Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

rovsoft::io::BinaryIStreamer Class Reference

An implementation of IStreamer for reading from binary streams (little endian format). More...

#include <BinaryIStreamer.hh>

Inheritance diagram for rovsoft::io::BinaryIStreamer:

Inheritance graph
[legend]
Collaboration diagram for rovsoft::io::BinaryIStreamer:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 BinaryIStreamer (std::istream *in) throw (lib::NullPointerExceptionPtr)
 Builds a BinaryIStreamer getting its input from istream in.
virtual char readChar () throw (IOExceptionPtr)
virtual char readByte () throw (IOExceptionPtr)
 Reads a single byte.
virtual unsigned char readUByte () throw (IOExceptionPtr)
virtual short readShort () throw (IOExceptionPtr)
virtual unsigned short readUShort () throw (IOExceptionPtr)
virtual long readLong () throw (IOExceptionPtr)
virtual unsigned long readULong () throw (IOExceptionPtr)
virtual long long readLongLong () throw (IOExceptionPtr)
virtual unsigned long long readULongLong () throw (IOExceptionPtr)
virtual float readFloat () throw (IOExceptionPtr)
virtual double readDouble () throw (IOExceptionPtr)
virtual std::string readString () throw (IOExceptionPtr)
virtual std::string readString (int length) throw (IOExceptionPtr)
 Reads a string with fix length.
virtual bool endOfStream ()
 Test if we are at the end of a stream.
virtual ~BinaryIStreamer ()
 Deletes the istream object if input is not a null pointer.

Protected Member Functions

void readArrayfromStream (char *array, int length) throw (IOExceptionPtr)
 reads bytes into array using readByte() !! using Little Ending format !!

Protected Attributes

std::istream * input

Detailed Description

An implementation of IStreamer for reading from binary streams (little endian format).


Constructor & Destructor Documentation

rovsoft::io::BinaryIStreamer::BinaryIStreamer std::istream *  in  )  throw (lib::NullPointerExceptionPtr)
 

Builds a BinaryIStreamer getting its input from istream in.

This istream object to which in points to should be dynamically generated because it gets deleted in the destructor of this class.

Parameters:
in The istream to read from.
Exceptions:
NullPointerExceptionPtr if in is a null pointer.

rovsoft::io::BinaryIStreamer::~BinaryIStreamer  )  [virtual]
 

Deletes the istream object if input is not a null pointer.


Member Function Documentation

bool rovsoft::io::BinaryIStreamer::endOfStream  )  [virtual]
 

Test if we are at the end of a stream.

Returns:
true if the end is reached. (E.g. end of file)
Todo:
Make common base classes for ASCII IStreamer and Binary IStreamer and ASCII OStreamer and Binary OStreamer, that define an i/o stream and the method endOfStream().

Todo:
If we need something special for TCP I/O streams, then maybe extend ASCII IO Streamer for this functionality.
Maybe completely rework the hierarchie.

Implements rovsoft::io::IStreamer.

void rovsoft::io::BinaryIStreamer::readArrayfromStream char *  array,
int  length
throw (IOExceptionPtr) [protected]
 

reads bytes into array using readByte() !! using Little Ending format !!

char rovsoft::io::BinaryIStreamer::readByte  )  throw (IOExceptionPtr) [virtual]
 

Reads a single byte.

Implements rovsoft::io::IStreamer.

Reimplemented in rovsoft::io::BinaryLenSegmentIStreamer, and rovsoft::io::BinarySubstitutionIStreamer.

char rovsoft::io::BinaryIStreamer::readChar  )  throw (IOExceptionPtr) [virtual]
 

See also:
readByte() used by this method for reading. So for details of thrown exceptions, please see this method.

Implements rovsoft::io::IStreamer.

Reimplemented in rovsoft::io::BinaryLenSegmentIStreamer.

Here is the call graph for this function:

double rovsoft::io::BinaryIStreamer::readDouble  )  throw (IOExceptionPtr) [virtual]
 

