/usr/include/boost/spirit/home/support
NameSizeModeActions
algorithm/-0755rm
auto/-0755rm
auxiliary/-0755rm
char_encoding/-0755rm
char_set/-0755rm
detail/-0755rm
iterators/-0755rm
nonterminal/-0755rm
utree/-0755rm
action_dispatch.hpp75180644editdlrm
adapt_adt_attributes.hpp138350644editdlrm
argument.hpp66490644editdlrm
argument_expression.hpp29090644editdlrm
assert_msg.hpp22730644editdlrm
attributes.hpp458020644editdlrm
attributes_fwd.hpp118710644editdlrm
auto.hpp12980644editdlrm
char_class.hpp329110644editdlrm
common_terminals.hpp186490644editdlrm
container.hpp153580644editdlrm
context.hpp93650644editdlrm
extended_variant.hpp53510644editdlrm
handles_container.hpp20840644editdlrm
has_semantic_action.hpp15170644editdlrm
info.hpp48360644editdlrm
lazy.hpp12250644editdlrm
limits.hpp6070644editdlrm
make_component.hpp155930644editdlrm
meta_compiler.hpp125030644editdlrm
modify.hpp37650644editdlrm
multi_pass.hpp17080644editdlrm
multi_pass_wrapper.hpp14190644editdlrm
numeric_traits.hpp35590644editdlrm
sequence_base_id.hpp13620644editdlrm
string_traits.hpp104740644editdlrm
terminal.hpp232960644editdlrm
terminal_expression.hpp5830644editdlrm
unused.hpp23470644editdlrm
utf8.hpp36130644editdlrm
utree.hpp8120644editdlrm
Edit: /usr/include/boost/spirit/home/support/string_traits.hpp (10474B)
/*============================================================================= Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2001-2011 Hartmut Kaiser Copyright (c) 2010 Bryce Lelbach 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_STRING_TRAITS_OCTOBER_2008_1252PM) #define BOOST_SPIRIT_STRING_TRAITS_OCTOBER_2008_1252PM #if defined(_MSC_VER) #pragma once #endif #include #include #include #include #include #include // for BOOST_PROTO_DISABLE_IF_IS_CONST #include #if defined(__GNUC__) && (__GNUC__ < 4) #include #endif namespace boost { namespace spirit { namespace traits { /////////////////////////////////////////////////////////////////////////// // Determine if T is a character type /////////////////////////////////////////////////////////////////////////// template struct is_char : mpl::false_ {}; template struct is_char : is_char {}; template <> struct is_char : mpl::true_ {}; template <> struct is_char : mpl::true_ {}; /////////////////////////////////////////////////////////////////////////// // Determine if T is a string /////////////////////////////////////////////////////////////////////////// template struct is_string : mpl::false_ {}; template struct is_string : is_string {}; template <> struct is_string : mpl::true_ {}; template <> struct is_string : mpl::true_ {}; template <> struct is_string : mpl::true_ {}; template <> struct is_string : mpl::true_ {}; template struct is_string : mpl::true_ {}; template struct is_string : mpl::true_ {}; template struct is_string : mpl::true_ {}; template struct is_string : mpl::true_ {}; template struct is_string : mpl::true_ {}; template struct is_string : mpl::true_ {}; template struct is_string : mpl::true_ {}; template struct is_string : mpl::true_ {}; template struct is_string > : mpl::true_ {}; /////////////////////////////////////////////////////////////////////////// // Get the underlying char type of a string /////////////////////////////////////////////////////////////////////////// template struct char_type_of; template struct char_type_of : char_type_of {}; template <> struct char_type_of : mpl::identity {}; template <> struct char_type_of : mpl::identity {}; template <> struct char_type_of : mpl::identity {}; template <> struct char_type_of : mpl::identity {}; template <> struct char_type_of : mpl::identity {}; template <> struct char_type_of : mpl::identity {}; template struct char_type_of : mpl::identity {}; template struct char_type_of : mpl::identity {}; template struct char_type_of : mpl::identity {}; template struct char_type_of : mpl::identity {}; template struct char_type_of : mpl::identity {}; template struct char_type_of : mpl::identity {}; template struct char_type_of : mpl::identity {}; template struct char_type_of : mpl::identity {}; template struct char_type_of > : mpl::identity {}; /////////////////////////////////////////////////////////////////////////// // Get the C string from a string /////////////////////////////////////////////////////////////////////////// template struct extract_c_string; template struct extract_c_string { typedef typename char_type_of::type char_type; template static T const* call (T* str) { return (T const*)str; } template static T const* call (T const* str) { return str; } }; // Forwarder that strips const template struct extract_c_string { typedef typename extract_c_string::char_type char_type; static typename extract_c_string::char_type const* call (T const str) { return extract_c_string::call(str); } }; // Forwarder that strips references template struct extract_c_string { typedef typename extract_c_string::char_type char_type; static typename extract_c_string::char_type const* call (T& str) { return extract_c_string::call(str); } }; // Forwarder that strips const references template struct extract_c_string { typedef typename extract_c_string::char_type char_type; static typename extract_c_string::char_type const* call (T const& str) { return extract_c_string::call(str); } }; template struct extract_c_string > { typedef T char_type; typedef std::basic_string string; static T const* call (string const& str) { return str.c_str(); } }; template typename extract_c_string::char_type const* get_c_string (T* str) { return extract_c_string::call(str); } template typename extract_c_string::char_type const* get_c_string (T const* str) { return extract_c_string::call(str); } template typename extract_c_string::char_type const* get_c_string (String& str) { return extract_c_string::call(str); } template typename extract_c_string::char_type const* get_c_string (String const& str) { return extract_c_string::call(str); } /////////////////////////////////////////////////////////////////////////// // Get the begin/end iterators from a string /////////////////////////////////////////////////////////////////////////// // Implementation for C-style strings. // gcc 3.x.x has problems resolving ambiguities here #if defined(__GNUC__) && (__GNUC__ < 4) template inline typename add_const::type * get_begin(T* str) { return str; } template inline typename add_const::type* get_end(T* str) { T* last = str; while (*last) last++; return last; } #else template inline T const* get_begin(T const* str) { return str; } template inline T* get_begin(T* str) { return str; } template inline T const* get_end(T const* str) { T const* last = str; while (*last) last++; return last; } template inline T* get_end(T* str) { T* last = str; while (*last) last++; return last; } #endif // Implementation for containers (includes basic_string). template inline typename Str::const_iterator get_begin(Str const& str) { return str.begin(); } template inline typename Str::iterator get_begin(Str& str BOOST_PROTO_DISABLE_IF_IS_CONST(Str)) { return str.begin(); } template inline typename Str::const_iterator get_end(Str const& str) { return str.end(); } template inline typename Str::iterator get_end(Str& str BOOST_PROTO_DISABLE_IF_IS_CONST(Str)) { return str.end(); } // Default implementation for other types: try a C-style string // conversion. // These overloads are explicitly disabled for containers, // as they would be ambiguous with the previous ones. template inline typename disable_if , T const*>::type get_begin(Str const& str) { return str; } template inline typename disable_if , T const*>::type get_end(Str const& str) { return get_end(get_begin(str)); } } namespace result_of { template struct get_begin { typedef typename traits::char_type_of::type char_type; typedef typename mpl::if_< is_const , char_type const , char_type >::type* type; }; template struct get_begin >::type> { typedef typename mpl::if_< is_const , typename Str::const_iterator , typename Str::iterator >::type type; }; template struct get_end : get_begin {}; } }} #endif