I have:
json_object *partialObjToSave = json_tokener_parse(json.c_str()); json_object *root = json_tokener_parse(__buffer.c_str());but dont work... the code will replace the obj with another obj.
json_object_object_add(root, id.c_str(), partialObjToSave);
I want this obj:
"myID2": {
"another": "another 1",
"another22": [ array ],
...
}
into this:
{
"myID1": {
"name": "my name 1",
"image": "my image 2"
},
"myID2": {
"name": "my name 1",
"image": "my name 2"
}
}
result:
{
"myID1": {
"name": "my name 1",
"image": "my image 2"
},
"myID2": {
"name": "my name 1",
"image": "my name 2"
"another": "another 1",
"another22": [ array ],
...
}
}