|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r67000 - trunk/boost/spirit/home/support/utree
From: hartmut.kaiser_at_[hidden]
Date: 2010-12-03 21:16:06
Author: hkaiser
Date: 2010-12-03 21:16:05 EST (Fri, 03 Dec 2010)
New Revision: 67000
URL: http://svn.boost.org/trac/boost/changeset/67000
Log:
Spirit: utree is fully integrated now
Text files modified:
trunk/boost/spirit/home/support/utree/utree.hpp | 2
trunk/boost/spirit/home/support/utree/utree_traits.hpp | 41 +++++++++++++++++++++++++++++++++++++++
2 files changed, 41 insertions(+), 2 deletions(-)
Modified: trunk/boost/spirit/home/support/utree/utree.hpp
==============================================================================
--- trunk/boost/spirit/home/support/utree/utree.hpp (original)
+++ trunk/boost/spirit/home/support/utree/utree.hpp 2010-12-03 21:16:05 EST (Fri, 03 Dec 2010)
@@ -383,7 +383,7 @@
bool empty() const;
std::size_t size() const;
- type::info which() const;
+ utree_type::info which() const;
template <typename T>
T get() const;
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 2010-12-03 21:16:05 EST (Fri, 03 Dec 2010)
@@ -170,6 +170,45 @@
}
///////////////////////////////////////////////////////////////////////
+ template <typename T2>
+ static void push_to_string_list(utree& c, T2 const& val)
+ {
+ c.push_back(val);
+ }
+
+ static void push_to_string_list(utree& c, utree const& val)
+ {
+ utree& b = c.back();
+ if (b.which() == utree_type::string_type &&
+ val.which() == utree_type::string_type)
+ {
+ push_to_string(b, val);
+ }
+ else
+ {
+ c.push_back(val);
+ }
+ }
+
+ static void push_to_string_list(utree& c, std::string const& val)
+ {
+ utree& b = c.back();
+ if (b.which() == utree_type::string_type)
+ push_to_string(b, val);
+ else
+ c.push_back(val);
+ }
+
+ static void push_to_string_list(utree& c, char val)
+ {
+ utree& b = c.back();
+ if (b.which() == utree_type::string_type)
+ push_to_string(b, val);
+ else
+ c.push_back(val);
+ }
+
+ ///////////////////////////////////////////////////////////////////////
static bool call(utree& c, T const& val)
{
switch (c.which())
@@ -181,7 +220,7 @@
}
case utree_type::list_type:
{
- c.push_back(val);
+ push_to_string_list(c, val);
break;
}
case utree_type::string_type:
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