cxxtools::posix::Pipe Class Reference

#include <cxxtools/posix/pipe.h>

Inheritance diagram for cxxtools::posix::Pipe:
cxxtools::Pipe cxxtools::NonCopyable

Public Member Functions

 Pipe (OpenMode mode=Sync)
 Creates the pipe with two IODevices.
int getReadFd () const
 Endpoint of the pipe to read from.
int getWriteFd () const
void closeReadFd ()
void closeWriteFd ()
void redirectStdout (bool close=true, bool inherit=true)
 Redirect write-end to stdout.
void redirectStdin (bool close=true, bool inherit=true)
 Redirect read-end to stdin.
void redirectStderr (bool close=true, bool inherit=true)
 Redirect write-end to stdout.
size_t write (const char *buf, size_t count)
void write (char ch)
size_t read (char *buf, size_t count)
char read ()
- Public Member Functions inherited from cxxtools::Pipe
 ~Pipe ()
 Destructor.
IODeviceout ()
 Endpoint of the pipe to read from.
const IODeviceout () const
IODevicein ()
 Endpoint of the pipe to write to.
const IODevicein () const

Additional Inherited Members

- Public Types inherited from cxxtools::Pipe
typedef int OpenMode
- Static Public Attributes inherited from cxxtools::Pipe
static const int Sync = 0
static const int Async = 1
- Protected Member Functions inherited from cxxtools::Pipe
PipeImpl * impl ()
const PipeImpl * impl () const

Constructor & Destructor Documentation

cxxtools::posix::Pipe::Pipe ( OpenMode  mode = Sync)
inlineexplicit

Creates the pipe with two IODevices.

The default constructor will create the pipe and the appropriate IODevices to read and write to the pipe.

Reimplemented from cxxtools::Pipe.

Member Function Documentation

void cxxtools::posix::Pipe::closeReadFd ( )
inline
void cxxtools::posix::Pipe::closeWriteFd ( )
inline
int cxxtools::posix::Pipe::getReadFd ( ) const

Endpoint of the pipe to read from.

Returns
An IODevice used to read from the pipe
int cxxtools::posix::Pipe::getWriteFd ( ) const
size_t cxxtools::posix::Pipe::read ( char *  buf,
size_t  count 
)
inline

Reimplemented from cxxtools::Pipe.

char cxxtools::posix::Pipe::read ( )
inline

Reimplemented from cxxtools::Pipe.

void cxxtools::posix::Pipe::redirectStderr ( bool  close = true,
bool  inherit = true 
)

Redirect write-end to stdout.

When the close argument is set, closes the original filedescriptor

void cxxtools::posix::Pipe::redirectStdin ( bool  close = true,
bool  inherit = true 
)

Redirect read-end to stdin.

When the close argument is set, closes the original filedescriptor

void cxxtools::posix::Pipe::redirectStdout ( bool  close = true,
bool  inherit = true 
)

Redirect write-end to stdout.

When the close argument is set, closes the original filedescriptor

size_t cxxtools::posix::Pipe::write ( const char *  buf,
size_t  count 
)
inline

Reimplemented from cxxtools::Pipe.

void cxxtools::posix::Pipe::write ( char  ch)
inline

Reimplemented from cxxtools::Pipe.


The documentation for this class was generated from the following file:
  • include/cxxtools/posix/pipe.h