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