- Cal3D 0.11 API Reference - |
CalStreamSource class. More...
#include <streamsource.h>
Public Member Functions | |
CalStreamSource (std::istream &inputStream) | |
Constructs a stream source instance from an existing istream. | |
virtual | ~CalStreamSource () |
Destruct the CalStreamSource. | |
virtual bool | ok () const |
Checks whether the data source is in a good state. | |
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. | |
virtual bool | readFloat (float &value) |
Reads a float. | |
virtual bool | readShort (short &value) |
Reads a short. | |
virtual bool | readInteger (int &value) |
Reads an integer. | |
virtual bool | readString (std::string &strValue) |
Reads a string. | |
![]() | |
bool | ok () |
Protected Attributes | |
std::istream * | mInputStream |
CalStreamSource class.
This is an object designed to represent a source of Cal3d data as coming from a standard input stream.
CalStreamSource::CalStreamSource | ( | std::istream & | inputStream | ) |
Constructs a stream source instance from an existing istream.
This function is the only constructor of the stream source.
inputStream | The input stream to use, which should be set up and ready to be read from before making the stream source. |
|
virtual |
Destruct the CalStreamSource.
Note that input stream is not closed here; this should be handled externally.
|
virtual |
Checks whether the data source is in a good state.
This function checks if the istream can be used.
|
virtual |
Reads a number of bytes.
This function reads a given number of bytes from this data source.
pBuffer | A pointer to the buffer where the bytes are stored into. |
length | The number of bytes that should be read. |
Implements CalDataSource.
|
virtual |
Reads a float.
This function reads a float from this data source.
value | A reference to the float into which the data is read. |
Implements CalDataSource.
|
virtual |
Reads an integer.
This function reads an integer from this data source.
value | A reference to the integer into which the data is read. |
Implements CalDataSource.
|
virtual |
Reads a short.
This function reads a short from this data source.
value | A reference to the short into which the data is read. |
Implements CalDataSource.
|
virtual |
Reads a string.
This function reads a string from this data source.
value | A reference to the string into which the data is read. |
Implements CalDataSource.
|
virtual |
Sets the error code and message related to a streaming source.
Implements CalDataSource.