A lightweight wrapper for the JSON-C library that makes handling JSON a bit more developer friendly.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
JsonObject.cpp
JsonObject.h
LICENSE.md
README.md

README.md

JsonObject

A very lightweight wrapper to make working with the json-c library slightly more straightforward.

Instead of relying on json-c's json_object_object_foreach() and storing values as you loop through them, this wrapper will give you easy access to the values.

Example Usage

Sample JSON

{
  "aBool": true
}

Sample C++

#include <json/json.h>

JsonObject root;

json_object *config = json_tokener_parse(json.c_str());

JsonObject::buildObject(root, config);

bool myValue = root.getChild("aBool").getBool(); // true

License

MIT