Main Page | Namespace List | Class Hierarchy | Compound List | File List | Namespace Members | Compound Members | File Members

redi::basic_opstream< CharT, Traits > Class Template Reference

Class template for Output PStreams. More...

#include <pstream.h>

Inheritance diagram for redi::basic_opstream< CharT, Traits >:

redi::pstream_common< CharT, Traits > redi::pstreams List of all members.

Public Types

typedef pbase_type::pmode pmode
 Type used to specify how to connect to the process.


Public Member Functions

 basic_opstream ()
 Default constructor, creates an uninitialised stream.

 basic_opstream (const std::string &command, pmode mode=std::ios_base::out)
 Constructor that initialises the stream by starting a process.

 basic_opstream (const std::string &file, const std::vector< std::string > &argv, pmode mode=std::ios_base::out)
 Constructor that initialises the stream by starting a process.

 ~basic_opstream ()
 Destructor.

void open (const std::string &command, pmode mode=std::ios_base::out)
 Start a process.

void open (const std::string &file, const std::vector< std::string > &argv, pmode mode=std::ios_base::out)
 Start a process.


Detailed Description

template<typename CharT, typename Traits = std::char_traits<CharT>>
class redi::basic_opstream< CharT, Traits >

Class template for Output PStreams.

Writing to an open opstream writes to the standard input of the command; the command's standard output is the same as that of the process that created the pstream object, unless altered by the command itself.


Constructor & Destructor Documentation

template<typename CharT, typename Traits = std::char_traits<CharT>>
redi::basic_opstream< CharT, Traits >::basic_opstream const std::string &  command,
pmode  mode = std::ios_base::out
[inline]
 

Constructor that initialises the stream by starting a process.

Initialises the stream buffer by calling open() with the supplied arguments.

Parameters:
command a string containing a shell command.
mode the I/O mode to use when opening the pipe.
See also:
open()

template<typename CharT, typename Traits = std::char_traits<CharT>>
redi::basic_opstream< CharT, Traits >::basic_opstream const std::string &  file,
const std::vector< std::string > &  argv,
pmode  mode = std::ios_base::out
[inline]
 

Constructor that initialises the stream by starting a process.

Initialises the stream buffer by calling open() with the supplied arguments.

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:
open()

template<typename CharT, typename Traits = std::char_traits<CharT>>
redi::basic_opstream< CharT, Traits >::~basic_opstream  )  [inline]
 

Destructor.

Closes the stream and waits for the child to exit.


Member Function Documentation

template<typename CharT, typename Traits = std::char_traits<CharT>>
void redi::basic_opstream< CharT, Traits >::open const std::string &  file,
const std::vector< std::string > &  argv,
pmode  mode = std::ios_base::out
[inline, virtual]
 

Start a process.

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:
pstream_common::open(const std::string&, const std::vector<std::string>&, pmode)

Reimplemented from redi::pstream_common< CharT, Traits >.

template<typename CharT, typename Traits = std::char_traits<CharT>>
void redi::basic_opstream< CharT, Traits >::open const std::string &  command,
pmode  mode = std::ios_base::out
[inline, virtual]
 

Start a process.

Parameters:
command a string containing a shell command.
mode the I/O mode to use when opening the pipe.
See also:
pstream_common::open(const std::string&, pmode)

Reimplemented from redi::pstream_common< CharT, Traits >.


The documentation for this class was generated from the following file:
Generated on Mon Jul 5 10:39:10 2004 for PStreams by doxygen 1.3.2