1 ///////////////////////////////////////////////////////////////////////////////
2 // posix_charset_matcher.hpp
4 // Copyright 2008 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_CORE_MATCHER_POSIX_CHARSET_MATCHER_HPP_EAN_10_04_2005
9 #define BOOST_XPRESSIVE_DETAIL_CORE_MATCHER_POSIX_CHARSET_MATCHER_HPP_EAN_10_04_2005
11 // MS compatible compilers support #pragma once
16 #include <boost/assert.hpp>
17 #include <boost/mpl/bool.hpp>
18 #include <boost/xpressive/detail/detail_fwd.hpp>
19 #include <boost/xpressive/detail/core/quant_style.hpp>
20 #include <boost/xpressive/detail/core/state.hpp>
21 #include <boost/xpressive/detail/utility/traits_utils.hpp>
23 namespace boost { namespace xpressive { namespace detail
26 ///////////////////////////////////////////////////////////////////////////////
27 // posix_charset_matcher
29 template<typename Traits>
30 struct posix_charset_matcher
31 : quant_style_fixed_width<1>
33 typedef Traits traits_type;
34 typedef typename Traits::char_class_type char_class_type;
36 posix_charset_matcher(char_class_type m, bool no)
40 BOOST_ASSERT(0 != this->mask_);
45 this->not_ = !this->not_;
48 template<typename BidiIter, typename Next>
49 bool match(match_state<BidiIter> &state, Next const &next) const
51 if(state.eos() || this->not_ == traits_cast<Traits>(state).isctype(
52 *state.cur_, this->mask_))
68 char_class_type mask_;