10#include "interval.hpp"
24#include <netinet/in.h>
36#pragma warning(disable: 4100)
37#elif defined(__GNUC__)
38#pragma GCC diagnostic push
39#pragma GCC diagnostic ignored "-Wunknown-pragmas"
42#define ENUM_FLAG_OPERATOR(T,X) \
43inline 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)); } \
44inline 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); } \
45inline 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)); } \
46inline T& operator X= (T& lhs, const T rhs) { return lhs = lhs X rhs; } \
47inline T& operator X= (T& lhs, const std::underlying_type_t<T> rhs) { return lhs = lhs X rhs; }
48#define ENUM_FLAGS(T, type) \
50inline T operator ~ (T t) { return (T) (~static_cast<std::underlying_type_t <T>>(t)); } \
51ENUM_FLAG_OPERATOR(T,|) \
52ENUM_FLAG_OPERATOR(T,^) \
53ENUM_FLAG_OPERATOR(T,&) \
57#elif defined(__APPLE__)
58#define s6_words __u6_addr.__u6_addr16
60#define s6_words s6_addr16
70 constexpr int match_default = 0;
71 constexpr int match_case_insensitive = 0x1;
72 constexpr int match_multiline = 0x2;
85 _In_reads_or_z_opt_(end)
const T* text,
86 _In_ size_t start = 0,
90 for (
size_t i = start; i < end && text[i]; i++)
91 if (match(text, i, end,
flags))
97 _In_reads_or_z_opt_(end)
const T* text,
98 _In_ size_t start = 0,
102 return do_match(text, start, end,
flags);
106 _In_ const std::basic_string_view<T, std::char_traits<T>> text,
107 _In_ size_t start = 0,
111 return match(text.data(), start, std::min<size_t>(end, text.size()),
flags);
114 virtual void invalidate()
122 virtual bool do_match(
123 _In_reads_or_z_opt_(end)
const T* text,
124 _In_ size_t start = 0,
131 if (text[start] ==
'&') {
133 const auto&
ctype = std::use_facet<std::ctype<T>>(m_locale);
142 if (
n >= 2 && text[start + 1] ==
'#') {
145 if (text[start + 2] ==
'x' || text[start + 2] ==
'X')
146 unicode =
static_cast<utf32_t
>(strtou32(text + start + 3,
n - 2,
nullptr, 16));
148 unicode =
static_cast<utf32_t
>(strtou32(text + start + 2,
n - 1,
nullptr, 10));
155 ucs4_to_surrogate_pair(buf,
unicode);
179 buf[0] = text[start];
186 std::locale m_locale;
189 using parser = basic_parser<char>;
190 using wparser = basic_parser<wchar_t>;
192 using tparser = wparser;
194 using tparser = parser;
196 using sgml_parser = basic_parser<char>;
205 virtual bool do_match(
206 _In_reads_or_z_opt_(end)
const T* text,
207 _In_ size_t start = 0,
211 _Assume_(text || start >= end);
212 if (start < end && text[start]) {
213 this->interval.
start = this->interval.
end = start;
240 virtual bool do_match(
241 _In_reads_or_z_opt_(end)
const T* text,
242 _In_ size_t start = 0,
246 _Assume_(text || start >= end);
247 if (start < end && text[start]) {
248 this->interval.
end = (this->interval.
start = start) + 1;
273 virtual bool do_match(
274 _In_reads_or_z_(end)
const char* text,
275 _In_ size_t start = 0,
279 _Assume_(text || start >= end);
280 if (start < end && text[start]) {
281 if (text[start] ==
'&') {
283 const auto&
ctype = std::use_facet<std::ctype<char>>(m_locale);
284 for (this->interval.
end = start + 1; this->interval.
end < end && text[this->interval.
end]; this->interval.
end++)
285 if (text[this->interval.
end] ==
';') {
286 this->interval.
end++;
287 this->interval.
start = start;
294 this->interval.
end = (this->interval.
start = start) + 1;
316 virtual bool do_match(
317 _In_reads_or_z_opt_(end)
const T* text,
318 _In_ size_t start = 0,
322 _Assume_(text || start >= end);
323 if (start < end && text[start]) {
325 if (
flags & match_case_insensitive) {
326 const auto&
ctype = std::use_facet<std::ctype<T>>(this->m_locale);
327 r =
ctype.tolower(text[start]) ==
ctype.tolower(m_chr);
330 r = text[start] == m_chr;
331 if ((
r && !m_invert) || (!
r && m_invert)) {
332 this->interval.
end = (this->interval.
start = start) + 1;
369 virtual bool do_match(
370 _In_reads_or_z_(end)
const char* text,
371 _In_ size_t start = 0,
375 _Assume_(text || start >= end);
376 if (start < end && text[start]) {
379 bool r = ((
flags & match_case_insensitive) ?
380 stdex::strnicmp(
chr,
SIZE_MAX, m_chr.data(), m_chr.size(), m_locale) :
381 stdex::strncmp(
chr,
SIZE_MAX, m_chr.data(), m_chr.size())) == 0;
382 if ((
r && !m_invert) || (!
r && m_invert)) {
383 this->interval.
start = start;
408 virtual bool do_match(
409 _In_reads_or_z_opt_(end)
const T* text,
410 _In_ size_t start = 0,
414 _Assume_(text || start >= end);
415 if (start < end && text[start]) {
417 ((
flags & match_multiline) || !stdex::islbreak(text[start])) &&
418 std::use_facet<std::ctype<T>>(this->m_locale).is(std::ctype_base::space, text[start]);
419 if ((
r && !m_invert) || (!
r && m_invert)) {
420 this->interval.
end = (this->interval.
start = start) + 1;
450 virtual bool do_match(
451 _In_reads_or_z_(end)
const char* text,
452 _In_ size_t start = 0,
456 _Assume_(text || start >= end);
457 if (start < end && text[start]) {
463 std::use_facet<std::ctype<wchar_t>>(m_locale).scan_not(std::ctype_base::space,
chr,
chr_end) ==
chr_end;
464 if ((
r && !m_invert) || (!
r && m_invert)) {
465 this->interval.
start = start;
488 virtual bool do_match(
489 _In_reads_or_z_opt_(end)
const T* text,
490 _In_ size_t start = 0,
494 _Assume_(text || start >= end);
495 if (start < end && text[start]) {
496 bool r = std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::punct, text[start]);
497 if ((
r && !m_invert) || (!
r && m_invert)) {
498 this->interval.
end = (this->interval.
start = start) + 1;
528 virtual bool do_match(
529 _In_reads_or_z_(end)
const char* text,
530 _In_ size_t start = 0,
534 _Assume_(text || start >= end);
535 if (start < end && text[start]) {
540 if ((
r && !m_invert) || (!
r && m_invert)) {
541 this->interval.
start = start;
563 virtual bool do_match(
564 _In_reads_or_z_opt_(end)
const T* text,
565 _In_ size_t start = 0,
569 _Assume_(text || start >= end);
570 if (start < end && text[start]) {
572 ((
flags & match_multiline) || !stdex::islbreak(text[start])) &&
573 std::use_facet<std::ctype<T>>(this->m_locale).is(std::ctype_base::space | std::ctype_base::punct, text[start]);
574 if ((
r && !m_invert) || (!
r && m_invert)) {
575 this->interval.
end = (this->interval.
start = start) + 1;
605 virtual bool do_match(
606 _In_reads_or_z_(end)
const char* text,
607 _In_ size_t start = 0,
611 _Assume_(text || start >= end);
612 if (start < end && text[start]) {
618 std::use_facet<std::ctype<wchar_t>>(m_locale).scan_not(std::ctype_base::space | std::ctype_base::punct,
chr,
chr_end) ==
chr_end;
619 if ((
r && !m_invert) || (!
r && m_invert)) {
620 this->interval.
start = start;
639 virtual bool do_match(
640 _In_reads_or_z_opt_(end)
const T* text,
641 _In_ size_t start = 0,
645 _Assume_(text || !end);
646 _Assume_(text || start >= end);
647 bool r = start == 0 || (start <= end && stdex::islbreak(text[start - 1]));
648 if ((
r && !m_invert) || (!
r && m_invert)) {
649 this->interval.
end = this->interval.
start = start;
678 virtual bool do_match(
679 _In_reads_or_z_opt_(end)
const T* text,
680 _In_ size_t start = 0,
684 _Assume_(text || start >= end);
685 bool r = start >= end || !text[start] || stdex::islbreak(text[start]);
686 if ((
r && !m_invert) || (!
r && m_invert)) {
687 this->interval.
end = this->interval.
start = start;
716 virtual void invalidate()
725 virtual bool do_match(
726 _In_reads_or_z_opt_(end)
const T* text,
727 _In_ size_t start = 0,
742 _In_reads_or_z_(
count)
const T* set,
745 _In_ const std::locale&
locale = std::locale()) :
749 m_set.assign(set, set + stdex::strnlen(set,
count));
753 virtual bool do_match(
754 _In_reads_or_z_opt_(end)
const T* text,
755 _In_ size_t start = 0,
759 _Assume_(text || start >= end);
760 if (start < end && text[start]) {
761 const T* set = m_set.data();
762 size_t r = (
flags & match_case_insensitive) ?
763 stdex::strnichr(set, m_set.size(), text[start], this->m_locale) :
764 stdex::strnchr(set, m_set.size(), text[start]);
765 if ((
r != stdex::npos && !this->m_invert) || (
r == stdex::npos && this->m_invert)) {
766 this->hit_offset =
r;
767 this->interval.
end = (this->interval.
start = start) + 1;
776 std::basic_string<T> m_set;
797 m_set = sgml2str(set,
count);
801 virtual bool do_match(
802 _In_reads_or_z_(end)
const char* text,
803 _In_ size_t start = 0,
807 _Assume_(text || start >= end);
808 if (start < end && text[start]) {
811 const wchar_t* set = m_set.data();
812 size_t r = (
flags & match_case_insensitive) ?
813 stdex::strnistr(set, m_set.size(),
chr, m_locale) :
814 stdex::strnstr(set, m_set.size(),
chr);
815 if ((
r != stdex::npos && !m_invert) || (
r == stdex::npos && m_invert)) {
817 this->interval.
start = start;
837 _In_reads_or_z_(
count)
const T*
str,
839 _In_ const std::locale&
locale = std::locale()) :
845 virtual bool do_match(
846 _In_reads_or_z_opt_(end)
const T* text,
847 _In_ size_t start = 0,
851 _Assume_(text || start >= end);
854 n = std::min<size_t>(end - start,
m);
855 bool r = ((
flags & match_case_insensitive) ?
856 stdex::strnicmp(text + start,
n, m_str.data(),
m, this->m_locale) :
857 stdex::strncmp(text + start,
n, m_str.data(),
m)) == 0;
859 this->interval.
end = (this->interval.
start = start) +
n;
866 std::basic_string<T> m_str;
889 virtual bool do_match(
890 _In_reads_or_z_(end)
const char* text,
891 _In_ size_t start = 0,
895 _Assume_(text || start >= end);
896 const wchar_t*
str = m_str.data();
898 const auto&
ctype = std::use_facet<std::ctype<wchar_t>>(m_locale);
899 for (this->interval.
end = start;;) {
901 this->interval.
start = start;
939 virtual bool do_match(
940 _In_reads_or_z_opt_(end)
const T* text,
941 _In_ size_t start = 0,
945 _Assume_(text || start >= end);
946 this->interval.
start = this->interval.
end = start;
947 for (
size_t i = 0; ; i++) {
959 this->interval.
end =
m_el->interval.end;
965 std::shared_ptr<basic_parser<T>>
m_el;
993 _In_ const std::locale&
locale = std::locale()) :
997 m_collection.reserve(
count);
998 for (
size_t i = 0; i <
count; i++)
999 m_collection.push_back(
el[i]);
1004 _In_ const std::locale&
locale = std::locale()) :
1009 virtual void invalidate()
1011 for (
auto&
el : m_collection)
1017 std::vector<std::shared_ptr<basic_parser<T>>> m_collection;
1030 _In_ const std::locale&
locale = std::locale()) :
1036 _In_ const std::locale&
locale = std::locale()) :
1041 virtual bool do_match(
1042 _In_reads_or_z_opt_(end)
const T* text,
1043 _In_ size_t start = 0,
1047 _Assume_(text || start >= end);
1048 this->interval.
end = start;
1049 for (
auto i = this->m_collection.begin(); i != this->m_collection.end(); ++i) {
1051 for (++i; i != this->m_collection.end(); ++i)
1056 this->interval.
end = (*i)->interval.end;
1058 this->interval.
start = start;
1088 _In_ const std::locale&
locale = std::locale()) :
1095 _In_ const std::locale&
locale = std::locale()) :
1100 virtual void invalidate()
1109 virtual bool do_match(
1110 _In_reads_or_z_opt_(end)
const T* text,
1111 _In_ size_t start = 0,
1115 _Assume_(text || start >= end);
1117 for (
auto i = this->m_collection.begin(); i != this->m_collection.end(); ++i, ++hit_offset) {
1118 if ((*i)->match(text, start, end,
flags)) {
1120 for (++i; i != this->m_collection.end(); ++i)
1143 template <
class T,
class T_parser = basic_
string<T>>
1150 _In_ const std::locale&
locale = std::locale()) :
1184 this->m_collection.reserve(
n);
1197 this->m_collection.push_back(std::move(std::make_shared<T_parser>(
str,
SIZE_MAX,
this->m_locale)));
1198 (p =
va_arg(params,
const T*)) !=
nullptr;
1199 this->m_collection.push_back(std::move(std::make_shared<T_parser>(p,
SIZE_MAX, this->m_locale))));
1222 _In_ const std::locale&
locale = std::locale()) :
1228 _In_ const std::locale&
locale = std::locale()) :
1233 virtual bool do_match(
1234 _In_reads_or_z_opt_(end)
const T* text,
1235 _In_ size_t start = 0,
1239 _Assume_(text || start >= end);
1240 for (
auto&
el : this->m_collection)
1242 if (match_recursively(text, start, end,
flags)) {
1243 this->interval.
start = start;
1250 bool match_recursively(
1251 _In_reads_or_z_opt_(end)
const T* text,
1252 _In_ size_t start = 0,
1257 for (
auto&
el : this->m_collection) {
1261 if (
el->match(text, start, end,
flags)) {
1272 this->interval.
end = start;
1300 virtual void invalidate()
1328 _In_ const std::locale&
locale = std::locale()) :
1343 virtual bool do_match(
1344 _In_reads_or_z_opt_(end)
const T* text,
1345 _In_ size_t start = 0,
1349 _Assume_(text || start >= end);
1350 for (this->interval.
end = start,
this->value = 0; this->interval.
end < end && text[this->interval.
end];) {
1366 this->interval.
start = start;
1373 std::shared_ptr<basic_parser<T>>
1405 _In_ const std::locale&
locale = std::locale()) :
1410 m_separator(separator)
1413 virtual void invalidate()
1424 virtual bool do_match(
1425 _In_reads_or_z_opt_(end)
const T* text,
1426 _In_ size_t start = 0,
1430 _Assume_(text || start >= end);
1431 if (m_digits->match(text, start, end,
flags)) {
1433 this->
value = m_digits->value;
1436 this->interval.
start = start;
1437 this->interval.
end = m_digits->interval.end;
1438 if (m_digits->interval.size() <= 3) {
1442 (hit_offset ==
SIZE_MAX || hit_offset == m_separator->hit_offset) &&
1443 m_digits->match(text, m_separator->interval.end, end,
flags) &&
1444 m_digits->interval.size() == 3)
1447 this->
value = this->
value * 1000 + m_digits->value;
1450 this->interval.
end = m_digits->interval.end;
1451 hit_offset = m_separator->hit_offset;
1462 std::shared_ptr<basic_integer10<T>> m_digits;
1463 std::shared_ptr<basic_set<T>> m_separator;
1466 using integer10ts = basic_integer10ts<char>;
1467 using winteger10ts = basic_integer10ts<wchar_t>;
1469 using tinteger10ts = winteger10ts;
1471 using tinteger10ts = integer10ts;
1473 using sgml_integer10ts = basic_integer10ts<char>;
1499 _In_ const std::locale&
locale = std::locale()) :
1520 virtual bool do_match(
1521 _In_reads_or_z_opt_(end)
const T* text,
1522 _In_ size_t start = 0,
1526 _Assume_(text || start >= end);
1527 for (this->interval.
end = start,
this->value = 0; this->interval.
end < end && text[this->interval.
end];) {
1539 else if (m_digit_10->match(text,
this->
interval.
end, end,
flags)) {
dig = 10; this->interval.
end = m_digit_10->interval.end; }
1540 else if (m_digit_11->match(text,
this->
interval.
end, end,
flags)) {
dig = 11; this->interval.
end = m_digit_11->interval.end; }
1541 else if (m_digit_12->match(text,
this->
interval.
end, end,
flags)) {
dig = 12; this->interval.
end = m_digit_12->interval.end; }
1542 else if (m_digit_13->match(text,
this->
interval.
end, end,
flags)) {
dig = 13; this->interval.
end = m_digit_13->interval.end; }
1543 else if (m_digit_14->match(text,
this->
interval.
end, end,
flags)) {
dig = 14; this->interval.
end = m_digit_14->interval.end; }
1544 else if (m_digit_15->match(text,
this->
interval.
end, end,
flags)) {
dig = 15; this->interval.
end = m_digit_15->interval.end; }
1549 this->interval.
start = start;
1556 std::shared_ptr<basic_parser<T>>
1601 _In_ const std::locale&
locale = std::locale()) :
1615 virtual bool do_match(
1616 _In_reads_or_z_opt_(end)
const T* text,
1617 _In_ size_t start = 0,
1621 _Assume_(text || start >= end);
1631 else if (m_digit_100 && m_digit_100->match(text,
this->
interval.
end, end,
flags)) {
dig[0] = 100;
end2 = m_digit_100->interval.end; }
1632 else if (m_digit_500 && m_digit_500->match(text,
this->
interval.
end, end,
flags)) {
dig[0] = 500;
end2 = m_digit_500->interval.end; }
1633 else if (m_digit_1000 && m_digit_1000->match(text,
this->
interval.
end, end,
flags)) {
dig[0] = 1000;
end2 = m_digit_1000->interval.end; }
1634 else if (m_digit_5000 && m_digit_5000->match(text,
this->
interval.
end, end,
flags)) {
dig[0] = 5000;
end2 = m_digit_5000->interval.end; }
1635 else if (m_digit_10000 && m_digit_10000->match(text,
this->
interval.
end, end,
flags)) {
dig[0] = 10000;
end2 = m_digit_10000->interval.end; }
1647 this->
value += dig[0];
1650 (
dig[1] == 1 && (
dig[0] == 5 ||
dig[0] == 10)) ||
1651 (
dig[1] == 10 && (
dig[0] == 50 ||
dig[0] == 100)) ||
1652 (
dig[1] == 100 && (
dig[0] == 500 ||
dig[0] == 1000)) ||
1653 (
dig[1] == 1000 && (
dig[0] == 5000 ||
dig[0] == 10000)))
1660 this->
value -= dig[1];
1664 this->
value += dig[0];
1672 this->interval.
start = start;
1679 std::shared_ptr<basic_parser<T>>
1711 _In_ const std::locale&
locale = std::locale()) :
1718 virtual void invalidate()
1720 numerator->invalidate();
1721 fraction_line->invalidate();
1722 denominator->invalidate();
1726 std::shared_ptr<basic_parser<T>> numerator;
1727 std::shared_ptr<basic_parser<T>> fraction_line;
1728 std::shared_ptr<basic_parser<T>> denominator;
1731 virtual bool do_match(
1732 _In_reads_or_z_opt_(end)
const T* text,
1733 _In_ size_t start = 0,
1737 _Assume_(text || start >= end);
1738 if (numerator->match(text, start, end,
flags) &&
1739 fraction_line->match(text, numerator->interval.end, end,
flags) &&
1740 denominator->match(text, fraction_line->interval.end, end,
flags))
1742 this->interval.
start = start;
1743 this->interval.
end = denominator->interval.end;
1746 numerator->invalidate();
1747 fraction_line->invalidate();
1748 denominator->invalidate();
1775 _In_ const std::locale&
locale = std::locale()) :
1783 virtual void invalidate()
1786 separator->invalidate();
1787 guest->invalidate();
1791 std::shared_ptr<basic_parser<T>> home;
1792 std::shared_ptr<basic_parser<T>> separator;
1793 std::shared_ptr<basic_parser<T>> guest;
1796 virtual bool do_match(
1797 _In_reads_or_z_opt_(end)
const T* text,
1798 _In_ size_t start = 0,
1802 _Assume_(text || start >= end);
1803 this->interval.
end = start;
1808 this->interval.
end = home->interval.end;
1812 for (; m_space->match(text, this->interval.
end, end,
space_match_flags); this->interval.
end = m_space->interval.end);
1815 this->interval.
end = separator->interval.end;
1819 for (; m_space->match(text, this->interval.
end, end,
space_match_flags); this->interval.
end = m_space->interval.end);
1822 this->interval.
end = guest->interval.end;
1826 this->interval.
start = start;
1831 separator->invalidate();
1832 guest->invalidate();
1837 std::shared_ptr<basic_parser<T>> m_space;
1861 _In_ const std::locale&
locale = std::locale()) :
1869 virtual void invalidate()
1884 virtual bool do_match(
1885 _In_reads_or_z_opt_(end)
const T* text,
1886 _In_ size_t start = 0,
1890 _Assume_(text || start >= end);
1891 this->interval.
end = start;
1913 this->interval.
start = start;
1914 this->interval.
end =
number->interval.end;
1926 using signed_numeral = basic_signed_numeral<char>;
1927 using wsigned_numeral = basic_signed_numeral<wchar_t>;
1929 using tsigned_numeral = wsigned_numeral;
1931 using tsigned_numeral = signed_numeral;
1933 using sgml_signed_numeral = basic_signed_numeral<char>;
1949 _In_ const std::locale&
locale = std::locale()) :
1959 virtual void invalidate()
1976 virtual bool do_match(
1977 _In_reads_or_z_opt_(end)
const T* text,
1978 _In_ size_t start = 0,
1982 _Assume_(text || start >= end);
1983 this->interval.
end = start;
2011 for (this->interval.
end = m_space->interval.end; m_space->match(text, this->interval.
end, end,
space_match_flags); this->interval.
end = m_space->interval.end);
2013 this->interval.
start = start;
2018 this->interval.
start = start;
2026 this->interval.
start = start;
2034 this->interval.
start = start;
2048 std::shared_ptr<basic_parser<T>> m_space;
2051 using mixed_numeral = basic_mixed_numeral<char>;
2052 using wmixed_numeral = basic_mixed_numeral<wchar_t>;
2054 using tmixed_numeral = wmixed_numeral;
2056 using tmixed_numeral = mixed_numeral;
2058 using sgml_mixed_numeral = basic_mixed_numeral<char>;
2078 _In_ const std::locale&
locale = std::locale()) :
2090 value(std::numeric_limits<double>::quiet_NaN())
2093 virtual void invalidate()
2105 value = std::numeric_limits<double>::quiet_NaN();
2122 virtual bool do_match(
2123 _In_reads_or_z_opt_(end)
const T* text,
2124 _In_ size_t start = 0,
2128 _Assume_(text || start >= end);
2129 this->interval.
end = start;
2163 if (
integer->interval.empty() &&
2215 this->interval.
start = start;
2220 using scientific_numeral = basic_scientific_numeral<char>;
2221 using wscientific_numeral = basic_scientific_numeral<wchar_t>;
2223 using tscientific_numeral = wscientific_numeral;
2225 using tscientific_numeral = scientific_numeral;
2227 using sgml_scientific_numeral = basic_scientific_numeral<char>;
2244 _In_ const std::locale&
locale = std::locale()) :
2255 virtual void invalidate()
2276 virtual bool do_match(
2277 _In_reads_or_z_opt_(end)
const T* text,
2278 _In_ size_t start = 0,
2282 _Assume_(text || start >= end);
2283 this->interval.
end = start;
2329 if (
integer->interval.empty() &&
2344 this->interval.
start = start;
2349 using monetary_numeral = basic_monetary_numeral<char>;
2350 using wmonetary_numeral = basic_monetary_numeral<wchar_t>;
2352 using tmonetary_numeral = wmonetary_numeral;
2354 using tmonetary_numeral = monetary_numeral;
2356 using sgml_monetary_numeral = basic_monetary_numeral<char>;
2377 _In_ const std::locale&
locale = std::locale()) :
2389 m_separator(separator)
2394 virtual void invalidate()
2412 virtual bool do_match(
2413 _In_reads_or_z_opt_(end)
const T* text,
2414 _In_ size_t start = 0,
2418 _Assume_(text || start >= end);
2419 this->interval.
end = start;
2423 for (i = 0; i < 4; i++) {
2426 this->interval.
end = m_separator->interval.end;
2434 for (
x = 0; this->interval.
end < end && text[this->interval.
end];) {
2437 else if (m_digit_1->match(text, this->interval.end, end, flags)) { dig = 1; digit_end = m_digit_1->interval.end; }
2438 else if (m_digit_2->match(text, this->interval.end, end, flags)) { dig = 2; digit_end = m_digit_2->interval.end; }
2439 else if (m_digit_3->match(text, this->interval.end, end, flags)) { dig = 3; digit_end = m_digit_3->interval.end; }
2440 else if (m_digit_4->match(text, this->interval.end, end, flags)) { dig = 4; digit_end = m_digit_4->interval.end; }
2441 else if (m_digit_5->match(text, this->interval.end, end, flags)) { dig = 5; digit_end = m_digit_5->interval.end; }
2442 else if (m_digit_6->match(text, this->interval.end, end, flags)) { dig = 6; digit_end = m_digit_6->interval.end; }
2443 else if (m_digit_7->match(text, this->interval.end, end, flags)) { dig = 7; digit_end = m_digit_7->interval.end; }
2444 else if (m_digit_8->match(text, this->interval.end, end, flags)) { dig = 8; digit_end = m_digit_8->interval.end; }
2445 else if (m_digit_9->match(text, this->interval.end, end, flags)) { dig = 9; digit_end = m_digit_9->interval.end; }
2447 size_t x_n = x * 10 + dig;
2450 this->interval.
end = digit_end;
2459 value.s_addr = (
value.s_addr << 8) | (uint8_t)x;
2464 HE2BE(
reinterpret_cast<uint32_t&
>(
value.s_addr));
2465 this->interval.
start = start;
2473 std::shared_ptr<basic_parser<T>>
2484 std::shared_ptr<basic_parser<T>> m_separator;
2487 using ipv4_address = basic_ipv4_address<char>;
2488 using wipv4_address = basic_ipv4_address<wchar_t>;
2490 using tipv4_address = wipv4_address;
2492 using tipv4_address = ipv4_address;
2494 using sgml_ipv4_address = basic_ipv4_address<char>;
2506 virtual bool do_match(
2507 _In_reads_or_z_opt_(end)
const T* text,
2508 _In_ size_t start = 0,
2512 _Assume_(text || start >= end);
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]))
2519 this->interval.
end = (this->interval.
start = start) + 1;
2545 virtual bool do_match(
2546 _In_reads_or_z_(end)
const char* text,
2547 _In_ size_t start = 0,
2551 _Assume_(text || start >= end);
2552 if (start < end && text[start]) {
2556 if (((
chr[0] ==
L'-' ||
2558 chr[0] ==
L':') &&
chr[1] == 0) ||
2561 this->interval.
start = start;
2597 _In_ const std::locale&
locale = std::locale()) :
2615 m_separator(separator),
2622 virtual void invalidate()
2650 virtual bool do_match(
2651 _In_reads_or_z_opt_(end)
const T* text,
2652 _In_ size_t start = 0,
2656 _Assume_(text || start >= end);
2657 this->interval.
end = start;
2661 for (i = 0; i < 8; i++) {
2666 this->interval.
end = m_separator->interval.end;
2673 this->interval.
end = m_separator->interval.end;
2692 for (
x = 0; this->interval.
end < end && text[this->interval.
end];) {
2712 if (
x_n <= 0xffff) {
2728 HE2BE(
reinterpret_cast<uint16_t&
>(this->value.s6_words[i]));
2735 this->value.s6_words[--
j] = this->value.s6_words[--
k];
2739 this->value.s6_words[--
j] = 0;
2747 if (m_scope_id_separator && m_scope_id_separator->match(text,
this->
interval.
end, end,
flags) &&
2753 this->interval.
start = start;
2761 std::shared_ptr<basic_parser<T>>
2778 std::shared_ptr<basic_parser<T>> m_separator, m_scope_id_separator;
2781 using ipv6_address = basic_ipv6_address<char>;
2782 using wipv6_address = basic_ipv6_address<wchar_t>;
2784 using tipv6_address = wipv6_address;
2786 using tipv6_address = ipv6_address;
2788 using sgml_ipv6_address = basic_ipv6_address<char>;
2799 _In_ const std::locale&
locale = std::locale()) :
2808 virtual bool do_match(
2809 _In_reads_or_z_opt_(end)
const T* text,
2810 _In_ size_t start = 0,
2814 _Assume_(text || start >= end);
2815 if (start < end && text[start]) {
2816 if ((
'A' <= text[start] && text[start] <=
'Z') ||
2817 (
'a' <= text[start] && text[start] <=
'z') ||
2818 (
'0' <= text[start] && text[start] <=
'9'))
2820 else if (text[start] ==
'-')
2822 else if (m_allow_idn && std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::alnum, text[start]))
2828 this->interval.
end = (this->interval.
start = start) + 1;
2838 using dns_domain_char = basic_dns_domain_char<char>;
2839 using wdns_domain_char = basic_dns_domain_char<wchar_t>;
2841 using tdns_domain_char = wdns_domain_char;
2843 using tdns_domain_char = dns_domain_char;
2854 _In_ const std::locale&
locale = std::locale()) :
2859 virtual bool do_match(
2860 _In_reads_or_z_(end)
const char* text,
2861 _In_ size_t start = 0,
2865 _Assume_(text || start >= end);
2866 if (start < end && text[start]) {
2870 if (((
'A' <=
chr[0] &&
chr[0] <=
'Z') ||
2871 (
'a' <=
chr[0] &&
chr[0] <=
'z') ||
2872 (
'0' <=
chr[0] &&
chr[0] <=
'9')) &&
chr[1] == 0)
2874 else if (
chr[0] ==
'-' &&
chr[1] == 0)
2876 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)
2882 this->interval.
start = start;
2901 _In_ const std::locale&
locale = std::locale()) :
2905 m_separator(separator)
2909 virtual bool do_match(
2910 _In_reads_or_z_opt_(end)
const T* text,
2911 _In_ size_t start = 0,
2915 _Assume_(text || start >= end);
2916 size_t i = start,
count;
2918 if (m_domain_char->match(text, i, end,
flags) &&
2919 m_domain_char->allow_on_edge)
2922 this->interval.
end = i = m_domain_char->interval.end;
2923 while (i < end && text[i]) {
2924 if (m_domain_char->allow_on_edge &&
2925 m_separator->match(text, i, end,
flags))
2929 this->interval.
end = i = m_separator->interval.end;
2931 this->interval.
end = i;
2932 i = m_separator->interval.end;
2936 if (m_domain_char->match(text, i, end,
flags)) {
2937 if (m_domain_char->allow_on_edge)
2938 this->interval.
end = i = m_domain_char->interval.end;
2940 i = m_domain_char->interval.end;
2943 this->interval.
start = start;
2952 this->interval.
start = start;
2960 std::shared_ptr<basic_dns_domain_char<T>> m_domain_char;
2961 std::shared_ptr<basic_parser<T>> m_separator;
2983 virtual bool do_match(
2984 _In_reads_or_z_opt_(end)
const T* text,
2985 _In_ size_t start = 0,
2989 _Assume_(text || start >= end);
2990 if (start < end && text[start]) {
2991 if (text[start] ==
'-' ||
2992 text[start] ==
'.' ||
2993 text[start] ==
'_' ||
2994 text[start] ==
'~' ||
2995 text[start] ==
'%' ||
2996 text[start] ==
'!' ||
2997 text[start] ==
'$' ||
2998 text[start] ==
'&' ||
2999 text[start] ==
'\'' ||
3002 text[start] ==
'*' ||
3003 text[start] ==
'+' ||
3004 text[start] ==
',' ||
3005 text[start] ==
';' ||
3006 text[start] ==
'=' ||
3007 std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::alnum, text[start]))
3009 this->interval.
end = (this->interval.
start = start) + 1;
3035 virtual bool do_match(
3036 _In_reads_or_z_(end)
const char* text,
3037 _In_ size_t start = 0,
3041 _Assume_(text || start >= end);
3042 if (start < end && text[start]) {
3046 if (((
chr[0] ==
L'-' ||
3061 chr[0] ==
L'=') &&
chr[1] == 0) ||
3064 this->interval.
start = start;
3084 virtual bool do_match(
3085 _In_reads_or_z_opt_(end)
const T* text,
3086 _In_ size_t start = 0,
3090 _Assume_(text || start >= end);
3091 if (start < end && text[start]) {
3092 if (text[start] ==
'-' ||
3093 text[start] ==
'.' ||
3094 text[start] ==
'_' ||
3095 text[start] ==
'~' ||
3096 text[start] ==
'%' ||
3097 text[start] ==
'!' ||
3098 text[start] ==
'$' ||
3099 text[start] ==
'&' ||
3100 text[start] ==
'\'' ||
3101 text[start] ==
'(' ||
3102 text[start] ==
')' ||
3103 text[start] ==
'*' ||
3104 text[start] ==
'+' ||
3105 text[start] ==
',' ||
3106 text[start] ==
';' ||
3107 text[start] ==
'=' ||
3108 text[start] ==
':' ||
3109 std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::alnum, text[start]))
3111 this->interval.
end = (this->interval.
start = start) + 1;
3137 virtual bool do_match(
3138 _In_reads_or_z_(end)
const char* text,
3139 _In_ size_t start = 0,
3143 _Assume_(text || start >= end);
3144 if (start < end && text[start]) {
3148 if (((
chr[0] ==
L'-' ||
3164 chr[0] ==
L':') &&
chr[1] == 0) ||
3167 this->interval.
start = start;
3186 virtual bool do_match(
3187 _In_reads_or_z_opt_(end)
const T* text,
3188 _In_ size_t start = 0,
3192 _Assume_(text || start >= end);
3193 if (start < end && text[start]) {
3194 if (text[start] ==
'/' ||
3195 text[start] ==
'-' ||
3196 text[start] ==
'.' ||
3197 text[start] ==
'_' ||
3198 text[start] ==
'~' ||
3199 text[start] ==
'%' ||
3200 text[start] ==
'!' ||
3201 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 std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::alnum, text[start]))
3217 this->interval.
end = (this->interval.
start = start) + 1;
3243 virtual bool do_match(
3244 _In_reads_or_z_(end)
const char* text,
3245 _In_ size_t start = 0,
3249 _Assume_(text || start >= end);
3250 if (start < end && text[start]) {
3254 if (((
chr[0] ==
L'/' ||
3274 chr[0] ==
L'#') &&
chr[1] == 0) ||
3277 this->interval.
start = start;
3297 _In_ const std::locale&
locale = std::locale()) :
3304 virtual void invalidate()
3320 virtual bool do_match(
3321 _In_reads_or_z_opt_(end)
const T* text,
3322 _In_ size_t start = 0,
3326 _Assume_(text || start >= end);
3328 this->interval.
end = start;
3339 path.
end = this->interval.
end;
3340 query.
start = this->interval.
end = m_query_start->interval.end;
3343 query.
end = this->interval.
end;
3347 query.
end = this->interval.
end;
3348 bookmark.
start = this->interval.
end = m_bookmark_start->interval.end;
3351 bookmark.
end = this->interval.
end;
3355 this->interval.
end = m_path_char->interval.end;
3357 bookmark.
end = this->interval.
end;
3361 this->interval.
start = start;
3365 this->interval.
end = m_path_char->interval.end;
3367 query.
end = this->interval.
end;
3371 this->interval.
start = start;
3375 path.
end = this->interval.
end;
3376 bookmark.
start = this->interval.
end = m_bookmark_start->interval.end;
3379 bookmark.
end = this->interval.
end;
3383 this->interval.
end = m_path_char->interval.end;
3385 bookmark.
end = this->interval.
end;
3389 this->interval.
start = start;
3393 this->interval.
end = m_path_char->interval.end;
3399 path.
end = this->interval.
end;
3400 this->interval.
start = start;
3412 std::shared_ptr<basic_parser<T>> m_path_char;
3413 std::shared_ptr<basic_parser<T>> m_query_start;
3414 std::shared_ptr<basic_parser<T>> m_bookmark_start;
3450 _In_ const std::locale&
locale = std::locale()) :
3470 virtual void invalidate()
3472 http_scheme->invalidate();
3473 ftp_scheme->invalidate();
3474 mailto_scheme->invalidate();
3475 file_scheme->invalidate();
3476 username->invalidate();
3477 password->invalidate();
3478 ipv4_host->invalidate();
3479 ipv6_host->invalidate();
3480 dns_host->invalidate();
3486 std::shared_ptr<basic_parser<T>> http_scheme;
3487 std::shared_ptr<basic_parser<T>> ftp_scheme;
3488 std::shared_ptr<basic_parser<T>> mailto_scheme;
3489 std::shared_ptr<basic_parser<T>> file_scheme;
3490 std::shared_ptr<basic_parser<T>> username;
3491 std::shared_ptr<basic_parser<T>> password;
3492 std::shared_ptr<basic_parser<T>> ipv4_host;
3493 std::shared_ptr<basic_parser<T>> ipv6_host;
3494 std::shared_ptr<basic_parser<T>> dns_host;
3495 std::shared_ptr<basic_parser<T>> port;
3496 std::shared_ptr<basic_parser<T>> path;
3499 virtual bool do_match(
3500 _In_reads_or_z_opt_(end)
const T* text,
3501 _In_ size_t start = 0,
3505 _Assume_(text || start >= end);
3507 this->interval.
end = start;
3510 m_colon->match(text, http_scheme->interval.end, end,
flags) &&
3511 m_slash->match(text, m_colon->interval.end, end,
flags) &&
3512 m_slash->match(text, m_slash->interval.end, end,
flags))
3515 this->interval.
end = m_slash->interval.end;
3516 ftp_scheme->invalidate();
3517 mailto_scheme->invalidate();
3518 file_scheme->invalidate();
3521 m_colon->match(text, ftp_scheme->interval.end, end,
flags) &&
3522 m_slash->match(text, m_colon->interval.end, end,
flags) &&
3523 m_slash->match(text, m_slash->interval.end, end,
flags))
3526 this->interval.
end = m_slash->interval.end;
3527 http_scheme->invalidate();
3528 mailto_scheme->invalidate();
3529 file_scheme->invalidate();
3532 m_colon->match(text, mailto_scheme->interval.end, end,
flags))
3535 this->interval.
end = m_colon->interval.end;
3536 http_scheme->invalidate();
3537 ftp_scheme->invalidate();
3538 file_scheme->invalidate();
3541 m_colon->match(text, file_scheme->interval.end, end,
flags) &&
3542 m_slash->match(text, m_colon->interval.end, end,
flags) &&
3543 m_slash->match(text, m_slash->interval.end, end,
flags))
3546 this->interval.
end = m_slash->interval.end;
3547 http_scheme->invalidate();
3548 ftp_scheme->invalidate();
3549 mailto_scheme->invalidate();
3553 http_scheme->invalidate();
3554 ftp_scheme->invalidate();
3555 mailto_scheme->invalidate();
3556 file_scheme->invalidate();
3559 if (ftp_scheme->interval) {
3561 if (m_colon->match(text, username->interval.end, end,
flags) &&
3562 password->match(text, m_colon->interval.end, end,
flags) &&
3563 m_at->match(text, password->interval.end, end,
flags))
3566 this->interval.
end = m_at->interval.end;
3570 this->interval.
end = m_at->interval.end;
3571 password->invalidate();
3574 username->invalidate();
3575 password->invalidate();
3579 username->invalidate();
3580 password->invalidate();
3585 this->interval.
end = ipv4_host->interval.end;
3586 ipv6_host->invalidate();
3587 dns_host->invalidate();
3591 ipv6_host->match(text, m_ip_lbracket->interval.end, end,
flags) &&
3592 m_ip_rbracket->match(text, ipv6_host->interval.end, end,
flags))
3595 this->interval.
end = m_ip_rbracket->interval.end;
3596 ipv4_host->invalidate();
3597 dns_host->invalidate();
3601 this->interval.
end = dns_host->interval.end;
3602 ipv4_host->invalidate();
3603 ipv6_host->invalidate();
3611 port->match(text, m_colon->interval.end, end,
flags))
3614 this->interval.
end = port->interval.end;
3621 this->interval.
end = path->interval.end;
3624 this->interval.
start = start;
3628 if (mailto_scheme->interval) {
3630 m_at->match(text, username->interval.end, end,
flags))
3633 this->interval.
end = m_at->interval.end;
3641 ipv4_host->match(text, m_ip_lbracket->interval.end, end,
flags) &&
3642 m_ip_rbracket->match(text, ipv4_host->interval.end, end,
flags))
3645 this->interval.
end = m_ip_rbracket->interval.end;
3646 ipv6_host->invalidate();
3647 dns_host->invalidate();
3651 ipv6_host->match(text, m_ip_lbracket->interval.end, end,
flags) &&
3652 m_ip_rbracket->match(text, ipv6_host->interval.end, end,
flags))
3655 this->interval.
end = m_ip_rbracket->interval.end;
3656 ipv4_host->invalidate();
3657 dns_host->invalidate();
3661 this->interval.
end = dns_host->interval.end;
3662 ipv4_host->invalidate();
3663 ipv6_host->invalidate();
3670 password->invalidate();
3673 this->interval.
start = start;
3677 if (file_scheme->interval) {
3680 this->interval.
end = path->interval.end;
3683 username->invalidate();
3684 password->invalidate();
3685 ipv4_host->invalidate();
3686 ipv6_host->invalidate();
3687 dns_host->invalidate();
3689 this->interval.
start = start;
3696 if (http_scheme->interval &&
3699 if (m_colon->match(text, username->interval.end, end,
flags) &&
3700 password->match(text, m_colon->interval.end, end,
flags) &&
3701 m_at->match(text, password->interval.end, end,
flags))
3704 this->interval.
end = m_at->interval.end;
3706 else if (m_at->match(text, username->interval.end, end,
flags)) {
3708 this->interval.
end = m_at->interval.end;
3709 password->invalidate();
3712 username->invalidate();
3713 password->invalidate();
3717 username->invalidate();
3718 password->invalidate();
3723 this->interval.
end = ipv4_host->interval.end;
3724 ipv6_host->invalidate();
3725 dns_host->invalidate();
3729 ipv6_host->match(text, m_ip_lbracket->interval.end, end,
flags) &&
3730 m_ip_rbracket->match(text, ipv6_host->interval.end, end,
flags))
3733 this->interval.
end = m_ip_rbracket->interval.end;
3734 ipv4_host->invalidate();
3735 dns_host->invalidate();
3739 this->interval.
end = dns_host->interval.end;
3740 ipv4_host->invalidate();
3741 ipv6_host->invalidate();
3749 port->match(text, m_colon->interval.end, end,
flags))
3752 this->interval.
end = port->interval.end;
3759 this->interval.
end = path->interval.end;
3762 this->interval.
start = start;
3766 std::shared_ptr<basic_parser<T>> m_colon;
3767 std::shared_ptr<basic_parser<T>> m_slash;
3768 std::shared_ptr<basic_parser<T>> m_at;
3769 std::shared_ptr<basic_parser<T>> m_ip_lbracket;
3770 std::shared_ptr<basic_parser<T>> m_ip_rbracket;
3797 _In_ const std::locale&
locale = std::locale()) :
3808 virtual void invalidate()
3810 username->invalidate();
3811 ipv4_host->invalidate();
3812 ipv6_host->invalidate();
3813 dns_host->invalidate();
3817 std::shared_ptr<basic_parser<T>> username;
3818 std::shared_ptr<basic_parser<T>> ipv4_host;
3819 std::shared_ptr<basic_parser<T>> ipv6_host;
3820 std::shared_ptr<basic_parser<T>> dns_host;
3823 virtual bool do_match(
3824 _In_reads_or_z_opt_(end)
const T* text,
3825 _In_ size_t start = 0,
3829 _Assume_(text || start >= end);
3831 if (username->match(text, start, end,
flags) &&
3832 m_at->match(text, username->interval.end, end,
flags))
3835 if (m_ip_lbracket->match(text, m_at->interval.end, end,
flags) &&
3836 ipv4_host->match(text, m_ip_lbracket->interval.end, end,
flags) &&
3837 m_ip_rbracket->match(text, ipv4_host->interval.end, end,
flags))
3840 this->interval.
end = m_ip_rbracket->interval.end;
3841 ipv6_host->invalidate();
3842 dns_host->invalidate();
3845 m_ip_lbracket->match(text, m_at->interval.end, end,
flags) &&
3846 ipv6_host->match(text, m_ip_lbracket->interval.end, end,
flags) &&
3847 m_ip_rbracket->match(text, ipv6_host->interval.end, end,
flags))
3850 this->interval.
end = m_ip_rbracket->interval.end;
3851 ipv4_host->invalidate();
3852 dns_host->invalidate();
3854 else if (dns_host->match(text, m_at->interval.end, end,
flags)) {
3856 this->interval.
end = dns_host->interval.end;
3857 ipv4_host->invalidate();
3858 ipv6_host->invalidate();
3862 this->interval.
start = start;
3871 std::shared_ptr<basic_parser<T>> m_at;
3872 std::shared_ptr<basic_parser<T>> m_ip_lbracket;
3873 std::shared_ptr<basic_parser<T>> m_ip_rbracket;
3898 _In_ const std::locale&
locale = std::locale()) :
3907 virtual void invalidate()
3913 mouth->invalidate();
3918 std::shared_ptr<basic_parser<T>>
apex;
3919 std::shared_ptr<basic_parser<T>>
eyes;
3920 std::shared_ptr<basic_parser<T>>
nose;
3924 virtual bool do_match(
3925 _In_reads_or_z_opt_(end)
const T* text,
3926 _In_ size_t start = 0,
3930 _Assume_(text || start >= end);
3936 mouth->invalidate();
3937 this->interval.
start = start;
3942 this->interval.
end = start;
3945 this->interval.
end =
apex->interval.end;
3953 hit_offset =
mouth->hit_offset;
3955 for (this->interval.
end =
mouth->interval.end;
mouth->match(text, this->interval.
end, end,
flags) &&
mouth->hit_offset == hit_offset; this->interval.
end =
mouth->interval.end);
3958 this->interval.
start = start;
3964 hit_offset =
mouth->hit_offset;
3966 for (this->interval.
end =
mouth->interval.end;
mouth->match(text, this->interval.
end, end,
flags) &&
mouth->hit_offset == hit_offset; this->interval.
end =
mouth->interval.end);
3970 this->interval.
start = start;
3979 mouth->invalidate();
3985 using emoticon = basic_emoticon<char>;
3986 using wemoticon = basic_emoticon<wchar_t>;
3988 using temoticon = wemoticon;
3990 using temoticon = emoticon;
3992 using sgml_emoticon = basic_emoticon<char>;
3997 enum date_format_t {
3998 date_format_none = 0,
3999 date_format_dmy = 0x1,
4000 date_format_mdy = 0x2,
4001 date_format_ymd = 0x4,
4002 date_format_ym = 0x8,
4003 date_format_my = 0x10,
4004 date_format_dm = 0x20,
4005 date_format_md = 0x40,
4022 _In_ const std::locale&
locale = std::locale()) :
4024 format(date_format_none),
4029 m_separator(separator),
4033 virtual void invalidate()
4035 if (day) day->invalidate();
4036 if (month) month->invalidate();
4037 if (year) year->invalidate();
4038 format = date_format_none;
4042 date_format_t format;
4043 std::shared_ptr<basic_integer<T>> day;
4044 std::shared_ptr<basic_integer<T>> month;
4045 std::shared_ptr<basic_integer<T>> year;
4048 virtual bool do_match(
4049 _In_reads_or_z_opt_(end)
const T* text,
4050 _In_ size_t start = 0,
4054 _Assume_(text || start >= end);
4057 if ((m_format_mask & date_format_dmy) == date_format_dmy) {
4058 if (day->match(text, start, end,
flags)) {
4059 for (this->interval.
end = day->interval.end; m_space->match(text, this->interval.
end, end,
space_match_flags); this->interval.
end = m_space->interval.end);
4061 size_t hit_offset = m_separator->hit_offset;
4062 for (this->interval.
end = m_separator->interval.end; m_space->match(text, this->interval.
end, end,
space_match_flags); this->interval.
end = m_space->interval.end);
4064 for (this->interval.
end = month->interval.end; m_space->match(text, this->interval.
end, end,
space_match_flags); this->interval.
end = m_space->interval.end);
4066 m_separator->hit_offset == hit_offset)
4068 for (this->interval.
end = m_separator->interval.end; m_space->match(text, this->interval.
end, end,
space_match_flags); this->interval.
end = m_space->interval.end);
4070 is_valid(day->value, month->value))
4072 this->interval.
start = start;
4073 this->interval.
end = year->interval.end;
4074 format = date_format_dmy;
4083 if ((m_format_mask & date_format_mdy) == date_format_mdy) {
4084 if (month->match(text, start, end,
flags)) {
4085 for (this->interval.
end = month->interval.end; m_space->match(text, this->interval.
end, end,
space_match_flags); this->interval.
end = m_space->interval.end);
4087 size_t hit_offset = m_separator->hit_offset;
4088 for (this->interval.
end = m_separator->interval.end; m_space->match(text, this->interval.
end, end,
space_match_flags); this->interval.
end = m_space->interval.end);
4090 for (this->interval.
end = day->interval.end; m_space->match(text, this->interval.
end, end,
space_match_flags); this->interval.
end = m_space->interval.end);
4092 m_separator->hit_offset == hit_offset)
4094 for (this->interval.
end = m_separator->interval.end; m_space->match(text, this->interval.
end, end,
space_match_flags); this->interval.
end = m_space->interval.end);
4096 is_valid(day->value, month->value))
4098 this->interval.
start = start;
4099 this->interval.
end = year->interval.end;
4100 format = date_format_mdy;
4109 if ((m_format_mask & date_format_ymd) == date_format_ymd) {
4110 if (year->match(text, start, end,
flags)) {
4111 for (this->interval.
end = year->interval.end; m_space->match(text, this->interval.
end, end,
space_match_flags); this->interval.
end = m_space->interval.end);
4113 size_t hit_offset = m_separator->hit_offset;
4114 for (this->interval.
end = m_separator->interval.end; m_space->match(text, this->interval.
end, end,
space_match_flags); this->interval.
end = m_space->interval.end);
4116 for (this->interval.
end = month->interval.end; m_space->match(text, this->interval.
end, end,
space_match_flags); this->interval.
end = m_space->interval.end);
4118 m_separator->hit_offset == hit_offset)
4120 for (this->interval.
end = m_separator->interval.end; m_space->match(text, this->interval.
end, end,
space_match_flags); this->interval.
end = m_space->interval.end);
4122 is_valid(day->value, month->value))
4124 this->interval.
start = start;
4125 this->interval.
end = day->interval.end;
4126 format = date_format_ymd;
4135 if ((m_format_mask & date_format_ym) == date_format_ym) {
4136 if (year->match(text, start, end,
flags)) {
4137 for (this->interval.
end = year->interval.end; m_space->match(text, this->interval.
end, end,
space_match_flags); this->interval.
end = m_space->interval.end);
4139 for (this->interval.
end = m_separator->interval.end; m_space->match(text, this->interval.
end, end,
space_match_flags); this->interval.
end = m_space->interval.end);
4143 if (day) day->invalidate();
4144 this->interval.
start = start;
4145 this->interval.
end = month->interval.end;
4146 format = date_format_ym;
4153 if ((m_format_mask & date_format_my) == date_format_my) {
4154 if (month->match(text, start, end,
flags)) {
4155 for (this->interval.
end = month->interval.end; m_space->match(text, this->interval.
end, end,
space_match_flags); this->interval.
end = m_space->interval.end);
4157 for (this->interval.
end = m_separator->interval.end; m_space->match(text, this->interval.
end, end,
space_match_flags); this->interval.
end = m_space->interval.end);
4161 if (day) day->invalidate();
4162 this->interval.
start = start;
4163 this->interval.
end = year->interval.end;
4164 format = date_format_my;
4171 if ((m_format_mask & date_format_dm) == date_format_dm) {
4172 if (day->match(text, start, end,
flags)) {
4173 for (this->interval.
end = day->interval.end; m_space->match(text, this->interval.
end, end,
space_match_flags); this->interval.
end = m_space->interval.end);
4175 size_t hit_offset = m_separator->hit_offset;
4176 for (this->interval.
end = m_separator->interval.end; m_space->match(text, this->interval.
end, end,
space_match_flags); this->interval.
end = m_space->interval.end);
4178 is_valid(day->value, month->value))
4180 if (year) year->invalidate();
4181 this->interval.
start = start;
4182 for (this->interval.
end = month->interval.end; m_space->match(text, this->interval.
end, end,
space_match_flags); this->interval.
end = m_space->interval.end);
4184 m_separator->hit_offset == hit_offset)
4185 this->interval.
end = m_separator->interval.end;
4187 this->interval.
end = month->interval.end;
4188 format = date_format_dm;
4195 if ((m_format_mask & date_format_md) == date_format_md) {
4196 if (month->match(text, start, end,
flags)) {
4197 for (this->interval.
end = month->interval.end; m_space->match(text, this->interval.
end, end,
space_match_flags); this->interval.
end = m_space->interval.end);
4199 size_t hit_offset = m_separator->hit_offset;
4200 for (this->interval.
end = m_separator->interval.end; m_space->match(text, this->interval.
end, end,
space_match_flags); this->interval.
end = m_space->interval.end);
4202 is_valid(day->value, month->value))
4204 if (year) year->invalidate();
4205 this->interval.
start = start;
4206 for (this->interval.
end = day->interval.end; m_space->match(text, this->interval.
end, end,
space_match_flags); this->interval.
end = m_space->interval.end);
4208 m_separator->hit_offset == hit_offset)
4209 this->interval.
end = m_separator->interval.end;
4211 this->interval.
end = day->interval.end;
4212 format = date_format_md;
4219 if (day) day->invalidate();
4220 if (month) month->invalidate();
4221 if (year) year->invalidate();
4222 format = date_format_none;
4227 static bool is_valid(
size_t day,
size_t month)
4246 return 1 <= day && day <= 31;
4248 return 1 <= day && day <= 29;
4253 return 1 <= day && day <= 30;
4260 std::shared_ptr<basic_set<T>> m_separator;
4261 std::shared_ptr<basic_parser<T>> m_space;
4287 _In_ const std::locale&
locale = std::locale()) :
4293 m_separator(separator),
4297 virtual void invalidate()
4300 minute->invalidate();
4301 if (second) second->invalidate();
4302 if (millisecond) millisecond->invalidate();
4306 std::shared_ptr<basic_integer10<T>> hour;
4307 std::shared_ptr<basic_integer10<T>> minute;
4308 std::shared_ptr<basic_integer10<T>> second;
4309 std::shared_ptr<basic_integer10<T>> millisecond;
4312 virtual bool do_match(
4313 _In_reads_or_z_opt_(end)
const T* text,
4314 _In_ size_t start = 0,
4318 _Assume_(text || start >= end);
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)
4338 this->interval.
end = millisecond->interval.end;
4341 if (millisecond) millisecond->invalidate();
4342 this->interval.
end = second->interval.end;
4346 if (second) second->invalidate();
4347 if (millisecond) millisecond->invalidate();
4348 this->interval.
end = minute->interval.end;
4350 this->interval.
start = start;
4355 minute->invalidate();
4356 if (second) second->invalidate();
4357 if (millisecond) millisecond->invalidate();
4362 std::shared_ptr<basic_set<T>> m_separator;
4363 std::shared_ptr<basic_parser<T>> m_millisecond_separator;
4390 _In_ const std::locale&
locale = std::locale()) :
4401 virtual void invalidate()
4403 degree->invalidate();
4404 degree_separator->invalidate();
4405 minute->invalidate();
4406 minute_separator->invalidate();
4407 if (second) second->invalidate();
4408 if (second_separator) second_separator->invalidate();
4409 if (decimal) decimal->invalidate();
4413 std::shared_ptr<basic_integer10<T>> degree;
4414 std::shared_ptr<basic_parser<T>> degree_separator;
4415 std::shared_ptr<basic_integer10<T>> minute;
4416 std::shared_ptr<basic_parser<T>> minute_separator;
4417 std::shared_ptr<basic_integer10<T>> second;
4418 std::shared_ptr<basic_parser<T>> second_separator;
4419 std::shared_ptr<basic_parser<T>> decimal;
4422 virtual bool do_match(
4423 _In_reads_or_z_opt_(end)
const T* text,
4424 _In_ size_t start = 0,
4428 _Assume_(text || start >= end);
4430 this->interval.
end = start;
4433 degree_separator->match(text, degree->interval.end, end,
flags))
4436 this->interval.
end = degree_separator->interval.end;
4439 degree->invalidate();
4440 degree_separator->invalidate();
4444 minute->value < 60 &&
4445 minute_separator->match(text, minute->interval.end, end,
flags))
4448 this->interval.
end = minute_separator->interval.end;
4451 minute->invalidate();
4452 minute_separator->invalidate();
4459 this->interval.
end = second->interval.end;
4461 this->interval.
end = second_separator->interval.end;
4463 if (second_separator) second_separator->invalidate();
4466 if (second) second->invalidate();
4467 if (second_separator) second_separator->invalidate();
4470 if (degree->interval.start < degree->interval.end ||
4471 minute->interval.start < minute->interval.end ||
4472 (second && second->interval.start < second->interval.end))
4476 this->interval.
end = decimal->interval.end;
4479 decimal->invalidate();
4480 this->interval.
start = start;
4483 if (decimal) decimal->invalidate();
4512 _In_ const std::locale&
locale = std::locale()) :
4518 m_separator(separator),
4522 virtual void invalidate()
4531 virtual bool do_match(
4532 _In_reads_or_z_opt_(end)
const T* text,
4533 _In_ size_t start = 0,
4537 _Assume_(text || start >= end);
4543 this->interval.
end = start;
4545 m_lparenthesis->invalidate();
4546 m_rparenthesis->invalidate();
4549 value.append(text + m_plus_sign->interval.start, text + m_plus_sign->interval.end);
4551 this->interval.
end = m_plus_sign->interval.end;
4555 _Assume_(text || this->interval.
end >= end);
4560 value.append(text + m_digit->interval.start, text + m_digit->interval.end);
4561 this->interval.
end = m_digit->interval.end;
4571 m_lparenthesis && !m_lparenthesis->interval &&
4572 m_rparenthesis && !m_rparenthesis->interval &&
4576 value.append(text + m_lparenthesis->interval.start, m_lparenthesis->interval.size());
4577 this->interval.
end = m_lparenthesis->interval.end;
4584 m_rparenthesis && !m_rparenthesis->interval &&
4586 m_lparenthesis->hit_offset == m_rparenthesis->hit_offset)
4589 value.append(text + m_rparenthesis->interval.start, text + m_rparenthesis->interval.end);
4590 this->interval.
end = m_rparenthesis->interval.end;
4604 this->interval.
end = m_separator->interval.end;
4613 this->interval.
end = m_space->interval.end;
4622 this->interval.
start = start;
4631 std::shared_ptr<basic_parser<T>> m_digit;
4632 std::shared_ptr<basic_parser<T>> m_plus_sign;
4633 std::shared_ptr<basic_set<T>> m_lparenthesis;
4634 std::shared_ptr<basic_set<T>> m_rparenthesis;
4635 std::shared_ptr<basic_parser<T>> m_separator;
4636 std::shared_ptr<basic_parser<T>> m_space;
4639 using phone_number = basic_phone_number<char>;
4640 using wphone_number = basic_phone_number<wchar_t>;
4642 using tphone_number = wphone_number;
4644 using tphone_number = phone_number;
4646 using sgml_phone_number = basic_phone_number<char>;
4659 _In_ const std::locale&
locale = std::locale()) :
4669 virtual void invalidate()
4684 virtual bool do_match(
4685 _In_reads_or_z_opt_(end)
const T* text,
4686 _In_ size_t start = 0,
4690 _Assume_(text || start >= end);
4691 const auto&
ctype = std::use_facet<std::ctype<T>>(this->m_locale);
4699 { {
'A',
'D' }, {}, 24 },
4700 { {
'A',
'E' }, {}, 23 },
4701 { {
'A',
'L' }, {}, 28 },
4702 { {
'A',
'O' }, {}, 25 },
4703 { {
'A',
'T' }, {}, 20 },
4704 { {
'A',
'Z' }, {}, 28 },
4705 { {
'B',
'A' }, {
'3',
'9' }, 20},
4706 { {
'B',
'E' }, {}, 16 },
4707 { {
'B',
'F' }, {}, 28 },
4708 { {
'B',
'G' }, {}, 22 },
4709 { {
'B',
'H' }, {}, 22 },
4710 { {
'B',
'I' }, {}, 27 },
4711 { {
'B',
'J' }, {}, 28 },
4712 { {
'B',
'R' }, {}, 29 },
4713 { {
'B',
'Y' }, {}, 28 },
4714 { {
'C',
'F' }, {}, 27 },
4715 { {
'C',
'G' }, {}, 27 },
4716 { {
'C',
'H' }, {}, 21 },
4717 { {
'C',
'I' }, {}, 28 },
4718 { {
'C',
'M' }, {}, 27 },
4719 { {
'C',
'R' }, {}, 22 },
4720 { {
'C',
'V' }, {}, 25 },
4721 { {
'C',
'Y' }, {}, 28 },
4722 { {
'C',
'Z' }, {}, 24 },
4723 { {
'D',
'E' }, {}, 22 },
4724 { {
'D',
'J' }, {}, 27 },
4725 { {
'D',
'K' }, {}, 18 },
4726 { {
'D',
'O' }, {}, 28 },
4727 { {
'D',
'Z' }, {}, 26 },
4728 { {
'E',
'E' }, {}, 20 },
4729 { {
'E',
'G' }, {}, 29 },
4730 { {
'E',
'S' }, {}, 24 },
4731 { {
'F',
'I' }, {}, 18 },
4732 { {
'F',
'O' }, {}, 18 },
4733 { {
'F',
'R' }, {}, 27 },
4734 { {
'G',
'A' }, {}, 27 },
4735 { {
'G',
'B' }, {}, 22 },
4736 { {
'G',
'E' }, {}, 22 },
4737 { {
'G',
'I' }, {}, 23 },
4738 { {
'G',
'L' }, {}, 18 },
4739 { {
'G',
'Q' }, {}, 27 },
4740 { {
'G',
'R' }, {}, 27 },
4741 { {
'G',
'T' }, {}, 28 },
4742 { {
'G',
'W' }, {}, 25 },
4743 { {
'H',
'N' }, {}, 28 },
4744 { {
'H',
'R' }, {}, 21 },
4745 { {
'H',
'U' }, {}, 28 },
4746 { {
'I',
'E' }, {}, 22 },
4747 { {
'I',
'L' }, {}, 23 },
4748 { {
'I',
'Q' }, {}, 23 },
4749 { {
'I',
'R' }, {}, 26 },
4750 { {
'I',
'S' }, {}, 26 },
4751 { {
'I',
'T' }, {}, 27 },
4752 { {
'J',
'O' }, {}, 30 },
4753 { {
'K',
'M' }, {}, 27 },
4754 { {
'K',
'W' }, {}, 30 },
4755 { {
'K',
'Z' }, {}, 20 },
4756 { {
'L',
'B' }, {}, 28 },
4757 { {
'L',
'C' }, {}, 32 },
4758 { {
'L',
'I' }, {}, 21 },
4759 { {
'L',
'T' }, {}, 20 },
4760 { {
'L',
'U' }, {}, 20 },
4761 { {
'L',
'V' }, {}, 21 },
4762 { {
'L',
'Y' }, {}, 25 },
4763 { {
'M',
'A' }, {}, 28 },
4764 { {
'M',
'C' }, {}, 27 },
4765 { {
'M',
'D' }, {}, 24 },
4766 { {
'M',
'E' }, {
'2',
'5' }, 22 },
4767 { {
'M',
'G' }, {}, 27 },
4768 { {
'M',
'K' }, {
'0',
'7' }, 19 },
4769 { {
'M',
'L' }, {}, 28 },
4770 { {
'M',
'R' }, {
'1',
'3' }, 27},
4771 { {
'M',
'T' }, {}, 31 },
4772 { {
'M',
'U' }, {}, 30 },
4773 { {
'M',
'Z' }, {}, 25 },
4774 { {
'N',
'E' }, {}, 28 },
4775 { {
'N',
'I' }, {}, 32 },
4776 { {
'N',
'L' }, {}, 18 },
4777 { {
'N',
'O' }, {}, 15 },
4778 { {
'P',
'K' }, {}, 24 },
4779 { {
'P',
'L' }, {}, 28 },
4780 { {
'P',
'S' }, {}, 29 },
4781 { {
'P',
'T' }, {
'5',
'0' }, 25 },
4782 { {
'Q',
'A' }, {}, 29 },
4783 { {
'R',
'O' }, {}, 24 },
4784 { {
'R',
'S' }, {
'3',
'5' }, 22 },
4785 { {
'R',
'U' }, {}, 33 },
4786 { {
'S',
'A' }, {}, 24 },
4787 { {
'S',
'C' }, {}, 31 },
4788 { {
'S',
'D' }, {}, 18 },
4789 { {
'S',
'E' }, {}, 24 },
4790 { {
'S',
'I' }, {
'5',
'6' }, 19 },
4791 { {
'S',
'K' }, {}, 24 },
4792 { {
'S',
'M' }, {}, 27 },
4793 { {
'S',
'N' }, {}, 28 },
4794 { {
'S',
'T' }, {}, 25 },
4795 { {
'S',
'V' }, {}, 28 },
4796 { {
'T',
'D' }, {}, 27 },
4797 { {
'T',
'G' }, {}, 28 },
4798 { {
'T',
'L' }, {
'3',
'8' }, 23},
4799 { {
'T',
'N' }, {
'5',
'9' }, 24 },
4800 { {
'T',
'R' }, {}, 26 },
4801 { {
'U',
'A' }, {}, 29 },
4802 { {
'V',
'A' }, {}, 22 },
4803 { {
'V',
'G' }, {}, 24 },
4804 { {
'X',
'K' }, {}, 20 },
4810 this->interval.
end = start;
4811 for (
size_t i = 0; i < 2; ++i, ++this->interval.
end) {
4815 if (
chr <
'A' ||
'Z' <
chr)
4817 this->country[i] =
chr;
4822 size_t m = (
l +
r) / 2;
4824 if (
c.country[0] <
this->country[0] || (
c.country[0] ==
this->country[0] &&
c.country[1] <
this->country[1]))
4826 else if (this->country[0] <
c.country[0] || (
this->country[0] ==
c.country[0] &&
this->country[1] <
c.country[1]))
4833 this->country[2] = 0;
4835 for (
size_t i = 0; i < 2; ++i, ++this->interval.
end) {
4838 this->check_digits[i] = text[this->interval.
end];
4840 this->check_digits[2] = 0;
4851 this->interval.
end = m_space->interval.end;
4855 if ((
'0' <=
chr &&
chr <=
'9') || (
'A' <=
chr &&
chr <=
'Z')) {
4856 this->bban[
n++] =
chr;
4857 this->interval.
end++;
4867 for (
size_t i = 0; ; ++i) {
4868 if (!this->bban[i]) {
4869 for (i = 0; i < 2; ++i) {
4870 if (
'A' <= this->country[i] && this->country[i] <=
'J') {
4874 else if (
'K' <= this->country[i] && this->country[i] <=
'T') {
4878 else if (
'U' <= this->country[i] && this->country[i] <=
'Z') {
4888 if (
'0' <= this->bban[i] && this->bban[i] <=
'9')
4890 else if (
'A' <= this->bban[i] && this->bban[i] <=
'J') {
4894 else if (
'K' <= this->bban[i] && this->bban[i] <=
'T') {
4898 else if (
'U' <= this->bban[i] && this->bban[i] <=
'Z') {
4913 for (; digit_count < 9 &&
normalized[next]; ++next, ++digit_count)
4917 this->interval.
start = start;
4925 std::shared_ptr<basic_parser<T>> m_space;
4928 using iban = basic_iban<char>;
4929 using wiban = basic_iban<wchar_t>;
4931 using tiban = wiban;
4935 using sgml_iban = basic_iban<char>;
4948 _In_ const std::locale&
locale = std::locale()) :
4952 this->check_digits[0] = 0;
4954 this->is_valid =
false;
4957 virtual void invalidate()
4959 this->check_digits[0] = 0;
4961 this->is_valid =
false;
4970 virtual bool do_match(
4971 _In_reads_or_z_opt_(end)
const T* text,
4972 _In_ size_t start = 0,
4976 _Assume_(text || start >= end);
4977 const auto&
ctype = std::use_facet<std::ctype<T>>(this->m_locale);
4982 this->interval.
end = start;
4983 if (this->interval.
end + 1 >= end ||
4987 this->interval.
end += 2;
4989 for (
size_t i = 0; i < 2; ++i, ++this->interval.
end) {
4992 this->check_digits[i] = text[this->interval.
end];
4994 this->check_digits[2] = 0;
4998 this->interval.
end = m_space->interval.end;
4999 for (
size_t j = 0;
j < 4; ++
j) {
5003 if ((
'0' <=
chr &&
chr <=
'9') || (
'A' <=
chr &&
chr <=
'Z')) {
5006 this->reference[
n++] =
chr;
5007 this->interval.
end++;
5016 this->reference[_countof(this->reference) - 1] = 0;
5017 for (
size_t i =
n,
j = _countof(this->reference) - 1; i;)
5018 this->reference[--
j] = this->reference[--i];
5019 for (
size_t j = _countof(this->reference) - 1 -
n;
j;)
5020 this->reference[--
j] =
'0';
5025 for (
size_t i = 0; ; ++i) {
5026 if (!this->reference[i]) {
5036 if (
'0' <= this->reference[i] && this->reference[i] <=
'9')
5038 else if (
'A' <= this->reference[i] && this->reference[i] <=
'J') {
5042 else if (
'K' <= this->reference[i] && this->reference[i] <=
'T') {
5046 else if (
'U' <= this->reference[i] && this->reference[i] <=
'Z') {
5061 for (; digit_count < 9 &&
normalized[next]; ++next, ++digit_count)
5065 this->interval.
start = start;
5073 std::shared_ptr<basic_parser<T>> m_space;
5076 using creditor_reference = basic_creditor_reference<char>;
5077 using wcreditor_reference = basic_creditor_reference<wchar_t>;
5079 using tcreditor_reference = wcreditor_reference;
5081 using tcreditor_reference = creditor_reference;
5083 using sgml_creditor_reference = basic_creditor_reference<char>;
5097 virtual bool do_match(
5098 _In_reads_or_z_opt_(end)
const T* text,
5099 _In_ size_t start = 0,
5103 _Assume_(text || start >= end);
5104 this->interval.
end = start;
5109 this->interval.
end++;
5114 this->interval.
start = start;
5143 virtual bool do_match(
5144 _In_reads_or_z_opt_(end)
const T* text,
5145 _In_ size_t start = 0,
5149 _Assume_(text || start >= end);
5150 if (start < end && text[start] ==
'-') {
5151 this->interval.
end = (this->interval.
start = start) + 1;
5181 _In_ const std::locale&
locale = std::locale()) :
5193 virtual void invalidate()
5196 this->
part1.invalidate();
5197 this->
part2.invalidate();
5198 this->
part3.invalidate();
5199 this->is_valid =
false;
5210 virtual bool do_match(
5211 _In_reads_or_z_opt_(end)
const T* text,
5212 _In_ size_t start = 0,
5216 _Assume_(text || start >= end);
5217 const auto&
ctype = std::use_facet<std::ctype<T>>(this->m_locale);
5220 this->interval.
end = start;
5221 if (this->interval.
end + 1 >= end ||
5225 this->interval.
end += 2;
5227 for (
size_t i = 0; i < 2; ++i, ++this->interval.
end) {
5230 this->model[i] = text[this->interval.
end];
5234 this->part1.invalidate();
5235 this->part2.invalidate();
5236 this->part3.invalidate();
5237 if (this->model[0] ==
'9' && this->model[1] ==
'9') {
5239 this->interval.
start = start;
5244 this->interval.
end = m_space->interval.end;
5246 this->part1.match(text, this->interval.
end, end,
flags) &&
5252 this->interval.
start = start;
5260 this->interval.
end = start + 4;
5262 if (this->model[0] ==
'0' && this->model[1] ==
'0')
5273 else if (this->model[0] ==
'0' && this->model[1] ==
'1')
5292 else if (this->model[0] ==
'0' && this->model[1] ==
'2')
5300 else if (this->model[0] ==
'0' && this->model[1] ==
'3')
5309 else if (this->model[0] ==
'0' && this->model[1] ==
'4')
5317 else if ((this->model[0] ==
'0' || this->model[0] ==
'5') && this->model[1] ==
'5')
5331 else if (this->model[0] ==
'0' && this->model[1] ==
'6')
5344 else if (this->model[0] ==
'0' && this->model[1] ==
'7')
5355 else if (this->model[0] ==
'0' && this->model[1] ==
'8')
5365 else if (this->model[0] ==
'0' && this->model[1] ==
'9')
5383 else if (this->model[0] ==
'1' && this->model[1] ==
'0')
5399 (this->model[0] ==
'1' && (this->model[1] ==
'1' || this->model[1] ==
'8' || this->model[1] ==
'9')) ||
5400 ((this->model[0] ==
'2' || this->model[0] ==
'3') && this->model[1] ==
'8') ||
5401 (this->model[0] ==
'4' && (this->model[1] ==
'0' || this->model[1] ==
'1' || this->model[1] ==
'8' || this->model[1] ==
'9')) ||
5402 (this->model[0] ==
'5' && (this->model[1] ==
'1' || this->model[1] ==
'8')))
5415 else if (this->model[0] ==
'1' && this->model[1] ==
'2')
5423 else if ((this->model[0] ==
'2' || this->model[0] ==
'3') && this->model[1] ==
'1')
5440 static bool check11(
5453 static bool check11(
5454 _In_count_(num_part1)
const T*
part1, _In_
size_t num_part1,
5455 _In_count_(num_part2)
const T*
part2, _In_
size_t num_part2)
5457 _Assume_(
part1 || !num_part1);
5458 _Assume_(
part2 && num_part2 >= 1);
5459 uint32_t nominator = 0, ponder = 2;
5460 for (
size_t i = num_part2 - 1; i--; ++ponder)
5461 nominator +=
static_cast<uint32_t
>(
part2[i] -
'0') * ponder;
5462 for (
size_t i = num_part1; i--; ++ponder)
5463 nominator +=
static_cast<uint32_t
>(
part1[i] -
'0') * ponder;
5464 uint8_t control = 11 -
static_cast<uint8_t
>(nominator % 11);
5467 return control ==
part2[num_part2 - 1] -
'0';
5470 static bool check11(
5471 _In_count_(num_part1)
const T*
part1, _In_
size_t num_part1,
5472 _In_count_(num_part2)
const T*
part2, _In_
size_t num_part2,
5473 _In_count_(num_part3)
const T*
part3, _In_
size_t num_part3)
5475 _Assume_(
part1 || !num_part1);
5476 _Assume_(
part2 || !num_part2);
5477 _Assume_(
part3 && num_part3 >= 1);
5478 uint32_t nominator = 0, ponder = 2;
5479 for (
size_t i = num_part3 - 1; i--; ++ponder)
5480 nominator +=
static_cast<uint32_t
>(
part3[i] -
'0') * ponder;
5481 for (
size_t i = num_part2; i--; ++ponder)
5482 nominator +=
static_cast<uint32_t
>(
part2[i] -
'0') * ponder;
5483 for (
size_t i = num_part1; i--; ++ponder)
5484 nominator +=
static_cast<uint32_t
>(
part1[i] -
'0') * ponder;
5485 uint8_t control = 11 -
static_cast<uint8_t
>(nominator % 11);
5488 return control ==
part2[num_part3 - 1] -
'0';
5491 std::shared_ptr<basic_parser<T>> m_space;
5492 basic_si_reference_delimiter<T> m_delimiter;
5495 using si_reference = basic_si_reference<char>;
5496 using wsi_reference = basic_si_reference<wchar_t>;
5498 using tsi_reference = wsi_reference;
5500 using tsi_reference = si_reference;
5502 using sgml_si_reference = basic_si_reference<char>;
5515 _In_ const std::locale&
locale = std::locale()) :
5524 virtual void invalidate()
5535 virtual bool do_match(
5536 _In_reads_or_z_opt_(end)
const T* text,
5537 _In_ size_t start = 0,
5541 _Assume_(text || start >= end);
5545 this->interval.
end = start;
5550 this->interval.
end = m_element->interval.end;
5552 this->interval.
end = m_digit->interval.end;
5558 this->interval.
end = m_sign->interval.end;
5561 this->interval.
start = start;
5571 std::shared_ptr<basic_parser<T>> m_element;
5572 std::shared_ptr<basic_parser<T>> m_digit;
5573 std::shared_ptr<basic_parser<T>> m_sign;
5591 virtual bool do_match(
5592 _In_reads_or_z_(end)
const char* text,
5593 _In_ size_t start = 0,
5597 _Assume_(text || start >= end);
5598 this->interval.
end = start;
5600 _Assume_(text || this->interval.
end >= end);
5602 if (text[this->interval.
end] ==
'\r') {
5603 this->interval.
end++;
5605 this->interval.
start = start;
5606 this->interval.
end++;
5610 else if (text[this->interval.
end] ==
'\n') {
5611 this->interval.
start = start;
5612 this->interval.
end++;
5627 virtual bool do_match(
5628 _In_reads_or_z_(end)
const char* text,
5629 _In_ size_t start = 0,
5633 _Assume_(text || start >= end);
5634 this->interval.
end = start;
5638 this->interval.
start = start;
5639 this->interval.
end++;
5645 this->interval.
start = start;
5646 this->interval.
end++;
5663 virtual bool do_match(
5664 _In_reads_or_z_(end)
const char* text,
5665 _In_ size_t start = 0,
5669 _Assume_(text || start >= end);
5670 this->interval.
end = start;
5672 _Assume_(text || this->interval.
end >= end);
5674 this->interval.
start = start;
5679 this->interval.
start = start;
5680 this->interval.
end++;
5696 virtual bool do_match(
5697 _In_reads_or_z_(end)
const char* text,
5698 _In_ size_t start = 0,
5702 _Assume_(text || start >= end);
5703 this->interval.
end = start;
5706 if ((
unsigned int)text[this->interval.
end] < 0x20 ||
5728 this->interval.
end++;
5734 this->interval.
start = start;
5750 virtual void invalidate()
5754 parser::invalidate();
5760 virtual bool do_match(
5761 _In_reads_or_z_(end)
const char* text,
5762 _In_ size_t start = 0,
5766 _Assume_(text || start >= end);
5767 this->interval.
end = start;
5770 this->interval.
end++;
5773 _Assume_(text || this->interval.
end >= end);
5775 if (text[this->interval.
end] ==
'"') {
5777 this->interval.
end++;
5780 else if (text[this->interval.
end] ==
'\\') {
5781 this->interval.
end++;
5783 this->interval.
end++;
5789 this->interval.
end++;
5796 this->interval.
start = start;
5813 virtual void invalidate()
5815 string.invalidate();
5817 parser::invalidate();
5824 virtual bool do_match(
5825 _In_reads_or_z_(end)
const char* text,
5826 _In_ size_t start = 0,
5830 _Assume_(text || start >= end);
5831 this->interval.
end = start;
5832 if (
string.match(text, this->interval.
end, end,
flags)) {
5834 this->interval.
end =
string.interval.end;
5835 this->interval.
start = start;
5839 string.invalidate();
5841 this->interval.
start = start;
5857 virtual void invalidate()
5861 parser::invalidate();
5868 virtual bool do_match(
5869 _In_reads_or_z_(end)
const char* text,
5870 _In_ size_t start = 0,
5874 _Assume_(text || start >= end);
5875 this->interval.
end = start;
5882 _Assume_(text || this->interval.
end >= end);
5884 this->interval.
end++;
5892 this->interval.
start = start;
5909 virtual bool do_match(
5910 _In_reads_or_z_(end)
const char* text,
5911 _In_ size_t start = 0,
5915 _Assume_(text || start >= end);
5916 if (start + 2 < end &&
5917 text[start] ==
'*' &&
5918 text[start + 1] ==
'/' &&
5919 text[start + 2] ==
'*')
5921 this->interval.
end = (this->interval.
start = start) + 3;
5924 else if (start < end && text[start] ==
'*') {
5925 this->interval.
end = (this->interval.
start = start) + 1;
5941 virtual void invalidate()
5944 subtype.invalidate();
5945 parser::invalidate();
5952 virtual bool do_match(
5953 _In_reads_or_z_(end)
const char* text,
5954 _In_ size_t start = 0,
5958 _Assume_(text || start >= end);
5959 this->interval.
end = start;
5967 this->interval.
end++;
5976 this->interval.
start = start;
5993 virtual void invalidate()
5996 http_media_range::invalidate();
5999 std::list<http_parameter> params;
6002 virtual bool do_match(
6003 _In_reads_or_z_(end)
const char* text,
6004 _In_ size_t start = 0,
6008 _Assume_(text || start >= end);
6009 if (!http_media_range::do_match(text, start, end,
flags))
6016 else if (text[this->interval.
end] ==
';') {
6017 this->interval.
end++;
6022 this->interval.
end = param.interval.end;
6023 params.push_back(std::move(param));
6034 this->interval.
end = params.empty() ? subtype.
interval.
end : params.back().interval.end;
6049 virtual bool do_match(
6050 _In_reads_or_z_(end)
const char* text,
6051 _In_ size_t start = 0,
6055 _Assume_(text || start >= end);
6056 this->interval.
end = start;
6059 if ((
unsigned int)text[this->interval.
end] < 0x20 ||
6066 this->interval.
end++;
6072 this->interval.
start = start;
6091 virtual void invalidate()
6094 parser::invalidate();
6100 virtual bool do_match(
6101 _In_reads_or_z_(end)
const char* text,
6102 _In_ size_t start = 0,
6106 _Assume_(text || start >= end);
6108 this->interval.
end = start;
6112 size_t _value =
static_cast<size_t>(value) * 10 +
static_cast<size_t>(text[this->interval.
end] -
'0');
6119 this->interval.
end++;
6128 this->interval.
start = start;
6142 virtual bool do_match(
6143 _In_reads_or_z_(end)
const char* text,
6144 _In_ size_t start = 0,
6148 _Assume_(text || start >= end);
6149 this->interval.
end = start;
6152 if ((
unsigned int)text[this->interval.
end] < 0x20 ||
6159 this->interval.
end++;
6164 this->interval.
start = start;
6175 virtual void invalidate()
6178 parser::invalidate();
6184 virtual bool do_match(
6185 _In_reads_or_z_(end)
const char* text,
6186 _In_ size_t start = 0,
6190 _Assume_(text || start >= end);
6192 this->interval.
end = start;
6194 _Assume_(text || this->interval.
end >= end);
6197 this->interval.
end++;
6198 s.match(text, this->interval.
end, end,
flags);
6200 this->interval.
end = s.interval.end;
6203 if (text[this->interval.
end] ==
'/') {
6204 this->interval.
end++;
6205 s.match(text, this->interval.
end, end,
flags);
6207 this->interval.
end = s.interval.end;
6215 this->interval.
start = start;
6230 virtual void invalidate()
6236 parser::invalidate();
6243 virtual bool do_match(
6244 _In_reads_or_z_(end)
const char* text,
6245 _In_ size_t start = 0,
6249 _Assume_(text || start >= end);
6250 this->interval.
end = start;
6254 if ((
unsigned int)text[this->interval.
end] < 0x20 ||
6261 this->interval.
end++;
6267 name.
end = this->interval.
end;
6270 if (text[this->interval.
end] ==
'=') {
6271 this->interval.
end++;
6275 if ((
unsigned int)text[this->interval.
end] < 0x20 ||
6281 this->interval.
end++;
6286 value.
end = this->interval.
end;
6292 this->interval.
start = start;
6312 virtual void invalidate()
6314 server.invalidate();
6318 parser::invalidate();
6324 std::list<http_url_parameter> params;
6327 virtual bool do_match(
6328 _In_reads_or_z_(end)
const char* text,
6329 _In_ size_t start = 0,
6333 _Assume_(text || start >= end);
6334 this->interval.
end = start;
6337 this->interval.
end += 7;
6343 this->interval.
end++;
6353 server.invalidate();
6366 this->interval.
end++;
6369 if ((
unsigned int)text[this->interval.
end] < 0x20 ||
6373 else if (text[this->interval.
end] ==
'&')
6374 this->interval.
end++;
6378 this->interval.
end = param.interval.end;
6379 params.push_back(std::move(param));
6390 this->interval.
start = start;
6405 virtual void invalidate()
6408 parser::invalidate();
6411 std::vector<stdex::interval<size_t>> components;
6414 virtual bool do_match(
6415 _In_reads_or_z_(end)
const char* text,
6416 _In_ size_t start = 0,
6420 _Assume_(text || start >= end);
6421 this->interval.
end = start;
6426 k.end = this->interval.
end;
6428 if (
k.end < end && text[
k.end]) {
6429 if (stdex::isalpha(text[
k.end]))
6437 if (this->interval.
end <
k.end) {
6438 k.start = this->interval.
end;
6439 this->interval.
end =
k.end;
6440 components.push_back(
k);
6445 this->interval.
end++;
6452 if (!components.empty()) {
6453 this->interval.
start = start;
6454 this->interval.
end = components.back().end;
6473 virtual void invalidate()
6476 parser::invalidate();
6482 virtual bool do_match(
6483 _In_reads_or_z_(end)
const char* text,
6484 _In_ size_t start = 0,
6488 _Assume_(text || start >= end);
6490 this->interval.
end = start;
6495 this->interval.
end++;
6497 else if (text[this->interval.
end] ==
'.') {
6498 this->interval.
end++;
6504 this->interval.
end++;
6522 this->interval.
start = start;
6537 virtual bool do_match(
6538 _In_reads_or_z_(end)
const char* text,
6539 _In_ size_t start = 0,
6543 _Assume_(text || end <= start);
6544 if (start < end && text[start] ==
'*') {
6545 this->interval.
end = (this->interval.
start = start) + 1;
6556 template <
class T,
class T_asterisk = http_asterisk>
6565 virtual void invalidate()
6567 asterisk.invalidate();
6569 factor.invalidate();
6570 parser::invalidate();
6578 virtual bool do_match(
6579 _In_reads_or_z_(end)
const char* text,
6580 _In_ size_t start = 0,
6584 _Assume_(text || start >= end);
6586 this->interval.
end = start;
6593 asterisk.invalidate();
6596 asterisk.invalidate();
6604 this->interval.
end++;
6607 this->interval.
end++;
6610 this->interval.
end++;
6618 factor.invalidate();
6621 this->interval.
start = start;
6632 virtual void invalidate()
6636 parser::invalidate();
6643 virtual bool do_match(
6644 _In_reads_or_z_(end)
const char* text,
6645 _In_ size_t start = 0,
6649 _Assume_(text || start >= end);
6650 this->interval.
end = start;
6652 this->interval.
end++;
6662 this->interval.
end++;
6671 this->interval.
start = start;
6688 virtual void invalidate()
6693 parser::invalidate();
6701 virtual bool do_match(
6702 _In_reads_or_z_(end)
const char* text,
6703 _In_ size_t start = 0,
6707 _Assume_(text || start >= end);
6708 this->interval.
end = start;
6716 this->interval.
end++;
6730 else if (text[this->interval.
end] ==
';') {
6731 this->interval.
end++;
6736 this->interval.
end = param.interval.end;
6737 params.push_back(std::move(param));
6748 this->interval.
start = start;
6766 virtual void invalidate()
6772 parser::invalidate();
6779 virtual bool do_match(
6780 _In_reads_or_z_(end)
const char* text,
6781 _In_ size_t start = 0,
6785 _Assume_(text || start >= end);
6786 this->interval.
end = start;
6790 if (text[this->interval.
end] ==
'/') {
6791 type.
end = this->interval.
end;
6792 this->interval.
end++;
6793 version.
start = this->interval.
end;
6796 if (stdex::isspace(text[this->interval.
end])) {
6797 version.
end = this->interval.
end;
6801 this->interval.
end++;
6804 version.
end = this->interval.
end;
6810 else if (stdex::isspace(text[this->interval.
end])) {
6811 type.
end = this->interval.
end;
6815 this->interval.
end++;
6818 type.
end = this->interval.
end;
6823 this->interval.
start = start;
6846 virtual void invalidate()
6850 version_maj.
start = 1;
6851 version_maj.
end = 0;
6852 version_min.
start = 1;
6853 version_min.
end = 0;
6855 parser::invalidate();
6864 virtual bool do_match(
6865 _In_reads_or_z_(end)
const char* text,
6866 _In_ size_t start = 0,
6870 _Assume_(text || start >= end);
6871 this->interval.
end = start;
6875 if (text[this->interval.
end] ==
'/') {
6876 type.
end = this->interval.
end;
6877 this->interval.
end++;
6880 else if (stdex::isspace(text[this->interval.
end]))
6883 this->interval.
end++;
6886 type.
end = this->interval.
end;
6890 version_maj.
start = this->interval.
end;
6893 if (text[this->interval.
end] ==
'.') {
6894 version_maj.
end = this->interval.
end;
6895 this->interval.
end++;
6896 version_min.
start = this->interval.
end;
6899 if (stdex::isspace(text[this->interval.
end])) {
6900 version_min.
end = this->interval.
end;
6902 (
uint16_t)strtoui(text + version_maj.
start, version_maj.
size(),
nullptr, 10) * 0x100 +
6907 this->interval.
end++;
6914 else if (stdex::isspace(text[this->interval.
end])) {
6915 version_maj.
end = this->interval.
end;
6916 version_min.
start = 1;
6917 version_min.
end = 0;
6922 this->interval.
end++;
6927 this->interval.
start = start;
6948 virtual void invalidate()
6953 protocol.invalidate();
6954 parser::invalidate();
6962 virtual bool do_match(
6963 _In_reads_or_z_(end)
const char* text,
6964 _In_ size_t start = 0,
6968 _Assume_(text || start >= end);
6969 this->interval.
end = start;
6975 if (stdex::isspace(text[this->interval.
end]))
6976 this->interval.
end++;
6988 if (stdex::isspace(text[this->interval.
end])) {
6989 verb.
end = this->interval.
end;
6990 this->interval.
end++;
6994 this->interval.
end++;
7004 if (stdex::isspace(text[this->interval.
end]))
7005 this->interval.
end++;
7017 protocol.invalidate();
7024 if (stdex::isspace(text[this->interval.
end]))
7025 this->interval.
end++;
7051 this->interval.
end++;
7057 this->interval.
start = start;
7074 virtual void invalidate()
7080 parser::invalidate();
7087 virtual bool do_match(
7088 _In_reads_or_z_(end)
const char* text,
7089 _In_ size_t start = 0,
7093 _Assume_(text || start >= end);
7094 this->interval.
end = start;
7104 if (stdex::isspace(text[this->interval.
end])) {
7105 name.
end = this->interval.
end;
7106 this->interval.
end++;
7111 if (stdex::isspace(text[this->interval.
end]))
7112 this->interval.
end++;
7120 this->interval.
end++;
7127 else if (text[this->interval.
end] ==
':') {
7128 name.
end = this->interval.
end;
7129 this->interval.
end++;
7133 this->interval.
end++;
7145 this->interval.
end++;
7150 if (stdex::isspace(text[this->interval.
end]))
7151 this->interval.
end++;
7154 value.
end = ++this->interval.
end;
7160 this->interval.
start = start;
7174 template <
class KEY,
class T>
7179 _In_reads_or_z_(end)
const char* text,
7180 _In_ size_t start = 0,
7184 while (start < end) {
7185 while (start < end && text[start] && stdex::isspace(text[start])) start++;
7186 if (start < end && text[start] ==
',') {
7188 while (start < end&& text[start] && stdex::isspace(text[start])) start++;
7191 if (
el.match(text, start, end,
flags)) {
7193 T::insert(std::move(
el));
7203 constexpr bool operator()(
const T& a,
const T& b)
const noexcept
7205 return a.factor.value > b.factor.value;
7212 template <
class T,
class AX = std::allocator<T>>
7234 _In_ const std::locale&
locale = std::locale()) :
7249 virtual void invalidate()
7255 std::basic_string<T> value;
7258 virtual bool do_match(
7259 _In_reads_or_z_opt_(end)
const T* text,
7260 _In_ size_t start = 0,
7264 _Assume_(text || start >= end);
7265 this->interval.
end = start;
7267 this->interval.
end = m_quote->interval.end;
7271 this->interval.
start = start;
7272 this->interval.
end = m_quote->interval.end;
7276 if (m_quote->match(text, m_escape->interval.end, end,
flags)) {
7277 value +=
'"'; this->interval.
end = m_quote->interval.end;
7280 if (m_sol->match(text, m_escape->interval.end, end,
flags)) {
7281 value +=
'/'; this->interval.
end = m_sol->interval.end;
7284 if (m_bs->match(text, m_escape->interval.end, end,
flags)) {
7285 value +=
'\b'; this->interval.
end = m_bs->interval.end;
7288 if (m_ff->match(text, m_escape->interval.end, end,
flags)) {
7289 value +=
'\f'; this->interval.
end = m_ff->interval.end;
7292 if (m_lf->match(text, m_escape->interval.end, end,
flags)) {
7293 value +=
'\n'; this->interval.
end = m_lf->interval.end;
7296 if (m_cr->match(text, m_escape->interval.end, end,
flags)) {
7297 value +=
'\r'; this->interval.
end = m_cr->interval.end;
7300 if (m_htab->match(text, m_escape->interval.end, end,
flags)) {
7301 value +=
'\t'; this->interval.
end = m_htab->interval.end;
7305 m_uni->match(text, m_escape->interval.end, end,
flags) &&
7306 m_hex->match(text, m_uni->interval.end, std::min(m_uni->interval.end + 4, end),
flags | match_case_insensitive) &&
7307 m_hex->interval.size() == 4 )
7309 _Assume_(m_hex->value <= 0xffff);
7310 if (
sizeof(T) == 1) {
7311 if (m_hex->value > 0x7ff) {
7312 value += (T)(0xe0 | ((m_hex->value >> 12) & 0x0f));
7313 value += (T)(0x80 | ((m_hex->value >> 6) & 0x3f));
7314 value += (T)(0x80 | (m_hex->value & 0x3f));
7316 else if (m_hex->value > 0x7f) {
7317 value += (T)(0xc0 | ((m_hex->value >> 6) & 0x1f));
7318 value += (T)(0x80 | (m_hex->value & 0x3f));
7321 value += (T)(m_hex->value & 0x7f);
7324 value += (T)m_hex->value;
7325 this->interval.
end = m_hex->interval.end;
7328 if (m_escape->match(text, m_escape->interval.end, end,
flags)) {
7329 value +=
'\\'; this->interval.
end = m_escape->interval.end;
7334 value.append(text + m_chr->interval.start, m_chr->interval.size());
7335 this->interval.
end = m_chr->interval.end;
7346 std::shared_ptr<basic_parser<T>> m_quote;
7347 std::shared_ptr<basic_parser<T>> m_chr;
7348 std::shared_ptr<basic_parser<T>> m_escape;
7349 std::shared_ptr<basic_parser<T>> m_sol;
7350 std::shared_ptr<basic_parser<T>> m_bs;
7351 std::shared_ptr<basic_parser<T>> m_ff;
7352 std::shared_ptr<basic_parser<T>> m_lf;
7353 std::shared_ptr<basic_parser<T>> m_cr;
7354 std::shared_ptr<basic_parser<T>> m_htab;
7355 std::shared_ptr<basic_parser<T>> m_uni;
7356 std::shared_ptr<basic_integer16<T>> m_hex;
7374 virtual void invalidate()
7383 virtual bool do_match(
7384 _In_reads_or_z_opt_(end)
const T* text,
7385 _In_ size_t start = 0,
7389 _Unreferenced_(
flags);
7390 _Assume_(text || start + 1 >= end);
7391 if (start + 1 < end &&
7392 text[start] ==
'/' &&
7393 text[start + 1] ==
'*')
7396 this->content.
start = this->interval.
end = start + 2;
7400 if (this->interval.
end + 1 < end &&
7405 this->content.
end = this->interval.
end;
7406 this->interval.
start = start;
7407 this->interval.
end = this->interval.
end + 2;
7410 this->interval.
end++;
7419 using css_comment = basic_css_comment<char>;
7420 using wcss_comment = basic_css_comment<wchar_t>;
7422 using tcss_comment = wcss_comment;
7424 using tcss_comment = css_comment;
7434 virtual bool do_match(
7435 _In_reads_or_z_opt_(end)
const T* text,
7436 _In_ size_t start = 0,
7440 _Unreferenced_(
flags);
7441 _Assume_(text || start + 3 >= end);
7442 if (start + 3 < end &&
7443 text[start] ==
'<' &&
7444 text[start + 1] ==
'!' &&
7445 text[start + 2] ==
'-' &&
7446 text[start + 3] ==
'-')
7448 this->interval.
start = start;
7449 this->interval.
end = start + 4;
7472 virtual bool do_match(
7473 _In_reads_or_z_opt_(end)
const T* text,
7474 _In_ size_t start = 0,
7478 _Unreferenced_(
flags);
7479 _Assume_(text || start + 2 >= end);
7480 if (start + 2 < end &&
7481 text[start] ==
'-' &&
7482 text[start + 1] ==
'-' &&
7483 text[start + 2] ==
'>')
7485 this->interval.
start = start;
7486 this->interval.
end = start + 3;
7509 virtual void invalidate()
7518 virtual bool do_match(
7519 _In_reads_or_z_opt_(end)
const T* text,
7520 _In_ size_t start = 0,
7524 _Unreferenced_(
flags);
7525 this->interval.
end = start;
7526 _Assume_(text || this->interval.
end >= end);
7527 if (this->interval.
end < end &&
7531 T
quote = text[this->interval.
end];
7532 this->content.
start = ++this->interval.
end;
7536 if (text[this->interval.
end] ==
quote) {
7538 this->content.
end = this->interval.
end;
7539 this->interval.
start = start;
7540 this->interval.
end++;
7543 if (this->interval.
end + 1 < end &&
7548 this->interval.
end = this->interval.
end + 2;
7551 this->interval.
end++;
7561 using css_string = basic_css_string<char>;
7562 using wcss_string = basic_css_string<wchar_t>;
7564 using tcss_string = wcss_string;
7566 using tcss_string = css_string;
7576 virtual void invalidate()
7585 virtual bool do_match(
7586 _In_reads_or_z_opt_(end)
const T* text,
7587 _In_ size_t start = 0,
7591 _Unreferenced_(
flags);
7592 this->interval.
end = start;
7593 _Assume_(text || this->interval.
end + 3 >= end);
7594 if (this->interval.
end + 3 < end &&
7601 this->interval.
end = this->interval.
end + 4;
7604 const auto&
ctype = std::use_facet<std::ctype<T>>(this->m_locale);
7607 if (this->interval.
end < end &&
7611 T
quote = text[this->interval.
end];
7612 this->content.
start = ++this->interval.
end;
7616 if (text[this->interval.
end] ==
quote) {
7618 this->content.
end = this->interval.
end;
7619 this->interval.
end++;
7622 if (this->interval.
end + 1 < end &&
7627 this->interval.
end = this->interval.
end + 2;
7630 this->interval.
end++;
7636 if (this->interval.
end < end &&
7640 this->interval.
start = start;
7641 this->interval.
end++;
7651 if (text[this->interval.
end] ==
')') {
7653 this->interval.
start = start;
7654 this->interval.
end++;
7658 this->interval.
end++;
7660 this->content.
end = ++this->interval.
end;
7671 using css_uri = basic_css_uri<char>;
7672 using wcss_uri = basic_css_uri<wchar_t>;
7674 using tcss_uri = wcss_uri;
7676 using tcss_uri = css_uri;
7686 virtual void invalidate()
7695 virtual bool do_match(
7696 _In_reads_or_z_opt_(end)
const T* text,
7697 _In_ size_t start = 0,
7701 _Unreferenced_(
flags);
7702 this->interval.
end = start;
7703 _Assume_(text || this->interval.
end + 6 >= end);
7704 if (this->interval.
end + 6 < end &&
7714 this->interval.
end = this->interval.
end + 7;
7717 const auto&
ctype = std::use_facet<std::ctype<T>>(this->m_locale);
7720 if (this->interval.
end < end &&
7724 T
quote = text[this->interval.
end];
7725 this->content.
start = ++this->interval.
end;
7729 if (text[this->interval.
end] ==
quote) {
7731 this->content.
end = this->interval.
end;
7732 this->interval.
start = start;
7733 this->interval.
end++;
7736 if (this->interval.
end + 1 < end &&
7741 this->interval.
end = this->interval.
end + 2;
7744 this->interval.
end++;
7755 using css_import = basic_css_import<char>;
7756 using wcss_import = basic_css_import<wchar_t>;
7758 using tcss_import = wcss_import;
7760 using tcss_import = css_import;
7770 virtual void invalidate()
7783 virtual bool do_match(
7784 _In_reads_or_z_opt_(end)
const T* text,
7785 _In_ size_t start = 0,
7789 _Unreferenced_(
flags);
7790 const auto&
ctype = std::use_facet<std::ctype<T>>(this->m_locale);
7792 this->interval.
end = start;
7793 this->base_type.
start = this->interval.
end;
7795 _Assume_(text || this->interval.
end >= end);
7798 if (text[this->interval.
end] ==
'/' ||
7802 this->interval.
end++;
7804 if (this->interval.
end <=
this->base_type.start)
7806 this->base_type.
end = this->interval.
end;
7811 this->interval.
end++;
7812 this->sub_type.
start = this->interval.
end;
7816 if (text[this->interval.
end] ==
'/' ||
7820 this->interval.
end++;
7822 if (this->interval.
end <=
this->sub_type.start)
7825 this->sub_type.
end = this->interval.
end;
7828 this->interval.
end++;
7833 if (this->interval.
end + 7 < end &&
7835 (text[this->interval.
end + 1] ==
'h' || text[this->interval.
end + 1] ==
'H') &&
7837 (text[this->interval.
end + 3] ==
'r' || text[this->interval.
end + 3] ==
'R') &&
7839 (text[this->interval.
end + 5] ==
'e' || text[this->interval.
end + 5] ==
'E') &&
7841 text[this->interval.
end + 7] ==
'=')
7843 this->interval.
end = this->interval.
end + 8;
7844 if (this->interval.
end < end &&
7848 T
quote = text[this->interval.
end];
7849 this->charset.
start = ++this->interval.
end;
7856 if (text[this->interval.
end] ==
quote) {
7858 this->charset.
end = this->interval.
end;
7859 this->interval.
end++;
7862 this->interval.
end++;
7867 this->charset.
start = this->interval.
end;
7871 this->charset.
end = this->interval.
end;
7874 this->interval.
end++;
7879 this->interval.
start = start;
7888 using mime_type = basic_mime_type<char>;
7889 using wmime_type = basic_mime_type<wchar_t>;
7891 using tmime_type = wmime_type;
7893 using tmime_type = mime_type;
7903 virtual bool do_match(
7904 _In_reads_or_z_opt_(end)
const T* text,
7905 _In_ size_t start = 0,
7909 _Unreferenced_(
flags);
7910 const auto&
ctype = std::use_facet<std::ctype<T>>(this->m_locale);
7911 this->interval.
end = start;
7913 _Assume_(text || this->interval.
end >= end);
7916 this->interval.
start = start;
7922 if (text[this->interval.
end] ==
'>' ||
7927 this->interval.
start = start;
7930 this->interval.
end++;
7950 virtual void invalidate()
7959 virtual bool do_match(
7960 _In_reads_or_z_opt_(end)
const T* text,
7961 _In_ size_t start = 0,
7965 _Unreferenced_(
flags);
7966 this->interval.
end = start;
7967 _Assume_(text || this->interval.
end >= end);
7968 if (this->interval.
end < end &&
7972 T
quote = text[this->interval.
end];
7973 this->content.
start = ++this->interval.
end;
7981 if (text[this->interval.
end] ==
quote) {
7983 this->content.
end = this->interval.
end;
7984 this->interval.
start = start;
7985 this->interval.
end++;
7988 this->interval.
end++;
7993 this->content.
start = this->interval.
end;
7994 const auto&
ctype = std::use_facet<std::ctype<T>>(this->m_locale);
7996 _Assume_(text || this->interval.
end >= end);
7998 this->content.
end = this->interval.
end;
7999 this->interval.
start = start;
8002 if (text[this->interval.
end] ==
'>' ||
8006 this->content.
end = this->interval.
end;
8007 this->interval.
start = start;
8010 this->interval.
end++;
8015 using html_value = basic_html_value<char>;
8016 using whtml_value = basic_html_value<wchar_t>;
8018 using thtml_value = whtml_value;
8020 using thtml_value = html_value;
8026 enum class html_sequence_t {
8057 type(html_sequence_t::unknown)
8060 virtual void invalidate()
8062 this->type = html_sequence_t::unknown;
8063 this->name.invalidate();
8073 virtual bool do_match(
8074 _In_reads_or_z_opt_(end)
const T* text,
8075 _In_ size_t start = 0,
8079 _Assume_(text || start >= end);
8080 if (start >= end || text[start] !=
'<')
8082 this->interval.
end = start + 1;
8085 if (text[this->interval.
end] ==
'/' &&
8089 this->type = html_sequence_t::element_end;
8090 this->name = this->m_ident.
interval;
8093 else if (text[this->interval.
end] ==
'!') {
8095 this->interval.
end++;
8096 if (this->interval.
end + 1 < end &&
8101 this->name.
start = this->interval.
end = this->interval.
end + 2;
8105 if (this->interval.
end + 2 < end &&
8111 this->type = html_sequence_t::comment;
8112 this->name.
end = this->interval.
end;
8113 this->attributes.clear();
8114 this->interval.
start = start;
8115 this->interval.
end = this->interval.
end + 3;
8118 this->interval.
end++;
8121 this->type = html_sequence_t::declaration;
8122 this->name.
start = this->name.
end = this->interval.
end;
8124 else if (text[this->interval.
end] ==
'?') {
8126 this->name.
start = ++this->interval.
end;
8130 if (text[this->interval.
end] ==
'>') {
8132 this->type = html_sequence_t::instruction;
8133 this->name.
end = this->interval.
end;
8134 this->attributes.clear();
8135 this->interval.
start = start;
8136 this->interval.
end++;
8139 if (this->interval.
end + 1 < end &&
8144 this->type = html_sequence_t::instruction;
8145 this->name.
end = this->interval.
end;
8146 this->attributes.clear();
8147 this->interval.
start = start;
8148 this->interval.
end = this->interval.
end + 2;
8151 this->interval.
end++;
8156 this->type = html_sequence_t::element_start;
8157 this->name = this->m_ident.
interval;
8165 const auto&
ctype = std::use_facet<std::ctype<T>>(this->m_locale);
8168 this->attributes.clear();
8170 if (this->type == html_sequence_t::element_start &&
8171 this->interval.
end + 1 < end &&
8176 this->type = html_sequence_t::element;
8177 this->interval.
end = this->interval.
end + 2;
8180 if (this->interval.
end < end &&
8184 this->interval.
end++;
8187 if (this->type == html_sequence_t::declaration &&
8188 this->interval.
end + 1 < end &&
8193 this->interval.
end = this->interval.
end + 2;
8196 if (this->type == html_sequence_t::declaration &&
8197 this->interval.
end + 1 < end &&
8202 this->interval.
end = this->interval.
end + 2;
8206 if (this->interval.
end + 1 < end &&
8211 this->interval.
end = this->interval.
end + 2;
8214 this->interval.
end++;
8229 a = &this->attributes.back();
8235 this->interval.
end++;
8243 this->interval.
end++;
8250 a->value = this->m_value.content;
8259 a->value.invalidate();
8264 this->interval.
start = start;
8276 using html_tag = basic_html_tag<char>;
8277 using whtml_tag = basic_html_tag<wchar_t>;
8279 using thtml_tag = whtml_tag;
8281 using thtml_tag = html_tag;
8291 virtual void invalidate()
8301 _In_reads_or_z_opt_(end)
const T* text,
8302 _In_ size_t start = 0,
8306 _Unreferenced_(
flags);
8307 _Assume_(text || start + 2 >= end);
8308 if (start + 2 < end &&
8309 text[start] ==
'<' &&
8310 text[start + 1] ==
'!' &&
8311 text[start + 2] ==
'[')
8313 this->interval.
end = start + 3;
8316 const auto&
ctype = std::use_facet<std::ctype<T>>(this->m_locale);
8319 this->condition.
start = this->condition.
end = this->interval.
end;
8324 if (text[this->interval.
end] ==
'[') {
8325 this->interval.
start = start;
8326 this->interval.
end++;
8330 this->interval.
end++;
8332 this->condition.
end = ++this->interval.
end;
8342 using html_declaration_condition_start = basic_html_declaration_condition_start<char>;
8343 using whtml_declaration_condition_start = basic_html_declaration_condition_start<wchar_t>;
8345 using thtml_declaration_condition_start = whtml_declaration_condition_start;
8347 using thtml_declaration_condition_start = html_declaration_condition_start;
8357 virtual bool do_match(
8358 _In_reads_or_z_opt_(end)
const T* text,
8359 _In_ size_t start = 0,
8363 _Unreferenced_(
flags);
8364 _Assume_(text || start + 2 >= end);
8365 if (start + 2 < end &&
8366 text[start] ==
']' &&
8367 text[start + 1] ==
']' &&
8368 text[start + 2] ==
'>')
8370 this->interval.
start = start;
8371 this->interval.
end = start + 3;
8389#undef ENUM_FLAG_OPERATOR
8392#if defined(_MSC_VER)
8394#elif defined(__GNUC__)
8395#pragma GCC diagnostic pop
locale_t helper class to free_locale when going out of scope.
Definition locale.hpp:69
Test for angle in d°mm'ss.dddd form.
Definition parser.hpp:4380
Test for any code unit.
Definition parser.hpp:235
Test for beginning of line.
Definition parser.hpp:634
Test for any.
Definition parser.hpp:1077
Test for Creditor Reference.
Definition parser.hpp:4944
T reference[22]
Normalized national reference number.
Definition parser.hpp:4966
T check_digits[3]
Two check digits.
Definition parser.hpp:4965
bool is_valid
Is reference valid per ISO 7064.
Definition parser.hpp:4967
Legacy CSS comment end -->
Definition parser.hpp:7470
Legacy CSS comment start <!--
Definition parser.hpp:7432
CSS import directive.
Definition parser.hpp:7684
stdex::interval< size_t > content
content position in source
Definition parser.hpp:7692
CSS string.
Definition parser.hpp:7507
stdex::interval< size_t > content
content position in source
Definition parser.hpp:7515
URI in CSS.
Definition parser.hpp:7574
stdex::interval< size_t > content
content position in source
Definition parser.hpp:7582
Test for any code unit from a given string of code units.
Definition parser.hpp:739
Test for specific code unit.
Definition parser.hpp:307
Test for date.
Definition parser.hpp:4013
Test for valid DNS domain character.
Definition parser.hpp:2795
bool allow_on_edge
Is character allowed at the beginning or an end of a DNS domain?
Definition parser.hpp:2805
Test for DNS domain/hostname.
Definition parser.hpp:2895
bool m_allow_absolute
May DNS names end with a dot (absolute name)?
Definition parser.hpp:2959
Test for e-mail address.
Definition parser.hpp:3787
Test for emoticon.
Definition parser.hpp:3890
std::shared_ptr< basic_parser< T > > apex
apex/eyebrows/halo (e.g. O, 0)
Definition parser.hpp:3918
std::shared_ptr< basic_parser< T > > eyes
eyes (e.g. :, ;, >, |, B)
Definition parser.hpp:3919
std::shared_ptr< basic_set< T > > mouth
mouth (e.g. ), ), (, (, |, P, D, p, d)
Definition parser.hpp:3921
std::shared_ptr< basic_parser< T > > nose
nose (e.g. -, o)
Definition parser.hpp:3920
std::shared_ptr< basic_parser< T > > emoticon
emoticon as a whole (e.g. 😀, 🤔, 😶)
Definition parser.hpp:3917
Test for end of line.
Definition parser.hpp:673
Test for fraction.
Definition parser.hpp:1705
End of condition ...]]>
Definition parser.hpp:8355
Start of condition <![condition[...
Definition parser.hpp:8289
virtual bool do_match(_In_reads_or_z_opt_(end) const T *text, size_t start=0, size_t end=SIZE_MAX, int flags=match_multiline)
condition position in source
Definition parser.hpp:8300
Contiguous sequence of characters representing name of element, attribute etc.
Definition parser.hpp:7901
Tag.
Definition parser.hpp:8053
std::vector< html_attribute > attributes
tag attributes
Definition parser.hpp:8070
html_sequence_t type
tag type
Definition parser.hpp:8068
stdex::interval< size_t > name
tag name position in source
Definition parser.hpp:8069
Optionally-quoted string representing value of an attribute.
Definition parser.hpp:7948
stdex::interval< size_t > content
content position in source
Definition parser.hpp:7956
Test for International Bank Account Number.
Definition parser.hpp:4655
T bban[31]
Normalized Basic Bank Account Number.
Definition parser.hpp:4680
T country[3]
ISO 3166-1 alpha-2 country code.
Definition parser.hpp:4678
T check_digits[3]
Two check digits.
Definition parser.hpp:4679
bool is_valid
Is IBAN valid per ISO 7064.
Definition parser.hpp:4681
Test for decimal integer.
Definition parser.hpp:1315
Test for decimal integer possibly containing thousand separators.
Definition parser.hpp:1400
bool has_separators
Did integer have any separators?
Definition parser.hpp:1421
size_t digit_count
Total number of digits in integer.
Definition parser.hpp:1420
Test for hexadecimal integer.
Definition parser.hpp:1480
Base class for integer testing.
Definition parser.hpp:1293
size_t value
Calculated value of the numeral.
Definition parser.hpp:1307
Test for IPv4 address.
Definition parser.hpp:2363
stdex::interval< size_t > components[4]
Individual component intervals.
Definition parser.hpp:2408
struct in_addr value
IPv4 address value.
Definition parser.hpp:2409
Test for IPv6 address.
Definition parser.hpp:2575
std::shared_ptr< basic_parser< T > > scope_id
Scope ID (e.g. NIC index with link-local addresses)
Definition parser.hpp:2647
stdex::interval< size_t > components[8]
Individual component intervals.
Definition parser.hpp:2645
struct in6_addr value
IPv6 address value.
Definition parser.hpp:2646
Test for valid IPv6 address scope ID character.
Definition parser.hpp:2501
Test for repeating.
Definition parser.hpp:929
bool m_greedy
try to match as long sequence as possible
Definition parser.hpp:968
std::shared_ptr< basic_parser< T > > m_el
repeating element
Definition parser.hpp:965
size_t m_min_iterations
minimum number of iterations
Definition parser.hpp:966
size_t m_max_iterations
maximum number of iterations
Definition parser.hpp:967
Test for JSON string.
Definition parser.hpp:7220
MIME content type.
Definition parser.hpp:7768
stdex::interval< size_t > base_type
basic type position in source
Definition parser.hpp:7778
stdex::interval< size_t > sub_type
sub-type position in source
Definition parser.hpp:7779
stdex::interval< size_t > charset
charset position in source
Definition parser.hpp:7780
Test for mixed numeral.
Definition parser.hpp:1940
std::shared_ptr< basic_parser< T > > fraction
fraction
Definition parser.hpp:1973
std::shared_ptr< basic_parser< T > > special_sign
Special sign (e.g. plus-minus '±')
Definition parser.hpp:1971
std::shared_ptr< basic_parser< T > > negative_sign
Negative sign.
Definition parser.hpp:1970
std::shared_ptr< basic_parser< T > > positive_sign
Positive sign.
Definition parser.hpp:1969
std::shared_ptr< basic_parser< T > > integer
Integer part.
Definition parser.hpp:1972
Test for monetary numeral.
Definition parser.hpp:2234
std::shared_ptr< basic_parser< T > > positive_sign
Positive sign.
Definition parser.hpp:2267
std::shared_ptr< basic_parser< T > > decimal_separator
Decimal separator.
Definition parser.hpp:2272
std::shared_ptr< basic_parser< T > > currency
Currency part.
Definition parser.hpp:2270
std::shared_ptr< basic_parser< T > > decimal
Decimal part.
Definition parser.hpp:2273
std::shared_ptr< basic_parser< T > > integer
Integer part.
Definition parser.hpp:2271
std::shared_ptr< basic_parser< T > > negative_sign
Negative sign.
Definition parser.hpp:2268
std::shared_ptr< basic_parser< T > > special_sign
Special sign (e.g. plus-minus '±')
Definition parser.hpp:2269
"No-op" match
Definition parser.hpp:203
Base template for all parsers.
Definition parser.hpp:79
stdex::interval< size_t > interval
Region of the last match.
Definition parser.hpp:119
Test for permutation.
Definition parser.hpp:1217
Test for phone number.
Definition parser.hpp:4503
std::basic_string< T > value
Normalized phone number.
Definition parser.hpp:4528
Test for any punctuation code unit.
Definition parser.hpp:480
Test for Roman numeral.
Definition parser.hpp:1589
Test for scientific numeral.
Definition parser.hpp:2065
std::shared_ptr< basic_parser< T > > special_sign
Special sign (e.g. plus-minus '±')
Definition parser.hpp:2111
std::shared_ptr< basic_parser< T > > exponent_symbol
Exponent symbol (e.g. 'e')
Definition parser.hpp:2115
std::shared_ptr< basic_parser< T > > positive_sign
Positive sign.
Definition parser.hpp:2109
std::shared_ptr< basic_parser< T > > negative_sign
Negative sign.
Definition parser.hpp:2110
double value
Calculated value of the numeral.
Definition parser.hpp:2119
std::shared_ptr< basic_parser< T > > negative_exp_sign
Negative exponent sign (e.g. '-')
Definition parser.hpp:2117
std::shared_ptr< basic_integer< T > > decimal
Decimal part.
Definition parser.hpp:2114
std::shared_ptr< basic_parser< T > > positive_exp_sign
Positive exponent sign (e.g. '+')
Definition parser.hpp:2116
std::shared_ptr< basic_integer< T > > exponent
Exponent part.
Definition parser.hpp:2118
std::shared_ptr< basic_parser< T > > decimal_separator
Decimal separator.
Definition parser.hpp:2113
std::shared_ptr< basic_integer< T > > integer
Integer part.
Definition parser.hpp:2112
Test for match score.
Definition parser.hpp:1768
Test for sequence.
Definition parser.hpp:1025
Definition parser.hpp:708
Test for SI Reference delimiter.
Definition parser.hpp:5138
Test for SI Reference part.
Definition parser.hpp:5092
Test for SI Reference.
Definition parser.hpp:5177
basic_si_reference_part< T > part3
Reference data part 3 (P3)
Definition parser.hpp:5206
basic_si_reference_part< T > part1
Reference data part 1 (P1)
Definition parser.hpp:5204
bool is_valid
Is reference valid.
Definition parser.hpp:5207
T model[3]
Reference model.
Definition parser.hpp:5203
basic_si_reference_part< T > part2
Reference data part 2 (P2)
Definition parser.hpp:5205
Test for signed numeral.
Definition parser.hpp:1854
std::shared_ptr< basic_parser< T > > special_sign
Special sign (e.g. plus-minus '±')
Definition parser.hpp:1880
std::shared_ptr< basic_parser< T > > negative_sign
Negative sign.
Definition parser.hpp:1879
std::shared_ptr< basic_parser< T > > positive_sign
Positive sign.
Definition parser.hpp:1878
std::shared_ptr< basic_parser< T > > number
Number.
Definition parser.hpp:1881
Test for any space code unit.
Definition parser.hpp:400
Test for any space or punctuation code unit.
Definition parser.hpp:555
Test for any string.
Definition parser.hpp:1145
Test for given string.
Definition parser.hpp:834
Test for time.
Definition parser.hpp:4278
Test for valid URL password character.
Definition parser.hpp:3079
Test for valid URL path character.
Definition parser.hpp:3181
Test for URL path.
Definition parser.hpp:3291
Test for valid URL username character.
Definition parser.hpp:2978
Test for URL.
Definition parser.hpp:3431
Test for HTTP agent.
Definition parser.hpp:6764
Test for HTTP any type.
Definition parser.hpp:5907
Test for HTTP asterisk.
Definition parser.hpp:6535
Test for HTTP cookie parameter (RFC2109)
Definition parser.hpp:6630
Test for HTTP cookie (RFC2109)
Definition parser.hpp:6686
std::list< http_cookie_parameter > params
List of cookie parameters.
Definition parser.hpp:6698
http_token name
Cookie name.
Definition parser.hpp:6696
http_value value
Cookie value.
Definition parser.hpp:6697
Test for HTTP language (RFC1766)
Definition parser.hpp:6403
Test for HTTP line break (RFC2616: CRLF | LF)
Definition parser.hpp:5589
Test for HTTP parameter (RFC2616: parameter)
Definition parser.hpp:5855
http_token name
Parameter name.
Definition parser.hpp:5864
http_value value
Parameter value.
Definition parser.hpp:5865
Test for HTTP protocol.
Definition parser.hpp:6839
uint16_t version
HTTP protocol version: 0x100 = 1.0, 0x101 = 1.1...
Definition parser.hpp:6861
Test for HTTP quoted string (RFC2616: quoted-string)
Definition parser.hpp:5748
stdex::interval< size_t > content
String content (without quotes)
Definition parser.hpp:5757
Test for HTTP request.
Definition parser.hpp:6940
Test for HTTP space (RFC2616: LWS)
Definition parser.hpp:5625
Test for HTTP text character (RFC2616: TEXT)
Definition parser.hpp:5661
Test for HTTP token (RFC2616: token - tolerates non-ASCII)
Definition parser.hpp:5694
Test for HTTP URL parameter.
Definition parser.hpp:6228
Test for HTTP URL path segment.
Definition parser.hpp:6140
Test for HTTP URL path segment.
Definition parser.hpp:6173
std::vector< http_url_path_segment > segments
Path segments.
Definition parser.hpp:6181
Test for HTTP URL port.
Definition parser.hpp:6084
Test for HTTP URL server.
Definition parser.hpp:6047
Test for HTTP URL.
Definition parser.hpp:6305
Collection of HTTP values.
Definition parser.hpp:7176
Test for HTTP value (RFC2616: value)
Definition parser.hpp:5811
http_quoted_string string
Value when matched as quoted string.
Definition parser.hpp:5820
http_token token
Value when matched as token.
Definition parser.hpp:5821
Test for HTTP weight factor.
Definition parser.hpp:6466
float value
Calculated value of the weight factor.
Definition parser.hpp:6479
Test for HTTP weighted value.
Definition parser.hpp:6558
Base template for collection-holding parsers.
Definition parser.hpp:985
Test for any SGML code point.
Definition parser.hpp:268
Test for any SGML code point from a given string of SGML code points.
Definition parser.hpp:791
Test for specific SGML code point.
Definition parser.hpp:356
Test for valid DNS domain SGML character.
Definition parser.hpp:2850
Test for valid IPv6 address scope ID SGML character.
Definition parser.hpp:2540
Test for any SGML punctuation code point.
Definition parser.hpp:521
Test for any SGML space code point.
Definition parser.hpp:443
Test for any SGML space or punctuation code point.
Definition parser.hpp:598
Test for SGML given string.
Definition parser.hpp:881
Test for valid URL password SGML character.
Definition parser.hpp:3132
Test for valid URL path SGML character.
Definition parser.hpp:3238
Test for valid URL username SGML character.
Definition parser.hpp:3030
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
void invalidate()
Invalidates interval.
Definition interval.hpp:59
T start
interval start
Definition interval.hpp:19
Tag attribute.
Definition parser.hpp:8043
stdex::interval< size_t > name
attribute name position in source
Definition parser.hpp:8044
stdex::interval< size_t > value
attribute value position in source
Definition parser.hpp:8045
Definition parser.hpp:7202