Drag[en]gine Game Engine  1.21
decMemoryFile Class Reference

Memory file. More...

#include <decMemoryFile.h>

Inheritance diagram for decMemoryFile:
deObject

Public Types

typedef deTObjectReference< decMemoryFileRef
 Type holding strong reference. More...
 
- Public Types inherited from deObject
typedef deTObjectReference< deObjectRef
 Type holding strong reference. More...
 

Public Member Functions

Management
const decStringGetFilename () const
 File path. More...
 
int GetLength () const
 Length of data. More...
 
TIME_SYSTEM GetModificationTime () const
 Modification time. More...
 
void SetModificationTime (TIME_SYSTEM time)
 Set modification time. More...
 
char * GetPointer () const
 Pointer to file data. More...
 
void Resize (int size, bool compact=true)
 Resize memory file data buffer. More...
 
void Touch ()
 Touch file setting the modification time to the current system time. 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

 decMemoryFile (const char *filename)
 Create memory file. More...
 
virtual ~decMemoryFile ()
 Clean up memory file. More...
 

Additional Inherited Members

- Protected Member Functions inherited from deObject
virtual ~deObject ()
 Clean up object. More...
 

Detailed Description

Memory file.

Member Typedef Documentation

◆ Ref

Type holding strong reference.

Constructor & Destructor Documentation

◆ decMemoryFile()

decMemoryFile::decMemoryFile ( const char *  filename)

Create memory file.

Exceptions
deeInvalidParamfilename is NULL.

◆ ~decMemoryFile()

virtual decMemoryFile::~decMemoryFile ( )
protectedvirtual

Clean up memory file.

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

◆ GetFilename()

const decString& decMemoryFile::GetFilename ( ) const
inline

File path.

◆ GetLength()

int decMemoryFile::GetLength ( ) const
inline

Length of data.

◆ GetModificationTime()

TIME_SYSTEM decMemoryFile::GetModificationTime ( ) const
inline

Modification time.

◆ GetPointer()

char* decMemoryFile::GetPointer ( ) const
inline

Pointer to file data.

◆ Resize()

void decMemoryFile::Resize ( int  size,
bool  compact = true 
)

Resize memory file data buffer.

If larger the additional data has undefined values.

Exceptions
deeInvalidParamsize is less than 0.

◆ SetModificationTime()

void decMemoryFile::SetModificationTime ( TIME_SYSTEM  time)

Set modification time.

◆ Touch()

void decMemoryFile::Touch ( )

Touch file setting the modification time to the current system time.


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