2012-09-17 14:27:17 +08:00
|
|
|
#include "CCData.h"
|
|
|
|
|
|
|
|
NS_CC_EXT_BEGIN
|
|
|
|
|
|
|
|
CCData::CCData(unsigned char *pBytes, const unsigned long nSize)
|
2012-11-26 21:51:05 +08:00
|
|
|
{
|
|
|
|
m_nSize = nSize;
|
|
|
|
m_pBytes = new unsigned char[m_nSize];
|
|
|
|
memcpy(m_pBytes, pBytes, m_nSize);
|
|
|
|
}
|
2012-09-17 14:27:17 +08:00
|
|
|
|
|
|
|
CCData::CCData(CCData *pData)
|
|
|
|
{
|
|
|
|
m_nSize = pData->m_nSize;
|
|
|
|
m_pBytes = new unsigned char[m_nSize];
|
|
|
|
memcpy(m_pBytes, pData->m_pBytes, m_nSize);
|
|
|
|
}
|
|
|
|
|
|
|
|
CCData::~CCData()
|
|
|
|
{
|
|
|
|
CC_SAFE_DELETE_ARRAY(m_pBytes);
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned char* CCData::getBytes()
|
|
|
|
{
|
|
|
|
return m_pBytes;
|
|
|
|
}
|
|
|
|
|
2013-04-09 18:08:43 +08:00
|
|
|
unsigned long CCData::getSize()
|
2013-04-09 02:58:50 +08:00
|
|
|
{
|
|
|
|
return m_nSize;
|
|
|
|
}
|
|
|
|
|
2012-09-17 14:27:17 +08:00
|
|
|
NS_CC_EXT_END
|