cocos2d-x 读取沙盒文件的方法
来源:未知 责任编辑:智问网络 发表时间:2013-11-08 08:44 点击:次
std::string fullPath = CCFileUtils::fullPathFromRelativePath("find.txt");
unsigned char* pBuffer = NULL;
unsigned long bufferSize = 0;
pBuffer = CCFileUtils::getFileData(fullPath.c_str(), "r", &bufferSize);
CCLog("%ld",bufferSize);
for (int i = 0; i < bufferSize; ++i)
{
CCLog("%c",pBuffer[i]);
}
if (pBuffer)
{
delete [] pBuffer;
pBuffer = NULL;
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>