- Cal3D 0.11 API Reference -

Public Member Functions | Protected Attributes | List of all members
CalStreamSource Class Reference

CalStreamSource class. More...

#include <streamsource.h>

Inheritance diagram for CalStreamSource:
CalDataSource

Public Member Functions

 CalStreamSource (std::istream &inputStream)
 Constructs a stream source instance from an existing istream. More...
 
virtual ~CalStreamSource ()
 Destruct the CalStreamSource. More...
 
virtual bool ok () const
 Checks whether the data source is in a good state. More...
 
virtual void setError () const
 Sets the error code and message related to a streaming source.
 
virtual bool readBytes (void *pBuffer, int length)
 Reads a number of bytes. More...
 
virtual bool readFloat (float &value)
 Reads a float. More...
 
virtual bool readInteger (int &value)
 Reads an integer. More...
 
virtual bool readString (std::string &strValue)
 Reads a string. More...
 

Protected Attributes

std::istream * mInputStream
 

Detailed Description

CalStreamSource class.

This is an object designed to represent a source of Cal3d data as coming from a standard input stream.

Constructor & Destructor Documentation

CalStreamSource::CalStreamSource ( std::istream &  inputStream)

Constructs a stream source instance from an existing istream.

This function is the only constructor of the stream source.

Parameters
inputStreamThe input stream to use, which should be set up and ready to be read from before making the stream source.
CalStreamSource::~CalStreamSource ( )
virtual

Destruct the CalStreamSource.

Note that input stream is not closed here; this should be handled externally.

Member Function Documentation

bool CalStreamSource::ok ( ) const
virtual

Checks whether the data source is in a good state.

This function checks if the istream can be used.

Returns
One of the following values:
  • true if data source is in a good state
  • false if not

Implements CalDataSource.

bool CalStreamSource::readBytes ( void *  pBuffer,
int  length 
)
virtual

Reads a number of bytes.

This function reads a given number of bytes from this data source.

Parameters
pBufferA pointer to the buffer where the bytes are stored into.
lengthThe number of bytes that should be read.
Returns
One of the following values:
  • true if successful
  • false if an error happend

Implements CalDataSource.

bool CalStreamSource::readFloat ( float &  value)
virtual

Reads a float.

This function reads a float from this data source.

Parameters
valueA reference to the float into which the data is read.
Returns
One of the following values:
  • true if successful
  • false if an error happend

Implements CalDataSource.

bool CalStreamSource::readInteger ( int &  value)
virtual

Reads an integer.

This function reads an integer from this data source.

Parameters
valueA reference to the integer into which the data is read.
Returns
One of the following values:
  • true if successful
  • false if an error happend

Implements CalDataSource.

bool CalStreamSource::readString ( std::string &  strValue)
virtual

Reads a string.

This function reads a string from this data source.

Parameters
valueA reference to the string into which the data is read.
Returns
One of the following values:
  • true if successful
  • false if an error happend

Implements CalDataSource.


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

Generated at Wed Nov 26 2014 05:33:20 by The Cal3D Team with Doxygen 1.8.7