Opened 9 years ago

Closed 8 years ago

#9782 closed Bugs (duplicate)

boost::property_tree::write_json always pretty prints ] when encoding arrays

Reported by: fisher Owned by: Sebastian Redl
Milestone: To Be Determined Component: property_tree
Version: Boost 1.55.0 Severity: Problem
Keywords: Cc:

Description

generally the result is unnecessary white space in the resulting json string

this can be resolved by changing line 96 of 'boost\property_tree\detail\json_parser_write.hpp' from

            stream << Str(4 * indent, Ch(' ')) << Ch(']');

to

            if (pretty) stream << Str(4 * indent, Ch(' '));
            stream << Ch(']');

which is consistent in style and functionality with lines 120 and 121 of the same file

Change History (1)

comment:1 by Sebastian Redl, 8 years ago

Resolution: duplicate
Status: newclosed

Dupe of #7180.

Note: See TracTickets for help on using tickets.