23#include <netinet/in.h>
34#pragma warning(disable: 4100)
37#define ENUM_FLAG_OPERATOR(T,X) \
38inline 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)); } \
39inline 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); } \
40inline 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)); } \
41inline T& operator X= (T& lhs, const T rhs) { return lhs = lhs X rhs; } \
42inline T& operator X= (T& lhs, const std::underlying_type_t<T> rhs) { return lhs = lhs X rhs; }
43#define ENUM_FLAGS(T, type) \
45inline T operator ~ (T t) { return (T) (~static_cast<std::underlying_type_t <T>>(t)); } \
46ENUM_FLAG_OPERATOR(T,|) \
47ENUM_FLAG_OPERATOR(T,^) \
48ENUM_FLAG_OPERATOR(T,&) \
52#elif defined(__APPLE__)
53#define s6_words __u6_addr.__u6_addr16
55#define s6_words s6_addr16
65 constexpr int match_default = 0;
66 constexpr int match_case_insensitive = 0x1;
67 constexpr int match_multiline = 0x2;
76 basic_parser(
_In_ const std::locale& locale = std::locale()) : m_locale(locale) {}
80 _In_reads_or_z_(end)
const T*
text,
81 _In_ size_t start = 0,
82 _In_ size_t end = (
size_t)-1,
85 for (
size_t i = start;
i < end &&
text[
i];
i++)
92 _In_reads_or_z_(end)
const T*
text,
93 _In_ size_t start = 0,
94 _In_ size_t end = (
size_t)-1,
97 template<
class _Traits,
class _Ax>
99 const std::basic_string<T, _Traits, _Ax>&
text,
100 _In_ size_t start = 0,
101 _In_ size_t end = (
size_t)-1,
104 return match(
text.c_str(), start, std::min<size_t>(end,
text.size()),
flags);
107 virtual void invalidate()
117 if (
text[start] ==
'&') {
119 const auto&
ctype = std::use_facet<std::ctype<T>>(m_locale);
128 if (
n >= 2 &&
text[start + 1] ==
'#') {
131 if (
text[start + 2] ==
'x' ||
text[start + 2] ==
'X')
132 unicode = strtou32(
text + start + 3,
n - 2,
nullptr, 16);
134 unicode = strtou32(
text + start + 2,
n - 1,
nullptr, 10);
141 ucs4_to_surrogate_pair(buf,
unicode);
165 buf[0] =
text[start];
176 std::locale m_locale;
196 _In_reads_or_z_(end)
const T*
text,
197 _In_ size_t start = 0,
198 _In_ size_t end = (
size_t)-1,
201 _Assume_(
text || start >= end);
202 if (start < end &&
text[start]) {
230 _In_reads_or_z_(end)
const T*
text,
231 _In_ size_t start = 0,
232 _In_ size_t end = (
size_t)-1,
235 _Assume_(
text || start >= end);
236 if (start < end &&
text[start]) {
262 _In_reads_or_z_(end)
const char*
text,
263 _In_ size_t start = 0,
264 _In_ size_t end = (
size_t)-1,
267 _Assume_(
text || start >= end);
268 if (start < end &&
text[start]) {
269 if (
text[start] ==
'&') {
271 const auto&
ctype = std::use_facet<std::ctype<char>>(m_locale);
304 _In_reads_or_z_(end)
const T*
text,
305 _In_ size_t start = 0,
306 _In_ size_t end = (
size_t)-1,
309 _Assume_(
text || start >= end);
310 if (start < end &&
text[start]) {
312 if (
flags & match_case_insensitive) {
313 const auto&
ctype = std::use_facet<std::ctype<T>>(this->m_locale);
317 r =
text[start] == m_chr;
318 if ((
r && !m_invert) || (!
r && m_invert)) {
346 sgml_cp(
const char*
chr,
size_t count = (
size_t)-1,
bool invert =
false,
_In_ const std::locale& locale = std::locale()) :
357 _In_reads_or_z_(end)
const char*
text,
358 _In_ size_t start = 0,
359 _In_ size_t end = (
size_t)-1,
362 _Assume_(
text || start >= end);
363 if (start < end &&
text[start]) {
366 bool r = ((
flags & match_case_insensitive) ?
367 stdex::strnicmp(
chr, (
size_t)-1, m_chr.c_str(), m_chr.size(), m_locale) :
368 stdex::strncmp(
chr, (
size_t)-1, m_chr.c_str(), m_chr.size())) == 0;
369 if ((
r && !m_invert) || (!
r && m_invert)) {
396 _In_reads_or_z_(end)
const T*
text,
397 _In_ size_t start = 0,
398 _In_ size_t end = (
size_t)-1,
401 _Assume_(
text || start >= end);
402 if (start < end &&
text[start]) {
404 ((
flags & match_multiline) || !islbreak(
text[start])) &&
405 std::use_facet<std::ctype<T>>(this->m_locale).is(std::ctype_base::space,
text[start]);
406 if ((
r && !m_invert) || (!
r && m_invert)) {
438 _In_reads_or_z_(end)
const char*
text,
439 _In_ size_t start = 0,
440 _In_ size_t end = (
size_t)-1,
443 _Assume_(
text || start >= end);
444 if (start < end &&
text[start]) {
449 ((
flags & match_multiline) || !islbreak(
chr, (
size_t)-1)) &&
451 if ((
r && !m_invert) || (!
r && m_invert)) {
475 _In_reads_or_z_(end)
const T*
text,
476 _In_ size_t start = 0,
477 _In_ size_t end = (
size_t)-1,
480 _Assume_(
text || start >= end);
481 if (start < end &&
text[start]) {
482 bool r = std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::punct,
text[start]);
483 if ((
r && !m_invert) || (!
r && m_invert)) {
515 _In_reads_or_z_(end)
const char*
text,
516 _In_ size_t start = 0,
517 _In_ size_t end = (
size_t)-1,
520 _Assume_(
text || start >= end);
521 if (start < end &&
text[start]) {
526 if ((
r && !m_invert) || (!
r && m_invert)) {
549 _In_reads_or_z_(end)
const T*
text,
550 _In_ size_t start = 0,
551 _In_ size_t end = (
size_t)-1,
554 _Assume_(
text || start >= end);
555 if (start < end &&
text[start]) {
557 ((
flags & match_multiline) || !islbreak(
text[start])) &&
558 std::use_facet<std::ctype<T>>(this->m_locale).is(std::ctype_base::space | std::ctype_base::punct,
text[start]);
559 if ((
r && !m_invert) || (!
r && m_invert)) {
591 _In_reads_or_z_(end)
const char*
text,
592 _In_ size_t start = 0,
593 _In_ size_t end = (
size_t)-1,
596 _Assume_(
text || start >= end);
597 if (start < end &&
text[start]) {
602 ((
flags & match_multiline) || !islbreak(
chr, (
size_t)-1)) &&
603 std::use_facet<std::ctype<wchar_t>>(m_locale).
scan_not(std::ctype_base::space | std::ctype_base::punct,
chr,
chr_end) ==
chr_end;
604 if ((
r && !m_invert) || (!
r && m_invert)) {
624 _In_reads_or_z_(end)
const T*
text,
625 _In_ size_t start = 0,
626 _In_ size_t end = (
size_t)-1,
629 _Assume_(
text || start >= end);
630 bool r = start == 0 || (start <= end && islbreak(
text[start - 1]));
631 if ((
r && !m_invert) || (!
r && m_invert)) {
662 _In_reads_or_z_(end)
const T*
text,
663 _In_ size_t start = 0,
664 _In_ size_t end = (
size_t)-1,
667 _Assume_(
text || start >= end);
668 bool r = islbreak(
text[start]);
669 if ((
r && !m_invert) || (!
r && m_invert)) {
696 hit_offset((
size_t)-1),
701 _In_reads_or_z_(end)
const T*
text,
702 _In_ size_t start = 0,
703 _In_ size_t end = (
size_t)-1,
706 virtual void invalidate()
727 _In_reads_or_z_(
count)
const T* set,
730 _In_ const std::locale& locale = std::locale()) :
734 m_set.assign(set, set + stdex::strnlen(set,
count));
738 _In_reads_or_z_(end)
const T*
text,
739 _In_ size_t start = 0,
740 _In_ size_t end = (
size_t)-1,
743 _Assume_(
text || start >= end);
744 if (start < end &&
text[start]) {
745 const T* set = m_set.c_str();
746 size_t r = (
flags & match_case_insensitive) ?
747 stdex::strnichr(set, m_set.size(),
text[start], this->m_locale) :
748 stdex::strnchr(set, m_set.size(),
text[start]);
749 if ((
r != stdex::npos && !this->m_invert) || (
r == stdex::npos && this->m_invert)) {
750 this->hit_offset =
r;
755 this->hit_offset = (
size_t)-1;
761 std::basic_string<T> m_set;
778 sgml_cp_set(
const char* set,
size_t count = (
size_t)-1,
bool invert =
false,
_In_ const std::locale& locale = std::locale()) :
782 m_set = sgml2wstr(set,
count);
786 _In_reads_or_z_(end)
const char*
text,
787 _In_ size_t start = 0,
788 _In_ size_t end = (
size_t)-1,
791 _Assume_(
text || start >= end);
792 if (start < end &&
text[start]) {
795 const wchar_t* set = m_set.c_str();
796 size_t r = (
flags & match_case_insensitive) ?
797 stdex::strnistr(set, m_set.size(),
chr, m_locale) :
798 stdex::strnstr(set, m_set.size(),
chr);
799 if ((
r != stdex::npos && !m_invert) || (
r == stdex::npos && m_invert)) {
822 _In_reads_or_z_(
count)
const T*
str,
824 _In_ const std::locale& locale = std::locale()) :
830 _In_reads_or_z_(end)
const T*
text,
831 _In_ size_t start = 0,
832 _In_ size_t end = (
size_t)-1,
835 _Assume_(
text || start >= end);
838 n = std::min<size_t>(end - start,
m);
839 bool r = ((
flags & match_case_insensitive) ?
840 stdex::strnicmp(
text + start,
n, m_str.c_str(),
m, this->m_locale) :
841 stdex::strncmp(
text + start,
n, m_str.c_str(),
m)) == 0;
851 std::basic_string<T> m_str;
874 _In_reads_or_z_(end)
const char*
text,
875 _In_ size_t start = 0,
876 _In_ size_t end = (
size_t)-1,
879 _Assume_(
text || start >= end);
880 const wchar_t*
str = m_str.c_str();
882 const auto&
ctype = std::use_facet<std::ctype<wchar_t>>(m_locale);
924 _In_reads_or_z_(end)
const T*
text,
925 _In_ size_t start = 0,
926 _In_ size_t end = (
size_t)-1,
929 _Assume_(
text || start >= end);
931 for (
size_t i = 0; ;
i++) {
950 std::shared_ptr<basic_parser<T>>
m_el;
978 _In_ const std::locale& locale = std::locale()) :
982 m_collection.reserve(
count);
984 m_collection.push_back(
el[
i]);
989 _In_ const std::locale& locale = std::locale()) :
994 virtual void invalidate()
996 for (
auto&
el: m_collection)
1002 std::vector<std::shared_ptr<basic_parser<T>>> m_collection;
1015 _In_ const std::locale& locale = std::locale()) :
1021 _In_ const std::locale& locale = std::locale()) :
1026 _In_reads_or_z_(end)
const T*
text,
1027 _In_ size_t start = 0,
1028 _In_ size_t end = (
size_t)-1,
1031 _Assume_(
text || start >= end);
1033 for (
auto i = this->m_collection.begin();
i != this->m_collection.end(); ++
i) {
1035 for (++
i;
i != this->m_collection.end(); ++
i)
1065 hit_offset((
size_t)-1)
1072 _In_ const std::locale& locale = std::locale()) :
1074 hit_offset((
size_t)-1)
1079 _In_ const std::locale& locale = std::locale()) :
1081 hit_offset((
size_t)-1)
1085 _In_reads_or_z_(end)
const T*
text,
1086 _In_ size_t start = 0,
1087 _In_ size_t end = (
size_t)-1,
1090 _Assume_(
text || start >= end);
1092 for (
auto i = this->m_collection.begin();
i != this->m_collection.end(); ++
i, ++hit_offset) {
1093 if ((*i)->match(
text, start, end,
flags)) {
1095 for (++
i;
i != this->m_collection.end(); ++
i)
1105 virtual void invalidate()
1127 template <
class T,
class T_parser = basic_
string<T>>
1134 _In_ const std::locale& locale = std::locale()) :
1167 offset += stdex::strnlen(
str_z + offset,
count - offset) + 1, ++
n);
1168 this->m_collection.reserve(
n);
1172 offset += stdex::strnlen(
str_z + offset,
count - offset) + 1)
1173 this->m_collection.push_back(std::move(std::make_shared<T_parser>(
str_z + offset,
count - offset,
this->m_locale)));
1181 this->m_collection.push_back(std::move(std::make_shared<T_parser>(
str, (
size_t)-1,
this->m_locale)));
1182 (
p =
va_arg(params,
const T*)) !=
nullptr;
1183 this->m_collection.push_back(std::move(std::make_shared<T_parser>(
p, (
size_t)-1, this->m_locale))));
1206 _In_ const std::locale& locale = std::locale()) :
1212 _In_ const std::locale& locale = std::locale()) :
1217 _In_reads_or_z_(end)
const T*
text,
1218 _In_ size_t start = 0,
1219 _In_ size_t end = (
size_t)-1,
1222 _Assume_(
text || start >= end);
1223 for (
auto&
el: this->m_collection)
1225 if (match_recursively(
text, start, end,
flags)) {
1234 bool match_recursively(
1235 _In_reads_or_z_(end)
const T*
text,
1236 _In_ size_t start = 0,
1237 _In_ size_t end = (
size_t)-1,
1241 for (
auto&
el: this->m_collection) {
1284 virtual void invalidate()
1312 _In_ const std::locale& locale = std::locale()) :
1327 _In_reads_or_z_(end)
const T*
text,
1328 _In_ size_t start = 0,
1329 _In_ size_t end = (
size_t)-1,
1332 _Assume_(
text || start >= end);
1357 std::shared_ptr<basic_parser<T>>
1389 _In_ const std::locale& locale = std::locale()) :
1394 m_separator(separator)
1398 _In_reads_or_z_(end)
const T*
text,
1399 _In_ size_t start = 0,
1400 _In_ size_t end = (
size_t)-1,
1403 _Assume_(
text || start >= end);
1404 if (m_digits->match(
text, start, end,
flags)) {
1406 this->
value = m_digits->value;
1411 if (m_digits->interval.size() <= 3) {
1413 size_t hit_offset = (
size_t)-1;
1415 (hit_offset == (
size_t)-1 || hit_offset == m_separator->hit_offset) &&
1416 m_digits->match(
text, m_separator->interval.end, end,
flags) &&
1417 m_digits->interval.size() == 3)
1420 this->
value = this->
value * 1000 + m_digits->value;
1424 hit_offset = m_separator->hit_offset;
1435 virtual void invalidate()
1447 std::shared_ptr<basic_integer10<T>> m_digits;
1448 std::shared_ptr<basic_set<T>> m_separator;
1484 _In_ const std::locale& locale = std::locale()) :
1505 _In_reads_or_z_(end)
const T*
text,
1506 _In_ size_t start = 0,
1507 _In_ size_t end = (
size_t)-1,
1510 _Assume_(
text || start >= end);
1541 std::shared_ptr<basic_parser<T>>
1586 _In_ const std::locale& locale = std::locale()) :
1600 _In_reads_or_z_(end)
const T*
text,
1601 _In_ size_t start = 0,
1602 _In_ size_t end = (
size_t)-1,
1605 _Assume_(
text || start >= end);
1623 if (
dig[4] == (
size_t)-1)
dig[4] =
dig[0];
1631 this->
value += dig[0];
1634 (
dig[1] == 1 && (
dig[0] == 5 ||
dig[0] == 10)) ||
1635 (
dig[1] == 10 && (
dig[0] == 50 ||
dig[0] == 100)) ||
1636 (
dig[1] == 100 && (
dig[0] == 500 ||
dig[0] == 1000)) ||
1637 (
dig[1] == 1000 && (
dig[0] == 5000 ||
dig[0] == 10000)))
1644 this->
value -= dig[1];
1648 this->
value += dig[0];
1664 std::shared_ptr<basic_parser<T>>
1696 _In_ const std::locale& locale = std::locale()) :
1704 _In_reads_or_z_(end)
const T*
text,
1705 _In_ size_t start = 0,
1706 _In_ size_t end = (
size_t)-1,
1709 _Assume_(
text || start >= end);
1710 if (numerator->match(
text, start, end,
flags) &&
1711 fraction_line->match(
text, numerator->interval.end, end,
flags) &&
1712 denominator->match(
text, fraction_line->interval.end, end,
flags))
1718 numerator->invalidate();
1719 fraction_line->invalidate();
1720 denominator->invalidate();
1725 virtual void invalidate()
1727 numerator->invalidate();
1728 fraction_line->invalidate();
1729 denominator->invalidate();
1734 std::shared_ptr<basic_parser<T>> numerator;
1735 std::shared_ptr<basic_parser<T>> fraction_line;
1736 std::shared_ptr<basic_parser<T>> denominator;
1760 _In_ const std::locale& locale = std::locale()) :
1769 _In_reads_or_z_(end)
const T*
text,
1770 _In_ size_t start = 0,
1771 _In_ size_t end = (
size_t)-1,
1774 _Assume_(
text || start >= end);
1803 separator->invalidate();
1804 guest->invalidate();
1809 virtual void invalidate()
1812 separator->invalidate();
1813 guest->invalidate();
1818 std::shared_ptr<basic_parser<T>> home;
1819 std::shared_ptr<basic_parser<T>> separator;
1820 std::shared_ptr<basic_parser<T>> guest;
1823 std::shared_ptr<basic_parser<T>> m_space;
1847 _In_ const std::locale& locale = std::locale()) :
1856 _In_reads_or_z_(end)
const T*
text,
1857 _In_ size_t start = 0,
1858 _In_ size_t end = (
size_t)-1,
1861 _Assume_(
text || start >= end);
1896 virtual void invalidate()
1935 _In_ const std::locale& locale = std::locale()) :
1946 _In_reads_or_z_(end)
const T*
text,
1947 _In_ size_t start = 0,
1948 _In_ size_t end = (
size_t)-1,
1951 _Assume_(
text || start >= end);
2017 virtual void invalidate()
2035 std::shared_ptr<basic_parser<T>> m_space;
2065 _In_ const std::locale& locale = std::locale()) :
2077 value(std::numeric_limits<double>::quiet_NaN())
2081 _In_reads_or_z_(end)
const T*
text,
2082 _In_ size_t start = 0,
2083 _In_ size_t end = (
size_t)-1,
2086 _Assume_(
text || start >= end);
2121 if (
integer->interval.empty() &&
2177 virtual void invalidate()
2189 value = std::numeric_limits<double>::quiet_NaN();
2231 _In_ const std::locale& locale = std::locale()) :
2243 _In_reads_or_z_(end)
const T*
text,
2244 _In_ size_t start = 0,
2245 _In_ size_t end = (
size_t)-1,
2248 _Assume_(
text || start >= end);
2295 if (
integer->interval.empty() &&
2314 virtual void invalidate()
2364 _In_ const std::locale& locale = std::locale()) :
2376 m_separator(separator)
2382 _In_reads_or_z_(end)
const T*
text,
2383 _In_ size_t start = 0,
2384 _In_ size_t end = (
size_t)-1,
2387 _Assume_(
text || start >= end);
2392 for (
i = 0;
i < 4;
i++) {
2450 virtual void invalidate()
2469 std::shared_ptr<basic_parser<T>>
2480 std::shared_ptr<basic_parser<T>> m_separator;
2502 _In_reads_or_z_(end)
const T*
text,
2503 _In_ size_t start = 0,
2504 _In_ size_t end = (
size_t)-1,
2507 _Assume_(
text || start >= end);
2508 if (start < end &&
text[start]) {
2509 if (
text[start] ==
'-' ||
2510 text[start] ==
'_' ||
2511 text[start] ==
':' ||
2512 std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::alnum,
text[start]))
2540 _In_reads_or_z_(end)
const char*
text,
2541 _In_ size_t start = 0,
2542 _In_ size_t end = (
size_t)-1,
2545 _Assume_(
text || start >= end);
2546 if (start < end &&
text[start]) {
2550 if (((
chr[0] ==
L'-' ||
2552 chr[0] ==
L':') &&
chr[1] == 0) ||
2591 _In_ const std::locale& locale = std::locale()) :
2609 m_separator(separator),
2617 _In_reads_or_z_(end)
const T*
text,
2618 _In_ size_t start = 0,
2619 _In_ size_t end = (
size_t)-1,
2622 _Assume_(
text || start >= end);
2627 for (
i = 0;
i < 8;
i++) {
2631 if (m_separator->match(
text, m_separator->interval.end, end,
flags)) {
2680 if (
x_n <= 0xffff) {
2703 this->
value.s6_words[--j] = this->
value.s6_words[--k];
2707 this->
value.s6_words[--j] = 0;
2747 virtual void invalidate()
2776 std::shared_ptr<basic_parser<T>>
2793 std::shared_ptr<basic_parser<T>> m_separator, m_scope_id_separator;
2814 _In_ const std::locale& locale = std::locale()) :
2821 _In_reads_or_z_(end)
const T*
text,
2822 _In_ size_t start = 0,
2823 _In_ size_t end = (
size_t)-1,
2826 _Assume_(
text || start >= end);
2827 if (start < end &&
text[start]) {
2828 if ((
'A' <=
text[start] &&
text[start] <=
'Z') ||
2829 (
'a' <=
text[start] &&
text[start] <=
'z') ||
2830 (
'0' <=
text[start] &&
text[start] <=
'9'))
2832 else if (
text[start] ==
'-')
2834 else if (m_allow_idn && std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::alnum,
text[start]))
2870 _In_ const std::locale& locale = std::locale()) :
2875 _In_reads_or_z_(end)
const char*
text,
2876 _In_ size_t start = 0,
2877 _In_ size_t end = (
size_t)-1,
2880 _Assume_(
text || start >= end);
2881 if (start < end &&
text[start]) {
2885 if (((
'A' <=
chr[0] &&
chr[0] <=
'Z') ||
2886 (
'a' <=
chr[0] &&
chr[0] <=
'z') ||
2887 (
'0' <=
chr[0] &&
chr[0] <=
'9')) &&
chr[1] == 0)
2889 else if (
chr[0] ==
'-' &&
chr[1] == 0)
2891 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)
2916 _In_ const std::locale& locale = std::locale()) :
2920 m_separator(separator)
2924 _In_reads_or_z_(end)
const T*
text,
2925 _In_ size_t start = 0,
2926 _In_ size_t end = (
size_t)-1,
2929 _Assume_(
text || start >= end);
2932 if (m_domain_char->match(
text,
i, end,
flags) &&
2933 m_domain_char->allow_on_edge)
2937 while (
i < end &&
text[
i]) {
2938 if (m_domain_char->allow_on_edge &&
2946 i = m_separator->interval.end;
2950 if (m_domain_char->match(
text,
i, end,
flags)) {
2951 if (m_domain_char->allow_on_edge)
2954 i = m_domain_char->interval.end;
2975 std::shared_ptr<basic_dns_domain_char<T>> m_domain_char;
2976 std::shared_ptr<basic_parser<T>> m_separator;
2998 _In_reads_or_z_(end)
const T*
text,
2999 _In_ size_t start = 0,
3000 _In_ size_t end = (
size_t)-1,
3003 _Assume_(
text || start >= end);
3004 if (start < end &&
text[start]) {
3005 if (
text[start] ==
'-' ||
3006 text[start] ==
'.' ||
3007 text[start] ==
'_' ||
3008 text[start] ==
'~' ||
3009 text[start] ==
'%' ||
3010 text[start] ==
'!' ||
3011 text[start] ==
'$' ||
3012 text[start] ==
'&' ||
3013 text[start] ==
'\'' ||
3016 text[start] ==
'*' ||
3017 text[start] ==
'+' ||
3018 text[start] ==
',' ||
3019 text[start] ==
';' ||
3020 text[start] ==
'=' ||
3021 std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::alnum,
text[start]))
3049 _In_reads_or_z_(end)
const char*
text,
3050 _In_ size_t start = 0,
3051 _In_ size_t end = (
size_t)-1,
3054 _Assume_(
text || start >= end);
3055 if (start < end &&
text[start]) {
3059 if (((
chr[0] ==
L'-' ||
3074 chr[0] ==
L'=') &&
chr[1] == 0) ||
3097 _In_reads_or_z_(end)
const T*
text,
3098 _In_ size_t start = 0,
3099 _In_ size_t end = (
size_t)-1,
3102 _Assume_(
text || start >= end);
3103 if (start < end &&
text[start]) {
3104 if (
text[start] ==
'-' ||
3105 text[start] ==
'.' ||
3106 text[start] ==
'_' ||
3107 text[start] ==
'~' ||
3108 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 std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::alnum,
text[start]))
3149 _In_reads_or_z_(end)
const char*
text,
3150 _In_ size_t start = 0,
3151 _In_ size_t end = (
size_t)-1,
3154 _Assume_(
text || start >= end);
3155 if (start < end &&
text[start]) {
3159 if (((
chr[0] ==
L'-' ||
3175 chr[0] ==
L':') &&
chr[1] == 0) ||
3197 _In_reads_or_z_(end)
const T*
text,
3198 _In_ size_t start = 0,
3199 _In_ size_t end = (
size_t)-1,
3202 _Assume_(
text || start >= end);
3203 if (start < end &&
text[start]) {
3204 if (
text[start] ==
'/' ||
3205 text[start] ==
'-' ||
3206 text[start] ==
'.' ||
3207 text[start] ==
'_' ||
3208 text[start] ==
'~' ||
3209 text[start] ==
'%' ||
3210 text[start] ==
'!' ||
3211 text[start] ==
'$' ||
3212 text[start] ==
'&' ||
3213 text[start] ==
'\'' ||
3214 text[start] ==
'(' ||
3215 text[start] ==
')' ||
3216 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 std::use_facet<std::ctype<T>>(this->m_locale).
is(std::ctype_base::alnum,
text[start]))
3253 _In_reads_or_z_(end)
const char*
text,
3254 _In_ size_t start = 0,
3255 _In_ size_t end = (
size_t)-1,
3258 _Assume_(
text || start >= end);
3259 if (start < end &&
text[start]) {
3263 if (((
chr[0] ==
L'/' ||
3283 chr[0] ==
L'#') &&
chr[1] == 0) ||
3306 _In_ const std::locale& locale = std::locale()) :
3314 _In_reads_or_z_(end)
const T*
text,
3315 _In_ size_t start = 0,
3316 _In_ size_t end = (
size_t)-1,
3319 _Assume_(
text || start >= end);
3405 virtual void invalidate()
3422 std::shared_ptr<basic_parser<T>> m_path_char;
3423 std::shared_ptr<basic_parser<T>> m_query_start;
3424 std::shared_ptr<basic_parser<T>> m_bookmark_start;
3460 _In_ const std::locale& locale = std::locale()) :
3481 _In_reads_or_z_(end)
const T*
text,
3482 _In_ size_t start = 0,
3483 _In_ size_t end = (
size_t)-1,
3486 _Assume_(
text || start >= end);
3491 m_colon->match(
text, http_scheme->interval.end, end,
flags) &&
3492 m_slash->match(
text, m_colon->interval.end, end,
flags) &&
3493 m_slash->match(
text, m_slash->interval.end, end,
flags))
3497 ftp_scheme->invalidate();
3498 mailto_scheme->invalidate();
3499 file_scheme->invalidate();
3502 m_colon->match(
text, ftp_scheme->interval.end, end,
flags) &&
3503 m_slash->match(
text, m_colon->interval.end, end,
flags) &&
3504 m_slash->match(
text, m_slash->interval.end, end,
flags))
3508 http_scheme->invalidate();
3509 mailto_scheme->invalidate();
3510 file_scheme->invalidate();
3513 m_colon->match(
text, mailto_scheme->interval.end, end,
flags))
3517 http_scheme->invalidate();
3518 ftp_scheme->invalidate();
3519 file_scheme->invalidate();
3522 m_colon->match(
text, file_scheme->interval.end, end,
flags) &&
3523 m_slash->match(
text, m_colon->interval.end, end,
flags) &&
3524 m_slash->match(
text, m_slash->interval.end, end,
flags))
3528 http_scheme->invalidate();
3529 ftp_scheme->invalidate();
3530 mailto_scheme->invalidate();
3534 http_scheme->invalidate();
3535 ftp_scheme->invalidate();
3536 mailto_scheme->invalidate();
3537 file_scheme->invalidate();
3540 if (ftp_scheme->interval) {
3542 if (m_colon->match(
text, username->interval.end, end,
flags) &&
3543 password->match(
text, m_colon->interval.end, end,
flags) &&
3544 m_at->match(
text, password->interval.end, end,
flags))
3552 password->invalidate();
3555 username->invalidate();
3556 password->invalidate();
3560 username->invalidate();
3561 password->invalidate();
3567 ipv6_host->invalidate();
3568 dns_host->invalidate();
3572 ipv6_host->match(
text, m_ip_lbracket->interval.end, end,
flags) &&
3573 m_ip_rbracket->match(
text, ipv6_host->interval.end, end,
flags))
3577 ipv4_host->invalidate();
3578 dns_host->invalidate();
3583 ipv4_host->invalidate();
3584 ipv6_host->invalidate();
3592 port->match(
text, m_colon->interval.end, end,
flags))
3609 if (mailto_scheme->interval) {
3611 m_at->match(
text, username->interval.end, end,
flags))
3622 ipv4_host->match(
text, m_ip_lbracket->interval.end, end,
flags) &&
3623 m_ip_rbracket->match(
text, ipv4_host->interval.end, end,
flags))
3627 ipv6_host->invalidate();
3628 dns_host->invalidate();
3632 ipv6_host->match(
text, m_ip_lbracket->interval.end, end,
flags) &&
3633 m_ip_rbracket->match(
text, ipv6_host->interval.end, end,
flags))
3637 ipv4_host->invalidate();
3638 dns_host->invalidate();
3643 ipv4_host->invalidate();
3644 ipv6_host->invalidate();
3651 password->invalidate();
3658 if (file_scheme->interval) {
3664 username->invalidate();
3665 password->invalidate();
3666 ipv4_host->invalidate();
3667 ipv6_host->invalidate();
3668 dns_host->invalidate();
3677 if (http_scheme->interval &&
3680 if (m_colon->match(
text, username->interval.end, end,
flags) &&
3681 password->match(
text, m_colon->interval.end, end,
flags) &&
3682 m_at->match(
text, password->interval.end, end,
flags))
3687 else if (m_at->match(
text, username->interval.end, end,
flags)) {
3690 password->invalidate();
3693 username->invalidate();
3694 password->invalidate();
3698 username->invalidate();
3699 password->invalidate();
3705 ipv6_host->invalidate();
3706 dns_host->invalidate();
3710 ipv6_host->match(
text, m_ip_lbracket->interval.end, end,
flags) &&
3711 m_ip_rbracket->match(
text, ipv6_host->interval.end, end,
flags))
3715 ipv4_host->invalidate();
3716 dns_host->invalidate();
3721 ipv4_host->invalidate();
3722 ipv6_host->invalidate();
3730 port->match(
text, m_colon->interval.end, end,
flags))
3747 virtual void invalidate()
3749 http_scheme->invalidate();
3750 ftp_scheme->invalidate();
3751 mailto_scheme->invalidate();
3752 file_scheme->invalidate();
3753 username->invalidate();
3754 password->invalidate();
3755 ipv4_host->invalidate();
3756 ipv6_host->invalidate();
3757 dns_host->invalidate();
3764 std::shared_ptr<basic_parser<T>> http_scheme;
3765 std::shared_ptr<basic_parser<T>> ftp_scheme;
3766 std::shared_ptr<basic_parser<T>> mailto_scheme;
3767 std::shared_ptr<basic_parser<T>> file_scheme;
3768 std::shared_ptr<basic_parser<T>> username;
3769 std::shared_ptr<basic_parser<T>> password;
3770 std::shared_ptr<basic_parser<T>> ipv4_host;
3771 std::shared_ptr<basic_parser<T>> ipv6_host;
3772 std::shared_ptr<basic_parser<T>> dns_host;
3773 std::shared_ptr<basic_parser<T>> port;
3774 std::shared_ptr<basic_parser<T>> path;
3777 std::shared_ptr<basic_parser<T>> m_colon;
3778 std::shared_ptr<basic_parser<T>> m_slash;
3779 std::shared_ptr<basic_parser<T>> m_at;
3780 std::shared_ptr<basic_parser<T>> m_ip_lbracket;
3781 std::shared_ptr<basic_parser<T>> m_ip_rbracket;
3808 _In_ const std::locale& locale = std::locale()) :
3820 _In_reads_or_z_(end)
const T*
text,
3821 _In_ size_t start = 0,
3822 _In_ size_t end = (
size_t)-1,
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))
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))
3847 ipv4_host->invalidate();
3848 dns_host->invalidate();
3850 else if (dns_host->match(
text, m_at->interval.end, end,
flags)) {
3853 ipv4_host->invalidate();
3854 ipv6_host->invalidate();
3863 username->invalidate();
3864 ipv4_host->invalidate();
3865 ipv6_host->invalidate();
3866 dns_host->invalidate();
3871 virtual void invalidate()
3873 username->invalidate();
3874 ipv4_host->invalidate();
3875 ipv6_host->invalidate();
3876 dns_host->invalidate();
3881 std::shared_ptr<basic_parser<T>> username;
3882 std::shared_ptr<basic_parser<T>> ipv4_host;
3883 std::shared_ptr<basic_parser<T>> ipv6_host;
3884 std::shared_ptr<basic_parser<T>> dns_host;
3887 std::shared_ptr<basic_parser<T>> m_at;
3888 std::shared_ptr<basic_parser<T>> m_ip_lbracket;
3889 std::shared_ptr<basic_parser<T>> m_ip_rbracket;
3914 _In_ const std::locale& locale = std::locale()) :
3924 _In_reads_or_z_(end)
const T*
text,
3925 _In_ size_t start = 0,
3926 _In_ size_t end = (
size_t)-1,
3929 _Assume_(
text || start >= end);
3935 mouth->invalidate();
3952 hit_offset =
mouth->hit_offset;
3963 hit_offset =
mouth->hit_offset;
3978 mouth->invalidate();
3983 virtual void invalidate()
3989 mouth->invalidate();
3995 std::shared_ptr<basic_parser<T>>
apex;
3996 std::shared_ptr<basic_parser<T>>
eyes;
3997 std::shared_ptr<basic_parser<T>>
nose;
4013 enum date_format_t {
4014 date_format_none = 0,
4015 date_format_dmy = 0x1,
4016 date_format_mdy = 0x2,
4017 date_format_ymd = 0x4,
4018 date_format_ym = 0x8,
4019 date_format_my = 0x10,
4020 date_format_dm = 0x20,
4021 date_format_md = 0x40,
4038 _In_ const std::locale& locale = std::locale()) :
4040 format(date_format_none),
4045 m_separator(separator),
4050 _In_reads_or_z_(end)
const T*
text,
4051 _In_ size_t start = 0,
4052 _In_ size_t end = (
size_t)-1,
4055 _Assume_(
text || start >= end);
4058 if ((m_format_mask & date_format_dmy) == date_format_dmy) {
4059 if (day->match(
text, start, end,
flags)) {
4062 size_t hit_offset = m_separator->hit_offset;
4067 m_separator->hit_offset == hit_offset)
4071 is_valid(day->value, month->value))
4075 format = date_format_dmy;
4084 if ((m_format_mask & date_format_mdy) == date_format_mdy) {
4085 if (month->match(
text, start, end,
flags)) {
4088 size_t hit_offset = m_separator->hit_offset;
4093 m_separator->hit_offset == hit_offset)
4097 is_valid(day->value, month->value))
4101 format = date_format_mdy;
4110 if ((m_format_mask & date_format_ymd) == date_format_ymd) {
4111 if (year->match(
text, start, end,
flags)) {
4114 size_t hit_offset = m_separator->hit_offset;
4119 m_separator->hit_offset == hit_offset)
4123 is_valid(day->value, month->value))
4127 format = date_format_ymd;
4136 if ((m_format_mask & date_format_ym) == date_format_ym) {
4137 if (year->match(
text, start, end,
flags)) {
4142 is_valid((
size_t)-1, month->value))
4144 if (day) day->invalidate();
4147 format = date_format_ym;
4154 if ((m_format_mask & date_format_my) == date_format_my) {
4155 if (month->match(
text, start, end,
flags)) {
4160 is_valid((
size_t)-1, month->value))
4162 if (day) day->invalidate();
4165 format = date_format_my;
4172 if ((m_format_mask & date_format_dm) == date_format_dm) {
4173 if (day->match(
text, start, end,
flags)) {
4176 size_t hit_offset = m_separator->hit_offset;
4179 is_valid(day->value, month->value))
4181 if (year) year->invalidate();
4185 m_separator->hit_offset == hit_offset)
4189 format = date_format_dm;
4196 if ((m_format_mask & date_format_md) == date_format_md) {
4197 if (month->match(
text, start, end,
flags)) {
4200 size_t hit_offset = m_separator->hit_offset;
4203 is_valid(day->value, month->value))
4205 if (year) year->invalidate();
4209 m_separator->hit_offset == hit_offset)
4213 format = date_format_md;
4220 if (day) day->invalidate();
4221 if (month) month->invalidate();
4222 if (year) year->invalidate();
4223 format = date_format_none;
4228 virtual void invalidate()
4230 if (day) day->invalidate();
4231 if (month) month->invalidate();
4232 if (year) year->invalidate();
4233 format = date_format_none;
4238 static inline bool is_valid(
size_t day,
size_t month)
4240 if (month == (
size_t)-1) {
4244 if (day == (
size_t)-1) {
4257 return 1 <= day && day <= 31;
4259 return 1 <= day && day <= 29;
4264 return 1 <= day && day <= 30;
4271 date_format_t format;
4272 std::shared_ptr<basic_integer<T>> day;
4273 std::shared_ptr<basic_integer<T>> month;
4274 std::shared_ptr<basic_integer<T>> year;
4278 std::shared_ptr<basic_set<T>> m_separator;
4279 std::shared_ptr<basic_parser<T>> m_space;
4305 _In_ const std::locale& locale = std::locale()) :
4311 m_separator(separator),
4316 _In_reads_or_z_(end)
const T*
text,
4317 _In_ size_t start = 0,
4318 _In_ size_t end = (
size_t)-1,
4321 _Assume_(
text || start >= end);
4323 if (hour->match(
text, start, end,
flags) &&
4324 m_separator->match(
text, hour->interval.end, end,
flags) &&
4325 minute->match(
text, m_separator->interval.end, end,
flags) &&
4329 size_t hit_offset = m_separator->hit_offset;
4330 if (m_separator->match(
text, minute->interval.end, end,
flags) &&
4331 m_separator->hit_offset == hit_offset &&
4332 second && second->match(
text, m_separator->interval.end, end,
flags) &&
4336 if (m_millisecond_separator && m_millisecond_separator->match(
text, second->interval.end, end,
flags) &&
4337 millisecond && millisecond->match(
text, m_millisecond_separator->interval.end, end,
flags) &&
4338 millisecond->value < 1000)
4344 if (millisecond) millisecond->invalidate();
4349 if (second) second->invalidate();
4350 if (millisecond) millisecond->invalidate();
4358 minute->invalidate();
4359 if (second) second->invalidate();
4360 if (millisecond) millisecond->invalidate();
4365 virtual void invalidate()
4368 minute->invalidate();
4369 if (second) second->invalidate();
4370 if (millisecond) millisecond->invalidate();
4375 std::shared_ptr<basic_integer10<T>> hour;
4376 std::shared_ptr<basic_integer10<T>> minute;
4377 std::shared_ptr<basic_integer10<T>> second;
4378 std::shared_ptr<basic_integer10<T>> millisecond;
4381 std::shared_ptr<basic_set<T>> m_separator;
4382 std::shared_ptr<basic_parser<T>> m_millisecond_separator;
4409 _In_ const std::locale& locale = std::locale()) :
4421 _In_reads_or_z_(end)
const T*
text,
4422 _In_ size_t start = 0,
4423 _In_ size_t end = (
size_t)-1,
4426 _Assume_(
text || start >= end);
4431 degree_separator->match(
text, degree->interval.end, end,
flags))
4434 this->
interval.
end = degree_separator->interval.end;
4437 degree->invalidate();
4438 degree_separator->invalidate();
4442 minute->value < 60 &&
4443 minute_separator->match(
text, minute->interval.end, end,
flags))
4446 this->
interval.
end = minute_separator->interval.end;
4449 minute->invalidate();
4450 minute_separator->invalidate();
4459 this->
interval.
end = second_separator->interval.end;
4461 if (second_separator) second_separator->invalidate();
4464 if (second) second->invalidate();
4465 if (second_separator) second_separator->invalidate();
4468 if (degree->interval.start < degree->interval.end ||
4469 minute->interval.start < minute->interval.end ||
4470 (second && second->interval.start < second->interval.end))
4477 decimal->invalidate();
4481 if (decimal) decimal->invalidate();
4486 virtual void invalidate()
4488 degree->invalidate();
4489 degree_separator->invalidate();
4490 minute->invalidate();
4491 minute_separator->invalidate();
4492 if (second) second->invalidate();
4493 if (second_separator) second_separator->invalidate();
4494 if (decimal) decimal->invalidate();
4499 std::shared_ptr<basic_integer10<T>> degree;
4500 std::shared_ptr<basic_parser<T>> degree_separator;
4501 std::shared_ptr<basic_integer10<T>> minute;
4502 std::shared_ptr<basic_parser<T>> minute_separator;
4503 std::shared_ptr<basic_integer10<T>> second;
4504 std::shared_ptr<basic_parser<T>> second_separator;
4505 std::shared_ptr<basic_parser<T>> decimal;
4531 _In_ const std::locale& locale = std::locale()) :
4537 m_separator(separator),
4542 _In_reads_or_z_(end)
const T*
text,
4543 _In_ size_t start = 0,
4544 _In_ size_t end = (
size_t)-1,
4547 _Assume_(
text || start >= end);
4555 m_lparenthesis->invalidate();
4556 m_rparenthesis->invalidate();
4559 value.append(
text + m_plus_sign->interval.start,
text + m_plus_sign->interval.end);
4570 value.append(
text + m_digit->interval.start,
text + m_digit->interval.end);
4581 m_lparenthesis && !m_lparenthesis->interval &&
4582 m_rparenthesis && !m_rparenthesis->interval &&
4586 value.append(
text + m_lparenthesis->interval.start, m_lparenthesis->interval.size());
4587 this->
interval.
end = m_lparenthesis->interval.end;
4594 m_rparenthesis && !m_rparenthesis->interval &&
4596 m_lparenthesis->hit_offset == m_rparenthesis->hit_offset)
4599 value.append(
text + m_rparenthesis->interval.start,
text + m_rparenthesis->interval.end);
4600 this->
interval.
end = m_rparenthesis->interval.end;
4641 virtual void invalidate()
4651 std::shared_ptr<basic_parser<T>> m_digit;
4652 std::shared_ptr<basic_parser<T>> m_plus_sign;
4653 std::shared_ptr<basic_set<T>> m_lparenthesis;
4654 std::shared_ptr<basic_set<T>> m_rparenthesis;
4655 std::shared_ptr<basic_parser<T>> m_separator;
4656 std::shared_ptr<basic_parser<T>> m_space;
4679 _In_ const std::locale& locale = std::locale()) :
4690 _In_reads_or_z_(end)
const T*
text,
4691 _In_ size_t start = 0,
4692 _In_ size_t end = (
size_t)-1,
4695 _Assume_(
text || start >= end);
4696 const auto&
ctype = std::use_facet<std::ctype<T>>(this->m_locale);
4704 { {
'A',
'D' }, {}, 24 },
4705 { {
'A',
'E' }, {}, 23 },
4706 { {
'A',
'L' }, {}, 28 },
4707 { {
'A',
'O' }, {}, 25 },
4708 { {
'A',
'T' }, {}, 20 },
4709 { {
'A',
'Z' }, {}, 28 },
4710 { {
'B',
'A' }, {
'3',
'9' }, 20},
4711 { {
'B',
'E' }, {}, 16 },
4712 { {
'B',
'F' }, {}, 28 },
4713 { {
'B',
'G' }, {}, 22 },
4714 { {
'B',
'H' }, {}, 22 },
4715 { {
'B',
'I' }, {}, 27 },
4716 { {
'B',
'J' }, {}, 28 },
4717 { {
'B',
'R' }, {}, 29 },
4718 { {
'B',
'Y' }, {}, 28 },
4719 { {
'C',
'F' }, {}, 27 },
4720 { {
'C',
'G' }, {}, 27 },
4721 { {
'C',
'H' }, {}, 21 },
4722 { {
'C',
'I' }, {}, 28 },
4723 { {
'C',
'M' }, {}, 27 },
4724 { {
'C',
'R' }, {}, 22 },
4725 { {
'C',
'V' }, {}, 25 },
4726 { {
'C',
'Y' }, {}, 28 },
4727 { {
'C',
'Z' }, {}, 24 },
4728 { {
'D',
'E' }, {}, 22 },
4729 { {
'D',
'J' }, {}, 27 },
4730 { {
'D',
'K' }, {}, 18 },
4731 { {
'D',
'O' }, {}, 28 },
4732 { {
'D',
'Z' }, {}, 26 },
4733 { {
'E',
'E' }, {}, 20 },
4734 { {
'E',
'G' }, {}, 29 },
4735 { {
'E',
'S' }, {}, 24 },
4736 { {
'F',
'I' }, {}, 18 },
4737 { {
'F',
'O' }, {}, 18 },
4738 { {
'F',
'R' }, {}, 27 },
4739 { {
'G',
'A' }, {}, 27 },
4740 { {
'G',
'B' }, {}, 22 },
4741 { {
'G',
'E' }, {}, 22 },
4742 { {
'G',
'I' }, {}, 23 },
4743 { {
'G',
'L' }, {}, 18 },
4744 { {
'G',
'Q' }, {}, 27 },
4745 { {
'G',
'R' }, {}, 27 },
4746 { {
'G',
'T' }, {}, 28 },
4747 { {
'G',
'W' }, {}, 25 },
4748 { {
'H',
'N' }, {}, 28 },
4749 { {
'H',
'R' }, {}, 21 },
4750 { {
'H',
'U' }, {}, 28 },
4751 { {
'I',
'E' }, {}, 22 },
4752 { {
'I',
'L' }, {}, 23 },
4753 { {
'I',
'Q' }, {}, 23 },
4754 { {
'I',
'R' }, {}, 26 },
4755 { {
'I',
'S' }, {}, 26 },
4756 { {
'I',
'T' }, {}, 27 },
4757 { {
'J',
'O' }, {}, 30 },
4758 { {
'K',
'M' }, {}, 27 },
4759 { {
'K',
'W' }, {}, 30 },
4760 { {
'K',
'Z' }, {}, 20 },
4761 { {
'L',
'B' }, {}, 28 },
4762 { {
'L',
'C' }, {}, 32 },
4763 { {
'L',
'I' }, {}, 21 },
4764 { {
'L',
'T' }, {}, 20 },
4765 { {
'L',
'U' }, {}, 20 },
4766 { {
'L',
'V' }, {}, 21 },
4767 { {
'L',
'Y' }, {}, 25 },
4768 { {
'M',
'A' }, {}, 28 },
4769 { {
'M',
'C' }, {}, 27 },
4770 { {
'M',
'D' }, {}, 24 },
4771 { {
'M',
'E' }, {
'2',
'5' }, 22 },
4772 { {
'M',
'G' }, {}, 27 },
4773 { {
'M',
'K' }, {
'0',
'7' }, 19 },
4774 { {
'M',
'L' }, {}, 28 },
4775 { {
'M',
'R' }, {
'1',
'3' }, 27},
4776 { {
'M',
'T' }, {}, 31 },
4777 { {
'M',
'U' }, {}, 30 },
4778 { {
'M',
'Z' }, {}, 25 },
4779 { {
'N',
'E' }, {}, 28 },
4780 { {
'N',
'I' }, {}, 32 },
4781 { {
'N',
'L' }, {}, 18 },
4782 { {
'N',
'O' }, {}, 15 },
4783 { {
'P',
'K' }, {}, 24 },
4784 { {
'P',
'L' }, {}, 28 },
4785 { {
'P',
'S' }, {}, 29 },
4786 { {
'P',
'T' }, {
'5',
'0' }, 25 },
4787 { {
'Q',
'A' }, {}, 29 },
4788 { {
'R',
'O' }, {}, 24 },
4789 { {
'R',
'S' }, {
'3',
'5' }, 22 },
4790 { {
'R',
'U' }, {}, 33 },
4791 { {
'S',
'A' }, {}, 24 },
4792 { {
'S',
'C' }, {}, 31 },
4793 { {
'S',
'D' }, {}, 18 },
4794 { {
'S',
'E' }, {}, 24 },
4795 { {
'S',
'I' }, {
'5',
'6' }, 19 },
4796 { {
'S',
'K' }, {}, 24 },
4797 { {
'S',
'M' }, {}, 27 },
4798 { {
'S',
'N' }, {}, 28 },
4799 { {
'S',
'T' }, {}, 25 },
4800 { {
'S',
'V' }, {}, 28 },
4801 { {
'T',
'D' }, {}, 27 },
4802 { {
'T',
'G' }, {}, 28 },
4803 { {
'T',
'L' }, {
'3',
'8' }, 23},
4804 { {
'T',
'N' }, {
'5',
'9' }, 24 },
4805 { {
'T',
'R' }, {}, 26 },
4806 { {
'U',
'A' }, {}, 29 },
4807 { {
'V',
'A' }, {}, 22 },
4808 { {
'V',
'G' }, {}, 24 },
4809 { {
'X',
'K' }, {}, 20 },
4820 if (
chr <
'A' ||
'Z' <
chr)
4827 size_t m = (
l +
r) / 2;
4829 if (
c.country[0] <
this->country[0] || (
c.country[0] ==
this->country[0] &&
c.country[1] <
this->country[1]))
4831 else if (this->
country[0] < c.country[0] || (
this->country[0] ==
c.country[0] &&
this->country[1] <
c.country[1]))
4847 if ((country_desc->check_digits[0] &&
this->check_digits[0] !=
country_desc->check_digits[0]) ||
4860 if ((
'0' <=
chr &&
chr <=
'9') || (
'A' <=
chr &&
chr <=
'Z')) {
4872 for (
size_t i = 0; ; ++
i) {
4873 if (!this->
bban[
i]) {
4874 for (
i = 0;
i < 2; ++
i) {
4893 if (
'0' <= this->
bban[i] && this->
bban[i] <=
'9')
4895 else if (
'A' <= this->
bban[i] && this->
bban[i] <=
'J') {
4899 else if (
'K' <= this->
bban[i] && this->
bban[i] <=
'T') {
4903 else if (
'U' <= this->
bban[i] && this->
bban[i] <=
'Z') {
4918 for (; digit_count < 9 &&
normalized[next]; ++next, ++digit_count)
4934 virtual void invalidate()
4950 std::shared_ptr<basic_parser<T>> m_space;
4973 _In_ const std::locale& locale = std::locale()) :
4983 _In_reads_or_z_(end)
const T*
text,
4984 _In_ size_t start = 0,
4985 _In_ size_t end = (
size_t)-1,
4988 _Assume_(
text || start >= end);
4989 const auto&
ctype = std::use_facet<std::ctype<T>>(this->m_locale);
5011 for (
size_t j = 0;
j < 4; ++
j) {
5015 if ((
'0' <=
chr &&
chr <=
'9') || (
'A' <=
chr &&
chr <=
'Z')) {
5031 for (
size_t j = _countof(this->
reference) - 1 - n;
j;)
5037 for (
size_t i = 0; ; ++
i) {
5073 for (; digit_count < 9 &&
normalized[next]; ++next, ++digit_count)
5088 virtual void invalidate()
5102 std::shared_ptr<basic_parser<T>> m_space;
5126 _In_reads_or_z_(end)
const T*
text,
5127 _In_ size_t start = 0,
5128 _In_ size_t end = (
size_t)-1,
5131 _Assume_(
text || start >= end);
5171 _In_reads_or_z_(end)
const T*
text,
5172 _In_ size_t start = 0,
5173 _In_ size_t end = (
size_t)-1,
5176 _Assume_(
text || start >= end);
5177 if (start < end &&
text[start] ==
'-') {
5208 _In_ const std::locale& locale = std::locale()) :
5221 _In_reads_or_z_(end)
const T*
text,
5222 _In_ size_t start = 0,
5223 _In_ size_t end = (
size_t)-1,
5226 _Assume_(
text || start >= end);
5227 const auto&
ctype = std::use_facet<std::ctype<T>>(this->m_locale);
5244 this->
part1.invalidate();
5245 this->
part2.invalidate();
5246 this->
part3.invalidate();
5247 if (this->
model[0] ==
'9' && this->
model[1] ==
'9') {
5272 if (this->
model[0] ==
'0' && this->
model[1] ==
'0')
5283 else if (this->
model[0] ==
'0' && this->
model[1] ==
'1')
5302 else if (this->
model[0] ==
'0' && this->
model[1] ==
'2')
5310 else if (this->
model[0] ==
'0' && this->
model[1] ==
'3')
5319 else if (this->
model[0] ==
'0' && this->
model[1] ==
'4')
5327 else if ((this->
model[0] ==
'0' || this->
model[0] ==
'5') && this->
model[1] ==
'5')
5341 else if (this->
model[0] ==
'0' && this->
model[1] ==
'6')
5354 else if (this->
model[0] ==
'0' && this->
model[1] ==
'7')
5365 else if (this->
model[0] ==
'0' && this->
model[1] ==
'8')
5375 else if (this->
model[0] ==
'0' && this->
model[1] ==
'9')
5393 else if (this->
model[0] ==
'1' && this->
model[1] ==
'0')
5409 (this->
model[0] ==
'1' && (this->
model[1] ==
'1' || this->
model[1] ==
'8' || this->
model[1] ==
'9')) ||
5410 ((this->
model[0] ==
'2' || this->
model[0] ==
'3') && this->
model[1] ==
'8') ||
5411 (this->
model[0] ==
'4' && (this->
model[1] ==
'0' || this->
model[1] ==
'1' || this->
model[1] ==
'8' || this->
model[1] ==
'9')) ||
5412 (this->
model[0] ==
'5' && (this->
model[1] ==
'1' || this->
model[1] ==
'8')))
5425 else if (this->
model[0] ==
'1' && this->
model[1] ==
'2')
5433 else if ((this->
model[0] ==
'2' || this->
model[0] ==
'3') && this->
model[1] ==
'1')
5455 virtual void invalidate()
5458 this->
part1.invalidate();
5459 this->
part2.invalidate();
5460 this->
part3.invalidate();
5466 static bool check11(
5479 static bool check11(
5496 static bool check11(
5525 std::shared_ptr<basic_parser<T>> m_space;
5549 _In_ const std::locale& locale = std::locale()) :
5559 _In_reads_or_z_(end)
const T*
text,
5560 _In_ size_t start = 0,
5561 _In_ size_t end = (
size_t)-1,
5564 _Assume_(
text || start >= end);
5594 virtual void invalidate()
5606 std::shared_ptr<basic_parser<T>> m_element;
5607 std::shared_ptr<basic_parser<T>> m_digit;
5608 std::shared_ptr<basic_parser<T>> m_sign;
5627 _In_reads_or_z_(end)
const char*
text,
5628 _In_ size_t start = 0,
5629 _In_ size_t end = (
size_t)-1,
5632 _Assume_(
text || start >= end);
5663 _In_reads_or_z_(end)
const char*
text,
5664 _In_ size_t start = 0,
5665 _In_ size_t end = (
size_t)-1,
5668 _Assume_(
text || start >= end);
5700 _In_reads_or_z_(end)
const char*
text,
5701 _In_ size_t start = 0,
5702 _In_ size_t end = (
size_t)-1,
5705 _Assume_(
text || start >= end);
5734 _In_reads_or_z_(end)
const char*
text,
5735 _In_ size_t start = 0,
5736 _In_ size_t end = (
size_t)-1,
5739 _Assume_(
text || start >= end);
5788 _In_reads_or_z_(end)
const char*
text,
5789 _In_ size_t start = 0,
5790 _In_ size_t end = (
size_t)-1,
5793 _Assume_(
text || start >= end);
5833 virtual void invalidate()
5837 parser::invalidate();
5854 _In_reads_or_z_(end)
const char*
text,
5855 _In_ size_t start = 0,
5856 _In_ size_t end = (
size_t)-1,
5859 _Assume_(
text || start >= end);
5868 string.invalidate();
5879 virtual void invalidate()
5881 string.invalidate();
5883 parser::invalidate();
5898 _In_reads_or_z_(end)
const char*
text,
5899 _In_ size_t start = 0,
5900 _In_ size_t end = (
size_t)-1,
5903 _Assume_(
text || start >= end);
5931 virtual void invalidate()
5935 parser::invalidate();
5953 _In_reads_or_z_(end)
const char*
text,
5954 _In_ size_t start = 0,
5955 _In_ size_t end = (
size_t)-1,
5958 _Assume_(
text || start >= end);
5959 if (start + 2 < end &&
5960 text[start] ==
'*' &&
5961 text[start + 1] ==
'/' &&
5962 text[start + 2] ==
'*')
5967 else if (start < end &&
text[start] ==
'*') {
5985 _In_reads_or_z_(end)
const char*
text,
5986 _In_ size_t start = 0,
5987 _In_ size_t end = (
size_t)-1,
5990 _Assume_(
text || start >= end);
6013 subtype.invalidate();
6018 virtual void invalidate()
6021 subtype.invalidate();
6022 parser::invalidate();
6040 _In_reads_or_z_(end)
const char*
text,
6041 _In_ size_t start = 0,
6042 _In_ size_t end = (
size_t)-1,
6045 _Assume_(
text || start >= end);
6046 if (!http_media_range::match(
text, start, end,
flags))
6060 params.push_back(std::move(
param));
6075 http_media_range::invalidate();
6081 virtual void invalidate()
6084 http_media_range::invalidate();
6088 std::list<http_parameter> params;
6098 _In_reads_or_z_(end)
const char*
text,
6099 _In_ size_t start = 0,
6100 _In_ size_t end = (
size_t)-1,
6103 _Assume_(
text || start >= end);
6140 _In_reads_or_z_(end)
const char*
text,
6141 _In_ size_t start = 0,
6142 _In_ size_t end = (
size_t)-1,
6145 _Assume_(
text || start >= end);
6174 virtual void invalidate()
6177 parser::invalidate();
6191 _In_reads_or_z_(end)
const char*
text,
6192 _In_ size_t start = 0,
6193 _In_ size_t end = (
size_t)-1,
6196 _Assume_(
text || start >= end);
6224 _In_reads_or_z_(end)
const char*
text,
6225 _In_ size_t start = 0,
6226 _In_ size_t end = (
size_t)-1,
6229 _Assume_(
text || start >= end);
6263 virtual void invalidate()
6266 parser::invalidate();
6280 _In_reads_or_z_(end)
const char*
text,
6281 _In_ size_t start = 0,
6282 _In_ size_t end = (
size_t)-1,
6285 _Assume_(
text || start >= end);
6340 virtual void invalidate()
6346 parser::invalidate();
6360 http_url(
_In_ const std::locale& locale = std::locale()) :
6366 _In_reads_or_z_(end)
const char*
text,
6367 _In_ size_t start = 0,
6368 _In_ size_t end = (
size_t)-1,
6371 _Assume_(
text || start >= end);
6391 server.invalidate();
6417 params.push_back(std::move(
param));
6432 server.invalidate();
6440 virtual void invalidate()
6442 server.invalidate();
6446 parser::invalidate();
6453 std::list<http_url_parameter> params;
6463 _In_reads_or_z_(end)
const char*
text,
6464 _In_ size_t start = 0,
6465 _In_ size_t end = (
size_t)-1,
6468 _Assume_(
text || start >= end);
6476 if (
k.end < end &&
text[
k.end]) {
6488 components.push_back(
k);
6500 if (!components.empty()) {
6509 virtual void invalidate()
6512 parser::invalidate();
6516 std::vector<stdex::interval<size_t>> components;
6531 _In_reads_or_z_(end)
const char*
text,
6532 _In_ size_t start = 0,
6533 _In_ size_t end = (
size_t)-1,
6536 _Assume_(
text || start >= end);
6578 virtual void invalidate()
6581 parser::invalidate();
6595 _In_reads_or_z_(end)
const char*
text,
6596 _In_ size_t start = 0,
6597 _In_ size_t end = (
size_t)-1,
6600 _Assume_(
text || end <= start);
6601 if (start < end &&
text[start] ==
'*') {
6613 template <
class T,
class T_asterisk = http_asterisk>
6623 _In_reads_or_z_(end)
const char*
text,
6624 _In_ size_t start = 0,
6625 _In_ size_t end = (
size_t)-1,
6628 _Assume_(
text || start >= end);
6637 asterisk.invalidate();
6640 asterisk.invalidate();
6662 factor.invalidate();
6669 virtual void invalidate()
6671 asterisk.invalidate();
6673 factor.invalidate();
6674 parser::invalidate();
6690 _In_reads_or_z_(end)
const char*
text,
6691 _In_ size_t start = 0,
6692 _In_ size_t end = (
size_t)-1,
6695 _Assume_(
text || start >= end);
6727 virtual void invalidate()
6731 parser::invalidate();
6749 _In_reads_or_z_(end)
const char*
text,
6750 _In_ size_t start = 0,
6751 _In_ size_t end = (
size_t)-1,
6754 _Assume_(
text || start >= end);
6807 virtual void invalidate()
6812 parser::invalidate();
6831 _In_reads_or_z_(end)
const char*
text,
6832 _In_ size_t start = 0,
6833 _In_ size_t end = (
size_t)-1,
6836 _Assume_(
text || start >= end);
6886 virtual void invalidate()
6892 parser::invalidate();
6912 _In_reads_or_z_(end)
const char*
text,
6913 _In_ size_t start = 0,
6914 _In_ size_t end = (
size_t)-1,
6917 _Assume_(
text || start >= end);
6963 version_min.
start = 1;
6964 version_min.
end = 0;
6980 version_maj.
start = 1;
6981 version_maj.
end = 0;
6982 version_min.
start = 1;
6983 version_min.
end = 0;
6990 virtual void invalidate()
6994 version_maj.
start = 1;
6995 version_maj.
end = 0;
6996 version_min.
start = 1;
6997 version_min.
end = 0;
6999 parser::invalidate();
7022 _In_reads_or_z_(end)
const char*
text,
7023 _In_ size_t start = 0,
7024 _In_ size_t end = (
size_t)-1,
7027 _Assume_(
text || start >= end);
7076 protocol.invalidate();
7123 protocol.invalidate();
7129 virtual void invalidate()
7134 protocol.invalidate();
7135 parser::invalidate();
7154 _In_reads_or_z_(end)
const char*
text,
7155 _In_ size_t start = 0,
7156 _In_ size_t end = (
size_t)-1,
7159 _Assume_(
text || start >= end);
7239 virtual void invalidate()
7245 parser::invalidate();
7259 template <
class _Key,
class T>
7264 _In_reads_or_z_(end)
const char*
text,
7265 _In_ size_t start = 0,
7266 _In_ size_t end = (
size_t)-1,
7269 while (start < end) {
7271 if (start < end &&
text[start] ==
',') {
7278 T::insert(std::move(
el));
7288 constexpr bool operator()(
const T&
a,
const T&
b)
const noexcept
7290 return a.factor.value >
b.factor.value;
7297 template <
class T,
class _Alloc = std::allocator<T>>
7319 _In_ const std::locale& locale = std::locale()) :
7335 _In_reads_or_z_(end)
const T*
text,
7336 _In_ size_t start = 0,
7337 _In_ size_t end = (
size_t)-1,
7340 _Assume_(
text || start >= end);
7352 if (m_quote->match(
text, m_escape->interval.end, end,
flags)) {
7353 value +=
'"'; this->
interval.
end = m_quote->interval.end;
7356 if (m_sol->match(
text, m_escape->interval.end, end,
flags)) {
7357 value +=
'/'; this->
interval.
end = m_sol->interval.end;
7360 if (m_bs->match(
text, m_escape->interval.end, end,
flags)) {
7361 value +=
'\b'; this->
interval.
end = m_bs->interval.end;
7364 if (m_ff->match(
text, m_escape->interval.end, end,
flags)) {
7365 value +=
'\f'; this->
interval.
end = m_ff->interval.end;
7368 if (m_lf->match(
text, m_escape->interval.end, end,
flags)) {
7369 value +=
'\n'; this->
interval.
end = m_lf->interval.end;
7372 if (m_cr->match(
text, m_escape->interval.end, end,
flags)) {
7373 value +=
'\r'; this->
interval.
end = m_cr->interval.end;
7376 if (m_htab->match(
text, m_escape->interval.end, end,
flags)) {
7377 value +=
'\t'; this->
interval.
end = m_htab->interval.end;
7381 m_uni->match(
text, m_escape->interval.end, end,
flags) &&
7382 m_hex->match(
text, m_uni->interval.end, std::min(m_uni->interval.end + 4, end),
flags | match_case_insensitive) &&
7383 m_hex->interval.size() == 4 )
7385 _Assume_(m_hex->value <= 0xffff);
7386 if (
sizeof(T) == 1) {
7387 if (m_hex->value > 0x7ff) {
7388 value += (T)(0xe0 | ((m_hex->value >> 12) & 0x0f));
7389 value += (T)(0x80 | ((m_hex->value >> 6) & 0x3f));
7390 value += (T)(0x80 | (m_hex->value & 0x3f));
7392 else if (m_hex->value > 0x7f) {
7393 value += (T)(0xc0 | ((m_hex->value >> 6) & 0x1f));
7394 value += (T)(0x80 | (m_hex->value & 0x3f));
7397 value += (T)(m_hex->value & 0x7f);
7400 value += (T)m_hex->value;
7404 if (m_escape->match(
text, m_escape->interval.end, end,
flags)) {
7405 value +=
'\\'; this->
interval.
end = m_escape->interval.end;
7410 value.Prilepi(
text + m_chr->interval.start, m_chr->interval.size());
7422 virtual void invalidate()
7429 std::basic_string<T> value;
7432 std::shared_ptr<basic_parser<T>> m_quote;
7433 std::shared_ptr<basic_parser<T>> m_chr;
7434 std::shared_ptr<basic_parser<T>> m_escape;
7435 std::shared_ptr<basic_parser<T>> m_sol;
7436 std::shared_ptr<basic_parser<T>> m_bs;
7437 std::shared_ptr<basic_parser<T>> m_ff;
7438 std::shared_ptr<basic_parser<T>> m_lf;
7439 std::shared_ptr<basic_parser<T>> m_cr;
7440 std::shared_ptr<basic_parser<T>> m_htab;
7441 std::shared_ptr<basic_parser<T>> m_uni;
7442 std::shared_ptr<basic_integer16<T>> m_hex;
7455#undef ENUM_FLAG_OPERATOR
Test for angle in d°mm'ss.dddd form.
Definition parser.hpp:4399
Test for any code unit.
Definition parser.hpp:225
Test for beginning of line.
Definition parser.hpp:619
Test for any.
Definition parser.hpp:1061
Test for Creditor Reference.
Definition parser.hpp:4969
T reference[22]
Normalized national reference number.
Definition parser.hpp:5098
T check_digits[3]
Two check digits.
Definition parser.hpp:5097
bool is_valid
Is reference valid per ISO 7064.
Definition parser.hpp:5099
Test for any code unit from a given string of code units.
Definition parser.hpp:724
Test for specific code unit.
Definition parser.hpp:295
Test for date.
Definition parser.hpp:4029
Test for valid DNS domain character.
Definition parser.hpp:2810
bool allow_on_edge
Is character allowed at the beginning or an end of a DNS domain?
Definition parser.hpp:2848
Test for DNS domain/hostname.
Definition parser.hpp:2910
bool m_allow_absolute
May DNS names end with a dot (absolute name)?
Definition parser.hpp:2974
Test for e-mail address.
Definition parser.hpp:3798
Test for emoticon.
Definition parser.hpp:3906
std::shared_ptr< basic_parser< T > > apex
apex/eyebrows/halo (e.g. O, 0)
Definition parser.hpp:3995
std::shared_ptr< basic_parser< T > > eyes
eyes (e.g. :, ;, >, |, B)
Definition parser.hpp:3996
std::shared_ptr< basic_set< T > > mouth
mouth (e.g. ), ), (, (, |, P, D, p, d)
Definition parser.hpp:3998
std::shared_ptr< basic_parser< T > > nose
nose (e.g. -, o)
Definition parser.hpp:3997
std::shared_ptr< basic_parser< T > > emoticon
emoticon as a whole (e.g. 😀, 🤔, 😶)
Definition parser.hpp:3994
Test for end of line.
Definition parser.hpp:657
Test for fraction.
Definition parser.hpp:1690
Test for International Bank Account Number.
Definition parser.hpp:4675
T bban[31]
Normalized Basic Bank Account Number.
Definition parser.hpp:4946
T country[3]
ISO 3166-1 alpha-2 country code.
Definition parser.hpp:4944
T check_digits[3]
Two check digits.
Definition parser.hpp:4945
bool is_valid
Is IBAN valid per ISO 7064.
Definition parser.hpp:4947
Test for decimal integer.
Definition parser.hpp:1299
Test for decimal integer possibly containing thousand separators.
Definition parser.hpp:1384
bool has_separators
Did integer have any separators?
Definition parser.hpp:1444
size_t digit_count
Total number of digits in integer.
Definition parser.hpp:1443
Test for hexadecimal integer.
Definition parser.hpp:1465
Base class for integer testing.
Definition parser.hpp:1277
size_t value
Calculated value of the numeral.
Definition parser.hpp:1291
Test for IPv4 address.
Definition parser.hpp:2350
stdex::interval< size_t > components[4]
Individual component intervals.
Definition parser.hpp:2465
struct in_addr value
IPv4 address value.
Definition parser.hpp:2466
Test for IPv6 address.
Definition parser.hpp:2569
std::shared_ptr< basic_parser< T > > scope_id
Scope ID (e.g. NIC index with link-local addresses)
Definition parser.hpp:2773
stdex::interval< size_t > components[8]
Individual component intervals.
Definition parser.hpp:2771
struct in6_addr value
IPv6 address value.
Definition parser.hpp:2772
Test for valid IPv6 address scope ID character.
Definition parser.hpp:2497
Test for repeating.
Definition parser.hpp:914
bool m_greedy
try to match as long sequence as possible
Definition parser.hpp:953
std::shared_ptr< basic_parser< T > > m_el
repeating element
Definition parser.hpp:950
size_t m_min_iterations
minimum number of iterations
Definition parser.hpp:951
size_t m_max_iterations
maximum number of iterations
Definition parser.hpp:952
Test for JSON string.
Definition parser.hpp:7305
Test for mixed numeral.
Definition parser.hpp:1926
std::shared_ptr< basic_parser< T > > fraction
fraction
Definition parser.hpp:2032
std::shared_ptr< basic_parser< T > > special_sign
Special sign (e.g. plus-minus '±')
Definition parser.hpp:2030
std::shared_ptr< basic_parser< T > > negative_sign
Negative sign.
Definition parser.hpp:2029
std::shared_ptr< basic_parser< T > > positive_sign
Positive sign.
Definition parser.hpp:2028
std::shared_ptr< basic_parser< T > > integer
Integer part.
Definition parser.hpp:2031
Test for monetary numeral.
Definition parser.hpp:2221
std::shared_ptr< basic_parser< T > > positive_sign
Positive sign.
Definition parser.hpp:2327
std::shared_ptr< basic_parser< T > > decimal_separator
Decimal separator.
Definition parser.hpp:2332
std::shared_ptr< basic_parser< T > > currency
Currency part.
Definition parser.hpp:2330
std::shared_ptr< basic_parser< T > > decimal
Decimal part.
Definition parser.hpp:2333
std::shared_ptr< basic_parser< T > > integer
Integer part.
Definition parser.hpp:2331
std::shared_ptr< basic_parser< T > > negative_sign
Negative sign.
Definition parser.hpp:2328
std::shared_ptr< basic_parser< T > > special_sign
Special sign (e.g. plus-minus '±')
Definition parser.hpp:2329
"No-op" match
Definition parser.hpp:193
Base template for all parsers.
Definition parser.hpp:74
stdex::interval< size_t > interval
Region of the last match.
Definition parser.hpp:173
Test for permutation.
Definition parser.hpp:1201
Test for phone number.
Definition parser.hpp:4522
std::basic_string< T > value
Normalized phone number.
Definition parser.hpp:4648
Test for any punctuation code unit.
Definition parser.hpp:467
Test for Roman numeral.
Definition parser.hpp:1574
Test for scientific numeral.
Definition parser.hpp:2052
std::shared_ptr< basic_parser< T > > special_sign
Special sign (e.g. plus-minus '±')
Definition parser.hpp:2196
std::shared_ptr< basic_parser< T > > exponent_symbol
Exponent symbol (e.g. 'e')
Definition parser.hpp:2200
std::shared_ptr< basic_parser< T > > positive_sign
Positive sign.
Definition parser.hpp:2194
std::shared_ptr< basic_parser< T > > negative_sign
Negative sign.
Definition parser.hpp:2195
double value
Calculated value of the numeral.
Definition parser.hpp:2204
std::shared_ptr< basic_parser< T > > negative_exp_sign
Negative exponent sign (e.g. '-')
Definition parser.hpp:2202
std::shared_ptr< basic_integer< T > > decimal
Decimal part.
Definition parser.hpp:2199
std::shared_ptr< basic_parser< T > > positive_exp_sign
Positive exponent sign (e.g. '+')
Definition parser.hpp:2201
std::shared_ptr< basic_integer< T > > exponent
Exponent part.
Definition parser.hpp:2203
std::shared_ptr< basic_parser< T > > decimal_separator
Decimal separator.
Definition parser.hpp:2198
std::shared_ptr< basic_integer< T > > integer
Integer part.
Definition parser.hpp:2197
Test for match score.
Definition parser.hpp:1753
Test for sequence.
Definition parser.hpp:1010
Definition parser.hpp:692
Test for SI Reference delimiter.
Definition parser.hpp:5166
Test for SI Reference part.
Definition parser.hpp:5121
Test for SI Reference.
Definition parser.hpp:5204
basic_si_reference_part< T > part3
Reference data part 3 (P3)
Definition parser.hpp:5521
basic_si_reference_part< T > part1
Reference data part 1 (P1)
Definition parser.hpp:5519
bool is_valid
Is reference valid.
Definition parser.hpp:5522
T model[3]
Reference model.
Definition parser.hpp:5518
basic_si_reference_part< T > part2
Reference data part 2 (P2)
Definition parser.hpp:5520
Test for signed numeral.
Definition parser.hpp:1840
std::shared_ptr< basic_parser< T > > special_sign
Special sign (e.g. plus-minus '±')
Definition parser.hpp:1908
std::shared_ptr< basic_parser< T > > negative_sign
Negative sign.
Definition parser.hpp:1907
std::shared_ptr< basic_parser< T > > positive_sign
Positive sign.
Definition parser.hpp:1906
std::shared_ptr< basic_parser< T > > number
Number.
Definition parser.hpp:1909
Test for any space code unit.
Definition parser.hpp:388
Test for any space or punctuation code unit.
Definition parser.hpp:541
Test for any string.
Definition parser.hpp:1129
Test for given string.
Definition parser.hpp:819
Test for time.
Definition parser.hpp:4296
Test for valid URL password character.
Definition parser.hpp:3092
Test for valid URL path character.
Definition parser.hpp:3192
Test for URL path.
Definition parser.hpp:3300
Test for valid URL username character.
Definition parser.hpp:2993
Test for URL.
Definition parser.hpp:3441
Test for HTTP agent.
Definition parser.hpp:6828
Test for HTTP any type.
Definition parser.hpp:5950
Test for HTTP asterisk.
Definition parser.hpp:6592
Test for HTTP cookie parameter (RFC2109)
Definition parser.hpp:6687
Test for HTTP cookie (RFC2109)
Definition parser.hpp:6746
std::list< http_cookie_parameter > params
List of cookie parameters.
Definition parser.hpp:6818
http_token name
Cookie name.
Definition parser.hpp:6816
http_value value
Cookie value.
Definition parser.hpp:6817
Test for HTTP language (RFC1766)
Definition parser.hpp:6460
Test for HTTP line break (RFC2616: CRLF | LF)
Definition parser.hpp:5624
Test for HTTP parameter (RFC2616: parameter)
Definition parser.hpp:5895
http_token name
Parameter name.
Definition parser.hpp:5939
http_value value
Parameter value.
Definition parser.hpp:5940
Test for HTTP protocol.
Definition parser.hpp:6904
uint16_t version
HTTP protocol version: 0x100 = 1.0, 0x101 = 1.1...
Definition parser.hpp:7006
Test for HTTP quoted string (RFC2616: quoted-string)
Definition parser.hpp:5785
stdex::interval< size_t > content
String content (without quotes)
Definition parser.hpp:5841
Test for HTTP request.
Definition parser.hpp:7013
Test for HTTP space (RFC2616: LWS)
Definition parser.hpp:5660
Test for HTTP text character (RFC2616: TEXT)
Definition parser.hpp:5697
Test for HTTP token (RFC2616: token - tolerates non-ASCII)
Definition parser.hpp:5731
Test for HTTP URL parameter.
Definition parser.hpp:6277
Test for HTTP URL path segment.
Definition parser.hpp:6188
Test for HTTP URL path segment.
Definition parser.hpp:6221
std::vector< http_url_path_segment > segments
Path segments.
Definition parser.hpp:6270
Test for HTTP URL port.
Definition parser.hpp:6132
Test for HTTP URL server.
Definition parser.hpp:6095
Test for HTTP URL.
Definition parser.hpp:6358
Collection of HTTP values.
Definition parser.hpp:7261
Test for HTTP value (RFC2616: value)
Definition parser.hpp:5851
http_quoted_string string
Value when matched as quoted string.
Definition parser.hpp:5887
http_token token
Value when matched as token.
Definition parser.hpp:5888
Test for HTTP weight factor.
Definition parser.hpp:6523
float value
Calculated value of the weight factor.
Definition parser.hpp:6585
Test for HTTP weighted value.
Definition parser.hpp:6615
Base template for collection-holding parsers.
Definition parser.hpp:970
Test for any SGML code point.
Definition parser.hpp:257
Test for any SGML code point from a given string of SGML code points.
Definition parser.hpp:776
Test for specific SGML code point.
Definition parser.hpp:344
Test for valid DNS domain SGML character.
Definition parser.hpp:2866
Test for valid IPv6 address scope ID SGML character.
Definition parser.hpp:2535
Test for any SGML punctuation code point.
Definition parser.hpp:508
Test for any SGML space code point.
Definition parser.hpp:431
Test for any SGML space or punctuation code point.
Definition parser.hpp:584
Test for SGML given string.
Definition parser.hpp:866
Test for valid URL password SGML character.
Definition parser.hpp:3144
Test for valid URL path SGML character.
Definition parser.hpp:3248
Test for valid URL username SGML character.
Definition parser.hpp:3044
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:7287