Improve vacpp support.
[boost.git] / boost / boost / xpressive / detail / static / placeholders.hpp
bloba4af88fd956f171bb87638aae4a11ca7085cb514
1 ///////////////////////////////////////////////////////////////////////////////
2 // placeholders.hpp
3 //
4 // Copyright 2004 Eric Niebler. Distributed under the Boost
5 // Software License, Version 1.0. (See accompanying file
6 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
8 #ifndef BOOST_XPRESSIVE_DETAIL_STATIC_PLACEHOLDERS_HPP_EAN_10_04_2005
9 #define BOOST_XPRESSIVE_DETAIL_STATIC_PLACEHOLDERS_HPP_EAN_10_04_2005
11 // MS compatible compilers support #pragma once
12 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
13 # pragma once
14 #endif
16 #include <string>
17 #include <boost/shared_ptr.hpp>
18 #include <boost/xpressive/detail/core/quant_style.hpp>
19 #include <boost/xpressive/detail/core/regex_impl.hpp>
21 namespace boost { namespace xpressive { namespace detail
24 ///////////////////////////////////////////////////////////////////////////////
25 // literal_placeholder
27 template<typename Char, bool Not>
28 struct literal_placeholder
29 : quant_style_fixed_width<1>
31 typedef mpl::bool_<Not> not_type;
32 Char ch_;
34 literal_placeholder(Char ch)
35 : ch_(ch)
40 ///////////////////////////////////////////////////////////////////////////////
41 // string_placeholder
43 template<typename Char>
44 struct string_placeholder
45 : quant_style_fixed_unknown_width
47 std::basic_string<Char> str_;
49 string_placeholder(std::basic_string<Char> const &str)
50 : str_(str)
55 ///////////////////////////////////////////////////////////////////////////////
56 // mark_placeholder
58 struct mark_placeholder
59 : quant_style_fixed_unknown_width
61 int mark_number_;
63 mark_placeholder(int mark_number)
64 : mark_number_(mark_number)
69 ///////////////////////////////////////////////////////////////////////////////
70 // regex_placeholder
72 template<typename BidiIter, bool ByRef>
73 struct regex_placeholder
74 : quant_style<quant_variable_width, unknown_width, mpl::false_>
76 shared_ptr<regex_impl<BidiIter> > impl_;
78 regex_placeholder(shared_ptr<regex_impl<BidiIter> > const &impl)
79 : impl_(impl)
84 ///////////////////////////////////////////////////////////////////////////////
85 // posix_charset_placeholder
87 struct posix_charset_placeholder
88 : quant_style_fixed_width<1>
90 char const *name_;
91 bool not_;
93 posix_charset_placeholder(char const *name)
94 : name_(name)
95 , not_(false)
100 ///////////////////////////////////////////////////////////////////////////////
101 // assert_word_placeholder
103 template<typename Cond>
104 struct assert_word_placeholder
105 : quant_style_assertion
109 ///////////////////////////////////////////////////////////////////////////////
110 // range_placeholder
112 template<typename Char>
113 struct range_placeholder
114 : quant_style_fixed_width<1>
116 Char ch_min_;
117 Char ch_max_;
118 bool not_;
120 range_placeholder(Char ch_min, Char ch_max)
121 : ch_min_(ch_min)
122 , ch_max_(ch_max)
123 , not_(false)
128 ///////////////////////////////////////////////////////////////////////////////
129 // assert_bol_placeholder
131 struct assert_bol_placeholder
132 : quant_style_assertion
136 ///////////////////////////////////////////////////////////////////////////////
137 // assert_eol_placeholder
139 struct assert_eol_placeholder
140 : quant_style_assertion
144 ///////////////////////////////////////////////////////////////////////////////
145 // logical_newline_placeholder
147 struct logical_newline_placeholder
148 : quant_style_variable_width
152 ///////////////////////////////////////////////////////////////////////////////
153 // self_placeholder
155 struct self_placeholder
156 : quant_style<quant_variable_width, unknown_width, mpl::false_>
160 }}} // namespace boost::xpressive::detail
162 #endif