#include <yateclass.h>
Inheritance diagram for Stream:
Public Member Functions | |
virtual | ~Stream () |
int | error () const |
virtual bool | terminate ()=0 |
virtual bool | canRetry () const |
virtual bool | valid () const=0 |
virtual bool | setBlocking (bool block=true) |
virtual int | writeData (const void *buffer, int length)=0 |
int | writeData (const char *str) |
int | writeData (const String &str) |
int | writeData (const DataBlock &buf) |
virtual int | readData (void *buffer, int length)=0 |
Static Public Member Functions | |
static bool | allocPipe (Stream *&reader, Stream *&writer) |
static bool | allocPair (Stream *&str1, Stream *&str2) |
static bool | supportsPipes () |
static bool | supportsPairs () |
Protected Member Functions | |
Stream () | |
void | clearError () |
Protected Attributes | |
int | m_error |
Base class for encapsulating system dependent stream capable objects
virtual ~Stream | ( | ) | [virtual] |
Destructor, terminates the stream
Stream | ( | ) | [inline, protected] |
Default constructor
int error | ( | ) | const [inline] |
Get the error code of the last operation on this stream
virtual bool terminate | ( | ) | [pure virtual] |
virtual bool canRetry | ( | ) | const [virtual] |
virtual bool valid | ( | ) | const [pure virtual] |
virtual bool setBlocking | ( | bool | block = true |
) | [virtual] |
virtual int writeData | ( | const void * | buffer, | |
int | length | |||
) | [pure virtual] |
int writeData | ( | const char * | str | ) |
Write a C string to a connected stream
str | String to send over the stream |
int writeData | ( | const String & | str | ) | [inline] |
int writeData | ( | const DataBlock & | buf | ) | [inline] |
Write a Data block to a connected stream
buf | DataBlock to send over the stream |
virtual int readData | ( | void * | buffer, | |
int | length | |||
) | [pure virtual] |
Allocate a new pair of unidirectionally pipe connected streams
reader | Reference of a pointer receiving the newly allocated reading side of the pipe | |
writer | Reference of a pointer receiving the newly allocated writing side of the pipe |
Allocate a new pair of bidirectionally connected streams
str1 | Reference of a pointer receiving the newly allocated 1st end of the pair | |
str2 | Reference of a pointer receiving the newly allocated 2nd end of the pair |
static bool supportsPipes | ( | ) | [static] |
Check if operating system supports unidirectional stream pairs
static bool supportsPairs | ( | ) | [static] |
Check if operating system supports bidirectional stream pairs
void clearError | ( | ) | [inline, protected] |
Clear the last error code