FBB::CoutExtractor(3bobcat)

Executing Child Processes
(libbobcat-dev_6.04.00)

2005-2023

NAME

FBB::CoutExtractor - Runs external programs writing standard output

SYNOPSIS

#include <bobcat/coutextractor>
Linking option: -lbobcat

DESCRIPTION

The FBB::CoutExtractor class offers a basic interface for calling external programs (so-called child processes) writing their standard output streams. The standard input and standard error streams of the child processes by default are not handled by CoutExtractor objects. The child's standard output is read through the CoutExtractor object: information written by the child process to its standard output stream is extracted or read from CoutExtractor object. The PATH environment variable is not used when calling child processes: child process programs must be specified using paths.

CoutExtractor objects may repeatedly be used to execute the same or different child processes.

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. In addition unquoted escape-sequences may be specified: those escape sequences are evaluated and replaced by their intended characters (e.g., \100 is 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

Copy and move constructors (and assignment operators) are not available.

MEMBERS

PROTECTED MEMBER

EXAMPLE

#include <iostream>

#include <bobcat/coutextractor>

using namespace std;
using namespace FBB;

int main()
{
    CoutExtractor 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/coutextractor - provides the class interface

SEE ALSO

bobcat(7), cerrextractor(3bobcat), cininserter(3bobcat), execl(3), exec(3bobcat), fork(3bobcat), process(3bobcat), stdextractor(3bobcat).

BUGS

None reported.

BOBCAT PROJECT FILES

BOBCAT

Bobcat is an acronym of `Brokken's Own Base Classes And Templates'.

COPYRIGHT

This is free software, distributed under the terms of the GNU General Public License (GPL).

AUTHOR

Frank B. Brokken (f.b.brokken@rug.nl).