Boost C++ Libraries: Ticket #7180: Property Tree: json_write() pretty = false option not fully respected for arrays https://svn.boost.org/trac10/ticket/7180 <p> When outputting an array with "pretty" set to false, indentation is output blindly before the closing brace. This has the potential to waste a lot of space in certain usage scenarios... like my own :) </p> <p> Example: </p> <pre class="wiki">["1","2" ] </pre><p> Expected: </p> <pre class="wiki">["1","2"] </pre><p> Patch: </p> <pre class="wiki">diff -dur boost.old/property_tree/detail/json_parser_write.hpp boost.new/property_tree/detail/json_parser_write.hpp --- boost.old/property_tree/detail/json_parser_write.hpp 2012-07-26 19:42:10.000000000 -0700 +++ boost.new/property_tree/detail/json_parser_write.hpp 2012-07-26 19:43:34.000000000 -0700 @@ -93,7 +93,8 @@ stream &lt;&lt; Ch(','); if (pretty) stream &lt;&lt; Ch('\n'); } - stream &lt;&lt; Str(4 * indent, Ch(' ')) &lt;&lt; Ch(']'); + if (pretty) stream &lt;&lt; Str(4 * indent, Ch(' ')); + stream &lt;&lt; Ch(']'); } else </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7180 Trac 1.4.3 Paul Chandler <mailslot@…> Fri, 27 Jul 2012 02:53:57 GMT attachment set https://svn.boost.org/trac10/ticket/7180 https://svn.boost.org/trac10/ticket/7180 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">jsonPrettyPrint.patch</span> </li> </ul> <p> Proposed patch </p> Ticket Nana Sakisaka <n.sakisaka@…> Mon, 10 Dec 2012 18:53:41 GMT <link>https://svn.boost.org/trac10/ticket/7180#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7180#comment:1</guid> <description> <p> This is a duplicate of <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7072" title="#7072: Bugs: Extra whitespace in write_json (closed: duplicate)">#7072</a>. See my comment on <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7072" title="#7072: Bugs: Extra whitespace in write_json (closed: duplicate)">#7072</a> for my proposal. </p> </description> <category>Ticket</category> </item> <item> <author>Nana Sakisaka <n.sakisaka@…></author> <pubDate>Mon, 10 Dec 2012 18:54:22 GMT</pubDate> <title>cc set https://svn.boost.org/trac10/ticket/7180#comment:2 https://svn.boost.org/trac10/ticket/7180#comment:2 <ul> <li><strong>cc</strong> <span class="trac-author">n.sakisaka@…</span> added </li> </ul> Ticket Sebastian Redl Tue, 11 Feb 2014 15:55:15 GMT status changed https://svn.boost.org/trac10/ticket/7180#comment:3 https://svn.boost.org/trac10/ticket/7180#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> <p> Fixed in develop in 530e6fe. </p> Ticket Sebastian Redl Mon, 24 Feb 2014 12:57:10 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/7180#comment:4 https://svn.boost.org/trac10/ticket/7180#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Merged to master in 85f8d8866ccf. </p> Ticket