2013-05-29 08:06:41 +08:00
|
|
|
#include <string.h>
|
2012-09-17 14:27:17 +08:00
|
|
|
#include "CCData.h"
|
|
|
|
|
2013-05-29 08:06:41 +08:00
|
|
|
NS_CC_BEGIN
|
2012-09-17 14:27:17 +08:00
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
2013-05-29 08:06:41 +08:00
|
|
|
unsigned char* CCData::getBytes() const
|
2012-09-17 14:27:17 +08:00
|
|
|
{
|
|
|
|
return m_pBytes;
|
|
|
|
}
|
|
|
|
|
2013-05-29 08:06:41 +08:00
|
|
|
unsigned long CCData::getSize() const
|
2013-04-09 02:58:50 +08:00
|
|
|
{
|
|
|
|
return m_nSize;
|
|
|
|
}
|
|
|
|
|
2013-05-29 08:06:41 +08:00
|
|
|
NS_CC_END
|