I'm trying to extract the key and the value of an object in array but don't find the proper getter:
for (Value::ConstValueIterator itr = document["params"].Begin(); itr != document["params"].End(); ++itr)
{
for (Value::MemberIterator m = itr->MemberBegin(); m != itr->.MemberEnd(); ++m) {
}
}
in the second loop, I want to extract the key and value from the iterator separately. how to do the extraction?
Suppose V is a JSON object which has key-value object. You can retrieve data like this.
m
isMember*
, where Member isThus the proper getter for the key is
m->name
.That much is obvious from "rapidjson/document.h". I can't test it further without a self-contained example (https://stackoverflow.com/help/mcve, http://www.sscce.org/).