File indexing completed on 2025-01-18 09:53:55
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef BOOST_XPRESSIVE_REGEX_TRAITS_HPP_EAN_10_04_2005
0011 #define BOOST_XPRESSIVE_REGEX_TRAITS_HPP_EAN_10_04_2005
0012
0013
0014 #if defined(_MSC_VER)
0015 # pragma once
0016 #endif
0017
0018 #include <boost/type_traits/is_convertible.hpp>
0019 #include <boost/xpressive/detail/detail_fwd.hpp>
0020
0021 #ifdef BOOST_XPRESSIVE_USE_C_TRAITS
0022 # include <boost/xpressive/traits/c_regex_traits.hpp>
0023 #else
0024 # include <boost/xpressive/traits/cpp_regex_traits.hpp>
0025 #endif
0026
0027 namespace boost { namespace xpressive
0028 {
0029
0030
0031
0032
0033
0034 struct regex_traits_version_1_tag
0035 {
0036 };
0037
0038
0039
0040
0041
0042 struct regex_traits_version_2_tag
0043 : regex_traits_version_1_tag
0044 {
0045 };
0046
0047
0048
0049
0050
0051 struct regex_traits_version_1_case_fold_tag
0052 : regex_traits_version_1_tag
0053 {
0054 };
0055
0056
0057
0058
0059 template<typename Traits>
0060 struct has_fold_case
0061 : is_convertible<
0062 typename Traits::version_tag *
0063 , regex_traits_version_1_case_fold_tag *
0064 >
0065 {
0066 };
0067
0068
0069
0070
0071
0072
0073 template<typename Char, typename Impl>
0074 struct regex_traits
0075 : Impl
0076 {
0077 typedef typename Impl::locale_type locale_type;
0078
0079 regex_traits()
0080 : Impl()
0081 {
0082 }
0083
0084 explicit regex_traits(locale_type const &loc)
0085 : Impl(loc)
0086 {
0087 }
0088 };
0089
0090
0091
0092
0093 template<typename Traits, std::size_t N>
0094 inline typename Traits::char_class_type
0095 lookup_classname(Traits const &traits, char const (&cname)[N], bool icase)
0096 {
0097 typename Traits::char_type name[N] = {0};
0098 for(std::size_t j = 0; j < N-1; ++j)
0099 {
0100 name[j] = traits.widen(cname[j]);
0101 }
0102 return traits.lookup_classname(name, name + N - 1, icase);
0103 }
0104
0105 }}
0106
0107 #endif