22#elif defined(__APPLE__)
23#include <netinet/in.h>
37#pragma warning(disable: 4100)
40#define ENUM_FLAG_OPERATOR(T,X) \
41inline T operator X (const T lhs, const T rhs) { return static_cast<T>(static_cast<std::underlying_type_t<T>>(lhs) X static_cast<std::underlying_type_t<T>>(rhs)); } \
42inline T operator X (const T lhs, const std::underlying_type_t<T> rhs) { return static_cast<T>(static_cast<std::underlying_type_t<T>>(lhs) X rhs); } \
43inline T operator X (const std::underlying_type_t<T> lhs, const T rhs) { return static_cast<T>(lhs X static_cast<std::underlying_type_t<T>>(rhs)); } \
44inline T& operator X= (T& lhs, const T rhs) { return lhs = lhs X rhs; } \
45inline T& operator X= (T& lhs, const std::underlying_type_t<T> rhs) { return lhs = lhs X rhs; }
46#define ENUM_FLAGS(T, type) \
48inline T operator ~ (T t) { return (T) (~static_cast<std::underlying_type_t <T>>(t)); } \
49ENUM_FLAG_OPERATOR(T,|) \
50ENUM_FLAG_OPERATOR(T,^) \
51ENUM_FLAG_OPERATOR(T,&) \
55#elif defined(__APPLE__)
56#define s6_words __u6_addr.__u6_addr16
58#error Unsupported platform
68 constexpr int match_default = 0;
69 constexpr int match_case_insensitive = 0x1;
70 constexpr int match_multiline = 0x2;
79 basic_parser(
_In_ const std::locale& locale = std::locale()) : m_locale(locale) {}
83 _In_reads_or_z_(end)
const T*
text,
84 _In_ size_t start = 0,
85 _In_ size_t end = (
size_t)-1,
88 for (
size_t i = start;
i < end &&
text[
i];
i++)
95 _In_reads_or_z_(end)
const T*
text,
96 _In_ size_t start = 0,
97 _In_ size_t end = (
size_t)-1,
100 template<
class _Traits,
class _Ax>
102 const std::basic_string<T, _Traits, _Ax>&
text,
103 _In_ size_t start = 0,
104 _In_ size_t end = (
size_t)-1,
107 return match(
text.c_str(), start, std::min<size_t>(end,
text.size()),
flags);
110 virtual void invalidate()
120 if (
text[start] ==
'&') {
122 const auto&
ctype = std::use_facet<std::ctype<T>>(m_locale);
131 if (
n >= 2 &&
text[start + 1] ==
'#') {
134 if (
text[start + 2] ==
'x' ||
text[start + 2] ==
'X')
135 unicode = strtou32(
text + start + 3,
n - 2,
nullptr, 16);
137 unicode = strtou32(
text + start + 2,
n - 1,
nullptr, 10);
144 ucs4_to_surrogate_pair(buf,
unicode);
168 buf[0] =
text[start];
179 std::locale m_locale;
199 _In_reads_or_z_(end)
const T*
text,
200 _In_ size_t start = 0,
201 _In_ size_t end = (
size_t)-1,
204 _Assume_(
text || start >= end);
205 if (start < end &&
text[start]) {
233 _In_reads_or_z_(end)
const T*
text,
234 _In_ size_t start = 0,
235 _In_ size_t end = (
size_t)-1,
238 _Assume_(
text || start >= end);
239 if (start < end &&
text[start]) {
265 _In_reads_or_z_(end)
const char*
text,
266 _In_ size_t start = 0,
267 _In_ size_t end = (
size_t)-1,
270 _Assume_(
text || start >= end);
271 if (start < end &&
text[start]) {
272 if (
text[start] ==
'&') {
274 const auto&
ctype = std::use_facet<std::ctype<char>>(m_locale);
307 _In_reads_or_z_(end)
const T*
text,
308 _In_ size_t start = 0,
309 _In_ size_t end = (
size_t)-1,
312 _Assume_(
text || start >= end);
313 if (start < end &&
text[start]) {
315 if (
flags & match_case_insensitive) {
316 const auto&
ctype = std::use_facet<std::ctype<T>>(this->m_locale);
320 r =
text[start] == m_chr;
321 if ((
r && !m_invert) || (!
r && m_invert)) {
349 sgml_cp(
const char*
chr,
size_t count = (
size_t)-1,
bool invert =
false,
_In_ const std::locale& locale = std::locale()) :
360 _In_reads_or_z_(end)
const char*
text,
361 _In_ size_t start = 0,
362 _In_ size_t end = (
size_t)-1,
365 _Assume_(
text || start >= end);
366 if (start < end &&
text[start]) {
369 bool r = ((
flags & match_case_insensitive) ?
370 stdex::strnicmp(
chr, (
size_t)-1, m_chr.c_str(), m_chr.size(), m_locale) :
371 stdex::strncmp(
chr, (
size_t)-1, m_chr.c_str(), m_chr.size())) == 0;
372 if ((
r && !m_invert) || (!
r && m_invert)) {
399 _In_reads_or_z_(end)
const T*
text,
400 _In_ size_t start = 0,
401 _In_ size_t end = (
size_t)-1,
404 _Assume_(
text || start >= end);
405 if (start < end &&
text[start]) {
407 ((
flags & match_multiline) || !islbreak(
text[start])) &&
408 std::use_facet<std::ctype<T>>(this->m_locale).is(std::ctype_base::space,
text[start]);
409 if ((
r && !m_invert) || (!
r && m_invert)) {
441 _In_reads_or_z_(end)
const char*
text,
442 _In_ size_t start = 0,
443 _In_ size_t end = (
size_t)-1,
446 _Assume_(
text || start >= end);
447 if (start < end &&
text[start]) {
452 ((
flags & match_multiline) || !islbreak(
chr, (
size_t)-1)) &&
454 if ((
r && !m_invert) || (!
r && m_invert)) {
478 _In_reads_or_z_(end)
const T*
text,
479 _In_ size_t start = 0,
480 _In_ size_t end = (
size_t)-1,
483 _Assume_(
text || start >= end);
484 if (start < end &&
text[start]) {
485 bool r = std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::punct,
text[start]);
486 if ((
r && !m_invert) || (!
r && m_invert)) {
518 _In_reads_or_z_(end)
const char*
text,
519 _In_ size_t start = 0,
520 _In_ size_t end = (
size_t)-1,
523 _Assume_(
text || start >= end);
524 if (start < end &&
text[start]) {
529 if ((
r && !m_invert) || (!
r && m_invert)) {
552 _In_reads_or_z_(end)
const T*
text,
553 _In_ size_t start = 0,
554 _In_ size_t end = (
size_t)-1,
557 _Assume_(
text || start >= end);
558 if (start < end &&
text[start]) {
560 ((
flags & match_multiline) || !islbreak(
text[start])) &&
561 std::use_facet<std::ctype<T>>(this->m_locale).is(std::ctype_base::space | std::ctype_base::punct,
text[start]);
562 if ((
r && !m_invert) || (!
r && m_invert)) {
594 _In_reads_or_z_(end)
const char*
text,
595 _In_ size_t start = 0,
596 _In_ size_t end = (
size_t)-1,
599 _Assume_(
text || start >= end);
600 if (start < end &&
text[start]) {
605 ((
flags & match_multiline) || !islbreak(
chr, (
size_t)-1)) &&
606 std::use_facet<std::ctype<wchar_t>>(m_locale).
scan_not(std::ctype_base::space | std::ctype_base::punct,
chr,
chr_end) ==
chr_end;
607 if ((
r && !m_invert) || (!
r && m_invert)) {
627 _In_reads_or_z_(end)
const T*
text,
628 _In_ size_t start = 0,
629 _In_ size_t end = (
size_t)-1,
632 _Assume_(
text || start >= end);
633 bool r = start == 0 || (start <= end && islbreak(
text[start - 1]));
634 if ((
r && !m_invert) || (!
r && m_invert)) {
665 _In_reads_or_z_(end)
const T*
text,
666 _In_ size_t start = 0,
667 _In_ size_t end = (
size_t)-1,
670 _Assume_(
text || start >= end);
671 bool r = islbreak(
text[start]);
672 if ((
r && !m_invert) || (!
r && m_invert)) {
699 hit_offset((
size_t)-1),
704 _In_reads_or_z_(end)
const T*
text,
705 _In_ size_t start = 0,
706 _In_ size_t end = (
size_t)-1,
709 virtual void invalidate()
730 _In_reads_or_z_(
count)
const T* set,
733 _In_ const std::locale& locale = std::locale()) :
737 m_set.assign(set, set + stdex::strnlen(set,
count));
741 _In_reads_or_z_(end)
const T*
text,
742 _In_ size_t start = 0,
743 _In_ size_t end = (
size_t)-1,
746 _Assume_(
text || start >= end);
747 if (start < end &&
text[start]) {
748 const T* set = m_set.c_str();
749 size_t r = (
flags & match_case_insensitive) ?
750 stdex::strnichr(set, m_set.size(),
text[start], this->m_locale) :
751 stdex::strnchr(set, m_set.size(),
text[start]);
752 if ((
r != stdex::npos && !this->m_invert) || (
r == stdex::npos && this->m_invert)) {
753 this->hit_offset =
r;
758 this->hit_offset = (
size_t)-1;
764 std::basic_string<T> m_set;
781 sgml_cp_set(
const char* set,
size_t count = (
size_t)-1,
bool invert =
false,
_In_ const std::locale& locale = std::locale()) :
785 m_set = sgml2wstr(set,
count);
789 _In_reads_or_z_(end)
const char*
text,
790 _In_ size_t start = 0,
791 _In_ size_t end = (
size_t)-1,
794 _Assume_(
text || start >= end);
795 if (start < end &&
text[start]) {
798 const wchar_t* set = m_set.c_str();
799 size_t r = (
flags & match_case_insensitive) ?
800 stdex::strnistr(set, m_set.size(),
chr, m_locale) :
801 stdex::strnstr(set, m_set.size(),
chr);
802 if ((
r != stdex::npos && !m_invert) || (
r == stdex::npos && m_invert)) {
825 _In_reads_or_z_(
count)
const T*
str,
827 _In_ const std::locale& locale = std::locale()) :
833 _In_reads_or_z_(end)
const T*
text,
834 _In_ size_t start = 0,
835 _In_ size_t end = (
size_t)-1,
838 _Assume_(
text || start >= end);
841 n = std::min<size_t>(end - start,
m);
842 bool r = ((
flags & match_case_insensitive) ?
843 stdex::strnicmp(
text + start,
n, m_str.c_str(),
m, this->m_locale) :
844 stdex::strncmp(
text + start,
n, m_str.c_str(),
m)) == 0;
854 std::basic_string<T> m_str;
877 _In_reads_or_z_(end)
const char*
text,
878 _In_ size_t start = 0,
879 _In_ size_t end = (
size_t)-1,
882 _Assume_(
text || start >= end);
883 const wchar_t*
str = m_str.c_str();
885 const auto&
ctype = std::use_facet<std::ctype<wchar_t>>(m_locale);
927 _In_reads_or_z_(end)
const T*
text,
928 _In_ size_t start = 0,
929 _In_ size_t end = (
size_t)-1,
932 _Assume_(
text || start >= end);
934 for (
size_t i = 0; ;
i++) {
953 std::shared_ptr<basic_parser<T>>
m_el;
981 _In_ const std::locale& locale = std::locale()) :
985 m_collection.reserve(
count);
987 m_collection.push_back(
el[
i]);
992 _In_ const std::locale& locale = std::locale()) :
997 virtual void invalidate()
999 for (
auto&
el: m_collection)
1005 std::vector<std::shared_ptr<basic_parser<T>>> m_collection;
1018 _In_ const std::locale& locale = std::locale()) :
1024 _In_ const std::locale& locale = std::locale()) :
1029 _In_reads_or_z_(end)
const T*
text,
1030 _In_ size_t start = 0,
1031 _In_ size_t end = (
size_t)-1,
1034 _Assume_(
text || start >= end);
1036 for (
auto i = this->m_collection.begin();
i != this->m_collection.end(); ++
i) {
1038 for (++
i;
i != this->m_collection.end(); ++
i)
1068 hit_offset((
size_t)-1)
1075 _In_ const std::locale& locale = std::locale()) :
1077 hit_offset((
size_t)-1)
1082 _In_ const std::locale& locale = std::locale()) :
1084 hit_offset((
size_t)-1)
1088 _In_reads_or_z_(end)
const T*
text,
1089 _In_ size_t start = 0,
1090 _In_ size_t end = (
size_t)-1,
1093 _Assume_(
text || start >= end);
1095 for (
auto i = this->m_collection.begin();
i != this->m_collection.end(); ++
i, ++hit_offset) {
1096 if ((*i)->match(
text, start, end,
flags)) {
1098 for (++
i;
i != this->m_collection.end(); ++
i)
1108 virtual void invalidate()
1130 template <
class T,
class T_parser = basic_
string<T>>
1137 _In_ const std::locale& locale = std::locale()) :
1170 offset += stdex::strnlen(
str_z + offset,
count - offset) + 1, ++
n);
1171 this->m_collection.reserve(
n);
1175 offset += stdex::strnlen(
str_z + offset,
count - offset) + 1)
1176 this->m_collection.push_back(std::move(std::make_shared<T_parser>(
str_z + offset,
count - offset,
this->m_locale)));
1184 this->m_collection.push_back(std::move(std::make_shared<T_parser>(
str, (
size_t)-1,
this->m_locale)));
1185 (
p =
va_arg(params,
const T*)) !=
nullptr;
1186 this->m_collection.push_back(std::move(std::make_shared<T_parser>(
p, (
size_t)-1, this->m_locale))));
1209 _In_ const std::locale& locale = std::locale()) :
1215 _In_ const std::locale& locale = std::locale()) :
1220 _In_reads_or_z_(end)
const T*
text,
1221 _In_ size_t start = 0,
1222 _In_ size_t end = (
size_t)-1,
1225 _Assume_(
text || start >= end);
1226 for (
auto&
el: this->m_collection)
1228 if (match_recursively(
text, start, end,
flags)) {
1237 bool match_recursively(
1238 _In_reads_or_z_(end)
const T*
text,
1239 _In_ size_t start = 0,
1240 _In_ size_t end = (
size_t)-1,
1244 for (
auto&
el: this->m_collection) {
1287 virtual void invalidate()
1315 _In_ const std::locale& locale = std::locale()) :
1330 _In_reads_or_z_(end)
const T*
text,
1331 _In_ size_t start = 0,
1332 _In_ size_t end = (
size_t)-1,
1335 _Assume_(
text || start >= end);
1360 std::shared_ptr<basic_parser<T>>
1392 _In_ const std::locale& locale = std::locale()) :
1397 m_separator(separator)
1401 _In_reads_or_z_(end)
const T*
text,
1402 _In_ size_t start = 0,
1403 _In_ size_t end = (
size_t)-1,
1406 _Assume_(
text || start >= end);
1407 if (m_digits->match(
text, start, end,
flags)) {
1409 this->
value = m_digits->value;
1414 if (m_digits->interval.size() <= 3) {
1416 size_t hit_offset = (
size_t)-1;
1418 (hit_offset == (
size_t)-1 || hit_offset == m_separator->hit_offset) &&
1419 m_digits->match(
text, m_separator->interval.end, end,
flags) &&
1420 m_digits->interval.size() == 3)
1423 this->
value = this->
value * 1000 + m_digits->value;
1427 hit_offset = m_separator->hit_offset;
1438 virtual void invalidate()
1450 std::shared_ptr<basic_integer10<T>> m_digits;
1451 std::shared_ptr<basic_set<T>> m_separator;
1487 _In_ const std::locale& locale = std::locale()) :
1508 _In_reads_or_z_(end)
const T*
text,
1509 _In_ size_t start = 0,
1510 _In_ size_t end = (
size_t)-1,
1513 _Assume_(
text || start >= end);
1544 std::shared_ptr<basic_parser<T>>
1589 _In_ const std::locale& locale = std::locale()) :
1603 _In_reads_or_z_(end)
const T*
text,
1604 _In_ size_t start = 0,
1605 _In_ size_t end = (
size_t)-1,
1608 _Assume_(
text || start >= end);
1626 if (
dig[4] == (
size_t)-1)
dig[4] =
dig[0];
1634 this->
value += dig[0];
1637 (
dig[1] == 1 && (
dig[0] == 5 ||
dig[0] == 10)) ||
1638 (
dig[1] == 10 && (
dig[0] == 50 ||
dig[0] == 100)) ||
1639 (
dig[1] == 100 && (
dig[0] == 500 ||
dig[0] == 1000)) ||
1640 (
dig[1] == 1000 && (
dig[0] == 5000 ||
dig[0] == 10000)))
1647 this->
value -= dig[1];
1651 this->
value += dig[0];
1667 std::shared_ptr<basic_parser<T>>
1699 _In_ const std::locale& locale = std::locale()) :
1707 _In_reads_or_z_(end)
const T*
text,
1708 _In_ size_t start = 0,
1709 _In_ size_t end = (
size_t)-1,
1712 _Assume_(
text || start >= end);
1713 if (numerator->match(
text, start, end,
flags) &&
1714 fraction_line->match(
text, numerator->interval.end, end,
flags) &&
1715 denominator->match(
text, fraction_line->interval.end, end,
flags))
1721 numerator->invalidate();
1722 fraction_line->invalidate();
1723 denominator->invalidate();
1728 virtual void invalidate()
1730 numerator->invalidate();
1731 fraction_line->invalidate();
1732 denominator->invalidate();
1737 std::shared_ptr<basic_parser<T>> numerator;
1738 std::shared_ptr<basic_parser<T>> fraction_line;
1739 std::shared_ptr<basic_parser<T>> denominator;
1763 _In_ const std::locale& locale = std::locale()) :
1772 _In_reads_or_z_(end)
const T*
text,
1773 _In_ size_t start = 0,
1774 _In_ size_t end = (
size_t)-1,
1777 _Assume_(
text || start >= end);
1806 separator->invalidate();
1807 guest->invalidate();
1812 virtual void invalidate()
1815 separator->invalidate();
1816 guest->invalidate();
1821 std::shared_ptr<basic_parser<T>> home;
1822 std::shared_ptr<basic_parser<T>> separator;
1823 std::shared_ptr<basic_parser<T>> guest;
1826 std::shared_ptr<basic_parser<T>> m_space;
1850 _In_ const std::locale& locale = std::locale()) :
1859 _In_reads_or_z_(end)
const T*
text,
1860 _In_ size_t start = 0,
1861 _In_ size_t end = (
size_t)-1,
1864 _Assume_(
text || start >= end);
1899 virtual void invalidate()
1938 _In_ const std::locale& locale = std::locale()) :
1949 _In_reads_or_z_(end)
const T*
text,
1950 _In_ size_t start = 0,
1951 _In_ size_t end = (
size_t)-1,
1954 _Assume_(
text || start >= end);
2020 virtual void invalidate()
2038 std::shared_ptr<basic_parser<T>> m_space;
2068 _In_ const std::locale& locale = std::locale()) :
2080 value(std::numeric_limits<double>::quiet_NaN())
2084 _In_reads_or_z_(end)
const T*
text,
2085 _In_ size_t start = 0,
2086 _In_ size_t end = (
size_t)-1,
2089 _Assume_(
text || start >= end);
2124 if (
integer->interval.empty() &&
2180 virtual void invalidate()
2192 value = std::numeric_limits<double>::quiet_NaN();
2234 _In_ const std::locale& locale = std::locale()) :
2246 _In_reads_or_z_(end)
const T*
text,
2247 _In_ size_t start = 0,
2248 _In_ size_t end = (
size_t)-1,
2251 _Assume_(
text || start >= end);
2298 if (
integer->interval.empty() &&
2317 virtual void invalidate()
2367 _In_ const std::locale& locale = std::locale()) :
2379 m_separator(separator)
2385 _In_reads_or_z_(end)
const T*
text,
2386 _In_ size_t start = 0,
2387 _In_ size_t end = (
size_t)-1,
2390 _Assume_(
text || start >= end);
2395 for (
i = 0;
i < 4;
i++) {
2453 virtual void invalidate()
2472 std::shared_ptr<basic_parser<T>>
2483 std::shared_ptr<basic_parser<T>> m_separator;
2505 _In_reads_or_z_(end)
const T*
text,
2506 _In_ size_t start = 0,
2507 _In_ size_t end = (
size_t)-1,
2510 _Assume_(
text || start >= end);
2511 if (start < end &&
text[start]) {
2512 if (
text[start] ==
'-' ||
2513 text[start] ==
'_' ||
2514 text[start] ==
':' ||
2515 std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::alnum,
text[start]))
2543 _In_reads_or_z_(end)
const char*
text,
2544 _In_ size_t start = 0,
2545 _In_ size_t end = (
size_t)-1,
2548 _Assume_(
text || start >= end);
2549 if (start < end &&
text[start]) {
2553 if (((
chr[0] ==
L'-' ||
2555 chr[0] ==
L':') &&
chr[1] == 0) ||
2594 _In_ const std::locale& locale = std::locale()) :
2612 m_separator(separator),
2620 _In_reads_or_z_(end)
const T*
text,
2621 _In_ size_t start = 0,
2622 _In_ size_t end = (
size_t)-1,
2625 _Assume_(
text || start >= end);
2630 for (
i = 0;
i < 8;
i++) {
2634 if (m_separator->match(
text, m_separator->interval.end, end,
flags)) {
2683 if (
x_n <= 0xffff) {
2706 this->
value.s6_words[--j] = this->
value.s6_words[--k];
2710 this->
value.s6_words[--j] = 0;
2750 virtual void invalidate()
2779 std::shared_ptr<basic_parser<T>>
2796 std::shared_ptr<basic_parser<T>> m_separator, m_scope_id_separator;
2817 _In_ const std::locale& locale = std::locale()) :
2824 _In_reads_or_z_(end)
const T*
text,
2825 _In_ size_t start = 0,
2826 _In_ size_t end = (
size_t)-1,
2829 _Assume_(
text || start >= end);
2830 if (start < end &&
text[start]) {
2831 if ((
'A' <=
text[start] &&
text[start] <=
'Z') ||
2832 (
'a' <=
text[start] &&
text[start] <=
'z') ||
2833 (
'0' <=
text[start] &&
text[start] <=
'9'))
2835 else if (
text[start] ==
'-')
2837 else if (m_allow_idn && std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::alnum,
text[start]))
2873 _In_ const std::locale& locale = std::locale()) :
2878 _In_reads_or_z_(end)
const char*
text,
2879 _In_ size_t start = 0,
2880 _In_ size_t end = (
size_t)-1,
2883 _Assume_(
text || start >= end);
2884 if (start < end &&
text[start]) {
2888 if (((
'A' <=
chr[0] &&
chr[0] <=
'Z') ||
2889 (
'a' <=
chr[0] &&
chr[0] <=
'z') ||
2890 (
'0' <=
chr[0] &&
chr[0] <=
'9')) &&
chr[1] == 0)
2892 else if (
chr[0] ==
'-' &&
chr[1] == 0)
2894 else if (m_allow_idn && std::use_facet<std::ctype<wchar_t>>(m_locale).
scan_not(std::ctype_base::alnum,
chr,
chr_end) ==
chr_end)
2919 _In_ const std::locale& locale = std::locale()) :
2923 m_separator(separator)
2927 _In_reads_or_z_(end)
const T*
text,
2928 _In_ size_t start = 0,
2929 _In_ size_t end = (
size_t)-1,
2932 _Assume_(
text || start >= end);
2935 if (m_domain_char->match(
text,
i, end,
flags) &&
2936 m_domain_char->allow_on_edge)
2940 while (
i < end &&
text[
i]) {
2941 if (m_domain_char->allow_on_edge &&
2949 i = m_separator->interval.end;
2953 if (m_domain_char->match(
text,
i, end,
flags)) {
2954 if (m_domain_char->allow_on_edge)
2957 i = m_domain_char->interval.end;
2978 std::shared_ptr<basic_dns_domain_char<T>> m_domain_char;
2979 std::shared_ptr<basic_parser<T>> m_separator;
3001 _In_reads_or_z_(end)
const T*
text,
3002 _In_ size_t start = 0,
3003 _In_ size_t end = (
size_t)-1,
3006 _Assume_(
text || start >= end);
3007 if (start < end &&
text[start]) {
3008 if (
text[start] ==
'-' ||
3009 text[start] ==
'.' ||
3010 text[start] ==
'_' ||
3011 text[start] ==
'~' ||
3012 text[start] ==
'%' ||
3013 text[start] ==
'!' ||
3014 text[start] ==
'$' ||
3015 text[start] ==
'&' ||
3016 text[start] ==
'\'' ||
3019 text[start] ==
'*' ||
3020 text[start] ==
'+' ||
3021 text[start] ==
',' ||
3022 text[start] ==
';' ||
3023 text[start] ==
'=' ||
3024 std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::alnum,
text[start]))
3052 _In_reads_or_z_(end)
const char*
text,
3053 _In_ size_t start = 0,
3054 _In_ size_t end = (
size_t)-1,
3057 _Assume_(
text || start >= end);
3058 if (start < end &&
text[start]) {
3062 if (((
chr[0] ==
L'-' ||
3077 chr[0] ==
L'=') &&
chr[1] == 0) ||
3100 _In_reads_or_z_(end)
const T*
text,
3101 _In_ size_t start = 0,
3102 _In_ size_t end = (
size_t)-1,
3105 _Assume_(
text || start >= end);
3106 if (start < end &&
text[start]) {
3107 if (
text[start] ==
'-' ||
3108 text[start] ==
'.' ||
3109 text[start] ==
'_' ||
3110 text[start] ==
'~' ||
3111 text[start] ==
'%' ||
3112 text[start] ==
'!' ||
3113 text[start] ==
'$' ||
3114 text[start] ==
'&' ||
3115 text[start] ==
'\'' ||
3116 text[start] ==
'(' ||
3117 text[start] ==
')' ||
3118 text[start] ==
'*' ||
3119 text[start] ==
'+' ||
3120 text[start] ==
',' ||
3121 text[start] ==
';' ||
3122 text[start] ==
'=' ||
3123 text[start] ==
':' ||
3124 std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::alnum,
text[start]))
3152 _In_reads_or_z_(end)
const char*
text,
3153 _In_ size_t start = 0,
3154 _In_ size_t end = (
size_t)-1,
3157 _Assume_(
text || start >= end);
3158 if (start < end &&
text[start]) {
3162 if (((
chr[0] ==
L'-' ||
3178 chr[0] ==
L':') &&
chr[1] == 0) ||
3200 _In_reads_or_z_(end)
const T*
text,
3201 _In_ size_t start = 0,
3202 _In_ size_t end = (
size_t)-1,
3205 _Assume_(
text || start >= end);
3206 if (start < end &&
text[start]) {
3207 if (
text[start] ==
'/' ||
3208 text[start] ==
'-' ||
3209 text[start] ==
'.' ||
3210 text[start] ==
'_' ||
3211 text[start] ==
'~' ||
3212 text[start] ==
'%' ||
3213 text[start] ==
'!' ||
3214 text[start] ==
'$' ||
3215 text[start] ==
'&' ||
3216 text[start] ==
'\'' ||
3217 text[start] ==
'(' ||
3218 text[start] ==
')' ||
3219 text[start] ==
'*' ||
3220 text[start] ==
'+' ||
3221 text[start] ==
',' ||
3222 text[start] ==
';' ||
3223 text[start] ==
'=' ||
3224 text[start] ==
':' ||
3225 text[start] ==
'@' ||
3226 text[start] ==
'?' ||
3227 text[start] ==
'#' ||
3228 std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::alnum,
text[start]))
3256 _In_reads_or_z_(end)
const char*
text,
3257 _In_ size_t start = 0,
3258 _In_ size_t end = (
size_t)-1,
3261 _Assume_(
text || start >= end);
3262 if (start < end &&
text[start]) {
3266 if (((
chr[0] ==
L'/' ||
3286 chr[0] ==
L'#') &&
chr[1] == 0) ||
3309 _In_ const std::locale& locale = std::locale()) :
3317 _In_reads_or_z_(end)
const T*
text,
3318 _In_ size_t start = 0,
3319 _In_ size_t end = (
size_t)-1,
3322 _Assume_(
text || start >= end);
3408 virtual void invalidate()
3425 std::shared_ptr<basic_parser<T>> m_path_char;
3426 std::shared_ptr<basic_parser<T>> m_query_start;
3427 std::shared_ptr<basic_parser<T>> m_bookmark_start;
3463 _In_ const std::locale& locale = std::locale()) :
3484 _In_reads_or_z_(end)
const T*
text,
3485 _In_ size_t start = 0,
3486 _In_ size_t end = (
size_t)-1,
3489 _Assume_(
text || start >= end);
3494 m_colon->match(
text, http_scheme->interval.end, end,
flags) &&
3495 m_slash->match(
text, m_colon->interval.end, end,
flags) &&
3496 m_slash->match(
text, m_slash->interval.end, end,
flags))
3500 ftp_scheme->invalidate();
3501 mailto_scheme->invalidate();
3502 file_scheme->invalidate();
3505 m_colon->match(
text, ftp_scheme->interval.end, end,
flags) &&
3506 m_slash->match(
text, m_colon->interval.end, end,
flags) &&
3507 m_slash->match(
text, m_slash->interval.end, end,
flags))
3511 http_scheme->invalidate();
3512 mailto_scheme->invalidate();
3513 file_scheme->invalidate();
3516 m_colon->match(
text, mailto_scheme->interval.end, end,
flags))
3520 http_scheme->invalidate();
3521 ftp_scheme->invalidate();
3522 file_scheme->invalidate();
3525 m_colon->match(
text, file_scheme->interval.end, end,
flags) &&
3526 m_slash->match(
text, m_colon->interval.end, end,
flags) &&
3527 m_slash->match(
text, m_slash->interval.end, end,
flags))
3531 http_scheme->invalidate();
3532 ftp_scheme->invalidate();
3533 mailto_scheme->invalidate();
3537 http_scheme->invalidate();
3538 ftp_scheme->invalidate();
3539 mailto_scheme->invalidate();
3540 file_scheme->invalidate();
3543 if (ftp_scheme->interval) {
3545 if (m_colon->match(
text, username->interval.end, end,
flags) &&
3546 password->match(
text, m_colon->interval.end, end,
flags) &&
3547 m_at->match(
text, password->interval.end, end,
flags))
3555 password->invalidate();
3558 username->invalidate();
3559 password->invalidate();
3563 username->invalidate();
3564 password->invalidate();
3570 ipv6_host->invalidate();
3571 dns_host->invalidate();
3575 ipv6_host->match(
text, m_ip_lbracket->interval.end, end,
flags) &&
3576 m_ip_rbracket->match(
text, ipv6_host->interval.end, end,
flags))
3580 ipv4_host->invalidate();
3581 dns_host->invalidate();
3586 ipv4_host->invalidate();
3587 ipv6_host->invalidate();
3595 port->match(
text, m_colon->interval.end, end,
flags))
3612 if (mailto_scheme->interval) {
3614 m_at->match(
text, username->interval.end, end,
flags))
3625 ipv4_host->match(
text, m_ip_lbracket->interval.end, end,
flags) &&
3626 m_ip_rbracket->match(
text, ipv4_host->interval.end, end,
flags))
3630 ipv6_host->invalidate();
3631 dns_host->invalidate();
3635 ipv6_host->match(
text, m_ip_lbracket->interval.end, end,
flags) &&
3636 m_ip_rbracket->match(
text, ipv6_host->interval.end, end,
flags))
3640 ipv4_host->invalidate();
3641 dns_host->invalidate();
3646 ipv4_host->invalidate();
3647 ipv6_host->invalidate();
3654 password->invalidate();
3661 if (file_scheme->interval) {
3667 username->invalidate();
3668 password->invalidate();
3669 ipv4_host->invalidate();
3670 ipv6_host->invalidate();
3671 dns_host->invalidate();
3680 if (http_scheme->interval &&
3683 if (m_colon->match(
text, username->interval.end, end,
flags) &&
3684 password->match(
text, m_colon->interval.end, end,
flags) &&
3685 m_at->match(
text, password->interval.end, end,
flags))
3690 else if (m_at->match(
text, username->interval.end, end,
flags)) {
3693 password->invalidate();
3696 username->invalidate();
3697 password->invalidate();
3701 username->invalidate();
3702 password->invalidate();
3708 ipv6_host->invalidate();
3709 dns_host->invalidate();
3713 ipv6_host->match(
text, m_ip_lbracket->interval.end, end,
flags) &&
3714 m_ip_rbracket->match(
text, ipv6_host->interval.end, end,
flags))
3718 ipv4_host->invalidate();
3719 dns_host->invalidate();
3724 ipv4_host->invalidate();
3725 ipv6_host->invalidate();
3733 port->match(
text, m_colon->interval.end, end,
flags))
3750 virtual void invalidate()
3752 http_scheme->invalidate();
3753 ftp_scheme->invalidate();
3754 mailto_scheme->invalidate();
3755 file_scheme->invalidate();
3756 username->invalidate();
3757 password->invalidate();
3758 ipv4_host->invalidate();
3759 ipv6_host->invalidate();
3760 dns_host->invalidate();
3767 std::shared_ptr<basic_parser<T>> http_scheme;
3768 std::shared_ptr<basic_parser<T>> ftp_scheme;
3769 std::shared_ptr<basic_parser<T>> mailto_scheme;
3770 std::shared_ptr<basic_parser<T>> file_scheme;
3771 std::shared_ptr<basic_parser<T>> username;
3772 std::shared_ptr<basic_parser<T>> password;
3773 std::shared_ptr<basic_parser<T>> ipv4_host;
3774 std::shared_ptr<basic_parser<T>> ipv6_host;
3775 std::shared_ptr<basic_parser<T>> dns_host;
3776 std::shared_ptr<basic_parser<T>> port;
3777 std::shared_ptr<basic_parser<T>> path;
3780 std::shared_ptr<basic_parser<T>> m_colon;
3781 std::shared_ptr<basic_parser<T>> m_slash;
3782 std::shared_ptr<basic_parser<T>> m_at;
3783 std::shared_ptr<basic_parser<T>> m_ip_lbracket;
3784 std::shared_ptr<basic_parser<T>> m_ip_rbracket;
3811 _In_ const std::locale& locale = std::locale()) :
3823 _In_reads_or_z_(end)
const T*
text,
3824 _In_ size_t start = 0,
3825 _In_ size_t end = (
size_t)-1,
3828 _Assume_(
text || start >= end);
3830 if (username->match(
text, start, end,
flags) &&
3831 m_at->match(
text, username->interval.end, end,
flags))
3834 if (m_ip_lbracket->match(
text, m_at->interval.end, end,
flags) &&
3835 ipv4_host->match(
text, m_ip_lbracket->interval.end, end,
flags) &&
3836 m_ip_rbracket->match(
text, ipv4_host->interval.end, end,
flags))
3840 ipv6_host->invalidate();
3841 dns_host->invalidate();
3844 m_ip_lbracket->match(
text, m_at->interval.end, end,
flags) &&
3845 ipv6_host->match(
text, m_ip_lbracket->interval.end, end,
flags) &&
3846 m_ip_rbracket->match(
text, ipv6_host->interval.end, end,
flags))
3850 ipv4_host->invalidate();
3851 dns_host->invalidate();
3853 else if (dns_host->match(
text, m_at->interval.end, end,
flags)) {
3856 ipv4_host->invalidate();
3857 ipv6_host->invalidate();
3866 username->invalidate();
3867 ipv4_host->invalidate();
3868 ipv6_host->invalidate();
3869 dns_host->invalidate();
3874 virtual void invalidate()
3876 username->invalidate();
3877 ipv4_host->invalidate();
3878 ipv6_host->invalidate();
3879 dns_host->invalidate();
3884 std::shared_ptr<basic_parser<T>> username;
3885 std::shared_ptr<basic_parser<T>> ipv4_host;
3886 std::shared_ptr<basic_parser<T>> ipv6_host;
3887 std::shared_ptr<basic_parser<T>> dns_host;
3890 std::shared_ptr<basic_parser<T>> m_at;
3891 std::shared_ptr<basic_parser<T>> m_ip_lbracket;
3892 std::shared_ptr<basic_parser<T>> m_ip_rbracket;
3917 _In_ const std::locale& locale = std::locale()) :
3927 _In_reads_or_z_(end)
const T*
text,
3928 _In_ size_t start = 0,
3929 _In_ size_t end = (
size_t)-1,
3932 _Assume_(
text || start >= end);
3938 mouth->invalidate();
3955 hit_offset =
mouth->hit_offset;
3966 hit_offset =
mouth->hit_offset;
3981 mouth->invalidate();
3986 virtual void invalidate()
3992 mouth->invalidate();
3998 std::shared_ptr<basic_parser<T>>
apex;
3999 std::shared_ptr<basic_parser<T>>
eyes;
4000 std::shared_ptr<basic_parser<T>>
nose;
4016 enum date_format_t {
4017 date_format_none = 0,
4018 date_format_dmy = 0x1,
4019 date_format_mdy = 0x2,
4020 date_format_ymd = 0x4,
4021 date_format_ym = 0x8,
4022 date_format_my = 0x10,
4023 date_format_dm = 0x20,
4024 date_format_md = 0x40,
4041 _In_ const std::locale& locale = std::locale()) :
4043 format(date_format_none),
4048 m_separator(separator),
4053 _In_reads_or_z_(end)
const T*
text,
4054 _In_ size_t start = 0,
4055 _In_ size_t end = (
size_t)-1,
4058 _Assume_(
text || start >= end);
4061 if ((m_format_mask & date_format_dmy) == date_format_dmy) {
4062 if (day->match(
text, start, end,
flags)) {
4065 size_t hit_offset = m_separator->hit_offset;
4070 m_separator->hit_offset == hit_offset)
4074 is_valid(day->value, month->value))
4078 format = date_format_dmy;
4087 if ((m_format_mask & date_format_mdy) == date_format_mdy) {
4088 if (month->match(
text, start, end,
flags)) {
4091 size_t hit_offset = m_separator->hit_offset;
4096 m_separator->hit_offset == hit_offset)
4100 is_valid(day->value, month->value))
4104 format = date_format_mdy;
4113 if ((m_format_mask & date_format_ymd) == date_format_ymd) {
4114 if (year->match(
text, start, end,
flags)) {
4117 size_t hit_offset = m_separator->hit_offset;
4122 m_separator->hit_offset == hit_offset)
4126 is_valid(day->value, month->value))
4130 format = date_format_ymd;
4139 if ((m_format_mask & date_format_ym) == date_format_ym) {
4140 if (year->match(
text, start, end,
flags)) {
4145 is_valid((
size_t)-1, month->value))
4147 if (day) day->invalidate();
4150 format = date_format_ym;
4157 if ((m_format_mask & date_format_my) == date_format_my) {
4158 if (month->match(
text, start, end,
flags)) {
4163 is_valid((
size_t)-1, month->value))
4165 if (day) day->invalidate();
4168 format = date_format_my;
4175 if ((m_format_mask & date_format_dm) == date_format_dm) {
4176 if (day->match(
text, start, end,
flags)) {
4179 size_t hit_offset = m_separator->hit_offset;
4182 is_valid(day->value, month->value))
4184 if (year) year->invalidate();
4188 m_separator->hit_offset == hit_offset)
4192 format = date_format_dm;
4199 if ((m_format_mask & date_format_md) == date_format_md) {
4200 if (month->match(
text, start, end,
flags)) {
4203 size_t hit_offset = m_separator->hit_offset;
4206 is_valid(day->value, month->value))
4208 if (year) year->invalidate();
4212 m_separator->hit_offset == hit_offset)
4216 format = date_format_md;
4223 if (day) day->invalidate();
4224 if (month) month->invalidate();
4225 if (year) year->invalidate();
4226 format = date_format_none;
4231 virtual void invalidate()
4233 if (day) day->invalidate();
4234 if (month) month->invalidate();
4235 if (year) year->invalidate();
4236 format = date_format_none;
4241 static inline bool is_valid(
size_t day,
size_t month)
4243 if (month == (
size_t)-1) {
4247 if (day == (
size_t)-1) {
4260 return 1 <= day && day <= 31;
4262 return 1 <= day && day <= 29;
4267 return 1 <= day && day <= 30;
4274 date_format_t format;
4275 std::shared_ptr<basic_integer<T>> day;
4276 std::shared_ptr<basic_integer<T>> month;
4277 std::shared_ptr<basic_integer<T>> year;
4281 std::shared_ptr<basic_set<T>> m_separator;
4282 std::shared_ptr<basic_parser<T>> m_space;
4308 _In_ const std::locale& locale = std::locale()) :
4314 m_separator(separator),
4319 _In_reads_or_z_(end)
const T*
text,
4320 _In_ size_t start = 0,
4321 _In_ size_t end = (
size_t)-1,
4324 _Assume_(
text || start >= end);
4326 if (hour->match(
text, start, end,
flags) &&
4327 m_separator->match(
text, hour->interval.end, end,
flags) &&
4328 minute->match(
text, m_separator->interval.end, end,
flags) &&
4332 size_t hit_offset = m_separator->hit_offset;
4333 if (m_separator->match(
text, minute->interval.end, end,
flags) &&
4334 m_separator->hit_offset == hit_offset &&
4335 second && second->match(
text, m_separator->interval.end, end,
flags) &&
4339 if (m_millisecond_separator && m_millisecond_separator->match(
text, second->interval.end, end,
flags) &&
4340 millisecond && millisecond->match(
text, m_millisecond_separator->interval.end, end,
flags) &&
4341 millisecond->value < 1000)
4347 if (millisecond) millisecond->invalidate();
4352 if (second) second->invalidate();
4353 if (millisecond) millisecond->invalidate();
4361 minute->invalidate();
4362 if (second) second->invalidate();
4363 if (millisecond) millisecond->invalidate();
4368 virtual void invalidate()
4371 minute->invalidate();
4372 if (second) second->invalidate();
4373 if (millisecond) millisecond->invalidate();
4378 std::shared_ptr<basic_integer10<T>> hour;
4379 std::shared_ptr<basic_integer10<T>> minute;
4380 std::shared_ptr<basic_integer10<T>> second;
4381 std::shared_ptr<basic_integer10<T>> millisecond;
4384 std::shared_ptr<basic_set<T>> m_separator;
4385 std::shared_ptr<basic_parser<T>> m_millisecond_separator;
4412 _In_ const std::locale& locale = std::locale()) :
4424 _In_reads_or_z_(end)
const T*
text,
4425 _In_ size_t start = 0,
4426 _In_ size_t end = (
size_t)-1,
4429 _Assume_(
text || start >= end);
4434 degree_separator->match(
text, degree->interval.end, end,
flags))
4437 this->
interval.
end = degree_separator->interval.end;
4440 degree->invalidate();
4441 degree_separator->invalidate();
4445 minute->value < 60 &&
4446 minute_separator->match(
text, minute->interval.end, end,
flags))
4449 this->
interval.
end = minute_separator->interval.end;
4452 minute->invalidate();
4453 minute_separator->invalidate();
4462 this->
interval.
end = second_separator->interval.end;
4464 if (second_separator) second_separator->invalidate();
4467 if (second) second->invalidate();
4468 if (second_separator) second_separator->invalidate();
4471 if (degree->interval.start < degree->interval.end ||
4472 minute->interval.start < minute->interval.end ||
4473 (second && second->interval.start < second->interval.end))
4480 decimal->invalidate();
4484 if (decimal) decimal->invalidate();
4489 virtual void invalidate()
4491 degree->invalidate();
4492 degree_separator->invalidate();
4493 minute->invalidate();
4494 minute_separator->invalidate();
4495 if (second) second->invalidate();
4496 if (second_separator) second_separator->invalidate();
4497 if (decimal) decimal->invalidate();
4502 std::shared_ptr<basic_integer10<T>> degree;
4503 std::shared_ptr<basic_parser<T>> degree_separator;
4504 std::shared_ptr<basic_integer10<T>> minute;
4505 std::shared_ptr<basic_parser<T>> minute_separator;
4506 std::shared_ptr<basic_integer10<T>> second;
4507 std::shared_ptr<basic_parser<T>> second_separator;
4508 std::shared_ptr<basic_parser<T>> decimal;
4534 _In_ const std::locale& locale = std::locale()) :
4540 m_separator(separator),
4545 _In_reads_or_z_(end)
const T*
text,
4546 _In_ size_t start = 0,
4547 _In_ size_t end = (
size_t)-1,
4550 _Assume_(
text || start >= end);
4558 m_lparenthesis->invalidate();
4559 m_rparenthesis->invalidate();
4562 value.append(
text + m_plus_sign->interval.start,
text + m_plus_sign->interval.end);
4573 value.append(
text + m_digit->interval.start,
text + m_digit->interval.end);
4584 m_lparenthesis && !m_lparenthesis->interval &&
4585 m_rparenthesis && !m_rparenthesis->interval &&
4589 value.append(
text + m_lparenthesis->interval.start, m_lparenthesis->interval.size());
4590 this->
interval.
end = m_lparenthesis->interval.end;
4597 m_rparenthesis && !m_rparenthesis->interval &&
4599 m_lparenthesis->hit_offset == m_rparenthesis->hit_offset)
4602 value.append(
text + m_rparenthesis->interval.start,
text + m_rparenthesis->interval.end);
4603 this->
interval.
end = m_rparenthesis->interval.end;
4644 virtual void invalidate()
4654 std::shared_ptr<basic_parser<T>> m_digit;
4655 std::shared_ptr<basic_parser<T>> m_plus_sign;
4656 std::shared_ptr<basic_set<T>> m_lparenthesis;
4657 std::shared_ptr<basic_set<T>> m_rparenthesis;
4658 std::shared_ptr<basic_parser<T>> m_separator;
4659 std::shared_ptr<basic_parser<T>> m_space;
4682 _In_ const std::locale& locale = std::locale()) :
4693 _In_reads_or_z_(end)
const T*
text,
4694 _In_ size_t start = 0,
4695 _In_ size_t end = (
size_t)-1,
4698 _Assume_(
text || start >= end);
4699 const auto&
ctype = std::use_facet<std::ctype<T>>(this->m_locale);
4707 { {
'A',
'D' }, {}, 24 },
4708 { {
'A',
'E' }, {}, 23 },
4709 { {
'A',
'L' }, {}, 28 },
4710 { {
'A',
'O' }, {}, 25 },
4711 { {
'A',
'T' }, {}, 20 },
4712 { {
'A',
'Z' }, {}, 28 },
4713 { {
'B',
'A' }, {
'3',
'9' }, 20},
4714 { {
'B',
'E' }, {}, 16 },
4715 { {
'B',
'F' }, {}, 28 },
4716 { {
'B',
'G' }, {}, 22 },
4717 { {
'B',
'H' }, {}, 22 },
4718 { {
'B',
'I' }, {}, 27 },
4719 { {
'B',
'J' }, {}, 28 },
4720 { {
'B',
'R' }, {}, 29 },
4721 { {
'B',
'Y' }, {}, 28 },
4722 { {
'C',
'F' }, {}, 27 },
4723 { {
'C',
'G' }, {}, 27 },
4724 { {
'C',
'H' }, {}, 21 },
4725 { {
'C',
'I' }, {}, 28 },
4726 { {
'C',
'M' }, {}, 27 },
4727 { {
'C',
'R' }, {}, 22 },
4728 { {
'C',
'V' }, {}, 25 },
4729 { {
'C',
'Y' }, {}, 28 },
4730 { {
'C',
'Z' }, {}, 24 },
4731 { {
'D',
'E' }, {}, 22 },
4732 { {
'D',
'J' }, {}, 27 },
4733 { {
'D',
'K' }, {}, 18 },
4734 { {
'D',
'O' }, {}, 28 },
4735 { {
'D',
'Z' }, {}, 26 },
4736 { {
'E',
'E' }, {}, 20 },
4737 { {
'E',
'G' }, {}, 29 },
4738 { {
'E',
'S' }, {}, 24 },
4739 { {
'F',
'I' }, {}, 18 },
4740 { {
'F',
'O' }, {}, 18 },
4741 { {
'F',
'R' }, {}, 27 },
4742 { {
'G',
'A' }, {}, 27 },
4743 { {
'G',
'B' }, {}, 22 },
4744 { {
'G',
'E' }, {}, 22 },
4745 { {
'G',
'I' }, {}, 23 },
4746 { {
'G',
'L' }, {}, 18 },
4747 { {
'G',
'Q' }, {}, 27 },
4748 { {
'G',
'R' }, {}, 27 },
4749 { {
'G',
'T' }, {}, 28 },
4750 { {
'G',
'W' }, {}, 25 },
4751 { {
'H',
'N' }, {}, 28 },
4752 { {
'H',
'R' }, {}, 21 },
4753 { {
'H',
'U' }, {}, 28 },
4754 { {
'I',
'E' }, {}, 22 },
4755 { {
'I',
'L' }, {}, 23 },
4756 { {
'I',
'Q' }, {}, 23 },
4757 { {
'I',
'R' }, {}, 26 },
4758 { {
'I',
'S' }, {}, 26 },
4759 { {
'I',
'T' }, {}, 27 },
4760 { {
'J',
'O' }, {}, 30 },
4761 { {
'K',
'M' }, {}, 27 },
4762 { {
'K',
'W' }, {}, 30 },
4763 { {
'K',
'Z' }, {}, 20 },
4764 { {
'L',
'B' }, {}, 28 },
4765 { {
'L',
'C' }, {}, 32 },
4766 { {
'L',
'I' }, {}, 21 },
4767 { {
'L',
'T' }, {}, 20 },
4768 { {
'L',
'U' }, {}, 20 },
4769 { {
'L',
'V' }, {}, 21 },
4770 { {
'L',
'Y' }, {}, 25 },
4771 { {
'M',
'A' }, {}, 28 },
4772 { {
'M',
'C' }, {}, 27 },
4773 { {
'M',
'D' }, {}, 24 },
4774 { {
'M',
'E' }, {
'2',
'5' }, 22 },
4775 { {
'M',
'G' }, {}, 27 },
4776 { {
'M',
'K' }, {
'0',
'7' }, 19 },
4777 { {
'M',
'L' }, {}, 28 },
4778 { {
'M',
'R' }, {
'1',
'3' }, 27},
4779 { {
'M',
'T' }, {}, 31 },
4780 { {
'M',
'U' }, {}, 30 },
4781 { {
'M',
'Z' }, {}, 25 },
4782 { {
'N',
'E' }, {}, 28 },
4783 { {
'N',
'I' }, {}, 32 },
4784 { {
'N',
'L' }, {}, 18 },
4785 { {
'N',
'O' }, {}, 15 },
4786 { {
'P',
'K' }, {}, 24 },
4787 { {
'P',
'L' }, {}, 28 },
4788 { {
'P',
'S' }, {}, 29 },
4789 { {
'P',
'T' }, {
'5',
'0' }, 25 },
4790 { {
'Q',
'A' }, {}, 29 },
4791 { {
'R',
'O' }, {}, 24 },
4792 { {
'R',
'S' }, {
'3',
'5' }, 22 },
4793 { {
'R',
'U' }, {}, 33 },
4794 { {
'S',
'A' }, {}, 24 },
4795 { {
'S',
'C' }, {}, 31 },
4796 { {
'S',
'D' }, {}, 18 },
4797 { {
'S',
'E' }, {}, 24 },
4798 { {
'S',
'I' }, {
'5',
'6' }, 19 },
4799 { {
'S',
'K' }, {}, 24 },
4800 { {
'S',
'M' }, {}, 27 },
4801 { {
'S',
'N' }, {}, 28 },
4802 { {
'S',
'T' }, {}, 25 },
4803 { {
'S',
'V' }, {}, 28 },
4804 { {
'T',
'D' }, {}, 27 },
4805 { {
'T',
'G' }, {}, 28 },
4806 { {
'T',
'L' }, {
'3',
'8' }, 23},
4807 { {
'T',
'N' }, {
'5',
'9' }, 24 },
4808 { {
'T',
'R' }, {}, 26 },
4809 { {
'U',
'A' }, {}, 29 },
4810 { {
'V',
'A' }, {}, 22 },
4811 { {
'V',
'G' }, {}, 24 },
4812 { {
'X',
'K' }, {}, 20 },
4823 if (
chr <
'A' ||
'Z' <
chr)
4830 size_t m = (
l +
r) / 2;
4832 if (
c.country[0] <
this->country[0] || (
c.country[0] ==
this->country[0] &&
c.country[1] <
this->country[1]))
4834 else if (this->
country[0] < c.country[0] || (
this->country[0] ==
c.country[0] &&
this->country[1] <
c.country[1]))
4850 if ((country_desc->check_digits[0] &&
this->check_digits[0] !=
country_desc->check_digits[0]) ||
4863 if ((
'0' <=
chr &&
chr <=
'9') || (
'A' <=
chr &&
chr <=
'Z')) {
4875 for (
size_t i = 0; ; ++
i) {
4876 if (!this->
bban[
i]) {
4877 for (
i = 0;
i < 2; ++
i) {
4896 if (
'0' <= this->
bban[i] && this->
bban[i] <=
'9')
4898 else if (
'A' <= this->
bban[i] && this->
bban[i] <=
'J') {
4902 else if (
'K' <= this->
bban[i] && this->
bban[i] <=
'T') {
4906 else if (
'U' <= this->
bban[i] && this->
bban[i] <=
'Z') {
4921 for (; digit_count < 9 &&
normalized[next]; ++next, ++digit_count)
4937 virtual void invalidate()
4953 std::shared_ptr<basic_parser<T>> m_space;
4976 _In_ const std::locale& locale = std::locale()) :
4986 _In_reads_or_z_(end)
const T*
text,
4987 _In_ size_t start = 0,
4988 _In_ size_t end = (
size_t)-1,
4991 _Assume_(
text || start >= end);
4992 const auto&
ctype = std::use_facet<std::ctype<T>>(this->m_locale);
5014 for (
size_t j = 0;
j < 4; ++
j) {
5018 if ((
'0' <=
chr &&
chr <=
'9') || (
'A' <=
chr &&
chr <=
'Z')) {
5034 for (
size_t j = _countof(this->
reference) - 1 - n;
j;)
5040 for (
size_t i = 0; ; ++
i) {
5076 for (; digit_count < 9 &&
normalized[next]; ++next, ++digit_count)
5091 virtual void invalidate()
5105 std::shared_ptr<basic_parser<T>> m_space;
5129 _In_reads_or_z_(end)
const T*
text,
5130 _In_ size_t start = 0,
5131 _In_ size_t end = (
size_t)-1,
5134 _Assume_(
text || start >= end);
5174 _In_reads_or_z_(end)
const T*
text,
5175 _In_ size_t start = 0,
5176 _In_ size_t end = (
size_t)-1,
5179 _Assume_(
text || start >= end);
5180 if (start < end &&
text[start] ==
'-') {
5211 _In_ const std::locale& locale = std::locale()) :
5224 _In_reads_or_z_(end)
const T*
text,
5225 _In_ size_t start = 0,
5226 _In_ size_t end = (
size_t)-1,
5229 _Assume_(
text || start >= end);
5230 const auto&
ctype = std::use_facet<std::ctype<T>>(this->m_locale);
5247 this->
part1.invalidate();
5248 this->
part2.invalidate();
5249 this->
part3.invalidate();
5250 if (this->
model[0] ==
'9' && this->
model[1] ==
'9') {
5275 if (this->
model[0] ==
'0' && this->
model[1] ==
'0')
5286 else if (this->
model[0] ==
'0' && this->
model[1] ==
'1')
5305 else if (this->
model[0] ==
'0' && this->
model[1] ==
'2')
5313 else if (this->
model[0] ==
'0' && this->
model[1] ==
'3')
5322 else if (this->
model[0] ==
'0' && this->
model[1] ==
'4')
5330 else if ((this->
model[0] ==
'0' || this->
model[0] ==
'5') && this->
model[1] ==
'5')
5344 else if (this->
model[0] ==
'0' && this->
model[1] ==
'6')
5357 else if (this->
model[0] ==
'0' && this->
model[1] ==
'7')
5368 else if (this->
model[0] ==
'0' && this->
model[1] ==
'8')
5378 else if (this->
model[0] ==
'0' && this->
model[1] ==
'9')
5396 else if (this->
model[0] ==
'1' && this->
model[1] ==
'0')
5412 (this->
model[0] ==
'1' && (this->
model[1] ==
'1' || this->
model[1] ==
'8' || this->
model[1] ==
'9')) ||
5413 ((this->
model[0] ==
'2' || this->
model[0] ==
'3') && this->
model[1] ==
'8') ||
5414 (this->
model[0] ==
'4' && (this->
model[1] ==
'0' || this->
model[1] ==
'1' || this->
model[1] ==
'8' || this->
model[1] ==
'9')) ||
5415 (this->
model[0] ==
'5' && (this->
model[1] ==
'1' || this->
model[1] ==
'8')))
5428 else if (this->
model[0] ==
'1' && this->
model[1] ==
'2')
5436 else if ((this->
model[0] ==
'2' || this->
model[0] ==
'3') && this->
model[1] ==
'1')
5458 virtual void invalidate()
5461 this->
part1.invalidate();
5462 this->
part2.invalidate();
5463 this->
part3.invalidate();
5469 static bool check11(
5482 static bool check11(
5499 static bool check11(
5528 std::shared_ptr<basic_parser<T>> m_space;
5552 _In_ const std::locale& locale = std::locale()) :
5562 _In_reads_or_z_(end)
const T*
text,
5563 _In_ size_t start = 0,
5564 _In_ size_t end = (
size_t)-1,
5567 _Assume_(
text || start >= end);
5597 virtual void invalidate()
5609 std::shared_ptr<basic_parser<T>> m_element;
5610 std::shared_ptr<basic_parser<T>> m_digit;
5611 std::shared_ptr<basic_parser<T>> m_sign;
5630 _In_reads_or_z_(end)
const char*
text,
5631 _In_ size_t start = 0,
5632 _In_ size_t end = (
size_t)-1,
5635 _Assume_(
text || start >= end);
5666 _In_reads_or_z_(end)
const char*
text,
5667 _In_ size_t start = 0,
5668 _In_ size_t end = (
size_t)-1,
5671 _Assume_(
text || start >= end);
5703 _In_reads_or_z_(end)
const char*
text,
5704 _In_ size_t start = 0,
5705 _In_ size_t end = (
size_t)-1,
5708 _Assume_(
text || start >= end);
5737 _In_reads_or_z_(end)
const char*
text,
5738 _In_ size_t start = 0,
5739 _In_ size_t end = (
size_t)-1,
5742 _Assume_(
text || start >= end);
5791 _In_reads_or_z_(end)
const char*
text,
5792 _In_ size_t start = 0,
5793 _In_ size_t end = (
size_t)-1,
5796 _Assume_(
text || start >= end);
5836 virtual void invalidate()
5840 parser::invalidate();
5857 _In_reads_or_z_(end)
const char*
text,
5858 _In_ size_t start = 0,
5859 _In_ size_t end = (
size_t)-1,
5862 _Assume_(
text || start >= end);
5871 string.invalidate();
5882 virtual void invalidate()
5884 string.invalidate();
5886 parser::invalidate();
5901 _In_reads_or_z_(end)
const char*
text,
5902 _In_ size_t start = 0,
5903 _In_ size_t end = (
size_t)-1,
5906 _Assume_(
text || start >= end);
5934 virtual void invalidate()
5938 parser::invalidate();
5956 _In_reads_or_z_(end)
const char*
text,
5957 _In_ size_t start = 0,
5958 _In_ size_t end = (
size_t)-1,
5961 _Assume_(
text || start >= end);
5962 if (start + 2 < end &&
5963 text[start] ==
'*' &&
5964 text[start + 1] ==
'/' &&
5965 text[start + 2] ==
'*')
5970 else if (start < end &&
text[start] ==
'*') {
5988 _In_reads_or_z_(end)
const char*
text,
5989 _In_ size_t start = 0,
5990 _In_ size_t end = (
size_t)-1,
5993 _Assume_(
text || start >= end);
6016 subtype.invalidate();
6021 virtual void invalidate()
6024 subtype.invalidate();
6025 parser::invalidate();
6043 _In_reads_or_z_(end)
const char*
text,
6044 _In_ size_t start = 0,
6045 _In_ size_t end = (
size_t)-1,
6048 _Assume_(
text || start >= end);
6049 if (!http_media_range::match(
text, start, end,
flags))
6063 params.push_back(std::move(
param));
6078 http_media_range::invalidate();
6084 virtual void invalidate()
6087 http_media_range::invalidate();
6091 std::list<http_parameter> params;
6101 _In_reads_or_z_(end)
const char*
text,
6102 _In_ size_t start = 0,
6103 _In_ size_t end = (
size_t)-1,
6106 _Assume_(
text || start >= end);
6143 _In_reads_or_z_(end)
const char*
text,
6144 _In_ size_t start = 0,
6145 _In_ size_t end = (
size_t)-1,
6148 _Assume_(
text || start >= end);
6177 virtual void invalidate()
6180 parser::invalidate();
6194 _In_reads_or_z_(end)
const char*
text,
6195 _In_ size_t start = 0,
6196 _In_ size_t end = (
size_t)-1,
6199 _Assume_(
text || start >= end);
6227 _In_reads_or_z_(end)
const char*
text,
6228 _In_ size_t start = 0,
6229 _In_ size_t end = (
size_t)-1,
6232 _Assume_(
text || start >= end);
6266 virtual void invalidate()
6269 parser::invalidate();
6283 _In_reads_or_z_(end)
const char*
text,
6284 _In_ size_t start = 0,
6285 _In_ size_t end = (
size_t)-1,
6288 _Assume_(
text || start >= end);
6343 virtual void invalidate()
6349 parser::invalidate();
6363 http_url(
_In_ const std::locale& locale = std::locale()) :
6369 _In_reads_or_z_(end)
const char*
text,
6370 _In_ size_t start = 0,
6371 _In_ size_t end = (
size_t)-1,
6374 _Assume_(
text || start >= end);
6394 server.invalidate();
6420 params.push_back(std::move(
param));
6435 server.invalidate();
6443 virtual void invalidate()
6445 server.invalidate();
6449 parser::invalidate();
6456 std::list<http_url_parameter> params;
6466 _In_reads_or_z_(end)
const char*
text,
6467 _In_ size_t start = 0,
6468 _In_ size_t end = (
size_t)-1,
6471 _Assume_(
text || start >= end);
6479 if (
k.end < end &&
text[
k.end]) {
6491 components.push_back(
k);
6503 if (!components.empty()) {
6512 virtual void invalidate()
6515 parser::invalidate();
6519 std::vector<stdex::interval<size_t>> components;
6534 _In_reads_or_z_(end)
const char*
text,
6535 _In_ size_t start = 0,
6536 _In_ size_t end = (
size_t)-1,
6539 _Assume_(
text || start >= end);
6581 virtual void invalidate()
6584 parser::invalidate();
6598 _In_reads_or_z_(end)
const char*
text,
6599 _In_ size_t start = 0,
6600 _In_ size_t end = (
size_t)-1,
6603 _Assume_(
text || end <= start);
6604 if (start < end &&
text[start] ==
'*') {
6616 template <
class T,
class T_asterisk = http_asterisk>
6626 _In_reads_or_z_(end)
const char*
text,
6627 _In_ size_t start = 0,
6628 _In_ size_t end = (
size_t)-1,
6631 _Assume_(
text || start >= end);
6640 asterisk.invalidate();
6643 asterisk.invalidate();
6665 factor.invalidate();
6672 virtual void invalidate()
6674 asterisk.invalidate();
6676 factor.invalidate();
6677 parser::invalidate();
6693 _In_reads_or_z_(end)
const char*
text,
6694 _In_ size_t start = 0,
6695 _In_ size_t end = (
size_t)-1,
6698 _Assume_(
text || start >= end);
6730 virtual void invalidate()
6734 parser::invalidate();
6752 _In_reads_or_z_(end)
const char*
text,
6753 _In_ size_t start = 0,
6754 _In_ size_t end = (
size_t)-1,
6757 _Assume_(
text || start >= end);
6810 virtual void invalidate()
6815 parser::invalidate();
6834 _In_reads_or_z_(end)
const char*
text,
6835 _In_ size_t start = 0,
6836 _In_ size_t end = (
size_t)-1,
6839 _Assume_(
text || start >= end);
6889 virtual void invalidate()
6895 parser::invalidate();
6915 _In_reads_or_z_(end)
const char*
text,
6916 _In_ size_t start = 0,
6917 _In_ size_t end = (
size_t)-1,
6920 _Assume_(
text || start >= end);
6966 version_min.
start = 1;
6967 version_min.
end = 0;
6983 version_maj.
start = 1;
6984 version_maj.
end = 0;
6985 version_min.
start = 1;
6986 version_min.
end = 0;
6993 virtual void invalidate()
6997 version_maj.
start = 1;
6998 version_maj.
end = 0;
6999 version_min.
start = 1;
7000 version_min.
end = 0;
7002 parser::invalidate();
7025 _In_reads_or_z_(end)
const char*
text,
7026 _In_ size_t start = 0,
7027 _In_ size_t end = (
size_t)-1,
7030 _Assume_(
text || start >= end);
7079 protocol.invalidate();
7126 protocol.invalidate();
7132 virtual void invalidate()
7137 protocol.invalidate();
7138 parser::invalidate();
7157 _In_reads_or_z_(end)
const char*
text,
7158 _In_ size_t start = 0,
7159 _In_ size_t end = (
size_t)-1,
7162 _Assume_(
text || start >= end);
7242 virtual void invalidate()
7248 parser::invalidate();
7262 template <
class _Key,
class T>
7267 _In_reads_or_z_(end)
const char*
text,
7268 _In_ size_t start = 0,
7269 _In_ size_t end = (
size_t)-1,
7272 while (start < end) {
7274 if (start < end &&
text[start] ==
',') {
7281 T::insert(std::move(
el));
7291 constexpr bool operator()(
const T&
a,
const T&
b)
const noexcept
7293 return a.factor.value >
b.factor.value;
7300 template <
class T,
class _Alloc = std::allocator<T>>
7322 _In_ const std::locale& locale = std::locale()) :
7338 _In_reads_or_z_(end)
const T*
text,
7339 _In_ size_t start = 0,
7340 _In_ size_t end = (
size_t)-1,
7343 _Assume_(
text || start >= end);
7355 if (m_quote->match(
text, m_escape->interval.end, end,
flags)) {
7356 value +=
'"'; this->
interval.
end = m_quote->interval.end;
7359 if (m_sol->match(
text, m_escape->interval.end, end,
flags)) {
7360 value +=
'/'; this->
interval.
end = m_sol->interval.end;
7363 if (m_bs->match(
text, m_escape->interval.end, end,
flags)) {
7364 value +=
'\b'; this->
interval.
end = m_bs->interval.end;
7367 if (m_ff->match(
text, m_escape->interval.end, end,
flags)) {
7368 value +=
'\f'; this->
interval.
end = m_ff->interval.end;
7371 if (m_lf->match(
text, m_escape->interval.end, end,
flags)) {
7372 value +=
'\n'; this->
interval.
end = m_lf->interval.end;
7375 if (m_cr->match(
text, m_escape->interval.end, end,
flags)) {
7376 value +=
'\r'; this->
interval.
end = m_cr->interval.end;
7379 if (m_htab->match(
text, m_escape->interval.end, end,
flags)) {
7380 value +=
'\t'; this->
interval.
end = m_htab->interval.end;
7384 m_uni->match(
text, m_escape->interval.end, end,
flags) &&
7385 m_hex->match(
text, m_uni->interval.end, std::min(m_uni->interval.end + 4, end),
flags | match_case_insensitive) &&
7386 m_hex->interval.size() == 4 )
7388 _Assume_(m_hex->value <= 0xffff);
7389 if (
sizeof(T) == 1) {
7390 if (m_hex->value > 0x7ff) {
7391 value += (T)(0xe0 | ((m_hex->value >> 12) & 0x0f));
7392 value += (T)(0x80 | ((m_hex->value >> 6) & 0x3f));
7393 value += (T)(0x80 | (m_hex->value & 0x3f));
7395 else if (m_hex->value > 0x7f) {
7396 value += (T)(0xc0 | ((m_hex->value >> 6) & 0x1f));
7397 value += (T)(0x80 | (m_hex->value & 0x3f));
7400 value += (T)(m_hex->value & 0x7f);
7403 value += (T)m_hex->value;
7407 if (m_escape->match(
text, m_escape->interval.end, end,
flags)) {
7408 value +=
'\\'; this->
interval.
end = m_escape->interval.end;
7413 value.Prilepi(
text + m_chr->interval.start, m_chr->interval.size());
7425 virtual void invalidate()
7432 std::basic_string<T> value;
7435 std::shared_ptr<basic_parser<T>> m_quote;
7436 std::shared_ptr<basic_parser<T>> m_chr;
7437 std::shared_ptr<basic_parser<T>> m_escape;
7438 std::shared_ptr<basic_parser<T>> m_sol;
7439 std::shared_ptr<basic_parser<T>> m_bs;
7440 std::shared_ptr<basic_parser<T>> m_ff;
7441 std::shared_ptr<basic_parser<T>> m_lf;
7442 std::shared_ptr<basic_parser<T>> m_cr;
7443 std::shared_ptr<basic_parser<T>> m_htab;
7444 std::shared_ptr<basic_parser<T>> m_uni;
7445 std::shared_ptr<basic_integer16<T>> m_hex;
7458#undef ENUM_FLAG_OPERATOR
Test for angle in d°mm'ss.dddd form.
Definition parser.hpp:4402
Test for any code unit.
Definition parser.hpp:228
Test for beginning of line.
Definition parser.hpp:622
Test for any.
Definition parser.hpp:1064
Test for Creditor Reference.
Definition parser.hpp:4972
T reference[22]
Normalized national reference number.
Definition parser.hpp:5101
T check_digits[3]
Two check digits.
Definition parser.hpp:5100
bool is_valid
Is reference valid per ISO 7064.
Definition parser.hpp:5102
Test for any code unit from a given string of code units.
Definition parser.hpp:727
Test for specific code unit.
Definition parser.hpp:298
Test for date.
Definition parser.hpp:4032
Test for valid DNS domain character.
Definition parser.hpp:2813
bool allow_on_edge
Is character allowed at the beginning or an end of a DNS domain?
Definition parser.hpp:2851
Test for DNS domain/hostname.
Definition parser.hpp:2913
bool m_allow_absolute
May DNS names end with a dot (absolute name)?
Definition parser.hpp:2977
Test for e-mail address.
Definition parser.hpp:3801
Test for emoticon.
Definition parser.hpp:3909
std::shared_ptr< basic_parser< T > > apex
apex/eyebrows/halo (e.g. O, 0)
Definition parser.hpp:3998
std::shared_ptr< basic_parser< T > > eyes
eyes (e.g. :, ;, >, |, B)
Definition parser.hpp:3999
std::shared_ptr< basic_set< T > > mouth
mouth (e.g. ), ), (, (, |, P, D, p, d)
Definition parser.hpp:4001
std::shared_ptr< basic_parser< T > > nose
nose (e.g. -, o)
Definition parser.hpp:4000
std::shared_ptr< basic_parser< T > > emoticon
emoticon as a whole (e.g. 😀, 🤔, 😶)
Definition parser.hpp:3997
Test for end of line.
Definition parser.hpp:660
Test for fraction.
Definition parser.hpp:1693
Test for International Bank Account Number.
Definition parser.hpp:4678
T bban[31]
Normalized Basic Bank Account Number.
Definition parser.hpp:4949
T country[3]
ISO 3166-1 alpha-2 country code.
Definition parser.hpp:4947
T check_digits[3]
Two check digits.
Definition parser.hpp:4948
bool is_valid
Is IBAN valid per ISO 7064.
Definition parser.hpp:4950
Test for decimal integer.
Definition parser.hpp:1302
Test for decimal integer possibly containing thousand separators.
Definition parser.hpp:1387
bool has_separators
Did integer have any separators?
Definition parser.hpp:1447
size_t digit_count
Total number of digits in integer.
Definition parser.hpp:1446
Test for hexadecimal integer.
Definition parser.hpp:1468
Base class for integer testing.
Definition parser.hpp:1280
size_t value
Calculated value of the numeral.
Definition parser.hpp:1294
Test for IPv4 address.
Definition parser.hpp:2353
stdex::interval< size_t > components[4]
Individual component intervals.
Definition parser.hpp:2468
struct in_addr value
IPv4 address value.
Definition parser.hpp:2469
Test for IPv6 address.
Definition parser.hpp:2572
std::shared_ptr< basic_parser< T > > scope_id
Scope ID (e.g. NIC index with link-local addresses)
Definition parser.hpp:2776
stdex::interval< size_t > components[8]
Individual component intervals.
Definition parser.hpp:2774
struct in6_addr value
IPv6 address value.
Definition parser.hpp:2775
Test for valid IPv6 address scope ID character.
Definition parser.hpp:2500
Test for repeating.
Definition parser.hpp:917
bool m_greedy
try to match as long sequence as possible
Definition parser.hpp:956
std::shared_ptr< basic_parser< T > > m_el
repeating element
Definition parser.hpp:953
size_t m_min_iterations
minimum number of iterations
Definition parser.hpp:954
size_t m_max_iterations
maximum number of iterations
Definition parser.hpp:955
Test for JSON string.
Definition parser.hpp:7308
Test for mixed numeral.
Definition parser.hpp:1929
std::shared_ptr< basic_parser< T > > fraction
fraction
Definition parser.hpp:2035
std::shared_ptr< basic_parser< T > > special_sign
Special sign (e.g. plus-minus '±')
Definition parser.hpp:2033
std::shared_ptr< basic_parser< T > > negative_sign
Negative sign.
Definition parser.hpp:2032
std::shared_ptr< basic_parser< T > > positive_sign
Positive sign.
Definition parser.hpp:2031
std::shared_ptr< basic_parser< T > > integer
Integer part.
Definition parser.hpp:2034
Test for monetary numeral.
Definition parser.hpp:2224
std::shared_ptr< basic_parser< T > > positive_sign
Positive sign.
Definition parser.hpp:2330
std::shared_ptr< basic_parser< T > > decimal_separator
Decimal separator.
Definition parser.hpp:2335
std::shared_ptr< basic_parser< T > > currency
Currency part.
Definition parser.hpp:2333
std::shared_ptr< basic_parser< T > > decimal
Decimal part.
Definition parser.hpp:2336
std::shared_ptr< basic_parser< T > > integer
Integer part.
Definition parser.hpp:2334
std::shared_ptr< basic_parser< T > > negative_sign
Negative sign.
Definition parser.hpp:2331
std::shared_ptr< basic_parser< T > > special_sign
Special sign (e.g. plus-minus '±')
Definition parser.hpp:2332
"No-op" match
Definition parser.hpp:196
Base template for all parsers.
Definition parser.hpp:77
interval< size_t > interval
Region of the last match.
Definition parser.hpp:176
Test for permutation.
Definition parser.hpp:1204
Test for phone number.
Definition parser.hpp:4525
std::basic_string< T > value
Normalized phone number.
Definition parser.hpp:4651
Test for any punctuation code unit.
Definition parser.hpp:470
Test for Roman numeral.
Definition parser.hpp:1577
Test for scientific numeral.
Definition parser.hpp:2055
std::shared_ptr< basic_parser< T > > special_sign
Special sign (e.g. plus-minus '±')
Definition parser.hpp:2199
std::shared_ptr< basic_parser< T > > exponent_symbol
Exponent symbol (e.g. 'e')
Definition parser.hpp:2203
std::shared_ptr< basic_parser< T > > positive_sign
Positive sign.
Definition parser.hpp:2197
std::shared_ptr< basic_parser< T > > negative_sign
Negative sign.
Definition parser.hpp:2198
double value
Calculated value of the numeral.
Definition parser.hpp:2207
std::shared_ptr< basic_parser< T > > negative_exp_sign
Negative exponent sign (e.g. '-')
Definition parser.hpp:2205
std::shared_ptr< basic_integer< T > > decimal
Decimal part.
Definition parser.hpp:2202
std::shared_ptr< basic_parser< T > > positive_exp_sign
Positive exponent sign (e.g. '+')
Definition parser.hpp:2204
std::shared_ptr< basic_integer< T > > exponent
Exponent part.
Definition parser.hpp:2206
std::shared_ptr< basic_parser< T > > decimal_separator
Decimal separator.
Definition parser.hpp:2201
std::shared_ptr< basic_integer< T > > integer
Integer part.
Definition parser.hpp:2200
Test for match score.
Definition parser.hpp:1756
Test for sequence.
Definition parser.hpp:1013
Definition parser.hpp:695
Test for SI Reference delimiter.
Definition parser.hpp:5169
Test for SI Reference part.
Definition parser.hpp:5124
Test for SI Reference.
Definition parser.hpp:5207
basic_si_reference_part< T > part3
Reference data part 3 (P3)
Definition parser.hpp:5524
basic_si_reference_part< T > part1
Reference data part 1 (P1)
Definition parser.hpp:5522
bool is_valid
Is reference valid.
Definition parser.hpp:5525
T model[3]
Reference model.
Definition parser.hpp:5521
basic_si_reference_part< T > part2
Reference data part 2 (P2)
Definition parser.hpp:5523
Test for signed numeral.
Definition parser.hpp:1843
std::shared_ptr< basic_parser< T > > special_sign
Special sign (e.g. plus-minus '±')
Definition parser.hpp:1911
std::shared_ptr< basic_parser< T > > negative_sign
Negative sign.
Definition parser.hpp:1910
std::shared_ptr< basic_parser< T > > positive_sign
Positive sign.
Definition parser.hpp:1909
std::shared_ptr< basic_parser< T > > number
Number.
Definition parser.hpp:1912
Test for any space code unit.
Definition parser.hpp:391
Test for any space or punctuation code unit.
Definition parser.hpp:544
Test for any string.
Definition parser.hpp:1132
Test for given string.
Definition parser.hpp:822
Test for time.
Definition parser.hpp:4299
Test for valid URL password character.
Definition parser.hpp:3095
Test for valid URL path character.
Definition parser.hpp:3195
Test for URL path.
Definition parser.hpp:3303
Test for valid URL username character.
Definition parser.hpp:2996
Test for URL.
Definition parser.hpp:3444
Test for HTTP agent.
Definition parser.hpp:6831
Test for HTTP any type.
Definition parser.hpp:5953
Test for HTTP asterisk.
Definition parser.hpp:6595
Test for HTTP cookie parameter (RFC2109)
Definition parser.hpp:6690
Test for HTTP cookie (RFC2109)
Definition parser.hpp:6749
std::list< http_cookie_parameter > params
List of cookie parameters.
Definition parser.hpp:6821
http_token name
Cookie name.
Definition parser.hpp:6819
http_value value
Cookie value.
Definition parser.hpp:6820
Test for HTTP language (RFC1766)
Definition parser.hpp:6463
Test for HTTP line break (RFC2616: CRLF | LF)
Definition parser.hpp:5627
Test for HTTP parameter (RFC2616: parameter)
Definition parser.hpp:5898
http_token name
Parameter name.
Definition parser.hpp:5942
http_value value
Parameter value.
Definition parser.hpp:5943
Test for HTTP protocol.
Definition parser.hpp:6907
uint16_t version
HTTP protocol version: 0x100 = 1.0, 0x101 = 1.1...
Definition parser.hpp:7009
Test for HTTP quoted string (RFC2616: quoted-string)
Definition parser.hpp:5788
stdex::interval< size_t > content
String content (without quotes)
Definition parser.hpp:5844
Test for HTTP request.
Definition parser.hpp:7016
Test for HTTP space (RFC2616: LWS)
Definition parser.hpp:5663
Test for HTTP text character (RFC2616: TEXT)
Definition parser.hpp:5700
Test for HTTP token (RFC2616: token - tolerates non-ASCII)
Definition parser.hpp:5734
Test for HTTP URL parameter.
Definition parser.hpp:6280
Test for HTTP URL path segment.
Definition parser.hpp:6191
Test for HTTP URL path segment.
Definition parser.hpp:6224
std::vector< http_url_path_segment > segments
Path segments.
Definition parser.hpp:6273
Test for HTTP URL port.
Definition parser.hpp:6135
Test for HTTP URL server.
Definition parser.hpp:6098
Test for HTTP URL.
Definition parser.hpp:6361
Collection of HTTP values.
Definition parser.hpp:7264
Test for HTTP value (RFC2616: value)
Definition parser.hpp:5854
http_quoted_string string
Value when matched as quoted string.
Definition parser.hpp:5890
http_token token
Value when matched as token.
Definition parser.hpp:5891
Test for HTTP weight factor.
Definition parser.hpp:6526
float value
Calculated value of the weight factor.
Definition parser.hpp:6588
Test for HTTP weighted value.
Definition parser.hpp:6618
Base template for collection-holding parsers.
Definition parser.hpp:973
Test for any SGML code point.
Definition parser.hpp:260
Test for any SGML code point from a given string of SGML code points.
Definition parser.hpp:779
Test for specific SGML code point.
Definition parser.hpp:347
Test for valid DNS domain SGML character.
Definition parser.hpp:2869
Test for valid IPv6 address scope ID SGML character.
Definition parser.hpp:2538
Test for any SGML punctuation code point.
Definition parser.hpp:511
Test for any SGML space code point.
Definition parser.hpp:434
Test for any SGML space or punctuation code point.
Definition parser.hpp:587
Test for SGML given string.
Definition parser.hpp:869
Test for valid URL password SGML character.
Definition parser.hpp:3147
Test for valid URL path SGML character.
Definition parser.hpp:3251
Test for valid URL username SGML character.
Definition parser.hpp:3047
Numerical interval.
Definition interval.hpp:18
T size() const
Returns interval size.
Definition interval.hpp:47
T end
interval end
Definition interval.hpp:20
interval() noexcept
Constructs an invalid interval.
Definition interval.hpp:25
T start
interval start
Definition interval.hpp:19
Definition parser.hpp:7290