Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r72230 - trunk/boost/spirit/home/support/utree
From: blelbach_at_[hidden]
Date: 2011-05-27 16:33:58


Author: wash
Date: 2011-05-27 16:33:57 EDT (Fri, 27 May 2011)
New Revision: 72230
URL: http://svn.boost.org/trac/boost/changeset/72230

Log:
Use io state savers in utree streaming operations to avoid polluting output
streams.

Text files modified:
   trunk/boost/spirit/home/support/utree/operators.hpp | 4 +++-
   1 files changed, 3 insertions(+), 1 deletions(-)

Modified: trunk/boost/spirit/home/support/utree/operators.hpp
==============================================================================
--- trunk/boost/spirit/home/support/utree/operators.hpp (original)
+++ trunk/boost/spirit/home/support/utree/operators.hpp 2011-05-27 16:33:57 EDT (Fri, 27 May 2011)
@@ -18,6 +18,7 @@
 #include <exception>
 #if !defined(BOOST_SPIRIT_DISABLE_UTREE_IO)
   #include <ios>
+ #include <boost/io/ios_state.hpp>
 #endif
 #include <boost/spirit/home/support/utree/utree.hpp>
 #include <boost/preprocessor/cat.hpp>
@@ -224,6 +225,7 @@
 
         void operator()(binary_range_type const& b) const
         {
+ boost::io::ios_all_saver saver(out);
             out << "#";
             out.width(2);
             out.fill('0');
@@ -231,7 +233,7 @@
             typedef binary_range_type::const_iterator iterator;
             for (iterator i = b.begin(); i != b.end(); ++i)
                 out << std::hex << int((unsigned char)*i);
- out << std::dec << "# ";
+ out << "# ";
         }
 
         void operator()(utf8_string_range_type const& str) const


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk