#include <CCData.h>
|
static const Data | Null |
| This parameter is defined for convenient reference if a null Data object is needed. More...
|
|
Copy constructor of Data.
Copy constructor of Data.
Clears data, free buffer and reset data size.
void copy |
( |
const unsigned char * |
bytes, |
|
|
const ssize_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
void fastSet |
( |
unsigned char * |
bytes, |
|
|
const ssize_t |
size |
|
) |
| |
Fast set the buffer pointer and its size.
Please use it carefully.
- Parameters
-
bytes | The buffer pointer, note that it have to be allocated by 'malloc' or 'calloc', since in the destructor of Data, the buffer will be deleted by 'free'. |
- Note
- 1. This method will move the ownship of 'bytes'pointer to Data,
- The pointer should not be used outside after it was passed to this method.
- See also
- Data::copy
unsigned char* getBytes |
( |
| ) |
const |
Gets internal bytes of Data.
It will retrun the pointer directly used in Data, so don't delete it.
- Returns
- Pointer of bytes used internal in Data.
Gets the size of the bytes.
- Returns
- The size of bytes of Data.
Check whether the data is null.
- Returns
- True if the the Data is null, false if not.
This parameter is defined for convenient reference if a null Data object is needed.
The documentation for this class was generated from the following file:
- /Users/minggo/SourceCode/cocos2d-x/cocos/base/CCData.h