23#elif defined(__APPLE__)
24#include <netinet/in.h>
38#pragma warning(disable: 4100)
41#define ENUM_FLAG_OPERATOR(T,X) \
42inline 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)); } \
43inline 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); } \
44inline 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)); } \
45inline T& operator X= (T& lhs, const T rhs) { return lhs = lhs X rhs; } \
46inline T& operator X= (T& lhs, const std::underlying_type_t<T> rhs) { return lhs = lhs X rhs; }
47#define ENUM_FLAGS(T, type) \
49inline T operator ~ (T t) { return (T) (~static_cast<std::underlying_type_t <T>>(t)); } \
50ENUM_FLAG_OPERATOR(T,|) \
51ENUM_FLAG_OPERATOR(T,^) \
52ENUM_FLAG_OPERATOR(T,&) \
57#define s6_words __u6_addr.__u6_addr16
59#error Unsupported platform
70 constexpr int match_default = 0;
71 constexpr int match_case_insensitive = 0x1;
72 constexpr int match_multiline = 0x2;
81 basic_parser(
_In_ const std::locale& locale = std::locale()) : m_locale(locale) {}
85 _In_reads_or_z_(end)
const T*
text,
86 _In_ size_t start = 0,
87 _In_ size_t end = (
size_t)-1,
90 for (
size_t i = start;
i < end &&
text[
i];
i++)
97 _In_reads_or_z_(end)
const T*
text,
98 _In_ size_t start = 0,
99 _In_ size_t end = (
size_t)-1,
102 template<
class _Traits,
class _Ax>
104 const std::basic_string<T, _Traits, _Ax>&
text,
105 _In_ size_t start = 0,
106 _In_ size_t end = (
size_t)-1,
109 return match(
text.c_str(), start, std::min<size_t>(end,
text.size()),
flags);
112 virtual void invalidate()
122 if (
text[start] ==
'&') {
124 const auto&
ctype = std::use_facet<std::ctype<T>>(m_locale);
133 if (
n >= 2 &&
text[start + 1] ==
'#') {
136 if (
text[start + 2] ==
'x' ||
text[start + 2] ==
'X')
137 unicode = strtou32(
text + start + 3,
n - 2,
nullptr, 16);
139 unicode = strtou32(
text + start + 2,
n - 1,
nullptr, 10);
146 ucs4_to_surrogate_pair(buf,
unicode);
170 buf[0] =
text[start];
181 std::locale m_locale;
201 _In_reads_or_z_(end)
const T*
text,
202 _In_ size_t start = 0,
203 _In_ size_t end = (
size_t)-1,
207 if (start < end &&
text[start]) {
235 _In_reads_or_z_(end)
const T*
text,
236 _In_ size_t start = 0,
237 _In_ size_t end = (
size_t)-1,
241 if (start < end &&
text[start]) {
267 _In_reads_or_z_(end)
const char*
text,
268 _In_ size_t start = 0,
269 _In_ size_t end = (
size_t)-1,
273 if (start < end &&
text[start]) {
274 if (
text[start] ==
'&') {
276 const auto&
ctype = std::use_facet<std::ctype<char>>(m_locale);
309 _In_reads_or_z_(end)
const T*
text,
310 _In_ size_t start = 0,
311 _In_ size_t end = (
size_t)-1,
315 if (start < end &&
text[start]) {
317 if (
flags & match_case_insensitive) {
318 const auto&
ctype = std::use_facet<std::ctype<T>>(this->m_locale);
322 r =
text[start] == m_chr;
323 if ((
r && !m_invert) || (!
r && m_invert)) {
351 sgml_cp(
const char*
chr,
size_t count = (
size_t)-1,
bool invert =
false,
_In_ const std::locale& locale = std::locale()) :
362 _In_reads_or_z_(end)
const char*
text,
363 _In_ size_t start = 0,
364 _In_ size_t end = (
size_t)-1,
368 if (start < end &&
text[start]) {
371 bool r = ((
flags & match_case_insensitive) ?
372 stdex::strnicmp(
chr, (
size_t)-1, m_chr.c_str(), m_chr.size(), m_locale) :
373 stdex::strncmp(
chr, (
size_t)-1, m_chr.c_str(), m_chr.size())) == 0;
374 if ((
r && !m_invert) || (!
r && m_invert)) {
401 _In_reads_or_z_(end)
const T*
text,
402 _In_ size_t start = 0,
403 _In_ size_t end = (
size_t)-1,
407 if (start < end &&
text[start]) {
409 ((
flags & match_multiline) || !islbreak(
text[start])) &&
410 std::use_facet<std::ctype<T>>(this->m_locale).is(std::ctype_base::space,
text[start]);
411 if ((
r && !m_invert) || (!
r && m_invert)) {
443 _In_reads_or_z_(end)
const char*
text,
444 _In_ size_t start = 0,
445 _In_ size_t end = (
size_t)-1,
449 if (start < end &&
text[start]) {
454 ((
flags & match_multiline) || !islbreak(
chr, (
size_t)-1)) &&
456 if ((
r && !m_invert) || (!
r && m_invert)) {
480 _In_reads_or_z_(end)
const T*
text,
481 _In_ size_t start = 0,
482 _In_ size_t end = (
size_t)-1,
486 if (start < end &&
text[start]) {
487 bool r = std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::punct,
text[start]);
488 if ((
r && !m_invert) || (!
r && m_invert)) {
520 _In_reads_or_z_(end)
const char*
text,
521 _In_ size_t start = 0,
522 _In_ size_t end = (
size_t)-1,
526 if (start < end &&
text[start]) {
531 if ((
r && !m_invert) || (!
r && m_invert)) {
554 _In_reads_or_z_(end)
const T*
text,
555 _In_ size_t start = 0,
556 _In_ size_t end = (
size_t)-1,
560 if (start < end &&
text[start]) {
562 ((
flags & match_multiline) || !islbreak(
text[start])) &&
563 std::use_facet<std::ctype<T>>(this->m_locale).is(std::ctype_base::space | std::ctype_base::punct,
text[start]);
564 if ((
r && !m_invert) || (!
r && m_invert)) {
596 _In_reads_or_z_(end)
const char*
text,
597 _In_ size_t start = 0,
598 _In_ size_t end = (
size_t)-1,
602 if (start < end &&
text[start]) {
607 ((
flags & match_multiline) || !islbreak(
chr, (
size_t)-1)) &&
608 std::use_facet<std::ctype<wchar_t>>(m_locale).
scan_not(std::ctype_base::space | std::ctype_base::punct,
chr,
chr_end) ==
chr_end;
609 if ((
r && !m_invert) || (!
r && m_invert)) {
629 _In_reads_or_z_(end)
const T*
text,
630 _In_ size_t start = 0,
631 _In_ size_t end = (
size_t)-1,
635 bool r = start == 0 || (start <= end && islbreak(
text[start - 1]));
636 if ((
r && !m_invert) || (!
r && m_invert)) {
667 _In_reads_or_z_(end)
const T*
text,
668 _In_ size_t start = 0,
669 _In_ size_t end = (
size_t)-1,
673 bool r = islbreak(
text[start]);
674 if ((
r && !m_invert) || (!
r && m_invert)) {
701 hit_offset((
size_t)-1),
706 _In_reads_or_z_(end)
const T*
text,
707 _In_ size_t start = 0,
708 _In_ size_t end = (
size_t)-1,
711 virtual void invalidate()
732 _In_reads_or_z_(
count)
const T* set,
735 _In_ const std::locale& locale = std::locale()) :
739 m_set.assign(set, set + stdex::strnlen(set,
count));
743 _In_reads_or_z_(end)
const T*
text,
744 _In_ size_t start = 0,
745 _In_ size_t end = (
size_t)-1,
749 if (start < end &&
text[start]) {
750 const T* set = m_set.c_str();
751 size_t r = (
flags & match_case_insensitive) ?
752 stdex::strnichr(set, m_set.size(),
text[start], this->m_locale) :
753 stdex::strnchr(set, m_set.size(),
text[start]);
754 if ((
r != stdex::npos && !this->m_invert) || (
r == stdex::npos && this->m_invert)) {
755 this->hit_offset =
r;
760 this->hit_offset = (
size_t)-1;
766 std::basic_string<T> m_set;
783 sgml_cp_set(
const char* set,
size_t count = (
size_t)-1,
bool invert =
false,
_In_ const std::locale& locale = std::locale()) :
787 m_set = sgml2wstr(set,
count);
791 _In_reads_or_z_(end)
const char*
text,
792 _In_ size_t start = 0,
793 _In_ size_t end = (
size_t)-1,
797 if (start < end &&
text[start]) {
800 const wchar_t* set = m_set.c_str();
801 size_t r = (
flags & match_case_insensitive) ?
802 stdex::strnistr(set, m_set.size(),
chr, m_locale) :
803 stdex::strnstr(set, m_set.size(),
chr);
804 if ((
r != stdex::npos && !m_invert) || (
r == stdex::npos && m_invert)) {
827 _In_reads_or_z_(
count)
const T*
str,
829 _In_ const std::locale& locale = std::locale()) :
835 _In_reads_or_z_(end)
const T*
text,
836 _In_ size_t start = 0,
837 _In_ size_t end = (
size_t)-1,
843 n = std::min<size_t>(end - start,
m);
844 bool r = ((
flags & match_case_insensitive) ?
845 stdex::strnicmp(
text + start,
n, m_str.c_str(),
m, this->m_locale) :
846 stdex::strncmp(
text + start,
n, m_str.c_str(),
m)) == 0;
856 std::basic_string<T> m_str;
879 _In_reads_or_z_(end)
const char*
text,
880 _In_ size_t start = 0,
881 _In_ size_t end = (
size_t)-1,
885 const wchar_t*
str = m_str.c_str();
887 const auto&
ctype = std::use_facet<std::ctype<wchar_t>>(m_locale);
929 _In_reads_or_z_(end)
const T*
text,
930 _In_ size_t start = 0,
931 _In_ size_t end = (
size_t)-1,
936 for (
size_t i = 0; ;
i++) {
955 std::shared_ptr<basic_parser<T>>
m_el;
983 _In_ const std::locale& locale = std::locale()) :
987 m_collection.reserve(
count);
989 m_collection.push_back(
el[
i]);
994 _In_ const std::locale& locale = std::locale()) :
999 virtual void invalidate()
1001 for (
auto&
el: m_collection)
1007 std::vector<std::shared_ptr<basic_parser<T>>> m_collection;
1020 _In_ const std::locale& locale = std::locale()) :
1026 _In_ const std::locale& locale = std::locale()) :
1031 _In_reads_or_z_(end)
const T*
text,
1032 _In_ size_t start = 0,
1033 _In_ size_t end = (
size_t)-1,
1038 for (
auto i = this->m_collection.begin();
i != this->m_collection.end(); ++
i) {
1040 for (++
i;
i != this->m_collection.end(); ++
i)
1070 hit_offset((
size_t)-1)
1077 _In_ const std::locale& locale = std::locale()) :
1079 hit_offset((
size_t)-1)
1084 _In_ const std::locale& locale = std::locale()) :
1086 hit_offset((
size_t)-1)
1090 _In_reads_or_z_(end)
const T*
text,
1091 _In_ size_t start = 0,
1092 _In_ size_t end = (
size_t)-1,
1097 for (
auto i = this->m_collection.begin();
i != this->m_collection.end(); ++
i, ++hit_offset) {
1098 if ((*i)->match(
text, start, end,
flags)) {
1100 for (++
i;
i != this->m_collection.end(); ++
i)
1110 virtual void invalidate()
1132 template <
class T,
class T_parser = basic_
string<T>>
1139 _In_ const std::locale& locale = std::locale()) :
1172 offset += stdex::strnlen(
str_z + offset,
count - offset) + 1, ++
n);
1173 this->m_collection.reserve(
n);
1177 offset += stdex::strnlen(
str_z + offset,
count - offset) + 1)
1178 this->m_collection.push_back(std::move(std::make_shared<T_parser>(
str_z + offset,
count - offset,
this->m_locale)));
1186 this->m_collection.push_back(std::move(std::make_shared<T_parser>(
str, (
size_t)-1,
this->m_locale)));
1187 (
p =
va_arg(params,
const T*)) !=
nullptr;
1188 this->m_collection.push_back(std::move(std::make_shared<T_parser>(
p, (
size_t)-1, this->m_locale))));
1211 _In_ const std::locale& locale = std::locale()) :
1217 _In_ const std::locale& locale = std::locale()) :
1222 _In_reads_or_z_(end)
const T*
text,
1223 _In_ size_t start = 0,
1224 _In_ size_t end = (
size_t)-1,
1228 for (
auto&
el: this->m_collection)
1230 if (match_recursively(
text, start, end,
flags)) {
1239 bool match_recursively(
1240 _In_reads_or_z_(end)
const T*
text,
1241 _In_ size_t start = 0,
1242 _In_ size_t end = (
size_t)-1,
1246 for (
auto&
el: this->m_collection) {
1289 virtual void invalidate()
1317 _In_ const std::locale& locale = std::locale()) :
1332 _In_reads_or_z_(end)
const T*
text,
1333 _In_ size_t start = 0,
1334 _In_ size_t end = (
size_t)-1,
1362 std::shared_ptr<basic_parser<T>>
1394 _In_ const std::locale& locale = std::locale()) :
1399 m_separator(separator)
1403 _In_reads_or_z_(end)
const T*
text,
1404 _In_ size_t start = 0,
1405 _In_ size_t end = (
size_t)-1,
1409 if (m_digits->match(
text, start, end,
flags)) {
1411 this->
value = m_digits->value;
1416 if (m_digits->interval.size() <= 3) {
1418 size_t hit_offset = (
size_t)-1;
1420 (hit_offset == (
size_t)-1 || hit_offset == m_separator->hit_offset) &&
1421 m_digits->match(
text, m_separator->interval.end, end,
flags) &&
1422 m_digits->interval.size() == 3)
1425 this->
value = this->
value * 1000 + m_digits->value;
1429 hit_offset = m_separator->hit_offset;
1440 virtual void invalidate()
1452 std::shared_ptr<basic_integer10<T>> m_digits;
1453 std::shared_ptr<basic_set<T>> m_separator;
1489 _In_ const std::locale& locale = std::locale()) :
1510 _In_reads_or_z_(end)
const T*
text,
1511 _In_ size_t start = 0,
1512 _In_ size_t end = (
size_t)-1,
1546 std::shared_ptr<basic_parser<T>>
1591 _In_ const std::locale& locale = std::locale()) :
1605 _In_reads_or_z_(end)
const T*
text,
1606 _In_ size_t start = 0,
1607 _In_ size_t end = (
size_t)-1,
1628 if (
dig[4] == (
size_t)-1)
dig[4] =
dig[0];
1636 this->
value += dig[0];
1639 (
dig[1] == 1 && (
dig[0] == 5 ||
dig[0] == 10)) ||
1640 (
dig[1] == 10 && (
dig[0] == 50 ||
dig[0] == 100)) ||
1641 (
dig[1] == 100 && (
dig[0] == 500 ||
dig[0] == 1000)) ||
1642 (
dig[1] == 1000 && (
dig[0] == 5000 ||
dig[0] == 10000)))
1649 this->
value -= dig[1];
1653 this->
value += dig[0];
1669 std::shared_ptr<basic_parser<T>>
1701 _In_ const std::locale& locale = std::locale()) :
1709 _In_reads_or_z_(end)
const T*
text,
1710 _In_ size_t start = 0,
1711 _In_ size_t end = (
size_t)-1,
1715 if (numerator->match(
text, start, end,
flags) &&
1716 fraction_line->match(
text, numerator->interval.end, end,
flags) &&
1717 denominator->match(
text, fraction_line->interval.end, end,
flags))
1723 numerator->invalidate();
1724 fraction_line->invalidate();
1725 denominator->invalidate();
1730 virtual void invalidate()
1732 numerator->invalidate();
1733 fraction_line->invalidate();
1734 denominator->invalidate();
1739 std::shared_ptr<basic_parser<T>> numerator;
1740 std::shared_ptr<basic_parser<T>> fraction_line;
1741 std::shared_ptr<basic_parser<T>> denominator;
1765 _In_ const std::locale& locale = std::locale()) :
1774 _In_reads_or_z_(end)
const T*
text,
1775 _In_ size_t start = 0,
1776 _In_ size_t end = (
size_t)-1,
1808 separator->invalidate();
1809 guest->invalidate();
1814 virtual void invalidate()
1817 separator->invalidate();
1818 guest->invalidate();
1823 std::shared_ptr<basic_parser<T>> home;
1824 std::shared_ptr<basic_parser<T>> separator;
1825 std::shared_ptr<basic_parser<T>> guest;
1828 std::shared_ptr<basic_parser<T>> m_space;
1852 _In_ const std::locale& locale = std::locale()) :
1861 _In_reads_or_z_(end)
const T*
text,
1862 _In_ size_t start = 0,
1863 _In_ size_t end = (
size_t)-1,
1901 virtual void invalidate()
1940 _In_ const std::locale& locale = std::locale()) :
1951 _In_reads_or_z_(end)
const T*
text,
1952 _In_ size_t start = 0,
1953 _In_ size_t end = (
size_t)-1,
2022 virtual void invalidate()
2040 std::shared_ptr<basic_parser<T>> m_space;
2070 _In_ const std::locale& locale = std::locale()) :
2082 value(std::numeric_limits<double>::quiet_NaN())
2086 _In_reads_or_z_(end)
const T*
text,
2087 _In_ size_t start = 0,
2088 _In_ size_t end = (
size_t)-1,
2126 if (
integer->interval.empty() &&
2182 virtual void invalidate()
2194 value = std::numeric_limits<double>::quiet_NaN();
2236 _In_ const std::locale& locale = std::locale()) :
2248 _In_reads_or_z_(end)
const T*
text,
2249 _In_ size_t start = 0,
2250 _In_ size_t end = (
size_t)-1,
2300 if (
integer->interval.empty() &&
2319 virtual void invalidate()
2369 _In_ const std::locale& locale = std::locale()) :
2381 m_separator(separator)
2387 _In_reads_or_z_(end)
const T*
text,
2388 _In_ size_t start = 0,
2389 _In_ size_t end = (
size_t)-1,
2397 for (
i = 0;
i < 4;
i++) {
2455 virtual void invalidate()
2474 std::shared_ptr<basic_parser<T>>
2485 std::shared_ptr<basic_parser<T>> m_separator;
2507 _In_reads_or_z_(end)
const T*
text,
2508 _In_ size_t start = 0,
2509 _In_ size_t end = (
size_t)-1,
2513 if (start < end &&
text[start]) {
2514 if (
text[start] ==
'-' ||
2515 text[start] ==
'_' ||
2516 text[start] ==
':' ||
2517 std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::alnum,
text[start]))
2545 _In_reads_or_z_(end)
const char*
text,
2546 _In_ size_t start = 0,
2547 _In_ size_t end = (
size_t)-1,
2551 if (start < end &&
text[start]) {
2555 if (((
chr[0] ==
L'-' ||
2557 chr[0] ==
L':') &&
chr[1] == 0) ||
2596 _In_ const std::locale& locale = std::locale()) :
2614 m_separator(separator),
2622 _In_reads_or_z_(end)
const T*
text,
2623 _In_ size_t start = 0,
2624 _In_ size_t end = (
size_t)-1,
2632 for (
i = 0;
i < 8;
i++) {
2636 if (m_separator->match(
text, m_separator->interval.end, end,
flags)) {
2685 if (
x_n <= 0xffff) {
2708 this->
value.s6_words[--j] = this->
value.s6_words[--k];
2712 this->
value.s6_words[--j] = 0;
2752 virtual void invalidate()
2781 std::shared_ptr<basic_parser<T>>
2798 std::shared_ptr<basic_parser<T>> m_separator, m_scope_id_separator;
2819 _In_ const std::locale& locale = std::locale()) :
2826 _In_reads_or_z_(end)
const T*
text,
2827 _In_ size_t start = 0,
2828 _In_ size_t end = (
size_t)-1,
2832 if (start < end &&
text[start]) {
2833 if ((
'A' <=
text[start] &&
text[start] <=
'Z') ||
2834 (
'a' <=
text[start] &&
text[start] <=
'z') ||
2835 (
'0' <=
text[start] &&
text[start] <=
'9'))
2837 else if (
text[start] ==
'-')
2839 else if (m_allow_idn && std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::alnum,
text[start]))
2875 _In_ const std::locale& locale = std::locale()) :
2880 _In_reads_or_z_(end)
const char*
text,
2881 _In_ size_t start = 0,
2882 _In_ size_t end = (
size_t)-1,
2886 if (start < end &&
text[start]) {
2890 if (((
'A' <=
chr[0] &&
chr[0] <=
'Z') ||
2891 (
'a' <=
chr[0] &&
chr[0] <=
'z') ||
2892 (
'0' <=
chr[0] &&
chr[0] <=
'9')) &&
chr[1] == 0)
2894 else if (
chr[0] ==
'-' &&
chr[1] == 0)
2896 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)
2921 _In_ const std::locale& locale = std::locale()) :
2925 m_separator(separator)
2929 _In_reads_or_z_(end)
const T*
text,
2930 _In_ size_t start = 0,
2931 _In_ size_t end = (
size_t)-1,
2937 if (m_domain_char->match(
text,
i, end,
flags) &&
2938 m_domain_char->allow_on_edge)
2942 while (
i < end &&
text[
i]) {
2943 if (m_domain_char->allow_on_edge &&
2951 i = m_separator->interval.end;
2955 if (m_domain_char->match(
text,
i, end,
flags)) {
2956 if (m_domain_char->allow_on_edge)
2959 i = m_domain_char->interval.end;
2980 std::shared_ptr<basic_dns_domain_char<T>> m_domain_char;
2981 std::shared_ptr<basic_parser<T>> m_separator;
3003 _In_reads_or_z_(end)
const T*
text,
3004 _In_ size_t start = 0,
3005 _In_ size_t end = (
size_t)-1,
3009 if (start < end &&
text[start]) {
3010 if (
text[start] ==
'-' ||
3011 text[start] ==
'.' ||
3012 text[start] ==
'_' ||
3013 text[start] ==
'~' ||
3014 text[start] ==
'%' ||
3015 text[start] ==
'!' ||
3016 text[start] ==
'$' ||
3017 text[start] ==
'&' ||
3018 text[start] ==
'\'' ||
3021 text[start] ==
'*' ||
3022 text[start] ==
'+' ||
3023 text[start] ==
',' ||
3024 text[start] ==
';' ||
3025 text[start] ==
'=' ||
3026 std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::alnum,
text[start]))
3054 _In_reads_or_z_(end)
const char*
text,
3055 _In_ size_t start = 0,
3056 _In_ size_t end = (
size_t)-1,
3060 if (start < end &&
text[start]) {
3064 if (((
chr[0] ==
L'-' ||
3079 chr[0] ==
L'=') &&
chr[1] == 0) ||
3102 _In_reads_or_z_(end)
const T*
text,
3103 _In_ size_t start = 0,
3104 _In_ size_t end = (
size_t)-1,
3108 if (start < end &&
text[start]) {
3109 if (
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 text[start] ==
'=' ||
3125 text[start] ==
':' ||
3126 std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::alnum,
text[start]))
3154 _In_reads_or_z_(end)
const char*
text,
3155 _In_ size_t start = 0,
3156 _In_ size_t end = (
size_t)-1,
3160 if (start < end &&
text[start]) {
3164 if (((
chr[0] ==
L'-' ||
3180 chr[0] ==
L':') &&
chr[1] == 0) ||
3202 _In_reads_or_z_(end)
const T*
text,
3203 _In_ size_t start = 0,
3204 _In_ size_t end = (
size_t)-1,
3208 if (start < end &&
text[start]) {
3209 if (
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 text[start] ==
'?' ||
3229 text[start] ==
'#' ||
3230 std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::alnum,
text[start]))
3258 _In_reads_or_z_(end)
const char*
text,
3259 _In_ size_t start = 0,
3260 _In_ size_t end = (
size_t)-1,
3264 if (start < end &&
text[start]) {
3268 if (((
chr[0] ==
L'/' ||
3288 chr[0] ==
L'#') &&
chr[1] == 0) ||
3311 _In_ const std::locale& locale = std::locale()) :
3319 _In_reads_or_z_(end)
const T*
text,
3320 _In_ size_t start = 0,
3321 _In_ size_t end = (
size_t)-1,
3410 virtual void invalidate()
3427 std::shared_ptr<basic_parser<T>> m_path_char;
3428 std::shared_ptr<basic_parser<T>> m_query_start;
3429 std::shared_ptr<basic_parser<T>> m_bookmark_start;
3465 _In_ const std::locale& locale = std::locale()) :
3486 _In_reads_or_z_(end)
const T*
text,
3487 _In_ size_t start = 0,
3488 _In_ size_t end = (
size_t)-1,
3496 m_colon->match(
text, http_scheme->interval.end, end,
flags) &&
3497 m_slash->match(
text, m_colon->interval.end, end,
flags) &&
3498 m_slash->match(
text, m_slash->interval.end, end,
flags))
3502 ftp_scheme->invalidate();
3503 mailto_scheme->invalidate();
3504 file_scheme->invalidate();
3507 m_colon->match(
text, ftp_scheme->interval.end, end,
flags) &&
3508 m_slash->match(
text, m_colon->interval.end, end,
flags) &&
3509 m_slash->match(
text, m_slash->interval.end, end,
flags))
3513 http_scheme->invalidate();
3514 mailto_scheme->invalidate();
3515 file_scheme->invalidate();
3518 m_colon->match(
text, mailto_scheme->interval.end, end,
flags))
3522 http_scheme->invalidate();
3523 ftp_scheme->invalidate();
3524 file_scheme->invalidate();
3527 m_colon->match(
text, file_scheme->interval.end, end,
flags) &&
3528 m_slash->match(
text, m_colon->interval.end, end,
flags) &&
3529 m_slash->match(
text, m_slash->interval.end, end,
flags))
3533 http_scheme->invalidate();
3534 ftp_scheme->invalidate();
3535 mailto_scheme->invalidate();
3539 http_scheme->invalidate();
3540 ftp_scheme->invalidate();
3541 mailto_scheme->invalidate();
3542 file_scheme->invalidate();
3545 if (ftp_scheme->interval) {
3547 if (m_colon->match(
text, username->interval.end, end,
flags) &&
3548 password->match(
text, m_colon->interval.end, end,
flags) &&
3549 m_at->match(
text, password->interval.end, end,
flags))
3557 password->invalidate();
3560 username->invalidate();
3561 password->invalidate();
3565 username->invalidate();
3566 password->invalidate();
3572 ipv6_host->invalidate();
3573 dns_host->invalidate();
3577 ipv6_host->match(
text, m_ip_lbracket->interval.end, end,
flags) &&
3578 m_ip_rbracket->match(
text, ipv6_host->interval.end, end,
flags))
3582 ipv4_host->invalidate();
3583 dns_host->invalidate();
3588 ipv4_host->invalidate();
3589 ipv6_host->invalidate();
3597 port->match(
text, m_colon->interval.end, end,
flags))
3614 if (mailto_scheme->interval) {
3616 m_at->match(
text, username->interval.end, end,
flags))
3627 ipv4_host->match(
text, m_ip_lbracket->interval.end, end,
flags) &&
3628 m_ip_rbracket->match(
text, ipv4_host->interval.end, end,
flags))
3632 ipv6_host->invalidate();
3633 dns_host->invalidate();
3637 ipv6_host->match(
text, m_ip_lbracket->interval.end, end,
flags) &&
3638 m_ip_rbracket->match(
text, ipv6_host->interval.end, end,
flags))
3642 ipv4_host->invalidate();
3643 dns_host->invalidate();
3648 ipv4_host->invalidate();
3649 ipv6_host->invalidate();
3656 password->invalidate();
3663 if (file_scheme->interval) {
3669 username->invalidate();
3670 password->invalidate();
3671 ipv4_host->invalidate();
3672 ipv6_host->invalidate();
3673 dns_host->invalidate();
3682 if (http_scheme->interval &&
3685 if (m_colon->match(
text, username->interval.end, end,
flags) &&
3686 password->match(
text, m_colon->interval.end, end,
flags) &&
3687 m_at->match(
text, password->interval.end, end,
flags))
3692 else if (m_at->match(
text, username->interval.end, end,
flags)) {
3695 password->invalidate();
3698 username->invalidate();
3699 password->invalidate();
3703 username->invalidate();
3704 password->invalidate();
3710 ipv6_host->invalidate();
3711 dns_host->invalidate();
3715 ipv6_host->match(
text, m_ip_lbracket->interval.end, end,
flags) &&
3716 m_ip_rbracket->match(
text, ipv6_host->interval.end, end,
flags))
3720 ipv4_host->invalidate();
3721 dns_host->invalidate();
3726 ipv4_host->invalidate();
3727 ipv6_host->invalidate();
3735 port->match(
text, m_colon->interval.end, end,
flags))
3752 virtual void invalidate()
3754 http_scheme->invalidate();
3755 ftp_scheme->invalidate();
3756 mailto_scheme->invalidate();
3757 file_scheme->invalidate();
3758 username->invalidate();
3759 password->invalidate();
3760 ipv4_host->invalidate();
3761 ipv6_host->invalidate();
3762 dns_host->invalidate();
3769 std::shared_ptr<basic_parser<T>> http_scheme;
3770 std::shared_ptr<basic_parser<T>> ftp_scheme;
3771 std::shared_ptr<basic_parser<T>> mailto_scheme;
3772 std::shared_ptr<basic_parser<T>> file_scheme;
3773 std::shared_ptr<basic_parser<T>> username;
3774 std::shared_ptr<basic_parser<T>> password;
3775 std::shared_ptr<basic_parser<T>> ipv4_host;
3776 std::shared_ptr<basic_parser<T>> ipv6_host;
3777 std::shared_ptr<basic_parser<T>> dns_host;
3778 std::shared_ptr<basic_parser<T>> port;
3779 std::shared_ptr<basic_parser<T>> path;
3782 std::shared_ptr<basic_parser<T>> m_colon;
3783 std::shared_ptr<basic_parser<T>> m_slash;
3784 std::shared_ptr<basic_parser<T>> m_at;
3785 std::shared_ptr<basic_parser<T>> m_ip_lbracket;
3786 std::shared_ptr<basic_parser<T>> m_ip_rbracket;
3813 _In_ const std::locale& locale = std::locale()) :
3825 _In_reads_or_z_(end)
const T*
text,
3826 _In_ size_t start = 0,
3827 _In_ size_t end = (
size_t)-1,
3832 if (username->match(
text, start, end,
flags) &&
3833 m_at->match(
text, username->interval.end, end,
flags))
3836 if (m_ip_lbracket->match(
text, m_at->interval.end, end,
flags) &&
3837 ipv4_host->match(
text, m_ip_lbracket->interval.end, end,
flags) &&
3838 m_ip_rbracket->match(
text, ipv4_host->interval.end, end,
flags))
3842 ipv6_host->invalidate();
3843 dns_host->invalidate();
3846 m_ip_lbracket->match(
text, m_at->interval.end, end,
flags) &&
3847 ipv6_host->match(
text, m_ip_lbracket->interval.end, end,
flags) &&
3848 m_ip_rbracket->match(
text, ipv6_host->interval.end, end,
flags))
3852 ipv4_host->invalidate();
3853 dns_host->invalidate();
3855 else if (dns_host->match(
text, m_at->interval.end, end,
flags)) {
3858 ipv4_host->invalidate();
3859 ipv6_host->invalidate();
3868 username->invalidate();
3869 ipv4_host->invalidate();
3870 ipv6_host->invalidate();
3871 dns_host->invalidate();
3876 virtual void invalidate()
3878 username->invalidate();
3879 ipv4_host->invalidate();
3880 ipv6_host->invalidate();
3881 dns_host->invalidate();
3886 std::shared_ptr<basic_parser<T>> username;
3887 std::shared_ptr<basic_parser<T>> ipv4_host;
3888 std::shared_ptr<basic_parser<T>> ipv6_host;
3889 std::shared_ptr<basic_parser<T>> dns_host;
3892 std::shared_ptr<basic_parser<T>> m_at;
3893 std::shared_ptr<basic_parser<T>> m_ip_lbracket;
3894 std::shared_ptr<basic_parser<T>> m_ip_rbracket;
3919 _In_ const std::locale& locale = std::locale()) :
3929 _In_reads_or_z_(end)
const T*
text,
3930 _In_ size_t start = 0,
3931 _In_ size_t end = (
size_t)-1,
3940 mouth->invalidate();
3957 hit_offset =
mouth->hit_offset;
3968 hit_offset =
mouth->hit_offset;
3983 mouth->invalidate();
3988 virtual void invalidate()
3994 mouth->invalidate();
4000 std::shared_ptr<basic_parser<T>>
apex;
4001 std::shared_ptr<basic_parser<T>>
eyes;
4002 std::shared_ptr<basic_parser<T>>
nose;
4018 enum date_format_t {
4019 date_format_none = 0,
4020 date_format_dmy = 0x1,
4021 date_format_mdy = 0x2,
4022 date_format_ymd = 0x4,
4023 date_format_ym = 0x8,
4024 date_format_my = 0x10,
4025 date_format_dm = 0x20,
4026 date_format_md = 0x40,
4043 _In_ const std::locale& locale = std::locale()) :
4045 format(date_format_none),
4050 m_separator(separator),
4055 _In_reads_or_z_(end)
const T*
text,
4056 _In_ size_t start = 0,
4057 _In_ size_t end = (
size_t)-1,
4063 if ((m_format_mask & date_format_dmy) == date_format_dmy) {
4064 if (day->match(
text, start, end,
flags)) {
4067 size_t hit_offset = m_separator->hit_offset;
4072 m_separator->hit_offset == hit_offset)
4076 is_valid(day->value, month->value))
4080 format = date_format_dmy;
4089 if ((m_format_mask & date_format_mdy) == date_format_mdy) {
4090 if (month->match(
text, start, end,
flags)) {
4093 size_t hit_offset = m_separator->hit_offset;
4098 m_separator->hit_offset == hit_offset)
4102 is_valid(day->value, month->value))
4106 format = date_format_mdy;
4115 if ((m_format_mask & date_format_ymd) == date_format_ymd) {
4116 if (year->match(
text, start, end,
flags)) {
4119 size_t hit_offset = m_separator->hit_offset;
4124 m_separator->hit_offset == hit_offset)
4128 is_valid(day->value, month->value))
4132 format = date_format_ymd;
4141 if ((m_format_mask & date_format_ym) == date_format_ym) {
4142 if (year->match(
text, start, end,
flags)) {
4147 is_valid((
size_t)-1, month->value))
4149 if (day) day->invalidate();
4152 format = date_format_ym;
4159 if ((m_format_mask & date_format_my) == date_format_my) {
4160 if (month->match(
text, start, end,
flags)) {
4165 is_valid((
size_t)-1, month->value))
4167 if (day) day->invalidate();
4170 format = date_format_my;
4177 if ((m_format_mask & date_format_dm) == date_format_dm) {
4178 if (day->match(
text, start, end,
flags)) {
4181 size_t hit_offset = m_separator->hit_offset;
4184 is_valid(day->value, month->value))
4186 if (year) year->invalidate();
4190 m_separator->hit_offset == hit_offset)
4194 format = date_format_dm;
4201 if ((m_format_mask & date_format_md) == date_format_md) {
4202 if (month->match(
text, start, end,
flags)) {
4205 size_t hit_offset = m_separator->hit_offset;
4208 is_valid(day->value, month->value))
4210 if (year) year->invalidate();
4214 m_separator->hit_offset == hit_offset)
4218 format = date_format_md;
4225 if (day) day->invalidate();
4226 if (month) month->invalidate();
4227 if (year) year->invalidate();
4228 format = date_format_none;
4233 virtual void invalidate()
4235 if (day) day->invalidate();
4236 if (month) month->invalidate();
4237 if (year) year->invalidate();
4238 format = date_format_none;
4243 static inline bool is_valid(
size_t day,
size_t month)
4245 if (month == (
size_t)-1) {
4249 if (day == (
size_t)-1) {
4262 return 1 <= day && day <= 31;
4264 return 1 <= day && day <= 29;
4269 return 1 <= day && day <= 30;
4276 date_format_t format;
4277 std::shared_ptr<basic_integer<T>> day;
4278 std::shared_ptr<basic_integer<T>> month;
4279 std::shared_ptr<basic_integer<T>> year;
4283 std::shared_ptr<basic_set<T>> m_separator;
4284 std::shared_ptr<basic_parser<T>> m_space;
4310 _In_ const std::locale& locale = std::locale()) :
4316 m_separator(separator),
4321 _In_reads_or_z_(end)
const T*
text,
4322 _In_ size_t start = 0,
4323 _In_ size_t end = (
size_t)-1,
4328 if (hour->match(
text, start, end,
flags) &&
4329 m_separator->match(
text, hour->interval.end, end,
flags) &&
4330 minute->match(
text, m_separator->interval.end, end,
flags) &&
4334 size_t hit_offset = m_separator->hit_offset;
4335 if (m_separator->match(
text, minute->interval.end, end,
flags) &&
4336 m_separator->hit_offset == hit_offset &&
4337 second && second->match(
text, m_separator->interval.end, end,
flags) &&
4341 if (m_millisecond_separator && m_millisecond_separator->match(
text, second->interval.end, end,
flags) &&
4342 millisecond && millisecond->match(
text, m_millisecond_separator->interval.end, end,
flags) &&
4343 millisecond->value < 1000)
4349 if (millisecond) millisecond->invalidate();
4354 if (second) second->invalidate();
4355 if (millisecond) millisecond->invalidate();
4363 minute->invalidate();
4364 if (second) second->invalidate();
4365 if (millisecond) millisecond->invalidate();
4370 virtual void invalidate()
4373 minute->invalidate();
4374 if (second) second->invalidate();
4375 if (millisecond) millisecond->invalidate();
4380 std::shared_ptr<basic_integer10<T>> hour;
4381 std::shared_ptr<basic_integer10<T>> minute;
4382 std::shared_ptr<basic_integer10<T>> second;
4383 std::shared_ptr<basic_integer10<T>> millisecond;
4386 std::shared_ptr<basic_set<T>> m_separator;
4387 std::shared_ptr<basic_parser<T>> m_millisecond_separator;
4414 _In_ const std::locale& locale = std::locale()) :
4426 _In_reads_or_z_(end)
const T*
text,
4427 _In_ size_t start = 0,
4428 _In_ size_t end = (
size_t)-1,
4436 degree_separator->match(
text, degree->interval.end, end,
flags))
4439 this->
interval.
end = degree_separator->interval.end;
4442 degree->invalidate();
4443 degree_separator->invalidate();
4447 minute->value < 60 &&
4448 minute_separator->match(
text, minute->interval.end, end,
flags))
4451 this->
interval.
end = minute_separator->interval.end;
4454 minute->invalidate();
4455 minute_separator->invalidate();
4464 this->
interval.
end = second_separator->interval.end;
4466 if (second_separator) second_separator->invalidate();
4469 if (second) second->invalidate();
4470 if (second_separator) second_separator->invalidate();
4473 if (degree->interval.start < degree->interval.end ||
4474 minute->interval.start < minute->interval.end ||
4475 (second && second->interval.start < second->interval.end))
4482 decimal->invalidate();
4486 if (decimal) decimal->invalidate();
4491 virtual void invalidate()
4493 degree->invalidate();
4494 degree_separator->invalidate();
4495 minute->invalidate();
4496 minute_separator->invalidate();
4497 if (second) second->invalidate();
4498 if (second_separator) second_separator->invalidate();
4499 if (decimal) decimal->invalidate();
4504 std::shared_ptr<basic_integer10<T>> degree;
4505 std::shared_ptr<basic_parser<T>> degree_separator;
4506 std::shared_ptr<basic_integer10<T>> minute;
4507 std::shared_ptr<basic_parser<T>> minute_separator;
4508 std::shared_ptr<basic_integer10<T>> second;
4509 std::shared_ptr<basic_parser<T>> second_separator;
4510 std::shared_ptr<basic_parser<T>> decimal;
4536 _In_ const std::locale& locale = std::locale()) :
4542 m_separator(separator),
4547 _In_reads_or_z_(end)
const T*
text,
4548 _In_ size_t start = 0,
4549 _In_ size_t end = (
size_t)-1,
4560 m_lparenthesis->invalidate();
4561 m_rparenthesis->invalidate();
4564 value.append(
text + m_plus_sign->interval.start,
text + m_plus_sign->interval.end);
4575 value.append(
text + m_digit->interval.start,
text + m_digit->interval.end);
4586 m_lparenthesis && !m_lparenthesis->interval &&
4587 m_rparenthesis && !m_rparenthesis->interval &&
4591 value.append(
text + m_lparenthesis->interval.start, m_lparenthesis->interval.size());
4592 this->
interval.
end = m_lparenthesis->interval.end;
4599 m_rparenthesis && !m_rparenthesis->interval &&
4601 m_lparenthesis->hit_offset == m_rparenthesis->hit_offset)
4604 value.append(
text + m_rparenthesis->interval.start,
text + m_rparenthesis->interval.end);
4605 this->
interval.
end = m_rparenthesis->interval.end;
4646 virtual void invalidate()
4656 std::shared_ptr<basic_parser<T>> m_digit;
4657 std::shared_ptr<basic_parser<T>> m_plus_sign;
4658 std::shared_ptr<basic_set<T>> m_lparenthesis;
4659 std::shared_ptr<basic_set<T>> m_rparenthesis;
4660 std::shared_ptr<basic_parser<T>> m_separator;
4661 std::shared_ptr<basic_parser<T>> m_space;
4684 _In_ const std::locale& locale = std::locale()) :
4695 _In_reads_or_z_(end)
const T*
text,
4696 _In_ size_t start = 0,
4697 _In_ size_t end = (
size_t)-1,
4701 const auto&
ctype = std::use_facet<std::ctype<T>>(this->m_locale);
4709 { {
'A',
'D' }, {}, 24 },
4710 { {
'A',
'E' }, {}, 23 },
4711 { {
'A',
'L' }, {}, 28 },
4712 { {
'A',
'O' }, {}, 25 },
4713 { {
'A',
'T' }, {}, 20 },
4714 { {
'A',
'Z' }, {}, 28 },
4715 { {
'B',
'A' }, {
'3',
'9' }, 20},
4716 { {
'B',
'E' }, {}, 16 },
4717 { {
'B',
'F' }, {}, 28 },
4718 { {
'B',
'G' }, {}, 22 },
4719 { {
'B',
'H' }, {}, 22 },
4720 { {
'B',
'I' }, {}, 27 },
4721 { {
'B',
'J' }, {}, 28 },
4722 { {
'B',
'R' }, {}, 29 },
4723 { {
'B',
'Y' }, {}, 28 },
4724 { {
'C',
'F' }, {}, 27 },
4725 { {
'C',
'G' }, {}, 27 },
4726 { {
'C',
'H' }, {}, 21 },
4727 { {
'C',
'I' }, {}, 28 },
4728 { {
'C',
'M' }, {}, 27 },
4729 { {
'C',
'R' }, {}, 22 },
4730 { {
'C',
'V' }, {}, 25 },
4731 { {
'C',
'Y' }, {}, 28 },
4732 { {
'C',
'Z' }, {}, 24 },
4733 { {
'D',
'E' }, {}, 22 },
4734 { {
'D',
'J' }, {}, 27 },
4735 { {
'D',
'K' }, {}, 18 },
4736 { {
'D',
'O' }, {}, 28 },
4737 { {
'D',
'Z' }, {}, 26 },
4738 { {
'E',
'E' }, {}, 20 },
4739 { {
'E',
'G' }, {}, 29 },
4740 { {
'E',
'S' }, {}, 24 },
4741 { {
'F',
'I' }, {}, 18 },
4742 { {
'F',
'O' }, {}, 18 },
4743 { {
'F',
'R' }, {}, 27 },
4744 { {
'G',
'A' }, {}, 27 },
4745 { {
'G',
'B' }, {}, 22 },
4746 { {
'G',
'E' }, {}, 22 },
4747 { {
'G',
'I' }, {}, 23 },
4748 { {
'G',
'L' }, {}, 18 },
4749 { {
'G',
'Q' }, {}, 27 },
4750 { {
'G',
'R' }, {}, 27 },
4751 { {
'G',
'T' }, {}, 28 },
4752 { {
'G',
'W' }, {}, 25 },
4753 { {
'H',
'N' }, {}, 28 },
4754 { {
'H',
'R' }, {}, 21 },
4755 { {
'H',
'U' }, {}, 28 },
4756 { {
'I',
'E' }, {}, 22 },
4757 { {
'I',
'L' }, {}, 23 },
4758 { {
'I',
'Q' }, {}, 23 },
4759 { {
'I',
'R' }, {}, 26 },
4760 { {
'I',
'S' }, {}, 26 },
4761 { {
'I',
'T' }, {}, 27 },
4762 { {
'J',
'O' }, {}, 30 },
4763 { {
'K',
'M' }, {}, 27 },
4764 { {
'K',
'W' }, {}, 30 },
4765 { {
'K',
'Z' }, {}, 20 },
4766 { {
'L',
'B' }, {}, 28 },
4767 { {
'L',
'C' }, {}, 32 },
4768 { {
'L',
'I' }, {}, 21 },
4769 { {
'L',
'T' }, {}, 20 },
4770 { {
'L',
'U' }, {}, 20 },
4771 { {
'L',
'V' }, {}, 21 },
4772 { {
'L',
'Y' }, {}, 25 },
4773 { {
'M',
'A' }, {}, 28 },
4774 { {
'M',
'C' }, {}, 27 },
4775 { {
'M',
'D' }, {}, 24 },
4776 { {
'M',
'E' }, {
'2',
'5' }, 22 },
4777 { {
'M',
'G' }, {}, 27 },
4778 { {
'M',
'K' }, {
'0',
'7' }, 19 },
4779 { {
'M',
'L' }, {}, 28 },
4780 { {
'M',
'R' }, {
'1',
'3' }, 27},
4781 { {
'M',
'T' }, {}, 31 },
4782 { {
'M',
'U' }, {}, 30 },
4783 { {
'M',
'Z' }, {}, 25 },
4784 { {
'N',
'E' }, {}, 28 },
4785 { {
'N',
'I' }, {}, 32 },
4786 { {
'N',
'L' }, {}, 18 },
4787 { {
'N',
'O' }, {}, 15 },
4788 { {
'P',
'K' }, {}, 24 },
4789 { {
'P',
'L' }, {}, 28 },
4790 { {
'P',
'S' }, {}, 29 },
4791 { {
'P',
'T' }, {
'5',
'0' }, 25 },
4792 { {
'Q',
'A' }, {}, 29 },
4793 { {
'R',
'O' }, {}, 24 },
4794 { {
'R',
'S' }, {
'3',
'5' }, 22 },
4795 { {
'R',
'U' }, {}, 33 },
4796 { {
'S',
'A' }, {}, 24 },
4797 { {
'S',
'C' }, {}, 31 },
4798 { {
'S',
'D' }, {}, 18 },
4799 { {
'S',
'E' }, {}, 24 },
4800 { {
'S',
'I' }, {
'5',
'6' }, 19 },
4801 { {
'S',
'K' }, {}, 24 },
4802 { {
'S',
'M' }, {}, 27 },
4803 { {
'S',
'N' }, {}, 28 },
4804 { {
'S',
'T' }, {}, 25 },
4805 { {
'S',
'V' }, {}, 28 },
4806 { {
'T',
'D' }, {}, 27 },
4807 { {
'T',
'G' }, {}, 28 },
4808 { {
'T',
'L' }, {
'3',
'8' }, 23},
4809 { {
'T',
'N' }, {
'5',
'9' }, 24 },
4810 { {
'T',
'R' }, {}, 26 },
4811 { {
'U',
'A' }, {}, 29 },
4812 { {
'V',
'A' }, {}, 22 },
4813 { {
'V',
'G' }, {}, 24 },
4814 { {
'X',
'K' }, {}, 20 },
4825 if (
chr <
'A' ||
'Z' <
chr)
4832 size_t m = (
l +
r) / 2;
4834 if (
c.country[0] <
this->country[0] || (
c.country[0] ==
this->country[0] &&
c.country[1] <
this->country[1]))
4836 else if (this->
country[0] < c.country[0] || (
this->country[0] ==
c.country[0] &&
this->country[1] <
c.country[1]))
4852 if ((country_desc->check_digits[0] &&
this->check_digits[0] !=
country_desc->check_digits[0]) ||
4865 if ((
'0' <=
chr &&
chr <=
'9') || (
'A' <=
chr &&
chr <=
'Z')) {
4877 for (
size_t i = 0; ; ++
i) {
4878 if (!this->
bban[
i]) {
4879 for (
i = 0;
i < 2; ++
i) {
4898 if (
'0' <= this->
bban[i] && this->
bban[i] <=
'9')
4900 else if (
'A' <= this->
bban[i] && this->
bban[i] <=
'J') {
4904 else if (
'K' <= this->
bban[i] && this->
bban[i] <=
'T') {
4908 else if (
'U' <= this->
bban[i] && this->
bban[i] <=
'Z') {
4923 for (; digit_count < 9 &&
normalized[next]; ++next, ++digit_count)
4939 virtual void invalidate()
4955 std::shared_ptr<basic_parser<T>> m_space;
4978 _In_ const std::locale& locale = std::locale()) :
4988 _In_reads_or_z_(end)
const T*
text,
4989 _In_ size_t start = 0,
4990 _In_ size_t end = (
size_t)-1,
4994 const auto&
ctype = std::use_facet<std::ctype<T>>(this->m_locale);
5016 for (
size_t j = 0;
j < 4; ++
j) {
5020 if ((
'0' <=
chr &&
chr <=
'9') || (
'A' <=
chr &&
chr <=
'Z')) {
5036 for (
size_t j = _countof(this->
reference) - 1 - n;
j;)
5042 for (
size_t i = 0; ; ++
i) {
5078 for (; digit_count < 9 &&
normalized[next]; ++next, ++digit_count)
5093 virtual void invalidate()
5107 std::shared_ptr<basic_parser<T>> m_space;
5131 _In_reads_or_z_(end)
const T*
text,
5132 _In_ size_t start = 0,
5133 _In_ size_t end = (
size_t)-1,
5176 _In_reads_or_z_(end)
const T*
text,
5177 _In_ size_t start = 0,
5178 _In_ size_t end = (
size_t)-1,
5182 if (start < end &&
text[start] ==
'-') {
5213 _In_ const std::locale& locale = std::locale()) :
5226 _In_reads_or_z_(end)
const T*
text,
5227 _In_ size_t start = 0,
5228 _In_ size_t end = (
size_t)-1,
5232 const auto&
ctype = std::use_facet<std::ctype<T>>(this->m_locale);
5249 this->
part1.invalidate();
5250 this->
part2.invalidate();
5251 this->
part3.invalidate();
5252 if (this->
model[0] ==
'9' && this->
model[1] ==
'9') {
5277 if (this->
model[0] ==
'0' && this->
model[1] ==
'0')
5288 else if (this->
model[0] ==
'0' && this->
model[1] ==
'1')
5307 else if (this->
model[0] ==
'0' && this->
model[1] ==
'2')
5315 else if (this->
model[0] ==
'0' && this->
model[1] ==
'3')
5324 else if (this->
model[0] ==
'0' && this->
model[1] ==
'4')
5332 else if ((this->
model[0] ==
'0' || this->
model[0] ==
'5') && this->
model[1] ==
'5')
5346 else if (this->
model[0] ==
'0' && this->
model[1] ==
'6')
5359 else if (this->
model[0] ==
'0' && this->
model[1] ==
'7')
5370 else if (this->
model[0] ==
'0' && this->
model[1] ==
'8')
5380 else if (this->
model[0] ==
'0' && this->
model[1] ==
'9')
5398 else if (this->
model[0] ==
'1' && this->
model[1] ==
'0')
5414 (this->
model[0] ==
'1' && (this->
model[1] ==
'1' || this->
model[1] ==
'8' || this->
model[1] ==
'9')) ||
5415 ((this->
model[0] ==
'2' || this->
model[0] ==
'3') && this->
model[1] ==
'8') ||
5416 (this->
model[0] ==
'4' && (this->
model[1] ==
'0' || this->
model[1] ==
'1' || this->
model[1] ==
'8' || this->
model[1] ==
'9')) ||
5417 (this->
model[0] ==
'5' && (this->
model[1] ==
'1' || this->
model[1] ==
'8')))
5430 else if (this->
model[0] ==
'1' && this->
model[1] ==
'2')
5438 else if ((this->
model[0] ==
'2' || this->
model[0] ==
'3') && this->
model[1] ==
'1')
5460 virtual void invalidate()
5463 this->
part1.invalidate();
5464 this->
part2.invalidate();
5465 this->
part3.invalidate();
5471 static bool check11(
5484 static bool check11(
5501 static bool check11(
5530 std::shared_ptr<basic_parser<T>> m_space;
5554 _In_ const std::locale& locale = std::locale()) :
5564 _In_reads_or_z_(end)
const T*
text,
5565 _In_ size_t start = 0,
5566 _In_ size_t end = (
size_t)-1,
5599 virtual void invalidate()
5611 std::shared_ptr<basic_parser<T>> m_element;
5612 std::shared_ptr<basic_parser<T>> m_digit;
5613 std::shared_ptr<basic_parser<T>> m_sign;
5632 _In_reads_or_z_(end)
const char*
text,
5633 _In_ size_t start = 0,
5634 _In_ size_t end = (
size_t)-1,
5668 _In_reads_or_z_(end)
const char*
text,
5669 _In_ size_t start = 0,
5670 _In_ size_t end = (
size_t)-1,
5705 _In_reads_or_z_(end)
const char*
text,
5706 _In_ size_t start = 0,
5707 _In_ size_t end = (
size_t)-1,
5739 _In_reads_or_z_(end)
const char*
text,
5740 _In_ size_t start = 0,
5741 _In_ size_t end = (
size_t)-1,
5793 _In_reads_or_z_(end)
const char*
text,
5794 _In_ size_t start = 0,
5795 _In_ size_t end = (
size_t)-1,
5838 virtual void invalidate()
5842 parser::invalidate();
5859 _In_reads_or_z_(end)
const char*
text,
5860 _In_ size_t start = 0,
5861 _In_ size_t end = (
size_t)-1,
5873 string.invalidate();
5884 virtual void invalidate()
5886 string.invalidate();
5888 parser::invalidate();
5903 _In_reads_or_z_(end)
const char*
text,
5904 _In_ size_t start = 0,
5905 _In_ size_t end = (
size_t)-1,
5936 virtual void invalidate()
5940 parser::invalidate();
5958 _In_reads_or_z_(end)
const char*
text,
5959 _In_ size_t start = 0,
5960 _In_ size_t end = (
size_t)-1,
5964 if (start + 2 < end &&
5965 text[start] ==
'*' &&
5966 text[start + 1] ==
'/' &&
5967 text[start + 2] ==
'*')
5972 else if (start < end &&
text[start] ==
'*') {
5990 _In_reads_or_z_(end)
const char*
text,
5991 _In_ size_t start = 0,
5992 _In_ size_t end = (
size_t)-1,
6018 subtype.invalidate();
6023 virtual void invalidate()
6026 subtype.invalidate();
6027 parser::invalidate();
6045 _In_reads_or_z_(end)
const char*
text,
6046 _In_ size_t start = 0,
6047 _In_ size_t end = (
size_t)-1,
6051 if (!http_media_range::match(
text, start, end,
flags))
6065 params.push_back(std::move(
param));
6080 http_media_range::invalidate();
6086 virtual void invalidate()
6089 http_media_range::invalidate();
6093 std::list<http_parameter> params;
6103 _In_reads_or_z_(end)
const char*
text,
6104 _In_ size_t start = 0,
6105 _In_ size_t end = (
size_t)-1,
6145 _In_reads_or_z_(end)
const char*
text,
6146 _In_ size_t start = 0,
6147 _In_ size_t end = (
size_t)-1,
6179 virtual void invalidate()
6182 parser::invalidate();
6196 _In_reads_or_z_(end)
const char*
text,
6197 _In_ size_t start = 0,
6198 _In_ size_t end = (
size_t)-1,
6229 _In_reads_or_z_(end)
const char*
text,
6230 _In_ size_t start = 0,
6231 _In_ size_t end = (
size_t)-1,
6268 virtual void invalidate()
6271 parser::invalidate();
6285 _In_reads_or_z_(end)
const char*
text,
6286 _In_ size_t start = 0,
6287 _In_ size_t end = (
size_t)-1,
6345 virtual void invalidate()
6351 parser::invalidate();
6365 http_url(
_In_ const std::locale& locale = std::locale()) :
6371 _In_reads_or_z_(end)
const char*
text,
6372 _In_ size_t start = 0,
6373 _In_ size_t end = (
size_t)-1,
6396 server.invalidate();
6422 params.push_back(std::move(
param));
6437 server.invalidate();
6445 virtual void invalidate()
6447 server.invalidate();
6451 parser::invalidate();
6458 std::list<http_url_parameter> params;
6468 _In_reads_or_z_(end)
const char*
text,
6469 _In_ size_t start = 0,
6470 _In_ size_t end = (
size_t)-1,
6481 if (
k.end < end &&
text[
k.end]) {
6493 components.push_back(
k);
6505 if (!components.empty()) {
6514 virtual void invalidate()
6517 parser::invalidate();
6521 std::vector<stdex::interval<size_t>> components;
6536 _In_reads_or_z_(end)
const char*
text,
6537 _In_ size_t start = 0,
6538 _In_ size_t end = (
size_t)-1,
6583 virtual void invalidate()
6586 parser::invalidate();
6600 _In_reads_or_z_(end)
const char*
text,
6601 _In_ size_t start = 0,
6602 _In_ size_t end = (
size_t)-1,
6606 if (start < end &&
text[start] ==
'*') {
6618 template <
class T,
class T_asterisk = http_asterisk>
6628 _In_reads_or_z_(end)
const char*
text,
6629 _In_ size_t start = 0,
6630 _In_ size_t end = (
size_t)-1,
6642 asterisk.invalidate();
6645 asterisk.invalidate();
6667 factor.invalidate();
6674 virtual void invalidate()
6676 asterisk.invalidate();
6678 factor.invalidate();
6679 parser::invalidate();
6695 _In_reads_or_z_(end)
const char*
text,
6696 _In_ size_t start = 0,
6697 _In_ size_t end = (
size_t)-1,
6732 virtual void invalidate()
6736 parser::invalidate();
6754 _In_reads_or_z_(end)
const char*
text,
6755 _In_ size_t start = 0,
6756 _In_ size_t end = (
size_t)-1,
6812 virtual void invalidate()
6817 parser::invalidate();
6836 _In_reads_or_z_(end)
const char*
text,
6837 _In_ size_t start = 0,
6838 _In_ size_t end = (
size_t)-1,
6891 virtual void invalidate()
6897 parser::invalidate();
6917 _In_reads_or_z_(end)
const char*
text,
6918 _In_ size_t start = 0,
6919 _In_ size_t end = (
size_t)-1,
6968 version_min.
start = 1;
6969 version_min.
end = 0;
6985 version_maj.
start = 1;
6986 version_maj.
end = 0;
6987 version_min.
start = 1;
6988 version_min.
end = 0;
6995 virtual void invalidate()
6999 version_maj.
start = 1;
7000 version_maj.
end = 0;
7001 version_min.
start = 1;
7002 version_min.
end = 0;
7004 parser::invalidate();
7027 _In_reads_or_z_(end)
const char*
text,
7028 _In_ size_t start = 0,
7029 _In_ size_t end = (
size_t)-1,
7081 protocol.invalidate();
7128 protocol.invalidate();
7134 virtual void invalidate()
7139 protocol.invalidate();
7140 parser::invalidate();
7159 _In_reads_or_z_(end)
const char*
text,
7160 _In_ size_t start = 0,
7161 _In_ size_t end = (
size_t)-1,
7244 virtual void invalidate()
7250 parser::invalidate();
7264 template <
class _Key,
class T>
7269 _In_reads_or_z_(end)
const char*
text,
7270 _In_ size_t start = 0,
7271 _In_ size_t end = (
size_t)-1,
7274 while (start < end) {
7276 if (start < end &&
text[start] ==
',') {
7283 T::insert(std::move(
el));
7293 constexpr bool operator()(
const T&
a,
const T&
b)
const noexcept
7295 return a.factor.value >
b.factor.value;
7302 template <
class T,
class _Alloc = std::allocator<T>>
7324 _In_ const std::locale& locale = std::locale()) :
7340 _In_reads_or_z_(end)
const T*
text,
7341 _In_ size_t start = 0,
7342 _In_ size_t end = (
size_t)-1,
7357 if (m_quote->match(
text, m_escape->interval.end, end,
flags)) {
7358 value +=
'"'; this->
interval.
end = m_quote->interval.end;
7361 if (m_sol->match(
text, m_escape->interval.end, end,
flags)) {
7362 value +=
'/'; this->
interval.
end = m_sol->interval.end;
7365 if (m_bs->match(
text, m_escape->interval.end, end,
flags)) {
7366 value +=
'\b'; this->
interval.
end = m_bs->interval.end;
7369 if (m_ff->match(
text, m_escape->interval.end, end,
flags)) {
7370 value +=
'\f'; this->
interval.
end = m_ff->interval.end;
7373 if (m_lf->match(
text, m_escape->interval.end, end,
flags)) {
7374 value +=
'\n'; this->
interval.
end = m_lf->interval.end;
7377 if (m_cr->match(
text, m_escape->interval.end, end,
flags)) {
7378 value +=
'\r'; this->
interval.
end = m_cr->interval.end;
7381 if (m_htab->match(
text, m_escape->interval.end, end,
flags)) {
7382 value +=
'\t'; this->
interval.
end = m_htab->interval.end;
7386 m_uni->match(
text, m_escape->interval.end, end,
flags) &&
7387 m_hex->match(
text, m_uni->interval.end, std::min(m_uni->interval.end + 4, end),
flags | match_case_insensitive) &&
7388 m_hex->interval.size() == 4 )
7390 assert(m_hex->value <= 0xffff);
7391 if (
sizeof(T) == 1) {
7392 if (m_hex->value > 0x7ff) {
7393 value += (T)(0xe0 | ((m_hex->value >> 12) & 0x0f));
7394 value += (T)(0x80 | ((m_hex->value >> 6) & 0x3f));
7395 value += (T)(0x80 | (m_hex->value & 0x3f));
7397 else if (m_hex->value > 0x7f) {
7398 value += (T)(0xc0 | ((m_hex->value >> 6) & 0x1f));
7399 value += (T)(0x80 | (m_hex->value & 0x3f));
7402 value += (T)(m_hex->value & 0x7f);
7405 value += (T)m_hex->value;
7409 if (m_escape->match(
text, m_escape->interval.end, end,
flags)) {
7410 value +=
'\\'; this->
interval.
end = m_escape->interval.end;
7415 value.Prilepi(
text + m_chr->interval.start, m_chr->interval.size());
7427 virtual void invalidate()
7434 std::basic_string<T> value;
7437 std::shared_ptr<basic_parser<T>> m_quote;
7438 std::shared_ptr<basic_parser<T>> m_chr;
7439 std::shared_ptr<basic_parser<T>> m_escape;
7440 std::shared_ptr<basic_parser<T>> m_sol;
7441 std::shared_ptr<basic_parser<T>> m_bs;
7442 std::shared_ptr<basic_parser<T>> m_ff;
7443 std::shared_ptr<basic_parser<T>> m_lf;
7444 std::shared_ptr<basic_parser<T>> m_cr;
7445 std::shared_ptr<basic_parser<T>> m_htab;
7446 std::shared_ptr<basic_parser<T>> m_uni;
7447 std::shared_ptr<basic_integer16<T>> m_hex;
7460#undef ENUM_FLAG_OPERATOR
Test for angle in d°mm'ss.dddd form.
Definition parser.hpp:4404
Test for any code unit.
Definition parser.hpp:230
Test for beginning of line.
Definition parser.hpp:624
Test for any.
Definition parser.hpp:1066
Test for Creditor Reference.
Definition parser.hpp:4974
T reference[22]
Normalized national reference number.
Definition parser.hpp:5103
T check_digits[3]
Two check digits.
Definition parser.hpp:5102
bool is_valid
Is reference valid per ISO 7064.
Definition parser.hpp:5104
Test for any code unit from a given string of code units.
Definition parser.hpp:729
Test for specific code unit.
Definition parser.hpp:300
Test for date.
Definition parser.hpp:4034
Test for valid DNS domain character.
Definition parser.hpp:2815
bool allow_on_edge
Is character allowed at the beginning or an end of a DNS domain?
Definition parser.hpp:2853
Test for DNS domain/hostname.
Definition parser.hpp:2915
bool m_allow_absolute
May DNS names end with a dot (absolute name)?
Definition parser.hpp:2979
Test for e-mail address.
Definition parser.hpp:3803
Test for emoticon.
Definition parser.hpp:3911
std::shared_ptr< basic_parser< T > > apex
apex/eyebrows/halo (e.g. O, 0)
Definition parser.hpp:4000
std::shared_ptr< basic_parser< T > > eyes
eyes (e.g. :, ;, >, |, B)
Definition parser.hpp:4001
std::shared_ptr< basic_set< T > > mouth
mouth (e.g. ), ), (, (, |, P, D, p, d)
Definition parser.hpp:4003
std::shared_ptr< basic_parser< T > > nose
nose (e.g. -, o)
Definition parser.hpp:4002
std::shared_ptr< basic_parser< T > > emoticon
emoticon as a whole (e.g. 😀, 🤔, 😶)
Definition parser.hpp:3999
Test for end of line.
Definition parser.hpp:662
Test for fraction.
Definition parser.hpp:1695
Test for International Bank Account Number.
Definition parser.hpp:4680
T bban[31]
Normalized Basic Bank Account Number.
Definition parser.hpp:4951
T country[3]
ISO 3166-1 alpha-2 country code.
Definition parser.hpp:4949
T check_digits[3]
Two check digits.
Definition parser.hpp:4950
bool is_valid
Is IBAN valid per ISO 7064.
Definition parser.hpp:4952
Test for decimal integer.
Definition parser.hpp:1304
Test for decimal integer possibly containing thousand separators.
Definition parser.hpp:1389
bool has_separators
Did integer have any separators?
Definition parser.hpp:1449
size_t digit_count
Total number of digits in integer.
Definition parser.hpp:1448
Test for hexadecimal integer.
Definition parser.hpp:1470
Base class for integer testing.
Definition parser.hpp:1282
size_t value
Calculated value of the numeral.
Definition parser.hpp:1296
Test for IPv4 address.
Definition parser.hpp:2355
stdex::interval< size_t > components[4]
Individual component intervals.
Definition parser.hpp:2470
struct in_addr value
IPv4 address value.
Definition parser.hpp:2471
Test for IPv6 address.
Definition parser.hpp:2574
std::shared_ptr< basic_parser< T > > scope_id
Scope ID (e.g. NIC index with link-local addresses)
Definition parser.hpp:2778
stdex::interval< size_t > components[8]
Individual component intervals.
Definition parser.hpp:2776
struct in6_addr value
IPv6 address value.
Definition parser.hpp:2777
Test for valid IPv6 address scope ID character.
Definition parser.hpp:2502
Test for repeating.
Definition parser.hpp:919
bool m_greedy
try to match as long sequence as possible
Definition parser.hpp:958
std::shared_ptr< basic_parser< T > > m_el
repeating element
Definition parser.hpp:955
size_t m_min_iterations
minimum number of iterations
Definition parser.hpp:956
size_t m_max_iterations
maximum number of iterations
Definition parser.hpp:957
Test for JSON string.
Definition parser.hpp:7310
Test for mixed numeral.
Definition parser.hpp:1931
std::shared_ptr< basic_parser< T > > fraction
fraction
Definition parser.hpp:2037
std::shared_ptr< basic_parser< T > > special_sign
Special sign (e.g. plus-minus '±')
Definition parser.hpp:2035
std::shared_ptr< basic_parser< T > > negative_sign
Negative sign.
Definition parser.hpp:2034
std::shared_ptr< basic_parser< T > > positive_sign
Positive sign.
Definition parser.hpp:2033
std::shared_ptr< basic_parser< T > > integer
Integer part.
Definition parser.hpp:2036
Test for monetary numeral.
Definition parser.hpp:2226
std::shared_ptr< basic_parser< T > > positive_sign
Positive sign.
Definition parser.hpp:2332
std::shared_ptr< basic_parser< T > > decimal_separator
Decimal separator.
Definition parser.hpp:2337
std::shared_ptr< basic_parser< T > > currency
Currency part.
Definition parser.hpp:2335
std::shared_ptr< basic_parser< T > > decimal
Decimal part.
Definition parser.hpp:2338
std::shared_ptr< basic_parser< T > > integer
Integer part.
Definition parser.hpp:2336
std::shared_ptr< basic_parser< T > > negative_sign
Negative sign.
Definition parser.hpp:2333
std::shared_ptr< basic_parser< T > > special_sign
Special sign (e.g. plus-minus '±')
Definition parser.hpp:2334
"No-op" match
Definition parser.hpp:198
Base template for all parsers.
Definition parser.hpp:79
interval< size_t > interval
Region of the last match.
Definition parser.hpp:178
Test for permutation.
Definition parser.hpp:1206
Test for phone number.
Definition parser.hpp:4527
std::basic_string< T > value
Normalized phone number.
Definition parser.hpp:4653
Test for any punctuation code unit.
Definition parser.hpp:472
Test for Roman numeral.
Definition parser.hpp:1579
Test for scientific numeral.
Definition parser.hpp:2057
std::shared_ptr< basic_parser< T > > special_sign
Special sign (e.g. plus-minus '±')
Definition parser.hpp:2201
std::shared_ptr< basic_parser< T > > exponent_symbol
Exponent symbol (e.g. 'e')
Definition parser.hpp:2205
std::shared_ptr< basic_parser< T > > positive_sign
Positive sign.
Definition parser.hpp:2199
std::shared_ptr< basic_parser< T > > negative_sign
Negative sign.
Definition parser.hpp:2200
double value
Calculated value of the numeral.
Definition parser.hpp:2209
std::shared_ptr< basic_parser< T > > negative_exp_sign
Negative exponent sign (e.g. '-')
Definition parser.hpp:2207
std::shared_ptr< basic_integer< T > > decimal
Decimal part.
Definition parser.hpp:2204
std::shared_ptr< basic_parser< T > > positive_exp_sign
Positive exponent sign (e.g. '+')
Definition parser.hpp:2206
std::shared_ptr< basic_integer< T > > exponent
Exponent part.
Definition parser.hpp:2208
std::shared_ptr< basic_parser< T > > decimal_separator
Decimal separator.
Definition parser.hpp:2203
std::shared_ptr< basic_integer< T > > integer
Integer part.
Definition parser.hpp:2202
Test for match score.
Definition parser.hpp:1758
Test for sequence.
Definition parser.hpp:1015
Definition parser.hpp:697
Test for SI Reference delimiter.
Definition parser.hpp:5171
Test for SI Reference part.
Definition parser.hpp:5126
Test for SI Reference.
Definition parser.hpp:5209
basic_si_reference_part< T > part3
Reference data part 3 (P3)
Definition parser.hpp:5526
basic_si_reference_part< T > part1
Reference data part 1 (P1)
Definition parser.hpp:5524
bool is_valid
Is reference valid.
Definition parser.hpp:5527
T model[3]
Reference model.
Definition parser.hpp:5523
basic_si_reference_part< T > part2
Reference data part 2 (P2)
Definition parser.hpp:5525
Test for signed numeral.
Definition parser.hpp:1845
std::shared_ptr< basic_parser< T > > special_sign
Special sign (e.g. plus-minus '±')
Definition parser.hpp:1913
std::shared_ptr< basic_parser< T > > negative_sign
Negative sign.
Definition parser.hpp:1912
std::shared_ptr< basic_parser< T > > positive_sign
Positive sign.
Definition parser.hpp:1911
std::shared_ptr< basic_parser< T > > number
Number.
Definition parser.hpp:1914
Test for any space code unit.
Definition parser.hpp:393
Test for any space or punctuation code unit.
Definition parser.hpp:546
Test for any string.
Definition parser.hpp:1134
Test for given string.
Definition parser.hpp:824
Test for time.
Definition parser.hpp:4301
Test for valid URL password character.
Definition parser.hpp:3097
Test for valid URL path character.
Definition parser.hpp:3197
Test for URL path.
Definition parser.hpp:3305
Test for valid URL username character.
Definition parser.hpp:2998
Test for URL.
Definition parser.hpp:3446
Test for HTTP agent.
Definition parser.hpp:6833
Test for HTTP any type.
Definition parser.hpp:5955
Test for HTTP asterisk.
Definition parser.hpp:6597
Test for HTTP cookie parameter (RFC2109)
Definition parser.hpp:6692
Test for HTTP cookie (RFC2109)
Definition parser.hpp:6751
std::list< http_cookie_parameter > params
List of cookie parameters.
Definition parser.hpp:6823
http_token name
Cookie name.
Definition parser.hpp:6821
http_value value
Cookie value.
Definition parser.hpp:6822
Test for HTTP language (RFC1766)
Definition parser.hpp:6465
Test for HTTP line break (RFC2616: CRLF | LF)
Definition parser.hpp:5629
Test for HTTP parameter (RFC2616: parameter)
Definition parser.hpp:5900
http_token name
Parameter name.
Definition parser.hpp:5944
http_value value
Parameter value.
Definition parser.hpp:5945
Test for HTTP protocol.
Definition parser.hpp:6909
uint16_t version
HTTP protocol version: 0x100 = 1.0, 0x101 = 1.1...
Definition parser.hpp:7011
Test for HTTP quoted string (RFC2616: quoted-string)
Definition parser.hpp:5790
stdex::interval< size_t > content
String content (without quotes)
Definition parser.hpp:5846
Test for HTTP request.
Definition parser.hpp:7018
Test for HTTP space (RFC2616: LWS)
Definition parser.hpp:5665
Test for HTTP text character (RFC2616: TEXT)
Definition parser.hpp:5702
Test for HTTP token (RFC2616: token - tolerates non-ASCII)
Definition parser.hpp:5736
Test for HTTP URL parameter.
Definition parser.hpp:6282
Test for HTTP URL path segment.
Definition parser.hpp:6193
Test for HTTP URL path segment.
Definition parser.hpp:6226
std::vector< http_url_path_segment > segments
Path segments.
Definition parser.hpp:6275
Test for HTTP URL port.
Definition parser.hpp:6137
Test for HTTP URL server.
Definition parser.hpp:6100
Test for HTTP URL.
Definition parser.hpp:6363
Collection of HTTP values.
Definition parser.hpp:7266
Test for HTTP value (RFC2616: value)
Definition parser.hpp:5856
http_quoted_string string
Value when matched as quoted string.
Definition parser.hpp:5892
http_token token
Value when matched as token.
Definition parser.hpp:5893
Test for HTTP weight factor.
Definition parser.hpp:6528
float value
Calculated value of the weight factor.
Definition parser.hpp:6590
Test for HTTP weighted value.
Definition parser.hpp:6620
Base template for collection-holding parsers.
Definition parser.hpp:975
Test for any SGML code point.
Definition parser.hpp:262
Test for any SGML code point from a given string of SGML code points.
Definition parser.hpp:781
Test for specific SGML code point.
Definition parser.hpp:349
Test for valid DNS domain SGML character.
Definition parser.hpp:2871
Test for valid IPv6 address scope ID SGML character.
Definition parser.hpp:2540
Test for any SGML punctuation code point.
Definition parser.hpp:513
Test for any SGML space code point.
Definition parser.hpp:436
Test for any SGML space or punctuation code point.
Definition parser.hpp:589
Test for SGML given string.
Definition parser.hpp:871
Test for valid URL password SGML character.
Definition parser.hpp:3149
Test for valid URL path SGML character.
Definition parser.hpp:3253
Test for valid URL username SGML character.
Definition parser.hpp:3049
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:7292