I am using jsoncpp parser (http://jsoncpp.sourceforge.net) to parse JSON data. So, if we have the following JSON:
{ "name": "Joseph", "age": 20 }
How can I get the property name and value of Joseph, ... after age and 20? Well, we can do universally :
string e = root.get(propertyName, defaultValue).asString();
Put the real one that we want:
string e = root.get(name, "Mark").asString();
Now the variable e is Joseph, it works. But I have to take / write " name ". I don't want QUERY (without asking for the function that I want to get "name" (property name) and "Joseph" (property value)).
After it would be better to keep in the field (e.g. C / C ++):
property[name][0] = "Joseph" property[age][0] = 20
How can i do this? Or any other ideas?
source share