文件名称:
A tiny JSON library for C++11.
开发工具:
文件大小: 15kb
下载次数: 0
上传时间: 2016-10-10
详细说明:
json11 json11 is a tiny JSON library for C++11, providing JSON parsing and serialization. The core object provided by the library is json11::Json. A Json object represents any JSON value: null, bool, number (int or double), string (std::string), array (std::ve ctor), or object (std::map). Json objects act like values. They can be assigned, copied, moved, compared for equality or order, and so on. There are also helper methods Json::dump, to serialize a Json to a string, and Json::parse (static) to parse a std::string as a Json object. It's easy to make a JSON object with C++11's new initializer syntax: Json my_json = Json::object { { "key1", "value1" }, { "key2", false }, { "key3", Json::array { 1, 2, 3 } }, }; std::string json_str = my_json.dump(); There are also implicit constructors that allow standard and user-defined types to be automatically converted to JSON. For example: class Point { public: int x; int y; Point (int x, int y) : x(x), y(y) {} Json to_json() const { return Json::array { x, y }; } }; std::vector points = { { 1, 2 }, { 10, 20 }, { 100, 200 } }; std::string points_json = Json(points).dump(); JSON values can have their values queried and inspected: Json json = Json::array { Json::object { { "k", "v" } } }; std::string str = json[0]["k"].string_value(); More documentation is still to come. For now, see json11.hpp. ...展开收缩
(系统自动生成,下载前可以参看下载内容)
下载文件列表
相关说明
- 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
- 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。
- 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
- 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
- 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
- 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.