An exception-safe wrapper around a pipe-fork-exec sequence. More...
#include <rutz/pipe.h>
Public Member Functions | |
exec_pipe (const char *m, char *const *argv) | |
Set up a pipe to a child process with the given argv array. | |
exec_pipe (const char *m, const char *argv0,...) | |
Set up a pipe to a child process with the given list of args. | |
~exec_pipe () throw () | |
Destructor cleans up child process and the pipe's file descriptors. | |
std::iostream & | stream () throw () |
Get the stream that is linked to the child process. | |
void | close () |
Close the underlying stream AND the underlying file descriptor. | |
int | exit_status () throw () |
Wait for child process to complete, return 0 if all is OK, -1 if error. |
An exception-safe wrapper around a pipe-fork-exec sequence.
Definition at line 131 of file pipe.h.
rutz::exec_pipe::exec_pipe | ( | const char * | m, | |
char *const * | argv | |||
) |
rutz::exec_pipe::exec_pipe | ( | const char * | m, | |
const char * | argv0, | |||
... | ||||
) |
rutz::exec_pipe::~exec_pipe | ( | ) | throw () |
void rutz::exec_pipe::close | ( | void | ) |
Close the underlying stream AND the underlying file descriptor.
Definition at line 262 of file pipe.cc.
References rutz::stdiostream::close().
int rutz::exec_pipe::exit_status | ( | ) | throw () |
Wait for child process to complete, return 0 if all is OK, -1 if error.
Definition at line 272 of file pipe.cc.
References rutz::child_process::wait().
std::iostream & rutz::exec_pipe::stream | ( | ) | throw () |