Drag[en]gine Game Engine  1.21
decBaseFileReader Class Referenceabstract

File reader interface. More...

#include <decBaseFileReader.h>

Inheritance diagram for decBaseFileReader:
deObject deNetworkMessageReader decDiskFileReader decMemoryFileReader decWeakFileReader decZFileReader

Public Types

typedef deTObjectReference< decBaseFileReaderRef
 Type holding strong reference. More...
 
- Public Types inherited from deObject
typedef deTObjectReference< deObjectRef
 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...
 

Detailed Description

File reader interface.

Member Typedef Documentation

◆ Ref

Type holding strong reference.

Constructor & Destructor Documentation

◆ decBaseFileReader()

decBaseFileReader::decBaseFileReader ( )

Create file reader.

◆ ~decBaseFileReader()

virtual decBaseFileReader::~decBaseFileReader ( )
protectedvirtual

Clean up file reader.

Note
Subclasses should set their destructor protected too to avoid users accidently deleting a reference counted object through the object pointer. Only FreeReference() is allowed to delete the object.

Member Function Documentation

◆ Duplicate()

virtual Ref decBaseFileReader::Duplicate ( )
pure virtual

◆ GetFilename()

virtual const char* decBaseFileReader::GetFilename ( )
pure virtual

◆ GetLength()

virtual int decBaseFileReader::GetLength ( )
pure virtual

◆ GetModificationTime()

virtual TIME_SYSTEM decBaseFileReader::GetModificationTime ( )
pure virtual

◆ GetPosition()

virtual int decBaseFileReader::GetPosition ( )
pure virtual

Current reading position in the file.

Implemented in deNetworkMessageReader, decZFileReader, decWeakFileReader, decMemoryFileReader, and decDiskFileReader.

◆ IsEOF()

bool decBaseFileReader::IsEOF ( )

File pointer is at the end of the file.

◆ MovePosition()

virtual void decBaseFileReader::MovePosition ( int  offset)
pure virtual

Move file position by the given offset.

Implemented in deNetworkMessageReader, decZFileReader, decWeakFileReader, decMemoryFileReader, and decDiskFileReader.

◆ Read()

virtual void decBaseFileReader::Read ( void *  buffer,
int  size 
)
pure virtual

Read size bytes into buffer and advances the file pointer.

Exceptions
deeInvalidParambuffer is NULL.
deeInvalidParamsize is less than 1.

Implemented in deNetworkMessageReader, decZFileReader, decWeakFileReader, decMemoryFileReader, and decDiskFileReader.

◆ ReadByte()

uint8_t decBaseFileReader::ReadByte ( )

Read one unsigned byte and advances the file pointer.

◆ ReadChar()

int8_t decBaseFileReader::ReadChar ( )

Read one byte and advances the file pointer.

◆ ReadColor()

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.

◆ ReadColor3()

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.

◆ ReadColor3Into()

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.

◆ ReadColorInto()

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.

◆ ReadDouble()

double decBaseFileReader::ReadDouble ( )

Read one double (8 bytes) and advances the file pointer.

◆ ReadDVector()

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.

◆ ReadDVectorInto()

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.

◆ ReadFloat()

float decBaseFileReader::ReadFloat ( )

Read one float (4 bytes) and advances the file pointer.

◆ ReadInt()

int32_t decBaseFileReader::ReadInt ( )

Read one integer (4 bytes) and advances the file pointer.

◆ ReadLong()

int64_t decBaseFileReader::ReadLong ( )

Read one integer (8 bytes) and advances the file pointer.

◆ ReadPoint()

decPoint decBaseFileReader::ReadPoint ( )

Read a 2-int point and advances the file pointer.

The point components are read in the order x and y.

◆ ReadPoint3()

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.

◆ ReadPoint3Into()

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.

◆ ReadPointInto()

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.

◆ ReadQuaternion()

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.

◆ ReadQuaternionInto()

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.

◆ ReadShort()

int16_t decBaseFileReader::ReadShort ( )

Read one short integer (2 bytes) and advances the file pointer.

◆ ReadString16()

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.

◆ ReadString16Into()

void decBaseFileReader::ReadString16Into ( decString string)

Read string prefixed by a 2-byte2 length field and advances the file pointer.

