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"
40#pragma GCC diagnostic ignored "-Wunused-parameter"
43#define ENUM_FLAG_OPERATOR(T,X) \
44inline 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)); } \
45inline 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); } \
46inline 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)); } \
47inline T& operator X= (T& lhs, const T rhs) { return lhs = lhs X rhs; } \
48inline T& operator X= (T& lhs, const std::underlying_type_t<T> rhs) { return lhs = lhs X rhs; }
49#define ENUM_FLAGS(T, type) \
51inline T operator ~ (T t) { return (T) (~static_cast<std::underlying_type_t <T>>(t)); } \
52ENUM_FLAG_OPERATOR(T,|) \
53ENUM_FLAG_OPERATOR(T,^) \
54ENUM_FLAG_OPERATOR(T,&) \
58#elif defined(__APPLE__)
59#define s6_words __u6_addr.__u6_addr16
61#define s6_words s6_addr16
71 constexpr int match_default = 0;
72 constexpr int match_case_insensitive = 0x1;
73 constexpr int match_multiline = 0x2;
86 _In_reads_or_z_opt_(end)
const T* text,
87 _In_ size_t start = 0,
91 for (
size_t i = start; i < end && text[i]; i++)
92 if (match(text, i, end,
flags))
98 _In_reads_or_z_opt_(end)
const T* text,
99 _In_ size_t start = 0,
103 return do_match(text, start, end,
flags);
107 _In_ const std::basic_string_view<T, std::char_traits<T>> text,
108 _In_ size_t start = 0,
112 return match(text.data(), start, std::min<size_t>(end, text.size()),
flags);
115 virtual void invalidate()
123 virtual bool do_match(
124 _In_reads_or_z_opt_(end)
const T* text,
125 _In_ size_t start = 0,
132 if (text[start] ==
'&') {
134 const auto&
ctype = std::use_facet<std::ctype<T>>(m_locale);
143 if (
n >= 2 && text[start + 1] ==
'#') {
146 if (text[start + 2] ==
'x' || text[start + 2] ==
'X')
147 unicode =
static_cast<utf32_t
>(strtou32(text + start + 3,
n - 2,
nullptr, 16));
149 unicode =
static_cast<utf32_t
>(strtou32(text + start + 2,
n - 1,
nullptr, 10));
156 ucs4_to_surrogate_pair(buf,
unicode);
180 buf[0] = text[start];
187 std::locale m_locale;
190 using parser = basic_parser<char>;
191 using wparser = basic_parser<wchar_t>;
193 using tparser = wparser;
195 using tparser = parser;
197 using sgml_parser = basic_parser<char>;
206 virtual bool do_match(
207 _In_reads_or_z_opt_(end)
const T* text,
208 _In_ size_t start = 0,
212 _Assume_(text || start >= end);
213 if (start < end && text[start]) {
214 this->interval.
start = this->interval.
end = start;
241 virtual bool do_match(
242 _In_reads_or_z_opt_(end)
const T* text,
243 _In_ size_t start = 0,
247 _Assume_(text || start >= end);
248 if (start < end && text[start]) {
249 this->interval.
end = (this->interval.
start = start) + 1;
274 virtual bool do_match(
275 _In_reads_or_z_(end)
const char* text,
276 _In_ size_t start = 0,
280 _Assume_(text || start >= end);
281 if (start < end && text[start]) {
282 if (text[start] ==
'&') {
284 const auto&
ctype = std::use_facet<std::ctype<char>>(m_locale);
285 for (this->interval.
end = start + 1; this->interval.
end < end && text[this->interval.
end]; this->interval.
end++)
286 if (text[this->interval.
end] ==
';') {
287 this->interval.
end++;
288 this->interval.
start = start;
295 this->interval.
end = (this->interval.
start = start) + 1;
317 virtual bool do_match(
318 _In_reads_or_z_opt_(end)
const T* text,
319 _In_ size_t start = 0,
323 _Assume_(text || start >= end);
324 if (start < end && text[start]) {
326 if (
flags & match_case_insensitive) {
327 const auto&
ctype = std::use_facet<std::ctype<T>>(this->m_locale);
328 r =
ctype.tolower(text[start]) ==
ctype.tolower(m_chr);
331 r = text[start] == m_chr;
332 if ((
r && !m_invert) || (!
r && m_invert)) {
333 this->interval.
end = (this->interval.
start = start) + 1;
370 virtual bool do_match(
371 _In_reads_or_z_(end)
const char* text,
372 _In_ size_t start = 0,
376 _Assume_(text || start >= end);
377 if (start < end && text[start]) {
380 bool r = ((
flags & match_case_insensitive) ?
381 stdex::strnicmp(
chr, stdex::strlen(
chr), m_chr.data(), m_chr.size(), m_locale) :
382 stdex::strncmp(
chr, stdex::strlen(
chr), m_chr.data(), m_chr.size())) == 0;
383 if ((
r && !m_invert) || (!
r && m_invert)) {
384 this->interval.
start = start;
409 virtual bool do_match(
410 _In_reads_or_z_opt_(end)
const T* text,
411 _In_ size_t start = 0,
415 _Assume_(text || start >= end);
416 if (start < end && text[start]) {
418 ((
flags & match_multiline) || !stdex::islbreak(text[start])) &&
419 std::use_facet<std::ctype<T>>(this->m_locale).is(std::ctype_base::space, text[start]);
420 if ((
r && !m_invert) || (!
r && m_invert)) {
421 this->interval.
end = (this->interval.
start = start) + 1;
451 virtual bool do_match(
452 _In_reads_or_z_(end)
const char* text,
453 _In_ size_t start = 0,
457 _Assume_(text || start >= end);
458 if (start < end && text[start]) {
464 std::use_facet<std::ctype<wchar_t>>(m_locale).scan_not(std::ctype_base::space,
chr,
chr_end) ==
chr_end;
465 if ((
r && !m_invert) || (!
r && m_invert)) {
466 this->interval.
start = start;
489 virtual bool do_match(
490 _In_reads_or_z_opt_(end)
const T* text,
491 _In_ size_t start = 0,
495 _Assume_(text || start >= end);
496 if (start < end && text[start]) {
497 bool r = std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::punct, text[start]);
498 if ((
r && !m_invert) || (!
r && m_invert)) {
499 this->interval.
end = (this->interval.
start = start) + 1;
529 virtual bool do_match(
530 _In_reads_or_z_(end)
const char* text,
531 _In_ size_t start = 0,
535 _Assume_(text || start >= end);
536 if (start < end && text[start]) {
541 if ((
r && !m_invert) || (!
r && m_invert)) {
542 this->interval.
start = start;
564 virtual bool do_match(
565 _In_reads_or_z_opt_(end)
const T* text,
566 _In_ size_t start = 0,
570 _Assume_(text || start >= end);
571 if (start < end && text[start]) {
573 ((
flags & match_multiline) || !stdex::islbreak(text[start])) &&
574 std::use_facet<std::ctype<T>>(this->m_locale).is(std::ctype_base::space | std::ctype_base::punct, text[start]);
575 if ((
r && !m_invert) || (!
r && m_invert)) {
576 this->interval.
end = (this->interval.
start = start) + 1;
606 virtual bool do_match(
607 _In_reads_or_z_(end)
const char* text,
608 _In_ size_t start = 0,
612 _Assume_(text || start >= end);
613 if (start < end && text[start]) {
619 std::use_facet<std::ctype<wchar_t>>(m_locale).scan_not(std::ctype_base::space | std::ctype_base::punct,
chr,
chr_end) ==
chr_end;
620 if ((
r && !m_invert) || (!
r && m_invert)) {
621 this->interval.
start = start;
640 virtual bool do_match(
641 _In_reads_or_z_opt_(end)
const T* text,
642 _In_ size_t start = 0,
646 _Assume_(text || !end);
647 _Assume_(text || start >= end);
648 bool r = start == 0 || (start <= end && stdex::islbreak(text[start - 1]));
649 if ((
r && !m_invert) || (!
r && m_invert)) {
650 this->interval.
end = this->interval.
start = start;
679 virtual bool do_match(
680 _In_reads_or_z_opt_(end)
const T* text,
681 _In_ size_t start = 0,
685 _Assume_(text || start >= end);
686 bool r = start >= end || !text[start] || stdex::islbreak(text[start]);
687 if ((
r && !m_invert) || (!
r && m_invert)) {
688 this->interval.
end = this->interval.
start = start;
717 virtual void invalidate()
726 virtual bool do_match(
727 _In_reads_or_z_opt_(end)
const T* text,
728 _In_ size_t start = 0,
743 _In_reads_or_z_(
count)
const T* set,
746 _In_ const std::locale&
locale = std::locale()) :
750 m_set.assign(set, set + stdex::strnlen(set,
count));
754 virtual bool do_match(
755 _In_reads_or_z_opt_(end)
const T* text,
756 _In_ size_t start = 0,
760 _Assume_(text || start >= end);
761 if (start < end && text[start]) {
762 const T* set = m_set.data();
763 size_t r = (
flags & match_case_insensitive) ?
764 stdex::strnichr(set, m_set.size(), text[start], this->m_locale) :
765 stdex::strnchr(set, m_set.size(), text[start]);
766 if ((
r != stdex::npos && !this->m_invert) || (
r == stdex::npos && this->m_invert)) {
767 this->hit_offset =
r;
768 this->interval.
end = (this->interval.
start = start) + 1;
777 std::basic_string<T> m_set;
798 m_set = sgml2str(set,
count);
802 virtual bool do_match(
803 _In_reads_or_z_(end)
const char* text,
804 _In_ size_t start = 0,
808 _Assume_(text || start >= end);
809 if (start < end && text[start]) {
812 const wchar_t* set = m_set.data();
813 size_t r = (
flags & match_case_insensitive) ?
814 stdex::strnistr(set, m_set.size(),
chr, m_locale) :
815 stdex::strnstr(set, m_set.size(),
chr);
816 if ((
r != stdex::npos && !m_invert) || (
r == stdex::npos && m_invert)) {
818 this->interval.
start = start;
838 _In_reads_or_z_(
count)
const T*
str,
840 _In_ const std::locale&
locale = std::locale()) :
846 virtual bool do_match(
847 _In_reads_or_z_opt_(end)
const T* text,
848 _In_ size_t start = 0,
852 _Assume_(text || start >= end);
855 n = std::min<size_t>(end - start,
m);
856 bool r = ((
flags & match_case_insensitive) ?
857 stdex::strnicmp(text + start,
n, m_str.data(),
m, this->m_locale) :
858 stdex::strncmp(text + start,
n, m_str.data(),
m)) == 0;
860 this->interval.
end = (this->interval.
start = start) +
n;
867 std::basic_string<T> m_str;
890 virtual bool do_match(
891 _In_reads_or_z_(end)
const char* text,
892 _In_ size_t start = 0,
896 _Assume_(text || start >= end);
897 const wchar_t*
str = m_str.data();
899 const auto&
ctype = std::use_facet<std::ctype<wchar_t>>(m_locale);
900 for (this->interval.
end = start;;) {
902 this->interval.
start = start;
940 virtual bool do_match(
941 _In_reads_or_z_opt_(end)
const T* text,
942 _In_ size_t start = 0,
946 _Assume_(text || start >= end);
947 this->interval.
start = this->interval.
end = start;
948 for (
size_t i = 0; ; i++) {
960 this->interval.
end =
m_el->interval.end;
966 std::shared_ptr<basic_parser<T>>
m_el;
994 _In_ const std::locale&
locale = std::locale()) :
998 m_collection.reserve(
count);
999 for (
size_t i = 0; i <
count; i++)
1000 m_collection.push_back(
el[i]);
1005 _In_ const std::locale&
locale = std::locale()) :
1010 virtual void invalidate()
1012 for (
auto&
el : m_collection)
1018 std::vector<std::shared_ptr<basic_parser<T>>> m_collection;
1031 _In_ const std::locale&
locale = std::locale()) :
1037 _In_ const std::locale&
locale = std::locale()) :
1042 virtual bool do_match(
1043 _In_reads_or_z_opt_(end)
const T* text,
1044 _In_ size_t start = 0,
1048 _Assume_(text || start >= end);
1049 this->interval.
end = start;
1050 for (
auto i = this->m_collection.begin(); i != this->m_collection.end(); ++i) {
1052 for (++i; i != this->m_collection.end(); ++i)
1057 this->interval.
end = (*i)->interval.end;
1059 this->interval.
start = start;
1089 _In_ const std::locale&
locale = std::locale()) :
1096 _In_ const std::locale&
locale = std::locale()) :
1101 virtual void invalidate()
1110 virtual bool do_match(
1111 _In_reads_or_z_opt_(end)
const T* text,
1112 _In_ size_t start = 0,
1116 _Assume_(text || start >= end);
1118 for (
auto i = this->m_collection.begin(); i != this->m_collection.end(); ++i, ++hit_offset) {
1119 if ((*i)->match(text, start, end,
flags)) {
1121 for (++i; i != this->m_collection.end(); ++i)
1144 template <
class T,
class T_parser = basic_
string<T>>
1151 _In_ const std::locale&
locale = std::locale()) :
1185 this->m_collection.reserve(
n);
1198 this->m_collection.push_back(std::move(std::make_shared<T_parser>(
str,
SIZE_MAX,
this->m_locale)));
1199 (p =
va_arg(params,
const T*)) !=
nullptr;
1200 this->m_collection.push_back(std::move(std::make_shared<T_parser>(p,
SIZE_MAX, this->m_locale))));
1223 _In_ const std::locale&
locale = std::locale()) :
1229 _In_ const std::locale&
locale = std::locale()) :
1234 virtual bool do_match(
1235 _In_reads_or_z_opt_(end)
const T* text,
1236 _In_ size_t start = 0,
1240 _Assume_(text || start >= end);
1241 for (
auto&
el : this->m_collection)
1243 if (match_recursively(text, start, end,
flags)) {
1244 this->interval.
start = start;
1251 bool match_recursively(
1252 _In_reads_or_z_opt_(end)
const T* text,
1253 _In_ size_t start = 0,
1258 for (
auto&
el : this->m_collection) {
1262 if (
el->match(text, start, end,
flags)) {
1273 this->interval.
end = start;
1301 virtual void invalidate()
1329 _In_ const std::locale&
locale = std::locale()) :
1344 virtual bool do_match(
1345 _In_reads_or_z_opt_(end)
const T* text,
1346 _In_ size_t start = 0,
1350 _Assume_(text || start >= end);
1351 for (this->interval.
end = start,
this->value = 0; this->interval.
end < end && text[this->interval.
end];) {
1367 this->interval.
start = start;
1374 std::shared_ptr<basic_parser<T>>
1406 _In_ const std::locale&
locale = std::locale()) :
1411 m_separator(separator)
1414 virtual void invalidate()
1425 virtual bool do_match(
1426 _In_reads_or_z_opt_(end)
const T* text,
1427 _In_ size_t start = 0,
1431 _Assume_(text || start >= end);
1432 if (m_digits->match(text, start, end,
flags)) {
1434 this->
value = m_digits->value;
1437 this->interval.
start = start;
1438 this->interval.
end = m_digits->interval.end;
1439 if (m_digits->interval.size() <= 3) {
1443 (hit_offset ==
SIZE_MAX || hit_offset == m_separator->hit_offset) &&
1444 m_digits->match(text, m_separator->interval.end, end,
flags) &&
1445 m_digits->interval.size() == 3)
1448 this->
value = this->
value * 1000 + m_digits->value;
1451 this->interval.
end = m_digits->interval.end;
1452 hit_offset = m_separator->hit_offset;
1463 std::shared_ptr<basic_integer10<T>> m_digits;
1464 std::shared_ptr<basic_set<T>> m_separator;
1467 using integer10ts = basic_integer10ts<char>;
1468 using winteger10ts = basic_integer10ts<wchar_t>;
1470 using tinteger10ts = winteger10ts;
1472 using tinteger10ts = integer10ts;
1474 using sgml_integer10ts = basic_integer10ts<char>;
1500 _In_ const std::locale&
locale = std::locale()) :
1521 virtual bool do_match(
1522 _In_reads_or_z_opt_(end)
const T* text,
1523 _In_ size_t start = 0,
1527 _Assume_(text || start >= end);
1528 for (this->interval.
end = start,
this->value = 0; this->interval.
end < end && text[this->interval.
end];) {
1540 else if (m_digit_10->match(text,
this->
interval.
end, end,
flags)) {
dig = 10; this->interval.
end = m_digit_10->interval.end; }
1541 else if (m_digit_11->match(text,
this->
interval.
end, end,
flags)) {
dig = 11; this->interval.
end = m_digit_11->interval.end; }
1542 else if (m_digit_12->match(text,
this->
interval.
end, end,
flags)) {
dig = 12; this->interval.
end = m_digit_12->interval.end; }
1543 else if (m_digit_13->match(text,
this->
interval.
end, end,
flags)) {
dig = 13; this->interval.
end = m_digit_13->interval.end; }
1544 else if (m_digit_14->match(text,
this->
interval.
end, end,
flags)) {
dig = 14; this->interval.
end = m_digit_14->interval.end; }
1545 else if (m_digit_15->match(text,
this->
interval.
end, end,
flags)) {
dig = 15; this->interval.
end = m_digit_15->interval.end; }
1550 this->interval.
start = start;
1557 std::shared_ptr<basic_parser<T>>
1602 _In_ const std::locale&
locale = std::locale()) :
1616 virtual bool do_match(
1617 _In_reads_or_z_opt_(end)
const T* text,
1618 _In_ size_t start = 0,
1622 _Assume_(text || start >= end);
1632 else if (m_digit_100 && m_digit_100->match(text,
this->
interval.
end, end,
flags)) {
dig[0] = 100;
end2 = m_digit_100->interval.end; }
1633 else if (m_digit_500 && m_digit_500->match(text,
this->
interval.
end, end,
flags)) {
dig[0] = 500;
end2 = m_digit_500->interval.end; }
1634 else if (m_digit_1000 && m_digit_1000->match(text,
this->
interval.
end, end,
flags)) {
dig[0] = 1000;
end2 = m_digit_1000->interval.end; }
1635 else if (m_digit_5000 && m_digit_5000->match(text,
this->
interval.
end, end,
flags)) {
dig[0] = 5000;
end2 = m_digit_5000->interval.end; }
1636 else if (m_digit_10000 && m_digit_10000->match(text,
this->
interval.
end, end,
flags)) {
dig[0] = 10000;
end2 = m_digit_10000->interval.end; }
1648 this->
value += dig[0];
1651 (
dig[1] == 1 && (
dig[0] == 5 ||
dig[0] == 10)) ||
1652 (
dig[1] == 10 && (
dig[0] == 50 ||
dig[0] == 100)) ||
1653 (
dig[1] == 100 && (
dig[0] == 500 ||
dig[0] == 1000)) ||
1654 (
dig[1] == 1000 && (
dig[0] == 5000 ||
dig[0] == 10000)))
1661 this->
value -= dig[1];
1665 this->
value += dig[0];
1673 this->interval.
start = start;
1680 std::shared_ptr<basic_parser<T>>
1712 _In_ const std::locale&
locale = std::locale()) :
1719 virtual void invalidate()
1721 numerator->invalidate();
1722 fraction_line->invalidate();
1723 denominator->invalidate();
1727 std::shared_ptr<basic_parser<T>> numerator;
1728 std::shared_ptr<basic_parser<T>> fraction_line;
1729 std::shared_ptr<basic_parser<T>> denominator;
1732 virtual bool do_match(
1733 _In_reads_or_z_opt_(end)
const T* text,
1734 _In_ size_t start = 0,
1738 _Assume_(text || start >= end);
1739 if (numerator->match(text, start, end,
flags) &&
1740 fraction_line->match(text, numerator->interval.end, end,
flags) &&
1741 denominator->match(text, fraction_line->interval.end, end,
flags))
1743 this->interval.
start = start;
1744 this->interval.
end = denominator->interval.end;
1747 numerator->invalidate();
1748 fraction_line->invalidate();
1749 denominator->invalidate();
1776 _In_ const std::locale&
locale = std::locale()) :
1784 virtual void invalidate()
1787 separator->invalidate();
1788 guest->invalidate();
1792 std::shared_ptr<basic_parser<T>> home;
1793 std::shared_ptr<basic_parser<T>> separator;
1794 std::shared_ptr<basic_parser<T>> guest;
1797 virtual bool do_match(
1798 _In_reads_or_z_opt_(end)
const T* text,
1799 _In_ size_t start = 0,
1803 _Assume_(text || start >= end);
1804 this->interval.
end = start;
1809 this->interval.
end = home->interval.end;
1813 for (; m_space->match(text, this->interval.
end, end,
space_match_flags); this->interval.
end = m_space->interval.end);
1816 this->interval.
end = separator->interval.end;
1820 for (; m_space->match(text, this->interval.
end, end,
space_match_flags); this->interval.
end = m_space->interval.end);
1823 this->interval.
end = guest->interval.end;
1827 this->interval.
start = start;
1832 separator->invalidate();
1833 guest->invalidate();
1838 std::shared_ptr<basic_parser<T>> m_space;
1862 _In_ const std::locale&
locale = std::locale()) :
1870 virtual void invalidate()
1885 virtual bool do_match(
1886 _In_reads_or_z_opt_(end)
const T* text,
1887 _In_ size_t start = 0,
1891 _Assume_(text || start >= end);
1892 this->interval.
end = start;
1914 this->interval.
start = start;
1915 this->interval.
end =
number->interval.end;
1927 using signed_numeral = basic_signed_numeral<char>;
1928 using wsigned_numeral = basic_signed_numeral<wchar_t>;
1930 using tsigned_numeral = wsigned_numeral;
1932 using tsigned_numeral = signed_numeral;
1934 using sgml_signed_numeral = basic_signed_numeral<char>;
1950 _In_ const std::locale&
locale = std::locale()) :
1960 virtual void invalidate()
1977 virtual bool do_match(
1978 _In_reads_or_z_opt_(end)
const T* text,
1979 _In_ size_t start = 0,
1983 _Assume_(text || start >= end);
1984 this->interval.
end = start;
2012 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);
2014 this->interval.
start = start;
2019 this->interval.
start = start;
2027 this->interval.
start = start;
2035 this->interval.
start = start;
2049 std::shared_ptr<basic_parser<T>> m_space;
2052 using mixed_numeral = basic_mixed_numeral<char>;
2053 using wmixed_numeral = basic_mixed_numeral<wchar_t>;
2055 using tmixed_numeral = wmixed_numeral;
2057 using tmixed_numeral = mixed_numeral;
2059 using sgml_mixed_numeral = basic_mixed_numeral<char>;
2079 _In_ const std::locale&
locale = std::locale()) :
2091 value(std::numeric_limits<double>::quiet_NaN())
2094 virtual void invalidate()
2106 value = std::numeric_limits<double>::quiet_NaN();
2123 virtual bool do_match(
2124 _In_reads_or_z_opt_(end)
const T* text,
2125 _In_ size_t start = 0,
2129 _Assume_(text || start >= end);
2130 this->interval.
end = start;
2164 if (
integer->interval.empty() &&
2216 this->interval.
start = start;
2221 using scientific_numeral = basic_scientific_numeral<char>;
2222 using wscientific_numeral = basic_scientific_numeral<wchar_t>;
2224 using tscientific_numeral = wscientific_numeral;
2226 using tscientific_numeral = scientific_numeral;
2228 using sgml_scientific_numeral = basic_scientific_numeral<char>;
2245 _In_ const std::locale&
locale = std::locale()) :
2256 virtual void invalidate()
2277 virtual bool do_match(
2278 _In_reads_or_z_opt_(end)
const T* text,
2279 _In_ size_t start = 0,
2283 _Assume_(text || start >= end);
2284 this->interval.
end = start;
2330 if (
integer->interval.empty() &&
2345 this->interval.
start = start;
2350 using monetary_numeral = basic_monetary_numeral<char>;
2351 using wmonetary_numeral = basic_monetary_numeral<wchar_t>;
2353 using tmonetary_numeral = wmonetary_numeral;
2355 using tmonetary_numeral = monetary_numeral;
2357 using sgml_monetary_numeral = basic_monetary_numeral<char>;
2378 _In_ const std::locale&
locale = std::locale()) :
2390 m_separator(separator)
2395 virtual void invalidate()
2413 virtual bool do_match(
2414 _In_reads_or_z_opt_(end)
const T* text,
2415 _In_ size_t start = 0,
2419 _Assume_(text || start >= end);
2420 this->interval.
end = start;
2424 for (i = 0; i < 4; i++) {
2427 this->interval.
end = m_separator->interval.end;
2435 for (
x = 0; this->interval.
end < end && text[this->interval.
end];) {
2438 else if (m_digit_1->match(text, this->interval.end, end, flags)) { dig = 1; digit_end = m_digit_1->interval.end; }
2439 else if (m_digit_2->match(text, this->interval.end, end, flags)) { dig = 2; digit_end = m_digit_2->interval.end; }
2440 else if (m_digit_3->match(text, this->interval.end, end, flags)) { dig = 3; digit_end = m_digit_3->interval.end; }
2441 else if (m_digit_4->match(text, this->interval.end, end, flags)) { dig = 4; digit_end = m_digit_4->interval.end; }
2442 else if (m_digit_5->match(text, this->interval.end, end, flags)) { dig = 5; digit_end = m_digit_5->interval.end; }
2443 else if (m_digit_6->match(text, this->interval.end, end, flags)) { dig = 6; digit_end = m_digit_6->interval.end; }
2444 else if (m_digit_7->match(text, this->interval.end, end, flags)) { dig = 7; digit_end = m_digit_7->interval.end; }
2445 else if (m_digit_8->match(text, this->interval.end, end, flags)) { dig = 8; digit_end = m_digit_8->interval.end; }
2446 else if (m_digit_9->match(text, this->interval.end, end, flags)) { dig = 9; digit_end = m_digit_9->interval.end; }
2448 size_t x_n = x * 10 + dig;
2451 this->interval.
end = digit_end;
2460 value.s_addr = (
value.s_addr << 8) | (uint8_t)x;
2465 HE2BE(
reinterpret_cast<uint32_t&
>(
value.s_addr));
2466 this->interval.
start = start;
2474 std::shared_ptr<basic_parser<T>>
2485 std::shared_ptr<basic_parser<T>> m_separator;
2488 using ipv4_address = basic_ipv4_address<char>;
2489 using wipv4_address = basic_ipv4_address<wchar_t>;
2491 using tipv4_address = wipv4_address;
2493 using tipv4_address = ipv4_address;
2495 using sgml_ipv4_address = basic_ipv4_address<char>;
2507 virtual bool do_match(
2508 _In_reads_or_z_opt_(end)
const T* text,
2509 _In_ size_t start = 0,
2513 _Assume_(text || start >= end);
2514 if (start < end && text[start]) {
2515 if (text[start] ==
'-' ||
2516 text[start] ==
'_' ||
2517 text[start] ==
':' ||
2518 std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::alnum, text[start]))
2520 this->interval.
end = (this->interval.
start = start) + 1;
2546 virtual bool do_match(
2547 _In_reads_or_z_(end)
const char* text,
2548 _In_ size_t start = 0,
2552 _Assume_(text || start >= end);
2553 if (start < end && text[start]) {
2557 if (((
chr[0] ==
L'-' ||
2559 chr[0] ==
L':') &&
chr[1] == 0) ||
2562 this->interval.
start = start;
2598 _In_ const std::locale&
locale = std::locale()) :
2616 m_separator(separator),
2623 virtual void invalidate()
2651 virtual bool do_match(
2652 _In_reads_or_z_opt_(end)
const T* text,
2653 _In_ size_t start = 0,
2657 _Assume_(text || start >= end);
2658 this->interval.
end = start;
2662 for (i = 0; i < 8; i++) {
2667 this->interval.
end = m_separator->interval.end;
2674 this->interval.
end = m_separator->interval.end;
2693 for (
x = 0; this->interval.
end < end && text[this->interval.
end];) {
2713 if (
x_n <= 0xffff) {
2729 HE2BE(
reinterpret_cast<uint16_t&
>(this->value.s6_words[i]));
2736 this->value.s6_words[--
j] = this->value.s6_words[--
k];
2740 this->value.s6_words[--
j] = 0;
2748 if (m_scope_id_separator && m_scope_id_separator->match(text,
this->
interval.
end, end,
flags) &&
2754 this->interval.
start = start;
2762 std::shared_ptr<basic_parser<T>>
2779 std::shared_ptr<basic_parser<T>> m_separator, m_scope_id_separator;
2782 using ipv6_address = basic_ipv6_address<char>;
2783 using wipv6_address = basic_ipv6_address<wchar_t>;
2785 using tipv6_address = wipv6_address;
2787 using tipv6_address = ipv6_address;
2789 using sgml_ipv6_address = basic_ipv6_address<char>;
2800 _In_ const std::locale&
locale = std::locale()) :
2809 virtual bool do_match(
2810 _In_reads_or_z_opt_(end)
const T* text,
2811 _In_ size_t start = 0,
2815 _Assume_(text || start >= end);
2816 if (start < end && text[start]) {
2817 if ((
'A' <= text[start] && text[start] <=
'Z') ||
2818 (
'a' <= text[start] && text[start] <=
'z') ||
2819 (
'0' <= text[start] && text[start] <=
'9'))
2821 else if (text[start] ==
'-')
2823 else if (m_allow_idn && std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::alnum, text[start]))
2829 this->interval.
end = (this->interval.
start = start) + 1;
2839 using dns_domain_char = basic_dns_domain_char<char>;
2840 using wdns_domain_char = basic_dns_domain_char<wchar_t>;
2842 using tdns_domain_char = wdns_domain_char;
2844 using tdns_domain_char = dns_domain_char;
2855 _In_ const std::locale&
locale = std::locale()) :
2860 virtual bool do_match(
2861 _In_reads_or_z_(end)
const char* text,
2862 _In_ size_t start = 0,
2866 _Assume_(text || start >= end);
2867 if (start < end && text[start]) {
2871 if (((
'A' <=
chr[0] &&
chr[0] <=
'Z') ||
2872 (
'a' <=
chr[0] &&
chr[0] <=
'z') ||
2873 (
'0' <=
chr[0] &&
chr[0] <=
'9')) &&
chr[1] == 0)
2875 else if (
chr[0] ==
'-' &&
chr[1] == 0)
2877 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)
2883 this->interval.
start = start;
2902 _In_ const std::locale&
locale = std::locale()) :
2906 m_separator(separator)
2910 virtual bool do_match(
2911 _In_reads_or_z_opt_(end)
const T* text,
2912 _In_ size_t start = 0,
2916 _Assume_(text || start >= end);
2917 size_t i = start,
count;
2919 if (m_domain_char->match(text, i, end,
flags) &&
2920 m_domain_char->allow_on_edge)
2923 this->interval.
end = i = m_domain_char->interval.end;
2924 while (i < end && text[i]) {
2925 if (m_domain_char->allow_on_edge &&
2926 m_separator->match(text, i, end,
flags))
2930 this->interval.
end = i = m_separator->interval.end;
2932 this->interval.
end = i;
2933 i = m_separator->interval.end;
2937 if (m_domain_char->match(text, i, end,
flags)) {
2938 if (m_domain_char->allow_on_edge)
2939 this->interval.
end = i = m_domain_char->interval.end;
2941 i = m_domain_char->interval.end;
2944 this->interval.
start = start;
2953 this->interval.
start = start;
2961 std::shared_ptr<basic_dns_domain_char<T>> m_domain_char;
2962 std::shared_ptr<basic_parser<T>> m_separator;
2984 virtual bool do_match(
2985 _In_reads_or_z_opt_(end)
const T* text,
2986 _In_ size_t start = 0,
2990 _Assume_(text || start >= end);
2991 if (start < end && text[start]) {
2992 if (text[start] ==
'-' ||
2993 text[start] ==
'.' ||
2994 text[start] ==
'_' ||
2995 text[start] ==
'~' ||
2996 text[start] ==
'%' ||
2997 text[start] ==
'!' ||
2998 text[start] ==
'$' ||
2999 text[start] ==
'&' ||
3000 text[start] ==
'\'' ||
3003 text[start] ==
'*' ||
3004 text[start] ==
'+' ||
3005 text[start] ==
',' ||
3006 text[start] ==
';' ||
3007 text[start] ==
'=' ||
3008 std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::alnum, text[start]))
3010 this->interval.
end = (this->interval.
start = start) + 1;
3036 virtual bool do_match(
3037 _In_reads_or_z_(end)
const char* text,
3038 _In_ size_t start = 0,
3042 _Assume_(text || start >= end);
3043 if (start < end && text[start]) {
3047 if (((
chr[0] ==
L'-' ||
3062 chr[0] ==
L'=') &&
chr[1] == 0) ||
3065 this->interval.
start = start;
3085 virtual bool do_match(
3086 _In_reads_or_z_opt_(end)
const T* text,
3087 _In_ size_t start = 0,
3091 _Assume_(text || start >= end);
3092 if (start < end && text[start]) {
3093 if (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 text[start] ==
':' ||
3110 std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::alnum, text[start]))
3112 this->interval.
end = (this->interval.
start = start) + 1;
3138 virtual bool do_match(
3139 _In_reads_or_z_(end)
const char* text,
3140 _In_ size_t start = 0,
3144 _Assume_(text || start >= end);
3145 if (start < end && text[start]) {
3149 if (((
chr[0] ==
L'-' ||
3165 chr[0] ==
L':') &&
chr[1] == 0) ||
3168 this->interval.
start = start;
3187 virtual bool do_match(
3188 _In_reads_or_z_opt_(end)
const T* text,
3189 _In_ size_t start = 0,
3193 _Assume_(text || start >= end);
3194 if (start < end && text[start]) {
3195 if (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 text[start] ==
'#' ||
3216 std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::alnum, text[start]))
3218 this->interval.
end = (this->interval.
start = start) + 1;
3244 virtual bool do_match(
3245 _In_reads_or_z_(end)
const char* text,
3246 _In_ size_t start = 0,
3250 _Assume_(text || start >= end);
3251 if (start < end && text[start]) {
3255 if (((
chr[0] ==
L'/' ||
3275 chr[0] ==
L'#') &&
chr[1] == 0) ||
3278 this->interval.
start = start;
3298 _In_ const std::locale&
locale = std::locale()) :
3305 virtual void invalidate()
3321 virtual bool do_match(
3322 _In_reads_or_z_opt_(end)
const T* text,
3323 _In_ size_t start = 0,
3327 _Assume_(text || start >= end);
3329 this->interval.
end = start;
3340 path.
end = this->interval.
end;
3341 query.
start = this->interval.
end = m_query_start->interval.end;
3344 query.
end = this->interval.
end;
3348 query.
end = this->interval.
end;
3349 bookmark.
start = this->interval.
end = m_bookmark_start->interval.end;
3352 bookmark.
end = this->interval.
end;
3356 this->interval.
end = m_path_char->interval.end;
3358 bookmark.
end = this->interval.
end;
3362 this->interval.
start = start;
3366 this->interval.
end = m_path_char->interval.end;
3368 query.
end = this->interval.
end;
3372 this->interval.
start = start;
3376 path.
end = this->interval.
end;
3377 bookmark.
start = this->interval.
end = m_bookmark_start->interval.end;
3380 bookmark.
end = this->interval.
end;
3384 this->interval.
end = m_path_char->interval.end;
3386 bookmark.
end = this->interval.
end;
3390 this->interval.
start = start;
3394 this->interval.
end = m_path_char->interval.end;
3400 path.
end = this->interval.
end;
3401 this->interval.
start = start;
3413 std::shared_ptr<basic_parser<T>> m_path_char;
3414 std::shared_ptr<basic_parser<T>> m_query_start;
3415 std::shared_ptr<basic_parser<T>> m_bookmark_start;
3451 _In_ const std::locale&
locale = std::locale()) :
3471 virtual void invalidate()
3473 http_scheme->invalidate();
3474 ftp_scheme->invalidate();
3475 mailto_scheme->invalidate();
3476 file_scheme->invalidate();
3477 username->invalidate();
3478 password->invalidate();
3479 ipv4_host->invalidate();
3480 ipv6_host->invalidate();
3481 dns_host->invalidate();
3487 std::shared_ptr<basic_parser<T>> http_scheme;
3488 std::shared_ptr<basic_parser<T>> ftp_scheme;
3489 std::shared_ptr<basic_parser<T>> mailto_scheme;
3490 std::shared_ptr<basic_parser<T>> file_scheme;
3491 std::shared_ptr<basic_parser<T>> username;
3492 std::shared_ptr<basic_parser<T>> password;
3493 std::shared_ptr<basic_parser<T>> ipv4_host;
3494 std::shared_ptr<basic_parser<T>> ipv6_host;
3495 std::shared_ptr<basic_parser<T>> dns_host;
3496 std::shared_ptr<basic_parser<T>> port;
3497 std::shared_ptr<basic_parser<T>> path;
3500 virtual bool do_match(
3501 _In_reads_or_z_opt_(end)
const T* text,
3502 _In_ size_t start = 0,
3506 _Assume_(text || start >= end);
3508 this->interval.
end = start;
3511 m_colon->match(text, http_scheme->interval.end, end,
flags) &&
3512 m_slash->match(text, m_colon->interval.end, end,
flags) &&
3513 m_slash->match(text, m_slash->interval.end, end,
flags))
3516 this->interval.
end = m_slash->interval.end;
3517 ftp_scheme->invalidate();
3518 mailto_scheme->invalidate();
3519 file_scheme->invalidate();
3522 m_colon->match(text, ftp_scheme->interval.end, end,
flags) &&
3523 m_slash->match(text, m_colon->interval.end, end,
flags) &&
3524 m_slash->match(text, m_slash->interval.end, end,
flags))
3527 this->interval.
end = m_slash->interval.end;
3528 http_scheme->invalidate();
3529 mailto_scheme->invalidate();
3530 file_scheme->invalidate();
3533 m_colon->match(text, mailto_scheme->interval.end, end,
flags))
3536 this->interval.
end = m_colon->interval.end;
3537 http_scheme->invalidate();
3538 ftp_scheme->invalidate();
3539 file_scheme->invalidate();
3542 m_colon->match(text, file_scheme->interval.end, end,
flags) &&
3543 m_slash->match(text, m_colon->interval.end, end,
flags) &&
3544 m_slash->match(text, m_slash->interval.end, end,
flags))
3547 this->interval.
end = m_slash->interval.end;
3548 http_scheme->invalidate();
3549 ftp_scheme->invalidate();
3550 mailto_scheme->invalidate();
3554 http_scheme->invalidate();
3555 ftp_scheme->invalidate();
3556 mailto_scheme->invalidate();
3557 file_scheme->invalidate();
3560 if (ftp_scheme->interval) {
3562 if (m_colon->match(text, username->interval.end, end,
flags) &&
3563 password->match(text, m_colon->interval.end, end,
flags) &&
3564 m_at->match(text, password->interval.end, end,
flags))
3567 this->interval.
end = m_at->interval.end;
3571 this->interval.
end = m_at->interval.end;
3572 password->invalidate();
3575 username->invalidate();
3576 password->invalidate();
3580 username->invalidate();
3581 password->invalidate();
3586 this->interval.
end = ipv4_host->interval.end;
3587 ipv6_host->invalidate();
3588 dns_host->invalidate();
3592 ipv6_host->match(text, m_ip_lbracket->interval.end, end,
flags) &&
3593 m_ip_rbracket->match(text, ipv6_host->interval.end, end,
flags))
3596 this->interval.
end = m_ip_rbracket->interval.end;
3597 ipv4_host->invalidate();
3598 dns_host->invalidate();
3602 this->interval.
end = dns_host->interval.end;
3603 ipv4_host->invalidate();
3604 ipv6_host->invalidate();
3612 port->match(text, m_colon->interval.end, end,
flags))
3615 this->interval.
end = port->interval.end;
3622 this->interval.
end = path->interval.end;
3625 this->interval.
start = start;
3629 if (mailto_scheme->interval) {
3631 m_at->match(text, username->interval.end, end,
flags))
3634 this->interval.
end = m_at->interval.end;
3642 ipv4_host->match(text, m_ip_lbracket->interval.end, end,
flags) &&
3643 m_ip_rbracket->match(text, ipv4_host->interval.end, end,
flags))
3646 this->interval.
end = m_ip_rbracket->interval.end;
3647 ipv6_host->invalidate();
3648 dns_host->invalidate();
3652 ipv6_host->match(text, m_ip_lbracket->interval.end, end,
flags) &&
3653 m_ip_rbracket->match(text, ipv6_host->interval.end, end,
flags))
3656 this->interval.
end = m_ip_rbracket->interval.end;
3657 ipv4_host->invalidate();
3658 dns_host->invalidate();
3662 this->interval.
end = dns_host->interval.end;
3663 ipv4_host->invalidate();
3664 ipv6_host->invalidate();
3671 password->invalidate();
3674 this->interval.
start = start;
3678 if (file_scheme->interval) {
3681 this->interval.
end = path->interval.end;
3684 username->invalidate();
3685 password->invalidate();
3686 ipv4_host->invalidate();
3687 ipv6_host->invalidate();
3688 dns_host->invalidate();
3690 this->interval.
start = start;
3697 if (http_scheme->interval &&
3700 if (m_colon->match(text, username->interval.end, end,
flags) &&
3701 password->match(text, m_colon->interval.end, end,
flags) &&
3702 m_at->match(text, password->interval.end, end,
flags))
3705 this->interval.
end = m_at->interval.end;
3707 else if (m_at->match(text, username->interval.end, end,
flags)) {
3709 this->interval.
end = m_at->interval.end;
3710 password->invalidate();
3713 username->invalidate();
3714 password->invalidate();
3718 username->invalidate();
3719 password->invalidate();
3724 this->interval.
end = ipv4_host->interval.end;
3725 ipv6_host->invalidate();
3726 dns_host->invalidate();
3730 ipv6_host->match(text, m_ip_lbracket->interval.end, end,
flags) &&
3731 m_ip_rbracket->match(text, ipv6_host->interval.end, end,
flags))
3734 this->interval.
end = m_ip_rbracket->interval.end;
3735 ipv4_host->invalidate();
3736 dns_host->invalidate();
3740 this->interval.
end = dns_host->interval.end;
3741 ipv4_host->invalidate();
3742 ipv6_host->invalidate();
3750 port->match(text, m_colon->interval.end, end,
flags))
3753 this->interval.
end = port->interval.end;
3760 this->interval.
end = path->interval.end;
3763 this->interval.
start = start;
3767 std::shared_ptr<basic_parser<T>> m_colon;
3768 std::shared_ptr<basic_parser<T>> m_slash;
3769 std::shared_ptr<basic_parser<T>> m_at;
3770 std::shared_ptr<basic_parser<T>> m_ip_lbracket;
3771 std::shared_ptr<basic_parser<T>> m_ip_rbracket;
3798 _In_ const std::locale&
locale = std::locale()) :
3809 virtual void invalidate()
3811 username->invalidate();
3812 ipv4_host->invalidate();
3813 ipv6_host->invalidate();
3814 dns_host->invalidate();
3818 std::shared_ptr<basic_parser<T>> username;
3819 std::shared_ptr<basic_parser<T>> ipv4_host;
3820 std::shared_ptr<basic_parser<T>> ipv6_host;
3821 std::shared_ptr<basic_parser<T>> dns_host;
3824 virtual bool do_match(
3825 _In_reads_or_z_opt_(end)
const T* text,
3826 _In_ size_t start = 0,
3830 _Assume_(text || start >= end);
3832 if (username->match(text, start, end,
flags) &&
3833 m_at->match(text, username->interval.end, end,
flags))
3836 if (m_ip_lbracket->match(text, m_at->interval.end, end,
flags) &&
3837 ipv4_host->match(text, m_ip_lbracket->interval.end, end,
flags) &&
3838 m_ip_rbracket->match(text, ipv4_host->interval.end, end,
flags))
3841 this->interval.
end = m_ip_rbracket->interval.end;
3842 ipv6_host->invalidate();
3843 dns_host->invalidate();
3846 m_ip_lbracket->match(text, m_at->interval.end, end,
flags) &&
3847 ipv6_host->match(text, m_ip_lbracket->interval.end, end,
flags) &&
3848 m_ip_rbracket->match(text, ipv6_host->interval.end, end,
flags))
3851 this->interval.
end = m_ip_rbracket->interval.end;
3852 ipv4_host->invalidate();
3853 dns_host->invalidate();
3855 else if (dns_host->match(text, m_at->interval.end, end,
flags)) {
3857 this->interval.
end = dns_host->interval.end;
3858 ipv4_host->invalidate();
3859 ipv6_host->invalidate();
3863 this->interval.
start = start;
3872 std::shared_ptr<basic_parser<T>> m_at;
3873 std::shared_ptr<basic_parser<T>> m_ip_lbracket;
3874 std::shared_ptr<basic_parser<T>> m_ip_rbracket;
3899 _In_ const std::locale&
locale = std::locale()) :
3908 virtual void invalidate()
3914 mouth->invalidate();
3919 std::shared_ptr<basic_parser<T>>
apex;
3920 std::shared_ptr<basic_parser<T>>
eyes;
3921 std::shared_ptr<basic_parser<T>>
nose;
3925 virtual bool do_match(
3926 _In_reads_or_z_opt_(end)
const T* text,
3927 _In_ size_t start = 0,
3931 _Assume_(text || start >= end);
3937 mouth->invalidate();
3938 this->interval.
start = start;
3943 this->interval.
end = start;
3946 this->interval.
end =
apex->interval.end;
3954 hit_offset =
mouth->hit_offset;
3956 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);
3959 this->interval.
start = start;
3965 hit_offset =
mouth->hit_offset;
3967 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);
3971 this->interval.
start = start;
3980 mouth->invalidate();
3986 using emoticon = basic_emoticon<char>;
3987 using wemoticon = basic_emoticon<wchar_t>;
3989 using temoticon = wemoticon;
3991 using temoticon = emoticon;
3993 using sgml_emoticon = basic_emoticon<char>;
3998 enum date_format_t {
3999 date_format_none = 0,
4000 date_format_dmy = 0x1,
4001 date_format_mdy = 0x2,
4002 date_format_ymd = 0x4,
4003 date_format_ym = 0x8,
4004 date_format_my = 0x10,
4005 date_format_dm = 0x20,
4006 date_format_md = 0x40,
4023 _In_ const std::locale&
locale = std::locale()) :
4025 format(date_format_none),
4030 m_separator(separator),
4034 virtual void invalidate()
4036 if (day) day->invalidate();
4037 if (month) month->invalidate();
4038 if (year) year->invalidate();
4039 format = date_format_none;
4043 date_format_t format;
4044 std::shared_ptr<basic_integer<T>> day;
4045 std::shared_ptr<basic_integer<T>> month;
4046 std::shared_ptr<basic_integer<T>> year;
4049 virtual bool do_match(
4050 _In_reads_or_z_opt_(end)
const T* text,
4051 _In_ size_t start = 0,
4055 _Assume_(text || start >= end);
4058 if ((m_format_mask & date_format_dmy) == date_format_dmy) {
4059 if (day->match(text, start, end,
flags)) {
4060 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);
4062 size_t hit_offset = m_separator->hit_offset;
4063 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);
4065 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);
4067 m_separator->hit_offset == hit_offset)
4069 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);
4071 is_valid(day->value, month->value))
4073 this->interval.
start = start;
4074 this->interval.
end = year->interval.end;
4075 format = date_format_dmy;
4084 if ((m_format_mask & date_format_mdy) == date_format_mdy) {
4085 if (month->match(text, start, end,
flags)) {
4086 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);
4088 size_t hit_offset = m_separator->hit_offset;
4089 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);
4091 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);
4093 m_separator->hit_offset == hit_offset)
4095 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);
4097 is_valid(day->value, month->value))
4099 this->interval.
start = start;
4100 this->interval.
end = year->interval.end;
4101 format = date_format_mdy;
4110 if ((m_format_mask & date_format_ymd) == date_format_ymd) {
4111 if (year->match(text, start, end,
flags)) {
4112 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);
4114 size_t hit_offset = m_separator->hit_offset;
4115 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);
4117 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);
4119 m_separator->hit_offset == hit_offset)
4121 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);
4123 is_valid(day->value, month->value))
4125 this->interval.
start = start;
4126 this->interval.
end = day->interval.end;
4127 format = date_format_ymd;
4136 if ((m_format_mask & date_format_ym) == date_format_ym) {
4137 if (year->match(text, start, end,
flags)) {
4138 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);
4140 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);
4144 if (day) day->invalidate();
4145 this->interval.
start = start;
4146 this->interval.
end = month->interval.end;
4147 format = date_format_ym;
4154 if ((m_format_mask & date_format_my) == date_format_my) {
4155 if (month->match(text, start, end,
flags)) {
4156 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);
4158 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);
4162 if (day) day->invalidate();
4163 this->interval.
start = start;
4164 this->interval.
end = year->interval.end;
4165 format = date_format_my;
4172 if ((m_format_mask & date_format_dm) == date_format_dm) {
4173 if (day->match(text, start, end,
flags)) {
4174 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);
4176 size_t hit_offset = m_separator->hit_offset;
4177 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);
4179 is_valid(day->value, month->value))
4181 if (year) year->invalidate();
4182 this->interval.
start = start;
4183 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);
4185 m_separator->hit_offset == hit_offset)
4186 this->interval.
end = m_separator->interval.end;
4188 this->interval.
end = month->interval.end;
4189 format = date_format_dm;
4196 if ((m_format_mask & date_format_md) == date_format_md) {
4197 if (month->match(text, start, end,
flags)) {
4198 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);
4200 size_t hit_offset = m_separator->hit_offset;
4201 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);
4203 is_valid(day->value, month->value))
4205 if (year) year->invalidate();
4206 this->interval.
start = start;
4207 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);
4209 m_separator->hit_offset == hit_offset)
4210 this->interval.
end = m_separator->interval.end;
4212 this->interval.
end = day->interval.end;
4213 format = date_format_md;
4220 if (day) day->invalidate();
4221 if (month) month->invalidate();
4222 if (year) year->invalidate();
4223 format = date_format_none;
4228 static bool is_valid(
size_t day,
size_t month)
4247 return 1 <= day && day <= 31;
4249 return 1 <= day && day <= 29;
4254 return 1 <= day && day <= 30;
4261 std::shared_ptr<basic_set<T>> m_separator;
4262 std::shared_ptr<basic_parser<T>> m_space;
4288 _In_ const std::locale&
locale = std::locale()) :
4294 m_separator(separator),
4298 virtual void invalidate()
4301 minute->invalidate();
4302 if (second) second->invalidate();
4303 if (millisecond) millisecond->invalidate();
4307 std::shared_ptr<basic_integer10<T>> hour;
4308 std::shared_ptr<basic_integer10<T>> minute;
4309 std::shared_ptr<basic_integer10<T>> second;
4310 std::shared_ptr<basic_integer10<T>> millisecond;
4313 virtual bool do_match(
4314 _In_reads_or_z_opt_(end)
const T* text,
4315 _In_ size_t start = 0,
4319 _Assume_(text || start >= end);
4321 if (hour->match(text, start, end,
flags) &&
4322 m_separator->match(text, hour->interval.end, end,
flags) &&
4323 minute->match(text, m_separator->interval.end, end,
flags) &&
4327 size_t hit_offset = m_separator->hit_offset;
4328 if (m_separator->match(text, minute->interval.end, end,
flags) &&
4329 m_separator->hit_offset == hit_offset &&
4330 second && second->match(text, m_separator->interval.end, end,
flags) &&
4334 if (m_millisecond_separator && m_millisecond_separator->match(text, second->interval.end, end,
flags) &&
4335 millisecond && millisecond->match(text, m_millisecond_separator->interval.end, end,
flags) &&
4336 millisecond->value < 1000)
4339 this->interval.
end = millisecond->interval.end;
4342 if (millisecond) millisecond->invalidate();
4343 this->interval.
end = second->interval.end;
4347 if (second) second->invalidate();
4348 if (millisecond) millisecond->invalidate();
4349 this->interval.
end = minute->interval.end;
4351 this->interval.
start = start;
4356 minute->invalidate();
4357 if (second) second->invalidate();
4358 if (millisecond) millisecond->invalidate();
4363 std::shared_ptr<basic_set<T>> m_separator;
4364 std::shared_ptr<basic_parser<T>> m_millisecond_separator;
4391 _In_ const std::locale&
locale = std::locale()) :
4402 virtual void invalidate()
4404 degree->invalidate();
4405 degree_separator->invalidate();
4406 minute->invalidate();
4407 minute_separator->invalidate();
4408 if (second) second->invalidate();
4409 if (second_separator) second_separator->invalidate();
4410 if (decimal) decimal->invalidate();
4414 std::shared_ptr<basic_integer10<T>> degree;
4415 std::shared_ptr<basic_parser<T>> degree_separator;
4416 std::shared_ptr<basic_integer10<T>> minute;
4417 std::shared_ptr<basic_parser<T>> minute_separator;
4418 std::shared_ptr<basic_integer10<T>> second;
4419 std::shared_ptr<basic_parser<T>> second_separator;
4420 std::shared_ptr<basic_parser<T>> decimal;
4423 virtual bool do_match(
4424 _In_reads_or_z_opt_(end)
const T* text,
4425 _In_ size_t start = 0,
4429 _Assume_(text || start >= end);
4431 this->interval.
end = start;
4434 degree_separator->match(text, degree->interval.end, end,
flags))
4437 this->interval.
end = degree_separator->interval.end;
4440 degree->invalidate();
4441 degree_separator->invalidate();
4445 minute->value < 60 &&
4446 minute_separator->match(text, minute->interval.end, end,
flags))
4449 this->interval.
end = minute_separator->interval.end;
4452 minute->invalidate();
4453 minute_separator->invalidate();
4460 this->interval.
end = second->interval.end;
4462 this->interval.
end = second_separator->interval.end;
4464 if (second_separator) second_separator->invalidate();
4467 if (second) second->invalidate();
4468 if (second_separator) second_separator->invalidate();
4471 if (degree->interval.start < degree->interval.end ||
4472 minute->interval.start < minute->interval.end ||
4473 (second && second->interval.start < second->interval.end))
4477 this->interval.
end = decimal->interval.end;
4480 decimal->invalidate();
4481 this->interval.
start = start;
4484 if (decimal) decimal->invalidate();
4513 _In_ const std::locale&
locale = std::locale()) :
4519 m_separator(separator),
4523 virtual void invalidate()
4532 virtual bool do_match(
4533 _In_reads_or_z_opt_(end)
const T* text,
4534 _In_ size_t start = 0,
4538 _Assume_(text || start >= end);
4544 this->interval.
end = start;
4546 m_lparenthesis->invalidate();
4547 m_rparenthesis->invalidate();
4550 value.append(text + m_plus_sign->interval.start, text + m_plus_sign->interval.end);
4552 this->interval.
end = m_plus_sign->interval.end;
4556 _Assume_(text || this->interval.
end >= end);
4561 value.append(text + m_digit->interval.start, text + m_digit->interval.end);
4562 this->interval.
end = m_digit->interval.end;
4572 m_lparenthesis && !m_lparenthesis->interval &&
4573 m_rparenthesis && !m_rparenthesis->interval &&
4577 value.append(text + m_lparenthesis->interval.start, m_lparenthesis->interval.size());
4578 this->interval.
end = m_lparenthesis->interval.end;
4585 m_rparenthesis && !m_rparenthesis->interval &&
4587 m_lparenthesis->hit_offset == m_rparenthesis->hit_offset)
4590 value.append(text + m_rparenthesis->interval.start, text + m_rparenthesis->interval.end);
4591 this->interval.
end = m_rparenthesis->interval.end;
4605 this->interval.
end = m_separator->interval.end;
4614 this->interval.
end = m_space->interval.end;
4623 this->interval.
start = start;
4632 std::shared_ptr<basic_parser<T>> m_digit;
4633 std::shared_ptr<basic_parser<T>> m_plus_sign;
4634 std::shared_ptr<basic_set<T>> m_lparenthesis;
4635 std::shared_ptr<basic_set<T>> m_rparenthesis;
4636 std::shared_ptr<basic_parser<T>> m_separator;
4637 std::shared_ptr<basic_parser<T>> m_space;
4640 using phone_number = basic_phone_number<char>;
4641 using wphone_number = basic_phone_number<wchar_t>;
4643 using tphone_number = wphone_number;
4645 using tphone_number = phone_number;
4647 using sgml_phone_number = basic_phone_number<char>;
4660 _In_ const std::locale&
locale = std::locale()) :
4670 virtual void invalidate()
4685 virtual bool do_match(
4686 _In_reads_or_z_opt_(end)
const T* text,
4687 _In_ size_t start = 0,
4691 _Assume_(text || start >= end);
4692 const auto&
ctype = std::use_facet<std::ctype<T>>(this->m_locale);
4700 { {
'A',
'D' }, {}, 24 },
4701 { {
'A',
'E' }, {}, 23 },
4702 { {
'A',
'L' }, {}, 28 },
4703 { {
'A',
'O' }, {}, 25 },
4704 { {
'A',
'T' }, {}, 20 },
4705 { {
'A',
'Z' }, {}, 28 },
4706 { {
'B',
'A' }, {
'3',
'9' }, 20},
4707 { {
'B',
'E' }, {}, 16 },
4708 { {
'B',
'F' }, {}, 28 },
4709 { {
'B',
'G' }, {}, 22 },
4710 { {
'B',
'H' }, {}, 22 },
4711 { {
'B',
'I' }, {}, 27 },
4712 { {
'B',
'J' }, {}, 28 },
4713 { {
'B',
'R' }, {}, 29 },
4714 { {
'B',
'Y' }, {}, 28 },
4715 { {
'C',
'F' }, {}, 27 },
4716 { {
'C',
'G' }, {}, 27 },
4717 { {
'C',
'H' }, {}, 21 },
4718 { {
'C',
'I' }, {}, 28 },
4719 { {
'C',
'M' }, {}, 27 },
4720 { {
'C',
'R' }, {}, 22 },
4721 { {
'C',
'V' }, {}, 25 },
4722 { {
'C',
'Y' }, {}, 28 },
4723 { {
'C',
'Z' }, {}, 24 },
4724 { {
'D',
'E' }, {}, 22 },
4725 { {
'D',
'J' }, {}, 27 },
4726 { {
'D',
'K' }, {}, 18 },
4727 { {
'D',
'O' }, {}, 28 },
4728 { {
'D',
'Z' }, {}, 26 },
4729 { {
'E',
'E' }, {}, 20 },
4730 { {
'E',
'G' }, {}, 29 },
4731 { {
'E',
'S' }, {}, 24 },
4732 { {
'F',
'I' }, {}, 18 },
4733 { {
'F',
'O' }, {}, 18 },
4734 { {
'F',
'R' }, {}, 27 },
4735 { {
'G',
'A' }, {}, 27 },
4736 { {
'G',
'B' }, {}, 22 },
4737 { {
'G',
'E' }, {}, 22 },
4738 { {
'G',
'I' }, {}, 23 },
4739 { {
'G',
'L' }, {}, 18 },
4740 { {
'G',
'Q' }, {}, 27 },
4741 { {
'G',
'R' }, {}, 27 },
4742 { {
'G',
'T' }, {}, 28 },
4743 { {
'G',
'W' }, {}, 25 },
4744 { {
'H',
'N' }, {}, 28 },
4745 { {
'H',
'R' }, {}, 21 },
4746 { {
'H',
'U' }, {}, 28 },
4747 { {
'I',
'E' }, {}, 22 },
4748 { {
'I',
'L' }, {}, 23 },
4749 { {
'I',
'Q' }, {}, 23 },
4750 { {
'I',
'R' }, {}, 26 },
4751 { {
'I',
'S' }, {}, 26 },
4752 { {
'I',
'T' }, {}, 27 },
4753 { {
'J',
'O' }, {}, 30 },
4754 { {
'K',
'M' }, {}, 27 },
4755 { {
'K',
'W' }, {}, 30 },
4756 { {
'K',
'Z' }, {}, 20 },
4757 { {
'L',
'B' }, {}, 28 },
4758 { {
'L',
'C' }, {}, 32 },
4759 { {
'L',
'I' }, {}, 21 },
4760 { {
'L',
'T' }, {}, 20 },
4761 { {
'L',
'U' }, {}, 20 },
4762 { {
'L',
'V' }, {}, 21 },
4763 { {
'L',
'Y' }, {}, 25 },
4764 { {
'M',
'A' }, {}, 28 },
4765 { {
'M',
'C' }, {}, 27 },
4766 { {
'M',
'D' }, {}, 24 },
4767 { {
'M',
'E' }, {
'2',
'5' }, 22 },
4768 { {
'M',
'G' }, {}, 27 },
4769 { {
'M',
'K' }, {
'0',
'7' }, 19 },
4770 { {
'M',
'L' }, {}, 28 },
4771 { {
'M',
'R' }, {
'1',
'3' }, 27},
4772 { {
'M',
'T' }, {}, 31 },
4773 { {
'M',
'U' }, {}, 30 },
4774 { {
'M',
'Z' }, {}, 25 },
4775 { {
'N',
'E' }, {}, 28 },
4776 { {
'N',
'I' }, {}, 32 },
4777 { {
'N',
'L' }, {}, 18 },
4778 { {
'N',
'O' }, {}, 15 },
4779 { {
'P',
'K' }, {}, 24 },
4780 { {
'P',
'L' }, {}, 28 },
4781 { {
'P',
'S' }, {}, 29 },
4782 { {
'P',
'T' }, {
'5',
'0' }, 25 },
4783 { {
'Q',
'A' }, {}, 29 },
4784 { {
'R',
'O' }, {}, 24 },
4785 { {
'R',
'S' }, {
'3',
'5' }, 22 },
4786 { {
'R',
'U' }, {}, 33 },
4787 { {
'S',
'A' }, {}, 24 },
4788 { {
'S',
'C' }, {}, 31 },
4789 { {
'S',
'D' }, {}, 18 },
4790 { {
'S',
'E' }, {}, 24 },
4791 { {
'S',
'I' }, {
'5',
'6' }, 19 },
4792 { {
'S',
'K' }, {}, 24 },
4793 { {
'S',
'M' }, {}, 27 },
4794 { {
'S',
'N' }, {}, 28 },
4795 { {
'S',
'T' }, {}, 25 },
4796 { {
'S',
'V' }, {}, 28 },
4797 { {
'T',
'D' }, {}, 27 },
4798 { {
'T',
'G' }, {}, 28 },
4799 { {
'T',
'L' }, {
'3',
'8' }, 23},
4800 { {
'T',
'N' }, {
'5',
'9' }, 24 },
4801 { {
'T',
'R' }, {}, 26 },
4802 { {
'U',
'A' }, {}, 29 },
4803 { {
'V',
'A' }, {}, 22 },
4804 { {
'V',
'G' }, {}, 24 },
4805 { {
'X',
'K' }, {}, 20 },
4811 this->interval.
end = start;
4812 for (
size_t i = 0; i < 2; ++i, ++this->interval.
end) {
4816 if (
chr <
'A' ||
'Z' <
chr)
4818 this->country[i] =
chr;
4823 size_t m = (
l +
r) / 2;
4825 if (
c.country[0] <
this->country[0] || (
c.country[0] ==
this->country[0] &&
c.country[1] <
this->country[1]))
4827 else if (this->country[0] <
c.country[0] || (
this->country[0] ==
c.country[0] &&
this->country[1] <
c.country[1]))
4834 this->country[2] = 0;
4836 for (
size_t i = 0; i < 2; ++i, ++this->interval.
end) {
4839 this->check_digits[i] = text[this->interval.
end];
4841 this->check_digits[2] = 0;
4852 this->interval.
end = m_space->interval.end;
4856 if ((
'0' <=
chr &&
chr <=
'9') || (
'A' <=
chr &&
chr <=
'Z')) {
4857 this->bban[
n++] =
chr;
4858 this->interval.
end++;
4868 for (
size_t i = 0; ; ++i) {
4869 if (!this->bban[i]) {
4870 for (i = 0; i < 2; ++i) {
4871 if (
'A' <= this->country[i] && this->country[i] <=
'J') {
4875 else if (
'K' <= this->country[i] && this->country[i] <=
'T') {
4879 else if (
'U' <= this->country[i] && this->country[i] <=
'Z') {
4889 if (
'0' <= this->bban[i] && this->bban[i] <=
'9')
4891 else if (
'A' <= this->bban[i] && this->bban[i] <=
'J') {
4895 else if (
'K' <= this->bban[i] && this->bban[i] <=
'T') {
4899 else if (
'U' <= this->bban[i] && this->bban[i] <=
'Z') {
4914 for (; digit_count < 9 &&
normalized[next]; ++next, ++digit_count)
4918 this->interval.
start = start;
4926 std::shared_ptr<basic_parser<T>> m_space;
4929 using iban = basic_iban<char>;
4930 using wiban = basic_iban<wchar_t>;
4932 using tiban = wiban;
4936 using sgml_iban = basic_iban<char>;
4949 _In_ const std::locale&
locale = std::locale()) :
4953 this->check_digits[0] = 0;
4955 this->is_valid =
false;
4958 virtual void invalidate()
4960 this->check_digits[0] = 0;
4962 this->is_valid =
false;
4971 virtual bool do_match(
4972 _In_reads_or_z_opt_(end)
const T* text,
4973 _In_ size_t start = 0,
4977 _Assume_(text || start >= end);
4978 const auto&
ctype = std::use_facet<std::ctype<T>>(this->m_locale);
4983 this->interval.
end = start;
4984 if (this->interval.
end + 1 >= end ||
4988 this->interval.
end += 2;
4990 for (
size_t i = 0; i < 2; ++i, ++this->interval.
end) {
4993 this->check_digits[i] = text[this->interval.
end];
4995 this->check_digits[2] = 0;
4999 this->interval.
end = m_space->interval.end;
5000 for (
size_t j = 0;
j < 4; ++
j) {
5004 if ((
'0' <=
chr &&
chr <=
'9') || (
'A' <=
chr &&
chr <=
'Z')) {
5007 this->reference[
n++] =
chr;
5008 this->interval.
end++;
5017 this->reference[_countof(this->reference) - 1] = 0;
5018 for (
size_t i =
n,
j = _countof(this->reference) - 1; i;)
5019 this->reference[--
j] = this->reference[--i];
5020 for (
size_t j = _countof(this->reference) - 1 -
n;
j;)
5021 this->reference[--
j] =
'0';
5026 for (
size_t i = 0; ; ++i) {
5027 if (!this->reference[i]) {
5037 if (
'0' <= this->reference[i] && this->reference[i] <=
'9')
5039 else if (
'A' <= this->reference[i] && this->reference[i] <=
'J') {
5043 else if (
'K' <= this->reference[i] && this->reference[i] <=
'T') {
5047 else if (
'U' <= this->reference[i] && this->reference[i] <=
'Z') {
5062 for (; digit_count < 9 &&
normalized[next]; ++next, ++digit_count)
5066 this->interval.
start = start;
5074 std::shared_ptr<basic_parser<T>> m_space;
5077 using creditor_reference = basic_creditor_reference<char>;
5078 using wcreditor_reference = basic_creditor_reference<wchar_t>;
5080 using tcreditor_reference = wcreditor_reference;
5082 using tcreditor_reference = creditor_reference;
5084 using sgml_creditor_reference = basic_creditor_reference<char>;
5098 virtual bool do_match(
5099 _In_reads_or_z_opt_(end)
const T* text,
5100 _In_ size_t start = 0,
5104 _Assume_(text || start >= end);
5105 this->interval.
end = start;
5110 this->interval.
end++;
5115 this->interval.
start = start;
5144 virtual bool do_match(
5145 _In_reads_or_z_opt_(end)
const T* text,
5146 _In_ size_t start = 0,
5150 _Assume_(text || start >= end);
5151 if (start < end && text[start] ==
'-') {
5152 this->interval.
end = (this->interval.
start = start) + 1;
5182 _In_ const std::locale&
locale = std::locale()) :
5194 virtual void invalidate()
5197 this->
part1.invalidate();
5198 this->
part2.invalidate();
5199 this->
part3.invalidate();
5200 this->is_valid =
false;
5211 virtual bool do_match(
5212 _In_reads_or_z_opt_(end)
const T* text,
5213 _In_ size_t start = 0,
5217 _Assume_(text || start >= end);
5218 const auto&
ctype = std::use_facet<std::ctype<T>>(this->m_locale);
5221 this->interval.
end = start;
5222 if (this->interval.
end + 1 >= end ||
5226 this->interval.
end += 2;
5228 for (
size_t i = 0; i < 2; ++i, ++this->interval.
end) {
5231 this->model[i] = text[this->interval.
end];
5235 this->part1.invalidate();
5236 this->part2.invalidate();
5237 this->part3.invalidate();
5238 if (this->model[0] ==
'9' && this->model[1] ==
'9') {
5240 this->interval.
start = start;
5245 this->interval.
end = m_space->interval.end;
5247 this->part1.match(text, this->interval.
end, end,
flags) &&
5253 this->interval.
start = start;
5261 this->interval.
end = start + 4;
5263 if (this->model[0] ==
'0' && this->model[1] ==
'0')
5274 else if (this->model[0] ==
'0' && this->model[1] ==
'1')
5293 else if (this->model[0] ==
'0' && this->model[1] ==
'2')
5301 else if (this->model[0] ==
'0' && this->model[1] ==
'3')
5310 else if (this->model[0] ==
'0' && this->model[1] ==
'4')
5318 else if ((this->model[0] ==
'0' || this->model[0] ==
'5') && this->model[1] ==
'5')
5332 else if (this->model[0] ==
'0' && this->model[1] ==
'6')
5345 else if (this->model[0] ==
'0' && this->model[1] ==
'7')
5356 else if (this->model[0] ==
'0' && this->model[1] ==
'8')
5366 else if (this->model[0] ==
'0' && this->model[1] ==
'9')
5384 else if (this->model[0] ==
'1' && this->model[1] ==
'0')
5400 (this->model[0] ==
'1' && (this->model[1] ==
'1' || this->model[1] ==
'8' || this->model[1] ==
'9')) ||
5401 ((this->model[0] ==
'2' || this->model[0] ==
'3') && this->model[1] ==
'8') ||
5402 (this->model[0] ==
'4' && (this->model[1] ==
'0' || this->model[1] ==
'1' || this->model[1] ==
'8' || this->model[1] ==
'9')) ||
5403 (this->model[0] ==
'5' && (this->model[1] ==
'1' || this->model[1] ==
'8')))
5416 else if (this->model[0] ==
'1' && this->model[1] ==
'2')
5424 else if ((this->model[0] ==
'2' || this->model[0] ==
'3') && this->model[1] ==
'1')
5441 static bool check11(
5454 static bool check11(
5455 _In_count_(num_part1)
const T*
part1, _In_
size_t num_part1,
5456 _In_count_(num_part2)
const T*
part2, _In_
size_t num_part2)
5458 _Assume_(
part1 || !num_part1);
5459 _Assume_(
part2 && num_part2 >= 1);
5460 uint32_t nominator = 0, ponder = 2;
5461 for (
size_t i = num_part2 - 1; i--; ++ponder)
5462 nominator +=
static_cast<uint32_t
>(
part2[i] -
'0') * ponder;
5463 for (
size_t i = num_part1; i--; ++ponder)
5464 nominator +=
static_cast<uint32_t
>(
part1[i] -
'0') * ponder;
5465 uint8_t control = 11 -
static_cast<uint8_t
>(nominator % 11);
5468 return control ==
part2[num_part2 - 1] -
'0';
5471 static bool check11(
5472 _In_count_(num_part1)
const T*
part1, _In_
size_t num_part1,
5473 _In_count_(num_part2)
const T*
part2, _In_
size_t num_part2,
5474 _In_count_(num_part3)
const T*
part3, _In_
size_t num_part3)
5476 _Assume_(
part1 || !num_part1);
5477 _Assume_(
part2 || !num_part2);
5478 _Assume_(
part3 && num_part3 >= 1);
5479 uint32_t nominator = 0, ponder = 2;
5480 for (
size_t i = num_part3 - 1; i--; ++ponder)
5481 nominator +=
static_cast<uint32_t
>(
part3[i] -
'0') * ponder;
5482 for (
size_t i = num_part2; i--; ++ponder)
5483 nominator +=
static_cast<uint32_t
>(
part2[i] -
'0') * ponder;
5484 for (
size_t i = num_part1; i--; ++ponder)
5485 nominator +=
static_cast<uint32_t
>(
part1[i] -
'0') * ponder;
5486 uint8_t control = 11 -
static_cast<uint8_t
>(nominator % 11);
5489 return control ==
part2[num_part3 - 1] -
'0';
5492 std::shared_ptr<basic_parser<T>> m_space;
5493 basic_si_reference_delimiter<T> m_delimiter;
5496 using si_reference = basic_si_reference<char>;
5497 using wsi_reference = basic_si_reference<wchar_t>;
5499 using tsi_reference = wsi_reference;
5501 using tsi_reference = si_reference;
5503 using sgml_si_reference = basic_si_reference<char>;
5516 _In_ const std::locale&
locale = std::locale()) :
5525 virtual void invalidate()
5536 virtual bool do_match(
5537 _In_reads_or_z_opt_(end)
const T* text,
5538 _In_ size_t start = 0,
5542 _Assume_(text || start >= end);
5546 this->interval.
end = start;
5551 this->interval.
end = m_element->interval.end;
5553 this->interval.
end = m_digit->interval.end;
5559 this->interval.
end = m_sign->interval.end;
5562 this->interval.
start = start;
5572 std::shared_ptr<basic_parser<T>> m_element;
5573 std::shared_ptr<basic_parser<T>> m_digit;
5574 std::shared_ptr<basic_parser<T>> m_sign;
5592 virtual bool do_match(
5593 _In_reads_or_z_(end)
const char* text,
5594 _In_ size_t start = 0,
5598 _Assume_(text || start >= end);
5599 this->interval.
end = start;
5601 _Assume_(text || this->interval.
end >= end);
5603 if (text[this->interval.
end] ==
'\r') {
5604 this->interval.
end++;
5606 this->interval.
start = start;
5607 this->interval.
end++;
5611 else if (text[this->interval.
end] ==
'\n') {
5612 this->interval.
start = start;
5613 this->interval.
end++;
5628 virtual bool do_match(
5629 _In_reads_or_z_(end)
const char* text,
5630 _In_ size_t start = 0,
5634 _Assume_(text || start >= end);
5635 this->interval.
end = start;
5639 this->interval.
start = start;
5640 this->interval.
end++;
5646 this->interval.
start = start;
5647 this->interval.
end++;
5664 virtual bool do_match(
5665 _In_reads_or_z_(end)
const char* text,
5666 _In_ size_t start = 0,
5670 _Assume_(text || start >= end);
5671 this->interval.
end = start;
5673 _Assume_(text || this->interval.
end >= end);
5675 this->interval.
start = start;
5680 this->interval.
start = start;
5681 this->interval.
end++;
5697 virtual bool do_match(
5698 _In_reads_or_z_(end)
const char* text,
5699 _In_ size_t start = 0,
5703 _Assume_(text || start >= end);
5704 this->interval.
end = start;
5707 if ((
unsigned int)text[this->interval.
end] < 0x20 ||
5729 this->interval.
end++;
5735 this->interval.
start = start;
5751 virtual void invalidate()
5755 parser::invalidate();
5761 virtual bool do_match(
5762 _In_reads_or_z_(end)
const char* text,
5763 _In_ size_t start = 0,
5767 _Assume_(text || start >= end);
5768 this->interval.
end = start;
5771 this->interval.
end++;
5774 _Assume_(text || this->interval.
end >= end);
5776 if (text[this->interval.
end] ==
'"') {
5778 this->interval.
end++;
5781 else if (text[this->interval.
end] ==
'\\') {
5782 this->interval.
end++;
5784 this->interval.
end++;
5790 this->interval.
end++;
5797 this->interval.
start = start;
5814 virtual void invalidate()
5816 string.invalidate();
5818 parser::invalidate();
5825 virtual bool do_match(
5826 _In_reads_or_z_(end)
const char* text,
5827 _In_ size_t start = 0,
5831 _Assume_(text || start >= end);
5832 this->interval.
end = start;
5833 if (
string.match(text, this->interval.
end, end,
flags)) {
5835 this->interval.
end =
string.interval.end;
5836 this->interval.
start = start;
5840 string.invalidate();
5842 this->interval.
start = start;
5858 virtual void invalidate()
5862 parser::invalidate();
5869 virtual bool do_match(
5870 _In_reads_or_z_(end)
const char* text,
5871 _In_ size_t start = 0,
5875 _Assume_(text || start >= end);
5876 this->interval.
end = start;
5883 _Assume_(text || this->interval.
end >= end);
5885 this->interval.
end++;
5893 this->interval.
start = start;
5910 virtual bool do_match(
5911 _In_reads_or_z_(end)
const char* text,
5912 _In_ size_t start = 0,
5916 _Assume_(text || start >= end);
5917 if (start + 2 < end &&
5918 text[start] ==
'*' &&
5919 text[start + 1] ==
'/' &&
5920 text[start + 2] ==
'*')
5922 this->interval.
end = (this->interval.
start = start) + 3;
5925 else if (start < end && text[start] ==
'*') {
5926 this->interval.
end = (this->interval.
start = start) + 1;
5942 virtual void invalidate()
5945 subtype.invalidate();
5946 parser::invalidate();
5953 virtual bool do_match(
5954 _In_reads_or_z_(end)
const char* text,
5955 _In_ size_t start = 0,
5959 _Assume_(text || start >= end);
5960 this->interval.
end = start;
5968 this->interval.
end++;
5977 this->interval.
start = start;
5994 virtual void invalidate()
5997 http_media_range::invalidate();
6000 std::list<http_parameter> params;
6003 virtual bool do_match(
6004 _In_reads_or_z_(end)
const char* text,
6005 _In_ size_t start = 0,
6009 _Assume_(text || start >= end);
6010 if (!http_media_range::do_match(text, start, end,
flags))
6017 else if (text[this->interval.
end] ==
';') {
6018 this->interval.
end++;
6023 this->interval.
end = param.interval.end;
6024 params.push_back(std::move(param));
6035 this->interval.
end = params.empty() ? subtype.
interval.
end : params.back().interval.end;
6050 virtual bool do_match(
6051 _In_reads_or_z_(end)
const char* text,
6052 _In_ size_t start = 0,
6056 _Assume_(text || start >= end);
6057 this->interval.
end = start;
6060 if ((
unsigned int)text[this->interval.
end] < 0x20 ||
6067 this->interval.
end++;
6073 this->interval.
start = start;
6092 virtual void invalidate()
6095 parser::invalidate();
6101 virtual bool do_match(
6102 _In_reads_or_z_(end)
const char* text,
6103 _In_ size_t start = 0,
6107 _Assume_(text || start >= end);
6109 this->interval.
end = start;
6113 size_t _value =
static_cast<size_t>(value) * 10 +
static_cast<size_t>(text[this->interval.
end] -
'0');
6120 this->interval.
end++;
6129 this->interval.
start = start;
6143 virtual bool do_match(
6144 _In_reads_or_z_(end)
const char* text,
6145 _In_ size_t start = 0,
6149 _Assume_(text || start >= end);
6150 this->interval.
end = start;
6153 if ((
unsigned int)text[this->interval.
end] < 0x20 ||
6160 this->interval.
end++;
6165 this->interval.
start = start;
6176 virtual void invalidate()
6179 parser::invalidate();
6185 virtual bool do_match(
6186 _In_reads_or_z_(end)
const char* text,
6187 _In_ size_t start = 0,
6191 _Assume_(text || start >= end);
6193 this->interval.
end = start;
6195 _Assume_(text || this->interval.
end >= end);
6198 this->interval.
end++;
6199 s.match(text, this->interval.
end, end,
flags);
6201 this->interval.
end = s.interval.end;
6204 if (text[this->interval.
end] ==
'/') {
6205 this->interval.
end++;
6206 s.match(text, this->interval.
end, end,
flags);
6208 this->interval.
end = s.interval.end;
6216 this->interval.
start = start;
6231 virtual void invalidate()
6237 parser::invalidate();
6244 virtual bool do_match(
6245 _In_reads_or_z_(end)
const char* text,
6246 _In_ size_t start = 0,
6250 _Assume_(text || start >= end);
6251 this->interval.
end = start;
6255 if ((
unsigned int)text[this->interval.
end] < 0x20 ||
6262 this->interval.
end++;
6268 name.
end = this->interval.
end;
6271 if (text[this->interval.
end] ==
'=') {
6272 this->interval.
end++;
6276 if ((
unsigned int)text[this->interval.
end] < 0x20 ||
6282 this->interval.
end++;
6287 value.
end = this->interval.
end;
6293 this->interval.
start = start;
6313 virtual void invalidate()
6315 server.invalidate();
6319 parser::invalidate();
6325 std::list<http_url_parameter> params;
6328 virtual bool do_match(
6329 _In_reads_or_z_(end)
const char* text,
6330 _In_ size_t start = 0,
6334 _Assume_(text || start >= end);
6335 this->interval.
end = start;
6338 this->interval.
end += 7;
6344 this->interval.
end++;
6354 server.invalidate();
6367 this->interval.
end++;
6370 if ((
unsigned int)text[this->interval.
end] < 0x20 ||
6374 else if (text[this->interval.
end] ==
'&')
6375 this->interval.
end++;
6379 this->interval.
end = param.interval.end;
6380 params.push_back(std::move(param));
6391 this->interval.
start = start;
6406 virtual void invalidate()
6409 parser::invalidate();
6412 std::vector<stdex::interval<size_t>> components;
6415 virtual bool do_match(
6416 _In_reads_or_z_(end)
const char* text,
6417 _In_ size_t start = 0,
6421 _Assume_(text || start >= end);
6422 this->interval.
end = start;
6427 k.end = this->interval.
end;
6429 if (
k.end < end && text[
k.end]) {
6430 if (stdex::isalpha(text[
k.end]))
6438 if (this->interval.
end <
k.end) {
6439 k.start = this->interval.
end;
6440 this->interval.
end =
k.end;
6441 components.push_back(
k);
6446 this->interval.
end++;
6453 if (!components.empty()) {
6454 this->interval.
start = start;
6455 this->interval.
end = components.back().end;
6474 virtual void invalidate()
6477 parser::invalidate();
6483 virtual bool do_match(
6484 _In_reads_or_z_(end)
const char* text,
6485 _In_ size_t start = 0,
6489 _Assume_(text || start >= end);
6491 this->interval.
end = start;
6496 this->interval.
end++;
6498 else if (text[this->interval.
end] ==
'.') {
6499 this->interval.
end++;
6505 this->interval.
end++;
6523 this->interval.
start = start;
6538 virtual bool do_match(
6539 _In_reads_or_z_(end)
const char* text,
6540 _In_ size_t start = 0,
6544 _Assume_(text || end <= start);
6545 if (start < end && text[start] ==
'*') {
6546 this->interval.
end = (this->interval.
start = start) + 1;
6557 template <
class T,
class T_asterisk = http_asterisk>
6566 virtual void invalidate()
6568 asterisk.invalidate();
6570 factor.invalidate();
6571 parser::invalidate();
6579 virtual bool do_match(
6580 _In_reads_or_z_(end)
const char* text,
6581 _In_ size_t start = 0,
6585 _Assume_(text || start >= end);
6587 this->interval.
end = start;
6594 asterisk.invalidate();
6597 asterisk.invalidate();
6605 this->interval.
end++;
6608 this->interval.
end++;
6611 this->interval.
end++;
6619 factor.invalidate();
6622 this->interval.
start = start;
6633 virtual void invalidate()
6637 parser::invalidate();
6644 virtual bool do_match(
6645 _In_reads_or_z_(end)
const char* text,
6646 _In_ size_t start = 0,
6650 _Assume_(text || start >= end);
6651 this->interval.
end = start;
6653 this->interval.
end++;
6663 this->interval.
end++;
6672 this->interval.
start = start;
6689 virtual void invalidate()
6694 parser::invalidate();
6702 virtual bool do_match(
6703 _In_reads_or_z_(end)
const char* text,
6704 _In_ size_t start = 0,
6708 _Assume_(text || start >= end);
6709 this->interval.
end = start;
6717 this->interval.
end++;
6731 else if (text[this->interval.
end] ==
';') {
6732 this->interval.
end++;
6737 this->interval.
end = param.interval.end;
6738 params.push_back(std::move(param));
6749 this->interval.
start = start;
6767 virtual void invalidate()
6773 parser::invalidate();
6780 virtual bool do_match(
6781 _In_reads_or_z_(end)
const char* text,
6782 _In_ size_t start = 0,
6786 _Assume_(text || start >= end);
6787 this->interval.
end = start;
6791 if (text[this->interval.
end] ==
'/') {
6792 type.
end = this->interval.
end;
6793 this->interval.
end++;
6794 version.
start = this->interval.
end;
6797 if (stdex::isspace(text[this->interval.
end])) {
6798 version.
end = this->interval.
end;
6802 this->interval.
end++;
6805 version.
end = this->interval.
end;
6811 else if (stdex::isspace(text[this->interval.
end])) {
6812 type.
end = this->interval.
end;
6816 this->interval.
end++;
6819 type.
end = this->interval.
end;
6824 this->interval.
start = start;
6847 virtual void invalidate()
6851 version_maj.
start = 1;
6852 version_maj.
end = 0;
6853 version_min.
start = 1;
6854 version_min.
end = 0;
6856 parser::invalidate();
6865 virtual bool do_match(
6866 _In_reads_or_z_(end)
const char* text,
6867 _In_ size_t start = 0,
6871 _Assume_(text || start >= end);
6872 this->interval.
end = start;
6876 if (text[this->interval.
end] ==
'/') {
6877 type.
end = this->interval.
end;
6878 this->interval.
end++;
6881 else if (stdex::isspace(text[this->interval.
end]))
6884 this->interval.
end++;
6887 type.
end = this->interval.
end;
6891 version_maj.
start = this->interval.
end;
6894 if (text[this->interval.
end] ==
'.') {
6895 version_maj.
end = this->interval.
end;
6896 this->interval.
end++;
6897 version_min.
start = this->interval.
end;
6900 if (stdex::isspace(text[this->interval.
end])) {
6901 version_min.
end = this->interval.
end;
6903 (
uint16_t)strtoui(text + version_maj.
start, version_maj.
size(),
nullptr, 10) * 0x100 +
6908 this->interval.
end++;
6915 else if (stdex::isspace(text[this->interval.
end])) {
6916 version_maj.
end = this->interval.
end;
6917 version_min.
start = 1;
6918 version_min.
end = 0;
6923 this->interval.
end++;
6928 this->interval.
start = start;
6949 virtual void invalidate()
6954 protocol.invalidate();
6955 parser::invalidate();
6963 virtual bool do_match(
6964 _In_reads_or_z_(end)
const char* text,
6965 _In_ size_t start = 0,
6969 _Assume_(text || start >= end);
6970 this->interval.
end = start;
6976 if (stdex::isspace(text[this->interval.
end]))
6977 this->interval.
end++;
6989 if (stdex::isspace(text[this->interval.
end])) {
6990 verb.
end = this->interval.
end;
6991 this->interval.
end++;
6995 this->interval.
end++;
7005 if (stdex::isspace(text[this->interval.
end]))
7006 this->interval.
end++;
7018 protocol.invalidate();
7025 if (stdex::isspace(text[this->interval.
end]))
7026 this->interval.
end++;
7052 this->interval.
end++;
7058 this->interval.
start = start;
7075 virtual void invalidate()
7081 parser::invalidate();
7088 virtual bool do_match(
7089 _In_reads_or_z_(end)
const char* text,
7090 _In_ size_t start = 0,
7094 _Assume_(text || start >= end);
7095 this->interval.
end = start;
7105 if (stdex::isspace(text[this->interval.
end])) {
7106 name.
end = this->interval.
end;
7107 this->interval.
end++;
7112 if (stdex::isspace(text[this->interval.
end]))
7113 this->interval.
end++;
7121 this->interval.
end++;
7128 else if (text[this->interval.
end] ==
':') {
7129 name.
end = this->interval.
end;
7130 this->interval.
end++;
7134 this->interval.
end++;
7146 this->interval.
end++;
7151 if (stdex::isspace(text[this->interval.
end]))
7152 this->interval.
end++;
7155 value.
end = ++this->interval.
end;
7161 this->interval.
start = start;
7175 template <
class KEY,
class T>
7180 _In_reads_or_z_(end)
const char* text,
7181 _In_ size_t start = 0,
7185 while (start < end) {
7186 while (start < end && text[start] && stdex::isspace(text[start])) start++;
7187 if (start < end && text[start] ==
',') {
7189 while (start < end&& text[start] && stdex::isspace(text[start])) start++;
7192 if (
el.match(text, start, end,
flags)) {
7194 T::insert(std::move(
el));
7204 constexpr bool operator()(
const T& a,
const T& b)
const noexcept
7206 return a.factor.value > b.factor.value;
7213 template <
class T,
class AX = std::allocator<T>>
7235 _In_ const std::locale&
locale = std::locale()) :
7250 virtual void invalidate()
7256 std::basic_string<T> value;
7259 virtual bool do_match(
7260 _In_reads_or_z_opt_(end)
const T* text,
7261 _In_ size_t start = 0,
7265 _Assume_(text || start >= end);
7266 this->interval.
end = start;
7268 this->interval.
end = m_quote->interval.end;
7272 this->interval.
start = start;
7273 this->interval.
end = m_quote->interval.end;
7277 if (m_quote->match(text, m_escape->interval.end, end,
flags)) {
7278 value +=
'"'; this->interval.
end = m_quote->interval.end;
7281 if (m_sol->match(text, m_escape->interval.end, end,
flags)) {
7282 value +=
'/'; this->interval.
end = m_sol->interval.end;
7285 if (m_bs->match(text, m_escape->interval.end, end,
flags)) {
7286 value +=
'\b'; this->interval.
end = m_bs->interval.end;
7289 if (m_ff->match(text, m_escape->interval.end, end,
flags)) {
7290 value +=
'\f'; this->interval.
end = m_ff->interval.end;
7293 if (m_lf->match(text, m_escape->interval.end, end,
flags)) {
7294 value +=
'\n'; this->interval.
end = m_lf->interval.end;
7297 if (m_cr->match(text, m_escape->interval.end, end,
flags)) {
7298 value +=
'\r'; this->interval.
end = m_cr->interval.end;
7301 if (m_htab->match(text, m_escape->interval.end, end,
flags)) {
7302 value +=
'\t'; this->interval.
end = m_htab->interval.end;
7306 m_uni->match(text, m_escape->interval.end, end,
flags) &&
7307 m_hex->match(text, m_uni->interval.end, std::min(m_uni->interval.end + 4, end),
flags | match_case_insensitive) &&
7308 m_hex->interval.size() == 4 )
7310 _Assume_(m_hex->value <= 0xffff);
7311 if (
sizeof(T) == 1) {
7312 if (m_hex->value > 0x7ff) {
7313 value += (T)(0xe0 | ((m_hex->value >> 12) & 0x0f));
7314 value += (T)(0x80 | ((m_hex->value >> 6) & 0x3f));
7315 value += (T)(0x80 | (m_hex->value & 0x3f));
7317 else if (m_hex->value > 0x7f) {
7318 value += (T)(0xc0 | ((m_hex->value >> 6) & 0x1f));
7319 value += (T)(0x80 | (m_hex->value & 0x3f));
7322 value += (T)(m_hex->value & 0x7f);
7325 value += (T)m_hex->value;
7326 this->interval.
end = m_hex->interval.end;
7329 if (m_escape->match(text, m_escape->interval.end, end,
flags)) {
7330 value +=
'\\'; this->interval.
end = m_escape->interval.end;
7335 value.append(text + m_chr->interval.start, m_chr->interval.size());
7336 this->interval.
end = m_chr->interval.end;
7347 std::shared_ptr<basic_parser<T>> m_quote;
7348 std::shared_ptr<basic_parser<T>> m_chr;
7349 std::shared_ptr<basic_parser<T>> m_escape;
7350 std::shared_ptr<basic_parser<T>> m_sol;
7351 std::shared_ptr<basic_parser<T>> m_bs;
7352 std::shared_ptr<basic_parser<T>> m_ff;
7353 std::shared_ptr<basic_parser<T>> m_lf;
7354 std::shared_ptr<basic_parser<T>> m_cr;
7355 std::shared_ptr<basic_parser<T>> m_htab;
7356 std::shared_ptr<basic_parser<T>> m_uni;
7357 std::shared_ptr<basic_integer16<T>> m_hex;
7375 virtual void invalidate()
7384 virtual bool do_match(
7385 _In_reads_or_z_opt_(end)
const T* text,
7386 _In_ size_t start = 0,
7390 _Unreferenced_(
flags);
7391 _Assume_(text || start + 1 >= end);
7392 if (start + 1 < end &&
7393 text[start] ==
'/' &&
7394 text[start + 1] ==
'*')
7397 this->content.
start = this->interval.
end = start + 2;
7401 if (this->interval.
end + 1 < end &&
7406 this->content.
end = this->interval.
end;
7407 this->interval.
start = start;
7408 this->interval.
end = this->interval.
end + 2;
7411 this->interval.
end++;
7420 using css_comment = basic_css_comment<char>;
7421 using wcss_comment = basic_css_comment<wchar_t>;
7423 using tcss_comment = wcss_comment;
7425 using tcss_comment = css_comment;
7435 virtual bool do_match(
7436 _In_reads_or_z_opt_(end)
const T* text,
7437 _In_ size_t start = 0,
7441 _Unreferenced_(
flags);
7442 _Assume_(text || start + 3 >= end);
7443 if (start + 3 < end &&
7444 text[start] ==
'<' &&
7445 text[start + 1] ==
'!' &&
7446 text[start + 2] ==
'-' &&
7447 text[start + 3] ==
'-')
7449 this->interval.
start = start;
7450 this->interval.
end = start + 4;
7473 virtual bool do_match(
7474 _In_reads_or_z_opt_(end)
const T* text,
7475 _In_ size_t start = 0,
7479 _Unreferenced_(
flags);
7480 _Assume_(text || start + 2 >= end);
7481 if (start + 2 < end &&
7482 text[start] ==
'-' &&
7483 text[start + 1] ==
'-' &&
7484 text[start + 2] ==
'>')
7486 this->interval.
start = start;
7487 this->interval.
end = start + 3;
7510 virtual void invalidate()
7519 virtual bool do_match(
7520 _In_reads_or_z_opt_(end)
const T* text,
7521 _In_ size_t start = 0,
7525 _Unreferenced_(
flags);
7526 this->interval.
end = start;
7527 _Assume_(text || this->interval.
end >= end);
7528 if (this->interval.
end < end &&
7532 T
quote = text[this->interval.
end];
7533 this->content.
start = ++this->interval.
end;
7537 if (text[this->interval.
end] ==
quote) {
7539 this->content.
end = this->interval.
end;
7540 this->interval.
start = start;
7541 this->interval.
end++;
7544 if (this->interval.
end + 1 < end &&
7549 this->interval.
end = this->interval.
end + 2;
7552 this->interval.
end++;
7562 using css_string = basic_css_string<char>;
7563 using wcss_string = basic_css_string<wchar_t>;
7565 using tcss_string = wcss_string;
7567 using tcss_string = css_string;
7577 virtual void invalidate()
7586 virtual bool do_match(
7587 _In_reads_or_z_opt_(end)
const T* text,
7588 _In_ size_t start = 0,
7592 _Unreferenced_(
flags);
7593 this->interval.
end = start;
7594 _Assume_(text || this->interval.
end + 3 >= end);
7595 if (this->interval.
end + 3 < end &&
7602 this->interval.
end = this->interval.
end + 4;
7605 const auto&
ctype = std::use_facet<std::ctype<T>>(this->m_locale);
7608 if (this->interval.
end < end &&
7612 T
quote = text[this->interval.
end];
7613 this->content.
start = ++this->interval.
end;
7617 if (text[this->interval.
end] ==
quote) {
7619 this->content.
end = this->interval.
end;
7620 this->interval.
end++;
7623 if (this->interval.
end + 1 < end &&
7628 this->interval.
end = this->interval.
end + 2;
7631 this->interval.
end++;
7637 if (this->interval.
end < end &&
7641 this->interval.
start = start;
7642 this->interval.
end++;
7652 if (text[this->interval.
end] ==
')') {
7654 this->interval.
start = start;
7655 this->interval.
end++;
7659 this->interval.
end++;
7661 this->content.
end = ++this->interval.
end;
7672 using css_uri = basic_css_uri<char>;
7673 using wcss_uri = basic_css_uri<wchar_t>;
7675 using tcss_uri = wcss_uri;
7677 using tcss_uri = css_uri;
7687 virtual void invalidate()
7696 virtual bool do_match(
7697 _In_reads_or_z_opt_(end)
const T* text,
7698 _In_ size_t start = 0,
7702 _Unreferenced_(
flags);
7703 this->interval.
end = start;
7704 _Assume_(text || this->interval.
end + 6 >= end);
7705 if (this->interval.
end + 6 < end &&
7715 this->interval.
end = this->interval.
end + 7;
7718 const auto&
ctype = std::use_facet<std::ctype<T>>(this->m_locale);
7721 if (this->interval.
end < end &&
7725 T
quote = text[this->interval.
end];
7726 this->content.
start = ++this->interval.
end;
7730 if (text[this->interval.
end] ==
quote) {
7732 this->content.
end = this->interval.
end;
7733 this->interval.
start = start;
7734 this->interval.
end++;
7737 if (this->interval.
end + 1 < end &&
7742 this->interval.
end = this->interval.
end + 2;
7745 this->interval.
end++;
7756 using css_import = basic_css_import<char>;
7757 using wcss_import = basic_css_import<wchar_t>;
7759 using tcss_import = wcss_import;
7761 using tcss_import = css_import;
7771 virtual void invalidate()
7784 virtual bool do_match(
7785 _In_reads_or_z_opt_(end)
const T* text,
7786 _In_ size_t start = 0,
7790 _Unreferenced_(
flags);
7791 const auto&
ctype = std::use_facet<std::ctype<T>>(this->m_locale);
7793 this->interval.
end = start;
7794 this->base_type.
start = this->interval.
end;
7796 _Assume_(text || this->interval.
end >= end);
7799 if (text[this->interval.
end] ==
'/' ||
7803 this->interval.
end++;
7805 if (this->interval.
end <=
this->base_type.start)
7807 this->base_type.
end = this->interval.
end;
7812 this->interval.
end++;
7813 this->sub_type.
start = this->interval.
end;
7817 if (text[this->interval.
end] ==
'/' ||
7821 this->interval.
end++;
7823 if (this->interval.
end <=
this->sub_type.start)
7826 this->sub_type.
end = this->interval.
end;
7829 this->interval.
end++;
7834 if (this->interval.
end + 7 < end &&
7836 (text[this->interval.
end + 1] ==
'h' || text[this->interval.
end + 1] ==
'H') &&
7838 (text[this->interval.
end + 3] ==
'r' || text[this->interval.
end + 3] ==
'R') &&
7840 (text[this->interval.
end + 5] ==
'e' || text[this->interval.
end + 5] ==
'E') &&
7842 text[this->interval.
end + 7] ==
'=')
7844 this->interval.
end = this->interval.
end + 8;
7845 if (this->interval.
end < end &&
7849 T
quote = text[this->interval.
end];
7850 this->charset.
start = ++this->interval.
end;
7857 if (text[this->interval.
end] ==
quote) {
7859 this->charset.
end = this->interval.
end;
7860 this->interval.
end++;
7863 this->interval.
end++;
7868 this->charset.
start = this->interval.
end;
7872 this->charset.
end = this->interval.
end;
7875 this->interval.
end++;
7880 this->interval.
start = start;
7889 using mime_type = basic_mime_type<char>;
7890 using wmime_type = basic_mime_type<wchar_t>;
7892 using tmime_type = wmime_type;
7894 using tmime_type = mime_type;
7904 virtual bool do_match(
7905 _In_reads_or_z_opt_(end)
const T* text,
7906 _In_ size_t start = 0,
7910 _Unreferenced_(
flags);
7911 const auto&
ctype = std::use_facet<std::ctype<T>>(this->m_locale);
7912 this->interval.
end = start;
7914 _Assume_(text || this->interval.
end >= end);
7917 this->interval.
start = start;
7923 if (text[this->interval.
end] ==
'>' ||
7928 this->interval.
start = start;
7931 this->interval.
end++;
7951 virtual void invalidate()
7960 virtual bool do_match(
7961 _In_reads_or_z_opt_(end)
const T* text,
7962 _In_ size_t start = 0,
7966 _Unreferenced_(
flags);
7967 this->interval.
end = start;
7968 _Assume_(text || this->interval.
end >= end);
7969 if (this->interval.
end < end &&
7973 T
quote = text[this->interval.
end];
7974 this->content.
start = ++this->interval.
end;
7982 if (text[this->interval.
end] ==
quote) {
7984 this->content.
end = this->interval.
end;
7985 this->interval.
start = start;
7986 this->interval.
end++;
7989 this->interval.
end++;
7994 this->content.
start = this->interval.
end;
7995 const auto&
ctype = std::use_facet<std::ctype<T>>(this->m_locale);
7997 _Assume_(text || this->interval.
end >= end);
7999 this->content.
end = this->interval.
end;
8000 this->interval.
start = start;
8003 if (text[this->interval.
end] ==
'>' ||
8007 this->content.
end = this->interval.
end;
8008 this->interval.
start = start;
8011 this->interval.
end++;
8016 using html_value = basic_html_value<char>;
8017 using whtml_value = basic_html_value<wchar_t>;
8019 using thtml_value = whtml_value;
8021 using thtml_value = html_value;
8027 enum class html_sequence_t {
8058 type(html_sequence_t::unknown)
8061 virtual void invalidate()
8063 this->type = html_sequence_t::unknown;
8064 this->name.invalidate();
8074 virtual bool do_match(
8075 _In_reads_or_z_opt_(end)
const T* text,
8076 _In_ size_t start = 0,
8080 _Assume_(text || start >= end);
8081 if (start >= end || text[start] !=
'<')
8083 this->interval.
end = start + 1;
8086 if (text[this->interval.
end] ==
'/' &&
8090 this->type = html_sequence_t::element_end;
8091 this->name = this->m_ident.
interval;
8094 else if (text[this->interval.
end] ==
'!') {
8096 this->interval.
end++;
8097 if (this->interval.
end + 1 < end &&
8102 this->name.
start = this->interval.
end = this->interval.
end + 2;
8106 if (this->interval.
end + 2 < end &&
8112 this->type = html_sequence_t::comment;
8113 this->name.
end = this->interval.
end;
8114 this->attributes.clear();
8115 this->interval.
start = start;
8116 this->interval.
end = this->interval.
end + 3;
8119 this->interval.
end++;
8122 this->type = html_sequence_t::declaration;
8123 this->name.
start = this->name.
end = this->interval.
end;
8125 else if (text[this->interval.
end] ==
'?') {
8127 this->name.
start = ++this->interval.
end;
8131 if (text[this->interval.
end] ==
'>') {
8133 this->type = html_sequence_t::instruction;
8134 this->name.
end = this->interval.
end;
8135 this->attributes.clear();
8136 this->interval.
start = start;
8137 this->interval.
end++;
8140 if (this->interval.
end + 1 < end &&
8145 this->type = html_sequence_t::instruction;
8146 this->name.
end = this->interval.
end;
8147 this->attributes.clear();
8148 this->interval.
start = start;
8149 this->interval.
end = this->interval.
end + 2;
8152 this->interval.
end++;
8157 this->type = html_sequence_t::element_start;
8158 this->name = this->m_ident.
interval;
8166 const auto&
ctype = std::use_facet<std::ctype<T>>(this->m_locale);
8169 this->attributes.clear();
8171 if (this->type == html_sequence_t::element_start &&
8172 this->interval.
end + 1 < end &&
8177 this->type = html_sequence_t::element;
8178 this->interval.
end = this->interval.
end + 2;
8181 if (this->interval.
end < end &&
8185 this->interval.
end++;
8188 if (this->type == html_sequence_t::declaration &&
8189 this->interval.
end + 1 < end &&
8194 this->interval.
end = this->interval.
end + 2;
8197 if (this->type == html_sequence_t::declaration &&
8198 this->interval.
end + 1 < end &&
8203 this->interval.
end = this->interval.
end + 2;
8207 if (this->interval.
end + 1 < end &&
8212 this->interval.
end = this->interval.
end + 2;
8215 this->interval.
end++;
8230 a = &this->attributes.back();
8236 this->interval.
end++;
8244 this->interval.
end++;
8251 a->value = this->m_value.content;
8260 a->value.invalidate();
8265 this->interval.
start = start;
8277 using html_tag = basic_html_tag<char>;
8278 using whtml_tag = basic_html_tag<wchar_t>;
8280 using thtml_tag = whtml_tag;
8282 using thtml_tag = html_tag;
8292 virtual void invalidate()
8302 _In_reads_or_z_opt_(end)
const T* text,
8303 _In_ size_t start = 0,
8307 _Unreferenced_(
flags);
8308 _Assume_(text || start + 2 >= end);
8309 if (start + 2 < end &&
8310 text[start] ==
'<' &&
8311 text[start + 1] ==
'!' &&
8312 text[start + 2] ==
'[')
8314 this->interval.
end = start + 3;
8317 const auto&
ctype = std::use_facet<std::ctype<T>>(this->m_locale);
8320 this->condition.
start = this->condition.
end = this->interval.
end;
8325 if (text[this->interval.
end] ==
'[') {
8326 this->interval.
start = start;
8327 this->interval.
end++;
8331 this->interval.
end++;
8333 this->condition.
end = ++this->interval.
end;
8343 using html_declaration_condition_start = basic_html_declaration_condition_start<char>;
8344 using whtml_declaration_condition_start = basic_html_declaration_condition_start<wchar_t>;
8346 using thtml_declaration_condition_start = whtml_declaration_condition_start;
8348 using thtml_declaration_condition_start = html_declaration_condition_start;
8358 virtual bool do_match(
8359 _In_reads_or_z_opt_(end)
const T* text,
8360 _In_ size_t start = 0,
8364 _Unreferenced_(
flags);
8365 _Assume_(text || start + 2 >= end);
8366 if (start + 2 < end &&
8367 text[start] ==
']' &&
8368 text[start + 1] ==
']' &&
8369 text[start + 2] ==
'>')
8371 this->interval.
start = start;
8372 this->interval.
end = start + 3;
8390#undef ENUM_FLAG_OPERATOR
8393#if defined(_MSC_VER)
8395#elif defined(__GNUC__)
8396#pragma GCC diagnostic pop
locale_t helper class to free_locale when going out of scope.
Definition locale.hpp:74
Test for angle in d°mm'ss.dddd form.
Definition parser.hpp:4381
Test for any code unit.
Definition parser.hpp:236
Test for beginning of line.
Definition parser.hpp:635
Test for any.
Definition parser.hpp:1078
Test for Creditor Reference.
Definition parser.hpp:4945
T reference[22]
Normalized national reference number.
Definition parser.hpp:4967
T check_digits[3]
Two check digits.
Definition parser.hpp:4966
bool is_valid
Is reference valid per ISO 7064.
Definition parser.hpp:4968
Legacy CSS comment end -->
Definition parser.hpp:7471
Legacy CSS comment start <!--
Definition parser.hpp:7433
CSS import directive.
Definition parser.hpp:7685
stdex::interval< size_t > content
content position in source
Definition parser.hpp:7693
CSS string.
Definition parser.hpp:7508
stdex::interval< size_t > content
content position in source
Definition parser.hpp:7516
URI in CSS.
Definition parser.hpp:7575
stdex::interval< size_t > content
content position in source
Definition parser.hpp:7583
Test for any code unit from a given string of code units.
Definition parser.hpp:740
Test for specific code unit.
Definition parser.hpp:308
Test for date.
Definition parser.hpp:4014
Test for valid DNS domain character.
Definition parser.hpp:2796
bool allow_on_edge
Is character allowed at the beginning or an end of a DNS domain?
Definition parser.hpp:2806
Test for DNS domain/hostname.
Definition parser.hpp:2896
bool m_allow_absolute
May DNS names end with a dot (absolute name)?
Definition parser.hpp:2960
Test for e-mail address.
Definition parser.hpp:3788
Test for emoticon.
Definition parser.hpp:3891
std::shared_ptr< basic_parser< T > > apex
apex/eyebrows/halo (e.g. O, 0)
Definition parser.hpp:3919
std::shared_ptr< basic_parser< T > > eyes
eyes (e.g. :, ;, >, |, B)
Definition parser.hpp:3920
std::shared_ptr< basic_set< T > > mouth
mouth (e.g. ), ), (, (, |, P, D, p, d)
Definition parser.hpp:3922
std::shared_ptr< basic_parser< T > > nose
nose (e.g. -, o)
Definition parser.hpp:3921
std::shared_ptr< basic_parser< T > > emoticon
emoticon as a whole (e.g. 😀, 🤔, 😶)
Definition parser.hpp:3918
Test for end of line.
Definition parser.hpp:674
Test for fraction.
Definition parser.hpp:1706
End of condition ...]]>
Definition parser.hpp:8356
Start of condition <![condition[...
Definition parser.hpp:8290
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:8301
Contiguous sequence of characters representing name of element, attribute etc.
Definition parser.hpp:7902
Tag.
Definition parser.hpp:8054
std::vector< html_attribute > attributes
tag attributes
Definition parser.hpp:8071
html_sequence_t type
tag type
Definition parser.hpp:8069
stdex::interval< size_t > name
tag name position in source
Definition parser.hpp:8070
Optionally-quoted string representing value of an attribute.
Definition parser.hpp:7949
stdex::interval< size_t > content
content position in source
Definition parser.hpp:7957
Test for International Bank Account Number.
Definition parser.hpp:4656
T bban[31]
Normalized Basic Bank Account Number.
Definition parser.hpp:4681
T country[3]
ISO 3166-1 alpha-2 country code.
Definition parser.hpp:4679
T check_digits[3]
Two check digits.
Definition parser.hpp:4680
bool is_valid
Is IBAN valid per ISO 7064.
Definition parser.hpp:4682
Test for decimal integer.
Definition parser.hpp:1316
Test for decimal integer possibly containing thousand separators.
Definition parser.hpp:1401
bool has_separators
Did integer have any separators?
Definition parser.hpp:1422
size_t digit_count
Total number of digits in integer.
Definition parser.hpp:1421
Test for hexadecimal integer.
Definition parser.hpp:1481
Base class for integer testing.
Definition parser.hpp:1294
size_t value
Calculated value of the numeral.
Definition parser.hpp:1308
Test for IPv4 address.
Definition parser.hpp:2364
stdex::interval< size_t > components[4]
Individual component intervals.
Definition parser.hpp:2409
struct in_addr value
IPv4 address value.
Definition parser.hpp:2410
Test for IPv6 address.
Definition parser.hpp:2576
std::shared_ptr< basic_parser< T > > scope_id
Scope ID (e.g. NIC index with link-local addresses)
Definition parser.hpp:2648
stdex::interval< size_t > components[8]
Individual component intervals.
Definition parser.hpp:2646
struct in6_addr value
IPv6 address value.
Definition parser.hpp:2647
Test for valid IPv6 address scope ID character.
Definition parser.hpp:2502
Test for repeating.
Definition parser.hpp:930
bool m_greedy
try to match as long sequence as possible
Definition parser.hpp:969
std::shared_ptr< basic_parser< T > > m_el
repeating element
Definition parser.hpp:966
size_t m_min_iterations
minimum number of iterations
Definition parser.hpp:967
size_t m_max_iterations
maximum number of iterations
Definition parser.hpp:968
Test for JSON string.
Definition parser.hpp:7221
MIME content type.
Definition parser.hpp:7769
stdex::interval< size_t > base_type
basic type position in source
Definition parser.hpp:7779
stdex::interval< size_t > sub_type
sub-type position in source
Definition parser.hpp:7780
stdex::interval< size_t > charset
charset position in source
Definition parser.hpp:7781
Test for mixed numeral.
Definition parser.hpp:1941
std::shared_ptr< basic_parser< T > > fraction
fraction
Definition parser.hpp:1974
std::shared_ptr< basic_parser< T > > special_sign
Special sign (e.g. plus-minus '±')
Definition parser.hpp:1972
std::shared_ptr< basic_parser< T > > negative_sign
Negative sign.
Definition parser.hpp:1971
std::shared_ptr< basic_parser< T > > positive_sign
Positive sign.
Definition parser.hpp:1970
std::shared_ptr< basic_parser< T > > integer
Integer part.
Definition parser.hpp:1973
Test for monetary numeral.
Definition parser.hpp:2235
std::shared_ptr< basic_parser< T > > positive_sign
Positive sign.
Definition parser.hpp:2268
std::shared_ptr< basic_parser< T > > decimal_separator
Decimal separator.
Definition parser.hpp:2273
std::shared_ptr< basic_parser< T > > currency
Currency part.
Definition parser.hpp:2271
std::shared_ptr< basic_parser< T > > decimal
Decimal part.
Definition parser.hpp:2274
std::shared_ptr< basic_parser< T > > integer
Integer part.
Definition parser.hpp:2272
std::shared_ptr< basic_parser< T > > negative_sign
Negative sign.
Definition parser.hpp:2269
std::shared_ptr< basic_parser< T > > special_sign
Special sign (e.g. plus-minus '±')
Definition parser.hpp:2270
"No-op" match
Definition parser.hpp:204
Base template for all parsers.
Definition parser.hpp:80
stdex::interval< size_t > interval
Region of the last match.
Definition parser.hpp:120
Test for permutation.
Definition parser.hpp:1218
Test for phone number.
Definition parser.hpp:4504
std::basic_string< T > value
Normalized phone number.
Definition parser.hpp:4529
Test for any punctuation code unit.
Definition parser.hpp:481
Test for Roman numeral.
Definition parser.hpp:1590
Test for scientific numeral.
Definition parser.hpp:2066
std::shared_ptr< basic_parser< T > > special_sign
Special sign (e.g. plus-minus '±')
Definition parser.hpp:2112
std::shared_ptr< basic_parser< T > > exponent_symbol
Exponent symbol (e.g. 'e')
Definition parser.hpp:2116
std::shared_ptr< basic_parser< T > > positive_sign
Positive sign.
Definition parser.hpp:2110
std::shared_ptr< basic_parser< T > > negative_sign
Negative sign.
Definition parser.hpp:2111
double value
Calculated value of the numeral.
Definition parser.hpp:2120
std::shared_ptr< basic_parser< T > > negative_exp_sign
Negative exponent sign (e.g. '-')
Definition parser.hpp:2118
std::shared_ptr< basic_integer< T > > decimal
Decimal part.
Definition parser.hpp:2115
std::shared_ptr< basic_parser< T > > positive_exp_sign
Positive exponent sign (e.g. '+')
Definition parser.hpp:2117
std::shared_ptr< basic_integer< T > > exponent
Exponent part.
Definition parser.hpp:2119
std::shared_ptr< basic_parser< T > > decimal_separator
Decimal separator.
Definition parser.hpp:2114
std::shared_ptr< basic_integer< T > > integer
Integer part.
Definition parser.hpp:2113
Test for match score.
Definition parser.hpp:1769
Test for sequence.
Definition parser.hpp:1026
Definition parser.hpp:709
Test for SI Reference delimiter.
Definition parser.hpp:5139
Test for SI Reference part.
Definition parser.hpp:5093
Test for SI Reference.
Definition parser.hpp:5178
basic_si_reference_part< T > part3
Reference data part 3 (P3)
Definition parser.hpp:5207
basic_si_reference_part< T > part1
Reference data part 1 (P1)
Definition parser.hpp:5205
bool is_valid
Is reference valid.
Definition parser.hpp:5208
T model[3]
Reference model.
Definition parser.hpp:5204
basic_si_reference_part< T > part2
Reference data part 2 (P2)
Definition parser.hpp:5206
Test for signed numeral.
Definition parser.hpp:1855
std::shared_ptr< basic_parser< T > > special_sign
Special sign (e.g. plus-minus '±')
Definition parser.hpp:1881
std::shared_ptr< basic_parser< T > > negative_sign
Negative sign.
Definition parser.hpp:1880
std::shared_ptr< basic_parser< T > > positive_sign
Positive sign.
Definition parser.hpp:1879
std::shared_ptr< basic_parser< T > > number
Number.
Definition parser.hpp:1882
Test for any space code unit.
Definition parser.hpp:401
Test for any space or punctuation code unit.
Definition parser.hpp:556
Test for any string.
Definition parser.hpp:1146
Test for given string.
Definition parser.hpp:835
Test for time.
Definition parser.hpp:4279
Test for valid URL password character.
Definition parser.hpp:3080
Test for valid URL path character.
Definition parser.hpp:3182
Test for URL path.
Definition parser.hpp:3292
Test for valid URL username character.
Definition parser.hpp:2979
Test for URL.
Definition parser.hpp:3432
Test for HTTP agent.
Definition parser.hpp:6765
Test for HTTP any type.
Definition parser.hpp:5908
Test for HTTP asterisk.
Definition parser.hpp:6536
Test for HTTP cookie parameter (RFC2109)
Definition parser.hpp:6631
Test for HTTP cookie (RFC2109)
Definition parser.hpp:6687
std::list< http_cookie_parameter > params
List of cookie parameters.
Definition parser.hpp:6699
http_token name
Cookie name.
Definition parser.hpp:6697
http_value value
Cookie value.
Definition parser.hpp:6698
Test for HTTP language (RFC1766)
Definition parser.hpp:6404
Test for HTTP line break (RFC2616: CRLF | LF)
Definition parser.hpp:5590
Test for HTTP parameter (RFC2616: parameter)
Definition parser.hpp:5856
http_token name
Parameter name.
Definition parser.hpp:5865
http_value value
Parameter value.
Definition parser.hpp:5866
Test for HTTP protocol.
Definition parser.hpp:6840
uint16_t version
HTTP protocol version: 0x100 = 1.0, 0x101 = 1.1...
Definition parser.hpp:6862
Test for HTTP quoted string (RFC2616: quoted-string)
Definition parser.hpp:5749
stdex::interval< size_t > content
String content (without quotes)
Definition parser.hpp:5758
Test for HTTP request.
Definition parser.hpp:6941
Test for HTTP space (RFC2616: LWS)
Definition parser.hpp:5626
Test for HTTP text character (RFC2616: TEXT)
Definition parser.hpp:5662
Test for HTTP token (RFC2616: token - tolerates non-ASCII)
Definition parser.hpp:5695
Test for HTTP URL parameter.
Definition parser.hpp:6229
Test for HTTP URL path segment.
Definition parser.hpp:6141
Test for HTTP URL path segment.
Definition parser.hpp:6174
std::vector< http_url_path_segment > segments
Path segments.
Definition parser.hpp:6182
Test for HTTP URL port.
Definition parser.hpp:6085
Test for HTTP URL server.
Definition parser.hpp:6048
Test for HTTP URL.
Definition parser.hpp:6306
Collection of HTTP values.
Definition parser.hpp:7177
Test for HTTP value (RFC2616: value)
Definition parser.hpp:5812
http_quoted_string string
Value when matched as quoted string.
Definition parser.hpp:5821
http_token token
Value when matched as token.
Definition parser.hpp:5822
Test for HTTP weight factor.
Definition parser.hpp:6467
float value
Calculated value of the weight factor.
Definition parser.hpp:6480
Test for HTTP weighted value.
Definition parser.hpp:6559
Base template for collection-holding parsers.
Definition parser.hpp:986
Test for any SGML code point.
Definition parser.hpp:269
Test for any SGML code point from a given string of SGML code points.
Definition parser.hpp:792
Test for specific SGML code point.
Definition parser.hpp:357
Test for valid DNS domain SGML character.
Definition parser.hpp:2851
Test for valid IPv6 address scope ID SGML character.
Definition parser.hpp:2541
Test for any SGML punctuation code point.
Definition parser.hpp:522
Test for any SGML space code point.
Definition parser.hpp:444
Test for any SGML space or punctuation code point.
Definition parser.hpp:599
Test for SGML given string.
Definition parser.hpp:882
Test for valid URL password SGML character.
Definition parser.hpp:3133
Test for valid URL path SGML character.
Definition parser.hpp:3239
Test for valid URL username SGML character.
Definition parser.hpp:3031
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:8044
stdex::interval< size_t > name
attribute name position in source
Definition parser.hpp:8045
stdex::interval< size_t > value
attribute value position in source
Definition parser.hpp:8046
Definition parser.hpp:7203