- Cal3D 0.11 API Reference - |
CalBufferSource class. More...
#include <buffersource.h>
Public Member Functions | |
CalBufferSource (void *inputBuffer) | |
Constructs a buffer source instance from an existing memory buffer. | |
virtual | ~CalBufferSource () |
Destruct the CalBufferSource. | |
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 memory buffer source. | |
virtual bool | readBytes (void *pBuffer, int length) |
Reads a number of bytes. | |
virtual bool | readFloat (float &value) |
Reads a float. | |
virtual bool | readInteger (int &value) |
Reads an integer. | |
virtual bool | readString (std::string &strValue) |
Reads a string. | |
Protected Attributes | |
void * | mInputBuffer |
unsigned int | mOffset |
CalBufferSource class.
This is an object designed to represent a source of Cal3d data as coming from a memory buffer.
CalBufferSource::CalBufferSource | ( | void * | inputBuffer | ) |
Constructs a buffer source instance from an existing memory buffer.
This function is the only constructor of the buffer source.
inputBuffer | The input buffer to read from |
CalBufferSource::~CalBufferSource | ( | ) | [virtual] |
Destruct the CalBufferSource.
Note that the memory is not deleted here; this should be handled externally.
bool CalBufferSource::ok | ( | ) | const [virtual] |
Checks whether the data source is in a good state.
This function checks if the buffer is NULL or not.
Implements CalDataSource.
bool CalBufferSource::readBytes | ( | void * | pBuffer, |
int | length | ||
) | [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.
bool CalBufferSource::readFloat | ( | float & | value | ) | [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.
bool CalBufferSource::readInteger | ( | int & | value | ) | [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.
bool CalBufferSource::readString | ( | std::string & | strValue | ) | [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.