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'm changing all my code to move off the deprecated classes and methods (it is odd that they are not all marked with JSONCPP_DEPRECATED) and came across a change in the output when moving from FastWriter to StreamWriterBuilder. So it looks like setting the indentation to an empty string does most of compatibility but the commas in arrays still have spaces after them. I've patched my version but it would be nice to put this in the official distribution.
--- /Before/json_writer.cpp 2016-08-08 15:29:32.000 -0500
+++ /After/json_writer.cpp 2016-08-08 15:29:59.000 -0500
@@ -1002,7 +1002,7 @@
if (!indentation_.empty()) *sout_ << " ";
for (unsigned index = 0; index < size; ++index) {
if (index > 0)
- *sout_ << ", ";
+ *sout_ << ((!indentation_.empty()) ? ", " : ",");
*sout_ << childValues_[index];
}
if (!indentation_.empty()) *sout_ << " ";
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
I'm changing all my code to move off the deprecated classes and methods (it is odd that they are not all marked with JSONCPP_DEPRECATED) and came across a change in the output when moving from FastWriter to StreamWriterBuilder. So it looks like setting the indentation to an empty string does most of compatibility but the commas in arrays still have spaces after them. I've patched my version but it would be nice to put this in the official distribution.
The text was updated successfully, but these errors were encountered: