Looking to rapidjson documentation this code is suggested to query an array:
for (Value::ConstValueIterator itr = a.Begin(); itr != a.End(); ++itr)
printf("%d ", itr->GetInt());
However, I have an array of arrays, something like:
[ [0,2], [1,2], [4, 5], ... ]
I would like to have some two-levels for for processing it, something like this:
for (Value::ConstValueIterator itr = a.Begin(); itr != a.End(); ++itr)
for (Value::ConstValueIterator itr2 = itr->GetArray().Begin(); itr2 != itr->GetArray().End(); ++itr2)
printf("%d ", itr2->GetInt());
However, it seems that itr
doesn't have any GetArray()
or equivalente method which returns an object in which get the second (inner) iterator.
NOTE: I have found this Q&A post, but it seems to be based in gettinig a Value
representing the internal array. However, I don't know how to get such value from the itr
iterator (e.g. itr->value
doesn't work).