// Copyright (c) 2001-2010 Hartmut Kaiser // Copyright (c) 2001-2010 Joel de Guzman // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #if !defined(BOOST_SPIRIT_GET_ENCODING_JANUARY_13_2009_1255PM) #define BOOST_SPIRIT_GET_ENCODING_JANUARY_13_2009_1255PM #if defined(_MSC_VER) #pragma once #endif #include #include namespace boost { namespace spirit { namespace detail { template struct get_implicit_encoding { // Extract the implicit encoding from the Modifiers // If one is not found, Encoding is used. The explicit // encoding is the first viable encoding that can be // extracted from the Modifiers (there can be more than one). typedef typename mpl::find_if< char_encodings, has_modifier > >::type iter; typedef typename mpl::eval_if< is_same::type>, mpl::identity, mpl::deref >::type type; }; template struct get_encoding { // Extract the explicit encoding from the Modifiers // If one is not found, get implicit encoding (see above). // Explicit encoding is the encoding explicitly declared // using the encoding[c] directive. typedef typename mpl::find_if< char_encodings, has_modifier > >::type iter; typedef typename mpl::eval_if< is_same::type>, get_implicit_encoding, mpl::deref >::type type; }; template struct get_encoding_with_case : mpl::identity {}; template struct get_encoding_with_case : get_encoding {}; }}} #endif