You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've had instances where I would like to first generate a JSON object in one function and then embed this into a array in another JSON object.
In such cases, I do something like:
dmlc::JSONWriterwriter(&os);
writer.BeginArray();
for (size_ti=0; i<dump.size(); ++i) {
if (i!=0) writer.WriteArraySeperator();
os << dump[i]; // Dump the previously generated JSON here
}
writer.EndArray();
But this means the indenting is not right anymore. Would be nice to be able to fix the indenting with:
dmlc::JSONWriterwriter(&os);
writer.BeginArray();
for (size_ti=0; i<dump.size(); ++i) {
if (i!=0) writer.WriteArraySeperator();
os << dmlc::JSONWriter.AddIndent(dump[i], 1); // Dump the previously generated JSON here
}
writer.EndArray();
or something similar
The text was updated successfully, but these errors were encountered:
I've had instances where I would like to first generate a JSON object in one function and then embed this into a array in another JSON object.
In such cases, I do something like:
But this means the indenting is not right anymore. Would be nice to be able to fix the indenting with:
or something similar
The text was updated successfully, but these errors were encountered: