- Cal3D 0.11 API Reference -

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

CalBufferSource class. More...

#include <buffersource.h>

Inheritance diagram for CalBufferSource:
CalDataSource

Public Member Functions

 CalBufferSource (void *inputBuffer)
 Constructs a buffer source instance from an existing memory buffer. More...
 
virtual ~CalBufferSource ()
 Destruct the CalBufferSource. 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 memory buffer 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 readShort (short &value)
 Reads a short. More...
 
virtual bool readInteger (int &value)
 Reads an integer. More...
 
virtual bool readString (std::string &strValue)
 Reads a string. More...
 
- Public Member Functions inherited from CalDataSource
bool ok ()
 

Protected Attributes

void * mInputBuffer
 
unsigned int mOffset
 

Detailed Description

CalBufferSource class.

This is an object designed to represent a source of Cal3d data as coming from a memory buffer.

Constructor & Destructor Documentation

◆ CalBufferSource()

CalBufferSource::CalBufferSource ( void *  inputBuffer)

Constructs a buffer source instance from an existing memory buffer.

This function is the only constructor of the buffer source.

Parameters
inputBufferThe input buffer to read from

◆ ~CalBufferSource()

CalBufferSource::~CalBufferSource ( )
virtual

Destruct the CalBufferSource.

Note that the memory is not deleted here; this should be handled externally.

Member Function Documentation

◆ ok()

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.

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

◆ readBytes()

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.

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 happened

Implements CalDataSource.

◆ readFloat()

bool CalBufferSource::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 happened

Implements CalDataSource.

◆ readInteger()

bool CalBufferSource::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 happened

Implements CalDataSource.

◆ readShort()

bool CalBufferSource::readShort ( short &  value)
virtual

Reads a short.

This function reads a short from this data source.

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

Implements CalDataSource.

◆ readString()

bool CalBufferSource::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 happened

Implements CalDataSource.


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

Generated by The Cal3D Team with Doxygen 1.8.14