diff --git a/_unit_tests_2compat_8hpp_source.html b/_unit_tests_2compat_8hpp_source.html index f5c71f156..84e76d1a7 100644 --- a/_unit_tests_2compat_8hpp_source.html +++ b/_unit_tests_2compat_8hpp_source.html @@ -162,7 +162,7 @@ $(document).ready(function() { init_codefold(0); }); diff --git a/annotated.html b/annotated.html index ac2d2986b..562521afa 100644 --- a/annotated.html +++ b/annotated.html @@ -219,7 +219,7 @@ $(function() { diff --git a/base64_8hpp_source.html b/base64_8hpp_source.html index c3e47b448..55686af60 100644 --- a/base64_8hpp_source.html +++ b/base64_8hpp_source.html @@ -346,7 +346,7 @@ $(document).ready(function() { init_codefold(0); }); diff --git a/chrono_8hpp_source.html b/chrono_8hpp_source.html index 8a30f0012..8a637f369 100644 --- a/chrono_8hpp_source.html +++ b/chrono_8hpp_source.html @@ -466,7 +466,7 @@ $(document).ready(function() { init_codefold(0); }); diff --git a/classes.html b/classes.html index 8cb101435..f2f54055c 100644 --- a/classes.html +++ b/classes.html @@ -133,7 +133,7 @@ $(function() { diff --git a/classstdex_1_1base64__dec-members.html b/classstdex_1_1base64__dec-members.html index 12ca0d7b4..46d7e1b89 100644 --- a/classstdex_1_1base64__dec-members.html +++ b/classstdex_1_1base64__dec-members.html @@ -90,7 +90,7 @@ $(function() { diff --git a/classstdex_1_1base64__dec.html b/classstdex_1_1base64__dec.html index 3443c4cee..f598132aa 100644 --- a/classstdex_1_1base64__dec.html +++ b/classstdex_1_1base64__dec.html @@ -230,7 +230,7 @@ template<class _Ty , class _Ax , class _Tchr > diff --git a/classstdex_1_1base64__enc-members.html b/classstdex_1_1base64__enc-members.html index db68f5131..2d09361cf 100644 --- a/classstdex_1_1base64__enc-members.html +++ b/classstdex_1_1base64__enc-members.html @@ -91,7 +91,7 @@ $(function() { diff --git a/classstdex_1_1base64__enc.html b/classstdex_1_1base64__enc.html index 20a9e80ca..7fedb3e71 100644 --- a/classstdex_1_1base64__enc.html +++ b/classstdex_1_1base64__enc.html @@ -235,7 +235,7 @@ template<class _Elem , class _Traits , class _Ax > diff --git a/classstdex_1_1charset__encoder-members.html b/classstdex_1_1charset__encoder-members.html index cfdf56163..41a88a260 100644 --- a/classstdex_1_1charset__encoder-members.html +++ b/classstdex_1_1charset__encoder-members.html @@ -97,7 +97,7 @@ $(function() { diff --git a/classstdex_1_1charset__encoder.html b/classstdex_1_1charset__encoder.html index 1198cd314..fde319fdd 100644 --- a/classstdex_1_1charset__encoder.html +++ b/classstdex_1_1charset__encoder.html @@ -588,7 +588,7 @@ template<class _Traits_to = std::char_traits<T_to>, class _Alloc_to = diff --git a/classstdex_1_1errno__error-members.html b/classstdex_1_1errno__error-members.html index 99cc1f467..8fadc3304 100644 --- a/classstdex_1_1errno__error-members.html +++ b/classstdex_1_1errno__error-members.html @@ -89,7 +89,7 @@ $(function() { diff --git a/classstdex_1_1errno__error.html b/classstdex_1_1errno__error.html index d909ab8fe..61e435835 100644 --- a/classstdex_1_1errno__error.html +++ b/classstdex_1_1errno__error.html @@ -286,7 +286,7 @@ errno_t m_num diff --git a/classstdex_1_1global__progress-members.html b/classstdex_1_1global__progress-members.html index 7c126312a..3d0673ae8 100644 --- a/classstdex_1_1global__progress-members.html +++ b/classstdex_1_1global__progress-members.html @@ -97,7 +97,7 @@ $(function() { diff --git a/classstdex_1_1global__progress.html b/classstdex_1_1global__progress.html index 119be9542..a0b54c446 100644 --- a/classstdex_1_1global__progress.html +++ b/classstdex_1_1global__progress.html @@ -547,7 +547,7 @@ template<class T > diff --git a/classstdex_1_1hex__dec-members.html b/classstdex_1_1hex__dec-members.html index 14d9dc5c2..8e50ea141 100644 --- a/classstdex_1_1hex__dec-members.html +++ b/classstdex_1_1hex__dec-members.html @@ -89,7 +89,7 @@ $(function() { diff --git a/classstdex_1_1hex__dec.html b/classstdex_1_1hex__dec.html index 4bf5aee12..3ed3fe72b 100644 --- a/classstdex_1_1hex__dec.html +++ b/classstdex_1_1hex__dec.html @@ -221,7 +221,7 @@ template<class _Ty , class _Ax , class _Tchr > diff --git a/classstdex_1_1hex__enc-members.html b/classstdex_1_1hex__enc-members.html index 7f492ccbb..9905e62f9 100644 --- a/classstdex_1_1hex__enc-members.html +++ b/classstdex_1_1hex__enc-members.html @@ -86,7 +86,7 @@ $(function() { diff --git a/classstdex_1_1hex__enc.html b/classstdex_1_1hex__enc.html index 413995494..33b64537e 100644 --- a/classstdex_1_1hex__enc.html +++ b/classstdex_1_1hex__enc.html @@ -198,7 +198,7 @@ template<class _Elem , class _Traits , class _Ax > diff --git a/classstdex_1_1idrec_1_1record-members.html b/classstdex_1_1idrec_1_1record-members.html index 4e19950d8..49a698a91 100644 --- a/classstdex_1_1idrec_1_1record-members.html +++ b/classstdex_1_1idrec_1_1record-members.html @@ -94,7 +94,7 @@ $(function() { diff --git a/classstdex_1_1idrec_1_1record.html b/classstdex_1_1idrec_1_1record.html index b69cf8192..6cfabfa97 100644 --- a/classstdex_1_1idrec_1_1record.html +++ b/classstdex_1_1idrec_1_1record.html @@ -526,7 +526,7 @@ template<class T , class T_ID , const T_ID ID, class T_SIZE , unsigned int AL diff --git a/classstdex_1_1lazy__progress-members.html b/classstdex_1_1lazy__progress-members.html index adb8547ad..be9003427 100644 --- a/classstdex_1_1lazy__progress-members.html +++ b/classstdex_1_1lazy__progress-members.html @@ -95,7 +95,7 @@ $(function() { diff --git a/classstdex_1_1lazy__progress.html b/classstdex_1_1lazy__progress.html index 9a6503d4d..161d5043c 100644 --- a/classstdex_1_1lazy__progress.html +++ b/classstdex_1_1lazy__progress.html @@ -279,7 +279,7 @@ template<class T > diff --git a/classstdex_1_1parser_1_1basic__angle-members.html b/classstdex_1_1parser_1_1basic__angle-members.html index aaee7ee92..a802f2e59 100644 --- a/classstdex_1_1parser_1_1basic__angle-members.html +++ b/classstdex_1_1parser_1_1basic__angle-members.html @@ -99,7 +99,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__angle.html b/classstdex_1_1parser_1_1basic__angle.html index b4a2a32a2..04dbba2d0 100644 --- a/classstdex_1_1parser_1_1basic__angle.html +++ b/classstdex_1_1parser_1_1basic__angle.html @@ -244,7 +244,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__any__cu-members.html b/classstdex_1_1parser_1_1basic__any__cu-members.html index 773651cf2..7212e63d1 100644 --- a/classstdex_1_1parser_1_1basic__any__cu-members.html +++ b/classstdex_1_1parser_1_1basic__any__cu-members.html @@ -92,7 +92,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__any__cu.html b/classstdex_1_1parser_1_1basic__any__cu.html index 7e96a5f7d..cae543962 100644 --- a/classstdex_1_1parser_1_1basic__any__cu.html +++ b/classstdex_1_1parser_1_1basic__any__cu.html @@ -191,7 +191,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__bol-members.html b/classstdex_1_1parser_1_1basic__bol-members.html index 884684b6f..d319adba2 100644 --- a/classstdex_1_1parser_1_1basic__bol-members.html +++ b/classstdex_1_1parser_1_1basic__bol-members.html @@ -93,7 +93,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__bol.html b/classstdex_1_1parser_1_1basic__bol.html index 6aee41d88..8539bc791 100644 --- a/classstdex_1_1parser_1_1basic__bol.html +++ b/classstdex_1_1parser_1_1basic__bol.html @@ -198,7 +198,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__branch-members.html b/classstdex_1_1parser_1_1basic__branch-members.html index 82d792f32..047be896c 100644 --- a/classstdex_1_1parser_1_1basic__branch-members.html +++ b/classstdex_1_1parser_1_1basic__branch-members.html @@ -99,7 +99,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__branch.html b/classstdex_1_1parser_1_1basic__branch.html index d0b8b4046..db4895c76 100644 --- a/classstdex_1_1parser_1_1basic__branch.html +++ b/classstdex_1_1parser_1_1basic__branch.html @@ -253,7 +253,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__chemical__formula-members.html b/classstdex_1_1parser_1_1basic__chemical__formula-members.html index 76ad25767..4bed72850 100644 --- a/classstdex_1_1parser_1_1basic__chemical__formula-members.html +++ b/classstdex_1_1parser_1_1basic__chemical__formula-members.html @@ -97,7 +97,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__chemical__formula.html b/classstdex_1_1parser_1_1basic__chemical__formula.html index 14779fa20..2892d7a5c 100644 --- a/classstdex_1_1parser_1_1basic__chemical__formula.html +++ b/classstdex_1_1parser_1_1basic__chemical__formula.html @@ -239,7 +239,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__cu-members.html b/classstdex_1_1parser_1_1basic__cu-members.html index 960ec6dc6..61e997758 100644 --- a/classstdex_1_1parser_1_1basic__cu-members.html +++ b/classstdex_1_1parser_1_1basic__cu-members.html @@ -94,7 +94,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__cu.html b/classstdex_1_1parser_1_1basic__cu.html index 1a6923356..f60f83234 100644 --- a/classstdex_1_1parser_1_1basic__cu.html +++ b/classstdex_1_1parser_1_1basic__cu.html @@ -201,7 +201,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__cu__set-members.html b/classstdex_1_1parser_1_1basic__cu__set-members.html index 8ab96b482..797db3fa9 100644 --- a/classstdex_1_1parser_1_1basic__cu__set-members.html +++ b/classstdex_1_1parser_1_1basic__cu__set-members.html @@ -96,7 +96,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__cu__set.html b/classstdex_1_1parser_1_1basic__cu__set.html index f47720f08..58c3f2d40 100644 --- a/classstdex_1_1parser_1_1basic__cu__set.html +++ b/classstdex_1_1parser_1_1basic__cu__set.html @@ -210,7 +210,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__date-members.html b/classstdex_1_1parser_1_1basic__date-members.html index b0964370d..fb98c3a59 100644 --- a/classstdex_1_1parser_1_1basic__date-members.html +++ b/classstdex_1_1parser_1_1basic__date-members.html @@ -100,7 +100,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__date.html b/classstdex_1_1parser_1_1basic__date.html index a897806a1..1299cf30f 100644 --- a/classstdex_1_1parser_1_1basic__date.html +++ b/classstdex_1_1parser_1_1basic__date.html @@ -252,7 +252,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__dns__domain__char-members.html b/classstdex_1_1parser_1_1basic__dns__domain__char-members.html index 5e1697768..a36a0a8e7 100644 --- a/classstdex_1_1parser_1_1basic__dns__domain__char-members.html +++ b/classstdex_1_1parser_1_1basic__dns__domain__char-members.html @@ -94,7 +94,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__dns__domain__char.html b/classstdex_1_1parser_1_1basic__dns__domain__char.html index f4006b362..204457059 100644 --- a/classstdex_1_1parser_1_1basic__dns__domain__char.html +++ b/classstdex_1_1parser_1_1basic__dns__domain__char.html @@ -203,7 +203,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__dns__name-members.html b/classstdex_1_1parser_1_1basic__dns__name-members.html index 4f4c55524..8fc042022 100644 --- a/classstdex_1_1parser_1_1basic__dns__name-members.html +++ b/classstdex_1_1parser_1_1basic__dns__name-members.html @@ -95,7 +95,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__dns__name.html b/classstdex_1_1parser_1_1basic__dns__name.html index fb2fc85ee..83d084bdd 100644 --- a/classstdex_1_1parser_1_1basic__dns__name.html +++ b/classstdex_1_1parser_1_1basic__dns__name.html @@ -205,7 +205,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__email__address-members.html b/classstdex_1_1parser_1_1basic__email__address-members.html index 6a7a065d2..3a6df7026 100644 --- a/classstdex_1_1parser_1_1basic__email__address-members.html +++ b/classstdex_1_1parser_1_1basic__email__address-members.html @@ -99,7 +99,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__email__address.html b/classstdex_1_1parser_1_1basic__email__address.html index 3d9629038..f35669883 100644 --- a/classstdex_1_1parser_1_1basic__email__address.html +++ b/classstdex_1_1parser_1_1basic__email__address.html @@ -245,7 +245,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__emoticon-members.html b/classstdex_1_1parser_1_1basic__emoticon-members.html index ffb505d84..b83409541 100644 --- a/classstdex_1_1parser_1_1basic__emoticon-members.html +++ b/classstdex_1_1parser_1_1basic__emoticon-members.html @@ -97,7 +97,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__emoticon.html b/classstdex_1_1parser_1_1basic__emoticon.html index ac9e2327c..4532b9e10 100644 --- a/classstdex_1_1parser_1_1basic__emoticon.html +++ b/classstdex_1_1parser_1_1basic__emoticon.html @@ -243,7 +243,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__eol-members.html b/classstdex_1_1parser_1_1basic__eol-members.html index 2cf511d7b..0db3806f6 100644 --- a/classstdex_1_1parser_1_1basic__eol-members.html +++ b/classstdex_1_1parser_1_1basic__eol-members.html @@ -93,7 +93,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__eol.html b/classstdex_1_1parser_1_1basic__eol.html index 836ee9e95..9a1f1c575 100644 --- a/classstdex_1_1parser_1_1basic__eol.html +++ b/classstdex_1_1parser_1_1basic__eol.html @@ -198,7 +198,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__fraction-members.html b/classstdex_1_1parser_1_1basic__fraction-members.html index 0f8cc52fb..d4f1ef910 100644 --- a/classstdex_1_1parser_1_1basic__fraction-members.html +++ b/classstdex_1_1parser_1_1basic__fraction-members.html @@ -95,7 +95,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__fraction.html b/classstdex_1_1parser_1_1basic__fraction.html index 1eb428592..8db1eb64f 100644 --- a/classstdex_1_1parser_1_1basic__fraction.html +++ b/classstdex_1_1parser_1_1basic__fraction.html @@ -232,7 +232,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__integer-members.html b/classstdex_1_1parser_1_1basic__integer-members.html index 06bb7315b..706e7b6da 100644 --- a/classstdex_1_1parser_1_1basic__integer-members.html +++ b/classstdex_1_1parser_1_1basic__integer-members.html @@ -93,7 +93,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__integer.html b/classstdex_1_1parser_1_1basic__integer.html index e3164ea83..67441b6cd 100644 --- a/classstdex_1_1parser_1_1basic__integer.html +++ b/classstdex_1_1parser_1_1basic__integer.html @@ -180,7 +180,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__integer10-members.html b/classstdex_1_1parser_1_1basic__integer10-members.html index d99e74b17..f19d90a2f 100644 --- a/classstdex_1_1parser_1_1basic__integer10-members.html +++ b/classstdex_1_1parser_1_1basic__integer10-members.html @@ -104,7 +104,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__integer10.html b/classstdex_1_1parser_1_1basic__integer10.html index ec6addbc4..85e3662b1 100644 --- a/classstdex_1_1parser_1_1basic__integer10.html +++ b/classstdex_1_1parser_1_1basic__integer10.html @@ -234,7 +234,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__integer10ts-members.html b/classstdex_1_1parser_1_1basic__integer10ts-members.html index 274883ddc..b56c2ee7d 100644 --- a/classstdex_1_1parser_1_1basic__integer10ts-members.html +++ b/classstdex_1_1parser_1_1basic__integer10ts-members.html @@ -98,7 +98,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__integer10ts.html b/classstdex_1_1parser_1_1basic__integer10ts.html index e05fc5d98..2a70d6b9c 100644 --- a/classstdex_1_1parser_1_1basic__integer10ts.html +++ b/classstdex_1_1parser_1_1basic__integer10ts.html @@ -248,7 +248,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__integer16-members.html b/classstdex_1_1parser_1_1basic__integer16-members.html index 0d69237db..48ac8d37b 100644 --- a/classstdex_1_1parser_1_1basic__integer16-members.html +++ b/classstdex_1_1parser_1_1basic__integer16-members.html @@ -110,7 +110,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__integer16.html b/classstdex_1_1parser_1_1basic__integer16.html index 8980b797f..afa2d33a4 100644 --- a/classstdex_1_1parser_1_1basic__integer16.html +++ b/classstdex_1_1parser_1_1basic__integer16.html @@ -252,7 +252,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__ipv4__address-members.html b/classstdex_1_1parser_1_1basic__ipv4__address-members.html index 5ac1f6f4c..87c792d13 100644 --- a/classstdex_1_1parser_1_1basic__ipv4__address-members.html +++ b/classstdex_1_1parser_1_1basic__ipv4__address-members.html @@ -105,7 +105,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__ipv4__address.html b/classstdex_1_1parser_1_1basic__ipv4__address.html index 024d1d02a..7231aedac 100644 --- a/classstdex_1_1parser_1_1basic__ipv4__address.html +++ b/classstdex_1_1parser_1_1basic__ipv4__address.html @@ -265,7 +265,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__ipv6__address-members.html b/classstdex_1_1parser_1_1basic__ipv6__address-members.html index 6abcb152d..407287f2a 100644 --- a/classstdex_1_1parser_1_1basic__ipv6__address-members.html +++ b/classstdex_1_1parser_1_1basic__ipv6__address-members.html @@ -113,7 +113,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__ipv6__address.html b/classstdex_1_1parser_1_1basic__ipv6__address.html index bad668621..602fb917c 100644 --- a/classstdex_1_1parser_1_1basic__ipv6__address.html +++ b/classstdex_1_1parser_1_1basic__ipv6__address.html @@ -290,7 +290,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__ipv6__scope__id__char-members.html b/classstdex_1_1parser_1_1basic__ipv6__scope__id__char-members.html index dde62043a..e707b66b8 100644 --- a/classstdex_1_1parser_1_1basic__ipv6__scope__id__char-members.html +++ b/classstdex_1_1parser_1_1basic__ipv6__scope__id__char-members.html @@ -92,7 +92,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__ipv6__scope__id__char.html b/classstdex_1_1parser_1_1basic__ipv6__scope__id__char.html index 58955b557..43a245397 100644 --- a/classstdex_1_1parser_1_1basic__ipv6__scope__id__char.html +++ b/classstdex_1_1parser_1_1basic__ipv6__scope__id__char.html @@ -191,7 +191,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__iterations-members.html b/classstdex_1_1parser_1_1basic__iterations-members.html index 80bc58b73..033eaa919 100644 --- a/classstdex_1_1parser_1_1basic__iterations-members.html +++ b/classstdex_1_1parser_1_1basic__iterations-members.html @@ -96,7 +96,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__iterations.html b/classstdex_1_1parser_1_1basic__iterations.html index b18c4e822..a7770b323 100644 --- a/classstdex_1_1parser_1_1basic__iterations.html +++ b/classstdex_1_1parser_1_1basic__iterations.html @@ -211,7 +211,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__json__string-members.html b/classstdex_1_1parser_1_1basic__json__string-members.html index f56072fc6..4ccefb126 100644 --- a/classstdex_1_1parser_1_1basic__json__string-members.html +++ b/classstdex_1_1parser_1_1basic__json__string-members.html @@ -104,7 +104,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__json__string.html b/classstdex_1_1parser_1_1basic__json__string.html index 739eee562..c818a33f5 100644 --- a/classstdex_1_1parser_1_1basic__json__string.html +++ b/classstdex_1_1parser_1_1basic__json__string.html @@ -260,7 +260,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__mixed__numeral-members.html b/classstdex_1_1parser_1_1basic__mixed__numeral-members.html index 0b3ae26f5..25192e6a5 100644 --- a/classstdex_1_1parser_1_1basic__mixed__numeral-members.html +++ b/classstdex_1_1parser_1_1basic__mixed__numeral-members.html @@ -98,7 +98,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__mixed__numeral.html b/classstdex_1_1parser_1_1basic__mixed__numeral.html index 3b4ed5076..bf2ca901c 100644 --- a/classstdex_1_1parser_1_1basic__mixed__numeral.html +++ b/classstdex_1_1parser_1_1basic__mixed__numeral.html @@ -247,7 +247,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__monetary__numeral-members.html b/classstdex_1_1parser_1_1basic__monetary__numeral-members.html index e364195ff..4d7ba3762 100644 --- a/classstdex_1_1parser_1_1basic__monetary__numeral-members.html +++ b/classstdex_1_1parser_1_1basic__monetary__numeral-members.html @@ -99,7 +99,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__monetary__numeral.html b/classstdex_1_1parser_1_1basic__monetary__numeral.html index bb614fcad..39a51aa18 100644 --- a/classstdex_1_1parser_1_1basic__monetary__numeral.html +++ b/classstdex_1_1parser_1_1basic__monetary__numeral.html @@ -251,7 +251,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__noop-members.html b/classstdex_1_1parser_1_1basic__noop-members.html index e1edf2e45..389bb9166 100644 --- a/classstdex_1_1parser_1_1basic__noop-members.html +++ b/classstdex_1_1parser_1_1basic__noop-members.html @@ -91,7 +91,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__noop.html b/classstdex_1_1parser_1_1basic__noop.html index 5e433966d..bb7cf1662 100644 --- a/classstdex_1_1parser_1_1basic__noop.html +++ b/classstdex_1_1parser_1_1basic__noop.html @@ -188,7 +188,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__parser-members.html b/classstdex_1_1parser_1_1basic__parser-members.html index 350e54ba5..f64bbf5c5 100644 --- a/classstdex_1_1parser_1_1basic__parser-members.html +++ b/classstdex_1_1parser_1_1basic__parser-members.html @@ -91,7 +91,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__parser.html b/classstdex_1_1parser_1_1basic__parser.html index e8d6f9e70..c2663bf65 100644 --- a/classstdex_1_1parser_1_1basic__parser.html +++ b/classstdex_1_1parser_1_1basic__parser.html @@ -183,7 +183,7 @@ class stdex::parser::basic_parser< T >

Base template for all parse

diff --git a/classstdex_1_1parser_1_1basic__permutation-members.html b/classstdex_1_1parser_1_1basic__permutation-members.html index 04188042a..e95d59558 100644 --- a/classstdex_1_1parser_1_1basic__permutation-members.html +++ b/classstdex_1_1parser_1_1basic__permutation-members.html @@ -98,7 +98,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__permutation.html b/classstdex_1_1parser_1_1basic__permutation.html index f8c0e95e0..bade12ec7 100644 --- a/classstdex_1_1parser_1_1basic__permutation.html +++ b/classstdex_1_1parser_1_1basic__permutation.html @@ -216,7 +216,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__phone__number-members.html b/classstdex_1_1parser_1_1basic__phone__number-members.html index ba35ac7ee..3df287f23 100644 --- a/classstdex_1_1parser_1_1basic__phone__number-members.html +++ b/classstdex_1_1parser_1_1basic__phone__number-members.html @@ -99,7 +99,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__phone__number.html b/classstdex_1_1parser_1_1basic__phone__number.html index 91b18328f..644eb3f7e 100644 --- a/classstdex_1_1parser_1_1basic__phone__number.html +++ b/classstdex_1_1parser_1_1basic__phone__number.html @@ -246,7 +246,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__punct__cu-members.html b/classstdex_1_1parser_1_1basic__punct__cu-members.html index 58b787044..9967db1ef 100644 --- a/classstdex_1_1parser_1_1basic__punct__cu-members.html +++ b/classstdex_1_1parser_1_1basic__punct__cu-members.html @@ -93,7 +93,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__punct__cu.html b/classstdex_1_1parser_1_1basic__punct__cu.html index 2d9a13fb5..442007ae3 100644 --- a/classstdex_1_1parser_1_1basic__punct__cu.html +++ b/classstdex_1_1parser_1_1basic__punct__cu.html @@ -198,7 +198,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__roman__numeral-members.html b/classstdex_1_1parser_1_1basic__roman__numeral-members.html index d9219c5a8..ed495ee94 100644 --- a/classstdex_1_1parser_1_1basic__roman__numeral-members.html +++ b/classstdex_1_1parser_1_1basic__roman__numeral-members.html @@ -103,7 +103,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__roman__numeral.html b/classstdex_1_1parser_1_1basic__roman__numeral.html index 7f9e9f597..56c59217b 100644 --- a/classstdex_1_1parser_1_1basic__roman__numeral.html +++ b/classstdex_1_1parser_1_1basic__roman__numeral.html @@ -231,7 +231,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__scientific__numeral-members.html b/classstdex_1_1parser_1_1basic__scientific__numeral-members.html index 70d7a40d1..27f6a41f7 100644 --- a/classstdex_1_1parser_1_1basic__scientific__numeral-members.html +++ b/classstdex_1_1parser_1_1basic__scientific__numeral-members.html @@ -103,7 +103,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__scientific__numeral.html b/classstdex_1_1parser_1_1basic__scientific__numeral.html index 83c68ef08..28cac2e91 100644 --- a/classstdex_1_1parser_1_1basic__scientific__numeral.html +++ b/classstdex_1_1parser_1_1basic__scientific__numeral.html @@ -267,7 +267,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__score-members.html b/classstdex_1_1parser_1_1basic__score-members.html index 51710d08c..ad044959f 100644 --- a/classstdex_1_1parser_1_1basic__score-members.html +++ b/classstdex_1_1parser_1_1basic__score-members.html @@ -96,7 +96,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__score.html b/classstdex_1_1parser_1_1basic__score.html index e1b367048..c32fbc475 100644 --- a/classstdex_1_1parser_1_1basic__score.html +++ b/classstdex_1_1parser_1_1basic__score.html @@ -236,7 +236,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__sequence-members.html b/classstdex_1_1parser_1_1basic__sequence-members.html index e19c3a724..244bf42b8 100644 --- a/classstdex_1_1parser_1_1basic__sequence-members.html +++ b/classstdex_1_1parser_1_1basic__sequence-members.html @@ -97,7 +97,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__sequence.html b/classstdex_1_1parser_1_1basic__sequence.html index 74d9e91c3..03ec0e887 100644 --- a/classstdex_1_1parser_1_1basic__sequence.html +++ b/classstdex_1_1parser_1_1basic__sequence.html @@ -209,7 +209,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__set-members.html b/classstdex_1_1parser_1_1basic__set-members.html index 3e9840ba9..cd4fb8180 100644 --- a/classstdex_1_1parser_1_1basic__set-members.html +++ b/classstdex_1_1parser_1_1basic__set-members.html @@ -94,7 +94,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__set.html b/classstdex_1_1parser_1_1basic__set.html index fcb37bdaf..f3eee21a8 100644 --- a/classstdex_1_1parser_1_1basic__set.html +++ b/classstdex_1_1parser_1_1basic__set.html @@ -223,7 +223,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__signed__numeral-members.html b/classstdex_1_1parser_1_1basic__signed__numeral-members.html index 04e50a133..3517b5e10 100644 --- a/classstdex_1_1parser_1_1basic__signed__numeral-members.html +++ b/classstdex_1_1parser_1_1basic__signed__numeral-members.html @@ -96,7 +96,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__signed__numeral.html b/classstdex_1_1parser_1_1basic__signed__numeral.html index d6651d973..b64c05deb 100644 --- a/classstdex_1_1parser_1_1basic__signed__numeral.html +++ b/classstdex_1_1parser_1_1basic__signed__numeral.html @@ -239,7 +239,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__space__cu-members.html b/classstdex_1_1parser_1_1basic__space__cu-members.html index f3e521eb7..d367e41da 100644 --- a/classstdex_1_1parser_1_1basic__space__cu-members.html +++ b/classstdex_1_1parser_1_1basic__space__cu-members.html @@ -93,7 +93,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__space__cu.html b/classstdex_1_1parser_1_1basic__space__cu.html index f08ac49ee..afe682da5 100644 --- a/classstdex_1_1parser_1_1basic__space__cu.html +++ b/classstdex_1_1parser_1_1basic__space__cu.html @@ -198,7 +198,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__space__or__punct__cu-members.html b/classstdex_1_1parser_1_1basic__space__or__punct__cu-members.html index ebaa2e97a..bd084d902 100644 --- a/classstdex_1_1parser_1_1basic__space__or__punct__cu-members.html +++ b/classstdex_1_1parser_1_1basic__space__or__punct__cu-members.html @@ -93,7 +93,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__space__or__punct__cu.html b/classstdex_1_1parser_1_1basic__space__or__punct__cu.html index 3056748d2..e4d49565e 100644 --- a/classstdex_1_1parser_1_1basic__space__or__punct__cu.html +++ b/classstdex_1_1parser_1_1basic__space__or__punct__cu.html @@ -198,7 +198,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__string-members.html b/classstdex_1_1parser_1_1basic__string-members.html index e4d8ca4f8..5d8af5c78 100644 --- a/classstdex_1_1parser_1_1basic__string-members.html +++ b/classstdex_1_1parser_1_1basic__string-members.html @@ -93,7 +93,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__string.html b/classstdex_1_1parser_1_1basic__string.html index f494b10fa..0b9ef2418 100644 --- a/classstdex_1_1parser_1_1basic__string.html +++ b/classstdex_1_1parser_1_1basic__string.html @@ -198,7 +198,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__string__branch-members.html b/classstdex_1_1parser_1_1basic__string__branch-members.html index 245a63058..703f1193b 100644 --- a/classstdex_1_1parser_1_1basic__string__branch-members.html +++ b/classstdex_1_1parser_1_1basic__string__branch-members.html @@ -104,7 +104,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__string__branch.html b/classstdex_1_1parser_1_1basic__string__branch.html index 0eba9e12e..6eee90436 100644 --- a/classstdex_1_1parser_1_1basic__string__branch.html +++ b/classstdex_1_1parser_1_1basic__string__branch.html @@ -185,7 +185,7 @@ class stdex::parser::basic_string_branch< T, T_parser >

Test for a

diff --git a/classstdex_1_1parser_1_1basic__time-members.html b/classstdex_1_1parser_1_1basic__time-members.html index 8bbf9b884..1210aad32 100644 --- a/classstdex_1_1parser_1_1basic__time-members.html +++ b/classstdex_1_1parser_1_1basic__time-members.html @@ -98,7 +98,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__time.html b/classstdex_1_1parser_1_1basic__time.html index 8adcbecd6..286b65ff4 100644 --- a/classstdex_1_1parser_1_1basic__time.html +++ b/classstdex_1_1parser_1_1basic__time.html @@ -242,7 +242,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__url-members.html b/classstdex_1_1parser_1_1basic__url-members.html index 730c48ea5..faed7fba2 100644 --- a/classstdex_1_1parser_1_1basic__url-members.html +++ b/classstdex_1_1parser_1_1basic__url-members.html @@ -108,7 +108,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__url.html b/classstdex_1_1parser_1_1basic__url.html index 611dba8f0..d2d7ee0d7 100644 --- a/classstdex_1_1parser_1_1basic__url.html +++ b/classstdex_1_1parser_1_1basic__url.html @@ -272,7 +272,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__url__password__char-members.html b/classstdex_1_1parser_1_1basic__url__password__char-members.html index 0d1899e27..f3adba979 100644 --- a/classstdex_1_1parser_1_1basic__url__password__char-members.html +++ b/classstdex_1_1parser_1_1basic__url__password__char-members.html @@ -92,7 +92,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__url__password__char.html b/classstdex_1_1parser_1_1basic__url__password__char.html index 15860f55b..bf420cc58 100644 --- a/classstdex_1_1parser_1_1basic__url__password__char.html +++ b/classstdex_1_1parser_1_1basic__url__password__char.html @@ -191,7 +191,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__url__path-members.html b/classstdex_1_1parser_1_1basic__url__path-members.html index c61656ec2..54aea3f45 100644 --- a/classstdex_1_1parser_1_1basic__url__path-members.html +++ b/classstdex_1_1parser_1_1basic__url__path-members.html @@ -98,7 +98,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__url__path.html b/classstdex_1_1parser_1_1basic__url__path.html index d87c1b2bf..7d82439b1 100644 --- a/classstdex_1_1parser_1_1basic__url__path.html +++ b/classstdex_1_1parser_1_1basic__url__path.html @@ -242,7 +242,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__url__path__char-members.html b/classstdex_1_1parser_1_1basic__url__path__char-members.html index 5a984b4ce..f9226f517 100644 --- a/classstdex_1_1parser_1_1basic__url__path__char-members.html +++ b/classstdex_1_1parser_1_1basic__url__path__char-members.html @@ -92,7 +92,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__url__path__char.html b/classstdex_1_1parser_1_1basic__url__path__char.html index a8e3d11cb..ed01c564b 100644 --- a/classstdex_1_1parser_1_1basic__url__path__char.html +++ b/classstdex_1_1parser_1_1basic__url__path__char.html @@ -191,7 +191,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__url__username__char-members.html b/classstdex_1_1parser_1_1basic__url__username__char-members.html index f065a59f7..9684d3263 100644 --- a/classstdex_1_1parser_1_1basic__url__username__char-members.html +++ b/classstdex_1_1parser_1_1basic__url__username__char-members.html @@ -92,7 +92,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__url__username__char.html b/classstdex_1_1parser_1_1basic__url__username__char.html index e485eb241..659e3bc88 100644 --- a/classstdex_1_1parser_1_1basic__url__username__char.html +++ b/classstdex_1_1parser_1_1basic__url__username__char.html @@ -191,7 +191,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1http__agent-members.html b/classstdex_1_1parser_1_1http__agent-members.html index 7d572d67b..9a41a2e3d 100644 --- a/classstdex_1_1parser_1_1http__agent-members.html +++ b/classstdex_1_1parser_1_1http__agent-members.html @@ -88,7 +88,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1http__agent.html b/classstdex_1_1parser_1_1http__agent.html index d2373d64b..0373d867d 100644 --- a/classstdex_1_1parser_1_1http__agent.html +++ b/classstdex_1_1parser_1_1http__agent.html @@ -220,7 +220,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1http__any__type-members.html b/classstdex_1_1parser_1_1http__any__type-members.html index 4bda8de55..cbc644c88 100644 --- a/classstdex_1_1parser_1_1http__any__type-members.html +++ b/classstdex_1_1parser_1_1http__any__type-members.html @@ -85,7 +85,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1http__any__type.html b/classstdex_1_1parser_1_1http__any__type.html index 4d414d1fb..56dd5308a 100644 --- a/classstdex_1_1parser_1_1http__any__type.html +++ b/classstdex_1_1parser_1_1http__any__type.html @@ -184,7 +184,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1http__asterisk-members.html b/classstdex_1_1parser_1_1http__asterisk-members.html index 0320433f4..6613d1b37 100644 --- a/classstdex_1_1parser_1_1http__asterisk-members.html +++ b/classstdex_1_1parser_1_1http__asterisk-members.html @@ -85,7 +85,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1http__asterisk.html b/classstdex_1_1parser_1_1http__asterisk.html index bee8d7d3b..571418dc1 100644 --- a/classstdex_1_1parser_1_1http__asterisk.html +++ b/classstdex_1_1parser_1_1http__asterisk.html @@ -184,7 +184,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1http__cookie-members.html b/classstdex_1_1parser_1_1http__cookie-members.html index b1f5162af..d32075f6d 100644 --- a/classstdex_1_1parser_1_1http__cookie-members.html +++ b/classstdex_1_1parser_1_1http__cookie-members.html @@ -90,7 +90,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1http__cookie.html b/classstdex_1_1parser_1_1http__cookie.html index 82064e3f1..f3989a88c 100644 --- a/classstdex_1_1parser_1_1http__cookie.html +++ b/classstdex_1_1parser_1_1http__cookie.html @@ -230,7 +230,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1http__cookie__parameter-members.html b/classstdex_1_1parser_1_1http__cookie__parameter-members.html index ad280d60f..7e33eb6df 100644 --- a/classstdex_1_1parser_1_1http__cookie__parameter-members.html +++ b/classstdex_1_1parser_1_1http__cookie__parameter-members.html @@ -89,7 +89,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1http__cookie__parameter.html b/classstdex_1_1parser_1_1http__cookie__parameter.html index 0c9d9fd0c..25cd6c835 100644 --- a/classstdex_1_1parser_1_1http__cookie__parameter.html +++ b/classstdex_1_1parser_1_1http__cookie__parameter.html @@ -224,7 +224,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1http__header-members.html b/classstdex_1_1parser_1_1http__header-members.html index f9993ae8c..a3388d582 100644 --- a/classstdex_1_1parser_1_1http__header-members.html +++ b/classstdex_1_1parser_1_1http__header-members.html @@ -89,7 +89,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1http__header.html b/classstdex_1_1parser_1_1http__header.html index bc47a9f07..c47dc5fc6 100644 --- a/classstdex_1_1parser_1_1http__header.html +++ b/classstdex_1_1parser_1_1http__header.html @@ -224,7 +224,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1http__language-members.html b/classstdex_1_1parser_1_1http__language-members.html index 5090990cb..744644fa7 100644 --- a/classstdex_1_1parser_1_1http__language-members.html +++ b/classstdex_1_1parser_1_1http__language-members.html @@ -87,7 +87,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1http__language.html b/classstdex_1_1parser_1_1http__language.html index cffda5d13..616341387 100644 --- a/classstdex_1_1parser_1_1http__language.html +++ b/classstdex_1_1parser_1_1http__language.html @@ -217,7 +217,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1http__line__break-members.html b/classstdex_1_1parser_1_1http__line__break-members.html index 373a6a923..a09296367 100644 --- a/classstdex_1_1parser_1_1http__line__break-members.html +++ b/classstdex_1_1parser_1_1http__line__break-members.html @@ -85,7 +85,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1http__line__break.html b/classstdex_1_1parser_1_1http__line__break.html index f3558d994..a5375d910 100644 --- a/classstdex_1_1parser_1_1http__line__break.html +++ b/classstdex_1_1parser_1_1http__line__break.html @@ -184,7 +184,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1http__media__range-members.html b/classstdex_1_1parser_1_1http__media__range-members.html index ae4854245..6c7c42052 100644 --- a/classstdex_1_1parser_1_1http__media__range-members.html +++ b/classstdex_1_1parser_1_1http__media__range-members.html @@ -89,7 +89,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1http__media__range.html b/classstdex_1_1parser_1_1http__media__range.html index 43e10a66e..580bbd88a 100644 --- a/classstdex_1_1parser_1_1http__media__range.html +++ b/classstdex_1_1parser_1_1http__media__range.html @@ -225,7 +225,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1http__media__type-members.html b/classstdex_1_1parser_1_1http__media__type-members.html index 87f4348d4..add322f74 100644 --- a/classstdex_1_1parser_1_1http__media__type-members.html +++ b/classstdex_1_1parser_1_1http__media__type-members.html @@ -90,7 +90,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1http__media__type.html b/classstdex_1_1parser_1_1http__media__type.html index 2bcd91bd1..17da40582 100644 --- a/classstdex_1_1parser_1_1http__media__type.html +++ b/classstdex_1_1parser_1_1http__media__type.html @@ -229,7 +229,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1http__parameter-members.html b/classstdex_1_1parser_1_1http__parameter-members.html index 5e0724c5c..9766553ff 100644 --- a/classstdex_1_1parser_1_1http__parameter-members.html +++ b/classstdex_1_1parser_1_1http__parameter-members.html @@ -89,7 +89,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1http__parameter.html b/classstdex_1_1parser_1_1http__parameter.html index 89b368d65..b2be2f56c 100644 --- a/classstdex_1_1parser_1_1http__parameter.html +++ b/classstdex_1_1parser_1_1http__parameter.html @@ -226,7 +226,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1http__protocol-members.html b/classstdex_1_1parser_1_1http__protocol-members.html index 9c3941931..be03ff57d 100644 --- a/classstdex_1_1parser_1_1http__protocol-members.html +++ b/classstdex_1_1parser_1_1http__protocol-members.html @@ -91,7 +91,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1http__protocol.html b/classstdex_1_1parser_1_1http__protocol.html index 75b5fea07..0454414bb 100644 --- a/classstdex_1_1parser_1_1http__protocol.html +++ b/classstdex_1_1parser_1_1http__protocol.html @@ -230,7 +230,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1http__quoted__string-members.html b/classstdex_1_1parser_1_1http__quoted__string-members.html index 69ee1f035..cce070e99 100644 --- a/classstdex_1_1parser_1_1http__quoted__string-members.html +++ b/classstdex_1_1parser_1_1http__quoted__string-members.html @@ -88,7 +88,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1http__quoted__string.html b/classstdex_1_1parser_1_1http__quoted__string.html index daf133d1f..736029ef5 100644 --- a/classstdex_1_1parser_1_1http__quoted__string.html +++ b/classstdex_1_1parser_1_1http__quoted__string.html @@ -222,7 +222,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1http__request-members.html b/classstdex_1_1parser_1_1http__request-members.html index 9eacbdd5b..79d23f740 100644 --- a/classstdex_1_1parser_1_1http__request-members.html +++ b/classstdex_1_1parser_1_1http__request-members.html @@ -91,7 +91,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1http__request.html b/classstdex_1_1parser_1_1http__request.html index 5da1006d0..68e77d10f 100644 --- a/classstdex_1_1parser_1_1http__request.html +++ b/classstdex_1_1parser_1_1http__request.html @@ -230,7 +230,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1http__space-members.html b/classstdex_1_1parser_1_1http__space-members.html index 73fb86278..982960c4d 100644 --- a/classstdex_1_1parser_1_1http__space-members.html +++ b/classstdex_1_1parser_1_1http__space-members.html @@ -86,7 +86,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1http__space.html b/classstdex_1_1parser_1_1http__space.html index 592fe140f..7c8034fe3 100644 --- a/classstdex_1_1parser_1_1http__space.html +++ b/classstdex_1_1parser_1_1http__space.html @@ -191,7 +191,7 @@ Additional Inherited Members diff --git a/classstdex_1_1parser_1_1http__text__char-members.html b/classstdex_1_1parser_1_1http__text__char-members.html index 815123bab..fd993427f 100644 --- a/classstdex_1_1parser_1_1http__text__char-members.html +++ b/classstdex_1_1parser_1_1http__text__char-members.html @@ -86,7 +86,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1http__text__char.html b/classstdex_1_1parser_1_1http__text__char.html index 1552d4600..391e5ac80 100644 --- a/classstdex_1_1parser_1_1http__text__char.html +++ b/classstdex_1_1parser_1_1http__text__char.html @@ -191,7 +191,7 @@ Additional Inherited Members diff --git a/classstdex_1_1parser_1_1http__token-members.html b/classstdex_1_1parser_1_1http__token-members.html index a57b52a30..40566f77f 100644 --- a/classstdex_1_1parser_1_1http__token-members.html +++ b/classstdex_1_1parser_1_1http__token-members.html @@ -85,7 +85,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1http__token.html b/classstdex_1_1parser_1_1http__token.html index 9f530db26..9a136fb6a 100644 --- a/classstdex_1_1parser_1_1http__token.html +++ b/classstdex_1_1parser_1_1http__token.html @@ -184,7 +184,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1http__url-members.html b/classstdex_1_1parser_1_1http__url-members.html index 0099f1604..5b2326b3f 100644 --- a/classstdex_1_1parser_1_1http__url-members.html +++ b/classstdex_1_1parser_1_1http__url-members.html @@ -91,7 +91,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1http__url.html b/classstdex_1_1parser_1_1http__url.html index 29b83caea..69faa590e 100644 --- a/classstdex_1_1parser_1_1http__url.html +++ b/classstdex_1_1parser_1_1http__url.html @@ -229,7 +229,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1http__url__parameter-members.html b/classstdex_1_1parser_1_1http__url__parameter-members.html index b9d29243d..25c069ea7 100644 --- a/classstdex_1_1parser_1_1http__url__parameter-members.html +++ b/classstdex_1_1parser_1_1http__url__parameter-members.html @@ -88,7 +88,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1http__url__parameter.html b/classstdex_1_1parser_1_1http__url__parameter.html index e8e298a4f..1019bc1c4 100644 --- a/classstdex_1_1parser_1_1http__url__parameter.html +++ b/classstdex_1_1parser_1_1http__url__parameter.html @@ -220,7 +220,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1http__url__path-members.html b/classstdex_1_1parser_1_1http__url__path-members.html index 861528c09..d5517ff9e 100644 --- a/classstdex_1_1parser_1_1http__url__path-members.html +++ b/classstdex_1_1parser_1_1http__url__path-members.html @@ -87,7 +87,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1http__url__path.html b/classstdex_1_1parser_1_1http__url__path.html index 8ccc291bc..628fe62ff 100644 --- a/classstdex_1_1parser_1_1http__url__path.html +++ b/classstdex_1_1parser_1_1http__url__path.html @@ -218,7 +218,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1http__url__path__segment-members.html b/classstdex_1_1parser_1_1http__url__path__segment-members.html index 42b0815dc..32a5ed3fa 100644 --- a/classstdex_1_1parser_1_1http__url__path__segment-members.html +++ b/classstdex_1_1parser_1_1http__url__path__segment-members.html @@ -85,7 +85,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1http__url__path__segment.html b/classstdex_1_1parser_1_1http__url__path__segment.html index e6387a6ab..15180f259 100644 --- a/classstdex_1_1parser_1_1http__url__path__segment.html +++ b/classstdex_1_1parser_1_1http__url__path__segment.html @@ -184,7 +184,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1http__url__port-members.html b/classstdex_1_1parser_1_1http__url__port-members.html index d4a432cbe..c171fc23a 100644 --- a/classstdex_1_1parser_1_1http__url__port-members.html +++ b/classstdex_1_1parser_1_1http__url__port-members.html @@ -88,7 +88,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1http__url__port.html b/classstdex_1_1parser_1_1http__url__port.html index 17ab03110..3a97e9615 100644 --- a/classstdex_1_1parser_1_1http__url__port.html +++ b/classstdex_1_1parser_1_1http__url__port.html @@ -220,7 +220,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1http__url__server-members.html b/classstdex_1_1parser_1_1http__url__server-members.html index 896f70e33..a9ccfd590 100644 --- a/classstdex_1_1parser_1_1http__url__server-members.html +++ b/classstdex_1_1parser_1_1http__url__server-members.html @@ -85,7 +85,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1http__url__server.html b/classstdex_1_1parser_1_1http__url__server.html index 509b3f2d5..832aba07b 100644 --- a/classstdex_1_1parser_1_1http__url__server.html +++ b/classstdex_1_1parser_1_1http__url__server.html @@ -184,7 +184,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1http__value-members.html b/classstdex_1_1parser_1_1http__value-members.html index 9a4feb4af..1715c87cd 100644 --- a/classstdex_1_1parser_1_1http__value-members.html +++ b/classstdex_1_1parser_1_1http__value-members.html @@ -88,7 +88,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1http__value.html b/classstdex_1_1parser_1_1http__value.html index 6d0763564..6fde0ce58 100644 --- a/classstdex_1_1parser_1_1http__value.html +++ b/classstdex_1_1parser_1_1http__value.html @@ -222,7 +222,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1http__value__collection-members.html b/classstdex_1_1parser_1_1http__value__collection-members.html index f0df53443..bfda8c267 100644 --- a/classstdex_1_1parser_1_1http__value__collection-members.html +++ b/classstdex_1_1parser_1_1http__value__collection-members.html @@ -84,7 +84,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1http__value__collection.html b/classstdex_1_1parser_1_1http__value__collection.html index 49f621aec..79d70bc19 100644 --- a/classstdex_1_1parser_1_1http__value__collection.html +++ b/classstdex_1_1parser_1_1http__value__collection.html @@ -107,7 +107,7 @@ class stdex::parser::http_value_collection< _Key, T >

Collection o

diff --git a/classstdex_1_1parser_1_1http__weight-members.html b/classstdex_1_1parser_1_1http__weight-members.html index fe621c3a9..5ee748a4a 100644 --- a/classstdex_1_1parser_1_1http__weight-members.html +++ b/classstdex_1_1parser_1_1http__weight-members.html @@ -88,7 +88,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1http__weight.html b/classstdex_1_1parser_1_1http__weight.html index b49172a1b..6b64b4a83 100644 --- a/classstdex_1_1parser_1_1http__weight.html +++ b/classstdex_1_1parser_1_1http__weight.html @@ -221,7 +221,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1http__weighted__value-members.html b/classstdex_1_1parser_1_1http__weighted__value-members.html index 4f233f807..784155066 100644 --- a/classstdex_1_1parser_1_1http__weighted__value-members.html +++ b/classstdex_1_1parser_1_1http__weighted__value-members.html @@ -90,7 +90,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1http__weighted__value.html b/classstdex_1_1parser_1_1http__weighted__value.html index 79153fc94..f79717f8a 100644 --- a/classstdex_1_1parser_1_1http__weighted__value.html +++ b/classstdex_1_1parser_1_1http__weighted__value.html @@ -231,7 +231,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1parser__collection-members.html b/classstdex_1_1parser_1_1parser__collection-members.html index e9a0fb0c2..8aa11c6ad 100644 --- a/classstdex_1_1parser_1_1parser__collection-members.html +++ b/classstdex_1_1parser_1_1parser__collection-members.html @@ -95,7 +95,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1parser__collection.html b/classstdex_1_1parser_1_1parser__collection.html index f6518fa41..7d8319d08 100644 --- a/classstdex_1_1parser_1_1parser__collection.html +++ b/classstdex_1_1parser_1_1parser__collection.html @@ -189,7 +189,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1sgml__any__cp-members.html b/classstdex_1_1parser_1_1sgml__any__cp-members.html index b55145b92..cbc37428e 100644 --- a/classstdex_1_1parser_1_1sgml__any__cp-members.html +++ b/classstdex_1_1parser_1_1sgml__any__cp-members.html @@ -93,7 +93,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1sgml__any__cp.html b/classstdex_1_1parser_1_1sgml__any__cp.html index b65e6f27f..4061d71fb 100644 --- a/classstdex_1_1parser_1_1sgml__any__cp.html +++ b/classstdex_1_1parser_1_1sgml__any__cp.html @@ -196,7 +196,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1sgml__cp-members.html b/classstdex_1_1parser_1_1sgml__cp-members.html index 383389364..fbfca09f6 100644 --- a/classstdex_1_1parser_1_1sgml__cp-members.html +++ b/classstdex_1_1parser_1_1sgml__cp-members.html @@ -88,7 +88,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1sgml__cp.html b/classstdex_1_1parser_1_1sgml__cp.html index 202200665..8db1243f6 100644 --- a/classstdex_1_1parser_1_1sgml__cp.html +++ b/classstdex_1_1parser_1_1sgml__cp.html @@ -197,7 +197,7 @@ Additional Inherited Members diff --git a/classstdex_1_1parser_1_1sgml__cp__set-members.html b/classstdex_1_1parser_1_1sgml__cp__set-members.html index 1ffe6d088..abd49dac3 100644 --- a/classstdex_1_1parser_1_1sgml__cp__set-members.html +++ b/classstdex_1_1parser_1_1sgml__cp__set-members.html @@ -93,7 +93,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1sgml__cp__set.html b/classstdex_1_1parser_1_1sgml__cp__set.html index 78570bb55..eb7904eb0 100644 --- a/classstdex_1_1parser_1_1sgml__cp__set.html +++ b/classstdex_1_1parser_1_1sgml__cp__set.html @@ -210,7 +210,7 @@ Additional Inherited Members diff --git a/classstdex_1_1parser_1_1sgml__dns__domain__char-members.html b/classstdex_1_1parser_1_1sgml__dns__domain__char-members.html index e3f35fb44..102e6ed42 100644 --- a/classstdex_1_1parser_1_1sgml__dns__domain__char-members.html +++ b/classstdex_1_1parser_1_1sgml__dns__domain__char-members.html @@ -94,7 +94,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1sgml__dns__domain__char.html b/classstdex_1_1parser_1_1sgml__dns__domain__char.html index 777a2d82b..027ade57d 100644 --- a/classstdex_1_1parser_1_1sgml__dns__domain__char.html +++ b/classstdex_1_1parser_1_1sgml__dns__domain__char.html @@ -205,7 +205,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1sgml__ipv6__scope__id__char-members.html b/classstdex_1_1parser_1_1sgml__ipv6__scope__id__char-members.html index 9ad81845c..306be531d 100644 --- a/classstdex_1_1parser_1_1sgml__ipv6__scope__id__char-members.html +++ b/classstdex_1_1parser_1_1sgml__ipv6__scope__id__char-members.html @@ -86,7 +86,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1sgml__ipv6__scope__id__char.html b/classstdex_1_1parser_1_1sgml__ipv6__scope__id__char.html index 44d660f06..3a8bb19dc 100644 --- a/classstdex_1_1parser_1_1sgml__ipv6__scope__id__char.html +++ b/classstdex_1_1parser_1_1sgml__ipv6__scope__id__char.html @@ -187,7 +187,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1sgml__punct__cp-members.html b/classstdex_1_1parser_1_1sgml__punct__cp-members.html index 81435ec5b..b0a0f8905 100644 --- a/classstdex_1_1parser_1_1sgml__punct__cp-members.html +++ b/classstdex_1_1parser_1_1sgml__punct__cp-members.html @@ -93,7 +93,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1sgml__punct__cp.html b/classstdex_1_1parser_1_1sgml__punct__cp.html index 9631987d3..dd75ac7cc 100644 --- a/classstdex_1_1parser_1_1sgml__punct__cp.html +++ b/classstdex_1_1parser_1_1sgml__punct__cp.html @@ -200,7 +200,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1sgml__space__cp-members.html b/classstdex_1_1parser_1_1sgml__space__cp-members.html index 7115638fc..3ad8cd2a5 100644 --- a/classstdex_1_1parser_1_1sgml__space__cp-members.html +++ b/classstdex_1_1parser_1_1sgml__space__cp-members.html @@ -93,7 +93,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1sgml__space__cp.html b/classstdex_1_1parser_1_1sgml__space__cp.html index 3fd8d9745..e680c2a07 100644 --- a/classstdex_1_1parser_1_1sgml__space__cp.html +++ b/classstdex_1_1parser_1_1sgml__space__cp.html @@ -200,7 +200,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1sgml__space__or__punct__cp-members.html b/classstdex_1_1parser_1_1sgml__space__or__punct__cp-members.html index 3dd1d73fa..0455d978d 100644 --- a/classstdex_1_1parser_1_1sgml__space__or__punct__cp-members.html +++ b/classstdex_1_1parser_1_1sgml__space__or__punct__cp-members.html @@ -93,7 +93,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1sgml__space__or__punct__cp.html b/classstdex_1_1parser_1_1sgml__space__or__punct__cp.html index d469761a0..250856713 100644 --- a/classstdex_1_1parser_1_1sgml__space__or__punct__cp.html +++ b/classstdex_1_1parser_1_1sgml__space__or__punct__cp.html @@ -200,7 +200,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1sgml__string-members.html b/classstdex_1_1parser_1_1sgml__string-members.html index 4231f6afa..95292a73f 100644 --- a/classstdex_1_1parser_1_1sgml__string-members.html +++ b/classstdex_1_1parser_1_1sgml__string-members.html @@ -87,7 +87,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1sgml__string.html b/classstdex_1_1parser_1_1sgml__string.html index 2e95740fa..abaf9d2d3 100644 --- a/classstdex_1_1parser_1_1sgml__string.html +++ b/classstdex_1_1parser_1_1sgml__string.html @@ -194,7 +194,7 @@ Additional Inherited Members diff --git a/classstdex_1_1parser_1_1sgml__url__password__char-members.html b/classstdex_1_1parser_1_1sgml__url__password__char-members.html index 53a616230..8f76c4822 100644 --- a/classstdex_1_1parser_1_1sgml__url__password__char-members.html +++ b/classstdex_1_1parser_1_1sgml__url__password__char-members.html @@ -93,7 +93,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1sgml__url__password__char.html b/classstdex_1_1parser_1_1sgml__url__password__char.html index 1f0d9ee42..b73282c53 100644 --- a/classstdex_1_1parser_1_1sgml__url__password__char.html +++ b/classstdex_1_1parser_1_1sgml__url__password__char.html @@ -196,7 +196,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1sgml__url__path__char-members.html b/classstdex_1_1parser_1_1sgml__url__path__char-members.html index 07c44342e..f8806ff43 100644 --- a/classstdex_1_1parser_1_1sgml__url__path__char-members.html +++ b/classstdex_1_1parser_1_1sgml__url__path__char-members.html @@ -93,7 +93,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1sgml__url__path__char.html b/classstdex_1_1parser_1_1sgml__url__path__char.html index 3f3ba177a..09c7fe97f 100644 --- a/classstdex_1_1parser_1_1sgml__url__path__char.html +++ b/classstdex_1_1parser_1_1sgml__url__path__char.html @@ -196,7 +196,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1sgml__url__username__char-members.html b/classstdex_1_1parser_1_1sgml__url__username__char-members.html index c5e8eddee..a02b6b225 100644 --- a/classstdex_1_1parser_1_1sgml__url__username__char-members.html +++ b/classstdex_1_1parser_1_1sgml__url__username__char-members.html @@ -93,7 +93,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1sgml__url__username__char.html b/classstdex_1_1parser_1_1sgml__url__username__char.html index 511acd5c4..bb1f647f1 100644 --- a/classstdex_1_1parser_1_1sgml__url__username__char.html +++ b/classstdex_1_1parser_1_1sgml__url__username__char.html @@ -196,7 +196,7 @@ std::locale m_locale diff --git a/classstdex_1_1progress-members.html b/classstdex_1_1progress-members.html index 988c8c28e..07c160a02 100644 --- a/classstdex_1_1progress-members.html +++ b/classstdex_1_1progress-members.html @@ -88,7 +88,7 @@ $(function() { diff --git a/classstdex_1_1progress.html b/classstdex_1_1progress.html index 1d0447ec5..1c612be33 100644 --- a/classstdex_1_1progress.html +++ b/classstdex_1_1progress.html @@ -319,7 +319,7 @@ template<class T > diff --git a/classstdex_1_1progress__switcher-members.html b/classstdex_1_1progress__switcher-members.html index 95353daff..1671ce17e 100644 --- a/classstdex_1_1progress__switcher-members.html +++ b/classstdex_1_1progress__switcher-members.html @@ -100,7 +100,7 @@ $(function() { diff --git a/classstdex_1_1progress__switcher.html b/classstdex_1_1progress__switcher.html index 9ebd98ab3..047a40a55 100644 --- a/classstdex_1_1progress__switcher.html +++ b/classstdex_1_1progress__switcher.html @@ -163,7 +163,7 @@ class stdex::progress_switcher< T >

Progress indicator switcher. <

diff --git a/classstdex_1_1ring-members.html b/classstdex_1_1ring-members.html index 7eda3d72d..5fea43867 100644 --- a/classstdex_1_1ring-members.html +++ b/classstdex_1_1ring-members.html @@ -100,7 +100,7 @@ $(function() { diff --git a/classstdex_1_1ring.html b/classstdex_1_1ring.html index 416240465..ba7eb74dd 100644 --- a/classstdex_1_1ring.html +++ b/classstdex_1_1ring.html @@ -296,7 +296,7 @@ template<class T , size_t CAPACITY> diff --git a/classstdex_1_1stream_1_1async__reader-members.html b/classstdex_1_1stream_1_1async__reader-members.html index 62f593664..e7faa802d 100644 --- a/classstdex_1_1stream_1_1async__reader-members.html +++ b/classstdex_1_1stream_1_1async__reader-members.html @@ -149,7 +149,7 @@ $(function() { diff --git a/classstdex_1_1stream_1_1async__reader.html b/classstdex_1_1stream_1_1async__reader.html index bfb627a44..405c8a1d7 100644 --- a/classstdex_1_1stream_1_1async__reader.html +++ b/classstdex_1_1stream_1_1async__reader.html @@ -390,7 +390,7 @@ template<size_t CAPACITY = default_async_limit> diff --git a/classstdex_1_1stream_1_1async__writer-members.html b/classstdex_1_1stream_1_1async__writer-members.html index 710eae935..c364f1c82 100644 --- a/classstdex_1_1stream_1_1async__writer-members.html +++ b/classstdex_1_1stream_1_1async__writer-members.html @@ -149,7 +149,7 @@ $(function() { diff --git a/classstdex_1_1stream_1_1async__writer.html b/classstdex_1_1stream_1_1async__writer.html index 40291340f..77a53aeb5 100644 --- a/classstdex_1_1stream_1_1async__writer.html +++ b/classstdex_1_1stream_1_1async__writer.html @@ -421,7 +421,7 @@ template<size_t CAPACITY = default_async_limit> diff --git a/classstdex_1_1stream_1_1basic-members.html b/classstdex_1_1stream_1_1basic-members.html index 9f9be4478..1ca21d347 100644 --- a/classstdex_1_1stream_1_1basic-members.html +++ b/classstdex_1_1stream_1_1basic-members.html @@ -139,7 +139,7 @@ $(function() { diff --git a/classstdex_1_1stream_1_1basic.html b/classstdex_1_1stream_1_1basic.html index f1c856b0b..df163085f 100644 --- a/classstdex_1_1stream_1_1basic.html +++ b/classstdex_1_1stream_1_1basic.html @@ -1320,7 +1320,7 @@ template<class T > diff --git a/classstdex_1_1stream_1_1basic__file-members.html b/classstdex_1_1stream_1_1basic__file-members.html index 8ad9aa2c3..6f3be4b9d 100644 --- a/classstdex_1_1stream_1_1basic__file-members.html +++ b/classstdex_1_1stream_1_1basic__file-members.html @@ -155,7 +155,7 @@ $(function() { diff --git a/classstdex_1_1stream_1_1basic__file.html b/classstdex_1_1stream_1_1basic__file.html index dcc9d1329..43df6c937 100644 --- a/classstdex_1_1stream_1_1basic__file.html +++ b/classstdex_1_1stream_1_1basic__file.html @@ -927,7 +927,7 @@ state_t m_state diff --git a/classstdex_1_1stream_1_1basic__sys-members.html b/classstdex_1_1stream_1_1basic__sys-members.html index c4bbdf5ea..aa1d09e2c 100644 --- a/classstdex_1_1stream_1_1basic__sys-members.html +++ b/classstdex_1_1stream_1_1basic__sys-members.html @@ -151,7 +151,7 @@ $(function() { diff --git a/classstdex_1_1stream_1_1basic__sys.html b/classstdex_1_1stream_1_1basic__sys.html index e7f7437eb..d063fb195 100644 --- a/classstdex_1_1stream_1_1basic__sys.html +++ b/classstdex_1_1stream_1_1basic__sys.html @@ -493,7 +493,7 @@ sys_handle m_h diff --git a/classstdex_1_1stream_1_1buffer-members.html b/classstdex_1_1stream_1_1buffer-members.html index 104d79746..ac94784c5 100644 --- a/classstdex_1_1stream_1_1buffer-members.html +++ b/classstdex_1_1stream_1_1buffer-members.html @@ -150,7 +150,7 @@ $(function() { diff --git a/classstdex_1_1stream_1_1buffer.html b/classstdex_1_1stream_1_1buffer.html index c851c6e0b..f2fc8b509 100644 --- a/classstdex_1_1stream_1_1buffer.html +++ b/classstdex_1_1stream_1_1buffer.html @@ -468,7 +468,7 @@ state_t m_state diff --git a/classstdex_1_1stream_1_1buffered__sys-members.html b/classstdex_1_1stream_1_1buffered__sys-members.html index 974168a87..dc87ed9da 100644 --- a/classstdex_1_1stream_1_1buffered__sys-members.html +++ b/classstdex_1_1stream_1_1buffered__sys-members.html @@ -152,7 +152,7 @@ $(function() { diff --git a/classstdex_1_1stream_1_1buffered__sys.html b/classstdex_1_1stream_1_1buffered__sys.html index 204dc50c0..8d9cdafa8 100644 --- a/classstdex_1_1stream_1_1buffered__sys.html +++ b/classstdex_1_1stream_1_1buffered__sys.html @@ -344,7 +344,7 @@ void done () diff --git a/classstdex_1_1stream_1_1cache-members.html b/classstdex_1_1stream_1_1cache-members.html index b77aa1b81..e322d9e4b 100644 --- a/classstdex_1_1stream_1_1cache-members.html +++ b/classstdex_1_1stream_1_1cache-members.html @@ -167,7 +167,7 @@ $(function() { diff --git a/classstdex_1_1stream_1_1cache.html b/classstdex_1_1stream_1_1cache.html index fe1c9bb34..7717e31fd 100644 --- a/classstdex_1_1stream_1_1cache.html +++ b/classstdex_1_1stream_1_1cache.html @@ -933,7 +933,7 @@ state_t m_state diff --git a/classstdex_1_1stream_1_1cached__file-members.html b/classstdex_1_1stream_1_1cached__file-members.html index 7bff1a4c6..624244f4a 100644 --- a/classstdex_1_1stream_1_1cached__file-members.html +++ b/classstdex_1_1stream_1_1cached__file-members.html @@ -171,7 +171,7 @@ $(function() { diff --git a/classstdex_1_1stream_1_1cached__file.html b/classstdex_1_1stream_1_1cached__file.html index dc7491773..8cb7b028f 100644 --- a/classstdex_1_1stream_1_1cached__file.html +++ b/classstdex_1_1stream_1_1cached__file.html @@ -499,7 +499,7 @@ void write_cache () diff --git a/classstdex_1_1stream_1_1converter-members.html b/classstdex_1_1stream_1_1converter-members.html index 481adf527..1c23a8291 100644 --- a/classstdex_1_1stream_1_1converter-members.html +++ b/classstdex_1_1stream_1_1converter-members.html @@ -144,7 +144,7 @@ $(function() { diff --git a/classstdex_1_1stream_1_1converter.html b/classstdex_1_1stream_1_1converter.html index cdab3422b..609a06cb6 100644 --- a/classstdex_1_1stream_1_1converter.html +++ b/classstdex_1_1stream_1_1converter.html @@ -480,7 +480,7 @@ state_t m_state diff --git a/classstdex_1_1stream_1_1diag__file-members.html b/classstdex_1_1stream_1_1diag__file-members.html index 9f47facc9..47758da6a 100644 --- a/classstdex_1_1stream_1_1diag__file-members.html +++ b/classstdex_1_1stream_1_1diag__file-members.html @@ -158,7 +158,7 @@ $(function() { diff --git a/classstdex_1_1stream_1_1diag__file.html b/classstdex_1_1stream_1_1diag__file.html index 955da99c6..78e318e13 100644 --- a/classstdex_1_1stream_1_1diag__file.html +++ b/classstdex_1_1stream_1_1diag__file.html @@ -720,7 +720,7 @@ state_t m_state diff --git a/classstdex_1_1stream_1_1fifo-members.html b/classstdex_1_1stream_1_1fifo-members.html index 679bce42a..28818b6fa 100644 --- a/classstdex_1_1stream_1_1fifo-members.html +++ b/classstdex_1_1stream_1_1fifo-members.html @@ -146,7 +146,7 @@ $(function() { diff --git a/classstdex_1_1stream_1_1fifo.html b/classstdex_1_1stream_1_1fifo.html index 6d9168a56..b1677462d 100644 --- a/classstdex_1_1stream_1_1fifo.html +++ b/classstdex_1_1stream_1_1fifo.html @@ -445,7 +445,7 @@ state_t m_state diff --git a/classstdex_1_1stream_1_1file-members.html b/classstdex_1_1stream_1_1file-members.html index 2c7815565..3d0d4d792 100644 --- a/classstdex_1_1stream_1_1file-members.html +++ b/classstdex_1_1stream_1_1file-members.html @@ -174,7 +174,7 @@ $(function() { diff --git a/classstdex_1_1stream_1_1file.html b/classstdex_1_1stream_1_1file.html index 04cbd5a0b..27293bad0 100644 --- a/classstdex_1_1stream_1_1file.html +++ b/classstdex_1_1stream_1_1file.html @@ -877,7 +877,7 @@ sys_handle m_h diff --git a/classstdex_1_1stream_1_1file__window-members.html b/classstdex_1_1stream_1_1file__window-members.html index f259c4295..85f8725da 100644 --- a/classstdex_1_1stream_1_1file__window-members.html +++ b/classstdex_1_1stream_1_1file__window-members.html @@ -159,7 +159,7 @@ $(function() { diff --git a/classstdex_1_1stream_1_1file__window.html b/classstdex_1_1stream_1_1file__window.html index 621381eab..4e0184ff2 100644 --- a/classstdex_1_1stream_1_1file__window.html +++ b/classstdex_1_1stream_1_1file__window.html @@ -753,7 +753,7 @@ state_t m_state diff --git a/classstdex_1_1stream_1_1limiter-members.html b/classstdex_1_1stream_1_1limiter-members.html index 9b3a7de04..651a7c92b 100644 --- a/classstdex_1_1stream_1_1limiter-members.html +++ b/classstdex_1_1stream_1_1limiter-members.html @@ -147,7 +147,7 @@ $(function() { diff --git a/classstdex_1_1stream_1_1limiter.html b/classstdex_1_1stream_1_1limiter.html index be6a13d91..d834e3f28 100644 --- a/classstdex_1_1stream_1_1limiter.html +++ b/classstdex_1_1stream_1_1limiter.html @@ -429,7 +429,7 @@ state_t m_state diff --git a/classstdex_1_1stream_1_1memory__file-members.html b/classstdex_1_1stream_1_1memory__file-members.html index b6826606c..b75571c3d 100644 --- a/classstdex_1_1stream_1_1memory__file-members.html +++ b/classstdex_1_1stream_1_1memory__file-members.html @@ -196,7 +196,7 @@ $(function() { diff --git a/classstdex_1_1stream_1_1memory__file.html b/classstdex_1_1stream_1_1memory__file.html index abff9bd17..47a6e0603 100644 --- a/classstdex_1_1stream_1_1memory__file.html +++ b/classstdex_1_1stream_1_1memory__file.html @@ -1465,7 +1465,7 @@ template<class T > diff --git a/classstdex_1_1stream_1_1replicator-members.html b/classstdex_1_1stream_1_1replicator-members.html index 001a01481..eec56ab26 100644 --- a/classstdex_1_1stream_1_1replicator-members.html +++ b/classstdex_1_1stream_1_1replicator-members.html @@ -144,7 +144,7 @@ $(function() { diff --git a/classstdex_1_1stream_1_1replicator.html b/classstdex_1_1stream_1_1replicator.html index b02c6bc3e..682d41bc5 100644 --- a/classstdex_1_1stream_1_1replicator.html +++ b/classstdex_1_1stream_1_1replicator.html @@ -428,7 +428,7 @@ state_t m_state diff --git a/classstdex_1_1stream_1_1replicator_1_1worker-members.html b/classstdex_1_1stream_1_1replicator_1_1worker-members.html index 8b76e86c1..14d568a1e 100644 --- a/classstdex_1_1stream_1_1replicator_1_1worker-members.html +++ b/classstdex_1_1stream_1_1replicator_1_1worker-members.html @@ -94,7 +94,7 @@ $(function() { diff --git a/classstdex_1_1stream_1_1replicator_1_1worker.html b/classstdex_1_1stream_1_1replicator_1_1worker.html index 9c0208713..4f12be677 100644 --- a/classstdex_1_1stream_1_1replicator_1_1worker.html +++ b/classstdex_1_1stream_1_1replicator_1_1worker.html @@ -146,7 +146,7 @@ static void process_op diff --git a/classstdex_1_1stream_1_1window-members.html b/classstdex_1_1stream_1_1window-members.html index 9c0eec8fe..159fd6eeb 100644 --- a/classstdex_1_1stream_1_1window-members.html +++ b/classstdex_1_1stream_1_1window-members.html @@ -150,7 +150,7 @@ $(function() { diff --git a/classstdex_1_1stream_1_1window.html b/classstdex_1_1stream_1_1window.html index a5f167b4a..cd0847a10 100644 --- a/classstdex_1_1stream_1_1window.html +++ b/classstdex_1_1stream_1_1window.html @@ -438,7 +438,7 @@ state_t m_state diff --git a/classstdex_1_1sys__object-members.html b/classstdex_1_1sys__object-members.html index ee94b7ab4..5afb05698 100644 --- a/classstdex_1_1sys__object-members.html +++ b/classstdex_1_1sys__object-members.html @@ -95,7 +95,7 @@ $(function() { diff --git a/classstdex_1_1sys__object.html b/classstdex_1_1sys__object.html index a70565998..a53c70d15 100644 --- a/classstdex_1_1sys__object.html +++ b/classstdex_1_1sys__object.html @@ -182,7 +182,7 @@ sys_handle m_h diff --git a/classstdex_1_1user__cancelled-members.html b/classstdex_1_1user__cancelled-members.html index 66577e63e..9e5a438bb 100644 --- a/classstdex_1_1user__cancelled-members.html +++ b/classstdex_1_1user__cancelled-members.html @@ -84,7 +84,7 @@ $(function() { diff --git a/classstdex_1_1user__cancelled.html b/classstdex_1_1user__cancelled.html index 836d88229..fb59fdf56 100644 --- a/classstdex_1_1user__cancelled.html +++ b/classstdex_1_1user__cancelled.html @@ -141,7 +141,7 @@ Public Member Functions diff --git a/classstdex_1_1vector__queue-members.html b/classstdex_1_1vector__queue-members.html index 03b4386c1..25ede9955 100644 --- a/classstdex_1_1vector__queue-members.html +++ b/classstdex_1_1vector__queue-members.html @@ -122,7 +122,7 @@ $(function() { diff --git a/classstdex_1_1vector__queue.html b/classstdex_1_1vector__queue.html index ee06bbeb8..2848f8cd3 100644 --- a/classstdex_1_1vector__queue.html +++ b/classstdex_1_1vector__queue.html @@ -795,7 +795,7 @@ template<class T > diff --git a/dir_4be4f7b278e009bf0f1906cf31fb73bd.html b/dir_4be4f7b278e009bf0f1906cf31fb73bd.html index 3b1e5a48e..1c2f04aa3 100644 --- a/dir_4be4f7b278e009bf0f1906cf31fb73bd.html +++ b/dir_4be4f7b278e009bf0f1906cf31fb73bd.html @@ -100,7 +100,7 @@ Files diff --git a/dir_d44c64559bbebec7f509842c48db8b23.html b/dir_d44c64559bbebec7f509842c48db8b23.html index 3ea0a94df..0a3fcf004 100644 --- a/dir_d44c64559bbebec7f509842c48db8b23.html +++ b/dir_d44c64559bbebec7f509842c48db8b23.html @@ -86,7 +86,7 @@ Directories diff --git a/dir_fca3c47b2ea228727bd6729832f89576.html b/dir_fca3c47b2ea228727bd6729832f89576.html index 049e081a8..82110c2ff 100644 --- a/dir_fca3c47b2ea228727bd6729832f89576.html +++ b/dir_fca3c47b2ea228727bd6729832f89576.html @@ -128,7 +128,7 @@ Files diff --git a/endian_8hpp_source.html b/endian_8hpp_source.html index 06a40cb64..ec01f6866 100644 --- a/endian_8hpp_source.html +++ b/endian_8hpp_source.html @@ -226,7 +226,7 @@ $(document).ready(function() { init_codefold(0); }); diff --git a/errno_8hpp_source.html b/errno_8hpp_source.html index 00ae7ddda..b13bb17f3 100644 --- a/errno_8hpp_source.html +++ b/errno_8hpp_source.html @@ -153,7 +153,7 @@ $(document).ready(function() { init_codefold(0); }); diff --git a/exception_8hpp_source.html b/exception_8hpp_source.html index 8ed353a4d..7adc8ac36 100644 --- a/exception_8hpp_source.html +++ b/exception_8hpp_source.html @@ -110,7 +110,7 @@ $(document).ready(function() { init_codefold(0); }); diff --git a/files.html b/files.html index fb68920bc..afffd2ce1 100644 --- a/files.html +++ b/files.html @@ -113,7 +113,7 @@ $(function() { diff --git a/functions.html b/functions.html index 2a887ce68..3b066a23e 100644 --- a/functions.html +++ b/functions.html @@ -84,7 +84,7 @@ $(function() { diff --git a/functions_b.html b/functions_b.html index 1e99b0c63..f2db34598 100644 --- a/functions_b.html +++ b/functions_b.html @@ -81,7 +81,7 @@ $(function() { diff --git a/functions_c.html b/functions_c.html index da69f3db1..056280b47 100644 --- a/functions_c.html +++ b/functions_c.html @@ -90,7 +90,7 @@ $(function() { diff --git a/functions_d.html b/functions_d.html index 43ab925d6..fdeba8efa 100644 --- a/functions_d.html +++ b/functions_d.html @@ -87,7 +87,7 @@ $(function() { diff --git a/functions_e.html b/functions_e.html index 08f120a03..a9ab36fe4 100644 --- a/functions_e.html +++ b/functions_e.html @@ -86,7 +86,7 @@ $(function() { diff --git a/functions_f.html b/functions_f.html index 77878dd76..7fe65546b 100644 --- a/functions_f.html +++ b/functions_f.html @@ -86,7 +86,7 @@ $(function() { diff --git a/functions_func.html b/functions_func.html index 84b7576ad..582bb329c 100644 --- a/functions_func.html +++ b/functions_func.html @@ -82,7 +82,7 @@ $(function() { diff --git a/functions_func_b.html b/functions_func_b.html index bc20eb57a..a8f9a15df 100644 --- a/functions_func_b.html +++ b/functions_func_b.html @@ -80,7 +80,7 @@ $(function() { diff --git a/functions_func_c.html b/functions_func_c.html index 9f58f27b1..ef8709e04 100644 --- a/functions_func_c.html +++ b/functions_func_c.html @@ -85,7 +85,7 @@ $(function() { diff --git a/functions_func_d.html b/functions_func_d.html index 87502e766..6a341445a 100644 --- a/functions_func_d.html +++ b/functions_func_d.html @@ -84,7 +84,7 @@ $(function() { diff --git a/functions_func_e.html b/functions_func_e.html index 56674f943..4ffa34a73 100644 --- a/functions_func_e.html +++ b/functions_func_e.html @@ -81,7 +81,7 @@ $(function() { diff --git a/functions_func_f.html b/functions_func_f.html index c171a1686..5037332ac 100644 --- a/functions_func_f.html +++ b/functions_func_f.html @@ -85,7 +85,7 @@ $(function() { diff --git a/functions_func_g.html b/functions_func_g.html index c4a9953ab..38ad69052 100644 --- a/functions_func_g.html +++ b/functions_func_g.html @@ -79,7 +79,7 @@ $(function() { diff --git a/functions_func_h.html b/functions_func_h.html index 0c63d5a6f..3a9a3be9e 100644 --- a/functions_func_h.html +++ b/functions_func_h.html @@ -80,7 +80,7 @@ $(function() { diff --git a/functions_func_i.html b/functions_func_i.html index ccb0717a2..8137219d5 100644 --- a/functions_func_i.html +++ b/functions_func_i.html @@ -79,7 +79,7 @@ $(function() { diff --git a/functions_func_l.html b/functions_func_l.html index 19fc147cf..4789960de 100644 --- a/functions_func_l.html +++ b/functions_func_l.html @@ -80,7 +80,7 @@ $(function() { diff --git a/functions_func_m.html b/functions_func_m.html index 0e8f95a02..2f7181829 100644 --- a/functions_func_m.html +++ b/functions_func_m.html @@ -80,7 +80,7 @@ $(function() { diff --git a/functions_func_n.html b/functions_func_n.html index a9b104b3a..d6c209268 100644 --- a/functions_func_n.html +++ b/functions_func_n.html @@ -79,7 +79,7 @@ $(function() { diff --git a/functions_func_o.html b/functions_func_o.html index f522add89..821e04cc3 100644 --- a/functions_func_o.html +++ b/functions_func_o.html @@ -85,7 +85,7 @@ $(function() { diff --git a/functions_func_p.html b/functions_func_p.html index 401494ce1..0956a865d 100644 --- a/functions_func_p.html +++ b/functions_func_p.html @@ -83,7 +83,7 @@ $(function() { diff --git a/functions_func_q.html b/functions_func_q.html index 04c6bb4ce..975348eb4 100644 --- a/functions_func_q.html +++ b/functions_func_q.html @@ -78,7 +78,7 @@ $(function() { diff --git a/functions_func_r.html b/functions_func_r.html index eaa0ebc79..9f436f008 100644 --- a/functions_func_r.html +++ b/functions_func_r.html @@ -89,7 +89,7 @@ $(function() { diff --git a/functions_func_s.html b/functions_func_s.html index c5af98df9..2a39c25ed 100644 --- a/functions_func_s.html +++ b/functions_func_s.html @@ -97,7 +97,7 @@ $(function() { diff --git a/functions_func_t.html b/functions_func_t.html index 46eac233d..abfbfb466 100644 --- a/functions_func_t.html +++ b/functions_func_t.html @@ -83,7 +83,7 @@ $(function() { diff --git a/functions_func_u.html b/functions_func_u.html index acf571196..c2fa8036d 100644 --- a/functions_func_u.html +++ b/functions_func_u.html @@ -79,7 +79,7 @@ $(function() { diff --git a/functions_func_v.html b/functions_func_v.html index 89664b51a..db6acbb12 100644 --- a/functions_func_v.html +++ b/functions_func_v.html @@ -78,7 +78,7 @@ $(function() { diff --git a/functions_func_w.html b/functions_func_w.html index bd6e94518..7049a6bde 100644 --- a/functions_func_w.html +++ b/functions_func_w.html @@ -86,7 +86,7 @@ $(function() { diff --git a/functions_func_~.html b/functions_func_~.html index 8fbed3a0c..85b92144c 100644 --- a/functions_func_~.html +++ b/functions_func_~.html @@ -78,7 +78,7 @@ $(function() { diff --git a/functions_g.html b/functions_g.html index 5f8e8efc5..cdbb30779 100644 --- a/functions_g.html +++ b/functions_g.html @@ -79,7 +79,7 @@ $(function() { diff --git a/functions_h.html b/functions_h.html index 052ce8129..28b2b7dac 100644 --- a/functions_h.html +++ b/functions_h.html @@ -81,7 +81,7 @@ $(function() { diff --git a/functions_i.html b/functions_i.html index e80dae679..bd5a69700 100644 --- a/functions_i.html +++ b/functions_i.html @@ -80,7 +80,7 @@ $(function() { diff --git a/functions_l.html b/functions_l.html index 9cfbeb5a2..82c60831d 100644 --- a/functions_l.html +++ b/functions_l.html @@ -81,7 +81,7 @@ $(function() { diff --git a/functions_m.html b/functions_m.html index 2ec95247f..2d63e7e8c 100644 --- a/functions_m.html +++ b/functions_m.html @@ -95,7 +95,7 @@ $(function() { diff --git a/functions_n.html b/functions_n.html index 3383abb52..590211017 100644 --- a/functions_n.html +++ b/functions_n.html @@ -85,7 +85,7 @@ $(function() { diff --git a/functions_o.html b/functions_o.html index b2cbc6bb4..5ff5e5593 100644 --- a/functions_o.html +++ b/functions_o.html @@ -86,7 +86,7 @@ $(function() { diff --git a/functions_p.html b/functions_p.html index a4a384d22..a5b90da9b 100644 --- a/functions_p.html +++ b/functions_p.html @@ -87,7 +87,7 @@ $(function() { diff --git a/functions_q.html b/functions_q.html index 9f64fa32f..8da6e5b2e 100644 --- a/functions_q.html +++ b/functions_q.html @@ -78,7 +78,7 @@ $(function() { diff --git a/functions_r.html b/functions_r.html index 55204ca0d..a35cc4737 100644 --- a/functions_r.html +++ b/functions_r.html @@ -93,7 +93,7 @@ $(function() { diff --git a/functions_s.html b/functions_s.html index 993062bc0..0c7b9db03 100644 --- a/functions_s.html +++ b/functions_s.html @@ -103,7 +103,7 @@ $(function() { diff --git a/functions_t.html b/functions_t.html index d6245d6cf..9c00f2ddb 100644 --- a/functions_t.html +++ b/functions_t.html @@ -84,7 +84,7 @@ $(function() { diff --git a/functions_type.html b/functions_type.html index 7347cc9eb..a8007186e 100644 --- a/functions_type.html +++ b/functions_type.html @@ -81,7 +81,7 @@ $(function() { diff --git a/functions_u.html b/functions_u.html index dbce7992a..4ad75314a 100644 --- a/functions_u.html +++ b/functions_u.html @@ -79,7 +79,7 @@ $(function() { diff --git a/functions_v.html b/functions_v.html index 7655f1498..8830a16b2 100644 --- a/functions_v.html +++ b/functions_v.html @@ -81,7 +81,7 @@ $(function() { diff --git a/functions_vars.html b/functions_vars.html index f00f6c485..37bf838ef 100644 --- a/functions_vars.html +++ b/functions_vars.html @@ -204,7 +204,7 @@ $(function() { diff --git a/functions_w.html b/functions_w.html index 442d62b72..e2c663bc1 100644 --- a/functions_w.html +++ b/functions_w.html @@ -88,7 +88,7 @@ $(function() { diff --git a/functions_~.html b/functions_~.html index 7b4ca9494..6b8a4767a 100644 --- a/functions_~.html +++ b/functions_~.html @@ -78,7 +78,7 @@ $(function() { diff --git a/hex_8hpp_source.html b/hex_8hpp_source.html index 48dda2dcf..25232a7ca 100644 --- a/hex_8hpp_source.html +++ b/hex_8hpp_source.html @@ -232,7 +232,7 @@ $(document).ready(function() { init_codefold(0); }); diff --git a/hierarchy.html b/hierarchy.html index 51efee02f..34e1208be 100644 --- a/hierarchy.html +++ b/hierarchy.html @@ -231,7 +231,7 @@ $(function() { diff --git a/idrec_8hpp_source.html b/idrec_8hpp_source.html index 5d75d156b..dc27e569d 100644 --- a/idrec_8hpp_source.html +++ b/idrec_8hpp_source.html @@ -421,7 +421,7 @@ $(document).ready(function() { init_codefold(0); }); diff --git a/include_2stdex_2compat_8hpp_source.html b/include_2stdex_2compat_8hpp_source.html index 3ad9b0117..652ed39a5 100644 --- a/include_2stdex_2compat_8hpp_source.html +++ b/include_2stdex_2compat_8hpp_source.html @@ -282,7 +282,7 @@ $(document).ready(function() { init_codefold(0); }); diff --git a/index.html b/index.html index 8d25def10..1e8bbcd3b 100644 --- a/index.html +++ b/index.html @@ -76,7 +76,7 @@ $(function() { diff --git a/interval_8hpp_source.html b/interval_8hpp_source.html index 39357e43c..e5b4d547f 100644 --- a/interval_8hpp_source.html +++ b/interval_8hpp_source.html @@ -202,7 +202,7 @@ $(document).ready(function() { init_codefold(0); }); diff --git a/mapping_8hpp_source.html b/mapping_8hpp_source.html index 95074f255..57170edb8 100644 --- a/mapping_8hpp_source.html +++ b/mapping_8hpp_source.html @@ -124,7 +124,7 @@ $(document).ready(function() { init_codefold(0); }); diff --git a/math_8cpp_source.html b/math_8cpp_source.html index 0bd04afd1..975934879 100644 --- a/math_8cpp_source.html +++ b/math_8cpp_source.html @@ -129,7 +129,7 @@ $(document).ready(function() { init_codefold(0); }); diff --git a/math_8hpp_source.html b/math_8hpp_source.html index d39a5bbb1..693fddcd5 100644 --- a/math_8hpp_source.html +++ b/math_8hpp_source.html @@ -134,7 +134,7 @@ $(document).ready(function() { init_codefold(0); }); diff --git a/memory_8hpp_source.html b/memory_8hpp_source.html index a163ec84e..46303d87c 100644 --- a/memory_8hpp_source.html +++ b/memory_8hpp_source.html @@ -128,7 +128,7 @@ $(document).ready(function() { init_codefold(0); }); diff --git a/parser_8cpp_source.html b/parser_8cpp_source.html index 13af1b468..75975a45f 100644 --- a/parser_8cpp_source.html +++ b/parser_8cpp_source.html @@ -403,19 +403,19 @@ $(document).ready(function() { init_codefold(0); });
319 };
320}
stdex::parser::basic_parser< char >
-
stdex::parser::basic_parser::interval
interval< size_t > interval
Region of the last match.
Definition parser.hpp:169
-
stdex::parser::basic_string
Test for given string.
Definition parser.hpp:815
-
stdex::parser::http_header
Test for HTTP header.
Definition parser.hpp:6277
-
stdex::parser::http_request
Test for HTTP request.
Definition parser.hpp:6139
-
stdex::parser::sgml_cp
Test for specific SGML code point.
Definition parser.hpp:340
-
stdex::parser::sgml_space_cp
Test for any SGML space code point.
Definition parser.hpp:427
+
stdex::parser::basic_parser::interval
interval< size_t > interval
Region of the last match.
Definition parser.hpp:170
+
stdex::parser::basic_string
Test for given string.
Definition parser.hpp:816
+
stdex::parser::http_header
Test for HTTP header.
Definition parser.hpp:6278
+
stdex::parser::http_request
Test for HTTP request.
Definition parser.hpp:6140
+
stdex::parser::sgml_cp
Test for specific SGML code point.
Definition parser.hpp:341
+
stdex::parser::sgml_space_cp
Test for any SGML space code point.
Definition parser.hpp:428
stdex::interval::size
T size() const
Returns interval size.
Definition interval.hpp:47
stdex::interval::end
T end
interval end
Definition interval.hpp:20
stdex::interval::start
T start
interval start
Definition interval.hpp:19
diff --git a/parser_8hpp_source.html b/parser_8hpp_source.html index 4c646ade1..4a8a446d4 100644 --- a/parser_8hpp_source.html +++ b/parser_8hpp_source.html @@ -98,6639 +98,6640 @@ $(document).ready(function() { init_codefold(0); });
14#include <assert.h>
15#include <stdarg.h>
16#include <stdint.h>
-
17#if defined(_WIN32)
-
18#ifndef _WINSOCKAPI_
-
19#include <winsock2.h>
-
20#include <ws2ipdef.h>
-
21#endif
-
22#elif defined(__APPLE__)
-
23#include <netinet/in.h>
-
24#else
-
25#include <inaddr.h>
-
26#include <in6addr.h>
-
27#endif
-
28#include <limits>
-
29#include <list>
-
30#include <locale>
-
31#include <memory>
-
32#include <set>
-
33#include <string>
-
34
-
35#ifdef _MSC_VER
-
36#pragma warning(push)
-
37#pragma warning(disable: 4100)
-
38#endif
-
39
-
40#define ENUM_FLAG_OPERATOR(T,X) \
-
41inline 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)); } \
-
42inline 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); } \
-
43inline 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)); } \
-
44inline T& operator X= (T& lhs, const T rhs) { return lhs = lhs X rhs; } \
-
45inline T& operator X= (T& lhs, const std::underlying_type_t<T> rhs) { return lhs = lhs X rhs; }
-
46#define ENUM_FLAGS(T, type) \
-
47enum class T : type; \
-
48inline T operator ~ (T t) { return (T) (~static_cast<std::underlying_type_t <T>>(t)); } \
-
49ENUM_FLAG_OPERATOR(T,|) \
-
50ENUM_FLAG_OPERATOR(T,^) \
-
51ENUM_FLAG_OPERATOR(T,&) \
-
52enum class T : type
-
53
-
54namespace stdex
-
55{
-
56 namespace parser
-
57 {
-
61 constexpr int match_default = 0;
-
62 constexpr int match_case_insensitive = 0x1;
-
63 constexpr int match_multiline = 0x2;
-
64
-
68 template <class T>
-
-
69 class basic_parser
-
70 {
-
71 public:
-
72 basic_parser(_In_ const std::locale& locale = std::locale()) : m_locale(locale) {}
-
73 virtual ~basic_parser() {}
-
74
-
75 bool search(
-
76 _In_reads_or_z_(end) const T* text,
-
77 _In_ size_t start = 0,
-
78 _In_ size_t end = (size_t)-1,
-
79 _In_ int flags = match_default)
-
80 {
-
81 for (size_t i = start; i < end && text[i]; i++)
-
82 if (match(text, i, end, flags))
-
83 return true;
-
84 return false;
-
85 }
-
86
-
87 virtual bool match(
-
88 _In_reads_or_z_(end) const T* text,
-
89 _In_ size_t start = 0,
-
90 _In_ size_t end = (size_t)-1,
-
91 _In_ int flags = match_default) = 0;
-
92
-
93 template<class _Traits, class _Ax>
-
94 inline bool match(
-
95 const std::basic_string<T, _Traits, _Ax>& text,
-
96 _In_ size_t start = 0,
-
97 _In_ size_t end = (size_t)-1,
-
98 _In_ int flags = match_default)
-
99 {
-
100 return match(text.c_str(), start, std::min<size_t>(end, text.size()), flags);
-
101 }
-
102
-
103 virtual void invalidate()
-
104 {
-
105 this->interval.start = 1;
-
106 this->interval.end = 0;
-
107 }
-
108
-
109 protected:
-
111 const wchar_t* next_sgml_cp(_In_ const char* text, _In_ size_t start, _In_ size_t end, _Out_ size_t& chr_end, _Out_ wchar_t(&buf)[3])
-
112 {
-
113 if (text[start] == '&') {
-
114 // Potential entity start
-
115 const auto& ctype = std::use_facet<std::ctype<T>>(m_locale);
-
116 for (chr_end = start + 1;; chr_end++) {
-
117 if (chr_end >= end || text[chr_end] == 0) {
-
118 // Unterminated entity
-
119 break;
-
120 }
-
121 if (text[chr_end] == ';') {
-
122 // Entity end
-
123 size_t n = chr_end - start - 1;
-
124 if (n >= 2 && text[start + 1] == '#') {
-
125 // Numerical entity
-
126 char32_t unicode;
-
127 if (text[start + 2] == 'x' || text[start + 2] == 'X')
-
128 unicode = strtou32(text + start + 3, n - 2, nullptr, 16);
-
129 else
-
130 unicode = strtou32(text + start + 2, n - 1, nullptr, 10);
-
131#ifdef _WIN32
-
132 if (unicode < 0x10000) {
-
133 buf[0] = (wchar_t)unicode;
-
134 buf[1] = 0;
-
135 }
-
136 else {
-
137 ucs4_to_surrogate_pair(buf, unicode);
-
138 buf[2] = 0;
-
139 }
-
140#else
-
141 buf[0] = (wchar_t)unicode;
-
142 buf[1] = 0;
-
143#endif
-
144 chr_end++;
-
145 return buf;
-
146 }
-
147 const wchar_t* entity_w = sgml2uni(text + start + 1, n);
-
148 if (entity_w) {
-
149 chr_end++;
-
150 return entity_w;
-
151 }
-
152 // Unknown entity.
-
153 break;
-
154 }
-
155 else if (text[chr_end] == '&' || ctype.is(ctype.space, text[chr_end])) {
-
156 // This char cannot possibly be a part of entity.
-
157 break;
-
158 }
-
159 }
-
160 }
-
161 buf[0] = text[start];
-
162 buf[1] = 0;
-
163 chr_end = start + 1;
-
164 return buf;
-
165 }
-
167
-
168 public:
-
169 interval<size_t> interval;
-
170
-
171 protected:
-
172 std::locale m_locale;
-
173 };
+
17#include <math.h>
+
18#if defined(_WIN32)
+
19#ifndef _WINSOCKAPI_
+
20#include <winsock2.h>
+
21#include <ws2ipdef.h>
+
22#endif
+
23#elif defined(__APPLE__)
+
24#include <netinet/in.h>
+
25#else
+
26#include <inaddr.h>
+
27#include <in6addr.h>
+
28#endif
+
29#include <limits>
+
30#include <list>
+
31#include <locale>
+
32#include <memory>
+
33#include <set>
+
34#include <string>
+
35
+
36#ifdef _MSC_VER
+
37#pragma warning(push)
+
38#pragma warning(disable: 4100)
+
39#endif
+
40
+
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) \
+
48enum class 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,&) \
+
53enum class T : type
+
54
+
55namespace stdex
+
56{
+
57 namespace parser
+
58 {
+
62 constexpr int match_default = 0;
+
63 constexpr int match_case_insensitive = 0x1;
+
64 constexpr int match_multiline = 0x2;
+
65
+
69 template <class T>
+
+ +
71 {
+
72 public:
+
73 basic_parser(_In_ const std::locale& locale = std::locale()) : m_locale(locale) {}
+
74 virtual ~basic_parser() {}
+
75
+
76 bool search(
+
77 _In_reads_or_z_(end) const T* text,
+
78 _In_ size_t start = 0,
+
79 _In_ size_t end = (size_t)-1,
+
80 _In_ int flags = match_default)
+
81 {
+
82 for (size_t i = start; i < end && text[i]; i++)
+
83 if (match(text, i, end, flags))
+
84 return true;
+
85 return false;
+
86 }
+
87
+
88 virtual bool match(
+
89 _In_reads_or_z_(end) const T* text,
+
90 _In_ size_t start = 0,
+
91 _In_ size_t end = (size_t)-1,
+
92 _In_ int flags = match_default) = 0;
+
93
+
94 template<class _Traits, class _Ax>
+
95 inline bool match(
+
96 const std::basic_string<T, _Traits, _Ax>& text,
+
97 _In_ size_t start = 0,
+
98 _In_ size_t end = (size_t)-1,
+
99 _In_ int flags = match_default)
+
100 {
+
101 return match(text.c_str(), start, std::min<size_t>(end, text.size()), flags);
+
102 }
+
103
+
104 virtual void invalidate()
+
105 {
+
106 this->interval.start = 1;
+
107 this->interval.end = 0;
+
108 }
+
109
+
110 protected:
+
112 const wchar_t* next_sgml_cp(_In_ const char* text, _In_ size_t start, _In_ size_t end, _Out_ size_t& chr_end, _Out_ wchar_t(&buf)[3])
+
113 {
+
114 if (text[start] == '&') {
+
115 // Potential entity start
+
116 const auto& ctype = std::use_facet<std::ctype<T>>(m_locale);
+
117 for (chr_end = start + 1;; chr_end++) {
+
118 if (chr_end >= end || text[chr_end] == 0) {
+
119 // Unterminated entity
+
120 break;
+
121 }
+
122 if (text[chr_end] == ';') {
+
123 // Entity end
+
124 size_t n = chr_end - start - 1;
+
125 if (n >= 2 && text[start + 1] == '#') {
+
126 // Numerical entity
+
127 char32_t unicode;
+
128 if (text[start + 2] == 'x' || text[start + 2] == 'X')
+
129 unicode = strtou32(text + start + 3, n - 2, nullptr, 16);
+
130 else
+
131 unicode = strtou32(text + start + 2, n - 1, nullptr, 10);
+
132#ifdef _WIN32
+
133 if (unicode < 0x10000) {
+
134 buf[0] = (wchar_t)unicode;
+
135 buf[1] = 0;
+
136 }
+
137 else {
+
138 ucs4_to_surrogate_pair(buf, unicode);
+
139 buf[2] = 0;
+
140 }
+
141#else
+
142 buf[0] = (wchar_t)unicode;
+
143 buf[1] = 0;
+
144#endif
+
145 chr_end++;
+
146 return buf;
+
147 }
+
148 const wchar_t* entity_w = sgml2uni(text + start + 1, n);
+
149 if (entity_w) {
+
150 chr_end++;
+
151 return entity_w;
+
152 }
+
153 // Unknown entity.
+
154 break;
+
155 }
+
156 else if (text[chr_end] == '&' || ctype.is(ctype.space, text[chr_end])) {
+
157 // This char cannot possibly be a part of entity.
+
158 break;
+
159 }
+
160 }
+
161 }
+
162 buf[0] = text[start];
+
163 buf[1] = 0;
+
164 chr_end = start + 1;
+
165 return buf;
+
166 }
+
168
+
169 public:
+ +
171
+
172 protected:
+
173 std::locale m_locale;
+
174 };
-
174
-
175 using parser = basic_parser<char>;
-
176 using wparser = basic_parser<wchar_t>;
-
177#ifdef _UNICODE
-
178 using tparser = wparser;
-
179#else
-
180 using tparser = parser;
-
181#endif
-
182 using sgml_parser = basic_parser<char>;
-
183
-
187 template <class T>
-
-
188 class basic_noop : public basic_parser<T>
-
189 {
-
190 public:
-
191 virtual bool match(
-
192 _In_reads_or_z_(end) const T* text,
-
193 _In_ size_t start = 0,
-
194 _In_ size_t end = (size_t)-1,
-
195 _In_ int flags = match_default)
-
196 {
-
197 assert(text || start >= end);
-
198 if (start < end && text[start]) {
-
199 this->interval.start = this->interval.end = start;
-
200 return true;
-
201 }
-
202 this->interval.start = (this->interval.end = start) + 1;
-
203 return false;
-
204 }
-
205 };
+
175
+ + +
178#ifdef _UNICODE
+
179 using tparser = wparser;
+
180#else
+
181 using tparser = parser;
+
182#endif
+ +
184
+
188 template <class T>
+
+
189 class basic_noop : public basic_parser<T>
+
190 {
+
191 public:
+
192 virtual bool match(
+
193 _In_reads_or_z_(end) const T* text,
+
194 _In_ size_t start = 0,
+
195 _In_ size_t end = (size_t)-1,
+
196 _In_ int flags = match_default)
+
197 {
+
198 assert(text || start >= end);
+
199 if (start < end && text[start]) {
+
200 this->interval.start = this->interval.end = start;
+
201 return true;
+
202 }
+
203 this->interval.start = (this->interval.end = start) + 1;
+
204 return false;
+
205 }
+
206 };
-
206
-
207 using noop = basic_noop<char>;
- -
209#ifdef _UNICODE
-
210 using tnoop = wnoop;
-
211#else
-
212 using tnoop = noop;
-
213#endif
- -
215
-
219 template <class T>
-
-
220 class basic_any_cu : public basic_parser<T>
-
221 {
-
222 public:
-
223 basic_any_cu(_In_ const std::locale& locale = std::locale()) : basic_parser<T>(locale) {}
-
224
-
225 virtual bool match(
-
226 _In_reads_or_z_(end) const T* text,
-
227 _In_ size_t start = 0,
-
228 _In_ size_t end = (size_t)-1,
-
229 _In_ int flags = match_default)
-
230 {
-
231 assert(text || start >= end);
-
232 if (start < end && text[start]) {
-
233 this->interval.end = (this->interval.start = start) + 1;
-
234 return true;
-
235 }
-
236 this->interval.start = (this->interval.end = start) + 1;
-
237 return false;
-
238 }
-
239 };
+
207
+
208 using noop = basic_noop<char>;
+ +
210#ifdef _UNICODE
+
211 using tnoop = wnoop;
+
212#else
+
213 using tnoop = noop;
+
214#endif
+ +
216
+
220 template <class T>
+
+
221 class basic_any_cu : public basic_parser<T>
+
222 {
+
223 public:
+
224 basic_any_cu(_In_ const std::locale& locale = std::locale()) : basic_parser<T>(locale) {}
+
225
+
226 virtual bool match(
+
227 _In_reads_or_z_(end) const T* text,
+
228 _In_ size_t start = 0,
+
229 _In_ size_t end = (size_t)-1,
+
230 _In_ int flags = match_default)
+
231 {
+
232 assert(text || start >= end);
+
233 if (start < end && text[start]) {
+
234 this->interval.end = (this->interval.start = start) + 1;
+
235 return true;
+
236 }
+
237 this->interval.start = (this->interval.end = start) + 1;
+
238 return false;
+
239 }
+
240 };
-
240
- - -
243#ifdef _UNICODE
-
244 using tany_cu = wany_cu;
-
245#else
-
246 using tany_cu = any_cu;
-
247#endif
-
248
-
-
252 class sgml_any_cp : public basic_any_cu<char>
-
253 {
-
254 public:
-
255 sgml_any_cp(_In_ const std::locale& locale = std::locale()) : basic_any_cu<char>(locale) {}
-
256
-
257 virtual bool match(
-
258 _In_reads_or_z_(end) const char* text,
-
259 _In_ size_t start = 0,
-
260 _In_ size_t end = (size_t)-1,
-
261 _In_ int flags = match_default)
-
262 {
-
263 assert(text || start >= end);
-
264 if (start < end && text[start]) {
-
265 if (text[start] == '&') {
-
266 // SGML entity
-
267 const auto& ctype = std::use_facet<std::ctype<char>>(m_locale);
-
268 for (this->interval.end = start + 1; this->interval.end < end && text[this->interval.end]; this->interval.end++)
-
269 if (text[this->interval.end] == ';') {
-
270 this->interval.end++;
-
271 this->interval.start = start;
-
272 return true;
-
273 }
-
274 else if (text[this->interval.end] == '&' || ctype.is(ctype.space, text[this->interval.end]))
-
275 break;
-
276 // Unterminated entity
-
277 }
-
278 this->interval.end = (this->interval.start = start) + 1;
-
279 return true;
-
280 }
-
281 this->interval.start = (this->interval.end = start) + 1;
-
282 return false;
-
283 }
-
284 };
+
241
+ + +
244#ifdef _UNICODE
+
245 using tany_cu = wany_cu;
+
246#else
+
247 using tany_cu = any_cu;
+
248#endif
+
249
+
+
253 class sgml_any_cp : public basic_any_cu<char>
+
254 {
+
255 public:
+
256 sgml_any_cp(_In_ const std::locale& locale = std::locale()) : basic_any_cu<char>(locale) {}
+
257
+
258 virtual bool match(
+
259 _In_reads_or_z_(end) const char* text,
+
260 _In_ size_t start = 0,
+
261 _In_ size_t end = (size_t)-1,
+
262 _In_ int flags = match_default)
+
263 {
+
264 assert(text || start >= end);
+
265 if (start < end && text[start]) {
+
266 if (text[start] == '&') {
+
267 // SGML entity
+
268 const auto& ctype = std::use_facet<std::ctype<char>>(m_locale);
+
269 for (this->interval.end = start + 1; this->interval.end < end && text[this->interval.end]; this->interval.end++)
+
270 if (text[this->interval.end] == ';') {
+
271 this->interval.end++;
+
272 this->interval.start = start;
+
273 return true;
+
274 }
+
275 else if (text[this->interval.end] == '&' || ctype.is(ctype.space, text[this->interval.end]))
+
276 break;
+
277 // Unterminated entity
+
278 }
+
279 this->interval.end = (this->interval.start = start) + 1;
+
280 return true;
+
281 }
+
282 this->interval.start = (this->interval.end = start) + 1;
+
283 return false;
+
284 }
+
285 };
-
285
-
289 template <class T>
-
-
290 class basic_cu : public basic_parser<T>
-
291 {
-
292 public:
-
293 basic_cu(T chr, bool invert = false, _In_ const std::locale& locale = std::locale()) :
-
294 basic_parser<T>(locale),
-
295 m_chr(chr),
-
296 m_invert(invert)
-
297 {}
-
298
-
299 virtual bool match(
-
300 _In_reads_or_z_(end) const T* text,
-
301 _In_ size_t start = 0,
-
302 _In_ size_t end = (size_t)-1,
-
303 _In_ int flags = match_default)
-
304 {
-
305 assert(text || start >= end);
-
306 if (start < end && text[start]) {
-
307 bool r;
-
308 if (flags & match_case_insensitive) {
-
309 const auto& ctype = std::use_facet<std::ctype<T>>(this->m_locale);
-
310 r = ctype.tolower(text[start]) == ctype.tolower(m_chr);
-
311 }
-
312 else
-
313 r = text[start] == m_chr;
-
314 if ((r && !m_invert) || (!r && m_invert)) {
-
315 this->interval.end = (this->interval.start = start) + 1;
-
316 return true;
-
317 }
-
318 }
-
319 this->interval.start = (this->interval.end = start) + 1;
-
320 return false;
-
321 }
-
322
-
323 protected:
-
324 T m_chr;
-
325 bool m_invert;
-
326 };
+
286
+
290 template <class T>
+
+
291 class basic_cu : public basic_parser<T>
+
292 {
+
293 public:
+
294 basic_cu(T chr, bool invert = false, _In_ const std::locale& locale = std::locale()) :
+
295 basic_parser<T>(locale),
+
296 m_chr(chr),
+
297 m_invert(invert)
+
298 {}
+
299
+
300 virtual bool match(
+
301 _In_reads_or_z_(end) const T* text,
+
302 _In_ size_t start = 0,
+
303 _In_ size_t end = (size_t)-1,
+
304 _In_ int flags = match_default)
+
305 {
+
306 assert(text || start >= end);
+
307 if (start < end && text[start]) {
+
308 bool r;
+
309 if (flags & match_case_insensitive) {
+
310 const auto& ctype = std::use_facet<std::ctype<T>>(this->m_locale);
+
311 r = ctype.tolower(text[start]) == ctype.tolower(m_chr);
+
312 }
+
313 else
+
314 r = text[start] == m_chr;
+
315 if ((r && !m_invert) || (!r && m_invert)) {
+
316 this->interval.end = (this->interval.start = start) + 1;
+
317 return true;
+
318 }
+
319 }
+
320 this->interval.start = (this->interval.end = start) + 1;
+
321 return false;
+
322 }
+
323
+
324 protected:
+
325 T m_chr;
+
326 bool m_invert;
+
327 };
-
327
-
328 using cu = basic_cu<char>;
-
329 using wcu = basic_cu<wchar_t>;
-
330#ifdef _UNICODE
-
331 using tcu = wcu;
-
332#else
-
333 using tcu = cu;
-
334#endif
-
335
-
-
339 class sgml_cp : public sgml_parser
-
340 {
-
341 public:
-
342 sgml_cp(const char* chr, size_t count = (size_t)-1, bool invert = false, _In_ const std::locale& locale = std::locale()) :
-
343 sgml_parser(locale),
-
344 m_invert(invert)
-
345 {
-
346 assert(chr || !count);
-
347 wchar_t buf[3];
-
348 size_t chr_end;
-
349 m_chr.assign(count ? next_sgml_cp(chr, 0, count, chr_end, buf) : L"");
-
350 }
-
351
-
352 virtual bool match(
-
353 _In_reads_or_z_(end) const char* text,
-
354 _In_ size_t start = 0,
-
355 _In_ size_t end = (size_t)-1,
-
356 _In_ int flags = match_default)
-
357 {
-
358 assert(text || start >= end);
-
359 if (start < end && text[start]) {
-
360 wchar_t buf[3];
-
361 const wchar_t* chr = next_sgml_cp(text, start, end, this->interval.end, buf);
-
362 bool r = ((flags & match_case_insensitive) ?
-
363 stdex::strnicmp(chr, (size_t)-1, m_chr.c_str(), m_chr.size(), m_locale) :
-
364 stdex::strncmp(chr, (size_t)-1, m_chr.c_str(), m_chr.size())) == 0;
-
365 if ((r && !m_invert) || (!r && m_invert)) {
-
366 this->interval.start = start;
-
367 return true;
-
368 }
-
369 }
-
370 this->interval.start = (this->interval.end = start) + 1;
-
371 return false;
-
372 }
-
373
-
374 protected:
-
375 std::wstring m_chr;
-
376 bool m_invert;
-
377 };
+
328
+
329 using cu = basic_cu<char>;
+
330 using wcu = basic_cu<wchar_t>;
+
331#ifdef _UNICODE
+
332 using tcu = wcu;
+
333#else
+
334 using tcu = cu;
+
335#endif
+
336
+
+
340 class sgml_cp : public sgml_parser
+
341 {
+
342 public:
+
343 sgml_cp(const char* chr, size_t count = (size_t)-1, bool invert = false, _In_ const std::locale& locale = std::locale()) :
+
344 sgml_parser(locale),
+
345 m_invert(invert)
+
346 {
+
347 assert(chr || !count);
+
348 wchar_t buf[3];
+
349 size_t chr_end;
+
350 m_chr.assign(count ? next_sgml_cp(chr, 0, count, chr_end, buf) : L"");
+
351 }
+
352
+
353 virtual bool match(
+
354 _In_reads_or_z_(end) const char* text,
+
355 _In_ size_t start = 0,
+
356 _In_ size_t end = (size_t)-1,
+
357 _In_ int flags = match_default)
+
358 {
+
359 assert(text || start >= end);
+
360 if (start < end && text[start]) {
+
361 wchar_t buf[3];
+
362 const wchar_t* chr = next_sgml_cp(text, start, end, this->interval.end, buf);
+
363 bool r = ((flags & match_case_insensitive) ?
+
364 stdex::strnicmp(chr, (size_t)-1, m_chr.c_str(), m_chr.size(), m_locale) :
+
365 stdex::strncmp(chr, (size_t)-1, m_chr.c_str(), m_chr.size())) == 0;
+
366 if ((r && !m_invert) || (!r && m_invert)) {
+
367 this->interval.start = start;
+
368 return true;
+
369 }
+
370 }
+
371 this->interval.start = (this->interval.end = start) + 1;
+
372 return false;
+
373 }
+
374
+
375 protected:
+
376 std::wstring m_chr;
+
377 bool m_invert;
+
378 };
-
378
-
382 template <class T>
-
-
383 class basic_space_cu : public basic_parser<T>
-
384 {
-
385 public:
-
386 basic_space_cu(bool invert = false, _In_ const std::locale& locale = std::locale()) :
-
387 basic_parser<T>(locale),
-
388 m_invert(invert)
-
389 {}
-
390
-
391 virtual bool match(
-
392 _In_reads_or_z_(end) const T* text,
-
393 _In_ size_t start = 0,
-
394 _In_ size_t end = (size_t)-1,
-
395 _In_ int flags = match_default)
-
396 {
-
397 assert(text || start >= end);
-
398 if (start < end && text[start]) {
-
399 bool r =
-
400 ((flags & match_multiline) || !islbreak(text[start])) &&
-
401 std::use_facet<std::ctype<T>>(this->m_locale).is(std::ctype_base::space, text[start]);
-
402 if ((r && !m_invert) || (!r && m_invert)) {
-
403 this->interval.end = (this->interval.start = start) + 1;
-
404 return true;
-
405 }
-
406 }
-
407 this->interval.start = (this->interval.end = start) + 1;
-
408 return false;
-
409 }
-
410
-
411 protected:
-
412 bool m_invert;
-
413 };
+
379
+
383 template <class T>
+
+
384 class basic_space_cu : public basic_parser<T>
+
385 {
+
386 public:
+
387 basic_space_cu(bool invert = false, _In_ const std::locale& locale = std::locale()) :
+
388 basic_parser<T>(locale),
+
389 m_invert(invert)
+
390 {}
+
391
+
392 virtual bool match(
+
393 _In_reads_or_z_(end) const T* text,
+
394 _In_ size_t start = 0,
+
395 _In_ size_t end = (size_t)-1,
+
396 _In_ int flags = match_default)
+
397 {
+
398 assert(text || start >= end);
+
399 if (start < end && text[start]) {
+
400 bool r =
+
401 ((flags & match_multiline) || !islbreak(text[start])) &&
+
402 std::use_facet<std::ctype<T>>(this->m_locale).is(std::ctype_base::space, text[start]);
+
403 if ((r && !m_invert) || (!r && m_invert)) {
+
404 this->interval.end = (this->interval.start = start) + 1;
+
405 return true;
+
406 }
+
407 }
+
408 this->interval.start = (this->interval.end = start) + 1;
+
409 return false;
+
410 }
+
411
+
412 protected:
+
413 bool m_invert;
+
414 };
-
414
- - -
417#ifdef _UNICODE
-
418 using tspace_cu = wspace_cu;
-
419#else
-
420 using tspace_cu = space_cu;
-
421#endif
-
422
-
-
426 class sgml_space_cp : public basic_space_cu<char>
-
427 {
-
428 public:
-
429 sgml_space_cp(_In_ bool invert = false, _In_ const std::locale& locale = std::locale()) :
- -
431 {}
-
432
-
433 virtual bool match(
-
434 _In_reads_or_z_(end) const char* text,
-
435 _In_ size_t start = 0,
-
436 _In_ size_t end = (size_t)-1,
-
437 _In_ int flags = match_default)
-
438 {
-
439 assert(text || start >= end);
-
440 if (start < end && text[start]) {
-
441 wchar_t buf[3];
-
442 const wchar_t* chr = next_sgml_cp(text, start, end, this->interval.end, buf);
-
443 const wchar_t* chr_end = chr + stdex::strlen(chr);
-
444 bool r =
-
445 ((flags & match_multiline) || !islbreak(chr, (size_t)-1)) &&
-
446 std::use_facet<std::ctype<wchar_t>>(m_locale).scan_not(std::ctype_base::space, chr, chr_end) == chr_end;
-
447 if ((r && !m_invert) || (!r && m_invert)) {
-
448 this->interval.start = start;
-
449 return true;
-
450 }
-
451 }
-
452
-
453 this->interval.start = (this->interval.end = start) + 1;
-
454 return false;
-
455 }
-
456 };
+
415
+ + +
418#ifdef _UNICODE
+
419 using tspace_cu = wspace_cu;
+
420#else
+
421 using tspace_cu = space_cu;
+
422#endif
+
423
+
+
427 class sgml_space_cp : public basic_space_cu<char>
+
428 {
+
429 public:
+
430 sgml_space_cp(_In_ bool invert = false, _In_ const std::locale& locale = std::locale()) :
+ +
432 {}
+
433
+
434 virtual bool match(
+
435 _In_reads_or_z_(end) const char* text,
+
436 _In_ size_t start = 0,
+
437 _In_ size_t end = (size_t)-1,
+
438 _In_ int flags = match_default)
+
439 {
+
440 assert(text || start >= end);
+
441 if (start < end && text[start]) {
+
442 wchar_t buf[3];
+
443 const wchar_t* chr = next_sgml_cp(text, start, end, this->interval.end, buf);
+
444 const wchar_t* chr_end = chr + stdex::strlen(chr);
+
445 bool r =
+
446 ((flags & match_multiline) || !islbreak(chr, (size_t)-1)) &&
+
447 std::use_facet<std::ctype<wchar_t>>(m_locale).scan_not(std::ctype_base::space, chr, chr_end) == chr_end;
+
448 if ((r && !m_invert) || (!r && m_invert)) {
+
449 this->interval.start = start;
+
450 return true;
+
451 }
+
452 }
+
453
+
454 this->interval.start = (this->interval.end = start) + 1;
+
455 return false;
+
456 }
+
457 };
-
457
-
461 template <class T>
-
-
462 class basic_punct_cu : public basic_parser<T>
-
463 {
-
464 public:
-
465 basic_punct_cu(bool invert = false, _In_ const std::locale& locale = std::locale()) :
-
466 basic_parser<T>(locale),
-
467 m_invert(invert)
-
468 {}
-
469
-
470 virtual bool match(
-
471 _In_reads_or_z_(end) const T* text,
-
472 _In_ size_t start = 0,
-
473 _In_ size_t end = (size_t)-1,
-
474 _In_ int flags = match_default)
-
475 {
-
476 assert(text || start >= end);
-
477 if (start < end && text[start]) {
-
478 bool r = std::use_facet<std::ctype<T>>(this->m_locale).is(std::ctype_base::punct, text[start]);
-
479 if ((r && !m_invert) || (!r && m_invert)) {
-
480 this->interval.end = (this->interval.start = start) + 1;
-
481 return true;
-
482 }
-
483 }
-
484 this->interval.start = (this->interval.end = start) + 1;
-
485 return false;
-
486 }
-
487
-
488 protected:
-
489 bool m_invert;
-
490 };
+
458
+
462 template <class T>
+
+
463 class basic_punct_cu : public basic_parser<T>
+
464 {
+
465 public:
+
466 basic_punct_cu(bool invert = false, _In_ const std::locale& locale = std::locale()) :
+
467 basic_parser<T>(locale),
+
468 m_invert(invert)
+
469 {}
+
470
+
471 virtual bool match(
+
472 _In_reads_or_z_(end) const T* text,
+
473 _In_ size_t start = 0,
+
474 _In_ size_t end = (size_t)-1,
+
475 _In_ int flags = match_default)
+
476 {
+
477 assert(text || start >= end);
+
478 if (start < end && text[start]) {
+
479 bool r = std::use_facet<std::ctype<T>>(this->m_locale).is(std::ctype_base::punct, text[start]);
+
480 if ((r && !m_invert) || (!r && m_invert)) {
+
481 this->interval.end = (this->interval.start = start) + 1;
+
482 return true;
+
483 }
+
484 }
+
485 this->interval.start = (this->interval.end = start) + 1;
+
486 return false;
+
487 }
+
488
+
489 protected:
+
490 bool m_invert;
+
491 };
-
491
- - -
494#ifdef _UNICODE
-
495 using tpunct_cu = wpunct_cu;
-
496#else
-
497 using tpunct_cu = punct_cu;
-
498#endif
-
499
-
-
503 class sgml_punct_cp : public basic_punct_cu<char>
-
504 {
-
505 public:
-
506 sgml_punct_cp(bool invert = false, _In_ const std::locale& locale = std::locale()) :
- -
508 {}
-
509
-
510 virtual bool match(
-
511 _In_reads_or_z_(end) const char* text,
-
512 _In_ size_t start = 0,
-
513 _In_ size_t end = (size_t)-1,
-
514 _In_ int flags = match_default)
-
515 {
-
516 assert(text || start >= end);
-
517 if (start < end && text[start]) {
-
518 wchar_t buf[3];
-
519 const wchar_t* chr = next_sgml_cp(text, start, end, this->interval.end, buf);
-
520 const wchar_t* chr_end = chr + stdex::strlen(chr);
-
521 bool r = std::use_facet<std::ctype<wchar_t>>(m_locale).scan_not(std::ctype_base::punct, chr, chr_end) == chr_end;
-
522 if ((r && !m_invert) || (!r && m_invert)) {
-
523 this->interval.start = start;
-
524 return true;
-
525 }
-
526 }
-
527 this->interval.start = (this->interval.end = start) + 1;
-
528 return false;
-
529 }
-
530 };
+
492
+ + +
495#ifdef _UNICODE
+
496 using tpunct_cu = wpunct_cu;
+
497#else
+
498 using tpunct_cu = punct_cu;
+
499#endif
+
500
+
+
504 class sgml_punct_cp : public basic_punct_cu<char>
+
505 {
+
506 public:
+
507 sgml_punct_cp(bool invert = false, _In_ const std::locale& locale = std::locale()) :
+ +
509 {}
+
510
+
511 virtual bool match(
+
512 _In_reads_or_z_(end) const char* text,
+
513 _In_ size_t start = 0,
+
514 _In_ size_t end = (size_t)-1,
+
515 _In_ int flags = match_default)
+
516 {
+
517 assert(text || start >= end);
+
518 if (start < end && text[start]) {
+
519 wchar_t buf[3];
+
520 const wchar_t* chr = next_sgml_cp(text, start, end, this->interval.end, buf);
+
521 const wchar_t* chr_end = chr + stdex::strlen(chr);
+
522 bool r = std::use_facet<std::ctype<wchar_t>>(m_locale).scan_not(std::ctype_base::punct, chr, chr_end) == chr_end;
+
523 if ((r && !m_invert) || (!r && m_invert)) {
+
524 this->interval.start = start;
+
525 return true;
+
526 }
+
527 }
+
528 this->interval.start = (this->interval.end = start) + 1;
+
529 return false;
+
530 }
+
531 };
-
531
-
535 template <class T>
-
- -
537 {
-
538 public:
-
539 basic_space_or_punct_cu(bool invert = false, _In_ const std::locale& locale = std::locale()) :
-
540 basic_parser<T>(locale),
-
541 m_invert(invert)
-
542 {}
-
543
-
544 virtual bool match(
-
545 _In_reads_or_z_(end) const T* text,
-
546 _In_ size_t start = 0,
-
547 _In_ size_t end = (size_t)-1,
-
548 _In_ int flags = match_default)
-
549 {
-
550 assert(text || start >= end);
-
551 if (start < end && text[start]) {
-
552 bool r =
-
553 ((flags & match_multiline) || !islbreak(text[start])) &&
-
554 std::use_facet<std::ctype<T>>(this->m_locale).is(std::ctype_base::space | std::ctype_base::punct, text[start]);
-
555 if ((r && !m_invert) || (!r && m_invert)) {
-
556 this->interval.end = (this->interval.start = start) + 1;
-
557 return true;
-
558 }
-
559 }
-
560 this->interval.start = (this->interval.end = start) + 1;
-
561 return false;
-
562 }
-
563
-
564 protected:
-
565 bool m_invert;
-
566 };
+
532
+
536 template <class T>
+
+ +
538 {
+
539 public:
+
540 basic_space_or_punct_cu(bool invert = false, _In_ const std::locale& locale = std::locale()) :
+
541 basic_parser<T>(locale),
+
542 m_invert(invert)
+
543 {}
+
544
+
545 virtual bool match(
+
546 _In_reads_or_z_(end) const T* text,
+
547 _In_ size_t start = 0,
+
548 _In_ size_t end = (size_t)-1,
+
549 _In_ int flags = match_default)
+
550 {
+
551 assert(text || start >= end);
+
552 if (start < end && text[start]) {
+
553 bool r =
+
554 ((flags & match_multiline) || !islbreak(text[start])) &&
+
555 std::use_facet<std::ctype<T>>(this->m_locale).is(std::ctype_base::space | std::ctype_base::punct, text[start]);
+
556 if ((r && !m_invert) || (!r && m_invert)) {
+
557 this->interval.end = (this->interval.start = start) + 1;
+
558 return true;
+
559 }
+
560 }
+
561 this->interval.start = (this->interval.end = start) + 1;
+
562 return false;
+
563 }
+
564
+
565 protected:
+
566 bool m_invert;
+
567 };
-
567
- - -
570#ifdef _UNICODE
- -
572#else
- -
574#endif
-
575
-
- -
580 {
-
581 public:
-
582 sgml_space_or_punct_cp(bool invert = false, _In_ const std::locale& locale = std::locale()) :
- -
584 {}
-
585
-
586 virtual bool match(
-
587 _In_reads_or_z_(end) const char* text,
-
588 _In_ size_t start = 0,
-
589 _In_ size_t end = (size_t)-1,
-
590 _In_ int flags = match_default)
-
591 {
-
592 assert(text || start >= end);
-
593 if (start < end && text[start]) {
-
594 wchar_t buf[3];
-
595 const wchar_t* chr = next_sgml_cp(text, start, end, this->interval.end, buf);
-
596 const wchar_t* chr_end = chr + stdex::strlen(chr);
-
597 bool r =
-
598 ((flags & match_multiline) || !islbreak(chr, (size_t)-1)) &&
-
599 std::use_facet<std::ctype<wchar_t>>(m_locale).scan_not(std::ctype_base::space | std::ctype_base::punct, chr, chr_end) == chr_end;
-
600 if ((r && !m_invert) || (!r && m_invert)) {
-
601 this->interval.start = start;
-
602 return true;
-
603 }
-
604 }
-
605 this->interval.start = (this->interval.end = start) + 1;
-
606 return false;
-
607 }
-
608 };
+
568
+ + +
571#ifdef _UNICODE
+ +
573#else
+ +
575#endif
+
576
+
+ +
581 {
+
582 public:
+
583 sgml_space_or_punct_cp(bool invert = false, _In_ const std::locale& locale = std::locale()) :
+ +
585 {}
+
586
+
587 virtual bool match(
+
588 _In_reads_or_z_(end) const char* text,
+
589 _In_ size_t start = 0,
+
590 _In_ size_t end = (size_t)-1,
+
591 _In_ int flags = match_default)
+
592 {
+
593 assert(text || start >= end);
+
594 if (start < end && text[start]) {
+
595 wchar_t buf[3];
+
596 const wchar_t* chr = next_sgml_cp(text, start, end, this->interval.end, buf);
+
597 const wchar_t* chr_end = chr + stdex::strlen(chr);
+
598 bool r =
+
599 ((flags & match_multiline) || !islbreak(chr, (size_t)-1)) &&
+
600 std::use_facet<std::ctype<wchar_t>>(m_locale).scan_not(std::ctype_base::space | std::ctype_base::punct, chr, chr_end) == chr_end;
+
601 if ((r && !m_invert) || (!r && m_invert)) {
+
602 this->interval.start = start;
+
603 return true;
+
604 }
+
605 }
+
606 this->interval.start = (this->interval.end = start) + 1;
+
607 return false;
+
608 }
+
609 };
-
609
-
613 template <class T>
-
-
614 class basic_bol : public basic_parser<T>
-
615 {
-
616 public:
-
617 basic_bol(bool invert = false) : m_invert(invert) {}
-
618
-
619 virtual bool match(
-
620 _In_reads_or_z_(end) const T* text,
-
621 _In_ size_t start = 0,
-
622 _In_ size_t end = (size_t)-1,
-
623 _In_ int flags = match_default)
-
624 {
-
625 assert(text || start >= end);
-
626 bool r = start == 0 || (start <= end && islbreak(text[start - 1]));
-
627 if ((r && !m_invert) || (!r && m_invert)) {
-
628 this->interval.end = this->interval.start = start;
-
629 return true;
-
630 }
-
631 this->interval.start = (this->interval.end = start) + 1;
-
632 return false;
-
633 }
-
634
-
635 protected:
-
636 bool m_invert;
-
637 };
+
610
+
614 template <class T>
+
+
615 class basic_bol : public basic_parser<T>
+
616 {
+
617 public:
+
618 basic_bol(bool invert = false) : m_invert(invert) {}
+
619
+
620 virtual bool match(
+
621 _In_reads_or_z_(end) const T* text,
+
622 _In_ size_t start = 0,
+
623 _In_ size_t end = (size_t)-1,
+
624 _In_ int flags = match_default)
+
625 {
+
626 assert(text || start >= end);
+
627 bool r = start == 0 || (start <= end && islbreak(text[start - 1]));
+
628 if ((r && !m_invert) || (!r && m_invert)) {
+
629 this->interval.end = this->interval.start = start;
+
630 return true;
+
631 }
+
632 this->interval.start = (this->interval.end = start) + 1;
+
633 return false;
+
634 }
+
635
+
636 protected:
+
637 bool m_invert;
+
638 };
-
638
-
639 using bol = basic_bol<char>;
-
640 using wbol = basic_bol<wchar_t>;
-
641#ifdef _UNICODE
-
642 using tbol = wbol;
-
643#else
-
644 using tbol = bol;
-
645#endif
- -
647
-
651 template <class T>
-
-
652 class basic_eol : public basic_parser<T>
-
653 {
-
654 public:
-
655 basic_eol(bool invert = false) : m_invert(invert) {}
-
656
-
657 virtual bool match(
-
658 _In_reads_or_z_(end) const T* text,
-
659 _In_ size_t start = 0,
-
660 _In_ size_t end = (size_t)-1,
-
661 _In_ int flags = match_default)
-
662 {
-
663 assert(text || start >= end);
-
664 bool r = islbreak(text[start]);
-
665 if ((r && !m_invert) || (!r && m_invert)) {
-
666 this->interval.end = this->interval.start = start;
-
667 return true;
-
668 }
-
669 this->interval.start = (this->interval.end = start) + 1;
-
670 return false;
-
671 }
-
672
-
673 protected:
-
674 bool m_invert;
-
675 };
+
639
+
640 using bol = basic_bol<char>;
+
641 using wbol = basic_bol<wchar_t>;
+
642#ifdef _UNICODE
+
643 using tbol = wbol;
+
644#else
+
645 using tbol = bol;
+
646#endif
+ +
648
+
652 template <class T>
+
+
653 class basic_eol : public basic_parser<T>
+
654 {
+
655 public:
+
656 basic_eol(bool invert = false) : m_invert(invert) {}
+
657
+
658 virtual bool match(
+
659 _In_reads_or_z_(end) const T* text,
+
660 _In_ size_t start = 0,
+
661 _In_ size_t end = (size_t)-1,
+
662 _In_ int flags = match_default)
+
663 {
+
664 assert(text || start >= end);
+
665 bool r = islbreak(text[start]);
+
666 if ((r && !m_invert) || (!r && m_invert)) {
+
667 this->interval.end = this->interval.start = start;
+
668 return true;
+
669 }
+
670 this->interval.start = (this->interval.end = start) + 1;
+
671 return false;
+
672 }
+
673
+
674 protected:
+
675 bool m_invert;
+
676 };
-
676
-
677 using eol = basic_eol<char>;
-
678 using weol = basic_eol<wchar_t>;
-
679#ifdef _UNICODE
-
680 using teol = weol;
-
681#else
-
682 using teol = eol;
-
683#endif
- -
685
-
686 template <class T>
-
-
687 class basic_set : public basic_parser<T>
-
688 {
-
689 public:
-
690 basic_set(bool invert = false, _In_ const std::locale& locale = std::locale()) :
-
691 basic_parser<T>(locale),
-
692 hit_offset((size_t)-1),
-
693 m_invert(invert)
-
694 {}
-
695
-
696 virtual bool match(
-
697 _In_reads_or_z_(end) const T* text,
-
698 _In_ size_t start = 0,
-
699 _In_ size_t end = (size_t)-1,
-
700 _In_ int flags = match_default) = 0;
-
701
-
702 virtual void invalidate()
-
703 {
-
704 hit_offset = (size_t)-1;
- -
706 }
-
707
-
708 public:
-
709 size_t hit_offset;
-
710
-
711 protected:
-
712 bool m_invert;
-
713 };
+
677
+
678 using eol = basic_eol<char>;
+
679 using weol = basic_eol<wchar_t>;
+
680#ifdef _UNICODE
+
681 using teol = weol;
+
682#else
+
683 using teol = eol;
+
684#endif
+ +
686
+
687 template <class T>
+
+
688 class basic_set : public basic_parser<T>
+
689 {
+
690 public:
+
691 basic_set(bool invert = false, _In_ const std::locale& locale = std::locale()) :
+
692 basic_parser<T>(locale),
+
693 hit_offset((size_t)-1),
+
694 m_invert(invert)
+
695 {}
+
696
+
697 virtual bool match(
+
698 _In_reads_or_z_(end) const T* text,
+
699 _In_ size_t start = 0,
+
700 _In_ size_t end = (size_t)-1,
+
701 _In_ int flags = match_default) = 0;
+
702
+
703 virtual void invalidate()
+
704 {
+
705 hit_offset = (size_t)-1;
+ +
707 }
+
708
+
709 public:
+
710 size_t hit_offset;
+
711
+
712 protected:
+
713 bool m_invert;
+
714 };
-
714
-
718 template <class T>
-
-
719 class basic_cu_set : public basic_set<T>
-
720 {
-
721 public:
- -
723 _In_reads_or_z_(count) const T* set,
-
724 _In_ size_t count = (size_t)-1,
-
725 _In_ bool invert = false,
-
726 _In_ const std::locale& locale = std::locale()) :
-
727 basic_set<T>(invert, locale)
-
728 {
-
729 if (set)
-
730 m_set.assign(set, set + stdex::strnlen(set, count));
-
731 }
-
732
-
733 virtual bool match(
-
734 _In_reads_or_z_(end) const T* text,
-
735 _In_ size_t start = 0,
-
736 _In_ size_t end = (size_t)-1,
-
737 _In_ int flags = match_default)
-
738 {
-
739 assert(text || start >= end);
-
740 if (start < end && text[start]) {
-
741 const T* set = m_set.c_str();
-
742 size_t r = (flags & match_case_insensitive) ?
-
743 stdex::strnichr(set, m_set.size(), text[start], this->m_locale) :
-
744 stdex::strnchr(set, m_set.size(), text[start]);
-
745 if ((r != stdex::npos && !this->m_invert) || (r == stdex::npos && this->m_invert)) {
-
746 this->hit_offset = r;
-
747 this->interval.end = (this->interval.start = start) + 1;
-
748 return true;
-
749 }
-
750 }
-
751 this->hit_offset = (size_t)-1;
-
752 this->interval.start = (this->interval.end = start) + 1;
-
753 return false;
-
754 }
-
755
-
756 protected:
-
757 std::basic_string<T> m_set;
-
758 };
+
715
+
719 template <class T>
+
+
720 class basic_cu_set : public basic_set<T>
+
721 {
+
722 public:
+ +
724 _In_reads_or_z_(count) const T* set,
+
725 _In_ size_t count = (size_t)-1,
+
726 _In_ bool invert = false,
+
727 _In_ const std::locale& locale = std::locale()) :
+
728 basic_set<T>(invert, locale)
+
729 {
+
730 if (set)
+
731 m_set.assign(set, set + stdex::strnlen(set, count));
+
732 }
+
733
+
734 virtual bool match(
+
735 _In_reads_or_z_(end) const T* text,
+
736 _In_ size_t start = 0,
+
737 _In_ size_t end = (size_t)-1,
+
738 _In_ int flags = match_default)
+
739 {
+
740 assert(text || start >= end);
+
741 if (start < end && text[start]) {
+
742 const T* set = m_set.c_str();
+
743 size_t r = (flags & match_case_insensitive) ?
+
744 stdex::strnichr(set, m_set.size(), text[start], this->m_locale) :
+
745 stdex::strnchr(set, m_set.size(), text[start]);
+
746 if ((r != stdex::npos && !this->m_invert) || (r == stdex::npos && this->m_invert)) {
+
747 this->hit_offset = r;
+
748 this->interval.end = (this->interval.start = start) + 1;
+
749 return true;
+
750 }
+
751 }
+
752 this->hit_offset = (size_t)-1;
+
753 this->interval.start = (this->interval.end = start) + 1;
+
754 return false;
+
755 }
+
756
+
757 protected:
+
758 std::basic_string<T> m_set;
+
759 };
-
759
- - -
762#ifdef _UNICODE
-
763 using tcu_set = wcu_set;
-
764#else
-
765 using tcu_set = cu_set;
-
766#endif
-
767
-
-
771 class sgml_cp_set : public basic_set<char>
-
772 {
-
773 public:
-
774 sgml_cp_set(const char* set, size_t count = (size_t)-1, bool invert = false, _In_ const std::locale& locale = std::locale()) :
-
775 basic_set<char>(invert, locale)
-
776 {
-
777 if (set)
-
778 m_set = sgml2wstr(set, count);
-
779 }
-
780
-
781 virtual bool match(
-
782 _In_reads_or_z_(end) const char* text,
-
783 _In_ size_t start = 0,
-
784 _In_ size_t end = (size_t)-1,
-
785 _In_ int flags = match_default)
-
786 {
-
787 assert(text || start >= end);
-
788 if (start < end && text[start]) {
-
789 wchar_t buf[3];
-
790 const wchar_t* chr = next_sgml_cp(text, start, end, this->interval.end, buf);
-
791 const wchar_t* set = m_set.c_str();
-
792 size_t r = (flags & match_case_insensitive) ?
-
793 stdex::strnistr(set, m_set.size(), chr, m_locale) :
-
794 stdex::strnstr(set, m_set.size(), chr);
-
795 if ((r != stdex::npos && !m_invert) || (r == stdex::npos && m_invert)) {
-
796 hit_offset = r;
-
797 this->interval.start = start;
-
798 return true;
-
799 }
-
800 }
-
801 hit_offset = (size_t)-1;
-
802 this->interval.start = (this->interval.end = start) + 1;
-
803 return false;
-
804 }
-
805
-
806 protected:
-
807 std::wstring m_set;
-
808 };
+
760
+ + +
763#ifdef _UNICODE
+
764 using tcu_set = wcu_set;
+
765#else
+
766 using tcu_set = cu_set;
+
767#endif
+
768
+
+
772 class sgml_cp_set : public basic_set<char>
+
773 {
+
774 public:
+
775 sgml_cp_set(const char* set, size_t count = (size_t)-1, bool invert = false, _In_ const std::locale& locale = std::locale()) :
+
776 basic_set<char>(invert, locale)
+
777 {
+
778 if (set)
+
779 m_set = sgml2wstr(set, count);
+
780 }
+
781
+
782 virtual bool match(
+
783 _In_reads_or_z_(end) const char* text,
+
784 _In_ size_t start = 0,
+
785 _In_ size_t end = (size_t)-1,
+
786 _In_ int flags = match_default)
+
787 {
+
788 assert(text || start >= end);
+
789 if (start < end && text[start]) {
+
790 wchar_t buf[3];
+
791 const wchar_t* chr = next_sgml_cp(text, start, end, this->interval.end, buf);
+
792 const wchar_t* set = m_set.c_str();
+
793 size_t r = (flags & match_case_insensitive) ?
+
794 stdex::strnistr(set, m_set.size(), chr, m_locale) :
+
795 stdex::strnstr(set, m_set.size(), chr);
+
796 if ((r != stdex::npos && !m_invert) || (r == stdex::npos && m_invert)) {
+
797 hit_offset = r;
+
798 this->interval.start = start;
+
799 return true;
+
800 }
+
801 }
+
802 hit_offset = (size_t)-1;
+
803 this->interval.start = (this->interval.end = start) + 1;
+
804 return false;
+
805 }
+
806
+
807 protected:
+
808 std::wstring m_set;
+
809 };
-
809
-
813 template <class T>
-
-
814 class basic_string : public basic_parser<T>
-
815 {
-
816 public:
- -
818 _In_reads_or_z_(count) const T* str,
-
819 _In_ size_t count = (size_t)-1,
-
820 _In_ const std::locale& locale = std::locale()) :
-
821 basic_parser<T>(locale),
-
822 m_str(str, str + stdex::strnlen(str, count))
-
823 {}
-
824
-
825 virtual bool match(
-
826 _In_reads_or_z_(end) const T* text,
-
827 _In_ size_t start = 0,
-
828 _In_ size_t end = (size_t)-1,
-
829 _In_ int flags = match_default)
-
830 {
-
831 assert(text || start >= end);
-
832 size_t
-
833 m = m_str.size(),
-
834 n = std::min<size_t>(end - start, m);
-
835 bool r = ((flags & match_case_insensitive) ?
-
836 stdex::strnicmp(text + start, n, m_str.c_str(), m, this->m_locale) :
-
837 stdex::strncmp(text + start, n, m_str.c_str(), m)) == 0;
-
838 if (r) {
-
839 this->interval.end = (this->interval.start = start) + n;
-
840 return true;
-
841 }
-
842 this->interval.start = (this->interval.end = start) + 1;
-
843 return false;
-
844 }
-
845
-
846 protected:
-
847 std::basic_string<T> m_str;
-
848 };
+
810
+
814 template <class T>
+
+
815 class basic_string : public basic_parser<T>
+
816 {
+
817 public:
+ +
819 _In_reads_or_z_(count) const T* str,
+
820 _In_ size_t count = (size_t)-1,
+
821 _In_ const std::locale& locale = std::locale()) :
+
822 basic_parser<T>(locale),
+
823 m_str(str, str + stdex::strnlen(str, count))
+
824 {}
+
825
+
826 virtual bool match(
+
827 _In_reads_or_z_(end) const T* text,
+
828 _In_ size_t start = 0,
+
829 _In_ size_t end = (size_t)-1,
+
830 _In_ int flags = match_default)
+
831 {
+
832 assert(text || start >= end);
+
833 size_t
+
834 m = m_str.size(),
+
835 n = std::min<size_t>(end - start, m);
+
836 bool r = ((flags & match_case_insensitive) ?
+
837 stdex::strnicmp(text + start, n, m_str.c_str(), m, this->m_locale) :
+
838 stdex::strncmp(text + start, n, m_str.c_str(), m)) == 0;
+
839 if (r) {
+
840 this->interval.end = (this->interval.start = start) + n;
+
841 return true;
+
842 }
+
843 this->interval.start = (this->interval.end = start) + 1;
+
844 return false;
+
845 }
+
846
+
847 protected:
+
848 std::basic_string<T> m_str;
+
849 };
-
849
- - -
852#ifdef _UNICODE
-
853 using tstring = wstring;
-
854#else
-
855 using tstring = string;
-
856#endif
-
857
-
- -
862 {
-
863 public:
-
864 sgml_string(const char* str, size_t count = (size_t)-1, _In_ const std::locale& locale = std::locale()) :
-
865 sgml_parser(locale),
-
866 m_str(sgml2wstr(str, count))
-
867 {}
-
868
-
869 virtual bool match(
-
870 _In_reads_or_z_(end) const char* text,
-
871 _In_ size_t start = 0,
-
872 _In_ size_t end = (size_t)-1,
-
873 _In_ int flags = match_default)
-
874 {
-
875 assert(text || start >= end);
-
876 const wchar_t* str = m_str.c_str();
-
877 const bool case_insensitive = flags & match_case_insensitive ? true : false;
-
878 const auto& ctype = std::use_facet<std::ctype<wchar_t>>(m_locale);
-
879 for (this->interval.end = start;;) {
-
880 if (!*str) {
-
881 this->interval.start = start;
-
882 return true;
-
883 }
-
884 if (this->interval.end >= end || !text[this->interval.end]) {
-
885 this->interval.start = (this->interval.end = start) + 1;
-
886 return false;
-
887 }
-
888 wchar_t buf[3];
-
889 const wchar_t* chr = next_sgml_cp(text, this->interval.end, end, this->interval.end, buf);
-
890 for (; *chr; ++str, ++chr) {
-
891 if (!*str ||
-
892 (case_insensitive ? ctype.tolower(*str) != ctype.tolower(*chr) : *str != *chr))
-
893 {
-
894 this->interval.start = (this->interval.end = start) + 1;
-
895 return false;
-
896 }
-
897 }
-
898 }
-
899 }
-
900
-
901 protected:
-
902 std::wstring m_str;
-
903 };
+
850
+ + +
853#ifdef _UNICODE
+
854 using tstring = wstring;
+
855#else
+
856 using tstring = string;
+
857#endif
+
858
+
+ +
863 {
+
864 public:
+
865 sgml_string(const char* str, size_t count = (size_t)-1, _In_ const std::locale& locale = std::locale()) :
+
866 sgml_parser(locale),
+
867 m_str(sgml2wstr(str, count))
+
868 {}
+
869
+
870 virtual bool match(
+
871 _In_reads_or_z_(end) const char* text,
+
872 _In_ size_t start = 0,
+
873 _In_ size_t end = (size_t)-1,
+
874 _In_ int flags = match_default)
+
875 {
+
876 assert(text || start >= end);
+
877 const wchar_t* str = m_str.c_str();
+
878 const bool case_insensitive = flags & match_case_insensitive ? true : false;
+
879 const auto& ctype = std::use_facet<std::ctype<wchar_t>>(m_locale);
+
880 for (this->interval.end = start;;) {
+
881 if (!*str) {
+
882 this->interval.start = start;
+
883 return true;
+
884 }
+
885 if (this->interval.end >= end || !text[this->interval.end]) {
+
886 this->interval.start = (this->interval.end = start) + 1;
+
887 return false;
+
888 }
+
889 wchar_t buf[3];
+
890 const wchar_t* chr = next_sgml_cp(text, this->interval.end, end, this->interval.end, buf);
+
891 for (; *chr; ++str, ++chr) {
+
892 if (!*str ||
+
893 (case_insensitive ? ctype.tolower(*str) != ctype.tolower(*chr) : *str != *chr))
+
894 {
+
895 this->interval.start = (this->interval.end = start) + 1;
+
896 return false;
+
897 }
+
898 }
+
899 }
+
900 }
+
901
+
902 protected:
+
903 std::wstring m_str;
+
904 };
-
904
-
908 template <class T>
-
- -
910 {
-
911 public:
-
912 basic_iterations(const std::shared_ptr<basic_parser<T>>& el, size_t min_iterations = 0, size_t max_iterations = (size_t)-1, bool greedy = true) :
-
913 m_el(el),
- - - -
917 {}
-
918
-
919 virtual bool match(
-
920 _In_reads_or_z_(end) const T* text,
-
921 _In_ size_t start = 0,
-
922 _In_ size_t end = (size_t)-1,
-
923 _In_ int flags = match_default)
-
924 {
-
925 assert(text || start >= end);
-
926 this->interval.start = this->interval.end = start;
-
927 for (size_t i = 0; ; i++) {
-
928 if ((!m_greedy && i >= m_min_iterations) || i >= m_max_iterations)
-
929 return true;
-
930 if (!m_el->match(text, this->interval.end, end, flags)) {
-
931 if (i >= m_min_iterations)
-
932 return true;
-
933 break;
-
934 }
-
935 if (m_el->interval.end == this->interval.end) {
-
936 // Element did match, but the matching interval was empty. Quit instead of spinning.
-
937 return true;
-
938 }
-
939 this->interval.end = m_el->interval.end;
-
940 }
-
941 this->interval.start = (this->interval.end = start) + 1;
-
942 return false;
-
943 }
-
944
-
945 protected:
-
946 std::shared_ptr<basic_parser<T>> m_el;
- - -
949 bool m_greedy;
-
950 };
+
905
+
909 template <class T>
+
+ +
911 {
+
912 public:
+
913 basic_iterations(const std::shared_ptr<basic_parser<T>>& el, size_t min_iterations = 0, size_t max_iterations = (size_t)-1, bool greedy = true) :
+
914 m_el(el),
+ + + +
918 {}
+
919
+
920 virtual bool match(
+
921 _In_reads_or_z_(end) const T* text,
+
922 _In_ size_t start = 0,
+
923 _In_ size_t end = (size_t)-1,
+
924 _In_ int flags = match_default)
+
925 {
+
926 assert(text || start >= end);
+
927 this->interval.start = this->interval.end = start;
+
928 for (size_t i = 0; ; i++) {
+
929 if ((!m_greedy && i >= m_min_iterations) || i >= m_max_iterations)
+
930 return true;
+
931 if (!m_el->match(text, this->interval.end, end, flags)) {
+
932 if (i >= m_min_iterations)
+
933 return true;
+
934 break;
+
935 }
+
936 if (m_el->interval.end == this->interval.end) {
+
937 // Element did match, but the matching interval was empty. Quit instead of spinning.
+
938 return true;
+
939 }
+
940 this->interval.end = m_el->interval.end;
+
941 }
+
942 this->interval.start = (this->interval.end = start) + 1;
+
943 return false;
+
944 }
+
945
+
946 protected:
+
947 std::shared_ptr<basic_parser<T>> m_el;
+ + +
950 bool m_greedy;
+
951 };
-
951
- - -
954#ifdef _UNICODE
-
955 using titerations = witerations;
-
956#else
-
957 using titerations = iterations;
-
958#endif
- -
960
-
964 template <class T>
-
- -
966 {
-
967 protected:
-
968 parser_collection(_In_ const std::locale& locale) : basic_parser<T>(locale) {}
-
969
-
970 public:
- -
972 _In_count_(count) const std::shared_ptr<basic_parser<T>>* el,
-
973 _In_ size_t count,
-
974 _In_ const std::locale& locale = std::locale()) :
-
975 basic_parser<T>(locale)
-
976 {
-
977 assert(el || !count);
-
978 m_collection.reserve(count);
-
979 for (size_t i = 0; i < count; i++)
-
980 m_collection.push_back(el[i]);
-
981 }
-
982
- -
984 _Inout_ std::vector<std::shared_ptr<basic_parser<T>>>&& collection,
-
985 _In_ const std::locale& locale = std::locale()) :
-
986 basic_parser<T>(locale),
-
987 m_collection(std::move(collection))
-
988 {}
-
989
-
990 virtual void invalidate()
-
991 {
-
992 for (auto& el: m_collection)
-
993 el->invalidate();
- -
995 }
-
996
-
997 protected:
-
998 std::vector<std::shared_ptr<basic_parser<T>>> m_collection;
-
999 };
+
952
+ + +
955#ifdef _UNICODE
+
956 using titerations = witerations;
+
957#else
+
958 using titerations = iterations;
+
959#endif
+ +
961
+
965 template <class T>
+
+ +
967 {
+
968 protected:
+
969 parser_collection(_In_ const std::locale& locale) : basic_parser<T>(locale) {}
+
970
+
971 public:
+ +
973 _In_count_(count) const std::shared_ptr<basic_parser<T>>* el,
+
974 _In_ size_t count,
+
975 _In_ const std::locale& locale = std::locale()) :
+
976 basic_parser<T>(locale)
+
977 {
+
978 assert(el || !count);
+
979 m_collection.reserve(count);
+
980 for (size_t i = 0; i < count; i++)
+
981 m_collection.push_back(el[i]);
+
982 }
+
983
+ +
985 _Inout_ std::vector<std::shared_ptr<basic_parser<T>>>&& collection,
+
986 _In_ const std::locale& locale = std::locale()) :
+
987 basic_parser<T>(locale),
+
988 m_collection(std::move(collection))
+
989 {}
+
990
+
991 virtual void invalidate()
+
992 {
+
993 for (auto& el: m_collection)
+
994 el->invalidate();
+ +
996 }
+
997
+
998 protected:
+
999 std::vector<std::shared_ptr<basic_parser<T>>> m_collection;
+
1000 };
-
1000
-
1004 template <class T>
-
- -
1006 {
-
1007 public:
- -
1009 _In_count_(count) const std::shared_ptr<basic_parser<T>>* el = nullptr,
-
1010 _In_ size_t count = 0,
-
1011 _In_ const std::locale& locale = std::locale()) :
-
1012 parser_collection<T>(el, count, locale)
-
1013 {}
-
1014
- -
1016 _Inout_ std::vector<std::shared_ptr<basic_parser<T>>>&& collection,
-
1017 _In_ const std::locale& locale = std::locale()) :
-
1018 parser_collection<T>(std::move(collection), locale)
-
1019 {}
-
1020
-
1021 virtual bool match(
-
1022 _In_reads_or_z_(end) const T* text,
-
1023 _In_ size_t start = 0,
-
1024 _In_ size_t end = (size_t)-1,
-
1025 _In_ int flags = match_default)
-
1026 {
-
1027 assert(text || start >= end);
-
1028 this->interval.end = start;
-
1029 for (auto i = this->m_collection.begin(); i != this->m_collection.end(); ++i) {
-
1030 if (!(*i)->match(text, this->interval.end, end, flags)) {
-
1031 for (++i; i != this->m_collection.end(); ++i)
-
1032 (*i)->invalidate();
-
1033 this->interval.start = (this->interval.end = start) + 1;
-
1034 return false;
-
1035 }
-
1036 this->interval.end = (*i)->interval.end;
-
1037 }
-
1038 this->interval.start = start;
-
1039 return true;
-
1040 }
-
1041 };
+
1001
+
1005 template <class T>
+
+ +
1007 {
+
1008 public:
+ +
1010 _In_count_(count) const std::shared_ptr<basic_parser<T>>* el = nullptr,
+
1011 _In_ size_t count = 0,
+
1012 _In_ const std::locale& locale = std::locale()) :
+
1013 parser_collection<T>(el, count, locale)
+
1014 {}
+
1015
+ +
1017 _Inout_ std::vector<std::shared_ptr<basic_parser<T>>>&& collection,
+
1018 _In_ const std::locale& locale = std::locale()) :
+
1019 parser_collection<T>(std::move(collection), locale)
+
1020 {}
+
1021
+
1022 virtual bool match(
+
1023 _In_reads_or_z_(end) const T* text,
+
1024 _In_ size_t start = 0,
+
1025 _In_ size_t end = (size_t)-1,
+
1026 _In_ int flags = match_default)
+
1027 {
+
1028 assert(text || start >= end);
+
1029 this->interval.end = start;
+
1030 for (auto i = this->m_collection.begin(); i != this->m_collection.end(); ++i) {
+
1031 if (!(*i)->match(text, this->interval.end, end, flags)) {
+
1032 for (++i; i != this->m_collection.end(); ++i)
+
1033 (*i)->invalidate();
+
1034 this->interval.start = (this->interval.end = start) + 1;
+
1035 return false;
+
1036 }
+
1037 this->interval.end = (*i)->interval.end;
+
1038 }
+
1039 this->interval.start = start;
+
1040 return true;
+
1041 }
+
1042 };
-
1042
- - -
1045#ifdef _UNICODE
-
1046 using tsequence = wsequence;
-
1047#else
-
1048 using tsequence = sequence;
-
1049#endif
- -
1051
-
1055 template <class T>
-
- -
1057 {
-
1058 protected:
-
1059 basic_branch(_In_ const std::locale& locale) :
-
1060 parser_collection<T>(locale),
-
1061 hit_offset((size_t)-1)
-
1062 {}
-
1063
-
1064 public:
- -
1066 _In_count_(count) const std::shared_ptr<basic_parser<T>>* el = nullptr,
-
1067 _In_ size_t count = 0,
-
1068 _In_ const std::locale& locale = std::locale()) :
-
1069 parser_collection<T>(el, count, locale),
-
1070 hit_offset((size_t)-1)
-
1071 {}
-
1072
- -
1074 _Inout_ std::vector<std::shared_ptr<basic_parser<T>>>&& collection,
-
1075 _In_ const std::locale& locale = std::locale()) :
-
1076 parser_collection<T>(std::move(collection), locale),
-
1077 hit_offset((size_t)-1)
-
1078 {}
-
1079
-
1080 virtual bool match(
-
1081 _In_reads_or_z_(end) const T* text,
-
1082 _In_ size_t start = 0,
-
1083 _In_ size_t end = (size_t)-1,
-
1084 _In_ int flags = match_default)
-
1085 {
-
1086 assert(text || start >= end);
-
1087 hit_offset = 0;
-
1088 for (auto i = this->m_collection.begin(); i != this->m_collection.end(); ++i, ++hit_offset) {
-
1089 if ((*i)->match(text, start, end, flags)) {
-
1090 this->interval = (*i)->interval;
-
1091 for (++i; i != this->m_collection.end(); ++i)
-
1092 (*i)->invalidate();
-
1093 return true;
-
1094 }
-
1095 }
-
1096 hit_offset = (size_t)-1;
-
1097 this->interval.start = (this->interval.end = start) + 1;
-
1098 return false;
-
1099 }
-
1100
-
1101 virtual void invalidate()
-
1102 {
-
1103 hit_offset = (size_t)-1;
- -
1105 }
-
1106
-
1107 public:
-
1108 size_t hit_offset;
-
1109 };
+
1043
+ + +
1046#ifdef _UNICODE
+
1047 using tsequence = wsequence;
+
1048#else
+
1049 using tsequence = sequence;
+
1050#endif
+ +
1052
+
1056 template <class T>
+
+ +
1058 {
+
1059 protected:
+
1060 basic_branch(_In_ const std::locale& locale) :
+
1061 parser_collection<T>(locale),
+
1062 hit_offset((size_t)-1)
+
1063 {}
+
1064
+
1065 public:
+ +
1067 _In_count_(count) const std::shared_ptr<basic_parser<T>>* el = nullptr,
+
1068 _In_ size_t count = 0,
+
1069 _In_ const std::locale& locale = std::locale()) :
+
1070 parser_collection<T>(el, count, locale),
+
1071 hit_offset((size_t)-1)
+
1072 {}
+
1073
+ +
1075 _Inout_ std::vector<std::shared_ptr<basic_parser<T>>>&& collection,
+
1076 _In_ const std::locale& locale = std::locale()) :
+
1077 parser_collection<T>(std::move(collection), locale),
+
1078 hit_offset((size_t)-1)
+
1079 {}
+
1080
+
1081 virtual bool match(
+
1082 _In_reads_or_z_(end) const T* text,
+
1083 _In_ size_t start = 0,
+
1084 _In_ size_t end = (size_t)-1,
+
1085 _In_ int flags = match_default)
+
1086 {
+
1087 assert(text || start >= end);
+
1088 hit_offset = 0;
+
1089 for (auto i = this->m_collection.begin(); i != this->m_collection.end(); ++i, ++hit_offset) {
+
1090 if ((*i)->match(text, start, end, flags)) {
+
1091 this->interval = (*i)->interval;
+
1092 for (++i; i != this->m_collection.end(); ++i)
+
1093 (*i)->invalidate();
+
1094 return true;
+
1095 }
+
1096 }
+
1097 hit_offset = (size_t)-1;
+
1098 this->interval.start = (this->interval.end = start) + 1;
+
1099 return false;
+
1100 }
+
1101
+
1102 virtual void invalidate()
+
1103 {
+
1104 hit_offset = (size_t)-1;
+ +
1106 }
+
1107
+
1108 public:
+
1109 size_t hit_offset;
+
1110 };
-
1110
-
1111 using branch = basic_branch<char>;
- -
1113#ifdef _UNICODE
-
1114 using tbranch = wbranch;
-
1115#else
-
1116 using tbranch = branch;
-
1117#endif
- -
1119
-
1123 template <class T, class T_parser = basic_string<T>>
-
- -
1125 {
-
1126 public:
-
1127 inline basic_string_branch(
-
1128 _In_reads_(count) const T* str_z = nullptr,
-
1129 _In_ size_t count = 0,
-
1130 _In_ const std::locale& locale = std::locale()) :
-
1131 basic_branch<T>(locale)
-
1132 {
-
1133 build(str_z, count);
-
1134 }
-
1135
-
1136 inline basic_string_branch(_In_z_ const T* str, ...) :
-
1137 basic_branch<T>(std::locale())
-
1138 {
-
1139 va_list params;
-
1140 va_start(params, str);
-
1141 build(str, params);
-
1142 va_end(params);
-
1143 }
-
1144
-
1145 inline basic_string_branch(_In_ const std::locale& locale, _In_z_ const T* str, ...) :
-
1146 basic_branch<T>(locale)
-
1147 {
-
1148 va_list params;
-
1149 va_start(params, str);
-
1150 build(str, params);
-
1151 va_end(params);
-
1152 }
-
1153
-
1154 protected:
-
1155 void build(_In_reads_(count) const T* str_z, _In_ size_t count)
-
1156 {
-
1157 assert(str_z || !count);
-
1158 if (count) {
-
1159 size_t offset, n;
-
1160 for (
-
1161 offset = n = 0;
-
1162 offset < count && str_z[offset];
-
1163 offset += stdex::strnlen(str_z + offset, count - offset) + 1, ++n);
-
1164 this->m_collection.reserve(n);
-
1165 for (
-
1166 offset = 0;
-
1167 offset < count && str_z[offset];
-
1168 offset += stdex::strnlen(str_z + offset, count - offset) + 1)
-
1169 this->m_collection.push_back(std::move(std::make_shared<T_parser>(str_z + offset, count - offset, this->m_locale)));
-
1170 }
-
1171 }
-
1172
-
1173 void build(_In_z_ const T* str, _In_ va_list params)
-
1174 {
-
1175 const T* p;
-
1176 for (
-
1177 this->m_collection.push_back(std::move(std::make_shared<T_parser>(str, (size_t)-1, this->m_locale)));
-
1178 (p = va_arg(params, const T*)) != nullptr;
-
1179 this->m_collection.push_back(std::move(std::make_shared<T_parser>(p, (size_t)-1, this->m_locale))));
-
1180 }
-
1181 };
+
1111
+
1112 using branch = basic_branch<char>;
+ +
1114#ifdef _UNICODE
+
1115 using tbranch = wbranch;
+
1116#else
+
1117 using tbranch = branch;
+
1118#endif
+ +
1120
+
1124 template <class T, class T_parser = basic_string<T>>
+
+ +
1126 {
+
1127 public:
+
1128 inline basic_string_branch(
+
1129 _In_reads_(count) const T* str_z = nullptr,
+
1130 _In_ size_t count = 0,
+
1131 _In_ const std::locale& locale = std::locale()) :
+
1132 basic_branch<T>(locale)
+
1133 {
+
1134 build(str_z, count);
+
1135 }
+
1136
+
1137 inline basic_string_branch(_In_z_ const T* str, ...) :
+
1138 basic_branch<T>(std::locale())
+
1139 {
+
1140 va_list params;
+
1141 va_start(params, str);
+
1142 build(str, params);
+
1143 va_end(params);
+
1144 }
+
1145
+
1146 inline basic_string_branch(_In_ const std::locale& locale, _In_z_ const T* str, ...) :
+
1147 basic_branch<T>(locale)
+
1148 {
+
1149 va_list params;
+
1150 va_start(params, str);
+
1151 build(str, params);
+
1152 va_end(params);
+
1153 }
+
1154
+
1155 protected:
+
1156 void build(_In_reads_(count) const T* str_z, _In_ size_t count)
+
1157 {
+
1158 assert(str_z || !count);
+
1159 if (count) {
+
1160 size_t offset, n;
+
1161 for (
+
1162 offset = n = 0;
+
1163 offset < count && str_z[offset];
+
1164 offset += stdex::strnlen(str_z + offset, count - offset) + 1, ++n);
+
1165 this->m_collection.reserve(n);
+
1166 for (
+
1167 offset = 0;
+
1168 offset < count && str_z[offset];
+
1169 offset += stdex::strnlen(str_z + offset, count - offset) + 1)
+
1170 this->m_collection.push_back(std::move(std::make_shared<T_parser>(str_z + offset, count - offset, this->m_locale)));
+
1171 }
+
1172 }
+
1173
+
1174 void build(_In_z_ const T* str, _In_ va_list params)
+
1175 {
+
1176 const T* p;
+
1177 for (
+
1178 this->m_collection.push_back(std::move(std::make_shared<T_parser>(str, (size_t)-1, this->m_locale)));
+
1179 (p = va_arg(params, const T*)) != nullptr;
+
1180 this->m_collection.push_back(std::move(std::make_shared<T_parser>(p, (size_t)-1, this->m_locale))));
+
1181 }
+
1182 };
-
1182
- - -
1185#ifdef _UNICODE
- -
1187#else
- -
1189#endif
- -
1191
-
1195 template <class T>
-
- -
1197 {
-
1198 public:
- -
1200 _In_count_(count) const std::shared_ptr<basic_parser<T>>* el = nullptr,
-
1201 _In_ size_t count = 0,
-
1202 _In_ const std::locale& locale = std::locale()) :
-
1203 parser_collection<T>(el, count, locale)
-
1204 {}
-
1205
- -
1207 _Inout_ std::vector<std::shared_ptr<basic_parser<T>>>&& collection,
-
1208 _In_ const std::locale& locale = std::locale()) :
-
1209 parser_collection<T>(std::move(collection), locale)
-
1210 {}
-
1211
-
1212 virtual bool match(
-
1213 _In_reads_or_z_(end) const T* text,
-
1214 _In_ size_t start = 0,
-
1215 _In_ size_t end = (size_t)-1,
-
1216 _In_ int flags = match_default)
-
1217 {
-
1218 assert(text || start >= end);
-
1219 for (auto& el: this->m_collection)
-
1220 el->invalidate();
-
1221 if (match_recursively(text, start, end, flags)) {
-
1222 this->interval.start = start;
-
1223 return true;
-
1224 }
-
1225 this->interval.start = (this->interval.end = start) + 1;
-
1226 return false;
-
1227 }
-
1228
-
1229 protected:
-
1230 bool match_recursively(
-
1231 _In_reads_or_z_(end) const T* text,
-
1232 _In_ size_t start = 0,
-
1233 _In_ size_t end = (size_t)-1,
-
1234 _In_ int flags = match_default)
-
1235 {
-
1236 bool all_matched = true;
-
1237 for (auto& el: this->m_collection) {
-
1238 if (!el->interval) {
-
1239 // Element was not matched in permutatuion yet.
-
1240 all_matched = false;
-
1241 if (el->match(text, start, end, flags)) {
-
1242 // Element matched for the first time.
-
1243 if (match_recursively(text, el->interval.end, end, flags)) {
-
1244 // Rest of the elements matched too.
-
1245 return true;
-
1246 }
-
1247 el->invalidate();
-
1248 }
-
1249 }
-
1250 }
-
1251 if (all_matched) {
-
1252 this->interval.end = start;
-
1253 return true;
-
1254 }
-
1255 return false;
-
1256 }
-
1257 };
+
1183
+ + +
1186#ifdef _UNICODE
+ +
1188#else
+ +
1190#endif
+ +
1192
+
1196 template <class T>
+
+ +
1198 {
+
1199 public:
+ +
1201 _In_count_(count) const std::shared_ptr<basic_parser<T>>* el = nullptr,
+
1202 _In_ size_t count = 0,
+
1203 _In_ const std::locale& locale = std::locale()) :
+
1204 parser_collection<T>(el, count, locale)
+
1205 {}
+
1206
+ +
1208 _Inout_ std::vector<std::shared_ptr<basic_parser<T>>>&& collection,
+
1209 _In_ const std::locale& locale = std::locale()) :
+
1210 parser_collection<T>(std::move(collection), locale)
+
1211 {}
+
1212
+
1213 virtual bool match(
+
1214 _In_reads_or_z_(end) const T* text,
+
1215 _In_ size_t start = 0,
+
1216 _In_ size_t end = (size_t)-1,
+
1217 _In_ int flags = match_default)
+
1218 {
+
1219 assert(text || start >= end);
+
1220 for (auto& el: this->m_collection)
+
1221 el->invalidate();
+
1222 if (match_recursively(text, start, end, flags)) {
+
1223 this->interval.start = start;
+
1224 return true;
+
1225 }
+
1226 this->interval.start = (this->interval.end = start) + 1;
+
1227 return false;
+
1228 }
+
1229
+
1230 protected:
+
1231 bool match_recursively(
+
1232 _In_reads_or_z_(end) const T* text,
+
1233 _In_ size_t start = 0,
+
1234 _In_ size_t end = (size_t)-1,
+
1235 _In_ int flags = match_default)
+
1236 {
+
1237 bool all_matched = true;
+
1238 for (auto& el: this->m_collection) {
+
1239 if (!el->interval) {
+
1240 // Element was not matched in permutatuion yet.
+
1241 all_matched = false;
+
1242 if (el->match(text, start, end, flags)) {
+
1243 // Element matched for the first time.
+
1244 if (match_recursively(text, el->interval.end, end, flags)) {
+
1245 // Rest of the elements matched too.
+
1246 return true;
+
1247 }
+
1248 el->invalidate();
+
1249 }
+
1250 }
+
1251 }
+
1252 if (all_matched) {
+
1253 this->interval.end = start;
+
1254 return true;
+
1255 }
+
1256 return false;
+
1257 }
+
1258 };
-
1258
- - -
1261#ifdef _UNICODE
-
1262 using tpermutation = wpermutation;
-
1263#else
-
1264 using tpermutation = permutation;
-
1265#endif
- -
1267
-
1271 template <class T>
-
-
1272 class basic_integer : public basic_parser<T>
-
1273 {
-
1274 public:
-
1275 basic_integer(_In_ const std::locale& locale = std::locale()) :
-
1276 basic_parser<T>(locale),
-
1277 value(0)
-
1278 {}
-
1279
-
1280 virtual void invalidate()
-
1281 {
-
1282 value = 0;
- -
1284 }
-
1285
-
1286 public:
-
1287 size_t value;
-
1288 };
+
1259
+ + +
1262#ifdef _UNICODE
+
1263 using tpermutation = wpermutation;
+
1264#else
+
1265 using tpermutation = permutation;
+
1266#endif
+ +
1268
+
1272 template <class T>
+
+
1273 class basic_integer : public basic_parser<T>
+
1274 {
+
1275 public:
+
1276 basic_integer(_In_ const std::locale& locale = std::locale()) :
+
1277 basic_parser<T>(locale),
+
1278 value(0)
+
1279 {}
+
1280
+
1281 virtual void invalidate()
+
1282 {
+
1283 value = 0;
+ +
1285 }
+
1286
+
1287 public:
+
1288 size_t value;
+
1289 };
-
1289
-
1293 template <class T>
-
- -
1295 {
-
1296 public:
- -
1298 _In_ const std::shared_ptr<basic_parser<T>>& digit_0,
-
1299 _In_ const std::shared_ptr<basic_parser<T>>& digit_1,
-
1300 _In_ const std::shared_ptr<basic_parser<T>>& digit_2,
-
1301 _In_ const std::shared_ptr<basic_parser<T>>& digit_3,
-
1302 _In_ const std::shared_ptr<basic_parser<T>>& digit_4,
-
1303 _In_ const std::shared_ptr<basic_parser<T>>& digit_5,
-
1304 _In_ const std::shared_ptr<basic_parser<T>>& digit_6,
-
1305 _In_ const std::shared_ptr<basic_parser<T>>& digit_7,
-
1306 _In_ const std::shared_ptr<basic_parser<T>>& digit_8,
-
1307 _In_ const std::shared_ptr<basic_parser<T>>& digit_9,
-
1308 _In_ const std::locale& locale = std::locale()) :
-
1309 basic_integer<T>(locale),
-
1310 m_digit_0(digit_0),
-
1311 m_digit_1(digit_1),
-
1312 m_digit_2(digit_2),
-
1313 m_digit_3(digit_3),
-
1314 m_digit_4(digit_4),
-
1315 m_digit_5(digit_5),
-
1316 m_digit_6(digit_6),
-
1317 m_digit_7(digit_7),
-
1318 m_digit_8(digit_8),
-
1319 m_digit_9(digit_9)
-
1320 {}
-
1321
-
1322 virtual bool match(
-
1323 _In_reads_or_z_(end) const T* text,
-
1324 _In_ size_t start = 0,
-
1325 _In_ size_t end = (size_t)-1,
-
1326 _In_ int flags = match_default)
-
1327 {
-
1328 assert(text || start >= end);
-
1329 for (this->interval.end = start, this->value = 0; this->interval.end < end && text[this->interval.end];) {
-
1330 size_t dig;
-
1331 if (m_digit_0->match(text, this->interval.end, end, flags)) { dig = 0; this->interval.end = m_digit_0->interval.end; }
-
1332 else if (m_digit_1->match(text, this->interval.end, end, flags)) { dig = 1; this->interval.end = m_digit_1->interval.end; }
-
1333 else if (m_digit_2->match(text, this->interval.end, end, flags)) { dig = 2; this->interval.end = m_digit_2->interval.end; }
-
1334 else if (m_digit_3->match(text, this->interval.end, end, flags)) { dig = 3; this->interval.end = m_digit_3->interval.end; }
-
1335 else if (m_digit_4->match(text, this->interval.end, end, flags)) { dig = 4; this->interval.end = m_digit_4->interval.end; }
-
1336 else if (m_digit_5->match(text, this->interval.end, end, flags)) { dig = 5; this->interval.end = m_digit_5->interval.end; }
-
1337 else if (m_digit_6->match(text, this->interval.end, end, flags)) { dig = 6; this->interval.end = m_digit_6->interval.end; }
-
1338 else if (m_digit_7->match(text, this->interval.end, end, flags)) { dig = 7; this->interval.end = m_digit_7->interval.end; }
-
1339 else if (m_digit_8->match(text, this->interval.end, end, flags)) { dig = 8; this->interval.end = m_digit_8->interval.end; }
-
1340 else if (m_digit_9->match(text, this->interval.end, end, flags)) { dig = 9; this->interval.end = m_digit_9->interval.end; }
-
1341 else break;
-
1342 this->value = this->value * 10 + dig;
-
1343 }
- -
1345 this->interval.start = start;
-
1346 return true;
-
1347 }
-
1348 this->interval.start = (this->interval.end = start) + 1;
-
1349 return false;
-
1350 }
-
1351
-
1352 protected:
-
1353 std::shared_ptr<basic_parser<T>>
-
1354 m_digit_0,
-
1355 m_digit_1,
-
1356 m_digit_2,
-
1357 m_digit_3,
-
1358 m_digit_4,
-
1359 m_digit_5,
-
1360 m_digit_6,
-
1361 m_digit_7,
-
1362 m_digit_8,
-
1363 m_digit_9;
-
1364 };
+
1290
+
1294 template <class T>
+
+ +
1296 {
+
1297 public:
+ +
1299 _In_ const std::shared_ptr<basic_parser<T>>& digit_0,
+
1300 _In_ const std::shared_ptr<basic_parser<T>>& digit_1,
+
1301 _In_ const std::shared_ptr<basic_parser<T>>& digit_2,
+
1302 _In_ const std::shared_ptr<basic_parser<T>>& digit_3,
+
1303 _In_ const std::shared_ptr<basic_parser<T>>& digit_4,
+
1304 _In_ const std::shared_ptr<basic_parser<T>>& digit_5,
+
1305 _In_ const std::shared_ptr<basic_parser<T>>& digit_6,
+
1306 _In_ const std::shared_ptr<basic_parser<T>>& digit_7,
+
1307 _In_ const std::shared_ptr<basic_parser<T>>& digit_8,
+
1308 _In_ const std::shared_ptr<basic_parser<T>>& digit_9,
+
1309 _In_ const std::locale& locale = std::locale()) :
+
1310 basic_integer<T>(locale),
+
1311 m_digit_0(digit_0),
+
1312 m_digit_1(digit_1),
+
1313 m_digit_2(digit_2),
+
1314 m_digit_3(digit_3),
+
1315 m_digit_4(digit_4),
+
1316 m_digit_5(digit_5),
+
1317 m_digit_6(digit_6),
+
1318 m_digit_7(digit_7),
+
1319 m_digit_8(digit_8),
+
1320 m_digit_9(digit_9)
+
1321 {}
+
1322
+
1323 virtual bool match(
+
1324 _In_reads_or_z_(end) const T* text,
+
1325 _In_ size_t start = 0,
+
1326 _In_ size_t end = (size_t)-1,
+
1327 _In_ int flags = match_default)
+
1328 {
+
1329 assert(text || start >= end);
+
1330 for (this->interval.end = start, this->value = 0; this->interval.end < end && text[this->interval.end];) {
+
1331 size_t dig;
+
1332 if (m_digit_0->match(text, this->interval.end, end, flags)) { dig = 0; this->interval.end = m_digit_0->interval.end; }
+
1333 else if (m_digit_1->match(text, this->interval.end, end, flags)) { dig = 1; this->interval.end = m_digit_1->interval.end; }
+
1334 else if (m_digit_2->match(text, this->interval.end, end, flags)) { dig = 2; this->interval.end = m_digit_2->interval.end; }
+
1335 else if (m_digit_3->match(text, this->interval.end, end, flags)) { dig = 3; this->interval.end = m_digit_3->interval.end; }
+
1336 else if (m_digit_4->match(text, this->interval.end, end, flags)) { dig = 4; this->interval.end = m_digit_4->interval.end; }
+
1337 else if (m_digit_5->match(text, this->interval.end, end, flags)) { dig = 5; this->interval.end = m_digit_5->interval.end; }
+
1338 else if (m_digit_6->match(text, this->interval.end, end, flags)) { dig = 6; this->interval.end = m_digit_6->interval.end; }
+
1339 else if (m_digit_7->match(text, this->interval.end, end, flags)) { dig = 7; this->interval.end = m_digit_7->interval.end; }
+
1340 else if (m_digit_8->match(text, this->interval.end, end, flags)) { dig = 8; this->interval.end = m_digit_8->interval.end; }
+
1341 else if (m_digit_9->match(text, this->interval.end, end, flags)) { dig = 9; this->interval.end = m_digit_9->interval.end; }
+
1342 else break;
+
1343 this->value = this->value * 10 + dig;
+
1344 }
+ +
1346 this->interval.start = start;
+
1347 return true;
+
1348 }
+
1349 this->interval.start = (this->interval.end = start) + 1;
+
1350 return false;
+
1351 }
+
1352
+
1353 protected:
+
1354 std::shared_ptr<basic_parser<T>>
+
1355 m_digit_0,
+
1356 m_digit_1,
+
1357 m_digit_2,
+
1358 m_digit_3,
+
1359 m_digit_4,
+
1360 m_digit_5,
+
1361 m_digit_6,
+
1362 m_digit_7,
+
1363 m_digit_8,
+
1364 m_digit_9;
+
1365 };
-
1365
- - -
1368#ifdef _UNICODE
-
1369 using tinteger10 = winteger10;
-
1370#else
-
1371 using tinteger10 = integer10;
-
1372#endif
- -
1374
-
1378 template <class T>
-
- -
1380 {
-
1381 public:
- -
1383 _In_ const std::shared_ptr<basic_integer10<T>>& digits,
-
1384 _In_ const std::shared_ptr<basic_set<T>>& separator,
-
1385 _In_ const std::locale& locale = std::locale()) :
-
1386 basic_integer<T>(locale),
-
1387 digit_count(0),
-
1388 has_separators(false),
-
1389 m_digits(digits),
-
1390 m_separator(separator)
-
1391 {}
-
1392
-
1393 virtual bool match(
-
1394 _In_reads_or_z_(end) const T* text,
-
1395 _In_ size_t start = 0,
-
1396 _In_ size_t end = (size_t)-1,
-
1397 _In_ int flags = match_default)
-
1398 {
-
1399 assert(text || start >= end);
-
1400 if (m_digits->match(text, start, end, flags)) {
-
1401 // Leading part match.
-
1402 this->value = m_digits->value;
-
1403 digit_count = m_digits->interval.size();
-
1404 has_separators = false;
-
1405 this->interval.start = start;
-
1406 this->interval.end = m_digits->interval.end;
-
1407 if (m_digits->interval.size() <= 3) {
-
1408 // Maybe separated with thousand separators?
-
1409 size_t hit_offset = (size_t)-1;
-
1410 while (m_separator->match(text, this->interval.end, end, flags) &&
-
1411 (hit_offset == (size_t)-1 || hit_offset == m_separator->hit_offset) && // All separators must be the same, no mixing.
-
1412 m_digits->match(text, m_separator->interval.end, end, flags) &&
-
1413 m_digits->interval.size() == 3)
-
1414 {
-
1415 // Thousand separator and three-digit integer followed.
-
1416 this->value = this->value * 1000 + m_digits->value;
-
1417 digit_count += 3;
-
1418 has_separators = true;
-
1419 this->interval.end = m_digits->interval.end;
-
1420 hit_offset = m_separator->hit_offset;
-
1421 }
-
1422 }
-
1423
-
1424 return true;
-
1425 }
-
1426 this->value = 0;
-
1427 this->interval.start = (this->interval.end = start) + 1;
-
1428 return false;
-
1429 }
-
1430
-
1431 virtual void invalidate()
-
1432 {
-
1433 digit_count = 0;
-
1434 has_separators = false;
- -
1436 }
-
1437
-
1438 public:
- - -
1441
-
1442 protected:
-
1443 std::shared_ptr<basic_integer10<T>> m_digits;
-
1444 std::shared_ptr<basic_set<T>> m_separator;
-
1445 };
+
1366
+ + +
1369#ifdef _UNICODE
+
1370 using tinteger10 = winteger10;
+
1371#else
+
1372 using tinteger10 = integer10;
+
1373#endif
+ +
1375
+
1379 template <class T>
+
+ +
1381 {
+
1382 public:
+ +
1384 _In_ const std::shared_ptr<basic_integer10<T>>& digits,
+
1385 _In_ const std::shared_ptr<basic_set<T>>& separator,
+
1386 _In_ const std::locale& locale = std::locale()) :
+
1387 basic_integer<T>(locale),
+
1388 digit_count(0),
+
1389 has_separators(false),
+
1390 m_digits(digits),
+
1391 m_separator(separator)
+
1392 {}
+
1393
+
1394 virtual bool match(
+
1395 _In_reads_or_z_(end) const T* text,
+
1396 _In_ size_t start = 0,
+
1397 _In_ size_t end = (size_t)-1,
+
1398 _In_ int flags = match_default)
+
1399 {
+
1400 assert(text || start >= end);
+
1401 if (m_digits->match(text, start, end, flags)) {
+
1402 // Leading part match.
+
1403 this->value = m_digits->value;
+
1404 digit_count = m_digits->interval.size();
+
1405 has_separators = false;
+
1406 this->interval.start = start;
+
1407 this->interval.end = m_digits->interval.end;
+
1408 if (m_digits->interval.size() <= 3) {
+
1409 // Maybe separated with thousand separators?
+
1410 size_t hit_offset = (size_t)-1;
+
1411 while (m_separator->match(text, this->interval.end, end, flags) &&
+
1412 (hit_offset == (size_t)-1 || hit_offset == m_separator->hit_offset) && // All separators must be the same, no mixing.
+
1413 m_digits->match(text, m_separator->interval.end, end, flags) &&
+
1414 m_digits->interval.size() == 3)
+
1415 {
+
1416 // Thousand separator and three-digit integer followed.
+
1417 this->value = this->value * 1000 + m_digits->value;
+
1418 digit_count += 3;
+
1419 has_separators = true;
+
1420 this->interval.end = m_digits->interval.end;
+
1421 hit_offset = m_separator->hit_offset;
+
1422 }
+
1423 }
+
1424
+
1425 return true;
+
1426 }
+
1427 this->value = 0;
+
1428 this->interval.start = (this->interval.end = start) + 1;
+
1429 return false;
+
1430 }
+
1431
+
1432 virtual void invalidate()
+
1433 {
+
1434 digit_count = 0;
+
1435 has_separators = false;
+ +
1437 }
+
1438
+
1439 public:
+ + +
1442
+
1443 protected:
+
1444 std::shared_ptr<basic_integer10<T>> m_digits;
+
1445 std::shared_ptr<basic_set<T>> m_separator;
+
1446 };
-
1446
- - -
1449#ifdef _UNICODE
-
1450 using tinteger10ts = winteger10ts;
-
1451#else
-
1452 using tinteger10ts = integer10ts;
-
1453#endif
- -
1455
-
1459 template <class T>
-
- -
1461 {
-
1462 public:
- -
1464 _In_ const std::shared_ptr<basic_parser<T>>& digit_0,
-
1465 _In_ const std::shared_ptr<basic_parser<T>>& digit_1,
-
1466 _In_ const std::shared_ptr<basic_parser<T>>& digit_2,
-
1467 _In_ const std::shared_ptr<basic_parser<T>>& digit_3,
-
1468 _In_ const std::shared_ptr<basic_parser<T>>& digit_4,
-
1469 _In_ const std::shared_ptr<basic_parser<T>>& digit_5,
-
1470 _In_ const std::shared_ptr<basic_parser<T>>& digit_6,
-
1471 _In_ const std::shared_ptr<basic_parser<T>>& digit_7,
-
1472 _In_ const std::shared_ptr<basic_parser<T>>& digit_8,
-
1473 _In_ const std::shared_ptr<basic_parser<T>>& digit_9,
-
1474 _In_ const std::shared_ptr<basic_parser<T>>& digit_10,
-
1475 _In_ const std::shared_ptr<basic_parser<T>>& digit_11,
-
1476 _In_ const std::shared_ptr<basic_parser<T>>& digit_12,
-
1477 _In_ const std::shared_ptr<basic_parser<T>>& digit_13,
-
1478 _In_ const std::shared_ptr<basic_parser<T>>& digit_14,
-
1479 _In_ const std::shared_ptr<basic_parser<T>>& digit_15,
-
1480 _In_ const std::locale& locale = std::locale()) :
-
1481 basic_integer<T>(locale),
-
1482 m_digit_0(digit_0),
-
1483 m_digit_1(digit_1),
-
1484 m_digit_2(digit_2),
-
1485 m_digit_3(digit_3),
-
1486 m_digit_4(digit_4),
-
1487 m_digit_5(digit_5),
-
1488 m_digit_6(digit_6),
-
1489 m_digit_7(digit_7),
-
1490 m_digit_8(digit_8),
-
1491 m_digit_9(digit_9),
-
1492 m_digit_10(digit_10),
-
1493 m_digit_11(digit_11),
-
1494 m_digit_12(digit_12),
-
1495 m_digit_13(digit_13),
-
1496 m_digit_14(digit_14),
-
1497 m_digit_15(digit_15)
-
1498 {}
-
1499
-
1500 virtual bool match(
-
1501 _In_reads_or_z_(end) const T* text,
-
1502 _In_ size_t start = 0,
-
1503 _In_ size_t end = (size_t)-1,
-
1504 _In_ int flags = match_default)
-
1505 {
-
1506 assert(text || start >= end);
-
1507 for (this->interval.end = start, this->value = 0; this->interval.end < end && text[this->interval.end];) {
-
1508 size_t dig;
-
1509 if (m_digit_0->match(text, this->interval.end, end, flags)) { dig = 0; this->interval.end = m_digit_0->interval.end; }
-
1510 else if (m_digit_1->match(text, this->interval.end, end, flags)) { dig = 1; this->interval.end = m_digit_1->interval.end; }
-
1511 else if (m_digit_2->match(text, this->interval.end, end, flags)) { dig = 2; this->interval.end = m_digit_2->interval.end; }
-
1512 else if (m_digit_3->match(text, this->interval.end, end, flags)) { dig = 3; this->interval.end = m_digit_3->interval.end; }
-
1513 else if (m_digit_4->match(text, this->interval.end, end, flags)) { dig = 4; this->interval.end = m_digit_4->interval.end; }
-
1514 else if (m_digit_5->match(text, this->interval.end, end, flags)) { dig = 5; this->interval.end = m_digit_5->interval.end; }
-
1515 else if (m_digit_6->match(text, this->interval.end, end, flags)) { dig = 6; this->interval.end = m_digit_6->interval.end; }
-
1516 else if (m_digit_7->match(text, this->interval.end, end, flags)) { dig = 7; this->interval.end = m_digit_7->interval.end; }
-
1517 else if (m_digit_8->match(text, this->interval.end, end, flags)) { dig = 8; this->interval.end = m_digit_8->interval.end; }
-
1518 else if (m_digit_9->match(text, this->interval.end, end, flags)) { dig = 9; this->interval.end = m_digit_9->interval.end; }
-
1519 else if (m_digit_10->match(text, this->interval.end, end, flags)) { dig = 10; this->interval.end = m_digit_10->interval.end; }
-
1520 else if (m_digit_11->match(text, this->interval.end, end, flags)) { dig = 11; this->interval.end = m_digit_11->interval.end; }
-
1521 else if (m_digit_12->match(text, this->interval.end, end, flags)) { dig = 12; this->interval.end = m_digit_12->interval.end; }
-
1522 else if (m_digit_13->match(text, this->interval.end, end, flags)) { dig = 13; this->interval.end = m_digit_13->interval.end; }
-
1523 else if (m_digit_14->match(text, this->interval.end, end, flags)) { dig = 14; this->interval.end = m_digit_14->interval.end; }
-
1524 else if (m_digit_15->match(text, this->interval.end, end, flags)) { dig = 15; this->interval.end = m_digit_15->interval.end; }
-
1525 else break;
-
1526 this->value = this->value * 16 + dig;
-
1527 }
- -
1529 this->interval.start = start;
-
1530 return true;
-
1531 }
-
1532 this->interval.start = (this->interval.end = start) + 1;
-
1533 return false;
-
1534 }
-
1535
-
1536 protected:
-
1537 std::shared_ptr<basic_parser<T>>
-
1538 m_digit_0,
-
1539 m_digit_1,
-
1540 m_digit_2,
-
1541 m_digit_3,
-
1542 m_digit_4,
-
1543 m_digit_5,
-
1544 m_digit_6,
-
1545 m_digit_7,
-
1546 m_digit_8,
-
1547 m_digit_9,
-
1548 m_digit_10,
-
1549 m_digit_11,
-
1550 m_digit_12,
-
1551 m_digit_13,
-
1552 m_digit_14,
-
1553 m_digit_15;
-
1554 };
+
1447
+ + +
1450#ifdef _UNICODE
+
1451 using tinteger10ts = winteger10ts;
+
1452#else
+
1453 using tinteger10ts = integer10ts;
+
1454#endif
+ +
1456
+
1460 template <class T>
+
+ +
1462 {
+
1463 public:
+ +
1465 _In_ const std::shared_ptr<basic_parser<T>>& digit_0,
+
1466 _In_ const std::shared_ptr<basic_parser<T>>& digit_1,
+
1467 _In_ const std::shared_ptr<basic_parser<T>>& digit_2,
+
1468 _In_ const std::shared_ptr<basic_parser<T>>& digit_3,
+
1469 _In_ const std::shared_ptr<basic_parser<T>>& digit_4,
+
1470 _In_ const std::shared_ptr<basic_parser<T>>& digit_5,
+
1471 _In_ const std::shared_ptr<basic_parser<T>>& digit_6,
+
1472 _In_ const std::shared_ptr<basic_parser<T>>& digit_7,
+
1473 _In_ const std::shared_ptr<basic_parser<T>>& digit_8,
+
1474 _In_ const std::shared_ptr<basic_parser<T>>& digit_9,
+
1475 _In_ const std::shared_ptr<basic_parser<T>>& digit_10,
+
1476 _In_ const std::shared_ptr<basic_parser<T>>& digit_11,
+
1477 _In_ const std::shared_ptr<basic_parser<T>>& digit_12,
+
1478 _In_ const std::shared_ptr<basic_parser<T>>& digit_13,
+
1479 _In_ const std::shared_ptr<basic_parser<T>>& digit_14,
+
1480 _In_ const std::shared_ptr<basic_parser<T>>& digit_15,
+
1481 _In_ const std::locale& locale = std::locale()) :
+
1482 basic_integer<T>(locale),
+
1483 m_digit_0(digit_0),
+
1484 m_digit_1(digit_1),
+
1485 m_digit_2(digit_2),
+
1486 m_digit_3(digit_3),
+
1487 m_digit_4(digit_4),
+
1488 m_digit_5(digit_5),
+
1489 m_digit_6(digit_6),
+
1490 m_digit_7(digit_7),
+
1491 m_digit_8(digit_8),
+
1492 m_digit_9(digit_9),
+
1493 m_digit_10(digit_10),
+
1494 m_digit_11(digit_11),
+
1495 m_digit_12(digit_12),
+
1496 m_digit_13(digit_13),
+
1497 m_digit_14(digit_14),
+
1498 m_digit_15(digit_15)
+
1499 {}
+
1500
+
1501 virtual bool match(
+
1502 _In_reads_or_z_(end) const T* text,
+
1503 _In_ size_t start = 0,
+
1504 _In_ size_t end = (size_t)-1,
+
1505 _In_ int flags = match_default)
+
1506 {
+
1507 assert(text || start >= end);
+
1508 for (this->interval.end = start, this->value = 0; this->interval.end < end && text[this->interval.end];) {
+
1509 size_t dig;
+
1510 if (m_digit_0->match(text, this->interval.end, end, flags)) { dig = 0; this->interval.end = m_digit_0->interval.end; }
+
1511 else if (m_digit_1->match(text, this->interval.end, end, flags)) { dig = 1; this->interval.end = m_digit_1->interval.end; }
+
1512 else if (m_digit_2->match(text, this->interval.end, end, flags)) { dig = 2; this->interval.end = m_digit_2->interval.end; }
+
1513 else if (m_digit_3->match(text, this->interval.end, end, flags)) { dig = 3; this->interval.end = m_digit_3->interval.end; }
+
1514 else if (m_digit_4->match(text, this->interval.end, end, flags)) { dig = 4; this->interval.end = m_digit_4->interval.end; }
+
1515 else if (m_digit_5->match(text, this->interval.end, end, flags)) { dig = 5; this->interval.end = m_digit_5->interval.end; }
+
1516 else if (m_digit_6->match(text, this->interval.end, end, flags)) { dig = 6; this->interval.end = m_digit_6->interval.end; }
+
1517 else if (m_digit_7->match(text, this->interval.end, end, flags)) { dig = 7; this->interval.end = m_digit_7->interval.end; }
+
1518 else if (m_digit_8->match(text, this->interval.end, end, flags)) { dig = 8; this->interval.end = m_digit_8->interval.end; }
+
1519 else if (m_digit_9->match(text, this->interval.end, end, flags)) { dig = 9; this->interval.end = m_digit_9->interval.end; }
+
1520 else if (m_digit_10->match(text, this->interval.end, end, flags)) { dig = 10; this->interval.end = m_digit_10->interval.end; }
+
1521 else if (m_digit_11->match(text, this->interval.end, end, flags)) { dig = 11; this->interval.end = m_digit_11->interval.end; }
+
1522 else if (m_digit_12->match(text, this->interval.end, end, flags)) { dig = 12; this->interval.end = m_digit_12->interval.end; }
+
1523 else if (m_digit_13->match(text, this->interval.end, end, flags)) { dig = 13; this->interval.end = m_digit_13->interval.end; }
+
1524 else if (m_digit_14->match(text, this->interval.end, end, flags)) { dig = 14; this->interval.end = m_digit_14->interval.end; }
+
1525 else if (m_digit_15->match(text, this->interval.end, end, flags)) { dig = 15; this->interval.end = m_digit_15->interval.end; }
+
1526 else break;
+
1527 this->value = this->value * 16 + dig;
+
1528 }
+ +
1530 this->interval.start = start;
+
1531 return true;
+
1532 }
+
1533 this->interval.start = (this->interval.end = start) + 1;
+
1534 return false;
+
1535 }
+
1536
+
1537 protected:
+
1538 std::shared_ptr<basic_parser<T>>
+
1539 m_digit_0,
+
1540 m_digit_1,
+
1541 m_digit_2,
+
1542 m_digit_3,
+
1543 m_digit_4,
+
1544 m_digit_5,
+
1545 m_digit_6,
+
1546 m_digit_7,
+
1547 m_digit_8,
+
1548 m_digit_9,
+
1549 m_digit_10,
+
1550 m_digit_11,
+
1551 m_digit_12,
+
1552 m_digit_13,
+
1553 m_digit_14,
+
1554 m_digit_15;
+
1555 };
-
1555
- - -
1558#ifdef _UNICODE
-
1559 using tinteger16 = winteger16;
-
1560#else
-
1561 using tinteger16 = integer16;
-
1562#endif
- -
1564
-
1568 template <class T>
-
- -
1570 {
-
1571 public:
- -
1573 _In_ const std::shared_ptr<basic_parser<T>>& digit_1,
-
1574 _In_ const std::shared_ptr<basic_parser<T>>& digit_5,
-
1575 _In_ const std::shared_ptr<basic_parser<T>>& digit_10,
-
1576 _In_ const std::shared_ptr<basic_parser<T>>& digit_50,
-
1577 _In_ const std::shared_ptr<basic_parser<T>>& digit_100,
-
1578 _In_ const std::shared_ptr<basic_parser<T>>& digit_500,
-
1579 _In_ const std::shared_ptr<basic_parser<T>>& digit_1000,
-
1580 _In_ const std::shared_ptr<basic_parser<T>>& digit_5000,
-
1581 _In_ const std::shared_ptr<basic_parser<T>>& digit_10000,
-
1582 _In_ const std::locale& locale = std::locale()) :
-
1583 basic_integer<T>(locale),
-
1584 m_digit_1(digit_1),
-
1585 m_digit_5(digit_5),
-
1586 m_digit_10(digit_10),
-
1587 m_digit_50(digit_50),
-
1588 m_digit_100(digit_100),
-
1589 m_digit_500(digit_500),
-
1590 m_digit_1000(digit_1000),
-
1591 m_digit_5000(digit_5000),
-
1592 m_digit_10000(digit_10000)
-
1593 {}
-
1594
-
1595 virtual bool match(
-
1596 _In_reads_or_z_(end) const T* text,
-
1597 _In_ size_t start = 0,
-
1598 _In_ size_t end = (size_t)-1,
-
1599 _In_ int flags = match_default)
-
1600 {
-
1601 assert(text || start >= end);
-
1602 size_t
-
1603 dig[5] = { (size_t)-1, (size_t)-1, (size_t)-1, (size_t)-1, (size_t)-1 },
-
1604 end2;
-
1605
-
1606 for (this->interval.end = start, this->value = 0; this->interval.end < end && text[this->interval.end]; dig[3] = dig[2], dig[2] = dig[1], dig[1] = dig[0], this->interval.end = end2) {
-
1607 if (m_digit_1 && m_digit_1->match(text, this->interval.end, end, flags)) { dig[0] = 1; end2 = m_digit_1->interval.end; }
-
1608 else if (m_digit_5 && m_digit_5->match(text, this->interval.end, end, flags)) { dig[0] = 5; end2 = m_digit_5->interval.end; }
-
1609 else if (m_digit_10 && m_digit_10->match(text, this->interval.end, end, flags)) { dig[0] = 10; end2 = m_digit_10->interval.end; }
-
1610 else if (m_digit_50 && m_digit_50->match(text, this->interval.end, end, flags)) { dig[0] = 50; end2 = m_digit_50->interval.end; }
-
1611 else if (m_digit_100 && m_digit_100->match(text, this->interval.end, end, flags)) { dig[0] = 100; end2 = m_digit_100->interval.end; }
-
1612 else if (m_digit_500 && m_digit_500->match(text, this->interval.end, end, flags)) { dig[0] = 500; end2 = m_digit_500->interval.end; }
-
1613 else if (m_digit_1000 && m_digit_1000->match(text, this->interval.end, end, flags)) { dig[0] = 1000; end2 = m_digit_1000->interval.end; }
-
1614 else if (m_digit_5000 && m_digit_5000->match(text, this->interval.end, end, flags)) { dig[0] = 5000; end2 = m_digit_5000->interval.end; }
-
1615 else if (m_digit_10000 && m_digit_10000->match(text, this->interval.end, end, flags)) { dig[0] = 10000; end2 = m_digit_10000->interval.end; }
-
1616 else break;
-
1617
-
1618 // Store first digit.
-
1619 if (dig[4] == (size_t)-1) dig[4] = dig[0];
-
1620
-
1621 if (dig[3] == dig[2] && dig[2] == dig[1] && dig[1] == dig[0] && dig[0] != dig[4]) {
-
1622 // Same digit repeated four times. No-go, unless first digit. E.g. XIIII vs. XIV. MMMMMCD allowed, IIII also...
-
1623 break;
-
1624 }
-
1625 if (dig[0] <= dig[1]) {
-
1626 // Digit is less or equal previous one: add.
-
1627 this->value += dig[0];
-
1628 }
-
1629 else if (
-
1630 (dig[1] == 1 && (dig[0] == 5 || dig[0] == 10)) ||
-
1631 (dig[1] == 10 && (dig[0] == 50 || dig[0] == 100)) ||
-
1632 (dig[1] == 100 && (dig[0] == 500 || dig[0] == 1000)) ||
-
1633 (dig[1] == 1000 && (dig[0] == 5000 || dig[0] == 10000)))
-
1634 {
-
1635 // Digit is up to two orders bigger than previous one: subtract. But...
-
1636 if (dig[2] < dig[0]) {
-
1637 // Digit is also bigger than pre-previous one. E.g. VIX (V < X => invalid)
-
1638 break;
-
1639 }
-
1640 this->value -= dig[1]; // Cancel addition in the previous step.
-
1641 dig[0] -= dig[1]; // Combine last two digits.
-
1642 dig[1] = dig[2]; // The true previous digit is now pre-previous one. :)
-
1643 dig[2] = dig[3]; // The true pre-previous digit is now pre-pre-previous one. :)
-
1644 this->value += dig[0]; // Add combined value.
-
1645 }
-
1646 else {
-
1647 // New digit is too big than the previous one. E.g. VX (V < X => invalid)
-
1648 break;
-
1649 }
-
1650 }
-
1651 if (this->value) {
-
1652 this->interval.start = start;
-
1653 return true;
-
1654 }
-
1655 this->interval.start = (this->interval.end = start) + 1;
-
1656 return false;
-
1657 }
-
1658
-
1659 protected:
-
1660 std::shared_ptr<basic_parser<T>>
-
1661 m_digit_1,
-
1662 m_digit_5,
-
1663 m_digit_10,
-
1664 m_digit_50,
-
1665 m_digit_100,
-
1666 m_digit_500,
-
1667 m_digit_1000,
-
1668 m_digit_5000,
-
1669 m_digit_10000;
-
1670 };
+
1556
+ + +
1559#ifdef _UNICODE
+
1560 using tinteger16 = winteger16;
+
1561#else
+
1562 using tinteger16 = integer16;
+
1563#endif
+ +
1565
+
1569 template <class T>
+
+ +
1571 {
+
1572 public:
+ +
1574 _In_ const std::shared_ptr<basic_parser<T>>& digit_1,
+
1575 _In_ const std::shared_ptr<basic_parser<T>>& digit_5,
+
1576 _In_ const std::shared_ptr<basic_parser<T>>& digit_10,
+
1577 _In_ const std::shared_ptr<basic_parser<T>>& digit_50,
+
1578 _In_ const std::shared_ptr<basic_parser<T>>& digit_100,
+
1579 _In_ const std::shared_ptr<basic_parser<T>>& digit_500,
+
1580 _In_ const std::shared_ptr<basic_parser<T>>& digit_1000,
+
1581 _In_ const std::shared_ptr<basic_parser<T>>& digit_5000,
+
1582 _In_ const std::shared_ptr<basic_parser<T>>& digit_10000,
+
1583 _In_ const std::locale& locale = std::locale()) :
+
1584 basic_integer<T>(locale),
+
1585 m_digit_1(digit_1),
+
1586 m_digit_5(digit_5),
+
1587 m_digit_10(digit_10),
+
1588 m_digit_50(digit_50),
+
1589 m_digit_100(digit_100),
+
1590 m_digit_500(digit_500),
+
1591 m_digit_1000(digit_1000),
+
1592 m_digit_5000(digit_5000),
+
1593 m_digit_10000(digit_10000)
+
1594 {}
+
1595
+
1596 virtual bool match(
+
1597 _In_reads_or_z_(end) const T* text,
+
1598 _In_ size_t start = 0,
+
1599 _In_ size_t end = (size_t)-1,
+
1600 _In_ int flags = match_default)
+
1601 {
+
1602 assert(text || start >= end);
+
1603 size_t
+
1604 dig[5] = { (size_t)-1, (size_t)-1, (size_t)-1, (size_t)-1, (size_t)-1 },
+
1605 end2;
+
1606
+
1607 for (this->interval.end = start, this->value = 0; this->interval.end < end && text[this->interval.end]; dig[3] = dig[2], dig[2] = dig[1], dig[1] = dig[0], this->interval.end = end2) {
+
1608 if (m_digit_1 && m_digit_1->match(text, this->interval.end, end, flags)) { dig[0] = 1; end2 = m_digit_1->interval.end; }
+
1609 else if (m_digit_5 && m_digit_5->match(text, this->interval.end, end, flags)) { dig[0] = 5; end2 = m_digit_5->interval.end; }
+
1610 else if (m_digit_10 && m_digit_10->match(text, this->interval.end, end, flags)) { dig[0] = 10; end2 = m_digit_10->interval.end; }
+
1611 else if (m_digit_50 && m_digit_50->match(text, this->interval.end, end, flags)) { dig[0] = 50; end2 = m_digit_50->interval.end; }
+
1612 else if (m_digit_100 && m_digit_100->match(text, this->interval.end, end, flags)) { dig[0] = 100; end2 = m_digit_100->interval.end; }
+
1613 else if (m_digit_500 && m_digit_500->match(text, this->interval.end, end, flags)) { dig[0] = 500; end2 = m_digit_500->interval.end; }
+
1614 else if (m_digit_1000 && m_digit_1000->match(text, this->interval.end, end, flags)) { dig[0] = 1000; end2 = m_digit_1000->interval.end; }
+
1615 else if (m_digit_5000 && m_digit_5000->match(text, this->interval.end, end, flags)) { dig[0] = 5000; end2 = m_digit_5000->interval.end; }
+
1616 else if (m_digit_10000 && m_digit_10000->match(text, this->interval.end, end, flags)) { dig[0] = 10000; end2 = m_digit_10000->interval.end; }
+
1617 else break;
+
1618
+
1619 // Store first digit.
+
1620 if (dig[4] == (size_t)-1) dig[4] = dig[0];
+
1621
+
1622 if (dig[3] == dig[2] && dig[2] == dig[1] && dig[1] == dig[0] && dig[0] != dig[4]) {
+
1623 // Same digit repeated four times. No-go, unless first digit. E.g. XIIII vs. XIV. MMMMMCD allowed, IIII also...
+
1624 break;
+
1625 }
+
1626 if (dig[0] <= dig[1]) {
+
1627 // Digit is less or equal previous one: add.
+
1628 this->value += dig[0];
+
1629 }
+
1630 else if (
+
1631 (dig[1] == 1 && (dig[0] == 5 || dig[0] == 10)) ||
+
1632 (dig[1] == 10 && (dig[0] == 50 || dig[0] == 100)) ||
+
1633 (dig[1] == 100 && (dig[0] == 500 || dig[0] == 1000)) ||
+
1634 (dig[1] == 1000 && (dig[0] == 5000 || dig[0] == 10000)))
+
1635 {
+
1636 // Digit is up to two orders bigger than previous one: subtract. But...
+
1637 if (dig[2] < dig[0]) {
+
1638 // Digit is also bigger than pre-previous one. E.g. VIX (V < X => invalid)
+
1639 break;
+
1640 }
+
1641 this->value -= dig[1]; // Cancel addition in the previous step.
+
1642 dig[0] -= dig[1]; // Combine last two digits.
+
1643 dig[1] = dig[2]; // The true previous digit is now pre-previous one. :)
+
1644 dig[2] = dig[3]; // The true pre-previous digit is now pre-pre-previous one. :)
+
1645 this->value += dig[0]; // Add combined value.
+
1646 }
+
1647 else {
+
1648 // New digit is too big than the previous one. E.g. VX (V < X => invalid)
+
1649 break;
+
1650 }
+
1651 }
+
1652 if (this->value) {
+
1653 this->interval.start = start;
+
1654 return true;
+
1655 }
+
1656 this->interval.start = (this->interval.end = start) + 1;
+
1657 return false;
+
1658 }
+
1659
+
1660 protected:
+
1661 std::shared_ptr<basic_parser<T>>
+
1662 m_digit_1,
+
1663 m_digit_5,
+
1664 m_digit_10,
+
1665 m_digit_50,
+
1666 m_digit_100,
+
1667 m_digit_500,
+
1668 m_digit_1000,
+
1669 m_digit_5000,
+
1670 m_digit_10000;
+
1671 };
-
1671
- - -
1674#ifdef _UNICODE
- -
1676#else
- -
1678#endif
- -
1680
-
1684 template <class T>
-
- -
1686 {
-
1687 public:
- -
1689 _In_ const std::shared_ptr<basic_parser<T>>& _numerator,
-
1690 _In_ const std::shared_ptr<basic_parser<T>>& _fraction_line,
-
1691 _In_ const std::shared_ptr<basic_parser<T>>& _denominator,
-
1692 _In_ const std::locale& locale = std::locale()) :
-
1693 basic_parser<T>(locale),
-
1694 numerator(_numerator),
-
1695 fraction_line(_fraction_line),
-
1696 denominator(_denominator)
-
1697 {}
-
1698
-
1699 virtual bool match(
-
1700 _In_reads_or_z_(end) const T* text,
-
1701 _In_ size_t start = 0,
-
1702 _In_ size_t end = (size_t)-1,
-
1703 _In_ int flags = match_default)
-
1704 {
-
1705 assert(text || start >= end);
-
1706 if (numerator->match(text, start, end, flags) &&
-
1707 fraction_line->match(text, numerator->interval.end, end, flags) &&
-
1708 denominator->match(text, fraction_line->interval.end, end, flags))
-
1709 {
-
1710 this->interval.start = start;
-
1711 this->interval.end = denominator->interval.end;
-
1712 return true;
-
1713 }
-
1714 numerator->invalidate();
-
1715 fraction_line->invalidate();
-
1716 denominator->invalidate();
-
1717 this->interval.start = (this->interval.end = start) + 1;
-
1718 return false;
-
1719 }
-
1720
-
1721 virtual void invalidate()
-
1722 {
-
1723 numerator->invalidate();
-
1724 fraction_line->invalidate();
-
1725 denominator->invalidate();
- -
1727 }
-
1728
-
1729 public:
-
1730 std::shared_ptr<basic_parser<T>> numerator;
-
1731 std::shared_ptr<basic_parser<T>> fraction_line;
-
1732 std::shared_ptr<basic_parser<T>> denominator;
-
1733 };
+
1672
+ + +
1675#ifdef _UNICODE
+ +
1677#else
+ +
1679#endif
+ +
1681
+
1685 template <class T>
+
+ +
1687 {
+
1688 public:
+ +
1690 _In_ const std::shared_ptr<basic_parser<T>>& _numerator,
+
1691 _In_ const std::shared_ptr<basic_parser<T>>& _fraction_line,
+
1692 _In_ const std::shared_ptr<basic_parser<T>>& _denominator,
+
1693 _In_ const std::locale& locale = std::locale()) :
+
1694 basic_parser<T>(locale),
+
1695 numerator(_numerator),
+
1696 fraction_line(_fraction_line),
+
1697 denominator(_denominator)
+
1698 {}
+
1699
+
1700 virtual bool match(
+
1701 _In_reads_or_z_(end) const T* text,
+
1702 _In_ size_t start = 0,
+
1703 _In_ size_t end = (size_t)-1,
+
1704 _In_ int flags = match_default)
+
1705 {
+
1706 assert(text || start >= end);
+
1707 if (numerator->match(text, start, end, flags) &&
+
1708 fraction_line->match(text, numerator->interval.end, end, flags) &&
+
1709 denominator->match(text, fraction_line->interval.end, end, flags))
+
1710 {
+
1711 this->interval.start = start;
+
1712 this->interval.end = denominator->interval.end;
+
1713 return true;
+
1714 }
+
1715 numerator->invalidate();
+
1716 fraction_line->invalidate();
+
1717 denominator->invalidate();
+
1718 this->interval.start = (this->interval.end = start) + 1;
+
1719 return false;
+
1720 }
+
1721
+
1722 virtual void invalidate()
+
1723 {
+
1724 numerator->invalidate();
+
1725 fraction_line->invalidate();
+
1726 denominator->invalidate();
+ +
1728 }
+
1729
+
1730 public:
+
1731 std::shared_ptr<basic_parser<T>> numerator;
+
1732 std::shared_ptr<basic_parser<T>> fraction_line;
+
1733 std::shared_ptr<basic_parser<T>> denominator;
+
1734 };
-
1734
- - -
1737#ifdef _UNICODE
-
1738 using tfraction = wfraction;
-
1739#else
-
1740 using tfraction = fraction;
-
1741#endif
- -
1743
-
1747 template <class T>
-
-
1748 class basic_score : public basic_parser<T>
-
1749 {
-
1750 public:
- -
1752 _In_ const std::shared_ptr<basic_parser<T>>& _home,
-
1753 _In_ const std::shared_ptr<basic_parser<T>>& _separator,
-
1754 _In_ const std::shared_ptr<basic_parser<T>>& _guest,
-
1755 _In_ const std::shared_ptr<basic_parser<T>>& space,
-
1756 _In_ const std::locale& locale = std::locale()) :
-
1757 basic_parser<T>(locale),
-
1758 home(_home),
-
1759 separator(_separator),
-
1760 guest(_guest),
-
1761 m_space(space)
-
1762 {}
-
1763
-
1764 virtual bool match(
-
1765 _In_reads_or_z_(end) const T* text,
-
1766 _In_ size_t start = 0,
-
1767 _In_ size_t end = (size_t)-1,
-
1768 _In_ int flags = match_default)
-
1769 {
-
1770 assert(text || start >= end);
-
1771 this->interval.end = start;
-
1772
-
1773 const int space_match_flags = flags & ~match_multiline; // Spaces in score must never be broken in new line.
-
1774
-
1775 if (home->match(text, this->interval.end, end, flags))
-
1776 this->interval.end = home->interval.end;
-
1777 else
-
1778 goto end;
-
1779
-
1780 for (; m_space->match(text, this->interval.end, end, space_match_flags); this->interval.end = m_space->interval.end);
-
1781
-
1782 if (separator->match(text, this->interval.end, end, flags))
-
1783 this->interval.end = separator->interval.end;
-
1784 else
-
1785 goto end;
-
1786
-
1787 for (; m_space->match(text, this->interval.end, end, space_match_flags); this->interval.end = m_space->interval.end);
-
1788
-
1789 if (guest->match(text, this->interval.end, end, flags))
-
1790 this->interval.end = guest->interval.end;
-
1791 else
-
1792 goto end;
-
1793
-
1794 this->interval.start = start;
-
1795 return true;
-
1796
-
1797 end:
-
1798 home->invalidate();
-
1799 separator->invalidate();
-
1800 guest->invalidate();
-
1801 this->interval.start = (this->interval.end = start) + 1;
-
1802 return false;
-
1803 }
-
1804
-
1805 virtual void invalidate()
-
1806 {
-
1807 home->invalidate();
-
1808 separator->invalidate();
-
1809 guest->invalidate();
- -
1811 }
-
1812
-
1813 public:
-
1814 std::shared_ptr<basic_parser<T>> home;
-
1815 std::shared_ptr<basic_parser<T>> separator;
-
1816 std::shared_ptr<basic_parser<T>> guest;
-
1817
-
1818 protected:
-
1819 std::shared_ptr<basic_parser<T>> m_space;
-
1820 };
+
1735
+ + +
1738#ifdef _UNICODE
+
1739 using tfraction = wfraction;
+
1740#else
+
1741 using tfraction = fraction;
+
1742#endif
+ +
1744
+
1748 template <class T>
+
+
1749 class basic_score : public basic_parser<T>
+
1750 {
+
1751 public:
+ +
1753 _In_ const std::shared_ptr<basic_parser<T>>& _home,
+
1754 _In_ const std::shared_ptr<basic_parser<T>>& _separator,
+
1755 _In_ const std::shared_ptr<basic_parser<T>>& _guest,
+
1756 _In_ const std::shared_ptr<basic_parser<T>>& space,
+
1757 _In_ const std::locale& locale = std::locale()) :
+
1758 basic_parser<T>(locale),
+
1759 home(_home),
+
1760 separator(_separator),
+
1761 guest(_guest),
+
1762 m_space(space)
+
1763 {}
+
1764
+
1765 virtual bool match(
+
1766 _In_reads_or_z_(end) const T* text,
+
1767 _In_ size_t start = 0,
+
1768 _In_ size_t end = (size_t)-1,
+
1769 _In_ int flags = match_default)
+
1770 {
+
1771 assert(text || start >= end);
+
1772 this->interval.end = start;
+
1773
+
1774 const int space_match_flags = flags & ~match_multiline; // Spaces in score must never be broken in new line.
+
1775
+
1776 if (home->match(text, this->interval.end, end, flags))
+
1777 this->interval.end = home->interval.end;
+
1778 else
+
1779 goto end;
+
1780
+
1781 for (; m_space->match(text, this->interval.end, end, space_match_flags); this->interval.end = m_space->interval.end);
+
1782
+
1783 if (separator->match(text, this->interval.end, end, flags))
+
1784 this->interval.end = separator->interval.end;
+
1785 else
+
1786 goto end;
+
1787
+
1788 for (; m_space->match(text, this->interval.end, end, space_match_flags); this->interval.end = m_space->interval.end);
+
1789
+
1790 if (guest->match(text, this->interval.end, end, flags))
+
1791 this->interval.end = guest->interval.end;
+
1792 else
+
1793 goto end;
+
1794
+
1795 this->interval.start = start;
+
1796 return true;
+
1797
+
1798 end:
+
1799 home->invalidate();
+
1800 separator->invalidate();
+
1801 guest->invalidate();
+
1802 this->interval.start = (this->interval.end = start) + 1;
+
1803 return false;
+
1804 }
+
1805
+
1806 virtual void invalidate()
+
1807 {
+
1808 home->invalidate();
+
1809 separator->invalidate();
+
1810 guest->invalidate();
+ +
1812 }
+
1813
+
1814 public:
+
1815 std::shared_ptr<basic_parser<T>> home;
+
1816 std::shared_ptr<basic_parser<T>> separator;
+
1817 std::shared_ptr<basic_parser<T>> guest;
+
1818
+
1819 protected:
+
1820 std::shared_ptr<basic_parser<T>> m_space;
+
1821 };
-
1821
-
1822 using score = basic_score<char>;
- -
1824#ifdef _UNICODE
-
1825 using tscore = wscore;
-
1826#else
-
1827 using tscore = score;
-
1828#endif
- -
1830
-
1834 template <class T>
-
- -
1836 {
-
1837 public:
- -
1839 _In_ const std::shared_ptr<basic_parser<T>>& _positive_sign,
-
1840 _In_ const std::shared_ptr<basic_parser<T>>& _negative_sign,
-
1841 _In_ const std::shared_ptr<basic_parser<T>>& _special_sign,
-
1842 _In_ const std::shared_ptr<basic_parser<T>>& _number,
-
1843 _In_ const std::locale& locale = std::locale()) :
-
1844 basic_parser<T>(locale),
- - - - -
1849 {}
-
1850
-
1851 virtual bool match(
-
1852 _In_reads_or_z_(end) const T* text,
-
1853 _In_ size_t start = 0,
-
1854 _In_ size_t end = (size_t)-1,
-
1855 _In_ int flags = match_default)
-
1856 {
-
1857 assert(text || start >= end);
-
1858 this->interval.end = start;
-
1859 if (positive_sign && positive_sign->match(text, this->interval.end, end, flags)) {
-
1860 this->interval.end = positive_sign->interval.end;
-
1861 if (negative_sign) negative_sign->invalidate();
-
1862 if (special_sign) special_sign->invalidate();
-
1863 }
-
1864 else if (negative_sign && negative_sign->match(text, this->interval.end, end, flags)) {
-
1865 this->interval.end = negative_sign->interval.end;
-
1866 if (positive_sign) positive_sign->invalidate();
-
1867 if (special_sign) special_sign->invalidate();
-
1868 }
-
1869 else if (special_sign && special_sign->match(text, this->interval.end, end, flags)) {
-
1870 this->interval.end = special_sign->interval.end;
-
1871 if (positive_sign) positive_sign->invalidate();
-
1872 if (negative_sign) negative_sign->invalidate();
-
1873 }
-
1874 else {
-
1875 if (positive_sign) positive_sign->invalidate();
-
1876 if (negative_sign) negative_sign->invalidate();
-
1877 if (special_sign) special_sign->invalidate();
-
1878 }
-
1879 if (number->match(text, this->interval.end, end, flags)) {
-
1880 this->interval.start = start;
-
1881 this->interval.end = number->interval.end;
-
1882 return true;
-
1883 }
-
1884 if (positive_sign) positive_sign->invalidate();
-
1885 if (negative_sign) negative_sign->invalidate();
-
1886 if (special_sign) special_sign->invalidate();
-
1887 number->invalidate();
-
1888 this->interval.start = (this->interval.end = start) + 1;
-
1889 return false;
-
1890 }
-
1891
-
1892 virtual void invalidate()
-
1893 {
-
1894 if (positive_sign) positive_sign->invalidate();
-
1895 if (negative_sign) negative_sign->invalidate();
-
1896 if (special_sign) special_sign->invalidate();
-
1897 number->invalidate();
- -
1899 }
-
1900
-
1901 public:
-
1902 std::shared_ptr<basic_parser<T>> positive_sign;
-
1903 std::shared_ptr<basic_parser<T>> negative_sign;
-
1904 std::shared_ptr<basic_parser<T>> special_sign;
-
1905 std::shared_ptr<basic_parser<T>> number;
-
1906 };
+
1822
+
1823 using score = basic_score<char>;
+ +
1825#ifdef _UNICODE
+
1826 using tscore = wscore;
+
1827#else
+
1828 using tscore = score;
+
1829#endif
+ +
1831
+
1835 template <class T>
+
+ +
1837 {
+
1838 public:
+ +
1840 _In_ const std::shared_ptr<basic_parser<T>>& _positive_sign,
+
1841 _In_ const std::shared_ptr<basic_parser<T>>& _negative_sign,
+
1842 _In_ const std::shared_ptr<basic_parser<T>>& _special_sign,
+
1843 _In_ const std::shared_ptr<basic_parser<T>>& _number,
+
1844 _In_ const std::locale& locale = std::locale()) :
+
1845 basic_parser<T>(locale),
+ + + + +
1850 {}
+
1851
+
1852 virtual bool match(
+
1853 _In_reads_or_z_(end) const T* text,
+
1854 _In_ size_t start = 0,
+
1855 _In_ size_t end = (size_t)-1,
+
1856 _In_ int flags = match_default)
+
1857 {
+
1858 assert(text || start >= end);
+
1859 this->interval.end = start;
+
1860 if (positive_sign && positive_sign->match(text, this->interval.end, end, flags)) {
+
1861 this->interval.end = positive_sign->interval.end;
+
1862 if (negative_sign) negative_sign->invalidate();
+
1863 if (special_sign) special_sign->invalidate();
+
1864 }
+
1865 else if (negative_sign && negative_sign->match(text, this->interval.end, end, flags)) {
+
1866 this->interval.end = negative_sign->interval.end;
+
1867 if (positive_sign) positive_sign->invalidate();
+
1868 if (special_sign) special_sign->invalidate();
+
1869 }
+
1870 else if (special_sign && special_sign->match(text, this->interval.end, end, flags)) {
+
1871 this->interval.end = special_sign->interval.end;
+
1872 if (positive_sign) positive_sign->invalidate();
+
1873 if (negative_sign) negative_sign->invalidate();
+
1874 }
+
1875 else {
+
1876 if (positive_sign) positive_sign->invalidate();
+
1877 if (negative_sign) negative_sign->invalidate();
+
1878 if (special_sign) special_sign->invalidate();
+
1879 }
+
1880 if (number->match(text, this->interval.end, end, flags)) {
+
1881 this->interval.start = start;
+
1882 this->interval.end = number->interval.end;
+
1883 return true;
+
1884 }
+
1885 if (positive_sign) positive_sign->invalidate();
+
1886 if (negative_sign) negative_sign->invalidate();
+
1887 if (special_sign) special_sign->invalidate();
+
1888 number->invalidate();
+
1889 this->interval.start = (this->interval.end = start) + 1;
+
1890 return false;
+
1891 }
+
1892
+
1893 virtual void invalidate()
+
1894 {
+
1895 if (positive_sign) positive_sign->invalidate();
+
1896 if (negative_sign) negative_sign->invalidate();
+
1897 if (special_sign) special_sign->invalidate();
+
1898 number->invalidate();
+ +
1900 }
+
1901
+
1902 public:
+
1903 std::shared_ptr<basic_parser<T>> positive_sign;
+
1904 std::shared_ptr<basic_parser<T>> negative_sign;
+
1905 std::shared_ptr<basic_parser<T>> special_sign;
+
1906 std::shared_ptr<basic_parser<T>> number;
+
1907 };
-
1907
- - -
1910#ifdef _UNICODE
- -
1912#else
- -
1914#endif
- -
1916
-
1920 template <class T>
-
- -
1922 {
-
1923 public:
- -
1925 _In_ const std::shared_ptr<basic_parser<T>>& _positive_sign,
-
1926 _In_ const std::shared_ptr<basic_parser<T>>& _negative_sign,
-
1927 _In_ const std::shared_ptr<basic_parser<T>>& _special_sign,
-
1928 _In_ const std::shared_ptr<basic_parser<T>>& _integer,
-
1929 _In_ const std::shared_ptr<basic_parser<T>>& space,
-
1930 _In_ const std::shared_ptr<basic_parser<T>>& _fraction,
-
1931 _In_ const std::locale& locale = std::locale()) :
-
1932 basic_parser<T>(locale),
- - - - - -
1938 m_space(space)
-
1939 {}
-
1940
-
1941 virtual bool match(
-
1942 _In_reads_or_z_(end) const T* text,
-
1943 _In_ size_t start = 0,
-
1944 _In_ size_t end = (size_t)-1,
-
1945 _In_ int flags = match_default)
-
1946 {
-
1947 assert(text || start >= end);
-
1948 this->interval.end = start;
-
1949
-
1950 if (positive_sign && positive_sign->match(text, this->interval.end, end, flags)) {
-
1951 this->interval.end = positive_sign->interval.end;
-
1952 if (negative_sign) negative_sign->invalidate();
-
1953 if (special_sign) special_sign->invalidate();
-
1954 }
-
1955 else if (negative_sign && negative_sign->match(text, this->interval.end, end, flags)) {
-
1956 this->interval.end = negative_sign->interval.end;
-
1957 if (positive_sign) positive_sign->invalidate();
-
1958 if (special_sign) special_sign->invalidate();
-
1959 }
-
1960 else if (special_sign && special_sign->match(text, this->interval.end, end, flags)) {
-
1961 this->interval.end = special_sign->interval.end;
-
1962 if (positive_sign) positive_sign->invalidate();
-
1963 if (negative_sign) negative_sign->invalidate();
-
1964 }
-
1965 else {
-
1966 if (positive_sign) positive_sign->invalidate();
-
1967 if (negative_sign) negative_sign->invalidate();
-
1968 if (special_sign) special_sign->invalidate();
-
1969 }
-
1970
-
1971 // Check for <integer> <fraction>
-
1972 const int space_match_flags = flags & ~match_multiline; // Spaces in fractions must never be broken in new line.
-
1973 if (integer->match(text, this->interval.end, end, flags) &&
-
1974 m_space->match(text, integer->interval.end, end, space_match_flags))
-
1975 {
-
1976 for (this->interval.end = m_space->interval.end; m_space->match(text, this->interval.end, end, space_match_flags); this->interval.end = m_space->interval.end);
-
1977 if (fraction->match(text, this->interval.end, end, flags)) {
-
1978 this->interval.start = start;
-
1979 this->interval.end = fraction->interval.end;
-
1980 return true;
-
1981 }
-
1982 fraction->invalidate();
-
1983 this->interval.start = start;
-
1984 this->interval.end = integer->interval.end;
-
1985 return true;
-
1986 }
-
1987
-
1988 // Check for <fraction>
-
1989 if (fraction->match(text, this->interval.end, end, flags)) {
-
1990 integer->invalidate();
-
1991 this->interval.start = start;
-
1992 this->interval.end = fraction->interval.end;
-
1993 return true;
-
1994 }
-
1995
-
1996 // Check for <integer>
-
1997 if (integer->match(text, this->interval.end, end, flags)) {
-
1998 fraction->invalidate();
-
1999 this->interval.start = start;
-
2000 this->interval.end = integer->interval.end;
-
2001 return true;
-
2002 }
-
2003
-
2004 if (positive_sign) positive_sign->invalidate();
-
2005 if (negative_sign) negative_sign->invalidate();
-
2006 if (special_sign) special_sign->invalidate();
-
2007 integer->invalidate();
-
2008 fraction->invalidate();
-
2009 this->interval.start = (this->interval.end = start) + 1;
-
2010 return false;
-
2011 }
-
2012
-
2013 virtual void invalidate()
-
2014 {
-
2015 if (positive_sign) positive_sign->invalidate();
-
2016 if (negative_sign) negative_sign->invalidate();
-
2017 if (special_sign) special_sign->invalidate();
-
2018 integer->invalidate();
-
2019 fraction->invalidate();
- -
2021 }
-
2022
-
2023 public:
-
2024 std::shared_ptr<basic_parser<T>> positive_sign;
-
2025 std::shared_ptr<basic_parser<T>> negative_sign;
-
2026 std::shared_ptr<basic_parser<T>> special_sign;
-
2027 std::shared_ptr<basic_parser<T>> integer;
-
2028 std::shared_ptr<basic_parser<T>> fraction;
-
2029
-
2030 protected:
-
2031 std::shared_ptr<basic_parser<T>> m_space;
-
2032 };
+
1908
+ + +
1911#ifdef _UNICODE
+ +
1913#else
+ +
1915#endif
+ +
1917
+
1921 template <class T>
+
+ +
1923 {
+
1924 public:
+ +
1926 _In_ const std::shared_ptr<basic_parser<T>>& _positive_sign,
+
1927 _In_ const std::shared_ptr<basic_parser<T>>& _negative_sign,
+
1928 _In_ const std::shared_ptr<basic_parser<T>>& _special_sign,
+
1929 _In_ const std::shared_ptr<basic_parser<T>>& _integer,
+
1930 _In_ const std::shared_ptr<basic_parser<T>>& space,
+
1931 _In_ const std::shared_ptr<basic_parser<T>>& _fraction,
+
1932 _In_ const std::locale& locale = std::locale()) :
+
1933 basic_parser<T>(locale),
+ + + + + +
1939 m_space(space)
+
1940 {}
+
1941
+
1942 virtual bool match(
+
1943 _In_reads_or_z_(end) const T* text,
+
1944 _In_ size_t start = 0,
+
1945 _In_ size_t end = (size_t)-1,
+
1946 _In_ int flags = match_default)
+
1947 {
+
1948 assert(text || start >= end);
+
1949 this->interval.end = start;
+
1950
+
1951 if (positive_sign && positive_sign->match(text, this->interval.end, end, flags)) {
+
1952 this->interval.end = positive_sign->interval.end;
+
1953 if (negative_sign) negative_sign->invalidate();
+
1954 if (special_sign) special_sign->invalidate();
+
1955 }
+
1956 else if (negative_sign && negative_sign->match(text, this->interval.end, end, flags)) {
+
1957 this->interval.end = negative_sign->interval.end;
+
1958 if (positive_sign) positive_sign->invalidate();
+
1959 if (special_sign) special_sign->invalidate();
+
1960 }
+
1961 else if (special_sign && special_sign->match(text, this->interval.end, end, flags)) {
+
1962 this->interval.end = special_sign->interval.end;
+
1963 if (positive_sign) positive_sign->invalidate();
+
1964 if (negative_sign) negative_sign->invalidate();
+
1965 }
+
1966 else {
+
1967 if (positive_sign) positive_sign->invalidate();
+
1968 if (negative_sign) negative_sign->invalidate();
+
1969 if (special_sign) special_sign->invalidate();
+
1970 }
+
1971
+
1972 // Check for <integer> <fraction>
+
1973 const int space_match_flags = flags & ~match_multiline; // Spaces in fractions must never be broken in new line.
+
1974 if (integer->match(text, this->interval.end, end, flags) &&
+
1975 m_space->match(text, integer->interval.end, end, space_match_flags))
+
1976 {
+
1977 for (this->interval.end = m_space->interval.end; m_space->match(text, this->interval.end, end, space_match_flags); this->interval.end = m_space->interval.end);
+
1978 if (fraction->match(text, this->interval.end, end, flags)) {
+
1979 this->interval.start = start;
+
1980 this->interval.end = fraction->interval.end;
+
1981 return true;
+
1982 }
+
1983 fraction->invalidate();
+
1984 this->interval.start = start;
+
1985 this->interval.end = integer->interval.end;
+
1986 return true;
+
1987 }
+
1988
+
1989 // Check for <fraction>
+
1990 if (fraction->match(text, this->interval.end, end, flags)) {
+
1991 integer->invalidate();
+
1992 this->interval.start = start;
+
1993 this->interval.end = fraction->interval.end;
+
1994 return true;
+
1995 }
+
1996
+
1997 // Check for <integer>
+
1998 if (integer->match(text, this->interval.end, end, flags)) {
+
1999 fraction->invalidate();
+
2000 this->interval.start = start;
+
2001 this->interval.end = integer->interval.end;
+
2002 return true;
+
2003 }
+
2004
+
2005 if (positive_sign) positive_sign->invalidate();
+
2006 if (negative_sign) negative_sign->invalidate();
+
2007 if (special_sign) special_sign->invalidate();
+
2008 integer->invalidate();
+
2009 fraction->invalidate();
+
2010 this->interval.start = (this->interval.end = start) + 1;
+
2011 return false;
+
2012 }
+
2013
+
2014 virtual void invalidate()
+
2015 {
+
2016 if (positive_sign) positive_sign->invalidate();
+
2017 if (negative_sign) negative_sign->invalidate();
+
2018 if (special_sign) special_sign->invalidate();
+
2019 integer->invalidate();
+
2020 fraction->invalidate();
+ +
2022 }
+
2023
+
2024 public:
+
2025 std::shared_ptr<basic_parser<T>> positive_sign;
+
2026 std::shared_ptr<basic_parser<T>> negative_sign;
+
2027 std::shared_ptr<basic_parser<T>> special_sign;
+
2028 std::shared_ptr<basic_parser<T>> integer;
+
2029 std::shared_ptr<basic_parser<T>> fraction;
+
2030
+
2031 protected:
+
2032 std::shared_ptr<basic_parser<T>> m_space;
+
2033 };
-
2033
- - -
2036#ifdef _UNICODE
- -
2038#else
- -
2040#endif
- -
2042
-
2046 template <class T>
-
- -
2048 {
-
2049 public:
- -
2051 _In_ const std::shared_ptr<basic_parser<T>>& _positive_sign,
-
2052 _In_ const std::shared_ptr<basic_parser<T>>& _negative_sign,
-
2053 _In_ const std::shared_ptr<basic_parser<T>>& _special_sign,
-
2054 _In_ const std::shared_ptr<basic_integer<T>>& _integer,
-
2055 _In_ const std::shared_ptr<basic_parser<T>>& _decimal_separator,
-
2056 _In_ const std::shared_ptr<basic_integer<T>>& _decimal,
-
2057 _In_ const std::shared_ptr<basic_parser<T>>& _exponent_symbol,
-
2058 _In_ const std::shared_ptr<basic_parser<T>>& _positive_exp_sign,
-
2059 _In_ const std::shared_ptr<basic_parser<T>>& _negative_exp_sign,
-
2060 _In_ const std::shared_ptr<basic_integer<T>>& _exponent,
-
2061 _In_ const std::locale& locale = std::locale()) :
-
2062 basic_parser<T>(locale),
- - - - - - - - - - -
2073 value(std::numeric_limits<double>::quiet_NaN())
-
2074 {}
-
2075
-
2076 virtual bool match(
-
2077 _In_reads_or_z_(end) const T* text,
-
2078 _In_ size_t start = 0,
-
2079 _In_ size_t end = (size_t)-1,
-
2080 _In_ int flags = match_default)
-
2081 {
-
2082 assert(text || start >= end);
-
2083 this->interval.end = start;
-
2084
-
2085 if (positive_sign && positive_sign->match(text, this->interval.end, end, flags)) {
-
2086 this->interval.end = positive_sign->interval.end;
-
2087 if (negative_sign) negative_sign->invalidate();
-
2088 if (special_sign) special_sign->invalidate();
-
2089 }
-
2090 else if (negative_sign && negative_sign->match(text, this->interval.end, end, flags)) {
-
2091 this->interval.end = negative_sign->interval.end;
-
2092 if (positive_sign) positive_sign->invalidate();
-
2093 if (special_sign) special_sign->invalidate();
-
2094 }
-
2095 else if (special_sign && special_sign->match(text, this->interval.end, end, flags)) {
-
2096 this->interval.end = special_sign->interval.end;
-
2097 if (positive_sign) positive_sign->invalidate();
-
2098 if (negative_sign) negative_sign->invalidate();
-
2099 }
-
2100 else {
-
2101 if (positive_sign) positive_sign->invalidate();
-
2102 if (negative_sign) negative_sign->invalidate();
-
2103 if (special_sign) special_sign->invalidate();
-
2104 }
-
2105
-
2106 if (integer->match(text, this->interval.end, end, flags))
-
2107 this->interval.end = integer->interval.end;
-
2108
-
2109 if (decimal_separator->match(text, this->interval.end, end, flags) &&
- -
2111 this->interval.end = decimal->interval.end;
-
2112 else {
-
2113 decimal_separator->invalidate();
-
2114 decimal->invalidate();
-
2115 }
-
2116
-
2117 if (integer->interval.empty() &&
-
2118 decimal->interval.empty())
-
2119 {
-
2120 // No integer part, no decimal part.
-
2121 if (positive_sign) positive_sign->invalidate();
-
2122 if (negative_sign) negative_sign->invalidate();
-
2123 if (special_sign) special_sign->invalidate();
-
2124 integer->invalidate();
-
2125 decimal_separator->invalidate();
-
2126 decimal->invalidate();
-
2127 if (exponent_symbol) exponent_symbol->invalidate();
-
2128 if (positive_exp_sign) positive_exp_sign->invalidate();
-
2129 if (negative_exp_sign) negative_exp_sign->invalidate();
-
2130 if (exponent) exponent->invalidate();
-
2131 this->interval.start = (this->interval.end = start) + 1;
-
2132 return false;
-
2133 }
-
2134
-
2135 if (exponent_symbol && exponent_symbol->match(text, this->interval.end, end, flags) &&
- - -
2138 (exponent && exponent->match(text, exponent_symbol->interval.end, end, flags))))
-
2139 {
-
2140 this->interval.end = exponent->interval.end;
-
2141 if (negative_exp_sign) negative_exp_sign->invalidate();
-
2142 }
-
2143 else if (exponent_symbol && exponent_symbol->match(text, this->interval.end, end, flags) &&
- - -
2146 {
-
2147 this->interval.end = exponent->interval.end;
-
2148 if (positive_exp_sign) positive_exp_sign->invalidate();
-
2149 }
-
2150 else {
-
2151 if (exponent_symbol) exponent_symbol->invalidate();
-
2152 if (positive_exp_sign) positive_exp_sign->invalidate();
-
2153 if (negative_exp_sign) negative_exp_sign->invalidate();
-
2154 if (exponent) exponent->invalidate();
-
2155 }
-
2156
-
2157 value = (double)integer->value;
-
2158 if (decimal->interval)
-
2159 value += (double)decimal->value * pow(10.0, -(double)decimal->interval.size());
-
2160 if (negative_sign && negative_sign->interval)
-
2161 value = -value;
-
2162 if (exponent && exponent->interval) {
-
2163 double e = (double)exponent->value;
-
2164 if (negative_exp_sign && negative_exp_sign->interval)
-
2165 e = -e;
-
2166 value *= pow(10.0, e);
-
2167 }
-
2168
-
2169 this->interval.start = start;
-
2170 return true;
-
2171 }
-
2172
-
2173 virtual void invalidate()
-
2174 {
-
2175 if (positive_sign) positive_sign->invalidate();
-
2176 if (negative_sign) negative_sign->invalidate();
-
2177 if (special_sign) special_sign->invalidate();
-
2178 integer->invalidate();
-
2179 decimal_separator->invalidate();
-
2180 decimal->invalidate();
-
2181 if (exponent_symbol) exponent_symbol->invalidate();
-
2182 if (positive_exp_sign) positive_exp_sign->invalidate();
-
2183 if (negative_exp_sign) negative_exp_sign->invalidate();
-
2184 if (exponent) exponent->invalidate();
-
2185 value = std::numeric_limits<double>::quiet_NaN();
- -
2187 }
-
2188
-
2189 public:
-
2190 std::shared_ptr<basic_parser<T>> positive_sign;
-
2191 std::shared_ptr<basic_parser<T>> negative_sign;
-
2192 std::shared_ptr<basic_parser<T>> special_sign;
-
2193 std::shared_ptr<basic_integer<T>> integer;
-
2194 std::shared_ptr<basic_parser<T>> decimal_separator;
-
2195 std::shared_ptr<basic_integer<T>> decimal;
-
2196 std::shared_ptr<basic_parser<T>> exponent_symbol;
-
2197 std::shared_ptr<basic_parser<T>> positive_exp_sign;
-
2198 std::shared_ptr<basic_parser<T>> negative_exp_sign;
-
2199 std::shared_ptr<basic_integer<T>> exponent;
-
2200 double value;
-
2201 };
+
2034
+ + +
2037#ifdef _UNICODE
+ +
2039#else
+ +
2041#endif
+ +
2043
+
2047 template <class T>
+
+ +
2049 {
+
2050 public:
+ +
2052 _In_ const std::shared_ptr<basic_parser<T>>& _positive_sign,
+
2053 _In_ const std::shared_ptr<basic_parser<T>>& _negative_sign,
+
2054 _In_ const std::shared_ptr<basic_parser<T>>& _special_sign,
+
2055 _In_ const std::shared_ptr<basic_integer<T>>& _integer,
+
2056 _In_ const std::shared_ptr<basic_parser<T>>& _decimal_separator,
+
2057 _In_ const std::shared_ptr<basic_integer<T>>& _decimal,
+
2058 _In_ const std::shared_ptr<basic_parser<T>>& _exponent_symbol,
+
2059 _In_ const std::shared_ptr<basic_parser<T>>& _positive_exp_sign,
+
2060 _In_ const std::shared_ptr<basic_parser<T>>& _negative_exp_sign,
+
2061 _In_ const std::shared_ptr<basic_integer<T>>& _exponent,
+
2062 _In_ const std::locale& locale = std::locale()) :
+
2063 basic_parser<T>(locale),
+ + + + + + + + + + +
2074 value(std::numeric_limits<double>::quiet_NaN())
+
2075 {}
+
2076
+
2077 virtual bool match(
+
2078 _In_reads_or_z_(end) const T* text,
+
2079 _In_ size_t start = 0,
+
2080 _In_ size_t end = (size_t)-1,
+
2081 _In_ int flags = match_default)
+
2082 {
+
2083 assert(text || start >= end);
+
2084 this->interval.end = start;
+
2085
+
2086 if (positive_sign && positive_sign->match(text, this->interval.end, end, flags)) {
+
2087 this->interval.end = positive_sign->interval.end;
+
2088 if (negative_sign) negative_sign->invalidate();
+
2089 if (special_sign) special_sign->invalidate();
+
2090 }
+
2091 else if (negative_sign && negative_sign->match(text, this->interval.end, end, flags)) {
+
2092 this->interval.end = negative_sign->interval.end;
+
2093 if (positive_sign) positive_sign->invalidate();
+
2094 if (special_sign) special_sign->invalidate();
+
2095 }
+
2096 else if (special_sign && special_sign->match(text, this->interval.end, end, flags)) {
+
2097 this->interval.end = special_sign->interval.end;
+
2098 if (positive_sign) positive_sign->invalidate();
+
2099 if (negative_sign) negative_sign->invalidate();
+
2100 }
+
2101 else {
+
2102 if (positive_sign) positive_sign->invalidate();
+
2103 if (negative_sign) negative_sign->invalidate();
+
2104 if (special_sign) special_sign->invalidate();
+
2105 }
+
2106
+
2107 if (integer->match(text, this->interval.end, end, flags))
+
2108 this->interval.end = integer->interval.end;
+
2109
+
2110 if (decimal_separator->match(text, this->interval.end, end, flags) &&
+ +
2112 this->interval.end = decimal->interval.end;
+
2113 else {
+
2114 decimal_separator->invalidate();
+
2115 decimal->invalidate();
+
2116 }
+
2117
+
2118 if (integer->interval.empty() &&
+
2119 decimal->interval.empty())
+
2120 {
+
2121 // No integer part, no decimal part.
+
2122 if (positive_sign) positive_sign->invalidate();
+
2123 if (negative_sign) negative_sign->invalidate();
+
2124 if (special_sign) special_sign->invalidate();
+
2125 integer->invalidate();
+
2126 decimal_separator->invalidate();
+
2127 decimal->invalidate();
+
2128 if (exponent_symbol) exponent_symbol->invalidate();
+
2129 if (positive_exp_sign) positive_exp_sign->invalidate();
+
2130 if (negative_exp_sign) negative_exp_sign->invalidate();
+
2131 if (exponent) exponent->invalidate();
+
2132 this->interval.start = (this->interval.end = start) + 1;
+
2133 return false;
+
2134 }
+
2135
+
2136 if (exponent_symbol && exponent_symbol->match(text, this->interval.end, end, flags) &&
+ + +
2139 (exponent && exponent->match(text, exponent_symbol->interval.end, end, flags))))
+
2140 {
+
2141 this->interval.end = exponent->interval.end;
+
2142 if (negative_exp_sign) negative_exp_sign->invalidate();
+
2143 }
+
2144 else if (exponent_symbol && exponent_symbol->match(text, this->interval.end, end, flags) &&
+ + +
2147 {
+
2148 this->interval.end = exponent->interval.end;
+
2149 if (positive_exp_sign) positive_exp_sign->invalidate();
+
2150 }
+
2151 else {
+
2152 if (exponent_symbol) exponent_symbol->invalidate();
+
2153 if (positive_exp_sign) positive_exp_sign->invalidate();
+
2154 if (negative_exp_sign) negative_exp_sign->invalidate();
+
2155 if (exponent) exponent->invalidate();
+
2156 }
+
2157
+
2158 value = (double)integer->value;
+
2159 if (decimal->interval)
+
2160 value += (double)decimal->value * pow(10.0, -(double)decimal->interval.size());
+
2161 if (negative_sign && negative_sign->interval)
+
2162 value = -value;
+
2163 if (exponent && exponent->interval) {
+
2164 double e = (double)exponent->value;
+
2165 if (negative_exp_sign && negative_exp_sign->interval)
+
2166 e = -e;
+
2167 value *= pow(10.0, e);
+
2168 }
+
2169
+
2170 this->interval.start = start;
+
2171 return true;
+
2172 }
+
2173
+
2174 virtual void invalidate()
+
2175 {
+
2176 if (positive_sign) positive_sign->invalidate();
+
2177 if (negative_sign) negative_sign->invalidate();
+
2178 if (special_sign) special_sign->invalidate();
+
2179 integer->invalidate();
+
2180 decimal_separator->invalidate();
+
2181 decimal->invalidate();
+
2182 if (exponent_symbol) exponent_symbol->invalidate();
+
2183 if (positive_exp_sign) positive_exp_sign->invalidate();
+
2184 if (negative_exp_sign) negative_exp_sign->invalidate();
+
2185 if (exponent) exponent->invalidate();
+
2186 value = std::numeric_limits<double>::quiet_NaN();
+ +
2188 }
+
2189
+
2190 public:
+
2191 std::shared_ptr<basic_parser<T>> positive_sign;
+
2192 std::shared_ptr<basic_parser<T>> negative_sign;
+
2193 std::shared_ptr<basic_parser<T>> special_sign;
+
2194 std::shared_ptr<basic_integer<T>> integer;
+
2195 std::shared_ptr<basic_parser<T>> decimal_separator;
+
2196 std::shared_ptr<basic_integer<T>> decimal;
+
2197 std::shared_ptr<basic_parser<T>> exponent_symbol;
+
2198 std::shared_ptr<basic_parser<T>> positive_exp_sign;
+
2199 std::shared_ptr<basic_parser<T>> negative_exp_sign;
+
2200 std::shared_ptr<basic_integer<T>> exponent;
+
2201 double value;
+
2202 };
-
2202
- - -
2205#ifdef _UNICODE
- -
2207#else
- -
2209#endif
- -
2211
-
2215 template <class T>
-
- -
2217 {
-
2218 public:
- -
2220 _In_ const std::shared_ptr<basic_parser<T>>& _positive_sign,
-
2221 _In_ const std::shared_ptr<basic_parser<T>>& _negative_sign,
-
2222 _In_ const std::shared_ptr<basic_parser<T>>& _special_sign,
-
2223 _In_ const std::shared_ptr<basic_parser<T>>& _currency,
-
2224 _In_ const std::shared_ptr<basic_parser<T>>& _integer,
-
2225 _In_ const std::shared_ptr<basic_parser<T>>& _decimal_separator,
-
2226 _In_ const std::shared_ptr<basic_parser<T>>& _decimal,
-
2227 _In_ const std::locale& locale = std::locale()) :
-
2228 basic_parser<T>(locale),
- - - - - - - -
2236 {}
-
2237
-
2238 virtual bool match(
-
2239 _In_reads_or_z_(end) const T* text,
-
2240 _In_ size_t start = 0,
-
2241 _In_ size_t end = (size_t)-1,
-
2242 _In_ int flags = match_default)
-
2243 {
-
2244 assert(text || start >= end);
-
2245 this->interval.end = start;
-
2246
-
2247 if (positive_sign->match(text, this->interval.end, end, flags)) {
-
2248 this->interval.end = positive_sign->interval.end;
-
2249 if (negative_sign) negative_sign->invalidate();
-
2250 if (special_sign) special_sign->invalidate();
-
2251 }
-
2252 else if (negative_sign->match(text, this->interval.end, end, flags)) {
-
2253 this->interval.end = negative_sign->interval.end;
-
2254 if (positive_sign) positive_sign->invalidate();
-
2255 if (special_sign) special_sign->invalidate();
-
2256 }
-
2257 else if (special_sign->match(text, this->interval.end, end, flags)) {
-
2258 this->interval.end = special_sign->interval.end;
-
2259 if (positive_sign) positive_sign->invalidate();
-
2260 if (negative_sign) negative_sign->invalidate();
-
2261 }
-
2262 else {
-
2263 if (positive_sign) positive_sign->invalidate();
-
2264 if (negative_sign) negative_sign->invalidate();
-
2265 if (special_sign) special_sign->invalidate();
-
2266 }
-
2267
-
2268 if (currency->match(text, this->interval.end, end, flags))
-
2269 this->interval.end = currency->interval.end;
-
2270 else {
-
2271 if (positive_sign) positive_sign->invalidate();
-
2272 if (negative_sign) negative_sign->invalidate();
-
2273 if (special_sign) special_sign->invalidate();
-
2274 integer->invalidate();
-
2275 decimal_separator->invalidate();
-
2276 decimal->invalidate();
-
2277 this->interval.start = (this->interval.end = start) + 1;
-
2278 return false;
-
2279 }
-
2280
-
2281 if (integer->match(text, this->interval.end, end, flags))
-
2282 this->interval.end = integer->interval.end;
-
2283 if (decimal_separator->match(text, this->interval.end, end, flags) &&
- -
2285 this->interval.end = decimal->interval.end;
-
2286 else {
-
2287 decimal_separator->invalidate();
-
2288 decimal->invalidate();
-
2289 }
-
2290
-
2291 if (integer->interval.empty() &&
-
2292 decimal->interval.empty())
-
2293 {
-
2294 // No integer part, no decimal part.
-
2295 if (positive_sign) positive_sign->invalidate();
-
2296 if (negative_sign) negative_sign->invalidate();
-
2297 if (special_sign) special_sign->invalidate();
-
2298 currency->invalidate();
-
2299 integer->invalidate();
-
2300 decimal_separator->invalidate();
-
2301 decimal->invalidate();
-
2302 this->interval.start = (this->interval.end = start) + 1;
-
2303 return false;
-
2304 }
-
2305
-
2306 this->interval.start = start;
-
2307 return true;
-
2308 }
-
2309
-
2310 virtual void invalidate()
-
2311 {
-
2312 if (positive_sign) positive_sign->invalidate();
-
2313 if (negative_sign) negative_sign->invalidate();
-
2314 if (special_sign) special_sign->invalidate();
-
2315 currency->invalidate();
-
2316 integer->invalidate();
-
2317 decimal_separator->invalidate();
-
2318 decimal->invalidate();
- -
2320 }
-
2321
-
2322 public:
-
2323 std::shared_ptr<basic_parser<T>> positive_sign;
-
2324 std::shared_ptr<basic_parser<T>> negative_sign;
-
2325 std::shared_ptr<basic_parser<T>> special_sign;
-
2326 std::shared_ptr<basic_parser<T>> currency;
-
2327 std::shared_ptr<basic_parser<T>> integer;
-
2328 std::shared_ptr<basic_parser<T>> decimal_separator;
-
2329 std::shared_ptr<basic_parser<T>> decimal;
-
2330 };
+
2203
+ + +
2206#ifdef _UNICODE
+ +
2208#else
+ +
2210#endif
+ +
2212
+
2216 template <class T>
+
+ +
2218 {
+
2219 public:
+ +
2221 _In_ const std::shared_ptr<basic_parser<T>>& _positive_sign,
+
2222 _In_ const std::shared_ptr<basic_parser<T>>& _negative_sign,
+
2223 _In_ const std::shared_ptr<basic_parser<T>>& _special_sign,
+
2224 _In_ const std::shared_ptr<basic_parser<T>>& _currency,
+
2225 _In_ const std::shared_ptr<basic_parser<T>>& _integer,
+
2226 _In_ const std::shared_ptr<basic_parser<T>>& _decimal_separator,
+
2227 _In_ const std::shared_ptr<basic_parser<T>>& _decimal,
+
2228 _In_ const std::locale& locale = std::locale()) :
+
2229 basic_parser<T>(locale),
+ + + + + + + +
2237 {}
+
2238
+
2239 virtual bool match(
+
2240 _In_reads_or_z_(end) const T* text,
+
2241 _In_ size_t start = 0,
+
2242 _In_ size_t end = (size_t)-1,
+
2243 _In_ int flags = match_default)
+
2244 {
+
2245 assert(text || start >= end);
+
2246 this->interval.end = start;
+
2247
+
2248 if (positive_sign->match(text, this->interval.end, end, flags)) {
+
2249 this->interval.end = positive_sign->interval.end;
+
2250 if (negative_sign) negative_sign->invalidate();
+
2251 if (special_sign) special_sign->invalidate();
+
2252 }
+
2253 else if (negative_sign->match(text, this->interval.end, end, flags)) {
+
2254 this->interval.end = negative_sign->interval.end;
+
2255 if (positive_sign) positive_sign->invalidate();
+
2256 if (special_sign) special_sign->invalidate();
+
2257 }
+
2258 else if (special_sign->match(text, this->interval.end, end, flags)) {
+
2259 this->interval.end = special_sign->interval.end;
+
2260 if (positive_sign) positive_sign->invalidate();
+
2261 if (negative_sign) negative_sign->invalidate();
+
2262 }
+
2263 else {
+
2264 if (positive_sign) positive_sign->invalidate();
+
2265 if (negative_sign) negative_sign->invalidate();
+
2266 if (special_sign) special_sign->invalidate();
+
2267 }
+
2268
+
2269 if (currency->match(text, this->interval.end, end, flags))
+
2270 this->interval.end = currency->interval.end;
+
2271 else {
+
2272 if (positive_sign) positive_sign->invalidate();
+
2273 if (negative_sign) negative_sign->invalidate();
+
2274 if (special_sign) special_sign->invalidate();
+
2275 integer->invalidate();
+
2276 decimal_separator->invalidate();
+
2277 decimal->invalidate();
+
2278 this->interval.start = (this->interval.end = start) + 1;
+
2279 return false;
+
2280 }
+
2281
+
2282 if (integer->match(text, this->interval.end, end, flags))
+
2283 this->interval.end = integer->interval.end;
+
2284 if (decimal_separator->match(text, this->interval.end, end, flags) &&
+ +
2286 this->interval.end = decimal->interval.end;
+
2287 else {
+
2288 decimal_separator->invalidate();
+
2289 decimal->invalidate();
+
2290 }
+
2291
+
2292 if (integer->interval.empty() &&
+
2293 decimal->interval.empty())
+
2294 {
+
2295 // No integer part, no decimal part.
+
2296 if (positive_sign) positive_sign->invalidate();
+
2297 if (negative_sign) negative_sign->invalidate();
+
2298 if (special_sign) special_sign->invalidate();
+
2299 currency->invalidate();
+
2300 integer->invalidate();
+
2301 decimal_separator->invalidate();
+
2302 decimal->invalidate();
+
2303 this->interval.start = (this->interval.end = start) + 1;
+
2304 return false;
+
2305 }
+
2306
+
2307 this->interval.start = start;
+
2308 return true;
+
2309 }
+
2310
+
2311 virtual void invalidate()
+
2312 {
+
2313 if (positive_sign) positive_sign->invalidate();
+
2314 if (negative_sign) negative_sign->invalidate();
+
2315 if (special_sign) special_sign->invalidate();
+
2316 currency->invalidate();
+
2317 integer->invalidate();
+
2318 decimal_separator->invalidate();
+
2319 decimal->invalidate();
+ +
2321 }
+
2322
+
2323 public:
+
2324 std::shared_ptr<basic_parser<T>> positive_sign;
+
2325 std::shared_ptr<basic_parser<T>> negative_sign;
+
2326 std::shared_ptr<basic_parser<T>> special_sign;
+
2327 std::shared_ptr<basic_parser<T>> currency;
+
2328 std::shared_ptr<basic_parser<T>> integer;
+
2329 std::shared_ptr<basic_parser<T>> decimal_separator;
+
2330 std::shared_ptr<basic_parser<T>> decimal;
+
2331 };
-
2331
- - -
2334#ifdef _UNICODE
- -
2336#else
- -
2338#endif
- -
2340
-
2344 template <class T>
-
- -
2346 {
-
2347 public:
- -
2349 _In_ const std::shared_ptr<basic_parser<T>>& digit_0,
-
2350 _In_ const std::shared_ptr<basic_parser<T>>& digit_1,
-
2351 _In_ const std::shared_ptr<basic_parser<T>>& digit_2,
-
2352 _In_ const std::shared_ptr<basic_parser<T>>& digit_3,
-
2353 _In_ const std::shared_ptr<basic_parser<T>>& digit_4,
-
2354 _In_ const std::shared_ptr<basic_parser<T>>& digit_5,
-
2355 _In_ const std::shared_ptr<basic_parser<T>>& digit_6,
-
2356 _In_ const std::shared_ptr<basic_parser<T>>& digit_7,
-
2357 _In_ const std::shared_ptr<basic_parser<T>>& digit_8,
-
2358 _In_ const std::shared_ptr<basic_parser<T>>& digit_9,
-
2359 _In_ const std::shared_ptr<basic_parser<T>>& separator,
-
2360 _In_ const std::locale& locale = std::locale()) :
-
2361 basic_parser<T>(locale),
-
2362 m_digit_0(digit_0),
-
2363 m_digit_1(digit_1),
-
2364 m_digit_2(digit_2),
-
2365 m_digit_3(digit_3),
-
2366 m_digit_4(digit_4),
-
2367 m_digit_5(digit_5),
-
2368 m_digit_6(digit_6),
-
2369 m_digit_7(digit_7),
-
2370 m_digit_8(digit_8),
-
2371 m_digit_9(digit_9),
-
2372 m_separator(separator)
-
2373 {
-
2374 value.s_addr = 0;
-
2375 }
-
2376
-
2377 virtual bool match(
-
2378 _In_reads_or_z_(end) const T* text,
-
2379 _In_ size_t start = 0,
-
2380 _In_ size_t end = (size_t)-1,
-
2381 _In_ int flags = match_default)
-
2382 {
-
2383 assert(text || start >= end);
-
2384 this->interval.end = start;
-
2385 value.s_addr = 0;
-
2386
-
2387 size_t i;
-
2388 for (i = 0; i < 4; i++) {
-
2389 if (i) {
-
2390 if (m_separator->match(text, this->interval.end, end, flags))
-
2391 this->interval.end = m_separator->interval.end;
-
2392 else
-
2393 goto error;
-
2394 }
-
2395
-
2396 components[i].start = this->interval.end;
-
2397 bool is_empty = true;
-
2398 size_t x;
-
2399 for (x = 0; this->interval.end < end && text[this->interval.end];) {
-
2400 size_t dig, digit_end;
-
2401 if (m_digit_0->match(text, this->interval.end, end, flags)) { dig = 0; digit_end = m_digit_0->interval.end; }
-
2402 else if (m_digit_1->match(text, this->interval.end, end, flags)) { dig = 1; digit_end = m_digit_1->interval.end; }
-
2403 else if (m_digit_2->match(text, this->interval.end, end, flags)) { dig = 2; digit_end = m_digit_2->interval.end; }
-
2404 else if (m_digit_3->match(text, this->interval.end, end, flags)) { dig = 3; digit_end = m_digit_3->interval.end; }
-
2405 else if (m_digit_4->match(text, this->interval.end, end, flags)) { dig = 4; digit_end = m_digit_4->interval.end; }
-
2406 else if (m_digit_5->match(text, this->interval.end, end, flags)) { dig = 5; digit_end = m_digit_5->interval.end; }
-
2407 else if (m_digit_6->match(text, this->interval.end, end, flags)) { dig = 6; digit_end = m_digit_6->interval.end; }
-
2408 else if (m_digit_7->match(text, this->interval.end, end, flags)) { dig = 7; digit_end = m_digit_7->interval.end; }
-
2409 else if (m_digit_8->match(text, this->interval.end, end, flags)) { dig = 8; digit_end = m_digit_8->interval.end; }
-
2410 else if (m_digit_9->match(text, this->interval.end, end, flags)) { dig = 9; digit_end = m_digit_9->interval.end; }
-
2411 else break;
-
2412 size_t x_n = x * 10 + dig;
-
2413 if (x_n <= 255) {
-
2414 x = x_n;
-
2415 this->interval.end = digit_end;
-
2416 is_empty = false;
-
2417 }
-
2418 else
-
2419 break;
-
2420 }
-
2421 if (is_empty)
-
2422 goto error;
-
2423 components[i].end = this->interval.end;
-
2424 value.s_addr = (value.s_addr << 8) | (uint8_t)x;
-
2425 }
-
2426 if (i < 4)
-
2427 goto error;
-
2428
-
2429 this->interval.start = start;
-
2430 return true;
-
2431
-
2432 error:
-
2433 components[0].start = 1;
-
2434 components[0].end = 0;
-
2435 components[1].start = 1;
-
2436 components[1].end = 0;
-
2437 components[2].start = 1;
-
2438 components[2].end = 0;
-
2439 components[3].start = 1;
-
2440 components[3].end = 0;
-
2441 value.s_addr = 0;
-
2442 this->interval.start = (this->interval.end = start) + 1;
-
2443 return false;
-
2444 }
-
2445
-
2446 virtual void invalidate()
-
2447 {
-
2448 components[0].start = 1;
-
2449 components[0].end = 0;
-
2450 components[1].start = 1;
-
2451 components[1].end = 0;
-
2452 components[2].start = 1;
-
2453 components[2].end = 0;
-
2454 components[3].start = 1;
-
2455 components[3].end = 0;
-
2456 value.s_addr = 0;
- -
2458 }
-
2459
-
2460 public:
- - -
2463
-
2464 protected:
-
2465 std::shared_ptr<basic_parser<T>>
-
2466 m_digit_0,
-
2467 m_digit_1,
-
2468 m_digit_2,
-
2469 m_digit_3,
-
2470 m_digit_4,
-
2471 m_digit_5,
-
2472 m_digit_6,
-
2473 m_digit_7,
-
2474 m_digit_8,
-
2475 m_digit_9;
-
2476 std::shared_ptr<basic_parser<T>> m_separator;
-
2477 };
+
2332
+ + +
2335#ifdef _UNICODE
+ +
2337#else
+ +
2339#endif
+ +
2341
+
2345 template <class T>
+
+ +
2347 {
+
2348 public:
+ +
2350 _In_ const std::shared_ptr<basic_parser<T>>& digit_0,
+
2351 _In_ const std::shared_ptr<basic_parser<T>>& digit_1,
+
2352 _In_ const std::shared_ptr<basic_parser<T>>& digit_2,
+
2353 _In_ const std::shared_ptr<basic_parser<T>>& digit_3,
+
2354 _In_ const std::shared_ptr<basic_parser<T>>& digit_4,
+
2355 _In_ const std::shared_ptr<basic_parser<T>>& digit_5,
+
2356 _In_ const std::shared_ptr<basic_parser<T>>& digit_6,
+
2357 _In_ const std::shared_ptr<basic_parser<T>>& digit_7,
+
2358 _In_ const std::shared_ptr<basic_parser<T>>& digit_8,
+
2359 _In_ const std::shared_ptr<basic_parser<T>>& digit_9,
+
2360 _In_ const std::shared_ptr<basic_parser<T>>& separator,
+
2361 _In_ const std::locale& locale = std::locale()) :
+
2362 basic_parser<T>(locale),
+
2363 m_digit_0(digit_0),
+
2364 m_digit_1(digit_1),
+
2365 m_digit_2(digit_2),
+
2366 m_digit_3(digit_3),
+
2367 m_digit_4(digit_4),
+
2368 m_digit_5(digit_5),
+
2369 m_digit_6(digit_6),
+
2370 m_digit_7(digit_7),
+
2371 m_digit_8(digit_8),
+
2372 m_digit_9(digit_9),
+
2373 m_separator(separator)
+
2374 {
+
2375 value.s_addr = 0;
+
2376 }
+
2377
+
2378 virtual bool match(
+
2379 _In_reads_or_z_(end) const T* text,
+
2380 _In_ size_t start = 0,
+
2381 _In_ size_t end = (size_t)-1,
+
2382 _In_ int flags = match_default)
+
2383 {
+
2384 assert(text || start >= end);
+
2385 this->interval.end = start;
+
2386 value.s_addr = 0;
+
2387
+
2388 size_t i;
+
2389 for (i = 0; i < 4; i++) {
+
2390 if (i) {
+
2391 if (m_separator->match(text, this->interval.end, end, flags))
+
2392 this->interval.end = m_separator->interval.end;
+
2393 else
+
2394 goto error;
+
2395 }
+
2396
+
2397 components[i].start = this->interval.end;
+
2398 bool is_empty = true;
+
2399 size_t x;
+
2400 for (x = 0; this->interval.end < end && text[this->interval.end];) {
+
2401 size_t dig, digit_end;
+
2402 if (m_digit_0->match(text, this->interval.end, end, flags)) { dig = 0; digit_end = m_digit_0->interval.end; }
+
2403 else if (m_digit_1->match(text, this->interval.end, end, flags)) { dig = 1; digit_end = m_digit_1->interval.end; }
+
2404 else if (m_digit_2->match(text, this->interval.end, end, flags)) { dig = 2; digit_end = m_digit_2->interval.end; }
+
2405 else if (m_digit_3->match(text, this->interval.end, end, flags)) { dig = 3; digit_end = m_digit_3->interval.end; }
+
2406 else if (m_digit_4->match(text, this->interval.end, end, flags)) { dig = 4; digit_end = m_digit_4->interval.end; }
+
2407 else if (m_digit_5->match(text, this->interval.end, end, flags)) { dig = 5; digit_end = m_digit_5->interval.end; }
+
2408 else if (m_digit_6->match(text, this->interval.end, end, flags)) { dig = 6; digit_end = m_digit_6->interval.end; }
+
2409 else if (m_digit_7->match(text, this->interval.end, end, flags)) { dig = 7; digit_end = m_digit_7->interval.end; }
+
2410 else if (m_digit_8->match(text, this->interval.end, end, flags)) { dig = 8; digit_end = m_digit_8->interval.end; }
+
2411 else if (m_digit_9->match(text, this->interval.end, end, flags)) { dig = 9; digit_end = m_digit_9->interval.end; }
+
2412 else break;
+
2413 size_t x_n = x * 10 + dig;
+
2414 if (x_n <= 255) {
+
2415 x = x_n;
+
2416 this->interval.end = digit_end;
+
2417 is_empty = false;
+
2418 }
+
2419 else
+
2420 break;
+
2421 }
+
2422 if (is_empty)
+
2423 goto error;
+
2424 components[i].end = this->interval.end;
+
2425 value.s_addr = (value.s_addr << 8) | (uint8_t)x;
+
2426 }
+
2427 if (i < 4)
+
2428 goto error;
+
2429
+
2430 this->interval.start = start;
+
2431 return true;
+
2432
+
2433 error:
+
2434 components[0].start = 1;
+
2435 components[0].end = 0;
+
2436 components[1].start = 1;
+
2437 components[1].end = 0;
+
2438 components[2].start = 1;
+
2439 components[2].end = 0;
+
2440 components[3].start = 1;
+
2441 components[3].end = 0;
+
2442 value.s_addr = 0;
+
2443 this->interval.start = (this->interval.end = start) + 1;
+
2444 return false;
+
2445 }
+
2446
+
2447 virtual void invalidate()
+
2448 {
+
2449 components[0].start = 1;
+
2450 components[0].end = 0;
+
2451 components[1].start = 1;
+
2452 components[1].end = 0;
+
2453 components[2].start = 1;
+
2454 components[2].end = 0;
+
2455 components[3].start = 1;
+
2456 components[3].end = 0;
+
2457 value.s_addr = 0;
+ +
2459 }
+
2460
+
2461 public:
+ + +
2464
+
2465 protected:
+
2466 std::shared_ptr<basic_parser<T>>
+
2467 m_digit_0,
+
2468 m_digit_1,
+
2469 m_digit_2,
+
2470 m_digit_3,
+
2471 m_digit_4,
+
2472 m_digit_5,
+
2473 m_digit_6,
+
2474 m_digit_7,
+
2475 m_digit_8,
+
2476 m_digit_9;
+
2477 std::shared_ptr<basic_parser<T>> m_separator;
+
2478 };
-
2478
- - -
2481#ifdef _UNICODE
- -
2483#else
- -
2485#endif
- -
2487
-
2491 template <class T>
-
- -
2493 {
-
2494 public:
-
2495 basic_ipv6_scope_id_char(_In_ const std::locale& locale = std::locale()) : basic_parser<T>(locale) {}
-
2496
-
2497 virtual bool match(
-
2498 _In_reads_or_z_(end) const T* text,
-
2499 _In_ size_t start = 0,
-
2500 _In_ size_t end = (size_t)-1,
-
2501 _In_ int flags = match_default)
-
2502 {
-
2503 assert(text || start >= end);
-
2504 if (start < end && text[start]) {
-
2505 if (text[start] == '-' ||
-
2506 text[start] == '_' ||
-
2507 text[start] == ':' ||
-
2508 std::use_facet<std::ctype<T>>(this->m_locale).is(std::ctype_base::alnum, text[start]))
-
2509 {
-
2510 this->interval.end = (this->interval.start = start) + 1;
-
2511 return true;
-
2512 }
-
2513 }
-
2514 this->interval.start = (this->interval.end = start) + 1;
-
2515 return false;
-
2516 }
-
2517 };
+
2479
+ + +
2482#ifdef _UNICODE
+ +
2484#else
+ +
2486#endif
+ +
2488
+
2492 template <class T>
+
+ +
2494 {
+
2495 public:
+
2496 basic_ipv6_scope_id_char(_In_ const std::locale& locale = std::locale()) : basic_parser<T>(locale) {}
+
2497
+
2498 virtual bool match(
+
2499 _In_reads_or_z_(end) const T* text,
+
2500 _In_ size_t start = 0,
+
2501 _In_ size_t end = (size_t)-1,
+
2502 _In_ int flags = match_default)
+
2503 {
+
2504 assert(text || start >= end);
+
2505 if (start < end && text[start]) {
+
2506 if (text[start] == '-' ||
+
2507 text[start] == '_' ||
+
2508 text[start] == ':' ||
+
2509 std::use_facet<std::ctype<T>>(this->m_locale).is(std::ctype_base::alnum, text[start]))
+
2510 {
+
2511 this->interval.end = (this->interval.start = start) + 1;
+
2512 return true;
+
2513 }
+
2514 }
+
2515 this->interval.start = (this->interval.end = start) + 1;
+
2516 return false;
+
2517 }
+
2518 };
-
2518
- - -
2521#ifdef _UNICODE
- -
2523#else
- -
2525#endif
-
2526
-
- -
2531 {
-
2532 public:
-
2533 sgml_ipv6_scope_id_char(_In_ const std::locale& locale = std::locale()) : sgml_parser(locale) {}
-
2534
-
2535 virtual bool match(
-
2536 _In_reads_or_z_(end) const char* text,
-
2537 _In_ size_t start = 0,
-
2538 _In_ size_t end = (size_t)-1,
-
2539 _In_ int flags = match_default)
-
2540 {
-
2541 assert(text || start >= end);
-
2542 if (start < end && text[start]) {
-
2543 wchar_t buf[3];
-
2544 const wchar_t* chr = next_sgml_cp(text, start, end, this->interval.end, buf);
-
2545 const wchar_t* chr_end = chr + stdex::strlen(chr);
-
2546 if (((chr[0] == L'-' ||
-
2547 chr[0] == L'_' ||
-
2548 chr[0] == L':') && chr[1] == 0) ||
-
2549 std::use_facet<std::ctype<wchar_t>>(m_locale).scan_not(std::ctype_base::alnum, chr, chr_end) == chr_end)
-
2550 {
-
2551 this->interval.start = start;
-
2552 return true;
-
2553 }
-
2554 }
-
2555 this->interval.start = (this->interval.end = start) + 1;
-
2556 return false;
-
2557 }
-
2558 };
+
2519
+ + +
2522#ifdef _UNICODE
+ +
2524#else
+ +
2526#endif
+
2527
+
+ +
2532 {
+
2533 public:
+
2534 sgml_ipv6_scope_id_char(_In_ const std::locale& locale = std::locale()) : sgml_parser(locale) {}
+
2535
+
2536 virtual bool match(
+
2537 _In_reads_or_z_(end) const char* text,
+
2538 _In_ size_t start = 0,
+
2539 _In_ size_t end = (size_t)-1,
+
2540 _In_ int flags = match_default)
+
2541 {
+
2542 assert(text || start >= end);
+
2543 if (start < end && text[start]) {
+
2544 wchar_t buf[3];
+
2545 const wchar_t* chr = next_sgml_cp(text, start, end, this->interval.end, buf);
+
2546 const wchar_t* chr_end = chr + stdex::strlen(chr);
+
2547 if (((chr[0] == L'-' ||
+
2548 chr[0] == L'_' ||
+
2549 chr[0] == L':') && chr[1] == 0) ||
+
2550 std::use_facet<std::ctype<wchar_t>>(m_locale).scan_not(std::ctype_base::alnum, chr, chr_end) == chr_end)
+
2551 {
+
2552 this->interval.start = start;
+
2553 return true;
+
2554 }
+
2555 }
+
2556 this->interval.start = (this->interval.end = start) + 1;
+
2557 return false;
+
2558 }
+
2559 };
-
2559
-
2563 template <class T>
-
- -
2565 {
-
2566 public:
- -
2568 _In_ const std::shared_ptr<basic_parser<T>>& digit_0,
-
2569 _In_ const std::shared_ptr<basic_parser<T>>& digit_1,
-
2570 _In_ const std::shared_ptr<basic_parser<T>>& digit_2,
-
2571 _In_ const std::shared_ptr<basic_parser<T>>& digit_3,
-
2572 _In_ const std::shared_ptr<basic_parser<T>>& digit_4,
-
2573 _In_ const std::shared_ptr<basic_parser<T>>& digit_5,
-
2574 _In_ const std::shared_ptr<basic_parser<T>>& digit_6,
-
2575 _In_ const std::shared_ptr<basic_parser<T>>& digit_7,
-
2576 _In_ const std::shared_ptr<basic_parser<T>>& digit_8,
-
2577 _In_ const std::shared_ptr<basic_parser<T>>& digit_9,
-
2578 _In_ const std::shared_ptr<basic_parser<T>>& digit_10,
-
2579 _In_ const std::shared_ptr<basic_parser<T>>& digit_11,
-
2580 _In_ const std::shared_ptr<basic_parser<T>>& digit_12,
-
2581 _In_ const std::shared_ptr<basic_parser<T>>& digit_13,
-
2582 _In_ const std::shared_ptr<basic_parser<T>>& digit_14,
-
2583 _In_ const std::shared_ptr<basic_parser<T>>& digit_15,
-
2584 _In_ const std::shared_ptr<basic_parser<T>>& separator,
-
2585 _In_ const std::shared_ptr<basic_parser<T>>& scope_id_separator = nullptr,
-
2586 _In_ const std::shared_ptr<basic_parser<T>>& _scope_id = nullptr,
-
2587 _In_ const std::locale& locale = std::locale()) :
-
2588 basic_parser<T>(locale),
-
2589 m_digit_0(digit_0),
-
2590 m_digit_1(digit_1),
-
2591 m_digit_2(digit_2),
-
2592 m_digit_3(digit_3),
-
2593 m_digit_4(digit_4),
-
2594 m_digit_5(digit_5),
-
2595 m_digit_6(digit_6),
-
2596 m_digit_7(digit_7),
-
2597 m_digit_8(digit_8),
-
2598 m_digit_9(digit_9),
-
2599 m_digit_10(digit_10),
-
2600 m_digit_11(digit_11),
-
2601 m_digit_12(digit_12),
-
2602 m_digit_13(digit_13),
-
2603 m_digit_14(digit_14),
-
2604 m_digit_15(digit_15),
-
2605 m_separator(separator),
-
2606 m_scope_id_separator(scope_id_separator),
- -
2608 {
-
2609 memset(&value, 0, sizeof(value));
-
2610 }
-
2611
-
2612 virtual bool match(
-
2613 _In_reads_or_z_(end) const T* text,
-
2614 _In_ size_t start = 0,
-
2615 _In_ size_t end = (size_t)-1,
-
2616 _In_ int flags = match_default)
-
2617 {
-
2618 assert(text || start >= end);
-
2619 this->interval.end = start;
-
2620 memset(&value, 0, sizeof(value));
-
2621
-
2622 size_t i, compaction_i = (size_t)-1, compaction_start = start;
-
2623 for (i = 0; i < 8; i++) {
-
2624 bool is_empty = true;
-
2625
-
2626 if (m_separator->match(text, this->interval.end, end, flags)) {
-
2627 if (m_separator->match(text, m_separator->interval.end, end, flags)) {
-
2628 // :: found
-
2629 if (compaction_i == (size_t)-1) {
-
2630 // Zero compaction start
-
2631 compaction_i = i;
-
2632 compaction_start = m_separator->interval.start;
-
2633 this->interval.end = m_separator->interval.end;
-
2634 }
-
2635 else {
-
2636 // More than one zero compaction
-
2637 break;
-
2638 }
-
2639 }
-
2640 else if (i) {
-
2641 // Inner : found
-
2642 this->interval.end = m_separator->interval.end;
-
2643 }
-
2644 else {
-
2645 // Leading : found
-
2646 goto error;
-
2647 }
-
2648 }
-
2649 else if (i) {
-
2650 // : missing
-
2651 break;
-
2652 }
-
2653
-
2654 components[i].start = this->interval.end;
-
2655 size_t x;
-
2656 for (x = 0; this->interval.end < end && text[this->interval.end];) {
-
2657 size_t dig, digit_end;
-
2658 if (m_digit_0->match(text, this->interval.end, end, flags)) { dig = 0; digit_end = m_digit_0->interval.end; }
-
2659 else if (m_digit_1->match(text, this->interval.end, end, flags)) { dig = 1; digit_end = m_digit_1->interval.end; }
-
2660 else if (m_digit_2->match(text, this->interval.end, end, flags)) { dig = 2; digit_end = m_digit_2->interval.end; }
-
2661 else if (m_digit_3->match(text, this->interval.end, end, flags)) { dig = 3; digit_end = m_digit_3->interval.end; }
-
2662 else if (m_digit_4->match(text, this->interval.end, end, flags)) { dig = 4; digit_end = m_digit_4->interval.end; }
-
2663 else if (m_digit_5->match(text, this->interval.end, end, flags)) { dig = 5; digit_end = m_digit_5->interval.end; }
-
2664 else if (m_digit_6->match(text, this->interval.end, end, flags)) { dig = 6; digit_end = m_digit_6->interval.end; }
-
2665 else if (m_digit_7->match(text, this->interval.end, end, flags)) { dig = 7; digit_end = m_digit_7->interval.end; }
-
2666 else if (m_digit_8->match(text, this->interval.end, end, flags)) { dig = 8; digit_end = m_digit_8->interval.end; }
-
2667 else if (m_digit_9->match(text, this->interval.end, end, flags)) { dig = 9; digit_end = m_digit_9->interval.end; }
-
2668 else if (m_digit_10->match(text, this->interval.end, end, flags)) { dig = 10; digit_end = m_digit_10->interval.end; }
-
2669 else if (m_digit_11->match(text, this->interval.end, end, flags)) { dig = 11; digit_end = m_digit_11->interval.end; }
-
2670 else if (m_digit_12->match(text, this->interval.end, end, flags)) { dig = 12; digit_end = m_digit_12->interval.end; }
-
2671 else if (m_digit_13->match(text, this->interval.end, end, flags)) { dig = 13; digit_end = m_digit_13->interval.end; }
-
2672 else if (m_digit_14->match(text, this->interval.end, end, flags)) { dig = 14; digit_end = m_digit_14->interval.end; }
-
2673 else if (m_digit_15->match(text, this->interval.end, end, flags)) { dig = 15; digit_end = m_digit_15->interval.end; }
-
2674 else break;
-
2675 size_t x_n = x * 16 + dig;
-
2676 if (x_n <= 0xffff) {
-
2677 x = x_n;
-
2678 this->interval.end = digit_end;
-
2679 is_empty = false;
-
2680 }
-
2681 else
-
2682 break;
-
2683 }
-
2684 if (is_empty) {
-
2685 if (compaction_i != (size_t)-1) {
-
2686 // Zero compaction active: no sweat.
-
2687 break;
-
2688 }
-
2689 goto error;
-
2690 }
-
2691 components[i].end = this->interval.end;
-
2692 this->value.s6_words[i] = (uint16_t)x;
-
2693 }
-
2694
-
2695 if (compaction_i != (size_t)-1) {
-
2696 // Align components right due to zero compaction.
-
2697 size_t j, k;
-
2698 for (j = 8, k = i; k > compaction_i;) {
-
2699 this->value.s6_words[--j] = this->value.s6_words[--k];
- -
2701 }
-
2702 for (; j > compaction_i;) {
-
2703 this->value.s6_words[--j] = 0;
-
2704 components[j].start =
- -
2706 }
-
2707 }
-
2708 else if (i < 8)
-
2709 goto error;
-
2710
-
2711 if (m_scope_id_separator && m_scope_id_separator->match(text, this->interval.end, end, flags) &&
-
2712 scope_id && scope_id->match(text, m_scope_id_separator->interval.end, end, flags))
-
2713 this->interval.end = scope_id->interval.end;
-
2714 else if (scope_id)
-
2715 scope_id->invalidate();
-
2716
-
2717 this->interval.start = start;
-
2718 return true;
-
2719
-
2720 error:
-
2721 components[0].start = 1;
-
2722 components[0].end = 0;
-
2723 components[1].start = 1;
-
2724 components[1].end = 0;
-
2725 components[2].start = 1;
-
2726 components[2].end = 0;
-
2727 components[3].start = 1;
-
2728 components[3].end = 0;
-
2729 components[4].start = 1;
-
2730 components[4].end = 0;
-
2731 components[5].start = 1;
-
2732 components[5].end = 0;
-
2733 components[6].start = 1;
-
2734 components[6].end = 0;
-
2735 components[7].start = 1;
-
2736 components[7].end = 0;
-
2737 memset(&value, 0, sizeof(value));
-
2738 if (scope_id) scope_id->invalidate();
-
2739 this->interval.start = (this->interval.end = start) + 1;
-
2740 return false;
-
2741 }
-
2742
-
2743 virtual void invalidate()
-
2744 {
-
2745 components[0].start = 1;
-
2746 components[0].end = 0;
-
2747 components[1].start = 1;
-
2748 components[1].end = 0;
-
2749 components[2].start = 1;
-
2750 components[2].end = 0;
-
2751 components[3].start = 1;
-
2752 components[3].end = 0;
-
2753 components[4].start = 1;
-
2754 components[4].end = 0;
-
2755 components[5].start = 1;
-
2756 components[5].end = 0;
-
2757 components[6].start = 1;
-
2758 components[6].end = 0;
-
2759 components[7].start = 1;
-
2760 components[7].end = 0;
-
2761 memset(&value, 0, sizeof(value));
-
2762 if (scope_id) scope_id->invalidate();
- -
2764 }
-
2765
-
2766 public:
- - -
2769 std::shared_ptr<basic_parser<T>> scope_id;
-
2770
-
2771 protected:
-
2772 std::shared_ptr<basic_parser<T>>
-
2773 m_digit_0,
-
2774 m_digit_1,
-
2775 m_digit_2,
-
2776 m_digit_3,
-
2777 m_digit_4,
-
2778 m_digit_5,
-
2779 m_digit_6,
-
2780 m_digit_7,
-
2781 m_digit_8,
-
2782 m_digit_9,
-
2783 m_digit_10,
-
2784 m_digit_11,
-
2785 m_digit_12,
-
2786 m_digit_13,
-
2787 m_digit_14,
-
2788 m_digit_15;
-
2789 std::shared_ptr<basic_parser<T>> m_separator, m_scope_id_separator;
-
2790 };
+
2560
+
2564 template <class T>
+
+ +
2566 {
+
2567 public:
+ +
2569 _In_ const std::shared_ptr<basic_parser<T>>& digit_0,
+
2570 _In_ const std::shared_ptr<basic_parser<T>>& digit_1,
+
2571 _In_ const std::shared_ptr<basic_parser<T>>& digit_2,
+
2572 _In_ const std::shared_ptr<basic_parser<T>>& digit_3,
+
2573 _In_ const std::shared_ptr<basic_parser<T>>& digit_4,
+
2574 _In_ const std::shared_ptr<basic_parser<T>>& digit_5,
+
2575 _In_ const std::shared_ptr<basic_parser<T>>& digit_6,
+
2576 _In_ const std::shared_ptr<basic_parser<T>>& digit_7,
+
2577 _In_ const std::shared_ptr<basic_parser<T>>& digit_8,
+
2578 _In_ const std::shared_ptr<basic_parser<T>>& digit_9,
+
2579 _In_ const std::shared_ptr<basic_parser<T>>& digit_10,
+
2580 _In_ const std::shared_ptr<basic_parser<T>>& digit_11,
+
2581 _In_ const std::shared_ptr<basic_parser<T>>& digit_12,
+
2582 _In_ const std::shared_ptr<basic_parser<T>>& digit_13,
+
2583 _In_ const std::shared_ptr<basic_parser<T>>& digit_14,
+
2584 _In_ const std::shared_ptr<basic_parser<T>>& digit_15,
+
2585 _In_ const std::shared_ptr<basic_parser<T>>& separator,
+
2586 _In_ const std::shared_ptr<basic_parser<T>>& scope_id_separator = nullptr,
+
2587 _In_ const std::shared_ptr<basic_parser<T>>& _scope_id = nullptr,
+
2588 _In_ const std::locale& locale = std::locale()) :
+
2589 basic_parser<T>(locale),
+
2590 m_digit_0(digit_0),
+
2591 m_digit_1(digit_1),
+
2592 m_digit_2(digit_2),
+
2593 m_digit_3(digit_3),
+
2594 m_digit_4(digit_4),
+
2595 m_digit_5(digit_5),
+
2596 m_digit_6(digit_6),
+
2597 m_digit_7(digit_7),
+
2598 m_digit_8(digit_8),
+
2599 m_digit_9(digit_9),
+
2600 m_digit_10(digit_10),
+
2601 m_digit_11(digit_11),
+
2602 m_digit_12(digit_12),
+
2603 m_digit_13(digit_13),
+
2604 m_digit_14(digit_14),
+
2605 m_digit_15(digit_15),
+
2606 m_separator(separator),
+
2607 m_scope_id_separator(scope_id_separator),
+ +
2609 {
+
2610 memset(&value, 0, sizeof(value));
+
2611 }
+
2612
+
2613 virtual bool match(
+
2614 _In_reads_or_z_(end) const T* text,
+
2615 _In_ size_t start = 0,
+
2616 _In_ size_t end = (size_t)-1,
+
2617 _In_ int flags = match_default)
+
2618 {
+
2619 assert(text || start >= end);
+
2620 this->interval.end = start;
+
2621 memset(&value, 0, sizeof(value));
+
2622
+
2623 size_t i, compaction_i = (size_t)-1, compaction_start = start;
+
2624 for (i = 0; i < 8; i++) {
+
2625 bool is_empty = true;
+
2626
+
2627 if (m_separator->match(text, this->interval.end, end, flags)) {
+
2628 if (m_separator->match(text, m_separator->interval.end, end, flags)) {
+
2629 // :: found
+
2630 if (compaction_i == (size_t)-1) {
+
2631 // Zero compaction start
+
2632 compaction_i = i;
+
2633 compaction_start = m_separator->interval.start;
+
2634 this->interval.end = m_separator->interval.end;
+
2635 }
+
2636 else {
+
2637 // More than one zero compaction
+
2638 break;
+
2639 }
+
2640 }
+
2641 else if (i) {
+
2642 // Inner : found
+
2643 this->interval.end = m_separator->interval.end;
+
2644 }
+
2645 else {
+
2646 // Leading : found
+
2647 goto error;
+
2648 }
+
2649 }
+
2650 else if (i) {
+
2651 // : missing
+
2652 break;
+
2653 }
+
2654
+
2655 components[i].start = this->interval.end;
+
2656 size_t x;
+
2657 for (x = 0; this->interval.end < end && text[this->interval.end];) {
+
2658 size_t dig, digit_end;
+
2659 if (m_digit_0->match(text, this->interval.end, end, flags)) { dig = 0; digit_end = m_digit_0->interval.end; }
+
2660 else if (m_digit_1->match(text, this->interval.end, end, flags)) { dig = 1; digit_end = m_digit_1->interval.end; }
+
2661 else if (m_digit_2->match(text, this->interval.end, end, flags)) { dig = 2; digit_end = m_digit_2->interval.end; }
+
2662 else if (m_digit_3->match(text, this->interval.end, end, flags)) { dig = 3; digit_end = m_digit_3->interval.end; }
+
2663 else if (m_digit_4->match(text, this->interval.end, end, flags)) { dig = 4; digit_end = m_digit_4->interval.end; }
+
2664 else if (m_digit_5->match(text, this->interval.end, end, flags)) { dig = 5; digit_end = m_digit_5->interval.end; }
+
2665 else if (m_digit_6->match(text, this->interval.end, end, flags)) { dig = 6; digit_end = m_digit_6->interval.end; }
+
2666 else if (m_digit_7->match(text, this->interval.end, end, flags)) { dig = 7; digit_end = m_digit_7->interval.end; }
+
2667 else if (m_digit_8->match(text, this->interval.end, end, flags)) { dig = 8; digit_end = m_digit_8->interval.end; }
+
2668 else if (m_digit_9->match(text, this->interval.end, end, flags)) { dig = 9; digit_end = m_digit_9->interval.end; }
+
2669 else if (m_digit_10->match(text, this->interval.end, end, flags)) { dig = 10; digit_end = m_digit_10->interval.end; }
+
2670 else if (m_digit_11->match(text, this->interval.end, end, flags)) { dig = 11; digit_end = m_digit_11->interval.end; }
+
2671 else if (m_digit_12->match(text, this->interval.end, end, flags)) { dig = 12; digit_end = m_digit_12->interval.end; }
+
2672 else if (m_digit_13->match(text, this->interval.end, end, flags)) { dig = 13; digit_end = m_digit_13->interval.end; }
+
2673 else if (m_digit_14->match(text, this->interval.end, end, flags)) { dig = 14; digit_end = m_digit_14->interval.end; }
+
2674 else if (m_digit_15->match(text, this->interval.end, end, flags)) { dig = 15; digit_end = m_digit_15->interval.end; }
+
2675 else break;
+
2676 size_t x_n = x * 16 + dig;
+
2677 if (x_n <= 0xffff) {
+
2678 x = x_n;
+
2679 this->interval.end = digit_end;
+
2680 is_empty = false;
+
2681 }
+
2682 else
+
2683 break;
+
2684 }
+
2685 if (is_empty) {
+
2686 if (compaction_i != (size_t)-1) {
+
2687 // Zero compaction active: no sweat.
+
2688 break;
+
2689 }
+
2690 goto error;
+
2691 }
+
2692 components[i].end = this->interval.end;
+
2693 this->value.s6_words[i] = (uint16_t)x;
+
2694 }
+
2695
+
2696 if (compaction_i != (size_t)-1) {
+
2697 // Align components right due to zero compaction.
+
2698 size_t j, k;
+
2699 for (j = 8, k = i; k > compaction_i;) {
+
2700 this->value.s6_words[--j] = this->value.s6_words[--k];
+ +
2702 }
+
2703 for (; j > compaction_i;) {
+
2704 this->value.s6_words[--j] = 0;
+
2705 components[j].start =
+ +
2707 }
+
2708 }
+
2709 else if (i < 8)
+
2710 goto error;
+
2711
+
2712 if (m_scope_id_separator && m_scope_id_separator->match(text, this->interval.end, end, flags) &&
+
2713 scope_id && scope_id->match(text, m_scope_id_separator->interval.end, end, flags))
+
2714 this->interval.end = scope_id->interval.end;
+
2715 else if (scope_id)
+
2716 scope_id->invalidate();
+
2717
+
2718 this->interval.start = start;
+
2719 return true;
+
2720
+
2721 error:
+
2722 components[0].start = 1;
+
2723 components[0].end = 0;
+
2724 components[1].start = 1;
+
2725 components[1].end = 0;
+
2726 components[2].start = 1;
+
2727 components[2].end = 0;
+
2728 components[3].start = 1;
+
2729 components[3].end = 0;
+
2730 components[4].start = 1;
+
2731 components[4].end = 0;
+
2732 components[5].start = 1;
+
2733 components[5].end = 0;
+
2734 components[6].start = 1;
+
2735 components[6].end = 0;
+
2736 components[7].start = 1;
+
2737 components[7].end = 0;
+
2738 memset(&value, 0, sizeof(value));
+
2739 if (scope_id) scope_id->invalidate();
+
2740 this->interval.start = (this->interval.end = start) + 1;
+
2741 return false;
+
2742 }
+
2743
+
2744 virtual void invalidate()
+
2745 {
+
2746 components[0].start = 1;
+
2747 components[0].end = 0;
+
2748 components[1].start = 1;
+
2749 components[1].end = 0;
+
2750 components[2].start = 1;
+
2751 components[2].end = 0;
+
2752 components[3].start = 1;
+
2753 components[3].end = 0;
+
2754 components[4].start = 1;
+
2755 components[4].end = 0;
+
2756 components[5].start = 1;
+
2757 components[5].end = 0;
+
2758 components[6].start = 1;
+
2759 components[6].end = 0;
+
2760 components[7].start = 1;
+
2761 components[7].end = 0;
+
2762 memset(&value, 0, sizeof(value));
+
2763 if (scope_id) scope_id->invalidate();
+ +
2765 }
+
2766
+
2767 public:
+ + +
2770 std::shared_ptr<basic_parser<T>> scope_id;
+
2771
+
2772 protected:
+
2773 std::shared_ptr<basic_parser<T>>
+
2774 m_digit_0,
+
2775 m_digit_1,
+
2776 m_digit_2,
+
2777 m_digit_3,
+
2778 m_digit_4,
+
2779 m_digit_5,
+
2780 m_digit_6,
+
2781 m_digit_7,
+
2782 m_digit_8,
+
2783 m_digit_9,
+
2784 m_digit_10,
+
2785 m_digit_11,
+
2786 m_digit_12,
+
2787 m_digit_13,
+
2788 m_digit_14,
+
2789 m_digit_15;
+
2790 std::shared_ptr<basic_parser<T>> m_separator, m_scope_id_separator;
+
2791 };
-
2791
- - -
2794#ifdef _UNICODE
- -
2796#else
- -
2798#endif
- -
2800
-
2804 template <class T>
-
- -
2806 {
-
2807 public:
- -
2809 _In_ bool allow_idn,
-
2810 _In_ const std::locale& locale = std::locale()) :
-
2811 basic_parser<T>(locale),
-
2812 m_allow_idn(allow_idn),
-
2813 allow_on_edge(true)
-
2814 {}
-
2815
-
2816 virtual bool match(
-
2817 _In_reads_or_z_(end) const T* text,
-
2818 _In_ size_t start = 0,
-
2819 _In_ size_t end = (size_t)-1,
-
2820 _In_ int flags = match_default)
-
2821 {
-
2822 assert(text || start >= end);
-
2823 if (start < end && text[start]) {
-
2824 if (('A' <= text[start] && text[start] <= 'Z') ||
-
2825 ('a' <= text[start] && text[start] <= 'z') ||
-
2826 ('0' <= text[start] && text[start] <= '9'))
-
2827 allow_on_edge = true;
-
2828 else if (text[start] == '-')
-
2829 allow_on_edge = false;
-
2830 else if (m_allow_idn && std::use_facet<std::ctype<T>>(this->m_locale).is(std::ctype_base::alnum, text[start]))
-
2831 allow_on_edge = true;
-
2832 else {
-
2833 this->interval.start = (this->interval.end = start) + 1;
-
2834 return false;
-
2835 }
-
2836 this->interval.end = (this->interval.start = start) + 1;
-
2837 return true;
-
2838 }
-
2839 this->interval.start = (this->interval.end = start) + 1;
-
2840 return false;
-
2841 }
-
2842
-
2843 public:
- -
2845
-
2846 protected:
-
2847 bool m_allow_idn;
-
2848 };
+
2792
+ + +
2795#ifdef _UNICODE
+ +
2797#else
+ +
2799#endif
+ +
2801
+
2805 template <class T>
+
+ +
2807 {
+
2808 public:
+ +
2810 _In_ bool allow_idn,
+
2811 _In_ const std::locale& locale = std::locale()) :
+
2812 basic_parser<T>(locale),
+
2813 m_allow_idn(allow_idn),
+
2814 allow_on_edge(true)
+
2815 {}
+
2816
+
2817 virtual bool match(
+
2818 _In_reads_or_z_(end) const T* text,
+
2819 _In_ size_t start = 0,
+
2820 _In_ size_t end = (size_t)-1,
+
2821 _In_ int flags = match_default)
+
2822 {
+
2823 assert(text || start >= end);
+
2824 if (start < end && text[start]) {
+
2825 if (('A' <= text[start] && text[start] <= 'Z') ||
+
2826 ('a' <= text[start] && text[start] <= 'z') ||
+
2827 ('0' <= text[start] && text[start] <= '9'))
+
2828 allow_on_edge = true;
+
2829 else if (text[start] == '-')
+
2830 allow_on_edge = false;
+
2831 else if (m_allow_idn && std::use_facet<std::ctype<T>>(this->m_locale).is(std::ctype_base::alnum, text[start]))
+
2832 allow_on_edge = true;
+
2833 else {
+
2834 this->interval.start = (this->interval.end = start) + 1;
+
2835 return false;
+
2836 }
+
2837 this->interval.end = (this->interval.start = start) + 1;
+
2838 return true;
+
2839 }
+
2840 this->interval.start = (this->interval.end = start) + 1;
+
2841 return false;
+
2842 }
+
2843
+
2844 public:
+ +
2846
+
2847 protected:
+
2848 bool m_allow_idn;
+
2849 };
-
2849
- - -
2852#ifdef _UNICODE
- -
2854#else
- -
2856#endif
-
2857
-
- -
2862 {
-
2863 public:
- -
2865 _In_ bool allow_idn,
-
2866 _In_ const std::locale& locale = std::locale()) :
- -
2868 {}
-
2869
-
2870 virtual bool match(
-
2871 _In_reads_or_z_(end) const char* text,
-
2872 _In_ size_t start = 0,
-
2873 _In_ size_t end = (size_t)-1,
-
2874 _In_ int flags = match_default)
-
2875 {
-
2876 assert(text || start >= end);
-
2877 if (start < end && text[start]) {
-
2878 wchar_t buf[3];
-
2879 const wchar_t* chr = next_sgml_cp(text, start, end, this->interval.end, buf);
-
2880 const wchar_t* chr_end = chr + stdex::strlen(chr);
-
2881 if ((('A' <= chr[0] && chr[0] <= 'Z') ||
-
2882 ('a' <= chr[0] && chr[0] <= 'z') ||
-
2883 ('0' <= chr[0] && chr[0] <= '9')) && chr[1] == 0)
-
2884 allow_on_edge = true;
-
2885 else if (chr[0] == '-' && chr[1] == 0)
-
2886 allow_on_edge = false;
-
2887 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)
-
2888 allow_on_edge = true;
-
2889 else {
-
2890 this->interval.start = (this->interval.end = start) + 1;
-
2891 return false;
-
2892 }
-
2893 this->interval.start = start;
-
2894 return true;
-
2895 }
-
2896 this->interval.start = (this->interval.end = start) + 1;
-
2897 return false;
-
2898 }
-
2899 };
+
2850
+ + +
2853#ifdef _UNICODE
+ +
2855#else
+ +
2857#endif
+
2858
+
+ +
2863 {
+
2864 public:
+ +
2866 _In_ bool allow_idn,
+
2867 _In_ const std::locale& locale = std::locale()) :
+ +
2869 {}
+
2870
+
2871 virtual bool match(
+
2872 _In_reads_or_z_(end) const char* text,
+
2873 _In_ size_t start = 0,
+
2874 _In_ size_t end = (size_t)-1,
+
2875 _In_ int flags = match_default)
+
2876 {
+
2877 assert(text || start >= end);
+
2878 if (start < end && text[start]) {
+
2879 wchar_t buf[3];
+
2880 const wchar_t* chr = next_sgml_cp(text, start, end, this->interval.end, buf);
+
2881 const wchar_t* chr_end = chr + stdex::strlen(chr);
+
2882 if ((('A' <= chr[0] && chr[0] <= 'Z') ||
+
2883 ('a' <= chr[0] && chr[0] <= 'z') ||
+
2884 ('0' <= chr[0] && chr[0] <= '9')) && chr[1] == 0)
+
2885 allow_on_edge = true;
+
2886 else if (chr[0] == '-' && chr[1] == 0)
+
2887 allow_on_edge = false;
+
2888 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)
+
2889 allow_on_edge = true;
+
2890 else {
+
2891 this->interval.start = (this->interval.end = start) + 1;
+
2892 return false;
+
2893 }
+
2894 this->interval.start = start;
+
2895 return true;
+
2896 }
+
2897 this->interval.start = (this->interval.end = start) + 1;
+
2898 return false;
+
2899 }
+
2900 };
-
2900
-
2904 template <class T>
-
- -
2906 {
-
2907 public:
- -
2909 _In_ bool allow_absolute,
-
2910 _In_ const std::shared_ptr<basic_dns_domain_char<T>>& domain_char,
-
2911 _In_ const std::shared_ptr<basic_parser<T>>& separator,
-
2912 _In_ const std::locale& locale = std::locale()) :
-
2913 basic_parser<T>(locale),
- -
2915 m_domain_char(domain_char),
-
2916 m_separator(separator)
-
2917 {}
-
2918
-
2919 virtual bool match(
-
2920 _In_reads_or_z_(end) const T* text,
-
2921 _In_ size_t start = 0,
-
2922 _In_ size_t end = (size_t)-1,
-
2923 _In_ int flags = match_default)
-
2924 {
-
2925 assert(text || start >= end);
-
2926 size_t i = start, count;
-
2927 for (count = 0; i < end && text[i] && count < 127; count++) {
-
2928 if (m_domain_char->match(text, i, end, flags) &&
-
2929 m_domain_char->allow_on_edge)
-
2930 {
-
2931 // Domain start
-
2932 this->interval.end = i = m_domain_char->interval.end;
-
2933 while (i < end && text[i]) {
-
2934 if (m_domain_char->allow_on_edge &&
-
2935 m_separator->match(text, i, end, flags))
-
2936 {
-
2937 // Domain end
-
2938 if (m_allow_absolute)
-
2939 this->interval.end = i = m_separator->interval.end;
-
2940 else {
-
2941 this->interval.end = i;
-
2942 i = m_separator->interval.end;
-
2943 }
-
2944 break;
-
2945 }
-
2946 if (m_domain_char->match(text, i, end, flags)) {
-
2947 if (m_domain_char->allow_on_edge)
-
2948 this->interval.end = i = m_domain_char->interval.end;
-
2949 else
-
2950 i = m_domain_char->interval.end;
-
2951 }
-
2952 else {
-
2953 this->interval.start = start;
-
2954 return true;
-
2955 }
-
2956 }
-
2957 }
-
2958 else
-
2959 break;
-
2960 }
-
2961 if (count) {
-
2962 this->interval.start = start;
-
2963 return true;
-
2964 }
-
2965 this->interval.start = (this->interval.end = start) + 1;
-
2966 return false;
-
2967 }
-
2968
-
2969 protected:
- -
2971 std::shared_ptr<basic_dns_domain_char<T>> m_domain_char;
-
2972 std::shared_ptr<basic_parser<T>> m_separator;
-
2973 };
+
2901
+
2905 template <class T>
+
+ +
2907 {
+
2908 public:
+ +
2910 _In_ bool allow_absolute,
+
2911 _In_ const std::shared_ptr<basic_dns_domain_char<T>>& domain_char,
+
2912 _In_ const std::shared_ptr<basic_parser<T>>& separator,
+
2913 _In_ const std::locale& locale = std::locale()) :
+
2914 basic_parser<T>(locale),
+ +
2916 m_domain_char(domain_char),
+
2917 m_separator(separator)
+
2918 {}
+
2919
+
2920 virtual bool match(
+
2921 _In_reads_or_z_(end) const T* text,
+
2922 _In_ size_t start = 0,
+
2923 _In_ size_t end = (size_t)-1,
+
2924 _In_ int flags = match_default)
+
2925 {
+
2926 assert(text || start >= end);
+
2927 size_t i = start, count;
+
2928 for (count = 0; i < end && text[i] && count < 127; count++) {
+
2929 if (m_domain_char->match(text, i, end, flags) &&
+
2930 m_domain_char->allow_on_edge)
+
2931 {
+
2932 // Domain start
+
2933 this->interval.end = i = m_domain_char->interval.end;
+
2934 while (i < end && text[i]) {
+
2935 if (m_domain_char->allow_on_edge &&
+
2936 m_separator->match(text, i, end, flags))
+
2937 {
+
2938 // Domain end
+
2939 if (m_allow_absolute)
+
2940 this->interval.end = i = m_separator->interval.end;
+
2941 else {
+
2942 this->interval.end = i;
+
2943 i = m_separator->interval.end;
+
2944 }
+
2945 break;
+
2946 }
+
2947 if (m_domain_char->match(text, i, end, flags)) {
+
2948 if (m_domain_char->allow_on_edge)
+
2949 this->interval.end = i = m_domain_char->interval.end;
+
2950 else
+
2951 i = m_domain_char->interval.end;
+
2952 }
+
2953 else {
+
2954 this->interval.start = start;
+
2955 return true;
+
2956 }
+
2957 }
+
2958 }
+
2959 else
+
2960 break;
+
2961 }
+
2962 if (count) {
+
2963 this->interval.start = start;
+
2964 return true;
+
2965 }
+
2966 this->interval.start = (this->interval.end = start) + 1;
+
2967 return false;
+
2968 }
+
2969
+
2970 protected:
+ +
2972 std::shared_ptr<basic_dns_domain_char<T>> m_domain_char;
+
2973 std::shared_ptr<basic_parser<T>> m_separator;
+
2974 };
-
2974
- - -
2977#ifdef _UNICODE
-
2978 using tdns_name = wdns_name;
-
2979#else
-
2980 using tdns_name = dns_name;
-
2981#endif
- -
2983
-
2987 template <class T>
-
- -
2989 {
-
2990 public:
-
2991 basic_url_username_char(_In_ const std::locale& locale = std::locale()) : basic_parser<T>(locale) {}
-
2992
-
2993 virtual bool match(
-
2994 _In_reads_or_z_(end) const T* text,
-
2995 _In_ size_t start = 0,
-
2996 _In_ size_t end = (size_t)-1,
-
2997 _In_ int flags = match_default)
-
2998 {
-
2999 assert(text || start >= end);
-
3000 if (start < end && text[start]) {
-
3001 if (text[start] == '-' ||
-
3002 text[start] == '.' ||
-
3003 text[start] == '_' ||
-
3004 text[start] == '~' ||
-
3005 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] == '+' ||
-
3014 text[start] == ',' ||
-
3015 text[start] == ';' ||
-
3016 text[start] == '=' ||
-
3017 std::use_facet<std::ctype<T>>(this->m_locale).is(std::ctype_base::alnum, text[start]))
-
3018 {
-
3019 this->interval.end = (this->interval.start = start) + 1;
-
3020 return true;
-
3021 }
-
3022 }
-
3023 this->interval.start = (this->interval.end = start) + 1;
-
3024 return false;
-
3025 }
-
3026 };
+
2975
+ + +
2978#ifdef _UNICODE
+
2979 using tdns_name = wdns_name;
+
2980#else
+
2981 using tdns_name = dns_name;
+
2982#endif
+ +
2984
+
2988 template <class T>
+
+ +
2990 {
+
2991 public:
+
2992 basic_url_username_char(_In_ const std::locale& locale = std::locale()) : basic_parser<T>(locale) {}
+
2993
+
2994 virtual bool match(
+
2995 _In_reads_or_z_(end) const T* text,
+
2996 _In_ size_t start = 0,
+
2997 _In_ size_t end = (size_t)-1,
+
2998 _In_ int flags = match_default)
+
2999 {
+
3000 assert(text || start >= end);
+
3001 if (start < end && text[start]) {
+
3002 if (text[start] == '-' ||
+
3003 text[start] == '.' ||
+
3004 text[start] == '_' ||
+
3005 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] == '*' ||
+
3014 text[start] == '+' ||
+
3015 text[start] == ',' ||
+
3016 text[start] == ';' ||
+
3017 text[start] == '=' ||
+
3018 std::use_facet<std::ctype<T>>(this->m_locale).is(std::ctype_base::alnum, text[start]))
+
3019 {
+
3020 this->interval.end = (this->interval.start = start) + 1;
+
3021 return true;
+
3022 }
+
3023 }
+
3024 this->interval.start = (this->interval.end = start) + 1;
+
3025 return false;
+
3026 }
+
3027 };
-
3027
- - -
3030#ifdef _UNICODE
- -
3032#else
- -
3034#endif
-
3035
-
- -
3040 {
-
3041 public:
-
3042 sgml_url_username_char(_In_ const std::locale& locale = std::locale()) : basic_url_username_char<char>(locale) {}
-
3043
-
3044 virtual bool match(
-
3045 _In_reads_or_z_(end) const char* text,
-
3046 _In_ size_t start = 0,
-
3047 _In_ size_t end = (size_t)-1,
-
3048 _In_ int flags = match_default)
-
3049 {
-
3050 assert(text || start >= end);
-
3051 if (start < end && text[start]) {
-
3052 wchar_t buf[3];
-
3053 const wchar_t* chr = next_sgml_cp(text, start, end, this->interval.end, buf);
-
3054 const wchar_t* chr_end = chr + stdex::strlen(chr);
-
3055 if (((chr[0] == L'-' ||
-
3056 chr[0] == L'.' ||
-
3057 chr[0] == L'_' ||
-
3058 chr[0] == L'~' ||
-
3059 chr[0] == L'%' ||
-
3060 chr[0] == L'!' ||
-
3061 chr[0] == L'$' ||
-
3062 chr[0] == L'&' ||
-
3063 chr[0] == L'\'' ||
-
3064 //chr[0] == L'(' ||
-
3065 //chr[0] == L')' ||
-
3066 chr[0] == L'*' ||
-
3067 chr[0] == L'+' ||
-
3068 chr[0] == L',' ||
-
3069 chr[0] == L';' ||
-
3070 chr[0] == L'=') && chr[1] == 0) ||
-
3071 std::use_facet<std::ctype<wchar_t>>(m_locale).scan_not(std::ctype_base::alnum, chr, chr_end) == chr_end)
-
3072 {
-
3073 this->interval.start = start;
-
3074 return true;
-
3075 }
-
3076 }
-
3077
-
3078 this->interval.start = (this->interval.end = start) + 1;
-
3079 return false;
-
3080 }
-
3081 };
+
3028
+ + +
3031#ifdef _UNICODE
+ +
3033#else
+ +
3035#endif
+
3036
+
+ +
3041 {
+
3042 public:
+
3043 sgml_url_username_char(_In_ const std::locale& locale = std::locale()) : basic_url_username_char<char>(locale) {}
+
3044
+
3045 virtual bool match(
+
3046 _In_reads_or_z_(end) const char* text,
+
3047 _In_ size_t start = 0,
+
3048 _In_ size_t end = (size_t)-1,
+
3049 _In_ int flags = match_default)
+
3050 {
+
3051 assert(text || start >= end);
+
3052 if (start < end && text[start]) {
+
3053 wchar_t buf[3];
+
3054 const wchar_t* chr = next_sgml_cp(text, start, end, this->interval.end, buf);
+
3055 const wchar_t* chr_end = chr + stdex::strlen(chr);
+
3056 if (((chr[0] == L'-' ||
+
3057 chr[0] == L'.' ||
+
3058 chr[0] == L'_' ||
+
3059 chr[0] == L'~' ||
+
3060 chr[0] == L'%' ||
+
3061 chr[0] == L'!' ||
+
3062 chr[0] == L'$' ||
+
3063 chr[0] == L'&' ||
+
3064 chr[0] == L'\'' ||
+
3065 //chr[0] == L'(' ||
+
3066 //chr[0] == L')' ||
+
3067 chr[0] == L'*' ||
+
3068 chr[0] == L'+' ||
+
3069 chr[0] == L',' ||
+
3070 chr[0] == L';' ||
+
3071 chr[0] == L'=') && chr[1] == 0) ||
+
3072 std::use_facet<std::ctype<wchar_t>>(m_locale).scan_not(std::ctype_base::alnum, chr, chr_end) == chr_end)
+
3073 {
+
3074 this->interval.start = start;
+
3075 return true;
+
3076 }
+
3077 }
+
3078
+
3079 this->interval.start = (this->interval.end = start) + 1;
+
3080 return false;
+
3081 }
+
3082 };
-
3082
-
3086 template <class T>
-
- -
3088 {
-
3089 public:
-
3090 basic_url_password_char(_In_ const std::locale& locale = std::locale()) : basic_parser<T>(locale) {}
-
3091
-
3092 virtual bool match(
-
3093 _In_reads_or_z_(end) const T* text,
-
3094 _In_ size_t start = 0,
-
3095 _In_ size_t end = (size_t)-1,
-
3096 _In_ int flags = match_default)
-
3097 {
-
3098 assert(text || start >= end);
-
3099 if (start < end && text[start]) {
-
3100 if (text[start] == '-' ||
-
3101 text[start] == '.' ||
-
3102 text[start] == '_' ||
-
3103 text[start] == '~' ||
-
3104 text[start] == '%' ||
-
3105 text[start] == '!' ||
-
3106 text[start] == '$' ||
-
3107 text[start] == '&' ||
-
3108 text[start] == '\'' ||
-
3109 text[start] == '(' ||
-
3110 text[start] == ')' ||
-
3111 text[start] == '*' ||
-
3112 text[start] == '+' ||
-
3113 text[start] == ',' ||
-
3114 text[start] == ';' ||
-
3115 text[start] == '=' ||
-
3116 text[start] == ':' ||
-
3117 std::use_facet<std::ctype<T>>(this->m_locale).is(std::ctype_base::alnum, text[start]))
-
3118 {
-
3119 this->interval.end = (this->interval.start = start) + 1;
-
3120 return true;
-
3121 }
-
3122 }
-
3123 this->interval.start = (this->interval.end = start) + 1;
-
3124 return false;
-
3125 }
-
3126 };
+
3083
+
3087 template <class T>
+
+ +
3089 {
+
3090 public:
+
3091 basic_url_password_char(_In_ const std::locale& locale = std::locale()) : basic_parser<T>(locale) {}
+
3092
+
3093 virtual bool match(
+
3094 _In_reads_or_z_(end) const T* text,
+
3095 _In_ size_t start = 0,
+
3096 _In_ size_t end = (size_t)-1,
+
3097 _In_ int flags = match_default)
+
3098 {
+
3099 assert(text || start >= end);
+
3100 if (start < end && text[start]) {
+
3101 if (text[start] == '-' ||
+
3102 text[start] == '.' ||
+
3103 text[start] == '_' ||
+
3104 text[start] == '~' ||
+
3105 text[start] == '%' ||
+
3106 text[start] == '!' ||
+
3107 text[start] == '$' ||
+
3108 text[start] == '&' ||
+
3109 text[start] == '\'' ||
+
3110 text[start] == '(' ||
+
3111 text[start] == ')' ||
+
3112 text[start] == '*' ||
+
3113 text[start] == '+' ||
+
3114 text[start] == ',' ||
+
3115 text[start] == ';' ||
+
3116 text[start] == '=' ||
+
3117 text[start] == ':' ||
+
3118 std::use_facet<std::ctype<T>>(this->m_locale).is(std::ctype_base::alnum, text[start]))
+
3119 {
+
3120 this->interval.end = (this->interval.start = start) + 1;
+
3121 return true;
+
3122 }
+
3123 }
+
3124 this->interval.start = (this->interval.end = start) + 1;
+
3125 return false;
+
3126 }
+
3127 };
-
3127
- - -
3130#ifdef _UNICODE
- -
3132#else
- -
3134#endif
-
3135
-
- -
3140 {
-
3141 public:
-
3142 sgml_url_password_char(_In_ const std::locale& locale = std::locale()) : basic_url_password_char<char>(locale) {}
-
3143
-
3144 virtual bool match(
-
3145 _In_reads_or_z_(end) const char* text,
-
3146 _In_ size_t start = 0,
-
3147 _In_ size_t end = (size_t)-1,
-
3148 _In_ int flags = match_default)
-
3149 {
-
3150 assert(text || start >= end);
-
3151 if (start < end && text[start]) {
-
3152 wchar_t buf[3];
-
3153 const wchar_t* chr = next_sgml_cp(text, start, end, this->interval.end, buf);
-
3154 const wchar_t* chr_end = chr + stdex::strlen(chr);
-
3155 if (((chr[0] == L'-' ||
-
3156 chr[0] == L'.' ||
-
3157 chr[0] == L'_' ||
-
3158 chr[0] == L'~' ||
-
3159 chr[0] == L'%' ||
-
3160 chr[0] == L'!' ||
-
3161 chr[0] == L'$' ||
-
3162 chr[0] == L'&' ||
-
3163 chr[0] == L'\'' ||
-
3164 chr[0] == L'(' ||
-
3165 chr[0] == L')' ||
-
3166 chr[0] == L'*' ||
-
3167 chr[0] == L'+' ||
-
3168 chr[0] == L',' ||
-
3169 chr[0] == L';' ||
-
3170 chr[0] == L'=' ||
-
3171 chr[0] == L':') && chr[1] == 0) ||
-
3172 std::use_facet<std::ctype<wchar_t>>(m_locale).scan_not(std::ctype_base::alnum, chr, chr_end) == chr_end)
-
3173 {
-
3174 this->interval.start = start;
-
3175 return true;
-
3176 }
-
3177 }
-
3178 this->interval.start = (this->interval.end = start) + 1;
-
3179 return false;
-
3180 }
-
3181 };
+
3128
+ + +
3131#ifdef _UNICODE
+ +
3133#else
+ +
3135#endif
+
3136
+
+ +
3141 {
+
3142 public:
+
3143 sgml_url_password_char(_In_ const std::locale& locale = std::locale()) : basic_url_password_char<char>(locale) {}
+
3144
+
3145 virtual bool match(
+
3146 _In_reads_or_z_(end) const char* text,
+
3147 _In_ size_t start = 0,
+
3148 _In_ size_t end = (size_t)-1,
+
3149 _In_ int flags = match_default)
+
3150 {
+
3151 assert(text || start >= end);
+
3152 if (start < end && text[start]) {
+
3153 wchar_t buf[3];
+
3154 const wchar_t* chr = next_sgml_cp(text, start, end, this->interval.end, buf);
+
3155 const wchar_t* chr_end = chr + stdex::strlen(chr);
+
3156 if (((chr[0] == L'-' ||
+
3157 chr[0] == L'.' ||
+
3158 chr[0] == L'_' ||
+
3159 chr[0] == L'~' ||
+
3160 chr[0] == L'%' ||
+
3161 chr[0] == L'!' ||
+
3162 chr[0] == L'$' ||
+
3163 chr[0] == L'&' ||
+
3164 chr[0] == L'\'' ||
+
3165 chr[0] == L'(' ||
+
3166 chr[0] == L')' ||
+
3167 chr[0] == L'*' ||
+
3168 chr[0] == L'+' ||
+
3169 chr[0] == L',' ||
+
3170 chr[0] == L';' ||
+
3171 chr[0] == L'=' ||
+
3172 chr[0] == L':') && chr[1] == 0) ||
+
3173 std::use_facet<std::ctype<wchar_t>>(m_locale).scan_not(std::ctype_base::alnum, chr, chr_end) == chr_end)
+
3174 {
+
3175 this->interval.start = start;
+
3176 return true;
+
3177 }
+
3178 }
+
3179 this->interval.start = (this->interval.end = start) + 1;
+
3180 return false;
+
3181 }
+
3182 };
-
3182
-
3186 template <class T>
-
- -
3188 {
-
3189 public:
-
3190 basic_url_path_char(_In_ const std::locale& locale = std::locale()) : basic_parser<T>(locale) {}
-
3191
-
3192 virtual bool match(
-
3193 _In_reads_or_z_(end) const T* text,
-
3194 _In_ size_t start = 0,
-
3195 _In_ size_t end = (size_t)-1,
-
3196 _In_ int flags = match_default)
-
3197 {
-
3198 assert(text || start >= end);
-
3199 if (start < end && text[start]) {
-
3200 if (text[start] == '/' ||
-
3201 text[start] == '-' ||
-
3202 text[start] == '.' ||
-
3203 text[start] == '_' ||
-
3204 text[start] == '~' ||
-
3205 text[start] == '%' ||
-
3206 text[start] == '!' ||
-
3207 text[start] == '$' ||
-
3208 text[start] == '&' ||
-
3209 text[start] == '\'' ||
-
3210 text[start] == '(' ||
-
3211 text[start] == ')' ||
-
3212 text[start] == '*' ||
-
3213 text[start] == '+' ||
-
3214 text[start] == ',' ||
-
3215 text[start] == ';' ||
-
3216 text[start] == '=' ||
-
3217 text[start] == ':' ||
-
3218 text[start] == '@' ||
-
3219 text[start] == '?' ||
-
3220 text[start] == '#' ||
-
3221 std::use_facet<std::ctype<T>>(this->m_locale).is(std::ctype_base::alnum, text[start]))
-
3222 {
-
3223 this->interval.end = (this->interval.start = start) + 1;
-
3224 return true;
-
3225 }
-
3226 }
-
3227 this->interval.start = (this->interval.end = start) + 1;
-
3228 return false;
-
3229 }
-
3230 };
+
3183
+
3187 template <class T>
+
+ +
3189 {
+
3190 public:
+
3191 basic_url_path_char(_In_ const std::locale& locale = std::locale()) : basic_parser<T>(locale) {}
+
3192
+
3193 virtual bool match(
+
3194 _In_reads_or_z_(end) const T* text,
+
3195 _In_ size_t start = 0,
+
3196 _In_ size_t end = (size_t)-1,
+
3197 _In_ int flags = match_default)
+
3198 {
+
3199 assert(text || start >= end);
+
3200 if (start < end && text[start]) {
+
3201 if (text[start] == '/' ||
+
3202 text[start] == '-' ||
+
3203 text[start] == '.' ||
+
3204 text[start] == '_' ||
+
3205 text[start] == '~' ||
+
3206 text[start] == '%' ||
+
3207 text[start] == '!' ||
+
3208 text[start] == '$' ||
+
3209 text[start] == '&' ||
+
3210 text[start] == '\'' ||
+
3211 text[start] == '(' ||
+
3212 text[start] == ')' ||
+
3213 text[start] == '*' ||
+
3214 text[start] == '+' ||
+
3215 text[start] == ',' ||
+
3216 text[start] == ';' ||
+
3217 text[start] == '=' ||
+
3218 text[start] == ':' ||
+
3219 text[start] == '@' ||
+
3220 text[start] == '?' ||
+
3221 text[start] == '#' ||
+
3222 std::use_facet<std::ctype<T>>(this->m_locale).is(std::ctype_base::alnum, text[start]))
+
3223 {
+
3224 this->interval.end = (this->interval.start = start) + 1;
+
3225 return true;
+
3226 }
+
3227 }
+
3228 this->interval.start = (this->interval.end = start) + 1;
+
3229 return false;
+
3230 }
+
3231 };
-
3231
- - -
3234#ifdef _UNICODE
- -
3236#else
- -
3238#endif
-
3239
-
- -
3244 {
-
3245 public:
-
3246 sgml_url_path_char(_In_ const std::locale& locale = std::locale()) : basic_url_path_char<char>(locale) {}
-
3247
-
3248 virtual bool match(
-
3249 _In_reads_or_z_(end) const char* text,
-
3250 _In_ size_t start = 0,
-
3251 _In_ size_t end = (size_t)-1,
-
3252 _In_ int flags = match_default)
-
3253 {
-
3254 assert(text || start >= end);
-
3255 if (start < end && text[start]) {
-
3256 wchar_t buf[3];
-
3257 const wchar_t* chr = next_sgml_cp(text, start, end, this->interval.end, buf);
-
3258 const wchar_t* chr_end = chr + stdex::strlen(chr);
-
3259 if (((chr[0] == L'/' ||
-
3260 chr[0] == L'-' ||
-
3261 chr[0] == L'.' ||
-
3262 chr[0] == L'_' ||
-
3263 chr[0] == L'~' ||
-
3264 chr[0] == L'%' ||
-
3265 chr[0] == L'!' ||
-
3266 chr[0] == L'$' ||
-
3267 chr[0] == L'&' ||
-
3268 chr[0] == L'\'' ||
-
3269 chr[0] == L'(' ||
-
3270 chr[0] == L')' ||
-
3271 chr[0] == L'*' ||
-
3272 chr[0] == L'+' ||
-
3273 chr[0] == L',' ||
-
3274 chr[0] == L';' ||
-
3275 chr[0] == L'=' ||
-
3276 chr[0] == L':' ||
-
3277 chr[0] == L'@' ||
-
3278 chr[0] == L'?' ||
-
3279 chr[0] == L'#') && chr[1] == 0) ||
-
3280 std::use_facet<std::ctype<wchar_t>>(m_locale).scan_not(std::ctype_base::alnum, chr, chr_end) == chr_end)
-
3281 {
-
3282 this->interval.start = start;
-
3283 return true;
-
3284 }
-
3285 }
-
3286 this->interval.start = (this->interval.end = start) + 1;
-
3287 return false;
-
3288 }
-
3289 };
+
3232
+ + +
3235#ifdef _UNICODE
+ +
3237#else
+ +
3239#endif
+
3240
+
+ +
3245 {
+
3246 public:
+
3247 sgml_url_path_char(_In_ const std::locale& locale = std::locale()) : basic_url_path_char<char>(locale) {}
+
3248
+
3249 virtual bool match(
+
3250 _In_reads_or_z_(end) const char* text,
+
3251 _In_ size_t start = 0,
+
3252 _In_ size_t end = (size_t)-1,
+
3253 _In_ int flags = match_default)
+
3254 {
+
3255 assert(text || start >= end);
+
3256 if (start < end && text[start]) {
+
3257 wchar_t buf[3];
+
3258 const wchar_t* chr = next_sgml_cp(text, start, end, this->interval.end, buf);
+
3259 const wchar_t* chr_end = chr + stdex::strlen(chr);
+
3260 if (((chr[0] == L'/' ||
+
3261 chr[0] == L'-' ||
+
3262 chr[0] == L'.' ||
+
3263 chr[0] == L'_' ||
+
3264 chr[0] == L'~' ||
+
3265 chr[0] == L'%' ||
+
3266 chr[0] == L'!' ||
+
3267 chr[0] == L'$' ||
+
3268 chr[0] == L'&' ||
+
3269 chr[0] == L'\'' ||
+
3270 chr[0] == L'(' ||
+
3271 chr[0] == L')' ||
+
3272 chr[0] == L'*' ||
+
3273 chr[0] == L'+' ||
+
3274 chr[0] == L',' ||
+
3275 chr[0] == L';' ||
+
3276 chr[0] == L'=' ||
+
3277 chr[0] == L':' ||
+
3278 chr[0] == L'@' ||
+
3279 chr[0] == L'?' ||
+
3280 chr[0] == L'#') && chr[1] == 0) ||
+
3281 std::use_facet<std::ctype<wchar_t>>(m_locale).scan_not(std::ctype_base::alnum, chr, chr_end) == chr_end)
+
3282 {
+
3283 this->interval.start = start;
+
3284 return true;
+
3285 }
+
3286 }
+
3287 this->interval.start = (this->interval.end = start) + 1;
+
3288 return false;
+
3289 }
+
3290 };
-
3290
-
3294 template <class T>
-
- -
3296 {
-
3297 public:
- -
3299 _In_ const std::shared_ptr<basic_parser<T>>& path_char,
-
3300 _In_ const std::shared_ptr<basic_parser<T>>& query_start,
-
3301 _In_ const std::shared_ptr<basic_parser<T>>& bookmark_start,
-
3302 _In_ const std::locale& locale = std::locale()) :
-
3303 basic_parser<T>(locale),
-
3304 m_path_char(path_char),
-
3305 m_query_start(query_start),
-
3306 m_bookmark_start(bookmark_start)
-
3307 {}
-
3308
-
3309 virtual bool match(
-
3310 _In_reads_or_z_(end) const T* text,
-
3311 _In_ size_t start = 0,
-
3312 _In_ size_t end = (size_t)-1,
-
3313 _In_ int flags = match_default)
-
3314 {
-
3315 assert(text || start >= end);
-
3316
-
3317 this->interval.end = start;
-
3318 path.start = start;
-
3319 query.start = 1;
-
3320 query.end = 0;
-
3321 bookmark.start = 1;
-
3322 bookmark.end = 0;
-
3323
-
3324 for (;;) {
-
3325 if (this->interval.end >= end || !text[this->interval.end])
-
3326 break;
-
3327 if (m_query_start->match(text, this->interval.end, end, flags)) {
-
3328 path.end = this->interval.end;
-
3329 query.start = this->interval.end = m_query_start->interval.end;
-
3330 for (;;) {
-
3331 if (this->interval.end >= end || !text[this->interval.end]) {
-
3332 query.end = this->interval.end;
-
3333 break;
-
3334 }
-
3335 if (m_bookmark_start->match(text, this->interval.end, end, flags)) {
-
3336 query.end = this->interval.end;
-
3337 bookmark.start = this->interval.end = m_bookmark_start->interval.end;
-
3338 for (;;) {
-
3339 if (this->interval.end >= end || !text[this->interval.end]) {
-
3340 bookmark.end = this->interval.end;
-
3341 break;
-
3342 }
-
3343 if (m_path_char->match(text, this->interval.end, end, flags))
-
3344 this->interval.end = m_path_char->interval.end;
-
3345 else {
-
3346 bookmark.end = this->interval.end;
-
3347 break;
-
3348 }
-
3349 }
-
3350 this->interval.start = start;
-
3351 return true;
-
3352 }
-
3353 if (m_path_char->match(text, this->interval.end, end, flags))
-
3354 this->interval.end = m_path_char->interval.end;
-
3355 else {
-
3356 query.end = this->interval.end;
-
3357 break;
-
3358 }
-
3359 }
-
3360 this->interval.start = start;
-
3361 return true;
-
3362 }
-
3363 if (m_bookmark_start->match(text, this->interval.end, end, flags)) {
-
3364 path.end = this->interval.end;
-
3365 bookmark.start = this->interval.end = m_bookmark_start->interval.end;
-
3366 for (;;) {
-
3367 if (this->interval.end >= end || !text[this->interval.end]) {
-
3368 bookmark.end = this->interval.end;
-
3369 break;
-
3370 }
-
3371 if (m_path_char->match(text, this->interval.end, end, flags))
-
3372 this->interval.end = m_path_char->interval.end;
-
3373 else {
-
3374 bookmark.end = this->interval.end;
-
3375 break;
-
3376 }
-
3377 }
-
3378 this->interval.start = start;
-
3379 return true;
-
3380 }
-
3381 if (m_path_char->match(text, this->interval.end, end, flags))
-
3382 this->interval.end = m_path_char->interval.end;
-
3383 else
-
3384 break;
-
3385 }
-
3386
- -
3388 path.end = this->interval.end;
-
3389 this->interval.start = start;
-
3390 return true;
-
3391 }
-
3392
-
3393 path.start = 1;
-
3394 path.end = 0;
-
3395 bookmark.start = 1;
-
3396 bookmark.end = 0;
-
3397 this->interval.start = (this->interval.end = start) + 1;
-
3398 return false;
-
3399 }
-
3400
-
3401 virtual void invalidate()
-
3402 {
-
3403 path.start = 1;
-
3404 path.end = 0;
-
3405 query.start = 1;
-
3406 query.end = 0;
-
3407 bookmark.start = 1;
-
3408 bookmark.end = 0;
- -
3410 }
-
3411
-
3412 public:
- - -
3415 stdex::interval<size_t> bookmark;
-
3416
-
3417 protected:
-
3418 std::shared_ptr<basic_parser<T>> m_path_char;
-
3419 std::shared_ptr<basic_parser<T>> m_query_start;
-
3420 std::shared_ptr<basic_parser<T>> m_bookmark_start;
-
3421 };
+
3291
+
3295 template <class T>
+
+ +
3297 {
+
3298 public:
+ +
3300 _In_ const std::shared_ptr<basic_parser<T>>& path_char,
+
3301 _In_ const std::shared_ptr<basic_parser<T>>& query_start,
+
3302 _In_ const std::shared_ptr<basic_parser<T>>& bookmark_start,
+
3303 _In_ const std::locale& locale = std::locale()) :
+
3304 basic_parser<T>(locale),
+
3305 m_path_char(path_char),
+
3306 m_query_start(query_start),
+
3307 m_bookmark_start(bookmark_start)
+
3308 {}
+
3309
+
3310 virtual bool match(
+
3311 _In_reads_or_z_(end) const T* text,
+
3312 _In_ size_t start = 0,
+
3313 _In_ size_t end = (size_t)-1,
+
3314 _In_ int flags = match_default)
+
3315 {
+
3316 assert(text || start >= end);
+
3317
+
3318 this->interval.end = start;
+
3319 path.start = start;
+
3320 query.start = 1;
+
3321 query.end = 0;
+
3322 bookmark.start = 1;
+
3323 bookmark.end = 0;
+
3324
+
3325 for (;;) {
+
3326 if (this->interval.end >= end || !text[this->interval.end])
+
3327 break;
+
3328 if (m_query_start->match(text, this->interval.end, end, flags)) {
+
3329 path.end = this->interval.end;
+
3330 query.start = this->interval.end = m_query_start->interval.end;
+
3331 for (;;) {
+
3332 if (this->interval.end >= end || !text[this->interval.end]) {
+
3333 query.end = this->interval.end;
+
3334 break;
+
3335 }
+
3336 if (m_bookmark_start->match(text, this->interval.end, end, flags)) {
+
3337 query.end = this->interval.end;
+
3338 bookmark.start = this->interval.end = m_bookmark_start->interval.end;
+
3339 for (;;) {
+
3340 if (this->interval.end >= end || !text[this->interval.end]) {
+
3341 bookmark.end = this->interval.end;
+
3342 break;
+
3343 }
+
3344 if (m_path_char->match(text, this->interval.end, end, flags))
+
3345 this->interval.end = m_path_char->interval.end;
+
3346 else {
+
3347 bookmark.end = this->interval.end;
+
3348 break;
+
3349 }
+
3350 }
+
3351 this->interval.start = start;
+
3352 return true;
+
3353 }
+
3354 if (m_path_char->match(text, this->interval.end, end, flags))
+
3355 this->interval.end = m_path_char->interval.end;
+
3356 else {
+
3357 query.end = this->interval.end;
+
3358 break;
+
3359 }
+
3360 }
+
3361 this->interval.start = start;
+
3362 return true;
+
3363 }
+
3364 if (m_bookmark_start->match(text, this->interval.end, end, flags)) {
+
3365 path.end = this->interval.end;
+
3366 bookmark.start = this->interval.end = m_bookmark_start->interval.end;
+
3367 for (;;) {
+
3368 if (this->interval.end >= end || !text[this->interval.end]) {
+
3369 bookmark.end = this->interval.end;
+
3370 break;
+
3371 }
+
3372 if (m_path_char->match(text, this->interval.end, end, flags))
+
3373 this->interval.end = m_path_char->interval.end;
+
3374 else {
+
3375 bookmark.end = this->interval.end;
+
3376 break;
+
3377 }
+
3378 }
+
3379 this->interval.start = start;
+
3380 return true;
+
3381 }
+
3382 if (m_path_char->match(text, this->interval.end, end, flags))
+
3383 this->interval.end = m_path_char->interval.end;
+
3384 else
+
3385 break;
+
3386 }
+
3387
+ +
3389 path.end = this->interval.end;
+
3390 this->interval.start = start;
+
3391 return true;
+
3392 }
+
3393
+
3394 path.start = 1;
+
3395 path.end = 0;
+
3396 bookmark.start = 1;
+
3397 bookmark.end = 0;
+
3398 this->interval.start = (this->interval.end = start) + 1;
+
3399 return false;
+
3400 }
+
3401
+
3402 virtual void invalidate()
+
3403 {
+
3404 path.start = 1;
+
3405 path.end = 0;
+
3406 query.start = 1;
+
3407 query.end = 0;
+
3408 bookmark.start = 1;
+
3409 bookmark.end = 0;
+ +
3411 }
+
3412
+
3413 public:
+ + +
3416 stdex::interval<size_t> bookmark;
+
3417
+
3418 protected:
+
3419 std::shared_ptr<basic_parser<T>> m_path_char;
+
3420 std::shared_ptr<basic_parser<T>> m_query_start;
+
3421 std::shared_ptr<basic_parser<T>> m_bookmark_start;
+
3422 };
-
3422
- - -
3425#ifdef _UNICODE
-
3426 using turl_path = wurl_path;
-
3427#else
-
3428 using turl_path = url_path;
-
3429#endif
- -
3431
-
3435 template <class T>
-
-
3436 class basic_url : public basic_parser<T>
-
3437 {
-
3438 public:
-
3439 basic_url(
-
3440 _In_ const std::shared_ptr<basic_parser<T>>& _http_scheme,
-
3441 _In_ const std::shared_ptr<basic_parser<T>>& _ftp_scheme,
-
3442 _In_ const std::shared_ptr<basic_parser<T>>& _mailto_scheme,
-
3443 _In_ const std::shared_ptr<basic_parser<T>>& _file_scheme,
-
3444 _In_ const std::shared_ptr<basic_parser<T>>& colon,
-
3445 _In_ const std::shared_ptr<basic_parser<T>>& slash,
-
3446 _In_ const std::shared_ptr<basic_parser<T>>& _username,
-
3447 _In_ const std::shared_ptr<basic_parser<T>>& _password,
-
3448 _In_ const std::shared_ptr<basic_parser<T>>& at,
-
3449 _In_ const std::shared_ptr<basic_parser<T>>& ip_lbracket,
-
3450 _In_ const std::shared_ptr<basic_parser<T>>& ip_rbracket,
-
3451 _In_ const std::shared_ptr<basic_parser<T>>& _ipv4_host,
-
3452 _In_ const std::shared_ptr<basic_parser<T>>& _ipv6_host,
-
3453 _In_ const std::shared_ptr<basic_parser<T>>& _dns_host,
-
3454 _In_ const std::shared_ptr<basic_parser<T>>& _port,
-
3455 _In_ const std::shared_ptr<basic_parser<T>>& _path,
-
3456 _In_ const std::locale& locale = std::locale()) :
-
3457 basic_parser<T>(locale),
-
3458 http_scheme(_http_scheme),
-
3459 ftp_scheme(_ftp_scheme),
-
3460 mailto_scheme(_mailto_scheme),
-
3461 file_scheme(_file_scheme),
-
3462 m_colon(colon),
-
3463 m_slash(slash),
-
3464 username(_username),
-
3465 password(_password),
-
3466 m_at(at),
-
3467 m_ip_lbracket(ip_lbracket),
-
3468 m_ip_rbracket(ip_rbracket),
-
3469 ipv4_host(_ipv4_host),
-
3470 ipv6_host(_ipv6_host),
-
3471 dns_host(_dns_host),
-
3472 port(_port),
-
3473 path(_path)
-
3474 {}
-
3475
-
3476 virtual bool match(
-
3477 _In_reads_or_z_(end) const T* text,
-
3478 _In_ size_t start = 0,
-
3479 _In_ size_t end = (size_t)-1,
-
3480 _In_ int flags = match_default)
-
3481 {
-
3482 assert(text || start >= end);
-
3483
-
3484 this->interval.end = start;
-
3485
-
3486 if (http_scheme->match(text, this->interval.end, end, flags) &&
-
3487 m_colon->match(text, http_scheme->interval.end, end, flags) &&
-
3488 m_slash->match(text, m_colon->interval.end, end, flags) &&
-
3489 m_slash->match(text, m_slash->interval.end, end, flags))
-
3490 {
-
3491 // http://
-
3492 this->interval.end = m_slash->interval.end;
-
3493 ftp_scheme->invalidate();
-
3494 mailto_scheme->invalidate();
-
3495 file_scheme->invalidate();
-
3496 }
-
3497 else if (ftp_scheme->match(text, this->interval.end, end, flags) &&
-
3498 m_colon->match(text, ftp_scheme->interval.end, end, flags) &&
-
3499 m_slash->match(text, m_colon->interval.end, end, flags) &&
-
3500 m_slash->match(text, m_slash->interval.end, end, flags))
-
3501 {
-
3502 // ftp://
-
3503 this->interval.end = m_slash->interval.end;
-
3504 http_scheme->invalidate();
-
3505 mailto_scheme->invalidate();
-
3506 file_scheme->invalidate();
-
3507 }
-
3508 else if (mailto_scheme->match(text, this->interval.end, end, flags) &&
-
3509 m_colon->match(text, mailto_scheme->interval.end, end, flags))
-
3510 {
-
3511 // mailto:
-
3512 this->interval.end = m_colon->interval.end;
-
3513 http_scheme->invalidate();
-
3514 ftp_scheme->invalidate();
-
3515 file_scheme->invalidate();
-
3516 }
-
3517 else if (file_scheme->match(text, this->interval.end, end, flags) &&
-
3518 m_colon->match(text, file_scheme->interval.end, end, flags) &&
-
3519 m_slash->match(text, m_colon->interval.end, end, flags) &&
-
3520 m_slash->match(text, m_slash->interval.end, end, flags))
-
3521 {
-
3522 // file://
-
3523 this->interval.end = m_slash->interval.end;
-
3524 http_scheme->invalidate();
-
3525 ftp_scheme->invalidate();
-
3526 mailto_scheme->invalidate();
-
3527 }
-
3528 else {
-
3529 // Default to http:
-
3530 http_scheme->invalidate();
-
3531 ftp_scheme->invalidate();
-
3532 mailto_scheme->invalidate();
-
3533 file_scheme->invalidate();
-
3534 }
-
3535
-
3536 if (ftp_scheme->interval) {
-
3537 if (username->match(text, this->interval.end, end, flags)) {
-
3538 if (m_colon->match(text, username->interval.end, end, flags) &&
-
3539 password->match(text, m_colon->interval.end, end, flags) &&
-
3540 m_at->match(text, password->interval.end, end, flags))
-
3541 {
-
3542 // Username and password
-
3543 this->interval.end = m_at->interval.end;
-
3544 }
-
3545 else if (m_at->match(text, this->interval.end, end, flags)) {
-
3546 // Username only
-
3547 this->interval.end = m_at->interval.end;
-
3548 password->invalidate();
-
3549 }
-
3550 else {
-
3551 username->invalidate();
-
3552 password->invalidate();
-
3553 }
-
3554 }
-
3555 else {
-
3556 username->invalidate();
-
3557 password->invalidate();
-
3558 }
-
3559
-
3560 if (ipv4_host->match(text, this->interval.end, end, flags)) {
-
3561 // Host is IPv4
-
3562 this->interval.end = ipv4_host->interval.end;
-
3563 ipv6_host->invalidate();
-
3564 dns_host->invalidate();
-
3565 }
-
3566 else if (
-
3567 m_ip_lbracket->match(text, this->interval.end, end, flags) &&
-
3568 ipv6_host->match(text, m_ip_lbracket->interval.end, end, flags) &&
-
3569 m_ip_rbracket->match(text, ipv6_host->interval.end, end, flags))
-
3570 {
-
3571 // Host is IPv6
-
3572 this->interval.end = m_ip_rbracket->interval.end;
-
3573 ipv4_host->invalidate();
-
3574 dns_host->invalidate();
-
3575 }
-
3576 else if (dns_host->match(text, this->interval.end, end, flags)) {
-
3577 // Host is hostname
-
3578 this->interval.end = dns_host->interval.end;
-
3579 ipv4_host->invalidate();
-
3580 ipv6_host->invalidate();
-
3581 }
-
3582 else {
-
3583 invalidate();
-
3584 return false;
-
3585 }
-
3586
-
3587 if (m_colon->match(text, this->interval.end, end, flags) &&
-
3588 port->match(text, m_colon->interval.end, end, flags))
-
3589 {
-
3590 // Port
-
3591 this->interval.end = port->interval.end;
-
3592 }
-
3593 else
-
3594 port->invalidate();
-
3595
-
3596 if (path->match(text, this->interval.end, end, flags)) {
-
3597 // Path
-
3598 this->interval.end = path->interval.end;
-
3599 }
-
3600
-
3601 this->interval.start = start;
-
3602 return true;
-
3603 }
-
3604
-
3605 if (mailto_scheme->interval) {
-
3606 if (username->match(text, this->interval.end, end, flags) &&
-
3607 m_at->match(text, username->interval.end, end, flags))
-
3608 {
-
3609 // Username
-
3610 this->interval.end = m_at->interval.end;
-
3611 }
-
3612 else {
-
3613 invalidate();
-
3614 return false;
-
3615 }
-
3616
-
3617 if (m_ip_lbracket->match(text, this->interval.end, end, flags) &&
-
3618 ipv4_host->match(text, m_ip_lbracket->interval.end, end, flags) &&
-
3619 m_ip_rbracket->match(text, ipv4_host->interval.end, end, flags))
-
3620 {
-
3621 // Host is IPv4
-
3622 this->interval.end = m_ip_rbracket->interval.end;
-
3623 ipv6_host->invalidate();
-
3624 dns_host->invalidate();
-
3625 }
-
3626 else if (
-
3627 m_ip_lbracket->match(text, this->interval.end, end, flags) &&
-
3628 ipv6_host->match(text, m_ip_lbracket->interval.end, end, flags) &&
-
3629 m_ip_rbracket->match(text, ipv6_host->interval.end, end, flags))
-
3630 {
-
3631 // Host is IPv6
-
3632 this->interval.end = m_ip_rbracket->interval.end;
-
3633 ipv4_host->invalidate();
-
3634 dns_host->invalidate();
-
3635 }
-
3636 else if (dns_host->match(text, this->interval.end, end, flags)) {
-
3637 // Host is hostname
-
3638 this->interval.end = dns_host->interval.end;
-
3639 ipv4_host->invalidate();
-
3640 ipv6_host->invalidate();
-
3641 }
-
3642 else {
-
3643 invalidate();
-
3644 return false;
-
3645 }
-
3646
-
3647 password->invalidate();
-
3648 port->invalidate();
-
3649 path->invalidate();
-
3650 this->interval.start = start;
-
3651 return true;
-
3652 }
-
3653
-
3654 if (file_scheme->interval) {
-
3655 if (path->match(text, this->interval.end, end, flags)) {
-
3656 // Path
-
3657 this->interval.end = path->interval.end;
-
3658 }
-
3659
-
3660 username->invalidate();
-
3661 password->invalidate();
-
3662 ipv4_host->invalidate();
-
3663 ipv6_host->invalidate();
-
3664 dns_host->invalidate();
-
3665 port->invalidate();
-
3666 this->interval.start = start;
-
3667 return true;
-
3668 }
-
3669
-
3670 // "http://" found or defaulted to
-
3671
-
3672 // If "http://" explicit, test for username&password.
-
3673 if (http_scheme->interval &&
-
3674 username->match(text, this->interval.end, end, flags))
-
3675 {
-
3676 if (m_colon->match(text, username->interval.end, end, flags) &&
-
3677 password->match(text, m_colon->interval.end, end, flags) &&
-
3678 m_at->match(text, password->interval.end, end, flags))
-
3679 {
-
3680 // Username and password
-
3681 this->interval.end = m_at->interval.end;
-
3682 }
-
3683 else if (m_at->match(text, username->interval.end, end, flags)) {
-
3684 // Username only
-
3685 this->interval.end = m_at->interval.end;
-
3686 password->invalidate();
-
3687 }
-
3688 else {
-
3689 username->invalidate();
-
3690 password->invalidate();
-
3691 }
-
3692 }
-
3693 else {
-
3694 username->invalidate();
-
3695 password->invalidate();
-
3696 }
-
3697
-
3698 if (ipv4_host->match(text, this->interval.end, end, flags)) {
-
3699 // Host is IPv4
-
3700 this->interval.end = ipv4_host->interval.end;
-
3701 ipv6_host->invalidate();
-
3702 dns_host->invalidate();
-
3703 }
-
3704 else if (
-
3705 m_ip_lbracket->match(text, this->interval.end, end, flags) &&
-
3706 ipv6_host->match(text, m_ip_lbracket->interval.end, end, flags) &&
-
3707 m_ip_rbracket->match(text, ipv6_host->interval.end, end, flags))
-
3708 {
-
3709 // Host is IPv6
-
3710 this->interval.end = m_ip_rbracket->interval.end;
-
3711 ipv4_host->invalidate();
-
3712 dns_host->invalidate();
-
3713 }
-
3714 else if (dns_host->match(text, this->interval.end, end, flags)) {
-
3715 // Host is hostname
-
3716 this->interval.end = dns_host->interval.end;
-
3717 ipv4_host->invalidate();
-
3718 ipv6_host->invalidate();
-
3719 }
-
3720 else {
-
3721 invalidate();
-
3722 return false;
-
3723 }
-
3724
-
3725 if (m_colon->match(text, this->interval.end, end, flags) &&
-
3726 port->match(text, m_colon->interval.end, end, flags))
-
3727 {
-
3728 // Port
-
3729 this->interval.end = port->interval.end;
-
3730 }
-
3731 else
-
3732 port->invalidate();
-
3733
-
3734 if (path->match(text, this->interval.end, end, flags)) {
-
3735 // Path
-
3736 this->interval.end = path->interval.end;
-
3737 }
-
3738
-
3739 this->interval.start = start;
-
3740 return true;
-
3741 }
-
3742
-
3743 virtual void invalidate()
-
3744 {
-
3745 http_scheme->invalidate();
-
3746 ftp_scheme->invalidate();
-
3747 mailto_scheme->invalidate();
-
3748 file_scheme->invalidate();
-
3749 username->invalidate();
-
3750 password->invalidate();
-
3751 ipv4_host->invalidate();
-
3752 ipv6_host->invalidate();
-
3753 dns_host->invalidate();
-
3754 port->invalidate();
-
3755 path->invalidate();
- -
3757 }
-
3758
-
3759 public:
-
3760 std::shared_ptr<basic_parser<T>> http_scheme;
-
3761 std::shared_ptr<basic_parser<T>> ftp_scheme;
-
3762 std::shared_ptr<basic_parser<T>> mailto_scheme;
-
3763 std::shared_ptr<basic_parser<T>> file_scheme;
-
3764 std::shared_ptr<basic_parser<T>> username;
-
3765 std::shared_ptr<basic_parser<T>> password;
-
3766 std::shared_ptr<basic_parser<T>> ipv4_host;
-
3767 std::shared_ptr<basic_parser<T>> ipv6_host;
-
3768 std::shared_ptr<basic_parser<T>> dns_host;
-
3769 std::shared_ptr<basic_parser<T>> port;
-
3770 std::shared_ptr<basic_parser<T>> path;
-
3771
-
3772 protected:
-
3773 std::shared_ptr<basic_parser<T>> m_colon;
-
3774 std::shared_ptr<basic_parser<T>> m_slash;
-
3775 std::shared_ptr<basic_parser<T>> m_at;
-
3776 std::shared_ptr<basic_parser<T>> m_ip_lbracket;
-
3777 std::shared_ptr<basic_parser<T>> m_ip_rbracket;
-
3778 };
+
3423
+ + +
3426#ifdef _UNICODE
+
3427 using turl_path = wurl_path;
+
3428#else
+
3429 using turl_path = url_path;
+
3430#endif
+ +
3432
+
3436 template <class T>
+
+
3437 class basic_url : public basic_parser<T>
+
3438 {
+
3439 public:
+
3440 basic_url(
+
3441 _In_ const std::shared_ptr<basic_parser<T>>& _http_scheme,
+
3442 _In_ const std::shared_ptr<basic_parser<T>>& _ftp_scheme,
+
3443 _In_ const std::shared_ptr<basic_parser<T>>& _mailto_scheme,
+
3444 _In_ const std::shared_ptr<basic_parser<T>>& _file_scheme,
+
3445 _In_ const std::shared_ptr<basic_parser<T>>& colon,
+
3446 _In_ const std::shared_ptr<basic_parser<T>>& slash,
+
3447 _In_ const std::shared_ptr<basic_parser<T>>& _username,
+
3448 _In_ const std::shared_ptr<basic_parser<T>>& _password,
+
3449 _In_ const std::shared_ptr<basic_parser<T>>& at,
+
3450 _In_ const std::shared_ptr<basic_parser<T>>& ip_lbracket,
+
3451 _In_ const std::shared_ptr<basic_parser<T>>& ip_rbracket,
+
3452 _In_ const std::shared_ptr<basic_parser<T>>& _ipv4_host,
+
3453 _In_ const std::shared_ptr<basic_parser<T>>& _ipv6_host,
+
3454 _In_ const std::shared_ptr<basic_parser<T>>& _dns_host,
+
3455 _In_ const std::shared_ptr<basic_parser<T>>& _port,
+
3456 _In_ const std::shared_ptr<basic_parser<T>>& _path,
+
3457 _In_ const std::locale& locale = std::locale()) :
+
3458 basic_parser<T>(locale),
+
3459 http_scheme(_http_scheme),
+
3460 ftp_scheme(_ftp_scheme),
+
3461 mailto_scheme(_mailto_scheme),
+
3462 file_scheme(_file_scheme),
+
3463 m_colon(colon),
+
3464 m_slash(slash),
+
3465 username(_username),
+
3466 password(_password),
+
3467 m_at(at),
+
3468 m_ip_lbracket(ip_lbracket),
+
3469 m_ip_rbracket(ip_rbracket),
+
3470 ipv4_host(_ipv4_host),
+
3471 ipv6_host(_ipv6_host),
+
3472 dns_host(_dns_host),
+
3473 port(_port),
+
3474 path(_path)
+
3475 {}
+
3476
+
3477 virtual bool match(
+
3478 _In_reads_or_z_(end) const T* text,
+
3479 _In_ size_t start = 0,
+
3480 _In_ size_t end = (size_t)-1,
+
3481 _In_ int flags = match_default)
+
3482 {
+
3483 assert(text || start >= end);
+
3484
+
3485 this->interval.end = start;
+
3486
+
3487 if (http_scheme->match(text, this->interval.end, end, flags) &&
+
3488 m_colon->match(text, http_scheme->interval.end, end, flags) &&
+
3489 m_slash->match(text, m_colon->interval.end, end, flags) &&
+
3490 m_slash->match(text, m_slash->interval.end, end, flags))
+
3491 {
+
3492 // http://
+
3493 this->interval.end = m_slash->interval.end;
+
3494 ftp_scheme->invalidate();
+
3495 mailto_scheme->invalidate();
+
3496 file_scheme->invalidate();
+
3497 }
+
3498 else if (ftp_scheme->match(text, this->interval.end, end, flags) &&
+
3499 m_colon->match(text, ftp_scheme->interval.end, end, flags) &&
+
3500 m_slash->match(text, m_colon->interval.end, end, flags) &&
+
3501 m_slash->match(text, m_slash->interval.end, end, flags))
+
3502 {
+
3503 // ftp://
+
3504 this->interval.end = m_slash->interval.end;
+
3505 http_scheme->invalidate();
+
3506 mailto_scheme->invalidate();
+
3507 file_scheme->invalidate();
+
3508 }
+
3509 else if (mailto_scheme->match(text, this->interval.end, end, flags) &&
+
3510 m_colon->match(text, mailto_scheme->interval.end, end, flags))
+
3511 {
+
3512 // mailto:
+
3513 this->interval.end = m_colon->interval.end;
+
3514 http_scheme->invalidate();
+
3515 ftp_scheme->invalidate();
+
3516 file_scheme->invalidate();
+
3517 }
+
3518 else if (file_scheme->match(text, this->interval.end, end, flags) &&
+
3519 m_colon->match(text, file_scheme->interval.end, end, flags) &&
+
3520 m_slash->match(text, m_colon->interval.end, end, flags) &&
+
3521 m_slash->match(text, m_slash->interval.end, end, flags))
+
3522 {
+
3523 // file://
+
3524 this->interval.end = m_slash->interval.end;
+
3525 http_scheme->invalidate();
+
3526 ftp_scheme->invalidate();
+
3527 mailto_scheme->invalidate();
+
3528 }
+
3529 else {
+
3530 // Default to http:
+
3531 http_scheme->invalidate();
+
3532 ftp_scheme->invalidate();
+
3533 mailto_scheme->invalidate();
+
3534 file_scheme->invalidate();
+
3535 }
+
3536
+
3537 if (ftp_scheme->interval) {
+
3538 if (username->match(text, this->interval.end, end, flags)) {
+
3539 if (m_colon->match(text, username->interval.end, end, flags) &&
+
3540 password->match(text, m_colon->interval.end, end, flags) &&
+
3541 m_at->match(text, password->interval.end, end, flags))
+
3542 {
+
3543 // Username and password
+
3544 this->interval.end = m_at->interval.end;
+
3545 }
+
3546 else if (m_at->match(text, this->interval.end, end, flags)) {
+
3547 // Username only
+
3548 this->interval.end = m_at->interval.end;
+
3549 password->invalidate();
+
3550 }
+
3551 else {
+
3552 username->invalidate();
+
3553 password->invalidate();
+
3554 }
+
3555 }
+
3556 else {
+
3557 username->invalidate();
+
3558 password->invalidate();
+
3559 }
+
3560
+
3561 if (ipv4_host->match(text, this->interval.end, end, flags)) {
+
3562 // Host is IPv4
+
3563 this->interval.end = ipv4_host->interval.end;
+
3564 ipv6_host->invalidate();
+
3565 dns_host->invalidate();
+
3566 }
+
3567 else if (
+
3568 m_ip_lbracket->match(text, this->interval.end, end, flags) &&
+
3569 ipv6_host->match(text, m_ip_lbracket->interval.end, end, flags) &&
+
3570 m_ip_rbracket->match(text, ipv6_host->interval.end, end, flags))
+
3571 {
+
3572 // Host is IPv6
+
3573 this->interval.end = m_ip_rbracket->interval.end;
+
3574 ipv4_host->invalidate();
+
3575 dns_host->invalidate();
+
3576 }
+
3577 else if (dns_host->match(text, this->interval.end, end, flags)) {
+
3578 // Host is hostname
+
3579 this->interval.end = dns_host->interval.end;
+
3580 ipv4_host->invalidate();
+
3581 ipv6_host->invalidate();
+
3582 }
+
3583 else {
+
3584 invalidate();
+
3585 return false;
+
3586 }
+
3587
+
3588 if (m_colon->match(text, this->interval.end, end, flags) &&
+
3589 port->match(text, m_colon->interval.end, end, flags))
+
3590 {
+
3591 // Port
+
3592 this->interval.end = port->interval.end;
+
3593 }
+
3594 else
+
3595 port->invalidate();
+
3596
+
3597 if (path->match(text, this->interval.end, end, flags)) {
+
3598 // Path
+
3599 this->interval.end = path->interval.end;
+
3600 }
+
3601
+
3602 this->interval.start = start;
+
3603 return true;
+
3604 }
+
3605
+
3606 if (mailto_scheme->interval) {
+
3607 if (username->match(text, this->interval.end, end, flags) &&
+
3608 m_at->match(text, username->interval.end, end, flags))
+
3609 {
+
3610 // Username
+
3611 this->interval.end = m_at->interval.end;
+
3612 }
+
3613 else {
+
3614 invalidate();
+
3615 return false;
+
3616 }
+
3617
+
3618 if (m_ip_lbracket->match(text, this->interval.end, end, flags) &&
+
3619 ipv4_host->match(text, m_ip_lbracket->interval.end, end, flags) &&
+
3620 m_ip_rbracket->match(text, ipv4_host->interval.end, end, flags))
+
3621 {
+
3622 // Host is IPv4
+
3623 this->interval.end = m_ip_rbracket->interval.end;
+
3624 ipv6_host->invalidate();
+
3625 dns_host->invalidate();
+
3626 }
+
3627 else if (
+
3628 m_ip_lbracket->match(text, this->interval.end, end, flags) &&
+
3629 ipv6_host->match(text, m_ip_lbracket->interval.end, end, flags) &&
+
3630 m_ip_rbracket->match(text, ipv6_host->interval.end, end, flags))
+
3631 {
+
3632 // Host is IPv6
+
3633 this->interval.end = m_ip_rbracket->interval.end;
+
3634 ipv4_host->invalidate();
+
3635 dns_host->invalidate();
+
3636 }
+
3637 else if (dns_host->match(text, this->interval.end, end, flags)) {
+
3638 // Host is hostname
+
3639 this->interval.end = dns_host->interval.end;
+
3640 ipv4_host->invalidate();
+
3641 ipv6_host->invalidate();
+
3642 }
+
3643 else {
+
3644 invalidate();
+
3645 return false;
+
3646 }
+
3647
+
3648 password->invalidate();
+
3649 port->invalidate();
+
3650 path->invalidate();
+
3651 this->interval.start = start;
+
3652 return true;
+
3653 }
+
3654
+
3655 if (file_scheme->interval) {
+
3656 if (path->match(text, this->interval.end, end, flags)) {
+
3657 // Path
+
3658 this->interval.end = path->interval.end;
+
3659 }
+
3660
+
3661 username->invalidate();
+
3662 password->invalidate();
+
3663 ipv4_host->invalidate();
+
3664 ipv6_host->invalidate();
+
3665 dns_host->invalidate();
+
3666 port->invalidate();
+
3667 this->interval.start = start;
+
3668 return true;
+
3669 }
+
3670
+
3671 // "http://" found or defaulted to
+
3672
+
3673 // If "http://" explicit, test for username&password.
+
3674 if (http_scheme->interval &&
+
3675 username->match(text, this->interval.end, end, flags))
+
3676 {
+
3677 if (m_colon->match(text, username->interval.end, end, flags) &&
+
3678 password->match(text, m_colon->interval.end, end, flags) &&
+
3679 m_at->match(text, password->interval.end, end, flags))
+
3680 {
+
3681 // Username and password
+
3682 this->interval.end = m_at->interval.end;
+
3683 }
+
3684 else if (m_at->match(text, username->interval.end, end, flags)) {
+
3685 // Username only
+
3686 this->interval.end = m_at->interval.end;
+
3687 password->invalidate();
+
3688 }
+
3689 else {
+
3690 username->invalidate();
+
3691 password->invalidate();
+
3692 }
+
3693 }
+
3694 else {
+
3695 username->invalidate();
+
3696 password->invalidate();
+
3697 }
+
3698
+
3699 if (ipv4_host->match(text, this->interval.end, end, flags)) {
+
3700 // Host is IPv4
+
3701 this->interval.end = ipv4_host->interval.end;
+
3702 ipv6_host->invalidate();
+
3703 dns_host->invalidate();
+
3704 }
+
3705 else if (
+
3706 m_ip_lbracket->match(text, this->interval.end, end, flags) &&
+
3707 ipv6_host->match(text, m_ip_lbracket->interval.end, end, flags) &&
+
3708 m_ip_rbracket->match(text, ipv6_host->interval.end, end, flags))
+
3709 {
+
3710 // Host is IPv6
+
3711 this->interval.end = m_ip_rbracket->interval.end;
+
3712 ipv4_host->invalidate();
+
3713 dns_host->invalidate();
+
3714 }
+
3715 else if (dns_host->match(text, this->interval.end, end, flags)) {
+
3716 // Host is hostname
+
3717 this->interval.end = dns_host->interval.end;
+
3718 ipv4_host->invalidate();
+
3719 ipv6_host->invalidate();
+
3720 }
+
3721 else {
+
3722 invalidate();
+
3723 return false;
+
3724 }
+
3725
+
3726 if (m_colon->match(text, this->interval.end, end, flags) &&
+
3727 port->match(text, m_colon->interval.end, end, flags))
+
3728 {
+
3729 // Port
+
3730 this->interval.end = port->interval.end;
+
3731 }
+
3732 else
+
3733 port->invalidate();
+
3734
+
3735 if (path->match(text, this->interval.end, end, flags)) {
+
3736 // Path
+
3737 this->interval.end = path->interval.end;
+
3738 }
+
3739
+
3740 this->interval.start = start;
+
3741 return true;
+
3742 }
+
3743
+
3744 virtual void invalidate()
+
3745 {
+
3746 http_scheme->invalidate();
+
3747 ftp_scheme->invalidate();
+
3748 mailto_scheme->invalidate();
+
3749 file_scheme->invalidate();
+
3750 username->invalidate();
+
3751 password->invalidate();
+
3752 ipv4_host->invalidate();
+
3753 ipv6_host->invalidate();
+
3754 dns_host->invalidate();
+
3755 port->invalidate();
+
3756 path->invalidate();
+ +
3758 }
+
3759
+
3760 public:
+
3761 std::shared_ptr<basic_parser<T>> http_scheme;
+
3762 std::shared_ptr<basic_parser<T>> ftp_scheme;
+
3763 std::shared_ptr<basic_parser<T>> mailto_scheme;
+
3764 std::shared_ptr<basic_parser<T>> file_scheme;
+
3765 std::shared_ptr<basic_parser<T>> username;
+
3766 std::shared_ptr<basic_parser<T>> password;
+
3767 std::shared_ptr<basic_parser<T>> ipv4_host;
+
3768 std::shared_ptr<basic_parser<T>> ipv6_host;
+
3769 std::shared_ptr<basic_parser<T>> dns_host;
+
3770 std::shared_ptr<basic_parser<T>> port;
+
3771 std::shared_ptr<basic_parser<T>> path;
+
3772
+
3773 protected:
+
3774 std::shared_ptr<basic_parser<T>> m_colon;
+
3775 std::shared_ptr<basic_parser<T>> m_slash;
+
3776 std::shared_ptr<basic_parser<T>> m_at;
+
3777 std::shared_ptr<basic_parser<T>> m_ip_lbracket;
+
3778 std::shared_ptr<basic_parser<T>> m_ip_rbracket;
+
3779 };
-
3779
-
3780 using url = basic_url<char>;
-
3781 using wurl = basic_url<wchar_t>;
-
3782#ifdef _UNICODE
-
3783 using turl = wurl;
-
3784#else
-
3785 using turl = url;
-
3786#endif
-
3787 using sgml_url = basic_url<char>;
-
3788
-
3792 template <class T>
-
- -
3794 {
-
3795 public:
- -
3797 _In_ const std::shared_ptr<basic_parser<T>>& _username,
-
3798 _In_ const std::shared_ptr<basic_parser<T>>& at,
-
3799 _In_ const std::shared_ptr<basic_parser<T>>& ip_lbracket,
-
3800 _In_ const std::shared_ptr<basic_parser<T>>& ip_rbracket,
-
3801 _In_ const std::shared_ptr<basic_parser<T>>& _ipv4_host,
-
3802 _In_ const std::shared_ptr<basic_parser<T>>& _ipv6_host,
-
3803 _In_ const std::shared_ptr<basic_parser<T>>& _dns_host,
-
3804 _In_ const std::locale& locale = std::locale()) :
-
3805 basic_parser<T>(locale),
-
3806 username(_username),
-
3807 m_at(at),
-
3808 m_ip_lbracket(ip_lbracket),
-
3809 m_ip_rbracket(ip_rbracket),
-
3810 ipv4_host(_ipv4_host),
-
3811 ipv6_host(_ipv6_host),
-
3812 dns_host(_dns_host)
-
3813 {}
-
3814
-
3815 virtual bool match(
-
3816 _In_reads_or_z_(end) const T* text,
-
3817 _In_ size_t start = 0,
-
3818 _In_ size_t end = (size_t)-1,
-
3819 _In_ int flags = match_default)
-
3820 {
-
3821 assert(text || start >= end);
-
3822
-
3823 if (username->match(text, start, end, flags) &&
-
3824 m_at->match(text, username->interval.end, end, flags))
-
3825 {
-
3826 // Username@
-
3827 if (m_ip_lbracket->match(text, m_at->interval.end, end, flags) &&
-
3828 ipv4_host->match(text, m_ip_lbracket->interval.end, end, flags) &&
-
3829 m_ip_rbracket->match(text, ipv4_host->interval.end, end, flags))
-
3830 {
-
3831 // Host is IPv4
-
3832 this->interval.end = m_ip_rbracket->interval.end;
-
3833 ipv6_host->invalidate();
-
3834 dns_host->invalidate();
-
3835 }
-
3836 else if (
-
3837 m_ip_lbracket->match(text, m_at->interval.end, end, flags) &&
-
3838 ipv6_host->match(text, m_ip_lbracket->interval.end, end, flags) &&
-
3839 m_ip_rbracket->match(text, ipv6_host->interval.end, end, flags))
-
3840 {
-
3841 // Host is IPv6
-
3842 this->interval.end = m_ip_rbracket->interval.end;
-
3843 ipv4_host->invalidate();
-
3844 dns_host->invalidate();
-
3845 }
-
3846 else if (dns_host->match(text, m_at->interval.end, end, flags)) {
-
3847 // Host is hostname
-
3848 this->interval.end = dns_host->interval.end;
-
3849 ipv4_host->invalidate();
-
3850 ipv6_host->invalidate();
-
3851 }
-
3852 else
-
3853 goto error;
-
3854 this->interval.start = start;
-
3855 return true;
-
3856 }
-
3857
-
3858 error:
-
3859 username->invalidate();
-
3860 ipv4_host->invalidate();
-
3861 ipv6_host->invalidate();
-
3862 dns_host->invalidate();
-
3863 this->interval.start = (this->interval.end = start) + 1;
-
3864 return false;
-
3865 }
-
3866
-
3867 virtual void invalidate()
-
3868 {
-
3869 username->invalidate();
-
3870 ipv4_host->invalidate();
-
3871 ipv6_host->invalidate();
-
3872 dns_host->invalidate();
- -
3874 }
-
3875
-
3876 public:
-
3877 std::shared_ptr<basic_parser<T>> username;
-
3878 std::shared_ptr<basic_parser<T>> ipv4_host;
-
3879 std::shared_ptr<basic_parser<T>> ipv6_host;
-
3880 std::shared_ptr<basic_parser<T>> dns_host;
-
3881
-
3882 protected:
-
3883 std::shared_ptr<basic_parser<T>> m_at;
-
3884 std::shared_ptr<basic_parser<T>> m_ip_lbracket;
-
3885 std::shared_ptr<basic_parser<T>> m_ip_rbracket;
-
3886 };
+
3780
+
3781 using url = basic_url<char>;
+
3782 using wurl = basic_url<wchar_t>;
+
3783#ifdef _UNICODE
+
3784 using turl = wurl;
+
3785#else
+
3786 using turl = url;
+
3787#endif
+
3788 using sgml_url = basic_url<char>;
+
3789
+
3793 template <class T>
+
+ +
3795 {
+
3796 public:
+ +
3798 _In_ const std::shared_ptr<basic_parser<T>>& _username,
+
3799 _In_ const std::shared_ptr<basic_parser<T>>& at,
+
3800 _In_ const std::shared_ptr<basic_parser<T>>& ip_lbracket,
+
3801 _In_ const std::shared_ptr<basic_parser<T>>& ip_rbracket,
+
3802 _In_ const std::shared_ptr<basic_parser<T>>& _ipv4_host,
+
3803 _In_ const std::shared_ptr<basic_parser<T>>& _ipv6_host,
+
3804 _In_ const std::shared_ptr<basic_parser<T>>& _dns_host,
+
3805 _In_ const std::locale& locale = std::locale()) :
+
3806 basic_parser<T>(locale),
+
3807 username(_username),
+
3808 m_at(at),
+
3809 m_ip_lbracket(ip_lbracket),
+
3810 m_ip_rbracket(ip_rbracket),
+
3811 ipv4_host(_ipv4_host),
+
3812 ipv6_host(_ipv6_host),
+
3813 dns_host(_dns_host)
+
3814 {}
+
3815
+
3816 virtual bool match(
+
3817 _In_reads_or_z_(end) const T* text,
+
3818 _In_ size_t start = 0,
+
3819 _In_ size_t end = (size_t)-1,
+
3820 _In_ int flags = match_default)
+
3821 {
+
3822 assert(text || start >= end);
+
3823
+
3824 if (username->match(text, start, end, flags) &&
+
3825 m_at->match(text, username->interval.end, end, flags))
+
3826 {
+
3827 // Username@
+
3828 if (m_ip_lbracket->match(text, m_at->interval.end, end, flags) &&
+
3829 ipv4_host->match(text, m_ip_lbracket->interval.end, end, flags) &&
+
3830 m_ip_rbracket->match(text, ipv4_host->interval.end, end, flags))
+
3831 {
+
3832 // Host is IPv4
+
3833 this->interval.end = m_ip_rbracket->interval.end;
+
3834 ipv6_host->invalidate();
+
3835 dns_host->invalidate();
+
3836 }
+
3837 else if (
+
3838 m_ip_lbracket->match(text, m_at->interval.end, end, flags) &&
+
3839 ipv6_host->match(text, m_ip_lbracket->interval.end, end, flags) &&
+
3840 m_ip_rbracket->match(text, ipv6_host->interval.end, end, flags))
+
3841 {
+
3842 // Host is IPv6
+
3843 this->interval.end = m_ip_rbracket->interval.end;
+
3844 ipv4_host->invalidate();
+
3845 dns_host->invalidate();
+
3846 }
+
3847 else if (dns_host->match(text, m_at->interval.end, end, flags)) {
+
3848 // Host is hostname
+
3849 this->interval.end = dns_host->interval.end;
+
3850 ipv4_host->invalidate();
+
3851 ipv6_host->invalidate();
+
3852 }
+
3853 else
+
3854 goto error;
+
3855 this->interval.start = start;
+
3856 return true;
+
3857 }
+
3858
+
3859 error:
+
3860 username->invalidate();
+
3861 ipv4_host->invalidate();
+
3862 ipv6_host->invalidate();
+
3863 dns_host->invalidate();
+
3864 this->interval.start = (this->interval.end = start) + 1;
+
3865 return false;
+
3866 }
+
3867
+
3868 virtual void invalidate()
+
3869 {
+
3870 username->invalidate();
+
3871 ipv4_host->invalidate();
+
3872 ipv6_host->invalidate();
+
3873 dns_host->invalidate();
+ +
3875 }
+
3876
+
3877 public:
+
3878 std::shared_ptr<basic_parser<T>> username;
+
3879 std::shared_ptr<basic_parser<T>> ipv4_host;
+
3880 std::shared_ptr<basic_parser<T>> ipv6_host;
+
3881 std::shared_ptr<basic_parser<T>> dns_host;
+
3882
+
3883 protected:
+
3884 std::shared_ptr<basic_parser<T>> m_at;
+
3885 std::shared_ptr<basic_parser<T>> m_ip_lbracket;
+
3886 std::shared_ptr<basic_parser<T>> m_ip_rbracket;
+
3887 };
-
3887
- - -
3890#ifdef _UNICODE
- -
3892#else
- -
3894#endif
- -
3896
-
3900 template <class T>
-
- -
3902 {
-
3903 public:
- -
3905 _In_ const std::shared_ptr<basic_parser<T>>& _emoticon,
-
3906 _In_ const std::shared_ptr<basic_parser<T>>& _apex,
-
3907 _In_ const std::shared_ptr<basic_parser<T>>& _eyes,
-
3908 _In_ const std::shared_ptr<basic_parser<T>>& _nose,
-
3909 _In_ const std::shared_ptr<basic_set<T>>& _mouth,
-
3910 _In_ const std::locale& locale = std::locale()) :
-
3911 basic_parser<T>(locale),
- -
3913 apex(_apex),
-
3914 eyes(_eyes),
-
3915 nose(_nose),
-
3916 mouth(_mouth)
-
3917 {}
-
3918
-
3919 virtual bool match(
-
3920 _In_reads_or_z_(end) const T* text,
-
3921 _In_ size_t start = 0,
-
3922 _In_ size_t end = (size_t)-1,
-
3923 _In_ int flags = match_default)
-
3924 {
-
3925 assert(text || start >= end);
-
3926
-
3927 if (emoticon && emoticon->match(text, start, end, flags)) {
-
3928 if (apex) apex->invalidate();
-
3929 eyes->invalidate();
-
3930 if (nose) nose->invalidate();
-
3931 mouth->invalidate();
-
3932 this->interval.start = start;
-
3933 this->interval.end = emoticon->interval.end;
-
3934 return true;
-
3935 }
-
3936
-
3937 this->interval.end = start;
-
3938
-
3939 if (apex && apex->match(text, this->interval.end, end, flags))
-
3940 this->interval.end = apex->interval.end;
-
3941
-
3942 if (eyes->match(text, this->interval.end, end, flags)) {
-
3943 if (nose && nose->match(text, eyes->interval.end, end, flags) &&
-
3944 mouth->match(text, nose->interval.end, end, flags))
-
3945 {
-
3946 size_t
- -
3948 hit_offset = mouth->hit_offset;
-
3949 // Mouth may repeat :-)))))))
-
3950 for (this->interval.end = mouth->interval.end; mouth->match(text, this->interval.end, end, flags) && mouth->hit_offset == hit_offset; this->interval.end = mouth->interval.end);
-
3951 mouth->interval.start = start_mouth;
-
3952 mouth->interval.end = this->interval.end;
-
3953 this->interval.start = start;
-
3954 return true;
-
3955 }
-
3956 if (mouth->match(text, eyes->interval.end, end, flags)) {
-
3957 size_t
- -
3959 hit_offset = mouth->hit_offset;
-
3960 // Mouth may repeat :-)))))))
-
3961 for (this->interval.end = mouth->interval.end; mouth->match(text, this->interval.end, end, flags) && mouth->hit_offset == hit_offset; this->interval.end = mouth->interval.end);
-
3962 if (nose) nose->invalidate();
-
3963 mouth->interval.start = start_mouth;
-
3964 mouth->interval.end = this->interval.end;
-
3965 this->interval.start = start;
-
3966 return true;
-
3967 }
-
3968 }
-
3969
-
3970 if (emoticon) emoticon->invalidate();
-
3971 if (apex) apex->invalidate();
-
3972 eyes->invalidate();
-
3973 if (nose) nose->invalidate();
-
3974 mouth->invalidate();
-
3975 this->interval.start = (this->interval.end = start) + 1;
-
3976 return false;
-
3977 }
-
3978
-
3979 virtual void invalidate()
-
3980 {
-
3981 if (emoticon) emoticon->invalidate();
-
3982 if (apex) apex->invalidate();
-
3983 eyes->invalidate();
-
3984 if (nose) nose->invalidate();
-
3985 mouth->invalidate();
- -
3987 }
-
3988
-
3989 public:
-
3990 std::shared_ptr<basic_parser<T>> emoticon;
-
3991 std::shared_ptr<basic_parser<T>> apex;
-
3992 std::shared_ptr<basic_parser<T>> eyes;
-
3993 std::shared_ptr<basic_parser<T>> nose;
-
3994 std::shared_ptr<basic_set<T>> mouth;
-
3995 };
+
3888
+ + +
3891#ifdef _UNICODE
+ +
3893#else
+ +
3895#endif
+ +
3897
+
3901 template <class T>
+
+ +
3903 {
+
3904 public:
+ +
3906 _In_ const std::shared_ptr<basic_parser<T>>& _emoticon,
+
3907 _In_ const std::shared_ptr<basic_parser<T>>& _apex,
+
3908 _In_ const std::shared_ptr<basic_parser<T>>& _eyes,
+
3909 _In_ const std::shared_ptr<basic_parser<T>>& _nose,
+
3910 _In_ const std::shared_ptr<basic_set<T>>& _mouth,
+
3911 _In_ const std::locale& locale = std::locale()) :
+
3912 basic_parser<T>(locale),
+ +
3914 apex(_apex),
+
3915 eyes(_eyes),
+
3916 nose(_nose),
+
3917 mouth(_mouth)
+
3918 {}
+
3919
+
3920 virtual bool match(
+
3921 _In_reads_or_z_(end) const T* text,
+
3922 _In_ size_t start = 0,
+
3923 _In_ size_t end = (size_t)-1,
+
3924 _In_ int flags = match_default)
+
3925 {
+
3926 assert(text || start >= end);
+
3927
+
3928 if (emoticon && emoticon->match(text, start, end, flags)) {
+
3929 if (apex) apex->invalidate();
+
3930 eyes->invalidate();
+
3931 if (nose) nose->invalidate();
+
3932 mouth->invalidate();
+
3933 this->interval.start = start;
+
3934 this->interval.end = emoticon->interval.end;
+
3935 return true;
+
3936 }
+
3937
+
3938 this->interval.end = start;
+
3939
+
3940 if (apex && apex->match(text, this->interval.end, end, flags))
+
3941 this->interval.end = apex->interval.end;
+
3942
+
3943 if (eyes->match(text, this->interval.end, end, flags)) {
+
3944 if (nose && nose->match(text, eyes->interval.end, end, flags) &&
+
3945 mouth->match(text, nose->interval.end, end, flags))
+
3946 {
+
3947 size_t
+ +
3949 hit_offset = mouth->hit_offset;
+
3950 // Mouth may repeat :-)))))))
+
3951 for (this->interval.end = mouth->interval.end; mouth->match(text, this->interval.end, end, flags) && mouth->hit_offset == hit_offset; this->interval.end = mouth->interval.end);
+
3952 mouth->interval.start = start_mouth;
+
3953 mouth->interval.end = this->interval.end;
+
3954 this->interval.start = start;
+
3955 return true;
+
3956 }
+
3957 if (mouth->match(text, eyes->interval.end, end, flags)) {
+
3958 size_t
+ +
3960 hit_offset = mouth->hit_offset;
+
3961 // Mouth may repeat :-)))))))
+
3962 for (this->interval.end = mouth->interval.end; mouth->match(text, this->interval.end, end, flags) && mouth->hit_offset == hit_offset; this->interval.end = mouth->interval.end);
+
3963 if (nose) nose->invalidate();
+
3964 mouth->interval.start = start_mouth;
+
3965 mouth->interval.end = this->interval.end;
+
3966 this->interval.start = start;
+
3967 return true;
+
3968 }
+
3969 }
+
3970
+
3971 if (emoticon) emoticon->invalidate();
+
3972 if (apex) apex->invalidate();
+
3973 eyes->invalidate();
+
3974 if (nose) nose->invalidate();
+
3975 mouth->invalidate();
+
3976 this->interval.start = (this->interval.end = start) + 1;
+
3977 return false;
+
3978 }
+
3979
+
3980 virtual void invalidate()
+
3981 {
+
3982 if (emoticon) emoticon->invalidate();
+
3983 if (apex) apex->invalidate();
+
3984 eyes->invalidate();
+
3985 if (nose) nose->invalidate();
+
3986 mouth->invalidate();
+ +
3988 }
+
3989
+
3990 public:
+
3991 std::shared_ptr<basic_parser<T>> emoticon;
+
3992 std::shared_ptr<basic_parser<T>> apex;
+
3993 std::shared_ptr<basic_parser<T>> eyes;
+
3994 std::shared_ptr<basic_parser<T>> nose;
+
3995 std::shared_ptr<basic_set<T>> mouth;
+
3996 };
-
3996
- - -
3999#ifdef _UNICODE
-
4000 using temoticon = wemoticon;
-
4001#else
-
4002 using temoticon = emoticon;
-
4003#endif
- -
4005
-
4009 enum date_format_t {
-
4010 date_format_none = 0,
-
4011 date_format_dmy = 0x1,
-
4012 date_format_mdy = 0x2,
-
4013 date_format_ymd = 0x4,
-
4014 date_format_ym = 0x8,
-
4015 date_format_my = 0x10,
-
4016 date_format_dm = 0x20,
-
4017 date_format_md = 0x40,
-
4018 };
-
4019
-
4023 template <class T>
-
-
4024 class basic_date : public basic_parser<T>
-
4025 {
-
4026 public:
-
4027 basic_date(
-
4028 _In_ int format_mask,
-
4029 _In_ const std::shared_ptr<basic_integer<T>>& _day,
-
4030 _In_ const std::shared_ptr<basic_integer<T>>& _month,
-
4031 _In_ const std::shared_ptr<basic_integer<T>>& _year,
-
4032 _In_ const std::shared_ptr<basic_set<T>>& separator,
-
4033 _In_ const std::shared_ptr<basic_parser<T>>& space,
-
4034 _In_ const std::locale& locale = std::locale()) :
-
4035 basic_parser<T>(locale),
-
4036 format(date_format_none),
-
4037 m_format_mask(format_mask),
-
4038 day(_day),
-
4039 month(_month),
-
4040 year(_year),
-
4041 m_separator(separator),
-
4042 m_space(space)
-
4043 {}
-
4044
-
4045 virtual bool match(
-
4046 _In_reads_or_z_(end) const T* text,
-
4047 _In_ size_t start = 0,
-
4048 _In_ size_t end = (size_t)-1,
-
4049 _In_ int flags = match_default)
-
4050 {
-
4051 assert(text || start >= end);
-
4052
-
4053 const int space_match_flags = flags & ~match_multiline; // Spaces in dates must never be broken in new line.
-
4054 if ((m_format_mask & date_format_dmy) == date_format_dmy) {
-
4055 if (day->match(text, start, end, flags)) {
-
4056 for (this->interval.end = day->interval.end; m_space->match(text, this->interval.end, end, space_match_flags); this->interval.end = m_space->interval.end);
-
4057 if (m_separator->match(text, this->interval.end, end, flags)) {
-
4058 size_t hit_offset = m_separator->hit_offset;
-
4059 for (this->interval.end = m_separator->interval.end; m_space->match(text, this->interval.end, end, space_match_flags); this->interval.end = m_space->interval.end);
-
4060 if (month->match(text, this->interval.end, end, flags)) {
-
4061 for (this->interval.end = month->interval.end; m_space->match(text, this->interval.end, end, space_match_flags); this->interval.end = m_space->interval.end);
-
4062 if (m_separator->match(text, this->interval.end, end, flags) &&
-
4063 m_separator->hit_offset == hit_offset) // Both separators must match.
-
4064 {
-
4065 for (this->interval.end = m_separator->interval.end; m_space->match(text, this->interval.end, end, space_match_flags); this->interval.end = m_space->interval.end);
-
4066 if (year->match(text, this->interval.end, end, flags) &&
-
4067 is_valid(day->value, month->value))
-
4068 {
-
4069 this->interval.start = start;
-
4070 this->interval.end = year->interval.end;
-
4071 format = date_format_dmy;
-
4072 return true;
-
4073 }
-
4074 }
-
4075 }
-
4076 }
-
4077 }
-
4078 }
-
4079
-
4080 if ((m_format_mask & date_format_mdy) == date_format_mdy) {
-
4081 if (month->match(text, start, end, flags)) {
-
4082 for (this->interval.end = month->interval.end; m_space->match(text, this->interval.end, end, space_match_flags); this->interval.end = m_space->interval.end);
-
4083 if (m_separator->match(text, this->interval.end, end, flags)) {
-
4084 size_t hit_offset = m_separator->hit_offset;
-
4085 for (this->interval.end = m_separator->interval.end; m_space->match(text, this->interval.end, end, space_match_flags); this->interval.end = m_space->interval.end);
-
4086 if (day->match(text, this->interval.end, end, flags)) {
-
4087 for (this->interval.end = day->interval.end; m_space->match(text, this->interval.end, end, space_match_flags); this->interval.end = m_space->interval.end);
-
4088 if (m_separator->match(text, this->interval.end, end, flags) &&
-
4089 m_separator->hit_offset == hit_offset) // Both separators must match.
-
4090 {
-
4091 for (this->interval.end = m_separator->interval.end; m_space->match(text, this->interval.end, end, space_match_flags); this->interval.end = m_space->interval.end);
-
4092 if (year->match(text, this->interval.end, end, flags) &&
-
4093 is_valid(day->value, month->value))
-
4094 {
-
4095 this->interval.start = start;
-
4096 this->interval.end = year->interval.end;
-
4097 format = date_format_mdy;
-
4098 return true;
-
4099 }
-
4100 }
-
4101 }
-
4102 }
-
4103 }
-
4104 }
-
4105
-
4106 if ((m_format_mask & date_format_ymd) == date_format_ymd) {
-
4107 if (year->match(text, start, end, flags)) {
-
4108 for (this->interval.end = year->interval.end; m_space->match(text, this->interval.end, end, space_match_flags); this->interval.end = m_space->interval.end);
-
4109 if (m_separator->match(text, this->interval.end, end, flags)) {
-
4110 size_t hit_offset = m_separator->hit_offset;
-
4111 for (this->interval.end = m_separator->interval.end; m_space->match(text, this->interval.end, end, space_match_flags); this->interval.end = m_space->interval.end);
-
4112 if (month->match(text, this->interval.end, end, flags)) {
-
4113 for (this->interval.end = month->interval.end; m_space->match(text, this->interval.end, end, space_match_flags); this->interval.end = m_space->interval.end);
-
4114 if (m_separator->match(text, this->interval.end, end, flags) &&
-
4115 m_separator->hit_offset == hit_offset) // Both separators must match.
-
4116 {
-
4117 for (this->interval.end = m_separator->interval.end; m_space->match(text, this->interval.end, end, space_match_flags); this->interval.end = m_space->interval.end);
-
4118 if (day->match(text, this->interval.end, end, flags) &&
-
4119 is_valid(day->value, month->value))
-
4120 {
-
4121 this->interval.start = start;
-
4122 this->interval.end = day->interval.end;
-
4123 format = date_format_ymd;
-
4124 return true;
-
4125 }
-
4126 }
-
4127 }
-
4128 }
-
4129 }
-
4130 }
-
4131
-
4132 if ((m_format_mask & date_format_ym) == date_format_ym) {
-
4133 if (year->match(text, start, end, flags)) {
-
4134 for (this->interval.end = year->interval.end; m_space->match(text, this->interval.end, end, space_match_flags); this->interval.end = m_space->interval.end);
-
4135 if (m_separator->match(text, this->interval.end, end, flags)) {
-
4136 for (this->interval.end = m_separator->interval.end; m_space->match(text, this->interval.end, end, space_match_flags); this->interval.end = m_space->interval.end);
-
4137 if (month->match(text, this->interval.end, end, flags) &&
-
4138 is_valid((size_t)-1, month->value))
-
4139 {
-
4140 if (day) day->invalidate();
-
4141 this->interval.start = start;
-
4142 this->interval.end = month->interval.end;
-
4143 format = date_format_ym;
-
4144 return true;
-
4145 }
-
4146 }
-
4147 }
-
4148 }
-
4149
-
4150 if ((m_format_mask & date_format_my) == date_format_my) {
-
4151 if (month->match(text, start, end, flags)) {
-
4152 for (this->interval.end = month->interval.end; m_space->match(text, this->interval.end, end, space_match_flags); this->interval.end = m_space->interval.end);
-
4153 if (m_separator->match(text, this->interval.end, end, flags)) {
-
4154 for (this->interval.end = m_separator->interval.end; m_space->match(text, this->interval.end, end, space_match_flags); this->interval.end = m_space->interval.end);
-
4155 if (year->match(text, this->interval.end, end, flags) &&
-
4156 is_valid((size_t)-1, month->value))
-
4157 {
-
4158 if (day) day->invalidate();
-
4159 this->interval.start = start;
-
4160 this->interval.end = year->interval.end;
-
4161 format = date_format_my;
-
4162 return true;
-
4163 }
-
4164 }
-
4165 }
-
4166 }
-
4167
-
4168 if ((m_format_mask & date_format_dm) == date_format_dm) {
-
4169 if (day->match(text, start, end, flags)) {
-
4170 for (this->interval.end = day->interval.end; m_space->match(text, this->interval.end, end, space_match_flags); this->interval.end = m_space->interval.end);
-
4171 if (m_separator->match(text, this->interval.end, end, flags)) {
-
4172 size_t hit_offset = m_separator->hit_offset;
-
4173 for (this->interval.end = m_separator->interval.end; m_space->match(text, this->interval.end, end, space_match_flags); this->interval.end = m_space->interval.end);
-
4174 if (month->match(text, this->interval.end, end, flags) &&
-
4175 is_valid(day->value, month->value))
-
4176 {
-
4177 if (year) year->invalidate();
-
4178 this->interval.start = start;
-
4179 for (this->interval.end = month->interval.end; m_space->match(text, this->interval.end, end, space_match_flags); this->interval.end = m_space->interval.end);
-
4180 if (m_separator->match(text, this->interval.end, end, flags) &&
-
4181 m_separator->hit_offset == hit_offset) // Both separators must match.
-
4182 this->interval.end = m_separator->interval.end;
-
4183 else
-
4184 this->interval.end = month->interval.end;
-
4185 format = date_format_dm;
-
4186 return true;
-
4187 }
-
4188 }
-
4189 }
-
4190 }
-
4191
-
4192 if ((m_format_mask & date_format_md) == date_format_md) {
-
4193 if (month->match(text, start, end, flags)) {
-
4194 for (this->interval.end = month->interval.end; m_space->match(text, this->interval.end, end, space_match_flags); this->interval.end = m_space->interval.end);
-
4195 if (m_separator->match(text, this->interval.end, end, flags)) {
-
4196 size_t hit_offset = m_separator->hit_offset;
-
4197 for (this->interval.end = m_separator->interval.end; m_space->match(text, this->interval.end, end, space_match_flags); this->interval.end = m_space->interval.end);
-
4198 if (day->match(text, this->interval.end, end, flags) &&
-
4199 is_valid(day->value, month->value))
-
4200 {
-
4201 if (year) year->invalidate();
-
4202 this->interval.start = start;
-
4203 for (this->interval.end = day->interval.end; m_space->match(text, this->interval.end, end, space_match_flags); this->interval.end = m_space->interval.end);
-
4204 if (m_separator->match(text, this->interval.end, end, flags) &&
-
4205 m_separator->hit_offset == hit_offset) // Both separators must match.
-
4206 this->interval.end = m_separator->interval.end;
-
4207 else
-
4208 this->interval.end = day->interval.end;
-
4209 format = date_format_md;
-
4210 return true;
-
4211 }
-
4212 }
-
4213 }
-
4214 }
-
4215
-
4216 if (day) day->invalidate();
-
4217 if (month) month->invalidate();
-
4218 if (year) year->invalidate();
-
4219 format = date_format_none;
-
4220 this->interval.start = (this->interval.end = start) + 1;
-
4221 return false;
-
4222 }
-
4223
-
4224 virtual void invalidate()
-
4225 {
-
4226 if (day) day->invalidate();
-
4227 if (month) month->invalidate();
-
4228 if (year) year->invalidate();
-
4229 format = date_format_none;
- -
4231 }
-
4232
-
4233 protected:
-
4234 static inline bool is_valid(size_t day, size_t month)
-
4235 {
-
4236 if (month == (size_t)-1) {
-
4237 // Default to January. This allows validating day only, as January has all 31 days.
-
4238 month = 1;
-
4239 }
-
4240 if (day == (size_t)-1) {
-
4241 // Default to 1st day in month. This allows validating month only, as each month has 1st day.
-
4242 day = 1;
-
4243 }
-
4244
-
4245 switch (month) {
-
4246 case 1:
-
4247 case 3:
-
4248 case 5:
-
4249 case 7:
-
4250 case 8:
-
4251 case 10:
-
4252 case 12:
-
4253 return 1 <= day && day <= 31;
-
4254 case 2:
-
4255 return 1 <= day && day <= 29;
-
4256 case 4:
-
4257 case 6:
-
4258 case 9:
-
4259 case 11:
-
4260 return 1 <= day && day <= 30;
-
4261 default:
-
4262 return false;
-
4263 }
-
4264 }
-
4265
-
4266 public:
-
4267 date_format_t format;
-
4268 std::shared_ptr<basic_integer<T>> day;
-
4269 std::shared_ptr<basic_integer<T>> month;
-
4270 std::shared_ptr<basic_integer<T>> year;
-
4271
-
4272 protected:
-
4273 int m_format_mask;
-
4274 std::shared_ptr<basic_set<T>> m_separator;
-
4275 std::shared_ptr<basic_parser<T>> m_space;
-
4276 };
+
3997
+ + +
4000#ifdef _UNICODE
+
4001 using temoticon = wemoticon;
+
4002#else
+
4003 using temoticon = emoticon;
+
4004#endif
+ +
4006
+
4010 enum date_format_t {
+
4011 date_format_none = 0,
+
4012 date_format_dmy = 0x1,
+
4013 date_format_mdy = 0x2,
+
4014 date_format_ymd = 0x4,
+
4015 date_format_ym = 0x8,
+
4016 date_format_my = 0x10,
+
4017 date_format_dm = 0x20,
+
4018 date_format_md = 0x40,
+
4019 };
+
4020
+
4024 template <class T>
+
+
4025 class basic_date : public basic_parser<T>
+
4026 {
+
4027 public:
+
4028 basic_date(
+
4029 _In_ int format_mask,
+
4030 _In_ const std::shared_ptr<basic_integer<T>>& _day,
+
4031 _In_ const std::shared_ptr<basic_integer<T>>& _month,
+
4032 _In_ const std::shared_ptr<basic_integer<T>>& _year,
+
4033 _In_ const std::shared_ptr<basic_set<T>>& separator,
+
4034 _In_ const std::shared_ptr<basic_parser<T>>& space,
+
4035 _In_ const std::locale& locale = std::locale()) :
+
4036 basic_parser<T>(locale),
+
4037 format(date_format_none),
+
4038 m_format_mask(format_mask),
+
4039 day(_day),
+
4040 month(_month),
+
4041 year(_year),
+
4042 m_separator(separator),
+
4043 m_space(space)
+
4044 {}
+
4045
+
4046 virtual bool match(
+
4047 _In_reads_or_z_(end) const T* text,
+
4048 _In_ size_t start = 0,
+
4049 _In_ size_t end = (size_t)-1,
+
4050 _In_ int flags = match_default)
+
4051 {
+
4052 assert(text || start >= end);
+
4053
+
4054 const int space_match_flags = flags & ~match_multiline; // Spaces in dates must never be broken in new line.
+
4055 if ((m_format_mask & date_format_dmy) == date_format_dmy) {
+
4056 if (day->match(text, start, end, flags)) {
+
4057 for (this->interval.end = day->interval.end; m_space->match(text, this->interval.end, end, space_match_flags); this->interval.end = m_space->interval.end);
+
4058 if (m_separator->match(text, this->interval.end, end, flags)) {
+
4059 size_t hit_offset = m_separator->hit_offset;
+
4060 for (this->interval.end = m_separator->interval.end; m_space->match(text, this->interval.end, end, space_match_flags); this->interval.end = m_space->interval.end);
+
4061 if (month->match(text, this->interval.end, end, flags)) {
+
4062 for (this->interval.end = month->interval.end; m_space->match(text, this->interval.end, end, space_match_flags); this->interval.end = m_space->interval.end);
+
4063 if (m_separator->match(text, this->interval.end, end, flags) &&
+
4064 m_separator->hit_offset == hit_offset) // Both separators must match.
+
4065 {
+
4066 for (this->interval.end = m_separator->interval.end; m_space->match(text, this->interval.end, end, space_match_flags); this->interval.end = m_space->interval.end);
+
4067 if (year->match(text, this->interval.end, end, flags) &&
+
4068 is_valid(day->value, month->value))
+
4069 {
+
4070 this->interval.start = start;
+
4071 this->interval.end = year->interval.end;
+
4072 format = date_format_dmy;
+
4073 return true;
+
4074 }
+
4075 }
+
4076 }
+
4077 }
+
4078 }
+
4079 }
+
4080
+
4081 if ((m_format_mask & date_format_mdy) == date_format_mdy) {
+
4082 if (month->match(text, start, end, flags)) {
+
4083 for (this->interval.end = month->interval.end; m_space->match(text, this->interval.end, end, space_match_flags); this->interval.end = m_space->interval.end);
+
4084 if (m_separator->match(text, this->interval.end, end, flags)) {
+
4085 size_t hit_offset = m_separator->hit_offset;
+
4086 for (this->interval.end = m_separator->interval.end; m_space->match(text, this->interval.end, end, space_match_flags); this->interval.end = m_space->interval.end);
+
4087 if (day->match(text, this->interval.end, end, flags)) {
+
4088 for (this->interval.end = day->interval.end; m_space->match(text, this->interval.end, end, space_match_flags); this->interval.end = m_space->interval.end);
+
4089 if (m_separator->match(text, this->interval.end, end, flags) &&
+
4090 m_separator->hit_offset == hit_offset) // Both separators must match.
+
4091 {
+
4092 for (this->interval.end = m_separator->interval.end; m_space->match(text, this->interval.end, end, space_match_flags); this->interval.end = m_space->interval.end);
+
4093 if (year->match(text, this->interval.end, end, flags) &&
+
4094 is_valid(day->value, month->value))
+
4095 {
+
4096 this->interval.start = start;
+
4097 this->interval.end = year->interval.end;
+
4098 format = date_format_mdy;
+
4099 return true;
+
4100 }
+
4101 }
+
4102 }
+
4103 }
+
4104 }
+
4105 }
+
4106
+
4107 if ((m_format_mask & date_format_ymd) == date_format_ymd) {
+
4108 if (year->match(text, start, end, flags)) {
+
4109 for (this->interval.end = year->interval.end; m_space->match(text, this->interval.end, end, space_match_flags); this->interval.end = m_space->interval.end);
+
4110 if (m_separator->match(text, this->interval.end, end, flags)) {
+
4111 size_t hit_offset = m_separator->hit_offset;
+
4112 for (this->interval.end = m_separator->interval.end; m_space->match(text, this->interval.end, end, space_match_flags); this->interval.end = m_space->interval.end);
+
4113 if (month->match(text, this->interval.end, end, flags)) {
+
4114 for (this->interval.end = month->interval.end; m_space->match(text, this->interval.end, end, space_match_flags); this->interval.end = m_space->interval.end);
+
4115 if (m_separator->match(text, this->interval.end, end, flags) &&
+
4116 m_separator->hit_offset == hit_offset) // Both separators must match.
+
4117 {
+
4118 for (this->interval.end = m_separator->interval.end; m_space->match(text, this->interval.end, end, space_match_flags); this->interval.end = m_space->interval.end);
+
4119 if (day->match(text, this->interval.end, end, flags) &&
+
4120 is_valid(day->value, month->value))
+
4121 {
+
4122 this->interval.start = start;
+
4123 this->interval.end = day->interval.end;
+
4124 format = date_format_ymd;
+
4125 return true;
+
4126 }
+
4127 }
+
4128 }
+
4129 }
+
4130 }
+
4131 }
+
4132
+
4133 if ((m_format_mask & date_format_ym) == date_format_ym) {
+
4134 if (year->match(text, start, end, flags)) {
+
4135 for (this->interval.end = year->interval.end; m_space->match(text, this->interval.end, end, space_match_flags); this->interval.end = m_space->interval.end);
+
4136 if (m_separator->match(text, this->interval.end, end, flags)) {
+
4137 for (this->interval.end = m_separator->interval.end; m_space->match(text, this->interval.end, end, space_match_flags); this->interval.end = m_space->interval.end);
+
4138 if (month->match(text, this->interval.end, end, flags) &&
+
4139 is_valid((size_t)-1, month->value))
+
4140 {
+
4141 if (day) day->invalidate();
+
4142 this->interval.start = start;
+
4143 this->interval.end = month->interval.end;
+
4144 format = date_format_ym;
+
4145 return true;
+
4146 }
+
4147 }
+
4148 }
+
4149 }
+
4150
+
4151 if ((m_format_mask & date_format_my) == date_format_my) {
+
4152 if (month->match(text, start, end, flags)) {
+
4153 for (this->interval.end = month->interval.end; m_space->match(text, this->interval.end, end, space_match_flags); this->interval.end = m_space->interval.end);
+
4154 if (m_separator->match(text, this->interval.end, end, flags)) {
+
4155 for (this->interval.end = m_separator->interval.end; m_space->match(text, this->interval.end, end, space_match_flags); this->interval.end = m_space->interval.end);
+
4156 if (year->match(text, this->interval.end, end, flags) &&
+
4157 is_valid((size_t)-1, month->value))
+
4158 {
+
4159 if (day) day->invalidate();
+
4160 this->interval.start = start;
+
4161 this->interval.end = year->interval.end;
+
4162 format = date_format_my;
+
4163 return true;
+
4164 }
+
4165 }
+
4166 }
+
4167 }
+
4168
+
4169 if ((m_format_mask & date_format_dm) == date_format_dm) {
+
4170 if (day->match(text, start, end, flags)) {
+
4171 for (this->interval.end = day->interval.end; m_space->match(text, this->interval.end, end, space_match_flags); this->interval.end = m_space->interval.end);
+
4172 if (m_separator->match(text, this->interval.end, end, flags)) {
+
4173 size_t hit_offset = m_separator->hit_offset;
+
4174 for (this->interval.end = m_separator->interval.end; m_space->match(text, this->interval.end, end, space_match_flags); this->interval.end = m_space->interval.end);
+
4175 if (month->match(text, this->interval.end, end, flags) &&
+
4176 is_valid(day->value, month->value))
+
4177 {
+
4178 if (year) year->invalidate();
+
4179 this->interval.start = start;
+
4180 for (this->interval.end = month->interval.end; m_space->match(text, this->interval.end, end, space_match_flags); this->interval.end = m_space->interval.end);
+
4181 if (m_separator->match(text, this->interval.end, end, flags) &&
+
4182 m_separator->hit_offset == hit_offset) // Both separators must match.
+
4183 this->interval.end = m_separator->interval.end;
+
4184 else
+
4185 this->interval.end = month->interval.end;
+
4186 format = date_format_dm;
+
4187 return true;
+
4188 }
+
4189 }
+
4190 }
+
4191 }
+
4192
+
4193 if ((m_format_mask & date_format_md) == date_format_md) {
+
4194 if (month->match(text, start, end, flags)) {
+
4195 for (this->interval.end = month->interval.end; m_space->match(text, this->interval.end, end, space_match_flags); this->interval.end = m_space->interval.end);
+
4196 if (m_separator->match(text, this->interval.end, end, flags)) {
+
4197 size_t hit_offset = m_separator->hit_offset;
+
4198 for (this->interval.end = m_separator->interval.end; m_space->match(text, this->interval.end, end, space_match_flags); this->interval.end = m_space->interval.end);
+
4199 if (day->match(text, this->interval.end, end, flags) &&
+
4200 is_valid(day->value, month->value))
+
4201 {
+
4202 if (year) year->invalidate();
+
4203 this->interval.start = start;
+
4204 for (this->interval.end = day->interval.end; m_space->match(text, this->interval.end, end, space_match_flags); this->interval.end = m_space->interval.end);
+
4205 if (m_separator->match(text, this->interval.end, end, flags) &&
+
4206 m_separator->hit_offset == hit_offset) // Both separators must match.
+
4207 this->interval.end = m_separator->interval.end;
+
4208 else
+
4209 this->interval.end = day->interval.end;
+
4210 format = date_format_md;
+
4211 return true;
+
4212 }
+
4213 }
+
4214 }
+
4215 }
+
4216
+
4217 if (day) day->invalidate();
+
4218 if (month) month->invalidate();
+
4219 if (year) year->invalidate();
+
4220 format = date_format_none;
+
4221 this->interval.start = (this->interval.end = start) + 1;
+
4222 return false;
+
4223 }
+
4224
+
4225 virtual void invalidate()
+
4226 {
+
4227 if (day) day->invalidate();
+
4228 if (month) month->invalidate();
+
4229 if (year) year->invalidate();
+
4230 format = date_format_none;
+ +
4232 }
+
4233
+
4234 protected:
+
4235 static inline bool is_valid(size_t day, size_t month)
+
4236 {
+
4237 if (month == (size_t)-1) {
+
4238 // Default to January. This allows validating day only, as January has all 31 days.
+
4239 month = 1;
+
4240 }
+
4241 if (day == (size_t)-1) {
+
4242 // Default to 1st day in month. This allows validating month only, as each month has 1st day.
+
4243 day = 1;
+
4244 }
+
4245
+
4246 switch (month) {
+
4247 case 1:
+
4248 case 3:
+
4249 case 5:
+
4250 case 7:
+
4251 case 8:
+
4252 case 10:
+
4253 case 12:
+
4254 return 1 <= day && day <= 31;
+
4255 case 2:
+
4256 return 1 <= day && day <= 29;
+
4257 case 4:
+
4258 case 6:
+
4259 case 9:
+
4260 case 11:
+
4261 return 1 <= day && day <= 30;
+
4262 default:
+
4263 return false;
+
4264 }
+
4265 }
+
4266
+
4267 public:
+
4268 date_format_t format;
+
4269 std::shared_ptr<basic_integer<T>> day;
+
4270 std::shared_ptr<basic_integer<T>> month;
+
4271 std::shared_ptr<basic_integer<T>> year;
+
4272
+
4273 protected:
+
4274 int m_format_mask;
+
4275 std::shared_ptr<basic_set<T>> m_separator;
+
4276 std::shared_ptr<basic_parser<T>> m_space;
+
4277 };
-
4277
-
4278 using date = basic_date<char>;
-
4279 using wdate = basic_date<wchar_t>;
-
4280#ifdef _UNICODE
-
4281 using tdate = wdate;
-
4282#else
-
4283 using tdate = date;
-
4284#endif
- -
4286
-
4290 template <class T>
-
-
4291 class basic_time : public basic_parser<T>
-
4292 {
-
4293 public:
-
4294 basic_time(
-
4295 _In_ const std::shared_ptr<basic_integer10<T>>& _hour,
-
4296 _In_ const std::shared_ptr<basic_integer10<T>>& _minute,
-
4297 _In_ const std::shared_ptr<basic_integer10<T>>& _second,
-
4298 _In_ const std::shared_ptr<basic_integer10<T>>& _millisecond,
-
4299 _In_ const std::shared_ptr<basic_set<T>>& separator,
-
4300 _In_ const std::shared_ptr<basic_parser<T>>& millisecond_separator,
-
4301 _In_ const std::locale& locale = std::locale()) :
-
4302 basic_parser<T>(locale),
-
4303 hour(_hour),
-
4304 minute(_minute),
-
4305 second(_second),
-
4306 millisecond(_millisecond),
-
4307 m_separator(separator),
-
4308 m_millisecond_separator(millisecond_separator)
-
4309 {}
-
4310
-
4311 virtual bool match(
-
4312 _In_reads_or_z_(end) const T* text,
-
4313 _In_ size_t start = 0,
-
4314 _In_ size_t end = (size_t)-1,
-
4315 _In_ int flags = match_default)
-
4316 {
-
4317 assert(text || start >= end);
-
4318
-
4319 if (hour->match(text, start, end, flags) &&
-
4320 m_separator->match(text, hour->interval.end, end, flags) &&
-
4321 minute->match(text, m_separator->interval.end, end, flags) &&
-
4322 minute->value < 60)
-
4323 {
-
4324 // hh::mm
-
4325 size_t hit_offset = m_separator->hit_offset;
-
4326 if (m_separator->match(text, minute->interval.end, end, flags) &&
-
4327 m_separator->hit_offset == hit_offset && // Both separators must match.
-
4328 second && second->match(text, m_separator->interval.end, end, flags) &&
-
4329 second->value < 60)
-
4330 {
-
4331 // hh::mm:ss
-
4332 if (m_millisecond_separator && m_millisecond_separator->match(text, second->interval.end, end, flags) &&
-
4333 millisecond && millisecond->match(text, m_millisecond_separator->interval.end, end, flags) &&
-
4334 millisecond->value < 1000)
-
4335 {
-
4336 // hh::mm:ss.mmmm
-
4337 this->interval.end = millisecond->interval.end;
-
4338 }
-
4339 else {
-
4340 if (millisecond) millisecond->invalidate();
-
4341 this->interval.end = second->interval.end;
-
4342 }
-
4343 }
-
4344 else {
-
4345 if (second) second->invalidate();
-
4346 if (millisecond) millisecond->invalidate();
-
4347 this->interval.end = minute->interval.end;
-
4348 }
-
4349 this->interval.start = start;
-
4350 return true;
-
4351 }
-
4352
-
4353 hour->invalidate();
-
4354 minute->invalidate();
-
4355 if (second) second->invalidate();
-
4356 if (millisecond) millisecond->invalidate();
-
4357 this->interval.start = (this->interval.end = start) + 1;
-
4358 return false;
-
4359 }
-
4360
-
4361 virtual void invalidate()
-
4362 {
-
4363 hour->invalidate();
-
4364 minute->invalidate();
-
4365 if (second) second->invalidate();
-
4366 if (millisecond) millisecond->invalidate();
- -
4368 }
-
4369
-
4370 public:
-
4371 std::shared_ptr<basic_integer10<T>> hour;
-
4372 std::shared_ptr<basic_integer10<T>> minute;
-
4373 std::shared_ptr<basic_integer10<T>> second;
-
4374 std::shared_ptr<basic_integer10<T>> millisecond;
-
4375
-
4376 protected:
-
4377 std::shared_ptr<basic_set<T>> m_separator;
-
4378 std::shared_ptr<basic_parser<T>> m_millisecond_separator;
-
4379 };
+
4278
+
4279 using date = basic_date<char>;
+
4280 using wdate = basic_date<wchar_t>;
+
4281#ifdef _UNICODE
+
4282 using tdate = wdate;
+
4283#else
+
4284 using tdate = date;
+
4285#endif
+ +
4287
+
4291 template <class T>
+
+
4292 class basic_time : public basic_parser<T>
+
4293 {
+
4294 public:
+
4295 basic_time(
+
4296 _In_ const std::shared_ptr<basic_integer10<T>>& _hour,
+
4297 _In_ const std::shared_ptr<basic_integer10<T>>& _minute,
+
4298 _In_ const std::shared_ptr<basic_integer10<T>>& _second,
+
4299 _In_ const std::shared_ptr<basic_integer10<T>>& _millisecond,
+
4300 _In_ const std::shared_ptr<basic_set<T>>& separator,
+
4301 _In_ const std::shared_ptr<basic_parser<T>>& millisecond_separator,
+
4302 _In_ const std::locale& locale = std::locale()) :
+
4303 basic_parser<T>(locale),
+
4304 hour(_hour),
+
4305 minute(_minute),
+
4306 second(_second),
+
4307 millisecond(_millisecond),
+
4308 m_separator(separator),
+
4309 m_millisecond_separator(millisecond_separator)
+
4310 {}
+
4311
+
4312 virtual bool match(
+
4313 _In_reads_or_z_(end) const T* text,
+
4314 _In_ size_t start = 0,
+
4315 _In_ size_t end = (size_t)-1,
+
4316 _In_ int flags = match_default)
+
4317 {
+
4318 assert(text || start >= end);
+
4319
+
4320 if (hour->match(text, start, end, flags) &&
+
4321 m_separator->match(text, hour->interval.end, end, flags) &&
+
4322 minute->match(text, m_separator->interval.end, end, flags) &&
+
4323 minute->value < 60)
+
4324 {
+
4325 // hh::mm
+
4326 size_t hit_offset = m_separator->hit_offset;
+
4327 if (m_separator->match(text, minute->interval.end, end, flags) &&
+
4328 m_separator->hit_offset == hit_offset && // Both separators must match.
+
4329 second && second->match(text, m_separator->interval.end, end, flags) &&
+
4330 second->value < 60)
+
4331 {
+
4332 // hh::mm:ss
+
4333 if (m_millisecond_separator && m_millisecond_separator->match(text, second->interval.end, end, flags) &&
+
4334 millisecond && millisecond->match(text, m_millisecond_separator->interval.end, end, flags) &&
+
4335 millisecond->value < 1000)
+
4336 {
+
4337 // hh::mm:ss.mmmm
+
4338 this->interval.end = millisecond->interval.end;
+
4339 }
+
4340 else {
+
4341 if (millisecond) millisecond->invalidate();
+
4342 this->interval.end = second->interval.end;
+
4343 }
+
4344 }
+
4345 else {
+
4346 if (second) second->invalidate();
+
4347 if (millisecond) millisecond->invalidate();
+
4348 this->interval.end = minute->interval.end;
+
4349 }
+
4350 this->interval.start = start;
+
4351 return true;
+
4352 }
+
4353
+
4354 hour->invalidate();
+
4355 minute->invalidate();
+
4356 if (second) second->invalidate();
+
4357 if (millisecond) millisecond->invalidate();
+
4358 this->interval.start = (this->interval.end = start) + 1;
+
4359 return false;
+
4360 }
+
4361
+
4362 virtual void invalidate()
+
4363 {
+
4364 hour->invalidate();
+
4365 minute->invalidate();
+
4366 if (second) second->invalidate();
+
4367 if (millisecond) millisecond->invalidate();
+ +
4369 }
+
4370
+
4371 public:
+
4372 std::shared_ptr<basic_integer10<T>> hour;
+
4373 std::shared_ptr<basic_integer10<T>> minute;
+
4374 std::shared_ptr<basic_integer10<T>> second;
+
4375 std::shared_ptr<basic_integer10<T>> millisecond;
+
4376
+
4377 protected:
+
4378 std::shared_ptr<basic_set<T>> m_separator;
+
4379 std::shared_ptr<basic_parser<T>> m_millisecond_separator;
+
4380 };
-
4380
-
4381 using time = basic_time<char>;
-
4382 using wtime = basic_time<wchar_t>;
-
4383#ifdef _UNICODE
-
4384 using ttime = wtime;
-
4385#else
-
4386 using ttime = time;
-
4387#endif
- -
4389
-
4393 template <class T>
-
-
4394 class basic_angle : public basic_parser<T>
-
4395 {
-
4396 public:
- -
4398 _In_ const std::shared_ptr<basic_integer10<T>>& _degree,
-
4399 _In_ const std::shared_ptr<basic_parser<T>>& _degree_separator,
-
4400 _In_ const std::shared_ptr<basic_integer10<T>>& _minute,
-
4401 _In_ const std::shared_ptr<basic_parser<T>>& _minute_separator,
-
4402 _In_ const std::shared_ptr<basic_integer10<T>>& _second,
-
4403 _In_ const std::shared_ptr<basic_parser<T>>& _second_separator,
-
4404 _In_ const std::shared_ptr<basic_parser<T>>& _decimal,
-
4405 _In_ const std::locale& locale = std::locale()) :
-
4406 basic_parser<T>(locale),
-
4407 degree(_degree),
-
4408 degree_separator(_degree_separator),
-
4409 minute(_minute),
-
4410 minute_separator(_minute_separator),
-
4411 second(_second),
-
4412 second_separator(_second_separator),
-
4413 decimal(_decimal)
-
4414 {}
-
4415
-
4416 virtual bool match(
-
4417 _In_reads_or_z_(end) const T* text,
-
4418 _In_ size_t start = 0,
-
4419 _In_ size_t end = (size_t)-1,
-
4420 _In_ int flags = match_default)
-
4421 {
-
4422 assert(text || start >= end);
-
4423
-
4424 this->interval.end = start;
-
4425
-
4426 if (degree->match(text, this->interval.end, end, flags) &&
-
4427 degree_separator->match(text, degree->interval.end, end, flags))
-
4428 {
-
4429 // Degrees
-
4430 this->interval.end = degree_separator->interval.end;
-
4431 }
-
4432 else {
-
4433 degree->invalidate();
-
4434 degree_separator->invalidate();
-
4435 }
-
4436
-
4437 if (minute->match(text, this->interval.end, end, flags) &&
-
4438 minute->value < 60 &&
-
4439 minute_separator->match(text, minute->interval.end, end, flags))
-
4440 {
-
4441 // Minutes
-
4442 this->interval.end = minute_separator->interval.end;
-
4443 }
-
4444 else {
-
4445 minute->invalidate();
-
4446 minute_separator->invalidate();
-
4447 }
-
4448
-
4449 if (second && second->match(text, this->interval.end, end, flags) &&
-
4450 second->value < 60)
-
4451 {
-
4452 // Seconds
-
4453 this->interval.end = second->interval.end;
-
4454 if (second_separator && second_separator->match(text, this->interval.end, end, flags))
-
4455 this->interval.end = second_separator->interval.end;
-
4456 else
-
4457 if (second_separator) second_separator->invalidate();
-
4458 }
-
4459 else {
-
4460 if (second) second->invalidate();
-
4461 if (second_separator) second_separator->invalidate();
-
4462 }
-
4463
-
4464 if (degree->interval.start < degree->interval.end ||
-
4465 minute->interval.start < minute->interval.end ||
-
4466 (second && second->interval.start < second->interval.end))
-
4467 {
-
4468 if (decimal && decimal->match(text, this->interval.end, end, flags)) {
-
4469 // Decimals
-
4470 this->interval.end = decimal->interval.end;
-
4471 }
-
4472 else if (decimal)
-
4473 decimal->invalidate();
-
4474 this->interval.start = start;
-
4475 return true;
-
4476 }
-
4477 if (decimal) decimal->invalidate();
-
4478 this->interval.start = (this->interval.end = start) + 1;
-
4479 return false;
-
4480 }
-
4481
-
4482 virtual void invalidate()
-
4483 {
-
4484 degree->invalidate();
-
4485 degree_separator->invalidate();
-
4486 minute->invalidate();
-
4487 minute_separator->invalidate();
-
4488 if (second) second->invalidate();
-
4489 if (second_separator) second_separator->invalidate();
-
4490 if (decimal) decimal->invalidate();
- -
4492 }
-
4493
-
4494 public:
-
4495 std::shared_ptr<basic_integer10<T>> degree;
-
4496 std::shared_ptr<basic_parser<T>> degree_separator;
-
4497 std::shared_ptr<basic_integer10<T>> minute;
-
4498 std::shared_ptr<basic_parser<T>> minute_separator;
-
4499 std::shared_ptr<basic_integer10<T>> second;
-
4500 std::shared_ptr<basic_parser<T>> second_separator;
-
4501 std::shared_ptr<basic_parser<T>> decimal;
-
4502 };
+
4381
+
4382 using time = basic_time<char>;
+
4383 using wtime = basic_time<wchar_t>;
+
4384#ifdef _UNICODE
+
4385 using ttime = wtime;
+
4386#else
+
4387 using ttime = time;
+
4388#endif
+ +
4390
+
4394 template <class T>
+
+
4395 class basic_angle : public basic_parser<T>
+
4396 {
+
4397 public:
+ +
4399 _In_ const std::shared_ptr<basic_integer10<T>>& _degree,
+
4400 _In_ const std::shared_ptr<basic_parser<T>>& _degree_separator,
+
4401 _In_ const std::shared_ptr<basic_integer10<T>>& _minute,
+
4402 _In_ const std::shared_ptr<basic_parser<T>>& _minute_separator,
+
4403 _In_ const std::shared_ptr<basic_integer10<T>>& _second,
+
4404 _In_ const std::shared_ptr<basic_parser<T>>& _second_separator,
+
4405 _In_ const std::shared_ptr<basic_parser<T>>& _decimal,
+
4406 _In_ const std::locale& locale = std::locale()) :
+
4407 basic_parser<T>(locale),
+
4408 degree(_degree),
+
4409 degree_separator(_degree_separator),
+
4410 minute(_minute),
+
4411 minute_separator(_minute_separator),
+
4412 second(_second),
+
4413 second_separator(_second_separator),
+
4414 decimal(_decimal)
+
4415 {}
+
4416
+
4417 virtual bool match(
+
4418 _In_reads_or_z_(end) const T* text,
+
4419 _In_ size_t start = 0,
+
4420 _In_ size_t end = (size_t)-1,
+
4421 _In_ int flags = match_default)
+
4422 {
+
4423 assert(text || start >= end);
+
4424
+
4425 this->interval.end = start;
+
4426
+
4427 if (degree->match(text, this->interval.end, end, flags) &&
+
4428 degree_separator->match(text, degree->interval.end, end, flags))
+
4429 {
+
4430 // Degrees
+
4431 this->interval.end = degree_separator->interval.end;
+
4432 }
+
4433 else {
+
4434 degree->invalidate();
+
4435 degree_separator->invalidate();
+
4436 }
+
4437
+
4438 if (minute->match(text, this->interval.end, end, flags) &&
+
4439 minute->value < 60 &&
+
4440 minute_separator->match(text, minute->interval.end, end, flags))
+
4441 {
+
4442 // Minutes
+
4443 this->interval.end = minute_separator->interval.end;
+
4444 }
+
4445 else {
+
4446 minute->invalidate();
+
4447 minute_separator->invalidate();
+
4448 }
+
4449
+
4450 if (second && second->match(text, this->interval.end, end, flags) &&
+
4451 second->value < 60)
+
4452 {
+
4453 // Seconds
+
4454 this->interval.end = second->interval.end;
+
4455 if (second_separator && second_separator->match(text, this->interval.end, end, flags))
+
4456 this->interval.end = second_separator->interval.end;
+
4457 else
+
4458 if (second_separator) second_separator->invalidate();
+
4459 }
+
4460 else {
+
4461 if (second) second->invalidate();
+
4462 if (second_separator) second_separator->invalidate();
+
4463 }
+
4464
+
4465 if (degree->interval.start < degree->interval.end ||
+
4466 minute->interval.start < minute->interval.end ||
+
4467 (second && second->interval.start < second->interval.end))
+
4468 {
+
4469 if (decimal && decimal->match(text, this->interval.end, end, flags)) {
+
4470 // Decimals
+
4471 this->interval.end = decimal->interval.end;
+
4472 }
+
4473 else if (decimal)
+
4474 decimal->invalidate();
+
4475 this->interval.start = start;
+
4476 return true;
+
4477 }
+
4478 if (decimal) decimal->invalidate();
+
4479 this->interval.start = (this->interval.end = start) + 1;
+
4480 return false;
+
4481 }
+
4482
+
4483 virtual void invalidate()
+
4484 {
+
4485 degree->invalidate();
+
4486 degree_separator->invalidate();
+
4487 minute->invalidate();
+
4488 minute_separator->invalidate();
+
4489 if (second) second->invalidate();
+
4490 if (second_separator) second_separator->invalidate();
+
4491 if (decimal) decimal->invalidate();
+ +
4493 }
+
4494
+
4495 public:
+
4496 std::shared_ptr<basic_integer10<T>> degree;
+
4497 std::shared_ptr<basic_parser<T>> degree_separator;
+
4498 std::shared_ptr<basic_integer10<T>> minute;
+
4499 std::shared_ptr<basic_parser<T>> minute_separator;
+
4500 std::shared_ptr<basic_integer10<T>> second;
+
4501 std::shared_ptr<basic_parser<T>> second_separator;
+
4502 std::shared_ptr<basic_parser<T>> decimal;
+
4503 };
-
4503
-
4504 using angle = basic_angle<char>;
- -
4506#ifdef _UNICODE
-
4507 using RRegElKot = wangle;
-
4508#else
-
4509 using RRegElKot = angle;
-
4510#endif
- -
4512
-
4516 template <class T>
-
- -
4518 {
-
4519 public:
- -
4521 _In_ const std::shared_ptr<basic_parser<T>>& digit,
-
4522 _In_ const std::shared_ptr<basic_parser<T>>& plus_sign,
-
4523 _In_ const std::shared_ptr<basic_set<T>>& lparenthesis,
-
4524 _In_ const std::shared_ptr<basic_set<T>>& rparenthesis,
-
4525 _In_ const std::shared_ptr<basic_parser<T>>& separator,
-
4526 _In_ const std::shared_ptr<basic_parser<T>>& space,
-
4527 _In_ const std::locale& locale = std::locale()) :
-
4528 basic_parser<T>(locale),
-
4529 m_digit(digit),
-
4530 m_plus_sign(plus_sign),
-
4531 m_lparenthesis(lparenthesis),
-
4532 m_rparenthesis(rparenthesis),
-
4533 m_separator(separator),
-
4534 m_space(space)
-
4535 {}
-
4536
-
4537 virtual bool match(
-
4538 _In_reads_or_z_(end) const T* text,
-
4539 _In_ size_t start = 0,
-
4540 _In_ size_t end = (size_t)-1,
-
4541 _In_ int flags = match_default)
-
4542 {
-
4543 assert(text || start >= end);
-
4544
-
4545 size_t safe_digit_end = start, safe_value_size = 0;
-
4546 bool has_digits = false, after_digit = false, in_parentheses = false, after_parentheses = false;
-
4547 const int space_match_flags = flags & ~match_multiline; // Spaces in phone numbers must never be broken in new line.
-
4548
-
4549 this->interval.end = start;
-
4550 value.clear();
-
4551 m_lparenthesis->invalidate();
-
4552 m_rparenthesis->invalidate();
-
4553
-
4554 if (m_plus_sign && m_plus_sign->match(text, this->interval.end, end, flags)) {
-
4555 value.append(text + m_plus_sign->interval.start, text + m_plus_sign->interval.end);
-
4556 safe_value_size = value.size();
-
4557 this->interval.end = m_plus_sign->interval.end;
-
4558 }
-
4559
-
4560 for (;;) {
-
4561 assert(text || this->interval.end >= end);
-
4562 if (this->interval.end >= end || !text[this->interval.end])
-
4563 break;
-
4564 if (m_digit->match(text, this->interval.end, end, flags)) {
-
4565 // Digit
-
4566 value.append(text + m_digit->interval.start, text + m_digit->interval.end);
-
4567 this->interval.end = m_digit->interval.end;
-
4568 if (!in_parentheses) {
-
4569 safe_digit_end = this->interval.end;
-
4570 safe_value_size = value.size();
-
4571 has_digits = true;
-
4572 }
-
4573 after_digit = true;
-
4574 after_parentheses = false;
-
4575 }
-
4576 else if (
-
4577 m_lparenthesis && !m_lparenthesis->interval && // No left parenthesis yet
-
4578 m_rparenthesis && !m_rparenthesis->interval && // Right parenthesis after left
-
4579 m_lparenthesis->match(text, this->interval.end, end, flags))
-
4580 {
-
4581 // Left parenthesis
-
4582 value.append(text + m_lparenthesis->interval.start, m_lparenthesis->interval.size());
-
4583 this->interval.end = m_lparenthesis->interval.end;
-
4584 in_parentheses = true;
-
4585 after_digit = false;
-
4586 after_parentheses = false;
-
4587 }
-
4588 else if (
-
4589 in_parentheses && // After left parenthesis
-
4590 m_rparenthesis && !m_rparenthesis->interval && // No right parenthesis yet
-
4591 m_rparenthesis->match(text, this->interval.end, end, flags) &&
-
4592 m_lparenthesis->hit_offset == m_rparenthesis->hit_offset) // Left and right parentheses must match
-
4593 {
-
4594 // Right parenthesis
-
4595 value.append(text + m_rparenthesis->interval.start, text + m_rparenthesis->interval.end);
-
4596 this->interval.end = m_rparenthesis->interval.end;
-
4597 safe_digit_end = this->interval.end;
-
4598 safe_value_size = value.size();
-
4599 in_parentheses = false;
-
4600 after_digit = false;
-
4601 after_parentheses = true;
-
4602 }
-
4603 else if (
-
4604 after_digit &&
-
4605 !in_parentheses && // No separators inside parentheses
-
4606 !after_parentheses && // No separators following right parenthesis
-
4607 m_separator && m_separator->match(text, this->interval.end, end, flags))
-
4608 {
-
4609 // Separator
-
4610 this->interval.end = m_separator->interval.end;
-
4611 after_digit = false;
-
4612 after_parentheses = false;
-
4613 }
-
4614 else if (
- -
4616 m_space && m_space->match(text, this->interval.end, end, space_match_flags))
-
4617 {
-
4618 // Space
-
4619 this->interval.end = m_space->interval.end;
-
4620 after_digit = false;
-
4621 after_parentheses = false;
-
4622 }
-
4623 else
-
4624 break;
-
4625 }
-
4626 if (has_digits) {
-
4627 value.erase(safe_value_size);
-
4628 this->interval.start = start;
-
4629 this->interval.end = safe_digit_end;
-
4630 return true;
-
4631 }
-
4632 value.clear();
-
4633 this->interval.start = (this->interval.end = start) + 1;
-
4634 return false;
-
4635 }
-
4636
-
4637 virtual void invalidate()
-
4638 {
-
4639 value.clear();
- -
4641 }
-
4642
-
4643 public:
-
4644 std::basic_string<T> value;
-
4645
-
4646 protected:
-
4647 std::shared_ptr<basic_parser<T>> m_digit;
-
4648 std::shared_ptr<basic_parser<T>> m_plus_sign;
-
4649 std::shared_ptr<basic_set<T>> m_lparenthesis;
-
4650 std::shared_ptr<basic_set<T>> m_rparenthesis;
-
4651 std::shared_ptr<basic_parser<T>> m_separator;
-
4652 std::shared_ptr<basic_parser<T>> m_space;
-
4653 };
+
4504
+
4505 using angle = basic_angle<char>;
+ +
4507#ifdef _UNICODE
+
4508 using RRegElKot = wangle;
+
4509#else
+
4510 using RRegElKot = angle;
+
4511#endif
+ +
4513
+
4517 template <class T>
+
+ +
4519 {
+
4520 public:
+ +
4522 _In_ const std::shared_ptr<basic_parser<T>>& digit,
+
4523 _In_ const std::shared_ptr<basic_parser<T>>& plus_sign,
+
4524 _In_ const std::shared_ptr<basic_set<T>>& lparenthesis,
+
4525 _In_ const std::shared_ptr<basic_set<T>>& rparenthesis,
+
4526 _In_ const std::shared_ptr<basic_parser<T>>& separator,
+
4527 _In_ const std::shared_ptr<basic_parser<T>>& space,
+
4528 _In_ const std::locale& locale = std::locale()) :
+
4529 basic_parser<T>(locale),
+
4530 m_digit(digit),
+
4531 m_plus_sign(plus_sign),
+
4532 m_lparenthesis(lparenthesis),
+
4533 m_rparenthesis(rparenthesis),
+
4534 m_separator(separator),
+
4535 m_space(space)
+
4536 {}
+
4537
+
4538 virtual bool match(
+
4539 _In_reads_or_z_(end) const T* text,
+
4540 _In_ size_t start = 0,
+
4541 _In_ size_t end = (size_t)-1,
+
4542 _In_ int flags = match_default)
+
4543 {
+
4544 assert(text || start >= end);
+
4545
+
4546 size_t safe_digit_end = start, safe_value_size = 0;
+
4547 bool has_digits = false, after_digit = false, in_parentheses = false, after_parentheses = false;
+
4548 const int space_match_flags = flags & ~match_multiline; // Spaces in phone numbers must never be broken in new line.
+
4549
+
4550 this->interval.end = start;
+
4551 value.clear();
+
4552 m_lparenthesis->invalidate();
+
4553 m_rparenthesis->invalidate();
+
4554
+
4555 if (m_plus_sign && m_plus_sign->match(text, this->interval.end, end, flags)) {
+
4556 value.append(text + m_plus_sign->interval.start, text + m_plus_sign->interval.end);
+
4557 safe_value_size = value.size();
+
4558 this->interval.end = m_plus_sign->interval.end;
+
4559 }
+
4560
+
4561 for (;;) {
+
4562 assert(text || this->interval.end >= end);
+
4563 if (this->interval.end >= end || !text[this->interval.end])
+
4564 break;
+
4565 if (m_digit->match(text, this->interval.end, end, flags)) {
+
4566 // Digit
+
4567 value.append(text + m_digit->interval.start, text + m_digit->interval.end);
+
4568 this->interval.end = m_digit->interval.end;
+
4569 if (!in_parentheses) {
+
4570 safe_digit_end = this->interval.end;
+
4571 safe_value_size = value.size();
+
4572 has_digits = true;
+
4573 }
+
4574 after_digit = true;
+
4575 after_parentheses = false;
+
4576 }
+
4577 else if (
+
4578 m_lparenthesis && !m_lparenthesis->interval && // No left parenthesis yet
+
4579 m_rparenthesis && !m_rparenthesis->interval && // Right parenthesis after left
+
4580 m_lparenthesis->match(text, this->interval.end, end, flags))
+
4581 {
+
4582 // Left parenthesis
+
4583 value.append(text + m_lparenthesis->interval.start, m_lparenthesis->interval.size());
+
4584 this->interval.end = m_lparenthesis->interval.end;
+
4585 in_parentheses = true;
+
4586 after_digit = false;
+
4587 after_parentheses = false;
+
4588 }
+
4589 else if (
+
4590 in_parentheses && // After left parenthesis
+
4591 m_rparenthesis && !m_rparenthesis->interval && // No right parenthesis yet
+
4592 m_rparenthesis->match(text, this->interval.end, end, flags) &&
+
4593 m_lparenthesis->hit_offset == m_rparenthesis->hit_offset) // Left and right parentheses must match
+
4594 {
+
4595 // Right parenthesis
+
4596 value.append(text + m_rparenthesis->interval.start, text + m_rparenthesis->interval.end);
+
4597 this->interval.end = m_rparenthesis->interval.end;
+
4598 safe_digit_end = this->interval.end;
+
4599 safe_value_size = value.size();
+
4600 in_parentheses = false;
+
4601 after_digit = false;
+
4602 after_parentheses = true;
+
4603 }
+
4604 else if (
+
4605 after_digit &&
+
4606 !in_parentheses && // No separators inside parentheses
+
4607 !after_parentheses && // No separators following right parenthesis
+
4608 m_separator && m_separator->match(text, this->interval.end, end, flags))
+
4609 {
+
4610 // Separator
+
4611 this->interval.end = m_separator->interval.end;
+
4612 after_digit = false;
+
4613 after_parentheses = false;
+
4614 }
+
4615 else if (
+ +
4617 m_space && m_space->match(text, this->interval.end, end, space_match_flags))
+
4618 {
+
4619 // Space
+
4620 this->interval.end = m_space->interval.end;
+
4621 after_digit = false;
+
4622 after_parentheses = false;
+
4623 }
+
4624 else
+
4625 break;
+
4626 }
+
4627 if (has_digits) {
+
4628 value.erase(safe_value_size);
+
4629 this->interval.start = start;
+
4630 this->interval.end = safe_digit_end;
+
4631 return true;
+
4632 }
+
4633 value.clear();
+
4634 this->interval.start = (this->interval.end = start) + 1;
+
4635 return false;
+
4636 }
+
4637
+
4638 virtual void invalidate()
+
4639 {
+
4640 value.clear();
+ +
4642 }
+
4643
+
4644 public:
+
4645 std::basic_string<T> value;
+
4646
+
4647 protected:
+
4648 std::shared_ptr<basic_parser<T>> m_digit;
+
4649 std::shared_ptr<basic_parser<T>> m_plus_sign;
+
4650 std::shared_ptr<basic_set<T>> m_lparenthesis;
+
4651 std::shared_ptr<basic_set<T>> m_rparenthesis;
+
4652 std::shared_ptr<basic_parser<T>> m_separator;
+
4653 std::shared_ptr<basic_parser<T>> m_space;
+
4654 };
-
4654
- - -
4657#ifdef _UNICODE
- -
4659#else
- -
4661#endif
- -
4663
-
4667 template <class T>
-
- -
4669 {
-
4670 public:
- -
4672 _In_ const std::shared_ptr<basic_parser<T>>& element,
-
4673 _In_ const std::shared_ptr<basic_parser<T>>& digit,
-
4674 _In_ const std::shared_ptr<basic_parser<T>>& sign,
-
4675 _In_ const std::locale& locale = std::locale()) :
-
4676 basic_parser<T>(locale),
-
4677 m_element(element),
-
4678 m_digit(digit),
-
4679 m_sign(sign),
-
4680 has_digits(false),
-
4681 has_charge(false)
-
4682 {}
-
4683
-
4684 virtual bool match(
-
4685 _In_reads_or_z_(end) const T* text,
-
4686 _In_ size_t start = 0,
-
4687 _In_ size_t end = (size_t)-1,
-
4688 _In_ int flags = match_default)
-
4689 {
-
4690 assert(text || start >= end);
-
4691
-
4692 has_digits = false;
-
4693 has_charge = false;
-
4694 this->interval.end = start;
-
4695
-
4696 const int element_match_flags = flags & ~match_case_insensitive; // Chemical elements are always case-sensitive.
-
4697 for (;;) {
-
4698 if (m_element->match(text, this->interval.end, end, element_match_flags)) {
-
4699 this->interval.end = m_element->interval.end;
-
4700 while (m_digit->match(text, this->interval.end, end, flags)) {
-
4701 this->interval.end = m_digit->interval.end;
-
4702 has_digits = true;
-
4703 }
-
4704 }
-
4705 else if (start < this->interval.end) {
-
4706 if (m_sign->match(text, this->interval.end, end, flags)) {
-
4707 this->interval.end = m_sign->interval.end;
-
4708 has_charge = true;
-
4709 }
-
4710 this->interval.start = start;
-
4711 return true;
-
4712 }
-
4713 else {
-
4714 this->interval.start = (this->interval.end = start) + 1;
-
4715 return false;
-
4716 }
-
4717 }
-
4718 }
-
4719
-
4720 virtual void invalidate()
-
4721 {
-
4722 has_digits = false;
-
4723 has_charge = false;
- -
4725 }
-
4726
-
4727 public:
-
4728 bool has_digits;
-
4729 bool has_charge;
-
4730
-
4731 protected:
-
4732 std::shared_ptr<basic_parser<T>> m_element;
-
4733 std::shared_ptr<basic_parser<T>> m_digit;
-
4734 std::shared_ptr<basic_parser<T>> m_sign;
-
4735 };
+
4655
+ + +
4658#ifdef _UNICODE
+ +
4660#else
+ +
4662#endif
+ +
4664
+
4668 template <class T>
+
+ +
4670 {
+
4671 public:
+ +
4673 _In_ const std::shared_ptr<basic_parser<T>>& element,
+
4674 _In_ const std::shared_ptr<basic_parser<T>>& digit,
+
4675 _In_ const std::shared_ptr<basic_parser<T>>& sign,
+
4676 _In_ const std::locale& locale = std::locale()) :
+
4677 basic_parser<T>(locale),
+
4678 m_element(element),
+
4679 m_digit(digit),
+
4680 m_sign(sign),
+
4681 has_digits(false),
+
4682 has_charge(false)
+
4683 {}
+
4684
+
4685 virtual bool match(
+
4686 _In_reads_or_z_(end) const T* text,
+
4687 _In_ size_t start = 0,
+
4688 _In_ size_t end = (size_t)-1,
+
4689 _In_ int flags = match_default)
+
4690 {
+
4691 assert(text || start >= end);
+
4692
+
4693 has_digits = false;
+
4694 has_charge = false;
+
4695 this->interval.end = start;
+
4696
+
4697 const int element_match_flags = flags & ~match_case_insensitive; // Chemical elements are always case-sensitive.
+
4698 for (;;) {
+
4699 if (m_element->match(text, this->interval.end, end, element_match_flags)) {
+
4700 this->interval.end = m_element->interval.end;
+
4701 while (m_digit->match(text, this->interval.end, end, flags)) {
+
4702 this->interval.end = m_digit->interval.end;
+
4703 has_digits = true;
+
4704 }
+
4705 }
+
4706 else if (start < this->interval.end) {
+
4707 if (m_sign->match(text, this->interval.end, end, flags)) {
+
4708 this->interval.end = m_sign->interval.end;
+
4709 has_charge = true;
+
4710 }
+
4711 this->interval.start = start;
+
4712 return true;
+
4713 }
+
4714 else {
+
4715 this->interval.start = (this->interval.end = start) + 1;
+
4716 return false;
+
4717 }
+
4718 }
+
4719 }
+
4720
+
4721 virtual void invalidate()
+
4722 {
+
4723 has_digits = false;
+
4724 has_charge = false;
+ +
4726 }
+
4727
+
4728 public:
+
4729 bool has_digits;
+
4730 bool has_charge;
+
4731
+
4732 protected:
+
4733 std::shared_ptr<basic_parser<T>> m_element;
+
4734 std::shared_ptr<basic_parser<T>> m_digit;
+
4735 std::shared_ptr<basic_parser<T>> m_sign;
+
4736 };
-
4736
- - -
4739#ifdef _UNICODE
- -
4741#else
- -
4743#endif
- -
4745
-
- -
4750 {
-
4751 public:
-
4752 virtual bool match(
-
4753 _In_reads_or_z_(end) const char* text,
-
4754 _In_ size_t start = 0,
-
4755 _In_ size_t end = (size_t)-1,
-
4756 _In_ int flags = match_default)
-
4757 {
-
4758 assert(text || start >= end);
-
4759 this->interval.end = start;
-
4760
-
4761 assert(text || this->interval.end >= end);
-
4762 if (this->interval.end < end && text[this->interval.end]) {
-
4763 if (text[this->interval.end] == '\r') {
-
4764 this->interval.end++;
-
4765 if (this->interval.end < end && text[this->interval.end] == '\n') {
-
4766 this->interval.start = start;
-
4767 this->interval.end++;
-
4768 return true;
-
4769 }
-
4770 }
-
4771 else if (text[this->interval.end] == '\n') {
-
4772 this->interval.start = start;
-
4773 this->interval.end++;
-
4774 return true;
-
4775 }
-
4776 }
-
4777 this->interval.start = (this->interval.end = start) + 1;
-
4778 return false;
-
4779 }
-
4780 };
+
4737
+ + +
4740#ifdef _UNICODE
+ +
4742#else
+ +
4744#endif
+ +
4746
+
+ +
4751 {
+
4752 public:
+
4753 virtual bool match(
+
4754 _In_reads_or_z_(end) const char* text,
+
4755 _In_ size_t start = 0,
+
4756 _In_ size_t end = (size_t)-1,
+
4757 _In_ int flags = match_default)
+
4758 {
+
4759 assert(text || start >= end);
+
4760 this->interval.end = start;
+
4761
+
4762 assert(text || this->interval.end >= end);
+
4763 if (this->interval.end < end && text[this->interval.end]) {
+
4764 if (text[this->interval.end] == '\r') {
+
4765 this->interval.end++;
+
4766 if (this->interval.end < end && text[this->interval.end] == '\n') {
+
4767 this->interval.start = start;
+
4768 this->interval.end++;
+
4769 return true;
+
4770 }
+
4771 }
+
4772 else if (text[this->interval.end] == '\n') {
+
4773 this->interval.start = start;
+
4774 this->interval.end++;
+
4775 return true;
+
4776 }
+
4777 }
+
4778 this->interval.start = (this->interval.end = start) + 1;
+
4779 return false;
+
4780 }
+
4781 };
-
4781
-
-
4785 class http_space : public parser
-
4786 {
-
4787 public:
-
4788 virtual bool match(
-
4789 _In_reads_or_z_(end) const char* text,
-
4790 _In_ size_t start = 0,
-
4791 _In_ size_t end = (size_t)-1,
-
4792 _In_ int flags = match_default)
-
4793 {
-
4794 assert(text || start >= end);
-
4795 this->interval.end = start;
-
4796 if (m_line_break.match(text, this->interval.end, end, flags)) {
-
4797 this->interval.end = m_line_break.interval.end;
-
4798 if (this->interval.end < end && text[this->interval.end] && isspace(text[this->interval.end])) {
-
4799 this->interval.start = start;
-
4800 this->interval.end++;
-
4801 while (this->interval.end < end && text[this->interval.end] && isspace(text[this->interval.end])) this->interval.end++;
-
4802 return true;
-
4803 }
-
4804 }
-
4805 else if (this->interval.end < end && text[this->interval.end] && isspace(text[this->interval.end])) {
-
4806 this->interval.start = start;
-
4807 this->interval.end++;
-
4808 while (this->interval.end < end && text[this->interval.end] && isspace(text[this->interval.end])) this->interval.end++;
-
4809 return true;
-
4810 }
-
4811 this->interval.start = (this->interval.end = start) + 1;
-
4812 return false;
-
4813 }
-
4814
-
4815 protected:
-
4816 http_line_break m_line_break;
-
4817 };
+
4782
+
+
4786 class http_space : public parser
+
4787 {
+
4788 public:
+
4789 virtual bool match(
+
4790 _In_reads_or_z_(end) const char* text,
+
4791 _In_ size_t start = 0,
+
4792 _In_ size_t end = (size_t)-1,
+
4793 _In_ int flags = match_default)
+
4794 {
+
4795 assert(text || start >= end);
+
4796 this->interval.end = start;
+
4797 if (m_line_break.match(text, this->interval.end, end, flags)) {
+
4798 this->interval.end = m_line_break.interval.end;
+
4799 if (this->interval.end < end && text[this->interval.end] && isspace(text[this->interval.end])) {
+
4800 this->interval.start = start;
+
4801 this->interval.end++;
+
4802 while (this->interval.end < end && text[this->interval.end] && isspace(text[this->interval.end])) this->interval.end++;
+
4803 return true;
+
4804 }
+
4805 }
+
4806 else if (this->interval.end < end && text[this->interval.end] && isspace(text[this->interval.end])) {
+
4807 this->interval.start = start;
+
4808 this->interval.end++;
+
4809 while (this->interval.end < end && text[this->interval.end] && isspace(text[this->interval.end])) this->interval.end++;
+
4810 return true;
+
4811 }
+
4812 this->interval.start = (this->interval.end = start) + 1;
+
4813 return false;
+
4814 }
+
4815
+
4816 protected:
+
4817 http_line_break m_line_break;
+
4818 };
-
4818
-
-
4822 class http_text_char : public parser
-
4823 {
-
4824 public:
-
4825 virtual bool match(
-
4826 _In_reads_or_z_(end) const char* text,
-
4827 _In_ size_t start = 0,
-
4828 _In_ size_t end = (size_t)-1,
-
4829 _In_ int flags = match_default)
-
4830 {
-
4831 assert(text || start >= end);
-
4832 this->interval.end = start;
-
4833
-
4834 assert(text || this->interval.end >= end);
-
4835 if (m_space.match(text, this->interval.end, end, flags)) {
-
4836 this->interval.start = start;
-
4837 this->interval.end = m_space.interval.end;
-
4838 return true;
-
4839 }
-
4840 else if (this->interval.end < end && text[this->interval.end] && text[this->interval.end] >= 0x20) {
-
4841 this->interval.start = start;
-
4842 this->interval.end++;
-
4843 return true;
-
4844 }
-
4845 this->interval.start = (this->interval.end = start) + 1;
-
4846 return false;
-
4847 }
-
4848
-
4849 protected:
-
4850 http_space m_space;
-
4851 };
+
4819
+
+
4823 class http_text_char : public parser
+
4824 {
+
4825 public:
+
4826 virtual bool match(
+
4827 _In_reads_or_z_(end) const char* text,
+
4828 _In_ size_t start = 0,
+
4829 _In_ size_t end = (size_t)-1,
+
4830 _In_ int flags = match_default)
+
4831 {
+
4832 assert(text || start >= end);
+
4833 this->interval.end = start;
+
4834
+
4835 assert(text || this->interval.end >= end);
+
4836 if (m_space.match(text, this->interval.end, end, flags)) {
+
4837 this->interval.start = start;
+
4838 this->interval.end = m_space.interval.end;
+
4839 return true;
+
4840 }
+
4841 else if (this->interval.end < end && text[this->interval.end] && text[this->interval.end] >= 0x20) {
+
4842 this->interval.start = start;
+
4843 this->interval.end++;
+
4844 return true;
+
4845 }
+
4846 this->interval.start = (this->interval.end = start) + 1;
+
4847 return false;
+
4848 }
+
4849
+
4850 protected:
+
4851 http_space m_space;
+
4852 };
-
4852
-
-
4856 class http_token : public parser
-
4857 {
-
4858 public:
-
4859 virtual bool match(
-
4860 _In_reads_or_z_(end) const char* text,
-
4861 _In_ size_t start = 0,
-
4862 _In_ size_t end = (size_t)-1,
-
4863 _In_ int flags = match_default)
-
4864 {
-
4865 assert(text || start >= end);
-
4866 this->interval.end = start;
-
4867 for (;;) {
-
4868 if (this->interval.end < end && text[this->interval.end]) {
-
4869 if ((unsigned int)text[this->interval.end] < 0x20 ||
-
4870 (unsigned int)text[this->interval.end] == 0x7f ||
-
4871 text[this->interval.end] == '(' ||
-
4872 text[this->interval.end] == ')' ||
-
4873 text[this->interval.end] == '<' ||
-
4874 text[this->interval.end] == '>' ||
-
4875 text[this->interval.end] == '@' ||
-
4876 text[this->interval.end] == ',' ||
-
4877 text[this->interval.end] == ';' ||
-
4878 text[this->interval.end] == ':' ||
-
4879 text[this->interval.end] == '\\' ||
-
4880 text[this->interval.end] == '\"' ||
-
4881 text[this->interval.end] == '/' ||
-
4882 text[this->interval.end] == '[' ||
-
4883 text[this->interval.end] == ']' ||
-
4884 text[this->interval.end] == '?' ||
-
4885 text[this->interval.end] == '=' ||
-
4886 text[this->interval.end] == '{' ||
-
4887 text[this->interval.end] == '}' ||
-
4888 isspace(text[this->interval.end]))
-
4889 break;
-
4890 else
-
4891 this->interval.end++;
-
4892 }
-
4893 else
-
4894 break;
-
4895 }
- -
4897 this->interval.start = start;
-
4898 return true;
-
4899 }
-
4900 else {
-
4901 this->interval.start = (this->interval.end = start) + 1;
-
4902 return false;
-
4903 }
-
4904 }
-
4905 };
+
4853
+
+
4857 class http_token : public parser
+
4858 {
+
4859 public:
+
4860 virtual bool match(
+
4861 _In_reads_or_z_(end) const char* text,
+
4862 _In_ size_t start = 0,
+
4863 _In_ size_t end = (size_t)-1,
+
4864 _In_ int flags = match_default)
+
4865 {
+
4866 assert(text || start >= end);
+
4867 this->interval.end = start;
+
4868 for (;;) {
+
4869 if (this->interval.end < end && text[this->interval.end]) {
+
4870 if ((unsigned int)text[this->interval.end] < 0x20 ||
+
4871 (unsigned int)text[this->interval.end] == 0x7f ||
+
4872 text[this->interval.end] == '(' ||
+
4873 text[this->interval.end] == ')' ||
+
4874 text[this->interval.end] == '<' ||
+
4875 text[this->interval.end] == '>' ||
+
4876 text[this->interval.end] == '@' ||
+
4877 text[this->interval.end] == ',' ||
+
4878 text[this->interval.end] == ';' ||
+
4879 text[this->interval.end] == ':' ||
+
4880 text[this->interval.end] == '\\' ||
+
4881 text[this->interval.end] == '\"' ||
+
4882 text[this->interval.end] == '/' ||
+
4883 text[this->interval.end] == '[' ||
+
4884 text[this->interval.end] == ']' ||
+
4885 text[this->interval.end] == '?' ||
+
4886 text[this->interval.end] == '=' ||
+
4887 text[this->interval.end] == '{' ||
+
4888 text[this->interval.end] == '}' ||
+
4889 isspace(text[this->interval.end]))
+
4890 break;
+
4891 else
+
4892 this->interval.end++;
+
4893 }
+
4894 else
+
4895 break;
+
4896 }
+ +
4898 this->interval.start = start;
+
4899 return true;
+
4900 }
+
4901 else {
+
4902 this->interval.start = (this->interval.end = start) + 1;
+
4903 return false;
+
4904 }
+
4905 }
+
4906 };
-
4906
-
- -
4911 {
-
4912 public:
-
4913 virtual bool match(
-
4914 _In_reads_or_z_(end) const char* text,
-
4915 _In_ size_t start = 0,
-
4916 _In_ size_t end = (size_t)-1,
-
4917 _In_ int flags = match_default)
-
4918 {
-
4919 assert(text || start >= end);
-
4920 this->interval.end = start;
-
4921 if (this->interval.end < end && text[this->interval.end] != '"')
-
4922 goto error;
-
4923 this->interval.end++;
-
4924 content.start = this->interval.end;
-
4925 for (;;) {
-
4926 assert(text || this->interval.end >= end);
-
4927 if (this->interval.end < end && text[this->interval.end]) {
-
4928 if (text[this->interval.end] == '"') {
-
4929 content.end = this->interval.end;
-
4930 this->interval.end++;
-
4931 break;
-
4932 }
-
4933 else if (text[this->interval.end] == '\\') {
-
4934 this->interval.end++;
-
4935 if (this->interval.end < end && text[this->interval.end]) {
-
4936 this->interval.end++;
-
4937 }
-
4938 else
-
4939 goto error;
-
4940 }
-
4941 else if (m_chr.match(text, this->interval.end, end, flags))
-
4942 this->interval.end++;
-
4943 else
-
4944 goto error;
-
4945 }
-
4946 else
-
4947 goto error;
-
4948 }
-
4949 this->interval.start = start;
-
4950 return true;
-
4951
-
4952 error:
-
4953 content.start = 1;
-
4954 content.end = 0;
-
4955 this->interval.start = (this->interval.end = start) + 1;
-
4956 return false;
-
4957 }
-
4958
-
4959 virtual void invalidate()
-
4960 {
-
4961 content.start = 1;
-
4962 content.end = 0;
-
4963 parser::invalidate();
-
4964 }
-
4965
-
4966 public:
- -
4968
-
4969 protected:
-
4970 http_text_char m_chr;
-
4971 };
+
4907
+
+ +
4912 {
+
4913 public:
+
4914 virtual bool match(
+
4915 _In_reads_or_z_(end) const char* text,
+
4916 _In_ size_t start = 0,
+
4917 _In_ size_t end = (size_t)-1,
+
4918 _In_ int flags = match_default)
+
4919 {
+
4920 assert(text || start >= end);
+
4921 this->interval.end = start;
+
4922 if (this->interval.end < end && text[this->interval.end] != '"')
+
4923 goto error;
+
4924 this->interval.end++;
+
4925 content.start = this->interval.end;
+
4926 for (;;) {
+
4927 assert(text || this->interval.end >= end);
+
4928 if (this->interval.end < end && text[this->interval.end]) {
+
4929 if (text[this->interval.end] == '"') {
+
4930 content.end = this->interval.end;
+
4931 this->interval.end++;
+
4932 break;
+
4933 }
+
4934 else if (text[this->interval.end] == '\\') {
+
4935 this->interval.end++;
+
4936 if (this->interval.end < end && text[this->interval.end]) {
+
4937 this->interval.end++;
+
4938 }
+
4939 else
+
4940 goto error;
+
4941 }
+
4942 else if (m_chr.match(text, this->interval.end, end, flags))
+
4943 this->interval.end++;
+
4944 else
+
4945 goto error;
+
4946 }
+
4947 else
+
4948 goto error;
+
4949 }
+
4950 this->interval.start = start;
+
4951 return true;
+
4952
+
4953 error:
+
4954 content.start = 1;
+
4955 content.end = 0;
+
4956 this->interval.start = (this->interval.end = start) + 1;
+
4957 return false;
+
4958 }
+
4959
+
4960 virtual void invalidate()
+
4961 {
+
4962 content.start = 1;
+
4963 content.end = 0;
+
4964 parser::invalidate();
+
4965 }
+
4966
+
4967 public:
+ +
4969
+
4970 protected:
+
4971 http_text_char m_chr;
+
4972 };
-
4972
-
-
4976 class http_value : public parser
-
4977 {
-
4978 public:
-
4979 virtual bool match(
-
4980 _In_reads_or_z_(end) const char* text,
-
4981 _In_ size_t start = 0,
-
4982 _In_ size_t end = (size_t)-1,
-
4983 _In_ int flags = match_default)
-
4984 {
-
4985 assert(text || start >= end);
-
4986 this->interval.end = start;
-
4987 if (string.match(text, this->interval.end, end, flags)) {
-
4988 token.invalidate();
-
4989 this->interval.end = string.interval.end;
-
4990 this->interval.start = start;
-
4991 return true;
-
4992 }
-
4993 else if (token.match(text, this->interval.end, end, flags)) {
-
4994 string.invalidate();
-
4995 this->interval.end = token.interval.end;
-
4996 this->interval.start = start;
-
4997 return true;
-
4998 }
-
4999 else {
-
5000 this->interval.start = (this->interval.end = start) + 1;
-
5001 return false;
-
5002 }
-
5003 }
-
5004
-
5005 virtual void invalidate()
-
5006 {
-
5007 string.invalidate();
-
5008 token.invalidate();
-
5009 parser::invalidate();
-
5010 }
-
5011
-
5012 public:
- - -
5015 };
+
4973
+
+
4977 class http_value : public parser
+
4978 {
+
4979 public:
+
4980 virtual bool match(
+
4981 _In_reads_or_z_(end) const char* text,
+
4982 _In_ size_t start = 0,
+
4983 _In_ size_t end = (size_t)-1,
+
4984 _In_ int flags = match_default)
+
4985 {
+
4986 assert(text || start >= end);
+
4987 this->interval.end = start;
+
4988 if (string.match(text, this->interval.end, end, flags)) {
+
4989 token.invalidate();
+
4990 this->interval.end = string.interval.end;
+
4991 this->interval.start = start;
+
4992 return true;
+
4993 }
+
4994 else if (token.match(text, this->interval.end, end, flags)) {
+
4995 string.invalidate();
+
4996 this->interval.end = token.interval.end;
+
4997 this->interval.start = start;
+
4998 return true;
+
4999 }
+
5000 else {
+
5001 this->interval.start = (this->interval.end = start) + 1;
+
5002 return false;
+
5003 }
+
5004 }
+
5005
+
5006 virtual void invalidate()
+
5007 {
+
5008 string.invalidate();
+
5009 token.invalidate();
+
5010 parser::invalidate();
+
5011 }
+
5012
+
5013 public:
+ + +
5016 };
-
5016
-
-
5020 class http_parameter : public parser
-
5021 {
-
5022 public:
-
5023 virtual bool match(
-
5024 _In_reads_or_z_(end) const char* text,
-
5025 _In_ size_t start = 0,
-
5026 _In_ size_t end = (size_t)-1,
-
5027 _In_ int flags = match_default)
-
5028 {
-
5029 assert(text || start >= end);
-
5030 this->interval.end = start;
-
5031 if (name.match(text, this->interval.end, end, flags))
-
5032 this->interval.end = name.interval.end;
-
5033 else
-
5034 goto error;
-
5035 while (m_space.match(text, this->interval.end, end, flags))
-
5036 this->interval.end = m_space.interval.end;
-
5037 assert(text || this->interval.end >= end);
-
5038 if (this->interval.end < end && text[this->interval.end] == '=')
-
5039 this->interval.end++;
-
5040 else
-
5041 while (m_space.match(text, this->interval.end, end, flags))
-
5042 this->interval.end = m_space.interval.end;
-
5043 if (value.match(text, this->interval.end, end, flags))
-
5044 this->interval.end = value.interval.end;
-
5045 else
-
5046 goto error;
-
5047 this->interval.start = start;
-
5048 return true;
-
5049
-
5050 error:
-
5051 name.invalidate();
-
5052 value.invalidate();
-
5053 this->interval.start = (this->interval.end = start) + 1;
-
5054 return false;
-
5055 }
-
5056
-
5057 virtual void invalidate()
-
5058 {
-
5059 name.invalidate();
-
5060 value.invalidate();
-
5061 parser::invalidate();
-
5062 }
-
5063
-
5064 public:
- - -
5067
-
5068 protected:
-
5069 http_space m_space;
-
5070 };
+
5017
+
+
5021 class http_parameter : public parser
+
5022 {
+
5023 public:
+
5024 virtual bool match(
+
5025 _In_reads_or_z_(end) const char* text,
+
5026 _In_ size_t start = 0,
+
5027 _In_ size_t end = (size_t)-1,
+
5028 _In_ int flags = match_default)
+
5029 {
+
5030 assert(text || start >= end);
+
5031 this->interval.end = start;
+
5032 if (name.match(text, this->interval.end, end, flags))
+
5033 this->interval.end = name.interval.end;
+
5034 else
+
5035 goto error;
+
5036 while (m_space.match(text, this->interval.end, end, flags))
+
5037 this->interval.end = m_space.interval.end;
+
5038 assert(text || this->interval.end >= end);
+
5039 if (this->interval.end < end && text[this->interval.end] == '=')
+
5040 this->interval.end++;
+
5041 else
+
5042 while (m_space.match(text, this->interval.end, end, flags))
+
5043 this->interval.end = m_space.interval.end;
+
5044 if (value.match(text, this->interval.end, end, flags))
+
5045 this->interval.end = value.interval.end;
+
5046 else
+
5047 goto error;
+
5048 this->interval.start = start;
+
5049 return true;
+
5050
+
5051 error:
+
5052 name.invalidate();
+
5053 value.invalidate();
+
5054 this->interval.start = (this->interval.end = start) + 1;
+
5055 return false;
+
5056 }
+
5057
+
5058 virtual void invalidate()
+
5059 {
+
5060 name.invalidate();
+
5061 value.invalidate();
+
5062 parser::invalidate();
+
5063 }
+
5064
+
5065 public:
+ + +
5068
+
5069 protected:
+
5070 http_space m_space;
+
5071 };
-
5071
-
-
5075 class http_any_type : public parser
-
5076 {
-
5077 public:
-
5078 virtual bool match(
-
5079 _In_reads_or_z_(end) const char* text,
-
5080 _In_ size_t start = 0,
-
5081 _In_ size_t end = (size_t)-1,
-
5082 _In_ int flags = match_default)
-
5083 {
-
5084 assert(text || start >= end);
-
5085 if (start + 2 < end &&
-
5086 text[start] == '*' &&
-
5087 text[start + 1] == '/' &&
-
5088 text[start + 2] == '*')
-
5089 {
-
5090 this->interval.end = (this->interval.start = start) + 3;
-
5091 return true;
-
5092 }
-
5093 else if (start < end && text[start] == '*') {
-
5094 this->interval.end = (this->interval.start = start) + 1;
-
5095 return true;
-
5096 }
-
5097 else {
-
5098 this->interval.start = (this->interval.end = start) + 1;
-
5099 return false;
-
5100 }
-
5101 }
-
5102 };
+
5072
+
+
5076 class http_any_type : public parser
+
5077 {
+
5078 public:
+
5079 virtual bool match(
+
5080 _In_reads_or_z_(end) const char* text,
+
5081 _In_ size_t start = 0,
+
5082 _In_ size_t end = (size_t)-1,
+
5083 _In_ int flags = match_default)
+
5084 {
+
5085 assert(text || start >= end);
+
5086 if (start + 2 < end &&
+
5087 text[start] == '*' &&
+
5088 text[start + 1] == '/' &&
+
5089 text[start + 2] == '*')
+
5090 {
+
5091 this->interval.end = (this->interval.start = start) + 3;
+
5092 return true;
+
5093 }
+
5094 else if (start < end && text[start] == '*') {
+
5095 this->interval.end = (this->interval.start = start) + 1;
+
5096 return true;
+
5097 }
+
5098 else {
+
5099 this->interval.start = (this->interval.end = start) + 1;
+
5100 return false;
+
5101 }
+
5102 }
+
5103 };
-
5103
-
- -
5108 {
-
5109 public:
-
5110 virtual bool match(
-
5111 _In_reads_or_z_(end) const char* text,
-
5112 _In_ size_t start = 0,
-
5113 _In_ size_t end = (size_t)-1,
-
5114 _In_ int flags = match_default)
-
5115 {
-
5116 assert(text || start >= end);
-
5117 this->interval.end = start;
-
5118 if (type.match(text, this->interval.end, end, flags))
-
5119 this->interval.end = type.interval.end;
-
5120 else
-
5121 goto error;
-
5122 while (m_space.match(text, this->interval.end, end, flags))
-
5123 this->interval.end = m_space.interval.end;
-
5124 if (this->interval.end < end && text[this->interval.end] == '/')
-
5125 this->interval.end++;
-
5126 else
-
5127 goto error;
-
5128 while (m_space.match(text, this->interval.end, end, flags))
-
5129 this->interval.end = m_space.interval.end;
-
5130 if (subtype.match(text, this->interval.end, end, flags))
-
5131 this->interval.end = subtype.interval.end;
-
5132 else
-
5133 goto error;
-
5134 this->interval.start = start;
-
5135 return true;
-
5136
-
5137 error:
-
5138 type.invalidate();
-
5139 subtype.invalidate();
-
5140 this->interval.start = (this->interval.end = start) + 1;
-
5141 return false;
-
5142 }
-
5143
-
5144 virtual void invalidate()
-
5145 {
-
5146 type.invalidate();
-
5147 subtype.invalidate();
-
5148 parser::invalidate();
-
5149 }
-
5150
-
5151 public:
-
5152 http_token type;
-
5153 http_token subtype;
-
5154
-
5155 protected:
-
5156 http_space m_space;
-
5157 };
+
5104
+
+ +
5109 {
+
5110 public:
+
5111 virtual bool match(
+
5112 _In_reads_or_z_(end) const char* text,
+
5113 _In_ size_t start = 0,
+
5114 _In_ size_t end = (size_t)-1,
+
5115 _In_ int flags = match_default)
+
5116 {
+
5117 assert(text || start >= end);
+
5118 this->interval.end = start;
+
5119 if (type.match(text, this->interval.end, end, flags))
+
5120 this->interval.end = type.interval.end;
+
5121 else
+
5122 goto error;
+
5123 while (m_space.match(text, this->interval.end, end, flags))
+
5124 this->interval.end = m_space.interval.end;
+
5125 if (this->interval.end < end && text[this->interval.end] == '/')
+
5126 this->interval.end++;
+
5127 else
+
5128 goto error;
+
5129 while (m_space.match(text, this->interval.end, end, flags))
+
5130 this->interval.end = m_space.interval.end;
+
5131 if (subtype.match(text, this->interval.end, end, flags))
+
5132 this->interval.end = subtype.interval.end;
+
5133 else
+
5134 goto error;
+
5135 this->interval.start = start;
+
5136 return true;
+
5137
+
5138 error:
+
5139 type.invalidate();
+
5140 subtype.invalidate();
+
5141 this->interval.start = (this->interval.end = start) + 1;
+
5142 return false;
+
5143 }
+
5144
+
5145 virtual void invalidate()
+
5146 {
+
5147 type.invalidate();
+
5148 subtype.invalidate();
+
5149 parser::invalidate();
+
5150 }
+
5151
+
5152 public:
+
5153 http_token type;
+
5154 http_token subtype;
+
5155
+
5156 protected:
+
5157 http_space m_space;
+
5158 };
-
5158
-
- -
5163 {
-
5164 public:
-
5165 virtual bool match(
-
5166 _In_reads_or_z_(end) const char* text,
-
5167 _In_ size_t start = 0,
-
5168 _In_ size_t end = (size_t)-1,
-
5169 _In_ int flags = match_default)
-
5170 {
-
5171 assert(text || start >= end);
-
5172 if (!http_media_range::match(text, start, end, flags))
-
5173 goto error;
-
5174 params.clear();
-
5175 for (;;) {
-
5176 if (this->interval.end < end && text[this->interval.end]) {
-
5177 if (m_space.match(text, this->interval.end, end, flags))
-
5178 this->interval.end = m_space.interval.end;
-
5179 else if (text[this->interval.end] == ';') {
-
5180 this->interval.end++;
-
5181 while (m_space.match(text, this->interval.end, end, flags))
-
5182 this->interval.end = m_space.interval.end;
- -
5184 if (param.match(text, this->interval.end, end, flags)) {
-
5185 this->interval.end = param.interval.end;
-
5186 params.push_back(std::move(param));
-
5187 }
-
5188 else
-
5189 break;
-
5190 }
-
5191 else
-
5192 break;
-
5193 }
-
5194 else
-
5195 break;
-
5196 }
-
5197 this->interval.end = params.empty() ? subtype.interval.end : params.back().interval.end;
-
5198 return true;
-
5199
-
5200 error:
-
5201 http_media_range::invalidate();
-
5202 params.clear();
-
5203 this->interval.start = (this->interval.end = start) + 1;
-
5204 return false;
-
5205 }
-
5206
-
5207 virtual void invalidate()
-
5208 {
-
5209 params.clear();
-
5210 http_media_range::invalidate();
-
5211 }
-
5212
-
5213 public:
-
5214 std::list<http_parameter> params;
-
5215 };
+
5159
+
+ +
5164 {
+
5165 public:
+
5166 virtual bool match(
+
5167 _In_reads_or_z_(end) const char* text,
+
5168 _In_ size_t start = 0,
+
5169 _In_ size_t end = (size_t)-1,
+
5170 _In_ int flags = match_default)
+
5171 {
+
5172 assert(text || start >= end);
+
5173 if (!http_media_range::match(text, start, end, flags))
+
5174 goto error;
+
5175 params.clear();
+
5176 for (;;) {
+
5177 if (this->interval.end < end && text[this->interval.end]) {
+
5178 if (m_space.match(text, this->interval.end, end, flags))
+
5179 this->interval.end = m_space.interval.end;
+
5180 else if (text[this->interval.end] == ';') {
+
5181 this->interval.end++;
+
5182 while (m_space.match(text, this->interval.end, end, flags))
+
5183 this->interval.end = m_space.interval.end;
+ +
5185 if (param.match(text, this->interval.end, end, flags)) {
+
5186 this->interval.end = param.interval.end;
+
5187 params.push_back(std::move(param));
+
5188 }
+
5189 else
+
5190 break;
+
5191 }
+
5192 else
+
5193 break;
+
5194 }
+
5195 else
+
5196 break;
+
5197 }
+
5198 this->interval.end = params.empty() ? subtype.interval.end : params.back().interval.end;
+
5199 return true;
+
5200
+
5201 error:
+
5202 http_media_range::invalidate();
+
5203 params.clear();
+
5204 this->interval.start = (this->interval.end = start) + 1;
+
5205 return false;
+
5206 }
+
5207
+
5208 virtual void invalidate()
+
5209 {
+
5210 params.clear();
+
5211 http_media_range::invalidate();
+
5212 }
+
5213
+
5214 public:
+
5215 std::list<http_parameter> params;
+
5216 };
-
5216
-
- -
5221 {
-
5222 public:
-
5223 virtual bool match(
-
5224 _In_reads_or_z_(end) const char* text,
-
5225 _In_ size_t start = 0,
-
5226 _In_ size_t end = (size_t)-1,
-
5227 _In_ int flags = match_default)
-
5228 {
-
5229 assert(text || start >= end);
-
5230 this->interval.end = start;
-
5231 for (;;) {
-
5232 if (this->interval.end < end && text[this->interval.end]) {
-
5233 if ((unsigned int)text[this->interval.end] < 0x20 ||
-
5234 (unsigned int)text[this->interval.end] == 0x7f ||
-
5235 text[this->interval.end] == ':' ||
-
5236 text[this->interval.end] == '/' ||
-
5237 isspace(text[this->interval.end]))
-
5238 break;
-
5239 else
-
5240 this->interval.end++;
-
5241 }
-
5242 else
-
5243 break;
-
5244 }
- -
5246 this->interval.start = start;
-
5247 return true;
-
5248 }
-
5249 this->interval.start = (this->interval.end = start) + 1;
-
5250 return false;
-
5251 }
-
5252 };
+
5217
+
+ +
5222 {
+
5223 public:
+
5224 virtual bool match(
+
5225 _In_reads_or_z_(end) const char* text,
+
5226 _In_ size_t start = 0,
+
5227 _In_ size_t end = (size_t)-1,
+
5228 _In_ int flags = match_default)
+
5229 {
+
5230 assert(text || start >= end);
+
5231 this->interval.end = start;
+
5232 for (;;) {
+
5233 if (this->interval.end < end && text[this->interval.end]) {
+
5234 if ((unsigned int)text[this->interval.end] < 0x20 ||
+
5235 (unsigned int)text[this->interval.end] == 0x7f ||
+
5236 text[this->interval.end] == ':' ||
+
5237 text[this->interval.end] == '/' ||
+
5238 isspace(text[this->interval.end]))
+
5239 break;
+
5240 else
+
5241 this->interval.end++;
+
5242 }
+
5243 else
+
5244 break;
+
5245 }
+ +
5247 this->interval.start = start;
+
5248 return true;
+
5249 }
+
5250 this->interval.start = (this->interval.end = start) + 1;
+
5251 return false;
+
5252 }
+
5253 };
-
5253
-
-
5257 class http_url_port : public parser
-
5258 {
-
5259 public:
-
5260 http_url_port(_In_ const std::locale& locale = std::locale()) :
-
5261 parser(locale),
-
5262 value(0)
-
5263 {}
-
5264
-
5265 virtual bool match(
-
5266 _In_reads_or_z_(end) const char* text,
-
5267 _In_ size_t start = 0,
-
5268 _In_ size_t end = (size_t)-1,
-
5269 _In_ int flags = match_default)
-
5270 {
-
5271 assert(text || start >= end);
-
5272 value = 0;
-
5273 this->interval.end = start;
-
5274 for (;;) {
-
5275 if (this->interval.end < end && text[this->interval.end]) {
-
5276 if ('0' <= text[this->interval.end] && text[this->interval.end] <= '9') {
-
5277 size_t _value = (size_t)value * 10 + text[this->interval.end] - '0';
-
5278 if (_value > (uint16_t)-1) {
-
5279 value = 0;
-
5280 this->interval.start = (this->interval.end = start) + 1;
-
5281 return false;
-
5282 }
-
5283 value = (uint16_t)_value;
-
5284 this->interval.end++;
-
5285 }
-
5286 else
-
5287 break;
-
5288 }
-
5289 else
-
5290 break;
-
5291 }
- -
5293 this->interval.start = start;
-
5294 return true;
-
5295 }
-
5296 this->interval.start = (this->interval.end = start) + 1;
-
5297 return false;
-
5298 }
-
5299
-
5300 virtual void invalidate()
-
5301 {
-
5302 value = 0;
-
5303 parser::invalidate();
-
5304 }
-
5305
-
5306 public:
-
5307 uint16_t value;
-
5308 };
+
5254
+
+
5258 class http_url_port : public parser
+
5259 {
+
5260 public:
+
5261 http_url_port(_In_ const std::locale& locale = std::locale()) :
+
5262 parser(locale),
+
5263 value(0)
+
5264 {}
+
5265
+
5266 virtual bool match(
+
5267 _In_reads_or_z_(end) const char* text,
+
5268 _In_ size_t start = 0,
+
5269 _In_ size_t end = (size_t)-1,
+
5270 _In_ int flags = match_default)
+
5271 {
+
5272 assert(text || start >= end);
+
5273 value = 0;
+
5274 this->interval.end = start;
+
5275 for (;;) {
+
5276 if (this->interval.end < end && text[this->interval.end]) {
+
5277 if ('0' <= text[this->interval.end] && text[this->interval.end] <= '9') {
+
5278 size_t _value = (size_t)value * 10 + text[this->interval.end] - '0';
+
5279 if (_value > (uint16_t)-1) {
+
5280 value = 0;
+
5281 this->interval.start = (this->interval.end = start) + 1;
+
5282 return false;
+
5283 }
+
5284 value = (uint16_t)_value;
+
5285 this->interval.end++;
+
5286 }
+
5287 else
+
5288 break;
+
5289 }
+
5290 else
+
5291 break;
+
5292 }
+ +
5294 this->interval.start = start;
+
5295 return true;
+
5296 }
+
5297 this->interval.start = (this->interval.end = start) + 1;
+
5298 return false;
+
5299 }
+
5300
+
5301 virtual void invalidate()
+
5302 {
+
5303 value = 0;
+
5304 parser::invalidate();
+
5305 }
+
5306
+
5307 public:
+
5308 uint16_t value;
+
5309 };
-
5309
-
- -
5314 {
-
5315 public:
-
5316 virtual bool match(
-
5317 _In_reads_or_z_(end) const char* text,
-
5318 _In_ size_t start = 0,
-
5319 _In_ size_t end = (size_t)-1,
-
5320 _In_ int flags = match_default)
-
5321 {
-
5322 assert(text || start >= end);
-
5323 this->interval.end = start;
-
5324 for (;;) {
-
5325 if (this->interval.end < end && text[this->interval.end]) {
-
5326 if ((unsigned int)text[this->interval.end] < 0x20 ||
-
5327 (unsigned int)text[this->interval.end] == 0x7f ||
-
5328 text[this->interval.end] == '?' ||
-
5329 text[this->interval.end] == '/' ||
-
5330 isspace(text[this->interval.end]))
-
5331 break;
-
5332 else
-
5333 this->interval.end++;
-
5334 }
-
5335 else
-
5336 break;
-
5337 }
-
5338 this->interval.start = start;
-
5339 return true;
-
5340 }
-
5341 };
+
5310
+
+ +
5315 {
+
5316 public:
+
5317 virtual bool match(
+
5318 _In_reads_or_z_(end) const char* text,
+
5319 _In_ size_t start = 0,
+
5320 _In_ size_t end = (size_t)-1,
+
5321 _In_ int flags = match_default)
+
5322 {
+
5323 assert(text || start >= end);
+
5324 this->interval.end = start;
+
5325 for (;;) {
+
5326 if (this->interval.end < end && text[this->interval.end]) {
+
5327 if ((unsigned int)text[this->interval.end] < 0x20 ||
+
5328 (unsigned int)text[this->interval.end] == 0x7f ||
+
5329 text[this->interval.end] == '?' ||
+
5330 text[this->interval.end] == '/' ||
+
5331 isspace(text[this->interval.end]))
+
5332 break;
+
5333 else
+
5334 this->interval.end++;
+
5335 }
+
5336 else
+
5337 break;
+
5338 }
+
5339 this->interval.start = start;
+
5340 return true;
+
5341 }
+
5342 };
-
5342
-
-
5346 class http_url_path : public parser
-
5347 {
-
5348 public:
-
5349 virtual bool match(
-
5350 _In_reads_or_z_(end) const char* text,
-
5351 _In_ size_t start = 0,
-
5352 _In_ size_t end = (size_t)-1,
-
5353 _In_ int flags = match_default)
-
5354 {
-
5355 assert(text || start >= end);
- -
5357 this->interval.end = start;
-
5358 segments.clear();
-
5359 assert(text || this->interval.end >= end);
-
5360 if (this->interval.end < end && text[this->interval.end] != '/')
-
5361 goto error;
-
5362 this->interval.end++;
-
5363 s.match(text, this->interval.end, end, flags);
-
5364 segments.push_back(s);
-
5365 this->interval.end = s.interval.end;
-
5366 for (;;) {
-
5367 if (this->interval.end < end && text[this->interval.end]) {
-
5368 if (text[this->interval.end] == '/') {
-
5369 this->interval.end++;
-
5370 s.match(text, this->interval.end, end, flags);
-
5371 segments.push_back(s);
-
5372 this->interval.end = s.interval.end;
-
5373 }
-
5374 else
-
5375 break;
-
5376 }
-
5377 else
-
5378 break;
-
5379 }
-
5380 this->interval.start = start;
-
5381 return true;
-
5382
-
5383 error:
-
5384 segments.clear();
-
5385 this->interval.start = (this->interval.end = start) + 1;
-
5386 return false;
-
5387 }
-
5388
-
5389 virtual void invalidate()
-
5390 {
-
5391 segments.clear();
-
5392 parser::invalidate();
-
5393 }
-
5394
-
5395 public:
-
5396 std::vector<http_url_path_segment> segments;
-
5397 };
+
5343
+
+
5347 class http_url_path : public parser
+
5348 {
+
5349 public:
+
5350 virtual bool match(
+
5351 _In_reads_or_z_(end) const char* text,
+
5352 _In_ size_t start = 0,
+
5353 _In_ size_t end = (size_t)-1,
+
5354 _In_ int flags = match_default)
+
5355 {
+
5356 assert(text || start >= end);
+ +
5358 this->interval.end = start;
+
5359 segments.clear();
+
5360 assert(text || this->interval.end >= end);
+
5361 if (this->interval.end < end && text[this->interval.end] != '/')
+
5362 goto error;
+
5363 this->interval.end++;
+
5364 s.match(text, this->interval.end, end, flags);
+
5365 segments.push_back(s);
+
5366 this->interval.end = s.interval.end;
+
5367 for (;;) {
+
5368 if (this->interval.end < end && text[this->interval.end]) {
+
5369 if (text[this->interval.end] == '/') {
+
5370 this->interval.end++;
+
5371 s.match(text, this->interval.end, end, flags);
+
5372 segments.push_back(s);
+
5373 this->interval.end = s.interval.end;
+
5374 }
+
5375 else
+
5376 break;
+
5377 }
+
5378 else
+
5379 break;
+
5380 }
+
5381 this->interval.start = start;
+
5382 return true;
+
5383
+
5384 error:
+
5385 segments.clear();
+
5386 this->interval.start = (this->interval.end = start) + 1;
+
5387 return false;
+
5388 }
+
5389
+
5390 virtual void invalidate()
+
5391 {
+
5392 segments.clear();
+
5393 parser::invalidate();
+
5394 }
+
5395
+
5396 public:
+
5397 std::vector<http_url_path_segment> segments;
+
5398 };
-
5398
-
- -
5403 {
-
5404 public:
-
5405 virtual bool match(
-
5406 _In_reads_or_z_(end) const char* text,
-
5407 _In_ size_t start = 0,
-
5408 _In_ size_t end = (size_t)-1,
-
5409 _In_ int flags = match_default)
-
5410 {
-
5411 assert(text || start >= end);
-
5412 this->interval.end = start;
-
5413 name.start = this->interval.end;
-
5414 for (;;) {
-
5415 if (this->interval.end < end && text[this->interval.end]) {
-
5416 if ((unsigned int)text[this->interval.end] < 0x20 ||
-
5417 (unsigned int)text[this->interval.end] == 0x7f ||
-
5418 text[this->interval.end] == '&' ||
-
5419 text[this->interval.end] == '=' ||
-
5420 isspace(text[this->interval.end]))
-
5421 break;
-
5422 else
-
5423 this->interval.end++;
-
5424 }
-
5425 else
-
5426 break;
-
5427 }
- -
5429 name.end = this->interval.end;
-
5430 else
-
5431 goto error;
-
5432 if (text[this->interval.end] == '=') {
-
5433 this->interval.end++;
-
5434 value.start = this->interval.end;
-
5435 for (;;) {
-
5436 if (this->interval.end < end && text[this->interval.end]) {
-
5437 if ((unsigned int)text[this->interval.end] < 0x20 ||
-
5438 (unsigned int)text[this->interval.end] == 0x7f ||
-
5439 text[this->interval.end] == '&' ||
-
5440 isspace(text[this->interval.end]))
-
5441 break;
-
5442 else
-
5443 this->interval.end++;
-
5444 }
-
5445 else
-
5446 break;
-
5447 }
-
5448 value.end = this->interval.end;
-
5449 }
-
5450 else {
-
5451 value.start = 1;
-
5452 value.end = 0;
-
5453 }
-
5454 this->interval.start = start;
-
5455 return true;
-
5456
-
5457 error:
-
5458 name.start = 1;
-
5459 name.end = 0;
-
5460 value.start = 1;
-
5461 value.end = 0;
-
5462 this->interval.start = (this->interval.end = start) + 1;
-
5463 return false;
-
5464 }
-
5465
-
5466 virtual void invalidate()
-
5467 {
-
5468 name.start = 1;
-
5469 name.end = 0;
-
5470 value.start = 1;
-
5471 value.end = 0;
-
5472 parser::invalidate();
-
5473 }
-
5474
-
5475 public:
- - -
5478 };
+
5399
+
+ +
5404 {
+
5405 public:
+
5406 virtual bool match(
+
5407 _In_reads_or_z_(end) const char* text,
+
5408 _In_ size_t start = 0,
+
5409 _In_ size_t end = (size_t)-1,
+
5410 _In_ int flags = match_default)
+
5411 {
+
5412 assert(text || start >= end);
+
5413 this->interval.end = start;
+
5414 name.start = this->interval.end;
+
5415 for (;;) {
+
5416 if (this->interval.end < end && text[this->interval.end]) {
+
5417 if ((unsigned int)text[this->interval.end] < 0x20 ||
+
5418 (unsigned int)text[this->interval.end] == 0x7f ||
+
5419 text[this->interval.end] == '&' ||
+
5420 text[this->interval.end] == '=' ||
+
5421 isspace(text[this->interval.end]))
+
5422 break;
+
5423 else
+
5424 this->interval.end++;
+
5425 }
+
5426 else
+
5427 break;
+
5428 }
+ +
5430 name.end = this->interval.end;
+
5431 else
+
5432 goto error;
+
5433 if (text[this->interval.end] == '=') {
+
5434 this->interval.end++;
+
5435 value.start = this->interval.end;
+
5436 for (;;) {
+
5437 if (this->interval.end < end && text[this->interval.end]) {
+
5438 if ((unsigned int)text[this->interval.end] < 0x20 ||
+
5439 (unsigned int)text[this->interval.end] == 0x7f ||
+
5440 text[this->interval.end] == '&' ||
+
5441 isspace(text[this->interval.end]))
+
5442 break;
+
5443 else
+
5444 this->interval.end++;
+
5445 }
+
5446 else
+
5447 break;
+
5448 }
+
5449 value.end = this->interval.end;
+
5450 }
+
5451 else {
+
5452 value.start = 1;
+
5453 value.end = 0;
+
5454 }
+
5455 this->interval.start = start;
+
5456 return true;
+
5457
+
5458 error:
+
5459 name.start = 1;
+
5460 name.end = 0;
+
5461 value.start = 1;
+
5462 value.end = 0;
+
5463 this->interval.start = (this->interval.end = start) + 1;
+
5464 return false;
+
5465 }
+
5466
+
5467 virtual void invalidate()
+
5468 {
+
5469 name.start = 1;
+
5470 name.end = 0;
+
5471 value.start = 1;
+
5472 value.end = 0;
+
5473 parser::invalidate();
+
5474 }
+
5475
+
5476 public:
+ + +
5479 };
-
5479
-
-
5483 class http_url : public parser
-
5484 {
-
5485 public:
-
5486 http_url(_In_ const std::locale& locale = std::locale()) :
-
5487 parser(locale),
-
5488 port(locale)
-
5489 {}
-
5490
-
5491 virtual bool match(
-
5492 _In_reads_or_z_(end) const char* text,
-
5493 _In_ size_t start = 0,
-
5494 _In_ size_t end = (size_t)-1,
-
5495 _In_ int flags = match_default)
-
5496 {
-
5497 assert(text || start >= end);
-
5498 this->interval.end = start;
-
5499
-
5500 if (this->interval.end + 7 <= end && stdex::strnicmp(text + this->interval.end, 7, "http://", (size_t)-1, m_locale) == 0) {
-
5501 this->interval.end += 7;
-
5502 if (server.match(text, this->interval.end, end, flags))
-
5503 this->interval.end = server.interval.end;
-
5504 else
-
5505 goto error;
-
5506 if (this->interval.end < end && text[this->interval.end] == ':') {
-
5507 this->interval.end++;
-
5508 if (port.match(text, this->interval.end, end, flags))
-
5509 this->interval.end = port.interval.end;
-
5510 }
-
5511 else {
-
5512 port.invalidate();
-
5513 port.value = 80;
-
5514 }
-
5515 }
-
5516 else {
-
5517 server.invalidate();
-
5518 port.invalidate();
-
5519 port.value = 80;
-
5520 }
-
5521
-
5522 if (path.match(text, this->interval.end, end, flags))
-
5523 this->interval.end = path.interval.end;
-
5524 else
-
5525 goto error;
-
5526
-
5527 params.clear();
-
5528
-
5529 if (this->interval.end < end && text[this->interval.end] == '?') {
-
5530 this->interval.end++;
-
5531 for (;;) {
-
5532 if (this->interval.end < end && text[this->interval.end]) {
-
5533 if ((unsigned int)text[this->interval.end] < 0x20 ||
-
5534 (unsigned int)text[this->interval.end] == 0x7f ||
-
5535 isspace(text[this->interval.end]))
-
5536 break;
-
5537 else if (text[this->interval.end] == '&')
-
5538 this->interval.end++;
-
5539 else {
- -
5541 if (param.match(text, this->interval.end, end, flags)) {
-
5542 this->interval.end = param.interval.end;
-
5543 params.push_back(std::move(param));
-
5544 }
-
5545 else
-
5546 break;
-
5547 }
-
5548 }
-
5549 else
-
5550 break;
-
5551 }
-
5552 }
-
5553
-
5554 this->interval.start = start;
-
5555 return true;
-
5556
-
5557 error:
-
5558 server.invalidate();
-
5559 port.invalidate();
-
5560 path.invalidate();
-
5561 params.clear();
-
5562 this->interval.start = (this->interval.end = start) + 1;
-
5563 return false;
-
5564 }
-
5565
-
5566 virtual void invalidate()
-
5567 {
-
5568 server.invalidate();
-
5569 port.invalidate();
-
5570 path.invalidate();
-
5571 params.clear();
-
5572 parser::invalidate();
-
5573 }
-
5574
-
5575 public:
-
5576 http_url_server server;
-
5577 http_url_port port;
-
5578 http_url_path path;
-
5579 std::list<http_url_parameter> params;
-
5580 };
+
5480
+
+
5484 class http_url : public parser
+
5485 {
+
5486 public:
+
5487 http_url(_In_ const std::locale& locale = std::locale()) :
+
5488 parser(locale),
+
5489 port(locale)
+
5490 {}
+
5491
+
5492 virtual bool match(
+
5493 _In_reads_or_z_(end) const char* text,
+
5494 _In_ size_t start = 0,
+
5495 _In_ size_t end = (size_t)-1,
+
5496 _In_ int flags = match_default)
+
5497 {
+
5498 assert(text || start >= end);
+
5499 this->interval.end = start;
+
5500
+
5501 if (this->interval.end + 7 <= end && stdex::strnicmp(text + this->interval.end, 7, "http://", (size_t)-1, m_locale) == 0) {
+
5502 this->interval.end += 7;
+
5503 if (server.match(text, this->interval.end, end, flags))
+
5504 this->interval.end = server.interval.end;
+
5505 else
+
5506 goto error;
+
5507 if (this->interval.end < end && text[this->interval.end] == ':') {
+
5508 this->interval.end++;
+
5509 if (port.match(text, this->interval.end, end, flags))
+
5510 this->interval.end = port.interval.end;
+
5511 }
+
5512 else {
+
5513 port.invalidate();
+
5514 port.value = 80;
+
5515 }
+
5516 }
+
5517 else {
+
5518 server.invalidate();
+
5519 port.invalidate();
+
5520 port.value = 80;
+
5521 }
+
5522
+
5523 if (path.match(text, this->interval.end, end, flags))
+
5524 this->interval.end = path.interval.end;
+
5525 else
+
5526 goto error;
+
5527
+
5528 params.clear();
+
5529
+
5530 if (this->interval.end < end && text[this->interval.end] == '?') {
+
5531 this->interval.end++;
+
5532 for (;;) {
+
5533 if (this->interval.end < end && text[this->interval.end]) {
+
5534 if ((unsigned int)text[this->interval.end] < 0x20 ||
+
5535 (unsigned int)text[this->interval.end] == 0x7f ||
+
5536 isspace(text[this->interval.end]))
+
5537 break;
+
5538 else if (text[this->interval.end] == '&')
+
5539 this->interval.end++;
+
5540 else {
+ +
5542 if (param.match(text, this->interval.end, end, flags)) {
+
5543 this->interval.end = param.interval.end;
+
5544 params.push_back(std::move(param));
+
5545 }
+
5546 else
+
5547 break;
+
5548 }
+
5549 }
+
5550 else
+
5551 break;
+
5552 }
+
5553 }
+
5554
+
5555 this->interval.start = start;
+
5556 return true;
+
5557
+
5558 error:
+
5559 server.invalidate();
+
5560 port.invalidate();
+
5561 path.invalidate();
+
5562 params.clear();
+
5563 this->interval.start = (this->interval.end = start) + 1;
+
5564 return false;
+
5565 }
+
5566
+
5567 virtual void invalidate()
+
5568 {
+
5569 server.invalidate();
+
5570 port.invalidate();
+
5571 path.invalidate();
+
5572 params.clear();
+
5573 parser::invalidate();
+
5574 }
+
5575
+
5576 public:
+
5577 http_url_server server;
+
5578 http_url_port port;
+
5579 http_url_path path;
+
5580 std::list<http_url_parameter> params;
+
5581 };
-
5581
-
-
5585 class http_language : public parser
-
5586 {
-
5587 public:
-
5588 virtual bool match(
-
5589 _In_reads_or_z_(end) const char* text,
-
5590 _In_ size_t start = 0,
-
5591 _In_ size_t end = (size_t)-1,
-
5592 _In_ int flags = match_default)
-
5593 {
-
5594 assert(text || start >= end);
-
5595 this->interval.end = start;
-
5596 components.clear();
-
5597 for (;;) {
-
5598 if (this->interval.end < end && text[this->interval.end]) {
- -
5600 k.end = this->interval.end;
-
5601 for (;;) {
-
5602 if (k.end < end && text[k.end]) {
-
5603 if (isalpha(text[k.end]))
-
5604 k.end++;
-
5605 else
-
5606 break;
-
5607 }
-
5608 else
-
5609 break;
-
5610 }
-
5611 if (this->interval.end < k.end) {
-
5612 k.start = this->interval.end;
-
5613 this->interval.end = k.end;
-
5614 components.push_back(k);
-
5615 }
-
5616 else
-
5617 break;
-
5618 if (this->interval.end < end && text[this->interval.end] == '-')
-
5619 this->interval.end++;
-
5620 else
-
5621 break;
-
5622 }
-
5623 else
-
5624 break;
-
5625 }
-
5626 if (!components.empty()) {
-
5627 this->interval.start = start;
-
5628 this->interval.end = components.back().end;
-
5629 return true;
-
5630 }
-
5631 this->interval.start = (this->interval.end = start) + 1;
-
5632 return false;
-
5633 }
-
5634
-
5635 virtual void invalidate()
-
5636 {
-
5637 components.clear();
-
5638 parser::invalidate();
-
5639 }
-
5640
-
5641 public:
-
5642 std::vector<stdex::interval<size_t>> components;
-
5643 };
+
5582
+
+
5586 class http_language : public parser
+
5587 {
+
5588 public:
+
5589 virtual bool match(
+
5590 _In_reads_or_z_(end) const char* text,
+
5591 _In_ size_t start = 0,
+
5592 _In_ size_t end = (size_t)-1,
+
5593 _In_ int flags = match_default)
+
5594 {
+
5595 assert(text || start >= end);
+
5596 this->interval.end = start;
+
5597 components.clear();
+
5598 for (;;) {
+
5599 if (this->interval.end < end && text[this->interval.end]) {
+ +
5601 k.end = this->interval.end;
+
5602 for (;;) {
+
5603 if (k.end < end && text[k.end]) {
+
5604 if (isalpha(text[k.end]))
+
5605 k.end++;
+
5606 else
+
5607 break;
+
5608 }
+
5609 else
+
5610 break;
+
5611 }
+
5612 if (this->interval.end < k.end) {
+
5613 k.start = this->interval.end;
+
5614 this->interval.end = k.end;
+
5615 components.push_back(k);
+
5616 }
+
5617 else
+
5618 break;
+
5619 if (this->interval.end < end && text[this->interval.end] == '-')
+
5620 this->interval.end++;
+
5621 else
+
5622 break;
+
5623 }
+
5624 else
+
5625 break;
+
5626 }
+
5627 if (!components.empty()) {
+
5628 this->interval.start = start;
+
5629 this->interval.end = components.back().end;
+
5630 return true;
+
5631 }
+
5632 this->interval.start = (this->interval.end = start) + 1;
+
5633 return false;
+
5634 }
+
5635
+
5636 virtual void invalidate()
+
5637 {
+
5638 components.clear();
+
5639 parser::invalidate();
+
5640 }
+
5641
+
5642 public:
+
5643 std::vector<stdex::interval<size_t>> components;
+
5644 };
-
5644
-
-
5648 class http_weight : public parser
-
5649 {
-
5650 public:
-
5651 http_weight(_In_ const std::locale& locale = std::locale()) :
-
5652 parser(locale),
-
5653 value(1.0f)
-
5654 {}
-
5655
-
5656 virtual bool match(
-
5657 _In_reads_or_z_(end) const char* text,
-
5658 _In_ size_t start = 0,
-
5659 _In_ size_t end = (size_t)-1,
-
5660 _In_ int flags = match_default)
-
5661 {
-
5662 assert(text || start >= end);
-
5663 size_t celi_del = 0, decimalni_del = 0, decimalni_del_n = 1;
-
5664 this->interval.end = start;
-
5665 for (;;) {
-
5666 if (this->interval.end < end && text[this->interval.end]) {
-
5667 if ('0' <= text[this->interval.end] && text[this->interval.end] <= '9') {
-
5668 celi_del = celi_del * 10 + text[this->interval.end] - '0';
-
5669 this->interval.end++;
-
5670 }
-
5671 else if (text[this->interval.end] == '.') {
-
5672 this->interval.end++;
-
5673 for (;;) {
-
5674 if (this->interval.end < end && text[this->interval.end]) {
-
5675 if ('0' <= text[this->interval.end] && text[this->interval.end] <= '9') {
-
5676 decimalni_del = decimalni_del * 10 + text[this->interval.end] - '0';
-
5677 decimalni_del_n *= 10;
-
5678 this->interval.end++;
-
5679 }
-
5680 else
-
5681 break;
-
5682 }
-
5683 else
-
5684 break;
-
5685 }
-
5686 break;
-
5687 }
-
5688 else
-
5689 break;
-
5690 }
-
5691 else
-
5692 break;
-
5693 }
- - -
5696 this->interval.start = start;
-
5697 return true;
-
5698 }
-
5699 value = 1.0f;
-
5700 this->interval.start = (this->interval.end = start) + 1;
-
5701 return false;
-
5702 }
-
5703
-
5704 virtual void invalidate()
-
5705 {
-
5706 value = 1.0f;
-
5707 parser::invalidate();
-
5708 }
-
5709
-
5710 public:
-
5711 float value;
-
5712 };
+
5645
+
+
5649 class http_weight : public parser
+
5650 {
+
5651 public:
+
5652 http_weight(_In_ const std::locale& locale = std::locale()) :
+
5653 parser(locale),
+
5654 value(1.0f)
+
5655 {}
+
5656
+
5657 virtual bool match(
+
5658 _In_reads_or_z_(end) const char* text,
+
5659 _In_ size_t start = 0,
+
5660 _In_ size_t end = (size_t)-1,
+
5661 _In_ int flags = match_default)
+
5662 {
+
5663 assert(text || start >= end);
+
5664 size_t celi_del = 0, decimalni_del = 0, decimalni_del_n = 1;
+
5665 this->interval.end = start;
+
5666 for (;;) {
+
5667 if (this->interval.end < end && text[this->interval.end]) {
+
5668 if ('0' <= text[this->interval.end] && text[this->interval.end] <= '9') {
+
5669 celi_del = celi_del * 10 + text[this->interval.end] - '0';
+
5670 this->interval.end++;
+
5671 }
+
5672 else if (text[this->interval.end] == '.') {
+
5673 this->interval.end++;
+
5674 for (;;) {
+
5675 if (this->interval.end < end && text[this->interval.end]) {
+
5676 if ('0' <= text[this->interval.end] && text[this->interval.end] <= '9') {
+
5677 decimalni_del = decimalni_del * 10 + text[this->interval.end] - '0';
+
5678 decimalni_del_n *= 10;
+
5679 this->interval.end++;
+
5680 }
+
5681 else
+
5682 break;
+
5683 }
+
5684 else
+
5685 break;
+
5686 }
+
5687 break;
+
5688 }
+
5689 else
+
5690 break;
+
5691 }
+
5692 else
+
5693 break;
+
5694 }
+ + +
5697 this->interval.start = start;
+
5698 return true;
+
5699 }
+
5700 value = 1.0f;
+
5701 this->interval.start = (this->interval.end = start) + 1;
+
5702 return false;
+
5703 }
+
5704
+
5705 virtual void invalidate()
+
5706 {
+
5707 value = 1.0f;
+
5708 parser::invalidate();
+
5709 }
+
5710
+
5711 public:
+
5712 float value;
+
5713 };
-
5713
-
-
5717 class http_asterisk : public parser
-
5718 {
-
5719 public:
-
5720 virtual bool match(
-
5721 _In_reads_or_z_(end) const char* text,
-
5722 _In_ size_t start = 0,
-
5723 _In_ size_t end = (size_t)-1,
-
5724 _In_ int flags = match_default)
-
5725 {
-
5726 assert(text || end <= start);
-
5727 if (start < end && text[start] == '*') {
-
5728 this->interval.end = (this->interval.start = start) + 1;
-
5729 return true;
-
5730 }
-
5731 this->interval.start = (this->interval.end = start) + 1;
-
5732 return false;
-
5733 }
-
5734 };
+
5714
+
+
5718 class http_asterisk : public parser
+
5719 {
+
5720 public:
+
5721 virtual bool match(
+
5722 _In_reads_or_z_(end) const char* text,
+
5723 _In_ size_t start = 0,
+
5724 _In_ size_t end = (size_t)-1,
+
5725 _In_ int flags = match_default)
+
5726 {
+
5727 assert(text || end <= start);
+
5728 if (start < end && text[start] == '*') {
+
5729 this->interval.end = (this->interval.start = start) + 1;
+
5730 return true;
+
5731 }
+
5732 this->interval.start = (this->interval.end = start) + 1;
+
5733 return false;
+
5734 }
+
5735 };
-
5735
-
5739 template <class T, class T_asterisk = http_asterisk>
-
- -
5741 {
-
5742 public:
-
5743 http_weighted_value(_In_ const std::locale& locale = std::locale()) :
-
5744 parser(locale),
-
5745 factor(locale)
-
5746 {}
-
5747
-
5748 virtual bool match(
-
5749 _In_reads_or_z_(end) const char* text,
-
5750 _In_ size_t start = 0,
-
5751 _In_ size_t end = (size_t)-1,
-
5752 _In_ int flags = match_default)
-
5753 {
-
5754 assert(text || start >= end);
-
5755 size_t konec_vrednosti;
-
5756 this->interval.end = start;
-
5757 if (asterisk.match(text, this->interval.end, end, flags)) {
-
5758 this->interval.end = konec_vrednosti = asterisk.interval.end;
-
5759 value.invalidate();
-
5760 }
-
5761 else if (value.match(text, this->interval.end, end, flags)) {
-
5762 this->interval.end = konec_vrednosti = value.interval.end;
-
5763 asterisk.invalidate();
-
5764 }
-
5765 else {
-
5766 asterisk.invalidate();
-
5767 value.invalidate();
-
5768 this->interval.start = (this->interval.end = start) + 1;
-
5769 return false;
-
5770 }
-
5771
-
5772 while (this->interval.end < end && text[this->interval.end] && isspace(text[this->interval.end])) this->interval.end++;
-
5773 if (this->interval.end < end && text[this->interval.end] == ';') {
-
5774 this->interval.end++;
-
5775 while (this->interval.end < end && text[this->interval.end] && isspace(text[this->interval.end])) this->interval.end++;
-
5776 if (this->interval.end < end && (text[this->interval.end] == 'q' || text[this->interval.end] == 'Q')) {
-
5777 this->interval.end++;
-
5778 while (this->interval.end < end && text[this->interval.end] && isspace(text[this->interval.end])) this->interval.end++;
-
5779 if (this->interval.end < end && text[this->interval.end] == '=') {
-
5780 this->interval.end++;
-
5781 while (this->interval.end < end && text[this->interval.end] && isspace(text[this->interval.end])) this->interval.end++;
-
5782 if (factor.match(text, this->interval.end, end, flags))
-
5783 this->interval.end = factor.interval.end;
-
5784 }
-
5785 }
-
5786 }
-
5787 if (!factor.interval) {
-
5788 factor.invalidate();
- -
5790 }
-
5791 this->interval.start = start;
-
5792 return true;
-
5793 }
-
5794
-
5795 virtual void invalidate()
-
5796 {
-
5797 asterisk.invalidate();
-
5798 value.invalidate();
-
5799 factor.invalidate();
-
5800 parser::invalidate();
-
5801 }
-
5802
-
5803 public:
-
5804 T_asterisk asterisk;
-
5805 T value;
-
5806 http_weight factor;
-
5807 };
+
5736
+
5740 template <class T, class T_asterisk = http_asterisk>
+
+ +
5742 {
+
5743 public:
+
5744 http_weighted_value(_In_ const std::locale& locale = std::locale()) :
+
5745 parser(locale),
+
5746 factor(locale)
+
5747 {}
+
5748
+
5749 virtual bool match(
+
5750 _In_reads_or_z_(end) const char* text,
+
5751 _In_ size_t start = 0,
+
5752 _In_ size_t end = (size_t)-1,
+
5753 _In_ int flags = match_default)
+
5754 {
+
5755 assert(text || start >= end);
+
5756 size_t konec_vrednosti;
+
5757 this->interval.end = start;
+
5758 if (asterisk.match(text, this->interval.end, end, flags)) {
+
5759 this->interval.end = konec_vrednosti = asterisk.interval.end;
+
5760 value.invalidate();
+
5761 }
+
5762 else if (value.match(text, this->interval.end, end, flags)) {
+
5763 this->interval.end = konec_vrednosti = value.interval.end;
+
5764 asterisk.invalidate();
+
5765 }
+
5766 else {
+
5767 asterisk.invalidate();
+
5768 value.invalidate();
+
5769 this->interval.start = (this->interval.end = start) + 1;
+
5770 return false;
+
5771 }
+
5772
+
5773 while (this->interval.end < end && text[this->interval.end] && isspace(text[this->interval.end])) this->interval.end++;
+
5774 if (this->interval.end < end && text[this->interval.end] == ';') {
+
5775 this->interval.end++;
+
5776 while (this->interval.end < end && text[this->interval.end] && isspace(text[this->interval.end])) this->interval.end++;
+
5777 if (this->interval.end < end && (text[this->interval.end] == 'q' || text[this->interval.end] == 'Q')) {
+
5778 this->interval.end++;
+
5779 while (this->interval.end < end && text[this->interval.end] && isspace(text[this->interval.end])) this->interval.end++;
+
5780 if (this->interval.end < end && text[this->interval.end] == '=') {
+
5781 this->interval.end++;
+
5782 while (this->interval.end < end && text[this->interval.end] && isspace(text[this->interval.end])) this->interval.end++;
+
5783 if (factor.match(text, this->interval.end, end, flags))
+
5784 this->interval.end = factor.interval.end;
+
5785 }
+
5786 }
+
5787 }
+
5788 if (!factor.interval) {
+
5789 factor.invalidate();
+ +
5791 }
+
5792 this->interval.start = start;
+
5793 return true;
+
5794 }
+
5795
+
5796 virtual void invalidate()
+
5797 {
+
5798 asterisk.invalidate();
+
5799 value.invalidate();
+
5800 factor.invalidate();
+
5801 parser::invalidate();
+
5802 }
+
5803
+
5804 public:
+
5805 T_asterisk asterisk;
+
5806 T value;
+
5807 http_weight factor;
+
5808 };
-
5808
-
- -
5813 {
-
5814 public:
-
5815 virtual bool match(
-
5816 _In_reads_or_z_(end) const char* text,
-
5817 _In_ size_t start = 0,
-
5818 _In_ size_t end = (size_t)-1,
-
5819 _In_ int flags = match_default)
-
5820 {
-
5821 assert(text || start >= end);
-
5822 this->interval.end = start;
-
5823 if (this->interval.end < end && text[this->interval.end] == '$')
-
5824 this->interval.end++;
-
5825 else
-
5826 goto error;
-
5827 if (name.match(text, this->interval.end, end, flags))
-
5828 this->interval.end = name.interval.end;
-
5829 else
-
5830 goto error;
-
5831 while (m_space.match(text, this->interval.end, end, flags))
-
5832 this->interval.end = m_space.interval.end;
-
5833 if (this->interval.end < end && text[this->interval.end] == '=')
-
5834 this->interval.end++;
-
5835 else
-
5836 goto error;
-
5837 while (m_space.match(text, this->interval.end, end, flags))
-
5838 this->interval.end = m_space.interval.end;
-
5839 if (value.match(text, this->interval.end, end, flags))
-
5840 this->interval.end = value.interval.end;
-
5841 else
-
5842 goto error;
-
5843 this->interval.start = start;
-
5844 return true;
-
5845
-
5846 error:
-
5847 name.invalidate();
-
5848 value.invalidate();
-
5849 this->interval.start = (this->interval.end = start) + 1;
-
5850 return false;
-
5851 }
-
5852
-
5853 virtual void invalidate()
-
5854 {
-
5855 name.invalidate();
-
5856 value.invalidate();
-
5857 parser::invalidate();
-
5858 }
-
5859
-
5860 public:
-
5861 http_token name;
-
5862 http_value value;
-
5863
-
5864 protected:
-
5865 http_space m_space;
-
5866 };
+
5809
+
+ +
5814 {
+
5815 public:
+
5816 virtual bool match(
+
5817 _In_reads_or_z_(end) const char* text,
+
5818 _In_ size_t start = 0,
+
5819 _In_ size_t end = (size_t)-1,
+
5820 _In_ int flags = match_default)
+
5821 {
+
5822 assert(text || start >= end);
+
5823 this->interval.end = start;
+
5824 if (this->interval.end < end && text[this->interval.end] == '$')
+
5825 this->interval.end++;
+
5826 else
+
5827 goto error;
+
5828 if (name.match(text, this->interval.end, end, flags))
+
5829 this->interval.end = name.interval.end;
+
5830 else
+
5831 goto error;
+
5832 while (m_space.match(text, this->interval.end, end, flags))
+
5833 this->interval.end = m_space.interval.end;
+
5834 if (this->interval.end < end && text[this->interval.end] == '=')
+
5835 this->interval.end++;
+
5836 else
+
5837 goto error;
+
5838 while (m_space.match(text, this->interval.end, end, flags))
+
5839 this->interval.end = m_space.interval.end;
+
5840 if (value.match(text, this->interval.end, end, flags))
+
5841 this->interval.end = value.interval.end;
+
5842 else
+
5843 goto error;
+
5844 this->interval.start = start;
+
5845 return true;
+
5846
+
5847 error:
+
5848 name.invalidate();
+
5849 value.invalidate();
+
5850 this->interval.start = (this->interval.end = start) + 1;
+
5851 return false;
+
5852 }
+
5853
+
5854 virtual void invalidate()
+
5855 {
+
5856 name.invalidate();
+
5857 value.invalidate();
+
5858 parser::invalidate();
+
5859 }
+
5860
+
5861 public:
+
5862 http_token name;
+
5863 http_value value;
+
5864
+
5865 protected:
+
5866 http_space m_space;
+
5867 };
-
5867
-
-
5871 class http_cookie : public parser
-
5872 {
-
5873 public:
-
5874 virtual bool match(
-
5875 _In_reads_or_z_(end) const char* text,
-
5876 _In_ size_t start = 0,
-
5877 _In_ size_t end = (size_t)-1,
-
5878 _In_ int flags = match_default)
-
5879 {
-
5880 assert(text || start >= end);
-
5881 this->interval.end = start;
-
5882 if (name.match(text, this->interval.end, end, flags))
-
5883 this->interval.end = name.interval.end;
-
5884 else
-
5885 goto error;
-
5886 while (m_space.match(text, this->interval.end, end, flags))
-
5887 this->interval.end = m_space.interval.end;
-
5888 if (this->interval.end < end && text[this->interval.end] == '=')
-
5889 this->interval.end++;
-
5890 else
-
5891 goto error;
-
5892 while (m_space.match(text, this->interval.end, end, flags))
-
5893 this->interval.end = m_space.interval.end;
-
5894 if (value.match(text, this->interval.end, end, flags))
-
5895 this->interval.end = value.interval.end;
-
5896 else
-
5897 goto error;
-
5898 params.clear();
-
5899 for (;;) {
-
5900 if (this->interval.end < end && text[this->interval.end]) {
-
5901 if (m_space.match(text, this->interval.end, end, flags))
-
5902 this->interval.end = m_space.interval.end;
-
5903 else if (text[this->interval.end] == ';') {
-
5904 this->interval.end++;
-
5905 while (m_space.match(text, this->interval.end, end, flags))
-
5906 this->interval.end = m_space.interval.end;
- -
5908 if (param.match(text, this->interval.end, end, flags)) {
-
5909 this->interval.end = param.interval.end;
-
5910 params.push_back(std::move(param));
-
5911 }
-
5912 else
-
5913 break;
-
5914 }
-
5915 else
-
5916 break;
-
5917 }
-
5918 else
-
5919 break;
-
5920 }
-
5921 this->interval.start = start;
-
5922 this->interval.end = params.empty() ? value.interval.end : params.back().interval.end;
-
5923 return true;
-
5924
-
5925 error:
-
5926 name.invalidate();
-
5927 value.invalidate();
-
5928 params.clear();
-
5929 this->interval.start = (this->interval.end = start) + 1;
-
5930 return false;
-
5931 }
-
5932
-
5933 virtual void invalidate()
-
5934 {
-
5935 name.invalidate();
-
5936 value.invalidate();
-
5937 params.clear();
-
5938 parser::invalidate();
-
5939 }
-
5940
-
5941 public:
- - -
5944 std::list<http_cookie_parameter> params;
-
5945
-
5946 protected:
-
5947 http_space m_space;
-
5948 };
+
5868
+
+
5872 class http_cookie : public parser
+
5873 {
+
5874 public:
+
5875 virtual bool match(
+
5876 _In_reads_or_z_(end) const char* text,
+
5877 _In_ size_t start = 0,
+
5878 _In_ size_t end = (size_t)-1,
+
5879 _In_ int flags = match_default)
+
5880 {
+
5881 assert(text || start >= end);
+
5882 this->interval.end = start;
+
5883 if (name.match(text, this->interval.end, end, flags))
+
5884 this->interval.end = name.interval.end;
+
5885 else
+
5886 goto error;
+
5887 while (m_space.match(text, this->interval.end, end, flags))
+
5888 this->interval.end = m_space.interval.end;
+
5889 if (this->interval.end < end && text[this->interval.end] == '=')
+
5890 this->interval.end++;
+
5891 else
+
5892 goto error;
+
5893 while (m_space.match(text, this->interval.end, end, flags))
+
5894 this->interval.end = m_space.interval.end;
+
5895 if (value.match(text, this->interval.end, end, flags))
+
5896 this->interval.end = value.interval.end;
+
5897 else
+
5898 goto error;
+
5899 params.clear();
+
5900 for (;;) {
+
5901 if (this->interval.end < end && text[this->interval.end]) {
+
5902 if (m_space.match(text, this->interval.end, end, flags))
+
5903 this->interval.end = m_space.interval.end;
+
5904 else if (text[this->interval.end] == ';') {
+
5905 this->interval.end++;
+
5906 while (m_space.match(text, this->interval.end, end, flags))
+
5907 this->interval.end = m_space.interval.end;
+ +
5909 if (param.match(text, this->interval.end, end, flags)) {
+
5910 this->interval.end = param.interval.end;
+
5911 params.push_back(std::move(param));
+
5912 }
+
5913 else
+
5914 break;
+
5915 }
+
5916 else
+
5917 break;
+
5918 }
+
5919 else
+
5920 break;
+
5921 }
+
5922 this->interval.start = start;
+
5923 this->interval.end = params.empty() ? value.interval.end : params.back().interval.end;
+
5924 return true;
+
5925
+
5926 error:
+
5927 name.invalidate();
+
5928 value.invalidate();
+
5929 params.clear();
+
5930 this->interval.start = (this->interval.end = start) + 1;
+
5931 return false;
+
5932 }
+
5933
+
5934 virtual void invalidate()
+
5935 {
+
5936 name.invalidate();
+
5937 value.invalidate();
+
5938 params.clear();
+
5939 parser::invalidate();
+
5940 }
+
5941
+
5942 public:
+ + +
5945 std::list<http_cookie_parameter> params;
+
5946
+
5947 protected:
+
5948 http_space m_space;
+
5949 };
-
5949
-
-
5953 class http_agent : public parser
-
5954 {
-
5955 public:
-
5956 virtual bool match(
-
5957 _In_reads_or_z_(end) const char* text,
-
5958 _In_ size_t start = 0,
-
5959 _In_ size_t end = (size_t)-1,
-
5960 _In_ int flags = match_default)
-
5961 {
-
5962 assert(text || start >= end);
-
5963 this->interval.end = start;
-
5964 type.start = this->interval.end;
-
5965 for (;;) {
-
5966 if (this->interval.end < end && text[this->interval.end]) {
-
5967 if (text[this->interval.end] == '/') {
-
5968 type.end = this->interval.end;
-
5969 this->interval.end++;
-
5970 version.start = this->interval.end;
-
5971 for (;;) {
-
5972 if (this->interval.end < end && text[this->interval.end]) {
-
5973 if (isspace(text[this->interval.end])) {
-
5974 version.end = this->interval.end;
-
5975 break;
-
5976 }
-
5977 else
-
5978 this->interval.end++;
-
5979 }
-
5980 else {
-
5981 version.end = this->interval.end;
-
5982 break;
-
5983 }
-
5984 }
-
5985 break;
-
5986 }
-
5987 else if (isspace(text[this->interval.end])) {
-
5988 type.end = this->interval.end;
-
5989 break;
-
5990 }
-
5991 else
-
5992 this->interval.end++;
-
5993 }
-
5994 else {
-
5995 type.end = this->interval.end;
-
5996 break;
-
5997 }
-
5998 }
- -
6000 this->interval.start = start;
-
6001 return true;
-
6002 }
-
6003 type.start = 1;
-
6004 type.end = 0;
-
6005 version.start = 1;
-
6006 version.end = 0;
-
6007 this->interval.start = 1;
-
6008 this->interval.end = 0;
-
6009 return false;
-
6010 }
-
6011
-
6012 virtual void invalidate()
-
6013 {
-
6014 type.start = 1;
-
6015 type.end = 0;
-
6016 version.start = 1;
-
6017 version.end = 0;
-
6018 parser::invalidate();
-
6019 }
-
6020
-
6021 public:
- - -
6024 };
+
5950
+
+
5954 class http_agent : public parser
+
5955 {
+
5956 public:
+
5957 virtual bool match(
+
5958 _In_reads_or_z_(end) const char* text,
+
5959 _In_ size_t start = 0,
+
5960 _In_ size_t end = (size_t)-1,
+
5961 _In_ int flags = match_default)
+
5962 {
+
5963 assert(text || start >= end);
+
5964 this->interval.end = start;
+
5965 type.start = this->interval.end;
+
5966 for (;;) {
+
5967 if (this->interval.end < end && text[this->interval.end]) {
+
5968 if (text[this->interval.end] == '/') {
+
5969 type.end = this->interval.end;
+
5970 this->interval.end++;
+
5971 version.start = this->interval.end;
+
5972 for (;;) {
+
5973 if (this->interval.end < end && text[this->interval.end]) {
+
5974 if (isspace(text[this->interval.end])) {
+
5975 version.end = this->interval.end;
+
5976 break;
+
5977 }
+
5978 else
+
5979 this->interval.end++;
+
5980 }
+
5981 else {
+
5982 version.end = this->interval.end;
+
5983 break;
+
5984 }
+
5985 }
+
5986 break;
+
5987 }
+
5988 else if (isspace(text[this->interval.end])) {
+
5989 type.end = this->interval.end;
+
5990 break;
+
5991 }
+
5992 else
+
5993 this->interval.end++;
+
5994 }
+
5995 else {
+
5996 type.end = this->interval.end;
+
5997 break;
+
5998 }
+
5999 }
+ +
6001 this->interval.start = start;
+
6002 return true;
+
6003 }
+
6004 type.start = 1;
+
6005 type.end = 0;
+
6006 version.start = 1;
+
6007 version.end = 0;
+
6008 this->interval.start = 1;
+
6009 this->interval.end = 0;
+
6010 return false;
+
6011 }
+
6012
+
6013 virtual void invalidate()
+
6014 {
+
6015 type.start = 1;
+
6016 type.end = 0;
+
6017 version.start = 1;
+
6018 version.end = 0;
+
6019 parser::invalidate();
+
6020 }
+
6021
+
6022 public:
+ + +
6025 };
-
6025
-
-
6029 class http_protocol : public parser
-
6030 {
-
6031 public:
-
6032 http_protocol(_In_ const std::locale& locale = std::locale()) :
-
6033 parser(locale),
-
6034 version(0x009)
-
6035 {}
-
6036
-
6037 virtual bool match(
-
6038 _In_reads_or_z_(end) const char* text,
-
6039 _In_ size_t start = 0,
-
6040 _In_ size_t end = (size_t)-1,
-
6041 _In_ int flags = match_default)
-
6042 {
-
6043 assert(text || start >= end);
-
6044 this->interval.end = start;
-
6045 type.start = this->interval.end;
-
6046 for (;;) {
-
6047 if (this->interval.end < end && text[this->interval.end]) {
-
6048 if (text[this->interval.end] == '/') {
-
6049 type.end = this->interval.end;
-
6050 this->interval.end++;
-
6051 break;
-
6052 }
-
6053 else if (isspace(text[this->interval.end]))
-
6054 goto error;
-
6055 else
-
6056 this->interval.end++;
-
6057 }
-
6058 else {
-
6059 type.end = this->interval.end;
-
6060 goto error;
-
6061 }
-
6062 }
-
6063 version_maj.start = this->interval.end;
-
6064 for (;;) {
-
6065 if (this->interval.end < end && text[this->interval.end]) {
-
6066 if (text[this->interval.end] == '.') {
-
6067 version_maj.end = this->interval.end;
-
6068 this->interval.end++;
-
6069 version_min.start = this->interval.end;
-
6070 for (;;) {
-
6071 if (this->interval.end < end && text[this->interval.end]) {
-
6072 if (isspace(text[this->interval.end])) {
-
6073 version_min.end = this->interval.end;
-
6074 version =
-
6075 (uint16_t)strtoui(text + version_maj.start, version_maj.size(), nullptr, 10) * 0x100 +
-
6076 (uint16_t)strtoui(text + version_min.start, version_min.size(), nullptr, 10);
-
6077 break;
-
6078 }
-
6079 else
-
6080 this->interval.end++;
-
6081 }
-
6082 else
-
6083 goto error;
-
6084 }
-
6085 break;
-
6086 }
-
6087 else if (isspace(text[this->interval.end])) {
-
6088 version_maj.end = this->interval.end;
-
6089 version_min.start = 1;
-
6090 version_min.end = 0;
-
6091 version = (uint16_t)strtoui(text + version_maj.start, version_maj.size(), nullptr, 10) * 0x100;
-
6092 break;
-
6093 }
-
6094 else
-
6095 this->interval.end++;
-
6096 }
-
6097 else
-
6098 goto error;
-
6099 }
-
6100 this->interval.start = start;
-
6101 return true;
-
6102
-
6103 error:
-
6104 type.start = 1;
-
6105 type.end = 0;
-
6106 version_maj.start = 1;
-
6107 version_maj.end = 0;
-
6108 version_min.start = 1;
-
6109 version_min.end = 0;
-
6110 version = 0x009;
-
6111 this->interval.start = 1;
-
6112 this->interval.end = 0;
-
6113 return false;
-
6114 }
-
6115
-
6116 virtual void invalidate()
-
6117 {
-
6118 type.start = 1;
-
6119 type.end = 0;
-
6120 version_maj.start = 1;
-
6121 version_maj.end = 0;
-
6122 version_min.start = 1;
-
6123 version_min.end = 0;
-
6124 version = 0x009;
-
6125 parser::invalidate();
-
6126 }
-
6127
-
6128 public:
- -
6130 stdex::interval<size_t> version_maj;
-
6131 stdex::interval<size_t> version_min;
- -
6133 };
+
6026
+
+
6030 class http_protocol : public parser
+
6031 {
+
6032 public:
+
6033 http_protocol(_In_ const std::locale& locale = std::locale()) :
+
6034 parser(locale),
+
6035 version(0x009)
+
6036 {}
+
6037
+
6038 virtual bool match(
+
6039 _In_reads_or_z_(end) const char* text,
+
6040 _In_ size_t start = 0,
+
6041 _In_ size_t end = (size_t)-1,
+
6042 _In_ int flags = match_default)
+
6043 {
+
6044 assert(text || start >= end);
+
6045 this->interval.end = start;
+
6046 type.start = this->interval.end;
+
6047 for (;;) {
+
6048 if (this->interval.end < end && text[this->interval.end]) {
+
6049 if (text[this->interval.end] == '/') {
+
6050 type.end = this->interval.end;
+
6051 this->interval.end++;
+
6052 break;
+
6053 }
+
6054 else if (isspace(text[this->interval.end]))
+
6055 goto error;
+
6056 else
+
6057 this->interval.end++;
+
6058 }
+
6059 else {
+
6060 type.end = this->interval.end;
+
6061 goto error;
+
6062 }
+
6063 }
+
6064 version_maj.start = this->interval.end;
+
6065 for (;;) {
+
6066 if (this->interval.end < end && text[this->interval.end]) {
+
6067 if (text[this->interval.end] == '.') {
+
6068 version_maj.end = this->interval.end;
+
6069 this->interval.end++;
+
6070 version_min.start = this->interval.end;
+
6071 for (;;) {
+
6072 if (this->interval.end < end && text[this->interval.end]) {
+
6073 if (isspace(text[this->interval.end])) {
+
6074 version_min.end = this->interval.end;
+
6075 version =
+
6076 (uint16_t)strtoui(text + version_maj.start, version_maj.size(), nullptr, 10) * 0x100 +
+
6077 (uint16_t)strtoui(text + version_min.start, version_min.size(), nullptr, 10);
+
6078 break;
+
6079 }
+
6080 else
+
6081 this->interval.end++;
+
6082 }
+
6083 else
+
6084 goto error;
+
6085 }
+
6086 break;
+
6087 }
+
6088 else if (isspace(text[this->interval.end])) {
+
6089 version_maj.end = this->interval.end;
+
6090 version_min.start = 1;
+
6091 version_min.end = 0;
+
6092 version = (uint16_t)strtoui(text + version_maj.start, version_maj.size(), nullptr, 10) * 0x100;
+
6093 break;
+
6094 }
+
6095 else
+
6096 this->interval.end++;
+
6097 }
+
6098 else
+
6099 goto error;
+
6100 }
+
6101 this->interval.start = start;
+
6102 return true;
+
6103
+
6104 error:
+
6105 type.start = 1;
+
6106 type.end = 0;
+
6107 version_maj.start = 1;
+
6108 version_maj.end = 0;
+
6109 version_min.start = 1;
+
6110 version_min.end = 0;
+
6111 version = 0x009;
+
6112 this->interval.start = 1;
+
6113 this->interval.end = 0;
+
6114 return false;
+
6115 }
+
6116
+
6117 virtual void invalidate()
+
6118 {
+
6119 type.start = 1;
+
6120 type.end = 0;
+
6121 version_maj.start = 1;
+
6122 version_maj.end = 0;
+
6123 version_min.start = 1;
+
6124 version_min.end = 0;
+
6125 version = 0x009;
+
6126 parser::invalidate();
+
6127 }
+
6128
+
6129 public:
+ +
6131 stdex::interval<size_t> version_maj;
+
6132 stdex::interval<size_t> version_min;
+ +
6134 };
-
6134
-
-
6138 class http_request : public parser
-
6139 {
-
6140 public:
-
6141 http_request(_In_ const std::locale& locale = std::locale()) :
-
6142 parser(locale),
-
6143 url(locale),
-
6144 protocol(locale)
-
6145 {}
-
6146
-
6147 virtual bool match(
-
6148 _In_reads_or_z_(end) const char* text,
-
6149 _In_ size_t start = 0,
-
6150 _In_ size_t end = (size_t)-1,
-
6151 _In_ int flags = match_default)
-
6152 {
-
6153 assert(text || start >= end);
-
6154 this->interval.end = start;
-
6155
-
6156 for (;;) {
-
6157 if (m_line_break.match(text, this->interval.end, end, flags))
-
6158 goto error;
-
6159 else if (this->interval.end < end && text[this->interval.end]) {
-
6160 if (isspace(text[this->interval.end]))
-
6161 this->interval.end++;
-
6162 else
-
6163 break;
-
6164 }
-
6165 else
-
6166 goto error;
-
6167 }
-
6168 verb.start = this->interval.end;
-
6169 for (;;) {
-
6170 if (m_line_break.match(text, this->interval.end, end, flags))
-
6171 goto error;
-
6172 else if (this->interval.end < end && text[this->interval.end]) {
-
6173 if (isspace(text[this->interval.end])) {
-
6174 verb.end = this->interval.end;
-
6175 this->interval.end++;
-
6176 break;
-
6177 }
-
6178 else
-
6179 this->interval.end++;
-
6180 }
-
6181 else
-
6182 goto error;
-
6183 }
-
6184
-
6185 for (;;) {
-
6186 if (m_line_break.match(text, this->interval.end, end, flags))
-
6187 goto error;
-
6188 else if (this->interval.end < end && text[this->interval.end]) {
-
6189 if (isspace(text[this->interval.end]))
-
6190 this->interval.end++;
-
6191 else
-
6192 break;
-
6193 }
-
6194 else
-
6195 goto error;
-
6196 }
-
6197 if (url.match(text, this->interval.end, end, flags))
-
6198 this->interval.end = url.interval.end;
-
6199 else
-
6200 goto error;
-
6201
-
6202 protocol.invalidate();
-
6203 for (;;) {
-
6204 if (m_line_break.match(text, this->interval.end, end, flags)) {
-
6205 this->interval.end = m_line_break.interval.end;
-
6206 goto end;
-
6207 }
-
6208 else if (this->interval.end < end && text[this->interval.end]) {
-
6209 if (isspace(text[this->interval.end]))
-
6210 this->interval.end++;
-
6211 else
-
6212 break;
-
6213 }
-
6214 else
-
6215 goto end;
-
6216 }
-
6217 for (;;) {
-
6218 if (m_line_break.match(text, this->interval.end, end, flags)) {
-
6219 this->interval.end = m_line_break.interval.end;
-
6220 goto end;
-
6221 }
-
6222 else if (protocol.match(text, this->interval.end, end, flags)) {
-
6223 this->interval.end = protocol.interval.end;
-
6224 break;
-
6225 }
-
6226 else
-
6227 goto end;
-
6228 }
-
6229
-
6230 for (;;) {
-
6231 if (m_line_break.match(text, this->interval.end, end, flags)) {
-
6232 this->interval.end = m_line_break.interval.end;
-
6233 break;
-
6234 }
-
6235 else if (this->interval.end < end && text[this->interval.end])
-
6236 this->interval.end++;
-
6237 else
-
6238 goto end;
-
6239 }
-
6240
-
6241 end:
-
6242 this->interval.start = start;
-
6243 return true;
-
6244
-
6245 error:
-
6246 verb.start = 1;
-
6247 verb.end = 0;
-
6248 url.invalidate();
-
6249 protocol.invalidate();
-
6250 this->interval.start = 1;
-
6251 this->interval.end = 0;
-
6252 return false;
-
6253 }
-
6254
-
6255 virtual void invalidate()
-
6256 {
-
6257 verb.start = 1;
-
6258 verb.end = 0;
-
6259 url.invalidate();
-
6260 protocol.invalidate();
-
6261 parser::invalidate();
-
6262 }
-
6263
-
6264 public:
- -
6266 http_url url;
-
6267 http_protocol protocol;
-
6268
-
6269 protected:
-
6270 http_line_break m_line_break;
-
6271 };
+
6135
+
+
6139 class http_request : public parser
+
6140 {
+
6141 public:
+
6142 http_request(_In_ const std::locale& locale = std::locale()) :
+
6143 parser(locale),
+
6144 url(locale),
+
6145 protocol(locale)
+
6146 {}
+
6147
+
6148 virtual bool match(
+
6149 _In_reads_or_z_(end) const char* text,
+
6150 _In_ size_t start = 0,
+
6151 _In_ size_t end = (size_t)-1,
+
6152 _In_ int flags = match_default)
+
6153 {
+
6154 assert(text || start >= end);
+
6155 this->interval.end = start;
+
6156
+
6157 for (;;) {
+
6158 if (m_line_break.match(text, this->interval.end, end, flags))
+
6159 goto error;
+
6160 else if (this->interval.end < end && text[this->interval.end]) {
+
6161 if (isspace(text[this->interval.end]))
+
6162 this->interval.end++;
+
6163 else
+
6164 break;
+
6165 }
+
6166 else
+
6167 goto error;
+
6168 }
+
6169 verb.start = this->interval.end;
+
6170 for (;;) {
+
6171 if (m_line_break.match(text, this->interval.end, end, flags))
+
6172 goto error;
+
6173 else if (this->interval.end < end && text[this->interval.end]) {
+
6174 if (isspace(text[this->interval.end])) {
+
6175 verb.end = this->interval.end;
+
6176 this->interval.end++;
+
6177 break;
+
6178 }
+
6179 else
+
6180 this->interval.end++;
+
6181 }
+
6182 else
+
6183 goto error;
+
6184 }
+
6185
+
6186 for (;;) {
+
6187 if (m_line_break.match(text, this->interval.end, end, flags))
+
6188 goto error;
+
6189 else if (this->interval.end < end && text[this->interval.end]) {
+
6190 if (isspace(text[this->interval.end]))
+
6191 this->interval.end++;
+
6192 else
+
6193 break;
+
6194 }
+
6195 else
+
6196 goto error;
+
6197 }
+
6198 if (url.match(text, this->interval.end, end, flags))
+
6199 this->interval.end = url.interval.end;
+
6200 else
+
6201 goto error;
+
6202
+
6203 protocol.invalidate();
+
6204 for (;;) {
+
6205 if (m_line_break.match(text, this->interval.end, end, flags)) {
+
6206 this->interval.end = m_line_break.interval.end;
+
6207 goto end;
+
6208 }
+
6209 else if (this->interval.end < end && text[this->interval.end]) {
+
6210 if (isspace(text[this->interval.end]))
+
6211 this->interval.end++;
+
6212 else
+
6213 break;
+
6214 }
+
6215 else
+
6216 goto end;
+
6217 }
+
6218 for (;;) {
+
6219 if (m_line_break.match(text, this->interval.end, end, flags)) {
+
6220 this->interval.end = m_line_break.interval.end;
+
6221 goto end;
+
6222 }
+
6223 else if (protocol.match(text, this->interval.end, end, flags)) {
+
6224 this->interval.end = protocol.interval.end;
+
6225 break;
+
6226 }
+
6227 else
+
6228 goto end;
+
6229 }
+
6230
+
6231 for (;;) {
+
6232 if (m_line_break.match(text, this->interval.end, end, flags)) {
+
6233 this->interval.end = m_line_break.interval.end;
+
6234 break;
+
6235 }
+
6236 else if (this->interval.end < end && text[this->interval.end])
+
6237 this->interval.end++;
+
6238 else
+
6239 goto end;
+
6240 }
+
6241
+
6242 end:
+
6243 this->interval.start = start;
+
6244 return true;
+
6245
+
6246 error:
+
6247 verb.start = 1;
+
6248 verb.end = 0;
+
6249 url.invalidate();
+
6250 protocol.invalidate();
+
6251 this->interval.start = 1;
+
6252 this->interval.end = 0;
+
6253 return false;
+
6254 }
+
6255
+
6256 virtual void invalidate()
+
6257 {
+
6258 verb.start = 1;
+
6259 verb.end = 0;
+
6260 url.invalidate();
+
6261 protocol.invalidate();
+
6262 parser::invalidate();
+
6263 }
+
6264
+
6265 public:
+ +
6267 http_url url;
+
6268 http_protocol protocol;
+
6269
+
6270 protected:
+
6271 http_line_break m_line_break;
+
6272 };
-
6272
-
-
6276 class http_header : public parser
-
6277 {
-
6278 public:
-
6279 virtual bool match(
-
6280 _In_reads_or_z_(end) const char* text,
-
6281 _In_ size_t start = 0,
-
6282 _In_ size_t end = (size_t)-1,
-
6283 _In_ int flags = match_default)
-
6284 {
-
6285 assert(text || start >= end);
-
6286 this->interval.end = start;
-
6287
-
6288 if (m_line_break.match(text, this->interval.end, end, flags) ||
-
6289 (this->interval.end < end && text[this->interval.end] && isspace(text[this->interval.end])))
-
6290 goto error;
-
6291 name.start = this->interval.end;
-
6292 for (;;) {
-
6293 if (m_line_break.match(text, this->interval.end, end, flags))
-
6294 goto error;
-
6295 else if (this->interval.end < end && text[this->interval.end]) {
-
6296 if (isspace(text[this->interval.end])) {
-
6297 name.end = this->interval.end;
-
6298 this->interval.end++;
-
6299 for (;;) {
-
6300 if (m_line_break.match(text, this->interval.end, end, flags))
-
6301 goto error;
-
6302 else if (this->interval.end < end && text[this->interval.end]) {
-
6303 if (isspace(text[this->interval.end]))
-
6304 this->interval.end++;
-
6305 else
-
6306 break;
-
6307 }
-
6308 else
-
6309 goto error;
-
6310 }
-
6311 if (this->interval.end < end && text[this->interval.end] == ':') {
-
6312 this->interval.end++;
-
6313 break;
-
6314 }
-
6315 else
-
6316 goto error;
-
6317 break;
-
6318 }
-
6319 else if (text[this->interval.end] == ':') {
-
6320 name.end = this->interval.end;
-
6321 this->interval.end++;
-
6322 break;
-
6323 }
-
6324 else
-
6325 this->interval.end++;
-
6326 }
-
6327 else
-
6328 goto error;
-
6329 }
-
6330 value.start = (size_t)-1;
-
6331 value.end = 0;
-
6332 for (;;) {
-
6333 if (m_line_break.match(text, this->interval.end, end, flags)) {
-
6334 this->interval.end = m_line_break.interval.end;
-
6335 if (!m_line_break.match(text, this->interval.end, end, flags) &&
-
6336 this->interval.end < end && text[this->interval.end] && isspace(text[this->interval.end]))
-
6337 this->interval.end++;
-
6338 else
-
6339 break;
-
6340 }
-
6341 else if (this->interval.end < end && text[this->interval.end]) {
-
6342 if (isspace(text[this->interval.end]))
-
6343 this->interval.end++;
-
6344 else {
-
6345 if (value.start == (size_t)-1) value.start = this->interval.end;
-
6346 value.end = ++this->interval.end;
-
6347 }
-
6348 }
-
6349 else
-
6350 break;
-
6351 }
-
6352 this->interval.start = start;
-
6353 return true;
-
6354
-
6355 error:
-
6356 name.start = 1;
-
6357 name.end = 0;
-
6358 value.start = 1;
-
6359 value.end = 0;
-
6360 this->interval.start = 1;
-
6361 this->interval.end = 0;
-
6362 return false;
-
6363 }
-
6364
-
6365 virtual void invalidate()
-
6366 {
-
6367 name.start = 1;
-
6368 name.end = 0;
-
6369 value.start = 1;
-
6370 value.end = 0;
-
6371 parser::invalidate();
-
6372 }
-
6373
-
6374 public:
- - -
6377
-
6378 protected:
-
6379 http_line_break m_line_break;
-
6380 };
+
6273
+
+
6277 class http_header : public parser
+
6278 {
+
6279 public:
+
6280 virtual bool match(
+
6281 _In_reads_or_z_(end) const char* text,
+
6282 _In_ size_t start = 0,
+
6283 _In_ size_t end = (size_t)-1,
+
6284 _In_ int flags = match_default)
+
6285 {
+
6286 assert(text || start >= end);
+
6287 this->interval.end = start;
+
6288
+
6289 if (m_line_break.match(text, this->interval.end, end, flags) ||
+
6290 (this->interval.end < end && text[this->interval.end] && isspace(text[this->interval.end])))
+
6291 goto error;
+
6292 name.start = this->interval.end;
+
6293 for (;;) {
+
6294 if (m_line_break.match(text, this->interval.end, end, flags))
+
6295 goto error;
+
6296 else if (this->interval.end < end && text[this->interval.end]) {
+
6297 if (isspace(text[this->interval.end])) {
+
6298 name.end = this->interval.end;
+
6299 this->interval.end++;
+
6300 for (;;) {
+
6301 if (m_line_break.match(text, this->interval.end, end, flags))
+
6302 goto error;
+
6303 else if (this->interval.end < end && text[this->interval.end]) {
+
6304 if (isspace(text[this->interval.end]))
+
6305 this->interval.end++;
+
6306 else
+
6307 break;
+
6308 }
+
6309 else
+
6310 goto error;
+
6311 }
+
6312 if (this->interval.end < end && text[this->interval.end] == ':') {
+
6313 this->interval.end++;
+
6314 break;
+
6315 }
+
6316 else
+
6317 goto error;
+
6318 break;
+
6319 }
+
6320 else if (text[this->interval.end] == ':') {
+
6321 name.end = this->interval.end;
+
6322 this->interval.end++;
+
6323 break;
+
6324 }
+
6325 else
+
6326 this->interval.end++;
+
6327 }
+
6328 else
+
6329 goto error;
+
6330 }
+
6331 value.start = (size_t)-1;
+
6332 value.end = 0;
+
6333 for (;;) {
+
6334 if (m_line_break.match(text, this->interval.end, end, flags)) {
+
6335 this->interval.end = m_line_break.interval.end;
+
6336 if (!m_line_break.match(text, this->interval.end, end, flags) &&
+
6337 this->interval.end < end && text[this->interval.end] && isspace(text[this->interval.end]))
+
6338 this->interval.end++;
+
6339 else
+
6340 break;
+
6341 }
+
6342 else if (this->interval.end < end && text[this->interval.end]) {
+
6343 if (isspace(text[this->interval.end]))
+
6344 this->interval.end++;
+
6345 else {
+
6346 if (value.start == (size_t)-1) value.start = this->interval.end;
+
6347 value.end = ++this->interval.end;
+
6348 }
+
6349 }
+
6350 else
+
6351 break;
+
6352 }
+
6353 this->interval.start = start;
+
6354 return true;
+
6355
+
6356 error:
+
6357 name.start = 1;
+
6358 name.end = 0;
+
6359 value.start = 1;
+
6360 value.end = 0;
+
6361 this->interval.start = 1;
+
6362 this->interval.end = 0;
+
6363 return false;
+
6364 }
+
6365
+
6366 virtual void invalidate()
+
6367 {
+
6368 name.start = 1;
+
6369 name.end = 0;
+
6370 value.start = 1;
+
6371 value.end = 0;
+
6372 parser::invalidate();
+
6373 }
+
6374
+
6375 public:
+ + +
6378
+
6379 protected:
+
6380 http_line_break m_line_break;
+
6381 };
-
6381
-
6385 template <class _Key, class T>
-
-
6386 class http_value_collection : public T
-
6387 {
-
6388 public:
-
6389 void insert(
-
6390 _In_reads_or_z_(end) const char* text,
-
6391 _In_ size_t start = 0,
-
6392 _In_ size_t end = (size_t)-1,
-
6393 _In_ int flags = match_default)
-
6394 {
-
6395 while (start < end) {
-
6396 while (start < end && text[start] && isspace(text[start])) start++;
-
6397 if (start < end && text[start] == ',') {
-
6398 start++;
-
6399 while (start < end&& text[start] && isspace(text[start])) start++;
-
6400 }
-
6401 _Key el;
-
6402 if (el.match(text, start, end, flags)) {
-
6403 start = el.interval.end;
-
6404 T::insert(std::move(el));
-
6405 }
-
6406 else
-
6407 break;
-
6408 }
-
6409 }
-
6410 };
+
6382
+
6386 template <class _Key, class T>
+
+
6387 class http_value_collection : public T
+
6388 {
+
6389 public:
+
6390 void insert(
+
6391 _In_reads_or_z_(end) const char* text,
+
6392 _In_ size_t start = 0,
+
6393 _In_ size_t end = (size_t)-1,
+
6394 _In_ int flags = match_default)
+
6395 {
+
6396 while (start < end) {
+
6397 while (start < end && text[start] && isspace(text[start])) start++;
+
6398 if (start < end && text[start] == ',') {
+
6399 start++;
+
6400 while (start < end&& text[start] && isspace(text[start])) start++;
+
6401 }
+
6402 _Key el;
+
6403 if (el.match(text, start, end, flags)) {
+
6404 start = el.interval.end;
+
6405 T::insert(std::move(el));
+
6406 }
+
6407 else
+
6408 break;
+
6409 }
+
6410 }
+
6411 };
-
6411
-
6412 template <class T>
-
- -
6414 constexpr bool operator()(const T& a, const T& b) const noexcept
-
6415 {
-
6416 return a.factor.value > b.factor.value;
-
6417 }
-
6418 };
+
6412
+
6413 template <class T>
+
+ +
6415 constexpr bool operator()(const T& a, const T& b) const noexcept
+
6416 {
+
6417 return a.factor.value > b.factor.value;
+
6418 }
+
6419 };
-
6419
-
6423 template <class T, class _Alloc = std::allocator<T>>
- -
6425
-
6429 template <class T>
-
- -
6431 {
-
6432 public:
- -
6434 _In_ const std::shared_ptr<basic_parser<T>>& quote,
-
6435 _In_ const std::shared_ptr<basic_parser<T>>& chr,
-
6436 _In_ const std::shared_ptr<basic_parser<T>>& escape,
-
6437 _In_ const std::shared_ptr<basic_parser<T>>& sol,
-
6438 _In_ const std::shared_ptr<basic_parser<T>>& bs,
-
6439 _In_ const std::shared_ptr<basic_parser<T>>& ff,
-
6440 _In_ const std::shared_ptr<basic_parser<T>>& lf,
-
6441 _In_ const std::shared_ptr<basic_parser<T>>& cr,
-
6442 _In_ const std::shared_ptr<basic_parser<T>>& htab,
-
6443 _In_ const std::shared_ptr<basic_parser<T>>& uni,
-
6444 _In_ const std::shared_ptr<basic_integer16<T>>& hex,
-
6445 _In_ const std::locale& locale = std::locale()) :
-
6446 basic_parser<T>(locale),
-
6447 m_quote(quote),
-
6448 m_chr(chr),
-
6449 m_escape(escape),
-
6450 m_sol(sol),
-
6451 m_bs(bs),
-
6452 m_ff(ff),
-
6453 m_lf(lf),
-
6454 m_cr(cr),
-
6455 m_htab(htab),
-
6456 m_uni(uni),
-
6457 m_hex(hex)
-
6458 {}
-
6459
-
6460 virtual bool match(
-
6461 _In_reads_or_z_(end) const T* text,
-
6462 _In_ size_t start = 0,
-
6463 _In_ size_t end = (size_t)-1,
-
6464 _In_ int flags = match_default)
-
6465 {
-
6466 assert(text || start >= end);
-
6467 this->interval.end = start;
-
6468 if (m_quote->match(text, this->interval.end, end, flags)) {
-
6469 this->interval.end = m_quote->interval.end;
-
6470 value.clear();
-
6471 for (;;) {
-
6472 if (m_quote->match(text, this->interval.end, end, flags)) {
-
6473 this->interval.start = start;
-
6474 this->interval.end = m_quote->interval.end;
-
6475 return true;
-
6476 }
-
6477 if (m_escape->match(text, this->interval.end, end, flags)) {
-
6478 if (m_quote->match(text, m_escape->interval.end, end, flags)) {
-
6479 value += '"'; this->interval.end = m_quote->interval.end;
-
6480 continue;
-
6481 }
-
6482 if (m_sol->match(text, m_escape->interval.end, end, flags)) {
-
6483 value += '/'; this->interval.end = m_sol->interval.end;
-
6484 continue;
-
6485 }
-
6486 if (m_bs->match(text, m_escape->interval.end, end, flags)) {
-
6487 value += '\b'; this->interval.end = m_bs->interval.end;
-
6488 continue;
-
6489 }
-
6490 if (m_ff->match(text, m_escape->interval.end, end, flags)) {
-
6491 value += '\f'; this->interval.end = m_ff->interval.end;
-
6492 continue;
-
6493 }
-
6494 if (m_lf->match(text, m_escape->interval.end, end, flags)) {
-
6495 value += '\n'; this->interval.end = m_lf->interval.end;
-
6496 continue;
-
6497 }
-
6498 if (m_cr->match(text, m_escape->interval.end, end, flags)) {
-
6499 value += '\r'; this->interval.end = m_cr->interval.end;
-
6500 continue;
-
6501 }
-
6502 if (m_htab->match(text, m_escape->interval.end, end, flags)) {
-
6503 value += '\t'; this->interval.end = m_htab->interval.end;
-
6504 continue;
-
6505 }
-
6506 if (
-
6507 m_uni->match(text, m_escape->interval.end, end, flags) &&
-
6508 m_hex->match(text, m_uni->interval.end, std::min(m_uni->interval.end + 4, end), flags | match_case_insensitive) &&
-
6509 m_hex->interval.size() == 4 /* JSON requests 4-digit Unicode sequneces: \u.... */)
-
6510 {
-
6511 assert(m_hex->value <= 0xffff);
-
6512 if (sizeof(T) == 1) {
-
6513 if (m_hex->value > 0x7ff) {
-
6514 value += (T)(0xe0 | ((m_hex->value >> 12) & 0x0f));
-
6515 value += (T)(0x80 | ((m_hex->value >> 6) & 0x3f));
-
6516 value += (T)(0x80 | (m_hex->value & 0x3f));
-
6517 }
-
6518 else if (m_hex->value > 0x7f) {
-
6519 value += (T)(0xc0 | ((m_hex->value >> 6) & 0x1f));
-
6520 value += (T)(0x80 | (m_hex->value & 0x3f));
-
6521 }
-
6522 else
-
6523 value += (T)(m_hex->value & 0x7f);
-
6524 }
-
6525 else
-
6526 value += (T)m_hex->value;
-
6527 this->interval.end = m_hex->interval.end;
-
6528 continue;
-
6529 }
-
6530 if (m_escape->match(text, m_escape->interval.end, end, flags)) {
-
6531 value += '\\'; this->interval.end = m_escape->interval.end;
-
6532 continue;
-
6533 }
-
6534 }
-
6535 if (m_chr->match(text, this->interval.end, end, flags)) {
-
6536 value.Prilepi(text + m_chr->interval.start, m_chr->interval.size());
-
6537 this->interval.end = m_chr->interval.end;
-
6538 continue;
-
6539 }
-
6540 break;
-
6541 }
-
6542 }
-
6543 value.clear();
-
6544 this->interval.start = (this->interval.end = start) + 1;
-
6545 return false;
-
6546 }
-
6547
-
6548 virtual void invalidate()
-
6549 {
-
6550 value.clear();
- -
6552 }
-
6553
-
6554 public:
-
6555 std::basic_string<T> value;
-
6556
-
6557 protected:
-
6558 std::shared_ptr<basic_parser<T>> m_quote;
-
6559 std::shared_ptr<basic_parser<T>> m_chr;
-
6560 std::shared_ptr<basic_parser<T>> m_escape;
-
6561 std::shared_ptr<basic_parser<T>> m_sol;
-
6562 std::shared_ptr<basic_parser<T>> m_bs;
-
6563 std::shared_ptr<basic_parser<T>> m_ff;
-
6564 std::shared_ptr<basic_parser<T>> m_lf;
-
6565 std::shared_ptr<basic_parser<T>> m_cr;
-
6566 std::shared_ptr<basic_parser<T>> m_htab;
-
6567 std::shared_ptr<basic_parser<T>> m_uni;
-
6568 std::shared_ptr<basic_integer16<T>> m_hex;
-
6569 };
+
6420
+
6424 template <class T, class _Alloc = std::allocator<T>>
+ +
6426
+
6430 template <class T>
+
+ +
6432 {
+
6433 public:
+ +
6435 _In_ const std::shared_ptr<basic_parser<T>>& quote,
+
6436 _In_ const std::shared_ptr<basic_parser<T>>& chr,
+
6437 _In_ const std::shared_ptr<basic_parser<T>>& escape,
+
6438 _In_ const std::shared_ptr<basic_parser<T>>& sol,
+
6439 _In_ const std::shared_ptr<basic_parser<T>>& bs,
+
6440 _In_ const std::shared_ptr<basic_parser<T>>& ff,
+
6441 _In_ const std::shared_ptr<basic_parser<T>>& lf,
+
6442 _In_ const std::shared_ptr<basic_parser<T>>& cr,
+
6443 _In_ const std::shared_ptr<basic_parser<T>>& htab,
+
6444 _In_ const std::shared_ptr<basic_parser<T>>& uni,
+
6445 _In_ const std::shared_ptr<basic_integer16<T>>& hex,
+
6446 _In_ const std::locale& locale = std::locale()) :
+
6447 basic_parser<T>(locale),
+
6448 m_quote(quote),
+
6449 m_chr(chr),
+
6450 m_escape(escape),
+
6451 m_sol(sol),
+
6452 m_bs(bs),
+
6453 m_ff(ff),
+
6454 m_lf(lf),
+
6455 m_cr(cr),
+
6456 m_htab(htab),
+
6457 m_uni(uni),
+
6458 m_hex(hex)
+
6459 {}
+
6460
+
6461 virtual bool match(
+
6462 _In_reads_or_z_(end) const T* text,
+
6463 _In_ size_t start = 0,
+
6464 _In_ size_t end = (size_t)-1,
+
6465 _In_ int flags = match_default)
+
6466 {
+
6467 assert(text || start >= end);
+
6468 this->interval.end = start;
+
6469 if (m_quote->match(text, this->interval.end, end, flags)) {
+
6470 this->interval.end = m_quote->interval.end;
+
6471 value.clear();
+
6472 for (;;) {
+
6473 if (m_quote->match(text, this->interval.end, end, flags)) {
+
6474 this->interval.start = start;
+
6475 this->interval.end = m_quote->interval.end;
+
6476 return true;
+
6477 }
+
6478 if (m_escape->match(text, this->interval.end, end, flags)) {
+
6479 if (m_quote->match(text, m_escape->interval.end, end, flags)) {
+
6480 value += '"'; this->interval.end = m_quote->interval.end;
+
6481 continue;
+
6482 }
+
6483 if (m_sol->match(text, m_escape->interval.end, end, flags)) {
+
6484 value += '/'; this->interval.end = m_sol->interval.end;
+
6485 continue;
+
6486 }
+
6487 if (m_bs->match(text, m_escape->interval.end, end, flags)) {
+
6488 value += '\b'; this->interval.end = m_bs->interval.end;
+
6489 continue;
+
6490 }
+
6491 if (m_ff->match(text, m_escape->interval.end, end, flags)) {
+
6492 value += '\f'; this->interval.end = m_ff->interval.end;
+
6493 continue;
+
6494 }
+
6495 if (m_lf->match(text, m_escape->interval.end, end, flags)) {
+
6496 value += '\n'; this->interval.end = m_lf->interval.end;
+
6497 continue;
+
6498 }
+
6499 if (m_cr->match(text, m_escape->interval.end, end, flags)) {
+
6500 value += '\r'; this->interval.end = m_cr->interval.end;
+
6501 continue;
+
6502 }
+
6503 if (m_htab->match(text, m_escape->interval.end, end, flags)) {
+
6504 value += '\t'; this->interval.end = m_htab->interval.end;
+
6505 continue;
+
6506 }
+
6507 if (
+
6508 m_uni->match(text, m_escape->interval.end, end, flags) &&
+
6509 m_hex->match(text, m_uni->interval.end, std::min(m_uni->interval.end + 4, end), flags | match_case_insensitive) &&
+
6510 m_hex->interval.size() == 4 /* JSON requests 4-digit Unicode sequneces: \u.... */)
+
6511 {
+
6512 assert(m_hex->value <= 0xffff);
+
6513 if (sizeof(T) == 1) {
+
6514 if (m_hex->value > 0x7ff) {
+
6515 value += (T)(0xe0 | ((m_hex->value >> 12) & 0x0f));
+
6516 value += (T)(0x80 | ((m_hex->value >> 6) & 0x3f));
+
6517 value += (T)(0x80 | (m_hex->value & 0x3f));
+
6518 }
+
6519 else if (m_hex->value > 0x7f) {
+
6520 value += (T)(0xc0 | ((m_hex->value >> 6) & 0x1f));
+
6521 value += (T)(0x80 | (m_hex->value & 0x3f));
+
6522 }
+
6523 else
+
6524 value += (T)(m_hex->value & 0x7f);
+
6525 }
+
6526 else
+
6527 value += (T)m_hex->value;
+
6528 this->interval.end = m_hex->interval.end;
+
6529 continue;
+
6530 }
+
6531 if (m_escape->match(text, m_escape->interval.end, end, flags)) {
+
6532 value += '\\'; this->interval.end = m_escape->interval.end;
+
6533 continue;
+
6534 }
+
6535 }
+
6536 if (m_chr->match(text, this->interval.end, end, flags)) {
+
6537 value.Prilepi(text + m_chr->interval.start, m_chr->interval.size());
+
6538 this->interval.end = m_chr->interval.end;
+
6539 continue;
+
6540 }
+
6541 break;
+
6542 }
+
6543 }
+
6544 value.clear();
+
6545 this->interval.start = (this->interval.end = start) + 1;
+
6546 return false;
+
6547 }
+
6548
+
6549 virtual void invalidate()
+
6550 {
+
6551 value.clear();
+ +
6553 }
+
6554
+
6555 public:
+
6556 std::basic_string<T> value;
+
6557
+
6558 protected:
+
6559 std::shared_ptr<basic_parser<T>> m_quote;
+
6560 std::shared_ptr<basic_parser<T>> m_chr;
+
6561 std::shared_ptr<basic_parser<T>> m_escape;
+
6562 std::shared_ptr<basic_parser<T>> m_sol;
+
6563 std::shared_ptr<basic_parser<T>> m_bs;
+
6564 std::shared_ptr<basic_parser<T>> m_ff;
+
6565 std::shared_ptr<basic_parser<T>> m_lf;
+
6566 std::shared_ptr<basic_parser<T>> m_cr;
+
6567 std::shared_ptr<basic_parser<T>> m_htab;
+
6568 std::shared_ptr<basic_parser<T>> m_uni;
+
6569 std::shared_ptr<basic_integer16<T>> m_hex;
+
6570 };
-
6570
- - -
6573#ifdef _UNICODE
-
6574 using tjson_string = wjson_string;
-
6575#else
-
6576 using tjson_string = json_string;
-
6577#endif
-
6578 }
-
6579}
-
6580
-
6581#undef ENUM_FLAG_OPERATOR
-
6582#undef ENUM_FLAGS
-
6583
-
6584#ifdef _MSC_VER
-
6585#pragma warning(pop)
-
6586#endif
-
Test for angle in d°mm'ss.dddd form.
Definition parser.hpp:4395
-
Test for any code unit.
Definition parser.hpp:221
-
Test for beginning of line.
Definition parser.hpp:615
-
Test for any.
Definition parser.hpp:1057
-
Test for chemical formula.
Definition parser.hpp:4669
-
Test for any code unit from a given string of code units.
Definition parser.hpp:720
-
Test for specific code unit.
Definition parser.hpp:291
-
Test for date.
Definition parser.hpp:4025
-
Test for valid DNS domain character.
Definition parser.hpp:2806
-
bool allow_on_edge
Is character allowed at the beginning or an end of a DNS domain?
Definition parser.hpp:2844
-
Test for DNS domain/hostname.
Definition parser.hpp:2906
-
bool m_allow_absolute
May DNS names end with a dot (absolute name)?
Definition parser.hpp:2970
-
Test for e-mail address.
Definition parser.hpp:3794
-
Test for emoticon.
Definition parser.hpp:3902
-
std::shared_ptr< basic_parser< T > > apex
apex/eyebrows/halo (e.g. O, 0)
Definition parser.hpp:3991
-
std::shared_ptr< basic_parser< T > > eyes
eyes (e.g. :, ;, >, |, B)
Definition parser.hpp:3992
-
std::shared_ptr< basic_set< T > > mouth
mouth (e.g. ), ), (, (, |, P, D, p, d)
Definition parser.hpp:3994
-
std::shared_ptr< basic_parser< T > > nose
nose (e.g. -, o)
Definition parser.hpp:3993
-
std::shared_ptr< basic_parser< T > > emoticon
emoticon as a whole (e.g. 😀, 🤔, 😶)
Definition parser.hpp:3990
-
Test for end of line.
Definition parser.hpp:653
-
Test for fraction.
Definition parser.hpp:1686
-
Test for decimal integer.
Definition parser.hpp:1295
-
Test for decimal integer possibly containing thousand separators.
Definition parser.hpp:1380
-
bool has_separators
Did integer have any separators?
Definition parser.hpp:1440
-
size_t digit_count
Total number of digits in integer.
Definition parser.hpp:1439
-
Test for hexadecimal integer.
Definition parser.hpp:1461
-
Base class for integer testing.
Definition parser.hpp:1273
-
size_t value
Calculated value of the numeral.
Definition parser.hpp:1287
-
Test for IPv4 address.
Definition parser.hpp:2346
-
stdex::interval< size_t > components[4]
Individual component intervals.
Definition parser.hpp:2461
-
struct in_addr value
IPv4 address value.
Definition parser.hpp:2462
-
Test for IPv6 address.
Definition parser.hpp:2565
-
std::shared_ptr< basic_parser< T > > scope_id
Scope ID (e.g. NIC index with link-local addresses)
Definition parser.hpp:2769
-
stdex::interval< size_t > components[8]
Individual component intervals.
Definition parser.hpp:2767
-
struct in6_addr value
IPv6 address value.
Definition parser.hpp:2768
-
Test for valid IPv6 address scope ID character.
Definition parser.hpp:2493
-
Test for repeating.
Definition parser.hpp:910
-
bool m_greedy
try to match as long sequence as possible
Definition parser.hpp:949
-
std::shared_ptr< basic_parser< T > > m_el
repeating element
Definition parser.hpp:946
-
size_t m_min_iterations
minimum number of iterations
Definition parser.hpp:947
-
size_t m_max_iterations
maximum number of iterations
Definition parser.hpp:948
-
Test for JSON string.
Definition parser.hpp:6431
-
Test for mixed numeral.
Definition parser.hpp:1922
-
std::shared_ptr< basic_parser< T > > fraction
fraction
Definition parser.hpp:2028
-
std::shared_ptr< basic_parser< T > > special_sign
Special sign (e.g. plus-minus '±')
Definition parser.hpp:2026
-
std::shared_ptr< basic_parser< T > > negative_sign
Negative sign.
Definition parser.hpp:2025
-
std::shared_ptr< basic_parser< T > > positive_sign
Positive sign.
Definition parser.hpp:2024
-
std::shared_ptr< basic_parser< T > > integer
Integer part.
Definition parser.hpp:2027
-
Test for monetary numeral.
Definition parser.hpp:2217
-
std::shared_ptr< basic_parser< T > > positive_sign
Positive sign.
Definition parser.hpp:2323
-
std::shared_ptr< basic_parser< T > > decimal_separator
Decimal separator.
Definition parser.hpp:2328
-
std::shared_ptr< basic_parser< T > > currency
Currency part.
Definition parser.hpp:2326
-
std::shared_ptr< basic_parser< T > > decimal
Decimal part.
Definition parser.hpp:2329
-
std::shared_ptr< basic_parser< T > > integer
Integer part.
Definition parser.hpp:2327
-
std::shared_ptr< basic_parser< T > > negative_sign
Negative sign.
Definition parser.hpp:2324
-
std::shared_ptr< basic_parser< T > > special_sign
Special sign (e.g. plus-minus '±')
Definition parser.hpp:2325
-
"No-op" match
Definition parser.hpp:189
-
Base template for all parsers.
Definition parser.hpp:70
-
interval< size_t > interval
Region of the last match.
Definition parser.hpp:169
-
Test for permutation.
Definition parser.hpp:1197
-
Test for phone number.
Definition parser.hpp:4518
-
std::basic_string< T > value
Normalized phone number.
Definition parser.hpp:4644
-
Test for any punctuation code unit.
Definition parser.hpp:463
-
Test for Roman numeral.
Definition parser.hpp:1570
-
Test for scientific numeral.
Definition parser.hpp:2048
-
std::shared_ptr< basic_parser< T > > special_sign
Special sign (e.g. plus-minus '±')
Definition parser.hpp:2192
-
std::shared_ptr< basic_parser< T > > exponent_symbol
Exponent symbol (e.g. 'e')
Definition parser.hpp:2196
-
std::shared_ptr< basic_parser< T > > positive_sign
Positive sign.
Definition parser.hpp:2190
-
std::shared_ptr< basic_parser< T > > negative_sign
Negative sign.
Definition parser.hpp:2191
-
double value
Calculated value of the numeral.
Definition parser.hpp:2200
-
std::shared_ptr< basic_parser< T > > negative_exp_sign
Negative exponent sign (e.g. '-')
Definition parser.hpp:2198
-
std::shared_ptr< basic_integer< T > > decimal
Decimal part.
Definition parser.hpp:2195
-
std::shared_ptr< basic_parser< T > > positive_exp_sign
Positive exponent sign (e.g. '+')
Definition parser.hpp:2197
-
std::shared_ptr< basic_integer< T > > exponent
Exponent part.
Definition parser.hpp:2199
-
std::shared_ptr< basic_parser< T > > decimal_separator
Decimal separator.
Definition parser.hpp:2194
-
std::shared_ptr< basic_integer< T > > integer
Integer part.
Definition parser.hpp:2193
-
Test for match score.
Definition parser.hpp:1749
-
Test for sequence.
Definition parser.hpp:1006
-
Definition parser.hpp:688
-
Test for signed numeral.
Definition parser.hpp:1836
-
std::shared_ptr< basic_parser< T > > special_sign
Special sign (e.g. plus-minus '±')
Definition parser.hpp:1904
-
std::shared_ptr< basic_parser< T > > negative_sign
Negative sign.
Definition parser.hpp:1903
-
std::shared_ptr< basic_parser< T > > positive_sign
Positive sign.
Definition parser.hpp:1902
-
std::shared_ptr< basic_parser< T > > number
Number.
Definition parser.hpp:1905
-
Test for any space code unit.
Definition parser.hpp:384
-
Test for any space or punctuation code unit.
Definition parser.hpp:537
-
Test for any string.
Definition parser.hpp:1125
-
Test for given string.
Definition parser.hpp:815
-
Test for time.
Definition parser.hpp:4292
-
Test for valid URL password character.
Definition parser.hpp:3088
-
Test for valid URL path character.
Definition parser.hpp:3188
-
Test for URL path.
Definition parser.hpp:3296
-
Test for valid URL username character.
Definition parser.hpp:2989
-
Test for URL.
Definition parser.hpp:3437
-
Test for HTTP agent.
Definition parser.hpp:5954
-
Test for HTTP any type.
Definition parser.hpp:5076
-
Test for HTTP asterisk.
Definition parser.hpp:5718
- - - - - -
Test for HTTP header.
Definition parser.hpp:6277
-
Test for HTTP language (RFC1766)
Definition parser.hpp:5586
-
Test for HTTP line break (RFC2616: CRLF | LF)
Definition parser.hpp:4750
-
Test for HTTP media range (RFC2616: media-range)
Definition parser.hpp:5108
-
Test for HTTP media type (RFC2616: media-type)
Definition parser.hpp:5163
-
Test for HTTP parameter (RFC2616: parameter)
Definition parser.hpp:5021
-
http_token name
Parameter name.
Definition parser.hpp:5065
-
http_value value
Parameter value.
Definition parser.hpp:5066
-
Test for HTTP protocol.
Definition parser.hpp:6030
-
uint16_t version
HTTP protocol version: 0x100 = 1.0, 0x101 = 1.1...
Definition parser.hpp:6132
-
Test for HTTP quoted string (RFC2616: quoted-string)
Definition parser.hpp:4911
-
stdex::interval< size_t > content
String content (without quotes)
Definition parser.hpp:4967
-
Test for HTTP request.
Definition parser.hpp:6139
-
Test for HTTP space (RFC2616: LWS)
Definition parser.hpp:4786
-
Test for HTTP text character (RFC2616: TEXT)
Definition parser.hpp:4823
-
Test for HTTP token (RFC2616: token - tolerates non-ASCII)
Definition parser.hpp:4857
-
Test for HTTP URL parameter.
Definition parser.hpp:5403
-
Test for HTTP URL path segment.
Definition parser.hpp:5314
-
Test for HTTP URL path segment.
Definition parser.hpp:5347
-
std::vector< http_url_path_segment > segments
Path segments.
Definition parser.hpp:5396
-
Test for HTTP URL port.
Definition parser.hpp:5258
-
Test for HTTP URL server.
Definition parser.hpp:5221
-
Test for HTTP URL.
Definition parser.hpp:5484
-
Collection of HTTP values.
Definition parser.hpp:6387
-
Test for HTTP value (RFC2616: value)
Definition parser.hpp:4977
-
http_quoted_string string
Value when matched as quoted string.
Definition parser.hpp:5013
-
http_token token
Value when matched as token.
Definition parser.hpp:5014
-
Test for HTTP weight factor.
Definition parser.hpp:5649
-
float value
Calculated value of the weight factor.
Definition parser.hpp:5711
-
Test for HTTP weighted value.
Definition parser.hpp:5741
-
Base template for collection-holding parsers.
Definition parser.hpp:966
-
Test for any SGML code point.
Definition parser.hpp:253
-
Test for any SGML code point from a given string of SGML code points.
Definition parser.hpp:772
-
Test for specific SGML code point.
Definition parser.hpp:340
-
Test for valid DNS domain SGML character.
Definition parser.hpp:2862
-
Test for valid IPv6 address scope ID SGML character.
Definition parser.hpp:2531
-
Test for any SGML punctuation code point.
Definition parser.hpp:504
-
Test for any SGML space code point.
Definition parser.hpp:427
-
Test for any SGML space or punctuation code point.
Definition parser.hpp:580
-
Test for SGML given string.
Definition parser.hpp:862
-
Test for valid URL password SGML character.
Definition parser.hpp:3140
-
Test for valid URL path SGML character.
Definition parser.hpp:3244
-
Test for valid URL username SGML character.
Definition parser.hpp:3040
+
6571
+ + +
6574#ifdef _UNICODE
+
6575 using tjson_string = wjson_string;
+
6576#else
+
6577 using tjson_string = json_string;
+
6578#endif
+
6579 }
+
6580}
+
6581
+
6582#undef ENUM_FLAG_OPERATOR
+
6583#undef ENUM_FLAGS
+
6584
+
6585#ifdef _MSC_VER
+
6586#pragma warning(pop)
+
6587#endif
+
Test for angle in d°mm'ss.dddd form.
Definition parser.hpp:4396
+
Test for any code unit.
Definition parser.hpp:222
+
Test for beginning of line.
Definition parser.hpp:616
+
Test for any.
Definition parser.hpp:1058
+
Test for chemical formula.
Definition parser.hpp:4670
+
Test for any code unit from a given string of code units.
Definition parser.hpp:721
+
Test for specific code unit.
Definition parser.hpp:292
+
Test for date.
Definition parser.hpp:4026
+
Test for valid DNS domain character.
Definition parser.hpp:2807
+
bool allow_on_edge
Is character allowed at the beginning or an end of a DNS domain?
Definition parser.hpp:2845
+
Test for DNS domain/hostname.
Definition parser.hpp:2907
+
bool m_allow_absolute
May DNS names end with a dot (absolute name)?
Definition parser.hpp:2971
+
Test for e-mail address.
Definition parser.hpp:3795
+
Test for emoticon.
Definition parser.hpp:3903
+
std::shared_ptr< basic_parser< T > > apex
apex/eyebrows/halo (e.g. O, 0)
Definition parser.hpp:3992
+
std::shared_ptr< basic_parser< T > > eyes
eyes (e.g. :, ;, >, |, B)
Definition parser.hpp:3993
+
std::shared_ptr< basic_set< T > > mouth
mouth (e.g. ), ), (, (, |, P, D, p, d)
Definition parser.hpp:3995
+
std::shared_ptr< basic_parser< T > > nose
nose (e.g. -, o)
Definition parser.hpp:3994
+
std::shared_ptr< basic_parser< T > > emoticon
emoticon as a whole (e.g. 😀, 🤔, 😶)
Definition parser.hpp:3991
+
Test for end of line.
Definition parser.hpp:654
+
Test for fraction.
Definition parser.hpp:1687
+
Test for decimal integer.
Definition parser.hpp:1296
+
Test for decimal integer possibly containing thousand separators.
Definition parser.hpp:1381
+
bool has_separators
Did integer have any separators?
Definition parser.hpp:1441
+
size_t digit_count
Total number of digits in integer.
Definition parser.hpp:1440
+
Test for hexadecimal integer.
Definition parser.hpp:1462
+
Base class for integer testing.
Definition parser.hpp:1274
+
size_t value
Calculated value of the numeral.
Definition parser.hpp:1288
+
Test for IPv4 address.
Definition parser.hpp:2347
+
stdex::interval< size_t > components[4]
Individual component intervals.
Definition parser.hpp:2462
+
struct in_addr value
IPv4 address value.
Definition parser.hpp:2463
+
Test for IPv6 address.
Definition parser.hpp:2566
+
std::shared_ptr< basic_parser< T > > scope_id
Scope ID (e.g. NIC index with link-local addresses)
Definition parser.hpp:2770
+
stdex::interval< size_t > components[8]
Individual component intervals.
Definition parser.hpp:2768
+
struct in6_addr value
IPv6 address value.
Definition parser.hpp:2769
+
Test for valid IPv6 address scope ID character.
Definition parser.hpp:2494
+
Test for repeating.
Definition parser.hpp:911
+
bool m_greedy
try to match as long sequence as possible
Definition parser.hpp:950
+
std::shared_ptr< basic_parser< T > > m_el
repeating element
Definition parser.hpp:947
+
size_t m_min_iterations
minimum number of iterations
Definition parser.hpp:948
+
size_t m_max_iterations
maximum number of iterations
Definition parser.hpp:949
+
Test for JSON string.
Definition parser.hpp:6432
+
Test for mixed numeral.
Definition parser.hpp:1923
+
std::shared_ptr< basic_parser< T > > fraction
fraction
Definition parser.hpp:2029
+
std::shared_ptr< basic_parser< T > > special_sign
Special sign (e.g. plus-minus '±')
Definition parser.hpp:2027
+
std::shared_ptr< basic_parser< T > > negative_sign
Negative sign.
Definition parser.hpp:2026
+
std::shared_ptr< basic_parser< T > > positive_sign
Positive sign.
Definition parser.hpp:2025
+
std::shared_ptr< basic_parser< T > > integer
Integer part.
Definition parser.hpp:2028
+
Test for monetary numeral.
Definition parser.hpp:2218
+
std::shared_ptr< basic_parser< T > > positive_sign
Positive sign.
Definition parser.hpp:2324
+
std::shared_ptr< basic_parser< T > > decimal_separator
Decimal separator.
Definition parser.hpp:2329
+
std::shared_ptr< basic_parser< T > > currency
Currency part.
Definition parser.hpp:2327
+
std::shared_ptr< basic_parser< T > > decimal
Decimal part.
Definition parser.hpp:2330
+
std::shared_ptr< basic_parser< T > > integer
Integer part.
Definition parser.hpp:2328
+
std::shared_ptr< basic_parser< T > > negative_sign
Negative sign.
Definition parser.hpp:2325
+
std::shared_ptr< basic_parser< T > > special_sign
Special sign (e.g. plus-minus '±')
Definition parser.hpp:2326
+
"No-op" match
Definition parser.hpp:190
+
Base template for all parsers.
Definition parser.hpp:71
+
interval< size_t > interval
Region of the last match.
Definition parser.hpp:170
+
Test for permutation.
Definition parser.hpp:1198
+
Test for phone number.
Definition parser.hpp:4519
+
std::basic_string< T > value
Normalized phone number.
Definition parser.hpp:4645
+
Test for any punctuation code unit.
Definition parser.hpp:464
+
Test for Roman numeral.
Definition parser.hpp:1571
+
Test for scientific numeral.
Definition parser.hpp:2049
+
std::shared_ptr< basic_parser< T > > special_sign
Special sign (e.g. plus-minus '±')
Definition parser.hpp:2193
+
std::shared_ptr< basic_parser< T > > exponent_symbol
Exponent symbol (e.g. 'e')
Definition parser.hpp:2197
+
std::shared_ptr< basic_parser< T > > positive_sign
Positive sign.
Definition parser.hpp:2191
+
std::shared_ptr< basic_parser< T > > negative_sign
Negative sign.
Definition parser.hpp:2192
+
double value
Calculated value of the numeral.
Definition parser.hpp:2201
+
std::shared_ptr< basic_parser< T > > negative_exp_sign
Negative exponent sign (e.g. '-')
Definition parser.hpp:2199
+
std::shared_ptr< basic_integer< T > > decimal
Decimal part.
Definition parser.hpp:2196
+
std::shared_ptr< basic_parser< T > > positive_exp_sign
Positive exponent sign (e.g. '+')
Definition parser.hpp:2198
+
std::shared_ptr< basic_integer< T > > exponent
Exponent part.
Definition parser.hpp:2200
+
std::shared_ptr< basic_parser< T > > decimal_separator
Decimal separator.
Definition parser.hpp:2195
+
std::shared_ptr< basic_integer< T > > integer
Integer part.
Definition parser.hpp:2194
+
Test for match score.
Definition parser.hpp:1750
+
Test for sequence.
Definition parser.hpp:1007
+
Definition parser.hpp:689
+
Test for signed numeral.
Definition parser.hpp:1837
+
std::shared_ptr< basic_parser< T > > special_sign
Special sign (e.g. plus-minus '±')
Definition parser.hpp:1905
+
std::shared_ptr< basic_parser< T > > negative_sign
Negative sign.
Definition parser.hpp:1904
+
std::shared_ptr< basic_parser< T > > positive_sign
Positive sign.
Definition parser.hpp:1903
+
std::shared_ptr< basic_parser< T > > number
Number.
Definition parser.hpp:1906
+
Test for any space code unit.
Definition parser.hpp:385
+
Test for any space or punctuation code unit.
Definition parser.hpp:538
+
Test for any string.
Definition parser.hpp:1126
+
Test for given string.
Definition parser.hpp:816
+
Test for time.
Definition parser.hpp:4293
+
Test for valid URL password character.
Definition parser.hpp:3089
+
Test for valid URL path character.
Definition parser.hpp:3189
+
Test for URL path.
Definition parser.hpp:3297
+
Test for valid URL username character.
Definition parser.hpp:2990
+
Test for URL.
Definition parser.hpp:3438
+
Test for HTTP agent.
Definition parser.hpp:5955
+
Test for HTTP any type.
Definition parser.hpp:5077
+
Test for HTTP asterisk.
Definition parser.hpp:5719
+ + + + + +
Test for HTTP header.
Definition parser.hpp:6278
+
Test for HTTP language (RFC1766)
Definition parser.hpp:5587
+
Test for HTTP line break (RFC2616: CRLF | LF)
Definition parser.hpp:4751
+
Test for HTTP media range (RFC2616: media-range)
Definition parser.hpp:5109
+
Test for HTTP media type (RFC2616: media-type)
Definition parser.hpp:5164
+
Test for HTTP parameter (RFC2616: parameter)
Definition parser.hpp:5022
+
http_token name
Parameter name.
Definition parser.hpp:5066
+
http_value value
Parameter value.
Definition parser.hpp:5067
+
Test for HTTP protocol.
Definition parser.hpp:6031
+
uint16_t version
HTTP protocol version: 0x100 = 1.0, 0x101 = 1.1...
Definition parser.hpp:6133
+
Test for HTTP quoted string (RFC2616: quoted-string)
Definition parser.hpp:4912
+
stdex::interval< size_t > content
String content (without quotes)
Definition parser.hpp:4968
+
Test for HTTP request.
Definition parser.hpp:6140
+
Test for HTTP space (RFC2616: LWS)
Definition parser.hpp:4787
+
Test for HTTP text character (RFC2616: TEXT)
Definition parser.hpp:4824
+
Test for HTTP token (RFC2616: token - tolerates non-ASCII)
Definition parser.hpp:4858
+
Test for HTTP URL parameter.
Definition parser.hpp:5404
+
Test for HTTP URL path segment.
Definition parser.hpp:5315
+
Test for HTTP URL path segment.
Definition parser.hpp:5348
+
std::vector< http_url_path_segment > segments
Path segments.
Definition parser.hpp:5397
+
Test for HTTP URL port.
Definition parser.hpp:5259
+
Test for HTTP URL server.
Definition parser.hpp:5222
+
Test for HTTP URL.
Definition parser.hpp:5485
+
Collection of HTTP values.
Definition parser.hpp:6388
+
Test for HTTP value (RFC2616: value)
Definition parser.hpp:4978
+
http_quoted_string string
Value when matched as quoted string.
Definition parser.hpp:5014
+
http_token token
Value when matched as token.
Definition parser.hpp:5015
+
Test for HTTP weight factor.
Definition parser.hpp:5650
+
float value
Calculated value of the weight factor.
Definition parser.hpp:5712
+
Test for HTTP weighted value.
Definition parser.hpp:5742
+
Base template for collection-holding parsers.
Definition parser.hpp:967
+
Test for any SGML code point.
Definition parser.hpp:254
+
Test for any SGML code point from a given string of SGML code points.
Definition parser.hpp:773
+
Test for specific SGML code point.
Definition parser.hpp:341
+
Test for valid DNS domain SGML character.
Definition parser.hpp:2863
+
Test for valid IPv6 address scope ID SGML character.
Definition parser.hpp:2532
+
Test for any SGML punctuation code point.
Definition parser.hpp:505
+
Test for any SGML space code point.
Definition parser.hpp:428
+
Test for any SGML space or punctuation code point.
Definition parser.hpp:581
+
Test for SGML given string.
Definition parser.hpp:863
+
Test for valid URL password SGML character.
Definition parser.hpp:3141
+
Test for valid URL path SGML character.
Definition parser.hpp:3245
+
Test for valid URL username SGML character.
Definition parser.hpp:3041
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:6413
+
Definition parser.hpp:6414
diff --git a/pch_8h_source.html b/pch_8h_source.html index f105f1c58..8e2b7f755 100644 --- a/pch_8h_source.html +++ b/pch_8h_source.html @@ -116,7 +116,7 @@ $(document).ready(function() { init_codefold(0); });
diff --git a/progress_8hpp_source.html b/progress_8hpp_source.html index c8de24680..5d6ae3e9e 100644 --- a/progress_8hpp_source.html +++ b/progress_8hpp_source.html @@ -331,7 +331,7 @@ $(document).ready(function() { init_codefold(0); });
diff --git a/ring_8cpp_source.html b/ring_8cpp_source.html index 3e46a7157..3ff53b83c 100644 --- a/ring_8cpp_source.html +++ b/ring_8cpp_source.html @@ -144,7 +144,7 @@ $(document).ready(function() { init_codefold(0); });
diff --git a/ring_8hpp_source.html b/ring_8hpp_source.html index 581e2e03d..0a8d51ebe 100644 --- a/ring_8hpp_source.html +++ b/ring_8hpp_source.html @@ -224,7 +224,7 @@ $(document).ready(function() { init_codefold(0); });
diff --git a/sgml_8cpp_source.html b/sgml_8cpp_source.html index efd3744f3..006a69143 100644 --- a/sgml_8cpp_source.html +++ b/sgml_8cpp_source.html @@ -153,7 +153,7 @@ $(document).ready(function() { init_codefold(0); });
diff --git a/sgml_8hpp_source.html b/sgml_8hpp_source.html index 4a8ff8f40..db0615d1c 100644 --- a/sgml_8hpp_source.html +++ b/sgml_8hpp_source.html @@ -773,7 +773,7 @@ $(document).ready(function() { init_codefold(0); });
diff --git a/sgml__unicode_8hpp_source.html b/sgml__unicode_8hpp_source.html index 09dbc69b8..c9f6c6add 100644 --- a/sgml__unicode_8hpp_source.html +++ b/sgml__unicode_8hpp_source.html @@ -3175,7 +3175,7 @@ $(document).ready(function() { init_codefold(0); });
diff --git a/stream_8cpp_source.html b/stream_8cpp_source.html index f01055f30..705b330a5 100644 --- a/stream_8cpp_source.html +++ b/stream_8cpp_source.html @@ -248,7 +248,7 @@ $(document).ready(function() { init_codefold(0); });
diff --git a/stream_8hpp_source.html b/stream_8hpp_source.html index 26b1d30e7..94bb47844 100644 --- a/stream_8hpp_source.html +++ b/stream_8hpp_source.html @@ -3865,7 +3865,7 @@ $(document).ready(function() { init_codefold(0); });
diff --git a/string_8hpp_source.html b/string_8hpp_source.html index 55b21b594..c90b283ad 100644 --- a/string_8hpp_source.html +++ b/string_8hpp_source.html @@ -920,7 +920,7 @@ $(document).ready(function() { init_codefold(0); });
diff --git a/structstdex_1_1chrono_1_1aosn__date-members.html b/structstdex_1_1chrono_1_1aosn__date-members.html index a2ed4b4a7..031133983 100644 --- a/structstdex_1_1chrono_1_1aosn__date-members.html +++ b/structstdex_1_1chrono_1_1aosn__date-members.html @@ -96,7 +96,7 @@ $(function() {
diff --git a/structstdex_1_1chrono_1_1aosn__date.html b/structstdex_1_1chrono_1_1aosn__date.html index 63e7333b2..e2e8492ea 100644 --- a/structstdex_1_1chrono_1_1aosn__date.html +++ b/structstdex_1_1chrono_1_1aosn__date.html @@ -152,7 +152,7 @@ static constexpr bool is_s
diff --git a/structstdex_1_1chrono_1_1aosn__timestamp-members.html b/structstdex_1_1chrono_1_1aosn__timestamp-members.html index c5aadc81f..d9a8662f6 100644 --- a/structstdex_1_1chrono_1_1aosn__timestamp-members.html +++ b/structstdex_1_1chrono_1_1aosn__timestamp-members.html @@ -110,7 +110,7 @@ $(function() {
diff --git a/structstdex_1_1chrono_1_1aosn__timestamp.html b/structstdex_1_1chrono_1_1aosn__timestamp.html index d38d94c00..7ef965e3b 100644 --- a/structstdex_1_1chrono_1_1aosn__timestamp.html +++ b/structstdex_1_1chrono_1_1aosn__timestamp.html @@ -197,7 +197,7 @@ static constexpr rep p_wee
diff --git a/structstdex_1_1free__locale__delete-members.html b/structstdex_1_1free__locale__delete-members.html index af50195e0..c78289ce3 100644 --- a/structstdex_1_1free__locale__delete-members.html +++ b/structstdex_1_1free__locale__delete-members.html @@ -84,7 +84,7 @@ $(function() {
diff --git a/structstdex_1_1free__locale__delete.html b/structstdex_1_1free__locale__delete.html index 4e7d6e42a..fdcacb38d 100644 --- a/structstdex_1_1free__locale__delete.html +++ b/structstdex_1_1free__locale__delete.html @@ -101,7 +101,7 @@ void operator() (local
diff --git a/structstdex_1_1interval-members.html b/structstdex_1_1interval-members.html index 18e12c382..517147ef8 100644 --- a/structstdex_1_1interval-members.html +++ b/structstdex_1_1interval-members.html @@ -92,7 +92,7 @@ $(function() {
diff --git a/structstdex_1_1interval.html b/structstdex_1_1interval.html index ec1d31013..4a6caa8a8 100644 --- a/structstdex_1_1interval.html +++ b/structstdex_1_1interval.html @@ -344,7 +344,7 @@ template<class T >
diff --git a/structstdex_1_1mapping-members.html b/structstdex_1_1mapping-members.html index 3b177a5fd..054d3b997 100644 --- a/structstdex_1_1mapping-members.html +++ b/structstdex_1_1mapping-members.html @@ -90,7 +90,7 @@ $(function() {
diff --git a/structstdex_1_1mapping.html b/structstdex_1_1mapping.html index 5a58663d9..200768771 100644 --- a/structstdex_1_1mapping.html +++ b/structstdex_1_1mapping.html @@ -283,7 +283,7 @@ template<class T >
diff --git a/structstdex_1_1no__delete-members.html b/structstdex_1_1no__delete-members.html index bffc2d87e..55b762aae 100644 --- a/structstdex_1_1no__delete-members.html +++ b/structstdex_1_1no__delete-members.html @@ -86,7 +86,7 @@ $(function() {
diff --git a/structstdex_1_1no__delete.html b/structstdex_1_1no__delete.html index 8235fb442..46487bf17 100644 --- a/structstdex_1_1no__delete.html +++ b/structstdex_1_1no__delete.html @@ -105,7 +105,7 @@ struct stdex::no_delete< T >

Noop deleter.

diff --git a/structstdex_1_1no__delete_3_01_t_0f_0e_4-members.html b/structstdex_1_1no__delete_3_01_t_0f_0e_4-members.html index 85a843492..9f3c6cadd 100644 --- a/structstdex_1_1no__delete_3_01_t_0f_0e_4-members.html +++ b/structstdex_1_1no__delete_3_01_t_0f_0e_4-members.html @@ -86,7 +86,7 @@ $(function() {
diff --git a/structstdex_1_1no__delete_3_01_t_0f_0e_4.html b/structstdex_1_1no__delete_3_01_t_0f_0e_4.html index 3d67e3a51..2a946071c 100644 --- a/structstdex_1_1no__delete_3_01_t_0f_0e_4.html +++ b/structstdex_1_1no__delete_3_01_t_0f_0e_4.html @@ -106,7 +106,7 @@ struct stdex::no_delete< T[]>

Noop array deleter.

diff --git a/structstdex_1_1parser_1_1http__factor__more-members.html b/structstdex_1_1parser_1_1http__factor__more-members.html index 2b2bfff31..c5df8993b 100644 --- a/structstdex_1_1parser_1_1http__factor__more-members.html +++ b/structstdex_1_1parser_1_1http__factor__more-members.html @@ -84,7 +84,7 @@ $(function() {
diff --git a/structstdex_1_1parser_1_1http__factor__more.html b/structstdex_1_1parser_1_1http__factor__more.html index b055024cf..10b2c51fb 100644 --- a/structstdex_1_1parser_1_1http__factor__more.html +++ b/structstdex_1_1parser_1_1http__factor__more.html @@ -93,7 +93,7 @@ Public Member Functions
diff --git a/structstdex_1_1stream_1_1buffer_1_1buffer__t-members.html b/structstdex_1_1stream_1_1buffer_1_1buffer__t-members.html index ceb718692..8d96798b2 100644 --- a/structstdex_1_1stream_1_1buffer_1_1buffer__t-members.html +++ b/structstdex_1_1stream_1_1buffer_1_1buffer__t-members.html @@ -89,7 +89,7 @@ $(function() {
diff --git a/structstdex_1_1stream_1_1buffer_1_1buffer__t.html b/structstdex_1_1stream_1_1buffer_1_1buffer__t.html index c335f5123..acf795e99 100644 --- a/structstdex_1_1stream_1_1buffer_1_1buffer__t.html +++ b/structstdex_1_1stream_1_1buffer_1_1buffer__t.html @@ -109,7 +109,7 @@ size_t capacity diff --git a/structstdex_1_1stream_1_1cache_1_1cache__t-members.html b/structstdex_1_1stream_1_1cache_1_1cache__t-members.html index d506b450b..c97805450 100644 --- a/structstdex_1_1stream_1_1cache_1_1cache__t-members.html +++ b/structstdex_1_1stream_1_1cache_1_1cache__t-members.html @@ -90,7 +90,7 @@ $(function() {
diff --git a/structstdex_1_1stream_1_1cache_1_1cache__t.html b/structstdex_1_1stream_1_1cache_1_1cache__t.html index f66a6606f..a8b35f8ed 100644 --- a/structstdex_1_1stream_1_1cache_1_1cache__t.html +++ b/structstdex_1_1stream_1_1cache_1_1cache__t.html @@ -119,7 +119,7 @@ enum stdex::stream::cache::cache_t::status_t  diff --git a/structstdex_1_1stream_1_1fifo_1_1node__t-members.html b/structstdex_1_1stream_1_1fifo_1_1node__t-members.html index 1027398db..9f76c0e49 100644 --- a/structstdex_1_1stream_1_1fifo_1_1node__t-members.html +++ b/structstdex_1_1stream_1_1fifo_1_1node__t-members.html @@ -86,7 +86,7 @@ $(function() {
diff --git a/structstdex_1_1stream_1_1fifo_1_1node__t.html b/structstdex_1_1stream_1_1fifo_1_1node__t.html index 05776f759..527b67eb0 100644 --- a/structstdex_1_1stream_1_1fifo_1_1node__t.html +++ b/structstdex_1_1stream_1_1fifo_1_1node__t.html @@ -99,7 +99,7 @@ uint8_t data [0]<
diff --git a/system_8hpp_source.html b/system_8hpp_source.html index e2382b874..4f6c6959c 100644 --- a/system_8hpp_source.html +++ b/system_8hpp_source.html @@ -286,7 +286,7 @@ $(document).ready(function() { init_codefold(0); });
diff --git a/unicode_8cpp_source.html b/unicode_8cpp_source.html index bc910946f..16f7dab0d 100644 --- a/unicode_8cpp_source.html +++ b/unicode_8cpp_source.html @@ -107,8 +107,8 @@ $(document).ready(function() { init_codefold(0); });
23 Assert::AreEqual(
24 L"Th\u00ed\u0161 i\u22c5 a te\u0073\u0304t. 😀😅",
25 stdex::str2wstr("Thíš i⋅ a tes̄t. 😀😅", stdex::charset_id::utf8).c_str());
-
26 string src;
-
27 wstring dst;
+
26 std::string src;
+
27 std::wstring dst;
28 for (size_t i = 0; i < 2000; i++) {
29 src += "🐔Test🐮\r\n";
30 dst += L"🐔Test🐮\r\n";
@@ -130,8 +130,8 @@ $(document).ready(function() { init_codefold(0); });
46 Assert::AreEqual(
47 "Th\xc3\xad\xc5\xa1 i\xe2\x8b\x85 a tes\xcc\x84t. \xf0\x9f\x98\x80\xf0\x9f\x98\x85",
48 stdex::wstr2str(L"Thíš i⋅ a tes̄t. 😀😅", stdex::charset_id::utf8).c_str());
-
49 wstring src;
-
50 string dst;
+
49 std::wstring src;
+
50 std::string dst;
51 for (size_t i = 0; i < 2000; i++) {
52 src += L"🐔Test🐮\r\n";
53 dst += "🐔Test🐮\r\n";
@@ -155,7 +155,7 @@ $(document).ready(function() { init_codefold(0); });
71 Assert::AreEqual(
72 "Thíš i· a teşt.",
73 win1250_to_utf8.convert("Th\xed\x9a i\xb7 a te\xbat.").c_str());
-
74 string src, dst;
+
74 std::string src, dst;
75 for (size_t i = 0; i < 1000; i++) {
76 src += "V ko\x9eu\x9a\xe8ku zlobnega mizarja stopiclja fant in kli\xe8" "e 0123456789.\r\n";
77 dst += "V kožuščku zlobnega mizarja stopiclja fant in kliče 0123456789.\r\n";
@@ -174,7 +174,7 @@ $(document).ready(function() { init_codefold(0); });
diff --git a/unicode_8hpp_source.html b/unicode_8hpp_source.html index 0c4b6e02f..c22eac404 100644 --- a/unicode_8hpp_source.html +++ b/unicode_8hpp_source.html @@ -162,421 +162,426 @@ $(document).ready(function() { init_codefold(0); });
86 _Inout_ std::basic_string<T_to, _Traits_to, _Alloc_to> &dst,
87 _In_reads_or_z_opt_(count_src) const T_from* src, _In_ size_t count_src)
88 {
-
89 constexpr DWORD dwFlagsMBWC = MB_PRECOMPOSED;
-
90 constexpr DWORD dwFlagsWCMB = 0;
-
91 constexpr LPCCH lpDefaultChar = NULL;
-
92
-
93 assert(src || !count_src);
-
94 count_src = stdex::strnlen(src, count_src);
-
95 if (!count_src) _Unlikely_
-
96 return;
-
97#ifdef _WIN32
-
98 _Analysis_assume_(src);
-
99 if (m_from == m_to) _Unlikely_{
-
100 dst.append(reinterpret_cast<const T_to*>(src), count_src);
-
101 return;
-
102 }
-
103
-
104 if _Constexpr_ (sizeof(T_from) == sizeof(char) && sizeof(T_to) == sizeof(wchar_t)) {
-
105 assert(count_src < INT_MAX || count_src == SIZE_MAX);
-
106
-
107 // Try to convert to stack buffer first.
-
108 WCHAR szStackBuffer[1024 / sizeof(WCHAR)];
-
109#pragma warning(suppress: 6387) // Testing indicates src may be NULL when count_src is also 0. Is SAL of the lpMultiByteStr parameter wrong?
-
110 int cch = MultiByteToWideChar(static_cast<UINT>(m_from), dwFlagsMBWC, reinterpret_cast<LPCCH>(src), static_cast<int>(count_src), szStackBuffer, _countof(szStackBuffer));
-
111 if (cch) {
-
112 // Append from stack.
-
113 dst.append(reinterpret_cast<const T_to*>(szStackBuffer), count_src != SIZE_MAX ? wcsnlen(szStackBuffer, cch) : static_cast<size_t>(cch) - 1);
-
114 return;
-
115 }
-
116 if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) {
-
117 // Query the required output size. Allocate buffer. Then convert again.
-
118 cch = MultiByteToWideChar(static_cast<UINT>(m_from), dwFlagsMBWC, reinterpret_cast<LPCCH>(src), static_cast<int>(count_src), NULL, 0);
-
119 std::unique_ptr<WCHAR[]> szBuffer(new WCHAR[cch]);
-
120 cch = MultiByteToWideChar(static_cast<UINT>(m_from), dwFlagsMBWC, reinterpret_cast<LPCCH>(src), static_cast<int>(count_src), szBuffer.get(), cch);
-
121 dst.append(reinterpret_cast<const T_to*>(szBuffer.get()), count_src != SIZE_MAX ? wcsnlen(szBuffer.get(), cch) : static_cast<size_t>(cch) - 1);
-
122 return;
-
123 }
-
124 throw std::runtime_error("MultiByteToWideChar failed");
-
125 }
-
126
-
127 if _Constexpr_ (sizeof(T_from) == sizeof(wchar_t) && sizeof(T_to) == sizeof(char)) {
-
128 assert(count_src < INT_MAX || count_src == SIZE_MAX);
-
129
-
130 // Try to convert to stack buffer first.
-
131 CHAR szStackBuffer[1024 / sizeof(CHAR)];
-
132#pragma warning(suppress: 6387) // Testing indicates src may be NULL when count_src is also 0. Is SAL of the lpWideCharStr parameter wrong?
-
133 int cch = WideCharToMultiByte(static_cast<UINT>(m_to), dwFlagsWCMB, reinterpret_cast<LPCWCH>(src), static_cast<int>(count_src), szStackBuffer, _countof(szStackBuffer), lpDefaultChar, NULL);
-
134 if (cch) {
-
135 // Copy from stack. Be careful not to include zero terminator.
-
136 dst.append(reinterpret_cast<const T_to*>(szStackBuffer), count_src != SIZE_MAX ? strnlen(szStackBuffer, cch) : static_cast<size_t>(cch) - 1);
-
137 return;
-
138 }
-
139 if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) {
-
140 // Query the required output size. Allocate buffer. Then convert again.
-
141 cch = WideCharToMultiByte(static_cast<UINT>(m_to), dwFlagsWCMB, reinterpret_cast<LPCWCH>(src), static_cast<int>(count_src), NULL, 0, lpDefaultChar, NULL);
-
142 std::unique_ptr<CHAR[]> szBuffer(new CHAR[cch]);
-
143 cch = WideCharToMultiByte(static_cast<UINT>(m_to), dwFlagsWCMB, reinterpret_cast<LPCWCH>(src), static_cast<int>(count_src), szBuffer.get(), cch, lpDefaultChar, NULL);
-
144 dst.append(reinterpret_cast<const T_to*>(szBuffer.get()), count_src != SIZE_MAX ? strnlen(szBuffer.get(), cch) : static_cast<size_t>(cch) - 1);
-
145 return;
-
146 }
-
147 throw std::runtime_error("WideCharToMultiByte failed");
-
148 }
-
149
-
150 if _Constexpr_ (sizeof(T_from) == sizeof(char) && sizeof(T_to) == sizeof(char)) {
-
151 assert(count_src < INT_MAX || count_src == SIZE_MAX);
-
152
-
153 // Try to convert to stack buffer first.
-
154 WCHAR szStackBufferMBWC[512 / sizeof(WCHAR)];
-
155#pragma warning(suppress: 6387) // Testing indicates src may be NULL when count_src is also 0. Is SAL of the lpMultiByteStr parameter wrong?
-
156 int cch = MultiByteToWideChar(static_cast<UINT>(m_from), dwFlagsMBWC, reinterpret_cast<LPCCH>(src), static_cast<int>(count_src), szStackBufferMBWC, _countof(szStackBufferMBWC));
-
157 if (cch) {
-
158 // Append from stack.
-
159 size_t count_inter = count_src != SIZE_MAX ? wcsnlen(szStackBufferMBWC, cch) : static_cast<size_t>(cch) - 1;
-
160 assert(count_inter < INT_MAX);
-
161
-
162 // Try to convert to stack buffer first.
-
163 CHAR szStackBufferWCMB[512 / sizeof(CHAR)];
-
164#pragma warning(suppress: 6387) // Testing indicates szStackBufferMBWC may be NULL when count_inter is also 0. Is SAL of the lpWideCharStr parameter wrong?
-
165 cch = WideCharToMultiByte(static_cast<UINT>(m_to), dwFlagsWCMB, szStackBufferMBWC, static_cast<int>(count_inter), szStackBufferWCMB, _countof(szStackBufferWCMB), lpDefaultChar, NULL);
-
166 if (cch) {
-
167 // Copy from stack. Be careful not to include zero terminator.
-
168 dst.append(reinterpret_cast<const T_to*>(szStackBufferWCMB), strnlen(szStackBufferWCMB, cch));
-
169 return;
-
170 }
-
171 if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) {
-
172 // Query the required output size. Allocate buffer. Then convert again.
-
173 cch = WideCharToMultiByte(static_cast<UINT>(m_to), dwFlagsWCMB, szStackBufferMBWC, static_cast<int>(count_inter), NULL, 0, lpDefaultChar, NULL);
-
174 std::unique_ptr<CHAR[]> szBufferWCMB(new CHAR[cch]);
-
175 cch = WideCharToMultiByte(static_cast<UINT>(m_to), dwFlagsWCMB, szStackBufferMBWC, static_cast<int>(count_inter), szBufferWCMB.get(), cch, lpDefaultChar, NULL);
-
176 dst.append(reinterpret_cast<const T_to*>(szBufferWCMB.get()), strnlen(szBufferWCMB.get(), cch));
-
177 return;
-
178 }
-
179 throw std::runtime_error("WideCharToMultiByte failed");
-
180 }
-
181 if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) {
-
182 // Query the required output size. Allocate buffer. Then convert again.
-
183 cch = MultiByteToWideChar(static_cast<UINT>(m_from), dwFlagsMBWC, reinterpret_cast<LPCCH>(src), static_cast<int>(count_src), NULL, 0);
-
184 std::unique_ptr<WCHAR[]> szBufferMBWC(new WCHAR[cch]);
-
185 cch = MultiByteToWideChar(static_cast<UINT>(m_from), dwFlagsMBWC, reinterpret_cast<LPCCH>(src), static_cast<int>(count_src), szBufferMBWC.get(), cch);
-
186 size_t count_inter = count_src != SIZE_MAX ? wcsnlen(szBufferMBWC.get(), cch) : static_cast<size_t>(cch) - 1;
-
187
-
188 // Query the required output size. Allocate buffer. Then convert again.
-
189 cch = WideCharToMultiByte(static_cast<UINT>(m_to), dwFlagsWCMB, szBufferMBWC.get(), static_cast<int>(count_inter), NULL, 0, lpDefaultChar, NULL);
-
190 std::unique_ptr<CHAR[]> szBufferWCMB(new CHAR[cch]);
-
191 cch = WideCharToMultiByte(static_cast<UINT>(m_to), dwFlagsWCMB, szBufferMBWC.get(), static_cast<int>(count_inter), szBufferWCMB.get(), cch, lpDefaultChar, NULL);
-
192 dst.append(reinterpret_cast<const T_to*>(szBufferWCMB.get()), strnlen(szBufferWCMB.get(), cch));
-
193 return;
-
194 }
-
195 throw std::runtime_error("MultiByteToWideChar failed");
-
196 }
-
197#else
-
198 T_to buf[1024 / sizeof(T_to)];
-
199 size_t src_size = stdex::mul(sizeof(T_from), count_src);
-
200 do {
-
201 T_to* output = &buf[0];
-
202 size_t output_size = sizeof(buf);
-
203 errno = 0;
-
204 iconv(m_handle, (char**)&src, &src_size, (char**)&output, &output_size);
-
205 if (errno)
-
206 throw std::runtime_error("iconv failed");
+
89 assert(src || !count_src);
+
90 count_src = stdex::strnlen(src, count_src);
+
91 if (!count_src) _Unlikely_
+
92 return;
+
93
+
94#ifdef _WIN32
+
95 constexpr DWORD dwFlagsMBWC = MB_PRECOMPOSED;
+
96 constexpr DWORD dwFlagsWCMB = 0;
+
97 constexpr LPCCH lpDefaultChar = NULL;
+
98
+
99 _Analysis_assume_(src);
+
100 if (m_from == m_to) _Unlikely_{
+
101 dst.append(reinterpret_cast<const T_to*>(src), count_src);
+
102 return;
+
103 }
+
104
+
105 if _Constexpr_ (sizeof(T_from) == sizeof(char) && sizeof(T_to) == sizeof(wchar_t)) {
+
106 assert(count_src < INT_MAX || count_src == SIZE_MAX);
+
107
+
108 // Try to convert to stack buffer first.
+
109 WCHAR szStackBuffer[1024 / sizeof(WCHAR)];
+
110#pragma warning(suppress: 6387) // Testing indicates src may be NULL when count_src is also 0. Is SAL of the lpMultiByteStr parameter wrong?
+
111 int cch = MultiByteToWideChar(static_cast<UINT>(m_from), dwFlagsMBWC, reinterpret_cast<LPCCH>(src), static_cast<int>(count_src), szStackBuffer, _countof(szStackBuffer));
+
112 if (cch) {
+
113 // Append from stack.
+
114 dst.append(reinterpret_cast<const T_to*>(szStackBuffer), count_src != SIZE_MAX ? wcsnlen(szStackBuffer, cch) : static_cast<size_t>(cch) - 1);
+
115 return;
+
116 }
+
117 if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) {
+
118 // Query the required output size. Allocate buffer. Then convert again.
+
119 cch = MultiByteToWideChar(static_cast<UINT>(m_from), dwFlagsMBWC, reinterpret_cast<LPCCH>(src), static_cast<int>(count_src), NULL, 0);
+
120 std::unique_ptr<WCHAR[]> szBuffer(new WCHAR[cch]);
+
121 cch = MultiByteToWideChar(static_cast<UINT>(m_from), dwFlagsMBWC, reinterpret_cast<LPCCH>(src), static_cast<int>(count_src), szBuffer.get(), cch);
+
122 dst.append(reinterpret_cast<const T_to*>(szBuffer.get()), count_src != SIZE_MAX ? wcsnlen(szBuffer.get(), cch) : static_cast<size_t>(cch) - 1);
+
123 return;
+
124 }
+
125 throw std::runtime_error("MultiByteToWideChar failed");
+
126 }
+
127
+
128 if _Constexpr_ (sizeof(T_from) == sizeof(wchar_t) && sizeof(T_to) == sizeof(char)) {
+
129 assert(count_src < INT_MAX || count_src == SIZE_MAX);
+
130
+
131 // Try to convert to stack buffer first.
+
132 CHAR szStackBuffer[1024 / sizeof(CHAR)];
+
133#pragma warning(suppress: 6387) // Testing indicates src may be NULL when count_src is also 0. Is SAL of the lpWideCharStr parameter wrong?
+
134 int cch = WideCharToMultiByte(static_cast<UINT>(m_to), dwFlagsWCMB, reinterpret_cast<LPCWCH>(src), static_cast<int>(count_src), szStackBuffer, _countof(szStackBuffer), lpDefaultChar, NULL);
+
135 if (cch) {
+
136 // Copy from stack. Be careful not to include zero terminator.
+
137 dst.append(reinterpret_cast<const T_to*>(szStackBuffer), count_src != SIZE_MAX ? strnlen(szStackBuffer, cch) : static_cast<size_t>(cch) - 1);
+
138 return;
+
139 }
+
140 if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) {
+
141 // Query the required output size. Allocate buffer. Then convert again.
+
142 cch = WideCharToMultiByte(static_cast<UINT>(m_to), dwFlagsWCMB, reinterpret_cast<LPCWCH>(src), static_cast<int>(count_src), NULL, 0, lpDefaultChar, NULL);
+
143 std::unique_ptr<CHAR[]> szBuffer(new CHAR[cch]);
+
144 cch = WideCharToMultiByte(static_cast<UINT>(m_to), dwFlagsWCMB, reinterpret_cast<LPCWCH>(src), static_cast<int>(count_src), szBuffer.get(), cch, lpDefaultChar, NULL);
+
145 dst.append(reinterpret_cast<const T_to*>(szBuffer.get()), count_src != SIZE_MAX ? strnlen(szBuffer.get(), cch) : static_cast<size_t>(cch) - 1);
+
146 return;
+
147 }
+
148 throw std::runtime_error("WideCharToMultiByte failed");
+
149 }
+
150
+
151 if _Constexpr_ (sizeof(T_from) == sizeof(char) && sizeof(T_to) == sizeof(char)) {
+
152 assert(count_src < INT_MAX || count_src == SIZE_MAX);
+
153
+
154 // Try to convert to stack buffer first.
+
155 WCHAR szStackBufferMBWC[512 / sizeof(WCHAR)];
+
156#pragma warning(suppress: 6387) // Testing indicates src may be NULL when count_src is also 0. Is SAL of the lpMultiByteStr parameter wrong?
+
157 int cch = MultiByteToWideChar(static_cast<UINT>(m_from), dwFlagsMBWC, reinterpret_cast<LPCCH>(src), static_cast<int>(count_src), szStackBufferMBWC, _countof(szStackBufferMBWC));
+
158 if (cch) {
+
159 // Append from stack.
+
160 size_t count_inter = count_src != SIZE_MAX ? wcsnlen(szStackBufferMBWC, cch) : static_cast<size_t>(cch) - 1;
+
161 assert(count_inter < INT_MAX);
+
162
+
163 // Try to convert to stack buffer first.
+
164 CHAR szStackBufferWCMB[512 / sizeof(CHAR)];
+
165#pragma warning(suppress: 6387) // Testing indicates szStackBufferMBWC may be NULL when count_inter is also 0. Is SAL of the lpWideCharStr parameter wrong?
+
166 cch = WideCharToMultiByte(static_cast<UINT>(m_to), dwFlagsWCMB, szStackBufferMBWC, static_cast<int>(count_inter), szStackBufferWCMB, _countof(szStackBufferWCMB), lpDefaultChar, NULL);
+
167 if (cch) {
+
168 // Copy from stack. Be careful not to include zero terminator.
+
169 dst.append(reinterpret_cast<const T_to*>(szStackBufferWCMB), strnlen(szStackBufferWCMB, cch));
+
170 return;
+
171 }
+
172 if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) {
+
173 // Query the required output size. Allocate buffer. Then convert again.
+
174 cch = WideCharToMultiByte(static_cast<UINT>(m_to), dwFlagsWCMB, szStackBufferMBWC, static_cast<int>(count_inter), NULL, 0, lpDefaultChar, NULL);
+
175 std::unique_ptr<CHAR[]> szBufferWCMB(new CHAR[cch]);
+
176 cch = WideCharToMultiByte(static_cast<UINT>(m_to), dwFlagsWCMB, szStackBufferMBWC, static_cast<int>(count_inter), szBufferWCMB.get(), cch, lpDefaultChar, NULL);
+
177 dst.append(reinterpret_cast<const T_to*>(szBufferWCMB.get()), strnlen(szBufferWCMB.get(), cch));
+
178 return;
+
179 }
+
180 throw std::runtime_error("WideCharToMultiByte failed");
+
181 }
+
182 if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) {
+
183 // Query the required output size. Allocate buffer. Then convert again.
+
184 cch = MultiByteToWideChar(static_cast<UINT>(m_from), dwFlagsMBWC, reinterpret_cast<LPCCH>(src), static_cast<int>(count_src), NULL, 0);
+
185 std::unique_ptr<WCHAR[]> szBufferMBWC(new WCHAR[cch]);
+
186 cch = MultiByteToWideChar(static_cast<UINT>(m_from), dwFlagsMBWC, reinterpret_cast<LPCCH>(src), static_cast<int>(count_src), szBufferMBWC.get(), cch);
+
187 size_t count_inter = count_src != SIZE_MAX ? wcsnlen(szBufferMBWC.get(), cch) : static_cast<size_t>(cch) - 1;
+
188
+
189 // Query the required output size. Allocate buffer. Then convert again.
+
190 cch = WideCharToMultiByte(static_cast<UINT>(m_to), dwFlagsWCMB, szBufferMBWC.get(), static_cast<int>(count_inter), NULL, 0, lpDefaultChar, NULL);
+
191 std::unique_ptr<CHAR[]> szBufferWCMB(new CHAR[cch]);
+
192 cch = WideCharToMultiByte(static_cast<UINT>(m_to), dwFlagsWCMB, szBufferMBWC.get(), static_cast<int>(count_inter), szBufferWCMB.get(), cch, lpDefaultChar, NULL);
+
193 dst.append(reinterpret_cast<const T_to*>(szBufferWCMB.get()), strnlen(szBufferWCMB.get(), cch));
+
194 return;
+
195 }
+
196 throw std::runtime_error("MultiByteToWideChar failed");
+
197 }
+
198#else
+
199 dst.reserve(dst.size() + count_src);
+
200 T_to buf[1024 / sizeof(T_to)];
+
201 size_t src_size = stdex::mul(sizeof(T_from), count_src);
+
202 for (;;) {
+
203 T_to* output = &buf[0];
+
204 size_t output_size = sizeof(buf);
+
205 errno = 0;
+
206 iconv(m_handle, const_cast<char**>(reinterpret_cast<const char**>(&src)), &src_size, reinterpret_cast<char**>(&output), &output_size);
207 dst.append(buf, reinterpret_cast<T_to*>(reinterpret_cast<char*>(buf) + sizeof(buf) - output_size));
-
208 } while (src_size);
-
209#endif
-
210 }
+
208 if (!errno)
+
209 break;
+
210 if (errno == E2BIG)
+
211 continue;
+
212 throw std::runtime_error("iconv failed");
+
213 }
+
214#endif
+
215 }
-
211
-
218 template <class _Traits_to = std::char_traits<T_to>, class _Alloc_to = std::allocator<T_to>>
-
-
219 inline void strcat(
-
220 _Inout_ std::basic_string<T_to, _Traits_to, _Alloc_to>& dst,
-
221 _In_z_ const T_from* src)
-
222 {
-
223 strcat(dst, src, SIZE_MAX);
-
224 }
+
216
+
223 template <class _Traits_to = std::char_traits<T_to>, class _Alloc_to = std::allocator<T_to>>
+
+
224 inline void strcat(
+
225 _Inout_ std::basic_string<T_to, _Traits_to, _Alloc_to>& dst,
+
226 _In_z_ const T_from* src)
+
227 {
+
228 strcat(dst, src, SIZE_MAX);
+
229 }
-
225
-
232 template <class _Traits_to = std::char_traits<T_to>, class _Alloc_to = std::allocator<T_to>, class _Traits_from = std::char_traits<T_from>, class _Alloc_from = std::allocator<T_from>>
-
-
233 inline void strcat(
-
234 _Inout_ std::basic_string<T_to, _Traits_to, _Alloc_to>& dst,
-
235 _In_ const std::basic_string<T_from, _Traits_from, _Alloc_from>& src)
-
236 {
-
237 strcat(dst, src.data(), src.size());
-
238 }
+
230
+
237 template <class _Traits_to = std::char_traits<T_to>, class _Alloc_to = std::allocator<T_to>, class _Traits_from = std::char_traits<T_from>, class _Alloc_from = std::allocator<T_from>>
+
+
238 inline void strcat(
+
239 _Inout_ std::basic_string<T_to, _Traits_to, _Alloc_to>& dst,
+
240 _In_ const std::basic_string<T_from, _Traits_from, _Alloc_from>& src)
+
241 {
+
242 strcat(dst, src.data(), src.size());
+
243 }
-
239
-
247 template <class _Traits_to = std::char_traits<T_to>, class _Alloc_to = std::allocator<T_to>>
-
-
248 inline void strcpy(
-
249 _Inout_ std::basic_string<T_to, _Traits_to, _Alloc_to>& dst,
-
250 _In_reads_or_z_opt_(count_src) const T_from* src, _In_ size_t count_src)
-
251 {
-
252 dst.clear();
-
253 strcat(dst, src, count_src);
-
254 }
+
244
+
252 template <class _Traits_to = std::char_traits<T_to>, class _Alloc_to = std::allocator<T_to>>
+
+
253 inline void strcpy(
+
254 _Inout_ std::basic_string<T_to, _Traits_to, _Alloc_to>& dst,
+
255 _In_reads_or_z_opt_(count_src) const T_from* src, _In_ size_t count_src)
+
256 {
+
257 dst.clear();
+
258 strcat(dst, src, count_src);
+
259 }
-
255
-
262 template <class _Traits_to = std::char_traits<T_to>, class _Alloc_to = std::allocator<T_to>>
-
-
263 inline void strcpy(
-
264 _Inout_ std::basic_string<T_to, _Traits_to, _Alloc_to>& dst,
-
265 _In_z_ const T_from* src)
-
266 {
-
267 strcpy(dst, src, SIZE_MAX);
-
268 }
+
260
+
267 template <class _Traits_to = std::char_traits<T_to>, class _Alloc_to = std::allocator<T_to>>
+
+
268 inline void strcpy(
+
269 _Inout_ std::basic_string<T_to, _Traits_to, _Alloc_to>& dst,
+
270 _In_z_ const T_from* src)
+
271 {
+
272 strcpy(dst, src, SIZE_MAX);
+
273 }
-
269
-
276 template <class _Traits_to = std::char_traits<T_to>, class _Alloc_to = std::allocator<T_to>, class _Traits_from = std::char_traits<T_from>, class _Alloc_from = std::allocator<T_from>>
-
-
277 inline void strcpy(
-
278 _Inout_ std::basic_string<T_to, _Traits_to, _Alloc_to>& dst,
-
279 _In_ const std::basic_string<T_from, _Traits_from, _Alloc_from>& src)
-
280 {
-
281 strcpy(dst, src.data(), src.size());
-
282 }
+
274
+
281 template <class _Traits_to = std::char_traits<T_to>, class _Alloc_to = std::allocator<T_to>, class _Traits_from = std::char_traits<T_from>, class _Alloc_from = std::allocator<T_from>>
+
+
282 inline void strcpy(
+
283 _Inout_ std::basic_string<T_to, _Traits_to, _Alloc_to>& dst,
+
284 _In_ const std::basic_string<T_from, _Traits_from, _Alloc_from>& src)
+
285 {
+
286 strcpy(dst, src.data(), src.size());
+
287 }
-
283
-
290 template <class _Traits_to = std::char_traits<T_to>, class _Alloc_to = std::allocator<T_to>>
-
-
291 inline std::basic_string<T_to, _Traits_to, _Alloc_to> convert(_In_reads_or_z_opt_(count_src) const T_from* src, _In_ size_t count_src)
-
292 {
-
293 std::basic_string<T_to, _Traits_to, _Alloc_to> dst;
-
294 strcat(dst, src, count_src);
-
295 return dst;
-
296 }
+
288
+
295 template <class _Traits_to = std::char_traits<T_to>, class _Alloc_to = std::allocator<T_to>>
+
+
296 inline std::basic_string<T_to, _Traits_to, _Alloc_to> convert(_In_reads_or_z_opt_(count_src) const T_from* src, _In_ size_t count_src)
+
297 {
+
298 std::basic_string<T_to, _Traits_to, _Alloc_to> dst;
+
299 strcat(dst, src, count_src);
+
300 return dst;
+
301 }
-
297
-
303 template <class _Traits_to = std::char_traits<T_to>, class _Alloc_to = std::allocator<T_to>>
-
-
304 inline std::basic_string<T_to, _Traits_to, _Alloc_to> convert(_In_z_ const T_from* src)
-
305 {
-
306 return convert(src, SIZE_MAX);
-
307 }
+
302
+
308 template <class _Traits_to = std::char_traits<T_to>, class _Alloc_to = std::allocator<T_to>>
+
+
309 inline std::basic_string<T_to, _Traits_to, _Alloc_to> convert(_In_z_ const T_from* src)
+
310 {
+
311 return convert(src, SIZE_MAX);
+
312 }
-
308
-
314 template <class _Traits_to = std::char_traits<T_to>, class _Alloc_to = std::allocator<T_to>, class _Traits_from = std::char_traits<T_from>, class _Alloc_from = std::allocator<T_from>>
-
-
315 inline std::basic_string<T_to, _Traits_to, _Alloc_to> convert(_In_ const std::basic_string<T_from, _Traits_from, _Alloc_from>& src)
-
316 {
-
317 return convert(src.data(), src.size());
-
318 }
-
-
319
-
320 inline void clear()
+
313
+
319 template <class _Traits_to = std::char_traits<T_to>, class _Alloc_to = std::allocator<T_to>, class _Traits_from = std::char_traits<T_from>, class _Alloc_from = std::allocator<T_from>>
+
+
320 inline std::basic_string<T_to, _Traits_to, _Alloc_to> convert(_In_ const std::basic_string<T_from, _Traits_from, _Alloc_from>& src)
321 {
-
322#ifndef _WIN32
-
323 iconv(m_handle, NULL, NULL, NULL, NULL);
-
324#endif
-
325 }
-
326
-
327#ifdef _WIN32
-
328 protected:
-
329 static UINT to_encoding(_In_ charset_id charset)
-
330 {
-
331 return
-
332 charset == charset_id::system ? GetACP() :
-
333 charset == charset_id::oem ? GetOEMCP() :
-
334 static_cast<UINT>(charset);
-
335 }
-
336
-
337 protected:
-
338 UINT m_from, m_to;
-
339#else
-
340 protected:
-
341 static const char* to_encoding(_In_ charset_id charset)
-
342 {
-
343 static const char* const encodings[static_cast<std::underlying_type_t<charset_id>>(charset_id::_max)] = {
-
344 "", // system
-
345 "UTF-8", // utf8
-
346#if BYTE_ORDER == BIG_ENDIAN
-
347 "UTF-16BE", // utf16
-
348 "UTF-32BE", // utf32
-
349#else
-
350 "UTF-16LE", // utf16
-
351 "UTF-32LE", // utf32
-
352#endif
-
353 "CP1250", // windows1250
-
354 "CP1251", // windows1251
-
355 "CP1252", // windows1252
-
356 }
-
357 return
-
358 charset == charset_id::system ? nl_langinfo(LC_CTYPE) :
-
359 encodings[static_cast<std::underlying_type_t<charset_id>>(charset))];
-
360 }
-
361
-
362 protected:
-
363 iconv_t m_handle;
-
364#endif
-
365 };
+
322 return convert(src.data(), src.size());
+
323 }
+
324
+
325 inline void clear()
+
326 {
+
327#ifndef _WIN32
+
328 iconv(m_handle, NULL, NULL, NULL, NULL);
+
329#endif
+
330 }
+
331
+
332#ifdef _WIN32
+
333 protected:
+
334 static UINT to_encoding(_In_ charset_id charset)
+
335 {
+
336 return
+
337 charset == charset_id::system ? GetACP() :
+
338 charset == charset_id::oem ? GetOEMCP() :
+
339 static_cast<UINT>(charset);
+
340 }
+
341
+
342 protected:
+
343 UINT m_from, m_to;
+
344#else
+
345 protected:
+
346 static const char* to_encoding(_In_ charset_id charset)
+
347 {
+
348 static const char* const encodings[static_cast<std::underlying_type_t<charset_id>>(charset_id::_max)] = {
+
349 "", // system
+
350 "UTF-8", // utf8
+
351#if BYTE_ORDER == BIG_ENDIAN
+
352 "UTF-16BE", // utf16
+
353 "UTF-32BE", // utf32
+
354#else
+
355 "UTF-16LE", // utf16
+
356 "UTF-32LE", // utf32
+
357#endif
+
358 "CP1250", // windows1250
+
359 "CP1251", // windows1251
+
360 "CP1252", // windows1252
+
361 };
+
362 return
+
363 charset == charset_id::system ? nl_langinfo(LC_CTYPE) :
+
364 encodings[static_cast<std::underlying_type_t<charset_id>>(charset)];
+
365 }
366
-
377 inline void strcat(
-
378 _Inout_ std::wstring& dst,
-
379 _In_reads_or_z_opt_(count_src) const char* src, _In_ size_t count_src,
-
380 _In_ charset_id charset = charset_id::system)
-
381 {
-
382 charset_encoder<char, wchar_t>(charset, wchar_t_charset).strcat(dst, src, count_src);
-
383 }
-
384
-
385 _Deprecated_("Use stdex::strcat")
-
386 inline void str2wstr(
-
387 _Inout_ std::wstring& dst,
-
388 _In_reads_or_z_opt_(count_src) const char* src, _In_ size_t count_src,
-
389 _In_ charset_id charset = charset_id::system)
-
390 {
-
391 strcat(dst, src, count_src, charset);
-
392 }
-
393
-
403 inline void strcat(
-
404 _Inout_ std::wstring& dst,
-
405 _In_ const std::string& src,
-
406 _In_ charset_id charset = charset_id::system)
-
407 {
-
408 strcat(dst, src.data(), src.size(), charset);
-
409 }
-
410
-
411 _Deprecated_("Use stdex::strcat")
-
412 inline void str2wstr(
-
413 _Inout_ std::wstring& dst,
-
414 _In_ const std::string& src,
-
415 _In_ charset_id charset = charset_id::system)
-
416 {
-
417 strcat(dst, src, charset);
-
418 }
-
419
-
430 inline void strcpy(
-
431 _Inout_ std::wstring& dst,
-
432 _In_reads_or_z_opt_(count_src) const char* src, _In_ size_t count_src,
-
433 _In_ charset_id charset = charset_id::system)
-
434 {
-
435 dst.clear();
-
436 strcat(dst, src, count_src, charset);
-
437 }
-
438
-
448 inline void strcpy(
-
449 _Inout_ std::wstring& dst,
-
450 _In_ const std::string& src,
-
451 _In_ charset_id charset = charset_id::system)
-
452 {
-
453 strcpy(dst, src.data(), src.size(), charset);
-
454 }
-
455
-
466 inline std::wstring str2wstr(
-
467 _In_z_ const char* src,
-
468 _In_ charset_id charset = charset_id::system)
-
469 {
-
470 std::wstring dst;
-
471 strcat(dst, src, SIZE_MAX, charset);
-
472 return dst;
-
473 }
-
474
-
486 inline std::wstring str2wstr(
-
487 _In_reads_or_z_opt_(count_src) const char* src, _In_ size_t count_src,
-
488 _In_ charset_id charset = charset_id::system)
-
489 {
-
490 std::wstring dst;
-
491 strcat(dst, src, count_src, charset);
-
492 return dst;
-
493 }
-
494
-
505 inline std::wstring str2wstr(
-
506 _In_ const std::string& src,
-
507 _In_ charset_id charset = charset_id::system)
-
508 {
-
509 return str2wstr(src.c_str(), src.size(), charset);
-
510 }
-
511
-
522 inline void strcat(
-
523 _Inout_ std::string& dst,
-
524 _In_reads_or_z_opt_(count_src) const wchar_t* src, _In_ size_t count_src,
-
525 _In_ charset_id charset = charset_id::system)
-
526 {
-
527 charset_encoder<wchar_t, char>(wchar_t_charset, charset).strcat(dst, src, count_src);
-
528 }
-
529
-
530 _Deprecated_("Use stdex::strcat")
-
531 inline void wstr2str(
-
532 _Inout_ std::string& dst,
-
533 _In_reads_or_z_opt_(count_src) const wchar_t* src, _In_ size_t count_src,
-
534 _In_ charset_id charset = charset_id::system)
-
535 {
-
536 strcat(dst, src, count_src, charset);
-
537 }
-
538
-
548 inline void strcat(
-
549 _Inout_ std::string& dst,
-
550 _In_ const std::wstring& src,
-
551 _In_ charset_id charset = charset_id::system)
-
552 {
-
553 strcat(dst, src.c_str(), src.size(), charset);
-
554 }
-
555
-
556 _Deprecated_("Use stdex::strcat")
-
557 inline void wstr2str(
-
558 _Inout_ std::string& dst,
-
559 _In_ const std::wstring& src,
-
560 _In_ charset_id charset = charset_id::system)
-
561 {
-
562 strcat(dst, src, charset);
-
563 }
-
564
-
575 inline void strcpy(
-
576 _Inout_ std::string& dst,
-
577 _In_reads_or_z_opt_(count_src) const wchar_t* src, _In_ size_t count_src,
-
578 _In_ charset_id charset = charset_id::system)
-
579 {
-
580 dst.clear();
-
581 strcat(dst, src, count_src, charset);
-
582 }
-
583
-
593 inline void strcpy(
-
594 _Inout_ std::string& dst,
-
595 _In_ const std::wstring& src,
-
596 _In_ charset_id charset = charset_id::system)
-
597 {
-
598 strcpy(dst, src.data(), src.size(), charset);
-
599 }
-
600
-
611 inline std::string wstr2str(
-
612 _In_z_ const wchar_t* src,
-
613 _In_ charset_id charset = charset_id::system)
-
614 {
-
615 std::string dst;
-
616 strcat(dst, src, SIZE_MAX, charset);
-
617 return dst;
-
618 }
-
619
-
631 inline std::string wstr2str(
-
632 _In_reads_or_z_opt_(count_src) const wchar_t* src, _In_ size_t count_src,
-
633 _In_ charset_id charset = charset_id::system)
-
634 {
-
635 std::string dst;
-
636 strcat(dst, src, count_src, charset);
-
637 return dst;
-
638 }
-
639
-
650 inline std::string wstr2str(
-
651 _In_ const std::wstring& src,
-
652 _In_ charset_id charset = charset_id::system)
-
653 {
-
654 return wstr2str(src.c_str(), src.size(), charset);
-
655 }
-
656}
+
367 protected:
+
368 iconv_t m_handle;
+
369#endif
+
370 };
+
+
371
+
382 inline void strcat(
+
383 _Inout_ std::wstring& dst,
+
384 _In_reads_or_z_opt_(count_src) const char* src, _In_ size_t count_src,
+
385 _In_ charset_id charset = charset_id::system)
+
386 {
+
387 charset_encoder<char, wchar_t>(charset, wchar_t_charset).strcat(dst, src, count_src);
+
388 }
+
389
+
390 _Deprecated_("Use stdex::strcat")
+
391 inline void str2wstr(
+
392 _Inout_ std::wstring& dst,
+
393 _In_reads_or_z_opt_(count_src) const char* src, _In_ size_t count_src,
+
394 _In_ charset_id charset = charset_id::system)
+
395 {
+
396 strcat(dst, src, count_src, charset);
+
397 }
+
398
+
408 inline void strcat(
+
409 _Inout_ std::wstring& dst,
+
410 _In_ const std::string& src,
+
411 _In_ charset_id charset = charset_id::system)
+
412 {
+
413 strcat(dst, src.data(), src.size(), charset);
+
414 }
+
415
+
416 _Deprecated_("Use stdex::strcat")
+
417 inline void str2wstr(
+
418 _Inout_ std::wstring& dst,
+
419 _In_ const std::string& src,
+
420 _In_ charset_id charset = charset_id::system)
+
421 {
+
422 strcat(dst, src, charset);
+
423 }
+
424
+
435 inline void strcpy(
+
436 _Inout_ std::wstring& dst,
+
437 _In_reads_or_z_opt_(count_src) const char* src, _In_ size_t count_src,
+
438 _In_ charset_id charset = charset_id::system)
+
439 {
+
440 dst.clear();
+
441 strcat(dst, src, count_src, charset);
+
442 }
+
443
+
453 inline void strcpy(
+
454 _Inout_ std::wstring& dst,
+
455 _In_ const std::string& src,
+
456 _In_ charset_id charset = charset_id::system)
+
457 {
+
458 strcpy(dst, src.data(), src.size(), charset);
+
459 }
+
460
+
471 inline std::wstring str2wstr(
+
472 _In_z_ const char* src,
+
473 _In_ charset_id charset = charset_id::system)
+
474 {
+
475 std::wstring dst;
+
476 strcat(dst, src, SIZE_MAX, charset);
+
477 return dst;
+
478 }
+
479
+
491 inline std::wstring str2wstr(
+
492 _In_reads_or_z_opt_(count_src) const char* src, _In_ size_t count_src,
+
493 _In_ charset_id charset = charset_id::system)
+
494 {
+
495 std::wstring dst;
+
496 strcat(dst, src, count_src, charset);
+
497 return dst;
+
498 }
+
499
+
510 inline std::wstring str2wstr(
+
511 _In_ const std::string& src,
+
512 _In_ charset_id charset = charset_id::system)
+
513 {
+
514 return str2wstr(src.c_str(), src.size(), charset);
+
515 }
+
516
+
527 inline void strcat(
+
528 _Inout_ std::string& dst,
+
529 _In_reads_or_z_opt_(count_src) const wchar_t* src, _In_ size_t count_src,
+
530 _In_ charset_id charset = charset_id::system)
+
531 {
+
532 charset_encoder<wchar_t, char>(wchar_t_charset, charset).strcat(dst, src, count_src);
+
533 }
+
534
+
535 _Deprecated_("Use stdex::strcat")
+
536 inline void wstr2str(
+
537 _Inout_ std::string& dst,
+
538 _In_reads_or_z_opt_(count_src) const wchar_t* src, _In_ size_t count_src,
+
539 _In_ charset_id charset = charset_id::system)
+
540 {
+
541 strcat(dst, src, count_src, charset);
+
542 }
+
543
+
553 inline void strcat(
+
554 _Inout_ std::string& dst,
+
555 _In_ const std::wstring& src,
+
556 _In_ charset_id charset = charset_id::system)
+
557 {
+
558 strcat(dst, src.c_str(), src.size(), charset);
+
559 }
+
560
+
561 _Deprecated_("Use stdex::strcat")
+
562 inline void wstr2str(
+
563 _Inout_ std::string& dst,
+
564 _In_ const std::wstring& src,
+
565 _In_ charset_id charset = charset_id::system)
+
566 {
+
567 strcat(dst, src, charset);
+
568 }
+
569
+
580 inline void strcpy(
+
581 _Inout_ std::string& dst,
+
582 _In_reads_or_z_opt_(count_src) const wchar_t* src, _In_ size_t count_src,
+
583 _In_ charset_id charset = charset_id::system)
+
584 {
+
585 dst.clear();
+
586 strcat(dst, src, count_src, charset);
+
587 }
+
588
+
598 inline void strcpy(
+
599 _Inout_ std::string& dst,
+
600 _In_ const std::wstring& src,
+
601 _In_ charset_id charset = charset_id::system)
+
602 {
+
603 strcpy(dst, src.data(), src.size(), charset);
+
604 }
+
605
+
616 inline std::string wstr2str(
+
617 _In_z_ const wchar_t* src,
+
618 _In_ charset_id charset = charset_id::system)
+
619 {
+
620 std::string dst;
+
621 strcat(dst, src, SIZE_MAX, charset);
+
622 return dst;
+
623 }
+
624
+
636 inline std::string wstr2str(
+
637 _In_reads_or_z_opt_(count_src) const wchar_t* src, _In_ size_t count_src,
+
638 _In_ charset_id charset = charset_id::system)
+
639 {
+
640 std::string dst;
+
641 strcat(dst, src, count_src, charset);
+
642 return dst;
+
643 }
+
644
+
655 inline std::string wstr2str(
+
656 _In_ const std::wstring& src,
+
657 _In_ charset_id charset = charset_id::system)
+
658 {
+
659 return wstr2str(src.c_str(), src.size(), charset);
+
660 }
+
661}
Encoding converter context.
Definition unicode.hpp:56
-
void strcpy(std::basic_string< T_to, _Traits_to, _Alloc_to > &dst, const std::basic_string< T_from, _Traits_from, _Alloc_from > &src)
Convert string.
Definition unicode.hpp:277
-
std::basic_string< T_to, _Traits_to, _Alloc_to > convert(const std::basic_string< T_from, _Traits_from, _Alloc_from > &src)
Return converted string.
Definition unicode.hpp:315
-
std::basic_string< T_to, _Traits_to, _Alloc_to > convert(const T_from *src)
Return converted string.
Definition unicode.hpp:304
-
void strcat(std::basic_string< T_to, _Traits_to, _Alloc_to > &dst, const std::basic_string< T_from, _Traits_from, _Alloc_from > &src)
Convert string and append to string.
Definition unicode.hpp:233
-
void strcpy(std::basic_string< T_to, _Traits_to, _Alloc_to > &dst, const T_from *src)
Convert string.
Definition unicode.hpp:263
+
void strcpy(std::basic_string< T_to, _Traits_to, _Alloc_to > &dst, const std::basic_string< T_from, _Traits_from, _Alloc_from > &src)
Convert string.
Definition unicode.hpp:282
+
std::basic_string< T_to, _Traits_to, _Alloc_to > convert(const std::basic_string< T_from, _Traits_from, _Alloc_from > &src)
Return converted string.
Definition unicode.hpp:320
+
std::basic_string< T_to, _Traits_to, _Alloc_to > convert(const T_from *src)
Return converted string.
Definition unicode.hpp:309
+
void strcat(std::basic_string< T_to, _Traits_to, _Alloc_to > &dst, const std::basic_string< T_from, _Traits_from, _Alloc_from > &src)
Convert string and append to string.
Definition unicode.hpp:238
+
void strcpy(std::basic_string< T_to, _Traits_to, _Alloc_to > &dst, const T_from *src)
Convert string.
Definition unicode.hpp:268
void strcat(std::basic_string< T_to, _Traits_to, _Alloc_to > &dst, _In_reads_or_z_opt_(count_src) const T_from *src, size_t count_src)
Convert string and append to string.
Definition unicode.hpp:85
-
void strcat(std::basic_string< T_to, _Traits_to, _Alloc_to > &dst, const T_from *src)
Convert string and append to string.
Definition unicode.hpp:219
-
void strcpy(std::basic_string< T_to, _Traits_to, _Alloc_to > &dst, _In_reads_or_z_opt_(count_src) const T_from *src, size_t count_src)
Convert string.
Definition unicode.hpp:248
-
std::basic_string< T_to, _Traits_to, _Alloc_to > convert(_In_reads_or_z_opt_(count_src) const T_from *src, size_t count_src)
Return converted string.
Definition unicode.hpp:291
+
void strcat(std::basic_string< T_to, _Traits_to, _Alloc_to > &dst, const T_from *src)
Convert string and append to string.
Definition unicode.hpp:224
+
void strcpy(std::basic_string< T_to, _Traits_to, _Alloc_to > &dst, _In_reads_or_z_opt_(count_src) const T_from *src, size_t count_src)
Convert string.
Definition unicode.hpp:253
+
std::basic_string< T_to, _Traits_to, _Alloc_to > convert(_In_reads_or_z_opt_(count_src) const T_from *src, size_t count_src)
Return converted string.
Definition unicode.hpp:296
diff --git a/vector__queue_8hpp_source.html b/vector__queue_8hpp_source.html index c75e36f5e..0a0c3b90e 100644 --- a/vector__queue_8hpp_source.html +++ b/vector__queue_8hpp_source.html @@ -451,7 +451,7 @@ $(document).ready(function() { init_codefold(0); });