|
VR-Engage
2.2
|
This class reads and decodes various data types from a byte array, assuming the data in the byte stream is in little endian format. It provides methods for reading primitive types as well as common complex data structures.
#include <byteStream.h>
Public Member Functions | |
| DtStreamReader (unsigned char *buffer, int length, bool makeCopy=false) | |
| virtual | ~DtStreamReader () |
Value Reading Methods | |
Each method reads a value and advances the read position | |
| unsigned char * | myBuffer |
| unsigned char * | myReadHead |
| int | myLength |
| bool | myShouldDelete |
| virtual bool | readBool () |
| virtual char | readInt8 () |
| virtual unsigned char | readUInt8 () |
| virtual short | readInt16 () |
| virtual unsigned short | readUInt16 () |
| virtual int | readInt32 () |
| virtual unsigned | readUInt32 () |
| virtual long long | readInt64 () |
| virtual unsigned long long | readUInt64 () |
| virtual float | readSingle () |
| virtual double | readDouble () |
| virtual std::string | readString () |
| virtual DtVector | readVector () |
| virtual DtTaitBryan | readTaitBryan () |
| DtQuaternion | readQuaternion () |
| DtEntityIdentifier | readEntityId () |
| DtEntityType | readEntityType () |
| unsigned char * | readBytes (int length) |
| virtual void | readBytes (unsigned char *buffer, int length) |
| int | decodeStringSize () |
| makRadarFx::DtStreamReader::DtStreamReader | ( | unsigned char * | buffer, |
| int | length, | ||
| bool | makeCopy = false ) |
Constructor for stream reader.
| buffer | Pointer to the input byte array |
| length | Length of the input buffer in bytes |
| makeCopy | Whether to make a copy of the buffer (true) or use the original (false) |
Creates a new stream reader to work with the provided buffer
|
virtual |
Virtual destructor.
Cleans up resources, including the buffer if it was copied
|
virtual |
Reads a boolean value.
|
virtual |
Reads an 8-bit signed integer.
|
virtual |
Reads an 8-bit unsigned integer.
|
virtual |
Reads a 16-bit signed integer.
Reimplemented in makRadarFx::DtBigEndianStreamReader.
|
virtual |
Reads a 16-bit unsigned integer.
Reimplemented in makRadarFx::DtBigEndianStreamReader.
|
virtual |
Reads a 32-bit signed integer.
Reimplemented in makRadarFx::DtBigEndianStreamReader.
|
virtual |
Reads a 32-bit unsigned integer.
Reimplemented in makRadarFx::DtBigEndianStreamReader.
|
virtual |
Reads a 64-bit signed integer.
Reimplemented in makRadarFx::DtBigEndianStreamReader.
|
virtual |
Reads a 64-bit unsigned integer.
Reimplemented in makRadarFx::DtBigEndianStreamReader.
|
virtual |
Reads a 32-bit floating point value.
Reimplemented in makRadarFx::DtBigEndianStreamReader.
|
virtual |
Reads a 64-bit floating point value.
Reimplemented in makRadarFx::DtBigEndianStreamReader.
|
virtual |
Reads a string.
|
virtual |
Reads a 3D vector.
|
virtual |
Reads a Tait-Bryan angle set.
| DtQuaternion makRadarFx::DtStreamReader::readQuaternion | ( | ) |
Reads a quaternion.
| DtEntityIdentifier makRadarFx::DtStreamReader::readEntityId | ( | ) |
Reads an entity identifier.
| DtEntityType makRadarFx::DtStreamReader::readEntityType | ( | ) |
Reads an entity type.
| unsigned char * makRadarFx::DtStreamReader::readBytes | ( | int | length | ) |
Allocates and reads bytes into a new buffer.
| length | Number of bytes to read |
This method allocates a new byte array and copies data into it
|
virtual |
Reads bytes into a supplied buffer.
| buffer | Pointer to the destination buffer |
| length | Number of bytes to read |
This reads from the byte stream into a supplied buffer
|
protected |
Determines the size of a string from a variable length encoded integer.
|
protected |
Pointer to the beginning of the buffer.
|
protected |
Current read position within the buffer.
|
protected |
Total length of the buffer in bytes.
|
protected |
Flag indicating if the buffer should be deleted on destruction.