How do I traverse a json object and add new elements into the hierarchy #1834
Labels
kind: question
state: stale
the issue has not been updated in a while and will be closed automatically soon unless it is updated
** - Describe what you want to achieve. **
I want to generate a JSON object that has hierarchy. Something like this:
I want to create this on the fly as I'm traversing another data structure. But I don't know how to traverse to arbitrary locations in a json object.
** - Describe what you tried. **
I've tried this:
where userdata_jptr is a pointer to the json object I'm trying to construct.
But when I try to compile this code I get errors like this:
What is the right iterator type to use when I want something that will point to the location in the json object to which I want to make changes (just adding things at this point).
Or in general what is the right method to traverse to a certain location in a json object, and then use whatever mechanism was used to iterate to that location and make in-place changes?
** - Describe which system (OS, compiler) you are using. **
Linux <machine name> 5.2.14-1-default #1 SMP Tue Sep 10 10:52:01 UTC 2019 (374b0ae) x86_64 x86_64 x86_64 GNU/Linux
Version 3.7.0.1-1
Thanks
The text was updated successfully, but these errors were encountered: