Class template for common base class.
More...
#include <pstream.h>
|
typedef int | fd_type |
| Type used for file descriptors.
|
|
|
static const pmode | pstdin = std::ios_base::out |
| Write to stdin.
|
|
static const pmode | pstdout = std::ios_base::in |
| Read from stdout.
|
|
static const pmode | pstderr = std::ios_base::app |
| Read from stderr.
|
|
static const pmode | newpg = std::ios_base::trunc |
| Create a new process group for the child process.
|
|
template<typename CharT, typename Traits = std::char_traits<CharT>>
class redi::pstream_common< CharT, Traits >
Class template for common base class.
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.
◆ pstream_common() [1/3]
template<typename C , typename T >
Default constructor.
Creates an uninitialised stream.
◆ pstream_common() [2/3]
template<typename C , typename T >
Constructor that initialises the stream by starting a process.
Initialises the stream buffer by calling do_open( command , mode )
- Parameters
-
cmd | a string containing a shell command. |
mode | the I/O mode to use when opening the pipe. |
- See also
- do_open(const std::string&, pmode)
◆ pstream_common() [3/3]
template<typename C , typename T >
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. |
- See also
- do_open(const std::string&, const argv_type&, pmode)
◆ ~pstream_common()
template<typename C , typename T >
|
inlineprotectedpure 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.
- See also
- If defining a pure virtual seems odd you should read http://www.gotw.ca/gotw/031.htm (and the rest of the site as well!)
◆ close()
template<typename C , typename T >
Close the pipe.
Calls rdbuf->close() and sets failbit
on error.
◆ command()
template<typename C , typename T >
Return the command used to initialise the stream.
- Returns
- a string containing the command used to initialise the stream.
◆ do_open() [1/2]
template<typename C , typename T >
◆ do_open() [2/2]
template<typename C , typename T >
◆ is_open()
template<typename C , typename T >
◆ rdbuf()
template<typename C , typename T >
Return a pointer to the stream buffer.
- Returns
- a pointer to the private stream buffer member.
The documentation for this class was generated from the following file: