File indexing completed on 2026-09-03 09:11:53
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef BOOST_URL_GRAMMAR_HEXDIG_CHARS_HPP
0011 #define BOOST_URL_GRAMMAR_HEXDIG_CHARS_HPP
0012
0013 #include <boost/url/detail/config.hpp>
0014 #include <boost/url/grammar/detail/charset.hpp>
0015
0016 namespace boost {
0017 namespace urls {
0018 namespace grammar {
0019 namespace implementation_defined {
0020 struct hexdig_chars_t
0021 {
0022
0023
0024
0025
0026
0027 constexpr
0028 bool
0029 operator()(char c) const noexcept
0030 {
0031 return
0032 (c >= '0' && c <= '9') ||
0033 (c >= 'A' && c <= 'F') ||
0034 (c >= 'a' && c <= 'f');
0035 }
0036
0037 #ifdef BOOST_URL_USE_SSE2
0038 char const*
0039 find_if(
0040 char const* first,
0041 char const* last) const noexcept
0042 {
0043 return detail::find_if_pred(
0044 *this, first, last);
0045 }
0046
0047 char const*
0048 find_if_not(
0049 char const* first,
0050 char const* last) const noexcept
0051 {
0052 return detail::find_if_not_pred(
0053 *this, first, last);
0054 }
0055 #endif
0056 };
0057 }
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084
0085
0086
0087
0088
0089
0090
0091
0092
0093
0094
0095
0096
0097 constexpr implementation_defined::hexdig_chars_t hexdig_chars{};
0098
0099
0100
0101
0102
0103
0104
0105
0106
0107
0108
0109
0110
0111
0112
0113
0114
0115
0116
0117 inline
0118 signed char
0119 hexdig_value(char ch) noexcept
0120 {
0121
0122
0123
0124 signed char res;
0125 switch(ch)
0126 {
0127 default: res = -1; break;
0128 case '0': res = 0; break;
0129 case '1': res = 1; break;
0130 case '2': res = 2; break;
0131 case '3': res = 3; break;
0132 case '4': res = 4; break;
0133 case '5': res = 5; break;
0134 case '6': res = 6; break;
0135 case '7': res = 7; break;
0136 case '8': res = 8; break;
0137 case '9': res = 9; break;
0138 case 'a': case 'A': res = 10; break;
0139 case 'b': case 'B': res = 11; break;
0140 case 'c': case 'C': res = 12; break;
0141 case 'd': case 'D': res = 13; break;
0142 case 'e': case 'E': res = 14; break;
0143 case 'f': case 'F': res = 15; break;
0144 }
0145 return res;
0146 }
0147
0148 }
0149 }
0150 }
0151
0152 #endif