FBB::StdExtractor(3bobcat)
π FBB::StdExtractor π
okay bestie, welcome to FBB::StdExtractor π
β she lives in section 3bobcat, and her official vibe in the title is Executing Child Processes. Yeah. She spawns external programs and catches what they scream into standard error. Main character energy fr fr π
β¨ NAME β¨
FBB::StdExtractor β Runs external programs writing standard error π«Ά
πΈ SYNOPSIS πΈ
#include <bobcat/cerrextractor>
Linking option: -lbobcat
π¦ DESCRIPTION π¦
So the FBB::StdExtractor class is basically the basic interface for calling external programs β you know, child processes β and dealing with the standard output and standard error streams they write. The child processes' standard input streams are, by default, not handled by StdExtractor objects. Nope, not her job π
The child's standard output and standard error streams are read through the StdExtractor object: anything the child process writes to those streams gets extracted (or just read) from the StdExtractor object. Simple as that.
Heads up bestie: the PATH environment variable is not used when calling child processes. Child process programs must be specified using paths. No shortcuts, no searching, she needs the full address π
StdExtractor objects may repeatedly be used to execute the same child process, or a whole different one. Reuse is iconic, periodt β»οΈ
Now, the quoting lore π β arguments passed to child processes may be surrounded by double or single quotes:
- Arguments surrounded by double quotes have their double quotes removed, while interpreting any escape-sequences that may have been used within.
- Arguments surrounded by single quotes have their single quotes removed, while accepting their content as-is.
- Bonus: unquoted escape-sequences may also be specified, and those escape sequences are evaluated and replaced by their intended characters β for example,
\100is converted to@β¨
π NAMESPACE π
FBB
All constructors, members, operators and manipulators mentioned in this man-page are defined in the namespace FBB. π
π§ INHERITS FROM π§
FBB::Exec (private), FBB::IFdBuf (private), std::istream
π CONSTRUCTOR π
StdExtractor(size_t bufSize = 100)β you may pass abufSizeargument, and it defines the internal buffer size used by theStdExtractor's streambuf. By default the standard input stream is not handled. πCoutExtractor(Mode mode, size_t bufSize = 100)β themodeargument must beStdExtractor::CLOSE_STD. It indicates that the standard input stream is redirected to/dev/null: the child processes cannot read their standard input streams. And yep, abufSizeargument may be specified too β it defines the internal buffer size used by theCinInserter's streambuf.- Copy and move constructors (and assignment operators) are not available. She does not do duplicates, sorry π«
π MEMBERS π
void execute(std::string const &cmd)β the argument specifies the command to execute, and the command itself must be specified as a path (thePATHenvironment variable isn't used, as established). This member immediately returns, and after that, information written by the child process to its standard output and standard error streams may be extracted from theStdExtractorobject. πββοΈπ¨
Once execute has returned, it can be called again β either with the same command or another one. Round two, let's go π₯
Arguments passed to the program to be executed as child process may optionally be specified using single or double quotes, as described in this man-page's DESCRIPTION section. Same rules, same energy π
int ret() constβ onceexecutehas returned, this member provides the actual exit code of the child process. Its value equals-1before the firstexecutecall. So before you've done anything, she's at negative one, and that's just the lore π€·ββοΈ
π PROTECTED MEMBER π
Pipe &childOutPipe()β if derived classes need to override the redirections-members, then they probably need access to the pipe written by the child process. This member provides a reference to that pipe. By default the parent process reads information from the pipe, while the child process inserts its standard error output into the pipe. π€
β EXAMPLE β
#include <iostream>
#include <bobcat/cerrextractor>
using namespace std;
using namespace FBB;
int main()
{
CerrExtractor extractor;
extractor.execute("/bin/cat driver.cc");
cout << extractor.rdbuf();
cerr << "Returning: " << extractor.ret() << "\n"
"again:\n";
extractor.execute("/bin/cat driver.cc");
cout << extractor.rdbuf();
cerr << "Returning: " << extractor.ret() << β\nβ;
}
π FILES π
bobcat/cerrextractorβ provides the class interface
π SEE ALSO π
bobcat(7), cerrextractor(3bobcat), cininserter(3bobcat), coutextractor(3bobcat), execl(3), exec(3bobcat), fork(3bobcat), process(3bobcat).
Go read those too bestie, they're all connected π¦
π BUGS π
None reported. We love a clean record, no cap β¨
πΌ BOBCAT PROJECT FILES πΌ
https://fbb-git.gitlab.io/bobcat/β gitlab project page;
Debian Bobcat project files:
libbobcat6β debian package containing the shared library, changelog and copyright note;libbobcat-devβ debian package containing the static library, headers, manual pages, and developer info;
πΈ BOBCAT πΈ
Bobcat is an acronym of Brokken's Own Base Classes And Templates. Cute acronym, honestly obsessed π
π COPYRIGHT π
This is free software, distributed under the terms of the GNU General Public License (GPL). Free as in freedom, slay π
π AUTHOR π
Frank B. Brokken (f.b.brokken@rug.nl).
okay and that's the whole page bestie, you made it to the end π this was libbobcat-dev_6.15.01, dated 2005-2026, and yeah it's FBB::StdExtractor(3bobcat) β literally iconic, no notes πβ¨π
π¦ where this page comes from
- ubuntu stonking: libbobcat-dev 6.15.01-1 Β· GPL-3.0-or-later WITH OpenSSL exception
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms