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

redi Namespace Reference

All PStreams classes are declared in namespace redi. More...


Compounds

class  basic_ipstream
 Class template for Input PStreams. More...

class  basic_opstream
 Class template for Output PStreams. More...

class  basic_pstream
 Class template for Bidirectional PStreams. More...

class  basic_pstreambuf
 Class template for stream buffer. More...

class  basic_rpstream
 Class template for Restricted PStreams. More...

class  pstream_common
 Class template for common base class. More...

struct  pstreams
 Common base class providing constants and typenames. More...


Typedefs

typedef basic_pstreambuf<
char, std::char_traits< char > > 
pstreambuf
 Type definition for common template specialisation.

typedef basic_ipstream< char > ipstream
 Type definition for common template specialisation.

typedef basic_opstream< char > opstream
 Type definition for common template specialisation.

typedef basic_pstream< char > pstream
 Type definition for common template specialisation.

typedef basic_rpstream< char > rpstream
 Type definition for common template specialisation.


Functions

template<typename C, typename T> std::basic_ostream< C, T > & peof (std::basic_ostream< C, T > &s)
 Manipulator to close the pipe connected to the process' stdin.

void close_fd_array (int *filedes, size_t count)
 Helper function to close an array of file descriptors. Inspects each of the count file descriptors in the array filedes and calls close() if they have a non-negative value.


Detailed Description

All PStreams classes are declared in namespace redi.

Like the standard IOStreams, PStreams is a set of class templates, taking a character type and traits type. As with the standard streams they are most likely to be used with char and the default traits type, so typedefs for this most common case are provided.

The pstream_common class template is not intended to be used directly, it is used internally to provide the common functionality for the other stream classes.


Function Documentation

void close_fd_array int *  filedes,
size_t  count
[inline]
 

Helper function to close an array of file descriptors. Inspects each of the count file descriptors in the array filedes and calls close() if they have a non-negative value.

Parameters:
filedes an array of file descriptors
count size of the array.

template<typename C, typename T>
std::basic_ostream<C,T>& peof std::basic_ostream< C, T > &  s  ) 
 

Manipulator to close the pipe connected to the process' stdin.

When inserted into an ouput pstream the manipulator calls basic_pstreambuf<C,T>::peof() to close the output pipe, causing the child process to receive the End Of File indicator on subsequent reads from its stdin stream.

Parameters:
s An output PStream class.
Returns:
The stream object the manipulator was invoked on.
Warning:
The effect of this manipulator is undefined if it is used with a stream object for which std::basic_ios<C,T>::rdbuf() does not return a pointer to a pstreambuf. If unsure do not use this manipulator and call basic_pstreambuf<C,T>::peof() directly.
See also:
basic_pstreambuf<C,T>::peof(), basic_pstream<C,T>::rdbuf(), basic_ipstream<C,T>::rdbuf(), basic_opstream<C,T>::rdbuf().


Generated on Mon Jul 5 10:39:10 2004 for PStreams by doxygen 1.3.2