Drag[en]gine Game Engine
1.21
|
File reader interface. More...
#include <decBaseFileReader.h>
Public Types | |
typedef deTObjectReference< decBaseFileReader > | Ref |
Type holding strong reference. More... | |
Public Types inherited from deObject | |
typedef deTObjectReference< deObject > | Ref |
Type holding strong reference. More... | |
Public Member Functions | |
Management | |
virtual const char * | GetFilename ()=0 |
Name of the file. More... | |
virtual int | GetLength ()=0 |
Length of the file. More... | |
virtual TIME_SYSTEM | GetModificationTime ()=0 |
Modification time. More... | |
virtual int | GetPosition ()=0 |
Current reading position in the file. More... | |
virtual void | SetPosition (int position)=0 |
Set file position for the next read action. More... | |
virtual void | MovePosition (int offset)=0 |
Move file position by the given offset. More... | |
virtual void | SetPositionEnd (int position)=0 |
Set file position to the given position measured from the end of the file. More... | |
virtual void | Read (void *buffer, int size)=0 |
Read size bytes into buffer and advances the file pointer. More... | |
virtual Ref | Duplicate ()=0 |
Duplicate file reader. More... | |
Helper Functions | |
bool | IsEOF () |
File pointer is at the end of the file. More... | |
int8_t | ReadChar () |
Read one byte and advances the file pointer. More... | |
uint8_t | ReadByte () |
Read one unsigned byte and advances the file pointer. More... | |
int16_t | ReadShort () |
Read one short integer (2 bytes) and advances the file pointer. More... | |
uint16_t | ReadUShort () |
Read one unsigned short integer (2 bytes) and advances the file pointer. More... | |
int32_t | ReadInt () |
Read one integer (4 bytes) and advances the file pointer. More... | |
uint32_t | ReadUInt () |
Read one unsigned integer (4 bytes) and advances the file pointer. More... | |
int64_t | ReadLong () |
Read one integer (8 bytes) and advances the file pointer. More... | |
uint64_t | ReadULong () |
Read one unsigned integer (8 bytes) and advances the file pointer. More... | |
float | ReadFloat () |
Read one float (4 bytes) and advances the file pointer. More... | |
double | ReadDouble () |
Read one double (8 bytes) and advances the file pointer. More... | |
decString | ReadString8 () |
Read a string prefixed by a 1-byte length field and advances the file pointer. More... | |
void | ReadString8Into (decString &string) |
Read string prefixed by a 1-byte length field and advances the file pointer. More... | |
decString | ReadString16 () |
Read a string prefixed by a 2-byte2 length field and advances the file pointer. More... | |
void | ReadString16Into (decString &string) |
Read string prefixed by a 2-byte2 length field and advances the file pointer. More... | |
decVector | ReadVector () |
Read a 3-float vector and advances the file pointer. More... | |
void | ReadVectorInto (decVector &vector) |
Read a 3-float vector and advances the file pointer. More... | |
decVector2 | ReadVector2 () |
Read a 2-float vector and advances the file pointer. More... | |
void | ReadVector2Into (decVector2 &vector) |
Read a 2-float vector and advances the file pointer. More... | |
decQuaternion | ReadQuaternion () |
Read a 4-float quaternion and advances the file pointer. More... | |
void | ReadQuaternionInto (decQuaternion &quaternion) |
Read a 4-float quaternion and advances the file pointer. More... | |
decPoint | ReadPoint () |
Read a 2-int point and advances the file pointer. More... | |
void | ReadPointInto (decPoint &point) |
Read a 2-int point and advances the file pointer. More... | |
decPoint3 | ReadPoint3 () |
Read a 3-int point and advances the file pointer. More... | |
void | ReadPoint3Into (decPoint3 &point) |
Read a 3-int point and advances the file pointer. More... | |
decDVector | ReadDVector () |
Read a 3-double vector and advances the file pointer. More... | |
void | ReadDVectorInto (decDVector &vector) |
Read a 3-double vector and advances the file pointer. More... | |
decColor | ReadColor () |
Read a 4-component color and advances the file pointer. More... | |
void | ReadColorInto (decColor &color) |
Read a 4-component color and advances the file pointer. More... | |
decColor | ReadColor3 () |
Read a 3-component color and advances the file pointer. More... | |
void | ReadColor3Into (decColor &color) |
Read a 3-component color and advances the file pointer. More... | |
void | SkipChar () |
Skip one byte and advances the file pointer. More... | |
void | SkipByte () |
Skip one unsigned byte and advances the file pointer. More... | |
void | SkipShort () |
Skip one short integer (2 bytes) and advances the file pointer. More... | |
void | SkipUShort () |
Skip one unsigned short integer (2 bytes) and advances the file pointer. More... | |
void | SkipInt () |
Skip one integer (4 bytes) and advances the file pointer. More... | |
void | SkipUInt () |
Skip one unsigned integer (4 bytes) and advances the file pointer. More... | |
void | SkipLong () |
Skip one integer (8 bytes) and advances the file pointer. More... | |
void | SkipULong () |
Skip one unsigned integer (8 bytes) and advances the file pointer. More... | |
void | SkipFloat () |
Skip one float (4 bytes) and advances the file pointer. More... | |
void | SkipDouble () |
Skip one double (8 bytes) and advances the file pointer. More... | |
void | SkipString8 () |
Skip a string prefixed by a 1-byte length field and advances the file pointer. More... | |
void | SkipString16 () |
Skip a string prefixed by a 2-byte2 length field and advances the file pointer. More... | |
void | SkipVector () |
Skip a 3-float vector and advances the file pointer. More... | |
void | SkipVector2 () |
Skip a 2-float vector and advances the file pointer. More... | |
void | SkipQuaternion () |
Skip a 4-float quaternion and advances the file pointer. More... | |
void | SkipPoint () |
Skip a 2-int point and advances the file pointer. More... | |
void | SkipPoint3 () |
Skip a 3-int point and advances the file pointer. More... | |
void | SkipDVector () |
Skip a 3-double vector and advances the file pointer. More... | |
void | SkipColor () |
Skip a 4-component color and advances the file pointer. More... | |
void | SkipColor3 () |
Skip a 3-component color and advances the file pointer. More... | |
Public Member Functions inherited from deObject | |
int | GetRefCount () const |
Reference count. More... | |
void | AddReference () |
Add reference increasing reference count by 1. More... | |
void | FreeReference () |
Decrease reference count by one and delete object if count reaches 0. More... | |
deObject () | |
Create object with reference count of 1. More... | |
Constructors and Destructors | |
decBaseFileReader () | |
Create file reader. More... | |
virtual | ~decBaseFileReader () |
Clean up file reader. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from deObject | |
virtual | ~deObject () |
Clean up object. More... | |
File reader interface.
Type holding strong reference.
decBaseFileReader::decBaseFileReader | ( | ) |
Create file reader.
|
protectedvirtual |
Clean up file reader.
|
pure virtual |
Duplicate file reader.
Implemented in deNetworkMessageReader, decZFileReader, decWeakFileReader, decMemoryFileReader, and decDiskFileReader.
|
pure virtual |
Name of the file.
Implemented in deNetworkMessageReader, decZFileReader, decWeakFileReader, decMemoryFileReader, and decDiskFileReader.
|
pure virtual |
Length of the file.
Implemented in deNetworkMessageReader, decZFileReader, decWeakFileReader, decMemoryFileReader, and decDiskFileReader.
|
pure virtual |
Modification time.
Implemented in deNetworkMessageReader, decZFileReader, decWeakFileReader, decMemoryFileReader, and decDiskFileReader.
|
pure virtual |
Current reading position in the file.
Implemented in deNetworkMessageReader, decZFileReader, decWeakFileReader, decMemoryFileReader, and decDiskFileReader.
bool decBaseFileReader::IsEOF | ( | ) |
File pointer is at the end of the file.
|
pure virtual |
Move file position by the given offset.
Implemented in deNetworkMessageReader, decZFileReader, decWeakFileReader, decMemoryFileReader, and decDiskFileReader.
|
pure virtual |
Read size bytes into buffer and advances the file pointer.
deeInvalidParam | buffer is NULL. |
deeInvalidParam | size is less than 1. |
Implemented in deNetworkMessageReader, decZFileReader, decWeakFileReader, decMemoryFileReader, and decDiskFileReader.
uint8_t decBaseFileReader::ReadByte | ( | ) |
Read one unsigned byte and advances the file pointer.
int8_t decBaseFileReader::ReadChar | ( | ) |
Read one byte and advances the file pointer.
decColor decBaseFileReader::ReadColor | ( | ) |
Read a 4-component color and advances the file pointer.
The color components are read in the order r, g, b and a.
decColor decBaseFileReader::ReadColor3 | ( | ) |
Read a 3-component color and advances the file pointer.
The color components are read in the order r, g and b.
void decBaseFileReader::ReadColor3Into | ( | decColor & | color | ) |
Read a 3-component color and advances the file pointer.
The color components are read in the order r, g and b.
void decBaseFileReader::ReadColorInto | ( | decColor & | color | ) |
Read a 4-component color and advances the file pointer.
The color components are read in the order r, g, b and a.
double decBaseFileReader::ReadDouble | ( | ) |
Read one double (8 bytes) and advances the file pointer.
decDVector decBaseFileReader::ReadDVector | ( | ) |
Read a 3-double vector and advances the file pointer.
The vector components are read in the order x, y and z.
void decBaseFileReader::ReadDVectorInto | ( | decDVector & | vector | ) |
Read a 3-double vector and advances the file pointer.
The vector components are read in the order x, y and z.
float decBaseFileReader::ReadFloat | ( | ) |
Read one float (4 bytes) and advances the file pointer.
int32_t decBaseFileReader::ReadInt | ( | ) |
Read one integer (4 bytes) and advances the file pointer.
int64_t decBaseFileReader::ReadLong | ( | ) |
Read one integer (8 bytes) and advances the file pointer.
decPoint decBaseFileReader::ReadPoint | ( | ) |
Read a 2-int point and advances the file pointer.
The point components are read in the order x and y.
decPoint3 decBaseFileReader::ReadPoint3 | ( | ) |
Read a 3-int point and advances the file pointer.
The point components are read in the order x, y and z.
void decBaseFileReader::ReadPoint3Into | ( | decPoint3 & | point | ) |
Read a 3-int point and advances the file pointer.
The point components are read in the order x, y and z.
void decBaseFileReader::ReadPointInto | ( | decPoint & | point | ) |
Read a 2-int point and advances the file pointer.
The point components are read in the order x and y.
decQuaternion decBaseFileReader::ReadQuaternion | ( | ) |
Read a 4-float quaternion and advances the file pointer.
The quaternion components are read in the order x, y, z and w.
void decBaseFileReader::ReadQuaternionInto | ( | decQuaternion & | quaternion | ) |
Read a 4-float quaternion and advances the file pointer.
The quaternion components are read in the order x, y, z and w.
int16_t decBaseFileReader::ReadShort | ( | ) |
Read one short integer (2 bytes) and advances the file pointer.
decString decBaseFileReader::ReadString16 | ( | ) |
Read a string prefixed by a 2-byte2 length field and advances the file pointer.
The returned string pointer has to be freed by the caller itself.
void decBaseFileReader::ReadString16Into | ( | decString & | string | ) |
Read string prefixed by a 2-byte2 length field and advances the file pointer.
decString decBaseFileReader::ReadString8 | ( | ) |
Read a string prefixed by a 1-byte length field and advances the file pointer.
The returned string pointer has to be freed by the caller itself.
void decBaseFileReader::ReadString8Into | ( | decString & | string | ) |
Read string prefixed by a 1-byte length field and advances the file pointer.
uint32_t decBaseFileReader::ReadUInt | ( | ) |
Read one unsigned integer (4 bytes) and advances the file pointer.
uint64_t decBaseFileReader::ReadULong | ( | ) |
Read one unsigned integer (8 bytes) and advances the file pointer.
uint16_t decBaseFileReader::ReadUShort | ( | ) |
Read one unsigned short integer (2 bytes) and advances the file pointer.
decVector decBaseFileReader::ReadVector | ( | ) |
Read a 3-float vector and advances the file pointer.
The vector components are read in the order x, y and z.
decVector2 decBaseFileReader::ReadVector2 | ( | ) |
Read a 2-float vector and advances the file pointer.
The vector components are read in the order x and y.
void decBaseFileReader::ReadVector2Into | ( | decVector2 & | vector | ) |
Read a 2-float vector and advances the file pointer.
The vector components are read in the order x and y.
void decBaseFileReader::ReadVectorInto | ( | decVector & | vector | ) |
Read a 3-float vector and advances the file pointer.
The vector components are read in the order x, y and z.
|
pure virtual |
Set file position for the next read action.
Implemented in deNetworkMessageReader, decZFileReader, decWeakFileReader, decMemoryFileReader, and decDiskFileReader.
|
pure virtual |
Set file position to the given position measured from the end of the file.
Implemented in deNetworkMessageReader, decZFileReader, decWeakFileReader, decMemoryFileReader, and decDiskFileReader.
void decBaseFileReader::SkipByte | ( | ) |
Skip one unsigned byte and advances the file pointer.
void decBaseFileReader::SkipChar | ( | ) |
Skip one byte and advances the file pointer.
void decBaseFileReader::SkipColor | ( | ) |
Skip a 4-component color and advances the file pointer.
void decBaseFileReader::SkipColor3 | ( | ) |
Skip a 3-component color and advances the file pointer.
void decBaseFileReader::SkipDouble | ( | ) |
Skip one double (8 bytes) and advances the file pointer.
void decBaseFileReader::SkipDVector | ( | ) |
Skip a 3-double vector and advances the file pointer.
void decBaseFileReader::SkipFloat | ( | ) |
Skip one float (4 bytes) and advances the file pointer.
void decBaseFileReader::SkipInt | ( | ) |
Skip one integer (4 bytes) and advances the file pointer.
void decBaseFileReader::SkipLong | ( | ) |
Skip one integer (8 bytes) and advances the file pointer.
void decBaseFileReader::SkipPoint | ( | ) |
Skip a 2-int point and advances the file pointer.
void decBaseFileReader::SkipPoint3 | ( | ) |
Skip a 3-int point and advances the file pointer.
void decBaseFileReader::SkipQuaternion | ( | ) |
Skip a 4-float quaternion and advances the file pointer.
void decBaseFileReader::SkipShort | ( | ) |
Skip one short integer (2 bytes) and advances the file pointer.
void decBaseFileReader::SkipString16 | ( | ) |
Skip a string prefixed by a 2-byte2 length field and advances the file pointer.
void decBaseFileReader::SkipString8 | ( | ) |
Skip a string prefixed by a 1-byte length field and advances the file pointer.
void decBaseFileReader::SkipUInt | ( | ) |
Skip one unsigned integer (4 bytes) and advances the file pointer.
void decBaseFileReader::SkipULong | ( | ) |
Skip one unsigned integer (8 bytes) and advances the file pointer.
void decBaseFileReader::SkipUShort | ( | ) |
Skip one unsigned short integer (2 bytes) and advances the file pointer.
void decBaseFileReader::SkipVector | ( | ) |
Skip a 3-float vector and advances the file pointer.
void decBaseFileReader::SkipVector2 | ( | ) |
Skip a 2-float vector and advances the file pointer.