Opened 9 years ago
Closed 8 years ago
#9765 closed Bugs (duplicate)
write_json(.., /*pretty=*/false) still outputs unnecessary spaces
Reported by: | Owned by: | Sebastian Redl | |
---|---|---|---|
Milestone: | To Be Determined | Component: | property_tree |
Version: | Boost 1.54.0 | Severity: | Problem |
Keywords: | Cc: |
Description
Using boost::property_tree::write_json(output, data, /*pretty=*/false); with an array in the data still outputs spaces before the ']'.
When you want to calculate HASH-es from JSON (and therefor do not want extra whitespaces in it) generated by different tools that is a problem.
Note:
See TracTickets
for help on using tickets.
See http://www.boost.org/doc/libs/1_55_0/boost/property_tree/detail/json_parser_write.hpp :
In function 'write_json_helper' please replace the line:
stream << Str(4 * indent, Ch(' ')) << Ch(']');
With the 2 lines:
if (pretty) stream << Str(4 * indent, Ch(' '));
stream << Ch(']');