#include <pfstreamBuf.h>
Public Types | |
enum | Direction { Input, Output } |
Public Member Functions | |
PipeStreamBuf (Direction) | |
virtual | ~PipeStreamBuf (void) |
void | flush () |
void | command (const string) |
Protected Member Functions | |
virtual int | overflow (int c) |
virtual int | sync (void) |
virtual int | underflow (void) |
Private Member Functions | |
void | init_pipe () |
Initializes whatever data structures store the child process information. | |
bool | is_open () const |
Returns true if the pipe has been opened, false otherwise. | |
bool | eof_pipe () const |
Returns true if there is an end-of-file condition on the input, or if the pipe was never opened. | |
bool | open_pipe (const string &cmd) |
Forks a child to run the indicated command, and according to the setting of _dir, binds either its input or output to this process for writing or reading. | |
void | close_pipe () |
Closes the pipe opened previously. | |
size_t | write_pipe (const char *data, size_t len) |
Writes the indicated data out to the child process opened previously. | |
size_t | read_pipe (char *data, size_t len) |
Reads the indicated amount of data from the child process opened previously. | |
void | write_chars (const char *, int, bool) |
Private Attributes | |
Direction | _dir |
string | _line_buffer |
FILE * | _pipe |
|
Definition at line 51 of file pfstreamBuf.h. |
|
Definition at line 25 of file pfstreamBuf.cxx. |
|
Definition at line 44 of file pfstreamBuf.cxx. |
|
Closes the pipe opened previously.
Definition at line 248 of file pfstreamBuf.cxx. |
|
Definition at line 59 of file pfstreamBuf.cxx. |
|
Returns true if there is an end-of-file condition on the input, or if the pipe was never opened.
Definition at line 210 of file pfstreamBuf.cxx. |
|
Definition at line 52 of file pfstreamBuf.cxx. |
|
Initializes whatever data structures store the child process information. This function is only called once at startup, by the constructor. Definition at line 180 of file pfstreamBuf.cxx. |
|
Returns true if the pipe has been opened, false otherwise.
Definition at line 195 of file pfstreamBuf.cxx. |
|
Forks a child to run the indicated command, and according to the setting of _dir, binds either its input or output to this process for writing or reading. Returns true on success, false on failure. Definition at line 233 of file pfstreamBuf.cxx. |
|
Definition at line 64 of file pfstreamBuf.cxx. References streamsize. |
|
Reads the indicated amount of data from the child process opened previously. Returns the number of bytes read. Definition at line 285 of file pfstreamBuf.cxx. |
|
Definition at line 80 of file pfstreamBuf.cxx. References streamsize. |
|
Definition at line 98 of file pfstreamBuf.cxx. |
|
Definition at line 136 of file pfstreamBuf.cxx. References _line_buffer. |
|
Writes the indicated data out to the child process opened previously. Returns the number of bytes read. Definition at line 266 of file pfstreamBuf.cxx. |
|
Definition at line 72 of file pfstreamBuf.h. Referenced by eof_pipe(). |
|
Definition at line 73 of file pfstreamBuf.h. Referenced by write_chars(). |
|
Definition at line 76 of file pfstreamBuf.h. Referenced by close_pipe(), eof_pipe(), init_pipe(), is_open(), and open_pipe(). |