See also:
readByte() used by this method for reading. So for details of thrown exceptions, please see this method.

Implements rovsoft::io::IStreamer.

Reimplemented in rovsoft::io::BinaryLenSegmentIStreamer.

Here is the call graph for this function:

float rovsoft::io::BinaryIStreamer::readFloat  )  throw (IOExceptionPtr) [virtual]
 

See also:
readByte() used by this method for reading. So for details of thrown exceptions, please see this method.

Implements rovsoft::io::IStreamer.

Reimplemented in rovsoft::io::BinaryLenSegmentIStreamer.

Here is the call graph for this function:

long rovsoft::io::BinaryIStreamer::readLong  )  throw (IOExceptionPtr) [virtual]
 

See also:
readByte() used by this method for reading. So for details of thrown exceptions, please see this method.

Implements rovsoft::io::IStreamer.

Reimplemented in rovsoft::io::BinaryLenSegmentIStreamer.

Here is the call graph for this function:

long long rovsoft::io::BinaryIStreamer::readLongLong  )  throw (IOExceptionPtr) [virtual]
 

See also:
readByte() used by this method for reading. So for details of thrown exceptions, please see this method.

Implements rovsoft::io::IStreamer.

Reimplemented in rovsoft::io::BinaryLenSegmentIStreamer.

Here is the call graph for this function:

short rovsoft::io::BinaryIStreamer::readShort  )  throw (IOExceptionPtr) [virtual]
 

See also:
readByte() used by this method for reading. So for details of thrown exceptions, please see this method.

Implements rovsoft::io::IStreamer.

Reimplemented in rovsoft::io::BinaryLenSegmentIStreamer.

Here is the call graph for this function:

std::string rovsoft::io::BinaryIStreamer::readString int  length  )  throw (IOExceptionPtr) [virtual]
 

Reads a string with fix length.

Parameters:
length the number of characters to read.

Implements rovsoft::io::IStreamer.

Reimplemented in rovsoft::io::BinaryLenSegmentIStreamer.

std::string rovsoft::io::BinaryIStreamer::readString  )  throw (IOExceptionPtr) [virtual]
 

Implements rovsoft::io::IStreamer.

Reimplemented in rovsoft::io::BinaryLenSegmentIStreamer.

Here is the call graph for this function:

unsigned char rovsoft::io::BinaryIStreamer::readUByte  )  throw (IOExceptionPtr) [virtual]
 

See also:
readByte() used by this method for reading. So for details of thrown exceptions, please see this method.

Implements rovsoft::io::IStreamer.

Reimplemented in rovsoft::io::BinaryLenSegmentIStreamer.

Here is the call graph for this function:

unsigned long rovsoft::io::BinaryIStreamer::readULong  )  throw (IOExceptionPtr) [virtual]
 

See also:
readByte() used by this method for reading. So for details of thrown exceptions, please see this method.

Implements rovsoft::io::IStreamer.

Reimplemented in rovsoft::io::BinaryLenSegmentIStreamer.

Here is the call graph for this function:

unsigned long long rovsoft::io::BinaryIStreamer::readULongLong  )  throw (IOExceptionPtr) [virtual]
 

See also:
readByte() used by this method for reading. So for details of thrown exceptions, please see this method.

Implements rovsoft::io::IStreamer.

Reimplemented in rovsoft::io::BinaryLenSegmentIStreamer.

Here is the call graph for this function:

unsigned short rovsoft::io::BinaryIStreamer::readUShort  )  throw (IOExceptionPtr) [virtual]
 

See also:
readByte() used by this method for reading. So for details of thrown exceptions, please see this method.

Implements rovsoft::io::IStreamer.

Reimplemented in rovsoft::io::BinaryLenSegmentIStreamer.

Here is the call graph for this function:


Member Data Documentation

std::istream* rovsoft::io::BinaryIStreamer::input [protected]
 


The documentation for this class was generated from the following files:
Generated on Tue May 31 14:19:26 2005 for Rovsoft by  doxygen 1.4.3