-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Description
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_ << " ";
Metadata
Metadata
Assignees
Labels
No labels