Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r72253 - in branches/release: . boost boost/spirit boost/spirit/home boost/spirit/home/support/utree
From: hartmut.kaiser_at_[hidden]
Date: 2011-05-28 19:21:56


Author: hkaiser
Date: 2011-05-28 19:21:55 EDT (Sat, 28 May 2011)
New Revision: 72253
URL: http://svn.boost.org/trac/boost/changeset/72253

Log:
Spirit: merging from trunk
Properties modified:
   branches/release/ (props changed)
   branches/release/boost/ (props changed)
   branches/release/boost/spirit/ (props changed)
   branches/release/boost/spirit/home/ (props changed)
Text files modified:
   branches/release/boost/spirit/home/support/utree/operators.hpp | 4 +++-
   branches/release/boost/spirit/home/support/utree/utree_traits.hpp | 26 +++++++++++++++++++++++++-
   2 files changed, 28 insertions(+), 2 deletions(-)

Modified: branches/release/boost/spirit/home/support/utree/operators.hpp
==============================================================================
--- branches/release/boost/spirit/home/support/utree/operators.hpp (original)
+++ branches/release/boost/spirit/home/support/utree/operators.hpp 2011-05-28 19:21:55 EDT (Sat, 28 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

Modified: branches/release/boost/spirit/home/support/utree/utree_traits.hpp
==============================================================================
--- branches/release/boost/spirit/home/support/utree/utree_traits.hpp (original)
+++ branches/release/boost/spirit/home/support/utree/utree_traits.hpp 2011-05-28 19:21:55 EDT (Sat, 28 May 2011)
@@ -322,6 +322,18 @@
                 push_back(attr, val);
         }
     };
+
+ template <>
+ struct assign_to_container_from_value<utree, binary_string_type>
+ {
+ static void call(binary_string_type const& val, utree& attr)
+ {
+ if (attr.empty())
+ attr = val;
+ else
+ push_back(attr, val);
+ }
+ };
 
     template<>
     struct assign_to_container_from_value<utree, utf8_symbol_range_type>
@@ -334,6 +346,18 @@
                 push_back(attr, val);
         }
     };
+
+ template <>
+ struct assign_to_container_from_value<utree, binary_range_type>
+ {
+ static void call(binary_range_type const& val, utree& attr)
+ {
+ if (attr.empty())
+ attr = val;
+ else
+ push_back(attr, val);
+ }
+ };
 
     template <>
     struct assign_to_container_from_value<utree, std::string>
@@ -449,7 +473,7 @@
     struct attribute_as<utf8_symbol_range_type, utree>
       : detail::attribute_as_symbol_type
     {};
-
+
     template <typename Attribute>
     struct attribute_as<Attribute, utree::list_type>
       : attribute_as<Attribute, utree>


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