cxxtools::posix::CommandInput Class Reference

cxxtools::posix::CommandInput starts a process and the stdin is connected to the current process. More...

#include <cxxtools/posix/commandinput.h>

Public Member Functions

 CommandInput (const std::string &cmd, unsigned bufsize=8192)
void push_back (const std::string &arg)
void run ()
int wait (int options=0)
IODeviceout ()
void close ()

Detailed Description

cxxtools::posix::CommandInput starts a process and the stdin is connected to the current process.

The class is derived from std::ostream. You can use all methods provided from that class to send data to the stdin of the process.

Typical usage example:

grep.push_back("foo"); // add a parameter
grep.run(); // runs the process
grep << "foo" << std::endl; // this line is printed
grep << "bar" << std::endl; // this line is not printed
grep << "foobar" << std::endl; // this line is printed

Constructor & Destructor Documentation

cxxtools::posix::CommandInput::CommandInput ( const std::string &  cmd,
unsigned  bufsize = 8192 
)
inlineexplicit

Member Function Documentation

void cxxtools::posix::CommandInput::close ( )
inline
IODevice& cxxtools::posix::CommandInput::out ( )
inline
void cxxtools::posix::CommandInput::push_back ( const std::string &  arg)
inline
void cxxtools::posix::CommandInput::run ( )
int cxxtools::posix::CommandInput::wait ( int  options = 0)
inline

The documentation for this class was generated from the following file: