// cocos2dx 读取Resource下的json文件
unsigned long ilength;
string pathKey = CCFileUtils::sharedFileUtils()->fullPathFromRelativePath("test.json");
char* pBuffer = (char*)CCFileUtils::sharedFileUtils()->getFileData(pathKey.c_str(), "r", &ilength);
// CCLOG("Qiang-pBytes:%s",pBuffer);
string sValue = pBuffer;
Json::Value json;
Json::Reader reader;
if(!reader.parse(sValue, json))
{
CCLOG("it's fail");
}
else
{
CCLOG("json:%s",json.toStyledString().c_str());
}