Google

C++ Portable Types Library (PTypes) Version 1.7


Top: Streams

The stream input/output module, which is an integral part of PTypes, declares a family of classes that implement abstract functionality of stream-oriented data processing. The main features of this module include:

  • Text processing utilities, such like token extraction using character sets.
  • Buffering: both input and output streams can be buffered to speed up operation.
  • Scalability: the functionality of either input or output streams can be overridden by providing several low-level routines for the given device or communication protocol.
  • System-independent error handling: regardless of the system on which the library is compiled, the error codes are presented in UNIX "errno" semantics.

The basic class iobase encapsulates features common to both input and output, such like buffering, event and error handling, etc. This class is derived from component. Two descendant classes -- instm and outstm -- specialize in data input and output respectively, as well as provide simple and powerful text processing utility methods.

PTypes declares three built-in objects for standard input, output and error devices.

All recoverable error conditions generate exceptions of class (estream*). See Error handling for details.

Some encapsulated structure fields in this module are accessed through get_X() and set_X() function pairs. To simplify documentation, we use a single description in the form get/set_X() for such fields, and sometimes we refer to them as properties.

The stream i/o class family is declared in <pstreams.h>.

See also: Networking


PTypes home