Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

ipstream Class Reference

The base class for reading (extracting) streamable objects from streams. More...

#include <tobjstrm.h>

Inheritance diagram for ipstream::

pstream ifpstream iopstream fpstream List of all members.

Public Methods

 ipstream (streambuf *buf)
 ~ipstream ()
streampos tellg ()
ipstream& seekg (streampos pos)
ipstream& seekg (streamoff off, ios::seek_dir dir)
uchar readByte ()
void readBytes (void *data, size_t sz)
ushort readWord ()
char* readString ()
char* readString (char *buf, unsigned maxLen)

Protected Methods

 ipstream ()
const TStreamableClassreadPrefix ()
void* readData (const TStreamableClass *c, TStreamable *mem)
void readSuffix ()
const void* find (P_id_type id)
void registerObject (const void *adr)

Friends

ipstream& operator>> (ipstream &, char &)
ipstream& operator>> (ipstream &, signed char &)
ipstream& operator>> (ipstream &, unsigned char &)
ipstream& operator>> (ipstream &, signed short &)
ipstream& operator>> (ipstream &, unsigned short &)
ipstream& operator>> (ipstream &, signed int &)
ipstream& operator>> (ipstream &, unsigned int &)
ipstream& operator>> (ipstream &, signed long &)
ipstream& operator>> (ipstream &, unsigned long &)
ipstream& operator>> (ipstream &, float &)
ipstream& operator>> (ipstream &, double &)
ipstream& operator>> (ipstream &, long double &)
ipstream& operator>> (ipstream &, TStreamable &)
ipstream& operator>> (ipstream &, void *&)

Detailed Description

ipstream, a specialized input stream derivative of pstream, is the base class for reading (extracting) streamable objects. ipstream is analogous to istream, defined in `iostream.h' for the standard C++ stream library. ipstream is a friend class of TPReadObjects.

The overloaded operators >> extract (read) from the given ipstream object to the given argument. A reference to the stream is returned, allowing you to chain >> operations in the usual way. The data type of the argument determines how the read is performed. For example, reading a signed char is implemented using readByte().

See also:
opstream

Definition at line 573 of file tobjstrm.h.


Constructor & Destructor Documentation

ipstream::ipstream ( streambuf * buf )
 

This form creates a buffered ipstream with the given buffer and sets the bp data member to `buf'. The state data member is set to 0.

ipstream::~ipstream ( )
 

Destroys the ipstream object.

ipstream::ipstream ( ) [protected]
 

This form does nothing.


Member Function Documentation

const void * ipstream::find ( P_id_type id ) [protected]
 

Returns a pointer to the object corresponding to `id'.

uchar ipstream::readByte ( )
 

Returns the character at the current stream position.

void ipstream::readBytes ( void * data,
size_t sz )
 

Reads `sz' bytes from current stream position, and writes them to the address given in `data'.

void * ipstream::readData ( const TStreamableClass * c,
TStreamable * mem ) [protected]
 

Invokes the appropriate read function to read from the stream to the object `mem'. If `mem' is 0, the appropriate build function is called first.

const TStreamableClass * ipstream::readPrefix ( ) [protected]
 

Returns the TStreamableClass object corresponding to the class name stored at the current position.

char * ipstream::readString ( char * buf,
unsigned maxLen )
 

Returns a string read from the current stream position.

char * ipstream::readString ( )
 

Returns a string read from the current stream position.

void ipstream::readSuffix ( ) [protected]
 

Reads and checks the final byte of an object's name field.

ushort ipstream::readWord ( )
 

Returns the word at the current stream position.

void ipstream::registerObject ( const void * adr ) [protected]
 

Registers the class of the object pointed by `adr'.

ipstream & ipstream::seekg ( streamoff off,
ios::seek_dir dir )
 

This form moves to a position relative to the current position by an offset `off' (+ or -) starting at `dir'. Parameter `dir' can be set to:

 beg (start of stream)

 cur (current stream position)

 end (end of stream)
 

ipstream & ipstream::seekg ( streampos pos )
 

This form moves the stream position to the absolute position given by `pos'.

streampos ipstream::tellg ( )
 

Returns the (absolute) current stream position.


Friends And Related Function Documentation

ipstream & operator>> ( ipstream &,
void *& ) [friend]
 

Undocumented.

ipstream & operator>> ( ipstream &,
TStreamable & ) [friend]
 

Undocumented.

ipstream & operator>> ( ipstream &,
long double & ) [friend]
 

Undocumented.

ipstream & operator>> ( ipstream &,
double & ) [friend]
 

Undocumented.

ipstream & operator>> ( ipstream &,
float & ) [friend]
 

Undocumented.

ipstream & operator>> ( ipstream &,
unsigned long & ) [friend]
 

Undocumented.

ipstream & operator>> ( ipstream &,
signed long & ) [friend]
 

Undocumented.

ipstream & operator>> ( ipstream &,
unsigned int & ) [friend]
 

Undocumented.

ipstream & operator>> ( ipstream &,
signed int & ) [friend]
 

Undocumented.

ipstream & operator>> ( ipstream &,
unsigned short & ) [friend]
 

Undocumented.

ipstream & operator>> ( ipstream &,
signed short & ) [friend]
 

Undocumented.

ipstream & operator>> ( ipstream &,
unsigned char & ) [friend]
 

Undocumented.

ipstream & operator>> ( ipstream &,
signed char & ) [friend]
 

Undocumented.

ipstream & operator>> ( ipstream &,
char & ) [friend]
 

Undocumented.


The documentation for this class was generated from the following file:
Generated at Sat Sep 22 20:19:27 2001 for TVision by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001