rutz::exec_pipe Class Reference

An exception-safe wrapper around a pipe-fork-exec sequence. More...

#include <rutz/pipe.h>

Collaboration diagram for rutz::exec_pipe:

Collaboration graph
[legend]

List of all members.

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.


Detailed Description

An exception-safe wrapper around a pipe-fork-exec sequence.

Definition at line 131 of file pipe.h.


Constructor & Destructor Documentation

rutz::exec_pipe::exec_pipe ( const char *  m,
char *const *  argv 
)

Set up a pipe to a child process with the given argv array.

The mode should be "r" if the parent is reading, and "w" if the parent is writing. NOTE that the argv array MUST be NULL-terminated!

Definition at line 225 of file pipe.cc.

rutz::exec_pipe::exec_pipe ( const char *  m,
const char *  argv0,
  ... 
)

Set up a pipe to a child process with the given list of args.

The mode should be "r" if the parent is reading, and "w" if the parent is writing. NOTE that the variable length argument list MUST NULL-terminated!

Definition at line 234 of file pipe.cc.


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

The software described here is Copyright (c) 1998-2005, Rob Peters.
This page was generated Wed Dec 3 06:56:44 2008 by Doxygen version 1.5.5.