例如:
{
"mydict": {
"inner dict": {
"val": 1,
"val2": 2
}
}
}
按下面这么获取即可:
const char json[] = "{\"mydict\": {\"inner dict\": {\"val\": 1, \"val2\": 2}}}";
Document doc, sub; // Null
doc.Parse(json);
sub.CopyFrom(doc["mydict"], doc.GetAllocator());
- 参考文献
https://stackoverflow.com/questions/44881239/convert-from-rapidjson-value-to-rapidjson-document