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
10 #include <boost/spirit/home/x3/string/detail/tst.hpp>
12 namespace boost { namespace spirit { namespace x3
14 struct tst_pass_through
16 template <typename Char>
17 Char operator()(Char ch) const
23 template <typename Char, typename T>
26 typedef Char char_type; // the character type
27 typedef T value_type; // the value associated with each entry
28 typedef detail::tst_node<Char, T> node;
46 tst& operator=(tst const& rhs)
51 template <typename Iterator, typename CaseCompare>
52 T* find(Iterator& first, Iterator last, CaseCompare caseCompare) const
54 return node::find(root, first, last, caseCompare);
57 /*template <typename Iterator>
58 T* find(Iterator& first, Iterator last) const
60 return find(first, last, case_compare<tst_pass_through());
63 template <typename Iterator>
67 , typename boost::call_traits<T>::param_type val)
69 return node::add(root, first, last, val, this);
72 template <typename Iterator>
73 void remove(Iterator first, Iterator last)
75 node::remove(root, first, last, this);
80 node::destruct_node(root, this);
85 void for_each(F f) const
87 node::for_each(root, std::basic_string<Char>(), f);
92 friend struct detail::tst_node<Char, T>;
94 void copy(tst const& rhs)
96 root = node::clone_node(rhs.root, this);
99 tst& assign(tst const& rhs)
111 node* new_node(Char id)
116 T* new_data(typename boost::call_traits<T>::param_type val)
121 void delete_node(node* p)
126 void delete_data(T* p)