Public Member Functions
imagen::iDataStream Class Reference

Abstract data stream. More...

#include <iDataStream.h>

Inheritance diagram for imagen::iDataStream:
imagen::iFileStream imagen::iMemoryStream

List of all members.

Public Member Functions

 iDataStream ()
 Constructor.
virtual ~iDataStream ()
 Destructor.
virtual bool close ()=0
 Closes the stream.
virtual long read (void *data, long size, long count)=0
 Reads data from the stream.
virtual long write (const void *data, long size, long count)=0
 Writes data to the stream.
virtual int getc ()=0
 Reads a character from the stream.
virtual int putc (int chr)=0
 Writes a character to the stream.
virtual bool flush ()=0
 Flushes the stream.
virtual long size () const =0
 Returns the size of the stream.
virtual long tell () const =0
 Returns the current value of the stream's position indicator.
virtual bool seek (long offset, iDataSeek origin)=0
 Sets the position of the stream's position indicator.
virtual bool atEnd () const =0
 Checks if the end of the stream has been reached.

Detailed Description

Abstract data stream.


Constructor & Destructor Documentation

Constructor.

virtual imagen::iDataStream::~iDataStream ( ) [inline, virtual]

Destructor.


Member Function Documentation

virtual bool imagen::iDataStream::close ( ) [pure virtual]

Closes the stream.

Returns:
True if the stream was closed successfully, else false.

Implemented in imagen::iMemoryStream, and imagen::iFileStream.

virtual long imagen::iDataStream::read ( void *  data,
long  size,
long  count 
) [pure virtual]

Reads data from the stream.

Parameters:
data: The array to place the read data into.
size: The size in bytes of each element to read.
count: The number of elements to read.
Returns:
The number of elements read.

Implemented in imagen::iMemoryStream, and imagen::iFileStream.

virtual long imagen::iDataStream::write ( const void *  data,
long  size,
long  count 
) [pure virtual]

Writes data to the stream.

Parameters:
data: The array of data to write.
size: The size in bytes of each element to write.
count: The number of elements to write.
Returns:
The number of elements written.

Implemented in imagen::iMemoryStream, and imagen::iFileStream.

virtual int imagen::iDataStream::getc ( ) [pure virtual]

Reads a character from the stream.

Returns:
If successful, the character read as an integer value, else 0.

Implemented in imagen::iMemoryStream, and imagen::iFileStream.

virtual int imagen::iDataStream::putc ( int  chr) [pure virtual]

Writes a character to the stream.

Returns:
If successful, the character that was written, else 0.

Implemented in imagen::iMemoryStream, and imagen::iFileStream.

virtual bool imagen::iDataStream::flush ( ) [pure virtual]

Flushes the stream.

Returns:
True if successful, else false.

Implemented in imagen::iMemoryStream, and imagen::iFileStream.

virtual long imagen::iDataStream::size ( ) const [pure virtual]

Returns the size of the stream.

Implemented in imagen::iMemoryStream, and imagen::iFileStream.

virtual long imagen::iDataStream::tell ( ) const [pure virtual]

Returns the current value of the stream's position indicator.

Implemented in imagen::iMemoryStream, and imagen::iFileStream.

virtual bool imagen::iDataStream::seek ( long  offset,
iDataSeek  origin 
) [pure virtual]

Sets the position of the stream's position indicator.

Parameters:
offset: The new position relative to origin
origin: The reference position to add offset to.
Returns:
True if successful, else false.

Implemented in imagen::iMemoryStream, and imagen::iFileStream.

virtual bool imagen::iDataStream::atEnd ( ) const [pure virtual]

Checks if the end of the stream has been reached.

Returns:
True if the end of the stream has been reached, else false.

Implemented in imagen::iMemoryStream, and imagen::iFileStream.


The documentation for this class was generated from the following file: