A JSON parser implementation in C.
Given a json file test_1.json
{
"result": {
"name":"value",
"list":[
"one",
"two"
]
}
}
The following is an example on how to access name
and iterate the inner list
array
Json *json = Json_parseFile("test_1.json");
JsonObject *result = Json_getObject(json, "result");
char *name = JsonObject_getString(result, "name");
JsonArray *list = JsonObject_getArray(result, "list");
int index;
for (index = 0; index < list->items->size; index++) {
char *item = JsonArray_getString(list, index);
}
Json_destroy(json);
- Boolean values.
- String and number encoding.
- Serialization.
- Error handling.
- Refactor API, reduce verbosity.