I have a file containing some JSON content that looks like:
{
"frame":
{
"id": "0",
"points":
[
[ "0.883", "0.553", "0" ],
[ "0.441", "0.889", "0" ],
]
},
"frame":
...
}
How do I parse the values of the double array using C++ and Boost ptree?
Use the iterators, Luke.
First , you have to parse the file:
... now, because it seems you have multiple "frame" keys in the top level dictionary you must iterate over them:
Iterating over the rows and columns is the same:
I didn't test the code, but the idea will work :-)