Question about the behaviour of the json_io class
Hello everyone,
I have come across a behaviour which I did not expect.
Here a little bit of sampel code:
char jsonStringBuffer[256];
json_io jsonData(jsonStringBuffer);
word jsonBase = jsonData.add_object(JSON_ID_ROOT, 0);
// add string to the root object of the json
jsonData.add_string(jsonBase, "mt", "testevent");
// add a new object to the root object of the json
word objectBase = jsonData.add_object(jsonBase, "newObject") :
jsonData.add_string(objectBase, "data", "testData");
// add something in the root object again
jsonData.add_string(jsonBase, "test", "123456");
// this line will not work
jsonData.add_string(objectBase, "data2", "testData123123");
Why will the line with the comment "this line will not work" not be added to the json? I would have expected that this will work. But like I said this line will not add anything to the json. It even works fine without any error messages that there was done something wrong.
Regards,
Sascha