23#elif defined(__APPLE__)
24#include <netinet/in.h>
38#pragma warning(disable: 4100)
41#define ENUM_FLAG_OPERATOR(T,X) \
42inline T operator X (const T lhs, const T rhs) { return static_cast<T>(static_cast<std::underlying_type_t<T>>(lhs) X static_cast<std::underlying_type_t<T>>(rhs)); } \
43inline T operator X (const T lhs, const std::underlying_type_t<T> rhs) { return static_cast<T>(static_cast<std::underlying_type_t<T>>(lhs) X rhs); } \
44inline T operator X (const std::underlying_type_t<T> lhs, const T rhs) { return static_cast<T>(lhs X static_cast<std::underlying_type_t<T>>(rhs)); } \
45inline T& operator X= (T& lhs, const T rhs) { return lhs = lhs X rhs; } \
46inline T& operator X= (T& lhs, const std::underlying_type_t<T> rhs) { return lhs = lhs X rhs; }
47#define ENUM_FLAGS(T, type) \
49inline T operator ~ (T t) { return (T) (~static_cast<std::underlying_type_t <T>>(t)); } \
50ENUM_FLAG_OPERATOR(T,|) \
51ENUM_FLAG_OPERATOR(T,^) \
52ENUM_FLAG_OPERATOR(T,&) \
56#elif defined(__APPLE__)
57#define s6_words __u6_addr.__u6_addr16
59#error Unsupported platform
69 constexpr int match_default = 0;
70 constexpr int match_case_insensitive = 0x1;
71 constexpr int match_multiline = 0x2;
80 basic_parser(
_In_ const std::locale& locale = std::locale()) : m_locale(locale) {}
84 _In_reads_or_z_(end)
const T*
text,
85 _In_ size_t start = 0,
86 _In_ size_t end = (
size_t)-1,
89 for (
size_t i = start;
i < end &&
text[
i];
i++)
96 _In_reads_or_z_(end)
const T*
text,
97 _In_ size_t start = 0,
98 _In_ size_t end = (
size_t)-1,
101 template<
class _Traits,
class _Ax>
103 const std::basic_string<T, _Traits, _Ax>&
text,
104 _In_ size_t start = 0,
105 _In_ size_t end = (
size_t)-1,
108 return match(
text.c_str(), start, std::min<size_t>(end,
text.size()),
flags);
111 virtual void invalidate()
121 if (
text[start] ==
'&') {
123 const auto&
ctype = std::use_facet<std::ctype<T>>(m_locale);
132 if (
n >= 2 &&
text[start + 1] ==
'#') {
135 if (
text[start + 2] ==
'x' ||
text[start + 2] ==
'X')
136 unicode = strtou32(
text + start + 3,
n - 2,
nullptr, 16);
138 unicode = strtou32(
text + start + 2,
n - 1,
nullptr, 10);
145 ucs4_to_surrogate_pair(buf,
unicode);
169 buf[0] =
text[start];
180 std::locale m_locale;
200 _In_reads_or_z_(end)
const T*
text,
201 _In_ size_t start = 0,
202 _In_ size_t end = (
size_t)-1,
205 _Assume_(
text || start >= end);
206 if (start < end &&
text[start]) {
234 _In_reads_or_z_(end)
const T*
text,
235 _In_ size_t start = 0,
236 _In_ size_t end = (
size_t)-1,
239 _Assume_(
text || start >= end);
240 if (start < end &&
text[start]) {
266 _In_reads_or_z_(end)
const char*
text,
267 _In_ size_t start = 0,
268 _In_ size_t end = (
size_t)-1,
271 _Assume_(
text || start >= end);
272 if (start < end &&
text[start]) {
273 if (
text[start] ==
'&') {
275 const auto&
ctype = std::use_facet<std::ctype<char>>(m_locale);
308 _In_reads_or_z_(end)
const T*
text,
309 _In_ size_t start = 0,
310 _In_ size_t end = (
size_t)-1,
313 _Assume_(
text || start >= end);
314 if (start < end &&
text[start]) {
316 if (
flags & match_case_insensitive) {
317 const auto&
ctype = std::use_facet<std::ctype<T>>(this->m_locale);
321 r =
text[start] == m_chr;
322 if ((
r && !m_invert) || (!
r && m_invert)) {
350 sgml_cp(
const char*
chr,
size_t count = (
size_t)-1,
bool invert =
false,
_In_ const std::locale& locale = std::locale()) :
361 _In_reads_or_z_(end)
const char*
text,
362 _In_ size_t start = 0,
363 _In_ size_t end = (
size_t)-1,
366 _Assume_(
text || start >= end);
367 if (start < end &&
text[start]) {
370 bool r = ((
flags & match_case_insensitive) ?
371 stdex::strnicmp(
chr, (
size_t)-1, m_chr.c_str(), m_chr.size(), m_locale) :
372 stdex::strncmp(
chr, (
size_t)-1, m_chr.c_str(), m_chr.size())) == 0;
373 if ((
r && !m_invert) || (!
r && m_invert)) {
400 _In_reads_or_z_(end)
const T*
text,
401 _In_ size_t start = 0,
402 _In_ size_t end = (
size_t)-1,
405 _Assume_(
text || start >= end);
406 if (start < end &&
text[start]) {
408 ((
flags & match_multiline) || !islbreak(
text[start])) &&
409 std::use_facet<std::ctype<T>>(this->m_locale).is(std::ctype_base::space,
text[start]);
410 if ((
r && !m_invert) || (!
r && m_invert)) {
442 _In_reads_or_z_(end)
const char*
text,
443 _In_ size_t start = 0,
444 _In_ size_t end = (
size_t)-1,
447 _Assume_(
text || start >= end);
448 if (start < end &&
text[start]) {
453 ((
flags & match_multiline) || !islbreak(
chr, (
size_t)-1)) &&
455 if ((
r && !m_invert) || (!
r && m_invert)) {
479 _In_reads_or_z_(end)
const T*
text,
480 _In_ size_t start = 0,
481 _In_ size_t end = (
size_t)-1,
484 _Assume_(
text || start >= end);
485 if (start < end &&
text[start]) {
486 bool r = std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::punct,
text[start]);
487 if ((
r && !m_invert) || (!
r && m_invert)) {
519 _In_reads_or_z_(end)
const char*
text,
520 _In_ size_t start = 0,
521 _In_ size_t end = (
size_t)-1,
524 _Assume_(
text || start >= end);
525 if (start < end &&
text[start]) {
530 if ((
r && !m_invert) || (!
r && m_invert)) {
553 _In_reads_or_z_(end)
const T*
text,
554 _In_ size_t start = 0,
555 _In_ size_t end = (
size_t)-1,
558 _Assume_(
text || start >= end);
559 if (start < end &&
text[start]) {
561 ((
flags & match_multiline) || !islbreak(
text[start])) &&
562 std::use_facet<std::ctype<T>>(this->m_locale).is(std::ctype_base::space | std::ctype_base::punct,
text[start]);
563 if ((
r && !m_invert) || (!
r && m_invert)) {
595 _In_reads_or_z_(end)
const char*
text,
596 _In_ size_t start = 0,
597 _In_ size_t end = (
size_t)-1,
600 _Assume_(
text || start >= end);
601 if (start < end &&
text[start]) {
606 ((
flags & match_multiline) || !islbreak(
chr, (
size_t)-1)) &&
607 std::use_facet<std::ctype<wchar_t>>(m_locale).
scan_not(std::ctype_base::space | std::ctype_base::punct,
chr,
chr_end) ==
chr_end;
608 if ((
r && !m_invert) || (!
r && m_invert)) {
628 _In_reads_or_z_(end)
const T*
text,
629 _In_ size_t start = 0,
630 _In_ size_t end = (
size_t)-1,
633 _Assume_(
text || start >= end);
634 bool r = start == 0 || (start <= end && islbreak(
text[start - 1]));
635 if ((
r && !m_invert) || (!
r && m_invert)) {
666 _In_reads_or_z_(end)
const T*
text,
667 _In_ size_t start = 0,
668 _In_ size_t end = (
size_t)-1,
671 _Assume_(
text || start >= end);
672 bool r = islbreak(
text[start]);
673 if ((
r && !m_invert) || (!
r && m_invert)) {
700 hit_offset((
size_t)-1),
705 _In_reads_or_z_(end)
const T*
text,
706 _In_ size_t start = 0,
707 _In_ size_t end = (
size_t)-1,
710 virtual void invalidate()
731 _In_reads_or_z_(
count)
const T* set,
734 _In_ const std::locale& locale = std::locale()) :
738 m_set.assign(set, set + stdex::strnlen(set,
count));
742 _In_reads_or_z_(end)
const T*
text,
743 _In_ size_t start = 0,
744 _In_ size_t end = (
size_t)-1,
747 _Assume_(
text || start >= end);
748 if (start < end &&
text[start]) {
749 const T* set = m_set.c_str();
750 size_t r = (
flags & match_case_insensitive) ?
751 stdex::strnichr(set, m_set.size(),
text[start], this->m_locale) :
752 stdex::strnchr(set, m_set.size(),
text[start]);
753 if ((
r != stdex::npos && !this->m_invert) || (
r == stdex::npos && this->m_invert)) {
754 this->hit_offset =
r;
759 this->hit_offset = (
size_t)-1;
765 std::basic_string<T> m_set;
782 sgml_cp_set(
const char* set,
size_t count = (
size_t)-1,
bool invert =
false,
_In_ const std::locale& locale = std::locale()) :
786 m_set = sgml2wstr(set,
count);
790 _In_reads_or_z_(end)
const char*
text,
791 _In_ size_t start = 0,
792 _In_ size_t end = (
size_t)-1,
795 _Assume_(
text || start >= end);
796 if (start < end &&
text[start]) {
799 const wchar_t* set = m_set.c_str();
800 size_t r = (
flags & match_case_insensitive) ?
801 stdex::strnistr(set, m_set.size(),
chr, m_locale) :
802 stdex::strnstr(set, m_set.size(),
chr);
803 if ((
r != stdex::npos && !m_invert) || (
r == stdex::npos && m_invert)) {
826 _In_reads_or_z_(
count)
const T*
str,
828 _In_ const std::locale& locale = std::locale()) :
834 _In_reads_or_z_(end)
const T*
text,
835 _In_ size_t start = 0,
836 _In_ size_t end = (
size_t)-1,
839 _Assume_(
text || start >= end);
842 n = std::min<size_t>(end - start,
m);
843 bool r = ((
flags & match_case_insensitive) ?
844 stdex::strnicmp(
text + start,
n, m_str.c_str(),
m, this->m_locale) :
845 stdex::strncmp(
text + start,
n, m_str.c_str(),
m)) == 0;
855 std::basic_string<T> m_str;
878 _In_reads_or_z_(end)
const char*
text,
879 _In_ size_t start = 0,
880 _In_ size_t end = (
size_t)-1,
883 _Assume_(
text || start >= end);
884 const wchar_t*
str = m_str.c_str();
886 const auto&
ctype = std::use_facet<std::ctype<wchar_t>>(m_locale);
928 _In_reads_or_z_(end)
const T*
text,
929 _In_ size_t start = 0,
930 _In_ size_t end = (
size_t)-1,
933 _Assume_(
text || start >= end);
935 for (
size_t i = 0; ;
i++) {
954 std::shared_ptr<basic_parser<T>>
m_el;
982 _In_ const std::locale& locale = std::locale()) :
986 m_collection.reserve(
count);
988 m_collection.push_back(
el[
i]);
993 _In_ const std::locale& locale = std::locale()) :
998 virtual void invalidate()
1000 for (
auto&
el: m_collection)
1006 std::vector<std::shared_ptr<basic_parser<T>>> m_collection;
1019 _In_ const std::locale& locale = std::locale()) :
1025 _In_ const std::locale& locale = std::locale()) :
1030 _In_reads_or_z_(end)
const T*
text,
1031 _In_ size_t start = 0,
1032 _In_ size_t end = (
size_t)-1,
1035 _Assume_(
text || start >= end);
1037 for (
auto i = this->m_collection.begin();
i != this->m_collection.end(); ++
i) {
1039 for (++
i;
i != this->m_collection.end(); ++
i)
1069 hit_offset((
size_t)-1)
1076 _In_ const std::locale& locale = std::locale()) :
1078 hit_offset((
size_t)-1)
1083 _In_ const std::locale& locale = std::locale()) :
1085 hit_offset((
size_t)-1)
1089 _In_reads_or_z_(end)
const T*
text,
1090 _In_ size_t start = 0,
1091 _In_ size_t end = (
size_t)-1,
1094 _Assume_(
text || start >= end);
1096 for (
auto i = this->m_collection.begin();
i != this->m_collection.end(); ++
i, ++hit_offset) {
1097 if ((*i)->match(
text, start, end,
flags)) {
1099 for (++
i;
i != this->m_collection.end(); ++
i)
1109 virtual void invalidate()
1131 template <
class T,
class T_parser = basic_
string<T>>
1138 _In_ const std::locale& locale = std::locale()) :
1171 offset += stdex::strnlen(
str_z + offset,
count - offset) + 1, ++
n);
1172 this->m_collection.reserve(
n);
1176 offset += stdex::strnlen(
str_z + offset,
count - offset) + 1)
1177 this->m_collection.push_back(std::move(std::make_shared<T_parser>(
str_z + offset,
count - offset,
this->m_locale)));
1185 this->m_collection.push_back(std::move(std::make_shared<T_parser>(
str, (
size_t)-1,
this->m_locale)));
1186 (
p =
va_arg(params,
const T*)) !=
nullptr;
1187 this->m_collection.push_back(std::move(std::make_shared<T_parser>(
p, (
size_t)-1, this->m_locale))));
1210 _In_ const std::locale& locale = std::locale()) :
1216 _In_ const std::locale& locale = std::locale()) :
1221 _In_reads_or_z_(end)
const T*
text,
1222 _In_ size_t start = 0,
1223 _In_ size_t end = (
size_t)-1,
1226 _Assume_(
text || start >= end);
1227 for (
auto&
el: this->m_collection)
1229 if (match_recursively(
text, start, end,
flags)) {
1238 bool match_recursively(
1239 _In_reads_or_z_(end)
const T*
text,
1240 _In_ size_t start = 0,
1241 _In_ size_t end = (
size_t)-1,
1245 for (
auto&
el: this->m_collection) {
1288 virtual void invalidate()
1316 _In_ const std::locale& locale = std::locale()) :
1331 _In_reads_or_z_(end)
const T*
text,
1332 _In_ size_t start = 0,
1333 _In_ size_t end = (
size_t)-1,
1336 _Assume_(
text || start >= end);
1361 std::shared_ptr<basic_parser<T>>
1393 _In_ const std::locale& locale = std::locale()) :
1398 m_separator(separator)
1402 _In_reads_or_z_(end)
const T*
text,
1403 _In_ size_t start = 0,
1404 _In_ size_t end = (
size_t)-1,
1407 _Assume_(
text || start >= end);
1408 if (m_digits->match(
text, start, end,
flags)) {
1410 this->
value = m_digits->value;
1415 if (m_digits->interval.size() <= 3) {
1417 size_t hit_offset = (
size_t)-1;
1419 (hit_offset == (
size_t)-1 || hit_offset == m_separator->hit_offset) &&
1420 m_digits->match(
text, m_separator->interval.end, end,
flags) &&
1421 m_digits->interval.size() == 3)
1424 this->
value = this->
value * 1000 + m_digits->value;
1428 hit_offset = m_separator->hit_offset;
1439 virtual void invalidate()
1451 std::shared_ptr<basic_integer10<T>> m_digits;
1452 std::shared_ptr<basic_set<T>> m_separator;
1488 _In_ const std::locale& locale = std::locale()) :
1509 _In_reads_or_z_(end)
const T*
text,
1510 _In_ size_t start = 0,
1511 _In_ size_t end = (
size_t)-1,
1514 _Assume_(
text || start >= end);
1545 std::shared_ptr<basic_parser<T>>
1590 _In_ const std::locale& locale = std::locale()) :
1604 _In_reads_or_z_(end)
const T*
text,
1605 _In_ size_t start = 0,
1606 _In_ size_t end = (
size_t)-1,
1609 _Assume_(
text || start >= end);
1627 if (
dig[4] == (
size_t)-1)
dig[4] =
dig[0];
1635 this->
value += dig[0];
1638 (
dig[1] == 1 && (
dig[0] == 5 ||
dig[0] == 10)) ||
1639 (
dig[1] == 10 && (
dig[0] == 50 ||
dig[0] == 100)) ||
1640 (
dig[1] == 100 && (
dig[0] == 500 ||
dig[0] == 1000)) ||
1641 (
dig[1] == 1000 && (
dig[0] == 5000 ||
dig[0] == 10000)))
1648 this->
value -= dig[1];
1652 this->
value += dig[0];
1668 std::shared_ptr<basic_parser<T>>
1700 _In_ const std::locale& locale = std::locale()) :
1708 _In_reads_or_z_(end)
const T*
text,
1709 _In_ size_t start = 0,
1710 _In_ size_t end = (
size_t)-1,
1713 _Assume_(
text || start >= end);
1714 if (numerator->match(
text, start, end,
flags) &&
1715 fraction_line->match(
text, numerator->interval.end, end,
flags) &&
1716 denominator->match(
text, fraction_line->interval.end, end,
flags))
1722 numerator->invalidate();
1723 fraction_line->invalidate();
1724 denominator->invalidate();
1729 virtual void invalidate()
1731 numerator->invalidate();
1732 fraction_line->invalidate();
1733 denominator->invalidate();
1738 std::shared_ptr<basic_parser<T>> numerator;
1739 std::shared_ptr<basic_parser<T>> fraction_line;
1740 std::shared_ptr<basic_parser<T>> denominator;
1764 _In_ const std::locale& locale = std::locale()) :
1773 _In_reads_or_z_(end)
const T*
text,
1774 _In_ size_t start = 0,
1775 _In_ size_t end = (
size_t)-1,
1778 _Assume_(
text || start >= end);
1807 separator->invalidate();
1808 guest->invalidate();
1813 virtual void invalidate()
1816 separator->invalidate();
1817 guest->invalidate();
1822 std::shared_ptr<basic_parser<T>> home;
1823 std::shared_ptr<basic_parser<T>> separator;
1824 std::shared_ptr<basic_parser<T>> guest;
1827 std::shared_ptr<basic_parser<T>> m_space;
1851 _In_ const std::locale& locale = std::locale()) :
1860 _In_reads_or_z_(end)
const T*
text,
1861 _In_ size_t start = 0,
1862 _In_ size_t end = (
size_t)-1,
1865 _Assume_(
text || start >= end);
1900 virtual void invalidate()
1939 _In_ const std::locale& locale = std::locale()) :
1950 _In_reads_or_z_(end)
const T*
text,
1951 _In_ size_t start = 0,
1952 _In_ size_t end = (
size_t)-1,
1955 _Assume_(
text || start >= end);
2021 virtual void invalidate()
2039 std::shared_ptr<basic_parser<T>> m_space;
2069 _In_ const std::locale& locale = std::locale()) :
2081 value(std::numeric_limits<double>::quiet_NaN())
2085 _In_reads_or_z_(end)
const T*
text,
2086 _In_ size_t start = 0,
2087 _In_ size_t end = (
size_t)-1,
2090 _Assume_(
text || start >= end);
2125 if (
integer->interval.empty() &&
2181 virtual void invalidate()
2193 value = std::numeric_limits<double>::quiet_NaN();
2235 _In_ const std::locale& locale = std::locale()) :
2247 _In_reads_or_z_(end)
const T*
text,
2248 _In_ size_t start = 0,
2249 _In_ size_t end = (
size_t)-1,
2252 _Assume_(
text || start >= end);
2299 if (
integer->interval.empty() &&
2318 virtual void invalidate()
2368 _In_ const std::locale& locale = std::locale()) :
2380 m_separator(separator)
2386 _In_reads_or_z_(end)
const T*
text,
2387 _In_ size_t start = 0,
2388 _In_ size_t end = (
size_t)-1,
2391 _Assume_(
text || start >= end);
2396 for (
i = 0;
i < 4;
i++) {
2454 virtual void invalidate()
2473 std::shared_ptr<basic_parser<T>>
2484 std::shared_ptr<basic_parser<T>> m_separator;
2506 _In_reads_or_z_(end)
const T*
text,
2507 _In_ size_t start = 0,
2508 _In_ size_t end = (
size_t)-1,
2511 _Assume_(
text || start >= end);
2512 if (start < end &&
text[start]) {
2513 if (
text[start] ==
'-' ||
2514 text[start] ==
'_' ||
2515 text[start] ==
':' ||
2516 std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::alnum,
text[start]))
2544 _In_reads_or_z_(end)
const char*
text,
2545 _In_ size_t start = 0,
2546 _In_ size_t end = (
size_t)-1,
2549 _Assume_(
text || start >= end);
2550 if (start < end &&
text[start]) {
2554 if (((
chr[0] ==
L'-' ||
2556 chr[0] ==
L':') &&
chr[1] == 0) ||
2595 _In_ const std::locale& locale = std::locale()) :
2613 m_separator(separator),
2621 _In_reads_or_z_(end)
const T*
text,
2622 _In_ size_t start = 0,
2623 _In_ size_t end = (
size_t)-1,
2626 _Assume_(
text || start >= end);
2631 for (
i = 0;
i < 8;
i++) {
2635 if (m_separator->match(
text, m_separator->interval.end, end,
flags)) {
2684 if (
x_n <= 0xffff) {
2707 this->
value.s6_words[--j] = this->
value.s6_words[--k];
2711 this->
value.s6_words[--j] = 0;
2751 virtual void invalidate()
2780 std::shared_ptr<basic_parser<T>>
2797 std::shared_ptr<basic_parser<T>> m_separator, m_scope_id_separator;
2818 _In_ const std::locale& locale = std::locale()) :
2825 _In_reads_or_z_(end)
const T*
text,
2826 _In_ size_t start = 0,
2827 _In_ size_t end = (
size_t)-1,
2830 _Assume_(
text || start >= end);
2831 if (start < end &&
text[start]) {
2832 if ((
'A' <=
text[start] &&
text[start] <=
'Z') ||
2833 (
'a' <=
text[start] &&
text[start] <=
'z') ||
2834 (
'0' <=
text[start] &&
text[start] <=
'9'))
2836 else if (
text[start] ==
'-')
2838 else if (m_allow_idn && std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::alnum,
text[start]))
2874 _In_ const std::locale& locale = std::locale()) :
2879 _In_reads_or_z_(end)
const char*
text,
2880 _In_ size_t start = 0,
2881 _In_ size_t end = (
size_t)-1,
2884 _Assume_(
text || start >= end);
2885 if (start < end &&
text[start]) {
2889 if (((
'A' <=
chr[0] &&
chr[0] <=
'Z') ||
2890 (
'a' <=
chr[0] &&
chr[0] <=
'z') ||
2891 (
'0' <=
chr[0] &&
chr[0] <=
'9')) &&
chr[1] == 0)
2893 else if (
chr[0] ==
'-' &&
chr[1] == 0)
2895 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)
2920 _In_ const std::locale& locale = std::locale()) :
2924 m_separator(separator)
2928 _In_reads_or_z_(end)
const T*
text,
2929 _In_ size_t start = 0,
2930 _In_ size_t end = (
size_t)-1,
2933 _Assume_(
text || start >= end);
2936 if (m_domain_char->match(
text,
i, end,
flags) &&
2937 m_domain_char->allow_on_edge)
2941 while (
i < end &&
text[
i]) {
2942 if (m_domain_char->allow_on_edge &&
2950 i = m_separator->interval.end;
2954 if (m_domain_char->match(
text,
i, end,
flags)) {
2955 if (m_domain_char->allow_on_edge)
2958 i = m_domain_char->interval.end;
2979 std::shared_ptr<basic_dns_domain_char<T>> m_domain_char;
2980 std::shared_ptr<basic_parser<T>> m_separator;
3002 _In_reads_or_z_(end)
const T*
text,
3003 _In_ size_t start = 0,
3004 _In_ size_t end = (
size_t)-1,
3007 _Assume_(
text || start >= end);
3008 if (start < end &&
text[start]) {
3009 if (
text[start] ==
'-' ||
3010 text[start] ==
'.' ||
3011 text[start] ==
'_' ||
3012 text[start] ==
'~' ||
3013 text[start] ==
'%' ||
3014 text[start] ==
'!' ||
3015 text[start] ==
'$' ||
3016 text[start] ==
'&' ||
3017 text[start] ==
'\'' ||
3020 text[start] ==
'*' ||
3021 text[start] ==
'+' ||
3022 text[start] ==
',' ||
3023 text[start] ==
';' ||
3024 text[start] ==
'=' ||
3025 std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::alnum,
text[start]))
3053 _In_reads_or_z_(end)
const char*
text,
3054 _In_ size_t start = 0,
3055 _In_ size_t end = (
size_t)-1,
3058 _Assume_(
text || start >= end);
3059 if (start < end &&
text[start]) {
3063 if (((
chr[0] ==
L'-' ||
3078 chr[0] ==
L'=') &&
chr[1] == 0) ||
3101 _In_reads_or_z_(end)
const T*
text,
3102 _In_ size_t start = 0,
3103 _In_ size_t end = (
size_t)-1,
3106 _Assume_(
text || start >= end);
3107 if (start < end &&
text[start]) {
3108 if (
text[start] ==
'-' ||
3109 text[start] ==
'.' ||
3110 text[start] ==
'_' ||
3111 text[start] ==
'~' ||
3112 text[start] ==
'%' ||
3113 text[start] ==
'!' ||
3114 text[start] ==
'$' ||
3115 text[start] ==
'&' ||
3116 text[start] ==
'\'' ||
3117 text[start] ==
'(' ||
3118 text[start] ==
')' ||
3119 text[start] ==
'*' ||
3120 text[start] ==
'+' ||
3121 text[start] ==
',' ||
3122 text[start] ==
';' ||
3123 text[start] ==
'=' ||
3124 text[start] ==
':' ||
3125 std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::alnum,
text[start]))
3153 _In_reads_or_z_(end)
const char*
text,
3154 _In_ size_t start = 0,
3155 _In_ size_t end = (
size_t)-1,
3158 _Assume_(
text || start >= end);
3159 if (start < end &&
text[start]) {
3163 if (((
chr[0] ==
L'-' ||
3179 chr[0] ==
L':') &&
chr[1] == 0) ||
3201 _In_reads_or_z_(end)
const T*
text,
3202 _In_ size_t start = 0,
3203 _In_ size_t end = (
size_t)-1,
3206 _Assume_(
text || start >= end);
3207 if (start < end &&
text[start]) {
3208 if (
text[start] ==
'/' ||
3209 text[start] ==
'-' ||
3210 text[start] ==
'.' ||
3211 text[start] ==
'_' ||
3212 text[start] ==
'~' ||
3213 text[start] ==
'%' ||
3214 text[start] ==
'!' ||
3215 text[start] ==
'$' ||
3216 text[start] ==
'&' ||
3217 text[start] ==
'\'' ||
3218 text[start] ==
'(' ||
3219 text[start] ==
')' ||
3220 text[start] ==
'*' ||
3221 text[start] ==
'+' ||
3222 text[start] ==
',' ||
3223 text[start] ==
';' ||
3224 text[start] ==
'=' ||
3225 text[start] ==
':' ||
3226 text[start] ==
'@' ||
3227 text[start] ==
'?' ||
3228 text[start] ==
'#' ||
3229 std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::alnum,
text[start]))
3257 _In_reads_or_z_(end)
const char*
text,
3258 _In_ size_t start = 0,
3259 _In_ size_t end = (
size_t)-1,
3262 _Assume_(
text || start >= end);
3263 if (start < end &&
text[start]) {
3267 if (((
chr[0] ==
L'/' ||
3287 chr[0] ==
L'#') &&
chr[1] == 0) ||
3310 _In_ const std::locale& locale = std::locale()) :
3318 _In_reads_or_z_(end)
const T*
text,
3319 _In_ size_t start = 0,
3320 _In_ size_t end = (
size_t)-1,
3323 _Assume_(
text || start >= end);
3409 virtual void invalidate()
3426 std::shared_ptr<basic_parser<T>> m_path_char;
3427 std::shared_ptr<basic_parser<T>> m_query_start;
3428 std::shared_ptr<basic_parser<T>> m_bookmark_start;
3464 _In_ const std::locale& locale = std::locale()) :
3485 _In_reads_or_z_(end)
const T*
text,
3486 _In_ size_t start = 0,
3487 _In_ size_t end = (
size_t)-1,
3490 _Assume_(
text || start >= end);
3495 m_colon->match(
text, http_scheme->interval.end, end,
flags) &&
3496 m_slash->match(
text, m_colon->interval.end, end,
flags) &&
3497 m_slash->match(
text, m_slash->interval.end, end,
flags))
3501 ftp_scheme->invalidate();
3502 mailto_scheme->invalidate();
3503 file_scheme->invalidate();
3506 m_colon->match(
text, ftp_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))
3512 http_scheme->invalidate();
3513 mailto_scheme->invalidate();
3514 file_scheme->invalidate();
3517 m_colon->match(
text, mailto_scheme->interval.end, end,
flags))
3521 http_scheme->invalidate();
3522 ftp_scheme->invalidate();
3523 file_scheme->invalidate();
3526 m_colon->match(
text, file_scheme->interval.end, end,
flags) &&
3527 m_slash->match(
text, m_colon->interval.end, end,
flags) &&
3528 m_slash->match(
text, m_slash->interval.end, end,
flags))
3532 http_scheme->invalidate();
3533 ftp_scheme->invalidate();
3534 mailto_scheme->invalidate();
3538 http_scheme->invalidate();
3539 ftp_scheme->invalidate();
3540 mailto_scheme->invalidate();
3541 file_scheme->invalidate();
3544 if (ftp_scheme->interval) {
3546 if (m_colon->match(
text, username->interval.end, end,
flags) &&
3547 password->match(
text, m_colon->interval.end, end,
flags) &&
3548 m_at->match(
text, password->interval.end, end,
flags))
3556 password->invalidate();
3559 username->invalidate();
3560 password->invalidate();
3564 username->invalidate();
3565 password->invalidate();
3571 ipv6_host->invalidate();
3572 dns_host->invalidate();
3576 ipv6_host->match(
text, m_ip_lbracket->interval.end, end,
flags) &&
3577 m_ip_rbracket->match(
text, ipv6_host->interval.end, end,
flags))
3581 ipv4_host->invalidate();
3582 dns_host->invalidate();
3587 ipv4_host->invalidate();
3588 ipv6_host->invalidate();
3596 port->match(
text, m_colon->interval.end, end,
flags))
3613 if (mailto_scheme->interval) {
3615 m_at->match(
text, username->interval.end, end,
flags))
3626 ipv4_host->match(
text, m_ip_lbracket->interval.end, end,
flags) &&
3627 m_ip_rbracket->match(
text, ipv4_host->interval.end, end,
flags))
3631 ipv6_host->invalidate();
3632 dns_host->invalidate();
3636 ipv6_host->match(
text, m_ip_lbracket->interval.end, end,
flags) &&
3637 m_ip_rbracket->match(
text, ipv6_host->interval.end, end,
flags))
3641 ipv4_host->invalidate();
3642 dns_host->invalidate();
3647 ipv4_host->invalidate();
3648 ipv6_host->invalidate();
3655 password->invalidate();
3662 if (file_scheme->interval) {
3668 username->invalidate();
3669 password->invalidate();
3670 ipv4_host->invalidate();
3671 ipv6_host->invalidate();
3672 dns_host->invalidate();
3681 if (http_scheme->interval &&
3684 if (m_colon->match(
text, username->interval.end, end,
flags) &&
3685 password->match(
text, m_colon->interval.end, end,
flags) &&
3686 m_at->match(
text, password->interval.end, end,
flags))
3691 else if (m_at->match(
text, username->interval.end, end,
flags)) {
3694 password->invalidate();
3697 username->invalidate();
3698 password->invalidate();
3702 username->invalidate();
3703 password->invalidate();
3709 ipv6_host->invalidate();
3710 dns_host->invalidate();
3714 ipv6_host->match(
text, m_ip_lbracket->interval.end, end,
flags) &&
3715 m_ip_rbracket->match(
text, ipv6_host->interval.end, end,
flags))
3719 ipv4_host->invalidate();
3720 dns_host->invalidate();
3725 ipv4_host->invalidate();
3726 ipv6_host->invalidate();
3734 port->match(
text, m_colon->interval.end, end,
flags))
3751 virtual void invalidate()
3753 http_scheme->invalidate();
3754 ftp_scheme->invalidate();
3755 mailto_scheme->invalidate();
3756 file_scheme->invalidate();
3757 username->invalidate();
3758 password->invalidate();
3759 ipv4_host->invalidate();
3760 ipv6_host->invalidate();
3761 dns_host->invalidate();
3768 std::shared_ptr<basic_parser<T>> http_scheme;
3769 std::shared_ptr<basic_parser<T>> ftp_scheme;
3770 std::shared_ptr<basic_parser<T>> mailto_scheme;
3771 std::shared_ptr<basic_parser<T>> file_scheme;
3772 std::shared_ptr<basic_parser<T>> username;
3773 std::shared_ptr<basic_parser<T>> password;
3774 std::shared_ptr<basic_parser<T>> ipv4_host;
3775 std::shared_ptr<basic_parser<T>> ipv6_host;
3776 std::shared_ptr<basic_parser<T>> dns_host;
3777 std::shared_ptr<basic_parser<T>> port;
3778 std::shared_ptr<basic_parser<T>> path;
3781 std::shared_ptr<basic_parser<T>> m_colon;
3782 std::shared_ptr<basic_parser<T>> m_slash;
3783 std::shared_ptr<basic_parser<T>> m_at;
3784 std::shared_ptr<basic_parser<T>> m_ip_lbracket;
3785 std::shared_ptr<basic_parser<T>> m_ip_rbracket;
3812 _In_ const std::locale& locale = std::locale()) :
3824 _In_reads_or_z_(end)
const T*
text,
3825 _In_ size_t start = 0,
3826 _In_ size_t end = (
size_t)-1,
3829 _Assume_(
text || start >= end);
3831 if (username->match(
text, start, end,
flags) &&
3832 m_at->match(
text, username->interval.end, end,
flags))
3835 if (m_ip_lbracket->match(
text, m_at->interval.end, end,
flags) &&
3836 ipv4_host->match(
text, m_ip_lbracket->interval.end, end,
flags) &&
3837 m_ip_rbracket->match(
text, ipv4_host->interval.end, end,
flags))
3841 ipv6_host->invalidate();
3842 dns_host->invalidate();
3845 m_ip_lbracket->match(
text, m_at->interval.end, end,
flags) &&
3846 ipv6_host->match(
text, m_ip_lbracket->interval.end, end,
flags) &&
3847 m_ip_rbracket->match(
text, ipv6_host->interval.end, end,
flags))
3851 ipv4_host->invalidate();
3852 dns_host->invalidate();
3854 else if (dns_host->match(
text, m_at->interval.end, end,
flags)) {
3857 ipv4_host->invalidate();
3858 ipv6_host->invalidate();
3867 username->invalidate();
3868 ipv4_host->invalidate();
3869 ipv6_host->invalidate();
3870 dns_host->invalidate();
3875 virtual void invalidate()
3877 username->invalidate();
3878 ipv4_host->invalidate();
3879 ipv6_host->invalidate();
3880 dns_host->invalidate();
3885 std::shared_ptr<basic_parser<T>> username;
3886 std::shared_ptr<basic_parser<T>> ipv4_host;
3887 std::shared_ptr<basic_parser<T>> ipv6_host;
3888 std::shared_ptr<basic_parser<T>> dns_host;
3891 std::shared_ptr<basic_parser<T>> m_at;
3892 std::shared_ptr<basic_parser<T>> m_ip_lbracket;
3893 std::shared_ptr<basic_parser<T>> m_ip_rbracket;
3918 _In_ const std::locale& locale = std::locale()) :
3928 _In_reads_or_z_(end)
const T*
text,
3929 _In_ size_t start = 0,
3930 _In_ size_t end = (
size_t)-1,
3933 _Assume_(
text || start >= end);
3939 mouth->invalidate();
3956 hit_offset =
mouth->hit_offset;
3967 hit_offset =
mouth->hit_offset;
3982 mouth->invalidate();
3987 virtual void invalidate()
3993 mouth->invalidate();
3999 std::shared_ptr<basic_parser<T>>
apex;
4000 std::shared_ptr<basic_parser<T>>
eyes;
4001 std::shared_ptr<basic_parser<T>>
nose;
4017 enum date_format_t {
4018 date_format_none = 0,
4019 date_format_dmy = 0x1,
4020 date_format_mdy = 0x2,
4021 date_format_ymd = 0x4,
4022 date_format_ym = 0x8,
4023 date_format_my = 0x10,
4024 date_format_dm = 0x20,
4025 date_format_md = 0x40,
4042 _In_ const std::locale& locale = std::locale()) :
4044 format(date_format_none),
4049 m_separator(separator),
4054 _In_reads_or_z_(end)
const T*
text,
4055 _In_ size_t start = 0,
4056 _In_ size_t end = (
size_t)-1,
4059 _Assume_(
text || start >= end);
4062 if ((m_format_mask & date_format_dmy) == date_format_dmy) {
4063 if (day->match(
text, start, end,
flags)) {
4066 size_t hit_offset = m_separator->hit_offset;
4071 m_separator->hit_offset == hit_offset)
4075 is_valid(day->value, month->value))
4079 format = date_format_dmy;
4088 if ((m_format_mask & date_format_mdy) == date_format_mdy) {
4089 if (month->match(
text, start, end,
flags)) {
4092 size_t hit_offset = m_separator->hit_offset;
4097 m_separator->hit_offset == hit_offset)
4101 is_valid(day->value, month->value))
4105 format = date_format_mdy;
4114 if ((m_format_mask & date_format_ymd) == date_format_ymd) {
4115 if (year->match(
text, start, end,
flags)) {
4118 size_t hit_offset = m_separator->hit_offset;
4123 m_separator->hit_offset == hit_offset)
4127 is_valid(day->value, month->value))
4131 format = date_format_ymd;
4140 if ((m_format_mask & date_format_ym) == date_format_ym) {
4141 if (year->match(
text, start, end,
flags)) {
4146 is_valid((
size_t)-1, month->value))
4148 if (day) day->invalidate();
4151 format = date_format_ym;
4158 if ((m_format_mask & date_format_my) == date_format_my) {
4159 if (month->match(
text, start, end,
flags)) {
4164 is_valid((
size_t)-1, month->value))
4166 if (day) day->invalidate();
4169 format = date_format_my;
4176 if ((m_format_mask & date_format_dm) == date_format_dm) {
4177 if (day->match(
text, start, end,
flags)) {
4180 size_t hit_offset = m_separator->hit_offset;
4183 is_valid(day->value, month->value))
4185 if (year) year->invalidate();
4189 m_separator->hit_offset == hit_offset)
4193 format = date_format_dm;
4200 if ((m_format_mask & date_format_md) == date_format_md) {
4201 if (month->match(
text, start, end,
flags)) {
4204 size_t hit_offset = m_separator->hit_offset;
4207 is_valid(day->value, month->value))
4209 if (year) year->invalidate();
4213 m_separator->hit_offset == hit_offset)
4217 format = date_format_md;
4224 if (day) day->invalidate();
4225 if (month) month->invalidate();
4226 if (year) year->invalidate();
4227 format = date_format_none;
4232 virtual void invalidate()
4234 if (day) day->invalidate();
4235 if (month) month->invalidate();
4236 if (year) year->invalidate();
4237 format = date_format_none;
4242 static inline bool is_valid(
size_t day,
size_t month)
4244 if (month == (
size_t)-1) {
4248 if (day == (
size_t)-1) {
4261 return 1 <= day && day <= 31;
4263 return 1 <= day && day <= 29;
4268 return 1 <= day && day <= 30;
4275 date_format_t format;
4276 std::shared_ptr<basic_integer<T>> day;
4277 std::shared_ptr<basic_integer<T>> month;
4278 std::shared_ptr<basic_integer<T>> year;
4282 std::shared_ptr<basic_set<T>> m_separator;
4283 std::shared_ptr<basic_parser<T>> m_space;
4309 _In_ const std::locale& locale = std::locale()) :
4315 m_separator(separator),
4320 _In_reads_or_z_(end)
const T*
text,
4321 _In_ size_t start = 0,
4322 _In_ size_t end = (
size_t)-1,
4325 _Assume_(
text || start >= end);
4327 if (hour->match(
text, start, end,
flags) &&
4328 m_separator->match(
text, hour->interval.end, end,
flags) &&
4329 minute->match(
text, m_separator->interval.end, end,
flags) &&
4333 size_t hit_offset = m_separator->hit_offset;
4334 if (m_separator->match(
text, minute->interval.end, end,
flags) &&
4335 m_separator->hit_offset == hit_offset &&
4336 second && second->match(
text, m_separator->interval.end, end,
flags) &&
4340 if (m_millisecond_separator && m_millisecond_separator->match(
text, second->interval.end, end,
flags) &&
4341 millisecond && millisecond->match(
text, m_millisecond_separator->interval.end, end,
flags) &&
4342 millisecond->value < 1000)
4348 if (millisecond) millisecond->invalidate();
4353 if (second) second->invalidate();
4354 if (millisecond) millisecond->invalidate();
4362 minute->invalidate();
4363 if (second) second->invalidate();
4364 if (millisecond) millisecond->invalidate();
4369 virtual void invalidate()
4372 minute->invalidate();
4373 if (second) second->invalidate();
4374 if (millisecond) millisecond->invalidate();
4379 std::shared_ptr<basic_integer10<T>> hour;
4380 std::shared_ptr<basic_integer10<T>> minute;
4381 std::shared_ptr<basic_integer10<T>> second;
4382 std::shared_ptr<basic_integer10<T>> millisecond;
4385 std::shared_ptr<basic_set<T>> m_separator;
4386 std::shared_ptr<basic_parser<T>> m_millisecond_separator;
4413 _In_ const std::locale& locale = std::locale()) :
4425 _In_reads_or_z_(end)
const T*
text,
4426 _In_ size_t start = 0,
4427 _In_ size_t end = (
size_t)-1,
4430 _Assume_(
text || start >= end);
4435 degree_separator->match(
text, degree->interval.end, end,
flags))
4438 this->
interval.
end = degree_separator->interval.end;
4441 degree->invalidate();
4442 degree_separator->invalidate();
4446 minute->value < 60 &&
4447 minute_separator->match(
text, minute->interval.end, end,
flags))
4450 this->
interval.
end = minute_separator->interval.end;
4453 minute->invalidate();
4454 minute_separator->invalidate();
4463 this->
interval.
end = second_separator->interval.end;
4465 if (second_separator) second_separator->invalidate();
4468 if (second) second->invalidate();
4469 if (second_separator) second_separator->invalidate();
4472 if (degree->interval.start < degree->interval.end ||
4473 minute->interval.start < minute->interval.end ||
4474 (second && second->interval.start < second->interval.end))
4481 decimal->invalidate();
4485 if (decimal) decimal->invalidate();
4490 virtual void invalidate()
4492 degree->invalidate();
4493 degree_separator->invalidate();
4494 minute->invalidate();
4495 minute_separator->invalidate();
4496 if (second) second->invalidate();
4497 if (second_separator) second_separator->invalidate();
4498 if (decimal) decimal->invalidate();
4503 std::shared_ptr<basic_integer10<T>> degree;
4504 std::shared_ptr<basic_parser<T>> degree_separator;
4505 std::shared_ptr<basic_integer10<T>> minute;
4506 std::shared_ptr<basic_parser<T>> minute_separator;
4507 std::shared_ptr<basic_integer10<T>> second;
4508 std::shared_ptr<basic_parser<T>> second_separator;
4509 std::shared_ptr<basic_parser<T>> decimal;
4535 _In_ const std::locale& locale = std::locale()) :
4541 m_separator(separator),
4546 _In_reads_or_z_(end)
const T*
text,
4547 _In_ size_t start = 0,
4548 _In_ size_t end = (
size_t)-1,
4551 _Assume_(
text || start >= end);
4559 m_lparenthesis->invalidate();
4560 m_rparenthesis->invalidate();
4563 value.append(
text + m_plus_sign->interval.start,
text + m_plus_sign->interval.end);
4574 value.append(
text + m_digit->interval.start,
text + m_digit->interval.end);
4585 m_lparenthesis && !m_lparenthesis->interval &&
4586 m_rparenthesis && !m_rparenthesis->interval &&
4590 value.append(
text + m_lparenthesis->interval.start, m_lparenthesis->interval.size());
4591 this->
interval.
end = m_lparenthesis->interval.end;
4598 m_rparenthesis && !m_rparenthesis->interval &&
4600 m_lparenthesis->hit_offset == m_rparenthesis->hit_offset)
4603 value.append(
text + m_rparenthesis->interval.start,
text + m_rparenthesis->interval.end);
4604 this->
interval.
end = m_rparenthesis->interval.end;
4645 virtual void invalidate()
4655 std::shared_ptr<basic_parser<T>> m_digit;
4656 std::shared_ptr<basic_parser<T>> m_plus_sign;
4657 std::shared_ptr<basic_set<T>> m_lparenthesis;
4658 std::shared_ptr<basic_set<T>> m_rparenthesis;
4659 std::shared_ptr<basic_parser<T>> m_separator;
4660 std::shared_ptr<basic_parser<T>> m_space;
4683 _In_ const std::locale& locale = std::locale()) :
4694 _In_reads_or_z_(end)
const T*
text,
4695 _In_ size_t start = 0,
4696 _In_ size_t end = (
size_t)-1,
4699 _Assume_(
text || start >= end);
4700 const auto&
ctype = std::use_facet<std::ctype<T>>(this->m_locale);
4708 { {
'A',
'D' }, {}, 24 },
4709 { {
'A',
'E' }, {}, 23 },
4710 { {
'A',
'L' }, {}, 28 },
4711 { {
'A',
'O' }, {}, 25 },
4712 { {
'A',
'T' }, {}, 20 },
4713 { {
'A',
'Z' }, {}, 28 },
4714 { {
'B',
'A' }, {
'3',
'9' }, 20},
4715 { {
'B',
'E' }, {}, 16 },
4716 { {
'B',
'F' }, {}, 28 },
4717 { {
'B',
'G' }, {}, 22 },
4718 { {
'B',
'H' }, {}, 22 },
4719 { {
'B',
'I' }, {}, 27 },
4720 { {
'B',
'J' }, {}, 28 },
4721 { {
'B',
'R' }, {}, 29 },
4722 { {
'B',
'Y' }, {}, 28 },
4723 { {
'C',
'F' }, {}, 27 },
4724 { {
'C',
'G' }, {}, 27 },
4725 { {
'C',
'H' }, {}, 21 },
4726 { {
'C',
'I' }, {}, 28 },
4727 { {
'C',
'M' }, {}, 27 },
4728 { {
'C',
'R' }, {}, 22 },
4729 { {
'C',
'V' }, {}, 25 },
4730 { {
'C',
'Y' }, {}, 28 },
4731 { {
'C',
'Z' }, {}, 24 },
4732 { {
'D',
'E' }, {}, 22 },
4733 { {
'D',
'J' }, {}, 27 },
4734 { {
'D',
'K' }, {}, 18 },
4735 { {
'D',
'O' }, {}, 28 },
4736 { {
'D',
'Z' }, {}, 26 },
4737 { {
'E',
'E' }, {}, 20 },
4738 { {
'E',
'G' }, {}, 29 },
4739 { {
'E',
'S' }, {}, 24 },
4740 { {
'F',
'I' }, {}, 18 },
4741 { {
'F',
'O' }, {}, 18 },
4742 { {
'F',
'R' }, {}, 27 },
4743 { {
'G',
'A' }, {}, 27 },
4744 { {
'G',
'B' }, {}, 22 },
4745 { {
'G',
'E' }, {}, 22 },
4746 { {
'G',
'I' }, {}, 23 },
4747 { {
'G',
'L' }, {}, 18 },
4748 { {
'G',
'Q' }, {}, 27 },
4749 { {
'G',
'R' }, {}, 27 },
4750 { {
'G',
'T' }, {}, 28 },
4751 { {
'G',
'W' }, {}, 25 },
4752 { {
'H',
'N' }, {}, 28 },
4753 { {
'H',
'R' }, {}, 21 },
4754 { {
'H',
'U' }, {}, 28 },
4755 { {
'I',
'E' }, {}, 22 },
4756 { {
'I',
'L' }, {}, 23 },
4757 { {
'I',
'Q' }, {}, 23 },
4758 { {
'I',
'R' }, {}, 26 },
4759 { {
'I',
'S' }, {}, 26 },
4760 { {
'I',
'T' }, {}, 27 },
4761 { {
'J',
'O' }, {}, 30 },
4762 { {
'K',
'M' }, {}, 27 },
4763 { {
'K',
'W' }, {}, 30 },
4764 { {
'K',
'Z' }, {}, 20 },
4765 { {
'L',
'B' }, {}, 28 },
4766 { {
'L',
'C' }, {}, 32 },
4767 { {
'L',
'I' }, {}, 21 },
4768 { {
'L',
'T' }, {}, 20 },
4769 { {
'L',
'U' }, {}, 20 },
4770 { {
'L',
'V' }, {}, 21 },
4771 { {
'L',
'Y' }, {}, 25 },
4772 { {
'M',
'A' }, {}, 28 },
4773 { {
'M',
'C' }, {}, 27 },
4774 { {
'M',
'D' }, {}, 24 },
4775 { {
'M',
'E' }, {
'2',
'5' }, 22 },
4776 { {
'M',
'G' }, {}, 27 },
4777 { {
'M',
'K' }, {
'0',
'7' }, 19 },
4778 { {
'M',
'L' }, {}, 28 },
4779 { {
'M',
'R' }, {
'1',
'3' }, 27},
4780 { {
'M',
'T' }, {}, 31 },
4781 { {
'M',
'U' }, {}, 30 },
4782 { {
'M',
'Z' }, {}, 25 },
4783 { {
'N',
'E' }, {}, 28 },
4784 { {
'N',
'I' }, {}, 32 },
4785 { {
'N',
'L' }, {}, 18 },
4786 { {
'N',
'O' }, {}, 15 },
4787 { {
'P',
'K' }, {}, 24 },
4788 { {
'P',
'L' }, {}, 28 },
4789 { {
'P',
'S' }, {}, 29 },
4790 { {
'P',
'T' }, {
'5',
'0' }, 25 },
4791 { {
'Q',
'A' }, {}, 29 },
4792 { {
'R',
'O' }, {}, 24 },
4793 { {
'R',
'S' }, {
'3',
'5' }, 22 },
4794 { {
'R',
'U' }, {}, 33 },
4795 { {
'S',
'A' }, {}, 24 },
4796 { {
'S',
'C' }, {}, 31 },
4797 { {
'S',
'D' }, {}, 18 },
4798 { {
'S',
'E' }, {}, 24 },
4799 { {
'S',
'I' }, {
'5',
'6' }, 19 },
4800 { {
'S',
'K' }, {}, 24 },
4801 { {
'S',
'M' }, {}, 27 },
4802 { {
'S',
'N' }, {}, 28 },
4803 { {
'S',
'T' }, {}, 25 },
4804 { {
'S',
'V' }, {}, 28 },
4805 { {
'T',
'D' }, {}, 27 },
4806 { {
'T',
'G' }, {}, 28 },
4807 { {
'T',
'L' }, {
'3',
'8' }, 23},
4808 { {
'T',
'N' }, {
'5',
'9' }, 24 },
4809 { {
'T',
'R' }, {}, 26 },
4810 { {
'U',
'A' }, {}, 29 },
4811 { {
'V',
'A' }, {}, 22 },
4812 { {
'V',
'G' }, {}, 24 },
4813 { {
'X',
'K' }, {}, 20 },
4824 if (
chr <
'A' ||
'Z' <
chr)
4831 size_t m = (
l +
r) / 2;
4833 if (
c.country[0] <
this->country[0] || (
c.country[0] ==
this->country[0] &&
c.country[1] <
this->country[1]))
4835 else if (this->
country[0] < c.country[0] || (
this->country[0] ==
c.country[0] &&
this->country[1] <
c.country[1]))
4851 if ((country_desc->check_digits[0] &&
this->check_digits[0] !=
country_desc->check_digits[0]) ||
4864 if ((
'0' <=
chr &&
chr <=
'9') || (
'A' <=
chr &&
chr <=
'Z')) {
4876 for (
size_t i = 0; ; ++
i) {
4877 if (!this->
bban[
i]) {
4878 for (
i = 0;
i < 2; ++
i) {
4897 if (
'0' <= this->
bban[i] && this->
bban[i] <=
'9')
4899 else if (
'A' <= this->
bban[i] && this->
bban[i] <=
'J') {
4903 else if (
'K' <= this->
bban[i] && this->
bban[i] <=
'T') {
4907 else if (
'U' <= this->
bban[i] && this->
bban[i] <=
'Z') {
4922 for (; digit_count < 9 &&
normalized[next]; ++next, ++digit_count)
4938 virtual void invalidate()
4954 std::shared_ptr<basic_parser<T>> m_space;
4977 _In_ const std::locale& locale = std::locale()) :
4987 _In_reads_or_z_(end)
const T*
text,
4988 _In_ size_t start = 0,
4989 _In_ size_t end = (
size_t)-1,
4992 _Assume_(
text || start >= end);
4993 const auto&
ctype = std::use_facet<std::ctype<T>>(this->m_locale);
5015 for (
size_t j = 0;
j < 4; ++
j) {
5019 if ((
'0' <=
chr &&
chr <=
'9') || (
'A' <=
chr &&
chr <=
'Z')) {
5035 for (
size_t j = _countof(this->
reference) - 1 - n;
j;)
5041 for (
size_t i = 0; ; ++
i) {
5077 for (; digit_count < 9 &&
normalized[next]; ++next, ++digit_count)
5092 virtual void invalidate()
5106 std::shared_ptr<basic_parser<T>> m_space;
5130 _In_reads_or_z_(end)
const T*
text,
5131 _In_ size_t start = 0,
5132 _In_ size_t end = (
size_t)-1,
5135 _Assume_(
text || start >= end);
5175 _In_reads_or_z_(end)
const T*
text,
5176 _In_ size_t start = 0,
5177 _In_ size_t end = (
size_t)-1,
5180 _Assume_(
text || start >= end);
5181 if (start < end &&
text[start] ==
'-') {
5212 _In_ const std::locale& locale = std::locale()) :
5225 _In_reads_or_z_(end)
const T*
text,
5226 _In_ size_t start = 0,
5227 _In_ size_t end = (
size_t)-1,
5230 _Assume_(
text || start >= end);
5231 const auto&
ctype = std::use_facet<std::ctype<T>>(this->m_locale);
5248 this->
part1.invalidate();
5249 this->
part2.invalidate();
5250 this->
part3.invalidate();
5251 if (this->
model[0] ==
'9' && this->
model[1] ==
'9') {
5276 if (this->
model[0] ==
'0' && this->
model[1] ==
'0')
5287 else if (this->
model[0] ==
'0' && this->
model[1] ==
'1')
5306 else if (this->
model[0] ==
'0' && this->
model[1] ==
'2')
5314 else if (this->
model[0] ==
'0' && this->
model[1] ==
'3')
5323 else if (this->
model[0] ==
'0' && this->
model[1] ==
'4')
5331 else if ((this->
model[0] ==
'0' || this->
model[0] ==
'5') && this->
model[1] ==
'5')
5345 else if (this->
model[0] ==
'0' && this->
model[1] ==
'6')
5358 else if (this->
model[0] ==
'0' && this->
model[1] ==
'7')
5369 else if (this->
model[0] ==
'0' && this->
model[1] ==
'8')
5379 else if (this->
model[0] ==
'0' && this->
model[1] ==
'9')
5397 else if (this->
model[0] ==
'1' && this->
model[1] ==
'0')
5413 (this->
model[0] ==
'1' && (this->
model[1] ==
'1' || this->
model[1] ==
'8' || this->
model[1] ==
'9')) ||
5414 ((this->
model[0] ==
'2' || this->
model[0] ==
'3') && this->
model[1] ==
'8') ||
5415 (this->
model[0] ==
'4' && (this->
model[1] ==
'0' || this->
model[1] ==
'1' || this->
model[1] ==
'8' || this->
model[1] ==
'9')) ||
5416 (this->
model[0] ==
'5' && (this->
model[1] ==
'1' || this->
model[1] ==
'8')))
5429 else if (this->
model[0] ==
'1' && this->
model[1] ==
'2')
5437 else if ((this->
model[0] ==
'2' || this->
model[0] ==
'3') && this->
model[1] ==
'1')
5459 virtual void invalidate()
5462 this->
part1.invalidate();
5463 this->
part2.invalidate();
5464 this->
part3.invalidate();
5470 static bool check11(
5483 static bool check11(
5500 static bool check11(
5529 std::shared_ptr<basic_parser<T>> m_space;
5553 _In_ const std::locale& locale = std::locale()) :
5563 _In_reads_or_z_(end)
const T*
text,
5564 _In_ size_t start = 0,
5565 _In_ size_t end = (
size_t)-1,
5568 _Assume_(
text || start >= end);
5598 virtual void invalidate()
5610 std::shared_ptr<basic_parser<T>> m_element;
5611 std::shared_ptr<basic_parser<T>> m_digit;
5612 std::shared_ptr<basic_parser<T>> m_sign;
5631 _In_reads_or_z_(end)
const char*
text,
5632 _In_ size_t start = 0,
5633 _In_ size_t end = (
size_t)-1,
5636 _Assume_(
text || start >= end);
5667 _In_reads_or_z_(end)
const char*
text,
5668 _In_ size_t start = 0,
5669 _In_ size_t end = (
size_t)-1,
5672 _Assume_(
text || start >= end);
5704 _In_reads_or_z_(end)
const char*
text,
5705 _In_ size_t start = 0,
5706 _In_ size_t end = (
size_t)-1,
5709 _Assume_(
text || start >= end);
5738 _In_reads_or_z_(end)
const char*
text,
5739 _In_ size_t start = 0,
5740 _In_ size_t end = (
size_t)-1,
5743 _Assume_(
text || start >= end);
5792 _In_reads_or_z_(end)
const char*
text,
5793 _In_ size_t start = 0,
5794 _In_ size_t end = (
size_t)-1,
5797 _Assume_(
text || start >= end);
5837 virtual void invalidate()
5841 parser::invalidate();
5858 _In_reads_or_z_(end)
const char*
text,
5859 _In_ size_t start = 0,
5860 _In_ size_t end = (
size_t)-1,
5863 _Assume_(
text || start >= end);
5872 string.invalidate();
5883 virtual void invalidate()
5885 string.invalidate();
5887 parser::invalidate();
5902 _In_reads_or_z_(end)
const char*
text,
5903 _In_ size_t start = 0,
5904 _In_ size_t end = (
size_t)-1,
5907 _Assume_(
text || start >= end);
5935 virtual void invalidate()
5939 parser::invalidate();
5957 _In_reads_or_z_(end)
const char*
text,
5958 _In_ size_t start = 0,
5959 _In_ size_t end = (
size_t)-1,
5962 _Assume_(
text || start >= end);
5963 if (start + 2 < end &&
5964 text[start] ==
'*' &&
5965 text[start + 1] ==
'/' &&
5966 text[start + 2] ==
'*')
5971 else if (start < end &&
text[start] ==
'*') {
5989 _In_reads_or_z_(end)
const char*
text,
5990 _In_ size_t start = 0,
5991 _In_ size_t end = (
size_t)-1,
5994 _Assume_(
text || start >= end);
6017 subtype.invalidate();
6022 virtual void invalidate()
6025 subtype.invalidate();
6026 parser::invalidate();
6044 _In_reads_or_z_(end)
const char*
text,
6045 _In_ size_t start = 0,
6046 _In_ size_t end = (
size_t)-1,
6049 _Assume_(
text || start >= end);
6050 if (!http_media_range::match(
text, start, end,
flags))
6064 params.push_back(std::move(
param));
6079 http_media_range::invalidate();
6085 virtual void invalidate()
6088 http_media_range::invalidate();
6092 std::list<http_parameter> params;
6102 _In_reads_or_z_(end)
const char*
text,
6103 _In_ size_t start = 0,
6104 _In_ size_t end = (
size_t)-1,
6107 _Assume_(
text || start >= end);
6144 _In_reads_or_z_(end)
const char*
text,
6145 _In_ size_t start = 0,
6146 _In_ size_t end = (
size_t)-1,
6149 _Assume_(
text || start >= end);
6178 virtual void invalidate()
6181 parser::invalidate();
6195 _In_reads_or_z_(end)
const char*
text,
6196 _In_ size_t start = 0,
6197 _In_ size_t end = (
size_t)-1,
6200 _Assume_(
text || start >= end);
6228 _In_reads_or_z_(end)
const char*
text,
6229 _In_ size_t start = 0,
6230 _In_ size_t end = (
size_t)-1,
6233 _Assume_(
text || start >= end);
6267 virtual void invalidate()
6270 parser::invalidate();
6284 _In_reads_or_z_(end)
const char*
text,
6285 _In_ size_t start = 0,
6286 _In_ size_t end = (
size_t)-1,
6289 _Assume_(
text || start >= end);
6344 virtual void invalidate()
6350 parser::invalidate();
6364 http_url(
_In_ const std::locale& locale = std::locale()) :
6370 _In_reads_or_z_(end)
const char*
text,
6371 _In_ size_t start = 0,
6372 _In_ size_t end = (
size_t)-1,
6375 _Assume_(
text || start >= end);
6395 server.invalidate();
6421 params.push_back(std::move(
param));
6436 server.invalidate();
6444 virtual void invalidate()
6446 server.invalidate();
6450 parser::invalidate();
6457 std::list<http_url_parameter> params;
6467 _In_reads_or_z_(end)
const char*
text,
6468 _In_ size_t start = 0,
6469 _In_ size_t end = (
size_t)-1,
6472 _Assume_(
text || start >= end);
6480 if (
k.end < end &&
text[
k.end]) {
6492 components.push_back(
k);
6504 if (!components.empty()) {
6513 virtual void invalidate()
6516 parser::invalidate();
6520 std::vector<stdex::interval<size_t>> components;
6535 _In_reads_or_z_(end)
const char*
text,
6536 _In_ size_t start = 0,
6537 _In_ size_t end = (
size_t)-1,
6540 _Assume_(
text || start >= end);
6582 virtual void invalidate()
6585 parser::invalidate();
6599 _In_reads_or_z_(end)
const char*
text,
6600 _In_ size_t start = 0,
6601 _In_ size_t end = (
size_t)-1,
6604 _Assume_(
text || end <= start);
6605 if (start < end &&
text[start] ==
'*') {
6617 template <
class T,
class T_asterisk = http_asterisk>
6627 _In_reads_or_z_(end)
const char*
text,
6628 _In_ size_t start = 0,
6629 _In_ size_t end = (
size_t)-1,
6632 _Assume_(
text || start >= end);
6641 asterisk.invalidate();
6644 asterisk.invalidate();
6666 factor.invalidate();
6673 virtual void invalidate()
6675 asterisk.invalidate();
6677 factor.invalidate();
6678 parser::invalidate();
6694 _In_reads_or_z_(end)
const char*
text,
6695 _In_ size_t start = 0,
6696 _In_ size_t end = (
size_t)-1,
6699 _Assume_(
text || start >= end);
6731 virtual void invalidate()
6735 parser::invalidate();
6753 _In_reads_or_z_(end)
const char*
text,
6754 _In_ size_t start = 0,
6755 _In_ size_t end = (
size_t)-1,
6758 _Assume_(
text || start >= end);
6811 virtual void invalidate()
6816 parser::invalidate();
6835 _In_reads_or_z_(end)
const char*
text,
6836 _In_ size_t start = 0,
6837 _In_ size_t end = (
size_t)-1,
6840 _Assume_(
text || start >= end);
6890 virtual void invalidate()
6896 parser::invalidate();
6916 _In_reads_or_z_(end)
const char*
text,
6917 _In_ size_t start = 0,
6918 _In_ size_t end = (
size_t)-1,
6921 _Assume_(
text || start >= end);
6967 version_min.
start = 1;
6968 version_min.
end = 0;
6984 version_maj.
start = 1;
6985 version_maj.
end = 0;
6986 version_min.
start = 1;
6987 version_min.
end = 0;
6994 virtual void invalidate()
6998 version_maj.
start = 1;
6999 version_maj.
end = 0;
7000 version_min.
start = 1;
7001 version_min.
end = 0;
7003 parser::invalidate();
7026 _In_reads_or_z_(end)
const char*
text,
7027 _In_ size_t start = 0,
7028 _In_ size_t end = (
size_t)-1,
7031 _Assume_(
text || start >= end);
7080 protocol.invalidate();
7127 protocol.invalidate();
7133 virtual void invalidate()
7138 protocol.invalidate();
7139 parser::invalidate();
7158 _In_reads_or_z_(end)
const char*
text,
7159 _In_ size_t start = 0,
7160 _In_ size_t end = (
size_t)-1,
7163 _Assume_(
text || start >= end);
7243 virtual void invalidate()
7249 parser::invalidate();
7263 template <
class _Key,
class T>
7268 _In_reads_or_z_(end)
const char*
text,
7269 _In_ size_t start = 0,
7270 _In_ size_t end = (
size_t)-1,
7273 while (start < end) {
7275 if (start < end &&
text[start] ==
',') {
7282 T::insert(std::move(
el));
7292 constexpr bool operator()(
const T&
a,
const T&
b)
const noexcept
7294 return a.factor.value >
b.factor.value;
7301 template <
class T,
class _Alloc = std::allocator<T>>
7323 _In_ const std::locale& locale = std::locale()) :
7339 _In_reads_or_z_(end)
const T*
text,
7340 _In_ size_t start = 0,
7341 _In_ size_t end = (
size_t)-1,
7344 _Assume_(
text || start >= end);
7356 if (m_quote->match(
text, m_escape->interval.end, end,
flags)) {
7357 value +=
'"'; this->
interval.
end = m_quote->interval.end;
7360 if (m_sol->match(
text, m_escape->interval.end, end,
flags)) {
7361 value +=
'/'; this->
interval.
end = m_sol->interval.end;
7364 if (m_bs->match(
text, m_escape->interval.end, end,
flags)) {
7365 value +=
'\b'; this->
interval.
end = m_bs->interval.end;
7368 if (m_ff->match(
text, m_escape->interval.end, end,
flags)) {
7369 value +=
'\f'; this->
interval.
end = m_ff->interval.end;
7372 if (m_lf->match(
text, m_escape->interval.end, end,
flags)) {
7373 value +=
'\n'; this->
interval.
end = m_lf->interval.end;
7376 if (m_cr->match(
text, m_escape->interval.end, end,
flags)) {
7377 value +=
'\r'; this->
interval.
end = m_cr->interval.end;
7380 if (m_htab->match(
text, m_escape->interval.end, end,
flags)) {
7381 value +=
'\t'; this->
interval.
end = m_htab->interval.end;
7385 m_uni->match(
text, m_escape->interval.end, end,
flags) &&
7386 m_hex->match(
text, m_uni->interval.end, std::min(m_uni->interval.end + 4, end),
flags | match_case_insensitive) &&
7387 m_hex->interval.size() == 4 )
7389 _Assume_(m_hex->value <= 0xffff);
7390 if (
sizeof(T) == 1) {
7391 if (m_hex->value > 0x7ff) {
7392 value += (T)(0xe0 | ((m_hex->value >> 12) & 0x0f));
7393 value += (T)(0x80 | ((m_hex->value >> 6) & 0x3f));
7394 value += (T)(0x80 | (m_hex->value & 0x3f));
7396 else if (m_hex->value > 0x7f) {
7397 value += (T)(0xc0 | ((m_hex->value >> 6) & 0x1f));
7398 value += (T)(0x80 | (m_hex->value & 0x3f));
7401 value += (T)(m_hex->value & 0x7f);
7404 value += (T)m_hex->value;
7408 if (m_escape->match(
text, m_escape->interval.end, end,
flags)) {
7409 value +=
'\\'; this->
interval.
end = m_escape->interval.end;
7414 value.Prilepi(
text + m_chr->interval.start, m_chr->interval.size());
7426 virtual void invalidate()
7433 std::basic_string<T> value;
7436 std::shared_ptr<basic_parser<T>> m_quote;
7437 std::shared_ptr<basic_parser<T>> m_chr;
7438 std::shared_ptr<basic_parser<T>> m_escape;
7439 std::shared_ptr<basic_parser<T>> m_sol;
7440 std::shared_ptr<basic_parser<T>> m_bs;
7441 std::shared_ptr<basic_parser<T>> m_ff;
7442 std::shared_ptr<basic_parser<T>> m_lf;
7443 std::shared_ptr<basic_parser<T>> m_cr;
7444 std::shared_ptr<basic_parser<T>> m_htab;
7445 std::shared_ptr<basic_parser<T>> m_uni;
7446 std::shared_ptr<basic_integer16<T>> m_hex;
7459#undef ENUM_FLAG_OPERATOR
Test for angle in d°mm'ss.dddd form.
Definition parser.hpp:4403
Test for any code unit.
Definition parser.hpp:229
Test for beginning of line.
Definition parser.hpp:623
Test for any.
Definition parser.hpp:1065
Test for Creditor Reference.
Definition parser.hpp:4973
T reference[22]
Normalized national reference number.
Definition parser.hpp:5102
T check_digits[3]
Two check digits.
Definition parser.hpp:5101
bool is_valid
Is reference valid per ISO 7064.
Definition parser.hpp:5103
Test for any code unit from a given string of code units.
Definition parser.hpp:728
Test for specific code unit.
Definition parser.hpp:299
Test for date.
Definition parser.hpp:4033
Test for valid DNS domain character.
Definition parser.hpp:2814
bool allow_on_edge
Is character allowed at the beginning or an end of a DNS domain?
Definition parser.hpp:2852
Test for DNS domain/hostname.
Definition parser.hpp:2914
bool m_allow_absolute
May DNS names end with a dot (absolute name)?
Definition parser.hpp:2978
Test for e-mail address.
Definition parser.hpp:3802
Test for emoticon.
Definition parser.hpp:3910
std::shared_ptr< basic_parser< T > > apex
apex/eyebrows/halo (e.g. O, 0)
Definition parser.hpp:3999
std::shared_ptr< basic_parser< T > > eyes
eyes (e.g. :, ;, >, |, B)
Definition parser.hpp:4000
std::shared_ptr< basic_set< T > > mouth
mouth (e.g. ), ), (, (, |, P, D, p, d)
Definition parser.hpp:4002
std::shared_ptr< basic_parser< T > > nose
nose (e.g. -, o)
Definition parser.hpp:4001
std::shared_ptr< basic_parser< T > > emoticon
emoticon as a whole (e.g. 😀, 🤔, 😶)
Definition parser.hpp:3998
Test for end of line.
Definition parser.hpp:661
Test for fraction.
Definition parser.hpp:1694
Test for International Bank Account Number.
Definition parser.hpp:4679
T bban[31]
Normalized Basic Bank Account Number.
Definition parser.hpp:4950
T country[3]
ISO 3166-1 alpha-2 country code.
Definition parser.hpp:4948
T check_digits[3]
Two check digits.
Definition parser.hpp:4949
bool is_valid
Is IBAN valid per ISO 7064.
Definition parser.hpp:4951
Test for decimal integer.
Definition parser.hpp:1303
Test for decimal integer possibly containing thousand separators.
Definition parser.hpp:1388
bool has_separators
Did integer have any separators?
Definition parser.hpp:1448
size_t digit_count
Total number of digits in integer.
Definition parser.hpp:1447
Test for hexadecimal integer.
Definition parser.hpp:1469
Base class for integer testing.
Definition parser.hpp:1281
size_t value
Calculated value of the numeral.
Definition parser.hpp:1295
Test for IPv4 address.
Definition parser.hpp:2354
stdex::interval< size_t > components[4]
Individual component intervals.
Definition parser.hpp:2469
struct in_addr value
IPv4 address value.
Definition parser.hpp:2470
Test for IPv6 address.
Definition parser.hpp:2573
std::shared_ptr< basic_parser< T > > scope_id
Scope ID (e.g. NIC index with link-local addresses)
Definition parser.hpp:2777
stdex::interval< size_t > components[8]
Individual component intervals.
Definition parser.hpp:2775
struct in6_addr value
IPv6 address value.
Definition parser.hpp:2776
Test for valid IPv6 address scope ID character.
Definition parser.hpp:2501
Test for repeating.
Definition parser.hpp:918
bool m_greedy
try to match as long sequence as possible
Definition parser.hpp:957
std::shared_ptr< basic_parser< T > > m_el
repeating element
Definition parser.hpp:954
size_t m_min_iterations
minimum number of iterations
Definition parser.hpp:955
size_t m_max_iterations
maximum number of iterations
Definition parser.hpp:956
Test for JSON string.
Definition parser.hpp:7309
Test for mixed numeral.
Definition parser.hpp:1930
std::shared_ptr< basic_parser< T > > fraction
fraction
Definition parser.hpp:2036
std::shared_ptr< basic_parser< T > > special_sign
Special sign (e.g. plus-minus '±')
Definition parser.hpp:2034
std::shared_ptr< basic_parser< T > > negative_sign
Negative sign.
Definition parser.hpp:2033
std::shared_ptr< basic_parser< T > > positive_sign
Positive sign.
Definition parser.hpp:2032
std::shared_ptr< basic_parser< T > > integer
Integer part.
Definition parser.hpp:2035
Test for monetary numeral.
Definition parser.hpp:2225
std::shared_ptr< basic_parser< T > > positive_sign
Positive sign.
Definition parser.hpp:2331
std::shared_ptr< basic_parser< T > > decimal_separator
Decimal separator.
Definition parser.hpp:2336
std::shared_ptr< basic_parser< T > > currency
Currency part.
Definition parser.hpp:2334
std::shared_ptr< basic_parser< T > > decimal
Decimal part.
Definition parser.hpp:2337
std::shared_ptr< basic_parser< T > > integer
Integer part.
Definition parser.hpp:2335
std::shared_ptr< basic_parser< T > > negative_sign
Negative sign.
Definition parser.hpp:2332
std::shared_ptr< basic_parser< T > > special_sign
Special sign (e.g. plus-minus '±')
Definition parser.hpp:2333
"No-op" match
Definition parser.hpp:197
Base template for all parsers.
Definition parser.hpp:78
interval< size_t > interval
Region of the last match.
Definition parser.hpp:177
Test for permutation.
Definition parser.hpp:1205
Test for phone number.
Definition parser.hpp:4526
std::basic_string< T > value
Normalized phone number.
Definition parser.hpp:4652
Test for any punctuation code unit.
Definition parser.hpp:471
Test for Roman numeral.
Definition parser.hpp:1578
Test for scientific numeral.
Definition parser.hpp:2056
std::shared_ptr< basic_parser< T > > special_sign
Special sign (e.g. plus-minus '±')
Definition parser.hpp:2200
std::shared_ptr< basic_parser< T > > exponent_symbol
Exponent symbol (e.g. 'e')
Definition parser.hpp:2204
std::shared_ptr< basic_parser< T > > positive_sign
Positive sign.
Definition parser.hpp:2198
std::shared_ptr< basic_parser< T > > negative_sign
Negative sign.
Definition parser.hpp:2199
double value
Calculated value of the numeral.
Definition parser.hpp:2208
std::shared_ptr< basic_parser< T > > negative_exp_sign
Negative exponent sign (e.g. '-')
Definition parser.hpp:2206
std::shared_ptr< basic_integer< T > > decimal
Decimal part.
Definition parser.hpp:2203
std::shared_ptr< basic_parser< T > > positive_exp_sign
Positive exponent sign (e.g. '+')
Definition parser.hpp:2205
std::shared_ptr< basic_integer< T > > exponent
Exponent part.
Definition parser.hpp:2207
std::shared_ptr< basic_parser< T > > decimal_separator
Decimal separator.
Definition parser.hpp:2202
std::shared_ptr< basic_integer< T > > integer
Integer part.
Definition parser.hpp:2201
Test for match score.
Definition parser.hpp:1757
Test for sequence.
Definition parser.hpp:1014
Definition parser.hpp:696
Test for SI Reference delimiter.
Definition parser.hpp:5170
Test for SI Reference part.
Definition parser.hpp:5125
Test for SI Reference.
Definition parser.hpp:5208
basic_si_reference_part< T > part3
Reference data part 3 (P3)
Definition parser.hpp:5525
basic_si_reference_part< T > part1
Reference data part 1 (P1)
Definition parser.hpp:5523
bool is_valid
Is reference valid.
Definition parser.hpp:5526
T model[3]
Reference model.
Definition parser.hpp:5522
basic_si_reference_part< T > part2
Reference data part 2 (P2)
Definition parser.hpp:5524
Test for signed numeral.
Definition parser.hpp:1844
std::shared_ptr< basic_parser< T > > special_sign
Special sign (e.g. plus-minus '±')
Definition parser.hpp:1912
std::shared_ptr< basic_parser< T > > negative_sign
Negative sign.
Definition parser.hpp:1911
std::shared_ptr< basic_parser< T > > positive_sign
Positive sign.
Definition parser.hpp:1910
std::shared_ptr< basic_parser< T > > number
Number.
Definition parser.hpp:1913
Test for any space code unit.
Definition parser.hpp:392
Test for any space or punctuation code unit.
Definition parser.hpp:545
Test for any string.
Definition parser.hpp:1133
Test for given string.
Definition parser.hpp:823
Test for time.
Definition parser.hpp:4300
Test for valid URL password character.
Definition parser.hpp:3096
Test for valid URL path character.
Definition parser.hpp:3196
Test for URL path.
Definition parser.hpp:3304
Test for valid URL username character.
Definition parser.hpp:2997
Test for URL.
Definition parser.hpp:3445
Test for HTTP agent.
Definition parser.hpp:6832
Test for HTTP any type.
Definition parser.hpp:5954
Test for HTTP asterisk.
Definition parser.hpp:6596
Test for HTTP cookie parameter (RFC2109)
Definition parser.hpp:6691
Test for HTTP cookie (RFC2109)
Definition parser.hpp:6750
std::list< http_cookie_parameter > params
List of cookie parameters.
Definition parser.hpp:6822
http_token name
Cookie name.
Definition parser.hpp:6820
http_value value
Cookie value.
Definition parser.hpp:6821
Test for HTTP language (RFC1766)
Definition parser.hpp:6464
Test for HTTP line break (RFC2616: CRLF | LF)
Definition parser.hpp:5628
Test for HTTP parameter (RFC2616: parameter)
Definition parser.hpp:5899
http_token name
Parameter name.
Definition parser.hpp:5943
http_value value
Parameter value.
Definition parser.hpp:5944
Test for HTTP protocol.
Definition parser.hpp:6908
uint16_t version
HTTP protocol version: 0x100 = 1.0, 0x101 = 1.1...
Definition parser.hpp:7010
Test for HTTP quoted string (RFC2616: quoted-string)
Definition parser.hpp:5789
stdex::interval< size_t > content
String content (without quotes)
Definition parser.hpp:5845
Test for HTTP request.
Definition parser.hpp:7017
Test for HTTP space (RFC2616: LWS)
Definition parser.hpp:5664
Test for HTTP text character (RFC2616: TEXT)
Definition parser.hpp:5701
Test for HTTP token (RFC2616: token - tolerates non-ASCII)
Definition parser.hpp:5735
Test for HTTP URL parameter.
Definition parser.hpp:6281
Test for HTTP URL path segment.
Definition parser.hpp:6192
Test for HTTP URL path segment.
Definition parser.hpp:6225
std::vector< http_url_path_segment > segments
Path segments.
Definition parser.hpp:6274
Test for HTTP URL port.
Definition parser.hpp:6136
Test for HTTP URL server.
Definition parser.hpp:6099
Test for HTTP URL.
Definition parser.hpp:6362
Collection of HTTP values.
Definition parser.hpp:7265
Test for HTTP value (RFC2616: value)
Definition parser.hpp:5855
http_quoted_string string
Value when matched as quoted string.
Definition parser.hpp:5891
http_token token
Value when matched as token.
Definition parser.hpp:5892
Test for HTTP weight factor.
Definition parser.hpp:6527
float value
Calculated value of the weight factor.
Definition parser.hpp:6589
Test for HTTP weighted value.
Definition parser.hpp:6619
Base template for collection-holding parsers.
Definition parser.hpp:974
Test for any SGML code point.
Definition parser.hpp:261
Test for any SGML code point from a given string of SGML code points.
Definition parser.hpp:780
Test for specific SGML code point.
Definition parser.hpp:348
Test for valid DNS domain SGML character.
Definition parser.hpp:2870
Test for valid IPv6 address scope ID SGML character.
Definition parser.hpp:2539
Test for any SGML punctuation code point.
Definition parser.hpp:512
Test for any SGML space code point.
Definition parser.hpp:435
Test for any SGML space or punctuation code point.
Definition parser.hpp:588
Test for SGML given string.
Definition parser.hpp:870
Test for valid URL password SGML character.
Definition parser.hpp:3148
Test for valid URL path SGML character.
Definition parser.hpp:3252
Test for valid URL username SGML character.
Definition parser.hpp:3048
Numerical interval.
Definition interval.hpp:18
T size() const
Returns interval size.
Definition interval.hpp:47
T end
interval end
Definition interval.hpp:20
interval() noexcept
Constructs an invalid interval.
Definition interval.hpp:25
T start
interval start
Definition interval.hpp:19
Definition parser.hpp:7291