1 ///////////////////////////////////////////////////////////////////////////////
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_CHARSET_MATCHER_HPP_EAN_10_04_2005
9 #define BOOST_XPRESSIVE_DETAIL_CORE_MATCHER_CHARSET_MATCHER_HPP_EAN_10_04_2005
11 // MS compatible compilers support #pragma once
16 #include <boost/xpressive/detail/detail_fwd.hpp>
17 #include <boost/xpressive/detail/core/quant_style.hpp>
18 #include <boost/xpressive/detail/core/state.hpp>
20 namespace boost { namespace xpressive { namespace detail
23 ///////////////////////////////////////////////////////////////////////////////
26 template<typename Traits, typename ICase, typename CharSet>
27 struct charset_matcher
28 : quant_style_fixed_width<1>
30 typedef typename Traits::char_type char_type;
31 typedef Traits traits_type;
32 typedef ICase icase_type;
34 charset_matcher(CharSet const &charset = CharSet())
41 this->charset_.inverse();
44 template<typename BidiIter, typename Next>
45 bool match(match_state<BidiIter> &state, Next const &next) const
47 if(state.eos() || !this->charset_.test(*state.cur_, traits_cast<Traits>(state), icase_type()))