cocos2d-x  3.0-beta2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Data Class Reference

#include <CCData.h>

Public Member Functions

 Data ()
 Data ()
 Data ()
 Data (const Data &other)
 Data ( var other)
 Data ( local other)
 Data (Data &&other)
 Data ( var other)
 Data ( local other)
 ~Data ()
 ~Data ()
 ~Data ()
Dataoperator= (const Data &other)
var operator= ( var other)
local operator= ( local other)
Dataoperator= (Data &&other)
var operator= ( var other)
local operator= ( local other)
unsigned char * getBytes () const
ssize_t getSize () const
void copy (unsigned char *bytes, const ssize_t size)
 Copies the buffer pointer and its size. More...
 
var copy ( var bytes, var size)
 Copies the buffer pointer and its size. More...
 
local copy ( local bytes, local size)
 Copies the buffer pointer and its size. More...
 
void fastSet (unsigned char *bytes, const ssize_t size)
 Fast set the buffer pointer and its size. More...
 
void clear ()
 Clears data, free buffer and reset data size. More...
 
var clear ()
 Clears data, free buffer and reset data size. More...
 
local clear ()
 Clears data, free buffer and reset data size. More...
 
bool isNull () const
 Check whether the data is null. More...
 
var isNull ()
 Check whether the data is null. More...
 
local isNull ()
 Check whether the data is null. More...
 

Static Public Attributes

static const Data Null
var Null
local Null

Constructor & Destructor Documentation

Data ( )
var Data ( )
local Data ( )
Data ( const Data other)
var Data ( var  other)
local Data ( local  other)
Data ( Data &&  other)
var Data ( var  other)
local Data ( local  other)
~Data ( )
var ~Data ( )
local ~Data ( )

Member Function Documentation

void clear ( )

Clears data, free buffer and reset data size.

var clear ( )

Clears data, free buffer and reset data size.

local clear ( )

Clears data, free buffer and reset data size.

void copy ( 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
var copy ( var  bytes,
var  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
local copy ( local  bytes,
local  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
bytesThe 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,
  1. The pointer should not be used outside after it was passed to this method.
See Also
Data::copy
var fastSet ( var  bytes,
var  size 
)

Fast set the buffer pointer and its size.

Please use it carefully.

Parameters
bytesThe 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,
  1. The pointer should not be used outside after it was passed to this method.
See Also
Data::copy
local fastSet ( local  bytes,
local  size 
)

Fast set the buffer pointer and its size.

Please use it carefully.

Parameters
bytesThe 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,
  1. The pointer should not be used outside after it was passed to this method.
See Also
Data::copy
unsigned char* getBytes ( ) const
ssize_t getSize ( ) const
bool isNull ( ) const

Check whether the data is null.

var isNull ( )

Check whether the data is null.

local isNull ( )

Check whether the data is null.

Data& operator= ( const Data other)
Data& operator= ( var  other)
Data& operator= ( local  other)
Data& operator= ( Data &&  other)
Data& operator= ( var  other)
Data& operator= ( local  other)

Member Data Documentation

const Data Null
static
var Null
static
local Null
static

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