My Project
Public Member Functions | Static Public Attributes | List of all members
ParaEngine::FileData Class Reference

Public Member Functions

 FileData (const FileData &other)
 
 FileData (FileData &&other)
 
FileDataoperator= (const FileData &other)
 
FileDataoperator= (FileData &&other)
 
char * GetBytes () const
 
size_t GetSize () const
 
void copy (char *bytes, const size_t size)
 Copies the buffer pointer and its size. More...
 
void SetOwnBuffer (char *bytes, const size_t size)
 take ownership of the buffer. More...
 
void ReleaseOwnership ()
 
void Clear ()
 Clears data, free buffer and reset data size.
 
bool isNull () const
 Check whether the data is null. More...
 

Static Public Attributes

static const FileData Null
 

Member Function Documentation

§ copy()

void FileData::copy ( char *  bytes,
const size_t  size 
)

Copies the buffer pointer and its size.

Note
This method will copy the whole buffer. Developer should free the pointer after invoking this method.
See also
Data::fastSet

§ isNull()

bool FileData::isNull ( ) const

Check whether the data is null.

§ SetOwnBuffer()

void FileData::SetOwnBuffer ( char *  bytes,
const size_t  size 
)

take ownership of the buffer.

Please use it carefully.

Parameters
bytesThe buffer pointer, note that it have to be allocated by new method, since in the destructor of Data, the buffer will be deleted by 'free'.
Note
1. This method will move the ownership of bytes' pointer to Data,
  1. The pointer should not be used outside after it was passed to this method.

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