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

PlainReader Class Reference

#include <PlainFile.h>

Inheritance diagram for PlainReader:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 PlainReader ()
virtual ~PlainReader ()
virtual int getByte ()=0
int getByte (unsigned char *dest)
int get2Bytes (unsigned char *dest)
int get3Bytes (unsigned char *dest)
int get4Bytes (unsigned char *dest)
int getByte (unsigned int &dest)
int get2Bytes (unsigned int &dest)
int get3Bytes (unsigned int &dest)
int get4Bytes (unsigned int &dest)
int addByte (unsigned int &dest)
int add2Bytes (unsigned int &dest)
int add3Bytes (unsigned int &dest)

Constructor & Destructor Documentation

PlainReader::PlainReader  ) 
 

The PlainReader initializes the internal data structures.

virtual PlainReader::~PlainReader  )  [virtual]
 

The buffer is released and all remaining bytes in the buffer are discarded.


Member Function Documentation

int PlainReader::add2Bytes unsigned int &  dest  ) 
 

Shift the content of the given integer left by 2 bytes. Read the first byte in the second-to-right byte of the integer, the second in the rightmost byte of the integer.

Parameters:
dest a reference of an unsigned integer
Returns:
0 in case of success or -1 in case of error.

int PlainReader::add3Bytes unsigned int &  dest  ) 
 

like add2Bytes()

Parameters:
dest a reference of an unsigned integer
Returns:
0 in case of success or -1 in case of error.

int PlainReader::addByte unsigned int &  dest  ) 
 

Shift the content of the given integer left by 1 byte. Copy 1 byte in the rightmost byte of the integer.

Parameters:
dest a reference of an unsigned integer
Returns:
a byte value in the range 0x00 - 0xff or -1 in case of error.

int PlainReader::get2Bytes unsigned int &  dest  ) 
 

The first read byte in the second-to-right byte of the integer, the second in the rightmost byte of the integer, where rightmost implies MSB for little endian machines and LSB for big endian machines (appropriate for bit operation mainly).

Parameters:
dest a reference of an unsigned integer
Returns:
0 in case of success or -1 in case of error.

int PlainReader::get2Bytes unsigned char *  dest  ) 
 

Stores, if successful, 2 bytes in the buffer

Parameters:
dest pointer to a character buffer of size 2
Returns:
0 in case of success or -1 in case of error.

int PlainReader::get3Bytes unsigned int &  dest  ) 
 

like get2Bytes()

Parameters:
dest a reference of an unsigned integer
Returns:
0 in case of success or -1 in case of error.

int PlainReader::get3Bytes unsigned char *  dest  ) 
 

Stores, if successful, 3 bytes in the buffer

Parameters:
dest pointer to a character buffer of size 3
Returns:
0 in case of success or -1 in case of error.

int PlainReader::get4Bytes unsigned int &  dest  ) 
 

like get2Bytes()

Parameters:
dest a reference of an unsigned integer
Returns:
0 in case of success or -1 in case of error.

int PlainReader::get4Bytes unsigned char *  dest  ) 
 

Stores, if successful, 4 bytes in the buffer

Parameters:
dest pointer to a character buffer of size 4
Returns:
0 in case of success or -1 in case of error.

int PlainReader::getByte unsigned int &  dest  ) 
 

Stores in the buffer 1 byte in the rightmost byte of the integer, where rightmost implies MSB for little endian machines and LSB for big endian machines (appropriate for bit operation mainly).

Parameters:
dest a reference of an unsigned integer
Returns:
a byte value in the range 0x00 - 0xff or -1 in case of error.

int PlainReader::getByte unsigned char *  dest  ) 
 

Stores, if successful, a byte in the buffer.

Parameters:
dest pointer to a character buffer of size 1
Returns:
a byte value in the range 0x00 - 0xff or -1 in case of error.

virtual int PlainReader::getByte  )  [pure virtual]
 

Get a single byte for processing.

Returns:
a byte value in the range 0x00 - 0xff or -1 in case of error.

Implemented in PlainFileReader, and PlainRopeReader.


The documentation for this class was generated from the following file:
Generated on Sun Mar 6 13:36:06 2005 for Komssys by doxygen 1.3.8