I'm 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 name and value Joseph, ... after age and 20? OK, we can do universally this:
string e = root.get(propertyName, defaultValue).asString();
But really what we want is something like this:
string e = root.get(name, "Mark").asString();
Now, variable e is Joseph, it works. But I have to take/write "name". I do not want to QUERY (without questioning the function I want to get "name" (name of property) and "Joseph" (value of property)).
After it would be best to store in a field (C/C++ for example):
property[name][0] = "Joseph"
property[age][0] = 20
How can I do that? Or any other ideas?