Cocos2d-X 3.0 中自带了rapidjson,用于解析Json。
可以直接拿过来使用,只要引入头文件
#include "json/document.h"
char json[100] = "{"hello": "world"}";
rapidjson::Document d1;
d1.Parse<0>(json);
log("json1: %s", d1["hello"].GetString());
//2.从文件读取
std::string f……继续阅读 »
10年前 (2015-10-22) 2093浏览 0评论
1个赞