I have a sample json record that I parsed with a json parser and saved it to expand the property tree to get all the key values ββof pair.ia in the following code. I can get the first attribute of the tree, but how to get the second attribute of value? when I try to get it, it shows me the exception: "There is no such node."
if I repeat the tree, then it shows me all the keys. I do not understand what is wrong with him. ref: http://www.boost.org/doc/libs/1_52_0/doc/html/boost_propertytree/accessing.html
json string := {"type":"net.aggregate","post.source":"1209010340", "val":1000}
code:
boost::property_tree::ptree pt; read_json("jSon string object", pt); cout << pt.get("type", ""); // working cout << pt.get("post.source", "") // showing error ....`
source share