码迷,mamicode.com
首页 > Web开发 > 详细

JSON

时间:2016-05-17 17:50:44      阅读:215      评论:0      收藏:0      [点我收藏+]

标签:

//Test write json
    Json::Value rooter;
    Json::FastWriter w;
    rooter["isTest"] = false;
    rooter["isAndy"] = true;
    std:string json_string = w.write(rooter);

//Test parse json
    std::string json_string = #json.string#;
    Json::Reader r;
    Json::Value root;
    r.parse(json_string, root, true);
    string str_linus = root["str_linus"].asString();
    bool iscalliope = root["iscalliope"].asBool();

JSON

标签:

原文地址:http://www.cnblogs.com/awiki/p/5502076.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!