Inherited by redi::basic_ipstream< CharT, Traits >, redi::basic_opstream< CharT, Traits >, redi::basic_pstream< CharT, Traits >, and redi::basic_rpstream< CharT, Traits > [private].
Public Types
typedef std::ios_base::openmode pmode Type used to specify how to connect to the process.
typedef std::vector< std::string > argv_type Type used to hold the arguments for a command.
typedef int fd_type Type used for file descriptors.
Public Member Functions
void close ()
Close the pipe.
bool is_open () const
Report whether the stream's buffer has been initialised.
const std::string & command () const
Return the command used to initialise the stream. streambuf_type * rdbuf () const
Return a pointer to the stream buffer.
Static Public Attributes
static const pmodepstdin = std::ios_base::out
Write to stdin.
static const pmodepstdout = std::ios_base::in
Read from stdout.
static const pmodepstderr = std::ios_base::app
Read from stderr.
Abstract Base Class providing common functionality for basic_ipstream, basic_opstream and basic_pstream. pstream_common manages the basic_pstreambuf stream buffer that is used by the derived classes to initialise an IOStream class.
Constructor that initialises the stream by starting a process.
Initialises the stream buffer by calling do_open( file , argv , mode )
Parameters:
file a string containing the pathname of a program to execute.
argv a vector of argument strings passed to the new program.
mode the I/O mode to use when opening the pipe.
template<typename C, typename T> redi::pstream_common< C, T >::~pstream_common () [inline, protected, pure virtual]
Pure virtual destructor.
This is a pure virtual function to make pstream_common abstract. Because it is the destructor it will be called by derived classes and so must be defined. It is also protected, to discourage use of the PStreams classes through pointers or references to the base class.
Calls rdbuf()->open( file, argv, mode ) and sets failbit on error.
Parameters:
file a string containing the pathname of a program to execute.
argv a vector of argument strings passed to the new program.
mode the I/O mode to use when opening the pipe.