23#include <netinet/in.h>
35#pragma warning(disable: 4100)
38#define ENUM_FLAG_OPERATOR(T,X) \
39inline 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)); } \
40inline 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); } \
41inline 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)); } \
42inline T& operator X= (T& lhs, const T rhs) { return lhs = lhs X rhs; } \
43inline T& operator X= (T& lhs, const std::underlying_type_t<T> rhs) { return lhs = lhs X rhs; }
44#define ENUM_FLAGS(T, type) \
46inline T operator ~ (T t) { return (T) (~static_cast<std::underlying_type_t <T>>(t)); } \
47ENUM_FLAG_OPERATOR(T,|) \
48ENUM_FLAG_OPERATOR(T,^) \
49ENUM_FLAG_OPERATOR(T,&) \
53#elif defined(__APPLE__)
54#define s6_words __u6_addr.__u6_addr16
56#define s6_words s6_addr16
66 constexpr int match_default = 0;
67 constexpr int match_case_insensitive = 0x1;
68 constexpr int match_multiline = 0x2;
81 _In_reads_or_z_opt_(end)
const T* text,
82 _In_ size_t start = 0,
86 for (
size_t i = start; i < end && text[i]; i++)
87 if (match(text, i, end,
flags))
93 _In_reads_or_z_opt_(end)
const T* text,
94 _In_ size_t start = 0,
98 return do_match(text, start, end,
flags);
102 _In_ const std::basic_string_view<T, std::char_traits<T>> text,
103 _In_ size_t start = 0,
107 return match(text.data(), start, std::min<size_t>(end, text.size()),
flags);
110 virtual void invalidate()
118 virtual bool do_match(
119 _In_reads_or_z_opt_(end)
const T* text,
120 _In_ size_t start = 0,
127 if (text[start] ==
'&') {
129 const auto&
ctype = std::use_facet<std::ctype<T>>(m_locale);
138 if (
n >= 2 && text[start + 1] ==
'#') {
141 if (text[start + 2] ==
'x' || text[start + 2] ==
'X')
142 unicode = strtou32(text + start + 3,
n - 2,
nullptr, 16);
144 unicode = strtou32(text + start + 2,
n - 1,
nullptr, 10);
151 ucs4_to_surrogate_pair(buf,
unicode);
175 buf[0] = text[start];
182 std::locale m_locale;
185 using parser = basic_parser<char>;
186 using wparser = basic_parser<wchar_t>;
188 using tparser = wparser;
190 using tparser = parser;
192 using sgml_parser = basic_parser<char>;
201 virtual bool do_match(
202 _In_reads_or_z_opt_(end)
const T* text,
203 _In_ size_t start = 0,
207 _Assume_(text || start >= end);
208 if (start < end && text[start]) {
209 this->interval.
start = this->interval.
end = start;
236 virtual bool do_match(
237 _In_reads_or_z_opt_(end)
const T* text,
238 _In_ size_t start = 0,
242 _Assume_(text || start >= end);
243 if (start < end && text[start]) {
244 this->interval.
end = (this->interval.
start = start) + 1;
269 virtual bool do_match(
270 _In_reads_or_z_(end)
const char* text,
271 _In_ size_t start = 0,
275 _Assume_(text || start >= end);
276 if (start < end && text[start]) {
277 if (text[start] ==
'&') {
279 const auto&
ctype = std::use_facet<std::ctype<char>>(m_locale);
280 for (this->interval.
end = start + 1; this->interval.
end < end && text[this->interval.
end]; this->interval.
end++)
281 if (text[this->interval.
end] ==
';') {
282 this->interval.
end++;
283 this->interval.
start = start;
290 this->interval.
end = (this->interval.
start = start) + 1;
312 virtual bool do_match(
313 _In_reads_or_z_opt_(end)
const T* text,
314 _In_ size_t start = 0,
318 _Assume_(text || start >= end);
319 if (start < end && text[start]) {
321 if (
flags & match_case_insensitive) {
322 const auto&
ctype = std::use_facet<std::ctype<T>>(this->m_locale);
323 r =
ctype.tolower(text[start]) ==
ctype.tolower(m_chr);
326 r = text[start] == m_chr;
327 if ((
r && !m_invert) || (!
r && m_invert)) {
328 this->interval.
end = (this->interval.
start = start) + 1;
365 virtual bool do_match(
366 _In_reads_or_z_(end)
const char* text,
367 _In_ size_t start = 0,
371 _Assume_(text || start >= end);
372 if (start < end && text[start]) {
375 bool r = ((
flags & match_case_insensitive) ?
376 stdex::strnicmp(
chr,
SIZE_MAX, m_chr.data(), m_chr.size(), m_locale) :
377 stdex::strncmp(
chr,
SIZE_MAX, m_chr.data(), m_chr.size())) == 0;
378 if ((
r && !m_invert) || (!
r && m_invert)) {
379 this->interval.
start = start;
404 virtual bool do_match(
405 _In_reads_or_z_opt_(end)
const T* text,
406 _In_ size_t start = 0,
410 _Assume_(text || start >= end);
411 if (start < end && text[start]) {
413 ((
flags & match_multiline) || !stdex::islbreak(text[start])) &&
414 std::use_facet<std::ctype<T>>(this->m_locale).is(std::ctype_base::space, text[start]);
415 if ((
r && !m_invert) || (!
r && m_invert)) {
416 this->interval.
end = (this->interval.
start = start) + 1;
446 virtual bool do_match(
447 _In_reads_or_z_(end)
const char* text,
448 _In_ size_t start = 0,
452 _Assume_(text || start >= end);
453 if (start < end && text[start]) {
459 std::use_facet<std::ctype<wchar_t>>(m_locale).scan_not(std::ctype_base::space,
chr,
chr_end) ==
chr_end;
460 if ((
r && !m_invert) || (!
r && m_invert)) {
461 this->interval.
start = start;
484 virtual bool do_match(
485 _In_reads_or_z_opt_(end)
const T* text,
486 _In_ size_t start = 0,
490 _Assume_(text || start >= end);
491 if (start < end && text[start]) {
492 bool r = std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::punct, text[start]);
493 if ((
r && !m_invert) || (!
r && m_invert)) {
494 this->interval.
end = (this->interval.
start = start) + 1;
524 virtual bool do_match(
525 _In_reads_or_z_(end)
const char* text,
526 _In_ size_t start = 0,
530 _Assume_(text || start >= end);
531 if (start < end && text[start]) {
536 if ((
r && !m_invert) || (!
r && m_invert)) {
537 this->interval.
start = start;
559 virtual bool do_match(
560 _In_reads_or_z_opt_(end)
const T* text,
561 _In_ size_t start = 0,
565 _Assume_(text || start >= end);
566 if (start < end && text[start]) {
568 ((
flags & match_multiline) || !stdex::islbreak(text[start])) &&
569 std::use_facet<std::ctype<T>>(this->m_locale).is(std::ctype_base::space | std::ctype_base::punct, text[start]);
570 if ((
r && !m_invert) || (!
r && m_invert)) {
571 this->interval.
end = (this->interval.
start = start) + 1;
601 virtual bool do_match(
602 _In_reads_or_z_(end)
const char* text,
603 _In_ size_t start = 0,
607 _Assume_(text || start >= end);
608 if (start < end && text[start]) {
614 std::use_facet<std::ctype<wchar_t>>(m_locale).scan_not(std::ctype_base::space | std::ctype_base::punct,
chr,
chr_end) ==
chr_end;
615 if ((
r && !m_invert) || (!
r && m_invert)) {
616 this->interval.
start = start;
635 virtual bool do_match(
636 _In_reads_or_z_opt_(end)
const T* text,
637 _In_ size_t start = 0,
641 _Assume_(text || !end);
642 _Assume_(text || start >= end);
643 bool r = start == 0 || (start <= end && stdex::islbreak(text[start - 1]));
644 if ((
r && !m_invert) || (!
r && m_invert)) {
645 this->interval.
end = this->interval.
start = start;
674 virtual bool do_match(
675 _In_reads_or_z_opt_(end)
const T* text,
676 _In_ size_t start = 0,
680 _Assume_(text || start >= end);
681 bool r = start >= end || !text[start] || stdex::islbreak(text[start]);
682 if ((
r && !m_invert) || (!
r && m_invert)) {
683 this->interval.
end = this->interval.
start = start;
712 virtual void invalidate()
721 virtual bool do_match(
722 _In_reads_or_z_opt_(end)
const T* text,
723 _In_ size_t start = 0,
738 _In_reads_or_z_(
count)
const T* set,
741 _In_ const std::locale&
locale = std::locale()) :
745 m_set.assign(set, set + stdex::strnlen(set,
count));
749 virtual bool do_match(
750 _In_reads_or_z_opt_(end)
const T* text,
751 _In_ size_t start = 0,
755 _Assume_(text || start >= end);
756 if (start < end && text[start]) {
757 const T* set = m_set.data();
758 size_t r = (
flags & match_case_insensitive) ?
759 stdex::strnichr(set, m_set.size(), text[start], this->m_locale) :
760 stdex::strnchr(set, m_set.size(), text[start]);
761 if ((
r != stdex::npos && !this->m_invert) || (
r == stdex::npos && this->m_invert)) {
762 this->hit_offset =
r;
763 this->interval.
end = (this->interval.
start = start) + 1;
772 std::basic_string<T> m_set;
793 m_set = sgml2str(set,
count);
797 virtual bool do_match(
798 _In_reads_or_z_(end)
const char* text,
799 _In_ size_t start = 0,
803 _Assume_(text || start >= end);
804 if (start < end && text[start]) {
807 const wchar_t* set = m_set.data();
808 size_t r = (
flags & match_case_insensitive) ?
809 stdex::strnistr(set, m_set.size(),
chr, m_locale) :
810 stdex::strnstr(set, m_set.size(),
chr);
811 if ((
r != stdex::npos && !m_invert) || (
r == stdex::npos && m_invert)) {
813 this->interval.
start = start;
833 _In_reads_or_z_(
count)
const T*
str,
835 _In_ const std::locale&
locale = std::locale()) :
841 virtual bool do_match(
842 _In_reads_or_z_opt_(end)
const T* text,
843 _In_ size_t start = 0,
847 _Assume_(text || start >= end);
850 n = std::min<size_t>(end - start,
m);
851 bool r = ((
flags & match_case_insensitive) ?
852 stdex::strnicmp(text + start,
n, m_str.data(),
m, this->m_locale) :
853 stdex::strncmp(text + start,
n, m_str.data(),
m)) == 0;
855 this->interval.
end = (this->interval.
start = start) +
n;
862 std::basic_string<T> m_str;
885 virtual bool do_match(
886 _In_reads_or_z_(end)
const char* text,
887 _In_ size_t start = 0,
891 _Assume_(text || start >= end);
892 const wchar_t*
str = m_str.data();
894 const auto&
ctype = std::use_facet<std::ctype<wchar_t>>(m_locale);
895 for (this->interval.
end = start;;) {
897 this->interval.
start = start;
935 virtual bool do_match(
936 _In_reads_or_z_opt_(end)
const T* text,
937 _In_ size_t start = 0,
941 _Assume_(text || start >= end);
942 this->interval.
start = this->interval.
end = start;
943 for (
size_t i = 0; ; i++) {
955 this->interval.
end =
m_el->interval.end;
961 std::shared_ptr<basic_parser<T>>
m_el;
989 _In_ const std::locale&
locale = std::locale()) :
993 m_collection.reserve(
count);
994 for (
size_t i = 0; i <
count; i++)
995 m_collection.push_back(
el[i]);
1000 _In_ const std::locale&
locale = std::locale()) :
1005 virtual void invalidate()
1007 for (
auto&
el : m_collection)
1013 std::vector<std::shared_ptr<basic_parser<T>>> m_collection;
1026 _In_ const std::locale&
locale = std::locale()) :
1032 _In_ const std::locale&
locale = std::locale()) :
1037 virtual bool do_match(
1038 _In_reads_or_z_opt_(end)
const T* text,
1039 _In_ size_t start = 0,
1043 _Assume_(text || start >= end);
1044 this->interval.
end = start;
1045 for (
auto i = this->m_collection.begin(); i != this->m_collection.end(); ++i) {
1047 for (++i; i != this->m_collection.end(); ++i)
1052 this->interval.
end = (*i)->interval.end;
1054 this->interval.
start = start;
1084 _In_ const std::locale&
locale = std::locale()) :
1091 _In_ const std::locale&
locale = std::locale()) :
1096 virtual void invalidate()
1105 virtual bool do_match(
1106 _In_reads_or_z_opt_(end)
const T* text,
1107 _In_ size_t start = 0,
1111 _Assume_(text || start >= end);
1113 for (
auto i = this->m_collection.begin(); i != this->m_collection.end(); ++i, ++hit_offset) {
1114 if ((*i)->match(text, start, end,
flags)) {
1116 for (++i; i != this->m_collection.end(); ++i)
1139 template <
class T,
class T_parser = basic_
string<T>>
1146 _In_ const std::locale&
locale = std::locale()) :
1180 this->m_collection.reserve(
n);
1193 this->m_collection.push_back(std::move(std::make_shared<T_parser>(
str,
SIZE_MAX,
this->m_locale)));
1194 (p =
va_arg(params,
const T*)) !=
nullptr;
1195 this->m_collection.push_back(std::move(std::make_shared<T_parser>(p,
SIZE_MAX, this->m_locale))));
1218 _In_ const std::locale&
locale = std::locale()) :
1224 _In_ const std::locale&
locale = std::locale()) :
1229 virtual bool do_match(
1230 _In_reads_or_z_opt_(end)
const T* text,
1231 _In_ size_t start = 0,
1235 _Assume_(text || start >= end);
1236 for (
auto&
el : this->m_collection)
1238 if (match_recursively(text, start, end,
flags)) {
1239 this->interval.
start = start;
1246 bool match_recursively(
1247 _In_reads_or_z_opt_(end)
const T* text,
1248 _In_ size_t start = 0,
1253 for (
auto&
el : this->m_collection) {
1257 if (
el->match(text, start, end,
flags)) {
1268 this->interval.
end = start;
1296 virtual void invalidate()
1324 _In_ const std::locale&
locale = std::locale()) :
1339 virtual bool do_match(
1340 _In_reads_or_z_opt_(end)
const T* text,
1341 _In_ size_t start = 0,
1345 _Assume_(text || start >= end);
1346 for (this->interval.
end = start,
this->value = 0; this->interval.
end < end && text[this->interval.
end];) {
1362 this->interval.
start = start;
1369 std::shared_ptr<basic_parser<T>>
1401 _In_ const std::locale&
locale = std::locale()) :
1406 m_separator(separator)
1409 virtual void invalidate()
1420 virtual bool do_match(
1421 _In_reads_or_z_opt_(end)
const T* text,
1422 _In_ size_t start = 0,
1426 _Assume_(text || start >= end);
1427 if (m_digits->match(text, start, end,
flags)) {
1429 this->
value = m_digits->value;
1432 this->interval.
start = start;
1433 this->interval.
end = m_digits->interval.end;
1434 if (m_digits->interval.size() <= 3) {
1438 (hit_offset ==
SIZE_MAX || hit_offset == m_separator->hit_offset) &&
1439 m_digits->match(text, m_separator->interval.end, end,
flags) &&
1440 m_digits->interval.size() == 3)
1443 this->
value = this->
value * 1000 + m_digits->value;
1446 this->interval.
end = m_digits->interval.end;
1447 hit_offset = m_separator->hit_offset;
1458 std::shared_ptr<basic_integer10<T>> m_digits;
1459 std::shared_ptr<basic_set<T>> m_separator;
1462 using integer10ts = basic_integer10ts<char>;
1463 using winteger10ts = basic_integer10ts<wchar_t>;
1465 using tinteger10ts = winteger10ts;
1467 using tinteger10ts = integer10ts;
1469 using sgml_integer10ts = basic_integer10ts<char>;
1495 _In_ const std::locale&
locale = std::locale()) :
1516 virtual bool do_match(
1517 _In_reads_or_z_opt_(end)
const T* text,
1518 _In_ size_t start = 0,
1522 _Assume_(text || start >= end);
1523 for (this->interval.
end = start,
this->value = 0; this->interval.
end < end && text[this->interval.
end];) {
1535 else if (m_digit_10->match(text,
this->
interval.
end, end,
flags)) {
dig = 10; this->interval.
end = m_digit_10->interval.end; }
1536 else if (m_digit_11->match(text,
this->
interval.
end, end,
flags)) {
dig = 11; this->interval.
end = m_digit_11->interval.end; }
1537 else if (m_digit_12->match(text,
this->
interval.
end, end,
flags)) {
dig = 12; this->interval.
end = m_digit_12->interval.end; }
1538 else if (m_digit_13->match(text,
this->
interval.
end, end,
flags)) {
dig = 13; this->interval.
end = m_digit_13->interval.end; }
1539 else if (m_digit_14->match(text,
this->
interval.
end, end,
flags)) {
dig = 14; this->interval.
end = m_digit_14->interval.end; }
1540 else if (m_digit_15->match(text,
this->
interval.
end, end,
flags)) {
dig = 15; this->interval.
end = m_digit_15->interval.end; }
1545 this->interval.
start = start;
1552 std::shared_ptr<basic_parser<T>>
1597 _In_ const std::locale&
locale = std::locale()) :
1611 virtual bool do_match(
1612 _In_reads_or_z_opt_(end)
const T* text,
1613 _In_ size_t start = 0,
1617 _Assume_(text || start >= end);
1627 else if (m_digit_100 && m_digit_100->match(text,
this->
interval.
end, end,
flags)) {
dig[0] = 100;
end2 = m_digit_100->interval.end; }
1628 else if (m_digit_500 && m_digit_500->match(text,
this->
interval.
end, end,
flags)) {
dig[0] = 500;
end2 = m_digit_500->interval.end; }
1629 else if (m_digit_1000 && m_digit_1000->match(text,
this->
interval.
end, end,
flags)) {
dig[0] = 1000;
end2 = m_digit_1000->interval.end; }
1630 else if (m_digit_5000 && m_digit_5000->match(text,
this->
interval.
end, end,
flags)) {
dig[0] = 5000;
end2 = m_digit_5000->interval.end; }
1631 else if (m_digit_10000 && m_digit_10000->match(text,
this->
interval.
end, end,
flags)) {
dig[0] = 10000;
end2 = m_digit_10000->interval.end; }
1643 this->
value += dig[0];
1646 (
dig[1] == 1 && (
dig[0] == 5 ||
dig[0] == 10)) ||
1647 (
dig[1] == 10 && (
dig[0] == 50 ||
dig[0] == 100)) ||
1648 (
dig[1] == 100 && (
dig[0] == 500 ||
dig[0] == 1000)) ||
1649 (
dig[1] == 1000 && (
dig[0] == 5000 ||
dig[0] == 10000)))
1656 this->
value -= dig[1];
1660 this->
value += dig[0];
1668 this->interval.
start = start;
1675 std::shared_ptr<basic_parser<T>>
1707 _In_ const std::locale&
locale = std::locale()) :
1714 virtual void invalidate()
1716 numerator->invalidate();
1717 fraction_line->invalidate();
1718 denominator->invalidate();
1722 std::shared_ptr<basic_parser<T>> numerator;
1723 std::shared_ptr<basic_parser<T>> fraction_line;
1724 std::shared_ptr<basic_parser<T>> denominator;
1727 virtual bool do_match(
1728 _In_reads_or_z_opt_(end)
const T* text,
1729 _In_ size_t start = 0,
1733 _Assume_(text || start >= end);
1734 if (numerator->match(text, start, end,
flags) &&
1735 fraction_line->match(text, numerator->interval.end, end,
flags) &&
1736 denominator->match(text, fraction_line->interval.end, end,
flags))
1738 this->interval.
start = start;
1739 this->interval.
end = denominator->interval.end;
1742 numerator->invalidate();
1743 fraction_line->invalidate();
1744 denominator->invalidate();
1771 _In_ const std::locale&
locale = std::locale()) :
1779 virtual void invalidate()
1782 separator->invalidate();
1783 guest->invalidate();
1787 std::shared_ptr<basic_parser<T>> home;
1788 std::shared_ptr<basic_parser<T>> separator;
1789 std::shared_ptr<basic_parser<T>> guest;
1792 virtual bool do_match(
1793 _In_reads_or_z_opt_(end)
const T* text,
1794 _In_ size_t start = 0,
1798 _Assume_(text || start >= end);
1799 this->interval.
end = start;
1804 this->interval.
end = home->interval.end;
1808 for (; m_space->match(text, this->interval.
end, end,
space_match_flags); this->interval.
end = m_space->interval.end);
1811 this->interval.
end = separator->interval.end;
1815 for (; m_space->match(text, this->interval.
end, end,
space_match_flags); this->interval.
end = m_space->interval.end);
1818 this->interval.
end = guest->interval.end;
1822 this->interval.
start = start;
1827 separator->invalidate();
1828 guest->invalidate();
1833 std::shared_ptr<basic_parser<T>> m_space;
1857 _In_ const std::locale&
locale = std::locale()) :
1865 virtual void invalidate()
1880 virtual bool do_match(
1881 _In_reads_or_z_opt_(end)
const T* text,
1882 _In_ size_t start = 0,
1886 _Assume_(text || start >= end);
1887 this->interval.
end = start;
1909 this->interval.
start = start;
1910 this->interval.
end =
number->interval.end;
1922 using signed_numeral = basic_signed_numeral<char>;
1923 using wsigned_numeral = basic_signed_numeral<wchar_t>;
1925 using tsigned_numeral = wsigned_numeral;
1927 using tsigned_numeral = signed_numeral;
1929 using sgml_signed_numeral = basic_signed_numeral<char>;
1945 _In_ const std::locale&
locale = std::locale()) :
1955 virtual void invalidate()
1972 virtual bool do_match(
1973 _In_reads_or_z_opt_(end)
const T* text,
1974 _In_ size_t start = 0,
1978 _Assume_(text || start >= end);
1979 this->interval.
end = start;
2007 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);
2009 this->interval.
start = start;
2014 this->interval.
start = start;
2022 this->interval.
start = start;
2030 this->interval.
start = start;
2044 std::shared_ptr<basic_parser<T>> m_space;
2047 using mixed_numeral = basic_mixed_numeral<char>;
2048 using wmixed_numeral = basic_mixed_numeral<wchar_t>;
2050 using tmixed_numeral = wmixed_numeral;
2052 using tmixed_numeral = mixed_numeral;
2054 using sgml_mixed_numeral = basic_mixed_numeral<char>;
2074 _In_ const std::locale&
locale = std::locale()) :
2086 value(std::numeric_limits<double>::quiet_NaN())
2089 virtual void invalidate()
2101 value = std::numeric_limits<double>::quiet_NaN();
2118 virtual bool do_match(
2119 _In_reads_or_z_opt_(end)
const T* text,
2120 _In_ size_t start = 0,
2124 _Assume_(text || start >= end);
2125 this->interval.
end = start;
2159 if (
integer->interval.empty() &&
2211 this->interval.
start = start;
2216 using scientific_numeral = basic_scientific_numeral<char>;
2217 using wscientific_numeral = basic_scientific_numeral<wchar_t>;
2219 using tscientific_numeral = wscientific_numeral;
2221 using tscientific_numeral = scientific_numeral;
2223 using sgml_scientific_numeral = basic_scientific_numeral<char>;
2240 _In_ const std::locale&
locale = std::locale()) :
2251 virtual void invalidate()
2272 virtual bool do_match(
2273 _In_reads_or_z_opt_(end)
const T* text,
2274 _In_ size_t start = 0,
2278 _Assume_(text || start >= end);
2279 this->interval.
end = start;
2325 if (
integer->interval.empty() &&
2340 this->interval.
start = start;
2345 using monetary_numeral = basic_monetary_numeral<char>;
2346 using wmonetary_numeral = basic_monetary_numeral<wchar_t>;
2348 using tmonetary_numeral = wmonetary_numeral;
2350 using tmonetary_numeral = monetary_numeral;
2352 using sgml_monetary_numeral = basic_monetary_numeral<char>;
2373 _In_ const std::locale&
locale = std::locale()) :
2385 m_separator(separator)
2390 virtual void invalidate()
2408 virtual bool do_match(
2409 _In_reads_or_z_opt_(end)
const T* text,
2410 _In_ size_t start = 0,
2414 _Assume_(text || start >= end);
2415 this->interval.
end = start;
2419 for (i = 0; i < 4; i++) {
2422 this->interval.
end = m_separator->interval.end;
2430 for (
x = 0; this->interval.
end < end && text[this->interval.
end];) {
2433 else if (m_digit_1->match(text, this->interval.end, end, flags)) { dig = 1; digit_end = m_digit_1->interval.end; }
2434 else if (m_digit_2->match(text, this->interval.end, end, flags)) { dig = 2; digit_end = m_digit_2->interval.end; }
2435 else if (m_digit_3->match(text, this->interval.end, end, flags)) { dig = 3; digit_end = m_digit_3->interval.end; }
2436 else if (m_digit_4->match(text, this->interval.end, end, flags)) { dig = 4; digit_end = m_digit_4->interval.end; }
2437 else if (m_digit_5->match(text, this->interval.end, end, flags)) { dig = 5; digit_end = m_digit_5->interval.end; }
2438 else if (m_digit_6->match(text, this->interval.end, end, flags)) { dig = 6; digit_end = m_digit_6->interval.end; }
2439 else if (m_digit_7->match(text, this->interval.end, end, flags)) { dig = 7; digit_end = m_digit_7->interval.end; }
2440 else if (m_digit_8->match(text, this->interval.end, end, flags)) { dig = 8; digit_end = m_digit_8->interval.end; }
2441 else if (m_digit_9->match(text, this->interval.end, end, flags)) { dig = 9; digit_end = m_digit_9->interval.end; }
2443 size_t x_n = x * 10 + dig;
2446 this->interval.
end = digit_end;
2455 value.s_addr = (
value.s_addr << 8) | (uint8_t)x;
2460 this->interval.
start = start;
2468 std::shared_ptr<basic_parser<T>>
2479 std::shared_ptr<basic_parser<T>> m_separator;
2482 using ipv4_address = basic_ipv4_address<char>;
2483 using wipv4_address = basic_ipv4_address<wchar_t>;
2485 using tipv4_address = wipv4_address;
2487 using tipv4_address = ipv4_address;
2489 using sgml_ipv4_address = basic_ipv4_address<char>;
2501 virtual bool do_match(
2502 _In_reads_or_z_opt_(end)
const T* text,
2503 _In_ size_t start = 0,
2507 _Assume_(text || start >= end);
2508 if (start < end && text[start]) {
2509 if (text[start] ==
'-' ||
2510 text[start] ==
'_' ||
2511 text[start] ==
':' ||
2512 std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::alnum, text[start]))
2514 this->interval.
end = (this->interval.
start = start) + 1;
2540 virtual bool do_match(
2541 _In_reads_or_z_(end)
const char* text,
2542 _In_ size_t start = 0,
2546 _Assume_(text || start >= end);
2547 if (start < end && text[start]) {
2551 if (((
chr[0] ==
L'-' ||
2553 chr[0] ==
L':') &&
chr[1] == 0) ||
2556 this->interval.
start = start;
2592 _In_ const std::locale&
locale = std::locale()) :
2610 m_separator(separator),
2617 virtual void invalidate()
2645 virtual bool do_match(
2646 _In_reads_or_z_opt_(end)
const T* text,
2647 _In_ size_t start = 0,
2651 _Assume_(text || start >= end);
2652 this->interval.
end = start;
2656 for (i = 0; i < 8; i++) {
2661 this->interval.
end = m_separator->interval.end;
2668 this->interval.
end = m_separator->interval.end;
2687 for (
x = 0; this->interval.
end < end && text[this->interval.
end];) {
2707 if (
x_n <= 0xffff) {
2730 this->value.s6_words[--
j] = this->value.s6_words[--
k];
2734 this->value.s6_words[--
j] = 0;
2742 if (m_scope_id_separator && m_scope_id_separator->match(text,
this->
interval.
end, end,
flags) &&
2748 this->interval.
start = start;
2756 std::shared_ptr<basic_parser<T>>
2773 std::shared_ptr<basic_parser<T>> m_separator, m_scope_id_separator;
2776 using ipv6_address = basic_ipv6_address<char>;
2777 using wipv6_address = basic_ipv6_address<wchar_t>;
2779 using tipv6_address = wipv6_address;
2781 using tipv6_address = ipv6_address;
2783 using sgml_ipv6_address = basic_ipv6_address<char>;
2794 _In_ const std::locale&
locale = std::locale()) :
2803 virtual bool do_match(
2804 _In_reads_or_z_opt_(end)
const T* text,
2805 _In_ size_t start = 0,
2809 _Assume_(text || start >= end);
2810 if (start < end && text[start]) {
2811 if ((
'A' <= text[start] && text[start] <=
'Z') ||
2812 (
'a' <= text[start] && text[start] <=
'z') ||
2813 (
'0' <= text[start] && text[start] <=
'9'))
2815 else if (text[start] ==
'-')
2817 else if (m_allow_idn && std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::alnum, text[start]))
2823 this->interval.
end = (this->interval.
start = start) + 1;
2833 using dns_domain_char = basic_dns_domain_char<char>;
2834 using wdns_domain_char = basic_dns_domain_char<wchar_t>;
2836 using tdns_domain_char = wdns_domain_char;
2838 using tdns_domain_char = dns_domain_char;
2849 _In_ const std::locale&
locale = std::locale()) :
2854 virtual bool do_match(
2855 _In_reads_or_z_(end)
const char* text,
2856 _In_ size_t start = 0,
2860 _Assume_(text || start >= end);
2861 if (start < end && text[start]) {
2865 if (((
'A' <=
chr[0] &&
chr[0] <=
'Z') ||
2866 (
'a' <=
chr[0] &&
chr[0] <=
'z') ||
2867 (
'0' <=
chr[0] &&
chr[0] <=
'9')) &&
chr[1] == 0)
2869 else if (
chr[0] ==
'-' &&
chr[1] == 0)
2871 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)
2877 this->interval.
start = start;
2896 _In_ const std::locale&
locale = std::locale()) :
2900 m_separator(separator)
2904 virtual bool do_match(
2905 _In_reads_or_z_opt_(end)
const T* text,
2906 _In_ size_t start = 0,
2910 _Assume_(text || start >= end);
2911 size_t i = start,
count;
2913 if (m_domain_char->match(text, i, end,
flags) &&
2914 m_domain_char->allow_on_edge)
2917 this->interval.
end = i = m_domain_char->interval.end;
2918 while (i < end && text[i]) {
2919 if (m_domain_char->allow_on_edge &&
2920 m_separator->match(text, i, end,
flags))
2924 this->interval.
end = i = m_separator->interval.end;
2926 this->interval.
end = i;
2927 i = m_separator->interval.end;
2931 if (m_domain_char->match(text, i, end,
flags)) {
2932 if (m_domain_char->allow_on_edge)
2933 this->interval.
end = i = m_domain_char->interval.end;
2935 i = m_domain_char->interval.end;
2938 this->interval.
start = start;
2947 this->interval.
start = start;
2955 std::shared_ptr<basic_dns_domain_char<T>> m_domain_char;
2956 std::shared_ptr<basic_parser<T>> m_separator;
2978 virtual bool do_match(
2979 _In_reads_or_z_opt_(end)
const T* text,
2980 _In_ size_t start = 0,
2984 _Assume_(text || start >= end);
2985 if (start < end && text[start]) {
2986 if (text[start] ==
'-' ||
2987 text[start] ==
'.' ||
2988 text[start] ==
'_' ||
2989 text[start] ==
'~' ||
2990 text[start] ==
'%' ||
2991 text[start] ==
'!' ||
2992 text[start] ==
'$' ||
2993 text[start] ==
'&' ||
2994 text[start] ==
'\'' ||
2997 text[start] ==
'*' ||
2998 text[start] ==
'+' ||
2999 text[start] ==
',' ||
3000 text[start] ==
';' ||
3001 text[start] ==
'=' ||
3002 std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::alnum, text[start]))
3004 this->interval.
end = (this->interval.
start = start) + 1;
3030 virtual bool do_match(
3031 _In_reads_or_z_(end)
const char* text,
3032 _In_ size_t start = 0,
3036 _Assume_(text || start >= end);
3037 if (start < end && text[start]) {
3041 if (((
chr[0] ==
L'-' ||
3056 chr[0] ==
L'=') &&
chr[1] == 0) ||
3059 this->interval.
start = start;
3079 virtual bool do_match(
3080 _In_reads_or_z_opt_(end)
const T* text,
3081 _In_ size_t start = 0,
3085 _Assume_(text || start >= end);
3086 if (start < end && text[start]) {
3087 if (text[start] ==
'-' ||
3088 text[start] ==
'.' ||
3089 text[start] ==
'_' ||
3090 text[start] ==
'~' ||
3091 text[start] ==
'%' ||
3092 text[start] ==
'!' ||
3093 text[start] ==
'$' ||
3094 text[start] ==
'&' ||
3095 text[start] ==
'\'' ||
3096 text[start] ==
'(' ||
3097 text[start] ==
')' ||
3098 text[start] ==
'*' ||
3099 text[start] ==
'+' ||
3100 text[start] ==
',' ||
3101 text[start] ==
';' ||
3102 text[start] ==
'=' ||
3103 text[start] ==
':' ||
3104 std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::alnum, text[start]))
3106 this->interval.
end = (this->interval.
start = start) + 1;
3132 virtual bool do_match(
3133 _In_reads_or_z_(end)
const char* text,
3134 _In_ size_t start = 0,
3138 _Assume_(text || start >= end);
3139 if (start < end && text[start]) {
3143 if (((
chr[0] ==
L'-' ||
3159 chr[0] ==
L':') &&
chr[1] == 0) ||
3162 this->interval.
start = start;
3181 virtual bool do_match(
3182 _In_reads_or_z_opt_(end)
const T* text,
3183 _In_ size_t start = 0,
3187 _Assume_(text || start >= end);
3188 if (start < end && text[start]) {
3189 if (text[start] ==
'/' ||
3190 text[start] ==
'-' ||
3191 text[start] ==
'.' ||
3192 text[start] ==
'_' ||
3193 text[start] ==
'~' ||
3194 text[start] ==
'%' ||
3195 text[start] ==
'!' ||
3196 text[start] ==
'$' ||
3197 text[start] ==
'&' ||
3198 text[start] ==
'\'' ||
3199 text[start] ==
'(' ||
3200 text[start] ==
')' ||
3201 text[start] ==
'*' ||
3202 text[start] ==
'+' ||
3203 text[start] ==
',' ||
3204 text[start] ==
';' ||
3205 text[start] ==
'=' ||
3206 text[start] ==
':' ||
3207 text[start] ==
'@' ||
3208 text[start] ==
'?' ||
3209 text[start] ==
'#' ||
3210 std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::alnum, text[start]))
3212 this->interval.
end = (this->interval.
start = start) + 1;
3238 virtual bool do_match(
3239 _In_reads_or_z_(end)
const char* text,
3240 _In_ size_t start = 0,
3244 _Assume_(text || start >= end);
3245 if (start < end && text[start]) {
3249 if (((
chr[0] ==
L'/' ||
3269 chr[0] ==
L'#') &&
chr[1] == 0) ||
3272 this->interval.
start = start;
3292 _In_ const std::locale&
locale = std::locale()) :
3299 virtual void invalidate()
3315 virtual bool do_match(
3316 _In_reads_or_z_opt_(end)
const T* text,
3317 _In_ size_t start = 0,
3321 _Assume_(text || start >= end);
3323 this->interval.
end = start;
3334 path.
end = this->interval.
end;
3335 query.
start = this->interval.
end = m_query_start->interval.end;
3338 query.
end = this->interval.
end;
3342 query.
end = this->interval.
end;
3343 bookmark.
start = this->interval.
end = m_bookmark_start->interval.end;
3346 bookmark.
end = this->interval.
end;
3350 this->interval.
end = m_path_char->interval.end;
3352 bookmark.
end = this->interval.
end;
3356 this->interval.
start = start;
3360 this->interval.
end = m_path_char->interval.end;
3362 query.
end = this->interval.
end;
3366 this->interval.
start = start;
3370 path.
end = this->interval.
end;
3371 bookmark.
start = this->interval.
end = m_bookmark_start->interval.end;
3374 bookmark.
end = this->interval.
end;
3378 this->interval.
end = m_path_char->interval.end;
3380 bookmark.
end = this->interval.
end;
3384 this->interval.
start = start;
3388 this->interval.
end = m_path_char->interval.end;
3394 path.
end = this->interval.
end;
3395 this->interval.
start = start;
3407 std::shared_ptr<basic_parser<T>> m_path_char;
3408 std::shared_ptr<basic_parser<T>> m_query_start;
3409 std::shared_ptr<basic_parser<T>> m_bookmark_start;
3445 _In_ const std::locale&
locale = std::locale()) :
3465 virtual void invalidate()
3467 http_scheme->invalidate();
3468 ftp_scheme->invalidate();
3469 mailto_scheme->invalidate();
3470 file_scheme->invalidate();
3471 username->invalidate();
3472 password->invalidate();
3473 ipv4_host->invalidate();
3474 ipv6_host->invalidate();
3475 dns_host->invalidate();
3481 std::shared_ptr<basic_parser<T>> http_scheme;
3482 std::shared_ptr<basic_parser<T>> ftp_scheme;
3483 std::shared_ptr<basic_parser<T>> mailto_scheme;
3484 std::shared_ptr<basic_parser<T>> file_scheme;
3485 std::shared_ptr<basic_parser<T>> username;
3486 std::shared_ptr<basic_parser<T>> password;
3487 std::shared_ptr<basic_parser<T>> ipv4_host;
3488 std::shared_ptr<basic_parser<T>> ipv6_host;
3489 std::shared_ptr<basic_parser<T>> dns_host;
3490 std::shared_ptr<basic_parser<T>> port;
3491 std::shared_ptr<basic_parser<T>> path;
3494 virtual bool do_match(
3495 _In_reads_or_z_opt_(end)
const T* text,
3496 _In_ size_t start = 0,
3500 _Assume_(text || start >= end);
3502 this->interval.
end = start;
3505 m_colon->match(text, http_scheme->interval.end, end,
flags) &&
3506 m_slash->match(text, m_colon->interval.end, end,
flags) &&
3507 m_slash->match(text, m_slash->interval.end, end,
flags))
3510 this->interval.
end = m_slash->interval.end;
3511 ftp_scheme->invalidate();
3512 mailto_scheme->invalidate();
3513 file_scheme->invalidate();
3516 m_colon->match(text, ftp_scheme->interval.end, end,
flags) &&
3517 m_slash->match(text, m_colon->interval.end, end,
flags) &&
3518 m_slash->match(text, m_slash->interval.end, end,
flags))
3521 this->interval.
end = m_slash->interval.end;
3522 http_scheme->invalidate();
3523 mailto_scheme->invalidate();
3524 file_scheme->invalidate();
3527 m_colon->match(text, mailto_scheme->interval.end, end,
flags))
3530 this->interval.
end = m_colon->interval.end;
3531 http_scheme->invalidate();
3532 ftp_scheme->invalidate();
3533 file_scheme->invalidate();
3536 m_colon->match(text, file_scheme->interval.end, end,
flags) &&
3537 m_slash->match(text, m_colon->interval.end, end,
flags) &&
3538 m_slash->match(text, m_slash->interval.end, end,
flags))
3541 this->interval.
end = m_slash->interval.end;
3542 http_scheme->invalidate();
3543 ftp_scheme->invalidate();
3544 mailto_scheme->invalidate();
3548 http_scheme->invalidate();
3549 ftp_scheme->invalidate();
3550 mailto_scheme->invalidate();
3551 file_scheme->invalidate();
3554 if (ftp_scheme->interval) {
3556 if (m_colon->match(text, username->interval.end, end,
flags) &&
3557 password->match(text, m_colon->interval.end, end,
flags) &&
3558 m_at->match(text, password->interval.end, end,
flags))
3561 this->interval.
end = m_at->interval.end;
3565 this->interval.
end = m_at->interval.end;
3566 password->invalidate();
3569 username->invalidate();
3570 password->invalidate();
3574 username->invalidate();
3575 password->invalidate();
3580 this->interval.
end = ipv4_host->interval.end;
3581 ipv6_host->invalidate();
3582 dns_host->invalidate();
3586 ipv6_host->match(text, m_ip_lbracket->interval.end, end,
flags) &&
3587 m_ip_rbracket->match(text, ipv6_host->interval.end, end,
flags))
3590 this->interval.
end = m_ip_rbracket->interval.end;
3591 ipv4_host->invalidate();
3592 dns_host->invalidate();
3596 this->interval.
end = dns_host->interval.end;
3597 ipv4_host->invalidate();
3598 ipv6_host->invalidate();
3606 port->match(text, m_colon->interval.end, end,
flags))
3609 this->interval.
end = port->interval.end;
3616 this->interval.
end = path->interval.end;
3619 this->interval.
start = start;
3623 if (mailto_scheme->interval) {
3625 m_at->match(text, username->interval.end, end,
flags))
3628 this->interval.
end = m_at->interval.end;
3636 ipv4_host->match(text, m_ip_lbracket->interval.end, end,
flags) &&
3637 m_ip_rbracket->match(text, ipv4_host->interval.end, end,
flags))
3640 this->interval.
end = m_ip_rbracket->interval.end;
3641 ipv6_host->invalidate();
3642 dns_host->invalidate();
3646 ipv6_host->match(text, m_ip_lbracket->interval.end, end,
flags) &&
3647 m_ip_rbracket->match(text, ipv6_host->interval.end, end,
flags))
3650 this->interval.
end = m_ip_rbracket->interval.end;
3651 ipv4_host->invalidate();
3652 dns_host->invalidate();
3656 this->interval.
end = dns_host->interval.end;
3657 ipv4_host->invalidate();
3658 ipv6_host->invalidate();
3665 password->invalidate();
3668 this->interval.
start = start;
3672 if (file_scheme->interval) {
3675 this->interval.
end = path->interval.end;
3678 username->invalidate();
3679 password->invalidate();
3680 ipv4_host->invalidate();
3681 ipv6_host->invalidate();
3682 dns_host->invalidate();
3684 this->interval.
start = start;
3691 if (http_scheme->interval &&
3694 if (m_colon->match(text, username->interval.end, end,
flags) &&
3695 password->match(text, m_colon->interval.end, end,
flags) &&
3696 m_at->match(text, password->interval.end, end,
flags))
3699 this->interval.
end = m_at->interval.end;
3701 else if (m_at->match(text, username->interval.end, end,
flags)) {
3703 this->interval.
end = m_at->interval.end;
3704 password->invalidate();
3707 username->invalidate();
3708 password->invalidate();
3712 username->invalidate();
3713 password->invalidate();
3718 this->interval.
end = ipv4_host->interval.end;
3719 ipv6_host->invalidate();
3720 dns_host->invalidate();
3724 ipv6_host->match(text, m_ip_lbracket->interval.end, end,
flags) &&
3725 m_ip_rbracket->match(text, ipv6_host->interval.end, end,
flags))
3728 this->interval.
end = m_ip_rbracket->interval.end;
3729 ipv4_host->invalidate();
3730 dns_host->invalidate();
3734 this->interval.
end = dns_host->interval.end;
3735 ipv4_host->invalidate();
3736 ipv6_host->invalidate();
3744 port->match(text, m_colon->interval.end, end,
flags))
3747 this->interval.
end = port->interval.end;
3754 this->interval.
end = path->interval.end;
3757 this->interval.
start = start;
3761 std::shared_ptr<basic_parser<T>> m_colon;
3762 std::shared_ptr<basic_parser<T>> m_slash;
3763 std::shared_ptr<basic_parser<T>> m_at;
3764 std::shared_ptr<basic_parser<T>> m_ip_lbracket;
3765 std::shared_ptr<basic_parser<T>> m_ip_rbracket;
3792 _In_ const std::locale&
locale = std::locale()) :
3803 virtual void invalidate()
3805 username->invalidate();
3806 ipv4_host->invalidate();
3807 ipv6_host->invalidate();
3808 dns_host->invalidate();
3812 std::shared_ptr<basic_parser<T>> username;
3813 std::shared_ptr<basic_parser<T>> ipv4_host;
3814 std::shared_ptr<basic_parser<T>> ipv6_host;
3815 std::shared_ptr<basic_parser<T>> dns_host;
3818 virtual bool do_match(
3819 _In_reads_or_z_opt_(end)
const T* text,
3820 _In_ size_t start = 0,
3824 _Assume_(text || start >= end);
3826 if (username->match(text, start, end,
flags) &&
3827 m_at->match(text, username->interval.end, end,
flags))
3830 if (m_ip_lbracket->match(text, m_at->interval.end, end,
flags) &&
3831 ipv4_host->match(text, m_ip_lbracket->interval.end, end,
flags) &&
3832 m_ip_rbracket->match(text, ipv4_host->interval.end, end,
flags))
3835 this->interval.
end = m_ip_rbracket->interval.end;
3836 ipv6_host->invalidate();
3837 dns_host->invalidate();
3840 m_ip_lbracket->match(text, m_at->interval.end, end,
flags) &&
3841 ipv6_host->match(text, m_ip_lbracket->interval.end, end,
flags) &&
3842 m_ip_rbracket->match(text, ipv6_host->interval.end, end,
flags))
3845 this->interval.
end = m_ip_rbracket->interval.end;
3846 ipv4_host->invalidate();
3847 dns_host->invalidate();
3849 else if (dns_host->match(text, m_at->interval.end, end,
flags)) {
3851 this->interval.
end = dns_host->interval.end;
3852 ipv4_host->invalidate();
3853 ipv6_host->invalidate();
3857 this->interval.
start = start;
3866 std::shared_ptr<basic_parser<T>> m_at;
3867 std::shared_ptr<basic_parser<T>> m_ip_lbracket;
3868 std::shared_ptr<basic_parser<T>> m_ip_rbracket;
3893 _In_ const std::locale&
locale = std::locale()) :
3902 virtual void invalidate()
3908 mouth->invalidate();
3913 std::shared_ptr<basic_parser<T>>
apex;
3914 std::shared_ptr<basic_parser<T>>
eyes;
3915 std::shared_ptr<basic_parser<T>>
nose;
3919 virtual bool do_match(
3920 _In_reads_or_z_opt_(end)
const T* text,
3921 _In_ size_t start = 0,
3925 _Assume_(text || start >= end);
3931 mouth->invalidate();
3932 this->interval.
start = start;
3937 this->interval.
end = start;
3940 this->interval.
end =
apex->interval.end;
3948 hit_offset =
mouth->hit_offset;
3950 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);
3953 this->interval.
start = start;
3959 hit_offset =
mouth->hit_offset;
3961 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);
3965 this->interval.
start = start;
3974 mouth->invalidate();
3980 using emoticon = basic_emoticon<char>;
3981 using wemoticon = basic_emoticon<wchar_t>;
3983 using temoticon = wemoticon;
3985 using temoticon = emoticon;
3987 using sgml_emoticon = basic_emoticon<char>;
3992 enum date_format_t {
3993 date_format_none = 0,
3994 date_format_dmy = 0x1,
3995 date_format_mdy = 0x2,
3996 date_format_ymd = 0x4,
3997 date_format_ym = 0x8,
3998 date_format_my = 0x10,
3999 date_format_dm = 0x20,
4000 date_format_md = 0x40,
4017 _In_ const std::locale&
locale = std::locale()) :
4019 format(date_format_none),
4024 m_separator(separator),
4028 virtual void invalidate()
4030 if (day) day->invalidate();
4031 if (month) month->invalidate();
4032 if (year) year->invalidate();
4033 format = date_format_none;
4037 date_format_t format;
4038 std::shared_ptr<basic_integer<T>> day;
4039 std::shared_ptr<basic_integer<T>> month;
4040 std::shared_ptr<basic_integer<T>> year;
4043 virtual bool do_match(
4044 _In_reads_or_z_opt_(end)
const T* text,
4045 _In_ size_t start = 0,
4049 _Assume_(text || start >= end);
4052 if ((m_format_mask & date_format_dmy) == date_format_dmy) {
4053 if (day->match(text, start, end,
flags)) {
4054 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);
4056 size_t hit_offset = m_separator->hit_offset;
4057 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);
4059 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);
4061 m_separator->hit_offset == 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 is_valid(day->value, month->value))
4067 this->interval.
start = start;
4068 this->interval.
end = year->interval.end;
4069 format = date_format_dmy;
4078 if ((m_format_mask & date_format_mdy) == date_format_mdy) {
4079 if (month->match(text, start, end,
flags)) {
4080 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);
4082 size_t hit_offset = m_separator->hit_offset;
4083 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);
4085 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);
4087 m_separator->hit_offset == 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 is_valid(day->value, month->value))
4093 this->interval.
start = start;
4094 this->interval.
end = year->interval.end;
4095 format = date_format_mdy;
4104 if ((m_format_mask & date_format_ymd) == date_format_ymd) {
4105 if (year->match(text, start, end,
flags)) {
4106 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);
4108 size_t hit_offset = m_separator->hit_offset;
4109 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);
4111 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);
4113 m_separator->hit_offset == 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 is_valid(day->value, month->value))
4119 this->interval.
start = start;
4120 this->interval.
end = day->interval.end;
4121 format = date_format_ymd;
4130 if ((m_format_mask & date_format_ym) == date_format_ym) {
4131 if (year->match(text, start, end,
flags)) {
4132 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);
4134 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);
4138 if (day) day->invalidate();
4139 this->interval.
start = start;
4140 this->interval.
end = month->interval.end;
4141 format = date_format_ym;
4148 if ((m_format_mask & date_format_my) == date_format_my) {
4149 if (month->match(text, start, end,
flags)) {
4150 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);
4152 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);
4156 if (day) day->invalidate();
4157 this->interval.
start = start;
4158 this->interval.
end = year->interval.end;
4159 format = date_format_my;
4166 if ((m_format_mask & date_format_dm) == date_format_dm) {
4167 if (day->match(text, start, end,
flags)) {
4168 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);
4170 size_t hit_offset = m_separator->hit_offset;
4171 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);
4173 is_valid(day->value, month->value))
4175 if (year) year->invalidate();
4176 this->interval.
start = start;
4177 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);
4179 m_separator->hit_offset == hit_offset)
4180 this->interval.
end = m_separator->interval.end;
4182 this->interval.
end = month->interval.end;
4183 format = date_format_dm;
4190 if ((m_format_mask & date_format_md) == date_format_md) {
4191 if (month->match(text, start, end,
flags)) {
4192 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);
4194 size_t hit_offset = m_separator->hit_offset;
4195 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);
4197 is_valid(day->value, month->value))
4199 if (year) year->invalidate();
4200 this->interval.
start = start;
4201 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);
4203 m_separator->hit_offset == hit_offset)
4204 this->interval.
end = m_separator->interval.end;
4206 this->interval.
end = day->interval.end;
4207 format = date_format_md;
4214 if (day) day->invalidate();
4215 if (month) month->invalidate();
4216 if (year) year->invalidate();
4217 format = date_format_none;
4222 static bool is_valid(
size_t day,
size_t month)
4241 return 1 <= day && day <= 31;
4243 return 1 <= day && day <= 29;
4248 return 1 <= day && day <= 30;
4255 std::shared_ptr<basic_set<T>> m_separator;
4256 std::shared_ptr<basic_parser<T>> m_space;
4282 _In_ const std::locale&
locale = std::locale()) :
4288 m_separator(separator),
4292 virtual void invalidate()
4295 minute->invalidate();
4296 if (second) second->invalidate();
4297 if (millisecond) millisecond->invalidate();
4301 std::shared_ptr<basic_integer10<T>> hour;
4302 std::shared_ptr<basic_integer10<T>> minute;
4303 std::shared_ptr<basic_integer10<T>> second;
4304 std::shared_ptr<basic_integer10<T>> millisecond;
4307 virtual bool do_match(
4308 _In_reads_or_z_opt_(end)
const T* text,
4309 _In_ size_t start = 0,
4313 _Assume_(text || start >= end);
4315 if (hour->match(text, start, end,
flags) &&
4316 m_separator->match(text, hour->interval.end, end,
flags) &&
4317 minute->match(text, m_separator->interval.end, end,
flags) &&
4321 size_t hit_offset = m_separator->hit_offset;
4322 if (m_separator->match(text, minute->interval.end, end,
flags) &&
4323 m_separator->hit_offset == hit_offset &&
4324 second && second->match(text, m_separator->interval.end, end,
flags) &&
4328 if (m_millisecond_separator && m_millisecond_separator->match(text, second->interval.end, end,
flags) &&
4329 millisecond && millisecond->match(text, m_millisecond_separator->interval.end, end,
flags) &&
4330 millisecond->value < 1000)
4333 this->interval.
end = millisecond->interval.end;
4336 if (millisecond) millisecond->invalidate();
4337 this->interval.
end = second->interval.end;
4341 if (second) second->invalidate();
4342 if (millisecond) millisecond->invalidate();
4343 this->interval.
end = minute->interval.end;
4345 this->interval.
start = start;
4350 minute->invalidate();
4351 if (second) second->invalidate();
4352 if (millisecond) millisecond->invalidate();
4357 std::shared_ptr<basic_set<T>> m_separator;
4358 std::shared_ptr<basic_parser<T>> m_millisecond_separator;
4385 _In_ const std::locale&
locale = std::locale()) :
4396 virtual void invalidate()
4398 degree->invalidate();
4399 degree_separator->invalidate();
4400 minute->invalidate();
4401 minute_separator->invalidate();
4402 if (second) second->invalidate();
4403 if (second_separator) second_separator->invalidate();
4404 if (decimal) decimal->invalidate();
4408 std::shared_ptr<basic_integer10<T>> degree;
4409 std::shared_ptr<basic_parser<T>> degree_separator;
4410 std::shared_ptr<basic_integer10<T>> minute;
4411 std::shared_ptr<basic_parser<T>> minute_separator;
4412 std::shared_ptr<basic_integer10<T>> second;
4413 std::shared_ptr<basic_parser<T>> second_separator;
4414 std::shared_ptr<basic_parser<T>> decimal;
4417 virtual bool do_match(
4418 _In_reads_or_z_opt_(end)
const T* text,
4419 _In_ size_t start = 0,
4423 _Assume_(text || start >= end);
4425 this->interval.
end = start;
4428 degree_separator->match(text, degree->interval.end, end,
flags))
4431 this->interval.
end = degree_separator->interval.end;
4434 degree->invalidate();
4435 degree_separator->invalidate();
4439 minute->value < 60 &&
4440 minute_separator->match(text, minute->interval.end, end,
flags))
4443 this->interval.
end = minute_separator->interval.end;
4446 minute->invalidate();
4447 minute_separator->invalidate();
4454 this->interval.
end = second->interval.end;
4456 this->interval.
end = second_separator->interval.end;
4458 if (second_separator) second_separator->invalidate();
4461 if (second) second->invalidate();
4462 if (second_separator) second_separator->invalidate();
4465 if (degree->interval.start < degree->interval.end ||
4466 minute->interval.start < minute->interval.end ||
4467 (second && second->interval.start < second->interval.end))
4471 this->interval.
end = decimal->interval.end;
4474 decimal->invalidate();
4475 this->interval.
start = start;
4478 if (decimal) decimal->invalidate();
4507 _In_ const std::locale&
locale = std::locale()) :
4513 m_separator(separator),
4517 virtual void invalidate()
4526 virtual bool do_match(
4527 _In_reads_or_z_opt_(end)
const T* text,
4528 _In_ size_t start = 0,
4532 _Assume_(text || start >= end);
4538 this->interval.
end = start;
4540 m_lparenthesis->invalidate();
4541 m_rparenthesis->invalidate();
4544 value.append(text + m_plus_sign->interval.start, text + m_plus_sign->interval.end);
4546 this->interval.
end = m_plus_sign->interval.end;
4550 _Assume_(text || this->interval.
end >= end);
4555 value.append(text + m_digit->interval.start, text + m_digit->interval.end);
4556 this->interval.
end = m_digit->interval.end;
4566 m_lparenthesis && !m_lparenthesis->interval &&
4567 m_rparenthesis && !m_rparenthesis->interval &&
4571 value.append(text + m_lparenthesis->interval.start, m_lparenthesis->interval.size());
4572 this->interval.
end = m_lparenthesis->interval.end;
4579 m_rparenthesis && !m_rparenthesis->interval &&
4581 m_lparenthesis->hit_offset == m_rparenthesis->hit_offset)
4584 value.append(text + m_rparenthesis->interval.start, text + m_rparenthesis->interval.end);
4585 this->interval.
end = m_rparenthesis->interval.end;
4599 this->interval.
end = m_separator->interval.end;
4608 this->interval.
end = m_space->interval.end;
4617 this->interval.
start = start;
4626 std::shared_ptr<basic_parser<T>> m_digit;
4627 std::shared_ptr<basic_parser<T>> m_plus_sign;
4628 std::shared_ptr<basic_set<T>> m_lparenthesis;
4629 std::shared_ptr<basic_set<T>> m_rparenthesis;
4630 std::shared_ptr<basic_parser<T>> m_separator;
4631 std::shared_ptr<basic_parser<T>> m_space;
4634 using phone_number = basic_phone_number<char>;
4635 using wphone_number = basic_phone_number<wchar_t>;
4637 using tphone_number = wphone_number;
4639 using tphone_number = phone_number;
4641 using sgml_phone_number = basic_phone_number<char>;
4654 _In_ const std::locale&
locale = std::locale()) :
4664 virtual void invalidate()
4679 virtual bool do_match(
4680 _In_reads_or_z_opt_(end)
const T* text,
4681 _In_ size_t start = 0,
4685 _Assume_(text || start >= end);
4686 const auto&
ctype = std::use_facet<std::ctype<T>>(this->m_locale);
4694 { {
'A',
'D' }, {}, 24 },
4695 { {
'A',
'E' }, {}, 23 },
4696 { {
'A',
'L' }, {}, 28 },
4697 { {
'A',
'O' }, {}, 25 },
4698 { {
'A',
'T' }, {}, 20 },
4699 { {
'A',
'Z' }, {}, 28 },
4700 { {
'B',
'A' }, {
'3',
'9' }, 20},
4701 { {
'B',
'E' }, {}, 16 },
4702 { {
'B',
'F' }, {}, 28 },
4703 { {
'B',
'G' }, {}, 22 },
4704 { {
'B',
'H' }, {}, 22 },
4705 { {
'B',
'I' }, {}, 27 },
4706 { {
'B',
'J' }, {}, 28 },
4707 { {
'B',
'R' }, {}, 29 },
4708 { {
'B',
'Y' }, {}, 28 },
4709 { {
'C',
'F' }, {}, 27 },
4710 { {
'C',
'G' }, {}, 27 },
4711 { {
'C',
'H' }, {}, 21 },
4712 { {
'C',
'I' }, {}, 28 },
4713 { {
'C',
'M' }, {}, 27 },
4714 { {
'C',
'R' }, {}, 22 },
4715 { {
'C',
'V' }, {}, 25 },
4716 { {
'C',
'Y' }, {}, 28 },
4717 { {
'C',
'Z' }, {}, 24 },
4718 { {
'D',
'E' }, {}, 22 },
4719 { {
'D',
'J' }, {}, 27 },
4720 { {
'D',
'K' }, {}, 18 },
4721 { {
'D',
'O' }, {}, 28 },
4722 { {
'D',
'Z' }, {}, 26 },
4723 { {
'E',
'E' }, {}, 20 },
4724 { {
'E',
'G' }, {}, 29 },
4725 { {
'E',
'S' }, {}, 24 },
4726 { {
'F',
'I' }, {}, 18 },
4727 { {
'F',
'O' }, {}, 18 },
4728 { {
'F',
'R' }, {}, 27 },
4729 { {
'G',
'A' }, {}, 27 },
4730 { {
'G',
'B' }, {}, 22 },
4731 { {
'G',
'E' }, {}, 22 },
4732 { {
'G',
'I' }, {}, 23 },
4733 { {
'G',
'L' }, {}, 18 },
4734 { {
'G',
'Q' }, {}, 27 },
4735 { {
'G',
'R' }, {}, 27 },
4736 { {
'G',
'T' }, {}, 28 },
4737 { {
'G',
'W' }, {}, 25 },
4738 { {
'H',
'N' }, {}, 28 },
4739 { {
'H',
'R' }, {}, 21 },
4740 { {
'H',
'U' }, {}, 28 },
4741 { {
'I',
'E' }, {}, 22 },
4742 { {
'I',
'L' }, {}, 23 },
4743 { {
'I',
'Q' }, {}, 23 },
4744 { {
'I',
'R' }, {}, 26 },
4745 { {
'I',
'S' }, {}, 26 },
4746 { {
'I',
'T' }, {}, 27 },
4747 { {
'J',
'O' }, {}, 30 },
4748 { {
'K',
'M' }, {}, 27 },
4749 { {
'K',
'W' }, {}, 30 },
4750 { {
'K',
'Z' }, {}, 20 },
4751 { {
'L',
'B' }, {}, 28 },
4752 { {
'L',
'C' }, {}, 32 },
4753 { {
'L',
'I' }, {}, 21 },
4754 { {
'L',
'T' }, {}, 20 },
4755 { {
'L',
'U' }, {}, 20 },
4756 { {
'L',
'V' }, {}, 21 },
4757 { {
'L',
'Y' }, {}, 25 },
4758 { {
'M',
'A' }, {}, 28 },
4759 { {
'M',
'C' }, {}, 27 },
4760 { {
'M',
'D' }, {}, 24 },
4761 { {
'M',
'E' }, {
'2',
'5' }, 22 },
4762 { {
'M',
'G' }, {}, 27 },
4763 { {
'M',
'K' }, {
'0',
'7' }, 19 },
4764 { {
'M',
'L' }, {}, 28 },
4765 { {
'M',
'R' }, {
'1',
'3' }, 27},
4766 { {
'M',
'T' }, {}, 31 },
4767 { {
'M',
'U' }, {}, 30 },
4768 { {
'M',
'Z' }, {}, 25 },
4769 { {
'N',
'E' }, {}, 28 },
4770 { {
'N',
'I' }, {}, 32 },
4771 { {
'N',
'L' }, {}, 18 },
4772 { {
'N',
'O' }, {}, 15 },
4773 { {
'P',
'K' }, {}, 24 },
4774 { {
'P',
'L' }, {}, 28 },
4775 { {
'P',
'S' }, {}, 29 },
4776 { {
'P',
'T' }, {
'5',
'0' }, 25 },
4777 { {
'Q',
'A' }, {}, 29 },
4778 { {
'R',
'O' }, {}, 24 },
4779 { {
'R',
'S' }, {
'3',
'5' }, 22 },
4780 { {
'R',
'U' }, {}, 33 },
4781 { {
'S',
'A' }, {}, 24 },
4782 { {
'S',
'C' }, {}, 31 },
4783 { {
'S',
'D' }, {}, 18 },
4784 { {
'S',
'E' }, {}, 24 },
4785 { {
'S',
'I' }, {
'5',
'6' }, 19 },
4786 { {
'S',
'K' }, {}, 24 },
4787 { {
'S',
'M' }, {}, 27 },
4788 { {
'S',
'N' }, {}, 28 },
4789 { {
'S',
'T' }, {}, 25 },
4790 { {
'S',
'V' }, {}, 28 },
4791 { {
'T',
'D' }, {}, 27 },
4792 { {
'T',
'G' }, {}, 28 },
4793 { {
'T',
'L' }, {
'3',
'8' }, 23},
4794 { {
'T',
'N' }, {
'5',
'9' }, 24 },
4795 { {
'T',
'R' }, {}, 26 },
4796 { {
'U',
'A' }, {}, 29 },
4797 { {
'V',
'A' }, {}, 22 },
4798 { {
'V',
'G' }, {}, 24 },
4799 { {
'X',
'K' }, {}, 20 },
4805 this->interval.
end = start;
4806 for (
size_t i = 0; i < 2; ++i, ++this->interval.
end) {
4810 if (
chr <
'A' ||
'Z' <
chr)
4812 this->country[i] =
chr;
4817 size_t m = (
l +
r) / 2;
4819 if (
c.country[0] <
this->country[0] || (
c.country[0] ==
this->country[0] &&
c.country[1] <
this->country[1]))
4821 else if (this->country[0] <
c.country[0] || (
this->country[0] ==
c.country[0] &&
this->country[1] <
c.country[1]))
4828 this->country[2] = 0;
4830 for (
size_t i = 0; i < 2; ++i, ++this->interval.
end) {
4833 this->check_digits[i] = text[this->interval.
end];
4835 this->check_digits[2] = 0;
4846 this->interval.
end = m_space->interval.end;
4850 if ((
'0' <=
chr &&
chr <=
'9') || (
'A' <=
chr &&
chr <=
'Z')) {
4851 this->bban[
n++] =
chr;
4852 this->interval.
end++;
4862 for (
size_t i = 0; ; ++i) {
4863 if (!this->bban[i]) {
4864 for (i = 0; i < 2; ++i) {
4865 if (
'A' <= this->country[i] && this->country[i] <=
'J') {
4869 else if (
'K' <= this->country[i] && this->country[i] <=
'T') {
4873 else if (
'U' <= this->country[i] && this->country[i] <=
'Z') {
4883 if (
'0' <= this->bban[i] && this->bban[i] <=
'9')
4885 else if (
'A' <= this->bban[i] && this->bban[i] <=
'J') {
4889 else if (
'K' <= this->bban[i] && this->bban[i] <=
'T') {
4893 else if (
'U' <= this->bban[i] && this->bban[i] <=
'Z') {
4908 for (; digit_count < 9 &&
normalized[next]; ++next, ++digit_count)
4912 this->interval.
start = start;
4920 std::shared_ptr<basic_parser<T>> m_space;
4923 using iban = basic_iban<char>;
4924 using wiban = basic_iban<wchar_t>;
4926 using tiban = wiban;
4930 using sgml_iban = basic_iban<char>;
4943 _In_ const std::locale&
locale = std::locale()) :
4947 this->check_digits[0] = 0;
4949 this->is_valid =
false;
4952 virtual void invalidate()
4954 this->check_digits[0] = 0;
4956 this->is_valid =
false;
4965 virtual bool do_match(
4966 _In_reads_or_z_opt_(end)
const T* text,
4967 _In_ size_t start = 0,
4971 _Assume_(text || start >= end);
4972 const auto&
ctype = std::use_facet<std::ctype<T>>(this->m_locale);
4977 this->interval.
end = start;
4978 if (this->interval.
end + 1 >= end ||
4982 this->interval.
end += 2;
4984 for (
size_t i = 0; i < 2; ++i, ++this->interval.
end) {
4987 this->check_digits[i] = text[this->interval.
end];
4989 this->check_digits[2] = 0;
4993 this->interval.
end = m_space->interval.end;
4994 for (
size_t j = 0;
j < 4; ++
j) {
4998 if ((
'0' <=
chr &&
chr <=
'9') || (
'A' <=
chr &&
chr <=
'Z')) {
5001 this->reference[
n++] =
chr;
5002 this->interval.
end++;
5011 this->reference[_countof(this->reference) - 1] = 0;
5012 for (
size_t i =
n,
j = _countof(this->reference) - 1; i;)
5013 this->reference[--
j] = this->reference[--i];
5014 for (
size_t j = _countof(this->reference) - 1 -
n;
j;)
5015 this->reference[--
j] =
'0';
5020 for (
size_t i = 0; ; ++i) {
5021 if (!this->reference[i]) {
5031 if (
'0' <= this->reference[i] && this->reference[i] <=
'9')
5033 else if (
'A' <= this->reference[i] && this->reference[i] <=
'J') {
5037 else if (
'K' <= this->reference[i] && this->reference[i] <=
'T') {
5041 else if (
'U' <= this->reference[i] && this->reference[i] <=
'Z') {
5056 for (; digit_count < 9 &&
normalized[next]; ++next, ++digit_count)
5060 this->interval.
start = start;
5068 std::shared_ptr<basic_parser<T>> m_space;
5071 using creditor_reference = basic_creditor_reference<char>;
5072 using wcreditor_reference = basic_creditor_reference<wchar_t>;
5074 using tcreditor_reference = wcreditor_reference;
5076 using tcreditor_reference = creditor_reference;
5078 using sgml_creditor_reference = basic_creditor_reference<char>;
5092 virtual bool do_match(
5093 _In_reads_or_z_opt_(end)
const T* text,
5094 _In_ size_t start = 0,
5098 _Assume_(text || start >= end);
5099 this->interval.
end = start;
5104 this->interval.
end++;
5109 this->interval.
start = start;
5138 virtual bool do_match(
5139 _In_reads_or_z_opt_(end)
const T* text,
5140 _In_ size_t start = 0,
5144 _Assume_(text || start >= end);
5145 if (start < end && text[start] ==
'-') {
5146 this->interval.
end = (this->interval.
start = start) + 1;
5176 _In_ const std::locale&
locale = std::locale()) :
5188 virtual void invalidate()
5191 this->
part1.invalidate();
5192 this->
part2.invalidate();
5193 this->
part3.invalidate();
5194 this->is_valid =
false;
5205 virtual bool do_match(
5206 _In_reads_or_z_opt_(end)
const T* text,
5207 _In_ size_t start = 0,
5211 _Assume_(text || start >= end);
5212 const auto&
ctype = std::use_facet<std::ctype<T>>(this->m_locale);
5215 this->interval.
end = start;
5216 if (this->interval.
end + 1 >= end ||
5220 this->interval.
end += 2;
5222 for (
size_t i = 0; i < 2; ++i, ++this->interval.
end) {
5225 this->model[i] = text[this->interval.
end];
5229 this->part1.invalidate();
5230 this->part2.invalidate();
5231 this->part3.invalidate();
5232 if (this->model[0] ==
'9' && this->model[1] ==
'9') {
5234 this->interval.
start = start;
5239 this->interval.
end = m_space->interval.end;
5241 this->part1.match(text, this->interval.
end, end,
flags) &&
5247 this->interval.
start = start;
5255 this->interval.
end = start + 4;
5257 if (this->model[0] ==
'0' && this->model[1] ==
'0')
5268 else if (this->model[0] ==
'0' && this->model[1] ==
'1')
5287 else if (this->model[0] ==
'0' && this->model[1] ==
'2')
5295 else if (this->model[0] ==
'0' && this->model[1] ==
'3')
5304 else if (this->model[0] ==
'0' && this->model[1] ==
'4')
5312 else if ((this->model[0] ==
'0' || this->model[0] ==
'5') && this->model[1] ==
'5')
5326 else if (this->model[0] ==
'0' && this->model[1] ==
'6')
5339 else if (this->model[0] ==
'0' && this->model[1] ==
'7')
5350 else if (this->model[0] ==
'0' && this->model[1] ==
'8')
5360 else if (this->model[0] ==
'0' && this->model[1] ==
'9')
5378 else if (this->model[0] ==
'1' && this->model[1] ==
'0')
5394 (this->model[0] ==
'1' && (this->model[1] ==
'1' || this->model[1] ==
'8' || this->model[1] ==
'9')) ||
5395 ((this->model[0] ==
'2' || this->model[0] ==
'3') && this->model[1] ==
'8') ||
5396 (this->model[0] ==
'4' && (this->model[1] ==
'0' || this->model[1] ==
'1' || this->model[1] ==
'8' || this->model[1] ==
'9')) ||
5397 (this->model[0] ==
'5' && (this->model[1] ==
'1' || this->model[1] ==
'8')))
5410 else if (this->model[0] ==
'1' && this->model[1] ==
'2')
5418 else if ((this->model[0] ==
'2' || this->model[0] ==
'3') && this->model[1] ==
'1')
5435 static bool check11(
5448 static bool check11(
5449 _In_count_(num_part1)
const T*
part1, _In_
size_t num_part1,
5450 _In_count_(num_part2)
const T*
part2, _In_
size_t num_part2)
5452 _Assume_(
part1 || !num_part1);
5453 _Assume_(
part2 && num_part2 >= 1);
5454 uint32_t nominator = 0, ponder = 2;
5455 for (
size_t i = num_part2 - 1; i--; ++ponder)
5456 nominator += (
part2[i] -
'0') * ponder;
5457 for (
size_t i = num_part1; i--; ++ponder)
5458 nominator += (
part1[i] -
'0') * ponder;
5459 uint8_t control = 11 -
static_cast<uint8_t
>(nominator % 11);
5462 return control ==
part2[num_part2 - 1] -
'0';
5465 static bool check11(
5466 _In_count_(num_part1)
const T*
part1, _In_
size_t num_part1,
5467 _In_count_(num_part2)
const T*
part2, _In_
size_t num_part2,
5468 _In_count_(num_part3)
const T*
part3, _In_
size_t num_part3)
5470 _Assume_(
part1 || !num_part1);
5471 _Assume_(
part2 || !num_part2);
5472 _Assume_(
part3 && num_part3 >= 1);
5473 uint32_t nominator = 0, ponder = 2;
5474 for (
size_t i = num_part3 - 1; i--; ++ponder)
5475 nominator += (
part3[i] -
'0') * ponder;
5476 for (
size_t i = num_part2; i--; ++ponder)
5477 nominator += (
part2[i] -
'0') * ponder;
5478 for (
size_t i = num_part1; i--; ++ponder)
5479 nominator += (
part1[i] -
'0') * ponder;
5480 uint8_t control = 11 -
static_cast<uint8_t
>(nominator % 11);
5483 return control ==
part2[num_part3 - 1] -
'0';
5486 std::shared_ptr<basic_parser<T>> m_space;
5487 basic_si_reference_delimiter<T> m_delimiter;
5490 using si_reference = basic_si_reference<char>;
5491 using wsi_reference = basic_si_reference<wchar_t>;
5493 using tsi_reference = wsi_reference;
5495 using tsi_reference = si_reference;
5497 using sgml_si_reference = basic_si_reference<char>;
5510 _In_ const std::locale&
locale = std::locale()) :
5519 virtual void invalidate()
5530 virtual bool do_match(
5531 _In_reads_or_z_opt_(end)
const T* text,
5532 _In_ size_t start = 0,
5536 _Assume_(text || start >= end);
5540 this->interval.
end = start;
5545 this->interval.
end = m_element->interval.end;
5547 this->interval.
end = m_digit->interval.end;
5553 this->interval.
end = m_sign->interval.end;
5556 this->interval.
start = start;
5566 std::shared_ptr<basic_parser<T>> m_element;
5567 std::shared_ptr<basic_parser<T>> m_digit;
5568 std::shared_ptr<basic_parser<T>> m_sign;
5586 virtual bool do_match(
5587 _In_reads_or_z_(end)
const char* text,
5588 _In_ size_t start = 0,
5592 _Assume_(text || start >= end);
5593 this->interval.
end = start;
5595 _Assume_(text || this->interval.
end >= end);
5597 if (text[this->interval.
end] ==
'\r') {
5598 this->interval.
end++;
5600 this->interval.
start = start;
5601 this->interval.
end++;
5605 else if (text[this->interval.
end] ==
'\n') {
5606 this->interval.
start = start;
5607 this->interval.
end++;
5622 virtual bool do_match(
5623 _In_reads_or_z_(end)
const char* text,
5624 _In_ size_t start = 0,
5628 _Assume_(text || start >= end);
5629 this->interval.
end = start;
5633 this->interval.
start = start;
5634 this->interval.
end++;
5640 this->interval.
start = start;
5641 this->interval.
end++;
5658 virtual bool do_match(
5659 _In_reads_or_z_(end)
const char* text,
5660 _In_ size_t start = 0,
5664 _Assume_(text || start >= end);
5665 this->interval.
end = start;
5667 _Assume_(text || this->interval.
end >= end);
5669 this->interval.
start = start;
5674 this->interval.
start = start;
5675 this->interval.
end++;
5691 virtual bool do_match(
5692 _In_reads_or_z_(end)
const char* text,
5693 _In_ size_t start = 0,
5697 _Assume_(text || start >= end);
5698 this->interval.
end = start;
5701 if ((
unsigned int)text[this->interval.
end] < 0x20 ||
5723 this->interval.
end++;
5729 this->interval.
start = start;
5745 virtual void invalidate()
5749 parser::invalidate();
5755 virtual bool do_match(
5756 _In_reads_or_z_(end)
const char* text,
5757 _In_ size_t start = 0,
5761 _Assume_(text || start >= end);
5762 this->interval.
end = start;
5765 this->interval.
end++;
5768 _Assume_(text || this->interval.
end >= end);
5770 if (text[this->interval.
end] ==
'"') {
5772 this->interval.
end++;
5775 else if (text[this->interval.
end] ==
'\\') {
5776 this->interval.
end++;
5778 this->interval.
end++;
5784 this->interval.
end++;
5791 this->interval.
start = start;
5808 virtual void invalidate()
5810 string.invalidate();
5812 parser::invalidate();
5819 virtual bool do_match(
5820 _In_reads_or_z_(end)
const char* text,
5821 _In_ size_t start = 0,
5825 _Assume_(text || start >= end);
5826 this->interval.
end = start;
5827 if (
string.match(text, this->interval.
end, end,
flags)) {
5829 this->interval.
end =
string.interval.end;
5830 this->interval.
start = start;
5834 string.invalidate();
5836 this->interval.
start = start;
5852 virtual void invalidate()
5856 parser::invalidate();
5863 virtual bool do_match(
5864 _In_reads_or_z_(end)
const char* text,
5865 _In_ size_t start = 0,
5869 _Assume_(text || start >= end);
5870 this->interval.
end = start;
5877 _Assume_(text || this->interval.
end >= end);
5879 this->interval.
end++;
5887 this->interval.
start = start;
5904 virtual bool do_match(
5905 _In_reads_or_z_(end)
const char* text,
5906 _In_ size_t start = 0,
5910 _Assume_(text || start >= end);
5911 if (start + 2 < end &&
5912 text[start] ==
'*' &&
5913 text[start + 1] ==
'/' &&
5914 text[start + 2] ==
'*')
5916 this->interval.
end = (this->interval.
start = start) + 3;
5919 else if (start < end && text[start] ==
'*') {
5920 this->interval.
end = (this->interval.
start = start) + 1;
5936 virtual void invalidate()
5939 subtype.invalidate();
5940 parser::invalidate();
5947 virtual bool do_match(
5948 _In_reads_or_z_(end)
const char* text,
5949 _In_ size_t start = 0,
5953 _Assume_(text || start >= end);
5954 this->interval.
end = start;
5962 this->interval.
end++;
5971 this->interval.
start = start;
5988 virtual void invalidate()
5991 http_media_range::invalidate();
5994 std::list<http_parameter> params;
5997 virtual bool do_match(
5998 _In_reads_or_z_(end)
const char* text,
5999 _In_ size_t start = 0,
6003 _Assume_(text || start >= end);
6004 if (!http_media_range::do_match(text, start, end,
flags))
6011 else if (text[this->interval.
end] ==
';') {
6012 this->interval.
end++;
6017 this->interval.
end = param.interval.end;
6018 params.push_back(std::move(param));
6029 this->interval.
end = params.empty() ? subtype.
interval.
end : params.back().interval.end;
6044 virtual bool do_match(
6045 _In_reads_or_z_(end)
const char* text,
6046 _In_ size_t start = 0,
6050 _Assume_(text || start >= end);
6051 this->interval.
end = start;
6054 if ((
unsigned int)text[this->interval.
end] < 0x20 ||
6061 this->interval.
end++;
6067 this->interval.
start = start;
6086 virtual void invalidate()
6089 parser::invalidate();
6095 virtual bool do_match(
6096 _In_reads_or_z_(end)
const char* text,
6097 _In_ size_t start = 0,
6101 _Assume_(text || start >= end);
6103 this->interval.
end = start;
6114 this->interval.
end++;
6123 this->interval.
start = start;
6137 virtual bool do_match(
6138 _In_reads_or_z_(end)
const char* text,
6139 _In_ size_t start = 0,
6143 _Assume_(text || start >= end);
6144 this->interval.
end = start;
6147 if ((
unsigned int)text[this->interval.
end] < 0x20 ||
6154 this->interval.
end++;
6159 this->interval.
start = start;
6170 virtual void invalidate()
6173 parser::invalidate();
6179 virtual bool do_match(
6180 _In_reads_or_z_(end)
const char* text,
6181 _In_ size_t start = 0,
6185 _Assume_(text || start >= end);
6187 this->interval.
end = start;
6189 _Assume_(text || this->interval.
end >= end);
6192 this->interval.
end++;
6193 s.match(text, this->interval.
end, end,
flags);
6195 this->interval.
end = s.interval.end;
6198 if (text[this->interval.
end] ==
'/') {
6199 this->interval.
end++;
6200 s.match(text, this->interval.
end, end,
flags);
6202 this->interval.
end = s.interval.end;
6210 this->interval.
start = start;
6225 virtual void invalidate()
6231 parser::invalidate();
6238 virtual bool do_match(
6239 _In_reads_or_z_(end)
const char* text,
6240 _In_ size_t start = 0,
6244 _Assume_(text || start >= end);
6245 this->interval.
end = start;
6249 if ((
unsigned int)text[this->interval.
end] < 0x20 ||
6256 this->interval.
end++;
6262 name.
end = this->interval.
end;
6265 if (text[this->interval.
end] ==
'=') {
6266 this->interval.
end++;
6270 if ((
unsigned int)text[this->interval.
end] < 0x20 ||
6276 this->interval.
end++;
6281 value.
end = this->interval.
end;
6287 this->interval.
start = start;
6307 virtual void invalidate()
6309 server.invalidate();
6313 parser::invalidate();
6319 std::list<http_url_parameter> params;
6322 virtual bool do_match(
6323 _In_reads_or_z_(end)
const char* text,
6324 _In_ size_t start = 0,
6328 _Assume_(text || start >= end);
6329 this->interval.
end = start;
6332 this->interval.
end += 7;
6338 this->interval.
end++;
6348 server.invalidate();
6361 this->interval.
end++;
6364 if ((
unsigned int)text[this->interval.
end] < 0x20 ||
6368 else if (text[this->interval.
end] ==
'&')
6369 this->interval.
end++;
6373 this->interval.
end = param.interval.end;
6374 params.push_back(std::move(param));
6385 this->interval.
start = start;
6400 virtual void invalidate()
6403 parser::invalidate();
6406 std::vector<stdex::interval<size_t>> components;
6409 virtual bool do_match(
6410 _In_reads_or_z_(end)
const char* text,
6411 _In_ size_t start = 0,
6415 _Assume_(text || start >= end);
6416 this->interval.
end = start;
6421 k.end = this->interval.
end;
6423 if (
k.end < end && text[
k.end]) {
6424 if (stdex::isalpha(text[
k.end]))
6432 if (this->interval.
end <
k.end) {
6433 k.start = this->interval.
end;
6434 this->interval.
end =
k.end;
6435 components.push_back(
k);
6440 this->interval.
end++;
6447 if (!components.empty()) {
6448 this->interval.
start = start;
6449 this->interval.
end = components.back().end;
6468 virtual void invalidate()
6471 parser::invalidate();
6477 virtual bool do_match(
6478 _In_reads_or_z_(end)
const char* text,
6479 _In_ size_t start = 0,
6483 _Assume_(text || start >= end);
6485 this->interval.
end = start;
6490 this->interval.
end++;
6492 else if (text[this->interval.
end] ==
'.') {
6493 this->interval.
end++;
6499 this->interval.
end++;
6517 this->interval.
start = start;
6532 virtual bool do_match(
6533 _In_reads_or_z_(end)
const char* text,
6534 _In_ size_t start = 0,
6538 _Assume_(text || end <= start);
6539 if (start < end && text[start] ==
'*') {
6540 this->interval.
end = (this->interval.
start = start) + 1;
6551 template <
class T,
class T_asterisk = http_asterisk>
6560 virtual void invalidate()
6562 asterisk.invalidate();
6564 factor.invalidate();
6565 parser::invalidate();
6573 virtual bool do_match(
6574 _In_reads_or_z_(end)
const char* text,
6575 _In_ size_t start = 0,
6579 _Assume_(text || start >= end);
6581 this->interval.
end = start;
6588 asterisk.invalidate();
6591 asterisk.invalidate();
6599 this->interval.
end++;
6602 this->interval.
end++;
6605 this->interval.
end++;
6613 factor.invalidate();
6616 this->interval.
start = start;
6627 virtual void invalidate()
6631 parser::invalidate();
6638 virtual bool do_match(
6639 _In_reads_or_z_(end)
const char* text,
6640 _In_ size_t start = 0,
6644 _Assume_(text || start >= end);
6645 this->interval.
end = start;
6647 this->interval.
end++;
6657 this->interval.
end++;
6666 this->interval.
start = start;
6683 virtual void invalidate()
6688 parser::invalidate();
6696 virtual bool do_match(
6697 _In_reads_or_z_(end)
const char* text,
6698 _In_ size_t start = 0,
6702 _Assume_(text || start >= end);
6703 this->interval.
end = start;
6711 this->interval.
end++;
6725 else if (text[this->interval.
end] ==
';') {
6726 this->interval.
end++;
6731 this->interval.
end = param.interval.end;
6732 params.push_back(std::move(param));
6743 this->interval.
start = start;
6761 virtual void invalidate()
6767 parser::invalidate();
6774 virtual bool do_match(
6775 _In_reads_or_z_(end)
const char* text,
6776 _In_ size_t start = 0,
6780 _Assume_(text || start >= end);
6781 this->interval.
end = start;
6785 if (text[this->interval.
end] ==
'/') {
6786 type.
end = this->interval.
end;
6787 this->interval.
end++;
6788 version.
start = this->interval.
end;
6791 if (stdex::isspace(text[this->interval.
end])) {
6792 version.
end = this->interval.
end;
6796 this->interval.
end++;
6799 version.
end = this->interval.
end;
6805 else if (stdex::isspace(text[this->interval.
end])) {
6806 type.
end = this->interval.
end;
6810 this->interval.
end++;
6813 type.
end = this->interval.
end;
6818 this->interval.
start = start;
6841 virtual void invalidate()
6845 version_maj.
start = 1;
6846 version_maj.
end = 0;
6847 version_min.
start = 1;
6848 version_min.
end = 0;
6850 parser::invalidate();
6859 virtual bool do_match(
6860 _In_reads_or_z_(end)
const char* text,
6861 _In_ size_t start = 0,
6865 _Assume_(text || start >= end);
6866 this->interval.
end = start;
6870 if (text[this->interval.
end] ==
'/') {
6871 type.
end = this->interval.
end;
6872 this->interval.
end++;
6875 else if (stdex::isspace(text[this->interval.
end]))
6878 this->interval.
end++;
6881 type.
end = this->interval.
end;
6885 version_maj.
start = this->interval.
end;
6888 if (text[this->interval.
end] ==
'.') {
6889 version_maj.
end = this->interval.
end;
6890 this->interval.
end++;
6891 version_min.
start = this->interval.
end;
6894 if (stdex::isspace(text[this->interval.
end])) {
6895 version_min.
end = this->interval.
end;
6897 (
uint16_t)strtoui(text + version_maj.
start, version_maj.
size(),
nullptr, 10) * 0x100 +
6902 this->interval.
end++;
6909 else if (stdex::isspace(text[this->interval.
end])) {
6910 version_maj.
end = this->interval.
end;
6911 version_min.
start = 1;
6912 version_min.
end = 0;
6917 this->interval.
end++;
6922 this->interval.
start = start;
6943 virtual void invalidate()
6948 protocol.invalidate();
6949 parser::invalidate();
6957 virtual bool do_match(
6958 _In_reads_or_z_(end)
const char* text,
6959 _In_ size_t start = 0,
6963 _Assume_(text || start >= end);
6964 this->interval.
end = start;
6970 if (stdex::isspace(text[this->interval.
end]))
6971 this->interval.
end++;
6983 if (stdex::isspace(text[this->interval.
end])) {
6984 verb.
end = this->interval.
end;
6985 this->interval.
end++;
6989 this->interval.
end++;
6999 if (stdex::isspace(text[this->interval.
end]))
7000 this->interval.
end++;
7012 protocol.invalidate();
7019 if (stdex::isspace(text[this->interval.
end]))
7020 this->interval.
end++;
7046 this->interval.
end++;
7052 this->interval.
start = start;
7069 virtual void invalidate()
7075 parser::invalidate();
7082 virtual bool do_match(
7083 _In_reads_or_z_(end)
const char* text,
7084 _In_ size_t start = 0,
7088 _Assume_(text || start >= end);
7089 this->interval.
end = start;
7099 if (stdex::isspace(text[this->interval.
end])) {
7100 name.
end = this->interval.
end;
7101 this->interval.
end++;
7106 if (stdex::isspace(text[this->interval.
end]))
7107 this->interval.
end++;
7115 this->interval.
end++;
7122 else if (text[this->interval.
end] ==
':') {
7123 name.
end = this->interval.
end;
7124 this->interval.
end++;
7128 this->interval.
end++;
7140 this->interval.
end++;
7145 if (stdex::isspace(text[this->interval.
end]))
7146 this->interval.
end++;
7149 value.
end = ++this->interval.
end;
7155 this->interval.
start = start;
7169 template <
class KEY,
class T>
7174 _In_reads_or_z_(end)
const char* text,
7175 _In_ size_t start = 0,
7179 while (start < end) {
7180 while (start < end && text[start] && stdex::isspace(text[start])) start++;
7181 if (start < end && text[start] ==
',') {
7183 while (start < end&& text[start] && stdex::isspace(text[start])) start++;
7186 if (
el.match(text, start, end,
flags)) {
7188 T::insert(std::move(
el));
7198 constexpr bool operator()(
const T& a,
const T& b)
const noexcept
7200 return a.factor.value > b.factor.value;
7207 template <
class T,
class AX = std::allocator<T>>
7229 _In_ const std::locale&
locale = std::locale()) :
7244 virtual void invalidate()
7250 std::basic_string<T> value;
7253 virtual bool do_match(
7254 _In_reads_or_z_opt_(end)
const T* text,
7255 _In_ size_t start = 0,
7259 _Assume_(text || start >= end);
7260 this->interval.
end = start;
7262 this->interval.
end = m_quote->interval.end;
7266 this->interval.
start = start;
7267 this->interval.
end = m_quote->interval.end;
7271 if (m_quote->match(text, m_escape->interval.end, end,
flags)) {
7272 value +=
'"'; this->interval.
end = m_quote->interval.end;
7275 if (m_sol->match(text, m_escape->interval.end, end,
flags)) {
7276 value +=
'/'; this->interval.
end = m_sol->interval.end;
7279 if (m_bs->match(text, m_escape->interval.end, end,
flags)) {
7280 value +=
'\b'; this->interval.
end = m_bs->interval.end;
7283 if (m_ff->match(text, m_escape->interval.end, end,
flags)) {
7284 value +=
'\f'; this->interval.
end = m_ff->interval.end;
7287 if (m_lf->match(text, m_escape->interval.end, end,
flags)) {
7288 value +=
'\n'; this->interval.
end = m_lf->interval.end;
7291 if (m_cr->match(text, m_escape->interval.end, end,
flags)) {
7292 value +=
'\r'; this->interval.
end = m_cr->interval.end;
7295 if (m_htab->match(text, m_escape->interval.end, end,
flags)) {
7296 value +=
'\t'; this->interval.
end = m_htab->interval.end;
7300 m_uni->match(text, m_escape->interval.end, end,
flags) &&
7301 m_hex->match(text, m_uni->interval.end, std::min(m_uni->interval.end + 4, end),
flags | match_case_insensitive) &&
7302 m_hex->interval.size() == 4 )
7304 _Assume_(m_hex->value <= 0xffff);
7305 if (
sizeof(T) == 1) {
7306 if (m_hex->value > 0x7ff) {
7307 value += (T)(0xe0 | ((m_hex->value >> 12) & 0x0f));
7308 value += (T)(0x80 | ((m_hex->value >> 6) & 0x3f));
7309 value += (T)(0x80 | (m_hex->value & 0x3f));
7311 else if (m_hex->value > 0x7f) {
7312 value += (T)(0xc0 | ((m_hex->value >> 6) & 0x1f));
7313 value += (T)(0x80 | (m_hex->value & 0x3f));
7316 value += (T)(m_hex->value & 0x7f);
7319 value += (T)m_hex->value;
7320 this->interval.
end = m_hex->interval.end;
7323 if (m_escape->match(text, m_escape->interval.end, end,
flags)) {
7324 value +=
'\\'; this->interval.
end = m_escape->interval.end;
7329 value.append(text + m_chr->interval.start, m_chr->interval.size());
7330 this->interval.
end = m_chr->interval.end;
7341 std::shared_ptr<basic_parser<T>> m_quote;
7342 std::shared_ptr<basic_parser<T>> m_chr;
7343 std::shared_ptr<basic_parser<T>> m_escape;
7344 std::shared_ptr<basic_parser<T>> m_sol;
7345 std::shared_ptr<basic_parser<T>> m_bs;
7346 std::shared_ptr<basic_parser<T>> m_ff;
7347 std::shared_ptr<basic_parser<T>> m_lf;
7348 std::shared_ptr<basic_parser<T>> m_cr;
7349 std::shared_ptr<basic_parser<T>> m_htab;
7350 std::shared_ptr<basic_parser<T>> m_uni;
7351 std::shared_ptr<basic_integer16<T>> m_hex;
7369 virtual void invalidate()
7372 basic_parser::invalidate();
7378 virtual bool do_match(
7379 _In_reads_or_z_opt_(end)
const T* text,
7380 _In_ size_t start = 0,
7384 _Unreferenced_(
flags);
7385 _Assume_(text || start + 1 >= end);
7386 if (start + 1 < end &&
7387 text[start] ==
'/' &&
7388 text[start + 1] ==
'*')
7391 this->content.
start = this->interval.
end = start + 2;
7395 if (this->interval.
end + 1 < end &&
7400 this->content.
end = this->interval.
end;
7401 this->interval.
start = start;
7402 this->interval.
end = this->interval.
end + 2;
7405 this->interval.
end++;
7414 using css_comment = basic_css_comment<char>;
7415 using wcss_comment = basic_css_comment<wchar_t>;
7417 using tcss_comment = wcss_comment;
7419 using tcss_comment = css_comment;
7429 virtual bool do_match(
7430 _In_reads_or_z_opt_(end)
const T* text,
7431 _In_ size_t start = 0,
7435 _Unreferenced_(
flags);
7436 _Assume_(text || start + 3 >= end);
7437 if (start + 3 < end &&
7438 text[start] ==
'<' &&
7439 text[start + 1] ==
'!' &&
7440 text[start + 2] ==
'-' &&
7441 text[start + 3] ==
'-')
7443 this->interval.
start = start;
7444 this->interval.
end = start + 4;
7467 virtual bool do_match(
7468 _In_reads_or_z_opt_(end)
const T* text,
7469 _In_ size_t start = 0,
7473 _Unreferenced_(
flags);
7474 _Assume_(text || start + 2 >= end);
7475 if (start + 2 < end &&
7476 text[start] ==
'-' &&
7477 text[start + 1] ==
'-' &&
7478 text[start + 2] ==
'>')
7480 this->interval.
start = start;
7481 this->interval.
end = start + 3;
7504 virtual void invalidate()
7507 basic_parser::invalidate();
7513 virtual bool do_match(
7514 _In_reads_or_z_opt_(end)
const T* text,
7515 _In_ size_t start = 0,
7519 _Unreferenced_(
flags);
7520 this->interval.
end = start;
7521 _Assume_(text || this->interval.
end >= end);
7522 if (this->interval.
end < end &&
7526 T
quote = text[this->interval.
end];
7527 this->content.
start = ++this->interval.
end;
7531 if (text[this->interval.
end] ==
quote) {
7533 this->content.
end = this->interval.
end;
7534 this->interval.
start = start;
7535 this->interval.
end++;
7538 if (this->interval.
end + 1 < end &&
7543 this->interval.
end = this->interval.
end + 2;
7546 this->interval.
end++;
7556 using css_string = basic_css_string<char>;
7557 using wcss_string = basic_css_string<wchar_t>;
7559 using tcss_string = wcss_string;
7561 using tcss_string = css_string;
7571 virtual void invalidate()
7574 basic_parser::invalidate();
7580 virtual bool do_match(
7581 _In_reads_or_z_opt_(end)
const T* text,
7582 _In_ size_t start = 0,
7586 _Unreferenced_(
flags);
7587 this->interval.
end = start;
7588 _Assume_(text || this->interval.
end + 3 >= end);
7589 if (this->interval.
end + 3 < end &&
7596 this->interval.
end = this->interval.
end + 4;
7599 const auto&
ctype = std::use_facet<std::ctype<T>>(m_locale);
7602 if (this->interval.
end < end &&
7606 T
quote = text[this->interval.
end];
7607 this->content.
start = ++this->interval.
end;
7611 if (text[this->interval.
end] ==
quote) {
7613 this->content.
end = this->interval.
end;
7614 this->interval.
end++;
7617 if (this->interval.
end + 1 < end &&
7622 this->interval.
end = this->interval.
end + 2;
7625 this->interval.
end++;
7631 if (this->interval.
end < end &&
7635 this->interval.
start = start;
7636 this->interval.
end++;
7646 if (text[this->interval.
end] ==
')') {
7648 this->interval.
start = start;
7649 this->interval.
end++;
7653 this->interval.
end++;
7655 this->content.
end = ++this->interval.
end;
7666 using css_uri = basic_css_uri<char>;
7667 using wcss_uri = basic_css_uri<wchar_t>;
7669 using tcss_uri = wcss_uri;
7671 using tcss_uri = css_uri;
7681 virtual void invalidate()
7684 basic_parser::invalidate();
7690 virtual bool do_match(
7691 _In_reads_or_z_opt_(end)
const T* text,
7692 _In_ size_t start = 0,
7696 _Unreferenced_(
flags);
7697 this->interval.
end = start;
7698 _Assume_(text || this->interval.
end + 6 >= end);
7699 if (this->interval.
end + 6 < end &&
7709 this->interval.
end = this->interval.
end + 7;
7712 const auto&
ctype = std::use_facet<std::ctype<T>>(m_locale);
7715 if (this->interval.
end < end &&
7719 T
quote = text[this->interval.
end];
7720 this->content.
start = ++this->interval.
end;
7724 if (text[this->interval.
end] ==
quote) {
7726 this->content.
end = this->interval.
end;
7727 this->interval.
start = start;
7728 this->interval.
end++;
7731 if (this->interval.
end + 1 < end &&
7736 this->interval.
end = this->interval.
end + 2;
7739 this->interval.
end++;
7750 using css_import = basic_css_import<char>;
7751 using wcss_import = basic_css_import<wchar_t>;
7753 using tcss_import = wcss_import;
7755 using tcss_import = css_import;
7765 virtual void invalidate()
7770 basic_parser::invalidate();
7778 virtual bool do_match(
7779 _In_reads_or_z_opt_(end)
const T* text,
7780 _In_ size_t start = 0,
7784 _Unreferenced_(
flags);
7785 const auto&
ctype = std::use_facet<std::ctype<T>>(m_locale);
7787 this->interval.
end = start;
7788 this->base_type.
start = this->interval.
end;
7790 _Assume_(text || this->interval.
end >= end);
7793 if (text[this->interval.
end] ==
'/' ||
7797 this->interval.
end++;
7799 if (this->interval.
end <=
this->base_type.start)
7801 this->base_type.
end = this->interval.
end;
7806 this->interval.
end++;
7807 this->sub_type.
start = this->interval.
end;
7811 if (text[this->interval.
end] ==
'/' ||
7815 this->interval.
end++;
7817 if (this->interval.
end <=
this->sub_type.start)
7820 this->sub_type.
end = this->interval.
end;
7823 this->interval.
end++;
7828 if (this->interval.
end + 7 < end &&
7830 (text[this->interval.
end + 1] ==
'h' || text[this->interval.
end + 1] ==
'H') &&
7832 (text[this->interval.
end + 3] ==
'r' || text[this->interval.
end + 3] ==
'R') &&
7834 (text[this->interval.
end + 5] ==
'e' || text[this->interval.
end + 5] ==
'E') &&
7836 text[this->interval.
end + 7] ==
'=')
7838 this->interval.
end = this->interval.
end + 8;
7839 if (this->interval.
end < end &&
7843 T
quote = text[this->interval.
end];
7844 this->charset.
start = ++this->interval.
end;
7851 if (text[this->interval.
end] ==
quote) {
7853 this->charset.
end = this->interval.
end;
7854 this->interval.
end++;
7857 this->interval.
end++;
7862 this->charset.
start = this->interval.
end;
7866 this->charset.
end = this->interval.
end;
7869 this->interval.
end++;
7874 this->interval.
start = start;
7883 using mime_type = basic_mime_type<char>;
7884 using wmime_type = basic_mime_type<wchar_t>;
7886 using tmime_type = wmime_type;
7888 using tmime_type = mime_type;
7898 virtual bool do_match(
7899 _In_reads_or_z_opt_(end)
const T* text,
7900 _In_ size_t start = 0,
7904 _Unreferenced_(
flags);
7905 const auto&
ctype = std::use_facet<std::ctype<T>>(m_locale);
7906 this->interval.
end = start;
7908 _Assume_(text || this->interval.
end >= end);
7911 this->interval.
start = start;
7917 if (text[this->interval.
end] ==
'>' ||
7922 this->interval.
start = start;
7925 this->interval.
end++;
7945 virtual void invalidate()
7948 basic_parser::invalidate();
7954 virtual bool do_match(
7955 _In_reads_or_z_opt_(end)
const T* text,
7956 _In_ size_t start = 0,
7960 _Unreferenced_(
flags);
7961 this->interval.
end = start;
7962 _Assume_(text || this->interval.
end >= end);
7963 if (this->interval.
end < end &&
7967 T
quote = text[this->interval.
end];
7968 this->content.
start = ++this->interval.
end;
7976 if (text[this->interval.
end] ==
quote) {
7978 this->content.
end = this->interval.
end;
7979 this->interval.
start = start;
7980 this->interval.
end++;
7983 this->interval.
end++;
7988 this->content.
start = this->interval.
end;
7989 const auto&
ctype = std::use_facet<std::ctype<T>>(m_locale);
7991 _Assume_(text || this->interval.
end >= end);
7993 this->content.
end = this->interval.
end;
7994 this->interval.
start = start;
7997 if (text[this->interval.
end] ==
'>' ||
8001 this->content.
end = this->interval.
end;
8002 this->interval.
start = start;
8005 this->interval.
end++;
8010 using html_value = basic_html_value<char>;
8011 using whtml_value = basic_html_value<wchar_t>;
8013 using thtml_value = whtml_value;
8015 using thtml_value = html_value;
8021 enum class html_sequence_t {
8052 type(html_sequence_t::unknown)
8055 virtual void invalidate()
8057 this->type = html_sequence_t::unknown;
8058 this->name.invalidate();
8060 basic_parser::invalidate();
8068 virtual bool do_match(
8069 _In_reads_or_z_opt_(end)
const T* text,
8070 _In_ size_t start = 0,
8074 _Assume_(text || start >= end);
8075 if (start >= end || text[start] !=
'<')
8077 this->interval.
end = start + 1;
8080 if (text[this->interval.
end] ==
'/' &&
8084 this->type = html_sequence_t::element_end;
8085 this->name = this->m_ident.
interval;
8088 else if (text[this->interval.
end] ==
'!') {
8090 this->interval.
end++;
8091 if (this->interval.
end + 1 < end &&
8096 this->name.
start = this->interval.
end = this->interval.
end + 2;
8100 if (this->interval.
end + 2 < end &&
8106 this->type = html_sequence_t::comment;
8107 this->name.
end = this->interval.
end;
8108 this->attributes.clear();
8109 this->interval.
start = start;
8110 this->interval.
end = this->interval.
end + 3;
8113 this->interval.
end++;
8116 this->type = html_sequence_t::declaration;
8117 this->name.
start = this->name.
end = this->interval.
end;
8119 else if (text[this->interval.
end] ==
'?') {
8121 this->name.
start = ++this->interval.
end;
8125 if (text[this->interval.
end] ==
'>') {
8127 this->type = html_sequence_t::instruction;
8128 this->name.
end = this->interval.
end;
8129 this->attributes.clear();
8130 this->interval.
start = start;
8131 this->interval.
end++;
8134 if (this->interval.
end + 1 < end &&
8139 this->type = html_sequence_t::instruction;
8140 this->name.
end = this->interval.
end;
8141 this->attributes.clear();
8142 this->interval.
start = start;
8143 this->interval.
end = this->interval.
end + 2;
8146 this->interval.
end++;
8151 this->type = html_sequence_t::element_start;
8152 this->name = this->m_ident.
interval;
8159 const auto&
ctype = std::use_facet<std::ctype<T>>(m_locale);
8162 this->attributes.clear();
8164 if (this->type == html_sequence_t::element_start &&
8165 this->interval.
end + 1 < end &&
8170 this->type = html_sequence_t::element;
8171 this->interval.
end = this->interval.
end + 2;
8174 if (this->interval.
end < end &&
8178 this->interval.
end++;
8181 if (this->type == html_sequence_t::declaration &&
8182 this->interval.
end + 1 < end &&
8187 this->interval.
end = this->interval.
end + 2;
8190 if (this->type == html_sequence_t::declaration &&
8191 this->interval.
end + 1 < end &&
8196 this->interval.
end = this->interval.
end + 2;
8200 if (this->interval.
end + 1 < end &&
8205 this->interval.
end = this->interval.
end + 2;
8208 this->interval.
end++;
8223 a = &this->attributes.back();
8229 this->interval.
end++;
8237 this->interval.
end++;
8244 a->value = this->m_value.content;
8253 a->value.invalidate();
8257 this->interval.
start = start;
8269 using html_tag = basic_html_tag<char>;
8270 using whtml_tag = basic_html_tag<wchar_t>;
8272 using thtml_tag = whtml_tag;
8274 using thtml_tag = html_tag;
8284 virtual void invalidate()
8287 basic_parser::invalidate();
8294 _In_reads_or_z_opt_(end)
const T* text,
8295 _In_ size_t start = 0,
8299 _Unreferenced_(
flags);
8300 _Assume_(text || start + 2 >= end);
8301 if (start + 2 < end &&
8302 text[start] ==
'<' &&
8303 text[start + 1] ==
'!' &&
8304 text[start + 2] ==
'[')
8306 this->interval.
end = start + 3;
8309 const auto&
ctype = std::use_facet<std::ctype<T>>(m_locale);
8312 this->condition.
start = this->condition.
end = this->interval.
end;
8317 if (text[this->interval.
end] ==
'[') {
8318 this->interval.
start = start;
8319 this->interval.
end++;
8323 this->interval.
end++;
8325 this->condition.
end = ++this->interval.
end;
8335 using html_declaration_condition_start = basic_html_declaration_condition_start<char>;
8336 using whtml_declaration_condition_start = basic_html_declaration_condition_start<wchar_t>;
8338 using thtml_declaration_condition_start = whtml_declaration_condition_start;
8340 using thtml_declaration_condition_start = html_declaration_condition_start;
8350 virtual bool do_match(
8351 _In_reads_or_z_opt_(end)
const T* text,
8352 _In_ size_t start = 0,
8356 _Unreferenced_(
flags);
8357 _Assume_(text || start + 2 >= end);
8358 if (start + 2 < end &&
8359 text[start] ==
']' &&
8360 text[start + 1] ==
']' &&
8361 text[start + 2] ==
'>')
8363 this->interval.
start = start;
8364 this->interval.
end = start + 3;
8382#undef ENUM_FLAG_OPERATOR
locale_t helper class to free_locale when going out of scope.
Definition locale.hpp:69
Test for angle in d°mm'ss.dddd form.
Definition parser.hpp:4375
Test for any code unit.
Definition parser.hpp:231
Test for beginning of line.
Definition parser.hpp:630
Test for any.
Definition parser.hpp:1073
Test for Creditor Reference.
Definition parser.hpp:4939
T reference[22]
Normalized national reference number.
Definition parser.hpp:4961
T check_digits[3]
Two check digits.
Definition parser.hpp:4960
bool is_valid
Is reference valid per ISO 7064.
Definition parser.hpp:4962
Legacy CSS comment end -->
Definition parser.hpp:7465
Legacy CSS comment start <!--
Definition parser.hpp:7427
CSS import directive.
Definition parser.hpp:7679
stdex::interval< size_t > content
content position in source
Definition parser.hpp:7687
CSS string.
Definition parser.hpp:7502
stdex::interval< size_t > content
content position in source
Definition parser.hpp:7510
URI in CSS.
Definition parser.hpp:7569
stdex::interval< size_t > content
content position in source
Definition parser.hpp:7577
Test for any code unit from a given string of code units.
Definition parser.hpp:735
Test for specific code unit.
Definition parser.hpp:303
Test for date.
Definition parser.hpp:4008
Test for valid DNS domain character.
Definition parser.hpp:2790
bool allow_on_edge
Is character allowed at the beginning or an end of a DNS domain?
Definition parser.hpp:2800
Test for DNS domain/hostname.
Definition parser.hpp:2890
bool m_allow_absolute
May DNS names end with a dot (absolute name)?
Definition parser.hpp:2954
Test for e-mail address.
Definition parser.hpp:3782
Test for emoticon.
Definition parser.hpp:3885
std::shared_ptr< basic_parser< T > > apex
apex/eyebrows/halo (e.g. O, 0)
Definition parser.hpp:3913
std::shared_ptr< basic_parser< T > > eyes
eyes (e.g. :, ;, >, |, B)
Definition parser.hpp:3914
std::shared_ptr< basic_set< T > > mouth
mouth (e.g. ), ), (, (, |, P, D, p, d)
Definition parser.hpp:3916
std::shared_ptr< basic_parser< T > > nose
nose (e.g. -, o)
Definition parser.hpp:3915
std::shared_ptr< basic_parser< T > > emoticon
emoticon as a whole (e.g. 😀, 🤔, 😶)
Definition parser.hpp:3912
Test for end of line.
Definition parser.hpp:669
Test for fraction.
Definition parser.hpp:1701
End of condition ...]]>
Definition parser.hpp:8348
Start of condition <![condition[...
Definition parser.hpp:8282
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:8293
Contiguous sequence of characters representing name of element, attribute etc.
Definition parser.hpp:7896
Tag.
Definition parser.hpp:8048
std::vector< html_attribute > attributes
tag attributes
Definition parser.hpp:8065
html_sequence_t type
tag type
Definition parser.hpp:8063
stdex::interval< size_t > name
tag name position in source
Definition parser.hpp:8064
Optionally-quoted string representing value of an attribute.
Definition parser.hpp:7943
stdex::interval< size_t > content
content position in source
Definition parser.hpp:7951
Test for International Bank Account Number.
Definition parser.hpp:4650
T bban[31]
Normalized Basic Bank Account Number.
Definition parser.hpp:4675
T country[3]
ISO 3166-1 alpha-2 country code.
Definition parser.hpp:4673
T check_digits[3]
Two check digits.
Definition parser.hpp:4674
bool is_valid
Is IBAN valid per ISO 7064.
Definition parser.hpp:4676
Test for decimal integer.
Definition parser.hpp:1311
Test for decimal integer possibly containing thousand separators.
Definition parser.hpp:1396
bool has_separators
Did integer have any separators?
Definition parser.hpp:1417
size_t digit_count
Total number of digits in integer.
Definition parser.hpp:1416
Test for hexadecimal integer.
Definition parser.hpp:1476
Base class for integer testing.
Definition parser.hpp:1289
size_t value
Calculated value of the numeral.
Definition parser.hpp:1303
Test for IPv4 address.
Definition parser.hpp:2359
stdex::interval< size_t > components[4]
Individual component intervals.
Definition parser.hpp:2404
struct in_addr value
IPv4 address value.
Definition parser.hpp:2405
Test for IPv6 address.
Definition parser.hpp:2570
std::shared_ptr< basic_parser< T > > scope_id
Scope ID (e.g. NIC index with link-local addresses)
Definition parser.hpp:2642
stdex::interval< size_t > components[8]
Individual component intervals.
Definition parser.hpp:2640
struct in6_addr value
IPv6 address value.
Definition parser.hpp:2641
Test for valid IPv6 address scope ID character.
Definition parser.hpp:2496
Test for repeating.
Definition parser.hpp:925
bool m_greedy
try to match as long sequence as possible
Definition parser.hpp:964
std::shared_ptr< basic_parser< T > > m_el
repeating element
Definition parser.hpp:961
size_t m_min_iterations
minimum number of iterations
Definition parser.hpp:962
size_t m_max_iterations
maximum number of iterations
Definition parser.hpp:963
Test for JSON string.
Definition parser.hpp:7215
MIME content type.
Definition parser.hpp:7763
stdex::interval< size_t > base_type
basic type position in source
Definition parser.hpp:7773
stdex::interval< size_t > sub_type
sub-type position in source
Definition parser.hpp:7774
stdex::interval< size_t > charset
charset position in source
Definition parser.hpp:7775
Test for mixed numeral.
Definition parser.hpp:1936
std::shared_ptr< basic_parser< T > > fraction
fraction
Definition parser.hpp:1969
std::shared_ptr< basic_parser< T > > special_sign
Special sign (e.g. plus-minus '±')
Definition parser.hpp:1967
std::shared_ptr< basic_parser< T > > negative_sign
Negative sign.
Definition parser.hpp:1966
std::shared_ptr< basic_parser< T > > positive_sign
Positive sign.
Definition parser.hpp:1965
std::shared_ptr< basic_parser< T > > integer
Integer part.
Definition parser.hpp:1968
Test for monetary numeral.
Definition parser.hpp:2230
std::shared_ptr< basic_parser< T > > positive_sign
Positive sign.
Definition parser.hpp:2263
std::shared_ptr< basic_parser< T > > decimal_separator
Decimal separator.
Definition parser.hpp:2268
std::shared_ptr< basic_parser< T > > currency
Currency part.
Definition parser.hpp:2266
std::shared_ptr< basic_parser< T > > decimal
Decimal part.
Definition parser.hpp:2269
std::shared_ptr< basic_parser< T > > integer
Integer part.
Definition parser.hpp:2267
std::shared_ptr< basic_parser< T > > negative_sign
Negative sign.
Definition parser.hpp:2264
std::shared_ptr< basic_parser< T > > special_sign
Special sign (e.g. plus-minus '±')
Definition parser.hpp:2265
"No-op" match
Definition parser.hpp:199
Base template for all parsers.
Definition parser.hpp:75
stdex::interval< size_t > interval
Region of the last match.
Definition parser.hpp:115
Test for permutation.
Definition parser.hpp:1213
Test for phone number.
Definition parser.hpp:4498
std::basic_string< T > value
Normalized phone number.
Definition parser.hpp:4523
Test for any punctuation code unit.
Definition parser.hpp:476
Test for Roman numeral.
Definition parser.hpp:1585
Test for scientific numeral.
Definition parser.hpp:2061
std::shared_ptr< basic_parser< T > > special_sign
Special sign (e.g. plus-minus '±')
Definition parser.hpp:2107
std::shared_ptr< basic_parser< T > > exponent_symbol
Exponent symbol (e.g. 'e')
Definition parser.hpp:2111
std::shared_ptr< basic_parser< T > > positive_sign
Positive sign.
Definition parser.hpp:2105
std::shared_ptr< basic_parser< T > > negative_sign
Negative sign.
Definition parser.hpp:2106
double value
Calculated value of the numeral.
Definition parser.hpp:2115
std::shared_ptr< basic_parser< T > > negative_exp_sign
Negative exponent sign (e.g. '-')
Definition parser.hpp:2113
std::shared_ptr< basic_integer< T > > decimal
Decimal part.
Definition parser.hpp:2110
std::shared_ptr< basic_parser< T > > positive_exp_sign
Positive exponent sign (e.g. '+')
Definition parser.hpp:2112
std::shared_ptr< basic_integer< T > > exponent
Exponent part.
Definition parser.hpp:2114
std::shared_ptr< basic_parser< T > > decimal_separator
Decimal separator.
Definition parser.hpp:2109
std::shared_ptr< basic_integer< T > > integer
Integer part.
Definition parser.hpp:2108
Test for match score.
Definition parser.hpp:1764
Test for sequence.
Definition parser.hpp:1021
Definition parser.hpp:704
Test for SI Reference delimiter.
Definition parser.hpp:5133
Test for SI Reference part.
Definition parser.hpp:5087
Test for SI Reference.
Definition parser.hpp:5172
basic_si_reference_part< T > part3
Reference data part 3 (P3)
Definition parser.hpp:5201
basic_si_reference_part< T > part1
Reference data part 1 (P1)
Definition parser.hpp:5199
bool is_valid
Is reference valid.
Definition parser.hpp:5202
T model[3]
Reference model.
Definition parser.hpp:5198
basic_si_reference_part< T > part2
Reference data part 2 (P2)
Definition parser.hpp:5200
Test for signed numeral.
Definition parser.hpp:1850
std::shared_ptr< basic_parser< T > > special_sign
Special sign (e.g. plus-minus '±')
Definition parser.hpp:1876
std::shared_ptr< basic_parser< T > > negative_sign
Negative sign.
Definition parser.hpp:1875
std::shared_ptr< basic_parser< T > > positive_sign
Positive sign.
Definition parser.hpp:1874
std::shared_ptr< basic_parser< T > > number
Number.
Definition parser.hpp:1877
Test for any space code unit.
Definition parser.hpp:396
Test for any space or punctuation code unit.
Definition parser.hpp:551
Test for any string.
Definition parser.hpp:1141
Test for given string.
Definition parser.hpp:830
Test for time.
Definition parser.hpp:4273
Test for valid URL password character.
Definition parser.hpp:3074
Test for valid URL path character.
Definition parser.hpp:3176
Test for URL path.
Definition parser.hpp:3286
Test for valid URL username character.
Definition parser.hpp:2973
Test for URL.
Definition parser.hpp:3426
Test for HTTP agent.
Definition parser.hpp:6759
Test for HTTP any type.
Definition parser.hpp:5902
Test for HTTP asterisk.
Definition parser.hpp:6530
Test for HTTP cookie parameter (RFC2109)
Definition parser.hpp:6625
Test for HTTP cookie (RFC2109)
Definition parser.hpp:6681
std::list< http_cookie_parameter > params
List of cookie parameters.
Definition parser.hpp:6693
http_token name
Cookie name.
Definition parser.hpp:6691
http_value value
Cookie value.
Definition parser.hpp:6692
Test for HTTP language (RFC1766)
Definition parser.hpp:6398
Test for HTTP line break (RFC2616: CRLF | LF)
Definition parser.hpp:5584
Test for HTTP parameter (RFC2616: parameter)
Definition parser.hpp:5850
http_token name
Parameter name.
Definition parser.hpp:5859
http_value value
Parameter value.
Definition parser.hpp:5860
Test for HTTP protocol.
Definition parser.hpp:6834
uint16_t version
HTTP protocol version: 0x100 = 1.0, 0x101 = 1.1...
Definition parser.hpp:6856
Test for HTTP quoted string (RFC2616: quoted-string)
Definition parser.hpp:5743
stdex::interval< size_t > content
String content (without quotes)
Definition parser.hpp:5752
Test for HTTP request.
Definition parser.hpp:6935
Test for HTTP space (RFC2616: LWS)
Definition parser.hpp:5620
Test for HTTP text character (RFC2616: TEXT)
Definition parser.hpp:5656
Test for HTTP token (RFC2616: token - tolerates non-ASCII)
Definition parser.hpp:5689
Test for HTTP URL parameter.
Definition parser.hpp:6223
Test for HTTP URL path segment.
Definition parser.hpp:6135
Test for HTTP URL path segment.
Definition parser.hpp:6168
std::vector< http_url_path_segment > segments
Path segments.
Definition parser.hpp:6176
Test for HTTP URL port.
Definition parser.hpp:6079
Test for HTTP URL server.
Definition parser.hpp:6042
Test for HTTP URL.
Definition parser.hpp:6300
Collection of HTTP values.
Definition parser.hpp:7171
Test for HTTP value (RFC2616: value)
Definition parser.hpp:5806
http_quoted_string string
Value when matched as quoted string.
Definition parser.hpp:5815
http_token token
Value when matched as token.
Definition parser.hpp:5816
Test for HTTP weight factor.
Definition parser.hpp:6461
float value
Calculated value of the weight factor.
Definition parser.hpp:6474
Test for HTTP weighted value.
Definition parser.hpp:6553
Base template for collection-holding parsers.
Definition parser.hpp:981
Test for any SGML code point.
Definition parser.hpp:264
Test for any SGML code point from a given string of SGML code points.
Definition parser.hpp:787
Test for specific SGML code point.
Definition parser.hpp:352
Test for valid DNS domain SGML character.
Definition parser.hpp:2845
Test for valid IPv6 address scope ID SGML character.
Definition parser.hpp:2535
Test for any SGML punctuation code point.
Definition parser.hpp:517
Test for any SGML space code point.
Definition parser.hpp:439
Test for any SGML space or punctuation code point.
Definition parser.hpp:594
Test for SGML given string.
Definition parser.hpp:877
Test for valid URL password SGML character.
Definition parser.hpp:3127
Test for valid URL path SGML character.
Definition parser.hpp:3233
Test for valid URL username SGML character.
Definition parser.hpp:3025
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:8038
stdex::interval< size_t > name
attribute name position in source
Definition parser.hpp:8039
stdex::interval< size_t > value
attribute value position in source
Definition parser.hpp:8040
Definition parser.hpp:7197