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;
2461 this->interval.
start = start;
2469 std::shared_ptr<basic_parser<T>>
2480 std::shared_ptr<basic_parser<T>> m_separator;
2483 using ipv4_address = basic_ipv4_address<char>;
2484 using wipv4_address = basic_ipv4_address<wchar_t>;
2486 using tipv4_address = wipv4_address;
2488 using tipv4_address = ipv4_address;
2490 using sgml_ipv4_address = basic_ipv4_address<char>;
2502 virtual bool do_match(
2503 _In_reads_or_z_opt_(end)
const T* text,
2504 _In_ size_t start = 0,
2508 _Assume_(text || start >= end);
2509 if (start < end && text[start]) {
2510 if (text[start] ==
'-' ||
2511 text[start] ==
'_' ||
2512 text[start] ==
':' ||
2513 std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::alnum, text[start]))
2515 this->interval.
end = (this->interval.
start = start) + 1;
2541 virtual bool do_match(
2542 _In_reads_or_z_(end)
const char* text,
2543 _In_ size_t start = 0,
2547 _Assume_(text || start >= end);
2548 if (start < end && text[start]) {
2552 if (((
chr[0] ==
L'-' ||
2554 chr[0] ==
L':') &&
chr[1] == 0) ||
2557 this->interval.
start = start;
2593 _In_ const std::locale&
locale = std::locale()) :
2611 m_separator(separator),
2618 virtual void invalidate()
2646 virtual bool do_match(
2647 _In_reads_or_z_opt_(end)
const T* text,
2648 _In_ size_t start = 0,
2652 _Assume_(text || start >= end);
2653 this->interval.
end = start;
2657 for (i = 0; i < 8; i++) {
2662 this->interval.
end = m_separator->interval.end;
2669 this->interval.
end = m_separator->interval.end;
2688 for (
x = 0; this->interval.
end < end && text[this->interval.
end];) {
2708 if (
x_n <= 0xffff) {
2731 this->value.s6_words[--
j] = this->value.s6_words[--
k];
2735 this->value.s6_words[--
j] = 0;
2743 if (m_scope_id_separator && m_scope_id_separator->match(text,
this->
interval.
end, end,
flags) &&
2749 this->interval.
start = start;
2757 std::shared_ptr<basic_parser<T>>
2774 std::shared_ptr<basic_parser<T>> m_separator, m_scope_id_separator;
2777 using ipv6_address = basic_ipv6_address<char>;
2778 using wipv6_address = basic_ipv6_address<wchar_t>;
2780 using tipv6_address = wipv6_address;
2782 using tipv6_address = ipv6_address;
2784 using sgml_ipv6_address = basic_ipv6_address<char>;
2795 _In_ const std::locale&
locale = std::locale()) :
2804 virtual bool do_match(
2805 _In_reads_or_z_opt_(end)
const T* text,
2806 _In_ size_t start = 0,
2810 _Assume_(text || start >= end);
2811 if (start < end && text[start]) {
2812 if ((
'A' <= text[start] && text[start] <=
'Z') ||
2813 (
'a' <= text[start] && text[start] <=
'z') ||
2814 (
'0' <= text[start] && text[start] <=
'9'))
2816 else if (text[start] ==
'-')
2818 else if (m_allow_idn && std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::alnum, text[start]))
2824 this->interval.
end = (this->interval.
start = start) + 1;
2834 using dns_domain_char = basic_dns_domain_char<char>;
2835 using wdns_domain_char = basic_dns_domain_char<wchar_t>;
2837 using tdns_domain_char = wdns_domain_char;
2839 using tdns_domain_char = dns_domain_char;
2850 _In_ const std::locale&
locale = std::locale()) :
2855 virtual bool do_match(
2856 _In_reads_or_z_(end)
const char* text,
2857 _In_ size_t start = 0,
2861 _Assume_(text || start >= end);
2862 if (start < end && text[start]) {
2866 if (((
'A' <=
chr[0] &&
chr[0] <=
'Z') ||
2867 (
'a' <=
chr[0] &&
chr[0] <=
'z') ||
2868 (
'0' <=
chr[0] &&
chr[0] <=
'9')) &&
chr[1] == 0)
2870 else if (
chr[0] ==
'-' &&
chr[1] == 0)
2872 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)
2878 this->interval.
start = start;
2897 _In_ const std::locale&
locale = std::locale()) :
2901 m_separator(separator)
2905 virtual bool do_match(
2906 _In_reads_or_z_opt_(end)
const T* text,
2907 _In_ size_t start = 0,
2911 _Assume_(text || start >= end);
2912 size_t i = start,
count;
2914 if (m_domain_char->match(text, i, end,
flags) &&
2915 m_domain_char->allow_on_edge)
2918 this->interval.
end = i = m_domain_char->interval.end;
2919 while (i < end && text[i]) {
2920 if (m_domain_char->allow_on_edge &&
2921 m_separator->match(text, i, end,
flags))
2925 this->interval.
end = i = m_separator->interval.end;
2927 this->interval.
end = i;
2928 i = m_separator->interval.end;
2932 if (m_domain_char->match(text, i, end,
flags)) {
2933 if (m_domain_char->allow_on_edge)
2934 this->interval.
end = i = m_domain_char->interval.end;
2936 i = m_domain_char->interval.end;
2939 this->interval.
start = start;
2948 this->interval.
start = start;
2956 std::shared_ptr<basic_dns_domain_char<T>> m_domain_char;
2957 std::shared_ptr<basic_parser<T>> m_separator;
2979 virtual bool do_match(
2980 _In_reads_or_z_opt_(end)
const T* text,
2981 _In_ size_t start = 0,
2985 _Assume_(text || start >= end);
2986 if (start < end && text[start]) {
2987 if (text[start] ==
'-' ||
2988 text[start] ==
'.' ||
2989 text[start] ==
'_' ||
2990 text[start] ==
'~' ||
2991 text[start] ==
'%' ||
2992 text[start] ==
'!' ||
2993 text[start] ==
'$' ||
2994 text[start] ==
'&' ||
2995 text[start] ==
'\'' ||
2998 text[start] ==
'*' ||
2999 text[start] ==
'+' ||
3000 text[start] ==
',' ||
3001 text[start] ==
';' ||
3002 text[start] ==
'=' ||
3003 std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::alnum, text[start]))
3005 this->interval.
end = (this->interval.
start = start) + 1;
3031 virtual bool do_match(
3032 _In_reads_or_z_(end)
const char* text,
3033 _In_ size_t start = 0,
3037 _Assume_(text || start >= end);
3038 if (start < end && text[start]) {
3042 if (((
chr[0] ==
L'-' ||
3057 chr[0] ==
L'=') &&
chr[1] == 0) ||
3060 this->interval.
start = start;
3080 virtual bool do_match(
3081 _In_reads_or_z_opt_(end)
const T* text,
3082 _In_ size_t start = 0,
3086 _Assume_(text || start >= end);
3087 if (start < end && text[start]) {
3088 if (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 text[start] ==
':' ||
3105 std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::alnum, text[start]))
3107 this->interval.
end = (this->interval.
start = start) + 1;
3133 virtual bool do_match(
3134 _In_reads_or_z_(end)
const char* text,
3135 _In_ size_t start = 0,
3139 _Assume_(text || start >= end);
3140 if (start < end && text[start]) {
3144 if (((
chr[0] ==
L'-' ||
3160 chr[0] ==
L':') &&
chr[1] == 0) ||
3163 this->interval.
start = start;
3182 virtual bool do_match(
3183 _In_reads_or_z_opt_(end)
const T* text,
3184 _In_ size_t start = 0,
3188 _Assume_(text || start >= end);
3189 if (start < end && text[start]) {
3190 if (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 text[start] ==
'#' ||
3211 std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::alnum, text[start]))
3213 this->interval.
end = (this->interval.
start = start) + 1;
3239 virtual bool do_match(
3240 _In_reads_or_z_(end)
const char* text,
3241 _In_ size_t start = 0,
3245 _Assume_(text || start >= end);
3246 if (start < end && text[start]) {
3250 if (((
chr[0] ==
L'/' ||
3270 chr[0] ==
L'#') &&
chr[1] == 0) ||
3273 this->interval.
start = start;
3293 _In_ const std::locale&
locale = std::locale()) :
3300 virtual void invalidate()
3316 virtual bool do_match(
3317 _In_reads_or_z_opt_(end)
const T* text,
3318 _In_ size_t start = 0,
3322 _Assume_(text || start >= end);
3324 this->interval.
end = start;
3335 path.
end = this->interval.
end;
3336 query.
start = this->interval.
end = m_query_start->interval.end;
3339 query.
end = this->interval.
end;
3343 query.
end = this->interval.
end;
3344 bookmark.
start = this->interval.
end = m_bookmark_start->interval.end;
3347 bookmark.
end = this->interval.
end;
3351 this->interval.
end = m_path_char->interval.end;
3353 bookmark.
end = this->interval.
end;
3357 this->interval.
start = start;
3361 this->interval.
end = m_path_char->interval.end;
3363 query.
end = this->interval.
end;
3367 this->interval.
start = start;
3371 path.
end = this->interval.
end;
3372 bookmark.
start = this->interval.
end = m_bookmark_start->interval.end;
3375 bookmark.
end = this->interval.
end;
3379 this->interval.
end = m_path_char->interval.end;
3381 bookmark.
end = this->interval.
end;
3385 this->interval.
start = start;
3389 this->interval.
end = m_path_char->interval.end;
3395 path.
end = this->interval.
end;
3396 this->interval.
start = start;
3408 std::shared_ptr<basic_parser<T>> m_path_char;
3409 std::shared_ptr<basic_parser<T>> m_query_start;
3410 std::shared_ptr<basic_parser<T>> m_bookmark_start;
3446 _In_ const std::locale&
locale = std::locale()) :
3466 virtual void invalidate()
3468 http_scheme->invalidate();
3469 ftp_scheme->invalidate();
3470 mailto_scheme->invalidate();
3471 file_scheme->invalidate();
3472 username->invalidate();
3473 password->invalidate();
3474 ipv4_host->invalidate();
3475 ipv6_host->invalidate();
3476 dns_host->invalidate();
3482 std::shared_ptr<basic_parser<T>> http_scheme;
3483 std::shared_ptr<basic_parser<T>> ftp_scheme;
3484 std::shared_ptr<basic_parser<T>> mailto_scheme;
3485 std::shared_ptr<basic_parser<T>> file_scheme;
3486 std::shared_ptr<basic_parser<T>> username;
3487 std::shared_ptr<basic_parser<T>> password;
3488 std::shared_ptr<basic_parser<T>> ipv4_host;
3489 std::shared_ptr<basic_parser<T>> ipv6_host;
3490 std::shared_ptr<basic_parser<T>> dns_host;
3491 std::shared_ptr<basic_parser<T>> port;
3492 std::shared_ptr<basic_parser<T>> path;
3495 virtual bool do_match(
3496 _In_reads_or_z_opt_(end)
const T* text,
3497 _In_ size_t start = 0,
3501 _Assume_(text || start >= end);
3503 this->interval.
end = start;
3506 m_colon->match(text, http_scheme->interval.end, end,
flags) &&
3507 m_slash->match(text, m_colon->interval.end, end,
flags) &&
3508 m_slash->match(text, m_slash->interval.end, end,
flags))
3511 this->interval.
end = m_slash->interval.end;
3512 ftp_scheme->invalidate();
3513 mailto_scheme->invalidate();
3514 file_scheme->invalidate();
3517 m_colon->match(text, ftp_scheme->interval.end, end,
flags) &&
3518 m_slash->match(text, m_colon->interval.end, end,
flags) &&
3519 m_slash->match(text, m_slash->interval.end, end,
flags))
3522 this->interval.
end = m_slash->interval.end;
3523 http_scheme->invalidate();
3524 mailto_scheme->invalidate();
3525 file_scheme->invalidate();
3528 m_colon->match(text, mailto_scheme->interval.end, end,
flags))
3531 this->interval.
end = m_colon->interval.end;
3532 http_scheme->invalidate();
3533 ftp_scheme->invalidate();
3534 file_scheme->invalidate();
3537 m_colon->match(text, file_scheme->interval.end, end,
flags) &&
3538 m_slash->match(text, m_colon->interval.end, end,
flags) &&
3539 m_slash->match(text, m_slash->interval.end, end,
flags))
3542 this->interval.
end = m_slash->interval.end;
3543 http_scheme->invalidate();
3544 ftp_scheme->invalidate();
3545 mailto_scheme->invalidate();
3549 http_scheme->invalidate();
3550 ftp_scheme->invalidate();
3551 mailto_scheme->invalidate();
3552 file_scheme->invalidate();
3555 if (ftp_scheme->interval) {
3557 if (m_colon->match(text, username->interval.end, end,
flags) &&
3558 password->match(text, m_colon->interval.end, end,
flags) &&
3559 m_at->match(text, password->interval.end, end,
flags))
3562 this->interval.
end = m_at->interval.end;
3566 this->interval.
end = m_at->interval.end;
3567 password->invalidate();
3570 username->invalidate();
3571 password->invalidate();
3575 username->invalidate();
3576 password->invalidate();
3581 this->interval.
end = ipv4_host->interval.end;
3582 ipv6_host->invalidate();
3583 dns_host->invalidate();
3587 ipv6_host->match(text, m_ip_lbracket->interval.end, end,
flags) &&
3588 m_ip_rbracket->match(text, ipv6_host->interval.end, end,
flags))
3591 this->interval.
end = m_ip_rbracket->interval.end;
3592 ipv4_host->invalidate();
3593 dns_host->invalidate();
3597 this->interval.
end = dns_host->interval.end;
3598 ipv4_host->invalidate();
3599 ipv6_host->invalidate();
3607 port->match(text, m_colon->interval.end, end,
flags))
3610 this->interval.
end = port->interval.end;
3617 this->interval.
end = path->interval.end;
3620 this->interval.
start = start;
3624 if (mailto_scheme->interval) {
3626 m_at->match(text, username->interval.end, end,
flags))
3629 this->interval.
end = m_at->interval.end;
3637 ipv4_host->match(text, m_ip_lbracket->interval.end, end,
flags) &&
3638 m_ip_rbracket->match(text, ipv4_host->interval.end, end,
flags))
3641 this->interval.
end = m_ip_rbracket->interval.end;
3642 ipv6_host->invalidate();
3643 dns_host->invalidate();
3647 ipv6_host->match(text, m_ip_lbracket->interval.end, end,
flags) &&
3648 m_ip_rbracket->match(text, ipv6_host->interval.end, end,
flags))
3651 this->interval.
end = m_ip_rbracket->interval.end;
3652 ipv4_host->invalidate();
3653 dns_host->invalidate();
3657 this->interval.
end = dns_host->interval.end;
3658 ipv4_host->invalidate();
3659 ipv6_host->invalidate();
3666 password->invalidate();
3669 this->interval.
start = start;
3673 if (file_scheme->interval) {
3676 this->interval.
end = path->interval.end;
3679 username->invalidate();
3680 password->invalidate();
3681 ipv4_host->invalidate();
3682 ipv6_host->invalidate();
3683 dns_host->invalidate();
3685 this->interval.
start = start;
3692 if (http_scheme->interval &&
3695 if (m_colon->match(text, username->interval.end, end,
flags) &&
3696 password->match(text, m_colon->interval.end, end,
flags) &&
3697 m_at->match(text, password->interval.end, end,
flags))
3700 this->interval.
end = m_at->interval.end;
3702 else if (m_at->match(text, username->interval.end, end,
flags)) {
3704 this->interval.
end = m_at->interval.end;
3705 password->invalidate();
3708 username->invalidate();
3709 password->invalidate();
3713 username->invalidate();
3714 password->invalidate();
3719 this->interval.
end = ipv4_host->interval.end;
3720 ipv6_host->invalidate();
3721 dns_host->invalidate();
3725 ipv6_host->match(text, m_ip_lbracket->interval.end, end,
flags) &&
3726 m_ip_rbracket->match(text, ipv6_host->interval.end, end,
flags))
3729 this->interval.
end = m_ip_rbracket->interval.end;
3730 ipv4_host->invalidate();
3731 dns_host->invalidate();
3735 this->interval.
end = dns_host->interval.end;
3736 ipv4_host->invalidate();
3737 ipv6_host->invalidate();
3745 port->match(text, m_colon->interval.end, end,
flags))
3748 this->interval.
end = port->interval.end;
3755 this->interval.
end = path->interval.end;
3758 this->interval.
start = start;
3762 std::shared_ptr<basic_parser<T>> m_colon;
3763 std::shared_ptr<basic_parser<T>> m_slash;
3764 std::shared_ptr<basic_parser<T>> m_at;
3765 std::shared_ptr<basic_parser<T>> m_ip_lbracket;
3766 std::shared_ptr<basic_parser<T>> m_ip_rbracket;
3793 _In_ const std::locale&
locale = std::locale()) :
3804 virtual void invalidate()
3806 username->invalidate();
3807 ipv4_host->invalidate();
3808 ipv6_host->invalidate();
3809 dns_host->invalidate();
3813 std::shared_ptr<basic_parser<T>> username;
3814 std::shared_ptr<basic_parser<T>> ipv4_host;
3815 std::shared_ptr<basic_parser<T>> ipv6_host;
3816 std::shared_ptr<basic_parser<T>> dns_host;
3819 virtual bool do_match(
3820 _In_reads_or_z_opt_(end)
const T* text,
3821 _In_ size_t start = 0,
3825 _Assume_(text || start >= end);
3827 if (username->match(text, start, end,
flags) &&
3828 m_at->match(text, username->interval.end, end,
flags))
3831 if (m_ip_lbracket->match(text, m_at->interval.end, end,
flags) &&
3832 ipv4_host->match(text, m_ip_lbracket->interval.end, end,
flags) &&
3833 m_ip_rbracket->match(text, ipv4_host->interval.end, end,
flags))
3836 this->interval.
end = m_ip_rbracket->interval.end;
3837 ipv6_host->invalidate();
3838 dns_host->invalidate();
3841 m_ip_lbracket->match(text, m_at->interval.end, end,
flags) &&
3842 ipv6_host->match(text, m_ip_lbracket->interval.end, end,
flags) &&
3843 m_ip_rbracket->match(text, ipv6_host->interval.end, end,
flags))
3846 this->interval.
end = m_ip_rbracket->interval.end;
3847 ipv4_host->invalidate();
3848 dns_host->invalidate();
3850 else if (dns_host->match(text, m_at->interval.end, end,
flags)) {
3852 this->interval.
end = dns_host->interval.end;
3853 ipv4_host->invalidate();
3854 ipv6_host->invalidate();
3858 this->interval.
start = start;
3867 std::shared_ptr<basic_parser<T>> m_at;
3868 std::shared_ptr<basic_parser<T>> m_ip_lbracket;
3869 std::shared_ptr<basic_parser<T>> m_ip_rbracket;
3894 _In_ const std::locale&
locale = std::locale()) :
3903 virtual void invalidate()
3909 mouth->invalidate();
3914 std::shared_ptr<basic_parser<T>>
apex;
3915 std::shared_ptr<basic_parser<T>>
eyes;
3916 std::shared_ptr<basic_parser<T>>
nose;
3920 virtual bool do_match(
3921 _In_reads_or_z_opt_(end)
const T* text,
3922 _In_ size_t start = 0,
3926 _Assume_(text || start >= end);
3932 mouth->invalidate();
3933 this->interval.
start = start;
3938 this->interval.
end = start;
3941 this->interval.
end =
apex->interval.end;
3949 hit_offset =
mouth->hit_offset;
3951 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);
3954 this->interval.
start = start;
3960 hit_offset =
mouth->hit_offset;
3962 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);
3966 this->interval.
start = start;
3975 mouth->invalidate();
3981 using emoticon = basic_emoticon<char>;
3982 using wemoticon = basic_emoticon<wchar_t>;
3984 using temoticon = wemoticon;
3986 using temoticon = emoticon;
3988 using sgml_emoticon = basic_emoticon<char>;
3993 enum date_format_t {
3994 date_format_none = 0,
3995 date_format_dmy = 0x1,
3996 date_format_mdy = 0x2,
3997 date_format_ymd = 0x4,
3998 date_format_ym = 0x8,
3999 date_format_my = 0x10,
4000 date_format_dm = 0x20,
4001 date_format_md = 0x40,
4018 _In_ const std::locale&
locale = std::locale()) :
4020 format(date_format_none),
4025 m_separator(separator),
4029 virtual void invalidate()
4031 if (day) day->invalidate();
4032 if (month) month->invalidate();
4033 if (year) year->invalidate();
4034 format = date_format_none;
4038 date_format_t format;
4039 std::shared_ptr<basic_integer<T>> day;
4040 std::shared_ptr<basic_integer<T>> month;
4041 std::shared_ptr<basic_integer<T>> year;
4044 virtual bool do_match(
4045 _In_reads_or_z_opt_(end)
const T* text,
4046 _In_ size_t start = 0,
4050 _Assume_(text || start >= end);
4053 if ((m_format_mask & date_format_dmy) == date_format_dmy) {
4054 if (day->match(text, start, end,
flags)) {
4055 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);
4057 size_t hit_offset = m_separator->hit_offset;
4058 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);
4060 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);
4062 m_separator->hit_offset == hit_offset)
4064 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);
4066 is_valid(day->value, month->value))
4068 this->interval.
start = start;
4069 this->interval.
end = year->interval.end;
4070 format = date_format_dmy;
4079 if ((m_format_mask & date_format_mdy) == date_format_mdy) {
4080 if (month->match(text, start, end,
flags)) {
4081 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);
4083 size_t hit_offset = m_separator->hit_offset;
4084 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);
4086 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);
4088 m_separator->hit_offset == hit_offset)
4090 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);
4092 is_valid(day->value, month->value))
4094 this->interval.
start = start;
4095 this->interval.
end = year->interval.end;
4096 format = date_format_mdy;
4105 if ((m_format_mask & date_format_ymd) == date_format_ymd) {
4106 if (year->match(text, start, end,
flags)) {
4107 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);
4109 size_t hit_offset = m_separator->hit_offset;
4110 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);
4112 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);
4114 m_separator->hit_offset == hit_offset)
4116 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);
4118 is_valid(day->value, month->value))
4120 this->interval.
start = start;
4121 this->interval.
end = day->interval.end;
4122 format = date_format_ymd;
4131 if ((m_format_mask & date_format_ym) == date_format_ym) {
4132 if (year->match(text, start, end,
flags)) {
4133 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);
4135 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);
4139 if (day) day->invalidate();
4140 this->interval.
start = start;
4141 this->interval.
end = month->interval.end;
4142 format = date_format_ym;
4149 if ((m_format_mask & date_format_my) == date_format_my) {
4150 if (month->match(text, start, end,
flags)) {
4151 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);
4153 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);
4157 if (day) day->invalidate();
4158 this->interval.
start = start;
4159 this->interval.
end = year->interval.end;
4160 format = date_format_my;
4167 if ((m_format_mask & date_format_dm) == date_format_dm) {
4168 if (day->match(text, start, end,
flags)) {
4169 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);
4171 size_t hit_offset = m_separator->hit_offset;
4172 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);
4174 is_valid(day->value, month->value))
4176 if (year) year->invalidate();
4177 this->interval.
start = start;
4178 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);
4180 m_separator->hit_offset == hit_offset)
4181 this->interval.
end = m_separator->interval.end;
4183 this->interval.
end = month->interval.end;
4184 format = date_format_dm;
4191 if ((m_format_mask & date_format_md) == date_format_md) {
4192 if (month->match(text, start, end,
flags)) {
4193 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);
4195 size_t hit_offset = m_separator->hit_offset;
4196 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);
4198 is_valid(day->value, month->value))
4200 if (year) year->invalidate();
4201 this->interval.
start = start;
4202 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);
4204 m_separator->hit_offset == hit_offset)
4205 this->interval.
end = m_separator->interval.end;
4207 this->interval.
end = day->interval.end;
4208 format = date_format_md;
4215 if (day) day->invalidate();
4216 if (month) month->invalidate();
4217 if (year) year->invalidate();
4218 format = date_format_none;
4223 static bool is_valid(
size_t day,
size_t month)
4242 return 1 <= day && day <= 31;
4244 return 1 <= day && day <= 29;
4249 return 1 <= day && day <= 30;
4256 std::shared_ptr<basic_set<T>> m_separator;
4257 std::shared_ptr<basic_parser<T>> m_space;
4283 _In_ const std::locale&
locale = std::locale()) :
4289 m_separator(separator),
4293 virtual void invalidate()
4296 minute->invalidate();
4297 if (second) second->invalidate();
4298 if (millisecond) millisecond->invalidate();
4302 std::shared_ptr<basic_integer10<T>> hour;
4303 std::shared_ptr<basic_integer10<T>> minute;
4304 std::shared_ptr<basic_integer10<T>> second;
4305 std::shared_ptr<basic_integer10<T>> millisecond;
4308 virtual bool do_match(
4309 _In_reads_or_z_opt_(end)
const T* text,
4310 _In_ size_t start = 0,
4314 _Assume_(text || start >= end);
4316 if (hour->match(text, start, end,
flags) &&
4317 m_separator->match(text, hour->interval.end, end,
flags) &&
4318 minute->match(text, m_separator->interval.end, end,
flags) &&
4322 size_t hit_offset = m_separator->hit_offset;
4323 if (m_separator->match(text, minute->interval.end, end,
flags) &&
4324 m_separator->hit_offset == hit_offset &&
4325 second && second->match(text, m_separator->interval.end, end,
flags) &&
4329 if (m_millisecond_separator && m_millisecond_separator->match(text, second->interval.end, end,
flags) &&
4330 millisecond && millisecond->match(text, m_millisecond_separator->interval.end, end,
flags) &&
4331 millisecond->value < 1000)
4334 this->interval.
end = millisecond->interval.end;
4337 if (millisecond) millisecond->invalidate();
4338 this->interval.
end = second->interval.end;
4342 if (second) second->invalidate();
4343 if (millisecond) millisecond->invalidate();
4344 this->interval.
end = minute->interval.end;
4346 this->interval.
start = start;
4351 minute->invalidate();
4352 if (second) second->invalidate();
4353 if (millisecond) millisecond->invalidate();
4358 std::shared_ptr<basic_set<T>> m_separator;
4359 std::shared_ptr<basic_parser<T>> m_millisecond_separator;
4386 _In_ const std::locale&
locale = std::locale()) :
4397 virtual void invalidate()
4399 degree->invalidate();
4400 degree_separator->invalidate();
4401 minute->invalidate();
4402 minute_separator->invalidate();
4403 if (second) second->invalidate();
4404 if (second_separator) second_separator->invalidate();
4405 if (decimal) decimal->invalidate();
4409 std::shared_ptr<basic_integer10<T>> degree;
4410 std::shared_ptr<basic_parser<T>> degree_separator;
4411 std::shared_ptr<basic_integer10<T>> minute;
4412 std::shared_ptr<basic_parser<T>> minute_separator;
4413 std::shared_ptr<basic_integer10<T>> second;
4414 std::shared_ptr<basic_parser<T>> second_separator;
4415 std::shared_ptr<basic_parser<T>> decimal;
4418 virtual bool do_match(
4419 _In_reads_or_z_opt_(end)
const T* text,
4420 _In_ size_t start = 0,
4424 _Assume_(text || start >= end);
4426 this->interval.
end = start;
4429 degree_separator->match(text, degree->interval.end, end,
flags))
4432 this->interval.
end = degree_separator->interval.end;
4435 degree->invalidate();
4436 degree_separator->invalidate();
4440 minute->value < 60 &&
4441 minute_separator->match(text, minute->interval.end, end,
flags))
4444 this->interval.
end = minute_separator->interval.end;
4447 minute->invalidate();
4448 minute_separator->invalidate();
4455 this->interval.
end = second->interval.end;
4457 this->interval.
end = second_separator->interval.end;
4459 if (second_separator) second_separator->invalidate();
4462 if (second) second->invalidate();
4463 if (second_separator) second_separator->invalidate();
4466 if (degree->interval.start < degree->interval.end ||
4467 minute->interval.start < minute->interval.end ||
4468 (second && second->interval.start < second->interval.end))
4472 this->interval.
end = decimal->interval.end;
4475 decimal->invalidate();
4476 this->interval.
start = start;
4479 if (decimal) decimal->invalidate();
4508 _In_ const std::locale&
locale = std::locale()) :
4514 m_separator(separator),
4518 virtual void invalidate()
4527 virtual bool do_match(
4528 _In_reads_or_z_opt_(end)
const T* text,
4529 _In_ size_t start = 0,
4533 _Assume_(text || start >= end);
4539 this->interval.
end = start;
4541 m_lparenthesis->invalidate();
4542 m_rparenthesis->invalidate();
4545 value.append(text + m_plus_sign->interval.start, text + m_plus_sign->interval.end);
4547 this->interval.
end = m_plus_sign->interval.end;
4551 _Assume_(text || this->interval.
end >= end);
4556 value.append(text + m_digit->interval.start, text + m_digit->interval.end);
4557 this->interval.
end = m_digit->interval.end;
4567 m_lparenthesis && !m_lparenthesis->interval &&
4568 m_rparenthesis && !m_rparenthesis->interval &&
4572 value.append(text + m_lparenthesis->interval.start, m_lparenthesis->interval.size());
4573 this->interval.
end = m_lparenthesis->interval.end;
4580 m_rparenthesis && !m_rparenthesis->interval &&
4582 m_lparenthesis->hit_offset == m_rparenthesis->hit_offset)
4585 value.append(text + m_rparenthesis->interval.start, text + m_rparenthesis->interval.end);
4586 this->interval.
end = m_rparenthesis->interval.end;
4600 this->interval.
end = m_separator->interval.end;
4609 this->interval.
end = m_space->interval.end;
4618 this->interval.
start = start;
4627 std::shared_ptr<basic_parser<T>> m_digit;
4628 std::shared_ptr<basic_parser<T>> m_plus_sign;
4629 std::shared_ptr<basic_set<T>> m_lparenthesis;
4630 std::shared_ptr<basic_set<T>> m_rparenthesis;
4631 std::shared_ptr<basic_parser<T>> m_separator;
4632 std::shared_ptr<basic_parser<T>> m_space;
4635 using phone_number = basic_phone_number<char>;
4636 using wphone_number = basic_phone_number<wchar_t>;
4638 using tphone_number = wphone_number;
4640 using tphone_number = phone_number;
4642 using sgml_phone_number = basic_phone_number<char>;
4655 _In_ const std::locale&
locale = std::locale()) :
4665 virtual void invalidate()
4680 virtual bool do_match(
4681 _In_reads_or_z_opt_(end)
const T* text,
4682 _In_ size_t start = 0,
4686 _Assume_(text || start >= end);
4687 const auto&
ctype = std::use_facet<std::ctype<T>>(this->m_locale);
4695 { {
'A',
'D' }, {}, 24 },
4696 { {
'A',
'E' }, {}, 23 },
4697 { {
'A',
'L' }, {}, 28 },
4698 { {
'A',
'O' }, {}, 25 },
4699 { {
'A',
'T' }, {}, 20 },
4700 { {
'A',
'Z' }, {}, 28 },
4701 { {
'B',
'A' }, {
'3',
'9' }, 20},
4702 { {
'B',
'E' }, {}, 16 },
4703 { {
'B',
'F' }, {}, 28 },
4704 { {
'B',
'G' }, {}, 22 },
4705 { {
'B',
'H' }, {}, 22 },
4706 { {
'B',
'I' }, {}, 27 },
4707 { {
'B',
'J' }, {}, 28 },
4708 { {
'B',
'R' }, {}, 29 },
4709 { {
'B',
'Y' }, {}, 28 },
4710 { {
'C',
'F' }, {}, 27 },
4711 { {
'C',
'G' }, {}, 27 },
4712 { {
'C',
'H' }, {}, 21 },
4713 { {
'C',
'I' }, {}, 28 },
4714 { {
'C',
'M' }, {}, 27 },
4715 { {
'C',
'R' }, {}, 22 },
4716 { {
'C',
'V' }, {}, 25 },
4717 { {
'C',
'Y' }, {}, 28 },
4718 { {
'C',
'Z' }, {}, 24 },
4719 { {
'D',
'E' }, {}, 22 },
4720 { {
'D',
'J' }, {}, 27 },
4721 { {
'D',
'K' }, {}, 18 },
4722 { {
'D',
'O' }, {}, 28 },
4723 { {
'D',
'Z' }, {}, 26 },
4724 { {
'E',
'E' }, {}, 20 },
4725 { {
'E',
'G' }, {}, 29 },
4726 { {
'E',
'S' }, {}, 24 },
4727 { {
'F',
'I' }, {}, 18 },
4728 { {
'F',
'O' }, {}, 18 },
4729 { {
'F',
'R' }, {}, 27 },
4730 { {
'G',
'A' }, {}, 27 },
4731 { {
'G',
'B' }, {}, 22 },
4732 { {
'G',
'E' }, {}, 22 },
4733 { {
'G',
'I' }, {}, 23 },
4734 { {
'G',
'L' }, {}, 18 },
4735 { {
'G',
'Q' }, {}, 27 },
4736 { {
'G',
'R' }, {}, 27 },
4737 { {
'G',
'T' }, {}, 28 },
4738 { {
'G',
'W' }, {}, 25 },
4739 { {
'H',
'N' }, {}, 28 },
4740 { {
'H',
'R' }, {}, 21 },
4741 { {
'H',
'U' }, {}, 28 },
4742 { {
'I',
'E' }, {}, 22 },
4743 { {
'I',
'L' }, {}, 23 },
4744 { {
'I',
'Q' }, {}, 23 },
4745 { {
'I',
'R' }, {}, 26 },
4746 { {
'I',
'S' }, {}, 26 },
4747 { {
'I',
'T' }, {}, 27 },
4748 { {
'J',
'O' }, {}, 30 },
4749 { {
'K',
'M' }, {}, 27 },
4750 { {
'K',
'W' }, {}, 30 },
4751 { {
'K',
'Z' }, {}, 20 },
4752 { {
'L',
'B' }, {}, 28 },
4753 { {
'L',
'C' }, {}, 32 },
4754 { {
'L',
'I' }, {}, 21 },
4755 { {
'L',
'T' }, {}, 20 },
4756 { {
'L',
'U' }, {}, 20 },
4757 { {
'L',
'V' }, {}, 21 },
4758 { {
'L',
'Y' }, {}, 25 },
4759 { {
'M',
'A' }, {}, 28 },
4760 { {
'M',
'C' }, {}, 27 },
4761 { {
'M',
'D' }, {}, 24 },
4762 { {
'M',
'E' }, {
'2',
'5' }, 22 },
4763 { {
'M',
'G' }, {}, 27 },
4764 { {
'M',
'K' }, {
'0',
'7' }, 19 },
4765 { {
'M',
'L' }, {}, 28 },
4766 { {
'M',
'R' }, {
'1',
'3' }, 27},
4767 { {
'M',
'T' }, {}, 31 },
4768 { {
'M',
'U' }, {}, 30 },
4769 { {
'M',
'Z' }, {}, 25 },
4770 { {
'N',
'E' }, {}, 28 },
4771 { {
'N',
'I' }, {}, 32 },
4772 { {
'N',
'L' }, {}, 18 },
4773 { {
'N',
'O' }, {}, 15 },
4774 { {
'P',
'K' }, {}, 24 },
4775 { {
'P',
'L' }, {}, 28 },
4776 { {
'P',
'S' }, {}, 29 },
4777 { {
'P',
'T' }, {
'5',
'0' }, 25 },
4778 { {
'Q',
'A' }, {}, 29 },
4779 { {
'R',
'O' }, {}, 24 },
4780 { {
'R',
'S' }, {
'3',
'5' }, 22 },
4781 { {
'R',
'U' }, {}, 33 },
4782 { {
'S',
'A' }, {}, 24 },
4783 { {
'S',
'C' }, {}, 31 },
4784 { {
'S',
'D' }, {}, 18 },
4785 { {
'S',
'E' }, {}, 24 },
4786 { {
'S',
'I' }, {
'5',
'6' }, 19 },
4787 { {
'S',
'K' }, {}, 24 },
4788 { {
'S',
'M' }, {}, 27 },
4789 { {
'S',
'N' }, {}, 28 },
4790 { {
'S',
'T' }, {}, 25 },
4791 { {
'S',
'V' }, {}, 28 },
4792 { {
'T',
'D' }, {}, 27 },
4793 { {
'T',
'G' }, {}, 28 },
4794 { {
'T',
'L' }, {
'3',
'8' }, 23},
4795 { {
'T',
'N' }, {
'5',
'9' }, 24 },
4796 { {
'T',
'R' }, {}, 26 },
4797 { {
'U',
'A' }, {}, 29 },
4798 { {
'V',
'A' }, {}, 22 },
4799 { {
'V',
'G' }, {}, 24 },
4800 { {
'X',
'K' }, {}, 20 },
4806 this->interval.
end = start;
4807 for (
size_t i = 0; i < 2; ++i, ++this->interval.
end) {
4811 if (
chr <
'A' ||
'Z' <
chr)
4813 this->country[i] =
chr;
4818 size_t m = (
l +
r) / 2;
4820 if (
c.country[0] <
this->country[0] || (
c.country[0] ==
this->country[0] &&
c.country[1] <
this->country[1]))
4822 else if (this->country[0] <
c.country[0] || (
this->country[0] ==
c.country[0] &&
this->country[1] <
c.country[1]))
4829 this->country[2] = 0;
4831 for (
size_t i = 0; i < 2; ++i, ++this->interval.
end) {
4834 this->check_digits[i] = text[this->interval.
end];
4836 this->check_digits[2] = 0;
4847 this->interval.
end = m_space->interval.end;
4851 if ((
'0' <=
chr &&
chr <=
'9') || (
'A' <=
chr &&
chr <=
'Z')) {
4852 this->bban[
n++] =
chr;
4853 this->interval.
end++;
4863 for (
size_t i = 0; ; ++i) {
4864 if (!this->bban[i]) {
4865 for (i = 0; i < 2; ++i) {
4866 if (
'A' <= this->country[i] && this->country[i] <=
'J') {
4870 else if (
'K' <= this->country[i] && this->country[i] <=
'T') {
4874 else if (
'U' <= this->country[i] && this->country[i] <=
'Z') {
4884 if (
'0' <= this->bban[i] && this->bban[i] <=
'9')
4886 else if (
'A' <= this->bban[i] && this->bban[i] <=
'J') {
4890 else if (
'K' <= this->bban[i] && this->bban[i] <=
'T') {
4894 else if (
'U' <= this->bban[i] && this->bban[i] <=
'Z') {
4909 for (; digit_count < 9 &&
normalized[next]; ++next, ++digit_count)
4913 this->interval.
start = start;
4921 std::shared_ptr<basic_parser<T>> m_space;
4924 using iban = basic_iban<char>;
4925 using wiban = basic_iban<wchar_t>;
4927 using tiban = wiban;
4931 using sgml_iban = basic_iban<char>;
4944 _In_ const std::locale&
locale = std::locale()) :
4948 this->check_digits[0] = 0;
4950 this->is_valid =
false;
4953 virtual void invalidate()
4955 this->check_digits[0] = 0;
4957 this->is_valid =
false;
4966 virtual bool do_match(
4967 _In_reads_or_z_opt_(end)
const T* text,
4968 _In_ size_t start = 0,
4972 _Assume_(text || start >= end);
4973 const auto&
ctype = std::use_facet<std::ctype<T>>(this->m_locale);
4978 this->interval.
end = start;
4979 if (this->interval.
end + 1 >= end ||
4983 this->interval.
end += 2;
4985 for (
size_t i = 0; i < 2; ++i, ++this->interval.
end) {
4988 this->check_digits[i] = text[this->interval.
end];
4990 this->check_digits[2] = 0;
4994 this->interval.
end = m_space->interval.end;
4995 for (
size_t j = 0;
j < 4; ++
j) {
4999 if ((
'0' <=
chr &&
chr <=
'9') || (
'A' <=
chr &&
chr <=
'Z')) {
5002 this->reference[
n++] =
chr;
5003 this->interval.
end++;
5012 this->reference[_countof(this->reference) - 1] = 0;
5013 for (
size_t i =
n,
j = _countof(this->reference) - 1; i;)
5014 this->reference[--
j] = this->reference[--i];
5015 for (
size_t j = _countof(this->reference) - 1 -
n;
j;)
5016 this->reference[--
j] =
'0';
5021 for (
size_t i = 0; ; ++i) {
5022 if (!this->reference[i]) {
5032 if (
'0' <= this->reference[i] && this->reference[i] <=
'9')
5034 else if (
'A' <= this->reference[i] && this->reference[i] <=
'J') {
5038 else if (
'K' <= this->reference[i] && this->reference[i] <=
'T') {
5042 else if (
'U' <= this->reference[i] && this->reference[i] <=
'Z') {
5057 for (; digit_count < 9 &&
normalized[next]; ++next, ++digit_count)
5061 this->interval.
start = start;
5069 std::shared_ptr<basic_parser<T>> m_space;
5072 using creditor_reference = basic_creditor_reference<char>;
5073 using wcreditor_reference = basic_creditor_reference<wchar_t>;
5075 using tcreditor_reference = wcreditor_reference;
5077 using tcreditor_reference = creditor_reference;
5079 using sgml_creditor_reference = basic_creditor_reference<char>;
5093 virtual bool do_match(
5094 _In_reads_or_z_opt_(end)
const T* text,
5095 _In_ size_t start = 0,
5099 _Assume_(text || start >= end);
5100 this->interval.
end = start;
5105 this->interval.
end++;
5110 this->interval.
start = start;
5139 virtual bool do_match(
5140 _In_reads_or_z_opt_(end)
const T* text,
5141 _In_ size_t start = 0,
5145 _Assume_(text || start >= end);
5146 if (start < end && text[start] ==
'-') {
5147 this->interval.
end = (this->interval.
start = start) + 1;
5177 _In_ const std::locale&
locale = std::locale()) :
5189 virtual void invalidate()
5192 this->
part1.invalidate();
5193 this->
part2.invalidate();
5194 this->
part3.invalidate();
5195 this->is_valid =
false;
5206 virtual bool do_match(
5207 _In_reads_or_z_opt_(end)
const T* text,
5208 _In_ size_t start = 0,
5212 _Assume_(text || start >= end);
5213 const auto&
ctype = std::use_facet<std::ctype<T>>(this->m_locale);
5216 this->interval.
end = start;
5217 if (this->interval.
end + 1 >= end ||
5221 this->interval.
end += 2;
5223 for (
size_t i = 0; i < 2; ++i, ++this->interval.
end) {
5226 this->model[i] = text[this->interval.
end];
5230 this->part1.invalidate();
5231 this->part2.invalidate();
5232 this->part3.invalidate();
5233 if (this->model[0] ==
'9' && this->model[1] ==
'9') {
5235 this->interval.
start = start;
5240 this->interval.
end = m_space->interval.end;
5242 this->part1.match(text, this->interval.
end, end,
flags) &&
5248 this->interval.
start = start;
5256 this->interval.
end = start + 4;
5258 if (this->model[0] ==
'0' && this->model[1] ==
'0')
5269 else if (this->model[0] ==
'0' && this->model[1] ==
'1')
5288 else if (this->model[0] ==
'0' && this->model[1] ==
'2')
5296 else if (this->model[0] ==
'0' && this->model[1] ==
'3')
5305 else if (this->model[0] ==
'0' && this->model[1] ==
'4')
5313 else if ((this->model[0] ==
'0' || this->model[0] ==
'5') && this->model[1] ==
'5')
5327 else if (this->model[0] ==
'0' && this->model[1] ==
'6')
5340 else if (this->model[0] ==
'0' && this->model[1] ==
'7')
5351 else if (this->model[0] ==
'0' && this->model[1] ==
'8')
5361 else if (this->model[0] ==
'0' && this->model[1] ==
'9')
5379 else if (this->model[0] ==
'1' && this->model[1] ==
'0')
5395 (this->model[0] ==
'1' && (this->model[1] ==
'1' || this->model[1] ==
'8' || this->model[1] ==
'9')) ||
5396 ((this->model[0] ==
'2' || this->model[0] ==
'3') && this->model[1] ==
'8') ||
5397 (this->model[0] ==
'4' && (this->model[1] ==
'0' || this->model[1] ==
'1' || this->model[1] ==
'8' || this->model[1] ==
'9')) ||
5398 (this->model[0] ==
'5' && (this->model[1] ==
'1' || this->model[1] ==
'8')))
5411 else if (this->model[0] ==
'1' && this->model[1] ==
'2')
5419 else if ((this->model[0] ==
'2' || this->model[0] ==
'3') && this->model[1] ==
'1')
5436 static bool check11(
5449 static bool check11(
5450 _In_count_(num_part1)
const T*
part1, _In_
size_t num_part1,
5451 _In_count_(num_part2)
const T*
part2, _In_
size_t num_part2)
5453 _Assume_(
part1 || !num_part1);
5454 _Assume_(
part2 && num_part2 >= 1);
5455 uint32_t nominator = 0, ponder = 2;
5456 for (
size_t i = num_part2 - 1; i--; ++ponder)
5457 nominator += (
part2[i] -
'0') * ponder;
5458 for (
size_t i = num_part1; i--; ++ponder)
5459 nominator += (
part1[i] -
'0') * ponder;
5460 uint8_t control = 11 -
static_cast<uint8_t
>(nominator % 11);
5463 return control ==
part2[num_part2 - 1] -
'0';
5466 static bool check11(
5467 _In_count_(num_part1)
const T*
part1, _In_
size_t num_part1,
5468 _In_count_(num_part2)
const T*
part2, _In_
size_t num_part2,
5469 _In_count_(num_part3)
const T*
part3, _In_
size_t num_part3)
5471 _Assume_(
part1 || !num_part1);
5472 _Assume_(
part2 || !num_part2);
5473 _Assume_(
part3 && num_part3 >= 1);
5474 uint32_t nominator = 0, ponder = 2;
5475 for (
size_t i = num_part3 - 1; i--; ++ponder)
5476 nominator += (
part3[i] -
'0') * ponder;
5477 for (
size_t i = num_part2; i--; ++ponder)
5478 nominator += (
part2[i] -
'0') * ponder;
5479 for (
size_t i = num_part1; i--; ++ponder)
5480 nominator += (
part1[i] -
'0') * ponder;
5481 uint8_t control = 11 -
static_cast<uint8_t
>(nominator % 11);
5484 return control ==
part2[num_part3 - 1] -
'0';
5487 std::shared_ptr<basic_parser<T>> m_space;
5488 basic_si_reference_delimiter<T> m_delimiter;
5491 using si_reference = basic_si_reference<char>;
5492 using wsi_reference = basic_si_reference<wchar_t>;
5494 using tsi_reference = wsi_reference;
5496 using tsi_reference = si_reference;
5498 using sgml_si_reference = basic_si_reference<char>;
5511 _In_ const std::locale&
locale = std::locale()) :
5520 virtual void invalidate()
5531 virtual bool do_match(
5532 _In_reads_or_z_opt_(end)
const T* text,
5533 _In_ size_t start = 0,
5537 _Assume_(text || start >= end);
5541 this->interval.
end = start;
5546 this->interval.
end = m_element->interval.end;
5548 this->interval.
end = m_digit->interval.end;
5554 this->interval.
end = m_sign->interval.end;
5557 this->interval.
start = start;
5567 std::shared_ptr<basic_parser<T>> m_element;
5568 std::shared_ptr<basic_parser<T>> m_digit;
5569 std::shared_ptr<basic_parser<T>> m_sign;
5587 virtual bool do_match(
5588 _In_reads_or_z_(end)
const char* text,
5589 _In_ size_t start = 0,
5593 _Assume_(text || start >= end);
5594 this->interval.
end = start;
5596 _Assume_(text || this->interval.
end >= end);
5598 if (text[this->interval.
end] ==
'\r') {
5599 this->interval.
end++;
5601 this->interval.
start = start;
5602 this->interval.
end++;
5606 else if (text[this->interval.
end] ==
'\n') {
5607 this->interval.
start = start;
5608 this->interval.
end++;
5623 virtual bool do_match(
5624 _In_reads_or_z_(end)
const char* text,
5625 _In_ size_t start = 0,
5629 _Assume_(text || start >= end);
5630 this->interval.
end = start;
5634 this->interval.
start = start;
5635 this->interval.
end++;
5641 this->interval.
start = start;
5642 this->interval.
end++;
5659 virtual bool do_match(
5660 _In_reads_or_z_(end)
const char* text,
5661 _In_ size_t start = 0,
5665 _Assume_(text || start >= end);
5666 this->interval.
end = start;
5668 _Assume_(text || this->interval.
end >= end);
5670 this->interval.
start = start;
5675 this->interval.
start = start;
5676 this->interval.
end++;
5692 virtual bool do_match(
5693 _In_reads_or_z_(end)
const char* text,
5694 _In_ size_t start = 0,
5698 _Assume_(text || start >= end);
5699 this->interval.
end = start;
5702 if ((
unsigned int)text[this->interval.
end] < 0x20 ||
5724 this->interval.
end++;
5730 this->interval.
start = start;
5746 virtual void invalidate()
5750 parser::invalidate();
5756 virtual bool do_match(
5757 _In_reads_or_z_(end)
const char* text,
5758 _In_ size_t start = 0,
5762 _Assume_(text || start >= end);
5763 this->interval.
end = start;
5766 this->interval.
end++;
5769 _Assume_(text || this->interval.
end >= end);
5771 if (text[this->interval.
end] ==
'"') {
5773 this->interval.
end++;
5776 else if (text[this->interval.
end] ==
'\\') {
5777 this->interval.
end++;
5779 this->interval.
end++;
5785 this->interval.
end++;
5792 this->interval.
start = start;
5809 virtual void invalidate()
5811 string.invalidate();
5813 parser::invalidate();
5820 virtual bool do_match(
5821 _In_reads_or_z_(end)
const char* text,
5822 _In_ size_t start = 0,
5826 _Assume_(text || start >= end);
5827 this->interval.
end = start;
5828 if (
string.match(text, this->interval.
end, end,
flags)) {
5830 this->interval.
end =
string.interval.end;
5831 this->interval.
start = start;
5835 string.invalidate();
5837 this->interval.
start = start;
5853 virtual void invalidate()
5857 parser::invalidate();
5864 virtual bool do_match(
5865 _In_reads_or_z_(end)
const char* text,
5866 _In_ size_t start = 0,
5870 _Assume_(text || start >= end);
5871 this->interval.
end = start;
5878 _Assume_(text || this->interval.
end >= end);
5880 this->interval.
end++;
5888 this->interval.
start = start;
5905 virtual bool do_match(
5906 _In_reads_or_z_(end)
const char* text,
5907 _In_ size_t start = 0,
5911 _Assume_(text || start >= end);
5912 if (start + 2 < end &&
5913 text[start] ==
'*' &&
5914 text[start + 1] ==
'/' &&
5915 text[start + 2] ==
'*')
5917 this->interval.
end = (this->interval.
start = start) + 3;
5920 else if (start < end && text[start] ==
'*') {
5921 this->interval.
end = (this->interval.
start = start) + 1;
5937 virtual void invalidate()
5940 subtype.invalidate();
5941 parser::invalidate();
5948 virtual bool do_match(
5949 _In_reads_or_z_(end)
const char* text,
5950 _In_ size_t start = 0,
5954 _Assume_(text || start >= end);
5955 this->interval.
end = start;
5963 this->interval.
end++;
5972 this->interval.
start = start;
5989 virtual void invalidate()
5992 http_media_range::invalidate();
5995 std::list<http_parameter> params;
5998 virtual bool do_match(
5999 _In_reads_or_z_(end)
const char* text,
6000 _In_ size_t start = 0,
6004 _Assume_(text || start >= end);
6005 if (!http_media_range::do_match(text, start, end,
flags))
6012 else if (text[this->interval.
end] ==
';') {
6013 this->interval.
end++;
6018 this->interval.
end = param.interval.end;
6019 params.push_back(std::move(param));
6030 this->interval.
end = params.empty() ? subtype.
interval.
end : params.back().interval.end;
6045 virtual bool do_match(
6046 _In_reads_or_z_(end)
const char* text,
6047 _In_ size_t start = 0,
6051 _Assume_(text || start >= end);
6052 this->interval.
end = start;
6055 if ((
unsigned int)text[this->interval.
end] < 0x20 ||
6062 this->interval.
end++;
6068 this->interval.
start = start;
6087 virtual void invalidate()
6090 parser::invalidate();
6096 virtual bool do_match(
6097 _In_reads_or_z_(end)
const char* text,
6098 _In_ size_t start = 0,
6102 _Assume_(text || start >= end);
6104 this->interval.
end = start;
6115 this->interval.
end++;
6124 this->interval.
start = start;
6138 virtual bool do_match(
6139 _In_reads_or_z_(end)
const char* text,
6140 _In_ size_t start = 0,
6144 _Assume_(text || start >= end);
6145 this->interval.
end = start;
6148 if ((
unsigned int)text[this->interval.
end] < 0x20 ||
6155 this->interval.
end++;
6160 this->interval.
start = start;
6171 virtual void invalidate()
6174 parser::invalidate();
6180 virtual bool do_match(
6181 _In_reads_or_z_(end)
const char* text,
6182 _In_ size_t start = 0,
6186 _Assume_(text || start >= end);
6188 this->interval.
end = start;
6190 _Assume_(text || this->interval.
end >= end);
6193 this->interval.
end++;
6194 s.match(text, this->interval.
end, end,
flags);
6196 this->interval.
end = s.interval.end;
6199 if (text[this->interval.
end] ==
'/') {
6200 this->interval.
end++;
6201 s.match(text, this->interval.
end, end,
flags);
6203 this->interval.
end = s.interval.end;
6211 this->interval.
start = start;
6226 virtual void invalidate()
6232 parser::invalidate();
6239 virtual bool do_match(
6240 _In_reads_or_z_(end)
const char* text,
6241 _In_ size_t start = 0,
6245 _Assume_(text || start >= end);
6246 this->interval.
end = start;
6250 if ((
unsigned int)text[this->interval.
end] < 0x20 ||
6257 this->interval.
end++;
6263 name.
end = this->interval.
end;
6266 if (text[this->interval.
end] ==
'=') {
6267 this->interval.
end++;
6271 if ((
unsigned int)text[this->interval.
end] < 0x20 ||
6277 this->interval.
end++;
6282 value.
end = this->interval.
end;
6288 this->interval.
start = start;
6308 virtual void invalidate()
6310 server.invalidate();
6314 parser::invalidate();
6320 std::list<http_url_parameter> params;
6323 virtual bool do_match(
6324 _In_reads_or_z_(end)
const char* text,
6325 _In_ size_t start = 0,
6329 _Assume_(text || start >= end);
6330 this->interval.
end = start;
6333 this->interval.
end += 7;
6339 this->interval.
end++;
6349 server.invalidate();
6362 this->interval.
end++;
6365 if ((
unsigned int)text[this->interval.
end] < 0x20 ||
6369 else if (text[this->interval.
end] ==
'&')
6370 this->interval.
end++;
6374 this->interval.
end = param.interval.end;
6375 params.push_back(std::move(param));
6386 this->interval.
start = start;
6401 virtual void invalidate()
6404 parser::invalidate();
6407 std::vector<stdex::interval<size_t>> components;
6410 virtual bool do_match(
6411 _In_reads_or_z_(end)
const char* text,
6412 _In_ size_t start = 0,
6416 _Assume_(text || start >= end);
6417 this->interval.
end = start;
6422 k.end = this->interval.
end;
6424 if (
k.end < end && text[
k.end]) {
6425 if (stdex::isalpha(text[
k.end]))
6433 if (this->interval.
end <
k.end) {
6434 k.start = this->interval.
end;
6435 this->interval.
end =
k.end;
6436 components.push_back(
k);
6441 this->interval.
end++;
6448 if (!components.empty()) {
6449 this->interval.
start = start;
6450 this->interval.
end = components.back().end;
6469 virtual void invalidate()
6472 parser::invalidate();
6478 virtual bool do_match(
6479 _In_reads_or_z_(end)
const char* text,
6480 _In_ size_t start = 0,
6484 _Assume_(text || start >= end);
6486 this->interval.
end = start;
6491 this->interval.
end++;
6493 else if (text[this->interval.
end] ==
'.') {
6494 this->interval.
end++;
6500 this->interval.
end++;
6518 this->interval.
start = start;
6533 virtual bool do_match(
6534 _In_reads_or_z_(end)
const char* text,
6535 _In_ size_t start = 0,
6539 _Assume_(text || end <= start);
6540 if (start < end && text[start] ==
'*') {
6541 this->interval.
end = (this->interval.
start = start) + 1;
6552 template <
class T,
class T_asterisk = http_asterisk>
6561 virtual void invalidate()
6563 asterisk.invalidate();
6565 factor.invalidate();
6566 parser::invalidate();
6574 virtual bool do_match(
6575 _In_reads_or_z_(end)
const char* text,
6576 _In_ size_t start = 0,
6580 _Assume_(text || start >= end);
6582 this->interval.
end = start;
6589 asterisk.invalidate();
6592 asterisk.invalidate();
6600 this->interval.
end++;
6603 this->interval.
end++;
6606 this->interval.
end++;
6614 factor.invalidate();
6617 this->interval.
start = start;
6628 virtual void invalidate()
6632 parser::invalidate();
6639 virtual bool do_match(
6640 _In_reads_or_z_(end)
const char* text,
6641 _In_ size_t start = 0,
6645 _Assume_(text || start >= end);
6646 this->interval.
end = start;
6648 this->interval.
end++;
6658 this->interval.
end++;
6667 this->interval.
start = start;
6684 virtual void invalidate()
6689 parser::invalidate();
6697 virtual bool do_match(
6698 _In_reads_or_z_(end)
const char* text,
6699 _In_ size_t start = 0,
6703 _Assume_(text || start >= end);
6704 this->interval.
end = start;
6712 this->interval.
end++;
6726 else if (text[this->interval.
end] ==
';') {
6727 this->interval.
end++;
6732 this->interval.
end = param.interval.end;
6733 params.push_back(std::move(param));
6744 this->interval.
start = start;
6762 virtual void invalidate()
6768 parser::invalidate();
6775 virtual bool do_match(
6776 _In_reads_or_z_(end)
const char* text,
6777 _In_ size_t start = 0,
6781 _Assume_(text || start >= end);
6782 this->interval.
end = start;
6786 if (text[this->interval.
end] ==
'/') {
6787 type.
end = this->interval.
end;
6788 this->interval.
end++;
6789 version.
start = this->interval.
end;
6792 if (stdex::isspace(text[this->interval.
end])) {
6793 version.
end = this->interval.
end;
6797 this->interval.
end++;
6800 version.
end = this->interval.
end;
6806 else if (stdex::isspace(text[this->interval.
end])) {
6807 type.
end = this->interval.
end;
6811 this->interval.
end++;
6814 type.
end = this->interval.
end;
6819 this->interval.
start = start;
6842 virtual void invalidate()
6846 version_maj.
start = 1;
6847 version_maj.
end = 0;
6848 version_min.
start = 1;
6849 version_min.
end = 0;
6851 parser::invalidate();
6860 virtual bool do_match(
6861 _In_reads_or_z_(end)
const char* text,
6862 _In_ size_t start = 0,
6866 _Assume_(text || start >= end);
6867 this->interval.
end = start;
6871 if (text[this->interval.
end] ==
'/') {
6872 type.
end = this->interval.
end;
6873 this->interval.
end++;
6876 else if (stdex::isspace(text[this->interval.
end]))
6879 this->interval.
end++;
6882 type.
end = this->interval.
end;
6886 version_maj.
start = this->interval.
end;
6889 if (text[this->interval.
end] ==
'.') {
6890 version_maj.
end = this->interval.
end;
6891 this->interval.
end++;
6892 version_min.
start = this->interval.
end;
6895 if (stdex::isspace(text[this->interval.
end])) {
6896 version_min.
end = this->interval.
end;
6898 (
uint16_t)strtoui(text + version_maj.
start, version_maj.
size(),
nullptr, 10) * 0x100 +
6903 this->interval.
end++;
6910 else if (stdex::isspace(text[this->interval.
end])) {
6911 version_maj.
end = this->interval.
end;
6912 version_min.
start = 1;
6913 version_min.
end = 0;
6918 this->interval.
end++;
6923 this->interval.
start = start;
6944 virtual void invalidate()
6949 protocol.invalidate();
6950 parser::invalidate();
6958 virtual bool do_match(
6959 _In_reads_or_z_(end)
const char* text,
6960 _In_ size_t start = 0,
6964 _Assume_(text || start >= end);
6965 this->interval.
end = start;
6971 if (stdex::isspace(text[this->interval.
end]))
6972 this->interval.
end++;
6984 if (stdex::isspace(text[this->interval.
end])) {
6985 verb.
end = this->interval.
end;
6986 this->interval.
end++;
6990 this->interval.
end++;
7000 if (stdex::isspace(text[this->interval.
end]))
7001 this->interval.
end++;
7013 protocol.invalidate();
7020 if (stdex::isspace(text[this->interval.
end]))
7021 this->interval.
end++;
7047 this->interval.
end++;
7053 this->interval.
start = start;
7070 virtual void invalidate()
7076 parser::invalidate();
7083 virtual bool do_match(
7084 _In_reads_or_z_(end)
const char* text,
7085 _In_ size_t start = 0,
7089 _Assume_(text || start >= end);
7090 this->interval.
end = start;
7100 if (stdex::isspace(text[this->interval.
end])) {
7101 name.
end = this->interval.
end;
7102 this->interval.
end++;
7107 if (stdex::isspace(text[this->interval.
end]))
7108 this->interval.
end++;
7116 this->interval.
end++;
7123 else if (text[this->interval.
end] ==
':') {
7124 name.
end = this->interval.
end;
7125 this->interval.
end++;
7129 this->interval.
end++;
7141 this->interval.
end++;
7146 if (stdex::isspace(text[this->interval.
end]))
7147 this->interval.
end++;
7150 value.
end = ++this->interval.
end;
7156 this->interval.
start = start;
7170 template <
class KEY,
class T>
7175 _In_reads_or_z_(end)
const char* text,
7176 _In_ size_t start = 0,
7180 while (start < end) {
7181 while (start < end && text[start] && stdex::isspace(text[start])) start++;
7182 if (start < end && text[start] ==
',') {
7184 while (start < end&& text[start] && stdex::isspace(text[start])) start++;
7187 if (
el.match(text, start, end,
flags)) {
7189 T::insert(std::move(
el));
7199 constexpr bool operator()(
const T& a,
const T& b)
const noexcept
7201 return a.factor.value > b.factor.value;
7208 template <
class T,
class AX = std::allocator<T>>
7230 _In_ const std::locale&
locale = std::locale()) :
7245 virtual void invalidate()
7251 std::basic_string<T> value;
7254 virtual bool do_match(
7255 _In_reads_or_z_opt_(end)
const T* text,
7256 _In_ size_t start = 0,
7260 _Assume_(text || start >= end);
7261 this->interval.
end = start;
7263 this->interval.
end = m_quote->interval.end;
7267 this->interval.
start = start;
7268 this->interval.
end = m_quote->interval.end;
7272 if (m_quote->match(text, m_escape->interval.end, end,
flags)) {
7273 value +=
'"'; this->interval.
end = m_quote->interval.end;
7276 if (m_sol->match(text, m_escape->interval.end, end,
flags)) {
7277 value +=
'/'; this->interval.
end = m_sol->interval.end;
7280 if (m_bs->match(text, m_escape->interval.end, end,
flags)) {
7281 value +=
'\b'; this->interval.
end = m_bs->interval.end;
7284 if (m_ff->match(text, m_escape->interval.end, end,
flags)) {
7285 value +=
'\f'; this->interval.
end = m_ff->interval.end;
7288 if (m_lf->match(text, m_escape->interval.end, end,
flags)) {
7289 value +=
'\n'; this->interval.
end = m_lf->interval.end;
7292 if (m_cr->match(text, m_escape->interval.end, end,
flags)) {
7293 value +=
'\r'; this->interval.
end = m_cr->interval.end;
7296 if (m_htab->match(text, m_escape->interval.end, end,
flags)) {
7297 value +=
'\t'; this->interval.
end = m_htab->interval.end;
7301 m_uni->match(text, m_escape->interval.end, end,
flags) &&
7302 m_hex->match(text, m_uni->interval.end, std::min(m_uni->interval.end + 4, end),
flags | match_case_insensitive) &&
7303 m_hex->interval.size() == 4 )
7305 _Assume_(m_hex->value <= 0xffff);
7306 if (
sizeof(T) == 1) {
7307 if (m_hex->value > 0x7ff) {
7308 value += (T)(0xe0 | ((m_hex->value >> 12) & 0x0f));
7309 value += (T)(0x80 | ((m_hex->value >> 6) & 0x3f));
7310 value += (T)(0x80 | (m_hex->value & 0x3f));
7312 else if (m_hex->value > 0x7f) {
7313 value += (T)(0xc0 | ((m_hex->value >> 6) & 0x1f));
7314 value += (T)(0x80 | (m_hex->value & 0x3f));
7317 value += (T)(m_hex->value & 0x7f);
7320 value += (T)m_hex->value;
7321 this->interval.
end = m_hex->interval.end;
7324 if (m_escape->match(text, m_escape->interval.end, end,
flags)) {
7325 value +=
'\\'; this->interval.
end = m_escape->interval.end;
7330 value.append(text + m_chr->interval.start, m_chr->interval.size());
7331 this->interval.
end = m_chr->interval.end;
7342 std::shared_ptr<basic_parser<T>> m_quote;
7343 std::shared_ptr<basic_parser<T>> m_chr;
7344 std::shared_ptr<basic_parser<T>> m_escape;
7345 std::shared_ptr<basic_parser<T>> m_sol;
7346 std::shared_ptr<basic_parser<T>> m_bs;
7347 std::shared_ptr<basic_parser<T>> m_ff;
7348 std::shared_ptr<basic_parser<T>> m_lf;
7349 std::shared_ptr<basic_parser<T>> m_cr;
7350 std::shared_ptr<basic_parser<T>> m_htab;
7351 std::shared_ptr<basic_parser<T>> m_uni;
7352 std::shared_ptr<basic_integer16<T>> m_hex;
7370 virtual void invalidate()
7373 basic_parser::invalidate();
7379 virtual bool do_match(
7380 _In_reads_or_z_opt_(end)
const T* text,
7381 _In_ size_t start = 0,
7385 _Unreferenced_(
flags);
7386 _Assume_(text || start + 1 >= end);
7387 if (start + 1 < end &&
7388 text[start] ==
'/' &&
7389 text[start + 1] ==
'*')
7392 this->content.
start = this->interval.
end = start + 2;
7396 if (this->interval.
end + 1 < end &&
7401 this->content.
end = this->interval.
end;
7402 this->interval.
start = start;
7403 this->interval.
end = this->interval.
end + 2;
7406 this->interval.
end++;
7415 using css_comment = basic_css_comment<char>;
7416 using wcss_comment = basic_css_comment<wchar_t>;
7418 using tcss_comment = wcss_comment;
7420 using tcss_comment = css_comment;
7430 virtual bool do_match(
7431 _In_reads_or_z_opt_(end)
const T* text,
7432 _In_ size_t start = 0,
7436 _Unreferenced_(
flags);
7437 _Assume_(text || start + 3 >= end);
7438 if (start + 3 < end &&
7439 text[start] ==
'<' &&
7440 text[start + 1] ==
'!' &&
7441 text[start + 2] ==
'-' &&
7442 text[start + 3] ==
'-')
7444 this->interval.
start = start;
7445 this->interval.
end = start + 4;
7468 virtual bool do_match(
7469 _In_reads_or_z_opt_(end)
const T* text,
7470 _In_ size_t start = 0,
7474 _Unreferenced_(
flags);
7475 _Assume_(text || start + 2 >= end);
7476 if (start + 2 < end &&
7477 text[start] ==
'-' &&
7478 text[start + 1] ==
'-' &&
7479 text[start + 2] ==
'>')
7481 this->interval.
start = start;
7482 this->interval.
end = start + 3;
7505 virtual void invalidate()
7508 basic_parser::invalidate();
7514 virtual bool do_match(
7515 _In_reads_or_z_opt_(end)
const T* text,
7516 _In_ size_t start = 0,
7520 _Unreferenced_(
flags);
7521 this->interval.
end = start;
7522 _Assume_(text || this->interval.
end >= end);
7523 if (this->interval.
end < end &&
7527 T
quote = text[this->interval.
end];
7528 this->content.
start = ++this->interval.
end;
7532 if (text[this->interval.
end] ==
quote) {
7534 this->content.
end = this->interval.
end;
7535 this->interval.
start = start;
7536 this->interval.
end++;
7539 if (this->interval.
end + 1 < end &&
7544 this->interval.
end = this->interval.
end + 2;
7547 this->interval.
end++;
7557 using css_string = basic_css_string<char>;
7558 using wcss_string = basic_css_string<wchar_t>;
7560 using tcss_string = wcss_string;
7562 using tcss_string = css_string;
7572 virtual void invalidate()
7575 basic_parser::invalidate();
7581 virtual bool do_match(
7582 _In_reads_or_z_opt_(end)
const T* text,
7583 _In_ size_t start = 0,
7587 _Unreferenced_(
flags);
7588 this->interval.
end = start;
7589 _Assume_(text || this->interval.
end + 3 >= end);
7590 if (this->interval.
end + 3 < end &&
7597 this->interval.
end = this->interval.
end + 4;
7600 const auto&
ctype = std::use_facet<std::ctype<T>>(m_locale);
7603 if (this->interval.
end < end &&
7607 T
quote = text[this->interval.
end];
7608 this->content.
start = ++this->interval.
end;
7612 if (text[this->interval.
end] ==
quote) {
7614 this->content.
end = this->interval.
end;
7615 this->interval.
end++;
7618 if (this->interval.
end + 1 < end &&
7623 this->interval.
end = this->interval.
end + 2;
7626 this->interval.
end++;
7632 if (this->interval.
end < end &&
7636 this->interval.
start = start;
7637 this->interval.
end++;
7647 if (text[this->interval.
end] ==
')') {
7649 this->interval.
start = start;
7650 this->interval.
end++;
7654 this->interval.
end++;
7656 this->content.
end = ++this->interval.
end;
7667 using css_uri = basic_css_uri<char>;
7668 using wcss_uri = basic_css_uri<wchar_t>;
7670 using tcss_uri = wcss_uri;
7672 using tcss_uri = css_uri;
7682 virtual void invalidate()
7685 basic_parser::invalidate();
7691 virtual bool do_match(
7692 _In_reads_or_z_opt_(end)
const T* text,
7693 _In_ size_t start = 0,
7697 _Unreferenced_(
flags);
7698 this->interval.
end = start;
7699 _Assume_(text || this->interval.
end + 6 >= end);
7700 if (this->interval.
end + 6 < end &&
7710 this->interval.
end = this->interval.
end + 7;
7713 const auto&
ctype = std::use_facet<std::ctype<T>>(m_locale);
7716 if (this->interval.
end < end &&
7720 T
quote = text[this->interval.
end];
7721 this->content.
start = ++this->interval.
end;
7725 if (text[this->interval.
end] ==
quote) {
7727 this->content.
end = this->interval.
end;
7728 this->interval.
start = start;
7729 this->interval.
end++;
7732 if (this->interval.
end + 1 < end &&
7737 this->interval.
end = this->interval.
end + 2;
7740 this->interval.
end++;
7751 using css_import = basic_css_import<char>;
7752 using wcss_import = basic_css_import<wchar_t>;
7754 using tcss_import = wcss_import;
7756 using tcss_import = css_import;
7766 virtual void invalidate()
7771 basic_parser::invalidate();
7779 virtual bool do_match(
7780 _In_reads_or_z_opt_(end)
const T* text,
7781 _In_ size_t start = 0,
7785 _Unreferenced_(
flags);
7786 const auto&
ctype = std::use_facet<std::ctype<T>>(m_locale);
7788 this->interval.
end = start;
7789 this->base_type.
start = this->interval.
end;
7791 _Assume_(text || this->interval.
end >= end);
7794 if (text[this->interval.
end] ==
'/' ||
7798 this->interval.
end++;
7800 if (this->interval.
end <=
this->base_type.start)
7802 this->base_type.
end = this->interval.
end;
7807 this->interval.
end++;
7808 this->sub_type.
start = this->interval.
end;
7812 if (text[this->interval.
end] ==
'/' ||
7816 this->interval.
end++;
7818 if (this->interval.
end <=
this->sub_type.start)
7821 this->sub_type.
end = this->interval.
end;
7824 this->interval.
end++;
7829 if (this->interval.
end + 7 < end &&
7831 (text[this->interval.
end + 1] ==
'h' || text[this->interval.
end + 1] ==
'H') &&
7833 (text[this->interval.
end + 3] ==
'r' || text[this->interval.
end + 3] ==
'R') &&
7835 (text[this->interval.
end + 5] ==
'e' || text[this->interval.
end + 5] ==
'E') &&
7837 text[this->interval.
end + 7] ==
'=')
7839 this->interval.
end = this->interval.
end + 8;
7840 if (this->interval.
end < end &&
7844 T
quote = text[this->interval.
end];
7845 this->charset.
start = ++this->interval.
end;
7852 if (text[this->interval.
end] ==
quote) {
7854 this->charset.
end = this->interval.
end;
7855 this->interval.
end++;
7858 this->interval.
end++;
7863 this->charset.
start = this->interval.
end;
7867 this->charset.
end = this->interval.
end;
7870 this->interval.
end++;
7875 this->interval.
start = start;
7884 using mime_type = basic_mime_type<char>;
7885 using wmime_type = basic_mime_type<wchar_t>;
7887 using tmime_type = wmime_type;
7889 using tmime_type = mime_type;
7899 virtual bool do_match(
7900 _In_reads_or_z_opt_(end)
const T* text,
7901 _In_ size_t start = 0,
7905 _Unreferenced_(
flags);
7906 const auto&
ctype = std::use_facet<std::ctype<T>>(m_locale);
7907 this->interval.
end = start;
7909 _Assume_(text || this->interval.
end >= end);
7912 this->interval.
start = start;
7918 if (text[this->interval.
end] ==
'>' ||
7923 this->interval.
start = start;
7926 this->interval.
end++;
7946 virtual void invalidate()
7949 basic_parser::invalidate();
7955 virtual bool do_match(
7956 _In_reads_or_z_opt_(end)
const T* text,
7957 _In_ size_t start = 0,
7961 _Unreferenced_(
flags);
7962 this->interval.
end = start;
7963 _Assume_(text || this->interval.
end >= end);
7964 if (this->interval.
end < end &&
7968 T
quote = text[this->interval.
end];
7969 this->content.
start = ++this->interval.
end;
7977 if (text[this->interval.
end] ==
quote) {
7979 this->content.
end = this->interval.
end;
7980 this->interval.
start = start;
7981 this->interval.
end++;
7984 this->interval.
end++;
7989 this->content.
start = this->interval.
end;
7990 const auto&
ctype = std::use_facet<std::ctype<T>>(m_locale);
7992 _Assume_(text || this->interval.
end >= end);
7994 this->content.
end = this->interval.
end;
7995 this->interval.
start = start;
7998 if (text[this->interval.
end] ==
'>' ||
8002 this->content.
end = this->interval.
end;
8003 this->interval.
start = start;
8006 this->interval.
end++;
8011 using html_value = basic_html_value<char>;
8012 using whtml_value = basic_html_value<wchar_t>;
8014 using thtml_value = whtml_value;
8016 using thtml_value = html_value;
8022 enum class html_sequence_t {
8053 type(html_sequence_t::unknown)
8056 virtual void invalidate()
8058 this->type = html_sequence_t::unknown;
8059 this->name.invalidate();
8061 basic_parser::invalidate();
8069 virtual bool do_match(
8070 _In_reads_or_z_opt_(end)
const T* text,
8071 _In_ size_t start = 0,
8075 _Assume_(text || start >= end);
8076 if (start >= end || text[start] !=
'<')
8078 this->interval.
end = start + 1;
8081 if (text[this->interval.
end] ==
'/' &&
8085 this->type = html_sequence_t::element_end;
8086 this->name = this->m_ident.
interval;
8089 else if (text[this->interval.
end] ==
'!') {
8091 this->interval.
end++;
8092 if (this->interval.
end + 1 < end &&
8097 this->name.
start = this->interval.
end = this->interval.
end + 2;
8101 if (this->interval.
end + 2 < end &&
8107 this->type = html_sequence_t::comment;
8108 this->name.
end = this->interval.
end;
8109 this->attributes.clear();
8110 this->interval.
start = start;
8111 this->interval.
end = this->interval.
end + 3;
8114 this->interval.
end++;
8117 this->type = html_sequence_t::declaration;
8118 this->name.
start = this->name.
end = this->interval.
end;
8120 else if (text[this->interval.
end] ==
'?') {
8122 this->name.
start = ++this->interval.
end;
8126 if (text[this->interval.
end] ==
'>') {
8128 this->type = html_sequence_t::instruction;
8129 this->name.
end = this->interval.
end;
8130 this->attributes.clear();
8131 this->interval.
start = start;
8132 this->interval.
end++;
8135 if (this->interval.
end + 1 < end &&
8140 this->type = html_sequence_t::instruction;
8141 this->name.
end = this->interval.
end;
8142 this->attributes.clear();
8143 this->interval.
start = start;
8144 this->interval.
end = this->interval.
end + 2;
8147 this->interval.
end++;
8152 this->type = html_sequence_t::element_start;
8153 this->name = this->m_ident.
interval;
8160 const auto&
ctype = std::use_facet<std::ctype<T>>(m_locale);
8163 this->attributes.clear();
8165 if (this->type == html_sequence_t::element_start &&
8166 this->interval.
end + 1 < end &&
8171 this->type = html_sequence_t::element;
8172 this->interval.
end = this->interval.
end + 2;
8175 if (this->interval.
end < end &&
8179 this->interval.
end++;
8182 if (this->type == html_sequence_t::declaration &&
8183 this->interval.
end + 1 < end &&
8188 this->interval.
end = this->interval.
end + 2;
8191 if (this->type == html_sequence_t::declaration &&
8192 this->interval.
end + 1 < end &&
8197 this->interval.
end = this->interval.
end + 2;
8201 if (this->interval.
end + 1 < end &&
8206 this->interval.
end = this->interval.
end + 2;
8209 this->interval.
end++;
8224 a = &this->attributes.back();
8230 this->interval.
end++;
8238 this->interval.
end++;
8245 a->value = this->m_value.content;
8254 a->value.invalidate();
8258 this->interval.
start = start;
8270 using html_tag = basic_html_tag<char>;
8271 using whtml_tag = basic_html_tag<wchar_t>;
8273 using thtml_tag = whtml_tag;
8275 using thtml_tag = html_tag;
8285 virtual void invalidate()
8288 basic_parser::invalidate();
8295 _In_reads_or_z_opt_(end)
const T* text,
8296 _In_ size_t start = 0,
8300 _Unreferenced_(
flags);
8301 _Assume_(text || start + 2 >= end);
8302 if (start + 2 < end &&
8303 text[start] ==
'<' &&
8304 text[start + 1] ==
'!' &&
8305 text[start + 2] ==
'[')
8307 this->interval.
end = start + 3;
8310 const auto&
ctype = std::use_facet<std::ctype<T>>(m_locale);
8313 this->condition.
start = this->condition.
end = this->interval.
end;
8318 if (text[this->interval.
end] ==
'[') {
8319 this->interval.
start = start;
8320 this->interval.
end++;
8324 this->interval.
end++;
8326 this->condition.
end = ++this->interval.
end;
8336 using html_declaration_condition_start = basic_html_declaration_condition_start<char>;
8337 using whtml_declaration_condition_start = basic_html_declaration_condition_start<wchar_t>;
8339 using thtml_declaration_condition_start = whtml_declaration_condition_start;
8341 using thtml_declaration_condition_start = html_declaration_condition_start;
8351 virtual bool do_match(
8352 _In_reads_or_z_opt_(end)
const T* text,
8353 _In_ size_t start = 0,
8357 _Unreferenced_(
flags);
8358 _Assume_(text || start + 2 >= end);
8359 if (start + 2 < end &&
8360 text[start] ==
']' &&
8361 text[start + 1] ==
']' &&
8362 text[start + 2] ==
'>')
8364 this->interval.
start = start;
8365 this->interval.
end = start + 3;
8383#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:4376
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:4940
T reference[22]
Normalized national reference number.
Definition parser.hpp:4962
T check_digits[3]
Two check digits.
Definition parser.hpp:4961
bool is_valid
Is reference valid per ISO 7064.
Definition parser.hpp:4963
Legacy CSS comment end -->
Definition parser.hpp:7466
Legacy CSS comment start <!--
Definition parser.hpp:7428
CSS import directive.
Definition parser.hpp:7680
stdex::interval< size_t > content
content position in source
Definition parser.hpp:7688
CSS string.
Definition parser.hpp:7503
stdex::interval< size_t > content
content position in source
Definition parser.hpp:7511
URI in CSS.
Definition parser.hpp:7570
stdex::interval< size_t > content
content position in source
Definition parser.hpp:7578
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:4009
Test for valid DNS domain character.
Definition parser.hpp:2791
bool allow_on_edge
Is character allowed at the beginning or an end of a DNS domain?
Definition parser.hpp:2801
Test for DNS domain/hostname.
Definition parser.hpp:2891
bool m_allow_absolute
May DNS names end with a dot (absolute name)?
Definition parser.hpp:2955
Test for e-mail address.
Definition parser.hpp:3783
Test for emoticon.
Definition parser.hpp:3886
std::shared_ptr< basic_parser< T > > apex
apex/eyebrows/halo (e.g. O, 0)
Definition parser.hpp:3914
std::shared_ptr< basic_parser< T > > eyes
eyes (e.g. :, ;, >, |, B)
Definition parser.hpp:3915
std::shared_ptr< basic_set< T > > mouth
mouth (e.g. ), ), (, (, |, P, D, p, d)
Definition parser.hpp:3917
std::shared_ptr< basic_parser< T > > nose
nose (e.g. -, o)
Definition parser.hpp:3916
std::shared_ptr< basic_parser< T > > emoticon
emoticon as a whole (e.g. 😀, 🤔, 😶)
Definition parser.hpp:3913
Test for end of line.
Definition parser.hpp:669
Test for fraction.
Definition parser.hpp:1701
End of condition ...]]>
Definition parser.hpp:8349
Start of condition <![condition[...
Definition parser.hpp:8283
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:8294
Contiguous sequence of characters representing name of element, attribute etc.
Definition parser.hpp:7897
Tag.
Definition parser.hpp:8049
std::vector< html_attribute > attributes
tag attributes
Definition parser.hpp:8066
html_sequence_t type
tag type
Definition parser.hpp:8064
stdex::interval< size_t > name
tag name position in source
Definition parser.hpp:8065
Optionally-quoted string representing value of an attribute.
Definition parser.hpp:7944
stdex::interval< size_t > content
content position in source
Definition parser.hpp:7952
Test for International Bank Account Number.
Definition parser.hpp:4651
T bban[31]
Normalized Basic Bank Account Number.
Definition parser.hpp:4676
T country[3]
ISO 3166-1 alpha-2 country code.
Definition parser.hpp:4674
T check_digits[3]
Two check digits.
Definition parser.hpp:4675
bool is_valid
Is IBAN valid per ISO 7064.
Definition parser.hpp:4677
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:2571
std::shared_ptr< basic_parser< T > > scope_id
Scope ID (e.g. NIC index with link-local addresses)
Definition parser.hpp:2643
stdex::interval< size_t > components[8]
Individual component intervals.
Definition parser.hpp:2641
struct in6_addr value
IPv6 address value.
Definition parser.hpp:2642
Test for valid IPv6 address scope ID character.
Definition parser.hpp:2497
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:7216
MIME content type.
Definition parser.hpp:7764
stdex::interval< size_t > base_type
basic type position in source
Definition parser.hpp:7774
stdex::interval< size_t > sub_type
sub-type position in source
Definition parser.hpp:7775
stdex::interval< size_t > charset
charset position in source
Definition parser.hpp:7776
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:4499
std::basic_string< T > value
Normalized phone number.
Definition parser.hpp:4524
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:5134
Test for SI Reference part.
Definition parser.hpp:5088
Test for SI Reference.
Definition parser.hpp:5173
basic_si_reference_part< T > part3
Reference data part 3 (P3)
Definition parser.hpp:5202
basic_si_reference_part< T > part1
Reference data part 1 (P1)
Definition parser.hpp:5200
bool is_valid
Is reference valid.
Definition parser.hpp:5203
T model[3]
Reference model.
Definition parser.hpp:5199
basic_si_reference_part< T > part2
Reference data part 2 (P2)
Definition parser.hpp:5201
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:4274
Test for valid URL password character.
Definition parser.hpp:3075
Test for valid URL path character.
Definition parser.hpp:3177
Test for URL path.
Definition parser.hpp:3287
Test for valid URL username character.
Definition parser.hpp:2974
Test for URL.
Definition parser.hpp:3427
Test for HTTP agent.
Definition parser.hpp:6760
Test for HTTP any type.
Definition parser.hpp:5903
Test for HTTP asterisk.
Definition parser.hpp:6531
Test for HTTP cookie parameter (RFC2109)
Definition parser.hpp:6626
Test for HTTP cookie (RFC2109)
Definition parser.hpp:6682
std::list< http_cookie_parameter > params
List of cookie parameters.
Definition parser.hpp:6694
http_token name
Cookie name.
Definition parser.hpp:6692
http_value value
Cookie value.
Definition parser.hpp:6693
Test for HTTP language (RFC1766)
Definition parser.hpp:6399
Test for HTTP line break (RFC2616: CRLF | LF)
Definition parser.hpp:5585
Test for HTTP parameter (RFC2616: parameter)
Definition parser.hpp:5851
http_token name
Parameter name.
Definition parser.hpp:5860
http_value value
Parameter value.
Definition parser.hpp:5861
Test for HTTP protocol.
Definition parser.hpp:6835
uint16_t version
HTTP protocol version: 0x100 = 1.0, 0x101 = 1.1...
Definition parser.hpp:6857
Test for HTTP quoted string (RFC2616: quoted-string)
Definition parser.hpp:5744
stdex::interval< size_t > content
String content (without quotes)
Definition parser.hpp:5753
Test for HTTP request.
Definition parser.hpp:6936
Test for HTTP space (RFC2616: LWS)
Definition parser.hpp:5621
Test for HTTP text character (RFC2616: TEXT)
Definition parser.hpp:5657
Test for HTTP token (RFC2616: token - tolerates non-ASCII)
Definition parser.hpp:5690
Test for HTTP URL parameter.
Definition parser.hpp:6224
Test for HTTP URL path segment.
Definition parser.hpp:6136
Test for HTTP URL path segment.
Definition parser.hpp:6169
std::vector< http_url_path_segment > segments
Path segments.
Definition parser.hpp:6177
Test for HTTP URL port.
Definition parser.hpp:6080
Test for HTTP URL server.
Definition parser.hpp:6043
Test for HTTP URL.
Definition parser.hpp:6301
Collection of HTTP values.
Definition parser.hpp:7172
Test for HTTP value (RFC2616: value)
Definition parser.hpp:5807
http_quoted_string string
Value when matched as quoted string.
Definition parser.hpp:5816
http_token token
Value when matched as token.
Definition parser.hpp:5817
Test for HTTP weight factor.
Definition parser.hpp:6462
float value
Calculated value of the weight factor.
Definition parser.hpp:6475
Test for HTTP weighted value.
Definition parser.hpp:6554
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:2846
Test for valid IPv6 address scope ID SGML character.
Definition parser.hpp:2536
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:3128
Test for valid URL path SGML character.
Definition parser.hpp:3234
Test for valid URL username SGML character.
Definition parser.hpp:3026
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:8039
stdex::interval< size_t > name
attribute name position in source
Definition parser.hpp:8040
stdex::interval< size_t > value
attribute value position in source
Definition parser.hpp:8041
Definition parser.hpp:7198