I've seen some examples how to iterate thought nested JSON objects like:
"{ \"test\" : { \"property\" : \"value\" } }"
But now I need to iterate through a JSON array (the children array below):
"{ \"name\" : \"Franky\", \"children\" : [ \"Jonas\", \"Ellen\" ] }"
How can I achieve this?
I can't see anywhere an example or even on the POCO documentation.
I have this sample below, but can't get the array of children.
Poco::Dynamic::Var test = object->get("children");
Poco::JSON::Array::Ptr subObject = test.extract<Poco::JSON::Array::Ptr>();
for (it = subObject->begin(); it != subObject->end(); it++) // how to iterate here?
{
std::cout << "my children:" << it->first << "\n";
}