c@5: json11
c@5: ------
c@5: 
c@5: json11 is a tiny JSON library for C++11, providing JSON parsing and serialization.
c@5: 
c@5: The core object provided by the library is json11::Json. A Json object represents any JSON
c@5: value: null, bool, number (int or double), string (std::string), array (std::vector), or
c@5: object (std::map).
c@5: 
c@5: Json objects act like values. They can be assigned, copied, moved, compared for equality or
c@5: order, and so on. There are also helper methods Json::dump, to serialize a Json to a string, and
c@5: Json::parse (static) to parse a std::string as a Json object.
c@5: 
c@5: It's easy to make a JSON object with C++11's new initializer syntax:
c@5: 
c@5:     Json my_json = Json::object {
c@5:         { "key1", "value1" },
c@5:         { "key2", false },
c@5:         { "key3", Json::array { 1, 2, 3 } },
c@5:     };
c@5:     std::string json_str = my_json.dump();
c@5: 
c@5: There are also implicit constructors that allow standard and user-defined types to be
c@5: automatically converted to JSON. For example:
c@5: 
c@5:     class Point {
c@5:     public:
c@5:         int x;
c@5:         int y;
c@5:         Point (int x, int y) : x(x), y(y) {}
c@5:         Json to_json() const { return Json::array { x, y }; }
c@5:     };
c@5: 
c@5:     std::vector<Point> points = { { 1, 2 }, { 10, 20 }, { 100, 200 } };
c@5:     std::string points_json = Json(points).dump();
c@5: 
c@5: JSON values can have their values queried and inspected:
c@5: 
c@5:     Json json = Json::array { Json::object { { "k", "v" } } };
c@5:     std::string str = json[0]["k"].string_value();
c@5: 
c@5: More documentation is still to come. For now, see json11.hpp.