◆ ReadString8()

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.

◆ ReadString8Into()

void decBaseFileReader::ReadString8Into ( decString string)

Read string prefixed by a 1-byte length field and advances the file pointer.

◆ ReadUInt()

uint32_t decBaseFileReader::ReadUInt ( )

Read one unsigned integer (4 bytes) and advances the file pointer.

◆ ReadULong()

uint64_t decBaseFileReader::ReadULong ( )

Read one unsigned integer (8 bytes) and advances the file pointer.

◆ ReadUShort()

uint16_t decBaseFileReader::ReadUShort ( )

Read one unsigned short integer (2 bytes) and advances the file pointer.

◆ ReadVector()

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.

◆ ReadVector2()

decVector2 decBaseFileReader::ReadVector2 ( )

Read a 2-float vector and advances the file pointer.

The vector components are read in the order x and y.

◆ ReadVector2Into()

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.

◆ ReadVectorInto()

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.

◆ SetPosition()

virtual void decBaseFileReader::SetPosition ( int  position)
pure virtual

Set file position for the next read action.

Implemented in deNetworkMessageReader, decZFileReader, decWeakFileReader, decMemoryFileReader, and decDiskFileReader.

◆ SetPositionEnd()

virtual void decBaseFileReader::SetPositionEnd ( int  position)
pure virtual

Set file position to the given position measured from the end of the file.

Implemented in deNetworkMessageReader, decZFileReader, decWeakFileReader, decMemoryFileReader, and decDiskFileReader.

◆ SkipByte()

void decBaseFileReader::SkipByte ( )

Skip one unsigned byte and advances the file pointer.

◆ SkipChar()

void decBaseFileReader::SkipChar ( )

Skip one byte and advances the file pointer.

◆ SkipColor()

void decBaseFileReader::SkipColor ( )

Skip a 4-component color and advances the file pointer.

◆ SkipColor3()

void decBaseFileReader::SkipColor3 ( )

Skip a 3-component color and advances the file pointer.

◆ SkipDouble()

void decBaseFileReader::SkipDouble ( )

Skip one double (8 bytes) and advances the file pointer.

◆ SkipDVector()

void decBaseFileReader::SkipDVector ( )

Skip a 3-double vector and advances the file pointer.

◆ SkipFloat()

void decBaseFileReader::SkipFloat ( )

Skip one float (4 bytes) and advances the file pointer.

◆ SkipInt()

void decBaseFileReader::SkipInt ( )

Skip one integer (4 bytes) and advances the file pointer.

◆ SkipLong()

void decBaseFileReader::SkipLong ( )

Skip one integer (8 bytes) and advances the file pointer.

◆ SkipPoint()

void decBaseFileReader::SkipPoint ( )

Skip a 2-int point and advances the file pointer.

◆ SkipPoint3()

void decBaseFileReader::SkipPoint3 ( )

Skip a 3-int point and advances the file pointer.

◆ SkipQuaternion()

void decBaseFileReader::SkipQuaternion ( )

Skip a 4-float quaternion and advances the file pointer.

◆ SkipShort()

void decBaseFileReader::SkipShort ( )

Skip one short integer (2 bytes) and advances the file pointer.

◆ SkipString16()

void decBaseFileReader::SkipString16 ( )

Skip a string prefixed by a 2-byte2 length field and advances the file pointer.

◆ SkipString8()

void decBaseFileReader::SkipString8 ( )

Skip a string prefixed by a 1-byte length field and advances the file pointer.

◆ SkipUInt()

void decBaseFileReader::SkipUInt ( )

Skip one unsigned integer (4 bytes) and advances the file pointer.

◆ SkipULong()

void decBaseFileReader::SkipULong ( )

Skip one unsigned integer (8 bytes) and advances the file pointer.

◆ SkipUShort()

void decBaseFileReader::SkipUShort ( )

Skip one unsigned short integer (2 bytes) and advances the file pointer.

◆ SkipVector()

void decBaseFileReader::SkipVector ( )

Skip a 3-float vector and advances the file pointer.

◆ SkipVector2()

void decBaseFileReader::SkipVector2 ( )

Skip a 2-float vector and advances the file pointer.


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