Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r72231 - trunk/boost/spirit/home/support/utree
From: blelbach_at_[hidden]
Date: 2011-05-27 16:34:39


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

Log:
Fix utree/spirit integration for binary strings.

Text files modified:
   trunk/boost/spirit/home/support/utree/utree_traits.hpp | 26 +++++++++++++++++++++++++-
   1 files changed, 25 insertions(+), 1 deletions(-)

Modified: trunk/boost/spirit/home/support/utree/utree_traits.hpp
==============================================================================
--- trunk/boost/spirit/home/support/utree/utree_traits.hpp (original)
+++ trunk/boost/spirit/home/support/utree/utree_traits.hpp 2011-05-27 16:34:38 EDT (Fri, 27 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