[prev in list] [next in list] [prev in thread] [next in thread]
List: boost-bugs
Subject: [Boost-bugs] [Boost C++ Libraries] #7180: Property Tree: json_write() pretty = false option not full
From: "Boost C++ Libraries" <noreply () lists ! boost ! org>
Date: 2012-07-27 2:53:14
Message-ID: 065.f649cc6961b80ae758ac9e29322426ba () lists ! boost ! org
[Download RAW message or body]
#7180: Property Tree: json_write() pretty = false option not fully respected for
arrays
----------------------------------------------------+-----------------------
Reporter: Paul Chandler <mailslot@…> | Owner: cornedbee
Type: Bugs | Status: new
Milestone: To Be Determined | Component: property_tree
Version: Boost Development Trunk | Severity: Problem
Keywords: property_tree json_write pretty indent |
----------------------------------------------------+-----------------------
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 :)
Example:
{{{
["1","2" ]
}}}
Expected:
{{{
["1","2"]
}}}
Patch:
{{{
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 << Ch(',');
if (pretty) stream << Ch('\n');
}
- stream << Str(4 * indent, Ch(' ')) << Ch(']');
+ if (pretty) stream << Str(4 * indent, Ch(' '));
+ stream << Ch(']');
}
else
}}}
--
Ticket URL: <https://svn.boost.org/trac/boost/ticket/7180>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.
_______________________________________________
Boost-bugs mailing list
Boost-bugs@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-bugs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic