1 /*=============================================================================
2 Copyright (c) 2001-2014 Joel de Guzman
4 Distributed under the Boost Software License, Version 1.0. (See accompanying
5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 ==============================================================================*/
7 #if !defined(BOOST_SPIRIT_X3_TST_JUNE_03_2007_1031AM)
8 #define BOOST_SPIRIT_X3_TST_JUNE_03_2007_1031AM
14 #include <boost/spirit/home/x3/string/detail/tst.hpp>
16 namespace boost { namespace spirit { namespace x3
18 struct tst_pass_through
20 template <typename Char>
21 Char operator()(Char ch) const
27 template <typename Char, typename T>
30 typedef Char char_type; // the character type
31 typedef T value_type; // the value associated with each entry
32 typedef detail::tst_node<Char, T> node;
50 tst& operator=(tst const& rhs)
55 template <typename Iterator, typename Filter>
56 T* find(Iterator& first, Iterator last, Filter filter) const
58 return node::find(root, first, last, filter);
61 template <typename Iterator>
62 T* find(Iterator& first, Iterator last) const
64 return find(first, last, tst_pass_through());
67 template <typename Iterator>
71 , typename boost::call_traits<T>::param_type val)
73 return node::add(root, first, last, val, this);
76 template <typename Iterator>
77 void remove(Iterator first, Iterator last)
79 node::remove(root, first, last, this);
84 node::destruct_node(root, this);
89 void for_each(F f) const
91 node::for_each(root, std::basic_string<Char>(), f);
96 friend struct detail::tst_node<Char, T>;
98 void copy(tst const& rhs)
100 root = node::clone_node(rhs.root, this);
103 tst& assign(tst const& rhs)
115 node* new_node(Char id)
120 T* new_data(typename boost::call_traits<T>::param_type val)
125 void delete_node(node* p)
130 void delete_data(T* p)