#include <rpstream.h>
Inheritance diagram for redi::basic_rpstream< CharT, Traits >:
Public Member Functions | |
basic_rpstream () | |
Default constructor, creates an uninitialised stream. | |
basic_rpstream (const std::string &command, pmode mode=std::ios_base::in|std::ios_base::out) | |
Constructor that initialises the stream by starting a process. | |
basic_rpstream (const std::string &file, const std::vector< std::string > &argv, pmode mode=std::ios_base::in|std::ios_base::out) | |
Constructor that initialises the stream by starting a process. | |
~basic_rpstream () | |
Destructor. | |
void | open (const std::string &command, pmode mode=std::ios_base::in|std::ios_base::out) |
Start a process. | |
void | open (const std::string &file, const std::vector< std::string > &argv, pmode mode=std::ios_base::in|std::ios_base::out) |
Start a process. | |
istream_type & | out () |
Obtain a reference to the istream that reads the process' stderr . | |
istream_type & | err () |
Obtain a reference to the istream that reads the process' stderr . |
Writing to an rpstream opened with pmode
pstdin
writes to the standard input of the command. It is not possible to read directly from an rpstream object, to use an rpstream as in istream you must call either basic_rpstream::out() or basic_rpstream::err(). This is to prevent accidental reads from the wrong input source. If the rpstream was not opened with pmode
pstderr
then the class cannot read the process' stderr
, and basic_rpstream::err() will return an istream that reads from the process' stdout
, and vice versa. Reading from an rpstream opened with pmode
pstdout
and/or pstderr
reads the command's standard output and/or standard error. Any of the process' stdin
, stdout
or stderr
that is not connected to the pstream (as specified by the pmode
) will be the same as the process that created the pstream object, unless altered by the command itself.
|
Default constructor, creates an uninitialised stream. Creates an uninitialised stream. |
|
Constructor that initialises the stream by starting a process. Initialises the stream buffer by calling open() with the supplied arguments.
|
|
Constructor that initialises the stream by starting a process. Initialises the stream buffer by calling open() with the supplied arguments.
|
|
Obtain a reference to the istream that reads the process'
|
|
Start a process. Starts a new process by executing file with the arguments in argv and opens pipes to the process as given by mode.
Reimplemented from redi::pstream_common< CharT, Traits >. |
|
Start a process. Starts a new process by passing command to the shell and opens a pipe to the process with the specified mode.
Reimplemented from redi::pstream_common< CharT, Traits >. |
|
Obtain a reference to the istream that reads the process'
|