I am having trouble writing nested arrays back into the file. Rapidjson correctly reads the nested arrays but when trying to write it back to a file (even without any changes) the inner arrays do not get copied.
I use the following for writing to file:
//Convert it back to a string
rapidjson::StringBuffer str_buffer(0, 2048);
rapidjson::PrettyWriter<rapidjson::StringBuffer> writer(str_buffer);
s_LoadedDocument.Accept(writer);
std::string json(str_buffer.GetString(), str_buffer.GetSize());
// Write to file
std::ofstream out(s_documentPath);
out << json;
out.close();
This is what i am expecting to see in the json:
...
"animConfig": [[3, 3, 3, 3, 1, 0, 1, 1, 2]],
...
and this is what i get:
"animConfig": [[]],
This happens to all nested arrays in the json, not just to this one.
Hello,
I am having trouble writing nested arrays back into the file. Rapidjson correctly reads the nested arrays but when trying to write it back to a file (even without any changes) the inner arrays do not get copied.
I use the following for writing to file:
This is what i am expecting to see in the json: ... "animConfig": [[3, 3, 3, 3, 1, 0, 1, 1, 2]], ...
and this is what i get: "animConfig": [[]],
This happens to all nested arrays in the json, not just to this one.
What am i doing wrong?
Many thanks