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,&) \
62 constexpr int match_default = 0;
63 constexpr int match_case_insensitive = 0x1;
64 constexpr int match_multiline = 0x2;
73 basic_parser(
_In_ const std::locale& locale = std::locale()) : m_locale(locale) {}
77 _In_reads_or_z_(end)
const T*
text,
78 _In_ size_t start = 0,
79 _In_ size_t end = (
size_t)-1,
82 for (
size_t i = start;
i < end &&
text[
i];
i++)
89 _In_reads_or_z_(end)
const T*
text,
90 _In_ size_t start = 0,
91 _In_ size_t end = (
size_t)-1,
94 template<
class _Traits,
class _Ax>
96 const std::basic_string<T, _Traits, _Ax>&
text,
97 _In_ size_t start = 0,
98 _In_ size_t end = (
size_t)-1,
101 return match(
text.c_str(), start, std::min<size_t>(end,
text.size()),
flags);
104 virtual void invalidate()
114 if (
text[start] ==
'&') {
116 const auto&
ctype = std::use_facet<std::ctype<T>>(m_locale);
125 if (
n >= 2 &&
text[start + 1] ==
'#') {
128 if (
text[start + 2] ==
'x' ||
text[start + 2] ==
'X')
129 unicode = strtou32(
text + start + 3,
n - 2,
nullptr, 16);
131 unicode = strtou32(
text + start + 2,
n - 1,
nullptr, 10);
138 ucs4_to_surrogate_pair(buf,
unicode);
162 buf[0] =
text[start];
173 std::locale m_locale;
193 _In_reads_or_z_(end)
const T*
text,
194 _In_ size_t start = 0,
195 _In_ size_t end = (
size_t)-1,
199 if (start < end &&
text[start]) {
227 _In_reads_or_z_(end)
const T*
text,
228 _In_ size_t start = 0,
229 _In_ size_t end = (
size_t)-1,
233 if (start < end &&
text[start]) {
259 _In_reads_or_z_(end)
const char*
text,
260 _In_ size_t start = 0,
261 _In_ size_t end = (
size_t)-1,
265 if (start < end &&
text[start]) {
266 if (
text[start] ==
'&') {
268 const auto&
ctype = std::use_facet<std::ctype<char>>(m_locale);
301 _In_reads_or_z_(end)
const T*
text,
302 _In_ size_t start = 0,
303 _In_ size_t end = (
size_t)-1,
307 if (start < end &&
text[start]) {
309 if (
flags & match_case_insensitive) {
310 const auto&
ctype = std::use_facet<std::ctype<T>>(this->m_locale);
314 r =
text[start] == m_chr;
315 if ((
r && !m_invert) || (!
r && m_invert)) {
343 sgml_cp(
const char*
chr,
size_t count = (
size_t)-1,
bool invert =
false,
_In_ const std::locale& locale = std::locale()) :
354 _In_reads_or_z_(end)
const char*
text,
355 _In_ size_t start = 0,
356 _In_ size_t end = (
size_t)-1,
360 if (start < end &&
text[start]) {
363 bool r = ((
flags & match_case_insensitive) ?
364 stdex::strnicmp(
chr, (
size_t)-1, m_chr.c_str(), m_chr.size(), m_locale) :
365 stdex::strncmp(
chr, (
size_t)-1, m_chr.c_str(), m_chr.size())) == 0;
366 if ((
r && !m_invert) || (!
r && m_invert)) {
393 _In_reads_or_z_(end)
const T*
text,
394 _In_ size_t start = 0,
395 _In_ size_t end = (
size_t)-1,
399 if (start < end &&
text[start]) {
401 ((
flags & match_multiline) || !islbreak(
text[start])) &&
402 std::use_facet<std::ctype<T>>(this->m_locale).is(std::ctype_base::space,
text[start]);
403 if ((
r && !m_invert) || (!
r && m_invert)) {
435 _In_reads_or_z_(end)
const char*
text,
436 _In_ size_t start = 0,
437 _In_ size_t end = (
size_t)-1,
441 if (start < end &&
text[start]) {
446 ((
flags & match_multiline) || !islbreak(
chr, (
size_t)-1)) &&
448 if ((
r && !m_invert) || (!
r && m_invert)) {
472 _In_reads_or_z_(end)
const T*
text,
473 _In_ size_t start = 0,
474 _In_ size_t end = (
size_t)-1,
478 if (start < end &&
text[start]) {
479 bool r = std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::punct,
text[start]);
480 if ((
r && !m_invert) || (!
r && m_invert)) {
512 _In_reads_or_z_(end)
const char*
text,
513 _In_ size_t start = 0,
514 _In_ size_t end = (
size_t)-1,
518 if (start < end &&
text[start]) {
523 if ((
r && !m_invert) || (!
r && m_invert)) {
546 _In_reads_or_z_(end)
const T*
text,
547 _In_ size_t start = 0,
548 _In_ size_t end = (
size_t)-1,
552 if (start < end &&
text[start]) {
554 ((
flags & match_multiline) || !islbreak(
text[start])) &&
555 std::use_facet<std::ctype<T>>(this->m_locale).is(std::ctype_base::space | std::ctype_base::punct,
text[start]);
556 if ((
r && !m_invert) || (!
r && m_invert)) {
588 _In_reads_or_z_(end)
const char*
text,
589 _In_ size_t start = 0,
590 _In_ size_t end = (
size_t)-1,
594 if (start < end &&
text[start]) {
599 ((
flags & match_multiline) || !islbreak(
chr, (
size_t)-1)) &&
600 std::use_facet<std::ctype<wchar_t>>(m_locale).
scan_not(std::ctype_base::space | std::ctype_base::punct,
chr,
chr_end) ==
chr_end;
601 if ((
r && !m_invert) || (!
r && m_invert)) {
621 _In_reads_or_z_(end)
const T*
text,
622 _In_ size_t start = 0,
623 _In_ size_t end = (
size_t)-1,
627 bool r = start == 0 || (start <= end && islbreak(
text[start - 1]));
628 if ((
r && !m_invert) || (!
r && m_invert)) {
659 _In_reads_or_z_(end)
const T*
text,
660 _In_ size_t start = 0,
661 _In_ size_t end = (
size_t)-1,
665 bool r = islbreak(
text[start]);
666 if ((
r && !m_invert) || (!
r && m_invert)) {
693 hit_offset((
size_t)-1),
698 _In_reads_or_z_(end)
const T*
text,
699 _In_ size_t start = 0,
700 _In_ size_t end = (
size_t)-1,
703 virtual void invalidate()
724 _In_reads_or_z_(
count)
const T* set,
727 _In_ const std::locale& locale = std::locale()) :
731 m_set.assign(set, set + stdex::strnlen(set,
count));
735 _In_reads_or_z_(end)
const T*
text,
736 _In_ size_t start = 0,
737 _In_ size_t end = (
size_t)-1,
741 if (start < end &&
text[start]) {
742 const T* set = m_set.c_str();
743 size_t r = (
flags & match_case_insensitive) ?
744 stdex::strnichr(set, m_set.size(),
text[start], this->m_locale) :
745 stdex::strnchr(set, m_set.size(),
text[start]);
746 if ((
r != stdex::npos && !this->m_invert) || (
r == stdex::npos && this->m_invert)) {
747 this->hit_offset =
r;
752 this->hit_offset = (
size_t)-1;
758 std::basic_string<T> m_set;
775 sgml_cp_set(
const char* set,
size_t count = (
size_t)-1,
bool invert =
false,
_In_ const std::locale& locale = std::locale()) :
779 m_set = sgml2wstr(set,
count);
783 _In_reads_or_z_(end)
const char*
text,
784 _In_ size_t start = 0,
785 _In_ size_t end = (
size_t)-1,
789 if (start < end &&
text[start]) {
792 const wchar_t* set = m_set.c_str();
793 size_t r = (
flags & match_case_insensitive) ?
794 stdex::strnistr(set, m_set.size(),
chr, m_locale) :
795 stdex::strnstr(set, m_set.size(),
chr);
796 if ((
r != stdex::npos && !m_invert) || (
r == stdex::npos && m_invert)) {
819 _In_reads_or_z_(
count)
const T*
str,
821 _In_ const std::locale& locale = std::locale()) :
827 _In_reads_or_z_(end)
const T*
text,
828 _In_ size_t start = 0,
829 _In_ size_t end = (
size_t)-1,
835 n = std::min<size_t>(end - start,
m);
836 bool r = ((
flags & match_case_insensitive) ?
837 stdex::strnicmp(
text + start,
n, m_str.c_str(),
m, this->m_locale) :
838 stdex::strncmp(
text + start,
n, m_str.c_str(),
m)) == 0;
848 std::basic_string<T> m_str;
871 _In_reads_or_z_(end)
const char*
text,
872 _In_ size_t start = 0,
873 _In_ size_t end = (
size_t)-1,
877 const wchar_t*
str = m_str.c_str();
879 const auto&
ctype = std::use_facet<std::ctype<wchar_t>>(m_locale);
921 _In_reads_or_z_(end)
const T*
text,
922 _In_ size_t start = 0,
923 _In_ size_t end = (
size_t)-1,
928 for (
size_t i = 0; ;
i++) {
947 std::shared_ptr<basic_parser<T>>
m_el;
975 _In_ const std::locale& locale = std::locale()) :
979 m_collection.reserve(
count);
981 m_collection.push_back(
el[
i]);
986 _In_ const std::locale& locale = std::locale()) :
991 virtual void invalidate()
993 for (
auto&
el: m_collection)
999 std::vector<std::shared_ptr<basic_parser<T>>> m_collection;
1012 _In_ const std::locale& locale = std::locale()) :
1018 _In_ const std::locale& locale = std::locale()) :
1023 _In_reads_or_z_(end)
const T*
text,
1024 _In_ size_t start = 0,
1025 _In_ size_t end = (
size_t)-1,
1030 for (
auto i = this->m_collection.begin();
i != this->m_collection.end(); ++
i) {
1032 for (++
i;
i != this->m_collection.end(); ++
i)
1062 hit_offset((
size_t)-1)
1069 _In_ const std::locale& locale = std::locale()) :
1071 hit_offset((
size_t)-1)
1076 _In_ const std::locale& locale = std::locale()) :
1078 hit_offset((
size_t)-1)
1082 _In_reads_or_z_(end)
const T*
text,
1083 _In_ size_t start = 0,
1084 _In_ size_t end = (
size_t)-1,
1089 for (
auto i = this->m_collection.begin();
i != this->m_collection.end(); ++
i, ++hit_offset) {
1090 if ((*i)->match(
text, start, end,
flags)) {
1092 for (++
i;
i != this->m_collection.end(); ++
i)
1102 virtual void invalidate()
1124 template <
class T,
class T_parser = basic_
string<T>>
1131 _In_ const std::locale& locale = std::locale()) :
1164 offset += stdex::strnlen(
str_z + offset,
count - offset) + 1, ++
n);
1165 this->m_collection.reserve(
n);
1169 offset += stdex::strnlen(
str_z + offset,
count - offset) + 1)
1170 this->m_collection.push_back(std::move(std::make_shared<T_parser>(
str_z + offset,
count - offset,
this->m_locale)));
1178 this->m_collection.push_back(std::move(std::make_shared<T_parser>(
str, (
size_t)-1,
this->m_locale)));
1179 (
p =
va_arg(params,
const T*)) !=
nullptr;
1180 this->m_collection.push_back(std::move(std::make_shared<T_parser>(
p, (
size_t)-1, this->m_locale))));
1203 _In_ const std::locale& locale = std::locale()) :
1209 _In_ const std::locale& locale = std::locale()) :
1214 _In_reads_or_z_(end)
const T*
text,
1215 _In_ size_t start = 0,
1216 _In_ size_t end = (
size_t)-1,
1220 for (
auto&
el: this->m_collection)
1222 if (match_recursively(
text, start, end,
flags)) {
1231 bool match_recursively(
1232 _In_reads_or_z_(end)
const T*
text,
1233 _In_ size_t start = 0,
1234 _In_ size_t end = (
size_t)-1,
1238 for (
auto&
el: this->m_collection) {
1281 virtual void invalidate()
1309 _In_ const std::locale& locale = std::locale()) :
1324 _In_reads_or_z_(end)
const T*
text,
1325 _In_ size_t start = 0,
1326 _In_ size_t end = (
size_t)-1,
1354 std::shared_ptr<basic_parser<T>>
1386 _In_ const std::locale& locale = std::locale()) :
1391 m_separator(separator)
1395 _In_reads_or_z_(end)
const T*
text,
1396 _In_ size_t start = 0,
1397 _In_ size_t end = (
size_t)-1,
1401 if (m_digits->match(
text, start, end,
flags)) {
1403 this->
value = m_digits->value;
1408 if (m_digits->interval.size() <= 3) {
1410 size_t hit_offset = (
size_t)-1;
1412 (hit_offset == (
size_t)-1 || hit_offset == m_separator->hit_offset) &&
1413 m_digits->match(
text, m_separator->interval.end, end,
flags) &&
1414 m_digits->interval.size() == 3)
1417 this->
value = this->
value * 1000 + m_digits->value;
1421 hit_offset = m_separator->hit_offset;
1432 virtual void invalidate()
1444 std::shared_ptr<basic_integer10<T>> m_digits;
1445 std::shared_ptr<basic_set<T>> m_separator;
1481 _In_ const std::locale& locale = std::locale()) :
1502 _In_reads_or_z_(end)
const T*
text,
1503 _In_ size_t start = 0,
1504 _In_ size_t end = (
size_t)-1,
1538 std::shared_ptr<basic_parser<T>>
1583 _In_ const std::locale& locale = std::locale()) :
1597 _In_reads_or_z_(end)
const T*
text,
1598 _In_ size_t start = 0,
1599 _In_ size_t end = (
size_t)-1,
1620 if (
dig[4] == (
size_t)-1)
dig[4] =
dig[0];
1628 this->
value += dig[0];
1631 (
dig[1] == 1 && (
dig[0] == 5 ||
dig[0] == 10)) ||
1632 (
dig[1] == 10 && (
dig[0] == 50 ||
dig[0] == 100)) ||
1633 (
dig[1] == 100 && (
dig[0] == 500 ||
dig[0] == 1000)) ||
1634 (
dig[1] == 1000 && (
dig[0] == 5000 ||
dig[0] == 10000)))
1641 this->
value -= dig[1];
1645 this->
value += dig[0];
1661 std::shared_ptr<basic_parser<T>>
1693 _In_ const std::locale& locale = std::locale()) :
1701 _In_reads_or_z_(end)
const T*
text,
1702 _In_ size_t start = 0,
1703 _In_ size_t end = (
size_t)-1,
1707 if (numerator->match(
text, start, end,
flags) &&
1708 fraction_line->match(
text, numerator->interval.end, end,
flags) &&
1709 denominator->match(
text, fraction_line->interval.end, end,
flags))
1715 numerator->invalidate();
1716 fraction_line->invalidate();
1717 denominator->invalidate();
1722 virtual void invalidate()
1724 numerator->invalidate();
1725 fraction_line->invalidate();
1726 denominator->invalidate();
1731 std::shared_ptr<basic_parser<T>> numerator;
1732 std::shared_ptr<basic_parser<T>> fraction_line;
1733 std::shared_ptr<basic_parser<T>> denominator;
1757 _In_ const std::locale& locale = std::locale()) :
1766 _In_reads_or_z_(end)
const T*
text,
1767 _In_ size_t start = 0,
1768 _In_ size_t end = (
size_t)-1,
1800 separator->invalidate();
1801 guest->invalidate();
1806 virtual void invalidate()
1809 separator->invalidate();
1810 guest->invalidate();
1815 std::shared_ptr<basic_parser<T>> home;
1816 std::shared_ptr<basic_parser<T>> separator;
1817 std::shared_ptr<basic_parser<T>> guest;
1820 std::shared_ptr<basic_parser<T>> m_space;
1844 _In_ const std::locale& locale = std::locale()) :
1853 _In_reads_or_z_(end)
const T*
text,
1854 _In_ size_t start = 0,
1855 _In_ size_t end = (
size_t)-1,
1893 virtual void invalidate()
1932 _In_ const std::locale& locale = std::locale()) :
1943 _In_reads_or_z_(end)
const T*
text,
1944 _In_ size_t start = 0,
1945 _In_ size_t end = (
size_t)-1,
2014 virtual void invalidate()
2032 std::shared_ptr<basic_parser<T>> m_space;
2062 _In_ const std::locale& locale = std::locale()) :
2074 value(std::numeric_limits<double>::quiet_NaN())
2078 _In_reads_or_z_(end)
const T*
text,
2079 _In_ size_t start = 0,
2080 _In_ size_t end = (
size_t)-1,
2118 if (
integer->interval.empty() &&
2174 virtual void invalidate()
2186 value = std::numeric_limits<double>::quiet_NaN();
2228 _In_ const std::locale& locale = std::locale()) :
2240 _In_reads_or_z_(end)
const T*
text,
2241 _In_ size_t start = 0,
2242 _In_ size_t end = (
size_t)-1,
2292 if (
integer->interval.empty() &&
2311 virtual void invalidate()
2361 _In_ const std::locale& locale = std::locale()) :
2373 m_separator(separator)
2379 _In_reads_or_z_(end)
const T*
text,
2380 _In_ size_t start = 0,
2381 _In_ size_t end = (
size_t)-1,
2389 for (
i = 0;
i < 4;
i++) {
2447 virtual void invalidate()
2466 std::shared_ptr<basic_parser<T>>
2477 std::shared_ptr<basic_parser<T>> m_separator;
2499 _In_reads_or_z_(end)
const T*
text,
2500 _In_ size_t start = 0,
2501 _In_ size_t end = (
size_t)-1,
2505 if (start < end &&
text[start]) {
2506 if (
text[start] ==
'-' ||
2507 text[start] ==
'_' ||
2508 text[start] ==
':' ||
2509 std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::alnum,
text[start]))
2537 _In_reads_or_z_(end)
const char*
text,
2538 _In_ size_t start = 0,
2539 _In_ size_t end = (
size_t)-1,
2543 if (start < end &&
text[start]) {
2547 if (((
chr[0] ==
L'-' ||
2549 chr[0] ==
L':') &&
chr[1] == 0) ||
2588 _In_ const std::locale& locale = std::locale()) :
2606 m_separator(separator),
2614 _In_reads_or_z_(end)
const T*
text,
2615 _In_ size_t start = 0,
2616 _In_ size_t end = (
size_t)-1,
2624 for (
i = 0;
i < 8;
i++) {
2628 if (m_separator->match(
text, m_separator->interval.end, end,
flags)) {
2677 if (
x_n <= 0xffff) {
2700 this->
value.s6_words[--j] = this->
value.s6_words[--k];
2704 this->
value.s6_words[--j] = 0;
2744 virtual void invalidate()
2773 std::shared_ptr<basic_parser<T>>
2790 std::shared_ptr<basic_parser<T>> m_separator, m_scope_id_separator;
2811 _In_ const std::locale& locale = std::locale()) :
2818 _In_reads_or_z_(end)
const T*
text,
2819 _In_ size_t start = 0,
2820 _In_ size_t end = (
size_t)-1,
2824 if (start < end &&
text[start]) {
2825 if ((
'A' <=
text[start] &&
text[start] <=
'Z') ||
2826 (
'a' <=
text[start] &&
text[start] <=
'z') ||
2827 (
'0' <=
text[start] &&
text[start] <=
'9'))
2829 else if (
text[start] ==
'-')
2831 else if (m_allow_idn && std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::alnum,
text[start]))
2867 _In_ const std::locale& locale = std::locale()) :
2872 _In_reads_or_z_(end)
const char*
text,
2873 _In_ size_t start = 0,
2874 _In_ size_t end = (
size_t)-1,
2878 if (start < end &&
text[start]) {
2882 if (((
'A' <=
chr[0] &&
chr[0] <=
'Z') ||
2883 (
'a' <=
chr[0] &&
chr[0] <=
'z') ||
2884 (
'0' <=
chr[0] &&
chr[0] <=
'9')) &&
chr[1] == 0)
2886 else if (
chr[0] ==
'-' &&
chr[1] == 0)
2888 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)
2913 _In_ const std::locale& locale = std::locale()) :
2917 m_separator(separator)
2921 _In_reads_or_z_(end)
const T*
text,
2922 _In_ size_t start = 0,
2923 _In_ size_t end = (
size_t)-1,
2929 if (m_domain_char->match(
text,
i, end,
flags) &&
2930 m_domain_char->allow_on_edge)
2934 while (
i < end &&
text[
i]) {
2935 if (m_domain_char->allow_on_edge &&
2943 i = m_separator->interval.end;
2947 if (m_domain_char->match(
text,
i, end,
flags)) {
2948 if (m_domain_char->allow_on_edge)
2951 i = m_domain_char->interval.end;
2972 std::shared_ptr<basic_dns_domain_char<T>> m_domain_char;
2973 std::shared_ptr<basic_parser<T>> m_separator;
2995 _In_reads_or_z_(end)
const T*
text,
2996 _In_ size_t start = 0,
2997 _In_ size_t end = (
size_t)-1,
3001 if (start < end &&
text[start]) {
3002 if (
text[start] ==
'-' ||
3003 text[start] ==
'.' ||
3004 text[start] ==
'_' ||
3005 text[start] ==
'~' ||
3006 text[start] ==
'%' ||
3007 text[start] ==
'!' ||
3008 text[start] ==
'$' ||
3009 text[start] ==
'&' ||
3010 text[start] ==
'\'' ||
3013 text[start] ==
'*' ||
3014 text[start] ==
'+' ||
3015 text[start] ==
',' ||
3016 text[start] ==
';' ||
3017 text[start] ==
'=' ||
3018 std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::alnum,
text[start]))
3046 _In_reads_or_z_(end)
const char*
text,
3047 _In_ size_t start = 0,
3048 _In_ size_t end = (
size_t)-1,
3052 if (start < end &&
text[start]) {
3056 if (((
chr[0] ==
L'-' ||
3071 chr[0] ==
L'=') &&
chr[1] == 0) ||
3094 _In_reads_or_z_(end)
const T*
text,
3095 _In_ size_t start = 0,
3096 _In_ size_t end = (
size_t)-1,
3100 if (start < end &&
text[start]) {
3101 if (
text[start] ==
'-' ||
3102 text[start] ==
'.' ||
3103 text[start] ==
'_' ||
3104 text[start] ==
'~' ||
3105 text[start] ==
'%' ||
3106 text[start] ==
'!' ||
3107 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 std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::alnum,
text[start]))
3146 _In_reads_or_z_(end)
const char*
text,
3147 _In_ size_t start = 0,
3148 _In_ size_t end = (
size_t)-1,
3152 if (start < end &&
text[start]) {
3156 if (((
chr[0] ==
L'-' ||
3172 chr[0] ==
L':') &&
chr[1] == 0) ||
3194 _In_reads_or_z_(end)
const T*
text,
3195 _In_ size_t start = 0,
3196 _In_ size_t end = (
size_t)-1,
3200 if (start < end &&
text[start]) {
3201 if (
text[start] ==
'/' ||
3202 text[start] ==
'-' ||
3203 text[start] ==
'.' ||
3204 text[start] ==
'_' ||
3205 text[start] ==
'~' ||
3206 text[start] ==
'%' ||
3207 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 std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::alnum,
text[start]))
3250 _In_reads_or_z_(end)
const char*
text,
3251 _In_ size_t start = 0,
3252 _In_ size_t end = (
size_t)-1,
3256 if (start < end &&
text[start]) {
3260 if (((
chr[0] ==
L'/' ||
3280 chr[0] ==
L'#') &&
chr[1] == 0) ||
3303 _In_ const std::locale& locale = std::locale()) :
3311 _In_reads_or_z_(end)
const T*
text,
3312 _In_ size_t start = 0,
3313 _In_ size_t end = (
size_t)-1,
3402 virtual void invalidate()
3419 std::shared_ptr<basic_parser<T>> m_path_char;
3420 std::shared_ptr<basic_parser<T>> m_query_start;
3421 std::shared_ptr<basic_parser<T>> m_bookmark_start;
3457 _In_ const std::locale& locale = std::locale()) :
3478 _In_reads_or_z_(end)
const T*
text,
3479 _In_ size_t start = 0,
3480 _In_ size_t end = (
size_t)-1,
3488 m_colon->match(
text, http_scheme->interval.end, end,
flags) &&
3489 m_slash->match(
text, m_colon->interval.end, end,
flags) &&
3490 m_slash->match(
text, m_slash->interval.end, end,
flags))
3494 ftp_scheme->invalidate();
3495 mailto_scheme->invalidate();
3496 file_scheme->invalidate();
3499 m_colon->match(
text, ftp_scheme->interval.end, end,
flags) &&
3500 m_slash->match(
text, m_colon->interval.end, end,
flags) &&
3501 m_slash->match(
text, m_slash->interval.end, end,
flags))
3505 http_scheme->invalidate();
3506 mailto_scheme->invalidate();
3507 file_scheme->invalidate();
3510 m_colon->match(
text, mailto_scheme->interval.end, end,
flags))
3514 http_scheme->invalidate();
3515 ftp_scheme->invalidate();
3516 file_scheme->invalidate();
3519 m_colon->match(
text, file_scheme->interval.end, end,
flags) &&
3520 m_slash->match(
text, m_colon->interval.end, end,
flags) &&
3521 m_slash->match(
text, m_slash->interval.end, end,
flags))
3525 http_scheme->invalidate();
3526 ftp_scheme->invalidate();
3527 mailto_scheme->invalidate();
3531 http_scheme->invalidate();
3532 ftp_scheme->invalidate();
3533 mailto_scheme->invalidate();
3534 file_scheme->invalidate();
3537 if (ftp_scheme->interval) {
3539 if (m_colon->match(
text, username->interval.end, end,
flags) &&
3540 password->match(
text, m_colon->interval.end, end,
flags) &&
3541 m_at->match(
text, password->interval.end, end,
flags))
3549 password->invalidate();
3552 username->invalidate();
3553 password->invalidate();
3557 username->invalidate();
3558 password->invalidate();
3564 ipv6_host->invalidate();
3565 dns_host->invalidate();
3569 ipv6_host->match(
text, m_ip_lbracket->interval.end, end,
flags) &&
3570 m_ip_rbracket->match(
text, ipv6_host->interval.end, end,
flags))
3574 ipv4_host->invalidate();
3575 dns_host->invalidate();
3580 ipv4_host->invalidate();
3581 ipv6_host->invalidate();
3589 port->match(
text, m_colon->interval.end, end,
flags))
3606 if (mailto_scheme->interval) {
3608 m_at->match(
text, username->interval.end, end,
flags))
3619 ipv4_host->match(
text, m_ip_lbracket->interval.end, end,
flags) &&
3620 m_ip_rbracket->match(
text, ipv4_host->interval.end, end,
flags))
3624 ipv6_host->invalidate();
3625 dns_host->invalidate();
3629 ipv6_host->match(
text, m_ip_lbracket->interval.end, end,
flags) &&
3630 m_ip_rbracket->match(
text, ipv6_host->interval.end, end,
flags))
3634 ipv4_host->invalidate();
3635 dns_host->invalidate();
3640 ipv4_host->invalidate();
3641 ipv6_host->invalidate();
3648 password->invalidate();
3655 if (file_scheme->interval) {
3661 username->invalidate();
3662 password->invalidate();
3663 ipv4_host->invalidate();
3664 ipv6_host->invalidate();
3665 dns_host->invalidate();
3674 if (http_scheme->interval &&
3677 if (m_colon->match(
text, username->interval.end, end,
flags) &&
3678 password->match(
text, m_colon->interval.end, end,
flags) &&
3679 m_at->match(
text, password->interval.end, end,
flags))
3684 else if (m_at->match(
text, username->interval.end, end,
flags)) {
3687 password->invalidate();
3690 username->invalidate();
3691 password->invalidate();
3695 username->invalidate();
3696 password->invalidate();
3702 ipv6_host->invalidate();
3703 dns_host->invalidate();
3707 ipv6_host->match(
text, m_ip_lbracket->interval.end, end,
flags) &&
3708 m_ip_rbracket->match(
text, ipv6_host->interval.end, end,
flags))
3712 ipv4_host->invalidate();
3713 dns_host->invalidate();
3718 ipv4_host->invalidate();
3719 ipv6_host->invalidate();
3727 port->match(
text, m_colon->interval.end, end,
flags))
3744 virtual void invalidate()
3746 http_scheme->invalidate();
3747 ftp_scheme->invalidate();
3748 mailto_scheme->invalidate();
3749 file_scheme->invalidate();
3750 username->invalidate();
3751 password->invalidate();
3752 ipv4_host->invalidate();
3753 ipv6_host->invalidate();
3754 dns_host->invalidate();
3761 std::shared_ptr<basic_parser<T>> http_scheme;
3762 std::shared_ptr<basic_parser<T>> ftp_scheme;
3763 std::shared_ptr<basic_parser<T>> mailto_scheme;
3764 std::shared_ptr<basic_parser<T>> file_scheme;
3765 std::shared_ptr<basic_parser<T>> username;
3766 std::shared_ptr<basic_parser<T>> password;
3767 std::shared_ptr<basic_parser<T>> ipv4_host;
3768 std::shared_ptr<basic_parser<T>> ipv6_host;
3769 std::shared_ptr<basic_parser<T>> dns_host;
3770 std::shared_ptr<basic_parser<T>> port;
3771 std::shared_ptr<basic_parser<T>> path;
3774 std::shared_ptr<basic_parser<T>> m_colon;
3775 std::shared_ptr<basic_parser<T>> m_slash;
3776 std::shared_ptr<basic_parser<T>> m_at;
3777 std::shared_ptr<basic_parser<T>> m_ip_lbracket;
3778 std::shared_ptr<basic_parser<T>> m_ip_rbracket;
3805 _In_ const std::locale& locale = std::locale()) :
3817 _In_reads_or_z_(end)
const T*
text,
3818 _In_ size_t start = 0,
3819 _In_ size_t end = (
size_t)-1,
3824 if (username->match(
text, start, end,
flags) &&
3825 m_at->match(
text, username->interval.end, end,
flags))
3828 if (m_ip_lbracket->match(
text, m_at->interval.end, end,
flags) &&
3829 ipv4_host->match(
text, m_ip_lbracket->interval.end, end,
flags) &&
3830 m_ip_rbracket->match(
text, ipv4_host->interval.end, end,
flags))
3834 ipv6_host->invalidate();
3835 dns_host->invalidate();
3838 m_ip_lbracket->match(
text, m_at->interval.end, end,
flags) &&
3839 ipv6_host->match(
text, m_ip_lbracket->interval.end, end,
flags) &&
3840 m_ip_rbracket->match(
text, ipv6_host->interval.end, end,
flags))
3844 ipv4_host->invalidate();
3845 dns_host->invalidate();
3847 else if (dns_host->match(
text, m_at->interval.end, end,
flags)) {
3850 ipv4_host->invalidate();
3851 ipv6_host->invalidate();
3860 username->invalidate();
3861 ipv4_host->invalidate();
3862 ipv6_host->invalidate();
3863 dns_host->invalidate();
3868 virtual void invalidate()
3870 username->invalidate();
3871 ipv4_host->invalidate();
3872 ipv6_host->invalidate();
3873 dns_host->invalidate();
3878 std::shared_ptr<basic_parser<T>> username;
3879 std::shared_ptr<basic_parser<T>> ipv4_host;
3880 std::shared_ptr<basic_parser<T>> ipv6_host;
3881 std::shared_ptr<basic_parser<T>> dns_host;
3884 std::shared_ptr<basic_parser<T>> m_at;
3885 std::shared_ptr<basic_parser<T>> m_ip_lbracket;
3886 std::shared_ptr<basic_parser<T>> m_ip_rbracket;
3911 _In_ const std::locale& locale = std::locale()) :
3921 _In_reads_or_z_(end)
const T*
text,
3922 _In_ size_t start = 0,
3923 _In_ size_t end = (
size_t)-1,
3932 mouth->invalidate();
3949 hit_offset =
mouth->hit_offset;
3960 hit_offset =
mouth->hit_offset;
3975 mouth->invalidate();
3980 virtual void invalidate()
3986 mouth->invalidate();
3992 std::shared_ptr<basic_parser<T>>
apex;
3993 std::shared_ptr<basic_parser<T>>
eyes;
3994 std::shared_ptr<basic_parser<T>>
nose;
4010 enum date_format_t {
4011 date_format_none = 0,
4012 date_format_dmy = 0x1,
4013 date_format_mdy = 0x2,
4014 date_format_ymd = 0x4,
4015 date_format_ym = 0x8,
4016 date_format_my = 0x10,
4017 date_format_dm = 0x20,
4018 date_format_md = 0x40,
4035 _In_ const std::locale& locale = std::locale()) :
4037 format(date_format_none),
4042 m_separator(separator),
4047 _In_reads_or_z_(end)
const T*
text,
4048 _In_ size_t start = 0,
4049 _In_ size_t end = (
size_t)-1,
4055 if ((m_format_mask & date_format_dmy) == date_format_dmy) {
4056 if (day->match(
text, start, end,
flags)) {
4059 size_t hit_offset = m_separator->hit_offset;
4064 m_separator->hit_offset == hit_offset)
4068 is_valid(day->value, month->value))
4072 format = date_format_dmy;
4081 if ((m_format_mask & date_format_mdy) == date_format_mdy) {
4082 if (month->match(
text, start, end,
flags)) {
4085 size_t hit_offset = m_separator->hit_offset;
4090 m_separator->hit_offset == hit_offset)
4094 is_valid(day->value, month->value))
4098 format = date_format_mdy;
4107 if ((m_format_mask & date_format_ymd) == date_format_ymd) {
4108 if (year->match(
text, start, end,
flags)) {
4111 size_t hit_offset = m_separator->hit_offset;
4116 m_separator->hit_offset == hit_offset)
4120 is_valid(day->value, month->value))
4124 format = date_format_ymd;
4133 if ((m_format_mask & date_format_ym) == date_format_ym) {
4134 if (year->match(
text, start, end,
flags)) {
4139 is_valid((
size_t)-1, month->value))
4141 if (day) day->invalidate();
4144 format = date_format_ym;
4151 if ((m_format_mask & date_format_my) == date_format_my) {
4152 if (month->match(
text, start, end,
flags)) {
4157 is_valid((
size_t)-1, month->value))
4159 if (day) day->invalidate();
4162 format = date_format_my;
4169 if ((m_format_mask & date_format_dm) == date_format_dm) {
4170 if (day->match(
text, start, end,
flags)) {
4173 size_t hit_offset = m_separator->hit_offset;
4176 is_valid(day->value, month->value))
4178 if (year) year->invalidate();
4182 m_separator->hit_offset == hit_offset)
4186 format = date_format_dm;
4193 if ((m_format_mask & date_format_md) == date_format_md) {
4194 if (month->match(
text, start, end,
flags)) {
4197 size_t hit_offset = m_separator->hit_offset;
4200 is_valid(day->value, month->value))
4202 if (year) year->invalidate();
4206 m_separator->hit_offset == hit_offset)
4210 format = date_format_md;
4217 if (day) day->invalidate();
4218 if (month) month->invalidate();
4219 if (year) year->invalidate();
4220 format = date_format_none;
4225 virtual void invalidate()
4227 if (day) day->invalidate();
4228 if (month) month->invalidate();
4229 if (year) year->invalidate();
4230 format = date_format_none;
4235 static inline bool is_valid(
size_t day,
size_t month)
4237 if (month == (
size_t)-1) {
4241 if (day == (
size_t)-1) {
4254 return 1 <= day && day <= 31;
4256 return 1 <= day && day <= 29;
4261 return 1 <= day && day <= 30;
4268 date_format_t format;
4269 std::shared_ptr<basic_integer<T>> day;
4270 std::shared_ptr<basic_integer<T>> month;
4271 std::shared_ptr<basic_integer<T>> year;
4275 std::shared_ptr<basic_set<T>> m_separator;
4276 std::shared_ptr<basic_parser<T>> m_space;
4302 _In_ const std::locale& locale = std::locale()) :
4308 m_separator(separator),
4313 _In_reads_or_z_(end)
const T*
text,
4314 _In_ size_t start = 0,
4315 _In_ size_t end = (
size_t)-1,
4320 if (hour->match(
text, start, end,
flags) &&
4321 m_separator->match(
text, hour->interval.end, end,
flags) &&
4322 minute->match(
text, m_separator->interval.end, end,
flags) &&
4326 size_t hit_offset = m_separator->hit_offset;
4327 if (m_separator->match(
text, minute->interval.end, end,
flags) &&
4328 m_separator->hit_offset == hit_offset &&
4329 second && second->match(
text, m_separator->interval.end, end,
flags) &&
4333 if (m_millisecond_separator && m_millisecond_separator->match(
text, second->interval.end, end,
flags) &&
4334 millisecond && millisecond->match(
text, m_millisecond_separator->interval.end, end,
flags) &&
4335 millisecond->value < 1000)
4341 if (millisecond) millisecond->invalidate();
4346 if (second) second->invalidate();
4347 if (millisecond) millisecond->invalidate();
4355 minute->invalidate();
4356 if (second) second->invalidate();
4357 if (millisecond) millisecond->invalidate();
4362 virtual void invalidate()
4365 minute->invalidate();
4366 if (second) second->invalidate();
4367 if (millisecond) millisecond->invalidate();
4372 std::shared_ptr<basic_integer10<T>> hour;
4373 std::shared_ptr<basic_integer10<T>> minute;
4374 std::shared_ptr<basic_integer10<T>> second;
4375 std::shared_ptr<basic_integer10<T>> millisecond;
4378 std::shared_ptr<basic_set<T>> m_separator;
4379 std::shared_ptr<basic_parser<T>> m_millisecond_separator;
4406 _In_ const std::locale& locale = std::locale()) :
4418 _In_reads_or_z_(end)
const T*
text,
4419 _In_ size_t start = 0,
4420 _In_ size_t end = (
size_t)-1,
4428 degree_separator->match(
text, degree->interval.end, end,
flags))
4431 this->
interval.
end = degree_separator->interval.end;
4434 degree->invalidate();
4435 degree_separator->invalidate();
4439 minute->value < 60 &&
4440 minute_separator->match(
text, minute->interval.end, end,
flags))
4443 this->
interval.
end = minute_separator->interval.end;
4446 minute->invalidate();
4447 minute_separator->invalidate();
4456 this->
interval.
end = second_separator->interval.end;
4458 if (second_separator) second_separator->invalidate();
4461 if (second) second->invalidate();
4462 if (second_separator) second_separator->invalidate();
4465 if (degree->interval.start < degree->interval.end ||
4466 minute->interval.start < minute->interval.end ||
4467 (second && second->interval.start < second->interval.end))
4474 decimal->invalidate();
4478 if (decimal) decimal->invalidate();
4483 virtual void invalidate()
4485 degree->invalidate();
4486 degree_separator->invalidate();
4487 minute->invalidate();
4488 minute_separator->invalidate();
4489 if (second) second->invalidate();
4490 if (second_separator) second_separator->invalidate();
4491 if (decimal) decimal->invalidate();
4496 std::shared_ptr<basic_integer10<T>> degree;
4497 std::shared_ptr<basic_parser<T>> degree_separator;
4498 std::shared_ptr<basic_integer10<T>> minute;
4499 std::shared_ptr<basic_parser<T>> minute_separator;
4500 std::shared_ptr<basic_integer10<T>> second;
4501 std::shared_ptr<basic_parser<T>> second_separator;
4502 std::shared_ptr<basic_parser<T>> decimal;
4528 _In_ const std::locale& locale = std::locale()) :
4534 m_separator(separator),
4539 _In_reads_or_z_(end)
const T*
text,
4540 _In_ size_t start = 0,
4541 _In_ size_t end = (
size_t)-1,
4552 m_lparenthesis->invalidate();
4553 m_rparenthesis->invalidate();
4556 value.append(
text + m_plus_sign->interval.start,
text + m_plus_sign->interval.end);
4567 value.append(
text + m_digit->interval.start,
text + m_digit->interval.end);
4578 m_lparenthesis && !m_lparenthesis->interval &&
4579 m_rparenthesis && !m_rparenthesis->interval &&
4583 value.append(
text + m_lparenthesis->interval.start, m_lparenthesis->interval.size());
4584 this->
interval.
end = m_lparenthesis->interval.end;
4591 m_rparenthesis && !m_rparenthesis->interval &&
4593 m_lparenthesis->hit_offset == m_rparenthesis->hit_offset)
4596 value.append(
text + m_rparenthesis->interval.start,
text + m_rparenthesis->interval.end);
4597 this->
interval.
end = m_rparenthesis->interval.end;
4638 virtual void invalidate()
4648 std::shared_ptr<basic_parser<T>> m_digit;
4649 std::shared_ptr<basic_parser<T>> m_plus_sign;
4650 std::shared_ptr<basic_set<T>> m_lparenthesis;
4651 std::shared_ptr<basic_set<T>> m_rparenthesis;
4652 std::shared_ptr<basic_parser<T>> m_separator;
4653 std::shared_ptr<basic_parser<T>> m_space;
4676 _In_ const std::locale& locale = std::locale()) :
4687 _In_reads_or_z_(end)
const T*
text,
4688 _In_ size_t start = 0,
4689 _In_ size_t end = (
size_t)-1,
4693 const auto&
ctype = std::use_facet<std::ctype<T>>(this->m_locale);
4701 { {
'A',
'D' }, {}, 24 },
4702 { {
'A',
'E' }, {}, 23 },
4703 { {
'A',
'L' }, {}, 28 },
4704 { {
'A',
'O' }, {}, 25 },
4705 { {
'A',
'T' }, {}, 20 },
4706 { {
'A',
'Z' }, {}, 28 },
4707 { {
'B',
'A' }, {
'3',
'9' }, 20},
4708 { {
'B',
'E' }, {}, 16 },
4709 { {
'B',
'F' }, {}, 28 },
4710 { {
'B',
'G' }, {}, 22 },
4711 { {
'B',
'H' }, {}, 22 },
4712 { {
'B',
'I' }, {}, 27 },
4713 { {
'B',
'J' }, {}, 28 },
4714 { {
'B',
'R' }, {}, 29 },
4715 { {
'B',
'Y' }, {}, 28 },
4716 { {
'C',
'F' }, {}, 27 },
4717 { {
'C',
'G' }, {}, 27 },
4718 { {
'C',
'H' }, {}, 21 },
4719 { {
'C',
'I' }, {}, 28 },
4720 { {
'C',
'M' }, {}, 27 },
4721 { {
'C',
'R' }, {}, 22 },
4722 { {
'C',
'V' }, {}, 25 },
4723 { {
'C',
'Y' }, {}, 28 },
4724 { {
'C',
'Z' }, {}, 24 },
4725 { {
'D',
'E' }, {}, 22 },
4726 { {
'D',
'J' }, {}, 27 },
4727 { {
'D',
'K' }, {}, 18 },
4728 { {
'D',
'O' }, {}, 28 },
4729 { {
'D',
'Z' }, {}, 26 },
4730 { {
'E',
'E' }, {}, 20 },
4731 { {
'E',
'G' }, {}, 29 },
4732 { {
'E',
'S' }, {}, 24 },
4733 { {
'F',
'I' }, {}, 18 },
4734 { {
'F',
'O' }, {}, 18 },
4735 { {
'F',
'R' }, {}, 27 },
4736 { {
'G',
'A' }, {}, 27 },
4737 { {
'G',
'B' }, {}, 22 },
4738 { {
'G',
'E' }, {}, 22 },
4739 { {
'G',
'I' }, {}, 23 },
4740 { {
'G',
'L' }, {}, 18 },
4741 { {
'G',
'Q' }, {}, 27 },
4742 { {
'G',
'R' }, {}, 27 },
4743 { {
'G',
'T' }, {}, 28 },
4744 { {
'G',
'W' }, {}, 25 },
4745 { {
'H',
'N' }, {}, 28 },
4746 { {
'H',
'R' }, {}, 21 },
4747 { {
'H',
'U' }, {}, 28 },
4748 { {
'I',
'E' }, {}, 22 },
4749 { {
'I',
'L' }, {}, 23 },
4750 { {
'I',
'Q' }, {}, 23 },
4751 { {
'I',
'R' }, {}, 26 },
4752 { {
'I',
'S' }, {}, 26 },
4753 { {
'I',
'T' }, {}, 27 },
4754 { {
'J',
'O' }, {}, 30 },
4755 { {
'K',
'M' }, {}, 27 },
4756 { {
'K',
'W' }, {}, 30 },
4757 { {
'K',
'Z' }, {}, 20 },
4758 { {
'L',
'B' }, {}, 28 },
4759 { {
'L',
'C' }, {}, 32 },
4760 { {
'L',
'I' }, {}, 21 },
4761 { {
'L',
'T' }, {}, 20 },
4762 { {
'L',
'U' }, {}, 20 },
4763 { {
'L',
'V' }, {}, 21 },
4764 { {
'L',
'Y' }, {}, 25 },
4765 { {
'M',
'A' }, {}, 28 },
4766 { {
'M',
'C' }, {}, 27 },
4767 { {
'M',
'D' }, {}, 24 },
4768 { {
'M',
'E' }, {
'2',
'5' }, 22 },
4769 { {
'M',
'G' }, {}, 27 },
4770 { {
'M',
'K' }, {
'0',
'7' }, 19 },
4771 { {
'M',
'L' }, {}, 28 },
4772 { {
'M',
'R' }, {
'1',
'3' }, 27},
4773 { {
'M',
'T' }, {}, 31 },
4774 { {
'M',
'U' }, {}, 30 },
4775 { {
'M',
'Z' }, {}, 25 },
4776 { {
'N',
'E' }, {}, 28 },
4777 { {
'N',
'I' }, {}, 32 },
4778 { {
'N',
'L' }, {}, 18 },
4779 { {
'N',
'O' }, {}, 15 },
4780 { {
'P',
'K' }, {}, 24 },
4781 { {
'P',
'L' }, {}, 28 },
4782 { {
'P',
'S' }, {}, 29 },
4783 { {
'P',
'T' }, {
'5',
'0' }, 25 },
4784 { {
'Q',
'A' }, {}, 29 },
4785 { {
'R',
'O' }, {}, 24 },
4786 { {
'R',
'S' }, {
'3',
'5' }, 22 },
4787 { {
'R',
'U' }, {}, 33 },
4788 { {
'S',
'A' }, {}, 24 },
4789 { {
'S',
'C' }, {}, 31 },
4790 { {
'S',
'D' }, {}, 18 },
4791 { {
'S',
'E' }, {}, 24 },
4792 { {
'S',
'I' }, {
'5',
'6' }, 19 },
4793 { {
'S',
'K' }, {}, 24 },
4794 { {
'S',
'M' }, {}, 27 },
4795 { {
'S',
'N' }, {}, 28 },
4796 { {
'S',
'T' }, {}, 25 },
4797 { {
'S',
'V' }, {}, 28 },
4798 { {
'T',
'D' }, {}, 27 },
4799 { {
'T',
'G' }, {}, 28 },
4800 { {
'T',
'L' }, {
'3',
'8' }, 23},
4801 { {
'T',
'N' }, {
'5',
'9' }, 24 },
4802 { {
'T',
'R' }, {}, 26 },
4803 { {
'U',
'A' }, {}, 29 },
4804 { {
'V',
'A' }, {}, 22 },
4805 { {
'V',
'G' }, {}, 24 },
4806 { {
'X',
'K' }, {}, 20 },
4817 if (
chr <
'A' ||
'Z' <
chr)
4824 size_t m = (
l +
r) / 2;
4826 if (
c.country[0] <
this->country[0] || (
c.country[0] ==
this->country[0] &&
c.country[1] <
this->country[1]))
4828 else if (this->
country[0] < c.country[0] || (
this->country[0] ==
c.country[0] &&
this->country[1] <
c.country[1]))
4844 if ((country_desc->check_digits[0] &&
this->check_digits[0] !=
country_desc->check_digits[0]) ||
4857 if ((
'0' <=
chr &&
chr <=
'9') || (
'A' <=
chr &&
chr <=
'Z')) {
4869 for (
size_t i = 0; ; ++
i) {
4870 if (!this->
bban[
i]) {
4871 for (
i = 0;
i < 2; ++
i) {
4890 if (
'0' <= this->
bban[i] && this->
bban[i] <=
'9')
4892 else if (
'A' <= this->
bban[i] && this->
bban[i] <=
'J') {
4896 else if (
'K' <= this->
bban[i] && this->
bban[i] <=
'T') {
4900 else if (
'U' <= this->
bban[i] && this->
bban[i] <=
'Z') {
4915 for (; digit_count < 9 &&
normalized[next]; ++next, ++digit_count)
4931 virtual void invalidate()
4947 std::shared_ptr<basic_parser<T>> m_space;
4970 _In_ const std::locale& locale = std::locale()) :
4980 _In_reads_or_z_(end)
const T*
text,
4981 _In_ size_t start = 0,
4982 _In_ size_t end = (
size_t)-1,
4986 const auto&
ctype = std::use_facet<std::ctype<T>>(this->m_locale);
5008 for (
size_t j = 0;
j < 4; ++
j) {
5012 if ((
'0' <=
chr &&
chr <=
'9') || (
'A' <=
chr &&
chr <=
'Z')) {
5028 for (
size_t j = _countof(this->
reference) - 1 - n;
j;)
5034 for (
size_t i = 0; ; ++
i) {
5070 for (; digit_count < 9 &&
normalized[next]; ++next, ++digit_count)
5085 virtual void invalidate()
5099 std::shared_ptr<basic_parser<T>> m_space;
5123 _In_reads_or_z_(end)
const T*
text,
5124 _In_ size_t start = 0,
5125 _In_ size_t end = (
size_t)-1,
5168 _In_reads_or_z_(end)
const T*
text,
5169 _In_ size_t start = 0,
5170 _In_ size_t end = (
size_t)-1,
5174 if (start < end &&
text[start] ==
'-') {
5205 _In_ const std::locale& locale = std::locale()) :
5218 _In_reads_or_z_(end)
const T*
text,
5219 _In_ size_t start = 0,
5220 _In_ size_t end = (
size_t)-1,
5224 const auto&
ctype = std::use_facet<std::ctype<T>>(this->m_locale);
5241 this->
part1.invalidate();
5242 this->
part2.invalidate();
5243 this->
part3.invalidate();
5244 if (this->
model[0] ==
'9' && this->
model[1] ==
'9') {
5269 if (this->
model[0] ==
'0' && this->
model[1] ==
'0')
5280 else if (this->
model[0] ==
'0' && this->
model[1] ==
'1')
5299 else if (this->
model[0] ==
'0' && this->
model[1] ==
'2')
5307 else if (this->
model[0] ==
'0' && this->
model[1] ==
'3')
5316 else if (this->
model[0] ==
'0' && this->
model[1] ==
'4')
5324 else if ((this->
model[0] ==
'0' || this->
model[0] ==
'5') && this->
model[1] ==
'5')
5338 else if (this->
model[0] ==
'0' && this->
model[1] ==
'6')
5351 else if (this->
model[0] ==
'0' && this->
model[1] ==
'7')
5362 else if (this->
model[0] ==
'0' && this->
model[1] ==
'8')
5372 else if (this->
model[0] ==
'0' && this->
model[1] ==
'9')
5390 else if (this->
model[0] ==
'1' && this->
model[1] ==
'0')
5406 (this->
model[0] ==
'1' && (this->
model[1] ==
'1' || this->
model[1] ==
'8' || this->
model[1] ==
'9')) ||
5407 ((this->
model[0] ==
'2' || this->
model[0] ==
'3') && this->
model[1] ==
'8') ||
5408 (this->
model[0] ==
'4' && (this->
model[1] ==
'0' || this->
model[1] ==
'1' || this->
model[1] ==
'8' || this->
model[1] ==
'9')) ||
5409 (this->
model[0] ==
'5' && (this->
model[1] ==
'1' || this->
model[1] ==
'8')))
5422 else if (this->
model[0] ==
'1' && this->
model[1] ==
'2')
5430 else if ((this->
model[0] ==
'2' || this->
model[0] ==
'3') && this->
model[1] ==
'1')
5452 virtual void invalidate()
5455 this->
part1.invalidate();
5456 this->
part2.invalidate();
5457 this->
part3.invalidate();
5463 static bool check11(
5476 static bool check11(
5493 static bool check11(
5522 std::shared_ptr<basic_parser<T>> m_space;
5546 _In_ const std::locale& locale = std::locale()) :
5556 _In_reads_or_z_(end)
const T*
text,
5557 _In_ size_t start = 0,
5558 _In_ size_t end = (
size_t)-1,
5591 virtual void invalidate()
5603 std::shared_ptr<basic_parser<T>> m_element;
5604 std::shared_ptr<basic_parser<T>> m_digit;
5605 std::shared_ptr<basic_parser<T>> m_sign;
5624 _In_reads_or_z_(end)
const char*
text,
5625 _In_ size_t start = 0,
5626 _In_ size_t end = (
size_t)-1,
5660 _In_reads_or_z_(end)
const char*
text,
5661 _In_ size_t start = 0,
5662 _In_ size_t end = (
size_t)-1,
5697 _In_reads_or_z_(end)
const char*
text,
5698 _In_ size_t start = 0,
5699 _In_ size_t end = (
size_t)-1,
5731 _In_reads_or_z_(end)
const char*
text,
5732 _In_ size_t start = 0,
5733 _In_ size_t end = (
size_t)-1,
5785 _In_reads_or_z_(end)
const char*
text,
5786 _In_ size_t start = 0,
5787 _In_ size_t end = (
size_t)-1,
5830 virtual void invalidate()
5834 parser::invalidate();
5851 _In_reads_or_z_(end)
const char*
text,
5852 _In_ size_t start = 0,
5853 _In_ size_t end = (
size_t)-1,
5865 string.invalidate();
5876 virtual void invalidate()
5878 string.invalidate();
5880 parser::invalidate();
5895 _In_reads_or_z_(end)
const char*
text,
5896 _In_ size_t start = 0,
5897 _In_ size_t end = (
size_t)-1,
5928 virtual void invalidate()
5932 parser::invalidate();
5950 _In_reads_or_z_(end)
const char*
text,
5951 _In_ size_t start = 0,
5952 _In_ size_t end = (
size_t)-1,
5956 if (start + 2 < end &&
5957 text[start] ==
'*' &&
5958 text[start + 1] ==
'/' &&
5959 text[start + 2] ==
'*')
5964 else if (start < end &&
text[start] ==
'*') {
5982 _In_reads_or_z_(end)
const char*
text,
5983 _In_ size_t start = 0,
5984 _In_ size_t end = (
size_t)-1,
6010 subtype.invalidate();
6015 virtual void invalidate()
6018 subtype.invalidate();
6019 parser::invalidate();
6037 _In_reads_or_z_(end)
const char*
text,
6038 _In_ size_t start = 0,
6039 _In_ size_t end = (
size_t)-1,
6043 if (!http_media_range::match(
text, start, end,
flags))
6057 params.push_back(std::move(
param));
6072 http_media_range::invalidate();
6078 virtual void invalidate()
6081 http_media_range::invalidate();
6085 std::list<http_parameter> params;
6095 _In_reads_or_z_(end)
const char*
text,
6096 _In_ size_t start = 0,
6097 _In_ size_t end = (
size_t)-1,
6137 _In_reads_or_z_(end)
const char*
text,
6138 _In_ size_t start = 0,
6139 _In_ size_t end = (
size_t)-1,
6171 virtual void invalidate()
6174 parser::invalidate();
6188 _In_reads_or_z_(end)
const char*
text,
6189 _In_ size_t start = 0,
6190 _In_ size_t end = (
size_t)-1,
6221 _In_reads_or_z_(end)
const char*
text,
6222 _In_ size_t start = 0,
6223 _In_ size_t end = (
size_t)-1,
6260 virtual void invalidate()
6263 parser::invalidate();
6277 _In_reads_or_z_(end)
const char*
text,
6278 _In_ size_t start = 0,
6279 _In_ size_t end = (
size_t)-1,
6337 virtual void invalidate()
6343 parser::invalidate();
6357 http_url(
_In_ const std::locale& locale = std::locale()) :
6363 _In_reads_or_z_(end)
const char*
text,
6364 _In_ size_t start = 0,
6365 _In_ size_t end = (
size_t)-1,
6388 server.invalidate();
6414 params.push_back(std::move(
param));
6429 server.invalidate();
6437 virtual void invalidate()
6439 server.invalidate();
6443 parser::invalidate();
6450 std::list<http_url_parameter> params;
6460 _In_reads_or_z_(end)
const char*
text,
6461 _In_ size_t start = 0,
6462 _In_ size_t end = (
size_t)-1,
6473 if (
k.end < end &&
text[
k.end]) {
6485 components.push_back(
k);
6497 if (!components.empty()) {
6506 virtual void invalidate()
6509 parser::invalidate();
6513 std::vector<stdex::interval<size_t>> components;
6528 _In_reads_or_z_(end)
const char*
text,
6529 _In_ size_t start = 0,
6530 _In_ size_t end = (
size_t)-1,
6575 virtual void invalidate()
6578 parser::invalidate();
6592 _In_reads_or_z_(end)
const char*
text,
6593 _In_ size_t start = 0,
6594 _In_ size_t end = (
size_t)-1,
6598 if (start < end &&
text[start] ==
'*') {
6610 template <
class T,
class T_asterisk = http_asterisk>
6620 _In_reads_or_z_(end)
const char*
text,
6621 _In_ size_t start = 0,
6622 _In_ size_t end = (
size_t)-1,
6634 asterisk.invalidate();
6637 asterisk.invalidate();
6659 factor.invalidate();
6666 virtual void invalidate()
6668 asterisk.invalidate();
6670 factor.invalidate();
6671 parser::invalidate();
6687 _In_reads_or_z_(end)
const char*
text,
6688 _In_ size_t start = 0,
6689 _In_ size_t end = (
size_t)-1,
6724 virtual void invalidate()
6728 parser::invalidate();
6746 _In_reads_or_z_(end)
const char*
text,
6747 _In_ size_t start = 0,
6748 _In_ size_t end = (
size_t)-1,
6804 virtual void invalidate()
6809 parser::invalidate();
6828 _In_reads_or_z_(end)
const char*
text,
6829 _In_ size_t start = 0,
6830 _In_ size_t end = (
size_t)-1,
6883 virtual void invalidate()
6889 parser::invalidate();
6909 _In_reads_or_z_(end)
const char*
text,
6910 _In_ size_t start = 0,
6911 _In_ size_t end = (
size_t)-1,
6960 version_min.
start = 1;
6961 version_min.
end = 0;
6977 version_maj.
start = 1;
6978 version_maj.
end = 0;
6979 version_min.
start = 1;
6980 version_min.
end = 0;
6987 virtual void invalidate()
6991 version_maj.
start = 1;
6992 version_maj.
end = 0;
6993 version_min.
start = 1;
6994 version_min.
end = 0;
6996 parser::invalidate();
7019 _In_reads_or_z_(end)
const char*
text,
7020 _In_ size_t start = 0,
7021 _In_ size_t end = (
size_t)-1,
7073 protocol.invalidate();
7120 protocol.invalidate();
7126 virtual void invalidate()
7131 protocol.invalidate();
7132 parser::invalidate();
7151 _In_reads_or_z_(end)
const char*
text,
7152 _In_ size_t start = 0,
7153 _In_ size_t end = (
size_t)-1,
7236 virtual void invalidate()
7242 parser::invalidate();
7256 template <
class _Key,
class T>
7261 _In_reads_or_z_(end)
const char*
text,
7262 _In_ size_t start = 0,
7263 _In_ size_t end = (
size_t)-1,
7266 while (start < end) {
7268 if (start < end &&
text[start] ==
',') {
7275 T::insert(std::move(
el));
7285 constexpr bool operator()(
const T&
a,
const T&
b)
const noexcept
7287 return a.factor.value >
b.factor.value;
7294 template <
class T,
class _Alloc = std::allocator<T>>
7316 _In_ const std::locale& locale = std::locale()) :
7332 _In_reads_or_z_(end)
const T*
text,
7333 _In_ size_t start = 0,
7334 _In_ size_t end = (
size_t)-1,
7349 if (m_quote->match(
text, m_escape->interval.end, end,
flags)) {
7350 value +=
'"'; this->
interval.
end = m_quote->interval.end;
7353 if (m_sol->match(
text, m_escape->interval.end, end,
flags)) {
7354 value +=
'/'; this->
interval.
end = m_sol->interval.end;
7357 if (m_bs->match(
text, m_escape->interval.end, end,
flags)) {
7358 value +=
'\b'; this->
interval.
end = m_bs->interval.end;
7361 if (m_ff->match(
text, m_escape->interval.end, end,
flags)) {
7362 value +=
'\f'; this->
interval.
end = m_ff->interval.end;
7365 if (m_lf->match(
text, m_escape->interval.end, end,
flags)) {
7366 value +=
'\n'; this->
interval.
end = m_lf->interval.end;
7369 if (m_cr->match(
text, m_escape->interval.end, end,
flags)) {
7370 value +=
'\r'; this->
interval.
end = m_cr->interval.end;
7373 if (m_htab->match(
text, m_escape->interval.end, end,
flags)) {
7374 value +=
'\t'; this->
interval.
end = m_htab->interval.end;
7378 m_uni->match(
text, m_escape->interval.end, end,
flags) &&
7379 m_hex->match(
text, m_uni->interval.end, std::min(m_uni->interval.end + 4, end),
flags | match_case_insensitive) &&
7380 m_hex->interval.size() == 4 )
7382 assert(m_hex->value <= 0xffff);
7383 if (
sizeof(T) == 1) {
7384 if (m_hex->value > 0x7ff) {
7385 value += (T)(0xe0 | ((m_hex->value >> 12) & 0x0f));
7386 value += (T)(0x80 | ((m_hex->value >> 6) & 0x3f));
7387 value += (T)(0x80 | (m_hex->value & 0x3f));
7389 else if (m_hex->value > 0x7f) {
7390 value += (T)(0xc0 | ((m_hex->value >> 6) & 0x1f));
7391 value += (T)(0x80 | (m_hex->value & 0x3f));
7394 value += (T)(m_hex->value & 0x7f);
7397 value += (T)m_hex->value;
7401 if (m_escape->match(
text, m_escape->interval.end, end,
flags)) {
7402 value +=
'\\'; this->
interval.
end = m_escape->interval.end;
7407 value.Prilepi(
text + m_chr->interval.start, m_chr->interval.size());
7419 virtual void invalidate()
7426 std::basic_string<T> value;
7429 std::shared_ptr<basic_parser<T>> m_quote;
7430 std::shared_ptr<basic_parser<T>> m_chr;
7431 std::shared_ptr<basic_parser<T>> m_escape;
7432 std::shared_ptr<basic_parser<T>> m_sol;
7433 std::shared_ptr<basic_parser<T>> m_bs;
7434 std::shared_ptr<basic_parser<T>> m_ff;
7435 std::shared_ptr<basic_parser<T>> m_lf;
7436 std::shared_ptr<basic_parser<T>> m_cr;
7437 std::shared_ptr<basic_parser<T>> m_htab;
7438 std::shared_ptr<basic_parser<T>> m_uni;
7439 std::shared_ptr<basic_integer16<T>> m_hex;
7452#undef ENUM_FLAG_OPERATOR
Test for angle in d°mm'ss.dddd form.
Definition parser.hpp:4396
Test for any code unit.
Definition parser.hpp:222
Test for beginning of line.
Definition parser.hpp:616
Test for any.
Definition parser.hpp:1058
Test for Creditor Reference.
Definition parser.hpp:4966
T reference[22]
Normalized national reference number.
Definition parser.hpp:5095
T check_digits[3]
Two check digits.
Definition parser.hpp:5094
bool is_valid
Is reference valid per ISO 7064.
Definition parser.hpp:5096
Test for any code unit from a given string of code units.
Definition parser.hpp:721
Test for specific code unit.
Definition parser.hpp:292
Test for date.
Definition parser.hpp:4026
Test for valid DNS domain character.
Definition parser.hpp:2807
bool allow_on_edge
Is character allowed at the beginning or an end of a DNS domain?
Definition parser.hpp:2845
Test for DNS domain/hostname.
Definition parser.hpp:2907
bool m_allow_absolute
May DNS names end with a dot (absolute name)?
Definition parser.hpp:2971
Test for e-mail address.
Definition parser.hpp:3795
Test for emoticon.
Definition parser.hpp:3903
std::shared_ptr< basic_parser< T > > apex
apex/eyebrows/halo (e.g. O, 0)
Definition parser.hpp:3992
std::shared_ptr< basic_parser< T > > eyes
eyes (e.g. :, ;, >, |, B)
Definition parser.hpp:3993
std::shared_ptr< basic_set< T > > mouth
mouth (e.g. ), ), (, (, |, P, D, p, d)
Definition parser.hpp:3995
std::shared_ptr< basic_parser< T > > nose
nose (e.g. -, o)
Definition parser.hpp:3994
std::shared_ptr< basic_parser< T > > emoticon
emoticon as a whole (e.g. 😀, 🤔, 😶)
Definition parser.hpp:3991
Test for end of line.
Definition parser.hpp:654
Test for fraction.
Definition parser.hpp:1687
Test for International Bank Account Number.
Definition parser.hpp:4672
T bban[31]
Normalized Basic Bank Account Number.
Definition parser.hpp:4943
T country[3]
ISO 3166-1 alpha-2 country code.
Definition parser.hpp:4941
T check_digits[3]
Two check digits.
Definition parser.hpp:4942
bool is_valid
Is IBAN valid per ISO 7064.
Definition parser.hpp:4944
Test for decimal integer.
Definition parser.hpp:1296
Test for decimal integer possibly containing thousand separators.
Definition parser.hpp:1381
bool has_separators
Did integer have any separators?
Definition parser.hpp:1441
size_t digit_count
Total number of digits in integer.
Definition parser.hpp:1440
Test for hexadecimal integer.
Definition parser.hpp:1462
Base class for integer testing.
Definition parser.hpp:1274
size_t value
Calculated value of the numeral.
Definition parser.hpp:1288
Test for IPv4 address.
Definition parser.hpp:2347
stdex::interval< size_t > components[4]
Individual component intervals.
Definition parser.hpp:2462
struct in_addr value
IPv4 address value.
Definition parser.hpp:2463
Test for IPv6 address.
Definition parser.hpp:2566
std::shared_ptr< basic_parser< T > > scope_id
Scope ID (e.g. NIC index with link-local addresses)
Definition parser.hpp:2770
stdex::interval< size_t > components[8]
Individual component intervals.
Definition parser.hpp:2768
struct in6_addr value
IPv6 address value.
Definition parser.hpp:2769
Test for valid IPv6 address scope ID character.
Definition parser.hpp:2494
Test for repeating.
Definition parser.hpp:911
bool m_greedy
try to match as long sequence as possible
Definition parser.hpp:950
std::shared_ptr< basic_parser< T > > m_el
repeating element
Definition parser.hpp:947
size_t m_min_iterations
minimum number of iterations
Definition parser.hpp:948
size_t m_max_iterations
maximum number of iterations
Definition parser.hpp:949
Test for JSON string.
Definition parser.hpp:7302
Test for mixed numeral.
Definition parser.hpp:1923
std::shared_ptr< basic_parser< T > > fraction
fraction
Definition parser.hpp:2029
std::shared_ptr< basic_parser< T > > special_sign
Special sign (e.g. plus-minus '±')
Definition parser.hpp:2027
std::shared_ptr< basic_parser< T > > negative_sign
Negative sign.
Definition parser.hpp:2026
std::shared_ptr< basic_parser< T > > positive_sign
Positive sign.
Definition parser.hpp:2025
std::shared_ptr< basic_parser< T > > integer
Integer part.
Definition parser.hpp:2028
Test for monetary numeral.
Definition parser.hpp:2218
std::shared_ptr< basic_parser< T > > positive_sign
Positive sign.
Definition parser.hpp:2324
std::shared_ptr< basic_parser< T > > decimal_separator
Decimal separator.
Definition parser.hpp:2329
std::shared_ptr< basic_parser< T > > currency
Currency part.
Definition parser.hpp:2327
std::shared_ptr< basic_parser< T > > decimal
Decimal part.
Definition parser.hpp:2330
std::shared_ptr< basic_parser< T > > integer
Integer part.
Definition parser.hpp:2328
std::shared_ptr< basic_parser< T > > negative_sign
Negative sign.
Definition parser.hpp:2325
std::shared_ptr< basic_parser< T > > special_sign
Special sign (e.g. plus-minus '±')
Definition parser.hpp:2326
"No-op" match
Definition parser.hpp:190
Base template for all parsers.
Definition parser.hpp:71
interval< size_t > interval
Region of the last match.
Definition parser.hpp:170
Test for permutation.
Definition parser.hpp:1198
Test for phone number.
Definition parser.hpp:4519
std::basic_string< T > value
Normalized phone number.
Definition parser.hpp:4645
Test for any punctuation code unit.
Definition parser.hpp:464
Test for Roman numeral.
Definition parser.hpp:1571
Test for scientific numeral.
Definition parser.hpp:2049
std::shared_ptr< basic_parser< T > > special_sign
Special sign (e.g. plus-minus '±')
Definition parser.hpp:2193
std::shared_ptr< basic_parser< T > > exponent_symbol
Exponent symbol (e.g. 'e')
Definition parser.hpp:2197
std::shared_ptr< basic_parser< T > > positive_sign
Positive sign.
Definition parser.hpp:2191
std::shared_ptr< basic_parser< T > > negative_sign
Negative sign.
Definition parser.hpp:2192
double value
Calculated value of the numeral.
Definition parser.hpp:2201
std::shared_ptr< basic_parser< T > > negative_exp_sign
Negative exponent sign (e.g. '-')
Definition parser.hpp:2199
std::shared_ptr< basic_integer< T > > decimal
Decimal part.
Definition parser.hpp:2196
std::shared_ptr< basic_parser< T > > positive_exp_sign
Positive exponent sign (e.g. '+')
Definition parser.hpp:2198
std::shared_ptr< basic_integer< T > > exponent
Exponent part.
Definition parser.hpp:2200
std::shared_ptr< basic_parser< T > > decimal_separator
Decimal separator.
Definition parser.hpp:2195
std::shared_ptr< basic_integer< T > > integer
Integer part.
Definition parser.hpp:2194
Test for match score.
Definition parser.hpp:1750
Test for sequence.
Definition parser.hpp:1007
Definition parser.hpp:689
Test for SI Reference delimiter.
Definition parser.hpp:5163
Test for SI Reference part.
Definition parser.hpp:5118
Test for SI Reference.
Definition parser.hpp:5201
basic_si_reference_part< T > part3
Reference data part 3 (P3)
Definition parser.hpp:5518
basic_si_reference_part< T > part1
Reference data part 1 (P1)
Definition parser.hpp:5516
bool is_valid
Is reference valid.
Definition parser.hpp:5519
T model[3]
Reference model.
Definition parser.hpp:5515
basic_si_reference_part< T > part2
Reference data part 2 (P2)
Definition parser.hpp:5517
Test for signed numeral.
Definition parser.hpp:1837
std::shared_ptr< basic_parser< T > > special_sign
Special sign (e.g. plus-minus '±')
Definition parser.hpp:1905
std::shared_ptr< basic_parser< T > > negative_sign
Negative sign.
Definition parser.hpp:1904
std::shared_ptr< basic_parser< T > > positive_sign
Positive sign.
Definition parser.hpp:1903
std::shared_ptr< basic_parser< T > > number
Number.
Definition parser.hpp:1906
Test for any space code unit.
Definition parser.hpp:385
Test for any space or punctuation code unit.
Definition parser.hpp:538
Test for any string.
Definition parser.hpp:1126
Test for given string.
Definition parser.hpp:816
Test for time.
Definition parser.hpp:4293
Test for valid URL password character.
Definition parser.hpp:3089
Test for valid URL path character.
Definition parser.hpp:3189
Test for URL path.
Definition parser.hpp:3297
Test for valid URL username character.
Definition parser.hpp:2990
Test for URL.
Definition parser.hpp:3438
Test for HTTP agent.
Definition parser.hpp:6825
Test for HTTP any type.
Definition parser.hpp:5947
Test for HTTP asterisk.
Definition parser.hpp:6589
Test for HTTP cookie parameter (RFC2109)
Definition parser.hpp:6684
Test for HTTP cookie (RFC2109)
Definition parser.hpp:6743
std::list< http_cookie_parameter > params
List of cookie parameters.
Definition parser.hpp:6815
http_token name
Cookie name.
Definition parser.hpp:6813
http_value value
Cookie value.
Definition parser.hpp:6814
Test for HTTP language (RFC1766)
Definition parser.hpp:6457
Test for HTTP line break (RFC2616: CRLF | LF)
Definition parser.hpp:5621
Test for HTTP parameter (RFC2616: parameter)
Definition parser.hpp:5892
http_token name
Parameter name.
Definition parser.hpp:5936
http_value value
Parameter value.
Definition parser.hpp:5937
Test for HTTP protocol.
Definition parser.hpp:6901
uint16_t version
HTTP protocol version: 0x100 = 1.0, 0x101 = 1.1...
Definition parser.hpp:7003
Test for HTTP quoted string (RFC2616: quoted-string)
Definition parser.hpp:5782
stdex::interval< size_t > content
String content (without quotes)
Definition parser.hpp:5838
Test for HTTP request.
Definition parser.hpp:7010
Test for HTTP space (RFC2616: LWS)
Definition parser.hpp:5657
Test for HTTP text character (RFC2616: TEXT)
Definition parser.hpp:5694
Test for HTTP token (RFC2616: token - tolerates non-ASCII)
Definition parser.hpp:5728
Test for HTTP URL parameter.
Definition parser.hpp:6274
Test for HTTP URL path segment.
Definition parser.hpp:6185
Test for HTTP URL path segment.
Definition parser.hpp:6218
std::vector< http_url_path_segment > segments
Path segments.
Definition parser.hpp:6267
Test for HTTP URL port.
Definition parser.hpp:6129
Test for HTTP URL server.
Definition parser.hpp:6092
Test for HTTP URL.
Definition parser.hpp:6355
Collection of HTTP values.
Definition parser.hpp:7258
Test for HTTP value (RFC2616: value)
Definition parser.hpp:5848
http_quoted_string string
Value when matched as quoted string.
Definition parser.hpp:5884
http_token token
Value when matched as token.
Definition parser.hpp:5885
Test for HTTP weight factor.
Definition parser.hpp:6520
float value
Calculated value of the weight factor.
Definition parser.hpp:6582
Test for HTTP weighted value.
Definition parser.hpp:6612
Base template for collection-holding parsers.
Definition parser.hpp:967
Test for any SGML code point.
Definition parser.hpp:254
Test for any SGML code point from a given string of SGML code points.
Definition parser.hpp:773
Test for specific SGML code point.
Definition parser.hpp:341
Test for valid DNS domain SGML character.
Definition parser.hpp:2863
Test for valid IPv6 address scope ID SGML character.
Definition parser.hpp:2532
Test for any SGML punctuation code point.
Definition parser.hpp:505
Test for any SGML space code point.
Definition parser.hpp:428
Test for any SGML space or punctuation code point.
Definition parser.hpp:581
Test for SGML given string.
Definition parser.hpp:863
Test for valid URL password SGML character.
Definition parser.hpp:3141
Test for valid URL path SGML character.
Definition parser.hpp:3245
Test for valid URL username SGML character.
Definition parser.hpp:3041
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:7284