diff --git a/annotated.html b/annotated.html index d8eac511d..4be6b7d9c 100644 --- a/annotated.html +++ b/annotated.html @@ -74,7 +74,7 @@ $(function() {
Here are the classes, structs, unions and interfaces with brief descriptions:
-
[detail level 123]
+
[detail level 1234]
@@ -168,38 +168,55 @@ $(function() { - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 Nstdex
 Nchrono
 Cbase64_decBase64 decoding session
 Cbase64_encBase64 encoding session
 Cbasic_diagstreamDiagnostic input/output stream
 Cbasic_diagstreambufDiagnostic input stream buffer
 Cbasic_fstreamFile stream with additional std::filesystem features
 Cbasic_iostreamfmtBinary stream reader/writer
 Cbasic_isharedstrstream
 Cbasic_istreamfmtBinary stream reader
 Cbasic_ostreamfmtBinary stream writer
 Cbasic_sharedstrbufShared-memory string stream buffer
 Cbasic_stringstreamString stream
 Cerrno_errorStandard C runtime library error
 CgetterHelper template to allow access to internal std C++ private members
 Cglobal_progressGlobal progress indicator base class
 Chex_decHexadecimal decoding session
 Chex_encHexadecimal encoding session
 CintervalNumerical interval
 Clazy_progressLazy progress indicator base class
 CmappingMaps index in source string to index in destination string
 Cno_deleteNoop deleter
 Cno_delete< T[]>Noop array deleter
 CprogressProgress indicator base class
 Cprogress_switcherProgress indicator switcher
 CrobberHelper template to allow access to internal std C++ private members
 Cuser_cancelledUser cancelled exception
 Cvector_queueHelper class to allow limited size FIFO queues implemented as vector of elements
 Nstream
 Cbase64_decBase64 decoding session
 Cbase64_encBase64 encoding session
 Cerrno_errorStandard C runtime library error
 Cglobal_progressGlobal progress indicator base class
 Chex_decHexadecimal decoding session
 Chex_encHexadecimal encoding session
 CintervalNumerical interval
 Clazy_progressLazy progress indicator base class
 CmappingMaps index in source string to index in destination string
 Cno_deleteNoop deleter
 Cno_delete< T[]>Noop array deleter
 CprogressProgress indicator base class
 Cprogress_switcherProgress indicator switcher
 CringRing buffer
 Csys_objectOperating system object (file, pipe, anything with an OS handle etc.)
 Cuser_cancelledUser cancelled exception
 Cvector_queueHelper class to allow limited size FIFO queues implemented as vector of elements
diff --git a/base64_8hpp_source.html b/base64_8hpp_source.html index 9088c0109..bf6e5a549 100644 --- a/base64_8hpp_source.html +++ b/base64_8hpp_source.html @@ -318,7 +318,7 @@ $(function() { diff --git a/chrono_8hpp_source.html b/chrono_8hpp_source.html index 227ac8ee2..b1753369a 100644 --- a/chrono_8hpp_source.html +++ b/chrono_8hpp_source.html @@ -85,158 +85,156 @@ $(function() {
6#pragma once
7
8#include "sal.hpp"
-
9#include <stdint.h>
-
10#ifdef _WIN32
-
11#include <windows.h>
-
12#endif
-
13#include <chrono>
-
14#include <stdexcept>
-
15
-
16namespace stdex {
-
17 namespace chrono
-
18 {
-
19 struct aosn_clock
-
20 {
-
21 using rep = int64_t;
-
22 using period = std::ratio<1, 1'000'000>; // 1 microsecond
-
23 using duration = std::chrono::duration<rep, period>;
-
24 using time_point = std::chrono::time_point<aosn_clock>;
-
25 static constexpr bool is_steady = false;
-
26
-
27 static constexpr rep f_second = 1000; // number of milliseconds per second
-
28 static constexpr rep f_minute = 60; // number of seconds per minute
-
29 static constexpr rep f_hour = 60; // number of minutes na hour
-
30 static constexpr rep f_day = 24; // number of hours na day
-
31 static constexpr rep f_week = 7; // number of days per week
-
32
-
33 static constexpr rep second = f_second; // number of milliseconds per second
-
34 static constexpr rep minute = f_minute * second; // number of milliseconds per minute
-
35 static constexpr rep hour = f_hour * minute; // number of milliseconds per hour
-
36 static constexpr rep day = f_day * hour; // number of milliseconds per day
-
37 static constexpr rep week = f_week * day; // number of milliseconds per week
-
38
-
42 static time_point now() noexcept
-
43 {
-
44#ifdef _WIN32
-
45 FILETIME t;
-
46 GetSystemTimeAsFileTime(&t);
-
47 return from_system(t);
-
48#else
-
49 time_t t;
-
50 time(&t);
-
51 return from_time_t(t);
-
52#endif
-
53 }
-
54
-
55 static inline int32_t now_jul(_Out_opt_ uint32_t* hour = nullptr) noexcept
-
56 {
-
57#ifdef _WIN32
-
58 SYSTEMTIME t;
-
59 GetSystemTime(&t);
-
60 duration tp = from_system(t).time_since_epoch();
-
61#else
-
62 struct timespec t;
-
63 clock_gettime(CLOCK_REALTIME, &t);
-
64 duration tp = from_system(t).time_since_epoch();
-
65#endif
-
66 if (hour)
-
67 *hour = (uint32_t)(tp.count() % day);
-
68 return (uint32_t)(tp.count() / day);
-
69 }
-
70
-
71 static int32_t gre2jul(_In_ uint8_t day, _In_ uint8_t month, _In_ int32_t year) noexcept
-
72 {
-
73 int32_t mtmp, ytmp;
-
74 if (month > 2) {
-
75 mtmp = month - 3;
-
76 ytmp = year;
-
77 }
-
78 else {
-
79 mtmp = month + 9;
-
80 ytmp = year - 1;
-
81 }
-
82
-
83 int32_t ctmp = (ytmp / 100);
-
84 int32_t dtmp = ytmp - (100 * ctmp);
-
85 int32_t result1 = 146097L * ctmp / 4;
-
86 int32_t result2 = (1461 * dtmp) / 4;
-
87 int32_t result3 = (153 * mtmp + 2) / 5;
-
88
-
89 return (int32_t)result1 + day + result2 + 1721119L + result3;
-
90 }
-
91
-
92 static void jul2gre(_In_ int32_t jul, _Out_opt_ uint8_t* day, _Out_opt_ uint8_t* month, _Out_opt_ int32_t* year) noexcept
-
93 {
-
94 int32_t mtmp = jul - 1721119L;
-
95 int32_t yr = (4 * mtmp - 1) / 146097L;
-
96 mtmp = 4 * mtmp - 1 - 146097L * yr;
-
97 int32_t da = mtmp / 4;
-
98 mtmp = (4 * da + 3) / 1461;
-
99 da = 4 * da + 3 - 1461 * mtmp;
-
100 da = (da + 4) / 4;
-
101 int32_t mo = (5 * da - 3) / 153;
-
102 da = 5 * da - 3 - 153 * mo;
-
103 da = (da + 5) / 5;
-
104 yr = 100 * yr + mtmp;
-
105
-
106 if (mo < 10)
-
107 mo += 3;
-
108 else {
-
109 mo -= 9;
-
110 yr++;
-
111 }
-
112
-
113 if (day) *day = static_cast<uint8_t>(da);
-
114 if (month) *month = static_cast<uint8_t>(mo);
-
115 if (year) *year = yr;
-
116 }
-
117
-
118 static __time64_t to_time_t(_In_ const time_point& tp) noexcept
-
119 {
-
120 return tp.time_since_epoch().count() / second - 210866803200;
-
121 }
-
122
-
123 static time_point from_time_t(_In_ __time64_t t) noexcept
-
124 {
-
125 return time_point(duration(((rep)t + 210866803200) * second));
-
126 }
-
127
-
128#ifdef _WIN32
-
129 static time_point from_system(_In_ const SYSTEMTIME& t) noexcept
-
130 {
-
131 return time_point(duration(
-
132 ((rep)gre2jul((uint8_t)t.wDay, (uint8_t)t.wMonth, (int32_t)t.wYear)) * day +
-
133 ((rep)t.wHour * hour + (rep)t.wMinute * minute + (rep)t.wSecond * second + t.wMilliseconds)));
-
134 }
-
135
-
136 static time_point from_system(_In_ const FILETIME& t) noexcept
-
137 {
-
138 rep x = (((rep)t.dwHighDateTime) << 32) | t.dwLowDateTime;
-
139 return time_point(duration(x / 10000 + 199222329600000)); // Convert from 100 ns to 1 ms interval and adjust epoch
-
140 }
-
141
-
142 static time_point from_system(_In_ DATE t)
-
143 {
-
144 SYSTEMTIME st;
-
145 if (!VariantTimeToSystemTime(t, &st))
-
146 throw std::invalid_argument("failed to convert date from VARIANT_DATE");
-
147 return from_system(st);
-
148 }
-
149#else
-
150 static time_point from_system(_In_ const struct timespec& t) noexcept
-
151 {
-
152 return from_time_t(t.tv_sec) + t.tv_nsec / 1000;
-
153 }
-
154#endif
-
155 };
-
156 }
-
157}
-
stdex::chrono::aosn_clock
Definition chrono.hpp:20
-
stdex::chrono::aosn_clock::now
static time_point now() noexcept
Gets current time.
Definition chrono.hpp:42
+
9#include "system.hpp"
+
10#include <stdint.h>
+
11#include <chrono>
+
12#include <stdexcept>
+
13
+
14namespace stdex {
+
15 namespace chrono
+
16 {
+
17 struct aosn_clock
+
18 {
+
19 using rep = int64_t;
+
20 using period = std::ratio<1, 1'000'000>; // 1 microsecond
+
21 using duration = std::chrono::duration<rep, period>;
+
22 using time_point = std::chrono::time_point<aosn_clock>;
+
23 static constexpr bool is_steady = false;
+
24
+
25 static constexpr rep f_second = 1000; // number of milliseconds per second
+
26 static constexpr rep f_minute = 60; // number of seconds per minute
+
27 static constexpr rep f_hour = 60; // number of minutes na hour
+
28 static constexpr rep f_day = 24; // number of hours na day
+
29 static constexpr rep f_week = 7; // number of days per week
+
30
+
31 static constexpr rep second = f_second; // number of milliseconds per second
+
32 static constexpr rep minute = f_minute * second; // number of milliseconds per minute
+
33 static constexpr rep hour = f_hour * minute; // number of milliseconds per hour
+
34 static constexpr rep day = f_day * hour; // number of milliseconds per day
+
35 static constexpr rep week = f_week * day; // number of milliseconds per week
+
36
+
40 static time_point now() noexcept
+
41 {
+
42#ifdef _WIN32
+
43 FILETIME t;
+
44 GetSystemTimeAsFileTime(&t);
+
45 return from_system(t);
+
46#else
+
47 time_t t;
+
48 time(&t);
+
49 return from_time_t(t);
+
50#endif
+
51 }
+
52
+
53 static inline int32_t now_jul(_Out_opt_ uint32_t* hour = nullptr) noexcept
+
54 {
+
55#ifdef _WIN32
+
56 SYSTEMTIME t;
+
57 GetSystemTime(&t);
+
58 duration tp = from_system(t).time_since_epoch();
+
59#else
+
60 struct timespec t;
+
61 clock_gettime(CLOCK_REALTIME, &t);
+
62 duration tp = from_system(t).time_since_epoch();
+
63#endif
+
64 if (hour)
+
65 *hour = (uint32_t)(tp.count() % day);
+
66 return (uint32_t)(tp.count() / day);
+
67 }
+
68
+
69 static int32_t gre2jul(_In_ uint8_t day, _In_ uint8_t month, _In_ int32_t year) noexcept
+
70 {
+
71 int32_t mtmp, ytmp;
+
72 if (month > 2) {
+
73 mtmp = month - 3;
+
74 ytmp = year;
+
75 }
+
76 else {
+
77 mtmp = month + 9;
+
78 ytmp = year - 1;
+
79 }
+
80
+
81 int32_t ctmp = (ytmp / 100);
+
82 int32_t dtmp = ytmp - (100 * ctmp);
+
83 int32_t result1 = 146097L * ctmp / 4;
+
84 int32_t result2 = (1461 * dtmp) / 4;
+
85 int32_t result3 = (153 * mtmp + 2) / 5;
+
86
+
87 return (int32_t)result1 + day + result2 + 1721119L + result3;
+
88 }
+
89
+
90 static void jul2gre(_In_ int32_t jul, _Out_opt_ uint8_t* day, _Out_opt_ uint8_t* month, _Out_opt_ int32_t* year) noexcept
+
91 {
+
92 int32_t mtmp = jul - 1721119L;
+
93 int32_t yr = (4 * mtmp - 1) / 146097L;
+
94 mtmp = 4 * mtmp - 1 - 146097L * yr;
+
95 int32_t da = mtmp / 4;
+
96 mtmp = (4 * da + 3) / 1461;
+
97 da = 4 * da + 3 - 1461 * mtmp;
+
98 da = (da + 4) / 4;
+
99 int32_t mo = (5 * da - 3) / 153;
+
100 da = 5 * da - 3 - 153 * mo;
+
101 da = (da + 5) / 5;
+
102 yr = 100 * yr + mtmp;
+
103
+
104 if (mo < 10)
+
105 mo += 3;
+
106 else {
+
107 mo -= 9;
+
108 yr++;
+
109 }
+
110
+
111 if (day) *day = static_cast<uint8_t>(da);
+
112 if (month) *month = static_cast<uint8_t>(mo);
+
113 if (year) *year = yr;
+
114 }
+
115
+
116 static __time64_t to_time_t(_In_ const time_point& tp) noexcept
+
117 {
+
118 return tp.time_since_epoch().count() / second - 210866803200;
+
119 }
+
120
+
121 static time_point from_time_t(_In_ __time64_t t) noexcept
+
122 {
+
123 return time_point(duration(((rep)t + 210866803200) * second));
+
124 }
+
125
+
126#ifdef _WIN32
+
127 static time_point from_system(_In_ const SYSTEMTIME& t) noexcept
+
128 {
+
129 return time_point(duration(
+
130 ((rep)gre2jul((uint8_t)t.wDay, (uint8_t)t.wMonth, (int32_t)t.wYear)) * day +
+
131 ((rep)t.wHour * hour + (rep)t.wMinute * minute + (rep)t.wSecond * second + t.wMilliseconds)));
+
132 }
+
133
+
134 static time_point from_system(_In_ const FILETIME& t) noexcept
+
135 {
+
136 rep x = (((rep)t.dwHighDateTime) << 32) | t.dwLowDateTime;
+
137 return time_point(duration(x / 10000 + 199222329600000)); // Convert from 100 ns to 1 ms interval and adjust epoch
+
138 }
+
139
+
140 static time_point from_system(_In_ DATE t)
+
141 {
+
142 SYSTEMTIME st;
+
143 if (!VariantTimeToSystemTime(t, &st))
+
144 throw std::invalid_argument("failed to convert date from VARIANT_DATE");
+
145 return from_system(st);
+
146 }
+
147#else
+
148 static time_point from_system(_In_ const struct timespec& t) noexcept
+
149 {
+
150 return from_time_t(t.tv_sec) + t.tv_nsec / 1000;
+
151 }
+
152#endif
+
153 };
+
154 }
+
155}
+
stdex::chrono::aosn_clock
Definition chrono.hpp:18
+
stdex::chrono::aosn_clock::now
static time_point now() noexcept
Gets current time.
Definition chrono.hpp:40
diff --git a/classes.html b/classes.html index 94895423d..daa0d0ad6 100644 --- a/classes.html +++ b/classes.html @@ -73,55 +73,67 @@ $(function() {
Class Index
-
A | B | E | G | H | I | L | M | N | P | R | S | U | V
+
A | B | C | D | E | F | G | H | I | L | M | N | P | R | S | U | V | W
A
-
aosn_clock (stdex::chrono)
+
aosn_clock (stdex::chrono)
async_reader (stdex::stream)
async_writer (stdex::stream)
B
-
base64_dec (stdex)
base64_enc (stdex)
basic_angle (stdex::parser)
basic_any_cu (stdex::parser)
basic_bol (stdex::parser)
basic_branch (stdex::parser)
basic_chemical_formula (stdex::parser)
basic_cu (stdex::parser)
basic_cu_set (stdex::parser)
basic_date (stdex::parser)
basic_diagstream (stdex)
basic_diagstreambuf (stdex)
basic_dns_domain_char (stdex::parser)
basic_dns_name (stdex::parser)
basic_email_address (stdex::parser)
basic_emoticon (stdex::parser)
basic_eol (stdex::parser)
basic_fraction (stdex::parser)
basic_fstream (stdex)
basic_integer (stdex::parser)
basic_integer10 (stdex::parser)
basic_integer10ts (stdex::parser)
basic_integer16 (stdex::parser)
basic_iostreamfmt (stdex)
basic_ipv4_address (stdex::parser)
basic_ipv6_address (stdex::parser)
basic_ipv6_scope_id_char (stdex::parser)
basic_isharedstrstream (stdex)
basic_istreamfmt (stdex)
basic_iterations (stdex::parser)
basic_json_string (stdex::parser)
basic_mixed_numeral (stdex::parser)
basic_monetary_numeral (stdex::parser)
basic_noop (stdex::parser)
basic_ostreamfmt (stdex)
basic_parser (stdex::parser)
basic_permutation (stdex::parser)
basic_phone_number (stdex::parser)
basic_punct_cu (stdex::parser)
basic_roman_numeral (stdex::parser)
basic_scientific_numeral (stdex::parser)
basic_score (stdex::parser)
basic_sequence (stdex::parser)
basic_set (stdex::parser)
basic_sharedstrbuf (stdex)
basic_signed_numeral (stdex::parser)
basic_space_cu (stdex::parser)
basic_space_or_punct_cu (stdex::parser)
basic_string (stdex::parser)
basic_string_branch (stdex::parser)
basic_stringstream (stdex)
basic_time (stdex::parser)
basic_url (stdex::parser)
basic_url_password_char (stdex::parser)
basic_url_path (stdex::parser)
basic_url_path_char (stdex::parser)
basic_url_username_char (stdex::parser)
+
base64_dec (stdex)
base64_enc (stdex)
basic (stdex::stream)
basic_angle (stdex::parser)
basic_any_cu (stdex::parser)
basic_bol (stdex::parser)
basic_branch (stdex::parser)
basic_chemical_formula (stdex::parser)
basic_cu (stdex::parser)
basic_cu_set (stdex::parser)
basic_date (stdex::parser)
basic_dns_domain_char (stdex::parser)
basic_dns_name (stdex::parser)
basic_email_address (stdex::parser)
basic_emoticon (stdex::parser)
basic_eol (stdex::parser)
basic_file (stdex::stream)
basic_fraction (stdex::parser)
basic_integer (stdex::parser)
basic_integer10 (stdex::parser)
basic_integer10ts (stdex::parser)
basic_integer16 (stdex::parser)
basic_ipv4_address (stdex::parser)
basic_ipv6_address (stdex::parser)
basic_ipv6_scope_id_char (stdex::parser)
basic_iterations (stdex::parser)
basic_json_string (stdex::parser)
basic_mixed_numeral (stdex::parser)
basic_monetary_numeral (stdex::parser)
basic_noop (stdex::parser)
basic_parser (stdex::parser)
basic_permutation (stdex::parser)
basic_phone_number (stdex::parser)
basic_punct_cu (stdex::parser)
basic_roman_numeral (stdex::parser)
basic_scientific_numeral (stdex::parser)
basic_score (stdex::parser)
basic_sequence (stdex::parser)
basic_set (stdex::parser)
basic_signed_numeral (stdex::parser)
basic_space_cu (stdex::parser)
basic_space_or_punct_cu (stdex::parser)
basic_string (stdex::parser)
basic_string_branch (stdex::parser)
basic_sys (stdex::stream)
basic_time (stdex::parser)
basic_url (stdex::parser)
basic_url_password_char (stdex::parser)
basic_url_path (stdex::parser)
basic_url_path_char (stdex::parser)
basic_url_username_char (stdex::parser)
buffer (stdex::stream)
buffer::buffer_t (stdex::stream)
buffered_sys (stdex::stream)
+
+
C
+
cache (stdex::stream)
cache::cache_t (stdex::stream)
cached_file (stdex::stream)
converter (stdex::stream)
+
+
D
+
diag_file (stdex::stream)
E
errno_error (stdex)
-
G
-
getter (stdex)
global_progress (stdex)
+
F
+
fifo (stdex::stream)
file (stdex::stream)
file_window (stdex::stream)
+
G
+
global_progress (stdex)
+
H
hex_dec (stdex)
hex_enc (stdex)
http_agent (stdex::parser)
http_any_type (stdex::parser)
http_asterisk (stdex::parser)
http_cookie (stdex::parser)
http_cookie_parameter (stdex::parser)
http_factor_more (stdex::parser)
http_header (stdex::parser)
http_language (stdex::parser)
http_line_break (stdex::parser)
http_media_range (stdex::parser)
http_media_type (stdex::parser)
http_parameter (stdex::parser)
http_protocol (stdex::parser)
http_quoted_string (stdex::parser)
http_request (stdex::parser)
http_space (stdex::parser)
http_text_char (stdex::parser)
http_token (stdex::parser)
http_url (stdex::parser)
http_url_parameter (stdex::parser)
http_url_path (stdex::parser)
http_url_path_segment (stdex::parser)
http_url_port (stdex::parser)
http_url_server (stdex::parser)
http_value (stdex::parser)
http_value_collection (stdex::parser)
http_weight (stdex::parser)
http_weighted_value (stdex::parser)
-
+
I
interval (stdex)
-
+
L
-
lazy_progress (stdex)
-
-
M
-
mapping (stdex)
+
lazy_progress (stdex)
limiter (stdex::stream)
-
N
-
no_delete (stdex)
no_delete< T[]> (stdex)
+
M
+
mapping (stdex)
memory_file (stdex::stream)
+
N
+
no_delete (stdex)
no_delete< T[]> (stdex)
fifo::node_t (stdex::stream)
+
P
parser_collection (stdex::parser)
progress (stdex)
progress_switcher (stdex)
-
-
R
-
record (stdex::idrec)
robber (stdex)
-
S
-
sgml_any_cp (stdex::parser)
sgml_cp (stdex::parser)
sgml_cp_set (stdex::parser)
sgml_dns_domain_char (stdex::parser)
sgml_ipv6_scope_id_char (stdex::parser)
sgml_punct_cp (stdex::parser)
sgml_space_cp (stdex::parser)
sgml_space_or_punct_cp (stdex::parser)
sgml_string (stdex::parser)
sgml_url_password_char (stdex::parser)
sgml_url_path_char (stdex::parser)
sgml_url_username_char (stdex::parser)
+
R
+
record (stdex::idrec)
replicator (stdex::stream)
ring (stdex)
+
S
+
sgml_any_cp (stdex::parser)
sgml_cp (stdex::parser)
sgml_cp_set (stdex::parser)
sgml_dns_domain_char (stdex::parser)
sgml_ipv6_scope_id_char (stdex::parser)
sgml_punct_cp (stdex::parser)
sgml_space_cp (stdex::parser)
sgml_space_or_punct_cp (stdex::parser)
sgml_string (stdex::parser)
sgml_url_password_char (stdex::parser)
sgml_url_path_char (stdex::parser)
sgml_url_username_char (stdex::parser)
sys_object (stdex)
+
U
user_cancelled (stdex)
-
+
V
vector_queue (stdex)
+
+
W
+
window (stdex::stream)
replicator::worker (stdex::stream)
diff --git a/classstdex_1_1base64__dec-members.html b/classstdex_1_1base64__dec-members.html index 4ba4576ba..676376186 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 6f9aa502d..328af0888 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 6d6b6036c..846abcabb 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 01dd96417..f86e0dec5 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_1basic__diagstream.png b/classstdex_1_1basic__diagstream.png deleted file mode 100644 index 3d1d62f47..000000000 Binary files a/classstdex_1_1basic__diagstream.png and /dev/null differ diff --git a/classstdex_1_1basic__diagstreambuf-members.html b/classstdex_1_1basic__diagstreambuf-members.html deleted file mode 100644 index 1cc0a9717..000000000 --- a/classstdex_1_1basic__diagstreambuf-members.html +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - -stdex: Member List - - - - - - - - - -
-
- - - - - - -
-
stdex -
-
Additional custom or not Standard C++ covered algorithms
-
-
- - - - - - - - -
-
- - -
-
-
-
-
-
Loading...
-
Searching...
-
No Matches
-
-
-
-
- - -
-
-
stdex::basic_diagstreambuf< _Elem, _Traits > Member List
-
-
- -

This is the complete list of members for stdex::basic_diagstreambuf< _Elem, _Traits >, including all inherited members.

- - - - - - - - - - -
basic_diagstreambuf(const _Iter first, const _Iter last) (defined in stdex::basic_diagstreambuf< _Elem, _Traits >)stdex::basic_diagstreambuf< _Elem, _Traits >inline
basic_diagstreambuf(guest_stream *const *streams, size_t count) (defined in stdex::basic_diagstreambuf< _Elem, _Traits >)stdex::basic_diagstreambuf< _Elem, _Traits >inline
guest_stream typedef (defined in stdex::basic_diagstreambuf< _Elem, _Traits >)stdex::basic_diagstreambuf< _Elem, _Traits >
m_streams (defined in stdex::basic_diagstreambuf< _Elem, _Traits >)stdex::basic_diagstreambuf< _Elem, _Traits >protected
overflow(int_type ch=_Traits::eof()) (defined in stdex::basic_diagstreambuf< _Elem, _Traits >)stdex::basic_diagstreambuf< _Elem, _Traits >inlineprotectedvirtual
seekoff(off_type off, std::ios_base::seekdir way, std::ios_base::openmode which=std::ios_base::in|std::ios_base::out) (defined in stdex::basic_diagstreambuf< _Elem, _Traits >)stdex::basic_diagstreambuf< _Elem, _Traits >inlineprotectedvirtual
seekpos(pos_type pos, std::ios_base::openmode which=std::ios_base::in|std::ios_base::out) (defined in stdex::basic_diagstreambuf< _Elem, _Traits >)stdex::basic_diagstreambuf< _Elem, _Traits >inlineprotectedvirtual
sync() (defined in stdex::basic_diagstreambuf< _Elem, _Traits >)stdex::basic_diagstreambuf< _Elem, _Traits >inlineprotectedvirtual
underflow() (defined in stdex::basic_diagstreambuf< _Elem, _Traits >)stdex::basic_diagstreambuf< _Elem, _Traits >inlineprotectedvirtual
- - - - diff --git a/classstdex_1_1basic__diagstreambuf.html b/classstdex_1_1basic__diagstreambuf.html deleted file mode 100644 index 677011ef0..000000000 --- a/classstdex_1_1basic__diagstreambuf.html +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - - -stdex: stdex::basic_diagstreambuf< _Elem, _Traits > Class Template Reference - - - - - - - - - -
-
- - - - - - -
-
stdex -
-
Additional custom or not Standard C++ covered algorithms
-
-
- - - - - - - - -
-
- - -
-
-
-
-
-
Loading...
-
Searching...
-
No Matches
-
-
-
-
- - -
-
-
-Public Types | -Public Member Functions | -Protected Member Functions | -Protected Attributes | -List of all members
-
stdex::basic_diagstreambuf< _Elem, _Traits > Class Template Reference
-
-
- -

Diagnostic input stream buffer. - More...

- -

#include <stdex/ios.hpp>

-
-Inheritance diagram for stdex::basic_diagstreambuf< _Elem, _Traits >:
-
-
- -
- - - - -

-Public Types

-using guest_stream = std::basic_iostream< _Elem, _Traits >
 
- - - - - - -

-Public Member Functions

-template<typename _Iter >
 basic_diagstreambuf (const _Iter first, const _Iter last)
 
basic_diagstreambuf (guest_stream *const *streams, size_t count)
 
- - - - - - - - - - - -

-Protected Member Functions

-virtual pos_type seekoff (off_type off, std::ios_base::seekdir way, std::ios_base::openmode which=std::ios_base::in|std::ios_base::out)
 
-virtual pos_type seekpos (pos_type pos, std::ios_base::openmode which=std::ios_base::in|std::ios_base::out)
 
-virtual int_type underflow ()
 
-virtual int_type overflow (int_type ch=_Traits::eof())
 
-virtual int sync ()
 
- - - -

-Protected Attributes

-std::vector< guest_stream * > m_streams
 
-

Detailed Description

-
template<class _Elem, class _Traits>
-class stdex::basic_diagstreambuf< _Elem, _Traits >

Diagnostic input stream buffer.

-

Verifies multiple input streams read the same data.

-

The documentation for this class was generated from the following file: -
- - - - diff --git a/classstdex_1_1basic__diagstreambuf.png b/classstdex_1_1basic__diagstreambuf.png deleted file mode 100644 index aeb004451..000000000 Binary files a/classstdex_1_1basic__diagstreambuf.png and /dev/null differ diff --git a/classstdex_1_1basic__fstream-members.html b/classstdex_1_1basic__fstream-members.html deleted file mode 100644 index f2c060be0..000000000 --- a/classstdex_1_1basic__fstream-members.html +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - -stdex: Member List - - - - - - - - - -
-
- - - - - - -
-
stdex -
-
Additional custom or not Standard C++ covered algorithms
-
-
- - - - - - - - -
-
- - -
-
-
-
-
-
Loading...
-
Searching...
-
No Matches
-
-
-
-
- - -
-
-
stdex::basic_fstream< _Elem, _Traits > Member List
-
-
- -

This is the complete list of members for stdex::basic_fstream< _Elem, _Traits >, including all inherited members.

- - - - - - - - - - - -
_Mybase typedef (defined in stdex::basic_fstream< _Elem, _Traits >)stdex::basic_fstream< _Elem, _Traits >
basic_fstream() (defined in stdex::basic_fstream< _Elem, _Traits >)stdex::basic_fstream< _Elem, _Traits >inline
basic_fstream(const char *file_name, ios_base::openmode mode=ios_base::in|ios_base::out, int prot=ios_base::_Default_open_prot) (defined in stdex::basic_fstream< _Elem, _Traits >)stdex::basic_fstream< _Elem, _Traits >inlineexplicit
basic_fstream(const wchar_t *file_name, ios_base::openmode mode=ios_base::in|ios_base::out, int prot=ios_base::_Default_open_prot) (defined in stdex::basic_fstream< _Elem, _Traits >)stdex::basic_fstream< _Elem, _Traits >inlineexplicit
basic_fstream(const std::basic_string< _Elem2, _Traits2, _Ax > &str, ios_base::openmode mode=ios_base::in|ios_base::out, int prot=ios_base::_Default_open_prot) (defined in stdex::basic_fstream< _Elem, _Traits >)stdex::basic_fstream< _Elem, _Traits >inlineexplicit
basic_fstream(FILE *file) (defined in stdex::basic_fstream< _Elem, _Traits >)stdex::basic_fstream< _Elem, _Traits >inlineexplicit
basic_fstream(basic_fstream &&other) (defined in stdex::basic_fstream< _Elem, _Traits >)stdex::basic_fstream< _Elem, _Traits >inline
mtime() conststdex::basic_fstream< _Elem, _Traits >inline
time_point typedef (defined in stdex::basic_fstream< _Elem, _Traits >)stdex::basic_fstream< _Elem, _Traits >
truncate()stdex::basic_fstream< _Elem, _Traits >inline
- - - - diff --git a/classstdex_1_1basic__fstream.html b/classstdex_1_1basic__fstream.html deleted file mode 100644 index de89b1e54..000000000 --- a/classstdex_1_1basic__fstream.html +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - -stdex: stdex::basic_fstream< _Elem, _Traits > Class Template Reference - - - - - - - - - -
-
- - - - - - -
-
stdex -
-
Additional custom or not Standard C++ covered algorithms
-
-
- - - - - - - - -
-
- - -
-
-
-
-
-
Loading...
-
Searching...
-
No Matches
-
-
-
-
- - -
-
-
-Public Types | -Public Member Functions | -List of all members
-
stdex::basic_fstream< _Elem, _Traits > Class Template Reference
-
-
- -

File stream with additional std::filesystem features. - More...

- -

#include <stdex/ios.hpp>

-
-Inheritance diagram for stdex::basic_fstream< _Elem, _Traits >:
-
-
- -
- - - - - - -

-Public Types

-using _Mybase = std::basic_fstream< _Elem, _Traits >
 
-using time_point = std::chrono::time_point< std::chrono::system_clock >
 
- - - - - - - - - - - - - - - - - - -

-Public Member Functions

basic_fstream (const char *file_name, ios_base::openmode mode=ios_base::in|ios_base::out, int prot=ios_base::_Default_open_prot)
 
basic_fstream (const wchar_t *file_name, ios_base::openmode mode=ios_base::in|ios_base::out, int prot=ios_base::_Default_open_prot)
 
-template<class _Elem2 , class _Traits2 , class _Ax >
 basic_fstream (const std::basic_string< _Elem2, _Traits2, _Ax > &str, ios_base::openmode mode=ios_base::in|ios_base::out, int prot=ios_base::_Default_open_prot)
 
basic_fstream (FILE *file)
 
basic_fstream (basic_fstream &&other)
 
-void truncate ()
 Sets end of file at current put position.
 
time_point mtime () const
 Returns file modification time.
 
-

Detailed Description

-
template<class _Elem, class _Traits>
-class stdex::basic_fstream< _Elem, _Traits >

File stream with additional std::filesystem features.

-

Member Function Documentation

- -

◆ mtime()

- -
-
-
-template<class _Elem , class _Traits >
- - - - - -
- - - - - - - -
time_point stdex::basic_fstream< _Elem, _Traits >::mtime () const
-
-inline
-
- -

Returns file modification time.

-
Returns
File modification time
- -
-
-
The documentation for this class was generated from the following file: -
- - - - diff --git a/classstdex_1_1basic__fstream.png b/classstdex_1_1basic__fstream.png deleted file mode 100644 index 1798c3651..000000000 Binary files a/classstdex_1_1basic__fstream.png and /dev/null differ diff --git a/classstdex_1_1basic__iostreamfmt-members.html b/classstdex_1_1basic__iostreamfmt-members.html deleted file mode 100644 index ea691a421..000000000 --- a/classstdex_1_1basic__iostreamfmt-members.html +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - - -stdex: Member List - - - - - - - - - -
-
- - - - - - -
-
stdex -
-
Additional custom or not Standard C++ covered algorithms
-
-
- - - - - - - - -
-
- - -
-
-
-
-
-
Loading...
-
Searching...
-
No Matches
-
-
-
-
- - -
-
-
stdex::basic_iostreamfmt< _Elem, _Traits > Member List
-
-
- -

This is the complete list of members for stdex::basic_iostreamfmt< _Elem, _Traits >, including all inherited members.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bad() const noexcept (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
bad() const noexcept (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
basic_iostreamfmt(std::basic_iostream< _Elem, _Traits > &stream) (defined in stdex::basic_iostreamfmt< _Elem, _Traits >)stdex::basic_iostreamfmt< _Elem, _Traits >inline
basic_istreamfmt(std::basic_istream< _Elem, _Traits > &stream) (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
basic_ostreamfmt(std::basic_ostream< _Elem, _Traits > &stream) (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
eof() const noexcept (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
eof() const noexcept (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
fail() const noexcept (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
fail() const noexcept (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
gcount() const noexcept (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
good() const noexcept (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
good() const noexcept (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
off_type typedef (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >
off_type typedef (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >
operator<<(int8_t value) (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
operator<<(int16_t value) (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
operator<<(int32_t value) (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
operator<<(int64_t value) (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
operator<<(uint8_t value) (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
operator<<(uint16_t value) (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
operator<<(uint32_t value) (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
operator<<(uint64_t value) (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
operator<<(float value) (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
operator<<(double value) (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
operator<<(char value) (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
operator<<(const char *value) (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
operator<<(const wchar_t *value) (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
operator>>(int8_t &value) (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
operator>>(int16_t &value) (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
operator>>(int32_t &value) (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
operator>>(int64_t &value) (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
operator>>(uint8_t &value) (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
operator>>(uint16_t &value) (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
operator>>(uint32_t &value) (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
operator>>(uint64_t &value) (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
operator>>(float &value) (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
operator>>(double &value) (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
operator>>(char &value) (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
operator>>(std::basic_string< char, _Traits, _Alloc > &value) (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
operator>>(std::basic_string< wchar_t, _Traits, _Alloc > &value) (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
pos_type typedef (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >
pos_type typedef (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >
printf(const _Elem2 *format, locale_t locale,...)stdex::basic_ostreamfmt< _Elem, _Traits >inline
read(_Out_writes_bytes_(size) void *data, std::streamsize size) (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
read(T &value) (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
read(std::basic_string< char, _Traits, _Alloc > &value) (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
read(std::basic_string< wchar_t, _Traits, _Alloc > &value) (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
read_byte() (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
seekg(pos_type pos) (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
seekg(off_type off, std::ios_base::seekdir dir) (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
seekp(pos_type pos) (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
seekp(off_type off, std::ios_base::seekdir dir) (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
sg (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >
sp (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >
tellg() (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
tellp() (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
vprintf(const _Elem2 *format, locale_t locale, va_list arg)stdex::basic_ostreamfmt< _Elem, _Traits >inline
write(_In_reads_bytes_(size) const void *data, std::streamsize size) (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
write(T value) (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
write(const char *value) (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
write(const wchar_t *value) (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
write_byte(uint8_t value) (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
- - - - diff --git a/classstdex_1_1basic__iostreamfmt.html b/classstdex_1_1basic__iostreamfmt.html deleted file mode 100644 index 46d462473..000000000 --- a/classstdex_1_1basic__iostreamfmt.html +++ /dev/null @@ -1,317 +0,0 @@ - - - - - - - -stdex: stdex::basic_iostreamfmt< _Elem, _Traits > Class Template Reference - - - - - - - - - -
-
- - - - - - -
-
stdex -
-
Additional custom or not Standard C++ covered algorithms
-
-
- - - - - - - - -
-
- - -
-
-
-
-
-
Loading...
-
Searching...
-
No Matches
-
-
-
-
- - -
-
-
-Public Member Functions | -List of all members
-
stdex::basic_iostreamfmt< _Elem, _Traits > Class Template Reference
-
-
- -

Binary stream reader/writer. - More...

- -

#include <stdex/ios.hpp>

-
-Inheritance diagram for stdex::basic_iostreamfmt< _Elem, _Traits >:
-
-
- - -stdex::basic_ostreamfmt< _Elem, _Traits > -stdex::basic_istreamfmt< _Elem, _Traits > - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

-Public Member Functions

basic_iostreamfmt (std::basic_iostream< _Elem, _Traits > &stream)
 
- Public Member Functions inherited from stdex::basic_ostreamfmt< _Elem, _Traits >
basic_ostreamfmt (std::basic_ostream< _Elem, _Traits > &stream)
 
-pos_type tellp ()
 
-basic_ostreamfmt< _Elem, _Traits > & seekp (pos_type pos)
 
-basic_ostreamfmt< _Elem, _Traits > & seekp (off_type off, std::ios_base::seekdir dir)
 
-bool good () const noexcept
 
-bool eof () const noexcept
 
-bool fail () const noexcept
 
-bool bad () const noexcept
 
-basic_ostreamfmt< _Elem, _Traits > & write (_In_reads_bytes_(size) const void *data, std::streamsize size)
 
-template<class T >
basic_ostreamfmt< _Elem, _Traits > & write (T value)
 
-basic_ostreamfmt< _Elem, _Traits > & write (const char *value)
 
-basic_ostreamfmt< _Elem, _Traits > & write (const wchar_t *value)
 
-basic_ostreamfmt< _Elem, _Traits > & write_byte (uint8_t value)
 
template<class _Elem2 >
void vprintf (const _Elem2 *format, locale_t locale, va_list arg)
 Formats string using printf() and write it to stream.
 
template<class _Elem2 >
void printf (const _Elem2 *format, locale_t locale,...)
 Formats string using printf() and write it to stream.
 
-basic_ostreamfmt< _Elem, _Traits > & operator<< (int8_t value)
 
-basic_ostreamfmt< _Elem, _Traits > & operator<< (int16_t value)
 
-basic_ostreamfmt< _Elem, _Traits > & operator<< (int32_t value)
 
-basic_ostreamfmt< _Elem, _Traits > & operator<< (int64_t value)
 
-basic_ostreamfmt< _Elem, _Traits > & operator<< (uint8_t value)
 
-basic_ostreamfmt< _Elem, _Traits > & operator<< (uint16_t value)
 
-basic_ostreamfmt< _Elem, _Traits > & operator<< (uint32_t value)
 
-basic_ostreamfmt< _Elem, _Traits > & operator<< (uint64_t value)
 
-basic_ostreamfmt< _Elem, _Traits > & operator<< (float value)
 
-basic_ostreamfmt< _Elem, _Traits > & operator<< (double value)
 
-basic_ostreamfmt< _Elem, _Traits > & operator<< (char value)
 
-basic_ostreamfmt< _Elem, _Traits > & operator<< (const char *value)
 
-basic_ostreamfmt< _Elem, _Traits > & operator<< (const wchar_t *value)
 
- Public Member Functions inherited from stdex::basic_istreamfmt< _Elem, _Traits >
basic_istreamfmt (std::basic_istream< _Elem, _Traits > &stream)
 
-pos_type tellg ()
 
-basic_istreamfmt< _Elem, _Traits > & seekg (pos_type pos)
 
-basic_istreamfmt< _Elem, _Traits > & seekg (off_type off, std::ios_base::seekdir dir)
 
-bool good () const noexcept
 
-bool eof () const noexcept
 
-bool fail () const noexcept
 
-bool bad () const noexcept
 
-std::streamsize gcount () const noexcept
 
-basic_istreamfmt< _Elem, _Traits > & read (_Out_writes_bytes_(size) void *data, std::streamsize size)
 
-template<class T >
basic_istreamfmt< _Elem, _Traits > & read (T &value)
 
-template<class _Traits = std::char_traits<char>, class _Alloc = std::allocator<char>>
basic_istreamfmt< _Elem, _Traits > & read (std::basic_string< char, _Traits, _Alloc > &value)
 
-template<class _Traits = std::char_traits<wchar_t>, class _Alloc = std::allocator<wchar_t>>
basic_istreamfmt< _Elem, _Traits > & read (std::basic_string< wchar_t, _Traits, _Alloc > &value)
 
-uint8_t read_byte ()
 
-basic_istreamfmt< _Elem, _Traits > & operator>> (int8_t &value)
 
-basic_istreamfmt< _Elem, _Traits > & operator>> (int16_t &value)
 
-basic_istreamfmt< _Elem, _Traits > & operator>> (int32_t &value)
 
-basic_istreamfmt< _Elem, _Traits > & operator>> (int64_t &value)
 
-basic_istreamfmt< _Elem, _Traits > & operator>> (uint8_t &value)
 
-basic_istreamfmt< _Elem, _Traits > & operator>> (uint16_t &value)
 
-basic_istreamfmt< _Elem, _Traits > & operator>> (uint32_t &value)
 
-basic_istreamfmt< _Elem, _Traits > & operator>> (uint64_t &value)
 
-basic_istreamfmt< _Elem, _Traits > & operator>> (float &value)
 
-basic_istreamfmt< _Elem, _Traits > & operator>> (double &value)
 
-basic_istreamfmt< _Elem, _Traits > & operator>> (char &value)
 
-template<class _Traits = std::char_traits<char>, class _Alloc = std::allocator<char>>
basic_istreamfmt< _Elem, _Traits > & operator>> (std::basic_string< char, _Traits, _Alloc > &value)
 
-template<class _Traits = std::char_traits<wchar_t>, class _Alloc = std::allocator<wchar_t>>
basic_istreamfmt< _Elem, _Traits > & operator>> (std::basic_string< wchar_t, _Traits, _Alloc > &value)
 
- - - - - - - - - - - - - - - - - -

-Additional Inherited Members

- Public Types inherited from stdex::basic_ostreamfmt< _Elem, _Traits >
-using pos_type = typename _Traits::pos_type
 
-using off_type = typename _Traits::off_type
 
- Public Types inherited from stdex::basic_istreamfmt< _Elem, _Traits >
-using pos_type = typename _Traits::pos_type
 
-using off_type = typename _Traits::off_type
 
- Public Attributes inherited from stdex::basic_ostreamfmt< _Elem, _Traits >
-std::basic_ostream< _Elem, _Traits > & sp
 
- Public Attributes inherited from stdex::basic_istreamfmt< _Elem, _Traits >
-std::basic_istream< _Elem, _Traits > & sg
 
-

Detailed Description

-
template<class _Elem, class _Traits>
-class stdex::basic_iostreamfmt< _Elem, _Traits >

Binary stream reader/writer.

-

The documentation for this class was generated from the following file: -
- - - - diff --git a/classstdex_1_1basic__iostreamfmt.png b/classstdex_1_1basic__iostreamfmt.png deleted file mode 100644 index 95d5019aa..000000000 Binary files a/classstdex_1_1basic__iostreamfmt.png and /dev/null differ diff --git a/classstdex_1_1basic__isharedstrstream.png b/classstdex_1_1basic__isharedstrstream.png deleted file mode 100644 index a3d61a3c8..000000000 Binary files a/classstdex_1_1basic__isharedstrstream.png and /dev/null differ diff --git a/classstdex_1_1basic__istreamfmt-members.html b/classstdex_1_1basic__istreamfmt-members.html deleted file mode 100644 index 3e550ab89..000000000 --- a/classstdex_1_1basic__istreamfmt-members.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - - - - -stdex: Member List - - - - - - - - - -
-
- - - - - - -
-
stdex -
-
Additional custom or not Standard C++ covered algorithms
-
-
- - - - - - - - -
-
- - -
-
-
-
-
-
Loading...
-
Searching...
-
No Matches
-
-
-
-
- - -
-
-
stdex::basic_istreamfmt< _Elem, _Traits > Member List
-
-
- -

This is the complete list of members for stdex::basic_istreamfmt< _Elem, _Traits >, including all inherited members.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bad() const noexcept (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
basic_istreamfmt(std::basic_istream< _Elem, _Traits > &stream) (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
eof() const noexcept (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
fail() const noexcept (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
gcount() const noexcept (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
good() const noexcept (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
off_type typedef (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >
operator>>(int8_t &value) (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
operator>>(int16_t &value) (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
operator>>(int32_t &value) (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
operator>>(int64_t &value) (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
operator>>(uint8_t &value) (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
operator>>(uint16_t &value) (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
operator>>(uint32_t &value) (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
operator>>(uint64_t &value) (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
operator>>(float &value) (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
operator>>(double &value) (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
operator>>(char &value) (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
operator>>(std::basic_string< char, _Traits, _Alloc > &value) (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
operator>>(std::basic_string< wchar_t, _Traits, _Alloc > &value) (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
pos_type typedef (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >
read(_Out_writes_bytes_(size) void *data, std::streamsize size) (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
read(T &value) (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
read(std::basic_string< char, _Traits, _Alloc > &value) (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
read(std::basic_string< wchar_t, _Traits, _Alloc > &value) (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
read_byte() (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
seekg(pos_type pos) (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
seekg(off_type off, std::ios_base::seekdir dir) (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
sg (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >
tellg() (defined in stdex::basic_istreamfmt< _Elem, _Traits >)stdex::basic_istreamfmt< _Elem, _Traits >inline
- - - - diff --git a/classstdex_1_1basic__istreamfmt.html b/classstdex_1_1basic__istreamfmt.html deleted file mode 100644 index c4dada0e0..000000000 --- a/classstdex_1_1basic__istreamfmt.html +++ /dev/null @@ -1,216 +0,0 @@ - - - - - - - -stdex: stdex::basic_istreamfmt< _Elem, _Traits > Class Template Reference - - - - - - - - - -
-
- - - - - - -
-
stdex -
-
Additional custom or not Standard C++ covered algorithms
-
-
- - - - - - - - -
-
- - -
-
-
-
-
-
Loading...
-
Searching...
-
No Matches
-
-
-
-
- - -
-
-
-Public Types | -Public Member Functions | -Public Attributes | -List of all members
-
stdex::basic_istreamfmt< _Elem, _Traits > Class Template Reference
-
-
- -

Binary stream reader. - More...

- -

#include <stdex/ios.hpp>

-
-Inheritance diagram for stdex::basic_istreamfmt< _Elem, _Traits >:
-
-
- - -stdex::basic_iostreamfmt< _Elem, _Traits > - -
- - - - - - -

-Public Types

-using pos_type = typename _Traits::pos_type
 
-using off_type = typename _Traits::off_type
 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

-Public Member Functions

basic_istreamfmt (std::basic_istream< _Elem, _Traits > &stream)
 
-pos_type tellg ()
 
-basic_istreamfmt< _Elem, _Traits > & seekg (pos_type pos)
 
-basic_istreamfmt< _Elem, _Traits > & seekg (off_type off, std::ios_base::seekdir dir)
 
-bool good () const noexcept
 
-bool eof () const noexcept
 
-bool fail () const noexcept
 
-bool bad () const noexcept
 
-std::streamsize gcount () const noexcept
 
-basic_istreamfmt< _Elem, _Traits > & read (_Out_writes_bytes_(size) void *data, std::streamsize size)
 
-template<class T >
basic_istreamfmt< _Elem, _Traits > & read (T &value)
 
-template<class _Traits = std::char_traits<char>, class _Alloc = std::allocator<char>>
basic_istreamfmt< _Elem, _Traits > & read (std::basic_string< char, _Traits, _Alloc > &value)
 
-template<class _Traits = std::char_traits<wchar_t>, class _Alloc = std::allocator<wchar_t>>
basic_istreamfmt< _Elem, _Traits > & read (std::basic_string< wchar_t, _Traits, _Alloc > &value)
 
-uint8_t read_byte ()
 
-basic_istreamfmt< _Elem, _Traits > & operator>> (int8_t &value)
 
-basic_istreamfmt< _Elem, _Traits > & operator>> (int16_t &value)
 
-basic_istreamfmt< _Elem, _Traits > & operator>> (int32_t &value)
 
-basic_istreamfmt< _Elem, _Traits > & operator>> (int64_t &value)
 
-basic_istreamfmt< _Elem, _Traits > & operator>> (uint8_t &value)
 
-basic_istreamfmt< _Elem, _Traits > & operator>> (uint16_t &value)
 
-basic_istreamfmt< _Elem, _Traits > & operator>> (uint32_t &value)
 
-basic_istreamfmt< _Elem, _Traits > & operator>> (uint64_t &value)
 
-basic_istreamfmt< _Elem, _Traits > & operator>> (float &value)
 
-basic_istreamfmt< _Elem, _Traits > & operator>> (double &value)
 
-basic_istreamfmt< _Elem, _Traits > & operator>> (char &value)
 
-template<class _Traits = std::char_traits<char>, class _Alloc = std::allocator<char>>
basic_istreamfmt< _Elem, _Traits > & operator>> (std::basic_string< char, _Traits, _Alloc > &value)
 
-template<class _Traits = std::char_traits<wchar_t>, class _Alloc = std::allocator<wchar_t>>
basic_istreamfmt< _Elem, _Traits > & operator>> (std::basic_string< wchar_t, _Traits, _Alloc > &value)
 
- - - -

-Public Attributes

-std::basic_istream< _Elem, _Traits > & sg
 
-

Detailed Description

-
template<class _Elem, class _Traits>
-class stdex::basic_istreamfmt< _Elem, _Traits >

Binary stream reader.

-

The documentation for this class was generated from the following file: -
- - - - diff --git a/classstdex_1_1basic__istreamfmt.png b/classstdex_1_1basic__istreamfmt.png deleted file mode 100644 index 52861e3ae..000000000 Binary files a/classstdex_1_1basic__istreamfmt.png and /dev/null differ diff --git a/classstdex_1_1basic__ostreamfmt-members.html b/classstdex_1_1basic__ostreamfmt-members.html deleted file mode 100644 index 28eecdb0f..000000000 --- a/classstdex_1_1basic__ostreamfmt-members.html +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - -stdex: Member List - - - - - - - - - -
-
- - - - - - -
-
stdex -
-
Additional custom or not Standard C++ covered algorithms
-
-
- - - - - - - - -
-
- - -
-
-
-
-
-
Loading...
-
Searching...
-
No Matches
-
-
-
-
- - -
-
-
stdex::basic_ostreamfmt< _Elem, _Traits > Member List
-
-
- -

This is the complete list of members for stdex::basic_ostreamfmt< _Elem, _Traits >, including all inherited members.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bad() const noexcept (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
basic_ostreamfmt(std::basic_ostream< _Elem, _Traits > &stream) (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
eof() const noexcept (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
fail() const noexcept (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
good() const noexcept (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
off_type typedef (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >
operator<<(int8_t value) (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
operator<<(int16_t value) (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
operator<<(int32_t value) (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
operator<<(int64_t value) (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
operator<<(uint8_t value) (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
operator<<(uint16_t value) (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
operator<<(uint32_t value) (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
operator<<(uint64_t value) (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
operator<<(float value) (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
operator<<(double value) (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
operator<<(char value) (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
operator<<(const char *value) (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
operator<<(const wchar_t *value) (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
pos_type typedef (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >
printf(const _Elem2 *format, locale_t locale,...)stdex::basic_ostreamfmt< _Elem, _Traits >inline
seekp(pos_type pos) (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
seekp(off_type off, std::ios_base::seekdir dir) (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
sp (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >
tellp() (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
vprintf(const _Elem2 *format, locale_t locale, va_list arg)stdex::basic_ostreamfmt< _Elem, _Traits >inline
write(_In_reads_bytes_(size) const void *data, std::streamsize size) (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
write(T value) (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
write(const char *value) (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
write(const wchar_t *value) (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
write_byte(uint8_t value) (defined in stdex::basic_ostreamfmt< _Elem, _Traits >)stdex::basic_ostreamfmt< _Elem, _Traits >inline
- - - - diff --git a/classstdex_1_1basic__ostreamfmt.html b/classstdex_1_1basic__ostreamfmt.html deleted file mode 100644 index a23f12b02..000000000 --- a/classstdex_1_1basic__ostreamfmt.html +++ /dev/null @@ -1,329 +0,0 @@ - - - - - - - -stdex: stdex::basic_ostreamfmt< _Elem, _Traits > Class Template Reference - - - - - - - - - -
-
- - - - - - -
-
stdex -
-
Additional custom or not Standard C++ covered algorithms
-
-
- - - - - - - - -
-
- - -
-
-
-
-
-
Loading...
-
Searching...
-
No Matches
-
-
-
-
- - -
-
-
-Public Types | -Public Member Functions | -Public Attributes | -List of all members
-
stdex::basic_ostreamfmt< _Elem, _Traits > Class Template Reference
-
-
- -

Binary stream writer. - More...

- -

#include <stdex/ios.hpp>

-
-Inheritance diagram for stdex::basic_ostreamfmt< _Elem, _Traits >:
-
-
- - -stdex::basic_iostreamfmt< _Elem, _Traits > - -
- - - - - - -

-Public Types

-using pos_type = typename _Traits::pos_type
 
-using off_type = typename _Traits::off_type
 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

-Public Member Functions

basic_ostreamfmt (std::basic_ostream< _Elem, _Traits > &stream)
 
-pos_type tellp ()
 
-basic_ostreamfmt< _Elem, _Traits > & seekp (pos_type pos)
 
-basic_ostreamfmt< _Elem, _Traits > & seekp (off_type off, std::ios_base::seekdir dir)
 
-bool good () const noexcept
 
-bool eof () const noexcept
 
-bool fail () const noexcept
 
-bool bad () const noexcept
 
-basic_ostreamfmt< _Elem, _Traits > & write (_In_reads_bytes_(size) const void *data, std::streamsize size)
 
-template<class T >
basic_ostreamfmt< _Elem, _Traits > & write (T value)
 
-basic_ostreamfmt< _Elem, _Traits > & write (const char *value)
 
-basic_ostreamfmt< _Elem, _Traits > & write (const wchar_t *value)
 
-basic_ostreamfmt< _Elem, _Traits > & write_byte (uint8_t value)
 
template<class _Elem2 >
void vprintf (const _Elem2 *format, locale_t locale, va_list arg)
 Formats string using printf() and write it to stream.
 
template<class _Elem2 >
void printf (const _Elem2 *format, locale_t locale,...)
 Formats string using printf() and write it to stream.
 
-basic_ostreamfmt< _Elem, _Traits > & operator<< (int8_t value)
 
-basic_ostreamfmt< _Elem, _Traits > & operator<< (int16_t value)
 
-basic_ostreamfmt< _Elem, _Traits > & operator<< (int32_t value)
 
-basic_ostreamfmt< _Elem, _Traits > & operator<< (int64_t value)
 
-basic_ostreamfmt< _Elem, _Traits > & operator<< (uint8_t value)
 
-basic_ostreamfmt< _Elem, _Traits > & operator<< (uint16_t value)
 
-basic_ostreamfmt< _Elem, _Traits > & operator<< (uint32_t value)
 
-basic_ostreamfmt< _Elem, _Traits > & operator<< (uint64_t value)
 
-basic_ostreamfmt< _Elem, _Traits > & operator<< (float value)
 
-basic_ostreamfmt< _Elem, _Traits > & operator<< (double value)
 
-basic_ostreamfmt< _Elem, _Traits > & operator<< (char value)
 
-basic_ostreamfmt< _Elem, _Traits > & operator<< (const char *value)
 
-basic_ostreamfmt< _Elem, _Traits > & operator<< (const wchar_t *value)
 
- - - -

-Public Attributes

-std::basic_ostream< _Elem, _Traits > & sp
 
-

Detailed Description

-
template<class _Elem, class _Traits>
-class stdex::basic_ostreamfmt< _Elem, _Traits >

Binary stream writer.

-

Member Function Documentation

- -

◆ printf()

- -
-
-
-template<class _Elem , class _Traits >
-
-template<class _Elem2 >
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -
void stdex::basic_ostreamfmt< _Elem, _Traits >::printf (const _Elem2 * format,
locale_t locale,
 ... 
)
-
-inline
-
- -

Formats string using printf() and write it to stream.

-
Parameters
- - - -
[in]formatString template using printf() style
[in]localeStdlib locale used to perform formatting. Use NULL to use locale globally set by setlocale().
-
-
- -
-
- -

◆ vprintf()

- -
-
-
-template<class _Elem , class _Traits >
-
-template<class _Elem2 >
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -
void stdex::basic_ostreamfmt< _Elem, _Traits >::vprintf (const _Elem2 * format,
locale_t locale,
va_list arg 
)
-
-inline
-
- -

Formats string using printf() and write it to stream.

-
Parameters
- - - - -
[in]formatString template using printf() style
[in]localeStdlib locale used to perform formatting. Use NULL to use locale globally set by setlocale().
[in]argArguments to format
-
-
- -
-
-
The documentation for this class was generated from the following file: -
- - - - diff --git a/classstdex_1_1basic__ostreamfmt.png b/classstdex_1_1basic__ostreamfmt.png deleted file mode 100644 index c7ea1a369..000000000 Binary files a/classstdex_1_1basic__ostreamfmt.png and /dev/null differ diff --git a/classstdex_1_1basic__sharedstrbuf.html b/classstdex_1_1basic__sharedstrbuf.html deleted file mode 100644 index b67564644..000000000 --- a/classstdex_1_1basic__sharedstrbuf.html +++ /dev/null @@ -1,129 +0,0 @@ - - - - - - - -stdex: stdex::basic_sharedstrbuf< _Elem, _Traits > Class Template Reference - - - - - - - - - -
-
- - - - - - -
-
stdex -
-
Additional custom or not Standard C++ covered algorithms
-
-
- - - - - - - - -
-
- - -
-
-
-
-
-
Loading...
-
Searching...
-
No Matches
-
-
-
-
- - -
-
-
-Public Member Functions | -Protected Member Functions | -List of all members
-
stdex::basic_sharedstrbuf< _Elem, _Traits > Class Template Reference
-
-
- -

Shared-memory string stream buffer. - More...

- -

#include <stdex/ios.hpp>

-
-Inheritance diagram for stdex::basic_sharedstrbuf< _Elem, _Traits >:
-
-
- -
- - - - - - - - -

-Public Member Functions

basic_sharedstrbuf (const _Elem *data, size_t size)
 
basic_sharedstrbuf (const basic_sharedstrbuf< _Elem, _Traits > &other)
 
-basic_sharedstrbuf< _Elem, _Traits > & operator= (const basic_sharedstrbuf< _Elem, _Traits > &other)
 
- - - - - -

-Protected Member Functions

-virtual pos_type seekoff (off_type off, std::ios_base::seekdir way, std::ios_base::openmode which=std::ios_base::in|std::ios_base::out)
 
-virtual pos_type seekpos (pos_type pos, std::ios_base::openmode which=std::ios_base::in|std::ios_base::out)
 
-

Detailed Description

-
template<class _Elem, class _Traits>
-class stdex::basic_sharedstrbuf< _Elem, _Traits >

Shared-memory string stream buffer.

-

The documentation for this class was generated from the following file: -
- - - - diff --git a/classstdex_1_1basic__sharedstrbuf.png b/classstdex_1_1basic__sharedstrbuf.png deleted file mode 100644 index 7f917ee05..000000000 Binary files a/classstdex_1_1basic__sharedstrbuf.png and /dev/null differ diff --git a/classstdex_1_1basic__stringstream-members.html b/classstdex_1_1basic__stringstream-members.html deleted file mode 100644 index 818f2a1d2..000000000 --- a/classstdex_1_1basic__stringstream-members.html +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - -stdex: Member List - - - - - - - - - -
-
- - - - - - -
-
stdex -
-
Additional custom or not Standard C++ covered algorithms
-
-
- - - - - - - - -
-
- - -
-
-
-
-
-
Loading...
-
Searching...
-
No Matches
-
-
-
-
- - -
-
-
stdex::basic_stringstream< _Elem, _Traits, _Alloc > Member List
-
-
- -

This is the complete list of members for stdex::basic_stringstream< _Elem, _Traits, _Alloc >, including all inherited members.

- - - - - - - - - - - -
_Mybase typedef (defined in stdex::basic_stringstream< _Elem, _Traits, _Alloc >)stdex::basic_stringstream< _Elem, _Traits, _Alloc >
_Mystr typedef (defined in stdex::basic_stringstream< _Elem, _Traits, _Alloc >)stdex::basic_stringstream< _Elem, _Traits, _Alloc >
basic_stringstream() (defined in stdex::basic_stringstream< _Elem, _Traits, _Alloc >)stdex::basic_stringstream< _Elem, _Traits, _Alloc >inline
basic_stringstream(std::ios_base::openmode mode) (defined in stdex::basic_stringstream< _Elem, _Traits, _Alloc >)stdex::basic_stringstream< _Elem, _Traits, _Alloc >inlineexplicit
basic_stringstream(const _Mystr &str, std::ios_base::openmode mode=std::ios_base::in|std::ios_base::out) (defined in stdex::basic_stringstream< _Elem, _Traits, _Alloc >)stdex::basic_stringstream< _Elem, _Traits, _Alloc >inlineexplicit
basic_stringstream(basic_stringstream &&other) (defined in stdex::basic_stringstream< _Elem, _Traits, _Alloc >)stdex::basic_stringstream< _Elem, _Traits, _Alloc >inline
basic_stringstream(const T *filename, std::ios_base::openmode mode=std::ios_base::in, int prot=std::ios_base::_Default_open_prot)stdex::basic_stringstream< _Elem, _Traits, _Alloc >inlineexplicit
basic_stringstream(const std::basic_string< _Elem2, _Traits2, _Alloc2 > &filename, std::ios_base::openmode mode=std::ios_base::in, int prot=std::ios_base::_Default_open_prot)stdex::basic_stringstream< _Elem, _Traits, _Alloc >inlineexplicit
save(const T *filename, std::ios_base::openmode mode=std::ios_base::out, int prot=std::ios_base::_Default_open_prot)stdex::basic_stringstream< _Elem, _Traits, _Alloc >inline
save(const std::basic_string< _Elem2, _Traits2, _Alloc2 > &filename, std::ios_base::openmode mode=std::ios_base::out, int prot=std::ios_base::_Default_open_prot) (defined in stdex::basic_stringstream< _Elem, _Traits, _Alloc >)stdex::basic_stringstream< _Elem, _Traits, _Alloc >inline
- - - - diff --git a/classstdex_1_1basic__stringstream.html b/classstdex_1_1basic__stringstream.html deleted file mode 100644 index fc8fc42c0..000000000 --- a/classstdex_1_1basic__stringstream.html +++ /dev/null @@ -1,315 +0,0 @@ - - - - - - - -stdex: stdex::basic_stringstream< _Elem, _Traits, _Alloc > Class Template Reference - - - - - - - - - -
-
- - - - - - -
-
stdex -
-
Additional custom or not Standard C++ covered algorithms
-
-
- - - - - - - - -
-
- - -
-
-
-
-
-
Loading...
-
Searching...
-
No Matches
-
-
-
-
- - -
-
-
-Public Types | -Public Member Functions | -List of all members
-
stdex::basic_stringstream< _Elem, _Traits, _Alloc > Class Template Reference
-
-
- -

String stream. - More...

- -

#include <stdex/ios.hpp>

-
-Inheritance diagram for stdex::basic_stringstream< _Elem, _Traits, _Alloc >:
-
-
- -
- - - - - - -

-Public Types

-using _Mybase = std::basic_stringstream< _Elem, _Traits, _Alloc >
 
-using _Mystr = std::basic_string< _Elem, _Traits, _Alloc >
 
- - - - - - - - - - - - - - - - - - - - - - -

-Public Member Functions

basic_stringstream (std::ios_base::openmode mode)
 
basic_stringstream (const _Mystr &str, std::ios_base::openmode mode=std::ios_base::in|std::ios_base::out)
 
basic_stringstream (basic_stringstream &&other)
 
template<class T >
 basic_stringstream (const T *filename, std::ios_base::openmode mode=std::ios_base::in, int prot=std::ios_base::_Default_open_prot)
 Initializes stream with content from file.
 
template<class _Elem2 , class _Traits2 = std::char_traits<_Elem2>, class _Alloc2 = std::allocator<_Elem2>>
 basic_stringstream (const std::basic_string< _Elem2, _Traits2, _Alloc2 > &filename, std::ios_base::openmode mode=std::ios_base::in, int prot=std::ios_base::_Default_open_prot)
 Initializes stream with content from file.
 
template<class T >
void save (const T *filename, std::ios_base::openmode mode=std::ios_base::out, int prot=std::ios_base::_Default_open_prot)
 Saves stream content to a file.
 
-template<class _Elem2 , class _Traits2 = std::char_traits<T>, class _Alloc2 = std::allocator<T>>
void save (const std::basic_string< _Elem2, _Traits2, _Alloc2 > &filename, std::ios_base::openmode mode=std::ios_base::out, int prot=std::ios_base::_Default_open_prot)
 
-

Detailed Description

-
template<class _Elem, class _Traits, class _Alloc>
-class stdex::basic_stringstream< _Elem, _Traits, _Alloc >

String stream.

-

Constructor & Destructor Documentation

- -

◆ basic_stringstream() [1/2]

- -
-
-
-template<class _Elem , class _Traits , class _Alloc >
-
-template<class T >
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -
stdex::basic_stringstream< _Elem, _Traits, _Alloc >::basic_stringstream (const T * filename,
std::ios_base::openmode mode = std::ios_base::in,
int prot = std::ios_base::_Default_open_prot 
)
-
-inlineexplicit
-
- -

Initializes stream with content from file.

-
Parameters
- - - - -
[in]filenameFile name
[in]modeMode flags to open file. The std::stringstream returned is always opened as in|out.
[in]protProtection flags to open file
-
-
- -
-
- -

◆ basic_stringstream() [2/2]

- -
-
-
-template<class _Elem , class _Traits , class _Alloc >
-
-template<class _Elem2 , class _Traits2 = std::char_traits<_Elem2>, class _Alloc2 = std::allocator<_Elem2>>
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -
stdex::basic_stringstream< _Elem, _Traits, _Alloc >::basic_stringstream (const std::basic_string< _Elem2, _Traits2, _Alloc2 > & filename,
std::ios_base::openmode mode = std::ios_base::in,
int prot = std::ios_base::_Default_open_prot 
)
-
-inlineexplicit
-
- -

Initializes stream with content from file.

-
Parameters
- - - - -
[in]filenameFile name
[in]modeMode flags to open file. The std::stringstream returned is always opened as in|out.
[in]protProtection flags to open file
-
-
- -
-
-

Member Function Documentation

- -

◆ save()

- -
-
-
-template<class _Elem , class _Traits , class _Alloc >
-
-template<class T >
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -
void stdex::basic_stringstream< _Elem, _Traits, _Alloc >::save (const T * filename,
std::ios_base::openmode mode = std::ios_base::out,
int prot = std::ios_base::_Default_open_prot 
)
-
-inline
-
- -

Saves stream content to a file.

-
Parameters
- - - - -
[in]filenameFile name
[in]modeMode flags to open file
[in]protProtection flags to open file
-
-
- -
-
-
The documentation for this class was generated from the following file: -
- - - - diff --git a/classstdex_1_1basic__stringstream.png b/classstdex_1_1basic__stringstream.png deleted file mode 100644 index af2bb7750..000000000 Binary files a/classstdex_1_1basic__stringstream.png and /dev/null differ diff --git a/classstdex_1_1errno__error-members.html b/classstdex_1_1errno__error-members.html index 849eefa60..03799130c 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 8016e0130..878d3f51a 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 c9c9639ae..b1547f90d 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 9ece09057..042713fc2 100644 --- a/classstdex_1_1global__progress.html +++ b/classstdex_1_1global__progress.html @@ -562,7 +562,7 @@ template<class T > diff --git a/classstdex_1_1hex__dec-members.html b/classstdex_1_1hex__dec-members.html index baed64b8b..8d0907bbc 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 508251417..92553e486 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 65a6fcb00..7cc11936c 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 2f9727685..d141e124b 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 a512fd24a..2903b3214 100644 --- a/classstdex_1_1idrec_1_1record-members.html +++ b/classstdex_1_1idrec_1_1record-members.html @@ -91,7 +91,7 @@ $(function() { diff --git a/classstdex_1_1idrec_1_1record.html b/classstdex_1_1idrec_1_1record.html index 3e1639406..d397cb484 100644 --- a/classstdex_1_1idrec_1_1record.html +++ b/classstdex_1_1idrec_1_1record.html @@ -380,7 +380,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 da75b0043..37fa9820f 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 94824ce4d..f1430e754 100644 --- a/classstdex_1_1lazy__progress.html +++ b/classstdex_1_1lazy__progress.html @@ -285,7 +285,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 a709db864..29c8bbc9d 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 3ae0ba4df..38f089dbc 100644 --- a/classstdex_1_1parser_1_1basic__angle.html +++ b/classstdex_1_1parser_1_1basic__angle.html @@ -250,7 +250,7 @@ template<class T > diff --git a/classstdex_1_1parser_1_1basic__any__cu-members.html b/classstdex_1_1parser_1_1basic__any__cu-members.html index 7ec931d52..12be7fdf8 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 1c4ef8699..e7695cfba 100644 --- a/classstdex_1_1parser_1_1basic__any__cu.html +++ b/classstdex_1_1parser_1_1basic__any__cu.html @@ -194,7 +194,7 @@ template<class T > diff --git a/classstdex_1_1parser_1_1basic__bol-members.html b/classstdex_1_1parser_1_1basic__bol-members.html index 63415d7f3..431594501 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 27d81f46d..e8f8c0a3b 100644 --- a/classstdex_1_1parser_1_1basic__bol.html +++ b/classstdex_1_1parser_1_1basic__bol.html @@ -201,7 +201,7 @@ template<class T > diff --git a/classstdex_1_1parser_1_1basic__branch-members.html b/classstdex_1_1parser_1_1basic__branch-members.html index 37d0eb18f..8af65df1a 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 f280a1ad7..f02a24857 100644 --- a/classstdex_1_1parser_1_1basic__branch.html +++ b/classstdex_1_1parser_1_1basic__branch.html @@ -261,7 +261,7 @@ template<class T > diff --git a/classstdex_1_1parser_1_1basic__chemical__formula-members.html b/classstdex_1_1parser_1_1basic__chemical__formula-members.html index 158bb7923..06492a7df 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 7b52163f8..d42f63991 100644 --- a/classstdex_1_1parser_1_1basic__chemical__formula.html +++ b/classstdex_1_1parser_1_1basic__chemical__formula.html @@ -245,7 +245,7 @@ template<class T > diff --git a/classstdex_1_1parser_1_1basic__cu-members.html b/classstdex_1_1parser_1_1basic__cu-members.html index 6e48e5348..105cb4b59 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 51b61f293..0b823a8bd 100644 --- a/classstdex_1_1parser_1_1basic__cu.html +++ b/classstdex_1_1parser_1_1basic__cu.html @@ -204,7 +204,7 @@ template<class T > diff --git a/classstdex_1_1parser_1_1basic__cu__set-members.html b/classstdex_1_1parser_1_1basic__cu__set-members.html index 6f5c11427..2d88ac3e8 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 9f41f67db..5318b6768 100644 --- a/classstdex_1_1parser_1_1basic__cu__set.html +++ b/classstdex_1_1parser_1_1basic__cu__set.html @@ -218,7 +218,7 @@ template<class T > diff --git a/classstdex_1_1parser_1_1basic__date-members.html b/classstdex_1_1parser_1_1basic__date-members.html index 2f6f13997..0bb248aee 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 c9f06d228..4e5a6a3a5 100644 --- a/classstdex_1_1parser_1_1basic__date.html +++ b/classstdex_1_1parser_1_1basic__date.html @@ -258,7 +258,7 @@ template<class T > 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 386153171..3c0cfab91 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 97bb325db..16562c739 100644 --- a/classstdex_1_1parser_1_1basic__dns__domain__char.html +++ b/classstdex_1_1parser_1_1basic__dns__domain__char.html @@ -206,7 +206,7 @@ template<class T > diff --git a/classstdex_1_1parser_1_1basic__dns__name-members.html b/classstdex_1_1parser_1_1basic__dns__name-members.html index bdc8dc022..66e36c97c 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 9d2428b01..4736ea3af 100644 --- a/classstdex_1_1parser_1_1basic__dns__name.html +++ b/classstdex_1_1parser_1_1basic__dns__name.html @@ -208,7 +208,7 @@ template<class T > diff --git a/classstdex_1_1parser_1_1basic__email__address-members.html b/classstdex_1_1parser_1_1basic__email__address-members.html index a30c5bd7d..b8770c0dd 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 a7d304905..b0c12ec94 100644 --- a/classstdex_1_1parser_1_1basic__email__address.html +++ b/classstdex_1_1parser_1_1basic__email__address.html @@ -251,7 +251,7 @@ template<class T > diff --git a/classstdex_1_1parser_1_1basic__emoticon-members.html b/classstdex_1_1parser_1_1basic__emoticon-members.html index c8c2a302a..610b1924d 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 ddab3ea49..1da9a8df4 100644 --- a/classstdex_1_1parser_1_1basic__emoticon.html +++ b/classstdex_1_1parser_1_1basic__emoticon.html @@ -249,7 +249,7 @@ template<class T > diff --git a/classstdex_1_1parser_1_1basic__eol-members.html b/classstdex_1_1parser_1_1basic__eol-members.html index 6014f0af6..f44ccada4 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 00613223a..ec98e0b26 100644 --- a/classstdex_1_1parser_1_1basic__eol.html +++ b/classstdex_1_1parser_1_1basic__eol.html @@ -201,7 +201,7 @@ template<class T > diff --git a/classstdex_1_1parser_1_1basic__fraction-members.html b/classstdex_1_1parser_1_1basic__fraction-members.html index 9fe378e27..d8f855c00 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 73a906d1c..495508cf4 100644 --- a/classstdex_1_1parser_1_1basic__fraction.html +++ b/classstdex_1_1parser_1_1basic__fraction.html @@ -238,7 +238,7 @@ template<class T > diff --git a/classstdex_1_1parser_1_1basic__integer-members.html b/classstdex_1_1parser_1_1basic__integer-members.html index 017299b22..ac15fb898 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 378f90c86..fde1a9e24 100644 --- a/classstdex_1_1parser_1_1basic__integer.html +++ b/classstdex_1_1parser_1_1basic__integer.html @@ -183,7 +183,7 @@ template<class T > diff --git a/classstdex_1_1parser_1_1basic__integer10-members.html b/classstdex_1_1parser_1_1basic__integer10-members.html index fd8a93383..1ca7b81b3 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 c5c4a6a7a..0005d8baf 100644 --- a/classstdex_1_1parser_1_1basic__integer10.html +++ b/classstdex_1_1parser_1_1basic__integer10.html @@ -240,7 +240,7 @@ template<class T > diff --git a/classstdex_1_1parser_1_1basic__integer10ts-members.html b/classstdex_1_1parser_1_1basic__integer10ts-members.html index 6a5f639ca..e1ae7ed61 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 14b716c67..6b1591ba4 100644 --- a/classstdex_1_1parser_1_1basic__integer10ts.html +++ b/classstdex_1_1parser_1_1basic__integer10ts.html @@ -256,7 +256,7 @@ template<class T > diff --git a/classstdex_1_1parser_1_1basic__integer16-members.html b/classstdex_1_1parser_1_1basic__integer16-members.html index cffb90097..f7eabaf23 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 68f97ff21..73473dbfd 100644 --- a/classstdex_1_1parser_1_1basic__integer16.html +++ b/classstdex_1_1parser_1_1basic__integer16.html @@ -258,7 +258,7 @@ template<class T > diff --git a/classstdex_1_1parser_1_1basic__ipv4__address-members.html b/classstdex_1_1parser_1_1basic__ipv4__address-members.html index fdf38baae..982ce88e0 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 dd022ff94..f9574b856 100644 --- a/classstdex_1_1parser_1_1basic__ipv4__address.html +++ b/classstdex_1_1parser_1_1basic__ipv4__address.html @@ -271,7 +271,7 @@ template<class T > diff --git a/classstdex_1_1parser_1_1basic__ipv6__address-members.html b/classstdex_1_1parser_1_1basic__ipv6__address-members.html index 260dc4916..20af2f51a 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 e57129036..0110267a3 100644 --- a/classstdex_1_1parser_1_1basic__ipv6__address.html +++ b/classstdex_1_1parser_1_1basic__ipv6__address.html @@ -296,7 +296,7 @@ template<class T > 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 0c018a320..0b0930f57 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 90cb6096a..1274ac43c 100644 --- a/classstdex_1_1parser_1_1basic__ipv6__scope__id__char.html +++ b/classstdex_1_1parser_1_1basic__ipv6__scope__id__char.html @@ -194,7 +194,7 @@ template<class T > diff --git a/classstdex_1_1parser_1_1basic__iterations-members.html b/classstdex_1_1parser_1_1basic__iterations-members.html index 3c81df72c..c4b8babfe 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 bd0b040d6..64e50dcee 100644 --- a/classstdex_1_1parser_1_1basic__iterations.html +++ b/classstdex_1_1parser_1_1basic__iterations.html @@ -214,7 +214,7 @@ template<class T > diff --git a/classstdex_1_1parser_1_1basic__json__string-members.html b/classstdex_1_1parser_1_1basic__json__string-members.html index a811d0d55..cdcb10d40 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 1daf374f1..4b80b4e5e 100644 --- a/classstdex_1_1parser_1_1basic__json__string.html +++ b/classstdex_1_1parser_1_1basic__json__string.html @@ -266,7 +266,7 @@ template<class T > diff --git a/classstdex_1_1parser_1_1basic__mixed__numeral-members.html b/classstdex_1_1parser_1_1basic__mixed__numeral-members.html index 9a1a415ae..0ecb6f300 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 ee70103e0..00be591d2 100644 --- a/classstdex_1_1parser_1_1basic__mixed__numeral.html +++ b/classstdex_1_1parser_1_1basic__mixed__numeral.html @@ -253,7 +253,7 @@ template<class T > diff --git a/classstdex_1_1parser_1_1basic__monetary__numeral-members.html b/classstdex_1_1parser_1_1basic__monetary__numeral-members.html index 23c158f72..1dbff3ccd 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 a72f2c7d8..eaff4bd4a 100644 --- a/classstdex_1_1parser_1_1basic__monetary__numeral.html +++ b/classstdex_1_1parser_1_1basic__monetary__numeral.html @@ -257,7 +257,7 @@ template<class T > diff --git a/classstdex_1_1parser_1_1basic__noop-members.html b/classstdex_1_1parser_1_1basic__noop-members.html index fbf9b997a..9913d9a3e 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 b559855e2..f89cef738 100644 --- a/classstdex_1_1parser_1_1basic__noop.html +++ b/classstdex_1_1parser_1_1basic__noop.html @@ -191,7 +191,7 @@ template<class T > diff --git a/classstdex_1_1parser_1_1basic__parser-members.html b/classstdex_1_1parser_1_1basic__parser-members.html index c23be3f76..d59de9c34 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 5bc0aff81..a0b3e24bb 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 8c540a418..8938b1545 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 ee10d947f..c12c2153d 100644 --- a/classstdex_1_1parser_1_1basic__permutation.html +++ b/classstdex_1_1parser_1_1basic__permutation.html @@ -222,7 +222,7 @@ template<class T > diff --git a/classstdex_1_1parser_1_1basic__phone__number-members.html b/classstdex_1_1parser_1_1basic__phone__number-members.html index aeaa1560b..a76ac4eaa 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 46965cd12..070e53079 100644 --- a/classstdex_1_1parser_1_1basic__phone__number.html +++ b/classstdex_1_1parser_1_1basic__phone__number.html @@ -252,7 +252,7 @@ template<class T > diff --git a/classstdex_1_1parser_1_1basic__punct__cu-members.html b/classstdex_1_1parser_1_1basic__punct__cu-members.html index e4977819d..5bcf085cf 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 59fc5b395..a1ef8f3f4 100644 --- a/classstdex_1_1parser_1_1basic__punct__cu.html +++ b/classstdex_1_1parser_1_1basic__punct__cu.html @@ -201,7 +201,7 @@ template<class T > diff --git a/classstdex_1_1parser_1_1basic__roman__numeral-members.html b/classstdex_1_1parser_1_1basic__roman__numeral-members.html index 2a328fd80..73c1bc5f4 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 de2fe81e7..76dd504bb 100644 --- a/classstdex_1_1parser_1_1basic__roman__numeral.html +++ b/classstdex_1_1parser_1_1basic__roman__numeral.html @@ -237,7 +237,7 @@ template<class T > diff --git a/classstdex_1_1parser_1_1basic__scientific__numeral-members.html b/classstdex_1_1parser_1_1basic__scientific__numeral-members.html index a214f25d3..d0a0272be 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 791ec98fa..a487d56bb 100644 --- a/classstdex_1_1parser_1_1basic__scientific__numeral.html +++ b/classstdex_1_1parser_1_1basic__scientific__numeral.html @@ -273,7 +273,7 @@ template<class T > diff --git a/classstdex_1_1parser_1_1basic__score-members.html b/classstdex_1_1parser_1_1basic__score-members.html index 84fff1f4b..5ac7f001b 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 c221d4532..484f61c99 100644 --- a/classstdex_1_1parser_1_1basic__score.html +++ b/classstdex_1_1parser_1_1basic__score.html @@ -242,7 +242,7 @@ template<class T > diff --git a/classstdex_1_1parser_1_1basic__sequence-members.html b/classstdex_1_1parser_1_1basic__sequence-members.html index eafa5668a..172561826 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 fff6d654a..020bacace 100644 --- a/classstdex_1_1parser_1_1basic__sequence.html +++ b/classstdex_1_1parser_1_1basic__sequence.html @@ -215,7 +215,7 @@ template<class T > diff --git a/classstdex_1_1parser_1_1basic__set-members.html b/classstdex_1_1parser_1_1basic__set-members.html index 12a77832d..64f1bf1f2 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 5818cafcf..53f638452 100644 --- a/classstdex_1_1parser_1_1basic__set.html +++ b/classstdex_1_1parser_1_1basic__set.html @@ -229,7 +229,7 @@ template<class T > diff --git a/classstdex_1_1parser_1_1basic__signed__numeral-members.html b/classstdex_1_1parser_1_1basic__signed__numeral-members.html index 25f1bb935..a230f359c 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 24619a007..8619830d5 100644 --- a/classstdex_1_1parser_1_1basic__signed__numeral.html +++ b/classstdex_1_1parser_1_1basic__signed__numeral.html @@ -245,7 +245,7 @@ template<class T > diff --git a/classstdex_1_1parser_1_1basic__space__cu-members.html b/classstdex_1_1parser_1_1basic__space__cu-members.html index b6ad6c21a..a04611385 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 d1f9cf360..bcfd262ae 100644 --- a/classstdex_1_1parser_1_1basic__space__cu.html +++ b/classstdex_1_1parser_1_1basic__space__cu.html @@ -201,7 +201,7 @@ template<class T > 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 a24abefed..fdc5d8231 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 0c0f8084c..495c34926 100644 --- a/classstdex_1_1parser_1_1basic__space__or__punct__cu.html +++ b/classstdex_1_1parser_1_1basic__space__or__punct__cu.html @@ -201,7 +201,7 @@ template<class T > diff --git a/classstdex_1_1parser_1_1basic__string-members.html b/classstdex_1_1parser_1_1basic__string-members.html index cc089ccd6..27d7ed842 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 6e7eec8a5..f9fd87ed3 100644 --- a/classstdex_1_1parser_1_1basic__string.html +++ b/classstdex_1_1parser_1_1basic__string.html @@ -201,7 +201,7 @@ template<class T > diff --git a/classstdex_1_1parser_1_1basic__string__branch-members.html b/classstdex_1_1parser_1_1basic__string__branch-members.html index 772a3257c..3c5ca1771 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 4e4bc9fc4..c42ce86d8 100644 --- a/classstdex_1_1parser_1_1basic__string__branch.html +++ b/classstdex_1_1parser_1_1basic__string__branch.html @@ -193,7 +193,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 1fd6aa78d..582772f6d 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 a9a2b39d5..f566c6790 100644 --- a/classstdex_1_1parser_1_1basic__time.html +++ b/classstdex_1_1parser_1_1basic__time.html @@ -248,7 +248,7 @@ template<class T > diff --git a/classstdex_1_1parser_1_1basic__url-members.html b/classstdex_1_1parser_1_1basic__url-members.html index c7fa9c0b0..29bc9e716 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 4851532d2..59c057f24 100644 --- a/classstdex_1_1parser_1_1basic__url.html +++ b/classstdex_1_1parser_1_1basic__url.html @@ -278,7 +278,7 @@ template<class T > 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 16b08e724..3eaa53de4 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 2b644147a..aa2e43db6 100644 --- a/classstdex_1_1parser_1_1basic__url__password__char.html +++ b/classstdex_1_1parser_1_1basic__url__password__char.html @@ -194,7 +194,7 @@ template<class T > diff --git a/classstdex_1_1parser_1_1basic__url__path-members.html b/classstdex_1_1parser_1_1basic__url__path-members.html index 794156b57..e6ec2bf1f 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 b904adf3a..1080c887b 100644 --- a/classstdex_1_1parser_1_1basic__url__path.html +++ b/classstdex_1_1parser_1_1basic__url__path.html @@ -248,7 +248,7 @@ template<class T > 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 d0819be29..8b19f46eb 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 db6324a1a..138976fbe 100644 --- a/classstdex_1_1parser_1_1basic__url__path__char.html +++ b/classstdex_1_1parser_1_1basic__url__path__char.html @@ -194,7 +194,7 @@ template<class T > 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 5fdd4c893..2d2a573a1 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 18ca8184d..2d62ce12a 100644 --- a/classstdex_1_1parser_1_1basic__url__username__char.html +++ b/classstdex_1_1parser_1_1basic__url__username__char.html @@ -194,7 +194,7 @@ template<class T > diff --git a/classstdex_1_1parser_1_1http__agent-members.html b/classstdex_1_1parser_1_1http__agent-members.html index 0e48f49ce..0fffaf1c7 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 e052d9d43..1273e0179 100644 --- a/classstdex_1_1parser_1_1http__agent.html +++ b/classstdex_1_1parser_1_1http__agent.html @@ -226,7 +226,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 aeb623b79..55635ea1b 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 92f0d66f4..7326aa5e1 100644 --- a/classstdex_1_1parser_1_1http__any__type.html +++ b/classstdex_1_1parser_1_1http__any__type.html @@ -187,7 +187,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 3d171caf7..8ded768c9 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 050e2024f..41f4e6922 100644 --- a/classstdex_1_1parser_1_1http__asterisk.html +++ b/classstdex_1_1parser_1_1http__asterisk.html @@ -187,7 +187,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 e32bdda2c..41cdb4ea1 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 06322cc4b..3894b17c8 100644 --- a/classstdex_1_1parser_1_1http__cookie.html +++ b/classstdex_1_1parser_1_1http__cookie.html @@ -236,7 +236,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 bcb0f753a..7fb85ffeb 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 f8a27e3bc..1bd9c85ee 100644 --- a/classstdex_1_1parser_1_1http__cookie__parameter.html +++ b/classstdex_1_1parser_1_1http__cookie__parameter.html @@ -230,7 +230,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 b225bca6d..33b4abb1a 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 2e5093406..546dd59ab 100644 --- a/classstdex_1_1parser_1_1http__header.html +++ b/classstdex_1_1parser_1_1http__header.html @@ -230,7 +230,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 1867613b6..3f13705b8 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 9f55dd596..a84b9bacc 100644 --- a/classstdex_1_1parser_1_1http__language.html +++ b/classstdex_1_1parser_1_1http__language.html @@ -223,7 +223,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 121f3d9ef..e8ab4a04b 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 ba704c52f..078a12c00 100644 --- a/classstdex_1_1parser_1_1http__line__break.html +++ b/classstdex_1_1parser_1_1http__line__break.html @@ -187,7 +187,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 d6638fc91..6ea4f2942 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 8961835d5..c993efb76 100644 --- a/classstdex_1_1parser_1_1http__media__range.html +++ b/classstdex_1_1parser_1_1http__media__range.html @@ -231,7 +231,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 a7902fa04..c331b12e4 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 322e93951..bf7629e69 100644 --- a/classstdex_1_1parser_1_1http__media__type.html +++ b/classstdex_1_1parser_1_1http__media__type.html @@ -239,7 +239,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 163bd7bc0..916ea7ec8 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 577ddf68f..60b40eeec 100644 --- a/classstdex_1_1parser_1_1http__parameter.html +++ b/classstdex_1_1parser_1_1http__parameter.html @@ -232,7 +232,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 090489636..c3d4af9ff 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 048212916..752f199d5 100644 --- a/classstdex_1_1parser_1_1http__protocol.html +++ b/classstdex_1_1parser_1_1http__protocol.html @@ -236,7 +236,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 c5805a60e..c53480705 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 5579ac4f7..a7cdf04b4 100644 --- a/classstdex_1_1parser_1_1http__quoted__string.html +++ b/classstdex_1_1parser_1_1http__quoted__string.html @@ -228,7 +228,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 d50661e3c..f74e0c79b 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 0191c69eb..52bb5cee8 100644 --- a/classstdex_1_1parser_1_1http__request.html +++ b/classstdex_1_1parser_1_1http__request.html @@ -236,7 +236,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 54d2ad87d..48277a05d 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 118ecbdc8..78ca12ef8 100644 --- a/classstdex_1_1parser_1_1http__space.html +++ b/classstdex_1_1parser_1_1http__space.html @@ -194,7 +194,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 8dc576d3c..e5076aafe 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 1a58d99a5..11b86ecc4 100644 --- a/classstdex_1_1parser_1_1http__text__char.html +++ b/classstdex_1_1parser_1_1http__text__char.html @@ -194,7 +194,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 a59caa4d8..089b74616 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 842e43ad1..efd398dc6 100644 --- a/classstdex_1_1parser_1_1http__token.html +++ b/classstdex_1_1parser_1_1http__token.html @@ -187,7 +187,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 cf44129a9..83697ca48 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 4196684f2..784f36b01 100644 --- a/classstdex_1_1parser_1_1http__url.html +++ b/classstdex_1_1parser_1_1http__url.html @@ -235,7 +235,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 58bce1a0c..e64a43a27 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 ac3813364..7618de19d 100644 --- a/classstdex_1_1parser_1_1http__url__parameter.html +++ b/classstdex_1_1parser_1_1http__url__parameter.html @@ -226,7 +226,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 7668d96e9..dfec721eb 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 c934cfa81..cf28ffde5 100644 --- a/classstdex_1_1parser_1_1http__url__path.html +++ b/classstdex_1_1parser_1_1http__url__path.html @@ -224,7 +224,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 76b538b23..54a86a4b9 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 156a8df8d..e4dba313e 100644 --- a/classstdex_1_1parser_1_1http__url__path__segment.html +++ b/classstdex_1_1parser_1_1http__url__path__segment.html @@ -187,7 +187,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 5c364e57f..d71ffd26d 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 c4879785b..52edfc453 100644 --- a/classstdex_1_1parser_1_1http__url__port.html +++ b/classstdex_1_1parser_1_1http__url__port.html @@ -226,7 +226,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 2d00dfcc1..ea6867704 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 989ee58e9..6684193f9 100644 --- a/classstdex_1_1parser_1_1http__url__server.html +++ b/classstdex_1_1parser_1_1http__url__server.html @@ -187,7 +187,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 79379ef0f..6703c66c4 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 3019520d4..2c604501c 100644 --- a/classstdex_1_1parser_1_1http__value.html +++ b/classstdex_1_1parser_1_1http__value.html @@ -228,7 +228,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 44082e0cf..aa420bac8 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 16473f16e..9a23d1086 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< T >

Collection of HTTP

diff --git a/classstdex_1_1parser_1_1http__weight-members.html b/classstdex_1_1parser_1_1http__weight-members.html index 4a1405c4f..2a7e3737d 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 9bb91bb17..9dce8c6a8 100644 --- a/classstdex_1_1parser_1_1http__weight.html +++ b/classstdex_1_1parser_1_1http__weight.html @@ -227,7 +227,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 652cca931..b8ebc0628 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 abc5a93c3..7988bdfb2 100644 --- a/classstdex_1_1parser_1_1http__weighted__value.html +++ b/classstdex_1_1parser_1_1http__weighted__value.html @@ -237,7 +237,7 @@ template<class T , class T_asterisk = http_asterisk> diff --git a/classstdex_1_1parser_1_1parser__collection-members.html b/classstdex_1_1parser_1_1parser__collection-members.html index e942d00d5..d38026024 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 3a979e89f..bcadb0ae4 100644 --- a/classstdex_1_1parser_1_1parser__collection.html +++ b/classstdex_1_1parser_1_1parser__collection.html @@ -192,7 +192,7 @@ template<class T > diff --git a/classstdex_1_1parser_1_1sgml__any__cp-members.html b/classstdex_1_1parser_1_1sgml__any__cp-members.html index 9fdf2ffb7..cfb37134f 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 b55a024df..adb74fab0 100644 --- a/classstdex_1_1parser_1_1sgml__any__cp.html +++ b/classstdex_1_1parser_1_1sgml__any__cp.html @@ -199,7 +199,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 c468dbabe..87eea879e 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 8962fa33e..ba9b1adb3 100644 --- a/classstdex_1_1parser_1_1sgml__cp.html +++ b/classstdex_1_1parser_1_1sgml__cp.html @@ -200,7 +200,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 828c71469..6df0853fe 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 00560eb04..73863a931 100644 --- a/classstdex_1_1parser_1_1sgml__cp__set.html +++ b/classstdex_1_1parser_1_1sgml__cp__set.html @@ -216,7 +216,7 @@ size_t hit_offset 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 505c4fa85..1ac34ce67 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 f6a4f064e..799040119 100644 --- a/classstdex_1_1parser_1_1sgml__dns__domain__char.html +++ b/classstdex_1_1parser_1_1sgml__dns__domain__char.html @@ -208,7 +208,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 11a9effad..f2519a279 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 34e121039..2de844b04 100644 --- a/classstdex_1_1parser_1_1sgml__ipv6__scope__id__char.html +++ b/classstdex_1_1parser_1_1sgml__ipv6__scope__id__char.html @@ -190,7 +190,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 c419b127d..b79e097db 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 d09e077aa..cceba6606 100644 --- a/classstdex_1_1parser_1_1sgml__punct__cp.html +++ b/classstdex_1_1parser_1_1sgml__punct__cp.html @@ -203,7 +203,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 3cacb3156..6d2dfde94 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 e08ed0c14..c79d5f7c5 100644 --- a/classstdex_1_1parser_1_1sgml__space__cp.html +++ b/classstdex_1_1parser_1_1sgml__space__cp.html @@ -203,7 +203,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 96f386516..bf71e7367 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 525b356dc..9b2d5e42f 100644 --- a/classstdex_1_1parser_1_1sgml__space__or__punct__cp.html +++ b/classstdex_1_1parser_1_1sgml__space__or__punct__cp.html @@ -203,7 +203,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 9b937b819..9289cdf6a 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 43576c515..f5450c95b 100644 --- a/classstdex_1_1parser_1_1sgml__string.html +++ b/classstdex_1_1parser_1_1sgml__string.html @@ -197,7 +197,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 060bd9d8d..d9f2fcccd 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 7d7bc8246..6f8047cfb 100644 --- a/classstdex_1_1parser_1_1sgml__url__password__char.html +++ b/classstdex_1_1parser_1_1sgml__url__password__char.html @@ -199,7 +199,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 825104ce2..207271436 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 70069073b..41c7ae1a6 100644 --- a/classstdex_1_1parser_1_1sgml__url__path__char.html +++ b/classstdex_1_1parser_1_1sgml__url__path__char.html @@ -199,7 +199,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 a28945829..3d4e156f9 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 8053924ae..65fa27428 100644 --- a/classstdex_1_1parser_1_1sgml__url__username__char.html +++ b/classstdex_1_1parser_1_1sgml__url__username__char.html @@ -199,7 +199,7 @@ std::locale m_locale diff --git a/classstdex_1_1progress-members.html b/classstdex_1_1progress-members.html index 92062e1d3..9044d43af 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 7514a6218..d556366ce 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 cfdc11625..7545ff20f 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 29514f807..e9f2d919e 100644 --- a/classstdex_1_1progress__switcher.html +++ b/classstdex_1_1progress__switcher.html @@ -178,7 +178,7 @@ class stdex::progress_switcher< T >

Progress indicator switcher. <

diff --git a/classstdex_1_1ring-members.html b/classstdex_1_1ring-members.html new file mode 100644 index 000000000..d852a9f1b --- /dev/null +++ b/classstdex_1_1ring-members.html @@ -0,0 +1,106 @@ + + + + + + + +stdex: Member List + + + + + + + + + +
+
+ + + + + + +
+
stdex +
+
Additional custom or not Standard C++ covered algorithms
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
stdex::ring< T, CAPACITY > Member List
+
+
+ +

This is the complete list of members for stdex::ring< T, CAPACITY >, including all inherited members.

+ + + + + + + + + + + + + + + + + + +
back()stdex::ring< T, CAPACITY >inline
empty() const (defined in stdex::ring< T, CAPACITY >)stdex::ring< T, CAPACITY >inlineprotected
front()stdex::ring< T, CAPACITY >inline
m_data (defined in stdex::ring< T, CAPACITY >)stdex::ring< T, CAPACITY >protected
m_head (defined in stdex::ring< T, CAPACITY >)stdex::ring< T, CAPACITY >protected
m_head_moved (defined in stdex::ring< T, CAPACITY >)stdex::ring< T, CAPACITY >protected
m_mutex (defined in stdex::ring< T, CAPACITY >)stdex::ring< T, CAPACITY >protected
m_quit (defined in stdex::ring< T, CAPACITY >)stdex::ring< T, CAPACITY >protected
m_size (defined in stdex::ring< T, CAPACITY >)stdex::ring< T, CAPACITY >protected
m_tail_moved (defined in stdex::ring< T, CAPACITY >)stdex::ring< T, CAPACITY >protected
pop(size_t size)stdex::ring< T, CAPACITY >inline
push(size_t size)stdex::ring< T, CAPACITY >inline
quit()stdex::ring< T, CAPACITY >inline
ring() (defined in stdex::ring< T, CAPACITY >)stdex::ring< T, CAPACITY >inline
space() const (defined in stdex::ring< T, CAPACITY >)stdex::ring< T, CAPACITY >inlineprotected
sync()stdex::ring< T, CAPACITY >inline
wrap(size_t idx) const (defined in stdex::ring< T, CAPACITY >)stdex::ring< T, CAPACITY >inlineprotected
+ + + + diff --git a/classstdex_1_1ring.html b/classstdex_1_1ring.html new file mode 100644 index 000000000..0656858df --- /dev/null +++ b/classstdex_1_1ring.html @@ -0,0 +1,302 @@ + + + + + + + +stdex: stdex::ring< T, CAPACITY > Class Template Reference + + + + + + + + + +
+
+ + + + + + +
+
stdex +
+
Additional custom or not Standard C++ covered algorithms
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
+Public Member Functions | +Protected Member Functions | +Protected Attributes | +List of all members
+
stdex::ring< T, CAPACITY > Class Template Reference
+
+
+ +

Ring buffer. + More...

+ +

#include <stdex/ring.hpp>

+ + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

std::tuple< T *, size_t > back ()
 Allocates the data after the ring tail. Use push() after the allocated data is populated.
 
void push (size_t size)
 Notifies the receiver the data was populated.
 
std::tuple< T *, size_t > front ()
 Peeks the data at the ring head. Use pop() after the data was consumed.
 
void pop (size_t size)
 Notifies the sender the data was consumed.
 
+void quit ()
 Cancells waiting sender and receiver.
 
+void sync ()
 Waits until the ring is flush.
 
+ + + + + + + +

+Protected Member Functions

+size_t wrap (size_t idx) const
 
+size_t space () const
 
+bool empty () const
 
+ + + + + + + + + + + + + + + +

+Protected Attributes

+std::mutex m_mutex
 
+std::condition_variable m_head_moved
 
+std::condition_variable m_tail_moved
 
+size_t m_head
 
+size_t m_size
 
+bool m_quit
 
+T m_data [CAPACITY]
 
+

Detailed Description

+
template<class T, size_t CAPACITY>
+class stdex::ring< T, CAPACITY >

Ring buffer.

+
Template Parameters
+ + + +
TRing element type
CAPACITYRing capacity (in number of elements)
+
+
+

Member Function Documentation

+ +

◆ back()

+ +
+
+
+template<class T , size_t CAPACITY>
+ + + + + +
+ + + + + + + +
std::tuple< T *, size_t > stdex::ring< T, CAPACITY >::back ()
+
+inline
+
+ +

Allocates the data after the ring tail. Use push() after the allocated data is populated.

+
Returns
Pointer to data available for writing and maximum data size to write. Or, {nullptr, 0} if quit() has been called.
+ +
+
+ +

◆ front()

+ +
+
+
+template<class T , size_t CAPACITY>
+ + + + + +
+ + + + + + + +
std::tuple< T *, size_t > stdex::ring< T, CAPACITY >::front ()
+
+inline
+
+ +

Peeks the data at the ring head. Use pop() after the data was consumed.

+
Returns
Pointer to data available for reading and maximum data size to read. Or, {nullptr, 0} if quit() has been called.
+ +
+
+ +

◆ pop()

+ +
+
+
+template<class T , size_t CAPACITY>
+ + + + + +
+ + + + + + + + +
void stdex::ring< T, CAPACITY >::pop (size_t size)
+
+inline
+
+ +

Notifies the sender the data was consumed.

+
Parameters
+ + +
[in]sizeAmount of data that was really consumed
+
+
+ +
+
+ +

◆ push()

+ +
+
+
+template<class T , size_t CAPACITY>
+ + + + + +
+ + + + + + + + +
void stdex::ring< T, CAPACITY >::push (size_t size)
+
+inline
+
+ +

Notifies the receiver the data was populated.

+
Parameters
+ + +
[in]sizeAmount of data that was really populated
+
+
+ +
+
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/classstdex_1_1stream_1_1async__reader-members.html b/classstdex_1_1stream_1_1async__reader-members.html new file mode 100644 index 000000000..126a91be2 --- /dev/null +++ b/classstdex_1_1stream_1_1async__reader-members.html @@ -0,0 +1,152 @@ + + + + + + + +stdex: Member List + + + + + + + + + +
+
+ + + + + + +
+
stdex +
+
Additional custom or not Standard C++ covered algorithms
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
stdex::stream::async_reader< CAPACITY > Member List
+
+
+ +

This is the complete list of members for stdex::stream::async_reader< CAPACITY >, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
async_reader(basic &source) (defined in stdex::stream::async_reader< CAPACITY >)stdex::stream::async_reader< CAPACITY >inline
basic(state_t state=state_t::ok) (defined in stdex::stream::basic)stdex::stream::basicinline
close()stdex::stream::converterinlinevirtual
converter() (defined in stdex::stream::converter)stdex::stream::converterinlineexplicitprotected
converter(basic &source) (defined in stdex::stream::converter)stdex::stream::converterinline
flush()stdex::stream::converterinlinevirtual
init(basic &source) (defined in stdex::stream::converter)stdex::stream::converterinlineprotected
m_ring (defined in stdex::stream::async_reader< CAPACITY >)stdex::stream::async_reader< CAPACITY >protected
m_source (defined in stdex::stream::converter)stdex::stream::converterprotected
m_state (defined in stdex::stream::basic)stdex::stream::basicprotected
m_worker (defined in stdex::stream::async_reader< CAPACITY >)stdex::stream::async_reader< CAPACITY >protected
ok() conststdex::stream::basicinline
operator<<(const int8_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const int16_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const int32_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const int64_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint8_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint16_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint32_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint64_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const float data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const double data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const char data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const T *data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int8_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int16_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int32_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int64_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint8_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint16_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint32_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint64_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(float &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(double &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(char &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(std::basic_string< _Elem, _Traits, _Ax > &data) (defined in stdex::stream::basic)stdex::stream::basicinline
process(async_reader &w) (defined in stdex::stream::async_reader< CAPACITY >)stdex::stream::async_reader< CAPACITY >inlineprotectedstatic
read(_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)stdex::stream::async_reader< CAPACITY >inlinevirtual
read_array(_Out_writes_bytes_(size *count) void *array, size_t size, size_t count)stdex::stream::basicinline
read_byte()stdex::stream::basicinline
read_data(T &data)stdex::stream::basicinline
read_remainder(size_t max_length=SIZE_MAX)stdex::stream::basicinlinevirtual
read_str(std::basic_string< _Elem, _Traits, _Ax > &data)stdex::stream::basicinline
readln(std::basic_string< char, _Traits, _Ax > &str)stdex::stream::basicinline
readln(std::basic_string< wchar_t, _Traits, _Ax > &wstr)stdex::stream::basicinline
readln(std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)stdex::stream::basicinline
readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline
readln_and_attach(std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)stdex::stream::basicinline
skip(fsize_t amount)stdex::stream::basicinlinevirtual
state() conststdex::stream::basicinline
write(_In_reads_bytes_opt_(length) const void *data, size_t length)stdex::stream::converterinlinevirtual
write_array(_In_reads_bytes_opt_(size *count) const void *array, size_t size, size_t count)stdex::stream::basicinline
write_array(_In_reads_or_z_opt_(num_chars) const wchar_t *wstr, size_t num_chars, charset_id charset)stdex::stream::basicinline
write_byte(uint8_t byte, fsize_t amount=1)stdex::stream::basicinline
write_charset(charset_id charset)stdex::stream::basicinline
write_data(const T data)stdex::stream::basicinline
write_sprintf(_Printf_format_string_params_(2) const char *format, locale_t locale,...)stdex::stream::basicinline
write_sprintf(_Printf_format_string_params_(2) const wchar_t *format, locale_t locale,...)stdex::stream::basicinline
write_str(const T *data)stdex::stream::basicinline
write_stream(basic &stream, fsize_t amount=fsize_max)stdex::stream::basicinline
write_vsprintf(_Printf_format_string_params_(2) const char *format, locale_t locale, va_list params)stdex::stream::basicinline
write_vsprintf(_Printf_format_string_params_(2) const wchar_t *format, locale_t locale, va_list params)stdex::stream::basicinline
~async_reader() (defined in stdex::stream::async_reader< CAPACITY >)stdex::stream::async_reader< CAPACITY >inlinevirtual
+ + + + diff --git a/classstdex_1_1stream_1_1async__reader.html b/classstdex_1_1stream_1_1async__reader.html new file mode 100644 index 000000000..23441b60c --- /dev/null +++ b/classstdex_1_1stream_1_1async__reader.html @@ -0,0 +1,401 @@ + + + + + + + +stdex: stdex::stream::async_reader< CAPACITY > Class Template Reference + + + + + + + + + +
+
+ + + + + + +
+
stdex +
+
Additional custom or not Standard C++ covered algorithms
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
+Public Member Functions | +Static Protected Member Functions | +Protected Attributes | +List of all members
+
stdex::stream::async_reader< CAPACITY > Class Template Reference
+
+
+ +

Provides read-ahead stream capability. + More...

+ +

#include <stdex/stream.hpp>

+
+Inheritance diagram for stdex::stream::async_reader< CAPACITY >:
+
+
+ + +stdex::stream::converter +stdex::stream::basic + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

async_reader (basic &source)
 
virtual size_t read (_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
 Reads block of data from the stream.
 
- Public Member Functions inherited from stdex::stream::converter
converter (basic &source)
 
virtual size_t read (_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
 Reads block of data from the stream.
 
virtual size_t write (_In_reads_bytes_opt_(length) const void *data, size_t length)
 Writes block of data to the stream.
 
virtual void close ()
 Closes the stream.
 
virtual void flush ()
 Persists volatile element data.
 
- Public Member Functions inherited from stdex::stream::basic
basic (state_t state=state_t::ok)
 
virtual size_t read (_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
 Reads block of data from the stream.
 
virtual size_t write (_In_reads_bytes_opt_(length) const void *data, size_t length)
 Writes block of data to the stream.
 
virtual void flush ()
 Persists volatile element data.
 
virtual void close ()
 Closes the stream.
 
virtual void skip (fsize_t amount)
 Skips given amount of bytes of data on the stream.
 
+state_t state () const
 Returns stream state after last operation.
 
+bool ok () const
 Returns true if the stream state is clean i.e. previous operation was succesful.
 
virtual std::vector< uint8_t > read_remainder (size_t max_length=SIZE_MAX)
 Reads and returns remainder of the stream.
 
+uint8_t read_byte ()
 Reads one byte of data.
 
+void write_byte (uint8_t byte, fsize_t amount=1)
 Writes a byte of data.
 
template<class T >
basicread_data (T &data)
 Reads one primitive data type.
 
template<class T >
basicwrite_data (const T data)
 Writes one primitive data type.
 
template<class _Traits = std::char_traits<char>, class _Ax = std::allocator<char>>
size_t readln (std::basic_string< char, _Traits, _Ax > &str)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln (std::basic_string< wchar_t, _Traits, _Ax > &wstr)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln (std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
size_t readln_and_attach (std::basic_string< _Elem, _Traits, _Ax > &str)
 Reads stream to the end-of-line or end-of-file and append to str.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln_and_attach (std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)
 Reads stream to the end-of-line or end-of-file and append to str.
 
size_t read_array (_Out_writes_bytes_(size *count) void *array, size_t size, size_t count)
 Reads an array of data from the stream.
 
size_t write_array (_In_reads_bytes_opt_(size *count) const void *array, size_t size, size_t count)
 Writes an array of data to the stream.
 
size_t write_array (_In_reads_or_z_opt_(num_chars) const wchar_t *wstr, size_t num_chars, charset_id charset)
 Writes array of characters to the stream.
 
template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
basicread_str (std::basic_string< _Elem, _Traits, _Ax > &data)
 Reads length-prefixed string from the stream.
 
template<class T >
basicwrite_str (const T *data)
 Writes string to the stream length-prefixed.
 
fsize_t write_stream (basic &stream, fsize_t amount=fsize_max)
 Writes content of another stream.
 
+void write_charset (charset_id charset)
 Writes UTF8 or UTF-16 byte-order-mark.
 
size_t write_sprintf (_Printf_format_string_params_(2) const char *format, locale_t locale,...)
 Writes formatted string to the stream.
 
size_t write_sprintf (_Printf_format_string_params_(2) const wchar_t *format, locale_t locale,...)
 Writes formatted string to the stream.
 
size_t write_vsprintf (_Printf_format_string_params_(2) const char *format, locale_t locale, va_list params)
 Writes formatted string to the stream.
 
size_t write_vsprintf (_Printf_format_string_params_(2) const wchar_t *format, locale_t locale, va_list params)
 Writes formatted string to the stream.
 
+basicoperator>> (int8_t &data)
 
+basicoperator<< (const int8_t data)
 
+basicoperator>> (int16_t &data)
 
+basicoperator<< (const int16_t data)
 
+basicoperator>> (int32_t &data)
 
+basicoperator<< (const int32_t data)
 
+basicoperator>> (int64_t &data)
 
+basicoperator<< (const int64_t data)
 
+basicoperator>> (uint8_t &data)
 
+basicoperator<< (const uint8_t data)
 
+basicoperator>> (uint16_t &data)
 
+basicoperator<< (const uint16_t data)
 
+basicoperator>> (uint32_t &data)
 
+basicoperator<< (const uint32_t data)
 
+basicoperator>> (uint64_t &data)
 
+basicoperator<< (const uint64_t data)
 
+basicoperator>> (float &data)
 
+basicoperator<< (const float data)
 
+basicoperator>> (double &data)
 
+basicoperator<< (const double data)
 
+basicoperator>> (char &data)
 
+basicoperator<< (const char data)
 
+template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
basicoperator>> (std::basic_string< _Elem, _Traits, _Ax > &data)
 
+template<class T >
basicoperator<< (const T *data)
 
+ + + +

+Static Protected Member Functions

+static void process (async_reader &w)
 
+ + + + + + + + + + + +

+Protected Attributes

+ring< uint8_t, CAPACITY > m_ring
 
+std::thread m_worker
 
- Protected Attributes inherited from stdex::stream::converter
+basicm_source
 
- Protected Attributes inherited from stdex::stream::basic
+state_t m_state
 
+ + + + +

+Additional Inherited Members

- Protected Member Functions inherited from stdex::stream::converter
+void init (basic &source)
 
+

Detailed Description

+
template<size_t CAPACITY = default_async_limit>
+class stdex::stream::async_reader< CAPACITY >

Provides read-ahead stream capability.

+
Template Parameters
+ + +
CAPACITYRead-ahead buffer size
+
+
+

Member Function Documentation

+ +

◆ read()

+ +
+
+
+template<size_t CAPACITY = default_async_limit>
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual size_t stdex::stream::async_reader< CAPACITY >::read (_Out_writes_bytes_to_opt_(length, return) void * data,
size_t length 
)
+
+inlinevirtual
+
+ +

Reads block of data from the stream.

+
Parameters
+ + + +
[out]dataBuffer to store read data
[in]lengthByte limit of data to read
+
+
+
Returns
Number of bytes succesfully read. On EOF, 0 is returned and stream state is set to state_t::eof. On error, 0 is returned and stream state is set to state_t::fail. On null reads (length == 0), 0 is returned and stream state is set to state_t::ok.
+ +

Reimplemented from stdex::stream::converter.

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/classstdex_1_1stream_1_1async__reader.png b/classstdex_1_1stream_1_1async__reader.png new file mode 100644 index 000000000..66accc121 Binary files /dev/null and b/classstdex_1_1stream_1_1async__reader.png differ diff --git a/classstdex_1_1stream_1_1async__writer-members.html b/classstdex_1_1stream_1_1async__writer-members.html new file mode 100644 index 000000000..542473131 --- /dev/null +++ b/classstdex_1_1stream_1_1async__writer-members.html @@ -0,0 +1,152 @@ + + + + + + + +stdex: Member List + + + + + + + + + +
+
+ + + + + + +
+
stdex +
+
Additional custom or not Standard C++ covered algorithms
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
stdex::stream::async_writer< CAPACITY > Member List
+
+
+ +

This is the complete list of members for stdex::stream::async_writer< CAPACITY >, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
async_writer(basic &source) (defined in stdex::stream::async_writer< CAPACITY >)stdex::stream::async_writer< CAPACITY >inline
basic(state_t state=state_t::ok) (defined in stdex::stream::basic)stdex::stream::basicinline
close()stdex::stream::converterinlinevirtual
converter() (defined in stdex::stream::converter)stdex::stream::converterinlineexplicitprotected
converter(basic &source) (defined in stdex::stream::converter)stdex::stream::converterinline
flush()stdex::stream::async_writer< CAPACITY >inlinevirtual
init(basic &source) (defined in stdex::stream::converter)stdex::stream::converterinlineprotected
m_ring (defined in stdex::stream::async_writer< CAPACITY >)stdex::stream::async_writer< CAPACITY >protected
m_source (defined in stdex::stream::converter)stdex::stream::converterprotected
m_state (defined in stdex::stream::basic)stdex::stream::basicprotected
m_worker (defined in stdex::stream::async_writer< CAPACITY >)stdex::stream::async_writer< CAPACITY >protected
ok() conststdex::stream::basicinline
operator<<(const int8_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const int16_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const int32_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const int64_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint8_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint16_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint32_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint64_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const float data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const double data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const char data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const T *data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int8_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int16_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int32_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int64_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint8_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint16_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint32_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint64_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(float &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(double &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(char &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(std::basic_string< _Elem, _Traits, _Ax > &data) (defined in stdex::stream::basic)stdex::stream::basicinline
process(async_writer &w) (defined in stdex::stream::async_writer< CAPACITY >)stdex::stream::async_writer< CAPACITY >inlineprotectedstatic
read(_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)stdex::stream::converterinlinevirtual
read_array(_Out_writes_bytes_(size *count) void *array, size_t size, size_t count)stdex::stream::basicinline
read_byte()stdex::stream::basicinline
read_data(T &data)stdex::stream::basicinline
read_remainder(size_t max_length=SIZE_MAX)stdex::stream::basicinlinevirtual
read_str(std::basic_string< _Elem, _Traits, _Ax > &data)stdex::stream::basicinline
readln(std::basic_string< char, _Traits, _Ax > &str)stdex::stream::basicinline
readln(std::basic_string< wchar_t, _Traits, _Ax > &wstr)stdex::stream::basicinline
readln(std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)stdex::stream::basicinline
readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline
readln_and_attach(std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)stdex::stream::basicinline
skip(fsize_t amount)stdex::stream::basicinlinevirtual
state() conststdex::stream::basicinline
write(_In_reads_bytes_opt_(length) const void *data, size_t length)stdex::stream::async_writer< CAPACITY >inlinevirtual
write_array(_In_reads_bytes_opt_(size *count) const void *array, size_t size, size_t count)stdex::stream::basicinline
write_array(_In_reads_or_z_opt_(num_chars) const wchar_t *wstr, size_t num_chars, charset_id charset)stdex::stream::basicinline
write_byte(uint8_t byte, fsize_t amount=1)stdex::stream::basicinline
write_charset(charset_id charset)stdex::stream::basicinline
write_data(const T data)stdex::stream::basicinline
write_sprintf(_Printf_format_string_params_(2) const char *format, locale_t locale,...)stdex::stream::basicinline
write_sprintf(_Printf_format_string_params_(2) const wchar_t *format, locale_t locale,...)stdex::stream::basicinline
write_str(const T *data)stdex::stream::basicinline
write_stream(basic &stream, fsize_t amount=fsize_max)stdex::stream::basicinline
write_vsprintf(_Printf_format_string_params_(2) const char *format, locale_t locale, va_list params)stdex::stream::basicinline
write_vsprintf(_Printf_format_string_params_(2) const wchar_t *format, locale_t locale, va_list params)stdex::stream::basicinline
~async_writer() (defined in stdex::stream::async_writer< CAPACITY >)stdex::stream::async_writer< CAPACITY >inlinevirtual
+ + + + diff --git a/classstdex_1_1stream_1_1async__writer.html b/classstdex_1_1stream_1_1async__writer.html new file mode 100644 index 000000000..9d0702be7 --- /dev/null +++ b/classstdex_1_1stream_1_1async__writer.html @@ -0,0 +1,435 @@ + + + + + + + +stdex: stdex::stream::async_writer< CAPACITY > Class Template Reference + + + + + + + + + +
+
+ + + + + + +
+
stdex +
+
Additional custom or not Standard C++ covered algorithms
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
+Public Member Functions | +Static Protected Member Functions | +Protected Attributes | +List of all members
+
stdex::stream::async_writer< CAPACITY > Class Template Reference
+
+
+ +

Provides write-back stream capability. + More...

+ +

#include <stdex/stream.hpp>

+
+Inheritance diagram for stdex::stream::async_writer< CAPACITY >:
+
+
+ + +stdex::stream::converter +stdex::stream::basic + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

async_writer (basic &source)
 
virtual size_t write (_In_reads_bytes_opt_(length) const void *data, size_t length)
 Writes block of data to the stream.
 
virtual void flush ()
 Persists volatile element data.
 
- Public Member Functions inherited from stdex::stream::converter
converter (basic &source)
 
virtual size_t read (_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
 Reads block of data from the stream.
 
virtual size_t write (_In_reads_bytes_opt_(length) const void *data, size_t length)
 Writes block of data to the stream.
 
virtual void close ()
 Closes the stream.
 
virtual void flush ()
 Persists volatile element data.
 
- Public Member Functions inherited from stdex::stream::basic
basic (state_t state=state_t::ok)
 
virtual size_t read (_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
 Reads block of data from the stream.
 
virtual size_t write (_In_reads_bytes_opt_(length) const void *data, size_t length)
 Writes block of data to the stream.
 
virtual void flush ()
 Persists volatile element data.
 
virtual void close ()
 Closes the stream.
 
virtual void skip (fsize_t amount)
 Skips given amount of bytes of data on the stream.
 
+state_t state () const
 Returns stream state after last operation.
 
+bool ok () const
 Returns true if the stream state is clean i.e. previous operation was succesful.
 
virtual std::vector< uint8_t > read_remainder (size_t max_length=SIZE_MAX)
 Reads and returns remainder of the stream.
 
+uint8_t read_byte ()
 Reads one byte of data.
 
+void write_byte (uint8_t byte, fsize_t amount=1)
 Writes a byte of data.
 
template<class T >
basicread_data (T &data)
 Reads one primitive data type.
 
template<class T >
basicwrite_data (const T data)
 Writes one primitive data type.
 
template<class _Traits = std::char_traits<char>, class _Ax = std::allocator<char>>
size_t readln (std::basic_string< char, _Traits, _Ax > &str)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln (std::basic_string< wchar_t, _Traits, _Ax > &wstr)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln (std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
size_t readln_and_attach (std::basic_string< _Elem, _Traits, _Ax > &str)
 Reads stream to the end-of-line or end-of-file and append to str.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln_and_attach (std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)
 Reads stream to the end-of-line or end-of-file and append to str.
 
size_t read_array (_Out_writes_bytes_(size *count) void *array, size_t size, size_t count)
 Reads an array of data from the stream.
 
size_t write_array (_In_reads_bytes_opt_(size *count) const void *array, size_t size, size_t count)
 Writes an array of data to the stream.
 
size_t write_array (_In_reads_or_z_opt_(num_chars) const wchar_t *wstr, size_t num_chars, charset_id charset)
 Writes array of characters to the stream.
 
template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
basicread_str (std::basic_string< _Elem, _Traits, _Ax > &data)
 Reads length-prefixed string from the stream.
 
template<class T >
basicwrite_str (const T *data)
 Writes string to the stream length-prefixed.
 
fsize_t write_stream (basic &stream, fsize_t amount=fsize_max)
 Writes content of another stream.
 
+void write_charset (charset_id charset)
 Writes UTF8 or UTF-16 byte-order-mark.
 
size_t write_sprintf (_Printf_format_string_params_(2) const char *format, locale_t locale,...)
 Writes formatted string to the stream.
 
size_t write_sprintf (_Printf_format_string_params_(2) const wchar_t *format, locale_t locale,...)
 Writes formatted string to the stream.
 
size_t write_vsprintf (_Printf_format_string_params_(2) const char *format, locale_t locale, va_list params)
 Writes formatted string to the stream.
 
size_t write_vsprintf (_Printf_format_string_params_(2) const wchar_t *format, locale_t locale, va_list params)
 Writes formatted string to the stream.
 
+basicoperator>> (int8_t &data)
 
+basicoperator<< (const int8_t data)
 
+basicoperator>> (int16_t &data)
 
+basicoperator<< (const int16_t data)
 
+basicoperator>> (int32_t &data)
 
+basicoperator<< (const int32_t data)
 
+basicoperator>> (int64_t &data)
 
+basicoperator<< (const int64_t data)
 
+basicoperator>> (uint8_t &data)
 
+basicoperator<< (const uint8_t data)
 
+basicoperator>> (uint16_t &data)
 
+basicoperator<< (const uint16_t data)
 
+basicoperator>> (uint32_t &data)
 
+basicoperator<< (const uint32_t data)
 
+basicoperator>> (uint64_t &data)
 
+basicoperator<< (const uint64_t data)
 
+basicoperator>> (float &data)
 
+basicoperator<< (const float data)
 
+basicoperator>> (double &data)
 
+basicoperator<< (const double data)
 
+basicoperator>> (char &data)
 
+basicoperator<< (const char data)
 
+template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
basicoperator>> (std::basic_string< _Elem, _Traits, _Ax > &data)
 
+template<class T >
basicoperator<< (const T *data)
 
+ + + +

+Static Protected Member Functions

+static void process (async_writer &w)
 
+ + + + + + + + + + + +

+Protected Attributes

+ring< uint8_t, CAPACITY > m_ring
 
+std::thread m_worker
 
- Protected Attributes inherited from stdex::stream::converter
+basicm_source
 
- Protected Attributes inherited from stdex::stream::basic
+state_t m_state
 
+ + + + +

+Additional Inherited Members

- Protected Member Functions inherited from stdex::stream::converter
+void init (basic &source)
 
+

Detailed Description

+
template<size_t CAPACITY = default_async_limit>
+class stdex::stream::async_writer< CAPACITY >

Provides write-back stream capability.

+
Template Parameters
+ + +
CAPACITYWrite-back buffer size
+
+
+

Member Function Documentation

+ +

◆ flush()

+ +
+
+
+template<size_t CAPACITY = default_async_limit>
+ + + + + +
+ + + + + + + +
virtual void stdex::stream::async_writer< CAPACITY >::flush ()
+
+inlinevirtual
+
+ +

Persists volatile element data.

+ +

Reimplemented from stdex::stream::converter.

+ +
+
+ +

◆ write()

+ +
+
+
+template<size_t CAPACITY = default_async_limit>
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual size_t stdex::stream::async_writer< CAPACITY >::write (_In_reads_bytes_opt_(length) const void * data,
size_t length 
)
+
+inlinevirtual
+
+ +

Writes block of data to the stream.

+
Parameters
+ + + +
[in]dataBuffer to write data from
[in]lengthNumber of bytes to write
+
+
+
Returns
Number of bytes succesfully written. On error, stream state is set to state_t::fail.
+ +

Reimplemented from stdex::stream::converter.

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/classstdex_1_1stream_1_1async__writer.png b/classstdex_1_1stream_1_1async__writer.png new file mode 100644 index 000000000..cdcbb7905 Binary files /dev/null and b/classstdex_1_1stream_1_1async__writer.png differ diff --git a/classstdex_1_1stream_1_1basic-members.html b/classstdex_1_1stream_1_1basic-members.html new file mode 100644 index 000000000..4816191ec --- /dev/null +++ b/classstdex_1_1stream_1_1basic-members.html @@ -0,0 +1,143 @@ + + + + + + + +stdex: Member List + + + + + + + + + +
+
+ + + + + + +
+
stdex +
+
Additional custom or not Standard C++ covered algorithms
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
stdex::stream::basic Member List
+
+
+ +

This is the complete list of members for stdex::stream::basic, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
basic(state_t state=state_t::ok) (defined in stdex::stream::basic)stdex::stream::basicinline
close()stdex::stream::basicinlinevirtual
flush()stdex::stream::basicinlinevirtual
m_state (defined in stdex::stream::basic)stdex::stream::basicprotected
ok() conststdex::stream::basicinline
operator<<(const int8_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const int16_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const int32_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const int64_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint8_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint16_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint32_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint64_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const float data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const double data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const char data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const T *data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int8_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int16_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int32_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int64_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint8_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint16_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint32_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint64_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(float &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(double &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(char &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(std::basic_string< _Elem, _Traits, _Ax > &data) (defined in stdex::stream::basic)stdex::stream::basicinline
read(_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)stdex::stream::basicinlinevirtual
read_array(_Out_writes_bytes_(size *count) void *array, size_t size, size_t count)stdex::stream::basicinline
read_byte()stdex::stream::basicinline
read_data(T &data)stdex::stream::basicinline
read_remainder(size_t max_length=SIZE_MAX)stdex::stream::basicinlinevirtual
read_str(std::basic_string< _Elem, _Traits, _Ax > &data)stdex::stream::basicinline
readln(std::basic_string< char, _Traits, _Ax > &str)stdex::stream::basicinline
readln(std::basic_string< wchar_t, _Traits, _Ax > &wstr)stdex::stream::basicinline
readln(std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)stdex::stream::basicinline
readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline
readln_and_attach(std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)stdex::stream::basicinline
skip(fsize_t amount)stdex::stream::basicinlinevirtual
state() conststdex::stream::basicinline
write(_In_reads_bytes_opt_(length) const void *data, size_t length)stdex::stream::basicinlinevirtual
write_array(_In_reads_bytes_opt_(size *count) const void *array, size_t size, size_t count)stdex::stream::basicinline
write_array(_In_reads_or_z_opt_(num_chars) const wchar_t *wstr, size_t num_chars, charset_id charset)stdex::stream::basicinline
write_byte(uint8_t byte, fsize_t amount=1)stdex::stream::basicinline
write_charset(charset_id charset)stdex::stream::basicinline
write_data(const T data)stdex::stream::basicinline
write_sprintf(_Printf_format_string_params_(2) const char *format, locale_t locale,...)stdex::stream::basicinline
write_sprintf(_Printf_format_string_params_(2) const wchar_t *format, locale_t locale,...)stdex::stream::basicinline
write_str(const T *data)stdex::stream::basicinline
write_stream(basic &stream, fsize_t amount=fsize_max)stdex::stream::basicinline
write_vsprintf(_Printf_format_string_params_(2) const char *format, locale_t locale, va_list params)stdex::stream::basicinline
write_vsprintf(_Printf_format_string_params_(2) const wchar_t *format, locale_t locale, va_list params)stdex::stream::basicinline
+ + + + diff --git a/classstdex_1_1stream_1_1basic.html b/classstdex_1_1stream_1_1basic.html new file mode 100644 index 000000000..742792c53 --- /dev/null +++ b/classstdex_1_1stream_1_1basic.html @@ -0,0 +1,1225 @@ + + + + + + + +stdex: stdex::stream::basic Class Reference + + + + + + + + + +
+
+ + + + + + +
+
stdex +
+
Additional custom or not Standard C++ covered algorithms
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
+Public Member Functions | +Protected Attributes | +List of all members
+
stdex::stream::basic Class Reference
+
+
+ +

+

‍UTF-8 byte-order-mark

+
+ + More...

+ +

#include <stdex/stream.hpp>

+
+Inheritance diagram for stdex::stream::basic:
+
+
+ + +stdex::stream::basic_file +stdex::stream::basic_sys +stdex::stream::converter +stdex::stream::fifo +stdex::stream::replicator +stdex::stream::cache +stdex::stream::diag_file +stdex::stream::file +stdex::stream::file_window +stdex::stream::memory_file +stdex::stream::file +stdex::stream::async_reader< CAPACITY > +stdex::stream::async_writer< CAPACITY > +stdex::stream::buffer +stdex::stream::limiter + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

basic (state_t state=state_t::ok)
 
virtual size_t read (_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
 Reads block of data from the stream.
 
virtual size_t write (_In_reads_bytes_opt_(length) const void *data, size_t length)
 Writes block of data to the stream.
 
virtual void flush ()
 Persists volatile element data.
 
virtual void close ()
 Closes the stream.
 
virtual void skip (fsize_t amount)
 Skips given amount of bytes of data on the stream.
 
+state_t state () const
 Returns stream state after last operation.
 
+bool ok () const
 Returns true if the stream state is clean i.e. previous operation was succesful.
 
virtual std::vector< uint8_t > read_remainder (size_t max_length=SIZE_MAX)
 Reads and returns remainder of the stream.
 
+uint8_t read_byte ()
 Reads one byte of data.
 
+void write_byte (uint8_t byte, fsize_t amount=1)
 Writes a byte of data.
 
template<class T >
basicread_data (T &data)
 Reads one primitive data type.
 
template<class T >
basicwrite_data (const T data)
 Writes one primitive data type.
 
template<class _Traits = std::char_traits<char>, class _Ax = std::allocator<char>>
size_t readln (std::basic_string< char, _Traits, _Ax > &str)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln (std::basic_string< wchar_t, _Traits, _Ax > &wstr)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln (std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
size_t readln_and_attach (std::basic_string< _Elem, _Traits, _Ax > &str)
 Reads stream to the end-of-line or end-of-file and append to str.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln_and_attach (std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)
 Reads stream to the end-of-line or end-of-file and append to str.
 
size_t read_array (_Out_writes_bytes_(size *count) void *array, size_t size, size_t count)
 Reads an array of data from the stream.
 
size_t write_array (_In_reads_bytes_opt_(size *count) const void *array, size_t size, size_t count)
 Writes an array of data to the stream.
 
size_t write_array (_In_reads_or_z_opt_(num_chars) const wchar_t *wstr, size_t num_chars, charset_id charset)
 Writes array of characters to the stream.
 
template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
basicread_str (std::basic_string< _Elem, _Traits, _Ax > &data)
 Reads length-prefixed string from the stream.
 
template<class T >
basicwrite_str (const T *data)
 Writes string to the stream length-prefixed.
 
fsize_t write_stream (basic &stream, fsize_t amount=fsize_max)
 Writes content of another stream.
 
+void write_charset (charset_id charset)
 Writes UTF8 or UTF-16 byte-order-mark.
 
size_t write_sprintf (_Printf_format_string_params_(2) const char *format, locale_t locale,...)
 Writes formatted string to the stream.
 
size_t write_sprintf (_Printf_format_string_params_(2) const wchar_t *format, locale_t locale,...)
 Writes formatted string to the stream.
 
size_t write_vsprintf (_Printf_format_string_params_(2) const char *format, locale_t locale, va_list params)
 Writes formatted string to the stream.
 
size_t write_vsprintf (_Printf_format_string_params_(2) const wchar_t *format, locale_t locale, va_list params)
 Writes formatted string to the stream.
 
+basicoperator>> (int8_t &data)
 
+basicoperator<< (const int8_t data)
 
+basicoperator>> (int16_t &data)
 
+basicoperator<< (const int16_t data)
 
+basicoperator>> (int32_t &data)
 
+basicoperator<< (const int32_t data)
 
+basicoperator>> (int64_t &data)
 
+basicoperator<< (const int64_t data)
 
+basicoperator>> (uint8_t &data)
 
+basicoperator<< (const uint8_t data)
 
+basicoperator>> (uint16_t &data)
 
+basicoperator<< (const uint16_t data)
 
+basicoperator>> (uint32_t &data)
 
+basicoperator<< (const uint32_t data)
 
+basicoperator>> (uint64_t &data)
 
+basicoperator<< (const uint64_t data)
 
+basicoperator>> (float &data)
 
+basicoperator<< (const float data)
 
+basicoperator>> (double &data)
 
+basicoperator<< (const double data)
 
+basicoperator>> (char &data)
 
+basicoperator<< (const char data)
 
+template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
basicoperator>> (std::basic_string< _Elem, _Traits, _Ax > &data)
 
+template<class T >
basicoperator<< (const T *data)
 
+ + + +

+Protected Attributes

+state_t m_state
 
+

Detailed Description

+
+

‍UTF-8 byte-order-mark

+
+

Basic stream operations

+

Member Function Documentation

+ +

◆ close()

+ +
+
+ + + + + +
+ + + + + + + +
virtual void stdex::stream::basic::close ()
+
+inlinevirtual
+
+
+ +

◆ flush()

+ +
+
+ + + + + +
+ + + + + + + +
virtual void stdex::stream::basic::flush ()
+
+inlinevirtual
+
+
+ +

◆ read()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual size_t stdex::stream::basic::read (_Out_writes_bytes_to_opt_(length, return) void * data,
size_t length 
)
+
+inlinevirtual
+
+ +

Reads block of data from the stream.

+
Parameters
+ + + +
[out]dataBuffer to store read data
[in]lengthByte limit of data to read
+
+
+
Returns
Number of bytes succesfully read. On EOF, 0 is returned and stream state is set to state_t::eof. On error, 0 is returned and stream state is set to state_t::fail. On null reads (length == 0), 0 is returned and stream state is set to state_t::ok.
+ +

Reimplemented in stdex::stream::converter, stdex::stream::async_reader< CAPACITY >, stdex::stream::buffer, stdex::stream::limiter, stdex::stream::window, stdex::stream::file_window, stdex::stream::cache, stdex::stream::basic_sys, stdex::stream::memory_file, stdex::stream::fifo, and stdex::stream::diag_file.

+ +
+
+ +

◆ read_array()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
size_t stdex::stream::basic::read_array (_Out_writes_bytes_(size *count) void * array,
size_t size,
size_t count 
)
+
+inline
+
+ +

Reads an array of data from the stream.

+
Returns
Number of read elements
+ +
+
+ +

◆ read_data()

+ +
+
+
+template<class T >
+ + + + + +
+ + + + + + + + +
basic & stdex::stream::basic::read_data (T & data)
+
+inline
+
+ +

Reads one primitive data type.

+

This method is intended for chaining: e.g. stream.read_data(a).read_data(b).read_data(c)... Since it would make it impossible to detect if any of the read_data(a) or read_data(b) failed should read_data(c) succeed, the method skips reading if stream state is not ok.

+
Parameters
+ + +
[in]dataWhere to store read data
+
+
+
Returns
This stream
+ +
+
+ +

◆ read_remainder()

+ +
+
+ + + + + +
+ + + + + + + + +
virtual std::vector< uint8_t > stdex::stream::basic::read_remainder (size_t max_length = SIZE_MAX)
+
+inlinevirtual
+
+ +

Reads and returns remainder of the stream.

+
Parameters
+ + +
[in]max_lengthByte limit of data to read
+
+
+
Returns
Data read
+ +

Reimplemented in stdex::stream::basic_file.

+ +
+
+ +

◆ read_str()

+ +
+
+
+template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
+ + + + + +
+ + + + + + + + +
basic & stdex::stream::basic::read_str (std::basic_string< _Elem, _Traits, _Ax > & data)
+
+inline
+
+ +

Reads length-prefixed string from the stream.

+

This method is intended for chaining: e.g. stream.read_str(a).read_str(b).read_str(c)... Since it would make it impossible to detect if any of the read_str(a) or read_str(b) failed should read_str(c) succeed, the method skips reading if stream state is not ok.

+
Parameters
+ + +
[in]dataString to read to
+
+
+
Returns
This stream
+ +
+
+ +

◆ readln() [1/3]

+ +
+
+
+template<class _Traits = std::char_traits<char>, class _Ax = std::allocator<char>>
+ + + + + +
+ + + + + + + + +
size_t stdex::stream::basic::readln (std::basic_string< char, _Traits, _Ax > & str)
+
+inline
+
+ +

Reads stream to the end-of-line or end-of-file.

+
Returns
Number of read characters
+ +
+
+ +

◆ readln() [2/3]

+ +
+
+
+template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
+ + + + + +
+ + + + + + + + +
size_t stdex::stream::basic::readln (std::basic_string< wchar_t, _Traits, _Ax > & wstr)
+
+inline
+
+ +

Reads stream to the end-of-line or end-of-file.

+
Returns
Number of read characters
+ +
+
+ +

◆ readln() [3/3]

+ +
+
+
+template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
size_t stdex::stream::basic::readln (std::basic_string< wchar_t, _Traits, _Ax > & wstr,
charset_id charset 
)
+
+inline
+
+ +

Reads stream to the end-of-line or end-of-file.

+
Returns
Number of read characters
+ +
+
+ +

◆ readln_and_attach() [1/2]

+ +
+
+
+template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
+ + + + + +
+ + + + + + + + +
size_t stdex::stream::basic::readln_and_attach (std::basic_string< _Elem, _Traits, _Ax > & str)
+
+inline
+
+ +

Reads stream to the end-of-line or end-of-file and append to str.

+
Returns
Total number of chars in str
+ +
+
+ +

◆ readln_and_attach() [2/2]

+ +
+
+
+template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
size_t stdex::stream::basic::readln_and_attach (std::basic_string< wchar_t, _Traits, _Ax > & wstr,
charset_id charset 
)
+
+inline
+
+ +

Reads stream to the end-of-line or end-of-file and append to str.

+
Returns
Total number of chars in str
+ +
+
+ +

◆ skip()

+ +
+
+ + + + + +
+ + + + + + + + +
virtual void stdex::stream::basic::skip (fsize_t amount)
+
+inlinevirtual
+
+ +

Skips given amount of bytes of data on the stream.

+ +

Reimplemented in stdex::stream::basic_file, and stdex::stream::file_window.

+ +
+
+ +

◆ write()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual size_t stdex::stream::basic::write (_In_reads_bytes_opt_(length) const void * data,
size_t length 
)
+
+inlinevirtual
+
+ +

Writes block of data to the stream.

+
Parameters
+ + + +
[in]dataBuffer to write data from
[in]lengthNumber of bytes to write
+
+
+
Returns
Number of bytes succesfully written. On error, stream state is set to state_t::fail.
+ +

Reimplemented in stdex::stream::converter, stdex::stream::replicator, stdex::stream::async_writer< CAPACITY >, stdex::stream::buffer, stdex::stream::limiter, stdex::stream::window, stdex::stream::file_window, stdex::stream::cache, stdex::stream::basic_sys, stdex::stream::memory_file, stdex::stream::fifo, and stdex::stream::diag_file.

+ +
+
+ +

◆ write_array() [1/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
size_t stdex::stream::basic::write_array (_In_reads_bytes_opt_(size *count) const void * array,
size_t size,
size_t count 
)
+
+inline
+
+ +

Writes an array of data to the stream.

+
Returns
Number of elements written
+ +
+
+ +

◆ write_array() [2/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
size_t stdex::stream::basic::write_array (_In_reads_or_z_opt_(num_chars) const wchar_t * wstr,
size_t num_chars,
charset_id charset 
)
+
+inline
+
+ +

Writes array of characters to the stream.

+
Parameters
+ + + + +
[in]wstrString to write
[in]num_charsString code unit count limit
[in]charsetCharset to convert string to
+
+
+
Returns
Number of code units written
+ +
+
+ +

◆ write_data()

+ +
+
+
+template<class T >
+ + + + + +
+ + + + + + + + +
basic & stdex::stream::basic::write_data (const T data)
+
+inline
+
+ +

Writes one primitive data type.

+

This method is intended for chaining: e.g. stream.write_data(a).write_data(b).write_data(c)... Since it would make it impossible to detect if any of the write_data(a) or write_data(b) failed should write_data(c) succeed, the method skips writing if stream state is not ok.

+
Parameters
+ + +
[in]dataData to write
+
+
+
Returns
This stream
+ +
+
+ +

◆ write_sprintf() [1/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
size_t stdex::stream::basic::write_sprintf (_Printf_format_string_params_(2) const char * format,
locale_t locale,
 ... 
)
+
+inline
+
+ +

Writes formatted string to the stream.

+
Returns
Number of characters written
+ +
+
+ +

◆ write_sprintf() [2/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
size_t stdex::stream::basic::write_sprintf (_Printf_format_string_params_(2) const wchar_t * format,
locale_t locale,
 ... 
)
+
+inline
+
+ +

Writes formatted string to the stream.

+
Returns
Number of characters written
+ +
+
+ +

◆ write_str()

+ +
+
+
+template<class T >
+ + + + + +
+ + + + + + + + +
basic & stdex::stream::basic::write_str (const T * data)
+
+inline
+
+ +

Writes string to the stream length-prefixed.

+

This method is intended for chaining: e.g. stream.write_str(a).write_str(b).write_str(c)... Since it would make it impossible to detect if any of the write_str(a) or write_str(b) failed should write_str(c) succeed, the method skips writing if stream state is not ok.

+
Parameters
+ + +
[in]dataString to write
+
+
+
Returns
This stream
+ +
+
+ +

◆ write_stream()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
fsize_t stdex::stream::basic::write_stream (basicstream,
fsize_t amount = fsize_max 
)
+
+inline
+
+ +

Writes content of another stream.

+
Returns
Number of bytes written
+ +
+
+ +

◆ write_vsprintf() [1/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
size_t stdex::stream::basic::write_vsprintf (_Printf_format_string_params_(2) const char * format,
locale_t locale,
va_list params 
)
+
+inline
+
+ +

Writes formatted string to the stream.

+
Returns
Number of characters written
+ +
+
+ +

◆ write_vsprintf() [2/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
size_t stdex::stream::basic::write_vsprintf (_Printf_format_string_params_(2) const wchar_t * format,
locale_t locale,
va_list params 
)
+
+inline
+
+ +

Writes formatted string to the stream.

+
Returns
Number of characters written
+ +
+
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/classstdex_1_1stream_1_1basic.png b/classstdex_1_1stream_1_1basic.png new file mode 100644 index 000000000..f48c0e9ac Binary files /dev/null and b/classstdex_1_1stream_1_1basic.png differ diff --git a/classstdex_1_1stream_1_1basic__file-members.html b/classstdex_1_1stream_1_1basic__file-members.html new file mode 100644 index 000000000..809cf3ec4 --- /dev/null +++ b/classstdex_1_1stream_1_1basic__file-members.html @@ -0,0 +1,159 @@ + + + + + + + +stdex: Member List + + + + + + + + + +
+
+ + + + + + +
+
stdex +
+
Additional custom or not Standard C++ covered algorithms
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
stdex::stream::basic_file Member List
+
+
+ +

This is the complete list of members for stdex::stream::basic_file, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
atime() conststdex::stream::basic_fileinlinevirtual
basic(state_t state=state_t::ok) (defined in stdex::stream::basic)stdex::stream::basicinline
close()stdex::stream::basicinlinevirtual
ctime() conststdex::stream::basic_fileinlinevirtual
flush()stdex::stream::basicinlinevirtual
lock(fpos_t offset, fsize_t length)stdex::stream::basic_fileinlinevirtual
m_state (defined in stdex::stream::basic)stdex::stream::basicprotected
mtime() conststdex::stream::basic_fileinlinevirtual
ok() conststdex::stream::basicinline
operator<<(const int8_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const int16_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const int32_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const int64_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint8_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint16_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint32_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint64_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const float data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const double data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const char data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const T *data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int8_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int16_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int32_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int64_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint8_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint16_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint32_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint64_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(float &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(double &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(char &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(std::basic_string< _Elem, _Traits, _Ax > &data) (defined in stdex::stream::basic)stdex::stream::basicinline
read(_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)stdex::stream::basicinlinevirtual
read_array(_Out_writes_bytes_(size *count) void *array, size_t size, size_t count)stdex::stream::basicinline
read_byte()stdex::stream::basicinline
read_charset(charset_id default_charset=charset_id::default)stdex::stream::basic_fileinline
read_data(T &data)stdex::stream::basicinline
read_remainder(size_t max_length=SIZE_MAX)stdex::stream::basic_fileinlinevirtual
read_str(std::basic_string< _Elem, _Traits, _Ax > &data)stdex::stream::basicinline
readln(std::basic_string< char, _Traits, _Ax > &str)stdex::stream::basicinline
readln(std::basic_string< wchar_t, _Traits, _Ax > &wstr)stdex::stream::basicinline
readln(std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)stdex::stream::basicinline
readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline
readln_and_attach(std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)stdex::stream::basicinline
seek(foff_t offset, seek_t how=seek_t::beg)=0stdex::stream::basic_filepure virtual
seekbeg(fpos_t offset)stdex::stream::basic_fileinline
seekcur(foff_t offset)stdex::stream::basic_fileinline
seekend(foff_t offset)stdex::stream::basic_fileinline
set_atime(time_point date)stdex::stream::basic_fileinlinevirtual
set_ctime(time_point date)stdex::stream::basic_fileinlinevirtual
set_mtime(time_point date)stdex::stream::basic_fileinlinevirtual
size()=0stdex::stream::basic_filepure virtual
skip(fsize_t amount)stdex::stream::basic_fileinlinevirtual
state() conststdex::stream::basicinline
tell() const =0stdex::stream::basic_filepure virtual
truncate()=0stdex::stream::basic_filepure virtual
unlock(fpos_t offset, fsize_t length)stdex::stream::basic_fileinlinevirtual
write(_In_reads_bytes_opt_(length) const void *data, size_t length)stdex::stream::basicinlinevirtual
write_array(_In_reads_bytes_opt_(size *count) const void *array, size_t size, size_t count)stdex::stream::basicinline
write_array(_In_reads_or_z_opt_(num_chars) const wchar_t *wstr, size_t num_chars, charset_id charset)stdex::stream::basicinline
write_byte(uint8_t byte, fsize_t amount=1)stdex::stream::basicinline
write_charset(charset_id charset)stdex::stream::basicinline
write_data(const T data)stdex::stream::basicinline
write_sprintf(_Printf_format_string_params_(2) const char *format, locale_t locale,...)stdex::stream::basicinline
write_sprintf(_Printf_format_string_params_(2) const wchar_t *format, locale_t locale,...)stdex::stream::basicinline
write_str(const T *data)stdex::stream::basicinline
write_stream(basic &stream, fsize_t amount=fsize_max)stdex::stream::basicinline
write_vsprintf(_Printf_format_string_params_(2) const char *format, locale_t locale, va_list params)stdex::stream::basicinline
write_vsprintf(_Printf_format_string_params_(2) const wchar_t *format, locale_t locale, va_list params)stdex::stream::basicinline
+ + + + diff --git a/classstdex_1_1stream_1_1basic__file.html b/classstdex_1_1stream_1_1basic__file.html new file mode 100644 index 000000000..19a502a09 --- /dev/null +++ b/classstdex_1_1stream_1_1basic__file.html @@ -0,0 +1,932 @@ + + + + + + + +stdex: stdex::stream::basic_file Class Reference + + + + + + + + + +
+
+ + + + + + +
+
stdex +
+
Additional custom or not Standard C++ covered algorithms
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
+Public Member Functions | +List of all members
+
stdex::stream::basic_file Class Referenceabstract
+
+
+ +

Basic seekable stream operations. + More...

+ +

#include <stdex/stream.hpp>

+
+Inheritance diagram for stdex::stream::basic_file:
+
+
+ + +stdex::stream::basic +stdex::stream::cache +stdex::stream::diag_file +stdex::stream::file +stdex::stream::file_window +stdex::stream::memory_file +stdex::stream::cached_file + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

virtual std::vector< uint8_t > read_remainder (size_t max_length=SIZE_MAX)
 Reads and returns remainder of the stream.
 
virtual fpos_t seek (foff_t offset, seek_t how=seek_t::beg)=0
 Seeks to specified relative file position.
 
fpos_t seekbeg (fpos_t offset)
 Seeks to absolute file position.
 
fpos_t seekcur (foff_t offset)
 Seeks to relative from current file position.
 
fpos_t seekend (foff_t offset)
 Seeks to relative from end file position.
 
virtual void skip (fsize_t amount)
 Skips given amount of bytes of data on the stream.
 
virtual fpos_t tell () const =0
 Returns absolute file position in file or fpos_max if fails. This method does not update stream state.
 
virtual void lock (fpos_t offset, fsize_t length)
 Locks file section for exclusive access.
 
virtual void unlock (fpos_t offset, fsize_t length)
 Unlocks file section for exclusive access.
 
virtual fsize_t size ()=0
 Returns file size Should the file size cannot be determined, the method returns fsize_max and it does not reset the state to failed.
 
virtual void truncate ()=0
 Sets file size - truncates the remainder of file content from the current file position to the end of file.
 
virtual time_point ctime () const
 Returns file creation time.
 
virtual time_point atime () const
 Returns file access time.
 
virtual time_point mtime () const
 Returns file modification time.
 
virtual void set_ctime (time_point date)
 Sets file create time.
 
virtual void set_atime (time_point date)
 Sets file access time.
 
virtual void set_mtime (time_point date)
 Sets file modification time.
 
charset_id read_charset (charset_id default_charset=charset_id::default)
 Attempts to detect textfile charset based on UTF16 or UTF8 BOM.
 
- Public Member Functions inherited from stdex::stream::basic
basic (state_t state=state_t::ok)
 
virtual size_t read (_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
 Reads block of data from the stream.
 
virtual size_t write (_In_reads_bytes_opt_(length) const void *data, size_t length)
 Writes block of data to the stream.
 
virtual void flush ()
 Persists volatile element data.
 
virtual void close ()
 Closes the stream.
 
virtual void skip (fsize_t amount)
 Skips given amount of bytes of data on the stream.
 
+state_t state () const
 Returns stream state after last operation.
 
+bool ok () const
 Returns true if the stream state is clean i.e. previous operation was succesful.
 
virtual std::vector< uint8_t > read_remainder (size_t max_length=SIZE_MAX)
 Reads and returns remainder of the stream.
 
+uint8_t read_byte ()
 Reads one byte of data.
 
+void write_byte (uint8_t byte, fsize_t amount=1)
 Writes a byte of data.
 
template<class T >
basicread_data (T &data)
 Reads one primitive data type.
 
template<class T >
basicwrite_data (const T data)
 Writes one primitive data type.
 
template<class _Traits = std::char_traits<char>, class _Ax = std::allocator<char>>
size_t readln (std::basic_string< char, _Traits, _Ax > &str)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln (std::basic_string< wchar_t, _Traits, _Ax > &wstr)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln (std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
size_t readln_and_attach (std::basic_string< _Elem, _Traits, _Ax > &str)
 Reads stream to the end-of-line or end-of-file and append to str.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln_and_attach (std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)
 Reads stream to the end-of-line or end-of-file and append to str.
 
size_t read_array (_Out_writes_bytes_(size *count) void *array, size_t size, size_t count)
 Reads an array of data from the stream.
 
size_t write_array (_In_reads_bytes_opt_(size *count) const void *array, size_t size, size_t count)
 Writes an array of data to the stream.
 
size_t write_array (_In_reads_or_z_opt_(num_chars) const wchar_t *wstr, size_t num_chars, charset_id charset)
 Writes array of characters to the stream.
 
template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
basicread_str (std::basic_string< _Elem, _Traits, _Ax > &data)
 Reads length-prefixed string from the stream.
 
template<class T >
basicwrite_str (const T *data)
 Writes string to the stream length-prefixed.
 
fsize_t write_stream (basic &stream, fsize_t amount=fsize_max)
 Writes content of another stream.
 
+void write_charset (charset_id charset)
 Writes UTF8 or UTF-16 byte-order-mark.
 
size_t write_sprintf (_Printf_format_string_params_(2) const char *format, locale_t locale,...)
 Writes formatted string to the stream.
 
size_t write_sprintf (_Printf_format_string_params_(2) const wchar_t *format, locale_t locale,...)
 Writes formatted string to the stream.
 
size_t write_vsprintf (_Printf_format_string_params_(2) const char *format, locale_t locale, va_list params)
 Writes formatted string to the stream.
 
size_t write_vsprintf (_Printf_format_string_params_(2) const wchar_t *format, locale_t locale, va_list params)
 Writes formatted string to the stream.
 
+basicoperator>> (int8_t &data)
 
+basicoperator<< (const int8_t data)
 
+basicoperator>> (int16_t &data)
 
+basicoperator<< (const int16_t data)
 
+basicoperator>> (int32_t &data)
 
+basicoperator<< (const int32_t data)
 
+basicoperator>> (int64_t &data)
 
+basicoperator<< (const int64_t data)
 
+basicoperator>> (uint8_t &data)
 
+basicoperator<< (const uint8_t data)
 
+basicoperator>> (uint16_t &data)
 
+basicoperator<< (const uint16_t data)
 
+basicoperator>> (uint32_t &data)
 
+basicoperator<< (const uint32_t data)
 
+basicoperator>> (uint64_t &data)
 
+basicoperator<< (const uint64_t data)
 
+basicoperator>> (float &data)
 
+basicoperator<< (const float data)
 
+basicoperator>> (double &data)
 
+basicoperator<< (const double data)
 
+basicoperator>> (char &data)
 
+basicoperator<< (const char data)
 
+template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
basicoperator>> (std::basic_string< _Elem, _Traits, _Ax > &data)
 
+template<class T >
basicoperator<< (const T *data)
 
+ + + + +

+Additional Inherited Members

- Protected Attributes inherited from stdex::stream::basic
+state_t m_state
 
+

Detailed Description

+

Basic seekable stream operations.

+

Member Function Documentation

+ +

◆ atime()

+ +
+
+ + + + + +
+ + + + + + + +
virtual time_point stdex::stream::basic_file::atime () const
+
+inlinevirtual
+
+ +

Returns file access time.

+ +

Reimplemented in stdex::stream::cache, and stdex::stream::file.

+ +
+
+ +

◆ ctime()

+ +
+
+ + + + + +
+ + + + + + + +
virtual time_point stdex::stream::basic_file::ctime () const
+
+inlinevirtual
+
+ +

Returns file creation time.

+ +

Reimplemented in stdex::stream::cache, and stdex::stream::file.

+ +
+
+ +

◆ lock()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual void stdex::stream::basic_file::lock (fpos_t offset,
fsize_t length 
)
+
+inlinevirtual
+
+ +

Locks file section for exclusive access.

+ +

Reimplemented in stdex::stream::file_window, stdex::stream::cache, stdex::stream::file, and stdex::stream::diag_file.

+ +
+
+ +

◆ mtime()

+ +
+
+ + + + + +
+ + + + + + + +
virtual time_point stdex::stream::basic_file::mtime () const
+
+inlinevirtual
+
+ +

Returns file modification time.

+ +

Reimplemented in stdex::stream::cache, and stdex::stream::file.

+ +
+
+ +

◆ read_charset()

+ +
+
+ + + + + +
+ + + + + + + + +
charset_id stdex::stream::basic_file::read_charset (charset_id default_charset = charset_id::default)
+
+inline
+
+ +

Attempts to detect textfile charset based on UTF16 or UTF8 BOM.

+
Parameters
+ + +
[in]default_charsetFallback charset to return when no BOM detected.
+
+
+ +
+
+ +

◆ read_remainder()

+ +
+
+ + + + + +
+ + + + + + + + +
virtual std::vector< uint8_t > stdex::stream::basic_file::read_remainder (size_t max_length = SIZE_MAX)
+
+inlinevirtual
+
+ +

Reads and returns remainder of the stream.

+
Parameters
+ + +
[in]max_lengthByte limit of data to read
+
+
+
Returns
Data read
+ +

Reimplemented from stdex::stream::basic.

+ +
+
+ +

◆ seek()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual fpos_t stdex::stream::basic_file::seek (foff_t offset,
seek_t how = seek_t::beg 
)
+
+pure virtual
+
+ +

Seeks to specified relative file position.

+
Returns
Absolute file position after seek, or fpos_max if seek failed.
+ +

Implemented in stdex::stream::file_window, stdex::stream::cache, stdex::stream::file, stdex::stream::memory_file, and stdex::stream::diag_file.

+ +
+
+ +

◆ seekbeg()

+ +
+
+ + + + + +
+ + + + + + + + +
fpos_t stdex::stream::basic_file::seekbeg (fpos_t offset)
+
+inline
+
+ +

Seeks to absolute file position.

+
Returns
Absolute file position after seek
+ +
+
+ +

◆ seekcur()

+ +
+
+ + + + + +
+ + + + + + + + +
fpos_t stdex::stream::basic_file::seekcur (foff_t offset)
+
+inline
+
+ +

Seeks to relative from current file position.

+
Returns
Absolute file position after seek
+ +
+
+ +

◆ seekend()

+ +
+
+ + + + + +
+ + + + + + + + +
fpos_t stdex::stream::basic_file::seekend (foff_t offset)
+
+inline
+
+ +

Seeks to relative from end file position.

+
Returns
Absolute file position after seek
+ +
+
+ +

◆ set_atime()

+ +
+
+ + + + + +
+ + + + + + + + +
virtual void stdex::stream::basic_file::set_atime (time_point date)
+
+inlinevirtual
+
+ +

Sets file access time.

+ +

Reimplemented in stdex::stream::cache, and stdex::stream::file.

+ +
+
+ +

◆ set_ctime()

+ +
+
+ + + + + +
+ + + + + + + + +
virtual void stdex::stream::basic_file::set_ctime (time_point date)
+
+inlinevirtual
+
+ +

Sets file create time.

+ +

Reimplemented in stdex::stream::cache, and stdex::stream::file.

+ +
+
+ +

◆ set_mtime()

+ +
+
+ + + + + +
+ + + + + + + + +
virtual void stdex::stream::basic_file::set_mtime (time_point date)
+
+inlinevirtual
+
+ +

Sets file modification time.

+ +

Reimplemented in stdex::stream::cache, and stdex::stream::file.

+ +
+
+ +

◆ size()

+ +
+
+ + + + + +
+ + + + + + + +
virtual fsize_t stdex::stream::basic_file::size ()
+
+pure virtual
+
+ +

Returns file size Should the file size cannot be determined, the method returns fsize_max and it does not reset the state to failed.

+ +

Implemented in stdex::stream::file_window, stdex::stream::cache, stdex::stream::file, stdex::stream::memory_file, and stdex::stream::diag_file.

+ +
+
+ +

◆ skip()

+ +
+
+ + + + + +
+ + + + + + + + +
virtual void stdex::stream::basic_file::skip (fsize_t amount)
+
+inlinevirtual
+
+ +

Skips given amount of bytes of data on the stream.

+ +

Reimplemented from stdex::stream::basic.

+ +

Reimplemented in stdex::stream::file_window.

+ +
+
+ +

◆ tell()

+ +
+
+ + + + + +
+ + + + + + + +
virtual fpos_t stdex::stream::basic_file::tell () const
+
+pure virtual
+
+ +

Returns absolute file position in file or fpos_max if fails. This method does not update stream state.

+
Returns
Absolute file position or fpos_max if position cannot be determined.
+ +

Implemented in stdex::stream::file_window, stdex::stream::cache, stdex::stream::file, stdex::stream::memory_file, and stdex::stream::diag_file.

+ +
+
+ +

◆ truncate()

+ +
+
+ + + + + +
+ + + + + + + +
virtual void stdex::stream::basic_file::truncate ()
+
+pure virtual
+
+ +

Sets file size - truncates the remainder of file content from the current file position to the end of file.

+ +

Implemented in stdex::stream::file_window, stdex::stream::cache, stdex::stream::file, stdex::stream::memory_file, and stdex::stream::diag_file.

+ +
+
+ +

◆ unlock()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual void stdex::stream::basic_file::unlock (fpos_t offset,
fsize_t length 
)
+
+inlinevirtual
+
+ +

Unlocks file section for exclusive access.

+ +

Reimplemented in stdex::stream::file_window, stdex::stream::cache, stdex::stream::file, and stdex::stream::diag_file.

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/classstdex_1_1stream_1_1basic__file.png b/classstdex_1_1stream_1_1basic__file.png new file mode 100644 index 000000000..dbfabc793 Binary files /dev/null and b/classstdex_1_1stream_1_1basic__file.png differ diff --git a/classstdex_1_1stream_1_1basic__sys-members.html b/classstdex_1_1stream_1_1basic__sys-members.html new file mode 100644 index 000000000..66fd241cf --- /dev/null +++ b/classstdex_1_1stream_1_1basic__sys-members.html @@ -0,0 +1,155 @@ + + + + + + + +stdex: Member List + + + + + + + + + +
+
+ + + + + + +
+
stdex +
+
Additional custom or not Standard C++ covered algorithms
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
stdex::stream::basic_sys Member List
+
+
+ +

This is the complete list of members for stdex::stream::basic_sys, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
basic(state_t state=state_t::ok) (defined in stdex::stream::basic)stdex::stream::basicinline
basic_sys(sys_handle h=invalid_handle, state_t state=state_t::ok) (defined in stdex::stream::basic_sys)stdex::stream::basic_sysinline
close()stdex::stream::basic_sysinlinevirtual
stdex::sys_object::close(sys_handle h)stdex::sys_objectinlineprotectedstatic
duplicate(sys_handle h, bool inherit)stdex::sys_objectinlineprotectedstatic
flush()stdex::stream::basic_sysinlinevirtual
get() const noexceptstdex::sys_objectinline
m_h (defined in stdex::sys_object)stdex::sys_objectprotected
m_state (defined in stdex::stream::basic)stdex::stream::basicprotected
ok() conststdex::stream::basicinline
operator bool() const noexceptstdex::sys_objectinline
operator<<(const int8_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const int16_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const int32_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const int64_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint8_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint16_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint32_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint64_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const float data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const double data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const char data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const T *data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator=(const sys_object &other) (defined in stdex::sys_object)stdex::sys_objectinline
operator=(sys_object &&other) noexcept (defined in stdex::sys_object)stdex::sys_objectinline
operator>>(int8_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int16_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int32_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int64_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint8_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint16_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint32_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint64_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(float &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(double &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(char &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(std::basic_string< _Elem, _Traits, _Ax > &data) (defined in stdex::stream::basic)stdex::stream::basicinline
read(_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)stdex::stream::basic_sysinlinevirtual
read_array(_Out_writes_bytes_(size *count) void *array, size_t size, size_t count)stdex::stream::basicinline
read_byte()stdex::stream::basicinline
read_data(T &data)stdex::stream::basicinline
read_remainder(size_t max_length=SIZE_MAX)stdex::stream::basicinlinevirtual
read_str(std::basic_string< _Elem, _Traits, _Ax > &data)stdex::stream::basicinline
readln(std::basic_string< char, _Traits, _Ax > &str)stdex::stream::basicinline
readln(std::basic_string< wchar_t, _Traits, _Ax > &wstr)stdex::stream::basicinline
readln(std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)stdex::stream::basicinline
readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline
readln_and_attach(std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)stdex::stream::basicinline
skip(fsize_t amount)stdex::stream::basicinlinevirtual
state() conststdex::stream::basicinline
sys_object(sys_handle h=invalid_handle) (defined in stdex::sys_object)stdex::sys_objectinline
sys_object(const sys_object &other) (defined in stdex::sys_object)stdex::sys_objectinline
sys_object(sys_object &&other) noexcept (defined in stdex::sys_object)stdex::sys_objectinline
write(_In_reads_bytes_opt_(length) const void *data, size_t length)stdex::stream::basic_sysinlinevirtual
write_array(_In_reads_bytes_opt_(size *count) const void *array, size_t size, size_t count)stdex::stream::basicinline
write_array(_In_reads_or_z_opt_(num_chars) const wchar_t *wstr, size_t num_chars, charset_id charset)stdex::stream::basicinline
write_byte(uint8_t byte, fsize_t amount=1)stdex::stream::basicinline
write_charset(charset_id charset)stdex::stream::basicinline
write_data(const T data)stdex::stream::basicinline
write_sprintf(_Printf_format_string_params_(2) const char *format, locale_t locale,...)stdex::stream::basicinline
write_sprintf(_Printf_format_string_params_(2) const wchar_t *format, locale_t locale,...)stdex::stream::basicinline
write_str(const T *data)stdex::stream::basicinline
write_stream(basic &stream, fsize_t amount=fsize_max)stdex::stream::basicinline
write_vsprintf(_Printf_format_string_params_(2) const char *format, locale_t locale, va_list params)stdex::stream::basicinline
write_vsprintf(_Printf_format_string_params_(2) const wchar_t *format, locale_t locale, va_list params)stdex::stream::basicinline
~sys_object() (defined in stdex::sys_object)stdex::sys_objectinlinevirtual
+ + + + diff --git a/classstdex_1_1stream_1_1basic__sys.html b/classstdex_1_1stream_1_1basic__sys.html new file mode 100644 index 000000000..df4978940 --- /dev/null +++ b/classstdex_1_1stream_1_1basic__sys.html @@ -0,0 +1,507 @@ + + + + + + + +stdex: stdex::stream::basic_sys Class Reference + + + + + + + + + +
+
+ + + + + + +
+
stdex +
+
Additional custom or not Standard C++ covered algorithms
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
+Public Member Functions | +List of all members
+
stdex::stream::basic_sys Class Reference
+
+
+ +

OS data stream (file, pipe, socket...) + More...

+ +

#include <stdex/stream.hpp>

+
+Inheritance diagram for stdex::stream::basic_sys:
+
+
+ + +stdex::stream::basic +stdex::sys_object +stdex::stream::file + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

basic_sys (sys_handle h=invalid_handle, state_t state=state_t::ok)
 
virtual size_t read (_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
 Reads block of data from the stream.
 
virtual size_t write (_In_reads_bytes_opt_(length) const void *data, size_t length)
 Writes block of data to the stream.
 
virtual void close ()
 Closes the stream.
 
virtual void flush ()
 Persists volatile element data.
 
- Public Member Functions inherited from stdex::stream::basic
basic (state_t state=state_t::ok)
 
virtual size_t read (_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
 Reads block of data from the stream.
 
virtual size_t write (_In_reads_bytes_opt_(length) const void *data, size_t length)
 Writes block of data to the stream.
 
virtual void flush ()
 Persists volatile element data.
 
virtual void close ()
 Closes the stream.
 
virtual void skip (fsize_t amount)
 Skips given amount of bytes of data on the stream.
 
+state_t state () const
 Returns stream state after last operation.
 
+bool ok () const
 Returns true if the stream state is clean i.e. previous operation was succesful.
 
virtual std::vector< uint8_t > read_remainder (size_t max_length=SIZE_MAX)
 Reads and returns remainder of the stream.
 
+uint8_t read_byte ()
 Reads one byte of data.
 
+void write_byte (uint8_t byte, fsize_t amount=1)
 Writes a byte of data.
 
template<class T >
basicread_data (T &data)
 Reads one primitive data type.
 
template<class T >
basicwrite_data (const T data)
 Writes one primitive data type.
 
template<class _Traits = std::char_traits<char>, class _Ax = std::allocator<char>>
size_t readln (std::basic_string< char, _Traits, _Ax > &str)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln (std::basic_string< wchar_t, _Traits, _Ax > &wstr)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln (std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
size_t readln_and_attach (std::basic_string< _Elem, _Traits, _Ax > &str)
 Reads stream to the end-of-line or end-of-file and append to str.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln_and_attach (std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)
 Reads stream to the end-of-line or end-of-file and append to str.
 
size_t read_array (_Out_writes_bytes_(size *count) void *array, size_t size, size_t count)
 Reads an array of data from the stream.
 
size_t write_array (_In_reads_bytes_opt_(size *count) const void *array, size_t size, size_t count)
 Writes an array of data to the stream.
 
size_t write_array (_In_reads_or_z_opt_(num_chars) const wchar_t *wstr, size_t num_chars, charset_id charset)
 Writes array of characters to the stream.
 
template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
basicread_str (std::basic_string< _Elem, _Traits, _Ax > &data)
 Reads length-prefixed string from the stream.
 
template<class T >
basicwrite_str (const T *data)
 Writes string to the stream length-prefixed.
 
fsize_t write_stream (basic &stream, fsize_t amount=fsize_max)
 Writes content of another stream.
 
+void write_charset (charset_id charset)
 Writes UTF8 or UTF-16 byte-order-mark.
 
size_t write_sprintf (_Printf_format_string_params_(2) const char *format, locale_t locale,...)
 Writes formatted string to the stream.
 
size_t write_sprintf (_Printf_format_string_params_(2) const wchar_t *format, locale_t locale,...)
 Writes formatted string to the stream.
 
size_t write_vsprintf (_Printf_format_string_params_(2) const char *format, locale_t locale, va_list params)
 Writes formatted string to the stream.
 
size_t write_vsprintf (_Printf_format_string_params_(2) const wchar_t *format, locale_t locale, va_list params)
 Writes formatted string to the stream.
 
+basicoperator>> (int8_t &data)
 
+basicoperator<< (const int8_t data)
 
+basicoperator>> (int16_t &data)
 
+basicoperator<< (const int16_t data)
 
+basicoperator>> (int32_t &data)
 
+basicoperator<< (const int32_t data)
 
+basicoperator>> (int64_t &data)
 
+basicoperator<< (const int64_t data)
 
+basicoperator>> (uint8_t &data)
 
+basicoperator<< (const uint8_t data)
 
+basicoperator>> (uint16_t &data)
 
+basicoperator<< (const uint16_t data)
 
+basicoperator>> (uint32_t &data)
 
+basicoperator<< (const uint32_t data)
 
+basicoperator>> (uint64_t &data)
 
+basicoperator<< (const uint64_t data)
 
+basicoperator>> (float &data)
 
+basicoperator<< (const float data)
 
+basicoperator>> (double &data)
 
+basicoperator<< (const double data)
 
+basicoperator>> (char &data)
 
+basicoperator<< (const char data)
 
+template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
basicoperator>> (std::basic_string< _Elem, _Traits, _Ax > &data)
 
+template<class T >
basicoperator<< (const T *data)
 
- Public Member Functions inherited from stdex::sys_object
sys_object (sys_handle h=invalid_handle)
 
sys_object (const sys_object &other)
 
+sys_objectoperator= (const sys_object &other)
 
sys_object (sys_object &&other) noexcept
 
+sys_objectoperator= (sys_object &&other) noexcept
 
virtual void close ()
 Closes object.
 
operator bool () const noexcept
 Returns true if object is valid.
 
+sys_handle get () const noexcept
 Returns object handle.
 
+ + + + + + + + + + + + + + +

+Additional Inherited Members

- Static Protected Member Functions inherited from stdex::sys_object
+static void close (sys_handle h)
 Closes object.
 
+static sys_handle duplicate (sys_handle h, bool inherit)
 Duplicates given object.
 
- Protected Attributes inherited from stdex::stream::basic
+state_t m_state
 
- Protected Attributes inherited from stdex::sys_object
+sys_handle m_h
 
+

Detailed Description

+

OS data stream (file, pipe, socket...)

+

Member Function Documentation

+ +

◆ close()

+ +
+
+ + + + + +
+ + + + + + + +
virtual void stdex::stream::basic_sys::close ()
+
+inlinevirtual
+
+ +

Closes the stream.

+ +

Reimplemented from stdex::stream::basic.

+ +
+
+ +

◆ flush()

+ +
+
+ + + + + +
+ + + + + + + +
virtual void stdex::stream::basic_sys::flush ()
+
+inlinevirtual
+
+ +

Persists volatile element data.

+ +

Reimplemented from stdex::stream::basic.

+ +
+
+ +

◆ read()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual size_t stdex::stream::basic_sys::read (_Out_writes_bytes_to_opt_(length, return) void * data,
size_t length 
)
+
+inlinevirtual
+
+ +

Reads block of data from the stream.

+
Parameters
+ + + +
[out]dataBuffer to store read data
[in]lengthByte limit of data to read
+
+
+
Returns
Number of bytes succesfully read. On EOF, 0 is returned and stream state is set to state_t::eof. On error, 0 is returned and stream state is set to state_t::fail. On null reads (length == 0), 0 is returned and stream state is set to state_t::ok.
+ +

Reimplemented from stdex::stream::basic.

+ +
+
+ +

◆ write()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual size_t stdex::stream::basic_sys::write (_In_reads_bytes_opt_(length) const void * data,
size_t length 
)
+
+inlinevirtual
+
+ +

Writes block of data to the stream.

+
Parameters
+ + + +
[in]dataBuffer to write data from
[in]lengthNumber of bytes to write
+
+
+
Returns
Number of bytes succesfully written. On error, stream state is set to state_t::fail.
+ +

Reimplemented from stdex::stream::basic.

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/classstdex_1_1stream_1_1basic__sys.png b/classstdex_1_1stream_1_1basic__sys.png new file mode 100644 index 000000000..e96ec2646 Binary files /dev/null and b/classstdex_1_1stream_1_1basic__sys.png differ diff --git a/classstdex_1_1stream_1_1buffer-members.html b/classstdex_1_1stream_1_1buffer-members.html new file mode 100644 index 000000000..38c13d190 --- /dev/null +++ b/classstdex_1_1stream_1_1buffer-members.html @@ -0,0 +1,153 @@ + + + + + + + +stdex: Member List + + + + + + + + + +
+
+ + + + + + +
+
stdex +
+
Additional custom or not Standard C++ covered algorithms
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
stdex::stream::buffer Member List
+
+
+ +

This is the complete list of members for stdex::stream::buffer, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
basic(state_t state=state_t::ok) (defined in stdex::stream::basic)stdex::stream::basicinline
buffer(size_t read_buffer_size=default_buffer_size, size_t write_buffer_size=default_buffer_size) (defined in stdex::stream::buffer)stdex::stream::bufferinlineexplicitprotected
buffer(basic &source, size_t read_buffer_size=default_buffer_size, size_t write_buffer_size=default_buffer_size) (defined in stdex::stream::buffer)stdex::stream::bufferinline
close()stdex::stream::converterinlinevirtual
converter() (defined in stdex::stream::converter)stdex::stream::converterinlineexplicitprotected
converter(basic &source) (defined in stdex::stream::converter)stdex::stream::converterinline
flush()stdex::stream::bufferinlinevirtual
flush_write() (defined in stdex::stream::buffer)stdex::stream::bufferinlineprotected
init(basic &source) (defined in stdex::stream::converter)stdex::stream::converterinlineprotected
m_read_buffer (defined in stdex::stream::buffer)stdex::stream::bufferprotected
m_source (defined in stdex::stream::converter)stdex::stream::converterprotected
m_state (defined in stdex::stream::basic)stdex::stream::basicprotected
m_write_buffer (defined in stdex::stream::buffer)stdex::stream::bufferprotected
ok() conststdex::stream::basicinline
operator<<(const int8_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const int16_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const int32_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const int64_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint8_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint16_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint32_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint64_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const float data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const double data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const char data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const T *data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int8_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int16_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int32_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int64_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint8_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint16_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint32_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint64_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(float &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(double &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(char &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(std::basic_string< _Elem, _Traits, _Ax > &data) (defined in stdex::stream::basic)stdex::stream::basicinline
read(_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)stdex::stream::bufferinlinevirtual
read_array(_Out_writes_bytes_(size *count) void *array, size_t size, size_t count)stdex::stream::basicinline
read_byte()stdex::stream::basicinline
read_data(T &data)stdex::stream::basicinline
read_remainder(size_t max_length=SIZE_MAX)stdex::stream::basicinlinevirtual
read_str(std::basic_string< _Elem, _Traits, _Ax > &data)stdex::stream::basicinline
readln(std::basic_string< char, _Traits, _Ax > &str)stdex::stream::basicinline
readln(std::basic_string< wchar_t, _Traits, _Ax > &wstr)stdex::stream::basicinline
readln(std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)stdex::stream::basicinline
readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline
readln_and_attach(std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)stdex::stream::basicinline
skip(fsize_t amount)stdex::stream::basicinlinevirtual
state() conststdex::stream::basicinline
write(_In_reads_bytes_opt_(length) const void *data, size_t length)stdex::stream::bufferinlinevirtual
write_array(_In_reads_bytes_opt_(size *count) const void *array, size_t size, size_t count)stdex::stream::basicinline
write_array(_In_reads_or_z_opt_(num_chars) const wchar_t *wstr, size_t num_chars, charset_id charset)stdex::stream::basicinline
write_byte(uint8_t byte, fsize_t amount=1)stdex::stream::basicinline
write_charset(charset_id charset)stdex::stream::basicinline
write_data(const T data)stdex::stream::basicinline
write_sprintf(_Printf_format_string_params_(2) const char *format, locale_t locale,...)stdex::stream::basicinline
write_sprintf(_Printf_format_string_params_(2) const wchar_t *format, locale_t locale,...)stdex::stream::basicinline
write_str(const T *data)stdex::stream::basicinline
write_stream(basic &stream, fsize_t amount=fsize_max)stdex::stream::basicinline
write_vsprintf(_Printf_format_string_params_(2) const char *format, locale_t locale, va_list params)stdex::stream::basicinline
write_vsprintf(_Printf_format_string_params_(2) const wchar_t *format, locale_t locale, va_list params)stdex::stream::basicinline
~buffer() (defined in stdex::stream::buffer)stdex::stream::bufferinlinevirtual
+ + + + diff --git a/classstdex_1_1stream_1_1buffer.html b/classstdex_1_1stream_1_1buffer.html new file mode 100644 index 000000000..127883dc7 --- /dev/null +++ b/classstdex_1_1stream_1_1buffer.html @@ -0,0 +1,482 @@ + + + + + + + +stdex: stdex::stream::buffer Class Reference + + + + + + + + + +
+
+ + + + + + +
+
stdex +
+
Additional custom or not Standard C++ covered algorithms
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
+Classes | +Public Member Functions | +Protected Member Functions | +Protected Attributes | +List of all members
+
stdex::stream::buffer Class Reference
+
+
+ +

Buffered read/write stream. + More...

+ +

#include <stdex/stream.hpp>

+
+Inheritance diagram for stdex::stream::buffer:
+
+
+ + +stdex::stream::converter +stdex::stream::basic +stdex::stream::buffered_sys + +
+ + + + +

+Classes

struct  buffer_t
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

buffer (basic &source, size_t read_buffer_size=default_buffer_size, size_t write_buffer_size=default_buffer_size)
 
virtual size_t read (_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
 Reads block of data from the stream.
 
virtual size_t write (_In_reads_bytes_opt_(length) const void *data, size_t length)
 Writes block of data to the stream.
 
virtual void flush ()
 Persists volatile element data.
 
- Public Member Functions inherited from stdex::stream::converter
converter (basic &source)
 
virtual size_t read (_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
 Reads block of data from the stream.
 
virtual size_t write (_In_reads_bytes_opt_(length) const void *data, size_t length)
 Writes block of data to the stream.
 
virtual void close ()
 Closes the stream.
 
virtual void flush ()
 Persists volatile element data.
 
- Public Member Functions inherited from stdex::stream::basic
basic (state_t state=state_t::ok)
 
virtual size_t read (_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
 Reads block of data from the stream.
 
virtual size_t write (_In_reads_bytes_opt_(length) const void *data, size_t length)
 Writes block of data to the stream.
 
virtual void flush ()
 Persists volatile element data.
 
virtual void close ()
 Closes the stream.
 
virtual void skip (fsize_t amount)
 Skips given amount of bytes of data on the stream.
 
+state_t state () const
 Returns stream state after last operation.
 
+bool ok () const
 Returns true if the stream state is clean i.e. previous operation was succesful.
 
virtual std::vector< uint8_t > read_remainder (size_t max_length=SIZE_MAX)
 Reads and returns remainder of the stream.
 
+uint8_t read_byte ()
 Reads one byte of data.
 
+void write_byte (uint8_t byte, fsize_t amount=1)
 Writes a byte of data.
 
template<class T >
basicread_data (T &data)
 Reads one primitive data type.
 
template<class T >
basicwrite_data (const T data)
 Writes one primitive data type.
 
template<class _Traits = std::char_traits<char>, class _Ax = std::allocator<char>>
size_t readln (std::basic_string< char, _Traits, _Ax > &str)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln (std::basic_string< wchar_t, _Traits, _Ax > &wstr)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln (std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
size_t readln_and_attach (std::basic_string< _Elem, _Traits, _Ax > &str)
 Reads stream to the end-of-line or end-of-file and append to str.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln_and_attach (std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)
 Reads stream to the end-of-line or end-of-file and append to str.
 
size_t read_array (_Out_writes_bytes_(size *count) void *array, size_t size, size_t count)
 Reads an array of data from the stream.
 
size_t write_array (_In_reads_bytes_opt_(size *count) const void *array, size_t size, size_t count)
 Writes an array of data to the stream.
 
size_t write_array (_In_reads_or_z_opt_(num_chars) const wchar_t *wstr, size_t num_chars, charset_id charset)
 Writes array of characters to the stream.
 
template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
basicread_str (std::basic_string< _Elem, _Traits, _Ax > &data)
 Reads length-prefixed string from the stream.
 
template<class T >
basicwrite_str (const T *data)
 Writes string to the stream length-prefixed.
 
fsize_t write_stream (basic &stream, fsize_t amount=fsize_max)
 Writes content of another stream.
 
+void write_charset (charset_id charset)
 Writes UTF8 or UTF-16 byte-order-mark.
 
size_t write_sprintf (_Printf_format_string_params_(2) const char *format, locale_t locale,...)
 Writes formatted string to the stream.
 
size_t write_sprintf (_Printf_format_string_params_(2) const wchar_t *format, locale_t locale,...)
 Writes formatted string to the stream.
 
size_t write_vsprintf (_Printf_format_string_params_(2) const char *format, locale_t locale, va_list params)
 Writes formatted string to the stream.
 
size_t write_vsprintf (_Printf_format_string_params_(2) const wchar_t *format, locale_t locale, va_list params)
 Writes formatted string to the stream.
 
+basicoperator>> (int8_t &data)
 
+basicoperator<< (const int8_t data)
 
+basicoperator>> (int16_t &data)
 
+basicoperator<< (const int16_t data)
 
+basicoperator>> (int32_t &data)
 
+basicoperator<< (const int32_t data)
 
+basicoperator>> (int64_t &data)
 
+basicoperator<< (const int64_t data)
 
+basicoperator>> (uint8_t &data)
 
+basicoperator<< (const uint8_t data)
 
+basicoperator>> (uint16_t &data)
 
+basicoperator<< (const uint16_t data)
 
+basicoperator>> (uint32_t &data)
 
+basicoperator<< (const uint32_t data)
 
+basicoperator>> (uint64_t &data)
 
+basicoperator<< (const uint64_t data)
 
+basicoperator>> (float &data)
 
+basicoperator<< (const float data)
 
+basicoperator>> (double &data)
 
+basicoperator<< (const double data)
 
+basicoperator>> (char &data)
 
+basicoperator<< (const char data)
 
+template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
basicoperator>> (std::basic_string< _Elem, _Traits, _Ax > &data)
 
+template<class T >
basicoperator<< (const T *data)
 
+ + + + + + + + +

+Protected Member Functions

buffer (size_t read_buffer_size=default_buffer_size, size_t write_buffer_size=default_buffer_size)
 
+void flush_write ()
 
- Protected Member Functions inherited from stdex::stream::converter
+void init (basic &source)
 
+ + + + + + + + + + + +

+Protected Attributes

+struct stdex::stream::buffer::buffer_t m_read_buffer
 
+struct stdex::stream::buffer::buffer_t m_write_buffer
 
- Protected Attributes inherited from stdex::stream::converter
+basicm_source
 
- Protected Attributes inherited from stdex::stream::basic
+state_t m_state
 
+

Detailed Description

+

Buffered read/write stream.

+

Member Function Documentation

+ +

◆ flush()

+ +
+
+ + + + + +
+ + + + + + + +
virtual void stdex::stream::buffer::flush ()
+
+inlinevirtual
+
+ +

Persists volatile element data.

+ +

Reimplemented from stdex::stream::converter.

+ +
+
+ +

◆ read()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual size_t stdex::stream::buffer::read (_Out_writes_bytes_to_opt_(length, return) void * data,
size_t length 
)
+
+inlinevirtual
+
+ +

Reads block of data from the stream.

+
Parameters
+ + + +
[out]dataBuffer to store read data
[in]lengthByte limit of data to read
+
+
+
Returns
Number of bytes succesfully read. On EOF, 0 is returned and stream state is set to state_t::eof. On error, 0 is returned and stream state is set to state_t::fail. On null reads (length == 0), 0 is returned and stream state is set to state_t::ok.
+ +

Reimplemented from stdex::stream::converter.

+ +
+
+ +

◆ write()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual size_t stdex::stream::buffer::write (_In_reads_bytes_opt_(length) const void * data,
size_t length 
)
+
+inlinevirtual
+
+ +

Writes block of data to the stream.

+
Parameters
+ + + +
[in]dataBuffer to write data from
[in]lengthNumber of bytes to write
+
+
+
Returns
Number of bytes succesfully written. On error, stream state is set to state_t::fail.
+ +

Reimplemented from stdex::stream::converter.

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/classstdex_1_1stream_1_1buffer.png b/classstdex_1_1stream_1_1buffer.png new file mode 100644 index 000000000..3757e43a2 Binary files /dev/null and b/classstdex_1_1stream_1_1buffer.png differ diff --git a/classstdex_1_1stream_1_1buffered__sys-members.html b/classstdex_1_1stream_1_1buffered__sys-members.html new file mode 100644 index 000000000..2041d069a --- /dev/null +++ b/classstdex_1_1stream_1_1buffered__sys-members.html @@ -0,0 +1,154 @@ + + + + + + + +stdex: Member List + + + + + + + + + +
+
+ + + + + + +
+
stdex +
+
Additional custom or not Standard C++ covered algorithms
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
stdex::stream::buffered_sys Member List
+
+
+ +

This is the complete list of members for stdex::stream::buffered_sys, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
basic(state_t state=state_t::ok) (defined in stdex::stream::basic)stdex::stream::basicinline
buffer(size_t read_buffer_size=default_buffer_size, size_t write_buffer_size=default_buffer_size) (defined in stdex::stream::buffer)stdex::stream::bufferinlineexplicitprotected
buffer(basic &source, size_t read_buffer_size=default_buffer_size, size_t write_buffer_size=default_buffer_size) (defined in stdex::stream::buffer)stdex::stream::bufferinline
buffered_sys(sys_handle h=invalid_handle, size_t read_buffer_size=default_buffer_size, size_t write_buffer_size=default_buffer_size) (defined in stdex::stream::buffered_sys)stdex::stream::buffered_sysinline
close()stdex::stream::converterinlinevirtual
converter() (defined in stdex::stream::converter)stdex::stream::converterinlineexplicitprotected
converter(basic &source) (defined in stdex::stream::converter)stdex::stream::converterinline
flush()stdex::stream::bufferinlinevirtual
flush_write() (defined in stdex::stream::buffer)stdex::stream::bufferinlineprotected
init(basic &source) (defined in stdex::stream::converter)stdex::stream::converterinlineprotected
m_read_buffer (defined in stdex::stream::buffer)stdex::stream::bufferprotected
m_source (defined in stdex::stream::buffered_sys)stdex::stream::buffered_sysprotected
m_state (defined in stdex::stream::basic)stdex::stream::basicprotected
m_write_buffer (defined in stdex::stream::buffer)stdex::stream::bufferprotected
ok() conststdex::stream::basicinline
operator<<(const int8_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const int16_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const int32_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const int64_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint8_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint16_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint32_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint64_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const float data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const double data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const char data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const T *data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int8_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int16_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int32_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int64_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint8_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint16_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint32_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint64_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(float &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(double &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(char &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(std::basic_string< _Elem, _Traits, _Ax > &data) (defined in stdex::stream::basic)stdex::stream::basicinline
read(_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)stdex::stream::bufferinlinevirtual
read_array(_Out_writes_bytes_(size *count) void *array, size_t size, size_t count)stdex::stream::basicinline
read_byte()stdex::stream::basicinline
read_data(T &data)stdex::stream::basicinline
read_remainder(size_t max_length=SIZE_MAX)stdex::stream::basicinlinevirtual
read_str(std::basic_string< _Elem, _Traits, _Ax > &data)stdex::stream::basicinline
readln(std::basic_string< char, _Traits, _Ax > &str)stdex::stream::basicinline
readln(std::basic_string< wchar_t, _Traits, _Ax > &wstr)stdex::stream::basicinline
readln(std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)stdex::stream::basicinline
readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline
readln_and_attach(std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)stdex::stream::basicinline
skip(fsize_t amount)stdex::stream::basicinlinevirtual
state() conststdex::stream::basicinline
write(_In_reads_bytes_opt_(length) const void *data, size_t length)stdex::stream::bufferinlinevirtual
write_array(_In_reads_bytes_opt_(size *count) const void *array, size_t size, size_t count)stdex::stream::basicinline
write_array(_In_reads_or_z_opt_(num_chars) const wchar_t *wstr, size_t num_chars, charset_id charset)stdex::stream::basicinline
write_byte(uint8_t byte, fsize_t amount=1)stdex::stream::basicinline
write_charset(charset_id charset)stdex::stream::basicinline
write_data(const T data)stdex::stream::basicinline
write_sprintf(_Printf_format_string_params_(2) const char *format, locale_t locale,...)stdex::stream::basicinline
write_sprintf(_Printf_format_string_params_(2) const wchar_t *format, locale_t locale,...)stdex::stream::basicinline
write_str(const T *data)stdex::stream::basicinline
write_stream(basic &stream, fsize_t amount=fsize_max)stdex::stream::basicinline
write_vsprintf(_Printf_format_string_params_(2) const char *format, locale_t locale, va_list params)stdex::stream::basicinline
write_vsprintf(_Printf_format_string_params_(2) const wchar_t *format, locale_t locale, va_list params)stdex::stream::basicinline
~buffer() (defined in stdex::stream::buffer)stdex::stream::bufferinlinevirtual
+ + + + diff --git a/classstdex_1_1stream_1_1buffered__sys.html b/classstdex_1_1stream_1_1buffered__sys.html new file mode 100644 index 000000000..ef698c18f --- /dev/null +++ b/classstdex_1_1stream_1_1buffered__sys.html @@ -0,0 +1,358 @@ + + + + + + + +stdex: stdex::stream::buffered_sys Class Reference + + + + + + + + + +
+
+ + + + + + +
+
stdex +
+
Additional custom or not Standard C++ covered algorithms
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
+Public Member Functions | +Protected Attributes | +List of all members
+
stdex::stream::buffered_sys Class Reference
+
+
+ +

Buffered OS data stream (file, pipe, socket...) + More...

+ +

#include <stdex/stream.hpp>

+
+Inheritance diagram for stdex::stream::buffered_sys:
+
+
+ + +stdex::stream::buffer +stdex::stream::converter +stdex::stream::basic + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

buffered_sys (sys_handle h=invalid_handle, size_t read_buffer_size=default_buffer_size, size_t write_buffer_size=default_buffer_size)
 
- Public Member Functions inherited from stdex::stream::buffer
buffer (basic &source, size_t read_buffer_size=default_buffer_size, size_t write_buffer_size=default_buffer_size)
 
virtual size_t read (_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
 Reads block of data from the stream.
 
virtual size_t write (_In_reads_bytes_opt_(length) const void *data, size_t length)
 Writes block of data to the stream.
 
virtual void flush ()
 Persists volatile element data.
 
- Public Member Functions inherited from stdex::stream::converter
converter (basic &source)
 
virtual size_t read (_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
 Reads block of data from the stream.
 
virtual size_t write (_In_reads_bytes_opt_(length) const void *data, size_t length)
 Writes block of data to the stream.
 
virtual void close ()
 Closes the stream.
 
virtual void flush ()
 Persists volatile element data.
 
- Public Member Functions inherited from stdex::stream::basic
basic (state_t state=state_t::ok)
 
virtual size_t read (_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
 Reads block of data from the stream.
 
virtual size_t write (_In_reads_bytes_opt_(length) const void *data, size_t length)
 Writes block of data to the stream.
 
virtual void flush ()
 Persists volatile element data.
 
virtual void close ()
 Closes the stream.
 
virtual void skip (fsize_t amount)
 Skips given amount of bytes of data on the stream.
 
+state_t state () const
 Returns stream state after last operation.
 
+bool ok () const
 Returns true if the stream state is clean i.e. previous operation was succesful.
 
virtual std::vector< uint8_t > read_remainder (size_t max_length=SIZE_MAX)
 Reads and returns remainder of the stream.
 
+uint8_t read_byte ()
 Reads one byte of data.
 
+void write_byte (uint8_t byte, fsize_t amount=1)
 Writes a byte of data.
 
template<class T >
basicread_data (T &data)
 Reads one primitive data type.
 
template<class T >
basicwrite_data (const T data)
 Writes one primitive data type.
 
template<class _Traits = std::char_traits<char>, class _Ax = std::allocator<char>>
size_t readln (std::basic_string< char, _Traits, _Ax > &str)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln (std::basic_string< wchar_t, _Traits, _Ax > &wstr)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln (std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
size_t readln_and_attach (std::basic_string< _Elem, _Traits, _Ax > &str)
 Reads stream to the end-of-line or end-of-file and append to str.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln_and_attach (std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)
 Reads stream to the end-of-line or end-of-file and append to str.
 
size_t read_array (_Out_writes_bytes_(size *count) void *array, size_t size, size_t count)
 Reads an array of data from the stream.
 
size_t write_array (_In_reads_bytes_opt_(size *count) const void *array, size_t size, size_t count)
 Writes an array of data to the stream.
 
size_t write_array (_In_reads_or_z_opt_(num_chars) const wchar_t *wstr, size_t num_chars, charset_id charset)
 Writes array of characters to the stream.
 
template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
basicread_str (std::basic_string< _Elem, _Traits, _Ax > &data)
 Reads length-prefixed string from the stream.
 
template<class T >
basicwrite_str (const T *data)
 Writes string to the stream length-prefixed.
 
fsize_t write_stream (basic &stream, fsize_t amount=fsize_max)
 Writes content of another stream.
 
+void write_charset (charset_id charset)
 Writes UTF8 or UTF-16 byte-order-mark.
 
size_t write_sprintf (_Printf_format_string_params_(2) const char *format, locale_t locale,...)
 Writes formatted string to the stream.
 
size_t write_sprintf (_Printf_format_string_params_(2) const wchar_t *format, locale_t locale,...)
 Writes formatted string to the stream.
 
size_t write_vsprintf (_Printf_format_string_params_(2) const char *format, locale_t locale, va_list params)
 Writes formatted string to the stream.
 
size_t write_vsprintf (_Printf_format_string_params_(2) const wchar_t *format, locale_t locale, va_list params)
 Writes formatted string to the stream.
 
+basicoperator>> (int8_t &data)
 
+basicoperator<< (const int8_t data)
 
+basicoperator>> (int16_t &data)
 
+basicoperator<< (const int16_t data)
 
+basicoperator>> (int32_t &data)
 
+basicoperator<< (const int32_t data)
 
+basicoperator>> (int64_t &data)
 
+basicoperator<< (const int64_t data)
 
+basicoperator>> (uint8_t &data)
 
+basicoperator<< (const uint8_t data)
 
+basicoperator>> (uint16_t &data)
 
+basicoperator<< (const uint16_t data)
 
+basicoperator>> (uint32_t &data)
 
+basicoperator<< (const uint32_t data)
 
+basicoperator>> (uint64_t &data)
 
+basicoperator<< (const uint64_t data)
 
+basicoperator>> (float &data)
 
+basicoperator<< (const float data)
 
+basicoperator>> (double &data)
 
+basicoperator<< (const double data)
 
+basicoperator>> (char &data)
 
+basicoperator<< (const char data)
 
+template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
basicoperator>> (std::basic_string< _Elem, _Traits, _Ax > &data)
 
+template<class T >
basicoperator<< (const T *data)
 
+ + + + + + + + + + + + + + +

+Protected Attributes

+basic_sys m_source
 
- Protected Attributes inherited from stdex::stream::buffer
+struct stdex::stream::buffer::buffer_t m_read_buffer
 
+struct stdex::stream::buffer::buffer_t m_write_buffer
 
- Protected Attributes inherited from stdex::stream::converter
+basicm_source
 
- Protected Attributes inherited from stdex::stream::basic
+state_t m_state
 
+ + + + + + + + + +

+Additional Inherited Members

- Protected Member Functions inherited from stdex::stream::buffer
buffer (size_t read_buffer_size=default_buffer_size, size_t write_buffer_size=default_buffer_size)
 
+void flush_write ()
 
- Protected Member Functions inherited from stdex::stream::converter
+void init (basic &source)
 
+

Detailed Description

+

Buffered OS data stream (file, pipe, socket...)

+

The documentation for this class was generated from the following file: +
+ + + + diff --git a/classstdex_1_1stream_1_1buffered__sys.png b/classstdex_1_1stream_1_1buffered__sys.png new file mode 100644 index 000000000..9c93a6d67 Binary files /dev/null and b/classstdex_1_1stream_1_1buffered__sys.png differ diff --git a/classstdex_1_1stream_1_1cache-members.html b/classstdex_1_1stream_1_1cache-members.html new file mode 100644 index 000000000..cc8e5d15b --- /dev/null +++ b/classstdex_1_1stream_1_1cache-members.html @@ -0,0 +1,169 @@ + + + + + + + +stdex: Member List + + + + + + + + + +
+
+ + + + + + +
+
stdex +
+
Additional custom or not Standard C++ covered algorithms
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
stdex::stream::cache Member List
+
+
+ +

This is the complete list of members for stdex::stream::cache, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
atime() conststdex::stream::cacheinlinevirtual
basic(state_t state=state_t::ok) (defined in stdex::stream::basic)stdex::stream::basicinline
cache(size_t cache_size=default_cache_size) (defined in stdex::stream::cache)stdex::stream::cacheinlineexplicitprotected
cache(basic_file &source, size_t cache_size=default_cache_size) (defined in stdex::stream::cache)stdex::stream::cacheinline
close()stdex::stream::cacheinlinevirtual
ctime() conststdex::stream::cacheinlinevirtual
flush()stdex::stream::cacheinlinevirtual
flush_cache() (defined in stdex::stream::cache)stdex::stream::cacheinlineprotected
init(basic_file &source) (defined in stdex::stream::cache)stdex::stream::cacheinlineprotected
invalidate_cache() (defined in stdex::stream::cache)stdex::stream::cacheinlineprotected
load_cache(fpos_t start) (defined in stdex::stream::cache)stdex::stream::cacheinlineprotected
lock(fpos_t offset, fsize_t length)stdex::stream::cacheinlinevirtual
m_cache (defined in stdex::stream::cache)stdex::stream::cacheprotected
m_offsetstdex::stream::cacheprotected
m_source (defined in stdex::stream::cache)stdex::stream::cacheprotected
m_state (defined in stdex::stream::basic)stdex::stream::basicprotected
mtime() conststdex::stream::cacheinlinevirtual
ok() conststdex::stream::basicinline
operator<<(const int8_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const int16_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const int32_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const int64_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint8_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint16_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint32_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint64_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const float data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const double data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const char data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const T *data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int8_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int16_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int32_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int64_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint8_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint16_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint32_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint64_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(float &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(double &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(char &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(std::basic_string< _Elem, _Traits, _Ax > &data) (defined in stdex::stream::basic)stdex::stream::basicinline
read(_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)stdex::stream::cacheinlinevirtual
read_array(_Out_writes_bytes_(size *count) void *array, size_t size, size_t count)stdex::stream::basicinline
read_byte()stdex::stream::basicinline
read_charset(charset_id default_charset=charset_id::default)stdex::stream::basic_fileinline
read_data(T &data)stdex::stream::basicinline
read_remainder(size_t max_length=SIZE_MAX)stdex::stream::basic_fileinlinevirtual
read_str(std::basic_string< _Elem, _Traits, _Ax > &data)stdex::stream::basicinline
readln(std::basic_string< char, _Traits, _Ax > &str)stdex::stream::basicinline
readln(std::basic_string< wchar_t, _Traits, _Ax > &wstr)stdex::stream::basicinline
readln(std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)stdex::stream::basicinline
readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline
readln_and_attach(std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)stdex::stream::basicinline
seek(foff_t offset, seek_t how=seek_t::beg)stdex::stream::cacheinlinevirtual
seekbeg(fpos_t offset)stdex::stream::basic_fileinline
seekcur(foff_t offset)stdex::stream::basic_fileinline
seekend(foff_t offset)stdex::stream::basic_fileinline
set_atime(time_point date)stdex::stream::cacheinlinevirtual
set_ctime(time_point date)stdex::stream::cacheinlinevirtual
set_mtime(time_point date)stdex::stream::cacheinlinevirtual
size()stdex::stream::cacheinlinevirtual
skip(fsize_t amount)stdex::stream::basic_fileinlinevirtual
state() conststdex::stream::basicinline
tell() conststdex::stream::cacheinlinevirtual
truncate()stdex::stream::cacheinlinevirtual
unlock(fpos_t offset, fsize_t length)stdex::stream::cacheinlinevirtual
write(_In_reads_bytes_opt_(length) const void *data, size_t length)stdex::stream::cacheinlinevirtual
write_array(_In_reads_bytes_opt_(size *count) const void *array, size_t size, size_t count)stdex::stream::basicinline
write_array(_In_reads_or_z_opt_(num_chars) const wchar_t *wstr, size_t num_chars, charset_id charset)stdex::stream::basicinline
write_byte(uint8_t byte, fsize_t amount=1)stdex::stream::basicinline
write_charset(charset_id charset)stdex::stream::basicinline
write_data(const T data)stdex::stream::basicinline
write_sprintf(_Printf_format_string_params_(2) const char *format, locale_t locale,...)stdex::stream::basicinline
write_sprintf(_Printf_format_string_params_(2) const wchar_t *format, locale_t locale,...)stdex::stream::basicinline
write_str(const T *data)stdex::stream::basicinline
write_stream(basic &stream, fsize_t amount=fsize_max)stdex::stream::basicinline
write_vsprintf(_Printf_format_string_params_(2) const char *format, locale_t locale, va_list params)stdex::stream::basicinline
write_vsprintf(_Printf_format_string_params_(2) const wchar_t *format, locale_t locale, va_list params)stdex::stream::basicinline
~cache() (defined in stdex::stream::cache)stdex::stream::cacheinlinevirtual
+ + + + diff --git a/classstdex_1_1stream_1_1cache.html b/classstdex_1_1stream_1_1cache.html new file mode 100644 index 000000000..a64883ee7 --- /dev/null +++ b/classstdex_1_1stream_1_1cache.html @@ -0,0 +1,980 @@ + + + + + + + +stdex: stdex::stream::cache Class Reference + + + + + + + + + +
+
+ + + + + + +
+
stdex +
+
Additional custom or not Standard C++ covered algorithms
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
+Classes | +Public Member Functions | +Protected Member Functions | +Protected Attributes | +List of all members
+
stdex::stream::cache Class Reference
+
+
+ +

Cached file. + More...

+ +

#include <stdex/stream.hpp>

+
+Inheritance diagram for stdex::stream::cache:
+
+
+ + +stdex::stream::basic_file +stdex::stream::basic +stdex::stream::cached_file + +
+ + + + +

+Classes

struct  cache_t
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

cache (basic_file &source, size_t cache_size=default_cache_size)
 
virtual size_t read (_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
 Reads block of data from the stream.
 
virtual size_t write (_In_reads_bytes_opt_(length) const void *data, size_t length)
 Writes block of data to the stream.
 
virtual void close ()
 Closes the stream.
 
virtual void flush ()
 Persists volatile element data.
 
virtual fpos_t seek (foff_t offset, seek_t how=seek_t::beg)
 Seeks to specified relative file position.
 
virtual fpos_t tell () const
 Returns absolute file position in file or fpos_max if fails. This method does not update stream state.
 
virtual void lock (fpos_t offset, fsize_t length)
 Locks file section for exclusive access.
 
virtual void unlock (fpos_t offset, fsize_t length)
 Unlocks file section for exclusive access.
 
virtual fsize_t size ()
 Returns file size Should the file size cannot be determined, the method returns fsize_max and it does not reset the state to failed.
 
virtual void truncate ()
 Sets file size - truncates the remainder of file content from the current file position to the end of file.
 
virtual time_point ctime () const
 Returns file creation time.
 
virtual time_point atime () const
 Returns file access time.
 
virtual time_point mtime () const
 Returns file modification time.
 
virtual void set_ctime (time_point date)
 Sets file create time.
 
virtual void set_atime (time_point date)
 Sets file access time.
 
virtual void set_mtime (time_point date)
 Sets file modification time.
 
- Public Member Functions inherited from stdex::stream::basic_file
virtual std::vector< uint8_t > read_remainder (size_t max_length=SIZE_MAX)
 Reads and returns remainder of the stream.
 
virtual fpos_t seek (foff_t offset, seek_t how=seek_t::beg)=0
 Seeks to specified relative file position.
 
fpos_t seekbeg (fpos_t offset)
 Seeks to absolute file position.
 
fpos_t seekcur (foff_t offset)
 Seeks to relative from current file position.
 
fpos_t seekend (foff_t offset)
 Seeks to relative from end file position.
 
virtual void skip (fsize_t amount)
 Skips given amount of bytes of data on the stream.
 
virtual fpos_t tell () const =0
 Returns absolute file position in file or fpos_max if fails. This method does not update stream state.
 
virtual void lock (fpos_t offset, fsize_t length)
 Locks file section for exclusive access.
 
virtual void unlock (fpos_t offset, fsize_t length)
 Unlocks file section for exclusive access.
 
virtual fsize_t size ()=0
 Returns file size Should the file size cannot be determined, the method returns fsize_max and it does not reset the state to failed.
 
virtual void truncate ()=0
 Sets file size - truncates the remainder of file content from the current file position to the end of file.
 
virtual time_point ctime () const
 Returns file creation time.
 
virtual time_point atime () const
 Returns file access time.
 
virtual time_point mtime () const
 Returns file modification time.
 
virtual void set_ctime (time_point date)
 Sets file create time.
 
virtual void set_atime (time_point date)
 Sets file access time.
 
virtual void set_mtime (time_point date)
 Sets file modification time.
 
charset_id read_charset (charset_id default_charset=charset_id::default)
 Attempts to detect textfile charset based on UTF16 or UTF8 BOM.
 
- Public Member Functions inherited from stdex::stream::basic
basic (state_t state=state_t::ok)
 
virtual size_t read (_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
 Reads block of data from the stream.
 
virtual size_t write (_In_reads_bytes_opt_(length) const void *data, size_t length)
 Writes block of data to the stream.
 
virtual void flush ()
 Persists volatile element data.
 
virtual void close ()
 Closes the stream.
 
virtual void skip (fsize_t amount)
 Skips given amount of bytes of data on the stream.
 
+state_t state () const
 Returns stream state after last operation.
 
+bool ok () const
 Returns true if the stream state is clean i.e. previous operation was succesful.
 
virtual std::vector< uint8_t > read_remainder (size_t max_length=SIZE_MAX)
 Reads and returns remainder of the stream.
 
+uint8_t read_byte ()
 Reads one byte of data.
 
+void write_byte (uint8_t byte, fsize_t amount=1)
 Writes a byte of data.
 
template<class T >
basicread_data (T &data)
 Reads one primitive data type.
 
template<class T >
basicwrite_data (const T data)
 Writes one primitive data type.
 
template<class _Traits = std::char_traits<char>, class _Ax = std::allocator<char>>
size_t readln (std::basic_string< char, _Traits, _Ax > &str)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln (std::basic_string< wchar_t, _Traits, _Ax > &wstr)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln (std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
size_t readln_and_attach (std::basic_string< _Elem, _Traits, _Ax > &str)
 Reads stream to the end-of-line or end-of-file and append to str.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln_and_attach (std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)
 Reads stream to the end-of-line or end-of-file and append to str.
 
size_t read_array (_Out_writes_bytes_(size *count) void *array, size_t size, size_t count)
 Reads an array of data from the stream.
 
size_t write_array (_In_reads_bytes_opt_(size *count) const void *array, size_t size, size_t count)
 Writes an array of data to the stream.
 
size_t write_array (_In_reads_or_z_opt_(num_chars) const wchar_t *wstr, size_t num_chars, charset_id charset)
 Writes array of characters to the stream.
 
template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
basicread_str (std::basic_string< _Elem, _Traits, _Ax > &data)
 Reads length-prefixed string from the stream.
 
template<class T >
basicwrite_str (const T *data)
 Writes string to the stream length-prefixed.
 
fsize_t write_stream (basic &stream, fsize_t amount=fsize_max)
 Writes content of another stream.
 
+void write_charset (charset_id charset)
 Writes UTF8 or UTF-16 byte-order-mark.
 
size_t write_sprintf (_Printf_format_string_params_(2) const char *format, locale_t locale,...)
 Writes formatted string to the stream.
 
size_t write_sprintf (_Printf_format_string_params_(2) const wchar_t *format, locale_t locale,...)
 Writes formatted string to the stream.
 
size_t write_vsprintf (_Printf_format_string_params_(2) const char *format, locale_t locale, va_list params)
 Writes formatted string to the stream.
 
size_t write_vsprintf (_Printf_format_string_params_(2) const wchar_t *format, locale_t locale, va_list params)
 Writes formatted string to the stream.
 
+basicoperator>> (int8_t &data)
 
+basicoperator<< (const int8_t data)
 
+basicoperator>> (int16_t &data)
 
+basicoperator<< (const int16_t data)
 
+basicoperator>> (int32_t &data)
 
+basicoperator<< (const int32_t data)
 
+basicoperator>> (int64_t &data)
 
+basicoperator<< (const int64_t data)
 
+basicoperator>> (uint8_t &data)
 
+basicoperator<< (const uint8_t data)
 
+basicoperator>> (uint16_t &data)
 
+basicoperator<< (const uint16_t data)
 
+basicoperator>> (uint32_t &data)
 
+basicoperator<< (const uint32_t data)
 
+basicoperator>> (uint64_t &data)
 
+basicoperator<< (const uint64_t data)
 
+basicoperator>> (float &data)
 
+basicoperator<< (const float data)
 
+basicoperator>> (double &data)
 
+basicoperator<< (const double data)
 
+basicoperator>> (char &data)
 
+basicoperator<< (const char data)
 
+template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
basicoperator>> (std::basic_string< _Elem, _Traits, _Ax > &data)
 
+template<class T >
basicoperator<< (const T *data)
 
+ + + + + + + + + + + +

+Protected Member Functions

cache (size_t cache_size=default_cache_size)
 
+void init (basic_file &source)
 
+void flush_cache ()
 
+void invalidate_cache ()
 
+void load_cache (fpos_t start)
 
+ + + + + + + + + + + +

+Protected Attributes

+basic_filem_source
 
+struct stdex::stream::cache::cache_t m_cache
 
+fpos_t m_offset
 Logical absolute file position.
 
- Protected Attributes inherited from stdex::stream::basic
+state_t m_state
 
+

Detailed Description

+

Cached file.

+

Member Function Documentation

+ +

◆ atime()

+ +
+
+ + + + + +
+ + + + + + + +
virtual time_point stdex::stream::cache::atime () const
+
+inlinevirtual
+
+ +

Returns file access time.

+ +

Reimplemented from stdex::stream::basic_file.

+ +
+
+ +

◆ close()

+ +
+
+ + + + + +
+ + + + + + + +
virtual void stdex::stream::cache::close ()
+
+inlinevirtual
+
+ +

Closes the stream.

+ +

Reimplemented from stdex::stream::basic.

+ +
+
+ +

◆ ctime()

+ +
+
+ + + + + +
+ + + + + + + +
virtual time_point stdex::stream::cache::ctime () const
+
+inlinevirtual
+
+ +

Returns file creation time.

+ +

Reimplemented from stdex::stream::basic_file.

+ +
+
+ +

◆ flush()

+ +
+
+ + + + + +
+ + + + + + + +
virtual void stdex::stream::cache::flush ()
+
+inlinevirtual
+
+ +

Persists volatile element data.

+ +

Reimplemented from stdex::stream::basic.

+ +
+
+ +

◆ lock()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual void stdex::stream::cache::lock (fpos_t offset,
fsize_t length 
)
+
+inlinevirtual
+
+ +

Locks file section for exclusive access.

+ +

Reimplemented from stdex::stream::basic_file.

+ +
+
+ +

◆ mtime()

+ +
+
+ + + + + +
+ + + + + + + +
virtual time_point stdex::stream::cache::mtime () const
+
+inlinevirtual
+
+ +

Returns file modification time.

+ +

Reimplemented from stdex::stream::basic_file.

+ +
+
+ +

◆ read()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual size_t stdex::stream::cache::read (_Out_writes_bytes_to_opt_(length, return) void * data,
size_t length 
)
+
+inlinevirtual
+
+ +

Reads block of data from the stream.

+
Parameters
+ + + +
[out]dataBuffer to store read data
[in]lengthByte limit of data to read
+
+
+
Returns
Number of bytes succesfully read. On EOF, 0 is returned and stream state is set to state_t::eof. On error, 0 is returned and stream state is set to state_t::fail. On null reads (length == 0), 0 is returned and stream state is set to state_t::ok.
+ +

Reimplemented from stdex::stream::basic.

+ +
+
+ +

◆ seek()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual fpos_t stdex::stream::cache::seek (foff_t offset,
seek_t how = seek_t::beg 
)
+
+inlinevirtual
+
+ +

Seeks to specified relative file position.

+
Returns
Absolute file position after seek, or fpos_max if seek failed.
+ +

Implements stdex::stream::basic_file.

+ +
+
+ +

◆ set_atime()

+ +
+
+ + + + + +
+ + + + + + + + +
virtual void stdex::stream::cache::set_atime (time_point date)
+
+inlinevirtual
+
+ +

Sets file access time.

+ +

Reimplemented from stdex::stream::basic_file.

+ +
+
+ +

◆ set_ctime()

+ +
+
+ + + + + +
+ + + + + + + + +
virtual void stdex::stream::cache::set_ctime (time_point date)
+
+inlinevirtual
+
+ +

Sets file create time.

+ +

Reimplemented from stdex::stream::basic_file.

+ +
+
+ +

◆ set_mtime()

+ +
+
+ + + + + +
+ + + + + + + + +
virtual void stdex::stream::cache::set_mtime (time_point date)
+
+inlinevirtual
+
+ +

Sets file modification time.

+ +

Reimplemented from stdex::stream::basic_file.

+ +
+
+ +

◆ size()

+ +
+
+ + + + + +
+ + + + + + + +
virtual fsize_t stdex::stream::cache::size ()
+
+inlinevirtual
+
+ +

Returns file size Should the file size cannot be determined, the method returns fsize_max and it does not reset the state to failed.

+ +

Implements stdex::stream::basic_file.

+ +
+
+ +

◆ tell()

+ +
+
+ + + + + +
+ + + + + + + +
virtual fpos_t stdex::stream::cache::tell () const
+
+inlinevirtual
+
+ +

Returns absolute file position in file or fpos_max if fails. This method does not update stream state.

+
Returns
Absolute file position or fpos_max if position cannot be determined.
+ +

Implements stdex::stream::basic_file.

+ +
+
+ +

◆ truncate()

+ +
+
+ + + + + +
+ + + + + + + +
virtual void stdex::stream::cache::truncate ()
+
+inlinevirtual
+
+ +

Sets file size - truncates the remainder of file content from the current file position to the end of file.

+ +

Implements stdex::stream::basic_file.

+ +
+
+ +

◆ unlock()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual void stdex::stream::cache::unlock (fpos_t offset,
fsize_t length 
)
+
+inlinevirtual
+
+ +

Unlocks file section for exclusive access.

+ +

Reimplemented from stdex::stream::basic_file.

+ +
+
+ +

◆ write()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual size_t stdex::stream::cache::write (_In_reads_bytes_opt_(length) const void * data,
size_t length 
)
+
+inlinevirtual
+
+ +

Writes block of data to the stream.

+
Parameters
+ + + +
[in]dataBuffer to write data from
[in]lengthNumber of bytes to write
+
+
+
Returns
Number of bytes succesfully written. On error, stream state is set to state_t::fail.
+ +

Reimplemented from stdex::stream::basic.

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/classstdex_1_1stream_1_1cache.png b/classstdex_1_1stream_1_1cache.png new file mode 100644 index 000000000..909aa0a91 Binary files /dev/null and b/classstdex_1_1stream_1_1cache.png differ diff --git a/classstdex_1_1stream_1_1cached__file-members.html b/classstdex_1_1stream_1_1cached__file-members.html new file mode 100644 index 000000000..48deb7bee --- /dev/null +++ b/classstdex_1_1stream_1_1cached__file-members.html @@ -0,0 +1,172 @@ + + + + + + + +stdex: Member List + + + + + + + + + +
+
+ + + + + + +
+
stdex +
+
Additional custom or not Standard C++ covered algorithms
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
stdex::stream::cached_file Member List
+
+
+ +

This is the complete list of members for stdex::stream::cached_file, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
atime() conststdex::stream::cacheinlinevirtual
basic(state_t state=state_t::ok) (defined in stdex::stream::basic)stdex::stream::basicinline
cache(size_t cache_size=default_cache_size) (defined in stdex::stream::cache)stdex::stream::cacheinlineexplicitprotected
cache(basic_file &source, size_t cache_size=default_cache_size) (defined in stdex::stream::cache)stdex::stream::cacheinline
cached_file(sys_handle h=invalid_handle, state_t state=state_t::ok, size_t cache_size=default_cache_size) (defined in stdex::stream::cached_file)stdex::stream::cached_fileinline
cached_file(const sys_char *filename, int mode, size_t cache_size=default_cache_size)stdex::stream::cached_fileinline
close()stdex::stream::cacheinlinevirtual
ctime() conststdex::stream::cacheinlinevirtual
flush()stdex::stream::cacheinlinevirtual
flush_cache() (defined in stdex::stream::cache)stdex::stream::cacheinlineprotected
init(basic_file &source) (defined in stdex::stream::cache)stdex::stream::cacheinlineprotected
invalidate_cache() (defined in stdex::stream::cache)stdex::stream::cacheinlineprotected
load_cache(fpos_t start) (defined in stdex::stream::cache)stdex::stream::cacheinlineprotected
lock(fpos_t offset, fsize_t length)stdex::stream::cacheinlinevirtual
m_cache (defined in stdex::stream::cache)stdex::stream::cacheprotected
m_offsetstdex::stream::cacheprotected
m_source (defined in stdex::stream::cached_file)stdex::stream::cached_fileprotected
m_state (defined in stdex::stream::basic)stdex::stream::basicprotected
mtime() conststdex::stream::cacheinlinevirtual
ok() conststdex::stream::basicinline
open(const sys_char *filename, int mode)stdex::stream::cached_fileinline
operator<<(const int8_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const int16_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const int32_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const int64_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint8_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint16_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint32_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint64_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const float data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const double data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const char data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const T *data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int8_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int16_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int32_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int64_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint8_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint16_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint32_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint64_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(float &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(double &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(char &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(std::basic_string< _Elem, _Traits, _Ax > &data) (defined in stdex::stream::basic)stdex::stream::basicinline
read(_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)stdex::stream::cacheinlinevirtual
read_array(_Out_writes_bytes_(size *count) void *array, size_t size, size_t count)stdex::stream::basicinline
read_byte()stdex::stream::basicinline
read_charset(charset_id default_charset=charset_id::default)stdex::stream::basic_fileinline
read_data(T &data)stdex::stream::basicinline
read_remainder(size_t max_length=SIZE_MAX)stdex::stream::basic_fileinlinevirtual
read_str(std::basic_string< _Elem, _Traits, _Ax > &data)stdex::stream::basicinline
readln(std::basic_string< char, _Traits, _Ax > &str)stdex::stream::basicinline
readln(std::basic_string< wchar_t, _Traits, _Ax > &wstr)stdex::stream::basicinline
readln(std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)stdex::stream::basicinline
readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline
readln_and_attach(std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)stdex::stream::basicinline
seek(foff_t offset, seek_t how=seek_t::beg)stdex::stream::cacheinlinevirtual
seekbeg(fpos_t offset)stdex::stream::basic_fileinline
seekcur(foff_t offset)stdex::stream::basic_fileinline
seekend(foff_t offset)stdex::stream::basic_fileinline
set_atime(time_point date)stdex::stream::cacheinlinevirtual
set_ctime(time_point date)stdex::stream::cacheinlinevirtual
set_mtime(time_point date)stdex::stream::cacheinlinevirtual
size()stdex::stream::cacheinlinevirtual
skip(fsize_t amount)stdex::stream::basic_fileinlinevirtual
state() conststdex::stream::basicinline
tell() conststdex::stream::cacheinlinevirtual
truncate()stdex::stream::cacheinlinevirtual
unlock(fpos_t offset, fsize_t length)stdex::stream::cacheinlinevirtual
write(_In_reads_bytes_opt_(length) const void *data, size_t length)stdex::stream::cacheinlinevirtual
write_array(_In_reads_bytes_opt_(size *count) const void *array, size_t size, size_t count)stdex::stream::basicinline
write_array(_In_reads_or_z_opt_(num_chars) const wchar_t *wstr, size_t num_chars, charset_id charset)stdex::stream::basicinline
write_byte(uint8_t byte, fsize_t amount=1)stdex::stream::basicinline
write_charset(charset_id charset)stdex::stream::basicinline
write_data(const T data)stdex::stream::basicinline
write_sprintf(_Printf_format_string_params_(2) const char *format, locale_t locale,...)stdex::stream::basicinline
write_sprintf(_Printf_format_string_params_(2) const wchar_t *format, locale_t locale,...)stdex::stream::basicinline
write_str(const T *data)stdex::stream::basicinline
write_stream(basic &stream, fsize_t amount=fsize_max)stdex::stream::basicinline
write_vsprintf(_Printf_format_string_params_(2) const char *format, locale_t locale, va_list params)stdex::stream::basicinline
write_vsprintf(_Printf_format_string_params_(2) const wchar_t *format, locale_t locale, va_list params)stdex::stream::basicinline
~cache() (defined in stdex::stream::cache)stdex::stream::cacheinlinevirtual
+ + + + diff --git a/classstdex_1_1stream_1_1cached__file.html b/classstdex_1_1stream_1_1cached__file.html new file mode 100644 index 000000000..ebf395a36 --- /dev/null +++ b/classstdex_1_1stream_1_1cached__file.html @@ -0,0 +1,547 @@ + + + + + + + +stdex: stdex::stream::cached_file Class Reference + + + + + + + + + +
+
+ + + + + + +
+
stdex +
+
Additional custom or not Standard C++ covered algorithms
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
+Public Member Functions | +Protected Attributes | +List of all members
+
stdex::stream::cached_file Class Reference
+
+
+ +

Cached file-system file. + More...

+ +

#include <stdex/stream.hpp>

+
+Inheritance diagram for stdex::stream::cached_file:
+
+
+ + +stdex::stream::cache +stdex::stream::basic_file +stdex::stream::basic + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

cached_file (sys_handle h=invalid_handle, state_t state=state_t::ok, size_t cache_size=default_cache_size)
 
 cached_file (const sys_char *filename, int mode, size_t cache_size=default_cache_size)
 Opens file.
 
void open (const sys_char *filename, int mode)
 Opens file.
 
- Public Member Functions inherited from stdex::stream::cache
cache (basic_file &source, size_t cache_size=default_cache_size)
 
virtual size_t read (_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
 Reads block of data from the stream.
 
virtual size_t write (_In_reads_bytes_opt_(length) const void *data, size_t length)
 Writes block of data to the stream.
 
virtual void close ()
 Closes the stream.
 
virtual void flush ()
 Persists volatile element data.
 
virtual fpos_t seek (foff_t offset, seek_t how=seek_t::beg)
 Seeks to specified relative file position.
 
virtual fpos_t tell () const
 Returns absolute file position in file or fpos_max if fails. This method does not update stream state.
 
virtual void lock (fpos_t offset, fsize_t length)
 Locks file section for exclusive access.
 
virtual void unlock (fpos_t offset, fsize_t length)
 Unlocks file section for exclusive access.
 
virtual fsize_t size ()
 Returns file size Should the file size cannot be determined, the method returns fsize_max and it does not reset the state to failed.
 
virtual void truncate ()
 Sets file size - truncates the remainder of file content from the current file position to the end of file.
 
virtual time_point ctime () const
 Returns file creation time.
 
virtual time_point atime () const
 Returns file access time.
 
virtual time_point mtime () const
 Returns file modification time.
 
virtual void set_ctime (time_point date)
 Sets file create time.
 
virtual void set_atime (time_point date)
 Sets file access time.
 
virtual void set_mtime (time_point date)
 Sets file modification time.
 
- Public Member Functions inherited from stdex::stream::basic_file
virtual std::vector< uint8_t > read_remainder (size_t max_length=SIZE_MAX)
 Reads and returns remainder of the stream.
 
virtual fpos_t seek (foff_t offset, seek_t how=seek_t::beg)=0
 Seeks to specified relative file position.
 
fpos_t seekbeg (fpos_t offset)
 Seeks to absolute file position.
 
fpos_t seekcur (foff_t offset)
 Seeks to relative from current file position.
 
fpos_t seekend (foff_t offset)
 Seeks to relative from end file position.
 
virtual void skip (fsize_t amount)
 Skips given amount of bytes of data on the stream.
 
virtual fpos_t tell () const =0
 Returns absolute file position in file or fpos_max if fails. This method does not update stream state.
 
virtual void lock (fpos_t offset, fsize_t length)
 Locks file section for exclusive access.
 
virtual void unlock (fpos_t offset, fsize_t length)
 Unlocks file section for exclusive access.
 
virtual fsize_t size ()=0
 Returns file size Should the file size cannot be determined, the method returns fsize_max and it does not reset the state to failed.
 
virtual void truncate ()=0
 Sets file size - truncates the remainder of file content from the current file position to the end of file.
 
virtual time_point ctime () const
 Returns file creation time.
 
virtual time_point atime () const
 Returns file access time.
 
virtual time_point mtime () const
 Returns file modification time.
 
virtual void set_ctime (time_point date)
 Sets file create time.
 
virtual void set_atime (time_point date)
 Sets file access time.
 
virtual void set_mtime (time_point date)
 Sets file modification time.
 
charset_id read_charset (charset_id default_charset=charset_id::default)
 Attempts to detect textfile charset based on UTF16 or UTF8 BOM.
 
- Public Member Functions inherited from stdex::stream::basic
basic (state_t state=state_t::ok)
 
virtual size_t read (_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
 Reads block of data from the stream.
 
virtual size_t write (_In_reads_bytes_opt_(length) const void *data, size_t length)
 Writes block of data to the stream.
 
virtual void flush ()
 Persists volatile element data.
 
virtual void close ()
 Closes the stream.
 
virtual void skip (fsize_t amount)
 Skips given amount of bytes of data on the stream.
 
+state_t state () const
 Returns stream state after last operation.
 
+bool ok () const
 Returns true if the stream state is clean i.e. previous operation was succesful.
 
virtual std::vector< uint8_t > read_remainder (size_t max_length=SIZE_MAX)
 Reads and returns remainder of the stream.
 
+uint8_t read_byte ()
 Reads one byte of data.
 
+void write_byte (uint8_t byte, fsize_t amount=1)
 Writes a byte of data.
 
template<class T >
basicread_data (T &data)
 Reads one primitive data type.
 
template<class T >
basicwrite_data (const T data)
 Writes one primitive data type.
 
template<class _Traits = std::char_traits<char>, class _Ax = std::allocator<char>>
size_t readln (std::basic_string< char, _Traits, _Ax > &str)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln (std::basic_string< wchar_t, _Traits, _Ax > &wstr)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln (std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
size_t readln_and_attach (std::basic_string< _Elem, _Traits, _Ax > &str)
 Reads stream to the end-of-line or end-of-file and append to str.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln_and_attach (std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)
 Reads stream to the end-of-line or end-of-file and append to str.
 
size_t read_array (_Out_writes_bytes_(size *count) void *array, size_t size, size_t count)
 Reads an array of data from the stream.
 
size_t write_array (_In_reads_bytes_opt_(size *count) const void *array, size_t size, size_t count)
 Writes an array of data to the stream.
 
size_t write_array (_In_reads_or_z_opt_(num_chars) const wchar_t *wstr, size_t num_chars, charset_id charset)
 Writes array of characters to the stream.
 
template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
basicread_str (std::basic_string< _Elem, _Traits, _Ax > &data)
 Reads length-prefixed string from the stream.
 
template<class T >
basicwrite_str (const T *data)
 Writes string to the stream length-prefixed.
 
fsize_t write_stream (basic &stream, fsize_t amount=fsize_max)
 Writes content of another stream.
 
+void write_charset (charset_id charset)
 Writes UTF8 or UTF-16 byte-order-mark.
 
size_t write_sprintf (_Printf_format_string_params_(2) const char *format, locale_t locale,...)
 Writes formatted string to the stream.
 
size_t write_sprintf (_Printf_format_string_params_(2) const wchar_t *format, locale_t locale,...)
 Writes formatted string to the stream.
 
size_t write_vsprintf (_Printf_format_string_params_(2) const char *format, locale_t locale, va_list params)
 Writes formatted string to the stream.
 
size_t write_vsprintf (_Printf_format_string_params_(2) const wchar_t *format, locale_t locale, va_list params)
 Writes formatted string to the stream.
 
+basicoperator>> (int8_t &data)
 
+basicoperator<< (const int8_t data)
 
+basicoperator>> (int16_t &data)
 
+basicoperator<< (const int16_t data)
 
+basicoperator>> (int32_t &data)
 
+basicoperator<< (const int32_t data)
 
+basicoperator>> (int64_t &data)
 
+basicoperator<< (const int64_t data)
 
+basicoperator>> (uint8_t &data)
 
+basicoperator<< (const uint8_t data)
 
+basicoperator>> (uint16_t &data)
 
+basicoperator<< (const uint16_t data)
 
+basicoperator>> (uint32_t &data)
 
+basicoperator<< (const uint32_t data)
 
+basicoperator>> (uint64_t &data)
 
+basicoperator<< (const uint64_t data)
 
+basicoperator>> (float &data)
 
+basicoperator<< (const float data)
 
+basicoperator>> (double &data)
 
+basicoperator<< (const double data)
 
+basicoperator>> (char &data)
 
+basicoperator<< (const char data)
 
+template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
basicoperator>> (std::basic_string< _Elem, _Traits, _Ax > &data)
 
+template<class T >
basicoperator<< (const T *data)
 
+ + + + + + + + + + + + + + +

+Protected Attributes

+file m_source
 
- Protected Attributes inherited from stdex::stream::cache
+basic_filem_source
 
+struct stdex::stream::cache::cache_t m_cache
 
+fpos_t m_offset
 Logical absolute file position.
 
- Protected Attributes inherited from stdex::stream::basic
+state_t m_state
 
+ + + + + + + + + + + + +

+Additional Inherited Members

- Protected Member Functions inherited from stdex::stream::cache
cache (size_t cache_size=default_cache_size)
 
+void init (basic_file &source)
 
+void flush_cache ()
 
+void invalidate_cache ()
 
+void load_cache (fpos_t start)
 
+

Detailed Description

+

Cached file-system file.

+

Constructor & Destructor Documentation

+ +

◆ cached_file()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
stdex::stream::cached_file::cached_file (const sys_char * filename,
int mode,
size_t cache_size = default_cache_size 
)
+
+inline
+
+ +

Opens file.

+
Parameters
+ + + + +
[in]filenameFilename
[in]modeBitwise combination of mode_t flags
[in]cache_sizeSize of the cache block
+
+
+ +
+
+

Member Function Documentation

+ +

◆ open()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void stdex::stream::cached_file::open (const sys_char * filename,
int mode 
)
+
+inline
+
+ +

Opens file.

+
Parameters
+ + + + +
[in]filenameFilename
[in]modeBitwise combination of mode_t flags
[in]cache_sizeSize of the cache block
+
+
+ +
+
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/classstdex_1_1stream_1_1cached__file.png b/classstdex_1_1stream_1_1cached__file.png new file mode 100644 index 000000000..a3fdcf4bb Binary files /dev/null and b/classstdex_1_1stream_1_1cached__file.png differ diff --git a/classstdex_1_1stream_1_1converter-members.html b/classstdex_1_1stream_1_1converter-members.html new file mode 100644 index 000000000..d859b9916 --- /dev/null +++ b/classstdex_1_1stream_1_1converter-members.html @@ -0,0 +1,147 @@ + + + + + + + +stdex: Member List + + + + + + + + + +
+
+ + + + + + +
+
stdex +
+
Additional custom or not Standard C++ covered algorithms
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
stdex::stream::converter Member List
+
+
+ +

This is the complete list of members for stdex::stream::converter, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
basic(state_t state=state_t::ok) (defined in stdex::stream::basic)stdex::stream::basicinline
close()stdex::stream::converterinlinevirtual
converter() (defined in stdex::stream::converter)stdex::stream::converterinlineexplicitprotected
converter(basic &source) (defined in stdex::stream::converter)stdex::stream::converterinline
flush()stdex::stream::converterinlinevirtual
init(basic &source) (defined in stdex::stream::converter)stdex::stream::converterinlineprotected
m_source (defined in stdex::stream::converter)stdex::stream::converterprotected
m_state (defined in stdex::stream::basic)stdex::stream::basicprotected
ok() conststdex::stream::basicinline
operator<<(const int8_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const int16_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const int32_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const int64_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint8_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint16_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint32_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint64_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const float data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const double data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const char data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const T *data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int8_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int16_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int32_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int64_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint8_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint16_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint32_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint64_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(float &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(double &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(char &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(std::basic_string< _Elem, _Traits, _Ax > &data) (defined in stdex::stream::basic)stdex::stream::basicinline
read(_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)stdex::stream::converterinlinevirtual
read_array(_Out_writes_bytes_(size *count) void *array, size_t size, size_t count)stdex::stream::basicinline
read_byte()stdex::stream::basicinline
read_data(T &data)stdex::stream::basicinline
read_remainder(size_t max_length=SIZE_MAX)stdex::stream::basicinlinevirtual
read_str(std::basic_string< _Elem, _Traits, _Ax > &data)stdex::stream::basicinline
readln(std::basic_string< char, _Traits, _Ax > &str)stdex::stream::basicinline
readln(std::basic_string< wchar_t, _Traits, _Ax > &wstr)stdex::stream::basicinline
readln(std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)stdex::stream::basicinline
readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline
readln_and_attach(std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)stdex::stream::basicinline
skip(fsize_t amount)stdex::stream::basicinlinevirtual
state() conststdex::stream::basicinline
write(_In_reads_bytes_opt_(length) const void *data, size_t length)stdex::stream::converterinlinevirtual
write_array(_In_reads_bytes_opt_(size *count) const void *array, size_t size, size_t count)stdex::stream::basicinline
write_array(_In_reads_or_z_opt_(num_chars) const wchar_t *wstr, size_t num_chars, charset_id charset)stdex::stream::basicinline
write_byte(uint8_t byte, fsize_t amount=1)stdex::stream::basicinline
write_charset(charset_id charset)stdex::stream::basicinline
write_data(const T data)stdex::stream::basicinline
write_sprintf(_Printf_format_string_params_(2) const char *format, locale_t locale,...)stdex::stream::basicinline
write_sprintf(_Printf_format_string_params_(2) const wchar_t *format, locale_t locale,...)stdex::stream::basicinline
write_str(const T *data)stdex::stream::basicinline
write_stream(basic &stream, fsize_t amount=fsize_max)stdex::stream::basicinline
write_vsprintf(_Printf_format_string_params_(2) const char *format, locale_t locale, va_list params)stdex::stream::basicinline
write_vsprintf(_Printf_format_string_params_(2) const wchar_t *format, locale_t locale, va_list params)stdex::stream::basicinline
+ + + + diff --git a/classstdex_1_1stream_1_1converter.html b/classstdex_1_1stream_1_1converter.html new file mode 100644 index 000000000..9438a2e97 --- /dev/null +++ b/classstdex_1_1stream_1_1converter.html @@ -0,0 +1,488 @@ + + + + + + + +stdex: stdex::stream::converter Class Reference + + + + + + + + + +
+
+ + + + + + +
+
stdex +
+
Additional custom or not Standard C++ covered algorithms
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
+Public Member Functions | +Protected Member Functions | +Protected Attributes | +List of all members
+
stdex::stream::converter Class Reference
+
+
+ +

Modifies data on the fly when reading from/writing to a source stream. + More...

+ +

#include <stdex/stream.hpp>

+
+Inheritance diagram for stdex::stream::converter:
+
+
+ + +stdex::stream::basic +stdex::stream::async_reader< CAPACITY > +stdex::stream::async_writer< CAPACITY > +stdex::stream::buffer +stdex::stream::limiter +stdex::stream::buffered_sys +stdex::stream::window + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

converter (basic &source)
 
virtual size_t read (_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
 Reads block of data from the stream.
 
virtual size_t write (_In_reads_bytes_opt_(length) const void *data, size_t length)
 Writes block of data to the stream.
 
virtual void close ()
 Closes the stream.
 
virtual void flush ()
 Persists volatile element data.
 
- Public Member Functions inherited from stdex::stream::basic
basic (state_t state=state_t::ok)
 
virtual size_t read (_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
 Reads block of data from the stream.
 
virtual size_t write (_In_reads_bytes_opt_(length) const void *data, size_t length)
 Writes block of data to the stream.
 
virtual void flush ()
 Persists volatile element data.
 
virtual void close ()
 Closes the stream.
 
virtual void skip (fsize_t amount)
 Skips given amount of bytes of data on the stream.
 
+state_t state () const
 Returns stream state after last operation.
 
+bool ok () const
 Returns true if the stream state is clean i.e. previous operation was succesful.
 
virtual std::vector< uint8_t > read_remainder (size_t max_length=SIZE_MAX)
 Reads and returns remainder of the stream.
 
+uint8_t read_byte ()
 Reads one byte of data.
 
+void write_byte (uint8_t byte, fsize_t amount=1)
 Writes a byte of data.
 
template<class T >
basicread_data (T &data)
 Reads one primitive data type.
 
template<class T >
basicwrite_data (const T data)
 Writes one primitive data type.
 
template<class _Traits = std::char_traits<char>, class _Ax = std::allocator<char>>
size_t readln (std::basic_string< char, _Traits, _Ax > &str)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln (std::basic_string< wchar_t, _Traits, _Ax > &wstr)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln (std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
size_t readln_and_attach (std::basic_string< _Elem, _Traits, _Ax > &str)
 Reads stream to the end-of-line or end-of-file and append to str.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln_and_attach (std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)
 Reads stream to the end-of-line or end-of-file and append to str.
 
size_t read_array (_Out_writes_bytes_(size *count) void *array, size_t size, size_t count)
 Reads an array of data from the stream.
 
size_t write_array (_In_reads_bytes_opt_(size *count) const void *array, size_t size, size_t count)
 Writes an array of data to the stream.
 
size_t write_array (_In_reads_or_z_opt_(num_chars) const wchar_t *wstr, size_t num_chars, charset_id charset)
 Writes array of characters to the stream.
 
template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
basicread_str (std::basic_string< _Elem, _Traits, _Ax > &data)
 Reads length-prefixed string from the stream.
 
template<class T >
basicwrite_str (const T *data)
 Writes string to the stream length-prefixed.
 
fsize_t write_stream (basic &stream, fsize_t amount=fsize_max)
 Writes content of another stream.
 
+void write_charset (charset_id charset)
 Writes UTF8 or UTF-16 byte-order-mark.
 
size_t write_sprintf (_Printf_format_string_params_(2) const char *format, locale_t locale,...)
 Writes formatted string to the stream.
 
size_t write_sprintf (_Printf_format_string_params_(2) const wchar_t *format, locale_t locale,...)
 Writes formatted string to the stream.
 
size_t write_vsprintf (_Printf_format_string_params_(2) const char *format, locale_t locale, va_list params)
 Writes formatted string to the stream.
 
size_t write_vsprintf (_Printf_format_string_params_(2) const wchar_t *format, locale_t locale, va_list params)
 Writes formatted string to the stream.
 
+basicoperator>> (int8_t &data)
 
+basicoperator<< (const int8_t data)
 
+basicoperator>> (int16_t &data)
 
+basicoperator<< (const int16_t data)
 
+basicoperator>> (int32_t &data)
 
+basicoperator<< (const int32_t data)
 
+basicoperator>> (int64_t &data)
 
+basicoperator<< (const int64_t data)
 
+basicoperator>> (uint8_t &data)
 
+basicoperator<< (const uint8_t data)
 
+basicoperator>> (uint16_t &data)
 
+basicoperator<< (const uint16_t data)
 
+basicoperator>> (uint32_t &data)
 
+basicoperator<< (const uint32_t data)
 
+basicoperator>> (uint64_t &data)
 
+basicoperator<< (const uint64_t data)
 
+basicoperator>> (float &data)
 
+basicoperator<< (const float data)
 
+basicoperator>> (double &data)
 
+basicoperator<< (const double data)
 
+basicoperator>> (char &data)
 
+basicoperator<< (const char data)
 
+template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
basicoperator>> (std::basic_string< _Elem, _Traits, _Ax > &data)
 
+template<class T >
basicoperator<< (const T *data)
 
+ + + +

+Protected Member Functions

+void init (basic &source)
 
+ + + + + + +

+Protected Attributes

+basicm_source
 
- Protected Attributes inherited from stdex::stream::basic
+state_t m_state
 
+

Detailed Description

+

Modifies data on the fly when reading from/writing to a source stream.

+

Member Function Documentation

+ +

◆ close()

+ +
+
+ + + + + +
+ + + + + + + +
virtual void stdex::stream::converter::close ()
+
+inlinevirtual
+
+ +

Closes the stream.

+ +

Reimplemented from stdex::stream::basic.

+ +
+
+ +

◆ flush()

+ +
+
+ + + + + +
+ + + + + + + +
virtual void stdex::stream::converter::flush ()
+
+inlinevirtual
+
+ +

Persists volatile element data.

+ +

Reimplemented from stdex::stream::basic.

+ +

Reimplemented in stdex::stream::async_writer< CAPACITY >, and stdex::stream::buffer.

+ +
+
+ +

◆ read()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual size_t stdex::stream::converter::read (_Out_writes_bytes_to_opt_(length, return) void * data,
size_t length 
)
+
+inlinevirtual
+
+ +

Reads block of data from the stream.

+
Parameters
+ + + +
[out]dataBuffer to store read data
[in]lengthByte limit of data to read
+
+
+
Returns
Number of bytes succesfully read. On EOF, 0 is returned and stream state is set to state_t::eof. On error, 0 is returned and stream state is set to state_t::fail. On null reads (length == 0), 0 is returned and stream state is set to state_t::ok.
+ +

Reimplemented from stdex::stream::basic.

+ +

Reimplemented in stdex::stream::async_reader< CAPACITY >, stdex::stream::buffer, stdex::stream::limiter, and stdex::stream::window.

+ +
+
+ +

◆ write()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual size_t stdex::stream::converter::write (_In_reads_bytes_opt_(length) const void * data,
size_t length 
)
+
+inlinevirtual
+
+ +

Writes block of data to the stream.

+
Parameters
+ + + +
[in]dataBuffer to write data from
[in]lengthNumber of bytes to write
+
+
+
Returns
Number of bytes succesfully written. On error, stream state is set to state_t::fail.
+ +

Reimplemented from stdex::stream::basic.

+ +

Reimplemented in stdex::stream::async_writer< CAPACITY >, stdex::stream::buffer, stdex::stream::limiter, and stdex::stream::window.

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/classstdex_1_1stream_1_1converter.png b/classstdex_1_1stream_1_1converter.png new file mode 100644 index 000000000..6ca3b51a5 Binary files /dev/null and b/classstdex_1_1stream_1_1converter.png differ diff --git a/classstdex_1_1stream_1_1diag__file-members.html b/classstdex_1_1stream_1_1diag__file-members.html new file mode 100644 index 000000000..36e6f4aa8 --- /dev/null +++ b/classstdex_1_1stream_1_1diag__file-members.html @@ -0,0 +1,162 @@ + + + + + + + +stdex: Member List + + + + + + + + + +
+
+ + + + + + +
+
stdex +
+
Additional custom or not Standard C++ covered algorithms
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
stdex::stream::diag_file Member List
+
+
+ +

This is the complete list of members for stdex::stream::diag_file, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
atime() conststdex::stream::basic_fileinlinevirtual
basic(state_t state=state_t::ok) (defined in stdex::stream::basic)stdex::stream::basicinline
close()stdex::stream::diag_fileinlinevirtual
ctime() conststdex::stream::basic_fileinlinevirtual
diag_file(basic_file *const *files, size_t num_files) (defined in stdex::stream::diag_file)stdex::stream::diag_fileinline
flush()stdex::stream::diag_fileinlinevirtual
lock(fpos_t offset, fsize_t length)stdex::stream::diag_fileinlinevirtual
m_files (defined in stdex::stream::diag_file)stdex::stream::diag_fileprotected
m_state (defined in stdex::stream::basic)stdex::stream::basicprotected
m_tmp (defined in stdex::stream::diag_file)stdex::stream::diag_fileprotected
mtime() conststdex::stream::basic_fileinlinevirtual
ok() conststdex::stream::basicinline
operator<<(const int8_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const int16_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const int32_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const int64_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint8_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint16_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint32_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint64_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const float data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const double data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const char data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const T *data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int8_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int16_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int32_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int64_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint8_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint16_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint32_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint64_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(float &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(double &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(char &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(std::basic_string< _Elem, _Traits, _Ax > &data) (defined in stdex::stream::basic)stdex::stream::basicinline
read(_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)stdex::stream::diag_fileinlinevirtual
read_array(_Out_writes_bytes_(size *count) void *array, size_t size, size_t count)stdex::stream::basicinline
read_byte()stdex::stream::basicinline
read_charset(charset_id default_charset=charset_id::default)stdex::stream::basic_fileinline
read_data(T &data)stdex::stream::basicinline
read_remainder(size_t max_length=SIZE_MAX)stdex::stream::basic_fileinlinevirtual
read_str(std::basic_string< _Elem, _Traits, _Ax > &data)stdex::stream::basicinline
readln(std::basic_string< char, _Traits, _Ax > &str)stdex::stream::basicinline
readln(std::basic_string< wchar_t, _Traits, _Ax > &wstr)stdex::stream::basicinline
readln(std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)stdex::stream::basicinline
readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline
readln_and_attach(std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)stdex::stream::basicinline
seek(foff_t offset, seek_t how=seek_t::beg)stdex::stream::diag_fileinlinevirtual
seekbeg(fpos_t offset)stdex::stream::basic_fileinline
seekcur(foff_t offset)stdex::stream::basic_fileinline
seekend(foff_t offset)stdex::stream::basic_fileinline
set_atime(time_point date)stdex::stream::basic_fileinlinevirtual
set_ctime(time_point date)stdex::stream::basic_fileinlinevirtual
set_mtime(time_point date)stdex::stream::basic_fileinlinevirtual
size()stdex::stream::diag_fileinlinevirtual
skip(fsize_t amount)stdex::stream::basic_fileinlinevirtual
state() conststdex::stream::basicinline
tell() conststdex::stream::diag_fileinlinevirtual
truncate()stdex::stream::diag_fileinlinevirtual
unlock(fpos_t offset, fsize_t length)stdex::stream::diag_fileinlinevirtual
write(_In_reads_bytes_opt_(length) const void *data, size_t length)stdex::stream::diag_fileinlinevirtual
write_array(_In_reads_bytes_opt_(size *count) const void *array, size_t size, size_t count)stdex::stream::basicinline
write_array(_In_reads_or_z_opt_(num_chars) const wchar_t *wstr, size_t num_chars, charset_id charset)stdex::stream::basicinline
write_byte(uint8_t byte, fsize_t amount=1)stdex::stream::basicinline
write_charset(charset_id charset)stdex::stream::basicinline
write_data(const T data)stdex::stream::basicinline
write_sprintf(_Printf_format_string_params_(2) const char *format, locale_t locale,...)stdex::stream::basicinline
write_sprintf(_Printf_format_string_params_(2) const wchar_t *format, locale_t locale,...)stdex::stream::basicinline
write_str(const T *data)stdex::stream::basicinline
write_stream(basic &stream, fsize_t amount=fsize_max)stdex::stream::basicinline
write_vsprintf(_Printf_format_string_params_(2) const char *format, locale_t locale, va_list params)stdex::stream::basicinline
write_vsprintf(_Printf_format_string_params_(2) const wchar_t *format, locale_t locale, va_list params)stdex::stream::basicinline
+ + + + diff --git a/classstdex_1_1stream_1_1diag__file.html b/classstdex_1_1stream_1_1diag__file.html new file mode 100644 index 000000000..cbe49bfc3 --- /dev/null +++ b/classstdex_1_1stream_1_1diag__file.html @@ -0,0 +1,755 @@ + + + + + + + +stdex: stdex::stream::diag_file Class Reference + + + + + + + + + +
+
+ + + + + + +
+
stdex +
+
Additional custom or not Standard C++ covered algorithms
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
+Public Member Functions | +Protected Attributes | +List of all members
+
stdex::stream::diag_file Class Reference
+
+
+ +

Compares multiple files to perform the same. + More...

+ +

#include <stdex/stream.hpp>

+
+Inheritance diagram for stdex::stream::diag_file:
+
+
+ + +stdex::stream::basic_file +stdex::stream::basic + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

diag_file (basic_file *const *files, size_t num_files)
 
virtual size_t read (_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
 Reads block of data from the stream.
 
virtual size_t write (_In_reads_bytes_opt_(length) const void *data, size_t length)
 Writes block of data to the stream.
 
virtual void flush ()
 Persists volatile element data.
 
virtual void close ()
 Closes the stream.
 
virtual fpos_t seek (foff_t offset, seek_t how=seek_t::beg)
 Seeks to specified relative file position.
 
virtual fpos_t tell () const
 Returns absolute file position in file or fpos_max if fails. This method does not update stream state.
 
virtual void lock (fpos_t offset, fsize_t length)
 Locks file section for exclusive access.
 
virtual void unlock (fpos_t offset, fsize_t length)
 Unlocks file section for exclusive access.
 
virtual fsize_t size ()
 Returns file size Should the file size cannot be determined, the method returns fsize_max and it does not reset the state to failed.
 
virtual void truncate ()
 Sets file size - truncates the remainder of file content from the current file position to the end of file.
 
- Public Member Functions inherited from stdex::stream::basic_file
virtual std::vector< uint8_t > read_remainder (size_t max_length=SIZE_MAX)
 Reads and returns remainder of the stream.
 
virtual fpos_t seek (foff_t offset, seek_t how=seek_t::beg)=0
 Seeks to specified relative file position.
 
fpos_t seekbeg (fpos_t offset)
 Seeks to absolute file position.
 
fpos_t seekcur (foff_t offset)
 Seeks to relative from current file position.
 
fpos_t seekend (foff_t offset)
 Seeks to relative from end file position.
 
virtual void skip (fsize_t amount)
 Skips given amount of bytes of data on the stream.
 
virtual fpos_t tell () const =0
 Returns absolute file position in file or fpos_max if fails. This method does not update stream state.
 
virtual void lock (fpos_t offset, fsize_t length)
 Locks file section for exclusive access.
 
virtual void unlock (fpos_t offset, fsize_t length)
 Unlocks file section for exclusive access.
 
virtual fsize_t size ()=0
 Returns file size Should the file size cannot be determined, the method returns fsize_max and it does not reset the state to failed.
 
virtual void truncate ()=0
 Sets file size - truncates the remainder of file content from the current file position to the end of file.
 
virtual time_point ctime () const
 Returns file creation time.
 
virtual time_point atime () const
 Returns file access time.
 
virtual time_point mtime () const
 Returns file modification time.
 
virtual void set_ctime (time_point date)
 Sets file create time.
 
virtual void set_atime (time_point date)
 Sets file access time.
 
virtual void set_mtime (time_point date)
 Sets file modification time.
 
charset_id read_charset (charset_id default_charset=charset_id::default)
 Attempts to detect textfile charset based on UTF16 or UTF8 BOM.
 
- Public Member Functions inherited from stdex::stream::basic
basic (state_t state=state_t::ok)
 
virtual size_t read (_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
 Reads block of data from the stream.
 
virtual size_t write (_In_reads_bytes_opt_(length) const void *data, size_t length)
 Writes block of data to the stream.
 
virtual void flush ()
 Persists volatile element data.
 
virtual void close ()
 Closes the stream.
 
virtual void skip (fsize_t amount)
 Skips given amount of bytes of data on the stream.
 
+state_t state () const
 Returns stream state after last operation.
 
+bool ok () const
 Returns true if the stream state is clean i.e. previous operation was succesful.
 
virtual std::vector< uint8_t > read_remainder (size_t max_length=SIZE_MAX)
 Reads and returns remainder of the stream.
 
+uint8_t read_byte ()
 Reads one byte of data.
 
+void write_byte (uint8_t byte, fsize_t amount=1)
 Writes a byte of data.
 
template<class T >
basicread_data (T &data)
 Reads one primitive data type.
 
template<class T >
basicwrite_data (const T data)
 Writes one primitive data type.
 
template<class _Traits = std::char_traits<char>, class _Ax = std::allocator<char>>
size_t readln (std::basic_string< char, _Traits, _Ax > &str)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln (std::basic_string< wchar_t, _Traits, _Ax > &wstr)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln (std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
size_t readln_and_attach (std::basic_string< _Elem, _Traits, _Ax > &str)
 Reads stream to the end-of-line or end-of-file and append to str.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln_and_attach (std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)
 Reads stream to the end-of-line or end-of-file and append to str.
 
size_t read_array (_Out_writes_bytes_(size *count) void *array, size_t size, size_t count)
 Reads an array of data from the stream.
 
size_t write_array (_In_reads_bytes_opt_(size *count) const void *array, size_t size, size_t count)
 Writes an array of data to the stream.
 
size_t write_array (_In_reads_or_z_opt_(num_chars) const wchar_t *wstr, size_t num_chars, charset_id charset)
 Writes array of characters to the stream.
 
template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
basicread_str (std::basic_string< _Elem, _Traits, _Ax > &data)
 Reads length-prefixed string from the stream.
 
template<class T >
basicwrite_str (const T *data)
 Writes string to the stream length-prefixed.
 
fsize_t write_stream (basic &stream, fsize_t amount=fsize_max)
 Writes content of another stream.
 
+void write_charset (charset_id charset)
 Writes UTF8 or UTF-16 byte-order-mark.
 
size_t write_sprintf (_Printf_format_string_params_(2) const char *format, locale_t locale,...)
 Writes formatted string to the stream.
 
size_t write_sprintf (_Printf_format_string_params_(2) const wchar_t *format, locale_t locale,...)
 Writes formatted string to the stream.
 
size_t write_vsprintf (_Printf_format_string_params_(2) const char *format, locale_t locale, va_list params)
 Writes formatted string to the stream.
 
size_t write_vsprintf (_Printf_format_string_params_(2) const wchar_t *format, locale_t locale, va_list params)
 Writes formatted string to the stream.
 
+basicoperator>> (int8_t &data)
 
+basicoperator<< (const int8_t data)
 
+basicoperator>> (int16_t &data)
 
+basicoperator<< (const int16_t data)
 
+basicoperator>> (int32_t &data)
 
+basicoperator<< (const int32_t data)
 
+basicoperator>> (int64_t &data)
 
+basicoperator<< (const int64_t data)
 
+basicoperator>> (uint8_t &data)
 
+basicoperator<< (const uint8_t data)
 
+basicoperator>> (uint16_t &data)
 
+basicoperator<< (const uint16_t data)
 
+basicoperator>> (uint32_t &data)
 
+basicoperator<< (const uint32_t data)
 
+basicoperator>> (uint64_t &data)
 
+basicoperator<< (const uint64_t data)
 
+basicoperator>> (float &data)
 
+basicoperator<< (const float data)
 
+basicoperator>> (double &data)
 
+basicoperator<< (const double data)
 
+basicoperator>> (char &data)
 
+basicoperator<< (const char data)
 
+template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
basicoperator>> (std::basic_string< _Elem, _Traits, _Ax > &data)
 
+template<class T >
basicoperator<< (const T *data)
 
+ + + + + + + + +

+Protected Attributes

+std::vector< basic_file * > m_files
 
+std::vector< uint8_t > m_tmp
 
- Protected Attributes inherited from stdex::stream::basic
+state_t m_state
 
+

Detailed Description

+

Compares multiple files to perform the same.

+

Member Function Documentation

+ +

◆ close()

+ +
+
+ + + + + +
+ + + + + + + +
virtual void stdex::stream::diag_file::close ()
+
+inlinevirtual
+
+ +

Closes the stream.

+ +

Reimplemented from stdex::stream::basic.

+ +
+
+ +

◆ flush()

+ +
+
+ + + + + +
+ + + + + + + +
virtual void stdex::stream::diag_file::flush ()
+
+inlinevirtual
+
+ +

Persists volatile element data.

+ +

Reimplemented from stdex::stream::basic.

+ +
+
+ +

◆ lock()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual void stdex::stream::diag_file::lock (fpos_t offset,
fsize_t length 
)
+
+inlinevirtual
+
+ +

Locks file section for exclusive access.

+ +

Reimplemented from stdex::stream::basic_file.

+ +
+
+ +

◆ read()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual size_t stdex::stream::diag_file::read (_Out_writes_bytes_to_opt_(length, return) void * data,
size_t length 
)
+
+inlinevirtual
+
+ +

Reads block of data from the stream.

+
Parameters
+ + + +
[out]dataBuffer to store read data
[in]lengthByte limit of data to read
+
+
+
Returns
Number of bytes succesfully read. On EOF, 0 is returned and stream state is set to state_t::eof. On error, 0 is returned and stream state is set to state_t::fail. On null reads (length == 0), 0 is returned and stream state is set to state_t::ok.
+ +

Reimplemented from stdex::stream::basic.

+ +
+
+ +

◆ seek()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual fpos_t stdex::stream::diag_file::seek (foff_t offset,
seek_t how = seek_t::beg 
)
+
+inlinevirtual
+
+ +

Seeks to specified relative file position.

+
Returns
Absolute file position after seek, or fpos_max if seek failed.
+ +

Implements stdex::stream::basic_file.

+ +
+
+ +

◆ size()

+ +
+
+ + + + + +
+ + + + + + + +
virtual fsize_t stdex::stream::diag_file::size ()
+
+inlinevirtual
+
+ +

Returns file size Should the file size cannot be determined, the method returns fsize_max and it does not reset the state to failed.

+ +

Implements stdex::stream::basic_file.

+ +
+
+ +

◆ tell()

+ +
+
+ + + + + +
+ + + + + + + +
virtual fpos_t stdex::stream::diag_file::tell () const
+
+inlinevirtual
+
+ +

Returns absolute file position in file or fpos_max if fails. This method does not update stream state.

+
Returns
Absolute file position or fpos_max if position cannot be determined.
+ +

Implements stdex::stream::basic_file.

+ +
+
+ +

◆ truncate()

+ +
+
+ + + + + +
+ + + + + + + +
virtual void stdex::stream::diag_file::truncate ()
+
+inlinevirtual
+
+ +

Sets file size - truncates the remainder of file content from the current file position to the end of file.

+ +

Implements stdex::stream::basic_file.

+ +
+
+ +

◆ unlock()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual void stdex::stream::diag_file::unlock (fpos_t offset,
fsize_t length 
)
+
+inlinevirtual
+
+ +

Unlocks file section for exclusive access.

+ +

Reimplemented from stdex::stream::basic_file.

+ +
+
+ +

◆ write()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual size_t stdex::stream::diag_file::write (_In_reads_bytes_opt_(length) const void * data,
size_t length 
)
+
+inlinevirtual
+
+ +

Writes block of data to the stream.

+
Parameters
+ + + +
[in]dataBuffer to write data from
[in]lengthNumber of bytes to write
+
+
+
Returns
Number of bytes succesfully written. On error, stream state is set to state_t::fail.
+ +

Reimplemented from stdex::stream::basic.

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/classstdex_1_1stream_1_1diag__file.png b/classstdex_1_1stream_1_1diag__file.png new file mode 100644 index 000000000..86280ee2d Binary files /dev/null and b/classstdex_1_1stream_1_1diag__file.png differ diff --git a/classstdex_1_1stream_1_1fifo-members.html b/classstdex_1_1stream_1_1fifo-members.html new file mode 100644 index 000000000..324efc6cb --- /dev/null +++ b/classstdex_1_1stream_1_1fifo-members.html @@ -0,0 +1,150 @@ + + + + + + + +stdex: Member List + + + + + + + + + +
+
+ + + + + + +
+
stdex +
+
Additional custom or not Standard C++ covered algorithms
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
stdex::stream::fifo Member List
+
+
+ +

This is the complete list of members for stdex::stream::fifo, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
basic(state_t state=state_t::ok) (defined in stdex::stream::basic)stdex::stream::basicinline
close()stdex::stream::fifoinlinevirtual
fifo() (defined in stdex::stream::fifo)stdex::stream::fifoinline
flush()stdex::stream::basicinlinevirtual
m_head (defined in stdex::stream::fifo)stdex::stream::fifoprotected
m_offset (defined in stdex::stream::fifo)stdex::stream::fifoprotected
m_size (defined in stdex::stream::fifo)stdex::stream::fifoprotected
m_state (defined in stdex::stream::basic)stdex::stream::basicprotected
m_tail (defined in stdex::stream::fifo)stdex::stream::fifoprotected
ok() conststdex::stream::basicinline
operator<<(const int8_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const int16_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const int32_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const int64_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint8_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint16_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint32_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint64_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const float data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const double data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const char data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const T *data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int8_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int16_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int32_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int64_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint8_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint16_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint32_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint64_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(float &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(double &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(char &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(std::basic_string< _Elem, _Traits, _Ax > &data) (defined in stdex::stream::basic)stdex::stream::basicinline
read(_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)stdex::stream::fifoinlinevirtual
read_array(_Out_writes_bytes_(size *count) void *array, size_t size, size_t count)stdex::stream::basicinline
read_byte()stdex::stream::basicinline
read_data(T &data)stdex::stream::basicinline
read_remainder(size_t max_length=SIZE_MAX)stdex::stream::basicinlinevirtual
read_str(std::basic_string< _Elem, _Traits, _Ax > &data)stdex::stream::basicinline
readln(std::basic_string< char, _Traits, _Ax > &str)stdex::stream::basicinline
readln(std::basic_string< wchar_t, _Traits, _Ax > &wstr)stdex::stream::basicinline
readln(std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)stdex::stream::basicinline
readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline
readln_and_attach(std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)stdex::stream::basicinline
size() conststdex::stream::fifoinline
skip(fsize_t amount)stdex::stream::basicinlinevirtual
state() conststdex::stream::basicinline
write(_In_reads_bytes_opt_(length) const void *data, size_t length)stdex::stream::fifoinlinevirtual
write_array(_In_reads_bytes_opt_(size *count) const void *array, size_t size, size_t count)stdex::stream::basicinline
write_array(_In_reads_or_z_opt_(num_chars) const wchar_t *wstr, size_t num_chars, charset_id charset)stdex::stream::basicinline
write_byte(uint8_t byte, fsize_t amount=1)stdex::stream::basicinline
write_charset(charset_id charset)stdex::stream::basicinline
write_data(const T data)stdex::stream::basicinline
write_sprintf(_Printf_format_string_params_(2) const char *format, locale_t locale,...)stdex::stream::basicinline
write_sprintf(_Printf_format_string_params_(2) const wchar_t *format, locale_t locale,...)stdex::stream::basicinline
write_str(const T *data)stdex::stream::basicinline
write_stream(basic &stream, fsize_t amount=fsize_max)stdex::stream::basicinline
write_vsprintf(_Printf_format_string_params_(2) const char *format, locale_t locale, va_list params)stdex::stream::basicinline
write_vsprintf(_Printf_format_string_params_(2) const wchar_t *format, locale_t locale, va_list params)stdex::stream::basicinline
~fifo() (defined in stdex::stream::fifo)stdex::stream::fifoinlinevirtual
+ + + + diff --git a/classstdex_1_1stream_1_1fifo.html b/classstdex_1_1stream_1_1fifo.html new file mode 100644 index 000000000..a92b0d8be --- /dev/null +++ b/classstdex_1_1stream_1_1fifo.html @@ -0,0 +1,453 @@ + + + + + + + +stdex: stdex::stream::fifo Class Reference + + + + + + + + + +
+
+ + + + + + +
+
stdex +
+
Additional custom or not Standard C++ covered algorithms
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
+Classes | +Public Member Functions | +Protected Attributes | +List of all members
+
stdex::stream::fifo Class Reference
+
+
+ +

In-memory FIFO queue. + More...

+ +

#include <stdex/stream.hpp>

+
+Inheritance diagram for stdex::stream::fifo:
+
+
+ + +stdex::stream::basic + +
+ + + + +

+Classes

struct  node_t
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

virtual size_t read (_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
 Reads block of data from the stream.
 
virtual size_t write (_In_reads_bytes_opt_(length) const void *data, size_t length)
 Writes block of data to the stream.
 
virtual void close ()
 Closes the stream.
 
+size_t size () const
 Returns total size of pending data in the queue.
 
- Public Member Functions inherited from stdex::stream::basic
basic (state_t state=state_t::ok)
 
virtual size_t read (_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
 Reads block of data from the stream.
 
virtual size_t write (_In_reads_bytes_opt_(length) const void *data, size_t length)
 Writes block of data to the stream.
 
virtual void flush ()
 Persists volatile element data.
 
virtual void close ()
 Closes the stream.
 
virtual void skip (fsize_t amount)
 Skips given amount of bytes of data on the stream.
 
+state_t state () const
 Returns stream state after last operation.
 
+bool ok () const
 Returns true if the stream state is clean i.e. previous operation was succesful.
 
virtual std::vector< uint8_t > read_remainder (size_t max_length=SIZE_MAX)
 Reads and returns remainder of the stream.
 
+uint8_t read_byte ()
 Reads one byte of data.
 
+void write_byte (uint8_t byte, fsize_t amount=1)
 Writes a byte of data.
 
template<class T >
basicread_data (T &data)
 Reads one primitive data type.
 
template<class T >
basicwrite_data (const T data)
 Writes one primitive data type.
 
template<class _Traits = std::char_traits<char>, class _Ax = std::allocator<char>>
size_t readln (std::basic_string< char, _Traits, _Ax > &str)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln (std::basic_string< wchar_t, _Traits, _Ax > &wstr)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln (std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
size_t readln_and_attach (std::basic_string< _Elem, _Traits, _Ax > &str)
 Reads stream to the end-of-line or end-of-file and append to str.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln_and_attach (std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)
 Reads stream to the end-of-line or end-of-file and append to str.
 
size_t read_array (_Out_writes_bytes_(size *count) void *array, size_t size, size_t count)
 Reads an array of data from the stream.
 
size_t write_array (_In_reads_bytes_opt_(size *count) const void *array, size_t size, size_t count)
 Writes an array of data to the stream.
 
size_t write_array (_In_reads_or_z_opt_(num_chars) const wchar_t *wstr, size_t num_chars, charset_id charset)
 Writes array of characters to the stream.
 
template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
basicread_str (std::basic_string< _Elem, _Traits, _Ax > &data)
 Reads length-prefixed string from the stream.
 
template<class T >
basicwrite_str (const T *data)
 Writes string to the stream length-prefixed.
 
fsize_t write_stream (basic &stream, fsize_t amount=fsize_max)
 Writes content of another stream.
 
+void write_charset (charset_id charset)
 Writes UTF8 or UTF-16 byte-order-mark.
 
size_t write_sprintf (_Printf_format_string_params_(2) const char *format, locale_t locale,...)
 Writes formatted string to the stream.
 
size_t write_sprintf (_Printf_format_string_params_(2) const wchar_t *format, locale_t locale,...)
 Writes formatted string to the stream.
 
size_t write_vsprintf (_Printf_format_string_params_(2) const char *format, locale_t locale, va_list params)
 Writes formatted string to the stream.
 
size_t write_vsprintf (_Printf_format_string_params_(2) const wchar_t *format, locale_t locale, va_list params)
 Writes formatted string to the stream.
 
+basicoperator>> (int8_t &data)
 
+basicoperator<< (const int8_t data)
 
+basicoperator>> (int16_t &data)
 
+basicoperator<< (const int16_t data)
 
+basicoperator>> (int32_t &data)
 
+basicoperator<< (const int32_t data)
 
+basicoperator>> (int64_t &data)
 
+basicoperator<< (const int64_t data)
 
+basicoperator>> (uint8_t &data)
 
+basicoperator<< (const uint8_t data)
 
+basicoperator>> (uint16_t &data)
 
+basicoperator<< (const uint16_t data)
 
+basicoperator>> (uint32_t &data)
 
+basicoperator<< (const uint32_t data)
 
+basicoperator>> (uint64_t &data)
 
+basicoperator<< (const uint64_t data)
 
+basicoperator>> (float &data)
 
+basicoperator<< (const float data)
 
+basicoperator>> (double &data)
 
+basicoperator<< (const double data)
 
+basicoperator>> (char &data)
 
+basicoperator<< (const char data)
 
+template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
basicoperator>> (std::basic_string< _Elem, _Traits, _Ax > &data)
 
+template<class T >
basicoperator<< (const T *data)
 
+ + + + + + + + + + + + +

+Protected Attributes

+size_t m_offset
 
+size_t m_size
 
+struct stdex::stream::fifo::node_tm_head
 
+struct stdex::stream::fifo::node_tm_tail
 
- Protected Attributes inherited from stdex::stream::basic
+state_t m_state
 
+

Detailed Description

+

In-memory FIFO queue.

+

Member Function Documentation

+ +

◆ close()

+ +
+
+ + + + + +
+ + + + + + + +
virtual void stdex::stream::fifo::close ()
+
+inlinevirtual
+
+ +

Closes the stream.

+ +

Reimplemented from stdex::stream::basic.

+ +
+
+ +

◆ read()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual size_t stdex::stream::fifo::read (_Out_writes_bytes_to_opt_(length, return) void * data,
size_t length 
)
+
+inlinevirtual
+
+ +

Reads block of data from the stream.

+
Parameters
+ + + +
[out]dataBuffer to store read data
[in]lengthByte limit of data to read
+
+
+
Returns
Number of bytes succesfully read. On EOF, 0 is returned and stream state is set to state_t::eof. On error, 0 is returned and stream state is set to state_t::fail. On null reads (length == 0), 0 is returned and stream state is set to state_t::ok.
+ +

Reimplemented from stdex::stream::basic.

+ +
+
+ +

◆ write()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual size_t stdex::stream::fifo::write (_In_reads_bytes_opt_(length) const void * data,
size_t length 
)
+
+inlinevirtual
+
+ +

Writes block of data to the stream.

+
Parameters
+ + + +
[in]dataBuffer to write data from
[in]lengthNumber of bytes to write
+
+
+
Returns
Number of bytes succesfully written. On error, stream state is set to state_t::fail.
+ +

Reimplemented from stdex::stream::basic.

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/classstdex_1_1stream_1_1fifo.png b/classstdex_1_1stream_1_1fifo.png new file mode 100644 index 000000000..451f9e96b Binary files /dev/null and b/classstdex_1_1stream_1_1fifo.png differ diff --git a/classstdex_1_1stream_1_1file-members.html b/classstdex_1_1stream_1_1file-members.html new file mode 100644 index 000000000..c83582977 --- /dev/null +++ b/classstdex_1_1stream_1_1file-members.html @@ -0,0 +1,178 @@ + + + + + + + +stdex: Member List + + + + + + + + + +
+
+ + + + + + +
+
stdex +
+
Additional custom or not Standard C++ covered algorithms
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
stdex::stream::file Member List
+
+
+ +

This is the complete list of members for stdex::stream::file, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
atime() conststdex::stream::fileinlinevirtual
basic(state_t state=state_t::ok) (defined in stdex::stream::basic)stdex::stream::basicinline
basic_sys(sys_handle h=invalid_handle, state_t state=state_t::ok) (defined in stdex::stream::basic_sys)stdex::stream::basic_sysinline
stdex::close()stdex::stream::basicinlinevirtual
stdex::stream::basic_sys::close()stdex::stream::basic_sysinlinevirtual
stdex::sys_object::close(sys_handle h)stdex::sys_objectinlineprotectedstatic
ctime() conststdex::stream::fileinlinevirtual
duplicate(sys_handle h, bool inherit)stdex::sys_objectinlineprotectedstatic
file(sys_handle h=invalid_handle, state_t state=state_t::ok) (defined in stdex::stream::file)stdex::stream::fileinline
file(const sys_char *filename, int mode)stdex::stream::fileinline
stdex::flush()stdex::stream::basicinlinevirtual
stdex::stream::basic_sys::flush()stdex::stream::basic_sysinlinevirtual
get() const noexceptstdex::sys_objectinline
lock(fpos_t offset, fsize_t length)stdex::stream::fileinlinevirtual
m_h (defined in stdex::sys_object)stdex::sys_objectprotected
m_state (defined in stdex::stream::basic)stdex::stream::basicprotected
mtime() conststdex::stream::fileinlinevirtual
ok() conststdex::stream::basicinline
open(const sys_char *filename, int mode)stdex::stream::fileinline
operator bool() const noexceptstdex::sys_objectinline
operator<<(const int8_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const int16_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const int32_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const int64_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint8_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint16_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint32_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint64_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const float data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const double data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const char data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const T *data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator=(const sys_object &other) (defined in stdex::sys_object)stdex::sys_objectinline
operator=(sys_object &&other) noexcept (defined in stdex::sys_object)stdex::sys_objectinline
operator>>(int8_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int16_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int32_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int64_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint8_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint16_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint32_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint64_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(float &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(double &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(char &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(std::basic_string< _Elem, _Traits, _Ax > &data) (defined in stdex::stream::basic)stdex::stream::basicinline
stdex::read(_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)stdex::stream::basicinlinevirtual
stdex::stream::basic_sys::read(_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)stdex::stream::basic_sysinlinevirtual
read_array(_Out_writes_bytes_(size *count) void *array, size_t size, size_t count)stdex::stream::basicinline
read_byte()stdex::stream::basicinline
read_charset(charset_id default_charset=charset_id::default)stdex::stream::basic_fileinline
read_data(T &data)stdex::stream::basicinline
read_remainder(size_t max_length=SIZE_MAX)stdex::stream::basic_fileinlinevirtual
read_str(std::basic_string< _Elem, _Traits, _Ax > &data)stdex::stream::basicinline
readln(std::basic_string< char, _Traits, _Ax > &str)stdex::stream::basicinline
readln(std::basic_string< wchar_t, _Traits, _Ax > &wstr)stdex::stream::basicinline
readln(std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)stdex::stream::basicinline
readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline
readln_and_attach(std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)stdex::stream::basicinline
seek(foff_t offset, seek_t how=seek_t::beg)stdex::stream::fileinlinevirtual
seekbeg(fpos_t offset)stdex::stream::basic_fileinline
seekcur(foff_t offset)stdex::stream::basic_fileinline
seekend(foff_t offset)stdex::stream::basic_fileinline
set_atime(time_point date)stdex::stream::fileinlinevirtual
set_ctime(time_point date)stdex::stream::fileinlinevirtual
set_mtime(time_point date)stdex::stream::fileinlinevirtual
size()stdex::stream::fileinlinevirtual
skip(fsize_t amount)stdex::stream::basic_fileinlinevirtual
state() conststdex::stream::basicinline
sys_object(sys_handle h=invalid_handle) (defined in stdex::sys_object)stdex::sys_objectinline
sys_object(const sys_object &other) (defined in stdex::sys_object)stdex::sys_objectinline
sys_object(sys_object &&other) noexcept (defined in stdex::sys_object)stdex::sys_objectinline
tell() conststdex::stream::fileinlinevirtual
truncate()stdex::stream::fileinlinevirtual
unlock(fpos_t offset, fsize_t length)stdex::stream::fileinlinevirtual
stdex::write(_In_reads_bytes_opt_(length) const void *data, size_t length)stdex::stream::basicinlinevirtual
stdex::stream::basic_sys::write(_In_reads_bytes_opt_(length) const void *data, size_t length)stdex::stream::basic_sysinlinevirtual
write_array(_In_reads_bytes_opt_(size *count) const void *array, size_t size, size_t count)stdex::stream::basicinline
write_array(_In_reads_or_z_opt_(num_chars) const wchar_t *wstr, size_t num_chars, charset_id charset)stdex::stream::basicinline
write_byte(uint8_t byte, fsize_t amount=1)stdex::stream::basicinline
write_charset(charset_id charset)stdex::stream::basicinline
write_data(const T data)stdex::stream::basicinline
write_sprintf(_Printf_format_string_params_(2) const char *format, locale_t locale,...)stdex::stream::basicinline
write_sprintf(_Printf_format_string_params_(2) const wchar_t *format, locale_t locale,...)stdex::stream::basicinline
write_str(const T *data)stdex::stream::basicinline
write_stream(basic &stream, fsize_t amount=fsize_max)stdex::stream::basicinline
write_vsprintf(_Printf_format_string_params_(2) const char *format, locale_t locale, va_list params)stdex::stream::basicinline
write_vsprintf(_Printf_format_string_params_(2) const wchar_t *format, locale_t locale, va_list params)stdex::stream::basicinline
~sys_object() (defined in stdex::sys_object)stdex::sys_objectinlinevirtual
+ + + + diff --git a/classstdex_1_1stream_1_1file.html b/classstdex_1_1stream_1_1file.html new file mode 100644 index 000000000..bb9fa16b5 --- /dev/null +++ b/classstdex_1_1stream_1_1file.html @@ -0,0 +1,933 @@ + + + + + + + +stdex: stdex::stream::file Class Reference + + + + + + + + + +
+
+ + + + + + +
+
stdex +
+
Additional custom or not Standard C++ covered algorithms
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
+Public Member Functions | +List of all members
+
stdex::stream::file Class Reference
+
+
+ +

File-system file. + More...

+ +

#include <stdex/stream.hpp>

+
+Inheritance diagram for stdex::stream::file:
+
+
+ + +stdex::stream::basic_file +stdex::stream::basic_sys +stdex::stream::basic +stdex::stream::basic +stdex::sys_object + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

file (sys_handle h=invalid_handle, state_t state=state_t::ok)
 
 file (const sys_char *filename, int mode)
 Opens file.
 
void open (const sys_char *filename, int mode)
 Opens file.
 
virtual fpos_t seek (foff_t offset, seek_t how=seek_t::beg)
 Seeks to specified relative file position.
 
virtual fpos_t tell () const
 Returns absolute file position in file or fpos_max if fails. This method does not update stream state.
 
virtual void lock (fpos_t offset, fsize_t length)
 Locks file section for exclusive access.
 
virtual void unlock (fpos_t offset, fsize_t length)
 Unlocks file section for exclusive access.
 
virtual fsize_t size ()
 Returns file size Should the file size cannot be determined, the method returns fsize_max and it does not reset the state to failed.
 
virtual void truncate ()
 Sets file size - truncates the remainder of file content from the current file position to the end of file.
 
virtual time_point ctime () const
 Returns file creation time.
 
virtual time_point atime () const
 Returns file access time.
 
virtual time_point mtime () const
 Returns file modification time.
 
virtual void set_ctime (time_point date)
 Sets file create time.
 
virtual void set_atime (time_point date)
 Sets file access time.
 
virtual void set_mtime (time_point date)
 Sets file modification time.
 
- Public Member Functions inherited from stdex::stream::basic_file
virtual std::vector< uint8_t > read_remainder (size_t max_length=SIZE_MAX)
 Reads and returns remainder of the stream.
 
virtual fpos_t seek (foff_t offset, seek_t how=seek_t::beg)=0
 Seeks to specified relative file position.
 
fpos_t seekbeg (fpos_t offset)
 Seeks to absolute file position.
 
fpos_t seekcur (foff_t offset)
 Seeks to relative from current file position.
 
fpos_t seekend (foff_t offset)
 Seeks to relative from end file position.
 
virtual void skip (fsize_t amount)
 Skips given amount of bytes of data on the stream.
 
virtual fpos_t tell () const =0
 Returns absolute file position in file or fpos_max if fails. This method does not update stream state.
 
virtual void lock (fpos_t offset, fsize_t length)
 Locks file section for exclusive access.
 
virtual void unlock (fpos_t offset, fsize_t length)
 Unlocks file section for exclusive access.
 
virtual fsize_t size ()=0
 Returns file size Should the file size cannot be determined, the method returns fsize_max and it does not reset the state to failed.
 
virtual void truncate ()=0
 Sets file size - truncates the remainder of file content from the current file position to the end of file.
 
virtual time_point ctime () const
 Returns file creation time.
 
virtual time_point atime () const
 Returns file access time.
 
virtual time_point mtime () const
 Returns file modification time.
 
virtual void set_ctime (time_point date)
 Sets file create time.
 
virtual void set_atime (time_point date)
 Sets file access time.
 
virtual void set_mtime (time_point date)
 Sets file modification time.
 
charset_id read_charset (charset_id default_charset=charset_id::default)
 Attempts to detect textfile charset based on UTF16 or UTF8 BOM.
 
- Public Member Functions inherited from stdex::stream::basic
basic (state_t state=state_t::ok)
 
virtual size_t read (_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
 Reads block of data from the stream.
 
virtual size_t write (_In_reads_bytes_opt_(length) const void *data, size_t length)
 Writes block of data to the stream.
 
virtual void flush ()
 Persists volatile element data.
 
virtual void close ()
 Closes the stream.
 
virtual void skip (fsize_t amount)
 Skips given amount of bytes of data on the stream.
 
+state_t state () const
 Returns stream state after last operation.
 
+bool ok () const
 Returns true if the stream state is clean i.e. previous operation was succesful.
 
virtual std::vector< uint8_t > read_remainder (size_t max_length=SIZE_MAX)
 Reads and returns remainder of the stream.
 
+uint8_t read_byte ()
 Reads one byte of data.
 
+void write_byte (uint8_t byte, fsize_t amount=1)
 Writes a byte of data.
 
template<class T >
basicread_data (T &data)
 Reads one primitive data type.
 
template<class T >
basicwrite_data (const T data)
 Writes one primitive data type.
 
template<class _Traits = std::char_traits<char>, class _Ax = std::allocator<char>>
size_t readln (std::basic_string< char, _Traits, _Ax > &str)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln (std::basic_string< wchar_t, _Traits, _Ax > &wstr)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln (std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
size_t readln_and_attach (std::basic_string< _Elem, _Traits, _Ax > &str)
 Reads stream to the end-of-line or end-of-file and append to str.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln_and_attach (std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)
 Reads stream to the end-of-line or end-of-file and append to str.
 
size_t read_array (_Out_writes_bytes_(size *count) void *array, size_t size, size_t count)
 Reads an array of data from the stream.
 
size_t write_array (_In_reads_bytes_opt_(size *count) const void *array, size_t size, size_t count)
 Writes an array of data to the stream.
 
size_t write_array (_In_reads_or_z_opt_(num_chars) const wchar_t *wstr, size_t num_chars, charset_id charset)
 Writes array of characters to the stream.
 
template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
basicread_str (std::basic_string< _Elem, _Traits, _Ax > &data)
 Reads length-prefixed string from the stream.
 
template<class T >
basicwrite_str (const T *data)
 Writes string to the stream length-prefixed.
 
fsize_t write_stream (basic &stream, fsize_t amount=fsize_max)
 Writes content of another stream.
 
+void write_charset (charset_id charset)
 Writes UTF8 or UTF-16 byte-order-mark.
 
size_t write_sprintf (_Printf_format_string_params_(2) const char *format, locale_t locale,...)
 Writes formatted string to the stream.
 
size_t write_sprintf (_Printf_format_string_params_(2) const wchar_t *format, locale_t locale,...)
 Writes formatted string to the stream.
 
size_t write_vsprintf (_Printf_format_string_params_(2) const char *format, locale_t locale, va_list params)
 Writes formatted string to the stream.
 
size_t write_vsprintf (_Printf_format_string_params_(2) const wchar_t *format, locale_t locale, va_list params)
 Writes formatted string to the stream.
 
+basicoperator>> (int8_t &data)
 
+basicoperator<< (const int8_t data)
 
+basicoperator>> (int16_t &data)
 
+basicoperator<< (const int16_t data)
 
+basicoperator>> (int32_t &data)
 
+basicoperator<< (const int32_t data)
 
+basicoperator>> (int64_t &data)
 
+basicoperator<< (const int64_t data)
 
+basicoperator>> (uint8_t &data)
 
+basicoperator<< (const uint8_t data)
 
+basicoperator>> (uint16_t &data)
 
+basicoperator<< (const uint16_t data)
 
+basicoperator>> (uint32_t &data)
 
+basicoperator<< (const uint32_t data)
 
+basicoperator>> (uint64_t &data)
 
+basicoperator<< (const uint64_t data)
 
+basicoperator>> (float &data)
 
+basicoperator<< (const float data)
 
+basicoperator>> (double &data)
 
+basicoperator<< (const double data)
 
+basicoperator>> (char &data)
 
+basicoperator<< (const char data)
 
+template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
basicoperator>> (std::basic_string< _Elem, _Traits, _Ax > &data)
 
+template<class T >
basicoperator<< (const T *data)
 
- Public Member Functions inherited from stdex::stream::basic_sys
basic_sys (sys_handle h=invalid_handle, state_t state=state_t::ok)
 
virtual size_t read (_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
 Reads block of data from the stream.
 
virtual size_t write (_In_reads_bytes_opt_(length) const void *data, size_t length)
 Writes block of data to the stream.
 
virtual void close ()
 Closes the stream.
 
virtual void flush ()
 Persists volatile element data.
 
- Public Member Functions inherited from stdex::sys_object
sys_object (sys_handle h=invalid_handle)
 
sys_object (const sys_object &other)
 
+sys_objectoperator= (const sys_object &other)
 
sys_object (sys_object &&other) noexcept
 
+sys_objectoperator= (sys_object &&other) noexcept
 
virtual void close ()
 Closes object.
 
operator bool () const noexcept
 Returns true if object is valid.
 
+sys_handle get () const noexcept
 Returns object handle.
 
+ + + + + + + + + + + + + + +

+Additional Inherited Members

- Static Protected Member Functions inherited from stdex::sys_object
+static void close (sys_handle h)
 Closes object.
 
+static sys_handle duplicate (sys_handle h, bool inherit)
 Duplicates given object.
 
- Protected Attributes inherited from stdex::stream::basic
+state_t m_state
 
- Protected Attributes inherited from stdex::sys_object
+sys_handle m_h
 
+

Detailed Description

+

File-system file.

+

Constructor & Destructor Documentation

+ +

◆ file()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
stdex::stream::file::file (const sys_char * filename,
int mode 
)
+
+inline
+
+ +

Opens file.

+
Parameters
+ + + +
[in]filenameFilename
[in]modeBitwise combination of mode_t flags
+
+
+ +
+
+

Member Function Documentation

+ +

◆ atime()

+ +
+
+ + + + + +
+ + + + + + + +
virtual time_point stdex::stream::file::atime () const
+
+inlinevirtual
+
+ +

Returns file access time.

+ +

Reimplemented from stdex::stream::basic_file.

+ +
+
+ +

◆ ctime()

+ +
+
+ + + + + +
+ + + + + + + +
virtual time_point stdex::stream::file::ctime () const
+
+inlinevirtual
+
+ +

Returns file creation time.

+ +

Reimplemented from stdex::stream::basic_file.

+ +
+
+ +

◆ lock()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual void stdex::stream::file::lock (fpos_t offset,
fsize_t length 
)
+
+inlinevirtual
+
+ +

Locks file section for exclusive access.

+ +

Reimplemented from stdex::stream::basic_file.

+ +
+
+ +

◆ mtime()

+ +
+
+ + + + + +
+ + + + + + + +
virtual time_point stdex::stream::file::mtime () const
+
+inlinevirtual
+
+ +

Returns file modification time.

+ +

Reimplemented from stdex::stream::basic_file.

+ +
+
+ +

◆ open()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void stdex::stream::file::open (const sys_char * filename,
int mode 
)
+
+inline
+
+ +

Opens file.

+
Parameters
+ + + +
[in]filenameFilename
[in]modeBitwise combination of mode_t flags
+
+
+ +
+
+ +

◆ seek()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual fpos_t stdex::stream::file::seek (foff_t offset,
seek_t how = seek_t::beg 
)
+
+inlinevirtual
+
+ +

Seeks to specified relative file position.

+
Returns
Absolute file position after seek, or fpos_max if seek failed.
+ +

Implements stdex::stream::basic_file.

+ +
+
+ +

◆ set_atime()

+ +
+
+ + + + + +
+ + + + + + + + +
virtual void stdex::stream::file::set_atime (time_point date)
+
+inlinevirtual
+
+ +

Sets file access time.

+ +

Reimplemented from stdex::stream::basic_file.

+ +
+
+ +

◆ set_ctime()

+ +
+
+ + + + + +
+ + + + + + + + +
virtual void stdex::stream::file::set_ctime (time_point date)
+
+inlinevirtual
+
+ +

Sets file create time.

+ +

Reimplemented from stdex::stream::basic_file.

+ +
+
+ +

◆ set_mtime()

+ +
+
+ + + + + +
+ + + + + + + + +
virtual void stdex::stream::file::set_mtime (time_point date)
+
+inlinevirtual
+
+ +

Sets file modification time.

+ +

Reimplemented from stdex::stream::basic_file.

+ +
+
+ +

◆ size()

+ +
+
+ + + + + +
+ + + + + + + +
virtual fsize_t stdex::stream::file::size ()
+
+inlinevirtual
+
+ +

Returns file size Should the file size cannot be determined, the method returns fsize_max and it does not reset the state to failed.

+ +

Implements stdex::stream::basic_file.

+ +
+
+ +

◆ tell()

+ +
+
+ + + + + +
+ + + + + + + +
virtual fpos_t stdex::stream::file::tell () const
+
+inlinevirtual
+
+ +

Returns absolute file position in file or fpos_max if fails. This method does not update stream state.

+
Returns
Absolute file position or fpos_max if position cannot be determined.
+ +

Implements stdex::stream::basic_file.

+ +
+
+ +

◆ truncate()

+ +
+
+ + + + + +
+ + + + + + + +
virtual void stdex::stream::file::truncate ()
+
+inlinevirtual
+
+ +

Sets file size - truncates the remainder of file content from the current file position to the end of file.

+ +

Implements stdex::stream::basic_file.

+ +
+
+ +

◆ unlock()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual void stdex::stream::file::unlock (fpos_t offset,
fsize_t length 
)
+
+inlinevirtual
+
+ +

Unlocks file section for exclusive access.

+ +

Reimplemented from stdex::stream::basic_file.

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/classstdex_1_1stream_1_1file.png b/classstdex_1_1stream_1_1file.png new file mode 100644 index 000000000..857652f52 Binary files /dev/null and b/classstdex_1_1stream_1_1file.png differ diff --git a/classstdex_1_1stream_1_1file__window-members.html b/classstdex_1_1stream_1_1file__window-members.html new file mode 100644 index 000000000..1f3e00a0c --- /dev/null +++ b/classstdex_1_1stream_1_1file__window-members.html @@ -0,0 +1,163 @@ + + + + + + + +stdex: Member List + + + + + + + + + +
+
+ + + + + + +
+
stdex +
+
Additional custom or not Standard C++ covered algorithms
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
stdex::stream::file_window Member List
+
+
+ +

This is the complete list of members for stdex::stream::file_window, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
atime() conststdex::stream::basic_fileinlinevirtual
basic(state_t state=state_t::ok) (defined in stdex::stream::basic)stdex::stream::basicinline
close()stdex::stream::file_windowinlinevirtual
ctime() conststdex::stream::basic_fileinlinevirtual
file_window(basic_file &source, fpos_t offset=0, fsize_t length=0) (defined in stdex::stream::file_window)stdex::stream::file_windowinline
flush()stdex::stream::file_windowinlinevirtual
lock(fpos_t offset, fsize_t length)stdex::stream::file_windowinlinevirtual
m_offset (defined in stdex::stream::file_window)stdex::stream::file_windowprotected
m_region (defined in stdex::stream::file_window)stdex::stream::file_windowprotected
m_source (defined in stdex::stream::file_window)stdex::stream::file_windowprotected
m_state (defined in stdex::stream::basic)stdex::stream::basicprotected
mtime() conststdex::stream::basic_fileinlinevirtual
ok() conststdex::stream::basicinline
operator<<(const int8_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const int16_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const int32_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const int64_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint8_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint16_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint32_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint64_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const float data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const double data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const char data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const T *data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int8_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int16_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int32_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int64_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint8_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint16_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint32_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint64_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(float &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(double &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(char &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(std::basic_string< _Elem, _Traits, _Ax > &data) (defined in stdex::stream::basic)stdex::stream::basicinline
read(_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)stdex::stream::file_windowinlinevirtual
read_array(_Out_writes_bytes_(size *count) void *array, size_t size, size_t count)stdex::stream::basicinline
read_byte()stdex::stream::basicinline
read_charset(charset_id default_charset=charset_id::default)stdex::stream::basic_fileinline
read_data(T &data)stdex::stream::basicinline
read_remainder(size_t max_length=SIZE_MAX)stdex::stream::basic_fileinlinevirtual
read_str(std::basic_string< _Elem, _Traits, _Ax > &data)stdex::stream::basicinline
readln(std::basic_string< char, _Traits, _Ax > &str)stdex::stream::basicinline
readln(std::basic_string< wchar_t, _Traits, _Ax > &wstr)stdex::stream::basicinline
readln(std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)stdex::stream::basicinline
readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline
readln_and_attach(std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)stdex::stream::basicinline
seek(foff_t offset, seek_t how=seek_t::beg)stdex::stream::file_windowinlinevirtual
seekbeg(fpos_t offset)stdex::stream::basic_fileinline
seekcur(foff_t offset)stdex::stream::basic_fileinline
seekend(foff_t offset)stdex::stream::basic_fileinline
set_atime(time_point date)stdex::stream::basic_fileinlinevirtual
set_ctime(time_point date)stdex::stream::basic_fileinlinevirtual
set_mtime(time_point date)stdex::stream::basic_fileinlinevirtual
size()stdex::stream::file_windowinlinevirtual
skip(fsize_t amount)stdex::stream::file_windowinlinevirtual
state() conststdex::stream::basicinline
tell() conststdex::stream::file_windowinlinevirtual
truncate()stdex::stream::file_windowinlinevirtual
unlock(fpos_t offset, fsize_t length)stdex::stream::file_windowinlinevirtual
write(_In_reads_bytes_opt_(length) const void *data, size_t length)stdex::stream::file_windowinlinevirtual
write_array(_In_reads_bytes_opt_(size *count) const void *array, size_t size, size_t count)stdex::stream::basicinline
write_array(_In_reads_or_z_opt_(num_chars) const wchar_t *wstr, size_t num_chars, charset_id charset)stdex::stream::basicinline
write_byte(uint8_t byte, fsize_t amount=1)stdex::stream::basicinline
write_charset(charset_id charset)stdex::stream::basicinline
write_data(const T data)stdex::stream::basicinline
write_sprintf(_Printf_format_string_params_(2) const char *format, locale_t locale,...)stdex::stream::basicinline
write_sprintf(_Printf_format_string_params_(2) const wchar_t *format, locale_t locale,...)stdex::stream::basicinline
write_str(const T *data)stdex::stream::basicinline
write_stream(basic &stream, fsize_t amount=fsize_max)stdex::stream::basicinline
write_vsprintf(_Printf_format_string_params_(2) const char *format, locale_t locale, va_list params)stdex::stream::basicinline
write_vsprintf(_Printf_format_string_params_(2) const wchar_t *format, locale_t locale, va_list params)stdex::stream::basicinline
+ + + + diff --git a/classstdex_1_1stream_1_1file__window.html b/classstdex_1_1stream_1_1file__window.html new file mode 100644 index 000000000..23c40fdd5 --- /dev/null +++ b/classstdex_1_1stream_1_1file__window.html @@ -0,0 +1,791 @@ + + + + + + + +stdex: stdex::stream::file_window Class Reference + + + + + + + + + +
+
+ + + + + + +
+
stdex +
+
Additional custom or not Standard C++ covered algorithms
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
+Public Member Functions | +Protected Attributes | +List of all members
+
stdex::stream::file_window Class Reference
+
+
+ +

Limits file reading/writing to a predefined window. + More...

+ +

#include <stdex/stream.hpp>

+
+Inheritance diagram for stdex::stream::file_window:
+
+
+ + +stdex::stream::basic_file +stdex::stream::basic + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

file_window (basic_file &source, fpos_t offset=0, fsize_t length=0)
 
virtual size_t read (_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
 Reads block of data from the stream.
 
virtual size_t write (_In_reads_bytes_opt_(length) const void *data, size_t length)
 Writes block of data to the stream.
 
virtual void close ()
 Closes the stream.
 
virtual void flush ()
 Persists volatile element data.
 
virtual fpos_t seek (foff_t offset, seek_t how=seek_t::beg)
 Seeks to specified relative file position.
 
virtual void skip (fsize_t amount)
 Skips given amount of bytes of data on the stream.
 
virtual fpos_t tell () const
 Returns absolute file position in file or fpos_max if fails. This method does not update stream state.
 
virtual void lock (fpos_t offset, fsize_t length)
 Locks file section for exclusive access.
 
virtual void unlock (fpos_t offset, fsize_t length)
 Unlocks file section for exclusive access.
 
virtual fsize_t size ()
 Returns file size Should the file size cannot be determined, the method returns fsize_max and it does not reset the state to failed.
 
virtual void truncate ()
 Sets file size - truncates the remainder of file content from the current file position to the end of file.
 
- Public Member Functions inherited from stdex::stream::basic_file
virtual std::vector< uint8_t > read_remainder (size_t max_length=SIZE_MAX)
 Reads and returns remainder of the stream.
 
virtual fpos_t seek (foff_t offset, seek_t how=seek_t::beg)=0
 Seeks to specified relative file position.
 
fpos_t seekbeg (fpos_t offset)
 Seeks to absolute file position.
 
fpos_t seekcur (foff_t offset)
 Seeks to relative from current file position.
 
fpos_t seekend (foff_t offset)
 Seeks to relative from end file position.
 
virtual void skip (fsize_t amount)
 Skips given amount of bytes of data on the stream.
 
virtual fpos_t tell () const =0
 Returns absolute file position in file or fpos_max if fails. This method does not update stream state.
 
virtual void lock (fpos_t offset, fsize_t length)
 Locks file section for exclusive access.
 
virtual void unlock (fpos_t offset, fsize_t length)
 Unlocks file section for exclusive access.
 
virtual fsize_t size ()=0
 Returns file size Should the file size cannot be determined, the method returns fsize_max and it does not reset the state to failed.
 
virtual void truncate ()=0
 Sets file size - truncates the remainder of file content from the current file position to the end of file.
 
virtual time_point ctime () const
 Returns file creation time.
 
virtual time_point atime () const
 Returns file access time.
 
virtual time_point mtime () const
 Returns file modification time.
 
virtual void set_ctime (time_point date)
 Sets file create time.
 
virtual void set_atime (time_point date)
 Sets file access time.
 
virtual void set_mtime (time_point date)
 Sets file modification time.
 
charset_id read_charset (charset_id default_charset=charset_id::default)
 Attempts to detect textfile charset based on UTF16 or UTF8 BOM.
 
- Public Member Functions inherited from stdex::stream::basic
basic (state_t state=state_t::ok)
 
virtual size_t read (_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
 Reads block of data from the stream.
 
virtual size_t write (_In_reads_bytes_opt_(length) const void *data, size_t length)
 Writes block of data to the stream.
 
virtual void flush ()
 Persists volatile element data.
 
virtual void close ()
 Closes the stream.
 
virtual void skip (fsize_t amount)
 Skips given amount of bytes of data on the stream.
 
+state_t state () const
 Returns stream state after last operation.
 
+bool ok () const
 Returns true if the stream state is clean i.e. previous operation was succesful.
 
virtual std::vector< uint8_t > read_remainder (size_t max_length=SIZE_MAX)
 Reads and returns remainder of the stream.
 
+uint8_t read_byte ()
 Reads one byte of data.
 
+void write_byte (uint8_t byte, fsize_t amount=1)
 Writes a byte of data.
 
template<class T >
basicread_data (T &data)
 Reads one primitive data type.
 
template<class T >
basicwrite_data (const T data)
 Writes one primitive data type.
 
template<class _Traits = std::char_traits<char>, class _Ax = std::allocator<char>>
size_t readln (std::basic_string< char, _Traits, _Ax > &str)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln (std::basic_string< wchar_t, _Traits, _Ax > &wstr)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln (std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
size_t readln_and_attach (std::basic_string< _Elem, _Traits, _Ax > &str)
 Reads stream to the end-of-line or end-of-file and append to str.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln_and_attach (std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)
 Reads stream to the end-of-line or end-of-file and append to str.
 
size_t read_array (_Out_writes_bytes_(size *count) void *array, size_t size, size_t count)
 Reads an array of data from the stream.
 
size_t write_array (_In_reads_bytes_opt_(size *count) const void *array, size_t size, size_t count)
 Writes an array of data to the stream.
 
size_t write_array (_In_reads_or_z_opt_(num_chars) const wchar_t *wstr, size_t num_chars, charset_id charset)
 Writes array of characters to the stream.
 
template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
basicread_str (std::basic_string< _Elem, _Traits, _Ax > &data)
 Reads length-prefixed string from the stream.
 
template<class T >
basicwrite_str (const T *data)
 Writes string to the stream length-prefixed.
 
fsize_t write_stream (basic &stream, fsize_t amount=fsize_max)
 Writes content of another stream.
 
+void write_charset (charset_id charset)
 Writes UTF8 or UTF-16 byte-order-mark.
 
size_t write_sprintf (_Printf_format_string_params_(2) const char *format, locale_t locale,...)
 Writes formatted string to the stream.
 
size_t write_sprintf (_Printf_format_string_params_(2) const wchar_t *format, locale_t locale,...)
 Writes formatted string to the stream.
 
size_t write_vsprintf (_Printf_format_string_params_(2) const char *format, locale_t locale, va_list params)
 Writes formatted string to the stream.
 
size_t write_vsprintf (_Printf_format_string_params_(2) const wchar_t *format, locale_t locale, va_list params)
 Writes formatted string to the stream.
 
+basicoperator>> (int8_t &data)
 
+basicoperator<< (const int8_t data)
 
+basicoperator>> (int16_t &data)
 
+basicoperator<< (const int16_t data)
 
+basicoperator>> (int32_t &data)
 
+basicoperator<< (const int32_t data)
 
+basicoperator>> (int64_t &data)
 
+basicoperator<< (const int64_t data)
 
+basicoperator>> (uint8_t &data)
 
+basicoperator<< (const uint8_t data)
 
+basicoperator>> (uint16_t &data)
 
+basicoperator<< (const uint16_t data)
 
+basicoperator>> (uint32_t &data)
 
+basicoperator<< (const uint32_t data)
 
+basicoperator>> (uint64_t &data)
 
+basicoperator<< (const uint64_t data)
 
+basicoperator>> (float &data)
 
+basicoperator<< (const float data)
 
+basicoperator>> (double &data)
 
+basicoperator<< (const double data)
 
+basicoperator>> (char &data)
 
+basicoperator<< (const char data)
 
+template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
basicoperator>> (std::basic_string< _Elem, _Traits, _Ax > &data)
 
+template<class T >
basicoperator<< (const T *data)
 
+ + + + + + + + + + +

+Protected Attributes

+basic_filem_source
 
+fpos_t m_offset
 
+interval< fpos_t > m_region
 
- Protected Attributes inherited from stdex::stream::basic
+state_t m_state
 
+

Detailed Description

+

Limits file reading/writing to a predefined window.

+

Member Function Documentation

+ +

◆ close()

+ +
+
+ + + + + +
+ + + + + + + +
virtual void stdex::stream::file_window::close ()
+
+inlinevirtual
+
+ +

Closes the stream.

+ +

Reimplemented from stdex::stream::basic.

+ +
+
+ +

◆ flush()

+ +
+
+ + + + + +
+ + + + + + + +
virtual void stdex::stream::file_window::flush ()
+
+inlinevirtual
+
+ +

Persists volatile element data.

+ +

Reimplemented from stdex::stream::basic.

+ +
+
+ +

◆ lock()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual void stdex::stream::file_window::lock (fpos_t offset,
fsize_t length 
)
+
+inlinevirtual
+
+ +

Locks file section for exclusive access.

+ +

Reimplemented from stdex::stream::basic_file.

+ +
+
+ +

◆ read()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual size_t stdex::stream::file_window::read (_Out_writes_bytes_to_opt_(length, return) void * data,
size_t length 
)
+
+inlinevirtual
+
+ +

Reads block of data from the stream.

+
Parameters
+ + + +
[out]dataBuffer to store read data
[in]lengthByte limit of data to read
+
+
+
Returns
Number of bytes succesfully read. On EOF, 0 is returned and stream state is set to state_t::eof. On error, 0 is returned and stream state is set to state_t::fail. On null reads (length == 0), 0 is returned and stream state is set to state_t::ok.
+ +

Reimplemented from stdex::stream::basic.

+ +
+
+ +

◆ seek()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual fpos_t stdex::stream::file_window::seek (foff_t offset,
seek_t how = seek_t::beg 
)
+
+inlinevirtual
+
+ +

Seeks to specified relative file position.

+
Returns
Absolute file position after seek, or fpos_max if seek failed.
+ +

Implements stdex::stream::basic_file.

+ +
+
+ +

◆ size()

+ +
+
+ + + + + +
+ + + + + + + +
virtual fsize_t stdex::stream::file_window::size ()
+
+inlinevirtual
+
+ +

Returns file size Should the file size cannot be determined, the method returns fsize_max and it does not reset the state to failed.

+ +

Implements stdex::stream::basic_file.

+ +
+
+ +

◆ skip()

+ +
+
+ + + + + +
+ + + + + + + + +
virtual void stdex::stream::file_window::skip (fsize_t amount)
+
+inlinevirtual
+
+ +

Skips given amount of bytes of data on the stream.

+ +

Reimplemented from stdex::stream::basic_file.

+ +
+
+ +

◆ tell()

+ +
+
+ + + + + +
+ + + + + + + +
virtual fpos_t stdex::stream::file_window::tell () const
+
+inlinevirtual
+
+ +

Returns absolute file position in file or fpos_max if fails. This method does not update stream state.

+
Returns
Absolute file position or fpos_max if position cannot be determined.
+ +

Implements stdex::stream::basic_file.

+ +
+
+ +

◆ truncate()

+ +
+
+ + + + + +
+ + + + + + + +
virtual void stdex::stream::file_window::truncate ()
+
+inlinevirtual
+
+ +

Sets file size - truncates the remainder of file content from the current file position to the end of file.

+ +

Implements stdex::stream::basic_file.

+ +
+
+ +

◆ unlock()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual void stdex::stream::file_window::unlock (fpos_t offset,
fsize_t length 
)
+
+inlinevirtual
+
+ +

Unlocks file section for exclusive access.

+ +

Reimplemented from stdex::stream::basic_file.

+ +
+
+ +

◆ write()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual size_t stdex::stream::file_window::write (_In_reads_bytes_opt_(length) const void * data,
size_t length 
)
+
+inlinevirtual
+
+ +

Writes block of data to the stream.

+
Parameters
+ + + +
[in]dataBuffer to write data from
[in]lengthNumber of bytes to write
+
+
+
Returns
Number of bytes succesfully written. On error, stream state is set to state_t::fail.
+ +

Reimplemented from stdex::stream::basic.

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/classstdex_1_1stream_1_1file__window.png b/classstdex_1_1stream_1_1file__window.png new file mode 100644 index 000000000..4a3be5858 Binary files /dev/null and b/classstdex_1_1stream_1_1file__window.png differ diff --git a/classstdex_1_1stream_1_1limiter-members.html b/classstdex_1_1stream_1_1limiter-members.html new file mode 100644 index 000000000..6c100750b --- /dev/null +++ b/classstdex_1_1stream_1_1limiter-members.html @@ -0,0 +1,150 @@ + + + + + + + +stdex: Member List + + + + + + + + + +
+
+ + + + + + +
+
stdex +
+
Additional custom or not Standard C++ covered algorithms
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
stdex::stream::limiter Member List
+
+
+ +

This is the complete list of members for stdex::stream::limiter, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
basic(state_t state=state_t::ok) (defined in stdex::stream::basic)stdex::stream::basicinline
close()stdex::stream::converterinlinevirtual
converter() (defined in stdex::stream::converter)stdex::stream::converterinlineexplicitprotected
converter(basic &source) (defined in stdex::stream::converter)stdex::stream::converterinline
flush()stdex::stream::converterinlinevirtual
init(basic &source) (defined in stdex::stream::converter)stdex::stream::converterinlineprotected
limiter(basic &source, fsize_t _read_limit=0, fsize_t _write_limit=0) (defined in stdex::stream::limiter)stdex::stream::limiterinline
m_source (defined in stdex::stream::converter)stdex::stream::converterprotected
m_state (defined in stdex::stream::basic)stdex::stream::basicprotected
ok() conststdex::stream::basicinline
operator<<(const int8_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const int16_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const int32_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const int64_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint8_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint16_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint32_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint64_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const float data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const double data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const char data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const T *data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int8_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int16_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int32_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int64_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint8_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint16_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint32_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint64_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(float &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(double &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(char &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(std::basic_string< _Elem, _Traits, _Ax > &data) (defined in stdex::stream::basic)stdex::stream::basicinline
read(_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)stdex::stream::limiterinlinevirtual
read_array(_Out_writes_bytes_(size *count) void *array, size_t size, size_t count)stdex::stream::basicinline
read_byte()stdex::stream::basicinline
read_data(T &data)stdex::stream::basicinline
read_limitstdex::stream::limiter
read_remainder(size_t max_length=SIZE_MAX)stdex::stream::basicinlinevirtual
read_str(std::basic_string< _Elem, _Traits, _Ax > &data)stdex::stream::basicinline
readln(std::basic_string< char, _Traits, _Ax > &str)stdex::stream::basicinline
readln(std::basic_string< wchar_t, _Traits, _Ax > &wstr)stdex::stream::basicinline
readln(std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)stdex::stream::basicinline
readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline
readln_and_attach(std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)stdex::stream::basicinline
skip(fsize_t amount)stdex::stream::basicinlinevirtual
state() conststdex::stream::basicinline
write(_In_reads_bytes_opt_(length) const void *data, size_t length)stdex::stream::limiterinlinevirtual
write_array(_In_reads_bytes_opt_(size *count) const void *array, size_t size, size_t count)stdex::stream::basicinline
write_array(_In_reads_or_z_opt_(num_chars) const wchar_t *wstr, size_t num_chars, charset_id charset)stdex::stream::basicinline
write_byte(uint8_t byte, fsize_t amount=1)stdex::stream::basicinline
write_charset(charset_id charset)stdex::stream::basicinline
write_data(const T data)stdex::stream::basicinline
write_limitstdex::stream::limiter
write_sprintf(_Printf_format_string_params_(2) const char *format, locale_t locale,...)stdex::stream::basicinline
write_sprintf(_Printf_format_string_params_(2) const wchar_t *format, locale_t locale,...)stdex::stream::basicinline
write_str(const T *data)stdex::stream::basicinline
write_stream(basic &stream, fsize_t amount=fsize_max)stdex::stream::basicinline
write_vsprintf(_Printf_format_string_params_(2) const char *format, locale_t locale, va_list params)stdex::stream::basicinline
write_vsprintf(_Printf_format_string_params_(2) const wchar_t *format, locale_t locale, va_list params)stdex::stream::basicinline
+ + + + diff --git a/classstdex_1_1stream_1_1limiter.html b/classstdex_1_1stream_1_1limiter.html new file mode 100644 index 000000000..3a6f56555 --- /dev/null +++ b/classstdex_1_1stream_1_1limiter.html @@ -0,0 +1,443 @@ + + + + + + + +stdex: stdex::stream::limiter Class Reference + + + + + + + + + +
+
+ + + + + + +
+
stdex +
+
Additional custom or not Standard C++ covered algorithms
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
+Public Member Functions | +Public Attributes | +List of all members
+
stdex::stream::limiter Class Reference
+
+
+ +

Limits reading from/writing to stream to a predefined number of bytes. + More...

+ +

#include <stdex/stream.hpp>

+
+Inheritance diagram for stdex::stream::limiter:
+
+
+ + +stdex::stream::converter +stdex::stream::basic +stdex::stream::window + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

limiter (basic &source, fsize_t _read_limit=0, fsize_t _write_limit=0)
 
virtual size_t read (_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
 Reads block of data from the stream.
 
virtual size_t write (_In_reads_bytes_opt_(length) const void *data, size_t length)
 Writes block of data to the stream.
 
- Public Member Functions inherited from stdex::stream::converter
converter (basic &source)
 
virtual size_t read (_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
 Reads block of data from the stream.
 
virtual size_t write (_In_reads_bytes_opt_(length) const void *data, size_t length)
 Writes block of data to the stream.
 
virtual void close ()
 Closes the stream.
 
virtual void flush ()
 Persists volatile element data.
 
- Public Member Functions inherited from stdex::stream::basic
basic (state_t state=state_t::ok)
 
virtual size_t read (_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
 Reads block of data from the stream.
 
virtual size_t write (_In_reads_bytes_opt_(length) const void *data, size_t length)
 Writes block of data to the stream.
 
virtual void flush ()
 Persists volatile element data.
 
virtual void close ()
 Closes the stream.
 
virtual void skip (fsize_t amount)
 Skips given amount of bytes of data on the stream.
 
+state_t state () const
 Returns stream state after last operation.
 
+bool ok () const
 Returns true if the stream state is clean i.e. previous operation was succesful.
 
virtual std::vector< uint8_t > read_remainder (size_t max_length=SIZE_MAX)
 Reads and returns remainder of the stream.
 
+uint8_t read_byte ()
 Reads one byte of data.
 
+void write_byte (uint8_t byte, fsize_t amount=1)
 Writes a byte of data.
 
template<class T >
basicread_data (T &data)
 Reads one primitive data type.
 
template<class T >
basicwrite_data (const T data)
 Writes one primitive data type.
 
template<class _Traits = std::char_traits<char>, class _Ax = std::allocator<char>>
size_t readln (std::basic_string< char, _Traits, _Ax > &str)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln (std::basic_string< wchar_t, _Traits, _Ax > &wstr)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln (std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
size_t readln_and_attach (std::basic_string< _Elem, _Traits, _Ax > &str)
 Reads stream to the end-of-line or end-of-file and append to str.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln_and_attach (std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)
 Reads stream to the end-of-line or end-of-file and append to str.
 
size_t read_array (_Out_writes_bytes_(size *count) void *array, size_t size, size_t count)
 Reads an array of data from the stream.
 
size_t write_array (_In_reads_bytes_opt_(size *count) const void *array, size_t size, size_t count)
 Writes an array of data to the stream.
 
size_t write_array (_In_reads_or_z_opt_(num_chars) const wchar_t *wstr, size_t num_chars, charset_id charset)
 Writes array of characters to the stream.
 
template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
basicread_str (std::basic_string< _Elem, _Traits, _Ax > &data)
 Reads length-prefixed string from the stream.
 
template<class T >
basicwrite_str (const T *data)
 Writes string to the stream length-prefixed.
 
fsize_t write_stream (basic &stream, fsize_t amount=fsize_max)
 Writes content of another stream.
 
+void write_charset (charset_id charset)
 Writes UTF8 or UTF-16 byte-order-mark.
 
size_t write_sprintf (_Printf_format_string_params_(2) const char *format, locale_t locale,...)
 Writes formatted string to the stream.
 
size_t write_sprintf (_Printf_format_string_params_(2) const wchar_t *format, locale_t locale,...)
 Writes formatted string to the stream.
 
size_t write_vsprintf (_Printf_format_string_params_(2) const char *format, locale_t locale, va_list params)
 Writes formatted string to the stream.
 
size_t write_vsprintf (_Printf_format_string_params_(2) const wchar_t *format, locale_t locale, va_list params)
 Writes formatted string to the stream.
 
+basicoperator>> (int8_t &data)
 
+basicoperator<< (const int8_t data)
 
+basicoperator>> (int16_t &data)
 
+basicoperator<< (const int16_t data)
 
+basicoperator>> (int32_t &data)
 
+basicoperator<< (const int32_t data)
 
+basicoperator>> (int64_t &data)
 
+basicoperator<< (const int64_t data)
 
+basicoperator>> (uint8_t &data)
 
+basicoperator<< (const uint8_t data)
 
+basicoperator>> (uint16_t &data)
 
+basicoperator<< (const uint16_t data)
 
+basicoperator>> (uint32_t &data)
 
+basicoperator<< (const uint32_t data)
 
+basicoperator>> (uint64_t &data)
 
+basicoperator<< (const uint64_t data)
 
+basicoperator>> (float &data)
 
+basicoperator<< (const float data)
 
+basicoperator>> (double &data)
 
+basicoperator<< (const double data)
 
+basicoperator>> (char &data)
 
+basicoperator<< (const char data)
 
+template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
basicoperator>> (std::basic_string< _Elem, _Traits, _Ax > &data)
 
+template<class T >
basicoperator<< (const T *data)
 
+ + + + + + + +

+Public Attributes

+fsize_t read_limit
 Number of bytes left that may be read from the stream.
 
+fsize_t write_limit
 Number of bytes left, that can be written to the stream.
 
+ + + + + + + + + + +

+Additional Inherited Members

- Protected Member Functions inherited from stdex::stream::converter
+void init (basic &source)
 
- Protected Attributes inherited from stdex::stream::converter
+basicm_source
 
- Protected Attributes inherited from stdex::stream::basic
+state_t m_state
 
+

Detailed Description

+

Limits reading from/writing to stream to a predefined number of bytes.

+

Member Function Documentation

+ +

◆ read()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual size_t stdex::stream::limiter::read (_Out_writes_bytes_to_opt_(length, return) void * data,
size_t length 
)
+
+inlinevirtual
+
+ +

Reads block of data from the stream.

+
Parameters
+ + + +
[out]dataBuffer to store read data
[in]lengthByte limit of data to read
+
+
+
Returns
Number of bytes succesfully read. On EOF, 0 is returned and stream state is set to state_t::eof. On error, 0 is returned and stream state is set to state_t::fail. On null reads (length == 0), 0 is returned and stream state is set to state_t::ok.
+ +

Reimplemented from stdex::stream::converter.

+ +

Reimplemented in stdex::stream::window.

+ +
+
+ +

◆ write()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual size_t stdex::stream::limiter::write (_In_reads_bytes_opt_(length) const void * data,
size_t length 
)
+
+inlinevirtual
+
+ +

Writes block of data to the stream.

+
Parameters
+ + + +
[in]dataBuffer to write data from
[in]lengthNumber of bytes to write
+
+
+
Returns
Number of bytes succesfully written. On error, stream state is set to state_t::fail.
+ +

Reimplemented from stdex::stream::converter.

+ +

Reimplemented in stdex::stream::window.

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/classstdex_1_1stream_1_1limiter.png b/classstdex_1_1stream_1_1limiter.png new file mode 100644 index 000000000..87d466f97 Binary files /dev/null and b/classstdex_1_1stream_1_1limiter.png differ diff --git a/classstdex_1_1stream_1_1memory__file-members.html b/classstdex_1_1stream_1_1memory__file-members.html new file mode 100644 index 000000000..323919fb4 --- /dev/null +++ b/classstdex_1_1stream_1_1memory__file-members.html @@ -0,0 +1,200 @@ + + + + + + + +stdex: Member List + + + + + + + + + +
+
+ + + + + + +
+
stdex +
+
Additional custom or not Standard C++ covered algorithms
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
stdex::stream::memory_file Member List
+
+
+ +

This is the complete list of members for stdex::stream::memory_file, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
atime() conststdex::stream::basic_fileinlinevirtual
basic(state_t state=state_t::ok) (defined in stdex::stream::basic)stdex::stream::basicinline
close()stdex::stream::memory_fileinlinevirtual
ctime() conststdex::stream::basic_fileinlinevirtual
data() conststdex::stream::memory_fileinline
flush()stdex::stream::basicinlinevirtual
get(fpos_t offset, T &data)stdex::stream::memory_fileinlineprotected
get(fpos_t offset, int8_t &data) (defined in stdex::stream::memory_file)stdex::stream::memory_fileinline
get(fpos_t offset, int16_t &data) (defined in stdex::stream::memory_file)stdex::stream::memory_fileinline
get(fpos_t offset, int32_t &data) (defined in stdex::stream::memory_file)stdex::stream::memory_fileinline
get(fpos_t offset, int64_t &data) (defined in stdex::stream::memory_file)stdex::stream::memory_fileinline
get(fpos_t offset, uint8_t &data) (defined in stdex::stream::memory_file)stdex::stream::memory_fileinline
get(fpos_t offset, uint16_t &data) (defined in stdex::stream::memory_file)stdex::stream::memory_fileinline
get(fpos_t offset, uint32_t &data) (defined in stdex::stream::memory_file)stdex::stream::memory_fileinline
get(fpos_t offset, uint64_t &data) (defined in stdex::stream::memory_file)stdex::stream::memory_fileinline
get(fpos_t offset, float &data) (defined in stdex::stream::memory_file)stdex::stream::memory_fileinline
get(fpos_t offset, double &data) (defined in stdex::stream::memory_file)stdex::stream::memory_fileinline
get(fpos_t offset, char &data) (defined in stdex::stream::memory_file)stdex::stream::memory_fileinline
load(const sys_char *filename, int mode)stdex::stream::memory_fileinline
lock(fpos_t offset, fsize_t length)stdex::stream::basic_fileinlinevirtual
m_datastdex::stream::memory_fileprotected
m_managestdex::stream::memory_fileprotected
m_offsetstdex::stream::memory_fileprotected
m_reservedstdex::stream::memory_fileprotected
m_sizestdex::stream::memory_fileprotected
m_state (defined in stdex::stream::basic)stdex::stream::basicprotected
memory_file(state_t state=state_t::ok) (defined in stdex::stream::memory_file)stdex::stream::memory_fileinline
memory_file(size_t size, state_t state=state_t::ok)stdex::stream::memory_fileinline
memory_file(void *data, size_t size, size_t reserved, bool manage=false, state_t state=state_t::ok)stdex::stream::memory_fileinline
memory_file(void *data, size_t size, bool manage=false, state_t state=state_t::ok)stdex::stream::memory_fileinline
memory_file(const sys_char *filename, int mode)stdex::stream::memory_fileinline
mtime() conststdex::stream::basic_fileinlinevirtual
ok() conststdex::stream::basicinline
operator<<(const int8_t data) (defined in stdex::stream::memory_file)stdex::stream::memory_fileinline
operator<<(const int16_t data) (defined in stdex::stream::memory_file)stdex::stream::memory_fileinline
operator<<(const int32_t data) (defined in stdex::stream::memory_file)stdex::stream::memory_fileinline
operator<<(const int64_t data) (defined in stdex::stream::memory_file)stdex::stream::memory_fileinline
operator<<(const uint8_t data) (defined in stdex::stream::memory_file)stdex::stream::memory_fileinline
operator<<(const uint16_t data) (defined in stdex::stream::memory_file)stdex::stream::memory_fileinline
operator<<(const uint32_t data) (defined in stdex::stream::memory_file)stdex::stream::memory_fileinline
operator<<(const uint64_t data) (defined in stdex::stream::memory_file)stdex::stream::memory_fileinline
operator<<(const float data) (defined in stdex::stream::memory_file)stdex::stream::memory_fileinline
operator<<(const double data) (defined in stdex::stream::memory_file)stdex::stream::memory_fileinline
operator<<(const char data) (defined in stdex::stream::memory_file)stdex::stream::memory_fileinline
operator<<(const T *data) (defined in stdex::stream::memory_file)stdex::stream::memory_fileinline
operator>>(int8_t &data) (defined in stdex::stream::memory_file)stdex::stream::memory_fileinline
operator>>(int16_t &data) (defined in stdex::stream::memory_file)stdex::stream::memory_fileinline
operator>>(int32_t &data) (defined in stdex::stream::memory_file)stdex::stream::memory_fileinline
operator>>(int64_t &data) (defined in stdex::stream::memory_file)stdex::stream::memory_fileinline
operator>>(uint8_t &data) (defined in stdex::stream::memory_file)stdex::stream::memory_fileinline
operator>>(uint16_t &data) (defined in stdex::stream::memory_file)stdex::stream::memory_fileinline
operator>>(uint32_t &data) (defined in stdex::stream::memory_file)stdex::stream::memory_fileinline
operator>>(uint64_t &data) (defined in stdex::stream::memory_file)stdex::stream::memory_fileinline
operator>>(float &data) (defined in stdex::stream::memory_file)stdex::stream::memory_fileinline
operator>>(double &data) (defined in stdex::stream::memory_file)stdex::stream::memory_fileinline
operator>>(char &data) (defined in stdex::stream::memory_file)stdex::stream::memory_fileinline
operator>>(std::basic_string< _Elem, _Traits, _Ax > &data) (defined in stdex::stream::memory_file)stdex::stream::memory_fileinline
read(_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)stdex::stream::memory_fileinlinevirtual
read_array(_Out_writes_bytes_(size *count) void *array, size_t size, size_t count)stdex::stream::basicinline
read_byte()stdex::stream::basicinline
read_charset(charset_id default_charset=charset_id::default)stdex::stream::basic_fileinline
read_data(T &data)stdex::stream::memory_fileinline
read_remainder(size_t max_length=SIZE_MAX)stdex::stream::basic_fileinlinevirtual
read_str(std::basic_string< _Elem, _Traits, _Ax > &data)stdex::stream::memory_fileinline
readln(std::basic_string< char, _Traits, _Ax > &str)stdex::stream::basicinline
readln(std::basic_string< wchar_t, _Traits, _Ax > &wstr)stdex::stream::basicinline
readln(std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)stdex::stream::basicinline
readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline
readln_and_attach(std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)stdex::stream::basicinline
reserve(size_t required, bool tight=false) noexceptstdex::stream::memory_fileinline
save(const sys_char *filename, int mode)stdex::stream::memory_fileinline
seek(foff_t offset, seek_t how=seek_t::beg)stdex::stream::memory_fileinlinevirtual
seekbeg(fpos_t offset)stdex::stream::basic_fileinline
seekcur(foff_t offset)stdex::stream::basic_fileinline
seekend(foff_t offset)stdex::stream::basic_fileinline
set(fpos_t offset, const T data)stdex::stream::memory_fileinlineprotected
set(fpos_t offset, const int8_t data) (defined in stdex::stream::memory_file)stdex::stream::memory_fileinline
set(fpos_t offset, const int16_t data) (defined in stdex::stream::memory_file)stdex::stream::memory_fileinline
set(fpos_t offset, const int32_t data) (defined in stdex::stream::memory_file)stdex::stream::memory_fileinline
set(fpos_t offset, const int64_t data) (defined in stdex::stream::memory_file)stdex::stream::memory_fileinline
set(fpos_t offset, const uint8_t data) (defined in stdex::stream::memory_file)stdex::stream::memory_fileinline
set(fpos_t offset, const uint16_t data) (defined in stdex::stream::memory_file)stdex::stream::memory_fileinline
set(fpos_t offset, const uint32_t data) (defined in stdex::stream::memory_file)stdex::stream::memory_fileinline
set(fpos_t offset, const uint64_t data) (defined in stdex::stream::memory_file)stdex::stream::memory_fileinline
set(fpos_t offset, const float data) (defined in stdex::stream::memory_file)stdex::stream::memory_fileinline
set(fpos_t offset, const double data) (defined in stdex::stream::memory_file)stdex::stream::memory_fileinline
set(fpos_t offset, const char data) (defined in stdex::stream::memory_file)stdex::stream::memory_fileinline
set_atime(time_point date)stdex::stream::basic_fileinlinevirtual
set_ctime(time_point date)stdex::stream::basic_fileinlinevirtual
set_mtime(time_point date)stdex::stream::basic_fileinlinevirtual
size()stdex::stream::memory_fileinlinevirtual
skip(fsize_t amount)stdex::stream::basic_fileinlinevirtual
state() conststdex::stream::basicinline
tell() conststdex::stream::memory_fileinlinevirtual
truncate()stdex::stream::memory_fileinlinevirtual
unlock(fpos_t offset, fsize_t length)stdex::stream::basic_fileinlinevirtual
write(_In_reads_bytes_opt_(length) const void *data, size_t length)stdex::stream::memory_fileinlinevirtual
write_array(_In_reads_bytes_opt_(size *count) const void *array, size_t size, size_t count)stdex::stream::basicinline
write_array(_In_reads_or_z_opt_(num_chars) const wchar_t *wstr, size_t num_chars, charset_id charset)stdex::stream::basicinline
write_byte(uint8_t byte, size_t amount=1)stdex::stream::memory_fileinline
stdex::stream::basic_file::write_byte(uint8_t byte, fsize_t amount=1)stdex::stream::basicinline
write_charset(charset_id charset)stdex::stream::basicinline
write_data(const T data)stdex::stream::memory_fileinline
write_sprintf(_Printf_format_string_params_(2) const char *format, locale_t locale,...)stdex::stream::basicinline
write_sprintf(_Printf_format_string_params_(2) const wchar_t *format, locale_t locale,...)stdex::stream::basicinline
write_str(const T *data)stdex::stream::memory_fileinline
write_stream(basic &stream, size_t amount=SIZE_MAX)stdex::stream::memory_fileinline
stdex::stream::basic_file::write_stream(basic &stream, fsize_t amount=fsize_max)stdex::stream::basicinline
write_vsprintf(_Printf_format_string_params_(2) const char *format, locale_t locale, va_list params)stdex::stream::basicinline
write_vsprintf(_Printf_format_string_params_(2) const wchar_t *format, locale_t locale, va_list params)stdex::stream::basicinline
~memory_file() (defined in stdex::stream::memory_file)stdex::stream::memory_fileinlinevirtual
+ + + + diff --git a/classstdex_1_1stream_1_1memory__file.html b/classstdex_1_1stream_1_1memory__file.html new file mode 100644 index 000000000..6ddf30fca --- /dev/null +++ b/classstdex_1_1stream_1_1memory__file.html @@ -0,0 +1,1491 @@ + + + + + + + +stdex: stdex::stream::memory_file Class Reference + + + + + + + + + +
+
+ + + + + + +
+
stdex +
+
Additional custom or not Standard C++ covered algorithms
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
+Public Member Functions | +Protected Member Functions | +Protected Attributes | +List of all members
+
stdex::stream::memory_file Class Reference
+
+
+ +

In-memory file. + More...

+ +

#include <stdex/stream.hpp>

+
+Inheritance diagram for stdex::stream::memory_file:
+
+
+ + +stdex::stream::basic_file +stdex::stream::basic + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

memory_file (state_t state=state_t::ok)
 
 memory_file (size_t size, state_t state=state_t::ok)
 Creates an empty file of reserved size.
 
 memory_file (void *data, size_t size, size_t reserved, bool manage=false, state_t state=state_t::ok)
 Creates a file based on available data.
 
 memory_file (void *data, size_t size, bool manage=false, state_t state=state_t::ok)
 Creates a file based on available data.
 
 memory_file (const sys_char *filename, int mode)
 Loads content from file-system file.
 
void reserve (size_t required, bool tight=false) noexcept
 Reallocates memory.
 
void load (const sys_char *filename, int mode)
 Loads content from a file-system file.
 
void save (const sys_char *filename, int mode)
 Saves content to a file-system file.
 
+const void * data () const
 Returns pointer to data.
 
virtual size_t read (_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
 Reads block of data from the stream.
 
template<class T >
memory_fileread_data (T &data)
 Reads one primitive data type.
 
template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
memory_fileread_str (std::basic_string< _Elem, _Traits, _Ax > &data)
 Reads length-prefixed string from the stream.
 
virtual size_t write (_In_reads_bytes_opt_(length) const void *data, size_t length)
 Writes block of data to the stream.
 
+void write_byte (uint8_t byte, size_t amount=1)
 Writes a byte of data.
 
template<class T >
memory_filewrite_data (const T data)
 Writes one primitive data type.
 
template<class T >
memory_filewrite_str (const T *data)
 Writes string to the stream length-prefixed.
 
size_t write_stream (basic &stream, size_t amount=SIZE_MAX)
 Writes content of another stream.
 
virtual void close ()
 Closes the stream.
 
virtual fpos_t seek (foff_t offset, seek_t how=seek_t::beg)
 Seeks to specified relative file position.
 
virtual fpos_t tell () const
 Returns absolute file position in file or fpos_max if fails. This method does not update stream state.
 
virtual fsize_t size ()
 Returns file size Should the file size cannot be determined, the method returns fsize_max and it does not reset the state to failed.
 
virtual void truncate ()
 Sets file size - truncates the remainder of file content from the current file position to the end of file.
 
+void set (fpos_t offset, const int8_t data)
 
+void set (fpos_t offset, const int16_t data)
 
+void set (fpos_t offset, const int32_t data)
 
+void set (fpos_t offset, const int64_t data)
 
+void set (fpos_t offset, const uint8_t data)
 
+void set (fpos_t offset, const uint16_t data)
 
+void set (fpos_t offset, const uint32_t data)
 
+void set (fpos_t offset, const uint64_t data)
 
+void set (fpos_t offset, const float data)
 
+void set (fpos_t offset, const double data)
 
+void set (fpos_t offset, const char data)
 
+void get (fpos_t offset, int8_t &data)
 
+void get (fpos_t offset, int16_t &data)
 
+void get (fpos_t offset, int32_t &data)
 
+void get (fpos_t offset, int64_t &data)
 
+void get (fpos_t offset, uint8_t &data)
 
+void get (fpos_t offset, uint16_t &data)
 
+void get (fpos_t offset, uint32_t &data)
 
+void get (fpos_t offset, uint64_t &data)
 
+void get (fpos_t offset, float &data)
 
+void get (fpos_t offset, double &data)
 
+void get (fpos_t offset, char &data)
 
+memory_fileoperator<< (const int8_t data)
 
+memory_fileoperator>> (int8_t &data)
 
+memory_fileoperator<< (const int16_t data)
 
+memory_fileoperator>> (int16_t &data)
 
+memory_fileoperator<< (const int32_t data)
 
+memory_fileoperator>> (int32_t &data)
 
+memory_fileoperator<< (const int64_t data)
 
+memory_fileoperator>> (int64_t &data)
 
+memory_fileoperator<< (const uint8_t data)
 
+memory_fileoperator>> (uint8_t &data)
 
+memory_fileoperator<< (const uint16_t data)
 
+memory_fileoperator>> (uint16_t &data)
 
+memory_fileoperator<< (const uint32_t data)
 
+memory_fileoperator>> (uint32_t &data)
 
+memory_fileoperator<< (const uint64_t data)
 
+memory_fileoperator>> (uint64_t &data)
 
+memory_fileoperator<< (const float data)
 
+memory_fileoperator>> (float &data)
 
+memory_fileoperator<< (const double data)
 
+memory_fileoperator>> (double &data)
 
+memory_fileoperator<< (const char data)
 
+memory_fileoperator>> (char &data)
 
+template<class T >
memory_fileoperator<< (const T *data)
 
+template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
memory_fileoperator>> (std::basic_string< _Elem, _Traits, _Ax > &data)
 
- Public Member Functions inherited from stdex::stream::basic_file
virtual std::vector< uint8_t > read_remainder (size_t max_length=SIZE_MAX)
 Reads and returns remainder of the stream.
 
virtual fpos_t seek (foff_t offset, seek_t how=seek_t::beg)=0
 Seeks to specified relative file position.
 
fpos_t seekbeg (fpos_t offset)
 Seeks to absolute file position.
 
fpos_t seekcur (foff_t offset)
 Seeks to relative from current file position.
 
fpos_t seekend (foff_t offset)
 Seeks to relative from end file position.
 
virtual void skip (fsize_t amount)
 Skips given amount of bytes of data on the stream.
 
virtual fpos_t tell () const =0
 Returns absolute file position in file or fpos_max if fails. This method does not update stream state.
 
virtual void lock (fpos_t offset, fsize_t length)
 Locks file section for exclusive access.
 
virtual void unlock (fpos_t offset, fsize_t length)
 Unlocks file section for exclusive access.
 
virtual fsize_t size ()=0
 Returns file size Should the file size cannot be determined, the method returns fsize_max and it does not reset the state to failed.
 
virtual void truncate ()=0
 Sets file size - truncates the remainder of file content from the current file position to the end of file.
 
virtual time_point ctime () const
 Returns file creation time.
 
virtual time_point atime () const
 Returns file access time.
 
virtual time_point mtime () const
 Returns file modification time.
 
virtual void set_ctime (time_point date)
 Sets file create time.
 
virtual void set_atime (time_point date)
 Sets file access time.
 
virtual void set_mtime (time_point date)
 Sets file modification time.
 
charset_id read_charset (charset_id default_charset=charset_id::default)
 Attempts to detect textfile charset based on UTF16 or UTF8 BOM.
 
- Public Member Functions inherited from stdex::stream::basic
basic (state_t state=state_t::ok)
 
virtual size_t read (_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
 Reads block of data from the stream.
 
virtual size_t write (_In_reads_bytes_opt_(length) const void *data, size_t length)
 Writes block of data to the stream.
 
virtual void flush ()
 Persists volatile element data.
 
virtual void close ()
 Closes the stream.
 
virtual void skip (fsize_t amount)
 Skips given amount of bytes of data on the stream.
 
+state_t state () const
 Returns stream state after last operation.
 
+bool ok () const
 Returns true if the stream state is clean i.e. previous operation was succesful.
 
virtual std::vector< uint8_t > read_remainder (size_t max_length=SIZE_MAX)
 Reads and returns remainder of the stream.
 
+uint8_t read_byte ()
 Reads one byte of data.
 
+void write_byte (uint8_t byte, fsize_t amount=1)
 Writes a byte of data.
 
template<class T >
basicread_data (T &data)
 Reads one primitive data type.
 
template<class T >
basicwrite_data (const T data)
 Writes one primitive data type.
 
template<class _Traits = std::char_traits<char>, class _Ax = std::allocator<char>>
size_t readln (std::basic_string< char, _Traits, _Ax > &str)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln (std::basic_string< wchar_t, _Traits, _Ax > &wstr)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln (std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
size_t readln_and_attach (std::basic_string< _Elem, _Traits, _Ax > &str)
 Reads stream to the end-of-line or end-of-file and append to str.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln_and_attach (std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)
 Reads stream to the end-of-line or end-of-file and append to str.
 
size_t read_array (_Out_writes_bytes_(size *count) void *array, size_t size, size_t count)
 Reads an array of data from the stream.
 
size_t write_array (_In_reads_bytes_opt_(size *count) const void *array, size_t size, size_t count)
 Writes an array of data to the stream.
 
size_t write_array (_In_reads_or_z_opt_(num_chars) const wchar_t *wstr, size_t num_chars, charset_id charset)
 Writes array of characters to the stream.
 
template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
basicread_str (std::basic_string< _Elem, _Traits, _Ax > &data)
 Reads length-prefixed string from the stream.
 
template<class T >
basicwrite_str (const T *data)
 Writes string to the stream length-prefixed.
 
fsize_t write_stream (basic &stream, fsize_t amount=fsize_max)
 Writes content of another stream.
 
+void write_charset (charset_id charset)
 Writes UTF8 or UTF-16 byte-order-mark.
 
size_t write_sprintf (_Printf_format_string_params_(2) const char *format, locale_t locale,...)
 Writes formatted string to the stream.
 
size_t write_sprintf (_Printf_format_string_params_(2) const wchar_t *format, locale_t locale,...)
 Writes formatted string to the stream.
 
size_t write_vsprintf (_Printf_format_string_params_(2) const char *format, locale_t locale, va_list params)
 Writes formatted string to the stream.
 
size_t write_vsprintf (_Printf_format_string_params_(2) const wchar_t *format, locale_t locale, va_list params)
 Writes formatted string to the stream.
 
+basicoperator>> (int8_t &data)
 
+basicoperator<< (const int8_t data)
 
+basicoperator>> (int16_t &data)
 
+basicoperator<< (const int16_t data)
 
+basicoperator>> (int32_t &data)
 
+basicoperator<< (const int32_t data)
 
+basicoperator>> (int64_t &data)
 
+basicoperator<< (const int64_t data)
 
+basicoperator>> (uint8_t &data)
 
+basicoperator<< (const uint8_t data)
 
+basicoperator>> (uint16_t &data)
 
+basicoperator<< (const uint16_t data)
 
+basicoperator>> (uint32_t &data)
 
+basicoperator<< (const uint32_t data)
 
+basicoperator>> (uint64_t &data)
 
+basicoperator<< (const uint64_t data)
 
+basicoperator>> (float &data)
 
+basicoperator<< (const float data)
 
+basicoperator>> (double &data)
 
+basicoperator<< (const double data)
 
+basicoperator>> (char &data)
 
+basicoperator<< (const char data)
 
+template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
basicoperator>> (std::basic_string< _Elem, _Traits, _Ax > &data)
 
+template<class T >
basicoperator<< (const T *data)
 
+ + + + + + + + + +

+Protected Member Functions

template<class T >
void set (fpos_t offset, const T data)
 Writes data to specified file location This does not move file pointer nor update file size. It checks for reserved space assert-only (in Debug builds). Use with caution!
 
template<class T >
void get (fpos_t offset, T &data)
 Reads data from specified file location This does not move file pointer. It checks for data size assert-only (in Debug builds). Use with caution!
 
+ + + + + + + + + + + + + + + + + + + +

+Protected Attributes

+uint8_t * m_data
 file data
 
+bool m_manage
 may reallocate m_data?
 
+size_t m_offset
 file pointer
 
+size_t m_size
 file size
 
+size_t m_reserved
 reserved file size
 
- Protected Attributes inherited from stdex::stream::basic
+state_t m_state
 
+

Detailed Description

+

In-memory file.

+

Constructor & Destructor Documentation

+ +

◆ memory_file() [1/4]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
stdex::stream::memory_file::memory_file (size_t size,
state_t state = state_t::ok 
)
+
+inline
+
+ +

Creates an empty file of reserved size.

+
Parameters
+ + + +
[in]sizeReserved size
[in]stateInitial stream state
+
+
+ +
+
+ +

◆ memory_file() [2/4]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
stdex::stream::memory_file::memory_file (void * data,
size_t size,
size_t reserved,
bool manage = false,
state_t state = state_t::ok 
)
+
+inline
+
+ +

Creates a file based on available data.

+
Parameters
+ + + + + + +
[in]dataPointer to data
[in]sizeValid data size
[in]reservedReserved data size
[in]manageIs input data allocated using malloc() and this class may reallocate data?
[in]stateInitial stream state
+
+
+ +
+
+ +

◆ memory_file() [3/4]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
stdex::stream::memory_file::memory_file (void * data,
size_t size,
bool manage = false,
state_t state = state_t::ok 
)
+
+inline
+
+ +

Creates a file based on available data.

+
Parameters
+ + + + + +
[in]dataPointer to data
[in]sizeValid and reserved data size
[in]manageIs input data allocated using malloc() and this class may reallocate data?
[in]stateInitial stream state
+
+
+ +
+
+ +

◆ memory_file() [4/4]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
stdex::stream::memory_file::memory_file (const sys_char * filename,
int mode 
)
+
+inline
+
+ +

Loads content from file-system file.

+
Parameters
+ + + +
[in]filenameFilename
[in]modeBitwise combination of mode_t flags
+
+
+ +
+
+

Member Function Documentation

+ +

◆ close()

+ +
+
+ + + + + +
+ + + + + + + +
virtual void stdex::stream::memory_file::close ()
+
+inlinevirtual
+
+ +

Closes the stream.

+ +

Reimplemented from stdex::stream::basic.

+ +
+
+ +

◆ get()

+ +
+
+
+template<class T >
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void stdex::stream::memory_file::get (fpos_t offset,
T & data 
)
+
+inlineprotected
+
+ +

Reads data from specified file location This does not move file pointer. It checks for data size assert-only (in Debug builds). Use with caution!

+
Parameters
+ + + +
[in]offsetOffset in file where to write data
[in]dataData to write
+
+
+ +
+
+ +

◆ load()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void stdex::stream::memory_file::load (const sys_char * filename,
int mode 
)
+
+inline
+
+ +

Loads content from a file-system file.

+
Parameters
+ + + +
[in]filenameFilename
[in]modeBitwise combination of mode_t flags
+
+
+ +
+
+ +

◆ read()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual size_t stdex::stream::memory_file::read (_Out_writes_bytes_to_opt_(length, return) void * data,
size_t length 
)
+
+inlinevirtual
+
+ +

Reads block of data from the stream.

+
Parameters
+ + + +
[out]dataBuffer to store read data
[in]lengthByte limit of data to read
+
+
+
Returns
Number of bytes succesfully read. On EOF, 0 is returned and stream state is set to state_t::eof. On error, 0 is returned and stream state is set to state_t::fail. On null reads (length == 0), 0 is returned and stream state is set to state_t::ok.
+ +

Reimplemented from stdex::stream::basic.

+ +
+
+ +

◆ read_data()

+ +
+
+
+template<class T >
+ + + + + +
+ + + + + + + + +
memory_file & stdex::stream::memory_file::read_data (T & data)
+
+inline
+
+ +

Reads one primitive data type.

+

This method is intended for chaining: e.g. stream.read_str(a).read_str(b).read_str(c)... Since it would make it impossible to detect if any of the read_str(a) or read_str(b) failed should read_str(c) succeed, the method skips reading if stream state is not ok.

+

As memory read rarely fails, a #define CHECK_STREAM_STATE 0 turns this checking off when performance is paramount.

+
Parameters
+ + +
[in]dataWhere to store read data
+
+
+
Returns
This stream
+ +
+
+ +

◆ read_str()

+ +
+
+
+template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
+ + + + + +
+ + + + + + + + +
memory_file & stdex::stream::memory_file::read_str (std::basic_string< _Elem, _Traits, _Ax > & data)
+
+inline
+
+ +

Reads length-prefixed string from the stream.

+

This method is intended for chaining: e.g. stream.read_str(a).read_str(b).read_str(c)... Since it would make it impossible to detect if any of the read_str(a) or read_str(b) failed should read_str(c) succeed, the method skips reading if stream state is not ok.

+

As memory read rarely fails, a #define CHECK_STREAM_STATE 0 turns this checking off when performance is paramount.

+
Parameters
+ + +
[in]dataString to read to
+
+
+
Returns
This stream
+ +
+
+ +

◆ reserve()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void stdex::stream::memory_file::reserve (size_t required,
bool tight = false 
)
+
+inlinenoexcept
+
+ +

Reallocates memory.

+
Parameters
+ + + +
[in]requiredDemanded memory size
[in]tightDon't overallocate on grow, release excessive on decrease.
+
+
+ +
+
+ +

◆ save()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void stdex::stream::memory_file::save (const sys_char * filename,
int mode 
)
+
+inline
+
+ +

Saves content to a file-system file.

+
Parameters
+ + + +
[in]filenameFilename
[in]modeBitwise combination of mode_t flags
+
+
+ +
+
+ +

◆ seek()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual fpos_t stdex::stream::memory_file::seek (foff_t offset,
seek_t how = seek_t::beg 
)
+
+inlinevirtual
+
+ +

Seeks to specified relative file position.

+
Returns
Absolute file position after seek, or fpos_max if seek failed.
+ +

Implements stdex::stream::basic_file.

+ +
+
+ +

◆ set()

+ +
+
+
+template<class T >
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void stdex::stream::memory_file::set (fpos_t offset,
const T data 
)
+
+inlineprotected
+
+ +

Writes data to specified file location This does not move file pointer nor update file size. It checks for reserved space assert-only (in Debug builds). Use with caution!

+
Parameters
+ + + +
[in]offsetOffset in file where to write data
[in]dataData to write
+
+
+ +
+
+ +

◆ size()

+ +
+
+ + + + + +
+ + + + + + + +
virtual fsize_t stdex::stream::memory_file::size ()
+
+inlinevirtual
+
+ +

Returns file size Should the file size cannot be determined, the method returns fsize_max and it does not reset the state to failed.

+ +

Implements stdex::stream::basic_file.

+ +
+
+ +

◆ tell()

+ +
+
+ + + + + +
+ + + + + + + +
virtual fpos_t stdex::stream::memory_file::tell () const
+
+inlinevirtual
+
+ +

Returns absolute file position in file or fpos_max if fails. This method does not update stream state.

+
Returns
Absolute file position or fpos_max if position cannot be determined.
+ +

Implements stdex::stream::basic_file.

+ +
+
+ +

◆ truncate()

+ +
+
+ + + + + +
+ + + + + + + +
virtual void stdex::stream::memory_file::truncate ()
+
+inlinevirtual
+
+ +

Sets file size - truncates the remainder of file content from the current file position to the end of file.

+ +

Implements stdex::stream::basic_file.

+ +
+
+ +

◆ write()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual size_t stdex::stream::memory_file::write (_In_reads_bytes_opt_(length) const void * data,
size_t length 
)
+
+inlinevirtual
+
+ +

Writes block of data to the stream.

+
Parameters
+ + + +
[in]dataBuffer to write data from
[in]lengthNumber of bytes to write
+
+
+
Returns
Number of bytes succesfully written. On error, stream state is set to state_t::fail.
+ +

Reimplemented from stdex::stream::basic.

+ +
+
+ +

◆ write_data()

+ +
+
+
+template<class T >
+ + + + + +
+ + + + + + + + +
memory_file & stdex::stream::memory_file::write_data (const T data)
+
+inline
+
+ +

Writes one primitive data type.

+

This method is intended for chaining: e.g. stream.write_data(a).write_data(b).write_data(c)... Since it would make it impossible to detect if any of the write_data(a) or write_data(b) failed should write_data(c) succeed, the method skips writing if stream state is not ok.

+

As memory write rarely fails, a #define CHECK_STREAM_STATE 0 turns this checking off when performance is paramount.

+
Parameters
+ + +
[in]dataData to write
+
+
+
Returns
This stream
+ +
+
+ +

◆ write_str()

+ +
+
+
+template<class T >
+ + + + + +
+ + + + + + + + +
memory_file & stdex::stream::memory_file::write_str (const T * data)
+
+inline
+
+ +

Writes string to the stream length-prefixed.

+

This method is intended for chaining: e.g. stream.write_str(a).write_str(b).write_str(c)... Since it would make it impossible to detect if any of the write_str(a) or write_str(b) failed should write_str(c) succeed, the method skips writing if stream state is not ok.

+

As memory write rarely fails, a #define CHECK_STREAM_STATE 0 turns this checking off when performance is paramount.

+
Parameters
+ + +
[in]dataString to write
+
+
+
Returns
This stream
+ +
+
+ +

◆ write_stream()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
size_t stdex::stream::memory_file::write_stream (basicstream,
size_t amount = SIZE_MAX 
)
+
+inline
+
+ +

Writes content of another stream.

+
Returns
Number of bytes written
+ +
+
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/classstdex_1_1stream_1_1memory__file.png b/classstdex_1_1stream_1_1memory__file.png new file mode 100644 index 000000000..b11f4e54f Binary files /dev/null and b/classstdex_1_1stream_1_1memory__file.png differ diff --git a/classstdex_1_1stream_1_1replicator-members.html b/classstdex_1_1stream_1_1replicator-members.html new file mode 100644 index 000000000..3b230c1ab --- /dev/null +++ b/classstdex_1_1stream_1_1replicator-members.html @@ -0,0 +1,148 @@ + + + + + + + +stdex: Member List + + + + + + + + + +
+
+ + + + + + +
+
stdex +
+
Additional custom or not Standard C++ covered algorithms
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
stdex::stream::replicator Member List
+
+
+ +

This is the complete list of members for stdex::stream::replicator, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
basic(state_t state=state_t::ok) (defined in stdex::stream::basic)stdex::stream::basicinline
close()stdex::stream::replicatorinlinevirtual
flush()stdex::stream::replicatorinlinevirtual
foreach_worker(worker::op_t op) (defined in stdex::stream::replicator)stdex::stream::replicatorinlineprotected
m_state (defined in stdex::stream::basic)stdex::stream::basicprotected
m_workers (defined in stdex::stream::replicator)stdex::stream::replicatorprotected
ok() conststdex::stream::basicinline
operator<<(const int8_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const int16_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const int32_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const int64_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint8_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint16_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint32_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint64_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const float data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const double data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const char data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const T *data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int8_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int16_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int32_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int64_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint8_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint16_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint32_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint64_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(float &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(double &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(char &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(std::basic_string< _Elem, _Traits, _Ax > &data) (defined in stdex::stream::basic)stdex::stream::basicinline
push_back(basic *source)stdex::stream::replicatorinline
read(_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)stdex::stream::basicinlinevirtual
read_array(_Out_writes_bytes_(size *count) void *array, size_t size, size_t count)stdex::stream::basicinline
read_byte()stdex::stream::basicinline
read_data(T &data)stdex::stream::basicinline
read_remainder(size_t max_length=SIZE_MAX)stdex::stream::basicinlinevirtual
read_str(std::basic_string< _Elem, _Traits, _Ax > &data)stdex::stream::basicinline
readln(std::basic_string< char, _Traits, _Ax > &str)stdex::stream::basicinline
readln(std::basic_string< wchar_t, _Traits, _Ax > &wstr)stdex::stream::basicinline
readln(std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)stdex::stream::basicinline
readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline
readln_and_attach(std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)stdex::stream::basicinline
remove(basic *source)stdex::stream::replicatorinline
skip(fsize_t amount)stdex::stream::basicinlinevirtual
state() conststdex::stream::basicinline
write(_In_reads_bytes_opt_(length) const void *data, size_t length)stdex::stream::replicatorinlinevirtual
write_array(_In_reads_bytes_opt_(size *count) const void *array, size_t size, size_t count)stdex::stream::basicinline
write_array(_In_reads_or_z_opt_(num_chars) const wchar_t *wstr, size_t num_chars, charset_id charset)stdex::stream::basicinline
write_byte(uint8_t byte, fsize_t amount=1)stdex::stream::basicinline
write_charset(charset_id charset)stdex::stream::basicinline
write_data(const T data)stdex::stream::basicinline
write_sprintf(_Printf_format_string_params_(2) const char *format, locale_t locale,...)stdex::stream::basicinline
write_sprintf(_Printf_format_string_params_(2) const wchar_t *format, locale_t locale,...)stdex::stream::basicinline
write_str(const T *data)stdex::stream::basicinline
write_stream(basic &stream, fsize_t amount=fsize_max)stdex::stream::basicinline
write_vsprintf(_Printf_format_string_params_(2) const char *format, locale_t locale, va_list params)stdex::stream::basicinline
write_vsprintf(_Printf_format_string_params_(2) const wchar_t *format, locale_t locale, va_list params)stdex::stream::basicinline
~replicator() (defined in stdex::stream::replicator)stdex::stream::replicatorinlinevirtual
+ + + + diff --git a/classstdex_1_1stream_1_1replicator.html b/classstdex_1_1stream_1_1replicator.html new file mode 100644 index 000000000..6008ee7da --- /dev/null +++ b/classstdex_1_1stream_1_1replicator.html @@ -0,0 +1,436 @@ + + + + + + + +stdex: stdex::stream::replicator Class Reference + + + + + + + + + +
+
+ + + + + + +
+
stdex +
+
Additional custom or not Standard C++ covered algorithms
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
+Classes | +Public Member Functions | +Protected Member Functions | +Protected Attributes | +List of all members
+
stdex::stream::replicator Class Reference
+
+
+ +

Replicates writing of the same data to multiple streams. + More...

+ +

#include <stdex/stream.hpp>

+
+Inheritance diagram for stdex::stream::replicator:
+
+
+ + +stdex::stream::basic + +
+ + + + +

+Classes

class  worker
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

+void push_back (basic *source)
 Adds stream on the list.
 
+void remove (basic *source)
 Removes stream from the list.
 
virtual size_t write (_In_reads_bytes_opt_(length) const void *data, size_t length)
 Writes block of data to the stream.
 
virtual void close ()
 Closes the stream.
 
virtual void flush ()
 Persists volatile element data.
 
- Public Member Functions inherited from stdex::stream::basic
basic (state_t state=state_t::ok)
 
virtual size_t read (_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
 Reads block of data from the stream.
 
virtual size_t write (_In_reads_bytes_opt_(length) const void *data, size_t length)
 Writes block of data to the stream.
 
virtual void flush ()
 Persists volatile element data.
 
virtual void close ()
 Closes the stream.
 
virtual void skip (fsize_t amount)
 Skips given amount of bytes of data on the stream.
 
+state_t state () const
 Returns stream state after last operation.
 
+bool ok () const
 Returns true if the stream state is clean i.e. previous operation was succesful.
 
virtual std::vector< uint8_t > read_remainder (size_t max_length=SIZE_MAX)
 Reads and returns remainder of the stream.
 
+uint8_t read_byte ()
 Reads one byte of data.
 
+void write_byte (uint8_t byte, fsize_t amount=1)
 Writes a byte of data.
 
template<class T >
basicread_data (T &data)
 Reads one primitive data type.
 
template<class T >
basicwrite_data (const T data)
 Writes one primitive data type.
 
template<class _Traits = std::char_traits<char>, class _Ax = std::allocator<char>>
size_t readln (std::basic_string< char, _Traits, _Ax > &str)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln (std::basic_string< wchar_t, _Traits, _Ax > &wstr)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln (std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
size_t readln_and_attach (std::basic_string< _Elem, _Traits, _Ax > &str)
 Reads stream to the end-of-line or end-of-file and append to str.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln_and_attach (std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)
 Reads stream to the end-of-line or end-of-file and append to str.
 
size_t read_array (_Out_writes_bytes_(size *count) void *array, size_t size, size_t count)
 Reads an array of data from the stream.
 
size_t write_array (_In_reads_bytes_opt_(size *count) const void *array, size_t size, size_t count)
 Writes an array of data to the stream.
 
size_t write_array (_In_reads_or_z_opt_(num_chars) const wchar_t *wstr, size_t num_chars, charset_id charset)
 Writes array of characters to the stream.
 
template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
basicread_str (std::basic_string< _Elem, _Traits, _Ax > &data)
 Reads length-prefixed string from the stream.
 
template<class T >
basicwrite_str (const T *data)
 Writes string to the stream length-prefixed.
 
fsize_t write_stream (basic &stream, fsize_t amount=fsize_max)
 Writes content of another stream.
 
+void write_charset (charset_id charset)
 Writes UTF8 or UTF-16 byte-order-mark.
 
size_t write_sprintf (_Printf_format_string_params_(2) const char *format, locale_t locale,...)
 Writes formatted string to the stream.
 
size_t write_sprintf (_Printf_format_string_params_(2) const wchar_t *format, locale_t locale,...)
 Writes formatted string to the stream.
 
size_t write_vsprintf (_Printf_format_string_params_(2) const char *format, locale_t locale, va_list params)
 Writes formatted string to the stream.
 
size_t write_vsprintf (_Printf_format_string_params_(2) const wchar_t *format, locale_t locale, va_list params)
 Writes formatted string to the stream.
 
+basicoperator>> (int8_t &data)
 
+basicoperator<< (const int8_t data)
 
+basicoperator>> (int16_t &data)
 
+basicoperator<< (const int16_t data)
 
+basicoperator>> (int32_t &data)
 
+basicoperator<< (const int32_t data)
 
+basicoperator>> (int64_t &data)
 
+basicoperator<< (const int64_t data)
 
+basicoperator>> (uint8_t &data)
 
+basicoperator<< (const uint8_t data)
 
+basicoperator>> (uint16_t &data)
 
+basicoperator<< (const uint16_t data)
 
+basicoperator>> (uint32_t &data)
 
+basicoperator<< (const uint32_t data)
 
+basicoperator>> (uint64_t &data)
 
+basicoperator<< (const uint64_t data)
 
+basicoperator>> (float &data)
 
+basicoperator<< (const float data)
 
+basicoperator>> (double &data)
 
+basicoperator<< (const double data)
 
+basicoperator>> (char &data)
 
+basicoperator<< (const char data)
 
+template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
basicoperator>> (std::basic_string< _Elem, _Traits, _Ax > &data)
 
+template<class T >
basicoperator<< (const T *data)
 
+ + + +

+Protected Member Functions

+void foreach_worker (worker::op_t op)
 
+ + + + + + +

+Protected Attributes

+std::list< std::unique_ptr< worker > > m_workers
 
- Protected Attributes inherited from stdex::stream::basic
+state_t m_state
 
+

Detailed Description

+

Replicates writing of the same data to multiple streams.

+

Member Function Documentation

+ +

◆ close()

+ +
+
+ + + + + +
+ + + + + + + +
virtual void stdex::stream::replicator::close ()
+
+inlinevirtual
+
+ +

Closes the stream.

+ +

Reimplemented from stdex::stream::basic.

+ +
+
+ +

◆ flush()

+ +
+
+ + + + + +
+ + + + + + + +
virtual void stdex::stream::replicator::flush ()
+
+inlinevirtual
+
+ +

Persists volatile element data.

+ +

Reimplemented from stdex::stream::basic.

+ +
+
+ +

◆ write()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual size_t stdex::stream::replicator::write (_In_reads_bytes_opt_(length) const void * data,
size_t length 
)
+
+inlinevirtual
+
+ +

Writes block of data to the stream.

+
Parameters
+ + + +
[in]dataBuffer to write data from
[in]lengthNumber of bytes to write
+
+
+
Returns
Number of bytes succesfully written. On error, stream state is set to state_t::fail.
+ +

Reimplemented from stdex::stream::basic.

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/classstdex_1_1stream_1_1replicator.png b/classstdex_1_1stream_1_1replicator.png new file mode 100644 index 000000000..fd596737d Binary files /dev/null and b/classstdex_1_1stream_1_1replicator.png differ diff --git a/classstdex_1_1stream_1_1replicator_1_1worker-members.html b/classstdex_1_1stream_1_1replicator_1_1worker-members.html new file mode 100644 index 000000000..ebda25db8 --- /dev/null +++ b/classstdex_1_1stream_1_1replicator_1_1worker-members.html @@ -0,0 +1,100 @@ + + + + + + + +stdex: Member List + + + + + + + + + +
+
+ + + + + + +
+
stdex +
+
Additional custom or not Standard C++ covered algorithms
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
stdex::stream::replicator::worker Member List
+
+
+ +

This is the complete list of members for stdex::stream::replicator::worker, including all inherited members.

+ + + + + + + + + + + + +
cv (defined in stdex::stream::replicator::worker)stdex::stream::replicator::worker
datastdex::stream::replicator::worker
lengthstdex::stream::replicator::worker
mutex (defined in stdex::stream::replicator::worker)stdex::stream::replicator::worker
num_writtenstdex::stream::replicator::worker
opstdex::stream::replicator::worker
op_t enum name (defined in stdex::stream::replicator::worker)stdex::stream::replicator::worker
process_op(worker &w) (defined in stdex::stream::replicator::worker)stdex::stream::replicator::workerinlineprotectedstatic
source (defined in stdex::stream::replicator::worker)stdex::stream::replicator::worker
thread (defined in stdex::stream::replicator::worker)stdex::stream::replicator::worker
worker(basic *_source) (defined in stdex::stream::replicator::worker)stdex::stream::replicator::workerinline
+ + + + diff --git a/classstdex_1_1stream_1_1replicator_1_1worker.html b/classstdex_1_1stream_1_1replicator_1_1worker.html new file mode 100644 index 000000000..4c489158d --- /dev/null +++ b/classstdex_1_1stream_1_1replicator_1_1worker.html @@ -0,0 +1,152 @@ + + + + + + + +stdex: stdex::stream::replicator::worker Class Reference + + + + + + + + + +
+
+ + + + + + +
+
stdex +
+
Additional custom or not Standard C++ covered algorithms
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
+Public Types | +Public Member Functions | +Public Attributes | +Static Protected Member Functions | +List of all members
+
stdex::stream::replicator::worker Class Reference
+
+
+ + + + +

+Public Types

enum class  op_t {
+  noop = 0 +, quit +, write +, close +,
+  flush +
+ }
 
+ + + +

+Public Member Functions

worker (basic *_source)
 
+ + + + + + + + + + + + + + + + + + + + + +

+Public Attributes

+basicsource
 
+enum stdex::stream::replicator::worker::op_t op
 Operation to perform.
 
+const void * data
 Data to write.
 
+size_t length
 Byte limit of data to write.
 
+size_t num_written
 Number of bytes written.
 
+std::mutex mutex
 
+std::condition_variable cv
 
+std::thread thread
 
+ + + +

+Static Protected Member Functions

+static void process_op (worker &w)
 
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/classstdex_1_1stream_1_1window-members.html b/classstdex_1_1stream_1_1window-members.html new file mode 100644 index 000000000..b405b0f2b --- /dev/null +++ b/classstdex_1_1stream_1_1window-members.html @@ -0,0 +1,153 @@ + + + + + + + +stdex: Member List + + + + + + + + + +
+
+ + + + + + +
+
stdex +
+
Additional custom or not Standard C++ covered algorithms
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
stdex::stream::window Member List
+
+
+ +

This is the complete list of members for stdex::stream::window, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
basic(state_t state=state_t::ok) (defined in stdex::stream::basic)stdex::stream::basicinline
close()stdex::stream::converterinlinevirtual
converter() (defined in stdex::stream::converter)stdex::stream::converterinlineexplicitprotected
converter(basic &source) (defined in stdex::stream::converter)stdex::stream::converterinline
flush()stdex::stream::converterinlinevirtual
init(basic &source) (defined in stdex::stream::converter)stdex::stream::converterinlineprotected
limiter(basic &source, fsize_t _read_limit=0, fsize_t _write_limit=0) (defined in stdex::stream::limiter)stdex::stream::limiterinline
m_source (defined in stdex::stream::converter)stdex::stream::converterprotected
m_state (defined in stdex::stream::basic)stdex::stream::basicprotected
ok() conststdex::stream::basicinline
operator<<(const int8_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const int16_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const int32_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const int64_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint8_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint16_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint32_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const uint64_t data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const float data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const double data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const char data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator<<(const T *data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int8_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int16_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int32_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(int64_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint8_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint16_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint32_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(uint64_t &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(float &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(double &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(char &data) (defined in stdex::stream::basic)stdex::stream::basicinline
operator>>(std::basic_string< _Elem, _Traits, _Ax > &data) (defined in stdex::stream::basic)stdex::stream::basicinline
read(_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)stdex::stream::windowinlinevirtual
read_array(_Out_writes_bytes_(size *count) void *array, size_t size, size_t count)stdex::stream::basicinline
read_byte()stdex::stream::basicinline
read_data(T &data)stdex::stream::basicinline
read_limitstdex::stream::limiter
read_offsetstdex::stream::window
read_remainder(size_t max_length=SIZE_MAX)stdex::stream::basicinlinevirtual
read_str(std::basic_string< _Elem, _Traits, _Ax > &data)stdex::stream::basicinline
readln(std::basic_string< char, _Traits, _Ax > &str)stdex::stream::basicinline
readln(std::basic_string< wchar_t, _Traits, _Ax > &wstr)stdex::stream::basicinline
readln(std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)stdex::stream::basicinline
readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline
readln_and_attach(std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)stdex::stream::basicinline
skip(fsize_t amount)stdex::stream::basicinlinevirtual
state() conststdex::stream::basicinline
window(basic &source, fpos_t _read_offset=0, fsize_t read_limit=fsize_max, fpos_t _write_offset=0, fsize_t write_limit=fsize_max) (defined in stdex::stream::window)stdex::stream::windowinline
write(_In_reads_bytes_opt_(length) const void *data, size_t length)stdex::stream::windowinlinevirtual
write_array(_In_reads_bytes_opt_(size *count) const void *array, size_t size, size_t count)stdex::stream::basicinline
write_array(_In_reads_or_z_opt_(num_chars) const wchar_t *wstr, size_t num_chars, charset_id charset)stdex::stream::basicinline
write_byte(uint8_t byte, fsize_t amount=1)stdex::stream::basicinline
write_charset(charset_id charset)stdex::stream::basicinline
write_data(const T data)stdex::stream::basicinline
write_limitstdex::stream::limiter
write_offsetstdex::stream::window
write_sprintf(_Printf_format_string_params_(2) const char *format, locale_t locale,...)stdex::stream::basicinline
write_sprintf(_Printf_format_string_params_(2) const wchar_t *format, locale_t locale,...)stdex::stream::basicinline
write_str(const T *data)stdex::stream::basicinline
write_stream(basic &stream, fsize_t amount=fsize_max)stdex::stream::basicinline
write_vsprintf(_Printf_format_string_params_(2) const char *format, locale_t locale, va_list params)stdex::stream::basicinline
write_vsprintf(_Printf_format_string_params_(2) const wchar_t *format, locale_t locale, va_list params)stdex::stream::basicinline
+ + + + diff --git a/classstdex_1_1stream_1_1window.html b/classstdex_1_1stream_1_1window.html new file mode 100644 index 000000000..35ddba56c --- /dev/null +++ b/classstdex_1_1stream_1_1window.html @@ -0,0 +1,458 @@ + + + + + + + +stdex: stdex::stream::window Class Reference + + + + + + + + + +
+
+ + + + + + +
+
stdex +
+
Additional custom or not Standard C++ covered algorithms
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
+Public Member Functions | +Public Attributes | +List of all members
+
stdex::stream::window Class Reference
+
+
+ +

Limits reading from/writing to stream to a predefined window. + More...

+ +

#include <stdex/stream.hpp>

+
+Inheritance diagram for stdex::stream::window:
+
+
+ + +stdex::stream::limiter +stdex::stream::converter +stdex::stream::basic + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

window (basic &source, fpos_t _read_offset=0, fsize_t read_limit=fsize_max, fpos_t _write_offset=0, fsize_t write_limit=fsize_max)
 
virtual size_t read (_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
 Reads block of data from the stream.
 
virtual size_t write (_In_reads_bytes_opt_(length) const void *data, size_t length)
 Writes block of data to the stream.
 
- Public Member Functions inherited from stdex::stream::limiter
limiter (basic &source, fsize_t _read_limit=0, fsize_t _write_limit=0)
 
virtual size_t read (_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
 Reads block of data from the stream.
 
virtual size_t write (_In_reads_bytes_opt_(length) const void *data, size_t length)
 Writes block of data to the stream.
 
- Public Member Functions inherited from stdex::stream::converter
converter (basic &source)
 
virtual size_t read (_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
 Reads block of data from the stream.
 
virtual size_t write (_In_reads_bytes_opt_(length) const void *data, size_t length)
 Writes block of data to the stream.
 
virtual void close ()
 Closes the stream.
 
virtual void flush ()
 Persists volatile element data.
 
- Public Member Functions inherited from stdex::stream::basic
basic (state_t state=state_t::ok)
 
virtual size_t read (_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
 Reads block of data from the stream.
 
virtual size_t write (_In_reads_bytes_opt_(length) const void *data, size_t length)
 Writes block of data to the stream.
 
virtual void flush ()
 Persists volatile element data.
 
virtual void close ()
 Closes the stream.
 
virtual void skip (fsize_t amount)
 Skips given amount of bytes of data on the stream.
 
+state_t state () const
 Returns stream state after last operation.
 
+bool ok () const
 Returns true if the stream state is clean i.e. previous operation was succesful.
 
virtual std::vector< uint8_t > read_remainder (size_t max_length=SIZE_MAX)
 Reads and returns remainder of the stream.
 
+uint8_t read_byte ()
 Reads one byte of data.
 
+void write_byte (uint8_t byte, fsize_t amount=1)
 Writes a byte of data.
 
template<class T >
basicread_data (T &data)
 Reads one primitive data type.
 
template<class T >
basicwrite_data (const T data)
 Writes one primitive data type.
 
template<class _Traits = std::char_traits<char>, class _Ax = std::allocator<char>>
size_t readln (std::basic_string< char, _Traits, _Ax > &str)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln (std::basic_string< wchar_t, _Traits, _Ax > &wstr)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln (std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)
 Reads stream to the end-of-line or end-of-file.
 
template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
size_t readln_and_attach (std::basic_string< _Elem, _Traits, _Ax > &str)
 Reads stream to the end-of-line or end-of-file and append to str.
 
template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
size_t readln_and_attach (std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)
 Reads stream to the end-of-line or end-of-file and append to str.
 
size_t read_array (_Out_writes_bytes_(size *count) void *array, size_t size, size_t count)
 Reads an array of data from the stream.
 
size_t write_array (_In_reads_bytes_opt_(size *count) const void *array, size_t size, size_t count)
 Writes an array of data to the stream.
 
size_t write_array (_In_reads_or_z_opt_(num_chars) const wchar_t *wstr, size_t num_chars, charset_id charset)
 Writes array of characters to the stream.
 
template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
basicread_str (std::basic_string< _Elem, _Traits, _Ax > &data)
 Reads length-prefixed string from the stream.
 
template<class T >
basicwrite_str (const T *data)
 Writes string to the stream length-prefixed.
 
fsize_t write_stream (basic &stream, fsize_t amount=fsize_max)
 Writes content of another stream.
 
+void write_charset (charset_id charset)
 Writes UTF8 or UTF-16 byte-order-mark.
 
size_t write_sprintf (_Printf_format_string_params_(2) const char *format, locale_t locale,...)
 Writes formatted string to the stream.
 
size_t write_sprintf (_Printf_format_string_params_(2) const wchar_t *format, locale_t locale,...)
 Writes formatted string to the stream.
 
size_t write_vsprintf (_Printf_format_string_params_(2) const char *format, locale_t locale, va_list params)
 Writes formatted string to the stream.
 
size_t write_vsprintf (_Printf_format_string_params_(2) const wchar_t *format, locale_t locale, va_list params)
 Writes formatted string to the stream.
 
+basicoperator>> (int8_t &data)
 
+basicoperator<< (const int8_t data)
 
+basicoperator>> (int16_t &data)
 
+basicoperator<< (const int16_t data)
 
+basicoperator>> (int32_t &data)
 
+basicoperator<< (const int32_t data)
 
+basicoperator>> (int64_t &data)
 
+basicoperator<< (const int64_t data)
 
+basicoperator>> (uint8_t &data)
 
+basicoperator<< (const uint8_t data)
 
+basicoperator>> (uint16_t &data)
 
+basicoperator<< (const uint16_t data)
 
+basicoperator>> (uint32_t &data)
 
+basicoperator<< (const uint32_t data)
 
+basicoperator>> (uint64_t &data)
 
+basicoperator<< (const uint64_t data)
 
+basicoperator>> (float &data)
 
+basicoperator<< (const float data)
 
+basicoperator>> (double &data)
 
+basicoperator<< (const double data)
 
+basicoperator>> (char &data)
 
+basicoperator<< (const char data)
 
+template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
basicoperator>> (std::basic_string< _Elem, _Traits, _Ax > &data)
 
+template<class T >
basicoperator<< (const T *data)
 
+ + + + + + + + + + + + + + +

+Public Attributes

+fpos_t read_offset
 Number of bytes to skip on read.
 
+fpos_t write_offset
 Number of bytes to discard on write.
 
- Public Attributes inherited from stdex::stream::limiter
+fsize_t read_limit
 Number of bytes left that may be read from the stream.
 
+fsize_t write_limit
 Number of bytes left, that can be written to the stream.
 
+ + + + + + + + + + +

+Additional Inherited Members

- Protected Member Functions inherited from stdex::stream::converter
+void init (basic &source)
 
- Protected Attributes inherited from stdex::stream::converter
+basicm_source
 
- Protected Attributes inherited from stdex::stream::basic
+state_t m_state
 
+

Detailed Description

+

Limits reading from/writing to stream to a predefined window.

+

Member Function Documentation

+ +

◆ read()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual size_t stdex::stream::window::read (_Out_writes_bytes_to_opt_(length, return) void * data,
size_t length 
)
+
+inlinevirtual
+
+ +

Reads block of data from the stream.

+
Parameters
+ + + +
[out]dataBuffer to store read data
[in]lengthByte limit of data to read
+
+
+
Returns
Number of bytes succesfully read. On EOF, 0 is returned and stream state is set to state_t::eof. On error, 0 is returned and stream state is set to state_t::fail. On null reads (length == 0), 0 is returned and stream state is set to state_t::ok.
+ +

Reimplemented from stdex::stream::limiter.

+ +
+
+ +

◆ write()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual size_t stdex::stream::window::write (_In_reads_bytes_opt_(length) const void * data,
size_t length 
)
+
+inlinevirtual
+
+ +

Writes block of data to the stream.

+
Parameters
+ + + +
[in]dataBuffer to write data from
[in]lengthNumber of bytes to write
+
+
+
Returns
Number of bytes succesfully written. On error, stream state is set to state_t::fail.
+ +

Reimplemented from stdex::stream::limiter.

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/classstdex_1_1stream_1_1window.png b/classstdex_1_1stream_1_1window.png new file mode 100644 index 000000000..6b5c557f5 Binary files /dev/null and b/classstdex_1_1stream_1_1window.png differ diff --git a/classstdex_1_1sys__object-members.html b/classstdex_1_1sys__object-members.html new file mode 100644 index 000000000..87b42882c --- /dev/null +++ b/classstdex_1_1sys__object-members.html @@ -0,0 +1,101 @@ + + + + + + + +stdex: Member List + + + + + + + + + +
+
+ + + + + + +
+
stdex +
+
Additional custom or not Standard C++ covered algorithms
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
stdex::sys_object Member List
+
+
+ +

This is the complete list of members for stdex::sys_object, including all inherited members.

+ + + + + + + + + + + + + +
close()stdex::sys_objectinlinevirtual
close(sys_handle h)stdex::sys_objectinlineprotectedstatic
duplicate(sys_handle h, bool inherit)stdex::sys_objectinlineprotectedstatic
get() const noexceptstdex::sys_objectinline
m_h (defined in stdex::sys_object)stdex::sys_objectprotected
operator bool() const noexceptstdex::sys_objectinline
operator=(const sys_object &other) (defined in stdex::sys_object)stdex::sys_objectinline
operator=(sys_object &&other) noexcept (defined in stdex::sys_object)stdex::sys_objectinline
sys_object(sys_handle h=invalid_handle) (defined in stdex::sys_object)stdex::sys_objectinline
sys_object(const sys_object &other) (defined in stdex::sys_object)stdex::sys_objectinline
sys_object(sys_object &&other) noexcept (defined in stdex::sys_object)stdex::sys_objectinline
~sys_object() (defined in stdex::sys_object)stdex::sys_objectinlinevirtual
+ + + + diff --git a/classstdex_1_1sys__object.html b/classstdex_1_1sys__object.html new file mode 100644 index 000000000..c522b8979 --- /dev/null +++ b/classstdex_1_1sys__object.html @@ -0,0 +1,188 @@ + + + + + + + +stdex: stdex::sys_object Class Reference + + + + + + + + + +
+
+ + + + + + +
+
stdex +
+
Additional custom or not Standard C++ covered algorithms
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
+Public Member Functions | +Static Protected Member Functions | +Protected Attributes | +List of all members
+
stdex::sys_object Class Reference
+
+
+ +

Operating system object (file, pipe, anything with an OS handle etc.) + More...

+ +

#include <stdex/system.hpp>

+
+Inheritance diagram for stdex::sys_object:
+
+
+ + +stdex::stream::basic_sys +stdex::stream::file + +
+ + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

sys_object (sys_handle h=invalid_handle)
 
sys_object (const sys_object &other)
 
+sys_objectoperator= (const sys_object &other)
 
sys_object (sys_object &&other) noexcept
 
+sys_objectoperator= (sys_object &&other) noexcept
 
virtual void close ()
 Closes object.
 
operator bool () const noexcept
 Returns true if object is valid.
 
+sys_handle get () const noexcept
 Returns object handle.
 
+ + + + + + + +

+Static Protected Member Functions

+static void close (sys_handle h)
 Closes object.
 
+static sys_handle duplicate (sys_handle h, bool inherit)
 Duplicates given object.
 
+ + + +

+Protected Attributes

+sys_handle m_h
 
+

Detailed Description

+

Operating system object (file, pipe, anything with an OS handle etc.)

+

Member Function Documentation

+ +

◆ close()

+ +
+
+ + + + + +
+ + + + + + + +
virtual void stdex::sys_object::close ()
+
+inlinevirtual
+
+ +

Closes object.

+ +

Reimplemented in stdex::stream::basic_sys.

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/classstdex_1_1sys__object.png b/classstdex_1_1sys__object.png new file mode 100644 index 000000000..ad3353bd0 Binary files /dev/null and b/classstdex_1_1sys__object.png differ diff --git a/classstdex_1_1user__cancelled-members.html b/classstdex_1_1user__cancelled-members.html index 7622ae1a7..0622c0bb7 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 1b471db55..7c863e1c4 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 ae4062653..a9848ed06 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 371032a06..e0fda0588 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 e4de9ad05..18b16de62 100644 --- a/dir_4be4f7b278e009bf0f1906cf31fb73bd.html +++ b/dir_4be4f7b278e009bf0f1906cf31fb73bd.html @@ -86,7 +86,7 @@ Files diff --git a/dir_d44c64559bbebec7f509842c48db8b23.html b/dir_d44c64559bbebec7f509842c48db8b23.html index f58b42499..d93147519 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 e82e7e722..8dcdb3b69 100644 --- a/dir_fca3c47b2ea228727bd6729832f89576.html +++ b/dir_fca3c47b2ea228727bd6729832f89576.html @@ -94,28 +94,32 @@ Files    idrec.hpp   - internal.hpp interval.hpp   - ios.hpp mapping.hpp   + math.hpp memory.hpp    parser.hpp    progress.hpp   + ring.hpp sal.hpp    sgml.hpp    sgml_unicode.hpp   + stream.hpp string.hpp   + system.hpp unicode.hpp    vector_queue.hpp @@ -124,7 +128,7 @@ Files diff --git a/endian_8hpp_source.html b/endian_8hpp_source.html index cd8607553..cf17b2a24 100644 --- a/endian_8hpp_source.html +++ b/endian_8hpp_source.html @@ -84,107 +84,105 @@ $(function() {
5
6#pragma once
7
-
8#ifdef _WIN32
-
9#include <windows.h>
-
10#endif
-
11#include "sal.hpp"
-
12#include <assert.h>
-
13#include <stdint.h>
-
14
-
15#ifdef _WIN32
-
16#if REG_DWORD == REG_DWORD_LITTLE_ENDIAN
-
17#elif REG_DWORD == REG_DWORD_BIG_ENDIAN
-
18#define BIG_ENDIAN
-
19#else
-
20#error Unknown endian
-
21#endif
-
22#else
-
23#include <endian.h>
-
24#if __BYTE_ORDER == __LITTLE_ENDIAN
-
25#elif __BYTE_ORDER == __BIG_ENDIAN
-
26#define BIG_ENDIAN
-
27#else
-
28#error Unknown endian
-
29#endif
-
30#endif
-
31
-
32namespace stdex
-
33{
-
34 inline uint16_t byteswap(_In_ const uint16_t value)
-
35 {
-
36 #if _MSC_VER >= 1300
-
37 return _byteswap_ushort(value);
-
38 #elif defined(_MSC_VER)
-
39 uint16_t t = (value & 0x00ff) << 8;
-
40 t |= (value) >> 8;
-
41 return t;
-
42 #else
-
43 return __builtin_bswap16(value);
-
44 #endif
-
45 }
-
46
-
47 inline uint32_t byteswap(_In_ const uint32_t value)
-
48 {
-
49 #if _MSC_VER >= 1300
-
50 return _byteswap_ulong(value);
-
51 #elif defined(_MSC_VER)
-
52 uint32_t t = (value & 0x000000ff) << 24;
-
53 t |= (value & 0x0000ff00) << 8;
-
54 t |= (value & 0x00ff0000) >> 8;
-
55 t |= (value) >> 24;
-
56 return t;
-
57 #else
-
58 return __builtin_bswap32(value);
-
59 #endif
-
60 }
-
61
-
62 inline uint64_t byteswap(_In_ const uint64_t value)
-
63 {
-
64 #if _MSC_VER >= 1300
-
65 return _byteswap_uint64(value);
-
66 #elif defined(_MSC_VER)
-
67 uint64_t t = (value & 0x00000000000000ff) << 56;
-
68 t |= (value & 0x000000000000ff00) << 40;
-
69 t |= (value & 0x0000000000ff0000) << 24;
-
70 t |= (value & 0x00000000ff000000) << 8;
-
71 t |= (value & 0x000000ff00000000) >> 8;
-
72 t |= (value & 0x0000ff0000000000) >> 24;
-
73 t |= (value & 0x00ff000000000000) >> 40;
-
74 t |= (value) >> 56;
-
75 return t;
-
76 #else
-
77 return __builtin_bswap64(value);
-
78 #endif
-
79 }
-
80
-
81 inline int16_t byteswap(_In_ const int16_t value) { return byteswap((uint16_t)value); }
-
82 inline int32_t byteswap(_In_ const int32_t value) { return byteswap((uint32_t)value); }
-
83 inline int64_t byteswap(_In_ const int64_t value) { return byteswap((uint64_t)value); }
-
84
-
85 inline void byteswap(_Inout_ uint16_t* value) { assert(value); *value = byteswap(*value); }
-
86 inline void byteswap(_Inout_ uint32_t* value) { assert(value); *value = byteswap(*value); }
-
87 inline void byteswap(_Inout_ uint64_t* value) { assert(value); *value = byteswap(*value); }
-
88
-
89 inline void byteswap(_Inout_ int16_t* value) { byteswap((uint16_t*)value); }
-
90 inline void byteswap(_Inout_ int32_t* value) { byteswap((uint32_t*)value); }
-
91 inline void byteswap(_Inout_ int64_t* value) { byteswap((uint64_t*)value); }
-
92}
-
93
-
94#ifdef BIG_ENDIAN
-
95#define LE2HE(x) stdex::byteswap(x)
-
96#define BE2HE(x) (x)
-
97#define HE2LE(x) stdex::byteswap(x)
-
98#define HE2BE(x) (x)
-
99#else
-
100#define LE2HE(x) (x)
-
101#define BE2HE(x) stdex::byteswap(x)
-
102#define HE2LE(x) (x)
-
103#define HE2BE(x) stdex::byteswap(x)
-
104#endif
+
8#include "sal.hpp"
+
9#include "system.hpp"
+
10#include <assert.h>
+
11#include <stdint.h>
+
12
+
13#ifdef _WIN32
+
14#if REG_DWORD == REG_DWORD_LITTLE_ENDIAN
+
15#elif REG_DWORD == REG_DWORD_BIG_ENDIAN
+
16#define BIG_ENDIAN
+
17#else
+
18#error Unknown endian
+
19#endif
+
20#else
+
21#include <endian.h>
+
22#if __BYTE_ORDER == __LITTLE_ENDIAN
+
23#elif __BYTE_ORDER == __BIG_ENDIAN
+
24#define BIG_ENDIAN
+
25#else
+
26#error Unknown endian
+
27#endif
+
28#endif
+
29
+
30namespace stdex
+
31{
+
32 inline uint16_t byteswap(_In_ const uint16_t value)
+
33 {
+
34 #if _MSC_VER >= 1300
+
35 return _byteswap_ushort(value);
+
36 #elif defined(_MSC_VER)
+
37 uint16_t t = (value & 0x00ff) << 8;
+
38 t |= (value) >> 8;
+
39 return t;
+
40 #else
+
41 return __builtin_bswap16(value);
+
42 #endif
+
43 }
+
44
+
45 inline uint32_t byteswap(_In_ const uint32_t value)
+
46 {
+
47 #if _MSC_VER >= 1300
+
48 return _byteswap_ulong(value);
+
49 #elif defined(_MSC_VER)
+
50 uint32_t t = (value & 0x000000ff) << 24;
+
51 t |= (value & 0x0000ff00) << 8;
+
52 t |= (value & 0x00ff0000) >> 8;
+
53 t |= (value) >> 24;
+
54 return t;
+
55 #else
+
56 return __builtin_bswap32(value);
+
57 #endif
+
58 }
+
59
+
60 inline uint64_t byteswap(_In_ const uint64_t value)
+
61 {
+
62 #if _MSC_VER >= 1300
+
63 return _byteswap_uint64(value);
+
64 #elif defined(_MSC_VER)
+
65 uint64_t t = (value & 0x00000000000000ff) << 56;
+
66 t |= (value & 0x000000000000ff00) << 40;
+
67 t |= (value & 0x0000000000ff0000) << 24;
+
68 t |= (value & 0x00000000ff000000) << 8;
+
69 t |= (value & 0x000000ff00000000) >> 8;
+
70 t |= (value & 0x0000ff0000000000) >> 24;
+
71 t |= (value & 0x00ff000000000000) >> 40;
+
72 t |= (value) >> 56;
+
73 return t;
+
74 #else
+
75 return __builtin_bswap64(value);
+
76 #endif
+
77 }
+
78
+
79 inline int16_t byteswap(_In_ const int16_t value) { return byteswap((uint16_t)value); }
+
80 inline int32_t byteswap(_In_ const int32_t value) { return byteswap((uint32_t)value); }
+
81 inline int64_t byteswap(_In_ const int64_t value) { return byteswap((uint64_t)value); }
+
82
+
83 inline void byteswap(_Inout_ uint16_t* value) { assert(value); *value = byteswap(*value); }
+
84 inline void byteswap(_Inout_ uint32_t* value) { assert(value); *value = byteswap(*value); }
+
85 inline void byteswap(_Inout_ uint64_t* value) { assert(value); *value = byteswap(*value); }
+
86
+
87 inline void byteswap(_Inout_ int16_t* value) { byteswap((uint16_t*)value); }
+
88 inline void byteswap(_Inout_ int32_t* value) { byteswap((uint32_t*)value); }
+
89 inline void byteswap(_Inout_ int64_t* value) { byteswap((uint64_t*)value); }
+
90}
+
91
+
92#ifdef BIG_ENDIAN
+
93#define LE2HE(x) stdex::byteswap(x)
+
94#define BE2HE(x) (x)
+
95#define HE2LE(x) stdex::byteswap(x)
+
96#define HE2BE(x) (x)
+
97#else
+
98#define LE2HE(x) (x)
+
99#define BE2HE(x) stdex::byteswap(x)
+
100#define HE2LE(x) (x)
+
101#define HE2BE(x) stdex::byteswap(x)
+
102#endif
diff --git a/errno_8hpp_source.html b/errno_8hpp_source.html index 4110a13b7..f8e890ca0 100644 --- a/errno_8hpp_source.html +++ b/errno_8hpp_source.html @@ -136,7 +136,7 @@ $(function() { diff --git a/exception_8hpp_source.html b/exception_8hpp_source.html index 12789a6fe..ea3187bf5 100644 --- a/exception_8hpp_source.html +++ b/exception_8hpp_source.html @@ -102,7 +102,7 @@ $(function() { diff --git a/files.html b/files.html index 21804e36a..fdd06ef86 100644 --- a/files.html +++ b/files.html @@ -84,19 +84,21 @@ $(function() {  exception.hpp  hex.hpp  idrec.hpp - internal.hpp - interval.hpp - ios.hpp - mapping.hpp - memory.hpp - parser.hpp - progress.hpp + interval.hpp + mapping.hpp + math.hpp + memory.hpp + parser.hpp + progress.hpp + ring.hpp  sal.hpp  sgml.hpp  sgml_unicode.hpp - string.hpp - unicode.hpp - vector_queue.hpp + stream.hpp + string.hpp + system.hpp + unicode.hpp + vector_queue.hpp   UnitTests  pch.h @@ -104,7 +106,7 @@ $(function() { diff --git a/functions.html b/functions.html index ee2ffce67..7a3c03c36 100644 --- a/functions.html +++ b/functions.html @@ -78,192 +78,13 @@ $(function() {
  • apex : stdex::parser::basic_emoticon< T >
  • at() : stdex::vector_queue< T >
  • at_abs() : stdex::vector_queue< T >
  • +
  • atime() : stdex::stream::basic_file, stdex::stream::cache, stdex::stream::file
  • attach() : stdex::global_progress< T >
  • - - -

    - b -

    - - -

    - c -

    - - -

    - d -

    - - -

    - e -

    - - -

    - f -

    - - -

    - g -

    - - -

    - h -

    - - -

    - i -

    - - -

    - l -

    - - -

    - m -

    - - -

    - n -

    - - -

    - o -

    - - -

    - p -

    - - -

    - r -

    - - -

    - s -

    - - -

    - t -

    - - -

    - u -

    - - -

    - v -

    - - -

    - ~ -

    diff --git a/structstdex_1_1getter-members.html b/functions_b.html similarity index 68% rename from structstdex_1_1getter-members.html rename to functions_b.html index a5698436d..81a7ee783 100644 --- a/structstdex_1_1getter-members.html +++ b/functions_b.html @@ -5,7 +5,7 @@ -stdex: Member List +stdex: Class Members @@ -47,6 +47,7 @@ $(function() { /* @license-end */ +
    - - -
    -
    stdex::getter< _Type, _Class > Member List
    -
    +
    Here is a list of all documented class members with links to the class documentation for each member:
    -

    This is the complete list of members for stdex::getter< _Type, _Class >, including all inherited members.

    - - - -
    get (defined in stdex::getter< _Type, _Class >)stdex::getter< _Type, _Class >friend
    type typedef (defined in stdex::getter< _Type, _Class >)stdex::getter< _Type, _Class >
    +

    - b -

    + diff --git a/functions_c.html b/functions_c.html new file mode 100644 index 000000000..693977644 --- /dev/null +++ b/functions_c.html @@ -0,0 +1,95 @@ + + + + + + + +stdex: Class Members + + + + + + + + + +
    +
    + + + + + + +
    +
    stdex +
    +
    Additional custom or not Standard C++ covered algorithms
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all documented class members with links to the class documentation for each member:
    + +

    - c -

    +
    + + + + diff --git a/functions_d.html b/functions_d.html new file mode 100644 index 000000000..28d07ea5a --- /dev/null +++ b/functions_d.html @@ -0,0 +1,92 @@ + + + + + + + +stdex: Class Members + + + + + + + + + +
    +
    + + + + + + +
    +
    stdex +
    +
    Additional custom or not Standard C++ covered algorithms
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all documented class members with links to the class documentation for each member:
    + +

    - d -

    +
    + + + + diff --git a/functions_e.html b/functions_e.html new file mode 100644 index 000000000..a733abaa7 --- /dev/null +++ b/functions_e.html @@ -0,0 +1,92 @@ + + + + + + + +stdex: Class Members + + + + + + + + + +
    +
    + + + + + + +
    +
    stdex +
    +
    Additional custom or not Standard C++ covered algorithms
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all documented class members with links to the class documentation for each member:
    + +

    - e -

    +
    + + + + diff --git a/functions_f.html b/functions_f.html new file mode 100644 index 000000000..4519101e9 --- /dev/null +++ b/functions_f.html @@ -0,0 +1,88 @@ + + + + + + + +stdex: Class Members + + + + + + + + + +
    +
    + + + + + + +
    +
    stdex +
    +
    Additional custom or not Standard C++ covered algorithms
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all documented class members with links to the class documentation for each member:
    + +

    - f -

    +
    + + + + diff --git a/functions_func.html b/functions_func.html index b4025c844..c838096ce 100644 --- a/functions_func.html +++ b/functions_func.html @@ -76,143 +76,13 @@ $(function() {
  • abs() : stdex::vector_queue< T >
  • at() : stdex::vector_queue< T >
  • at_abs() : stdex::vector_queue< T >
  • +
  • atime() : stdex::stream::basic_file, stdex::stream::cache, stdex::stream::file
  • attach() : stdex::global_progress< T >
  • - - -

    - b -

    - - -

    - c -

    - - -

    - d -

    - - -

    - e -

    - - -

    - f -

    - - -

    - g -

    - - -

    - h -

    - - -

    - i -

    - - -

    - l -

    - - -

    - m -

    - - -

    - n -

    - - -

    - o -

    - - -

    - p -

    - - -

    - r -

    - - -

    - s -

    - - -

    - t -

    - - -

    - u -

    - - -

    - v -

    - - -

    - ~ -

    diff --git a/structstdex_1_1robber-members.html b/functions_func_b.html similarity index 74% rename from structstdex_1_1robber-members.html rename to functions_func_b.html index 2567d0597..87da9c72c 100644 --- a/structstdex_1_1robber-members.html +++ b/functions_func_b.html @@ -5,7 +5,7 @@ -stdex: Member List +stdex: Class Members - Functions @@ -47,6 +47,7 @@ $(function() { /* @license-end */ +
    - - -
    -
    stdex::robber< _Tag, _Member > Member List
    -
    +
    Here is a list of all documented functions with links to the class documentation for each member:
    -

    This is the complete list of members for stdex::robber< _Tag, _Member >, including all inherited members.

    - - -
    get (defined in stdex::robber< _Tag, _Member >)stdex::robber< _Tag, _Member >friend
    +

    - b -

    + diff --git a/functions_func_c.html b/functions_func_c.html new file mode 100644 index 000000000..a426814c3 --- /dev/null +++ b/functions_func_c.html @@ -0,0 +1,90 @@ + + + + + + + +stdex: Class Members - Functions + + + + + + + + + +
    +
    + + + + + + +
    +
    stdex +
    +
    Additional custom or not Standard C++ covered algorithms
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all documented functions with links to the class documentation for each member:
    + +

    - c -

    +
    + + + + diff --git a/functions_func_d.html b/functions_func_d.html new file mode 100644 index 000000000..4738827ad --- /dev/null +++ b/functions_func_d.html @@ -0,0 +1,89 @@ + + + + + + + +stdex: Class Members - Functions + + + + + + + + + +
    +
    + + + + + + +
    +
    stdex +
    +
    Additional custom or not Standard C++ covered algorithms
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all documented functions with links to the class documentation for each member:
    + +

    - d -

    +
    + + + + diff --git a/functions_func_e.html b/functions_func_e.html new file mode 100644 index 000000000..964309d22 --- /dev/null +++ b/functions_func_e.html @@ -0,0 +1,87 @@ + + + + + + + +stdex: Class Members - Functions + + + + + + + + + +
    +
    + + + + + + +
    +
    stdex +
    +
    Additional custom or not Standard C++ covered algorithms
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all documented functions with links to the class documentation for each member:
    + +

    - e -

    +
    + + + + diff --git a/functions_func_f.html b/functions_func_f.html new file mode 100644 index 000000000..eded3c12c --- /dev/null +++ b/functions_func_f.html @@ -0,0 +1,87 @@ + + + + + + + +stdex: Class Members - Functions + + + + + + + + + +
    +
    + + + + + + +
    +
    stdex +
    +
    Additional custom or not Standard C++ covered algorithms
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all documented functions with links to the class documentation for each member:
    + +

    - f -

    +
    + + + + diff --git a/functions_func_g.html b/functions_func_g.html new file mode 100644 index 000000000..e060c5d60 --- /dev/null +++ b/functions_func_g.html @@ -0,0 +1,85 @@ + + + + + + + +stdex: Class Members - Functions + + + + + + + + + +
    +
    + + + + + + +
    +
    stdex +
    +
    Additional custom or not Standard C++ covered algorithms
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all documented functions with links to the class documentation for each member:
    + +

    - g -

    +
    + + + + diff --git a/functions_func_h.html b/functions_func_h.html new file mode 100644 index 000000000..e9364468d --- /dev/null +++ b/functions_func_h.html @@ -0,0 +1,86 @@ + + + + + + + +stdex: Class Members - Functions + + + + + + + + + +
    +
    + + + + + + +
    +
    stdex +
    +
    Additional custom or not Standard C++ covered algorithms
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all documented functions with links to the class documentation for each member:
    + +

    - h -

    +
    + + + + diff --git a/functions_func_i.html b/functions_func_i.html new file mode 100644 index 000000000..dee7ca2a9 --- /dev/null +++ b/functions_func_i.html @@ -0,0 +1,85 @@ + + + + + + + +stdex: Class Members - Functions + + + + + + + + + +
    +
    + + + + + + +
    +
    stdex +
    +
    Additional custom or not Standard C++ covered algorithms
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all documented functions with links to the class documentation for each member:
    + +

    - i -

    +
    + + + + diff --git a/functions_func_l.html b/functions_func_l.html new file mode 100644 index 000000000..95e53256d --- /dev/null +++ b/functions_func_l.html @@ -0,0 +1,86 @@ + + + + + + + +stdex: Class Members - Functions + + + + + + + + + +
    +
    + + + + + + +
    +
    stdex +
    +
    Additional custom or not Standard C++ covered algorithms
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all documented functions with links to the class documentation for each member:
    + +

    - l -

    +
    + + + + diff --git a/functions_func_m.html b/functions_func_m.html new file mode 100644 index 000000000..73addc236 --- /dev/null +++ b/functions_func_m.html @@ -0,0 +1,86 @@ + + + + + + + +stdex: Class Members - Functions + + + + + + + + + +
    +
    + + + + + + +
    +
    stdex +
    +
    Additional custom or not Standard C++ covered algorithms
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all documented functions with links to the class documentation for each member:
    + +

    - m -

    +
    + + + + diff --git a/functions_func_n.html b/functions_func_n.html new file mode 100644 index 000000000..c3c0512ee --- /dev/null +++ b/functions_func_n.html @@ -0,0 +1,85 @@ + + + + + + + +stdex: Class Members - Functions + + + + + + + + + +
    +
    + + + + + + +
    +
    stdex +
    +
    Additional custom or not Standard C++ covered algorithms
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all documented functions with links to the class documentation for each member:
    + +

    - n -

    +
    + + + + diff --git a/functions_func_o.html b/functions_func_o.html new file mode 100644 index 000000000..aa8387172 --- /dev/null +++ b/functions_func_o.html @@ -0,0 +1,90 @@ + + + + + + + +stdex: Class Members - Functions + + + + + + + + + +
    +
    + + + + + + +
    +
    stdex +
    +
    Additional custom or not Standard C++ covered algorithms
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all documented functions with links to the class documentation for each member:
    + +

    - o -

    +
    + + + + diff --git a/functions_func_p.html b/functions_func_p.html new file mode 100644 index 000000000..231d0b60e --- /dev/null +++ b/functions_func_p.html @@ -0,0 +1,89 @@ + + + + + + + +stdex: Class Members - Functions + + + + + + + + + +
    +
    + + + + + + +
    +
    stdex +
    +
    Additional custom or not Standard C++ covered algorithms
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all documented functions with links to the class documentation for each member:
    + +

    - p -

    +
    + + + + diff --git a/functions_func_q.html b/functions_func_q.html new file mode 100644 index 000000000..0e197cbdf --- /dev/null +++ b/functions_func_q.html @@ -0,0 +1,84 @@ + + + + + + + +stdex: Class Members - Functions + + + + + + + + + +
    +
    + + + + + + +
    +
    stdex +
    +
    Additional custom or not Standard C++ covered algorithms
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all documented functions with links to the class documentation for each member:
    + +

    - q -

    +
    + + + + diff --git a/functions_func_r.html b/functions_func_r.html new file mode 100644 index 000000000..5038871c3 --- /dev/null +++ b/functions_func_r.html @@ -0,0 +1,95 @@ + + + + + + + +stdex: Class Members - Functions + + + + + + + + + +
    +
    + + + + + + +
    +
    stdex +
    +
    Additional custom or not Standard C++ covered algorithms
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all documented functions with links to the class documentation for each member:
    + +

    - r -

    +
    + + + + diff --git a/functions_func_s.html b/functions_func_s.html new file mode 100644 index 000000000..2d4ac6630 --- /dev/null +++ b/functions_func_s.html @@ -0,0 +1,101 @@ + + + + + + + +stdex: Class Members - Functions + + + + + + + + + +
    +
    + + + + + + +
    +
    stdex +
    +
    Additional custom or not Standard C++ covered algorithms
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all documented functions with links to the class documentation for each member:
    + +

    - s -

    +
    + + + + diff --git a/functions_func_t.html b/functions_func_t.html new file mode 100644 index 000000000..265524ab9 --- /dev/null +++ b/functions_func_t.html @@ -0,0 +1,86 @@ + + + + + + + +stdex: Class Members - Functions + + + + + + + + + +
    +
    + + + + + + +
    +
    stdex +
    +
    Additional custom or not Standard C++ covered algorithms
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all documented functions with links to the class documentation for each member:
    + +

    - t -

    +
    + + + + diff --git a/functions_func_u.html b/functions_func_u.html new file mode 100644 index 000000000..3cf1dea2b --- /dev/null +++ b/functions_func_u.html @@ -0,0 +1,85 @@ + + + + + + + +stdex: Class Members - Functions + + + + + + + + + +
    +
    + + + + + + +
    +
    stdex +
    +
    Additional custom or not Standard C++ covered algorithms
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all documented functions with links to the class documentation for each member:
    + +

    - u -

    +
    + + + + diff --git a/functions_func_v.html b/functions_func_v.html new file mode 100644 index 000000000..05eef020f --- /dev/null +++ b/functions_func_v.html @@ -0,0 +1,84 @@ + + + + + + + +stdex: Class Members - Functions + + + + + + + + + +
    +
    + + + + + + +
    +
    stdex +
    +
    Additional custom or not Standard C++ covered algorithms
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all documented functions with links to the class documentation for each member:
    + +

    - v -

    +
    + + + + diff --git a/functions_func_w.html b/functions_func_w.html new file mode 100644 index 000000000..9bc767ae3 --- /dev/null +++ b/functions_func_w.html @@ -0,0 +1,92 @@ + + + + + + + +stdex: Class Members - Functions + + + + + + + + + +
    +
    + + + + + + +
    +
    stdex +
    +
    Additional custom or not Standard C++ covered algorithms
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all documented functions with links to the class documentation for each member:
    + +

    - w -

    +
    + + + + diff --git a/functions_func_~.html b/functions_func_~.html new file mode 100644 index 000000000..6dfa82b37 --- /dev/null +++ b/functions_func_~.html @@ -0,0 +1,84 @@ + + + + + + + +stdex: Class Members - Functions + + + + + + + + + +
    +
    + + + + + + +
    +
    stdex +
    +
    Additional custom or not Standard C++ covered algorithms
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all documented functions with links to the class documentation for each member:
    + +

    - ~ -

    +
    + + + + diff --git a/functions_g.html b/functions_g.html new file mode 100644 index 000000000..7adc337ab --- /dev/null +++ b/functions_g.html @@ -0,0 +1,85 @@ + + + + + + + +stdex: Class Members + + + + + + + + + +
    +
    + + + + + + +
    +
    stdex +
    +
    Additional custom or not Standard C++ covered algorithms
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all documented class members with links to the class documentation for each member:
    + +

    - g -

    +
    + + + + diff --git a/functions_h.html b/functions_h.html new file mode 100644 index 000000000..4d16ed76f --- /dev/null +++ b/functions_h.html @@ -0,0 +1,87 @@ + + + + + + + +stdex: Class Members + + + + + + + + + +
    +
    + + + + + + +
    +
    stdex +
    +
    Additional custom or not Standard C++ covered algorithms
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all documented class members with links to the class documentation for each member:
    + +

    - h -

    +
    + + + + diff --git a/functions_i.html b/functions_i.html new file mode 100644 index 000000000..3c7f16fdf --- /dev/null +++ b/functions_i.html @@ -0,0 +1,86 @@ + + + + + + + +stdex: Class Members + + + + + + + + + +
    +
    + + + + + + +
    +
    stdex +
    +
    Additional custom or not Standard C++ covered algorithms
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all documented class members with links to the class documentation for each member:
    + +

    - i -

    +
    + + + + diff --git a/functions_l.html b/functions_l.html new file mode 100644 index 000000000..40791e2a2 --- /dev/null +++ b/functions_l.html @@ -0,0 +1,87 @@ + + + + + + + +stdex: Class Members + + + + + + + + + +
    +
    + + + + + + +
    +
    stdex +
    +
    Additional custom or not Standard C++ covered algorithms
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all documented class members with links to the class documentation for each member:
    + +

    - l -

    +
    + + + + diff --git a/functions_m.html b/functions_m.html new file mode 100644 index 000000000..be347f381 --- /dev/null +++ b/functions_m.html @@ -0,0 +1,101 @@ + + + + + + + +stdex: Class Members + + + + + + + + + +
    +
    + + + + + + +
    +
    stdex +
    +
    Additional custom or not Standard C++ covered algorithms
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all documented class members with links to the class documentation for each member:
    + +

    - m -

    +
    + + + + diff --git a/functions_n.html b/functions_n.html new file mode 100644 index 000000000..fa214268a --- /dev/null +++ b/functions_n.html @@ -0,0 +1,91 @@ + + + + + + + +stdex: Class Members + + + + + + + + + +
    +
    + + + + + + +
    +
    stdex +
    +
    Additional custom or not Standard C++ covered algorithms
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all documented class members with links to the class documentation for each member:
    + +

    - n -

    +
    + + + + diff --git a/functions_o.html b/functions_o.html new file mode 100644 index 000000000..f680f129e --- /dev/null +++ b/functions_o.html @@ -0,0 +1,91 @@ + + + + + + + +stdex: Class Members + + + + + + + + + +
    +
    + + + + + + +
    +
    stdex +
    +
    Additional custom or not Standard C++ covered algorithms
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all documented class members with links to the class documentation for each member:
    + +

    - o -

    +
    + + + + diff --git a/functions_p.html b/functions_p.html new file mode 100644 index 000000000..ac5e90f58 --- /dev/null +++ b/functions_p.html @@ -0,0 +1,93 @@ + + + + + + + +stdex: Class Members + + + + + + + + + +
    +
    + + + + + + +
    +
    stdex +
    +
    Additional custom or not Standard C++ covered algorithms
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all documented class members with links to the class documentation for each member:
    + +

    - p -

    +
    + + + + diff --git a/functions_q.html b/functions_q.html new file mode 100644 index 000000000..998ca7647 --- /dev/null +++ b/functions_q.html @@ -0,0 +1,84 @@ + + + + + + + +stdex: Class Members + + + + + + + + + +
    +
    + + + + + + +
    +
    stdex +
    +
    Additional custom or not Standard C++ covered algorithms
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all documented class members with links to the class documentation for each member:
    + +

    - q -

    +
    + + + + diff --git a/functions_r.html b/functions_r.html new file mode 100644 index 000000000..5e2f9e817 --- /dev/null +++ b/functions_r.html @@ -0,0 +1,99 @@ + + + + + + + +stdex: Class Members + + + + + + + + + +
    +
    + + + + + + +
    +
    stdex +
    +
    Additional custom or not Standard C++ covered algorithms
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all documented class members with links to the class documentation for each member:
    + +

    - r -

    +
    + + + + diff --git a/functions_s.html b/functions_s.html new file mode 100644 index 000000000..b8df12449 --- /dev/null +++ b/functions_s.html @@ -0,0 +1,107 @@ + + + + + + + +stdex: Class Members + + + + + + + + + +
    +
    + + + + + + +
    +
    stdex +
    +
    Additional custom or not Standard C++ covered algorithms
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all documented class members with links to the class documentation for each member:
    + +

    - s -

    +
    + + + + diff --git a/functions_t.html b/functions_t.html new file mode 100644 index 000000000..b2f723d8b --- /dev/null +++ b/functions_t.html @@ -0,0 +1,87 @@ + + + + + + + +stdex: Class Members + + + + + + + + + +
    +
    + + + + + + +
    +
    stdex +
    +
    Additional custom or not Standard C++ covered algorithms
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all documented class members with links to the class documentation for each member:
    + +

    - t -

    +
    + + + + diff --git a/functions_type.html b/functions_type.html index 7a534755a..3e32c1ae9 100644 --- a/functions_type.html +++ b/functions_type.html @@ -81,7 +81,7 @@ $(function() { diff --git a/functions_u.html b/functions_u.html new file mode 100644 index 000000000..fbe805df8 --- /dev/null +++ b/functions_u.html @@ -0,0 +1,85 @@ + + + + + + + +stdex: Class Members + + + + + + + + + +
    +
    + + + + + + +
    +
    stdex +
    +
    Additional custom or not Standard C++ covered algorithms
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all documented class members with links to the class documentation for each member:
    + +

    - u -

    +
    + + + + diff --git a/functions_v.html b/functions_v.html new file mode 100644 index 000000000..7286821be --- /dev/null +++ b/functions_v.html @@ -0,0 +1,87 @@ + + + + + + + +stdex: Class Members + + + + + + + + + +
    +
    + + + + + + +
    +
    stdex +
    +
    Additional custom or not Standard C++ covered algorithms
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all documented class members with links to the class documentation for each member:
    + +

    - v -

    +
    + + + + diff --git a/functions_vars.html b/functions_vars.html index a2c116d37..e98b3e429 100644 --- a/functions_vars.html +++ b/functions_vars.html @@ -91,7 +91,7 @@ $(function() {

    - d -

    +

    - l -

    + +

    - m -

    @@ -144,10 +153,16 @@ $(function() {
  • negative_sign : stdex::parser::basic_mixed_numeral< T >, stdex::parser::basic_monetary_numeral< T >, stdex::parser::basic_scientific_numeral< T >, stdex::parser::basic_signed_numeral< T >
  • nose : stdex::parser::basic_emoticon< T >
  • num : stdex::base64_dec, stdex::base64_enc, stdex::hex_dec
  • +
  • num_written : stdex::stream::replicator::worker
  • number : stdex::parser::basic_signed_numeral< T >
  • +

    - o -

    + +

    - p -

    +

    - r -

    + +

    - s -

    + + +

    - w -

    diff --git a/functions_w.html b/functions_w.html new file mode 100644 index 000000000..3140d1cab --- /dev/null +++ b/functions_w.html @@ -0,0 +1,94 @@ + + + + + + + +stdex: Class Members + + + + + + + + + +
    +
    + + + + + + +
    +
    stdex +
    +
    Additional custom or not Standard C++ covered algorithms
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all documented class members with links to the class documentation for each member:
    + +

    - w -

    +
    + + + + diff --git a/functions_~.html b/functions_~.html new file mode 100644 index 000000000..2bc56ec70 --- /dev/null +++ b/functions_~.html @@ -0,0 +1,84 @@ + + + + + + + +stdex: Class Members + + + + + + + + + +
    +
    + + + + + + +
    +
    stdex +
    +
    Additional custom or not Standard C++ covered algorithms
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all documented class members with links to the class documentation for each member:
    + +

    - ~ -

    +
    + + + + diff --git a/hex_8hpp_source.html b/hex_8hpp_source.html index 3e59c6fbe..6d342b12b 100644 --- a/hex_8hpp_source.html +++ b/hex_8hpp_source.html @@ -209,7 +209,7 @@ $(function() { diff --git a/hierarchy.html b/hierarchy.html index bc2883114..7e66ce84b 100644 --- a/hierarchy.html +++ b/hierarchy.html @@ -78,144 +78,158 @@ $(function() {  Cstdex::chrono::aosn_clock  Cstdex::base64_decBase64 decoding session  Cstdex::base64_encBase64 encoding session - Cstd::basic_fstream - Cstdex::basic_fstream< _Elem, _Traits >File stream with additional std::filesystem features - Cstd::basic_iostream - Cstdex::basic_diagstream< _Elem, _Traits >Diagnostic input/output stream - Cstd::basic_istream - Cstdex::basic_isharedstrstream< _Elem, _Traits > - Cstdex::basic_istreamfmt< _Elem, _Traits >Binary stream reader - Cstdex::basic_iostreamfmt< _Elem, _Traits >Binary stream reader/writer - Cstdex::basic_ostreamfmt< _Elem, _Traits >Binary stream writer - Cstdex::basic_iostreamfmt< _Elem, _Traits >Binary stream reader/writer - Cstdex::parser::basic_parser< T >Base template for all parsers - Cstdex::parser::basic_any_cu< char > - Cstdex::parser::sgml_any_cpTest for any SGML code point - Cstdex::parser::basic_dns_domain_char< char > - Cstdex::parser::sgml_dns_domain_charTest for valid DNS domain SGML character - Cstdex::parser::basic_punct_cu< char > - Cstdex::parser::sgml_punct_cpTest for any SGML punctuation code point - Cstdex::parser::basic_set< char > - Cstdex::parser::sgml_cp_setTest for any SGML code point from a given string of SGML code points - Cstdex::parser::basic_space_cu< char > - Cstdex::parser::sgml_space_cpTest for any SGML space code point - Cstdex::parser::basic_space_or_punct_cu< char > - Cstdex::parser::sgml_space_or_punct_cpTest for any SGML space or punctuation code point - Cstdex::parser::basic_url_password_char< char > - Cstdex::parser::sgml_url_password_charTest for valid URL password SGML character - Cstdex::parser::basic_url_path_char< char > - Cstdex::parser::sgml_url_path_charTest for valid URL path SGML character - Cstdex::parser::basic_url_username_char< char > - Cstdex::parser::sgml_url_username_charTest for valid URL username SGML character - Cstdex::parser::basic_angle< T >Test for angle in d°mm'ss.dddd form - Cstdex::parser::basic_any_cu< T >Test for any code unit - Cstdex::parser::basic_bol< T >Test for beginning of line - Cstdex::parser::basic_chemical_formula< T >Test for chemical formula - Cstdex::parser::basic_cu< T >Test for specific code unit - Cstdex::parser::basic_date< T >Test for date - Cstdex::parser::basic_dns_domain_char< T >Test for valid DNS domain character - Cstdex::parser::basic_dns_name< T >Test for DNS domain/hostname - Cstdex::parser::basic_email_address< T >Test for e-mail address - Cstdex::parser::basic_emoticon< T >Test for emoticon - Cstdex::parser::basic_eol< T >Test for end of line - Cstdex::parser::basic_fraction< T >Test for fraction - Cstdex::parser::basic_integer< T >Base class for integer testing - Cstdex::parser::basic_integer10< T >Test for decimal integer - Cstdex::parser::basic_integer10ts< T >Test for decimal integer possibly containing thousand separators - Cstdex::parser::basic_integer16< T >Test for hexadecimal integer - Cstdex::parser::basic_roman_numeral< T >Test for Roman numeral - Cstdex::parser::basic_ipv4_address< T >Test for IPv4 address - Cstdex::parser::basic_ipv6_address< T >Test for IPv6 address - Cstdex::parser::basic_ipv6_scope_id_char< T >Test for valid IPv6 address scope ID character - Cstdex::parser::basic_iterations< T >Test for repeating - Cstdex::parser::basic_json_string< T >Test for JSON string - Cstdex::parser::basic_mixed_numeral< T >Test for mixed numeral - Cstdex::parser::basic_monetary_numeral< T >Test for monetary numeral - Cstdex::parser::basic_noop< T >"No-op" match - Cstdex::parser::basic_phone_number< T >Test for phone number - Cstdex::parser::basic_punct_cu< T >Test for any punctuation code unit - Cstdex::parser::basic_scientific_numeral< T >Test for scientific numeral - Cstdex::parser::basic_score< T >Test for match score - Cstdex::parser::basic_set< T > - Cstdex::parser::basic_cu_set< T >Test for any code unit from a given string of code units - Cstdex::parser::basic_signed_numeral< T >Test for signed numeral - Cstdex::parser::basic_space_cu< T >Test for any space code unit - Cstdex::parser::basic_space_or_punct_cu< T >Test for any space or punctuation code unit - Cstdex::parser::basic_string< T >Test for given string - Cstdex::parser::basic_time< T >Test for time - Cstdex::parser::basic_url< T >Test for URL - Cstdex::parser::basic_url_password_char< T >Test for valid URL password character - Cstdex::parser::basic_url_path< T >Test for URL path - Cstdex::parser::basic_url_path_char< T >Test for valid URL path character - Cstdex::parser::basic_url_username_char< T >Test for valid URL username character - Cstdex::parser::parser_collection< T >Base template for collection-holding parsers - Cstdex::parser::basic_branch< T >Test for any - Cstdex::parser::basic_string_branch< T, T_parser >Test for any string - Cstdex::parser::basic_permutation< T >Test for permutation - Cstdex::parser::basic_sequence< T >Test for sequence - Cstdex::parser::basic_parser< char > - Cstdex::parser::http_agentTest for HTTP agent - Cstdex::parser::http_any_typeTest for HTTP any type - Cstdex::parser::http_asteriskTest for HTTP asterisk - Cstdex::parser::http_cookieTest for HTTP cookie (RFC2109) - Cstdex::parser::http_cookie_parameterTest for HTTP cookie parameter (RFC2109) - Cstdex::parser::http_headerTest for HTTP header - Cstdex::parser::http_languageTest for HTTP language (RFC1766) - Cstdex::parser::http_line_breakTest for HTTP line break (RFC2616: CRLF | LF) - Cstdex::parser::http_media_rangeTest for HTTP media range (RFC2616: media-range) - Cstdex::parser::http_media_typeTest for HTTP media type (RFC2616: media-type) - Cstdex::parser::http_parameterTest for HTTP parameter (RFC2616: parameter) - Cstdex::parser::http_protocolTest for HTTP protocol - Cstdex::parser::http_quoted_stringTest for HTTP quoted string (RFC2616: quoted-string) - Cstdex::parser::http_requestTest for HTTP request - Cstdex::parser::http_spaceTest for HTTP space (RFC2616: LWS) - Cstdex::parser::http_text_charTest for HTTP text character (RFC2616: TEXT) - Cstdex::parser::http_tokenTest for HTTP token (RFC2616: token - tolerates non-ASCII) - Cstdex::parser::http_urlTest for HTTP URL - Cstdex::parser::http_url_parameterTest for HTTP URL parameter - Cstdex::parser::http_url_pathTest for HTTP URL path segment - Cstdex::parser::http_url_path_segmentTest for HTTP URL path segment - Cstdex::parser::http_url_portTest for HTTP URL port - Cstdex::parser::http_url_serverTest for HTTP URL server - Cstdex::parser::http_valueTest for HTTP value (RFC2616: value) - Cstdex::parser::http_weightTest for HTTP weight factor - Cstdex::parser::http_weighted_value< T, T_asterisk >Test for HTTP weighted value - Cstdex::parser::sgml_cpTest for specific SGML code point - Cstdex::parser::sgml_ipv6_scope_id_charTest for valid IPv6 address scope ID SGML character - Cstdex::parser::sgml_stringTest for SGML given string - Cstd::basic_streambuf - Cstdex::basic_diagstreambuf< _Elem, _Traits >Diagnostic input stream buffer - Cstdex::basic_sharedstrbuf< _Elem, _Traits >Shared-memory string stream buffer - Cstd::basic_stringstream - Cstdex::basic_stringstream< _Elem, _Traits, _Alloc >String stream - Cstd::exception - Cstdex::user_cancelledUser cancelled exception - Cstdex::getter< _Type, _Class >Helper template to allow access to internal std C++ private members - Cstdex::hex_decHexadecimal decoding session - Cstdex::hex_encHexadecimal encoding session - Cstdex::parser::http_factor_more< T > - Cstdex::interval< T >Numerical interval - Cstdex::interval< size_t > - Cstdex::mapping< T >Maps index in source string to index in destination string - Cstdex::no_delete< T >Noop deleter - Cstdex::no_delete< T[]>Noop array deleter - Cstdex::progress< T >Progress indicator base class - Cstdex::global_progress< T >Global progress indicator base class - Cstdex::progress_switcher< T >Progress indicator switcher - Cstdex::lazy_progress< T >Lazy progress indicator base class - Cstdex::idrec::record< T, T_ID, ID, T_SIZE, ALIGN >Helper class for read/write of records to/from memory - Cstdex::robber< _Tag, _Member >Helper template to allow access to internal std C++ private members - Cstd::runtime_error - Cstdex::errno_errorStandard C runtime library error - CT - Cstdex::parser::http_value_collection< T >Collection of HTTP values - Cstdex::vector_queue< T >Helper class to allow limited size FIFO queues implemented as vector of elements + Cstdex::stream::basic
    +

    ‍UTF-8 byte-order-mark

    +
    + + Cstdex::stream::basic_fileBasic seekable stream operations + Cstdex::stream::cacheCached file + Cstdex::stream::cached_fileCached file-system file + Cstdex::stream::diag_fileCompares multiple files to perform the same + Cstdex::stream::fileFile-system file + Cstdex::stream::file_windowLimits file reading/writing to a predefined window + Cstdex::stream::memory_fileIn-memory file + Cstdex::stream::basic_sysOS data stream (file, pipe, socket...) + Cstdex::stream::fileFile-system file + Cstdex::stream::converterModifies data on the fly when reading from/writing to a source stream + Cstdex::stream::async_reader< CAPACITY >Provides read-ahead stream capability + Cstdex::stream::async_writer< CAPACITY >Provides write-back stream capability + Cstdex::stream::bufferBuffered read/write stream + Cstdex::stream::buffered_sysBuffered OS data stream (file, pipe, socket...) + Cstdex::stream::limiterLimits reading from/writing to stream to a predefined number of bytes + Cstdex::stream::windowLimits reading from/writing to stream to a predefined window + Cstdex::stream::fifoIn-memory FIFO queue + Cstdex::stream::replicatorReplicates writing of the same data to multiple streams + Cstdex::parser::basic_parser< T >Base template for all parsers + Cstdex::parser::basic_any_cu< char > + Cstdex::parser::sgml_any_cpTest for any SGML code point + Cstdex::parser::basic_dns_domain_char< char > + Cstdex::parser::sgml_dns_domain_charTest for valid DNS domain SGML character + Cstdex::parser::basic_punct_cu< char > + Cstdex::parser::sgml_punct_cpTest for any SGML punctuation code point + Cstdex::parser::basic_set< char > + Cstdex::parser::sgml_cp_setTest for any SGML code point from a given string of SGML code points + Cstdex::parser::basic_space_cu< char > + Cstdex::parser::sgml_space_cpTest for any SGML space code point + Cstdex::parser::basic_space_or_punct_cu< char > + Cstdex::parser::sgml_space_or_punct_cpTest for any SGML space or punctuation code point + Cstdex::parser::basic_url_password_char< char > + Cstdex::parser::sgml_url_password_charTest for valid URL password SGML character + Cstdex::parser::basic_url_path_char< char > + Cstdex::parser::sgml_url_path_charTest for valid URL path SGML character + Cstdex::parser::basic_url_username_char< char > + Cstdex::parser::sgml_url_username_charTest for valid URL username SGML character + Cstdex::parser::basic_angle< T >Test for angle in d°mm'ss.dddd form + Cstdex::parser::basic_any_cu< T >Test for any code unit + Cstdex::parser::basic_bol< T >Test for beginning of line + Cstdex::parser::basic_chemical_formula< T >Test for chemical formula + Cstdex::parser::basic_cu< T >Test for specific code unit + Cstdex::parser::basic_date< T >Test for date + Cstdex::parser::basic_dns_domain_char< T >Test for valid DNS domain character + Cstdex::parser::basic_dns_name< T >Test for DNS domain/hostname + Cstdex::parser::basic_email_address< T >Test for e-mail address + Cstdex::parser::basic_emoticon< T >Test for emoticon + Cstdex::parser::basic_eol< T >Test for end of line + Cstdex::parser::basic_fraction< T >Test for fraction + Cstdex::parser::basic_integer< T >Base class for integer testing + Cstdex::parser::basic_integer10< T >Test for decimal integer + Cstdex::parser::basic_integer10ts< T >Test for decimal integer possibly containing thousand separators + Cstdex::parser::basic_integer16< T >Test for hexadecimal integer + Cstdex::parser::basic_roman_numeral< T >Test for Roman numeral + Cstdex::parser::basic_ipv4_address< T >Test for IPv4 address + Cstdex::parser::basic_ipv6_address< T >Test for IPv6 address + Cstdex::parser::basic_ipv6_scope_id_char< T >Test for valid IPv6 address scope ID character + Cstdex::parser::basic_iterations< T >Test for repeating + Cstdex::parser::basic_json_string< T >Test for JSON string + Cstdex::parser::basic_mixed_numeral< T >Test for mixed numeral + Cstdex::parser::basic_monetary_numeral< T >Test for monetary numeral + Cstdex::parser::basic_noop< T >"No-op" match + Cstdex::parser::basic_phone_number< T >Test for phone number + Cstdex::parser::basic_punct_cu< T >Test for any punctuation code unit + Cstdex::parser::basic_scientific_numeral< T >Test for scientific numeral + Cstdex::parser::basic_score< T >Test for match score + Cstdex::parser::basic_set< T > + Cstdex::parser::basic_cu_set< T >Test for any code unit from a given string of code units + Cstdex::parser::basic_signed_numeral< T >Test for signed numeral + Cstdex::parser::basic_space_cu< T >Test for any space code unit + Cstdex::parser::basic_space_or_punct_cu< T >Test for any space or punctuation code unit + Cstdex::parser::basic_string< T >Test for given string + Cstdex::parser::basic_time< T >Test for time + Cstdex::parser::basic_url< T >Test for URL + Cstdex::parser::basic_url_password_char< T >Test for valid URL password character + Cstdex::parser::basic_url_path< T >Test for URL path + Cstdex::parser::basic_url_path_char< T >Test for valid URL path character + Cstdex::parser::basic_url_username_char< T >Test for valid URL username character + Cstdex::parser::parser_collection< T >Base template for collection-holding parsers + Cstdex::parser::basic_branch< T >Test for any + Cstdex::parser::basic_string_branch< T, T_parser >Test for any string + Cstdex::parser::basic_permutation< T >Test for permutation + Cstdex::parser::basic_sequence< T >Test for sequence + Cstdex::parser::basic_parser< char > + Cstdex::parser::http_agentTest for HTTP agent + Cstdex::parser::http_any_typeTest for HTTP any type + Cstdex::parser::http_asteriskTest for HTTP asterisk + Cstdex::parser::http_cookieTest for HTTP cookie (RFC2109) + Cstdex::parser::http_cookie_parameterTest for HTTP cookie parameter (RFC2109) + Cstdex::parser::http_headerTest for HTTP header + Cstdex::parser::http_languageTest for HTTP language (RFC1766) + Cstdex::parser::http_line_breakTest for HTTP line break (RFC2616: CRLF | LF) + Cstdex::parser::http_media_rangeTest for HTTP media range (RFC2616: media-range) + Cstdex::parser::http_media_typeTest for HTTP media type (RFC2616: media-type) + Cstdex::parser::http_parameterTest for HTTP parameter (RFC2616: parameter) + Cstdex::parser::http_protocolTest for HTTP protocol + Cstdex::parser::http_quoted_stringTest for HTTP quoted string (RFC2616: quoted-string) + Cstdex::parser::http_requestTest for HTTP request + Cstdex::parser::http_spaceTest for HTTP space (RFC2616: LWS) + Cstdex::parser::http_text_charTest for HTTP text character (RFC2616: TEXT) + Cstdex::parser::http_tokenTest for HTTP token (RFC2616: token - tolerates non-ASCII) + Cstdex::parser::http_urlTest for HTTP URL + Cstdex::parser::http_url_parameterTest for HTTP URL parameter + Cstdex::parser::http_url_pathTest for HTTP URL path segment + Cstdex::parser::http_url_path_segmentTest for HTTP URL path segment + Cstdex::parser::http_url_portTest for HTTP URL port + Cstdex::parser::http_url_serverTest for HTTP URL server + Cstdex::parser::http_valueTest for HTTP value (RFC2616: value) + Cstdex::parser::http_weightTest for HTTP weight factor + Cstdex::parser::http_weighted_value< T, T_asterisk >Test for HTTP weighted value + Cstdex::parser::sgml_cpTest for specific SGML code point + Cstdex::parser::sgml_ipv6_scope_id_charTest for valid IPv6 address scope ID SGML character + Cstdex::parser::sgml_stringTest for SGML given string + Cstdex::stream::buffer::buffer_t + Cstdex::stream::cache::cache_t + Cstd::exception + Cstdex::user_cancelledUser cancelled exception + Cstdex::hex_decHexadecimal decoding session + Cstdex::hex_encHexadecimal encoding session + Cstdex::parser::http_factor_more< T > + Cstdex::interval< T >Numerical interval + Cstdex::interval< fpos_t > + Cstdex::interval< size_t > + Cstdex::mapping< T >Maps index in source string to index in destination string + Cstdex::no_delete< T >Noop deleter + Cstdex::no_delete< T[]>Noop array deleter + Cstdex::stream::fifo::node_t + Cstdex::progress< T >Progress indicator base class + Cstdex::global_progress< T >Global progress indicator base class + Cstdex::progress_switcher< T >Progress indicator switcher + Cstdex::lazy_progress< T >Lazy progress indicator base class + Cstdex::idrec::record< T, T_ID, ID, T_SIZE, ALIGN >Helper class for read/write of records to/from memory + Cstdex::ring< T, CAPACITY >Ring buffer + Cstdex::ring< uint8_t, default_async_limit > + Cstd::runtime_error + Cstdex::errno_errorStandard C runtime library error + Cstdex::sys_objectOperating system object (file, pipe, anything with an OS handle etc.) + Cstdex::stream::basic_sysOS data stream (file, pipe, socket...) + CT + Cstdex::parser::http_value_collection< T >Collection of HTTP values + Cstdex::vector_queue< T >Helper class to allow limited size FIFO queues implemented as vector of elements + Cstdex::stream::replicator::worker diff --git a/idrec_8hpp_source.html b/idrec_8hpp_source.html index 3a23f22ff..7ff72de3a 100644 --- a/idrec_8hpp_source.html +++ b/idrec_8hpp_source.html @@ -275,7 +275,7 @@ $(function() { diff --git a/index.html b/index.html index 37147dbfa..23238d584 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 52c7333a9..336ffe024 100644 --- a/interval_8hpp_source.html +++ b/interval_8hpp_source.html @@ -110,13 +110,16 @@ $(function() {
    70 inline bool operator==(const interval& other) const { return start == other.start && end == other.end; }
    71
    79 inline bool operator!=(const interval& other) const { return !operator==(other); }
    -
    80 };
    -
    81
    -
    82 template <class T, class _Alloc = std::allocator<interval<T>>>
    -
    83 using interval_vector = std::vector<interval<T>, _Alloc>;
    -
    84}
    +
    80
    +
    88 inline bool contains(_In_ T x) const { return start <= x && x < end; }
    +
    89 };
    +
    90
    +
    91 template <class T, class _Alloc = std::allocator<interval<T>>>
    +
    92 using interval_vector = std::vector<interval<T>, _Alloc>;
    +
    93}
    stdex::interval
    Numerical interval.
    Definition interval.hpp:18
    stdex::interval::interval
    interval(T x) noexcept
    Constructs a zero-size interval.
    Definition interval.hpp:32
    +
    stdex::interval::contains
    bool contains(T x) const
    Is value in interval?
    Definition interval.hpp:88
    stdex::interval::empty
    bool empty() const
    Is interval empty?
    Definition interval.hpp:54
    stdex::interval::interval
    interval(T _start, T _end) noexcept
    Constructs an interval.
    Definition interval.hpp:40
    stdex::interval::size
    T size() const
    Returns interval size.
    Definition interval.hpp:47
    @@ -128,7 +131,7 @@ $(function() { diff --git a/ios_8hpp_source.html b/ios_8hpp_source.html deleted file mode 100644 index 1da098685..000000000 --- a/ios_8hpp_source.html +++ /dev/null @@ -1,702 +0,0 @@ - - - - - - - -stdex: include/stdex/ios.hpp Source File - - - - - - - - - -
    -
    - - - - - - -
    -
    stdex -
    -
    Additional custom or not Standard C++ covered algorithms
    -
    -
    - - - - - - - - -
    -
    - - -
    -
    -
    -
    -
    -
    Loading...
    -
    Searching...
    -
    No Matches
    -
    -
    -
    -
    - - -
    -
    -
    ios.hpp
    -
    -
    -
    1/*
    -
    2 SPDX-License-Identifier: MIT
    -
    3 Copyright © 2023 Amebis
    -
    4*/
    -
    5
    -
    6#pragma once
    -
    7
    -
    8#ifdef _WIN32
    -
    9#include <windows.h>
    -
    10#endif
    -
    11#include "endian.hpp"
    -
    12#include "internal.hpp"
    -
    13#include "string.hpp"
    -
    14#include "sal.hpp"
    -
    15#include <assert.h>
    -
    16#include <stdint.h>
    -
    17#include <stdio.h>
    -
    18#include <algorithm>
    -
    19#include <chrono>
    -
    20#include <fstream>
    -
    21#include <iterator>
    -
    22#include <istream>
    -
    23#include <ostream>
    -
    24#include <vector>
    -
    25
    -
    26namespace stdex
    -
    27{
    -
    31 template <class _Elem, class _Traits>
    - -
    33 {
    -
    34 public:
    -
    35 std::basic_ostream<_Elem, _Traits> &sp; // Write stream
    -
    36
    -
    37 inline basic_ostreamfmt(_Inout_ std::basic_ostream<_Elem, _Traits> &stream) : sp(stream) {}
    -
    38
    -
    39 using pos_type = typename _Traits::pos_type;
    -
    40 using off_type = typename _Traits::off_type;
    -
    41 inline pos_type tellp() { return sp.tellp(); }
    -
    42 inline basic_ostreamfmt<_Elem, _Traits>& seekp(pos_type pos) { sp.seekp(pos); return *this; }
    -
    43 inline basic_ostreamfmt<_Elem, _Traits>& seekp(off_type off, std::ios_base::seekdir dir) { sp.seekp(off, dir); return *this; }
    -
    44 inline bool good() const noexcept { return sp.good(); }
    -
    45 inline bool eof() const noexcept { return sp.eof(); }
    -
    46 inline bool fail() const noexcept { return sp.fail(); }
    -
    47 inline bool bad() const noexcept { return sp.bad(); }
    -
    48
    -
    49 inline basic_ostreamfmt<_Elem, _Traits>& write(_In_reads_bytes_(size) const void* data, _In_ std::streamsize size)
    -
    50 {
    -
    51 sp.write(reinterpret_cast<const _Elem*>(data), size/sizeof(_Elem));
    -
    52 return *this;
    -
    53 }
    -
    54
    -
    55 template <class T>
    -
    56 inline basic_ostreamfmt<_Elem, _Traits>& write(_In_ T value)
    -
    57 {
    -
    58 HE2LE(&value);
    -
    59 sp.write(reinterpret_cast<const _Elem*>(&value), sizeof(T)/sizeof(_Elem));
    -
    60 return *this;
    -
    61 }
    -
    62
    -
    63 inline basic_ostreamfmt<_Elem, _Traits>& write(_In_z_ const char* value)
    -
    64 {
    -
    65 size_t count = strlen(value);
    -
    66 if (count > UINT32_MAX)
    -
    67 throw std::invalid_argument("string too big");
    -
    68 sp.write(static_cast<uint32_t>(count));
    -
    69 sp.write(reinterpret_cast<const _Elem*>(value), (std::streamsize)count * sizeof(char)/sizeof(_Elem));
    -
    70 return *this;
    -
    71 }
    -
    72
    -
    73 inline basic_ostreamfmt<_Elem, _Traits>& write(_In_z_ const wchar_t* value)
    -
    74 {
    -
    75 size_t count = strlen(value);
    -
    76 if (count > UINT32_MAX)
    -
    77 throw std::invalid_argument("string too big");
    -
    78 sp.write(static_cast<uint32_t>(count));
    -
    79#ifdef BIG_ENDIAN
    -
    80 for (size_t i = 0; i < count; ++i)
    -
    81 sp.write(value[i]);
    -
    82#else
    -
    83 sp.write(reinterpret_cast<const _Elem*>(value), (std::streamsize)count * sizeof(wchar_t)/sizeof(_Elem));
    -
    84#endif
    -
    85 return *this;
    -
    86 }
    -
    87
    -
    88 inline basic_ostreamfmt<_Elem, _Traits>& write_byte(_In_ uint8_t value)
    -
    89 {
    -
    90 return write(value);
    -
    91 }
    -
    92
    -
    100 template <class _Elem2>
    -
    101 void vprintf(_In_z_ _Printf_format_string_ const _Elem2 *format, _In_opt_ locale_t locale, _In_ va_list arg)
    -
    102 {
    -
    103 std::basic_string<_Elem2> str;
    -
    104 vappendf(str, format, locale, arg);
    -
    105 sp.write(reinterpret_cast<const _Elem*>(str.c_str()), str.size() * sizeof(_Elem2)/sizeof(_Elem));
    -
    106 }
    -
    107
    -
    114 template <class _Elem2>
    -
    115 void printf(_In_z_ _Printf_format_string_ const _Elem2 *format, _In_opt_ locale_t locale, ...)
    -
    116 {
    -
    117 va_list arg;
    -
    118 va_start(arg, locale);
    -
    119 vprintf(format, locale, arg);
    -
    120 va_end(arg);
    -
    121 }
    -
    122
    -
    123 inline basic_ostreamfmt<_Elem, _Traits>& operator <<(_In_ int8_t value) { return write(value); }
    -
    124 inline basic_ostreamfmt<_Elem, _Traits>& operator <<(_In_ int16_t value) { return write(value); }
    -
    125 inline basic_ostreamfmt<_Elem, _Traits>& operator <<(_In_ int32_t value) { return write(value); }
    -
    126 inline basic_ostreamfmt<_Elem, _Traits>& operator <<(_In_ int64_t value) { return write(value); }
    -
    127 inline basic_ostreamfmt<_Elem, _Traits>& operator <<(_In_ uint8_t value) { return write(value); }
    -
    128 inline basic_ostreamfmt<_Elem, _Traits>& operator <<(_In_ uint16_t value) { return write(value); }
    -
    129 inline basic_ostreamfmt<_Elem, _Traits>& operator <<(_In_ uint32_t value) { return write(value); }
    -
    130 inline basic_ostreamfmt<_Elem, _Traits>& operator <<(_In_ uint64_t value) { return write(value); }
    -
    131#if defined(_NATIVE_SIZE_T_DEFINED) && defined(_WIN64)
    -
    132 inline basic_ostreamfmt<_Elem, _Traits>& operator <<(_In_ size_t value) { return write(value); }
    -
    133#endif
    -
    134 inline basic_ostreamfmt<_Elem, _Traits>& operator <<(_In_ float value) { return write(value); }
    -
    135 inline basic_ostreamfmt<_Elem, _Traits>& operator <<(_In_ double value) { return write(value); }
    -
    136 inline basic_ostreamfmt<_Elem, _Traits>& operator <<(_In_ char value) { return write(value); }
    -
    137#ifdef _NATIVE_WCHAR_T_DEFINED
    -
    138 inline basic_ostreamfmt<_Elem, _Traits>& operator <<(_In_ wchar_t value) { return write(value); }
    -
    139#endif
    -
    140 inline basic_ostreamfmt<_Elem, _Traits>& operator <<(_In_z_ const char* value) { return write(value); }
    -
    141 inline basic_ostreamfmt<_Elem, _Traits>& operator <<(_In_z_ const wchar_t* value) { return write(value); }
    -
    142 };
    -
    143
    -
    144 using ostreamfmt = basic_ostreamfmt<char, std::char_traits<char>>;
    -
    145 using wostreamfmt = basic_ostreamfmt<wchar_t, std::char_traits<wchar_t>>;
    -
    146
    -
    150 template <class _Elem, class _Traits>
    - -
    152 {
    -
    153 public:
    -
    154 std::basic_istream<_Elem, _Traits> &sg; // Read stream
    -
    155
    -
    156 inline basic_istreamfmt(_Inout_ std::basic_istream<_Elem, _Traits> &stream) : sg(stream) {}
    -
    157
    -
    158 using pos_type = typename _Traits::pos_type;
    -
    159 using off_type = typename _Traits::off_type;
    -
    160 inline pos_type tellg() { return sg.tellg(); }
    -
    161 inline basic_istreamfmt<_Elem, _Traits>& seekg(pos_type pos) { sg.seekg(pos); return *this; }
    -
    162 inline basic_istreamfmt<_Elem, _Traits>& seekg(off_type off, std::ios_base::seekdir dir) { sg.seekg(off, dir); return *this; }
    -
    163 inline bool good() const noexcept { return sg.good(); }
    -
    164 inline bool eof() const noexcept { return sg.eof(); }
    -
    165 inline bool fail() const noexcept { return sg.fail(); }
    -
    166 inline bool bad() const noexcept { return sg.bad(); }
    -
    167 inline std::streamsize gcount() const noexcept { return sg.gcount(); }
    -
    168
    -
    169 inline basic_istreamfmt<_Elem, _Traits>& read(_Out_writes_bytes_(size) void* data, std::streamsize size)
    -
    170 {
    -
    171 sg.read(reinterpret_cast<_Elem*>(data), size/sizeof(_Elem));
    -
    172 return *this;
    -
    173 }
    -
    174
    -
    175 template <class T>
    -
    176 inline basic_istreamfmt<_Elem, _Traits>& read(_Out_ T& value)
    -
    177 {
    -
    178 sg.read(reinterpret_cast<_Elem*>(&value), sizeof(T)/sizeof(_Elem));
    -
    179 if (sg.good())
    -
    180 LE2HE(&value);
    -
    181 return *this;
    -
    182 }
    -
    183
    -
    184 template <class _Traits = std::char_traits<char>, class _Alloc = std::allocator<char>>
    -
    185 inline basic_istreamfmt<_Elem, _Traits>& read(_Inout_ std::basic_string<char, _Traits, _Alloc>& value)
    -
    186 {
    -
    187 uint32_t count;
    -
    188 sg.read(count);
    -
    189 if (sg.good()) {
    -
    190 value.resize(count);
    -
    191 sg.read(reinterpret_cast<_Elem*>(&value[0]), (std::streamsize)count * sizeof(char)/sizeof(_Elem));
    -
    192 }
    -
    193 return *this;
    -
    194 }
    -
    195
    -
    196 template <class _Traits = std::char_traits<wchar_t>, class _Alloc = std::allocator<wchar_t>>
    -
    197 inline basic_istreamfmt<_Elem, _Traits>& read(_Inout_ std::basic_string<wchar_t, _Traits, _Alloc>& value)
    -
    198 {
    -
    199 uint32_t count;
    -
    200 sg.read(count);
    -
    201 if (sg.good()) {
    -
    202 value.resize(count);
    -
    203#ifdef BIG_ENDIAN
    -
    204 for (size_t i = 0; i < count; ++i)
    -
    205 sg.read(value[i]);
    -
    206#else
    -
    207 sg.read(reinterpret_cast<_Elem*>(&value[0]), (std::streamsize)count * sizeof(wchar_t)/sizeof(_Elem));
    -
    208#endif
    -
    209 }
    -
    210 return *this;
    -
    211 }
    -
    212
    -
    213 inline uint8_t read_byte()
    -
    214 {
    -
    215 uint8_t value;
    -
    216 read(value);
    -
    217 return value;
    -
    218 }
    -
    219
    -
    220 inline basic_istreamfmt<_Elem, _Traits>& operator >>(_Out_ int8_t& value) { return read(value); }
    -
    221 inline basic_istreamfmt<_Elem, _Traits>& operator >>(_Out_ int16_t& value) { return read(value); }
    -
    222 inline basic_istreamfmt<_Elem, _Traits>& operator >>(_Out_ int32_t& value) { return read(value); }
    -
    223 inline basic_istreamfmt<_Elem, _Traits>& operator >>(_Out_ int64_t& value) { return read(value); }
    -
    224 inline basic_istreamfmt<_Elem, _Traits>& operator >>(_Out_ uint8_t& value) { return read(value); }
    -
    225 inline basic_istreamfmt<_Elem, _Traits>& operator >>(_Out_ uint16_t& value) { return read(value); }
    -
    226 inline basic_istreamfmt<_Elem, _Traits>& operator >>(_Out_ uint32_t& value) { return read(value); }
    -
    227 inline basic_istreamfmt<_Elem, _Traits>& operator >>(_Out_ uint64_t& value) { return read(value); }
    -
    228#if defined(_NATIVE_SIZE_T_DEFINED) && defined(_WIN64)
    -
    229 inline basic_istreamfmt<_Elem, _Traits>& operator >>(_Out_ size_t& value) { return read(value); }
    -
    230#endif
    -
    231 inline basic_istreamfmt<_Elem, _Traits>& operator >>(_Out_ float& value) { return read(value); }
    -
    232 inline basic_istreamfmt<_Elem, _Traits>& operator >>(_Out_ double& value) { return read(value); }
    -
    233 inline basic_istreamfmt<_Elem, _Traits>& operator >>(_Out_ char& value) { return read(value); }
    -
    234#ifdef _NATIVE_WCHAR_T_DEFINED
    -
    235 inline basic_istreamfmt<_Elem, _Traits>& operator >>(_Out_ wchar_t& value) { return read(value); }
    -
    236#endif
    -
    237 template <class _Traits = std::char_traits<char>, class _Alloc = std::allocator<char>>
    -
    238 inline basic_istreamfmt<_Elem, _Traits>& operator >>(_Inout_ std::basic_string<char, _Traits, _Alloc>& value) { return read(value); }
    -
    239 template <class _Traits = std::char_traits<wchar_t>, class _Alloc = std::allocator<wchar_t>>
    -
    240 inline basic_istreamfmt<_Elem, _Traits>& operator >>(_Inout_ std::basic_string<wchar_t, _Traits, _Alloc>& value) { return read(value); }
    -
    241 };
    -
    242
    - - -
    245
    -
    249 template <class _Elem, class _Traits>
    -
    250 class basic_iostreamfmt : public basic_ostreamfmt<_Elem, _Traits>, public basic_istreamfmt<_Elem, _Traits>
    -
    251 {
    -
    252 public:
    -
    253 inline basic_iostreamfmt(_Inout_ std::basic_iostream<_Elem, _Traits> &stream) :
    - - -
    256 {}
    -
    257 };
    -
    258
    - - -
    261
    -
    265 template <class _Elem, class _Traits>
    -
    266 class basic_sharedstrbuf : public std::basic_streambuf<_Elem, _Traits>
    -
    267 {
    -
    268 public:
    -
    269 basic_sharedstrbuf(_In_reads_(size) const _Elem* data, _In_ size_t size)
    -
    270 {
    -
    271 setg(const_cast<_Elem*>(data), const_cast<_Elem*>(data), const_cast<_Elem*>(data + size));
    -
    272 }
    -
    273
    - -
    275 {
    -
    276 setg(other.eback(), other.gptr(), other.egptr());
    -
    277 }
    -
    278
    - -
    280 {
    -
    281 if (this != std::addressof(other))
    -
    282 std::basic_streambuf<_Elem, _Traits>::operator =(other);
    -
    283 return *this;
    -
    284 }
    -
    285
    -
    286 private:
    - - -
    289
    -
    290 protected:
    -
    291 virtual pos_type seekoff(off_type off, std::ios_base::seekdir way, std::ios_base::openmode which = std::ios_base::in | std::ios_base::out)
    -
    292 {
    -
    293 if (which & std::ios_base::in) {
    -
    294 _Elem* target;
    -
    295 switch (way) {
    -
    296 case std::ios_base::beg: target = eback() + static_cast<ptrdiff_t>(off); break;
    -
    297 case std::ios_base::cur: target = gptr() + static_cast<ptrdiff_t>(off); break;
    -
    298 case std::ios_base::end: target = egptr() + static_cast<ptrdiff_t>(off); break;
    -
    299 default: throw std::invalid_argument("invalid seek reference");
    -
    300 }
    -
    301 if (eback() <= target && target <= egptr()) {
    -
    302 gbump(static_cast<int>(target - gptr()));
    -
    303 return pos_type{ off_type{ target - eback() } };
    -
    304 }
    -
    305 }
    -
    306 return pos_type{ off_type{-1} };
    -
    307 }
    -
    308
    -
    309 virtual pos_type seekpos(pos_type pos, std::ios_base::openmode which = std::ios_base::in | std::ios_base::out)
    -
    310 {
    -
    311 if (which & std::ios_base::in) {
    -
    312 _Elem* target = eback() + static_cast<size_t>(pos);
    -
    313 if (eback() <= target && target <= egptr()) {
    -
    314 gbump(static_cast<int>(target - gptr()));
    -
    315 return pos_type{ off_type{ target - eback() } };
    -
    316 }
    -
    317 }
    -
    318 return pos_type{ off_type{-1} };
    -
    319 }
    -
    320 };
    -
    321
    -
    322 template <class _Elem, class _Traits>
    -
    323 class basic_isharedstrstream : public std::basic_istream<_Elem, _Traits>
    -
    324 {
    -
    325 public:
    -
    326 basic_isharedstrstream(_In_reads_(size) const _Elem* data, _In_ size_t size) :
    -
    327 m_buf(data, size),
    -
    328 std::basic_istream<_Elem, _Traits>(&m_buf)
    -
    329 {}
    -
    330
    -
    331 protected:
    - -
    333 };
    -
    334
    - - -
    337
    -
    343 template <class _Elem, class _Traits>
    -
    344 class basic_diagstreambuf : public std::basic_streambuf<_Elem, _Traits>
    -
    345 {
    -
    346 public:
    -
    347 using guest_stream = std::basic_iostream<_Elem, _Traits>;
    -
    348
    -
    349 template<typename _Iter>
    -
    350 basic_diagstreambuf(_In_ const _Iter first, _In_ const _Iter last) : m_streams(first, last) {}
    -
    351 basic_diagstreambuf(_In_reads_(count) guest_stream* const* streams, _In_ size_t count) : basic_diagstreambuf(streams, streams + count) {}
    -
    352
    -
    353 private:
    - - - - -
    358
    -
    359 protected:
    -
    360 virtual pos_type seekoff(off_type off, std::ios_base::seekdir way, std::ios_base::openmode which = std::ios_base::in | std::ios_base::out)
    -
    361 {
    -
    362 if (m_streams.empty())
    -
    363 return pos_type{ off_type{-1} };
    -
    364 auto r = pos_type{ off_type{-1} };
    -
    365 if ((which & std::ios_base::in)) {
    -
    366 m_streams[0]->seekg(off, way);
    -
    367 r = m_streams[0]->bad() ? pos_type{ off_type{-1} } : m_streams[0]->tellg();
    -
    368 for (size_t i = 1, n = m_streams.size(); i < n; ++i) {
    -
    369 m_streams[i]->seekg(off, way);
    -
    370 if (m_streams[i]->bad())
    -
    371 r = pos_type{ off_type{-1} };
    -
    372 }
    -
    373 }
    -
    374 if ((which & std::ios_base::out)) {
    -
    375 m_streams[0]->seekp(off, way);
    -
    376 r = m_streams[0]->bad() ? pos_type{ off_type{-1} } : m_streams[0]->tellp();
    -
    377 for (size_t i = 1, n = m_streams.size(); i < n; ++i) {
    -
    378 m_streams[i]->seekp(off, way);
    -
    379 if (m_streams[i]->bad())
    -
    380 r = pos_type{ off_type{-1} };
    -
    381 }
    -
    382 }
    -
    383 return r;
    -
    384 }
    -
    385
    -
    386 virtual pos_type seekpos(pos_type pos, std::ios_base::openmode which = std::ios_base::in | std::ios_base::out)
    -
    387 {
    -
    388 return seekoff(pos, std::ios_base::beg, which);
    -
    389 }
    -
    390
    -
    391 virtual int_type underflow()
    -
    392 {
    -
    393 int_type eof = _Traits::eof();
    -
    394 if (m_streams.empty())
    -
    395 eof;
    -
    396 _Elem data;
    -
    397 m_streams[0]->read(&data, 1);
    -
    398 int_type r = m_streams[0]->gcount() == 1 ? _Traits::to_int_type(data) : eof;
    -
    399 for (size_t i = 1, n = m_streams.size(); i < n; ++i) {
    -
    400 m_streams[i]->read(&data, 1);
    -
    401 int_type temp_r = m_streams[i]->gcount() == 1 ? _Traits::to_int_type(data) : eof;
    -
    402 if (r != temp_r)
    -
    403 r = eof;
    -
    404 }
    -
    405 return r;
    -
    406 }
    -
    407
    -
    408 virtual int_type overflow(int_type ch = _Traits::eof())
    -
    409 {
    -
    410 if (_Traits::not_eof(ch)) {
    -
    411 _Elem data = _Traits::to_char_type(ch);
    -
    412 bool good = true;
    -
    413 for (size_t i = 0, n = m_streams.size(); i < n; ++i) {
    -
    414 m_streams[i]->write(&data, 1);
    -
    415 good &= m_streams[i]->good();
    -
    416 }
    -
    417 return good ? 0 : _Traits::eof();
    -
    418 }
    -
    419 return 0;
    -
    420 }
    -
    421
    -
    422 virtual int sync()
    -
    423 {
    -
    424 int r = 0;
    -
    425 for (size_t i = 0, n = m_streams.size(); i < n; ++i)
    -
    426 if (m_streams[i]->sync() < 0)
    -
    427 r = -1;
    -
    428 return r;
    -
    429 }
    -
    430
    -
    431 protected:
    -
    432 std::vector<guest_stream*> m_streams;
    -
    433 };
    -
    434
    -
    441 template <class _Elem, class _Traits>
    -
    442 class basic_diagstream : public std::basic_iostream<_Elem, _Traits>
    -
    443 {
    -
    444 public:
    -
    445 using guest_stream = std::basic_iostream<_Elem, _Traits>;
    -
    446
    -
    447 template<typename _Iter>
    -
    448 basic_diagstream(_In_ const _Iter first, _In_ const _Iter last) :
    -
    449 m_buf(first, last),
    -
    450 std::basic_iostream<_Elem, _Traits>(&m_buf)
    -
    451 {}
    -
    452
    -
    453 basic_diagstream(_In_reads_(count) guest_stream* const* streams, _In_ size_t count) :
    -
    454 basic_diagstream(streams, streams + count)
    -
    455 {}
    -
    456
    -
    457 protected:
    - -
    459 };
    -
    460
    - - -
    463
    -
    464#ifdef _WIN32
    -
    466 template struct robber<getter<FILE*, std::filebuf>, &std::filebuf::_Myfile>;
    -
    467 template struct robber<getter<FILE*, std::wfilebuf>, &std::wfilebuf::_Myfile>;
    -
    468
    -
    469 inline FILE* filebuf_fhandle(_In_ std::filebuf* rb)
    -
    470 {
    -
    471 return (*rb).*get(getter<FILE*, std::filebuf>());
    -
    472 }
    -
    473
    -
    474 inline FILE* filebuf_fhandle(_In_ std::wfilebuf* rb)
    -
    475 {
    -
    476 return (*rb).*get(getter<FILE*, std::wfilebuf>());
    -
    477 }
    -
    479#endif
    -
    480
    -
    484 template <class _Elem, class _Traits>
    -
    485 class basic_fstream : public std::basic_fstream<_Elem, _Traits>
    -
    486 {
    -
    487 public:
    -
    488 using _Mybase = std::basic_fstream<_Elem, _Traits>;
    -
    489#if _HAS_CXX20
    -
    490 using time_point = std::chrono::time_point<std::chrono::file_clock>;
    -
    491#else
    -
    492 using time_point = std::chrono::time_point<std::chrono::system_clock>;
    -
    493#endif
    -
    494
    -
    495 basic_fstream() {}
    -
    496
    -
    497 explicit basic_fstream(
    -
    498 _In_z_ const char* file_name,
    -
    499 _In_ ios_base::openmode mode = ios_base::in | ios_base::out,
    -
    500 _In_ int prot = ios_base::_Default_open_prot) : _Mybase(file_name, mode, prot) {}
    -
    501
    -
    502 explicit basic_fstream(
    -
    503 _In_z_ const wchar_t* file_name,
    -
    504 _In_ ios_base::openmode mode = ios_base::in | ios_base::out,
    -
    505 _In_ int prot = ios_base::_Default_open_prot) : _Mybase(file_name, mode, prot) {}
    -
    506
    -
    507 template<class _Elem2, class _Traits2, class _Ax>
    -
    508 explicit basic_fstream(
    -
    509 _In_ const std::basic_string<_Elem2, _Traits2, _Ax>& str,
    -
    510 _In_ ios_base::openmode mode = ios_base::in | ios_base::out,
    -
    511 _In_ int prot = ios_base::_Default_open_prot) : basic_fstream(str.c_str(), mode, prot) {}
    -
    512
    -
    513 explicit basic_fstream(_In_ FILE* file) : _Mybase(file) {}
    -
    514
    -
    515 basic_fstream(_Inout_ basic_fstream&& other) : _Mybase(std::move(other)) {}
    -
    516
    -
    520 void truncate()
    -
    521 {
    -
    522 flush();
    -
    523 auto h = os_fhandle();
    -
    524#ifdef _WIN32
    -
    525 if (h == INVALID_HANDLE_VALUE)
    -
    526 throw std::runtime_error("invalid handle");
    -
    527 auto pos = tellp();
    -
    528 LONG
    -
    529 pos_lo = static_cast<LONG>(pos & 0xffffffff),
    -
    530 pos_hi = static_cast<LONG>((pos >> 32) & 0xffffffff);
    -
    531 if (SetFilePointer(h, pos_lo, &pos_hi, FILE_BEGIN) == INVALID_SET_FILE_POINTER)
    -
    532 throw std::runtime_error("failed to seek");
    -
    533 if (!SetEndOfFile(h))
    -
    534 throw std::runtime_error("failed to truncate");
    -
    535#else
    -
    536#error Implement!
    -
    537#endif
    -
    538 }
    -
    539
    -
    545 time_point mtime() const
    -
    546 {
    -
    547 auto h = os_fhandle();
    -
    548#ifdef _WIN32
    -
    549 if (h == INVALID_HANDLE_VALUE)
    -
    550 throw std::runtime_error("invalid handle");
    -
    551 FILETIME ft;
    -
    552 if (!GetFileTime(h, NULL, NULL, &ft))
    -
    553 throw std::runtime_error("failed to get mtime");
    -
    554#if _HAS_CXX20
    -
    555 return time_point(time_point::duration(((static_cast<int64_t>(ft.dwHighDateTime) << 32) | ft.dwLowDateTime)));
    -
    556#else
    -
    557 // Adjust epoch to std::chrono::time_point<std::chrono::system_clock>/time_t.
    -
    558 return time_point(time_point::duration(((static_cast<int64_t>(ft.dwHighDateTime) << 32) | ft.dwLowDateTime) - 116444736000000000ll));
    -
    559#endif
    -
    560#else
    -
    561#error Implement!
    -
    562#endif
    -
    563 }
    -
    564
    -
    565 protected:
    -
    566#ifdef _WIN32
    -
    567 HANDLE os_fhandle() const
    -
    568 {
    -
    569 FILE* f = filebuf_fhandle(rdbuf());
    -
    570 if (f == NULL)
    -
    571 return INVALID_HANDLE_VALUE;
    -
    572
    -
    573 int fd = _fileno(f);
    -
    574 if (fd == -1)
    -
    575 return INVALID_HANDLE_VALUE;
    -
    576
    -
    577 return (HANDLE)_get_osfhandle(fd);
    -
    578 }
    -
    579#else
    -
    580#error Implement!
    -
    581#endif
    -
    582 };
    -
    583
    -
    584 using fstream = basic_fstream<char, std::char_traits<char>>;
    -
    585 using wfstream = basic_fstream<wchar_t, std::char_traits<wchar_t>>;
    -
    586
    -
    590 template <class _Elem, class _Traits, class _Alloc>
    -
    591 class basic_stringstream : public std::basic_stringstream<_Elem, _Traits, _Alloc> {
    -
    592 public:
    -
    593 using _Mybase = std::basic_stringstream<_Elem, _Traits, _Alloc>;
    -
    594 using _Mystr = std::basic_string<_Elem, _Traits, _Alloc>;
    -
    595
    - -
    597 explicit basic_stringstream(_In_ std::ios_base::openmode mode) : _Mybase(mode) {}
    -
    598 explicit basic_stringstream(_In_ const _Mystr& str, _In_ std::ios_base::openmode mode = std::ios_base::in | std::ios_base::out) : _Mybase(str, mode) {}
    -
    599 basic_stringstream(_Inout_ basic_stringstream&& other) : _Mybase(std::move(other)) {}
    -
    600
    -
    608 template <class T>
    -
    609 explicit basic_stringstream(_In_z_ const T* filename, _In_ std::ios_base::openmode mode = std::ios_base::in, _In_ int prot = std::ios_base::_Default_open_prot) :
    -
    610 _Mybase(std::ios_base::in | std::ios_base::out | (mode & std::ios_base::binary | std::ios_base::app))
    -
    611 {
    -
    612 std::basic_ifstream<_Elem, _Traits> input(filename, mode & ~(std::ios_base::ate | std::ios_base::app), prot);
    -
    613 input.seekg(0, input.end);
    -
    614 auto size = input.tellg();
    -
    615 if (size > SIZE_MAX)
    -
    616 throw std::runtime_error("file too big to fit into memory");
    -
    617 str().reserve(static_cast<size_t>(size));
    -
    618 input.seekg(0);
    -
    619 do {
    -
    620 _Elem buf[0x1000];
    -
    621 input.read(buf, _countof(buf));
    -
    622 write(buf, input.gcount());
    -
    623 } while (!input.eof());
    -
    624 if (!(mode & (std::ios_base::ate | std::ios_base::app)))
    -
    625 seekp(0);
    -
    626 }
    -
    627
    -
    635 template <class _Elem2, class _Traits2 = std::char_traits<_Elem2>, class _Alloc2 = std::allocator<_Elem2>>
    -
    636 explicit basic_stringstream(_In_ const std::basic_string<_Elem2, _Traits2, _Alloc2>& filename, _In_ std::ios_base::openmode mode = std::ios_base::in, _In_ int prot = std::ios_base::_Default_open_prot) :
    -
    637 basic_stringstream(filename.c_str(), mode, prot)
    -
    638 {}
    -
    639
    -
    647 template <class T>
    -
    648 void save(_In_z_ const T* filename, _In_ std::ios_base::openmode mode = std::ios_base::out, _In_ int prot = std::ios_base::_Default_open_prot)
    -
    649 {
    -
    650 std::basic_ofstream<_Elem, _Traits> output(filename, mode, prot);
    -
    651 auto origin = tellg();
    -
    652 seekg(0, end);
    -
    653 auto size = tellg();
    -
    654 do {
    -
    655 _Elem buf[0x1000];
    -
    656 read(buf, _countof(buf));
    -
    657 output.write(buf, gcount());
    -
    658 } while (!eof());
    -
    659 seekg(origin);
    -
    660 }
    -
    661
    -
    662 template <class _Elem2, class _Traits2 = std::char_traits<T>, class _Alloc2 = std::allocator<T>>
    -
    663 void save(_In_ const std::basic_string<_Elem2, _Traits2, _Alloc2>& filename, _In_ std::ios_base::openmode mode = std::ios_base::out, _In_ int prot = std::ios_base::_Default_open_prot)
    -
    664 {
    -
    665 save(filename.data(), mode, prot);
    -
    666 }
    -
    667 };
    -
    668
    -
    669 using stringstream = basic_stringstream<char, std::char_traits<char>, std::allocator<char>>;
    -
    670 using wstringstream = basic_stringstream<wchar_t, std::char_traits<wchar_t>, std::allocator<char>>;
    -
    671}
    -
    Diagnostic input/output stream.
    Definition ios.hpp:443
    -
    Diagnostic input stream buffer.
    Definition ios.hpp:345
    -
    File stream with additional std::filesystem features.
    Definition ios.hpp:486
    -
    time_point mtime() const
    Returns file modification time.
    Definition ios.hpp:545
    -
    void truncate()
    Sets end of file at current put position.
    Definition ios.hpp:520
    -
    Binary stream reader/writer.
    Definition ios.hpp:251
    -
    Definition ios.hpp:324
    -
    Binary stream reader.
    Definition ios.hpp:152
    -
    Binary stream writer.
    Definition ios.hpp:33
    -
    void vprintf(const _Elem2 *format, locale_t locale, va_list arg)
    Formats string using printf() and write it to stream.
    Definition ios.hpp:101
    -
    void printf(const _Elem2 *format, locale_t locale,...)
    Formats string using printf() and write it to stream.
    Definition ios.hpp:115
    -
    Shared-memory string stream buffer.
    Definition ios.hpp:267
    -
    String stream.
    Definition ios.hpp:591
    -
    basic_stringstream(const T *filename, std::ios_base::openmode mode=std::ios_base::in, int prot=std::ios_base::_Default_open_prot)
    Initializes stream with content from file.
    Definition ios.hpp:609
    -
    void save(const T *filename, std::ios_base::openmode mode=std::ios_base::out, int prot=std::ios_base::_Default_open_prot)
    Saves stream content to a file.
    Definition ios.hpp:648
    -
    basic_stringstream(const std::basic_string< _Elem2, _Traits2, _Alloc2 > &filename, std::ios_base::openmode mode=std::ios_base::in, int prot=std::ios_base::_Default_open_prot)
    Initializes stream with content from file.
    Definition ios.hpp:636
    -
    Helper template to allow access to internal std C++ private members.
    Definition internal.hpp:30
    -
    Helper template to allow access to internal std C++ private members.
    Definition internal.hpp:18
    -
    - - - - diff --git a/mapping_8hpp_source.html b/mapping_8hpp_source.html index d2889dfbf..4aa418176 100644 --- a/mapping_8hpp_source.html +++ b/mapping_8hpp_source.html @@ -117,7 +117,7 @@ $(function() { diff --git a/internal_8hpp_source.html b/math_8hpp_source.html similarity index 53% rename from internal_8hpp_source.html rename to math_8hpp_source.html index 735fa4be2..2999c9937 100644 --- a/internal_8hpp_source.html +++ b/math_8hpp_source.html @@ -5,7 +5,7 @@ -stdex: include/stdex/internal.hpp Source File +stdex: include/stdex/math.hpp Source File @@ -74,7 +74,7 @@ $(function() {
    -
    internal.hpp
    +
    math.hpp
    1/*
    @@ -84,35 +84,52 @@ $(function() {
    5
    6#pragma once
    7
    -
    8#include <stdio.h>
    -
    9
    -
    10namespace stdex
    -
    11{
    -
    17 template<typename _Tag, typename _Tag::type _Member>
    -
    18 struct robber {
    -
    19 friend typename _Tag::type get(_Tag) {
    -
    20 return _Member;
    -
    21 }
    -
    22 };
    -
    23
    -
    29 template<typename _Type, typename _Class>
    -
    30 struct getter {
    -
    31 typedef _Type _Class::* type;
    -
    32 friend type get(getter<_Type, _Class>);
    -
    33 };
    -
    34}
    -
    35
    -
    36#ifdef _WIN32
    -
    38extern "C" {
    -
    39 _ACRTIMP intptr_t __cdecl _get_osfhandle(_In_ int _FileHandle);
    -
    40}
    -
    42#endif
    -
    Helper template to allow access to internal std C++ private members.
    Definition internal.hpp:30
    -
    Helper template to allow access to internal std C++ private members.
    Definition internal.hpp:18
    +
    8#include "sal.hpp"
    +
    9#include "system.hpp"
    +
    10#include <stdexcept>
    +
    11
    +
    12namespace stdex
    +
    13{
    +
    14 inline size_t mul(size_t a, size_t b)
    +
    15 {
    +
    16#if _MSC_VER >= 1300
    +
    17 SIZE_T result;
    +
    18 if (SUCCEEDED(SIZETMult(a, b, &result)))
    +
    19 return result;
    +
    20#elif defined(_MSC_VER)
    +
    21 if (a == 0)
    +
    22 return 0;
    +
    23 if (b <= SIZE_MAX / a)
    +
    24 return a * b;
    +
    25#else
    +
    26 size_t result;
    +
    27 if (!__builtin_mul_overflow(a, b, &result))
    +
    28 return result;
    +
    29#endif
    +
    30 throw std::invalid_argument("multiply overflow");
    +
    31 }
    +
    32
    +
    33 inline size_t add(size_t a, size_t b)
    +
    34 {
    +
    35#if _MSC_VER >= 1300
    +
    36 SIZE_T result;
    +
    37 if (SUCCEEDED(SIZETAdd(a, b, &result)))
    +
    38 return result;
    +
    39#elif defined(_MSC_VER)
    +
    40 if (a <= SIZE_MAX - b)
    +
    41 return a + b;
    +
    42#else
    +
    43 size_t result;
    +
    44 if (!__builtin_add_overflow(a, b, &result))
    +
    45 return result;
    +
    46#endif
    +
    47 throw std::invalid_argument("add overflow");
    +
    48 }
    +
    49}
    diff --git a/memory_8hpp_source.html b/memory_8hpp_source.html index b9eec9196..d55708878 100644 --- a/memory_8hpp_source.html +++ b/memory_8hpp_source.html @@ -119,7 +119,7 @@ $(function() { diff --git a/menudata.js b/menudata.js index da1ad248f..4b8969dba 100644 --- a/menudata.js +++ b/menudata.js @@ -31,46 +31,50 @@ var menudata={children:[ {text:"Class Members",url:"functions.html",children:[ {text:"All",url:"functions.html",children:[ {text:"a",url:"functions.html#index_a"}, -{text:"b",url:"functions.html#index_b"}, -{text:"c",url:"functions.html#index_c"}, -{text:"d",url:"functions.html#index_d"}, -{text:"e",url:"functions.html#index_e"}, -{text:"f",url:"functions.html#index_f"}, -{text:"g",url:"functions.html#index_g"}, -{text:"h",url:"functions.html#index_h"}, -{text:"i",url:"functions.html#index_i"}, -{text:"l",url:"functions.html#index_l"}, -{text:"m",url:"functions.html#index_m"}, -{text:"n",url:"functions.html#index_n"}, -{text:"o",url:"functions.html#index_o"}, -{text:"p",url:"functions.html#index_p"}, -{text:"r",url:"functions.html#index_r"}, -{text:"s",url:"functions.html#index_s"}, -{text:"t",url:"functions.html#index_t"}, -{text:"u",url:"functions.html#index_u"}, -{text:"v",url:"functions.html#index_v"}, -{text:"~",url:"functions.html#index__7E"}]}, +{text:"b",url:"functions_b.html#index_b"}, +{text:"c",url:"functions_c.html#index_c"}, +{text:"d",url:"functions_d.html#index_d"}, +{text:"e",url:"functions_e.html#index_e"}, +{text:"f",url:"functions_f.html#index_f"}, +{text:"g",url:"functions_g.html#index_g"}, +{text:"h",url:"functions_h.html#index_h"}, +{text:"i",url:"functions_i.html#index_i"}, +{text:"l",url:"functions_l.html#index_l"}, +{text:"m",url:"functions_m.html#index_m"}, +{text:"n",url:"functions_n.html#index_n"}, +{text:"o",url:"functions_o.html#index_o"}, +{text:"p",url:"functions_p.html#index_p"}, +{text:"q",url:"functions_q.html#index_q"}, +{text:"r",url:"functions_r.html#index_r"}, +{text:"s",url:"functions_s.html#index_s"}, +{text:"t",url:"functions_t.html#index_t"}, +{text:"u",url:"functions_u.html#index_u"}, +{text:"v",url:"functions_v.html#index_v"}, +{text:"w",url:"functions_w.html#index_w"}, +{text:"~",url:"functions_~.html#index__7E"}]}, {text:"Functions",url:"functions_func.html",children:[ {text:"a",url:"functions_func.html#index_a"}, -{text:"b",url:"functions_func.html#index_b"}, -{text:"c",url:"functions_func.html#index_c"}, -{text:"d",url:"functions_func.html#index_d"}, -{text:"e",url:"functions_func.html#index_e"}, -{text:"f",url:"functions_func.html#index_f"}, -{text:"g",url:"functions_func.html#index_g"}, -{text:"h",url:"functions_func.html#index_h"}, -{text:"i",url:"functions_func.html#index_i"}, -{text:"l",url:"functions_func.html#index_l"}, -{text:"m",url:"functions_func.html#index_m"}, -{text:"n",url:"functions_func.html#index_n"}, -{text:"o",url:"functions_func.html#index_o"}, -{text:"p",url:"functions_func.html#index_p"}, -{text:"r",url:"functions_func.html#index_r"}, -{text:"s",url:"functions_func.html#index_s"}, -{text:"t",url:"functions_func.html#index_t"}, -{text:"u",url:"functions_func.html#index_u"}, -{text:"v",url:"functions_func.html#index_v"}, -{text:"~",url:"functions_func.html#index__7E"}]}, +{text:"b",url:"functions_func_b.html#index_b"}, +{text:"c",url:"functions_func_c.html#index_c"}, +{text:"d",url:"functions_func_d.html#index_d"}, +{text:"e",url:"functions_func_e.html#index_e"}, +{text:"f",url:"functions_func_f.html#index_f"}, +{text:"g",url:"functions_func_g.html#index_g"}, +{text:"h",url:"functions_func_h.html#index_h"}, +{text:"i",url:"functions_func_i.html#index_i"}, +{text:"l",url:"functions_func_l.html#index_l"}, +{text:"m",url:"functions_func_m.html#index_m"}, +{text:"n",url:"functions_func_n.html#index_n"}, +{text:"o",url:"functions_func_o.html#index_o"}, +{text:"p",url:"functions_func_p.html#index_p"}, +{text:"q",url:"functions_func_q.html#index_q"}, +{text:"r",url:"functions_func_r.html#index_r"}, +{text:"s",url:"functions_func_s.html#index_s"}, +{text:"t",url:"functions_func_t.html#index_t"}, +{text:"u",url:"functions_func_u.html#index_u"}, +{text:"v",url:"functions_func_v.html#index_v"}, +{text:"w",url:"functions_func_w.html#index_w"}, +{text:"~",url:"functions_func_~.html#index__7E"}]}, {text:"Variables",url:"functions_vars.html",children:[ {text:"a",url:"functions_vars.html#index_a"}, {text:"b",url:"functions_vars.html#index_b"}, @@ -80,12 +84,16 @@ var menudata={children:[ {text:"f",url:"functions_vars.html#index_f"}, {text:"h",url:"functions_vars.html#index_h"}, {text:"i",url:"functions_vars.html#index_i"}, +{text:"l",url:"functions_vars.html#index_l"}, {text:"m",url:"functions_vars.html#index_m"}, {text:"n",url:"functions_vars.html#index_n"}, +{text:"o",url:"functions_vars.html#index_o"}, {text:"p",url:"functions_vars.html#index_p"}, +{text:"r",url:"functions_vars.html#index_r"}, {text:"s",url:"functions_vars.html#index_s"}, {text:"t",url:"functions_vars.html#index_t"}, -{text:"v",url:"functions_vars.html#index_v"}]}, +{text:"v",url:"functions_vars.html#index_v"}, +{text:"w",url:"functions_vars.html#index_w"}]}, {text:"Typedefs",url:"functions_type.html"}]}]}, {text:"Files",url:"files.html",children:[ {text:"File List",url:"files.html"}]}]} diff --git a/parser_8hpp_source.html b/parser_8hpp_source.html index d427ceabc..157a2121c 100644 --- a/parser_8hpp_source.html +++ b/parser_8hpp_source.html @@ -89,6463 +89,6464 @@ $(function() {
    10#include "sal.hpp"
    11#include "sgml.hpp"
    12#include "string.hpp"
    -
    13#include <assert.h>
    -
    14#include <stdarg.h>
    -
    15#include <stdint.h>
    -
    16#ifdef _WIN32
    -
    17#include <winsock2.h>
    -
    18#include <ws2ipdef.h>
    -
    19#else
    -
    20#include <inaddr.h>
    -
    21#include <in6addr.h>
    -
    22#endif
    -
    23#include <limits>
    -
    24#include <list>
    -
    25#include <locale>
    -
    26#include <memory>
    -
    27#include <set>
    -
    28#include <string>
    -
    29
    -
    30#ifdef _MSC_VER
    -
    31#pragma warning(push)
    -
    32#pragma warning(disable: 4100)
    -
    33#endif
    -
    34
    -
    35#define ENUM_FLAG_OPERATOR(T,X) \
    -
    36inline 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)); } \
    -
    37inline 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); } \
    -
    38inline 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)); } \
    -
    39inline T& operator X= (T& lhs, const T rhs) { return lhs = lhs X rhs; } \
    -
    40inline T& operator X= (T& lhs, const std::underlying_type_t<T> rhs) { return lhs = lhs X rhs; }
    -
    41#define ENUM_FLAGS(T, type) \
    -
    42enum class T : type; \
    -
    43inline T operator ~ (T t) { return (T) (~static_cast<std::underlying_type_t <T>>(t)); } \
    -
    44ENUM_FLAG_OPERATOR(T,|) \
    -
    45ENUM_FLAG_OPERATOR(T,^) \
    -
    46ENUM_FLAG_OPERATOR(T,&) \
    -
    47enum class T : type
    -
    48
    -
    49namespace stdex
    -
    50{
    -
    51 namespace parser
    -
    52 {
    -
    56 constexpr int match_default = 0;
    -
    57 constexpr int match_case_insensitive = 0x1;
    -
    58 constexpr int match_multiline = 0x2;
    -
    59
    -
    63 template <class T>
    -
    64 class basic_parser
    -
    65 {
    -
    66 public:
    -
    67 basic_parser(_In_ const std::locale& locale = std::locale()) : m_locale(locale) {}
    -
    68 virtual ~basic_parser() {}
    -
    69
    -
    70 bool search(
    -
    71 _In_reads_or_z_(end) const T* text,
    -
    72 _In_ size_t start = 0,
    -
    73 _In_ size_t end = (size_t)-1,
    -
    74 _In_ int flags = match_default)
    -
    75 {
    -
    76 for (size_t i = start; i < end && text[i]; i++)
    -
    77 if (match(text, i, end, flags))
    -
    78 return true;
    -
    79 return false;
    -
    80 }
    -
    81
    -
    82 virtual bool match(
    -
    83 _In_reads_or_z_(end) const T* text,
    -
    84 _In_ size_t start = 0,
    -
    85 _In_ size_t end = (size_t)-1,
    -
    86 _In_ int flags = match_default) = 0;
    -
    87
    -
    88 template<class _Traits, class _Ax>
    -
    89 inline bool match(
    -
    90 const std::basic_string<T, _Traits, _Ax>& text,
    -
    91 _In_ size_t start = 0,
    -
    92 _In_ size_t end = (size_t)-1,
    -
    93 _In_ int flags = match_default)
    -
    94 {
    -
    95 return match(text.c_str(), start, std::min<size_t>(end, text.size()), flags);
    -
    96 }
    -
    97
    -
    98 virtual void invalidate()
    -
    99 {
    -
    100 interval.start = 1;
    -
    101 interval.end = 0;
    -
    102 }
    -
    103
    -
    104 protected:
    -
    106 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])
    -
    107 {
    -
    108 if (text[start] == '&') {
    -
    109 // Potential entity start
    -
    110 const auto& ctype = std::use_facet<std::ctype<T>>(m_locale);
    -
    111 for (chr_end = start + 1;; chr_end++) {
    -
    112 if (chr_end >= end || text[chr_end] == 0) {
    -
    113 // Unterminated entity
    -
    114 break;
    -
    115 }
    -
    116 if (text[chr_end] == ';') {
    -
    117 // Entity end
    -
    118 size_t n = chr_end - start - 1;
    -
    119 if (n >= 2 && text[start + 1] == '#') {
    -
    120 // Numerical entity
    -
    121 char32_t unicode;
    -
    122 if (text[start + 2] == 'x' || text[start + 2] == 'X')
    -
    123 unicode = strtou32(text + start + 3, n - 2, nullptr, 16);
    -
    124 else
    -
    125 unicode = strtou32(text + start + 2, n - 1, nullptr, 10);
    -
    126#ifdef _WIN32
    -
    127 if (unicode < 0x10000) {
    -
    128 buf[0] = (wchar_t)unicode;
    -
    129 buf[1] = 0;
    -
    130 }
    -
    131 else {
    -
    132 ucs4_to_surrogate_pair(buf, unicode);
    -
    133 buf[2] = 0;
    -
    134 }
    -
    135#else
    -
    136 buf[0] = (wchar_t)unicode;
    -
    137 buf[1] = 0;
    -
    138#endif
    -
    139 chr_end++;
    -
    140 return buf;
    -
    141 }
    -
    142 const wchar_t* entity_w = sgml2uni(text + start + 1, n);
    -
    143 if (entity_w) {
    -
    144 chr_end++;
    -
    145 return entity_w;
    -
    146 }
    -
    147 // Unknown entity.
    -
    148 break;
    -
    149 }
    -
    150 else if (text[chr_end] == '&' || ctype.is(ctype.space, text[chr_end])) {
    -
    151 // This char cannot possibly be a part of entity.
    -
    152 break;
    -
    153 }
    -
    154 }
    -
    155 }
    -
    156 buf[0] = text[start];
    -
    157 buf[1] = 0;
    -
    158 chr_end = start + 1;
    -
    159 return buf;
    -
    160 }
    -
    162
    -
    163 public:
    -
    164 interval<size_t> interval;
    -
    165
    -
    166 protected:
    -
    167 std::locale m_locale;
    -
    168 };
    -
    169
    -
    170 using parser = basic_parser<char>;
    -
    171 using wparser = basic_parser<wchar_t>;
    -
    172#ifdef _UNICODE
    -
    173 using tparser = wparser;
    -
    174#else
    -
    175 using tparser = parser;
    -
    176#endif
    -
    177 using sgml_parser = basic_parser<char>;
    -
    178
    -
    182 template <class T>
    -
    183 class basic_noop : public basic_parser<T>
    -
    184 {
    -
    185 public:
    -
    186 virtual bool match(
    -
    187 _In_reads_or_z_(end) const T* text,
    -
    188 _In_ size_t start = 0,
    -
    189 _In_ size_t end = (size_t)-1,
    -
    190 _In_ int flags = match_default)
    -
    191 {
    -
    192 assert(text || start >= end);
    -
    193 if (start < end && text[start]) {
    -
    194 interval.start = interval.end = start;
    -
    195 return true;
    -
    196 }
    -
    197 interval.start = (interval.end = start) + 1;
    -
    198 return false;
    -
    199 }
    -
    200 };
    -
    201
    -
    202 using noop = basic_noop<char>;
    -
    203 using wnoop = basic_noop<wchar_t>;
    -
    204#ifdef _UNICODE
    -
    205 using tnoop = wnoop;
    -
    206#else
    -
    207 using tnoop = noop;
    -
    208#endif
    -
    209 using sgml_noop = basic_noop<char>;
    -
    210
    -
    214 template <class T>
    -
    215 class basic_any_cu : public basic_parser<T>
    -
    216 {
    -
    217 public:
    -
    218 basic_any_cu(_In_ const std::locale& locale = std::locale()) : basic_parser<T>(locale) {}
    -
    219
    -
    220 virtual bool match(
    -
    221 _In_reads_or_z_(end) const T* text,
    -
    222 _In_ size_t start = 0,
    -
    223 _In_ size_t end = (size_t)-1,
    -
    224 _In_ int flags = match_default)
    -
    225 {
    -
    226 assert(text || start >= end);
    -
    227 if (start < end && text[start]) {
    -
    228 interval.end = (interval.start = start) + 1;
    -
    229 return true;
    -
    230 }
    -
    231 interval.start = (interval.end = start) + 1;
    -
    232 return false;
    -
    233 }
    -
    234 };
    -
    235
    -
    236 using any_cu = basic_any_cu<char>;
    -
    237 using wany_cu = basic_any_cu<wchar_t>;
    -
    238#ifdef _UNICODE
    -
    239 using tany_cu = wany_cu;
    -
    240#else
    -
    241 using tany_cu = any_cu;
    -
    242#endif
    -
    243
    -
    247 class sgml_any_cp : public basic_any_cu<char>
    -
    248 {
    -
    249 public:
    -
    250 sgml_any_cp(_In_ const std::locale& locale = std::locale()) : basic_any_cu<char>(locale) {}
    -
    251
    -
    252 virtual bool match(
    -
    253 _In_reads_or_z_(end) const char* text,
    -
    254 _In_ size_t start = 0,
    -
    255 _In_ size_t end = (size_t)-1,
    -
    256 _In_ int flags = match_default)
    -
    257 {
    -
    258 assert(text || start >= end);
    -
    259 if (start < end && text[start]) {
    -
    260 if (text[start] == '&') {
    -
    261 // SGML entity
    -
    262 const auto& ctype = std::use_facet<std::ctype<char>>(m_locale);
    -
    263 for (interval.end = start + 1; interval.end < end && text[interval.end]; interval.end++)
    -
    264 if (text[interval.end] == ';') {
    -
    265 interval.end++;
    -
    266 interval.start = start;
    -
    267 return true;
    -
    268 }
    -
    269 else if (text[interval.end] == '&' || ctype.is(ctype.space, text[interval.end]))
    -
    270 break;
    -
    271 // Unterminated entity
    -
    272 }
    -
    273 interval.end = (interval.start = start) + 1;
    -
    274 return true;
    -
    275 }
    -
    276 interval.start = (interval.end = start) + 1;
    -
    277 return false;
    -
    278 }
    -
    279 };
    -
    280
    -
    284 template <class T>
    -
    285 class basic_cu : public basic_parser<T>
    -
    286 {
    -
    287 public:
    -
    288 basic_cu(T chr, bool invert = false, _In_ const std::locale& locale = std::locale()) :
    -
    289 basic_parser<T>(locale),
    -
    290 m_chr(chr),
    -
    291 m_invert(invert)
    -
    292 {}
    -
    293
    -
    294 virtual bool match(
    -
    295 _In_reads_or_z_(end) const T* text,
    -
    296 _In_ size_t start = 0,
    -
    297 _In_ size_t end = (size_t)-1,
    -
    298 _In_ int flags = match_default)
    -
    299 {
    -
    300 assert(text || start >= end);
    -
    301 if (start < end && text[start]) {
    -
    302 bool r;
    -
    303 if (flags & match_case_insensitive) {
    -
    304 const auto& ctype = std::use_facet<std::ctype<T>>(m_locale);
    -
    305 r = ctype.tolower(text[start]) == ctype.tolower(m_chr);
    -
    306 }
    -
    307 else
    -
    308 r = text[start] == m_chr;
    -
    309 if (r && !m_invert || !r && m_invert) {
    -
    310 interval.end = (interval.start = start) + 1;
    -
    311 return true;
    -
    312 }
    -
    313 }
    -
    314 interval.start = (interval.end = start) + 1;
    -
    315 return false;
    -
    316 }
    -
    317
    -
    318 protected:
    -
    319 T m_chr;
    -
    320 bool m_invert;
    -
    321 };
    -
    322
    -
    323 using cu = basic_cu<char>;
    -
    324 using wcu = basic_cu<wchar_t>;
    -
    325#ifdef _UNICODE
    -
    326 using tcu = wcu;
    -
    327#else
    -
    328 using tcu = cu;
    -
    329#endif
    -
    330
    -
    334 class sgml_cp : public sgml_parser
    -
    335 {
    -
    336 public:
    -
    337 sgml_cp(const char* chr, size_t count = (size_t)-1, bool invert = false, _In_ const std::locale& locale = std::locale()) :
    -
    338 sgml_parser(locale),
    -
    339 m_invert(invert)
    -
    340 {
    -
    341 assert(chr || !count);
    -
    342 wchar_t buf[3];
    -
    343 size_t chr_end;
    -
    344 m_chr.assign(count ? next_sgml_cp(chr, 0, count, chr_end, buf) : L"");
    -
    345 }
    -
    346
    -
    347 virtual bool match(
    -
    348 _In_reads_or_z_(end) const char* text,
    -
    349 _In_ size_t start = 0,
    -
    350 _In_ size_t end = (size_t)-1,
    -
    351 _In_ int flags = match_default)
    -
    352 {
    -
    353 assert(text || start >= end);
    -
    354 if (start < end && text[start]) {
    -
    355 wchar_t buf[3];
    -
    356 const wchar_t* chr = next_sgml_cp(text, start, end, interval.end, buf);
    -
    357 bool r = ((flags & match_case_insensitive) ?
    -
    358 stdex::strnicmp(chr, (size_t)-1, m_chr.c_str(), m_chr.size(), m_locale) :
    -
    359 stdex::strncmp(chr, (size_t)-1, m_chr.c_str(), m_chr.size())) == 0;
    -
    360 if (r && !m_invert || !r && m_invert) {
    -
    361 interval.start = start;
    -
    362 return true;
    -
    363 }
    -
    364 }
    -
    365 interval.start = (interval.end = start) + 1;
    -
    366 return false;
    -
    367 }
    -
    368
    -
    369 protected:
    -
    370 std::wstring m_chr;
    -
    371 bool m_invert;
    -
    372 };
    -
    373
    -
    377 template <class T>
    -
    378 class basic_space_cu : public basic_parser<T>
    -
    379 {
    -
    380 public:
    -
    381 basic_space_cu(bool invert = false, _In_ const std::locale& locale = std::locale()) :
    -
    382 basic_parser<T>(locale),
    -
    383 m_invert(invert)
    -
    384 {}
    -
    385
    -
    386 virtual bool match(
    -
    387 _In_reads_or_z_(end) const T* text,
    -
    388 _In_ size_t start = 0,
    -
    389 _In_ size_t end = (size_t)-1,
    -
    390 _In_ int flags = match_default)
    -
    391 {
    -
    392 assert(text || start >= end);
    -
    393 if (start < end && text[start]) {
    -
    394 bool r =
    -
    395 ((flags & match_multiline) || !islbreak(text[start])) &&
    -
    396 std::use_facet<std::ctype<T>>(m_locale).is(std::ctype_base::space, text[start]);
    -
    397 if (r && !m_invert || !r && m_invert) {
    -
    398 interval.end = (interval.start = start) + 1;
    -
    399 return true;
    -
    400 }
    -
    401 }
    -
    402 interval.start = (interval.end = start) + 1;
    -
    403 return false;
    -
    404 }
    -
    405
    -
    406 protected:
    -
    407 bool m_invert;
    -
    408 };
    -
    409
    -
    410 using space_cu = basic_space_cu<char>;
    -
    411 using wspace_cu = basic_space_cu<wchar_t>;
    -
    412#ifdef _UNICODE
    -
    413 using tspace_cu = wspace_cu;
    -
    414#else
    -
    415 using tspace_cu = space_cu;
    -
    416#endif
    -
    417
    -
    421 class sgml_space_cp : public basic_space_cu<char>
    -
    422 {
    -
    423 public:
    -
    424 sgml_space_cp(_In_ bool invert = false, _In_ const std::locale& locale = std::locale()) :
    -
    425 basic_space_cu<char>(invert, locale)
    -
    426 {}
    -
    427
    -
    428 virtual bool match(
    -
    429 _In_reads_or_z_(end) const char* text,
    -
    430 _In_ size_t start = 0,
    -
    431 _In_ size_t end = (size_t)-1,
    -
    432 _In_ int flags = match_default)
    -
    433 {
    -
    434 assert(text || start >= end);
    -
    435 if (start < end && text[start]) {
    -
    436 wchar_t buf[3];
    -
    437 const wchar_t* chr = next_sgml_cp(text, start, end, interval.end, buf);
    -
    438 const wchar_t* chr_end = chr + stdex::strlen(chr);
    -
    439 bool r =
    -
    440 ((flags & match_multiline) || !islbreak(chr, (size_t)-1)) &&
    -
    441 std::use_facet<std::ctype<wchar_t>>(m_locale).scan_not(std::ctype_base::space, chr, chr_end) == chr_end;
    -
    442 if (r && !m_invert || !r && m_invert) {
    -
    443 interval.start = start;
    -
    444 return true;
    -
    445 }
    -
    446 }
    -
    447
    -
    448 interval.start = (interval.end = start) + 1;
    -
    449 return false;
    -
    450 }
    -
    451 };
    -
    452
    -
    456 template <class T>
    -
    457 class basic_punct_cu : public basic_parser<T>
    -
    458 {
    -
    459 public:
    -
    460 basic_punct_cu(bool invert = false, _In_ const std::locale& locale = std::locale()) :
    -
    461 basic_parser<T>(locale),
    -
    462 m_invert(invert)
    -
    463 {}
    -
    464
    -
    465 virtual bool match(
    -
    466 _In_reads_or_z_(end) const T* text,
    -
    467 _In_ size_t start = 0,
    -
    468 _In_ size_t end = (size_t)-1,
    -
    469 _In_ int flags = match_default)
    -
    470 {
    -
    471 assert(text || start >= end);
    -
    472 if (start < end && text[start]) {
    -
    473 bool r = std::use_facet<std::ctype<T>>(m_locale).is(std::ctype_base::punct, text[start]);
    -
    474 if (r && !m_invert || !r && m_invert) {
    -
    475 interval.end = (interval.start = start) + 1;
    -
    476 return true;
    -
    477 }
    -
    478 }
    -
    479 interval.start = (interval.end = start) + 1;
    -
    480 return false;
    -
    481 }
    -
    482
    -
    483 protected:
    -
    484 bool m_invert;
    -
    485 };
    -
    486
    -
    487 using punct_cu = basic_punct_cu<char>;
    -
    488 using wpunct_cu = basic_punct_cu<wchar_t>;
    -
    489#ifdef _UNICODE
    -
    490 using tpunct_cu = wpunct_cu;
    -
    491#else
    -
    492 using tpunct_cu = punct_cu;
    -
    493#endif
    -
    494
    -
    498 class sgml_punct_cp : public basic_punct_cu<char>
    -
    499 {
    -
    500 public:
    -
    501 sgml_punct_cp(bool invert = false, _In_ const std::locale& locale = std::locale()) :
    -
    502 basic_punct_cu<char>(invert, locale)
    -
    503 {}
    -
    504
    -
    505 virtual bool match(
    -
    506 _In_reads_or_z_(end) const char* text,
    -
    507 _In_ size_t start = 0,
    -
    508 _In_ size_t end = (size_t)-1,
    -
    509 _In_ int flags = match_default)
    -
    510 {
    -
    511 assert(text || start >= end);
    -
    512 if (start < end && text[start]) {
    -
    513 wchar_t buf[3];
    -
    514 const wchar_t* chr = next_sgml_cp(text, start, end, interval.end, buf);
    -
    515 const wchar_t* chr_end = chr + stdex::strlen(chr);
    -
    516 bool r = std::use_facet<std::ctype<wchar_t>>(m_locale).scan_not(std::ctype_base::punct, chr, chr_end) == chr_end;
    -
    517 if (r && !m_invert || !r && m_invert) {
    -
    518 interval.start = start;
    -
    519 return true;
    -
    520 }
    -
    521 }
    -
    522 interval.start = (interval.end = start) + 1;
    -
    523 return false;
    -
    524 }
    -
    525 };
    -
    526
    -
    530 template <class T>
    -
    531 class basic_space_or_punct_cu : public basic_parser<T>
    -
    532 {
    -
    533 public:
    -
    534 basic_space_or_punct_cu(bool invert = false, _In_ const std::locale& locale = std::locale()) :
    -
    535 basic_parser<T>(locale),
    -
    536 m_invert(invert)
    -
    537 {}
    -
    538
    -
    539 virtual bool match(
    -
    540 _In_reads_or_z_(end) const T* text,
    -
    541 _In_ size_t start = 0,
    -
    542 _In_ size_t end = (size_t)-1,
    -
    543 _In_ int flags = match_default)
    -
    544 {
    -
    545 assert(text || start >= end);
    -
    546 if (start < end && text[start]) {
    -
    547 bool r =
    -
    548 ((flags & match_multiline) || !islbreak(text[start])) &&
    -
    549 std::use_facet<std::ctype<T>>(m_locale).is(std::ctype_base::space | std::ctype_base::punct, text[start]);
    -
    550 if (r && !m_invert || !r && m_invert) {
    -
    551 interval.end = (interval.start = start) + 1;
    -
    552 return true;
    -
    553 }
    -
    554 }
    -
    555 interval.start = (interval.end = start) + 1;
    -
    556 return false;
    -
    557 }
    -
    558
    -
    559 protected:
    -
    560 bool m_invert;
    -
    561 };
    -
    562
    -
    563 using space_or_punct_cu = basic_space_or_punct_cu<char>;
    -
    564 using wspace_or_punct_cu = basic_space_or_punct_cu<wchar_t>;
    -
    565#ifdef _UNICODE
    -
    566 using tspace_or_punct_cu = wspace_or_punct_cu;
    -
    567#else
    -
    568 using tspace_or_punct_cu = space_or_punct_cu;
    -
    569#endif
    -
    570
    -
    574 class sgml_space_or_punct_cp : public basic_space_or_punct_cu<char>
    -
    575 {
    -
    576 public:
    -
    577 sgml_space_or_punct_cp(bool invert = false, _In_ const std::locale& locale = std::locale()) :
    -
    578 basic_space_or_punct_cu<char>(invert, locale)
    -
    579 {}
    -
    580
    -
    581 virtual bool match(
    -
    582 _In_reads_or_z_(end) const char* text,
    -
    583 _In_ size_t start = 0,
    -
    584 _In_ size_t end = (size_t)-1,
    -
    585 _In_ int flags = match_default)
    -
    586 {
    -
    587 assert(text || start >= end);
    -
    588 if (start < end && text[start]) {
    -
    589 wchar_t buf[3];
    -
    590 const wchar_t* chr = next_sgml_cp(text, start, end, interval.end, buf);
    -
    591 const wchar_t* chr_end = chr + stdex::strlen(chr);
    -
    592 bool r =
    -
    593 ((flags & match_multiline) || !islbreak(chr, (size_t)-1)) &&
    -
    594 std::use_facet<std::ctype<wchar_t>>(m_locale).scan_not(std::ctype_base::space | std::ctype_base::punct, chr, chr_end) == chr_end;
    -
    595 if (r && !m_invert || !r && m_invert) {
    -
    596 interval.start = start;
    -
    597 return true;
    -
    598 }
    -
    599 }
    -
    600 interval.start = (interval.end = start) + 1;
    -
    601 return false;
    -
    602 }
    -
    603 };
    -
    604
    -
    608 template <class T>
    -
    609 class basic_bol : public basic_parser<T>
    -
    610 {
    -
    611 public:
    -
    612 basic_bol(bool invert = false) : m_invert(invert) {}
    -
    613
    -
    614 virtual bool match(
    -
    615 _In_reads_or_z_(end) const T* text,
    -
    616 _In_ size_t start = 0,
    -
    617 _In_ size_t end = (size_t)-1,
    -
    618 _In_ int flags = match_default)
    -
    619 {
    -
    620 assert(text || start >= end);
    -
    621 bool r = start == 0 || start <= end && islbreak(text[start - 1]);
    -
    622 if (r && !m_invert || !r && m_invert) {
    -
    623 interval.end = interval.start = start;
    -
    624 return true;
    -
    625 }
    -
    626 interval.start = (interval.end = start) + 1;
    -
    627 return false;
    -
    628 }
    -
    629
    -
    630 protected:
    -
    631 bool m_invert;
    -
    632 };
    -
    633
    -
    634 using bol = basic_bol<char>;
    -
    635 using wbol = basic_bol<wchar_t>;
    -
    636#ifdef _UNICODE
    -
    637 using tbol = wbol;
    -
    638#else
    -
    639 using tbol = bol;
    -
    640#endif
    -
    641 using sgml_bol = basic_bol<char>;
    -
    642
    -
    646 template <class T>
    -
    647 class basic_eol : public basic_parser<T>
    -
    648 {
    -
    649 public:
    -
    650 basic_eol(bool invert = false) : m_invert(invert) {}
    -
    651
    -
    652 virtual bool match(
    -
    653 _In_reads_or_z_(end) const T* text,
    -
    654 _In_ size_t start = 0,
    -
    655 _In_ size_t end = (size_t)-1,
    -
    656 _In_ int flags = match_default)
    -
    657 {
    -
    658 assert(text || start >= end);
    -
    659 bool r = islbreak(text[start]);
    -
    660 if (r && !m_invert || !r && m_invert) {
    -
    661 interval.end = interval.start = start;
    -
    662 return true;
    -
    663 }
    -
    664 interval.start = (interval.end = start) + 1;
    -
    665 return false;
    -
    666 }
    -
    667
    -
    668 protected:
    -
    669 bool m_invert;
    -
    670 };
    -
    671
    -
    672 using eol = basic_eol<char>;
    -
    673 using weol = basic_eol<wchar_t>;
    -
    674#ifdef _UNICODE
    -
    675 using teol = weol;
    -
    676#else
    -
    677 using teol = eol;
    -
    678#endif
    -
    679 using sgml_eol = basic_eol<char>;
    -
    680
    -
    681 template <class T>
    -
    682 class basic_set : public basic_parser<T>
    -
    683 {
    -
    684 public:
    -
    685 basic_set(bool invert = false, _In_ const std::locale& locale = std::locale()) :
    -
    686 basic_parser<T>(locale),
    -
    687 hit_offset((size_t)-1),
    -
    688 m_invert(invert)
    -
    689 {}
    -
    690
    -
    691 virtual bool match(
    -
    692 _In_reads_or_z_(end) const T* text,
    -
    693 _In_ size_t start = 0,
    -
    694 _In_ size_t end = (size_t)-1,
    -
    695 _In_ int flags = match_default) = 0;
    -
    696
    -
    697 virtual void invalidate()
    -
    698 {
    -
    699 hit_offset = (size_t)-1;
    -
    700 basic_parser<T>::invalidate();
    -
    701 }
    -
    702
    -
    703 public:
    -
    704 size_t hit_offset;
    -
    705
    -
    706 protected:
    -
    707 bool m_invert;
    -
    708 };
    -
    709
    -
    713 template <class T>
    -
    714 class basic_cu_set : public basic_set<T>
    -
    715 {
    -
    716 public:
    -
    717 basic_cu_set(
    -
    718 _In_reads_or_z_(count) const T* set,
    -
    719 _In_ size_t count = (size_t)-1,
    -
    720 _In_ bool invert = false,
    -
    721 _In_ const std::locale& locale = std::locale()) :
    -
    722 basic_set<T>(invert, locale)
    -
    723 {
    -
    724 if (set)
    -
    725 m_set.assign(set, set + stdex::strnlen(set, count));
    -
    726 }
    -
    727
    -
    728 virtual bool match(
    -
    729 _In_reads_or_z_(end) const T* text,
    -
    730 _In_ size_t start = 0,
    -
    731 _In_ size_t end = (size_t)-1,
    -
    732 _In_ int flags = match_default)
    -
    733 {
    -
    734 assert(text || start >= end);
    -
    735 if (start < end && text[start]) {
    -
    736 const T* set = m_set.c_str();
    -
    737 size_t r = (flags & match_case_insensitive) ?
    -
    738 stdex::strnichr(set, m_set.size(), text[start], m_locale) :
    -
    739 stdex::strnchr(set, m_set.size(), text[start]);
    -
    740 if (r != stdex::npos && !m_invert || r == stdex::npos && m_invert) {
    -
    741 hit_offset = r;
    -
    742 interval.end = (interval.start = start) + 1;
    -
    743 return true;
    -
    744 }
    -
    745 }
    -
    746 hit_offset = (size_t)-1;
    -
    747 interval.start = (interval.end = start) + 1;
    -
    748 return false;
    -
    749 }
    -
    750
    -
    751 protected:
    -
    752 std::basic_string<T> m_set;
    -
    753 };
    -
    754
    -
    755 using cu_set = basic_cu_set<char>;
    -
    756 using wcu_set = basic_cu_set<wchar_t>;
    -
    757#ifdef _UNICODE
    -
    758 using tcu_set = wcu_set;
    -
    759#else
    -
    760 using tcu_set = cu_set;
    -
    761#endif
    -
    762
    -
    766 class sgml_cp_set : public basic_set<char>
    -
    767 {
    -
    768 public:
    -
    769 sgml_cp_set(const char* set, size_t count = (size_t)-1, bool invert = false, _In_ const std::locale& locale = std::locale()) :
    -
    770 basic_set<char>(invert, locale)
    -
    771 {
    -
    772 if (set)
    -
    773 m_set = sgml2wstr(set, count);
    -
    774 }
    -
    775
    -
    776 virtual bool match(
    -
    777 _In_reads_or_z_(end) const char* text,
    -
    778 _In_ size_t start = 0,
    -
    779 _In_ size_t end = (size_t)-1,
    -
    780 _In_ int flags = match_default)
    -
    781 {
    -
    782 assert(text || start >= end);
    -
    783 if (start < end && text[start]) {
    -
    784 wchar_t buf[3];
    -
    785 const wchar_t* chr = next_sgml_cp(text, start, end, interval.end, buf);
    -
    786 const wchar_t* set = m_set.c_str();
    -
    787 size_t r = (flags & match_case_insensitive) ?
    -
    788 stdex::strnistr(set, m_set.size(), chr, m_locale) :
    -
    789 stdex::strnstr(set, m_set.size(), chr);
    -
    790 if (r != stdex::npos && !m_invert || r == stdex::npos && m_invert) {
    -
    791 hit_offset = r;
    -
    792 interval.start = start;
    -
    793 return true;
    -
    794 }
    -
    795 }
    -
    796 hit_offset = (size_t)-1;
    -
    797 interval.start = (interval.end = start) + 1;
    -
    798 return false;
    -
    799 }
    -
    800
    -
    801 protected:
    -
    802 std::wstring m_set;
    -
    803 };
    -
    804
    -
    808 template <class T>
    -
    809 class basic_string : public basic_parser<T>
    -
    810 {
    -
    811 public:
    -
    812 basic_string(
    -
    813 _In_reads_or_z_(count) const T* str,
    -
    814 _In_ size_t count = (size_t)-1,
    -
    815 _In_ const std::locale& locale = std::locale()) :
    -
    816 basic_parser<T>(locale),
    -
    817 m_str(str, str + stdex::strnlen(str, count))
    -
    818 {}
    -
    819
    -
    820 virtual bool match(
    -
    821 _In_reads_or_z_(end) const T* text,
    -
    822 _In_ size_t start = 0,
    -
    823 _In_ size_t end = (size_t)-1,
    -
    824 _In_ int flags = match_default)
    -
    825 {
    -
    826 assert(text || start >= end);
    -
    827 size_t
    -
    828 m = m_str.size(),
    -
    829 n = std::min<size_t>(end - start, m);
    -
    830 bool r = ((flags & match_case_insensitive) ?
    -
    831 stdex::strnicmp(text + start, n, m_str.c_str(), m, m_locale) :
    -
    832 stdex::strncmp(text + start, n, m_str.c_str(), m)) == 0;
    -
    833 if (r) {
    -
    834 interval.end = (interval.start = start) + n;
    -
    835 return true;
    -
    836 }
    -
    837 interval.start = (interval.end = start) + 1;
    -
    838 return false;
    -
    839 }
    -
    840
    -
    841 protected:
    -
    842 std::basic_string<T> m_str;
    -
    843 };
    -
    844
    -
    845 using string = basic_string<char>;
    -
    846 using wstring = basic_string<wchar_t>;
    -
    847#ifdef _UNICODE
    -
    848 using tstring = wstring;
    -
    849#else
    -
    850 using tstring = string;
    -
    851#endif
    -
    852
    -
    856 class sgml_string : public sgml_parser
    -
    857 {
    -
    858 public:
    -
    859 sgml_string(const char* str, size_t count = (size_t)-1, _In_ const std::locale& locale = std::locale()) :
    -
    860 sgml_parser(locale),
    -
    861 m_str(sgml2wstr(str, count))
    -
    862 {}
    -
    863
    -
    864 virtual bool match(
    -
    865 _In_reads_or_z_(end) const char* text,
    -
    866 _In_ size_t start = 0,
    -
    867 _In_ size_t end = (size_t)-1,
    -
    868 _In_ int flags = match_default)
    -
    869 {
    -
    870 assert(text || start >= end);
    -
    871 const wchar_t* str = m_str.c_str();
    -
    872 const bool case_insensitive = flags & match_case_insensitive ? true : false;
    -
    873 const auto& ctype = std::use_facet<std::ctype<wchar_t>>(m_locale);
    -
    874 for (interval.end = start;;) {
    -
    875 if (!*str) {
    -
    876 interval.start = start;
    -
    877 return true;
    -
    878 }
    -
    879 if (interval.end >= end || !text[interval.end]) {
    -
    880 interval.start = (interval.end = start) + 1;
    -
    881 return false;
    -
    882 }
    -
    883 wchar_t buf[3];
    -
    884 const wchar_t* chr = next_sgml_cp(text, interval.end, end, interval.end, buf);
    -
    885 for (; *chr; ++str, ++chr) {
    -
    886 if (!*str ||
    -
    887 (case_insensitive ? ctype.tolower(*str) != ctype.tolower(*chr) : *str != *chr))
    -
    888 {
    -
    889 interval.start = (interval.end = start) + 1;
    -
    890 return false;
    -
    891 }
    -
    892 }
    -
    893 }
    -
    894 }
    -
    895
    -
    896 protected:
    -
    897 std::wstring m_str;
    -
    898 };
    -
    899
    -
    903 template <class T>
    -
    904 class basic_iterations : public basic_parser<T>
    -
    905 {
    -
    906 public:
    -
    907 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) :
    -
    908 m_el(el),
    -
    909 m_min_iterations(min_iterations),
    -
    910 m_max_iterations(max_iterations),
    -
    911 m_greedy(greedy)
    -
    912 {}
    -
    913
    -
    914 virtual bool match(
    -
    915 _In_reads_or_z_(end) const T* text,
    -
    916 _In_ size_t start = 0,
    -
    917 _In_ size_t end = (size_t)-1,
    -
    918 _In_ int flags = match_default)
    -
    919 {
    -
    920 assert(text || start >= end);
    -
    921 interval.start = interval.end = start;
    -
    922 for (size_t i = 0; ; i++) {
    -
    923 if (!m_greedy && i >= m_min_iterations || i >= m_max_iterations)
    -
    924 return true;
    -
    925 if (!m_el->match(text, interval.end, end, flags)) {
    -
    926 if (i >= m_min_iterations)
    -
    927 return true;
    -
    928 break;
    -
    929 }
    -
    930 if (m_el->interval.end == interval.end) {
    -
    931 // Element did match, but the matching interval was empty. Quit instead of spinning.
    -
    932 return true;
    -
    933 }
    -
    934 interval.end = m_el->interval.end;
    -
    935 }
    -
    936 interval.start = (interval.end = start) + 1;
    -
    937 return false;
    -
    938 }
    -
    939
    -
    940 protected:
    -
    941 std::shared_ptr<basic_parser<T>> m_el;
    -
    942 size_t m_min_iterations;
    -
    943 size_t m_max_iterations;
    -
    944 bool m_greedy;
    -
    945 };
    -
    946
    -
    947 using iterations = basic_iterations<char>;
    -
    948 using witerations = basic_iterations<wchar_t>;
    -
    949#ifdef _UNICODE
    -
    950 using titerations = witerations;
    -
    951#else
    -
    952 using titerations = iterations;
    -
    953#endif
    -
    954 using sgml_iterations = basic_iterations<char>;
    -
    955
    -
    959 template <class T>
    -
    960 class parser_collection : public basic_parser<T>
    -
    961 {
    -
    962 protected:
    -
    963 parser_collection(_In_ const std::locale& locale) : basic_parser<T>(locale) {}
    -
    964
    -
    965 public:
    -
    966 parser_collection(
    -
    967 _In_count_(count) const std::shared_ptr<basic_parser<T>>* el,
    -
    968 _In_ size_t count,
    -
    969 _In_ const std::locale& locale = std::locale()) :
    -
    970 basic_parser<T>(locale)
    -
    971 {
    -
    972 assert(el || !count);
    -
    973 m_collection.reserve(count);
    -
    974 for (size_t i = 0; i < count; i++)
    -
    975 m_collection.push_back(el[i]);
    -
    976 }
    -
    977
    -
    978 parser_collection(
    -
    979 _Inout_ std::vector<std::shared_ptr<basic_parser<T>>>&& collection,
    -
    980 _In_ const std::locale& locale = std::locale()) :
    -
    981 basic_parser<T>(locale),
    -
    982 m_collection(std::move(collection))
    -
    983 {}
    -
    984
    -
    985 virtual void invalidate()
    -
    986 {
    -
    987 for (auto& el: m_collection)
    -
    988 el->invalidate();
    -
    989 basic_parser<T>::invalidate();
    -
    990 }
    -
    991
    -
    992 protected:
    -
    993 std::vector<std::shared_ptr<basic_parser<T>>> m_collection;
    -
    994 };
    -
    995
    -
    999 template <class T>
    -
    1000 class basic_sequence : public parser_collection<T>
    -
    1001 {
    -
    1002 public:
    -
    1003 basic_sequence(
    -
    1004 _In_count_(count) const std::shared_ptr<basic_parser<T>>* el = nullptr,
    -
    1005 _In_ size_t count = 0,
    -
    1006 _In_ const std::locale& locale = std::locale()) :
    -
    1007 parser_collection<T>(el, count, locale)
    -
    1008 {}
    -
    1009
    -
    1010 basic_sequence(
    -
    1011 _Inout_ std::vector<std::shared_ptr<basic_parser<T>>>&& collection,
    -
    1012 _In_ const std::locale& locale = std::locale()) :
    -
    1013 parser_collection<T>(std::move(collection), locale)
    -
    1014 {}
    -
    1015
    -
    1016 virtual bool match(
    -
    1017 _In_reads_or_z_(end) const T* text,
    -
    1018 _In_ size_t start = 0,
    -
    1019 _In_ size_t end = (size_t)-1,
    -
    1020 _In_ int flags = match_default)
    -
    1021 {
    -
    1022 assert(text || start >= end);
    -
    1023 interval.end = start;
    -
    1024 for (auto i = m_collection.begin(); i != m_collection.end(); ++i) {
    -
    1025 if (!(*i)->match(text, interval.end, end, flags)) {
    -
    1026 for (++i; i != m_collection.end(); ++i)
    -
    1027 (*i)->invalidate();
    -
    1028 interval.start = (interval.end = start) + 1;
    -
    1029 return false;
    -
    1030 }
    -
    1031 interval.end = (*i)->interval.end;
    -
    1032 }
    -
    1033 interval.start = start;
    -
    1034 return true;
    -
    1035 }
    -
    1036 };
    -
    1037
    -
    1038 using sequence = basic_sequence<char>;
    -
    1039 using wsequence = basic_sequence<wchar_t>;
    -
    1040#ifdef _UNICODE
    -
    1041 using tsequence = wsequence;
    -
    1042#else
    -
    1043 using tsequence = sequence;
    -
    1044#endif
    -
    1045 using sgml_sequence = basic_sequence<char>;
    -
    1046
    -
    1050 template <class T>
    -
    1051 class basic_branch : public parser_collection<T>
    -
    1052 {
    -
    1053 protected:
    -
    1054 basic_branch(_In_ const std::locale& locale) :
    -
    1055 parser_collection<T>(locale),
    -
    1056 hit_offset((size_t)-1)
    -
    1057 {}
    -
    1058
    -
    1059 public:
    -
    1060 basic_branch(
    -
    1061 _In_count_(count) const std::shared_ptr<basic_parser<T>>* el = nullptr,
    -
    1062 _In_ size_t count = 0,
    -
    1063 _In_ const std::locale& locale = std::locale()) :
    -
    1064 parser_collection<T>(el, count, locale),
    -
    1065 hit_offset((size_t)-1)
    -
    1066 {}
    -
    1067
    -
    1068 basic_branch(
    -
    1069 _Inout_ std::vector<std::shared_ptr<basic_parser<T>>>&& collection,
    -
    1070 _In_ const std::locale& locale = std::locale()) :
    -
    1071 parser_collection<T>(std::move(collection), locale),
    -
    1072 hit_offset((size_t)-1)
    -
    1073 {}
    -
    1074
    -
    1075 virtual bool match(
    -
    1076 _In_reads_or_z_(end) const T* text,
    -
    1077 _In_ size_t start = 0,
    -
    1078 _In_ size_t end = (size_t)-1,
    -
    1079 _In_ int flags = match_default)
    -
    1080 {
    -
    1081 assert(text || start >= end);
    -
    1082 hit_offset = 0;
    -
    1083 for (auto i = m_collection.begin(); i != m_collection.end(); ++i, ++hit_offset) {
    -
    1084 if ((*i)->match(text, start, end, flags)) {
    -
    1085 interval = (*i)->interval;
    -
    1086 for (++i; i != m_collection.end(); ++i)
    -
    1087 (*i)->invalidate();
    -
    1088 return true;
    -
    1089 }
    -
    1090 }
    -
    1091 hit_offset = (size_t)-1;
    -
    1092 interval.start = (interval.end = start) + 1;
    -
    1093 return false;
    -
    1094 }
    -
    1095
    -
    1096 virtual void invalidate()
    -
    1097 {
    -
    1098 hit_offset = (size_t)-1;
    -
    1099 parser_collection<T>::invalidate();
    -
    1100 }
    -
    1101
    -
    1102 public:
    -
    1103 size_t hit_offset;
    -
    1104 };
    -
    1105
    -
    1106 using branch = basic_branch<char>;
    -
    1107 using wbranch = basic_branch<wchar_t>;
    -
    1108#ifdef _UNICODE
    -
    1109 using tbranch = wbranch;
    -
    1110#else
    -
    1111 using tbranch = branch;
    -
    1112#endif
    -
    1113 using sgml_branch = basic_branch<char>;
    -
    1114
    -
    1118 template <class T, class T_parser = basic_string<T>>
    -
    1119 class basic_string_branch : public basic_branch<T>
    -
    1120 {
    -
    1121 public:
    -
    1122 inline basic_string_branch(
    -
    1123 _In_reads_(count) const T* str_z = nullptr,
    -
    1124 _In_ size_t count = 0,
    -
    1125 _In_ const std::locale& locale = std::locale()) :
    -
    1126 basic_branch<T>(locale)
    -
    1127 {
    -
    1128 build(str_z, count);
    -
    1129 }
    -
    1130
    -
    1131 inline basic_string_branch(_In_z_ const T* str, ...) :
    -
    1132 basic_branch<T>(std::locale())
    -
    1133 {
    -
    1134 va_list params;
    -
    1135 va_start(params, str);
    -
    1136 build(str, params);
    -
    1137 va_end(params);
    -
    1138 }
    -
    1139
    -
    1140 inline basic_string_branch(_In_ const std::locale& locale, _In_z_ const T* str, ...) :
    -
    1141 basic_branch<T>(locale)
    -
    1142 {
    -
    1143 va_list params;
    -
    1144 va_start(params, str);
    -
    1145 build(str, params);
    -
    1146 va_end(params);
    -
    1147 }
    -
    1148
    -
    1149 protected:
    -
    1150 void build(_In_reads_(count) const T* str_z, _In_ size_t count)
    -
    1151 {
    -
    1152 assert(str_z || !count);
    -
    1153 if (count) {
    -
    1154 size_t offset, n;
    -
    1155 for (
    -
    1156 offset = n = 0;
    -
    1157 offset < count && str_z[offset];
    -
    1158 offset += stdex::strnlen(str_z + offset, count - offset) + 1, ++n);
    -
    1159 m_collection.reserve(n);
    -
    1160 for (
    -
    1161 offset = 0;
    -
    1162 offset < count && str_z[offset];
    -
    1163 offset += stdex::strnlen(str_z + offset, count - offset) + 1)
    -
    1164 m_collection.push_back(std::move(std::make_shared<T_parser>(str_z + offset, count - offset, m_locale)));
    -
    1165 }
    -
    1166 }
    -
    1167
    -
    1168 void build(_In_z_ const T* str, _In_ va_list params)
    -
    1169 {
    -
    1170 const T* p;
    -
    1171 for (
    -
    1172 m_collection.push_back(std::move(std::make_shared<T_parser>(str, (size_t)-1, m_locale)));
    -
    1173 (p = va_arg(params, const T*)) != nullptr;
    -
    1174 m_collection.push_back(std::move(std::make_shared<T_parser>(p, (size_t)-1, m_locale))));
    -
    1175 }
    -
    1176 };
    -
    1177
    -
    1178 using string_branch = basic_string_branch<char>;
    -
    1179 using wstring_branch = basic_string_branch<wchar_t>;
    -
    1180#ifdef _UNICODE
    -
    1181 using tstring_branch = wstring_branch;
    -
    1182#else
    -
    1183 using tstring_branch = string_branch;
    -
    1184#endif
    -
    1185 using sgml_string_branch = basic_string_branch<char, sgml_string>;
    -
    1186
    -
    1190 template <class T>
    -
    1191 class basic_permutation : public parser_collection<T>
    -
    1192 {
    -
    1193 public:
    -
    1194 basic_permutation(
    -
    1195 _In_count_(count) const std::shared_ptr<basic_parser<T>>* el = nullptr,
    -
    1196 _In_ size_t count = 0,
    -
    1197 _In_ const std::locale& locale = std::locale()) :
    -
    1198 parser_collection<T>(el, count, locale)
    -
    1199 {}
    -
    1200
    -
    1201 basic_permutation(
    -
    1202 _Inout_ std::vector<std::shared_ptr<basic_parser<T>>>&& collection,
    -
    1203 _In_ const std::locale& locale = std::locale()) :
    -
    1204 parser_collection<T>(std::move(collection), locale)
    -
    1205 {}
    -
    1206
    -
    1207 virtual bool match(
    -
    1208 _In_reads_or_z_(end) const T* text,
    -
    1209 _In_ size_t start = 0,
    -
    1210 _In_ size_t end = (size_t)-1,
    -
    1211 _In_ int flags = match_default)
    -
    1212 {
    -
    1213 assert(text || start >= end);
    -
    1214 for (auto& el: m_collection)
    -
    1215 el->invalidate();
    -
    1216 if (match_recursively(text, start, end, flags)) {
    -
    1217 interval.start = start;
    -
    1218 return true;
    -
    1219 }
    -
    1220 interval.start = (interval.end = start) + 1;
    -
    1221 return false;
    -
    1222 }
    -
    1223
    -
    1224 protected:
    -
    1225 bool match_recursively(
    -
    1226 _In_reads_or_z_(end) const T* text,
    -
    1227 _In_ size_t start = 0,
    -
    1228 _In_ size_t end = (size_t)-1,
    -
    1229 _In_ int flags = match_default)
    -
    1230 {
    -
    1231 bool all_matched = true;
    -
    1232 for (auto& el: m_collection) {
    -
    1233 if (!el->interval) {
    -
    1234 // Element was not matched in permutatuion yet.
    -
    1235 all_matched = false;
    -
    1236 if (el->match(text, start, end, flags)) {
    -
    1237 // Element matched for the first time.
    -
    1238 if (match_recursively(text, el->interval.end, end, flags)) {
    -
    1239 // Rest of the elements matched too.
    -
    1240 return true;
    -
    1241 }
    -
    1242 el->invalidate();
    -
    1243 }
    -
    1244 }
    -
    1245 }
    -
    1246 if (all_matched) {
    -
    1247 interval.end = start;
    -
    1248 return true;
    -
    1249 }
    -
    1250 return false;
    -
    1251 }
    -
    1252 };
    -
    1253
    -
    1254 using permutation = basic_permutation<char>;
    -
    1255 using wpermutation = basic_permutation<wchar_t>;
    -
    1256#ifdef _UNICODE
    -
    1257 using tpermutation = wpermutation;
    -
    1258#else
    -
    1259 using tpermutation = permutation;
    -
    1260#endif
    -
    1261 using sgml_permutation = basic_permutation<char>;
    -
    1262
    -
    1266 template <class T>
    -
    1267 class basic_integer : public basic_parser<T>
    -
    1268 {
    -
    1269 public:
    -
    1270 basic_integer(_In_ const std::locale& locale = std::locale()) :
    -
    1271 basic_parser<T>(locale),
    -
    1272 value(0)
    -
    1273 {}
    -
    1274
    -
    1275 virtual void invalidate()
    -
    1276 {
    -
    1277 value = 0;
    -
    1278 basic_parser<T>::invalidate();
    -
    1279 }
    -
    1280
    -
    1281 public:
    -
    1282 size_t value;
    -
    1283 };
    -
    1284
    -
    1288 template <class T>
    -
    1289 class basic_integer10 : public basic_integer<T>
    -
    1290 {
    -
    1291 public:
    -
    1292 basic_integer10(
    -
    1293 _In_ const std::shared_ptr<basic_parser<T>>& digit_0,
    -
    1294 _In_ const std::shared_ptr<basic_parser<T>>& digit_1,
    -
    1295 _In_ const std::shared_ptr<basic_parser<T>>& digit_2,
    -
    1296 _In_ const std::shared_ptr<basic_parser<T>>& digit_3,
    -
    1297 _In_ const std::shared_ptr<basic_parser<T>>& digit_4,
    -
    1298 _In_ const std::shared_ptr<basic_parser<T>>& digit_5,
    -
    1299 _In_ const std::shared_ptr<basic_parser<T>>& digit_6,
    -
    1300 _In_ const std::shared_ptr<basic_parser<T>>& digit_7,
    -
    1301 _In_ const std::shared_ptr<basic_parser<T>>& digit_8,
    -
    1302 _In_ const std::shared_ptr<basic_parser<T>>& digit_9,
    -
    1303 _In_ const std::locale& locale = std::locale()) :
    -
    1304 basic_integer<T>(locale),
    -
    1305 m_digit_0(digit_0),
    -
    1306 m_digit_1(digit_1),
    -
    1307 m_digit_2(digit_2),
    -
    1308 m_digit_3(digit_3),
    -
    1309 m_digit_4(digit_4),
    -
    1310 m_digit_5(digit_5),
    -
    1311 m_digit_6(digit_6),
    -
    1312 m_digit_7(digit_7),
    -
    1313 m_digit_8(digit_8),
    -
    1314 m_digit_9(digit_9)
    -
    1315 {}
    -
    1316
    -
    1317 virtual bool match(
    -
    1318 _In_reads_or_z_(end) const T* text,
    -
    1319 _In_ size_t start = 0,
    -
    1320 _In_ size_t end = (size_t)-1,
    -
    1321 _In_ int flags = match_default)
    -
    1322 {
    -
    1323 assert(text || start >= end);
    -
    1324 for (interval.end = start, value = 0; interval.end < end && text[interval.end];) {
    -
    1325 size_t dig;
    -
    1326 if (m_digit_0->match(text, interval.end, end, flags)) { dig = 0; interval.end = m_digit_0->interval.end; }
    -
    1327 else if (m_digit_1->match(text, interval.end, end, flags)) { dig = 1; interval.end = m_digit_1->interval.end; }
    -
    1328 else if (m_digit_2->match(text, interval.end, end, flags)) { dig = 2; interval.end = m_digit_2->interval.end; }
    -
    1329 else if (m_digit_3->match(text, interval.end, end, flags)) { dig = 3; interval.end = m_digit_3->interval.end; }
    -
    1330 else if (m_digit_4->match(text, interval.end, end, flags)) { dig = 4; interval.end = m_digit_4->interval.end; }
    -
    1331 else if (m_digit_5->match(text, interval.end, end, flags)) { dig = 5; interval.end = m_digit_5->interval.end; }
    -
    1332 else if (m_digit_6->match(text, interval.end, end, flags)) { dig = 6; interval.end = m_digit_6->interval.end; }
    -
    1333 else if (m_digit_7->match(text, interval.end, end, flags)) { dig = 7; interval.end = m_digit_7->interval.end; }
    -
    1334 else if (m_digit_8->match(text, interval.end, end, flags)) { dig = 8; interval.end = m_digit_8->interval.end; }
    -
    1335 else if (m_digit_9->match(text, interval.end, end, flags)) { dig = 9; interval.end = m_digit_9->interval.end; }
    -
    1336 else break;
    -
    1337 value = value * 10 + dig;
    -
    1338 }
    -
    1339 if (start < interval.end) {
    -
    1340 interval.start = start;
    -
    1341 return true;
    -
    1342 }
    -
    1343 interval.start = (interval.end = start) + 1;
    -
    1344 return false;
    -
    1345 }
    -
    1346
    -
    1347 protected:
    -
    1348 std::shared_ptr<basic_parser<T>>
    -
    1349 m_digit_0,
    -
    1350 m_digit_1,
    -
    1351 m_digit_2,
    -
    1352 m_digit_3,
    -
    1353 m_digit_4,
    -
    1354 m_digit_5,
    -
    1355 m_digit_6,
    -
    1356 m_digit_7,
    -
    1357 m_digit_8,
    -
    1358 m_digit_9;
    -
    1359 };
    -
    1360
    -
    1361 using integer10 = basic_integer10<char>;
    -
    1362 using winteger10 = basic_integer10<wchar_t>;
    -
    1363#ifdef _UNICODE
    -
    1364 using tinteger10 = winteger10;
    -
    1365#else
    -
    1366 using tinteger10 = integer10;
    -
    1367#endif
    -
    1368 using sgml_integer10 = basic_integer10<char>;
    -
    1369
    -
    1373 template <class T>
    -
    1374 class basic_integer10ts : public basic_integer<T>
    -
    1375 {
    -
    1376 public:
    -
    1377 basic_integer10ts(
    -
    1378 _In_ const std::shared_ptr<basic_integer10<T>>& digits,
    -
    1379 _In_ const std::shared_ptr<basic_set<T>>& separator,
    -
    1380 _In_ const std::locale& locale = std::locale()) :
    -
    1381 basic_integer<T>(locale),
    -
    1382 digit_count(0),
    -
    1383 has_separators(false),
    -
    1384 m_digits(digits),
    -
    1385 m_separator(separator)
    -
    1386 {}
    -
    1387
    -
    1388 virtual bool match(
    -
    1389 _In_reads_or_z_(end) const T* text,
    -
    1390 _In_ size_t start = 0,
    -
    1391 _In_ size_t end = (size_t)-1,
    -
    1392 _In_ int flags = match_default)
    -
    1393 {
    -
    1394 assert(text || start >= end);
    -
    1395 if (m_digits->match(text, start, end, flags)) {
    -
    1396 // Leading part match.
    -
    1397 value = m_digits->value;
    -
    1398 digit_count = m_digits->interval.size();
    -
    1399 has_separators = false;
    -
    1400 interval.start = start;
    -
    1401 interval.end = m_digits->interval.end;
    -
    1402 if (m_digits->interval.size() <= 3) {
    -
    1403 // Maybe separated with thousand separators?
    -
    1404 size_t hit_offset = (size_t)-1;
    -
    1405 while (m_separator->match(text, interval.end, end, flags) &&
    -
    1406 (hit_offset == (size_t)-1 || hit_offset == m_separator->hit_offset) && // All separators must be the same, no mixing.
    -
    1407 m_digits->match(text, m_separator->interval.end, end, flags) &&
    -
    1408 m_digits->interval.size() == 3)
    -
    1409 {
    -
    1410 // Thousand separator and three-digit integer followed.
    -
    1411 value = value * 1000 + m_digits->value;
    -
    1412 digit_count += 3;
    -
    1413 has_separators = true;
    -
    1414 interval.end = m_digits->interval.end;
    -
    1415 hit_offset = m_separator->hit_offset;
    -
    1416 }
    -
    1417 }
    -
    1418
    -
    1419 return true;
    -
    1420 }
    -
    1421 value = 0;
    -
    1422 interval.start = (interval.end = start) + 1;
    -
    1423 return false;
    -
    1424 }
    -
    1425
    -
    1426 virtual void invalidate()
    -
    1427 {
    -
    1428 digit_count = 0;
    -
    1429 has_separators = false;
    -
    1430 basic_integer<T>::invalidate();
    -
    1431 }
    -
    1432
    -
    1433 public:
    -
    1434 size_t digit_count;
    -
    1435 bool has_separators;
    -
    1436
    -
    1437 protected:
    -
    1438 std::shared_ptr<basic_integer10<T>> m_digits;
    -
    1439 std::shared_ptr<basic_set<T>> m_separator;
    -
    1440 };
    -
    1441
    -
    1442 using integer10ts = basic_integer10ts<char>;
    -
    1443 using winteger10ts = basic_integer10ts<wchar_t>;
    -
    1444#ifdef _UNICODE
    -
    1445 using tinteger10ts = winteger10ts;
    -
    1446#else
    -
    1447 using tinteger10ts = integer10ts;
    -
    1448#endif
    -
    1449 using sgml_integer10ts = basic_integer10ts<char>;
    -
    1450
    -
    1454 template <class T>
    -
    1455 class basic_integer16 : public basic_integer<T>
    -
    1456 {
    -
    1457 public:
    -
    1458 basic_integer16(
    -
    1459 _In_ const std::shared_ptr<basic_parser<T>>& digit_0,
    -
    1460 _In_ const std::shared_ptr<basic_parser<T>>& digit_1,
    -
    1461 _In_ const std::shared_ptr<basic_parser<T>>& digit_2,
    -
    1462 _In_ const std::shared_ptr<basic_parser<T>>& digit_3,
    -
    1463 _In_ const std::shared_ptr<basic_parser<T>>& digit_4,
    -
    1464 _In_ const std::shared_ptr<basic_parser<T>>& digit_5,
    -
    1465 _In_ const std::shared_ptr<basic_parser<T>>& digit_6,
    -
    1466 _In_ const std::shared_ptr<basic_parser<T>>& digit_7,
    -
    1467 _In_ const std::shared_ptr<basic_parser<T>>& digit_8,
    -
    1468 _In_ const std::shared_ptr<basic_parser<T>>& digit_9,
    -
    1469 _In_ const std::shared_ptr<basic_parser<T>>& digit_10,
    -
    1470 _In_ const std::shared_ptr<basic_parser<T>>& digit_11,
    -
    1471 _In_ const std::shared_ptr<basic_parser<T>>& digit_12,
    -
    1472 _In_ const std::shared_ptr<basic_parser<T>>& digit_13,
    -
    1473 _In_ const std::shared_ptr<basic_parser<T>>& digit_14,
    -
    1474 _In_ const std::shared_ptr<basic_parser<T>>& digit_15,
    -
    1475 _In_ const std::locale& locale = std::locale()) :
    -
    1476 basic_integer<T>(locale),
    -
    1477 m_digit_0(digit_0),
    -
    1478 m_digit_1(digit_1),
    -
    1479 m_digit_2(digit_2),
    -
    1480 m_digit_3(digit_3),
    -
    1481 m_digit_4(digit_4),
    -
    1482 m_digit_5(digit_5),
    -
    1483 m_digit_6(digit_6),
    -
    1484 m_digit_7(digit_7),
    -
    1485 m_digit_8(digit_8),
    -
    1486 m_digit_9(digit_9),
    -
    1487 m_digit_10(digit_10),
    -
    1488 m_digit_11(digit_11),
    -
    1489 m_digit_12(digit_12),
    -
    1490 m_digit_13(digit_13),
    -
    1491 m_digit_14(digit_14),
    -
    1492 m_digit_15(digit_15)
    -
    1493 {}
    -
    1494
    -
    1495 virtual bool match(
    -
    1496 _In_reads_or_z_(end) const T* text,
    -
    1497 _In_ size_t start = 0,
    -
    1498 _In_ size_t end = (size_t)-1,
    -
    1499 _In_ int flags = match_default)
    -
    1500 {
    -
    1501 assert(text || start >= end);
    -
    1502 for (interval.end = start, value = 0; interval.end < end && text[interval.end];) {
    -
    1503 size_t dig;
    -
    1504 if (m_digit_0->match(text, interval.end, end, flags)) { dig = 0; interval.end = m_digit_0->interval.end; }
    -
    1505 else if (m_digit_1->match(text, interval.end, end, flags)) { dig = 1; interval.end = m_digit_1->interval.end; }
    -
    1506 else if (m_digit_2->match(text, interval.end, end, flags)) { dig = 2; interval.end = m_digit_2->interval.end; }
    -
    1507 else if (m_digit_3->match(text, interval.end, end, flags)) { dig = 3; interval.end = m_digit_3->interval.end; }
    -
    1508 else if (m_digit_4->match(text, interval.end, end, flags)) { dig = 4; interval.end = m_digit_4->interval.end; }
    -
    1509 else if (m_digit_5->match(text, interval.end, end, flags)) { dig = 5; interval.end = m_digit_5->interval.end; }
    -
    1510 else if (m_digit_6->match(text, interval.end, end, flags)) { dig = 6; interval.end = m_digit_6->interval.end; }
    -
    1511 else if (m_digit_7->match(text, interval.end, end, flags)) { dig = 7; interval.end = m_digit_7->interval.end; }
    -
    1512 else if (m_digit_8->match(text, interval.end, end, flags)) { dig = 8; interval.end = m_digit_8->interval.end; }
    -
    1513 else if (m_digit_9->match(text, interval.end, end, flags)) { dig = 9; interval.end = m_digit_9->interval.end; }
    -
    1514 else if (m_digit_10->match(text, interval.end, end, flags)) { dig = 10; interval.end = m_digit_10->interval.end; }
    -
    1515 else if (m_digit_11->match(text, interval.end, end, flags)) { dig = 11; interval.end = m_digit_11->interval.end; }
    -
    1516 else if (m_digit_12->match(text, interval.end, end, flags)) { dig = 12; interval.end = m_digit_12->interval.end; }
    -
    1517 else if (m_digit_13->match(text, interval.end, end, flags)) { dig = 13; interval.end = m_digit_13->interval.end; }
    -
    1518 else if (m_digit_14->match(text, interval.end, end, flags)) { dig = 14; interval.end = m_digit_14->interval.end; }
    -
    1519 else if (m_digit_15->match(text, interval.end, end, flags)) { dig = 15; interval.end = m_digit_15->interval.end; }
    -
    1520 else break;
    -
    1521 value = value * 16 + dig;
    -
    1522 }
    -
    1523 if (start < interval.end) {
    -
    1524 interval.start = start;
    -
    1525 return true;
    -
    1526 }
    -
    1527 interval.start = (interval.end = start) + 1;
    -
    1528 return false;
    -
    1529 }
    -
    1530
    -
    1531 protected:
    -
    1532 std::shared_ptr<basic_parser<T>>
    -
    1533 m_digit_0,
    -
    1534 m_digit_1,
    -
    1535 m_digit_2,
    -
    1536 m_digit_3,
    -
    1537 m_digit_4,
    -
    1538 m_digit_5,
    -
    1539 m_digit_6,
    -
    1540 m_digit_7,
    -
    1541 m_digit_8,
    -
    1542 m_digit_9,
    -
    1543 m_digit_10,
    -
    1544 m_digit_11,
    -
    1545 m_digit_12,
    -
    1546 m_digit_13,
    -
    1547 m_digit_14,
    -
    1548 m_digit_15;
    -
    1549 };
    -
    1550
    -
    1551 using integer16 = basic_integer16<char>;
    -
    1552 using winteger16 = basic_integer16<wchar_t>;
    -
    1553#ifdef _UNICODE
    -
    1554 using tinteger16 = winteger16;
    -
    1555#else
    -
    1556 using tinteger16 = integer16;
    -
    1557#endif
    -
    1558 using sgml_integer16 = basic_integer16<char>;
    -
    1559
    -
    1563 template <class T>
    -
    1564 class basic_roman_numeral : public basic_integer<T>
    -
    1565 {
    -
    1566 public:
    -
    1567 basic_roman_numeral(
    -
    1568 _In_ const std::shared_ptr<basic_parser<T>>& digit_1,
    -
    1569 _In_ const std::shared_ptr<basic_parser<T>>& digit_5,
    -
    1570 _In_ const std::shared_ptr<basic_parser<T>>& digit_10,
    -
    1571 _In_ const std::shared_ptr<basic_parser<T>>& digit_50,
    -
    1572 _In_ const std::shared_ptr<basic_parser<T>>& digit_100,
    -
    1573 _In_ const std::shared_ptr<basic_parser<T>>& digit_500,
    -
    1574 _In_ const std::shared_ptr<basic_parser<T>>& digit_1000,
    -
    1575 _In_ const std::shared_ptr<basic_parser<T>>& digit_5000,
    -
    1576 _In_ const std::shared_ptr<basic_parser<T>>& digit_10000,
    -
    1577 _In_ const std::locale& locale = std::locale()) :
    -
    1578 basic_integer<T>(locale),
    -
    1579 m_digit_1(digit_1),
    -
    1580 m_digit_5(digit_5),
    -
    1581 m_digit_10(digit_10),
    -
    1582 m_digit_50(digit_50),
    -
    1583 m_digit_100(digit_100),
    -
    1584 m_digit_500(digit_500),
    -
    1585 m_digit_1000(digit_1000),
    -
    1586 m_digit_5000(digit_5000),
    -
    1587 m_digit_10000(digit_10000)
    -
    1588 {}
    -
    1589
    -
    1590 virtual bool match(
    -
    1591 _In_reads_or_z_(end) const T* text,
    -
    1592 _In_ size_t start = 0,
    -
    1593 _In_ size_t end = (size_t)-1,
    -
    1594 _In_ int flags = match_default)
    -
    1595 {
    -
    1596 assert(text || start >= end);
    -
    1597 size_t
    -
    1598 dig[5] = { (size_t)-1, (size_t)-1, (size_t)-1, (size_t)-1, (size_t)-1 },
    -
    1599 end2;
    -
    1600
    -
    1601 for (interval.end = start, value = 0; interval.end < end && text[interval.end]; dig[3] = dig[2], dig[2] = dig[1], dig[1] = dig[0], interval.end = end2) {
    -
    1602 if (m_digit_1 && m_digit_1->match(text, interval.end, end, flags)) { dig[0] = 1; end2 = m_digit_1->interval.end; }
    -
    1603 else if (m_digit_5 && m_digit_5->match(text, interval.end, end, flags)) { dig[0] = 5; end2 = m_digit_5->interval.end; }
    -
    1604 else if (m_digit_10 && m_digit_10->match(text, interval.end, end, flags)) { dig[0] = 10; end2 = m_digit_10->interval.end; }
    -
    1605 else if (m_digit_50 && m_digit_50->match(text, interval.end, end, flags)) { dig[0] = 50; end2 = m_digit_50->interval.end; }
    -
    1606 else if (m_digit_100 && m_digit_100->match(text, interval.end, end, flags)) { dig[0] = 100; end2 = m_digit_100->interval.end; }
    -
    1607 else if (m_digit_500 && m_digit_500->match(text, interval.end, end, flags)) { dig[0] = 500; end2 = m_digit_500->interval.end; }
    -
    1608 else if (m_digit_1000 && m_digit_1000->match(text, interval.end, end, flags)) { dig[0] = 1000; end2 = m_digit_1000->interval.end; }
    -
    1609 else if (m_digit_5000 && m_digit_5000->match(text, interval.end, end, flags)) { dig[0] = 5000; end2 = m_digit_5000->interval.end; }
    -
    1610 else if (m_digit_10000 && m_digit_10000->match(text, interval.end, end, flags)) { dig[0] = 10000; end2 = m_digit_10000->interval.end; }
    -
    1611 else break;
    -
    1612
    -
    1613 // Store first digit.
    -
    1614 if (dig[4] == (size_t)-1) dig[4] = dig[0];
    -
    1615
    -
    1616 if (dig[3] == dig[2] && dig[2] == dig[1] && dig[1] == dig[0] && dig[0] != dig[4]) {
    -
    1617 // Same digit repeated four times. No-go, unless first digit. E.g. XIIII vs. XIV. MMMMMCD allowed, IIII also...
    -
    1618 break;
    -
    1619 }
    -
    1620 if (dig[0] <= dig[1]) {
    -
    1621 // Digit is less or equal previous one: add.
    -
    1622 value += dig[0];
    -
    1623 }
    -
    1624 else if (
    -
    1625 dig[1] == 1 && (dig[0] == 5 || dig[0] == 10) ||
    -
    1626 dig[1] == 10 && (dig[0] == 50 || dig[0] == 100) ||
    -
    1627 dig[1] == 100 && (dig[0] == 500 || dig[0] == 1000) ||
    -
    1628 dig[1] == 1000 && (dig[0] == 5000 || dig[0] == 10000))
    -
    1629 {
    -
    1630 // Digit is up to two orders bigger than previous one: subtract. But...
    -
    1631 if (dig[2] < dig[0]) {
    -
    1632 // Digit is also bigger than pre-previous one. E.g. VIX (V < X => invalid)
    -
    1633 break;
    -
    1634 }
    -
    1635 value -= dig[1]; // Cancel addition in the previous step.
    -
    1636 dig[0] -= dig[1]; // Combine last two digits.
    -
    1637 dig[1] = dig[2]; // The true previous digit is now pre-previous one. :)
    -
    1638 dig[2] = dig[3]; // The true pre-previous digit is now pre-pre-previous one. :)
    -
    1639 value += dig[0]; // Add combined value.
    -
    1640 }
    -
    1641 else {
    -
    1642 // New digit is too big than the previous one. E.g. VX (V < X => invalid)
    -
    1643 break;
    -
    1644 }
    -
    1645 }
    -
    1646 if (value) {
    -
    1647 interval.start = start;
    -
    1648 return true;
    -
    1649 }
    -
    1650 interval.start = (interval.end = start) + 1;
    -
    1651 return false;
    -
    1652 }
    -
    1653
    -
    1654 protected:
    -
    1655 std::shared_ptr<basic_parser<T>>
    -
    1656 m_digit_1,
    -
    1657 m_digit_5,
    -
    1658 m_digit_10,
    -
    1659 m_digit_50,
    -
    1660 m_digit_100,
    -
    1661 m_digit_500,
    -
    1662 m_digit_1000,
    -
    1663 m_digit_5000,
    -
    1664 m_digit_10000;
    -
    1665 };
    -
    1666
    -
    1667 using roman_numeral = basic_roman_numeral<char>;
    -
    1668 using wroman_numeral = basic_roman_numeral<wchar_t>;
    -
    1669#ifdef _UNICODE
    -
    1670 using troman_numeral = wroman_numeral;
    -
    1671#else
    -
    1672 using troman_numeral = roman_numeral;
    -
    1673#endif
    -
    1674 using sgml_roman_numeral = basic_roman_numeral<char>;
    -
    1675
    -
    1679 template <class T>
    -
    1680 class basic_fraction : public basic_parser<T>
    -
    1681 {
    -
    1682 public:
    -
    1683 basic_fraction(
    -
    1684 _In_ const std::shared_ptr<basic_parser<T>>& _numerator,
    -
    1685 _In_ const std::shared_ptr<basic_parser<T>>& _fraction_line,
    -
    1686 _In_ const std::shared_ptr<basic_parser<T>>& _denominator,
    -
    1687 _In_ const std::locale& locale = std::locale()) :
    -
    1688 basic_parser<T>(locale),
    -
    1689 numerator(_numerator),
    -
    1690 fraction_line(_fraction_line),
    -
    1691 denominator(_denominator)
    -
    1692 {}
    -
    1693
    -
    1694 virtual bool match(
    -
    1695 _In_reads_or_z_(end) const T* text,
    -
    1696 _In_ size_t start = 0,
    -
    1697 _In_ size_t end = (size_t)-1,
    -
    1698 _In_ int flags = match_default)
    -
    1699 {
    -
    1700 assert(text || start >= end);
    -
    1701 if (numerator->match(text, start, end, flags) &&
    -
    1702 fraction_line->match(text, numerator->interval.end, end, flags) &&
    -
    1703 denominator->match(text, fraction_line->interval.end, end, flags))
    -
    1704 {
    -
    1705 interval.start = start;
    -
    1706 interval.end = denominator->interval.end;
    -
    1707 return true;
    -
    1708 }
    -
    1709 numerator->invalidate();
    -
    1710 fraction_line->invalidate();
    -
    1711 denominator->invalidate();
    -
    1712 interval.start = (interval.end = start) + 1;
    -
    1713 return false;
    -
    1714 }
    -
    1715
    -
    1716 virtual void invalidate()
    -
    1717 {
    -
    1718 numerator->invalidate();
    -
    1719 fraction_line->invalidate();
    -
    1720 denominator->invalidate();
    -
    1721 basic_parser<T>::invalidate();
    -
    1722 }
    -
    1723
    -
    1724 public:
    -
    1725 std::shared_ptr<basic_parser<T>> numerator;
    -
    1726 std::shared_ptr<basic_parser<T>> fraction_line;
    -
    1727 std::shared_ptr<basic_parser<T>> denominator;
    -
    1728 };
    -
    1729
    -
    1730 using fraction = basic_fraction<char>;
    -
    1731 using wfraction = basic_fraction<wchar_t>;
    -
    1732#ifdef _UNICODE
    -
    1733 using tfraction = wfraction;
    -
    1734#else
    -
    1735 using tfraction = fraction;
    -
    1736#endif
    -
    1737 using sgml_fraction = basic_fraction<char>;
    -
    1738
    -
    1742 template <class T>
    -
    1743 class basic_score : public basic_parser<T>
    -
    1744 {
    -
    1745 public:
    -
    1746 basic_score(
    -
    1747 _In_ const std::shared_ptr<basic_parser<T>>& _home,
    -
    1748 _In_ const std::shared_ptr<basic_parser<T>>& _separator,
    -
    1749 _In_ const std::shared_ptr<basic_parser<T>>& _guest,
    -
    1750 _In_ const std::shared_ptr<basic_parser<T>>& space,
    -
    1751 _In_ const std::locale& locale = std::locale()) :
    -
    1752 basic_parser<T>(locale),
    -
    1753 home(_home),
    -
    1754 separator(_separator),
    -
    1755 guest(_guest),
    -
    1756 m_space(space)
    -
    1757 {}
    -
    1758
    -
    1759 virtual bool match(
    -
    1760 _In_reads_or_z_(end) const T* text,
    -
    1761 _In_ size_t start = 0,
    -
    1762 _In_ size_t end = (size_t)-1,
    -
    1763 _In_ int flags = match_default)
    -
    1764 {
    -
    1765 assert(text || start >= end);
    -
    1766 interval.end = start;
    -
    1767
    -
    1768 if (home->match(text, interval.end, end, flags))
    -
    1769 interval.end = home->interval.end;
    -
    1770 else
    -
    1771 goto end;
    -
    1772
    -
    1773 const int space_match_flags = flags & ~match_multiline; // Spaces in score must never be broken in new line.
    -
    1774 for (; m_space->match(text, interval.end, end, space_match_flags); interval.end = m_space->interval.end);
    -
    1775
    -
    1776 if (separator->match(text, interval.end, end, flags))
    -
    1777 interval.end = separator->interval.end;
    -
    1778 else
    -
    1779 goto end;
    -
    1780
    -
    1781 for (; m_space->match(text, interval.end, end, space_match_flags); interval.end = m_space->interval.end);
    -
    1782
    -
    1783 if (guest->match(text, interval.end, end, flags))
    -
    1784 interval.end = guest->interval.end;
    -
    1785 else
    -
    1786 goto end;
    -
    1787
    -
    1788 interval.start = start;
    -
    1789 return true;
    -
    1790
    -
    1791 end:
    -
    1792 home->invalidate();
    -
    1793 separator->invalidate();
    -
    1794 guest->invalidate();
    -
    1795 interval.start = (interval.end = start) + 1;
    -
    1796 return false;
    -
    1797 }
    -
    1798
    -
    1799 virtual void invalidate()
    -
    1800 {
    -
    1801 home->invalidate();
    -
    1802 separator->invalidate();
    -
    1803 guest->invalidate();
    -
    1804 basic_parser<T>::invalidate();
    -
    1805 }
    -
    1806
    -
    1807 public:
    -
    1808 std::shared_ptr<basic_parser<T>> home;
    -
    1809 std::shared_ptr<basic_parser<T>> separator;
    -
    1810 std::shared_ptr<basic_parser<T>> guest;
    -
    1811
    -
    1812 protected:
    -
    1813 std::shared_ptr<basic_parser<T>> m_space;
    -
    1814 };
    -
    1815
    -
    1816 using score = basic_score<char>;
    -
    1817 using wscore = basic_score<wchar_t>;
    -
    1818#ifdef _UNICODE
    -
    1819 using tscore = wscore;
    -
    1820#else
    -
    1821 using tscore = score;
    -
    1822#endif
    -
    1823 using sgml_score = basic_score<char>;
    -
    1824
    -
    1828 template <class T>
    -
    1829 class basic_signed_numeral : public basic_parser<T>
    -
    1830 {
    -
    1831 public:
    -
    1832 basic_signed_numeral(
    -
    1833 _In_ const std::shared_ptr<basic_parser<T>>& _positive_sign,
    -
    1834 _In_ const std::shared_ptr<basic_parser<T>>& _negative_sign,
    -
    1835 _In_ const std::shared_ptr<basic_parser<T>>& _special_sign,
    -
    1836 _In_ const std::shared_ptr<basic_parser<T>>& _number,
    -
    1837 _In_ const std::locale& locale = std::locale()) :
    -
    1838 basic_parser<T>(locale),
    -
    1839 positive_sign(_positive_sign),
    -
    1840 negative_sign(_negative_sign),
    -
    1841 special_sign(_special_sign),
    -
    1842 number(_number)
    -
    1843 {}
    -
    1844
    -
    1845 virtual bool match(
    -
    1846 _In_reads_or_z_(end) const T* text,
    -
    1847 _In_ size_t start = 0,
    -
    1848 _In_ size_t end = (size_t)-1,
    -
    1849 _In_ int flags = match_default)
    -
    1850 {
    -
    1851 assert(text || start >= end);
    -
    1852 interval.end = start;
    -
    1853 if (positive_sign && positive_sign->match(text, interval.end, end, flags)) {
    -
    1854 interval.end = positive_sign->interval.end;
    -
    1855 if (negative_sign) negative_sign->invalidate();
    -
    1856 if (special_sign) special_sign->invalidate();
    -
    1857 }
    -
    1858 else if (negative_sign && negative_sign->match(text, interval.end, end, flags)) {
    -
    1859 interval.end = negative_sign->interval.end;
    -
    1860 if (positive_sign) positive_sign->invalidate();
    -
    1861 if (special_sign) special_sign->invalidate();
    -
    1862 }
    -
    1863 else if (special_sign && special_sign->match(text, interval.end, end, flags)) {
    -
    1864 interval.end = special_sign->interval.end;
    -
    1865 if (positive_sign) positive_sign->invalidate();
    -
    1866 if (negative_sign) negative_sign->invalidate();
    -
    1867 }
    -
    1868 else {
    -
    1869 if (positive_sign) positive_sign->invalidate();
    -
    1870 if (negative_sign) negative_sign->invalidate();
    -
    1871 if (special_sign) special_sign->invalidate();
    -
    1872 }
    -
    1873 if (number->match(text, interval.end, end, flags)) {
    -
    1874 interval.start = start;
    -
    1875 interval.end = number->interval.end;
    -
    1876 return true;
    -
    1877 }
    -
    1878 if (positive_sign) positive_sign->invalidate();
    -
    1879 if (negative_sign) negative_sign->invalidate();
    -
    1880 if (special_sign) special_sign->invalidate();
    -
    1881 number->invalidate();
    -
    1882 interval.start = (interval.end = start) + 1;
    -
    1883 return false;
    -
    1884 }
    -
    1885
    -
    1886 virtual void invalidate()
    -
    1887 {
    -
    1888 if (positive_sign) positive_sign->invalidate();
    -
    1889 if (negative_sign) negative_sign->invalidate();
    -
    1890 if (special_sign) special_sign->invalidate();
    -
    1891 number->invalidate();
    -
    1892 basic_parser<T>::invalidate();
    -
    1893 }
    -
    1894
    -
    1895 public:
    -
    1896 std::shared_ptr<basic_parser<T>> positive_sign;
    -
    1897 std::shared_ptr<basic_parser<T>> negative_sign;
    -
    1898 std::shared_ptr<basic_parser<T>> special_sign;
    -
    1899 std::shared_ptr<basic_parser<T>> number;
    -
    1900 };
    -
    1901
    -
    1902 using signed_numeral = basic_signed_numeral<char>;
    -
    1903 using wsigned_numeral = basic_signed_numeral<wchar_t>;
    -
    1904#ifdef _UNICODE
    -
    1905 using tsigned_numeral = wsigned_numeral;
    -
    1906#else
    -
    1907 using tsigned_numeral = signed_numeral;
    -
    1908#endif
    -
    1909 using sgml_signed_numeral = basic_signed_numeral<char>;
    -
    1910
    -
    1914 template <class T>
    -
    1915 class basic_mixed_numeral : public basic_parser<T>
    -
    1916 {
    -
    1917 public:
    -
    1918 basic_mixed_numeral(
    -
    1919 _In_ const std::shared_ptr<basic_parser<T>>& _positive_sign,
    -
    1920 _In_ const std::shared_ptr<basic_parser<T>>& _negative_sign,
    -
    1921 _In_ const std::shared_ptr<basic_parser<T>>& _special_sign,
    -
    1922 _In_ const std::shared_ptr<basic_parser<T>>& _integer,
    -
    1923 _In_ const std::shared_ptr<basic_parser<T>>& space,
    -
    1924 _In_ const std::shared_ptr<basic_parser<T>>& _fraction,
    -
    1925 _In_ const std::locale& locale = std::locale()) :
    -
    1926 basic_parser<T>(locale),
    -
    1927 positive_sign(_positive_sign),
    -
    1928 negative_sign(_negative_sign),
    -
    1929 special_sign(_special_sign),
    -
    1930 integer(_integer),
    -
    1931 fraction(_fraction),
    -
    1932 m_space(space)
    -
    1933 {}
    -
    1934
    -
    1935 virtual bool match(
    -
    1936 _In_reads_or_z_(end) const T* text,
    -
    1937 _In_ size_t start = 0,
    -
    1938 _In_ size_t end = (size_t)-1,
    -
    1939 _In_ int flags = match_default)
    -
    1940 {
    -
    1941 assert(text || start >= end);
    -
    1942 interval.end = start;
    -
    1943
    -
    1944 if (positive_sign && positive_sign->match(text, interval.end, end, flags)) {
    -
    1945 interval.end = positive_sign->interval.end;
    -
    1946 if (negative_sign) negative_sign->invalidate();
    -
    1947 if (special_sign) special_sign->invalidate();
    -
    1948 }
    -
    1949 else if (negative_sign && negative_sign->match(text, interval.end, end, flags)) {
    -
    1950 interval.end = negative_sign->interval.end;
    -
    1951 if (positive_sign) positive_sign->invalidate();
    -
    1952 if (special_sign) special_sign->invalidate();
    -
    1953 }
    -
    1954 else if (special_sign && special_sign->match(text, interval.end, end, flags)) {
    -
    1955 interval.end = special_sign->interval.end;
    -
    1956 if (positive_sign) positive_sign->invalidate();
    -
    1957 if (negative_sign) negative_sign->invalidate();
    -
    1958 }
    -
    1959 else {
    -
    1960 if (positive_sign) positive_sign->invalidate();
    -
    1961 if (negative_sign) negative_sign->invalidate();
    -
    1962 if (special_sign) special_sign->invalidate();
    -
    1963 }
    -
    1964
    -
    1965 // Check for <integer> <fraction>
    -
    1966 const int space_match_flags = flags & ~match_multiline; // Spaces in fractions must never be broken in new line.
    -
    1967 if (integer->match(text, interval.end, end, flags) &&
    -
    1968 m_space->match(text, integer->interval.end, end, space_match_flags))
    -
    1969 {
    -
    1970 for (interval.end = m_space->interval.end; m_space->match(text, interval.end, end, space_match_flags); interval.end = m_space->interval.end);
    -
    1971 if (fraction->match(text, interval.end, end, flags)) {
    -
    1972 interval.start = start;
    -
    1973 interval.end = fraction->interval.end;
    -
    1974 return true;
    -
    1975 }
    -
    1976 fraction->invalidate();
    -
    1977 interval.start = start;
    -
    1978 interval.end = integer->interval.end;
    -
    1979 return true;
    -
    1980 }
    -
    1981
    -
    1982 // Check for <fraction>
    -
    1983 if (fraction->match(text, interval.end, end, flags)) {
    -
    1984 integer->invalidate();
    -
    1985 interval.start = start;
    -
    1986 interval.end = fraction->interval.end;
    -
    1987 return true;
    -
    1988 }
    -
    1989
    -
    1990 // Check for <integer>
    -
    1991 if (integer->match(text, interval.end, end, flags)) {
    -
    1992 fraction->invalidate();
    -
    1993 interval.start = start;
    -
    1994 interval.end = integer->interval.end;
    -
    1995 return true;
    -
    1996 }
    -
    1997
    -
    1998 if (positive_sign) positive_sign->invalidate();
    -
    1999 if (negative_sign) negative_sign->invalidate();
    -
    2000 if (special_sign) special_sign->invalidate();
    -
    2001 integer->invalidate();
    -
    2002 fraction->invalidate();
    -
    2003 interval.start = (interval.end = start) + 1;
    -
    2004 return false;
    -
    2005 }
    -
    2006
    -
    2007 virtual void invalidate()
    -
    2008 {
    -
    2009 if (positive_sign) positive_sign->invalidate();
    -
    2010 if (negative_sign) negative_sign->invalidate();
    -
    2011 if (special_sign) special_sign->invalidate();
    -
    2012 integer->invalidate();
    -
    2013 fraction->invalidate();
    -
    2014 basic_parser<T>::invalidate();
    -
    2015 }
    -
    2016
    -
    2017 public:
    -
    2018 std::shared_ptr<basic_parser<T>> positive_sign;
    -
    2019 std::shared_ptr<basic_parser<T>> negative_sign;
    -
    2020 std::shared_ptr<basic_parser<T>> special_sign;
    -
    2021 std::shared_ptr<basic_parser<T>> integer;
    -
    2022 std::shared_ptr<basic_parser<T>> fraction;
    -
    2023
    -
    2024 protected:
    -
    2025 std::shared_ptr<basic_parser<T>> m_space;
    -
    2026 };
    -
    2027
    -
    2028 using mixed_numeral = basic_mixed_numeral<char>;
    -
    2029 using wmixed_numeral = basic_mixed_numeral<wchar_t>;
    -
    2030#ifdef _UNICODE
    -
    2031 using tmixed_numeral = wmixed_numeral;
    -
    2032#else
    -
    2033 using tmixed_numeral = mixed_numeral;
    -
    2034#endif
    -
    2035 using sgml_mixed_numeral = basic_mixed_numeral<char>;
    -
    2036
    -
    2040 template <class T>
    -
    2041 class basic_scientific_numeral : public basic_parser<T>
    -
    2042 {
    -
    2043 public:
    -
    2044 basic_scientific_numeral(
    -
    2045 _In_ const std::shared_ptr<basic_parser<T>>& _positive_sign,
    -
    2046 _In_ const std::shared_ptr<basic_parser<T>>& _negative_sign,
    -
    2047 _In_ const std::shared_ptr<basic_parser<T>>& _special_sign,
    -
    2048 _In_ const std::shared_ptr<basic_integer<T>>& _integer,
    -
    2049 _In_ const std::shared_ptr<basic_parser<T>>& _decimal_separator,
    -
    2050 _In_ const std::shared_ptr<basic_integer<T>>& _decimal,
    -
    2051 _In_ const std::shared_ptr<basic_parser<T>>& _exponent_symbol,
    -
    2052 _In_ const std::shared_ptr<basic_parser<T>>& _positive_exp_sign,
    -
    2053 _In_ const std::shared_ptr<basic_parser<T>>& _negative_exp_sign,
    -
    2054 _In_ const std::shared_ptr<basic_integer<T>>& _exponent,
    -
    2055 _In_ const std::locale& locale = std::locale()) :
    -
    2056 basic_parser<T>(locale),
    -
    2057 positive_sign(_positive_sign),
    -
    2058 negative_sign(_negative_sign),
    -
    2059 special_sign(_special_sign),
    -
    2060 integer(_integer),
    -
    2061 decimal_separator(_decimal_separator),
    -
    2062 decimal(_decimal),
    -
    2063 exponent_symbol(_exponent_symbol),
    -
    2064 positive_exp_sign(_positive_exp_sign),
    -
    2065 negative_exp_sign(_negative_exp_sign),
    -
    2066 exponent(_exponent),
    -
    2067 value(std::numeric_limits<double>::quiet_NaN())
    -
    2068 {}
    -
    2069
    -
    2070 virtual bool match(
    -
    2071 _In_reads_or_z_(end) const T* text,
    -
    2072 _In_ size_t start = 0,
    -
    2073 _In_ size_t end = (size_t)-1,
    -
    2074 _In_ int flags = match_default)
    -
    2075 {
    -
    2076 assert(text || start >= end);
    -
    2077 interval.end = start;
    -
    2078
    -
    2079 if (positive_sign && positive_sign->match(text, interval.end, end, flags)) {
    -
    2080 interval.end = positive_sign->interval.end;
    -
    2081 if (negative_sign) negative_sign->invalidate();
    -
    2082 if (special_sign) special_sign->invalidate();
    -
    2083 }
    -
    2084 else if (negative_sign && negative_sign->match(text, interval.end, end, flags)) {
    -
    2085 interval.end = negative_sign->interval.end;
    -
    2086 if (positive_sign) positive_sign->invalidate();
    -
    2087 if (special_sign) special_sign->invalidate();
    -
    2088 }
    -
    2089 else if (special_sign && special_sign->match(text, interval.end, end, flags)) {
    -
    2090 interval.end = special_sign->interval.end;
    -
    2091 if (positive_sign) positive_sign->invalidate();
    -
    2092 if (negative_sign) negative_sign->invalidate();
    -
    2093 }
    -
    2094 else {
    -
    2095 if (positive_sign) positive_sign->invalidate();
    -
    2096 if (negative_sign) negative_sign->invalidate();
    -
    2097 if (special_sign) special_sign->invalidate();
    -
    2098 }
    -
    2099
    -
    2100 if (integer->match(text, interval.end, end, flags))
    -
    2101 interval.end = integer->interval.end;
    -
    2102
    -
    2103 if (decimal_separator->match(text, interval.end, end, flags) &&
    -
    2104 decimal->match(text, decimal_separator->interval.end, end, flags))
    -
    2105 interval.end = decimal->interval.end;
    -
    2106 else {
    -
    2107 decimal_separator->invalidate();
    -
    2108 decimal->invalidate();
    -
    2109 }
    -
    2110
    -
    2111 if (integer->interval.empty() &&
    -
    2112 decimal->interval.empty())
    -
    2113 {
    -
    2114 // No integer part, no decimal part.
    -
    2115 if (positive_sign) positive_sign->invalidate();
    -
    2116 if (negative_sign) negative_sign->invalidate();
    -
    2117 if (special_sign) special_sign->invalidate();
    -
    2118 integer->invalidate();
    -
    2119 decimal_separator->invalidate();
    -
    2120 decimal->invalidate();
    -
    2121 if (exponent_symbol) exponent_symbol->invalidate();
    -
    2122 if (positive_exp_sign) positive_exp_sign->invalidate();
    -
    2123 if (negative_exp_sign) negative_exp_sign->invalidate();
    -
    2124 if (exponent) exponent->invalidate();
    -
    2125 interval.start = (interval.end = start) + 1;
    -
    2126 return false;
    -
    2127 }
    -
    2128
    -
    2129 if (exponent_symbol && exponent_symbol->match(text, interval.end, end, flags) &&
    -
    2130 (positive_exp_sign && positive_exp_sign->match(text, exponent_symbol->interval.end, end, flags) &&
    -
    2131 exponent && exponent->match(text, positive_exp_sign->interval.end, end, flags) ||
    -
    2132 exponent && exponent->match(text, exponent_symbol->interval.end, end, flags)))
    -
    2133 {
    -
    2134 interval.end = exponent->interval.end;
    -
    2135 if (negative_exp_sign) negative_exp_sign->invalidate();
    -
    2136 }
    -
    2137 else if (exponent_symbol && exponent_symbol->match(text, interval.end, end, flags) &&
    -
    2138 negative_exp_sign && negative_exp_sign->match(text, exponent_symbol->interval.end, end, flags) &&
    -
    2139 exponent && exponent->match(text, negative_exp_sign->interval.end, end, flags))
    -
    2140 {
    -
    2141 interval.end = exponent->interval.end;
    -
    2142 if (positive_exp_sign) positive_exp_sign->invalidate();
    -
    2143 }
    -
    2144 else {
    -
    2145 if (exponent_symbol) exponent_symbol->invalidate();
    -
    2146 if (positive_exp_sign) positive_exp_sign->invalidate();
    -
    2147 if (negative_exp_sign) negative_exp_sign->invalidate();
    -
    2148 if (exponent) exponent->invalidate();
    -
    2149 }
    -
    2150
    -
    2151 value = (double)integer->value;
    -
    2152 if (decimal->interval)
    -
    2153 value += (double)decimal->value * pow(10.0, -(double)decimal->interval.size());
    -
    2154 if (negative_sign && negative_sign->interval)
    -
    2155 value = -value;
    -
    2156 if (exponent && exponent->interval) {
    -
    2157 double e = (double)exponent->value;
    -
    2158 if (negative_exp_sign && negative_exp_sign->interval)
    -
    2159 e = -e;
    -
    2160 value *= pow(10.0, e);
    -
    2161 }
    -
    2162
    -
    2163 interval.start = start;
    -
    2164 return true;
    -
    2165 }
    -
    2166
    -
    2167 virtual void invalidate()
    -
    2168 {
    -
    2169 if (positive_sign) positive_sign->invalidate();
    -
    2170 if (negative_sign) negative_sign->invalidate();
    -
    2171 if (special_sign) special_sign->invalidate();
    -
    2172 integer->invalidate();
    -
    2173 decimal_separator->invalidate();
    -
    2174 decimal->invalidate();
    -
    2175 if (exponent_symbol) exponent_symbol->invalidate();
    -
    2176 if (positive_exp_sign) positive_exp_sign->invalidate();
    -
    2177 if (negative_exp_sign) negative_exp_sign->invalidate();
    -
    2178 if (exponent) exponent->invalidate();
    -
    2179 value = std::numeric_limits<double>::quiet_NaN();
    -
    2180 basic_parser<T>::invalidate();
    -
    2181 }
    -
    2182
    -
    2183 public:
    -
    2184 std::shared_ptr<basic_parser<T>> positive_sign;
    -
    2185 std::shared_ptr<basic_parser<T>> negative_sign;
    -
    2186 std::shared_ptr<basic_parser<T>> special_sign;
    -
    2187 std::shared_ptr<basic_integer<T>> integer;
    -
    2188 std::shared_ptr<basic_parser<T>> decimal_separator;
    -
    2189 std::shared_ptr<basic_integer<T>> decimal;
    -
    2190 std::shared_ptr<basic_parser<T>> exponent_symbol;
    -
    2191 std::shared_ptr<basic_parser<T>> positive_exp_sign;
    -
    2192 std::shared_ptr<basic_parser<T>> negative_exp_sign;
    -
    2193 std::shared_ptr<basic_integer<T>> exponent;
    -
    2194 double value;
    -
    2195 };
    -
    2196
    -
    2197 using scientific_numeral = basic_scientific_numeral<char>;
    -
    2198 using wscientific_numeral = basic_scientific_numeral<wchar_t>;
    -
    2199#ifdef _UNICODE
    -
    2200 using tscientific_numeral = wscientific_numeral;
    -
    2201#else
    -
    2202 using tscientific_numeral = scientific_numeral;
    -
    2203#endif
    -
    2204 using sgml_scientific_numeral = basic_scientific_numeral<char>;
    -
    2205
    -
    2209 template <class T>
    -
    2210 class basic_monetary_numeral : public basic_parser<T>
    -
    2211 {
    -
    2212 public:
    -
    2213 basic_monetary_numeral(
    -
    2214 _In_ const std::shared_ptr<basic_parser<T>>& _positive_sign,
    -
    2215 _In_ const std::shared_ptr<basic_parser<T>>& _negative_sign,
    -
    2216 _In_ const std::shared_ptr<basic_parser<T>>& _special_sign,
    -
    2217 _In_ const std::shared_ptr<basic_parser<T>>& _currency,
    -
    2218 _In_ const std::shared_ptr<basic_parser<T>>& _integer,
    -
    2219 _In_ const std::shared_ptr<basic_parser<T>>& _decimal_separator,
    -
    2220 _In_ const std::shared_ptr<basic_parser<T>>& _decimal,
    -
    2221 _In_ const std::locale& locale = std::locale()) :
    -
    2222 basic_parser<T>(locale),
    -
    2223 positive_sign(_positive_sign),
    -
    2224 negative_sign(_negative_sign),
    -
    2225 special_sign(_special_sign),
    -
    2226 currency(_currency),
    -
    2227 integer(_integer),
    -
    2228 decimal_separator(_decimal_separator),
    -
    2229 decimal(_decimal)
    -
    2230 {}
    -
    2231
    -
    2232 virtual bool match(
    -
    2233 _In_reads_or_z_(end) const T* text,
    -
    2234 _In_ size_t start = 0,
    -
    2235 _In_ size_t end = (size_t)-1,
    -
    2236 _In_ int flags = match_default)
    -
    2237 {
    -
    2238 assert(text || start >= end);
    -
    2239 interval.end = start;
    -
    2240
    -
    2241 if (positive_sign->match(text, interval.end, end, flags)) {
    -
    2242 interval.end = positive_sign->interval.end;
    -
    2243 if (negative_sign) negative_sign->invalidate();
    -
    2244 if (special_sign) special_sign->invalidate();
    -
    2245 }
    -
    2246 else if (negative_sign->match(text, interval.end, end, flags)) {
    -
    2247 interval.end = negative_sign->interval.end;
    -
    2248 if (positive_sign) positive_sign->invalidate();
    -
    2249 if (special_sign) special_sign->invalidate();
    -
    2250 }
    -
    2251 else if (special_sign->match(text, interval.end, end, flags)) {
    -
    2252 interval.end = special_sign->interval.end;
    -
    2253 if (positive_sign) positive_sign->invalidate();
    -
    2254 if (negative_sign) negative_sign->invalidate();
    -
    2255 }
    -
    2256 else {
    -
    2257 if (positive_sign) positive_sign->invalidate();
    -
    2258 if (negative_sign) negative_sign->invalidate();
    -
    2259 if (special_sign) special_sign->invalidate();
    -
    2260 }
    -
    2261
    -
    2262 if (currency->match(text, interval.end, end, flags))
    -
    2263 interval.end = currency->interval.end;
    -
    2264 else {
    -
    2265 if (positive_sign) positive_sign->invalidate();
    -
    2266 if (negative_sign) negative_sign->invalidate();
    -
    2267 if (special_sign) special_sign->invalidate();
    -
    2268 integer->invalidate();
    -
    2269 decimal_separator->invalidate();
    -
    2270 decimal->invalidate();
    -
    2271 interval.start = (interval.end = start) + 1;
    -
    2272 return false;
    -
    2273 }
    -
    2274
    -
    2275 if (integer->match(text, interval.end, end, flags))
    -
    2276 interval.end = integer->interval.end;
    -
    2277 if (decimal_separator->match(text, interval.end, end, flags) &&
    -
    2278 decimal->match(text, decimal_separator->interval.end, end, flags))
    -
    2279 interval.end = decimal->interval.end;
    -
    2280 else {
    -
    2281 decimal_separator->invalidate();
    -
    2282 decimal->invalidate();
    -
    2283 }
    -
    2284
    -
    2285 if (integer->interval.empty() &&
    -
    2286 decimal->interval.empty())
    -
    2287 {
    -
    2288 // No integer part, no decimal part.
    -
    2289 if (positive_sign) positive_sign->invalidate();
    -
    2290 if (negative_sign) negative_sign->invalidate();
    -
    2291 if (special_sign) special_sign->invalidate();
    -
    2292 currency->invalidate();
    -
    2293 integer->invalidate();
    -
    2294 decimal_separator->invalidate();
    -
    2295 decimal->invalidate();
    -
    2296 interval.start = (interval.end = start) + 1;
    -
    2297 return false;
    -
    2298 }
    -
    2299
    -
    2300 interval.start = start;
    -
    2301 return true;
    -
    2302 }
    -
    2303
    -
    2304 virtual void invalidate()
    -
    2305 {
    -
    2306 if (positive_sign) positive_sign->invalidate();
    -
    2307 if (negative_sign) negative_sign->invalidate();
    -
    2308 if (special_sign) special_sign->invalidate();
    -
    2309 currency->invalidate();
    -
    2310 integer->invalidate();
    -
    2311 decimal_separator->invalidate();
    -
    2312 decimal->invalidate();
    -
    2313 basic_parser<T>::invalidate();
    -
    2314 }
    -
    2315
    -
    2316 public:
    -
    2317 std::shared_ptr<basic_parser<T>> positive_sign;
    -
    2318 std::shared_ptr<basic_parser<T>> negative_sign;
    -
    2319 std::shared_ptr<basic_parser<T>> special_sign;
    -
    2320 std::shared_ptr<basic_parser<T>> currency;
    -
    2321 std::shared_ptr<basic_parser<T>> integer;
    -
    2322 std::shared_ptr<basic_parser<T>> decimal_separator;
    -
    2323 std::shared_ptr<basic_parser<T>> decimal;
    -
    2324 };
    -
    2325
    -
    2326 using monetary_numeral = basic_monetary_numeral<char>;
    -
    2327 using wmonetary_numeral = basic_monetary_numeral<wchar_t>;
    -
    2328#ifdef _UNICODE
    -
    2329 using tmonetary_numeral = wmonetary_numeral;
    -
    2330#else
    -
    2331 using tmonetary_numeral = monetary_numeral;
    -
    2332#endif
    -
    2333 using sgml_monetary_numeral = basic_monetary_numeral<char>;
    -
    2334
    -
    2338 template <class T>
    -
    2339 class basic_ipv4_address : public basic_parser<T>
    -
    2340 {
    -
    2341 public:
    -
    2342 basic_ipv4_address(
    -
    2343 _In_ const std::shared_ptr<basic_parser<T>>& digit_0,
    -
    2344 _In_ const std::shared_ptr<basic_parser<T>>& digit_1,
    -
    2345 _In_ const std::shared_ptr<basic_parser<T>>& digit_2,
    -
    2346 _In_ const std::shared_ptr<basic_parser<T>>& digit_3,
    -
    2347 _In_ const std::shared_ptr<basic_parser<T>>& digit_4,
    -
    2348 _In_ const std::shared_ptr<basic_parser<T>>& digit_5,
    -
    2349 _In_ const std::shared_ptr<basic_parser<T>>& digit_6,
    -
    2350 _In_ const std::shared_ptr<basic_parser<T>>& digit_7,
    -
    2351 _In_ const std::shared_ptr<basic_parser<T>>& digit_8,
    -
    2352 _In_ const std::shared_ptr<basic_parser<T>>& digit_9,
    -
    2353 _In_ const std::shared_ptr<basic_parser<T>>& separator,
    -
    2354 _In_ const std::locale& locale = std::locale()) :
    -
    2355 basic_parser<T>(locale),
    -
    2356 m_digit_0(digit_0),
    -
    2357 m_digit_1(digit_1),
    -
    2358 m_digit_2(digit_2),
    -
    2359 m_digit_3(digit_3),
    -
    2360 m_digit_4(digit_4),
    -
    2361 m_digit_5(digit_5),
    -
    2362 m_digit_6(digit_6),
    -
    2363 m_digit_7(digit_7),
    -
    2364 m_digit_8(digit_8),
    -
    2365 m_digit_9(digit_9),
    -
    2366 m_separator(separator)
    -
    2367 {
    -
    2368 value.s_addr = 0;
    -
    2369 }
    -
    2370
    -
    2371 virtual bool match(
    -
    2372 _In_reads_or_z_(end) const T* text,
    -
    2373 _In_ size_t start = 0,
    -
    2374 _In_ size_t end = (size_t)-1,
    -
    2375 _In_ int flags = match_default)
    -
    2376 {
    -
    2377 assert(text || start >= end);
    -
    2378 interval.end = start;
    -
    2379 value.s_addr = 0;
    -
    2380
    -
    2381 size_t i;
    -
    2382 for (i = 0; i < 4; i++) {
    -
    2383 if (i) {
    -
    2384 if (m_separator->match(text, interval.end, end, flags))
    -
    2385 interval.end = m_separator->interval.end;
    -
    2386 else
    -
    2387 goto error;
    -
    2388 }
    -
    2389
    -
    2390 components[i].start = interval.end;
    -
    2391 bool is_empty = true;
    -
    2392 size_t x;
    -
    2393 for (x = 0; interval.end < end && text[interval.end];) {
    -
    2394 size_t dig, digit_end;
    -
    2395 if (m_digit_0->match(text, interval.end, end, flags)) { dig = 0; digit_end = m_digit_0->interval.end; }
    -
    2396 else if (m_digit_1->match(text, interval.end, end, flags)) { dig = 1; digit_end = m_digit_1->interval.end; }
    -
    2397 else if (m_digit_2->match(text, interval.end, end, flags)) { dig = 2; digit_end = m_digit_2->interval.end; }
    -
    2398 else if (m_digit_3->match(text, interval.end, end, flags)) { dig = 3; digit_end = m_digit_3->interval.end; }
    -
    2399 else if (m_digit_4->match(text, interval.end, end, flags)) { dig = 4; digit_end = m_digit_4->interval.end; }
    -
    2400 else if (m_digit_5->match(text, interval.end, end, flags)) { dig = 5; digit_end = m_digit_5->interval.end; }
    -
    2401 else if (m_digit_6->match(text, interval.end, end, flags)) { dig = 6; digit_end = m_digit_6->interval.end; }
    -
    2402 else if (m_digit_7->match(text, interval.end, end, flags)) { dig = 7; digit_end = m_digit_7->interval.end; }
    -
    2403 else if (m_digit_8->match(text, interval.end, end, flags)) { dig = 8; digit_end = m_digit_8->interval.end; }
    -
    2404 else if (m_digit_9->match(text, interval.end, end, flags)) { dig = 9; digit_end = m_digit_9->interval.end; }
    -
    2405 else break;
    -
    2406 size_t x_n = x * 10 + dig;
    -
    2407 if (x_n <= 255) {
    -
    2408 x = x_n;
    -
    2409 interval.end = digit_end;
    -
    2410 is_empty = false;
    -
    2411 }
    -
    2412 else
    -
    2413 break;
    -
    2414 }
    -
    2415 if (is_empty)
    -
    2416 goto error;
    -
    2417 components[i].end = interval.end;
    -
    2418 value.s_addr = (value.s_addr << 8) | (uint8_t)x;
    -
    2419 }
    -
    2420 if (i < 4)
    -
    2421 goto error;
    -
    2422
    -
    2423 interval.start = start;
    -
    2424 return true;
    -
    2425
    -
    2426 error:
    -
    2427 components[0].start = 1;
    -
    2428 components[0].end = 0;
    -
    2429 components[1].start = 1;
    -
    2430 components[1].end = 0;
    -
    2431 components[2].start = 1;
    -
    2432 components[2].end = 0;
    -
    2433 components[3].start = 1;
    -
    2434 components[3].end = 0;
    -
    2435 value.s_addr = 0;
    -
    2436 interval.start = (interval.end = start) + 1;
    -
    2437 return false;
    -
    2438 }
    -
    2439
    -
    2440 virtual void invalidate()
    -
    2441 {
    -
    2442 components[0].start = 1;
    -
    2443 components[0].end = 0;
    -
    2444 components[1].start = 1;
    -
    2445 components[1].end = 0;
    -
    2446 components[2].start = 1;
    -
    2447 components[2].end = 0;
    -
    2448 components[3].start = 1;
    -
    2449 components[3].end = 0;
    -
    2450 value.s_addr = 0;
    -
    2451 basic_parser<T>::invalidate();
    -
    2452 }
    -
    2453
    -
    2454 public:
    -
    2455 stdex::interval<size_t> components[4];
    -
    2456 struct in_addr value;
    -
    2457
    -
    2458 protected:
    -
    2459 std::shared_ptr<basic_parser<T>>
    -
    2460 m_digit_0,
    -
    2461 m_digit_1,
    -
    2462 m_digit_2,
    -
    2463 m_digit_3,
    -
    2464 m_digit_4,
    -
    2465 m_digit_5,
    -
    2466 m_digit_6,
    -
    2467 m_digit_7,
    -
    2468 m_digit_8,
    -
    2469 m_digit_9;
    -
    2470 std::shared_ptr<basic_parser<T>> m_separator;
    -
    2471 };
    -
    2472
    -
    2473 using ipv4_address = basic_ipv4_address<char>;
    -
    2474 using wipv4_address = basic_ipv4_address<wchar_t>;
    -
    2475#ifdef _UNICODE
    -
    2476 using tipv4_address = wipv4_address;
    -
    2477#else
    -
    2478 using tipv4_address = ipv4_address;
    -
    2479#endif
    -
    2480 using sgml_ipv4_address = basic_ipv4_address<char>;
    -
    2481
    -
    2485 template <class T>
    -
    2486 class basic_ipv6_scope_id_char : public basic_parser<T>
    -
    2487 {
    -
    2488 public:
    -
    2489 basic_ipv6_scope_id_char(_In_ const std::locale& locale = std::locale()) : basic_parser<T>(locale) {}
    -
    2490
    -
    2491 virtual bool match(
    -
    2492 _In_reads_or_z_(end) const T* text,
    -
    2493 _In_ size_t start = 0,
    -
    2494 _In_ size_t end = (size_t)-1,
    -
    2495 _In_ int flags = match_default)
    -
    2496 {
    -
    2497 assert(text || start >= end);
    -
    2498 if (start < end && text[start]) {
    -
    2499 if (text[start] == '-' ||
    -
    2500 text[start] == '_' ||
    -
    2501 text[start] == ':' ||
    -
    2502 std::use_facet<std::ctype<T>>(m_locale).is(std::ctype_base::alnum, text[start]))
    -
    2503 {
    -
    2504 interval.end = (interval.start = start) + 1;
    -
    2505 return true;
    -
    2506 }
    -
    2507 }
    -
    2508 interval.start = (interval.end = start) + 1;
    -
    2509 return false;
    -
    2510 }
    -
    2511 };
    -
    2512
    -
    2513 using ipv6_scope_id_char = basic_ipv6_scope_id_char<char>;
    -
    2514 using wipv6_scope_id_char = basic_ipv6_scope_id_char<wchar_t>;
    -
    2515#ifdef _UNICODE
    -
    2516 using tipv6_scope_id_char = wipv6_scope_id_char;
    -
    2517#else
    -
    2518 using tipv6_scope_id_char = ipv6_scope_id_char;
    -
    2519#endif
    -
    2520
    -
    2524 class sgml_ipv6_scope_id_char : public sgml_parser
    -
    2525 {
    -
    2526 public:
    -
    2527 sgml_ipv6_scope_id_char(_In_ const std::locale& locale = std::locale()) : sgml_parser(locale) {}
    -
    2528
    -
    2529 virtual bool match(
    -
    2530 _In_reads_or_z_(end) const char* text,
    -
    2531 _In_ size_t start = 0,
    -
    2532 _In_ size_t end = (size_t)-1,
    -
    2533 _In_ int flags = match_default)
    -
    2534 {
    -
    2535 assert(text || start >= end);
    -
    2536 if (start < end && text[start]) {
    -
    2537 wchar_t buf[3];
    -
    2538 const wchar_t* chr = next_sgml_cp(text, start, end, interval.end, buf);
    -
    2539 const wchar_t* chr_end = chr + stdex::strlen(chr);
    -
    2540 if ((chr[0] == L'-' ||
    -
    2541 chr[0] == L'_' ||
    -
    2542 chr[0] == L':') && chr[1] == 0 ||
    -
    2543 std::use_facet<std::ctype<wchar_t>>(m_locale).scan_not(std::ctype_base::alnum, chr, chr_end) == chr_end)
    -
    2544 {
    -
    2545 interval.start = start;
    -
    2546 return true;
    -
    2547 }
    -
    2548 }
    -
    2549 interval.start = (interval.end = start) + 1;
    -
    2550 return false;
    -
    2551 }
    -
    2552 };
    -
    2553
    -
    2557 template <class T>
    -
    2558 class basic_ipv6_address : public basic_parser<T>
    -
    2559 {
    -
    2560 public:
    -
    2561 basic_ipv6_address(
    -
    2562 _In_ const std::shared_ptr<basic_parser<T>>& digit_0,
    -
    2563 _In_ const std::shared_ptr<basic_parser<T>>& digit_1,
    -
    2564 _In_ const std::shared_ptr<basic_parser<T>>& digit_2,
    -
    2565 _In_ const std::shared_ptr<basic_parser<T>>& digit_3,
    -
    2566 _In_ const std::shared_ptr<basic_parser<T>>& digit_4,
    -
    2567 _In_ const std::shared_ptr<basic_parser<T>>& digit_5,
    -
    2568 _In_ const std::shared_ptr<basic_parser<T>>& digit_6,
    -
    2569 _In_ const std::shared_ptr<basic_parser<T>>& digit_7,
    -
    2570 _In_ const std::shared_ptr<basic_parser<T>>& digit_8,
    -
    2571 _In_ const std::shared_ptr<basic_parser<T>>& digit_9,
    -
    2572 _In_ const std::shared_ptr<basic_parser<T>>& digit_10,
    -
    2573 _In_ const std::shared_ptr<basic_parser<T>>& digit_11,
    -
    2574 _In_ const std::shared_ptr<basic_parser<T>>& digit_12,
    -
    2575 _In_ const std::shared_ptr<basic_parser<T>>& digit_13,
    -
    2576 _In_ const std::shared_ptr<basic_parser<T>>& digit_14,
    -
    2577 _In_ const std::shared_ptr<basic_parser<T>>& digit_15,
    -
    2578 _In_ const std::shared_ptr<basic_parser<T>>& separator,
    -
    2579 _In_ const std::shared_ptr<basic_parser<T>>& scope_id_separator = nullptr,
    -
    2580 _In_ const std::shared_ptr<basic_parser<T>>& _scope_id = nullptr,
    -
    2581 _In_ const std::locale& locale = std::locale()) :
    -
    2582 basic_parser<T>(locale),
    -
    2583 m_digit_0(digit_0),
    -
    2584 m_digit_1(digit_1),
    -
    2585 m_digit_2(digit_2),
    -
    2586 m_digit_3(digit_3),
    -
    2587 m_digit_4(digit_4),
    -
    2588 m_digit_5(digit_5),
    -
    2589 m_digit_6(digit_6),
    -
    2590 m_digit_7(digit_7),
    -
    2591 m_digit_8(digit_8),
    -
    2592 m_digit_9(digit_9),
    -
    2593 m_digit_10(digit_10),
    -
    2594 m_digit_11(digit_11),
    -
    2595 m_digit_12(digit_12),
    -
    2596 m_digit_13(digit_13),
    -
    2597 m_digit_14(digit_14),
    -
    2598 m_digit_15(digit_15),
    -
    2599 m_separator(separator),
    -
    2600 m_scope_id_separator(scope_id_separator),
    -
    2601 scope_id(_scope_id)
    -
    2602 {
    -
    2603 memset(&value, 0, sizeof(value));
    -
    2604 }
    -
    2605
    -
    2606 virtual bool match(
    -
    2607 _In_reads_or_z_(end) const T* text,
    -
    2608 _In_ size_t start = 0,
    -
    2609 _In_ size_t end = (size_t)-1,
    -
    2610 _In_ int flags = match_default)
    -
    2611 {
    -
    2612 assert(text || start >= end);
    -
    2613 interval.end = start;
    -
    2614 memset(&value, 0, sizeof(value));
    -
    2615
    -
    2616 size_t i, compaction_i = (size_t)-1, compaction_start = start;
    -
    2617 for (i = 0; i < 8; i++) {
    -
    2618 bool is_empty = true;
    -
    2619
    -
    2620 if (m_separator->match(text, interval.end, end, flags)) {
    -
    2621 if (m_separator->match(text, m_separator->interval.end, end, flags)) {
    -
    2622 // :: found
    -
    2623 if (compaction_i == (size_t)-1) {
    -
    2624 // Zero compaction start
    -
    2625 compaction_i = i;
    -
    2626 compaction_start = m_separator->interval.start;
    -
    2627 interval.end = m_separator->interval.end;
    -
    2628 }
    -
    2629 else {
    -
    2630 // More than one zero compaction
    -
    2631 break;
    -
    2632 }
    -
    2633 }
    -
    2634 else if (i) {
    -
    2635 // Inner : found
    -
    2636 interval.end = m_separator->interval.end;
    -
    2637 }
    -
    2638 else {
    -
    2639 // Leading : found
    -
    2640 goto error;
    -
    2641 }
    -
    2642 }
    -
    2643 else if (i) {
    -
    2644 // : missing
    -
    2645 break;
    -
    2646 }
    -
    2647
    -
    2648 components[i].start = interval.end;
    -
    2649 size_t x;
    -
    2650 for (x = 0; interval.end < end && text[interval.end];) {
    -
    2651 size_t dig, digit_end;
    -
    2652 if (m_digit_0->match(text, interval.end, end, flags)) { dig = 0; digit_end = m_digit_0->interval.end; }
    -
    2653 else if (m_digit_1->match(text, interval.end, end, flags)) { dig = 1; digit_end = m_digit_1->interval.end; }
    -
    2654 else if (m_digit_2->match(text, interval.end, end, flags)) { dig = 2; digit_end = m_digit_2->interval.end; }
    -
    2655 else if (m_digit_3->match(text, interval.end, end, flags)) { dig = 3; digit_end = m_digit_3->interval.end; }
    -
    2656 else if (m_digit_4->match(text, interval.end, end, flags)) { dig = 4; digit_end = m_digit_4->interval.end; }
    -
    2657 else if (m_digit_5->match(text, interval.end, end, flags)) { dig = 5; digit_end = m_digit_5->interval.end; }
    -
    2658 else if (m_digit_6->match(text, interval.end, end, flags)) { dig = 6; digit_end = m_digit_6->interval.end; }
    -
    2659 else if (m_digit_7->match(text, interval.end, end, flags)) { dig = 7; digit_end = m_digit_7->interval.end; }
    -
    2660 else if (m_digit_8->match(text, interval.end, end, flags)) { dig = 8; digit_end = m_digit_8->interval.end; }
    -
    2661 else if (m_digit_9->match(text, interval.end, end, flags)) { dig = 9; digit_end = m_digit_9->interval.end; }
    -
    2662 else if (m_digit_10->match(text, interval.end, end, flags)) { dig = 10; digit_end = m_digit_10->interval.end; }
    -
    2663 else if (m_digit_11->match(text, interval.end, end, flags)) { dig = 11; digit_end = m_digit_11->interval.end; }
    -
    2664 else if (m_digit_12->match(text, interval.end, end, flags)) { dig = 12; digit_end = m_digit_12->interval.end; }
    -
    2665 else if (m_digit_13->match(text, interval.end, end, flags)) { dig = 13; digit_end = m_digit_13->interval.end; }
    -
    2666 else if (m_digit_14->match(text, interval.end, end, flags)) { dig = 14; digit_end = m_digit_14->interval.end; }
    -
    2667 else if (m_digit_15->match(text, interval.end, end, flags)) { dig = 15; digit_end = m_digit_15->interval.end; }
    -
    2668 else break;
    -
    2669 size_t x_n = x * 16 + dig;
    -
    2670 if (x_n <= 0xffff) {
    -
    2671 x = x_n;
    -
    2672 interval.end = digit_end;
    -
    2673 is_empty = false;
    -
    2674 }
    -
    2675 else
    -
    2676 break;
    -
    2677 }
    -
    2678 if (is_empty) {
    -
    2679 if (compaction_i != (size_t)-1) {
    -
    2680 // Zero compaction active: no sweat.
    -
    2681 break;
    -
    2682 }
    -
    2683 goto error;
    -
    2684 }
    -
    2685 components[i].end = interval.end;
    -
    2686 value.s6_words[i] = (uint16_t)x;
    -
    2687 }
    -
    2688
    -
    2689 if (compaction_i != (size_t)-1) {
    -
    2690 // Align components right due to zero compaction.
    -
    2691 size_t j, k;
    -
    2692 for (j = 8, k = i; k > compaction_i;) {
    -
    2693 value.s6_words[--j] = value.s6_words[--k];
    -
    2694 components[j] = components[k];
    -
    2695 }
    -
    2696 for (; j > compaction_i;) {
    -
    2697 value.s6_words[--j] = 0;
    -
    2698 components[j].start =
    -
    2699 components[j].end = compaction_start;
    -
    2700 }
    -
    2701 }
    -
    2702 else if (i < 8)
    -
    2703 goto error;
    -
    2704
    -
    2705 if (m_scope_id_separator && m_scope_id_separator->match(text, interval.end, end, flags) &&
    -
    2706 scope_id && scope_id->match(text, m_scope_id_separator->interval.end, end, flags))
    -
    2707 interval.end = scope_id->interval.end;
    -
    2708 else if (scope_id)
    -
    2709 scope_id->invalidate();
    -
    2710
    -
    2711 interval.start = start;
    -
    2712 return true;
    -
    2713
    -
    2714 error:
    -
    2715 components[0].start = 1;
    -
    2716 components[0].end = 0;
    -
    2717 components[1].start = 1;
    -
    2718 components[1].end = 0;
    -
    2719 components[2].start = 1;
    -
    2720 components[2].end = 0;
    -
    2721 components[3].start = 1;
    -
    2722 components[3].end = 0;
    -
    2723 components[4].start = 1;
    -
    2724 components[4].end = 0;
    -
    2725 components[5].start = 1;
    -
    2726 components[5].end = 0;
    -
    2727 components[6].start = 1;
    -
    2728 components[6].end = 0;
    -
    2729 components[7].start = 1;
    -
    2730 components[7].end = 0;
    -
    2731 memset(&value, 0, sizeof(value));
    -
    2732 if (scope_id) scope_id->invalidate();
    -
    2733 interval.start = (interval.end = start) + 1;
    -
    2734 return false;
    -
    2735 }
    -
    2736
    -
    2737 virtual void invalidate()
    -
    2738 {
    -
    2739 components[0].start = 1;
    -
    2740 components[0].end = 0;
    -
    2741 components[1].start = 1;
    -
    2742 components[1].end = 0;
    -
    2743 components[2].start = 1;
    -
    2744 components[2].end = 0;
    -
    2745 components[3].start = 1;
    -
    2746 components[3].end = 0;
    -
    2747 components[4].start = 1;
    -
    2748 components[4].end = 0;
    -
    2749 components[5].start = 1;
    -
    2750 components[5].end = 0;
    -
    2751 components[6].start = 1;
    -
    2752 components[6].end = 0;
    -
    2753 components[7].start = 1;
    -
    2754 components[7].end = 0;
    -
    2755 memset(&value, 0, sizeof(value));
    -
    2756 if (scope_id) scope_id->invalidate();
    -
    2757 basic_parser<T>::invalidate();
    -
    2758 }
    -
    2759
    -
    2760 public:
    -
    2761 stdex::interval<size_t> components[8];
    -
    2762 struct in6_addr value;
    -
    2763 std::shared_ptr<basic_parser<T>> scope_id;
    -
    2764
    -
    2765 protected:
    -
    2766 std::shared_ptr<basic_parser<T>>
    -
    2767 m_digit_0,
    -
    2768 m_digit_1,
    -
    2769 m_digit_2,
    -
    2770 m_digit_3,
    -
    2771 m_digit_4,
    -
    2772 m_digit_5,
    -
    2773 m_digit_6,
    -
    2774 m_digit_7,
    -
    2775 m_digit_8,
    -
    2776 m_digit_9,
    -
    2777 m_digit_10,
    -
    2778 m_digit_11,
    -
    2779 m_digit_12,
    -
    2780 m_digit_13,
    -
    2781 m_digit_14,
    -
    2782 m_digit_15;
    -
    2783 std::shared_ptr<basic_parser<T>> m_separator, m_scope_id_separator;
    -
    2784 };
    -
    2785
    -
    2786 using ipv6_address = basic_ipv6_address<char>;
    -
    2787 using wipv6_address = basic_ipv6_address<wchar_t>;
    -
    2788#ifdef _UNICODE
    -
    2789 using tipv6_address = wipv6_address;
    -
    2790#else
    -
    2791 using tipv6_address = ipv6_address;
    -
    2792#endif
    -
    2793 using sgml_ipv6_address = basic_ipv6_address<char>;
    -
    2794
    -
    2798 template <class T>
    -
    2799 class basic_dns_domain_char : public basic_parser<T>
    -
    2800 {
    -
    2801 public:
    -
    2802 basic_dns_domain_char(
    -
    2803 _In_ bool allow_idn,
    -
    2804 _In_ const std::locale& locale = std::locale()) :
    -
    2805 basic_parser<T>(locale),
    -
    2806 m_allow_idn(allow_idn),
    -
    2807 allow_on_edge(true)
    -
    2808 {}
    -
    2809
    -
    2810 virtual bool match(
    -
    2811 _In_reads_or_z_(end) const T* text,
    -
    2812 _In_ size_t start = 0,
    -
    2813 _In_ size_t end = (size_t)-1,
    -
    2814 _In_ int flags = match_default)
    -
    2815 {
    -
    2816 assert(text || start >= end);
    -
    2817 if (start < end && text[start]) {
    -
    2818 if (('A' <= text[start] && text[start] <= 'Z') ||
    -
    2819 ('a' <= text[start] && text[start] <= 'z') ||
    -
    2820 ('0' <= text[start] && text[start] <= '9'))
    -
    2821 allow_on_edge = true;
    -
    2822 else if (text[start] == '-')
    -
    2823 allow_on_edge = false;
    -
    2824 else if (m_allow_idn && std::use_facet<std::ctype<T>>(m_locale).is(std::ctype_base::alnum, text[start]))
    -
    2825 allow_on_edge = true;
    -
    2826 else {
    -
    2827 interval.start = (interval.end = start) + 1;
    -
    2828 return false;
    -
    2829 }
    -
    2830 interval.end = (interval.start = start) + 1;
    -
    2831 return true;
    -
    2832 }
    -
    2833 interval.start = (interval.end = start) + 1;
    -
    2834 return false;
    -
    2835 }
    -
    2836
    -
    2837 public:
    -
    2838 bool allow_on_edge;
    -
    2839
    -
    2840 protected:
    -
    2841 bool m_allow_idn;
    -
    2842 };
    -
    2843
    -
    2844 using dns_domain_char = basic_dns_domain_char<char>;
    -
    2845 using wdns_domain_char = basic_dns_domain_char<wchar_t>;
    -
    2846#ifdef _UNICODE
    -
    2847 using tdns_domain_char = wdns_domain_char;
    -
    2848#else
    -
    2849 using tdns_domain_char = dns_domain_char;
    -
    2850#endif
    -
    2851
    -
    2855 class sgml_dns_domain_char : public basic_dns_domain_char<char>
    -
    2856 {
    -
    2857 public:
    -
    2858 sgml_dns_domain_char(
    -
    2859 _In_ bool allow_idn,
    -
    2860 _In_ const std::locale& locale = std::locale()) :
    -
    2861 basic_dns_domain_char<char>(allow_idn, locale)
    -
    2862 {}
    -
    2863
    -
    2864 virtual bool match(
    -
    2865 _In_reads_or_z_(end) const char* text,
    -
    2866 _In_ size_t start = 0,
    -
    2867 _In_ size_t end = (size_t)-1,
    -
    2868 _In_ int flags = match_default)
    -
    2869 {
    -
    2870 assert(text || start >= end);
    -
    2871 if (start < end && text[start]) {
    -
    2872 wchar_t buf[3];
    -
    2873 const wchar_t* chr = next_sgml_cp(text, start, end, interval.end, buf);
    -
    2874 const wchar_t* chr_end = chr + stdex::strlen(chr);
    -
    2875 if ((('A' <= chr[0] && chr[0] <= 'Z') ||
    -
    2876 ('a' <= chr[0] && chr[0] <= 'z') ||
    -
    2877 ('0' <= chr[0] && chr[0] <= '9')) && chr[1] == 0)
    -
    2878 allow_on_edge = true;
    -
    2879 else if (chr[0] == '-' && chr[1] == 0)
    -
    2880 allow_on_edge = false;
    -
    2881 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)
    -
    2882 allow_on_edge = true;
    -
    2883 else {
    -
    2884 interval.start = (interval.end = start) + 1;
    -
    2885 return false;
    -
    2886 }
    -
    2887 interval.start = start;
    -
    2888 return true;
    -
    2889 }
    -
    2890 interval.start = (interval.end = start) + 1;
    -
    2891 return false;
    -
    2892 }
    -
    2893 };
    -
    2894
    -
    2898 template <class T>
    -
    2899 class basic_dns_name : public basic_parser<T>
    -
    2900 {
    -
    2901 public:
    -
    2902 basic_dns_name(
    -
    2903 _In_ bool allow_absolute,
    -
    2904 _In_ const std::shared_ptr<basic_dns_domain_char<T>>& domain_char,
    -
    2905 _In_ const std::shared_ptr<basic_parser<T>>& separator,
    -
    2906 _In_ const std::locale& locale = std::locale()) :
    -
    2907 basic_parser<T>(locale),
    -
    2908 m_allow_absolute(allow_absolute),
    -
    2909 m_domain_char(domain_char),
    -
    2910 m_separator(separator)
    -
    2911 {}
    -
    2912
    -
    2913 virtual bool match(
    -
    2914 _In_reads_or_z_(end) const T* text,
    -
    2915 _In_ size_t start = 0,
    -
    2916 _In_ size_t end = (size_t)-1,
    -
    2917 _In_ int flags = match_default)
    -
    2918 {
    -
    2919 assert(text || start >= end);
    -
    2920 size_t i = start, count;
    -
    2921 for (count = 0; i < end && text[i] && count < 127; count++) {
    -
    2922 if (m_domain_char->match(text, i, end, flags) &&
    -
    2923 m_domain_char->allow_on_edge)
    -
    2924 {
    -
    2925 // Domain start
    -
    2926 interval.end = i = m_domain_char->interval.end;
    -
    2927 while (i < end && text[i]) {
    -
    2928 if (m_domain_char->allow_on_edge &&
    -
    2929 m_separator->match(text, i, end, flags))
    -
    2930 {
    -
    2931 // Domain end
    -
    2932 if (m_allow_absolute)
    -
    2933 interval.end = i = m_separator->interval.end;
    -
    2934 else {
    -
    2935 interval.end = i;
    -
    2936 i = m_separator->interval.end;
    -
    2937 }
    -
    2938 break;
    -
    2939 }
    -
    2940 if (m_domain_char->match(text, i, end, flags)) {
    -
    2941 if (m_domain_char->allow_on_edge)
    -
    2942 interval.end = i = m_domain_char->interval.end;
    -
    2943 else
    -
    2944 i = m_domain_char->interval.end;
    -
    2945 }
    -
    2946 else {
    -
    2947 interval.start = start;
    -
    2948 return true;
    -
    2949 }
    -
    2950 }
    -
    2951 }
    -
    2952 else
    -
    2953 break;
    -
    2954 }
    -
    2955 if (count) {
    -
    2956 interval.start = start;
    -
    2957 return true;
    -
    2958 }
    -
    2959 interval.start = (interval.end = start) + 1;
    -
    2960 return false;
    -
    2961 }
    -
    2962
    -
    2963 protected:
    -
    2964 bool m_allow_absolute;
    -
    2965 std::shared_ptr<basic_dns_domain_char<T>> m_domain_char;
    -
    2966 std::shared_ptr<basic_parser<T>> m_separator;
    -
    2967 };
    -
    2968
    -
    2969 using dns_name = basic_dns_name<char>;
    -
    2970 using wdns_name = basic_dns_name<wchar_t>;
    -
    2971#ifdef _UNICODE
    -
    2972 using tdns_name = wdns_name;
    -
    2973#else
    -
    2974 using tdns_name = dns_name;
    -
    2975#endif
    -
    2976 using sgml_dns_name = basic_dns_name<char>;
    -
    2977
    -
    2981 template <class T>
    -
    2982 class basic_url_username_char : public basic_parser<T>
    -
    2983 {
    -
    2984 public:
    -
    2985 basic_url_username_char(_In_ const std::locale& locale = std::locale()) : basic_parser<T>(locale) {}
    -
    2986
    -
    2987 virtual bool match(
    -
    2988 _In_reads_or_z_(end) const T* text,
    -
    2989 _In_ size_t start = 0,
    -
    2990 _In_ size_t end = (size_t)-1,
    -
    2991 _In_ int flags = match_default)
    -
    2992 {
    -
    2993 assert(text || start >= end);
    -
    2994 if (start < end && text[start]) {
    -
    2995 if (text[start] == '-' ||
    -
    2996 text[start] == '.' ||
    -
    2997 text[start] == '_' ||
    -
    2998 text[start] == '~' ||
    -
    2999 text[start] == '%' ||
    -
    3000 text[start] == '!' ||
    -
    3001 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 std::use_facet<std::ctype<T>>(m_locale).is(std::ctype_base::alnum, text[start]))
    -
    3012 {
    -
    3013 interval.end = (interval.start = start) + 1;
    -
    3014 return true;
    -
    3015 }
    -
    3016 }
    -
    3017 interval.start = (interval.end = start) + 1;
    -
    3018 return false;
    -
    3019 }
    -
    3020 };
    -
    3021
    -
    3022 using url_username_char = basic_url_username_char<char>;
    -
    3023 using wurl_username_char = basic_url_username_char<wchar_t>;
    -
    3024#ifdef _UNICODE
    -
    3025 using turl_username_char = wurl_username_char;
    -
    3026#else
    -
    3027 using turl_username_char = url_username_char;
    -
    3028#endif
    -
    3029
    -
    3033 class sgml_url_username_char : public basic_url_username_char<char>
    -
    3034 {
    -
    3035 public:
    -
    3036 sgml_url_username_char(_In_ const std::locale& locale = std::locale()) : basic_url_username_char<char>(locale) {}
    -
    3037
    -
    3038 virtual bool match(
    -
    3039 _In_reads_or_z_(end) const char* text,
    -
    3040 _In_ size_t start = 0,
    -
    3041 _In_ size_t end = (size_t)-1,
    -
    3042 _In_ int flags = match_default)
    -
    3043 {
    -
    3044 assert(text || start >= end);
    -
    3045 if (start < end && text[start]) {
    -
    3046 wchar_t buf[3];
    -
    3047 const wchar_t* chr = next_sgml_cp(text, start, end, interval.end, buf);
    -
    3048 const wchar_t* chr_end = chr + stdex::strlen(chr);
    -
    3049 if ((chr[0] == L'-' ||
    -
    3050 chr[0] == L'.' ||
    -
    3051 chr[0] == L'_' ||
    -
    3052 chr[0] == L'~' ||
    -
    3053 chr[0] == L'%' ||
    -
    3054 chr[0] == L'!' ||
    -
    3055 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'=') && chr[1] == 0 ||
    -
    3065 std::use_facet<std::ctype<wchar_t>>(m_locale).scan_not(std::ctype_base::alnum, chr, chr_end) == chr_end)
    -
    3066 {
    -
    3067 interval.start = start;
    -
    3068 return true;
    -
    3069 }
    -
    3070 }
    -
    3071
    -
    3072 interval.start = (interval.end = start) + 1;
    -
    3073 return false;
    -
    3074 }
    -
    3075 };
    -
    3076
    -
    3080 template <class T>
    -
    3081 class basic_url_password_char : public basic_parser<T>
    -
    3082 {
    -
    3083 public:
    -
    3084 basic_url_password_char(_In_ const std::locale& locale = std::locale()) : basic_parser<T>(locale) {}
    -
    3085
    -
    3086 virtual bool match(
    -
    3087 _In_reads_or_z_(end) const T* text,
    -
    3088 _In_ size_t start = 0,
    -
    3089 _In_ size_t end = (size_t)-1,
    -
    3090 _In_ int flags = match_default)
    -
    3091 {
    -
    3092 assert(text || start >= end);
    -
    3093 if (start < end && text[start]) {
    -
    3094 if (text[start] == '-' ||
    -
    3095 text[start] == '.' ||
    -
    3096 text[start] == '_' ||
    -
    3097 text[start] == '~' ||
    -
    3098 text[start] == '%' ||
    -
    3099 text[start] == '!' ||
    -
    3100 text[start] == '$' ||
    -
    3101 text[start] == '&' ||
    -
    3102 text[start] == '\'' ||
    -
    3103 text[start] == '(' ||
    -
    3104 text[start] == ')' ||
    -
    3105 text[start] == '*' ||
    -
    3106 text[start] == '+' ||
    -
    3107 text[start] == ',' ||
    -
    3108 text[start] == ';' ||
    -
    3109 text[start] == '=' ||
    -
    3110 text[start] == ':' ||
    -
    3111 std::use_facet<std::ctype<T>>(m_locale).is(std::ctype_base::alnum, text[start]))
    -
    3112 {
    -
    3113 interval.end = (interval.start = start) + 1;
    -
    3114 return true;
    -
    3115 }
    -
    3116 }
    -
    3117 interval.start = (interval.end = start) + 1;
    -
    3118 return false;
    -
    3119 }
    -
    3120 };
    -
    3121
    -
    3122 using url_password_char = basic_url_password_char<char>;
    -
    3123 using wurl_password_char = basic_url_password_char<wchar_t>;
    -
    3124#ifdef _UNICODE
    -
    3125 using turl_password_char = wurl_password_char;
    -
    3126#else
    -
    3127 using turl_password_char = url_password_char;
    -
    3128#endif
    -
    3129
    -
    3133 class sgml_url_password_char : public basic_url_password_char<char>
    -
    3134 {
    -
    3135 public:
    -
    3136 sgml_url_password_char(_In_ const std::locale& locale = std::locale()) : basic_url_password_char<char>(locale) {}
    -
    3137
    -
    3138 virtual bool match(
    -
    3139 _In_reads_or_z_(end) const char* text,
    -
    3140 _In_ size_t start = 0,
    -
    3141 _In_ size_t end = (size_t)-1,
    -
    3142 _In_ int flags = match_default)
    -
    3143 {
    -
    3144 assert(text || start >= end);
    -
    3145 if (start < end && text[start]) {
    -
    3146 wchar_t buf[3];
    -
    3147 const wchar_t* chr = next_sgml_cp(text, start, end, interval.end, buf);
    -
    3148 const wchar_t* chr_end = chr + stdex::strlen(chr);
    -
    3149 if ((chr[0] == L'-' ||
    -
    3150 chr[0] == L'.' ||
    -
    3151 chr[0] == L'_' ||
    -
    3152 chr[0] == L'~' ||
    -
    3153 chr[0] == L'%' ||
    -
    3154 chr[0] == L'!' ||
    -
    3155 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':') && chr[1] == 0 ||
    -
    3166 std::use_facet<std::ctype<wchar_t>>(m_locale).scan_not(std::ctype_base::alnum, chr, chr_end) == chr_end)
    -
    3167 {
    -
    3168 interval.start = start;
    -
    3169 return true;
    -
    3170 }
    -
    3171 }
    -
    3172 interval.start = (interval.end = start) + 1;
    -
    3173 return false;
    -
    3174 }
    -
    3175 };
    -
    3176
    -
    3180 template <class T>
    -
    3181 class basic_url_path_char : public basic_parser<T>
    -
    3182 {
    -
    3183 public:
    -
    3184 basic_url_path_char(_In_ const std::locale& locale = std::locale()) : basic_parser<T>(locale) {}
    -
    3185
    -
    3186 virtual bool match(
    -
    3187 _In_reads_or_z_(end) const T* text,
    -
    3188 _In_ size_t start = 0,
    -
    3189 _In_ size_t end = (size_t)-1,
    -
    3190 _In_ int flags = match_default)
    -
    3191 {
    -
    3192 assert(text || start >= end);
    -
    3193 if (start < end && text[start]) {
    -
    3194 if (text[start] == '/' ||
    -
    3195 text[start] == '-' ||
    -
    3196 text[start] == '.' ||
    -
    3197 text[start] == '_' ||
    -
    3198 text[start] == '~' ||
    -
    3199 text[start] == '%' ||
    -
    3200 text[start] == '!' ||
    -
    3201 text[start] == '$' ||
    -
    3202 text[start] == '&' ||
    -
    3203 text[start] == '\'' ||
    -
    3204 text[start] == '(' ||
    -
    3205 text[start] == ')' ||
    -
    3206 text[start] == '*' ||
    -
    3207 text[start] == '+' ||
    -
    3208 text[start] == ',' ||
    -
    3209 text[start] == ';' ||
    -
    3210 text[start] == '=' ||
    -
    3211 text[start] == ':' ||
    -
    3212 text[start] == '@' ||
    -
    3213 text[start] == '?' ||
    -
    3214 text[start] == '#' ||
    -
    3215 std::use_facet<std::ctype<T>>(m_locale).is(std::ctype_base::alnum, text[start]))
    -
    3216 {
    -
    3217 interval.end = (interval.start = start) + 1;
    -
    3218 return true;
    -
    3219 }
    -
    3220 }
    -
    3221 interval.start = (interval.end = start) + 1;
    -
    3222 return false;
    -
    3223 }
    -
    3224 };
    -
    3225
    -
    3226 using url_path_char = basic_url_path_char<char>;
    -
    3227 using wurl_path_char = basic_url_path_char<wchar_t>;
    -
    3228#ifdef _UNICODE
    -
    3229 using turl_path_char = wurl_path_char;
    -
    3230#else
    -
    3231 using turl_path_char = url_path_char;
    -
    3232#endif
    -
    3233
    -
    3237 class sgml_url_path_char : public basic_url_path_char<char>
    -
    3238 {
    -
    3239 public:
    -
    3240 sgml_url_path_char(_In_ const std::locale& locale = std::locale()) : basic_url_path_char<char>(locale) {}
    -
    3241
    -
    3242 virtual bool match(
    -
    3243 _In_reads_or_z_(end) const char* text,
    -
    3244 _In_ size_t start = 0,
    -
    3245 _In_ size_t end = (size_t)-1,
    -
    3246 _In_ int flags = match_default)
    -
    3247 {
    -
    3248 assert(text || start >= end);
    -
    3249 if (start < end && text[start]) {
    -
    3250 wchar_t buf[3];
    -
    3251 const wchar_t* chr = next_sgml_cp(text, start, end, interval.end, buf);
    -
    3252 const wchar_t* chr_end = chr + stdex::strlen(chr);
    -
    3253 if ((chr[0] == L'/' ||
    -
    3254 chr[0] == L'-' ||
    -
    3255 chr[0] == L'.' ||
    -
    3256 chr[0] == L'_' ||
    -
    3257 chr[0] == L'~' ||
    -
    3258 chr[0] == L'%' ||
    -
    3259 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'#') && chr[1] == 0 ||
    -
    3274 std::use_facet<std::ctype<wchar_t>>(m_locale).scan_not(std::ctype_base::alnum, chr, chr_end) == chr_end)
    -
    3275 {
    -
    3276 interval.start = start;
    -
    3277 return true;
    -
    3278 }
    -
    3279 }
    -
    3280 interval.start = (interval.end = start) + 1;
    -
    3281 return false;
    -
    3282 }
    -
    3283 };
    -
    3284
    -
    3288 template <class T>
    -
    3289 class basic_url_path : public basic_parser<T>
    -
    3290 {
    -
    3291 public:
    -
    3292 basic_url_path(
    -
    3293 _In_ const std::shared_ptr<basic_parser<T>>& path_char,
    -
    3294 _In_ const std::shared_ptr<basic_parser<T>>& query_start,
    -
    3295 _In_ const std::shared_ptr<basic_parser<T>>& bookmark_start,
    -
    3296 _In_ const std::locale& locale = std::locale()) :
    -
    3297 basic_parser<T>(locale),
    -
    3298 m_path_char(path_char),
    -
    3299 m_query_start(query_start),
    -
    3300 m_bookmark_start(bookmark_start)
    -
    3301 {}
    -
    3302
    -
    3303 virtual bool match(
    -
    3304 _In_reads_or_z_(end) const T* text,
    -
    3305 _In_ size_t start = 0,
    -
    3306 _In_ size_t end = (size_t)-1,
    -
    3307 _In_ int flags = match_default)
    -
    3308 {
    -
    3309 assert(text || start >= end);
    -
    3310
    -
    3311 interval.end = start;
    -
    3312 path.start = start;
    -
    3313 query.start = 1;
    -
    3314 query.end = 0;
    -
    3315 bookmark.start = 1;
    -
    3316 bookmark.end = 0;
    -
    3317
    -
    3318 for (;;) {
    -
    3319 if (interval.end >= end || !text[interval.end])
    -
    3320 break;
    -
    3321 if (m_query_start->match(text, interval.end, end, flags)) {
    -
    3322 path.end = interval.end;
    -
    3323 query.start = interval.end = m_query_start->interval.end;
    -
    3324 for (;;) {
    -
    3325 if (interval.end >= end || !text[interval.end]) {
    -
    3326 query.end = interval.end;
    -
    3327 break;
    -
    3328 }
    -
    3329 if (m_bookmark_start->match(text, interval.end, end, flags)) {
    -
    3330 query.end = interval.end;
    -
    3331 bookmark.start = interval.end = m_bookmark_start->interval.end;
    -
    3332 for (;;) {
    -
    3333 if (interval.end >= end || !text[interval.end]) {
    -
    3334 bookmark.end = interval.end;
    -
    3335 break;
    -
    3336 }
    -
    3337 if (m_path_char->match(text, interval.end, end, flags))
    -
    3338 interval.end = m_path_char->interval.end;
    -
    3339 else {
    -
    3340 bookmark.end = interval.end;
    -
    3341 break;
    -
    3342 }
    -
    3343 }
    -
    3344 interval.start = start;
    -
    3345 return true;
    -
    3346 }
    -
    3347 if (m_path_char->match(text, interval.end, end, flags))
    -
    3348 interval.end = m_path_char->interval.end;
    -
    3349 else {
    -
    3350 query.end = interval.end;
    -
    3351 break;
    -
    3352 }
    -
    3353 }
    -
    3354 interval.start = start;
    -
    3355 return true;
    -
    3356 }
    -
    3357 if (m_bookmark_start->match(text, interval.end, end, flags)) {
    -
    3358 path.end = interval.end;
    -
    3359 bookmark.start = interval.end = m_bookmark_start->interval.end;
    -
    3360 for (;;) {
    -
    3361 if (interval.end >= end || !text[interval.end]) {
    -
    3362 bookmark.end = interval.end;
    -
    3363 break;
    -
    3364 }
    -
    3365 if (m_path_char->match(text, interval.end, end, flags))
    -
    3366 interval.end = m_path_char->interval.end;
    -
    3367 else {
    -
    3368 bookmark.end = interval.end;
    -
    3369 break;
    -
    3370 }
    -
    3371 }
    -
    3372 interval.start = start;
    -
    3373 return true;
    -
    3374 }
    -
    3375 if (m_path_char->match(text, interval.end, end, flags))
    -
    3376 interval.end = m_path_char->interval.end;
    -
    3377 else
    -
    3378 break;
    -
    3379 }
    -
    3380
    -
    3381 if (start < interval.end) {
    -
    3382 path.end = interval.end;
    -
    3383 interval.start = start;
    -
    3384 return true;
    -
    3385 }
    -
    3386
    -
    3387 path.start = 1;
    -
    3388 path.end = 0;
    -
    3389 bookmark.start = 1;
    -
    3390 bookmark.end = 0;
    -
    3391 interval.start = (interval.end = start) + 1;
    -
    3392 return false;
    -
    3393 }
    -
    3394
    -
    3395 virtual void invalidate()
    -
    3396 {
    -
    3397 path.start = 1;
    -
    3398 path.end = 0;
    -
    3399 query.start = 1;
    -
    3400 query.end = 0;
    -
    3401 bookmark.start = 1;
    -
    3402 bookmark.end = 0;
    -
    3403 basic_parser<T>::invalidate();
    -
    3404 }
    -
    3405
    -
    3406 public:
    -
    3407 stdex::interval<size_t> path;
    -
    3408 stdex::interval<size_t> query;
    -
    3409 stdex::interval<size_t> bookmark;
    -
    3410
    -
    3411 protected:
    -
    3412 std::shared_ptr<basic_parser<T>> m_path_char;
    -
    3413 std::shared_ptr<basic_parser<T>> m_query_start;
    -
    3414 std::shared_ptr<basic_parser<T>> m_bookmark_start;
    -
    3415 };
    -
    3416
    -
    3417 using url_path = basic_url_path<char>;
    -
    3418 using wurl_path = basic_url_path<wchar_t>;
    -
    3419#ifdef _UNICODE
    -
    3420 using turl_path = wurl_path;
    -
    3421#else
    -
    3422 using turl_path = url_path;
    -
    3423#endif
    -
    3424 using sgml_url_path = basic_url_path<char>;
    -
    3425
    -
    3429 template <class T>
    -
    3430 class basic_url : public basic_parser<T>
    -
    3431 {
    -
    3432 public:
    -
    3433 basic_url(
    -
    3434 _In_ const std::shared_ptr<basic_parser<T>>& _http_scheme,
    -
    3435 _In_ const std::shared_ptr<basic_parser<T>>& _ftp_scheme,
    -
    3436 _In_ const std::shared_ptr<basic_parser<T>>& _mailto_scheme,
    -
    3437 _In_ const std::shared_ptr<basic_parser<T>>& _file_scheme,
    -
    3438 _In_ const std::shared_ptr<basic_parser<T>>& colon,
    -
    3439 _In_ const std::shared_ptr<basic_parser<T>>& slash,
    -
    3440 _In_ const std::shared_ptr<basic_parser<T>>& _username,
    -
    3441 _In_ const std::shared_ptr<basic_parser<T>>& _password,
    -
    3442 _In_ const std::shared_ptr<basic_parser<T>>& at,
    -
    3443 _In_ const std::shared_ptr<basic_parser<T>>& ip_lbracket,
    -
    3444 _In_ const std::shared_ptr<basic_parser<T>>& ip_rbracket,
    -
    3445 _In_ const std::shared_ptr<basic_parser<T>>& _ipv4_host,
    -
    3446 _In_ const std::shared_ptr<basic_parser<T>>& _ipv6_host,
    -
    3447 _In_ const std::shared_ptr<basic_parser<T>>& _dns_host,
    -
    3448 _In_ const std::shared_ptr<basic_parser<T>>& _port,
    -
    3449 _In_ const std::shared_ptr<basic_parser<T>>& _path,
    -
    3450 _In_ const std::locale& locale = std::locale()) :
    -
    3451 basic_parser<T>(locale),
    -
    3452 http_scheme(_http_scheme),
    -
    3453 ftp_scheme(_ftp_scheme),
    -
    3454 mailto_scheme(_mailto_scheme),
    -
    3455 file_scheme(_file_scheme),
    -
    3456 m_colon(colon),
    -
    3457 m_slash(slash),
    -
    3458 username(_username),
    -
    3459 password(_password),
    -
    3460 m_at(at),
    -
    3461 m_ip_lbracket(ip_lbracket),
    -
    3462 m_ip_rbracket(ip_rbracket),
    -
    3463 ipv4_host(_ipv4_host),
    -
    3464 ipv6_host(_ipv6_host),
    -
    3465 dns_host(_dns_host),
    -
    3466 port(_port),
    -
    3467 path(_path)
    -
    3468 {}
    -
    3469
    -
    3470 virtual bool match(
    -
    3471 _In_reads_or_z_(end) const T* text,
    -
    3472 _In_ size_t start = 0,
    -
    3473 _In_ size_t end = (size_t)-1,
    -
    3474 _In_ int flags = match_default)
    -
    3475 {
    -
    3476 assert(text || start >= end);
    -
    3477
    -
    3478 interval.end = start;
    -
    3479
    -
    3480 if (http_scheme->match(text, interval.end, end, flags) &&
    -
    3481 m_colon->match(text, http_scheme->interval.end, end, flags) &&
    -
    3482 m_slash->match(text, m_colon->interval.end, end, flags) &&
    -
    3483 m_slash->match(text, m_slash->interval.end, end, flags))
    -
    3484 {
    -
    3485 // http://
    -
    3486 interval.end = m_slash->interval.end;
    -
    3487 ftp_scheme->invalidate();
    -
    3488 mailto_scheme->invalidate();
    -
    3489 file_scheme->invalidate();
    -
    3490 }
    -
    3491 else if (ftp_scheme->match(text, interval.end, end, flags) &&
    -
    3492 m_colon->match(text, ftp_scheme->interval.end, end, flags) &&
    -
    3493 m_slash->match(text, m_colon->interval.end, end, flags) &&
    -
    3494 m_slash->match(text, m_slash->interval.end, end, flags))
    -
    3495 {
    -
    3496 // ftp://
    -
    3497 interval.end = m_slash->interval.end;
    -
    3498 http_scheme->invalidate();
    -
    3499 mailto_scheme->invalidate();
    -
    3500 file_scheme->invalidate();
    -
    3501 }
    -
    3502 else if (mailto_scheme->match(text, interval.end, end, flags) &&
    -
    3503 m_colon->match(text, mailto_scheme->interval.end, end, flags))
    -
    3504 {
    -
    3505 // mailto:
    -
    3506 interval.end = m_colon->interval.end;
    -
    3507 http_scheme->invalidate();
    -
    3508 ftp_scheme->invalidate();
    -
    3509 file_scheme->invalidate();
    -
    3510 }
    -
    3511 else if (file_scheme->match(text, interval.end, end, flags) &&
    -
    3512 m_colon->match(text, file_scheme->interval.end, end, flags) &&
    -
    3513 m_slash->match(text, m_colon->interval.end, end, flags) &&
    -
    3514 m_slash->match(text, m_slash->interval.end, end, flags))
    -
    3515 {
    -
    3516 // file://
    -
    3517 interval.end = m_slash->interval.end;
    -
    3518 http_scheme->invalidate();
    -
    3519 ftp_scheme->invalidate();
    -
    3520 mailto_scheme->invalidate();
    -
    3521 }
    -
    3522 else {
    -
    3523 // Default to http:
    -
    3524 http_scheme->invalidate();
    -
    3525 ftp_scheme->invalidate();
    -
    3526 mailto_scheme->invalidate();
    -
    3527 file_scheme->invalidate();
    -
    3528 }
    -
    3529
    -
    3530 if (ftp_scheme->interval) {
    -
    3531 if (username->match(text, interval.end, end, flags)) {
    -
    3532 if (m_colon->match(text, username->interval.end, end, flags) &&
    -
    3533 password->match(text, m_colon->interval.end, end, flags) &&
    -
    3534 m_at->match(text, password->interval.end, end, flags))
    -
    3535 {
    -
    3536 // Username and password
    -
    3537 interval.end = m_at->interval.end;
    -
    3538 }
    -
    3539 else if (m_at->match(text, interval.end, end, flags)) {
    -
    3540 // Username only
    -
    3541 interval.end = m_at->interval.end;
    -
    3542 password->invalidate();
    -
    3543 }
    -
    3544 else {
    -
    3545 username->invalidate();
    -
    3546 password->invalidate();
    -
    3547 }
    -
    3548 }
    -
    3549 else {
    -
    3550 username->invalidate();
    -
    3551 password->invalidate();
    -
    3552 }
    -
    3553
    -
    3554 if (ipv4_host->match(text, interval.end, end, flags)) {
    -
    3555 // Host is IPv4
    -
    3556 interval.end = ipv4_host->interval.end;
    -
    3557 ipv6_host->invalidate();
    -
    3558 dns_host->invalidate();
    -
    3559 }
    -
    3560 else if (
    -
    3561 m_ip_lbracket->match(text, interval.end, end, flags) &&
    -
    3562 ipv6_host->match(text, m_ip_lbracket->interval.end, end, flags) &&
    -
    3563 m_ip_rbracket->match(text, ipv6_host->interval.end, end, flags))
    -
    3564 {
    -
    3565 // Host is IPv6
    -
    3566 interval.end = m_ip_rbracket->interval.end;
    -
    3567 ipv4_host->invalidate();
    -
    3568 dns_host->invalidate();
    -
    3569 }
    -
    3570 else if (dns_host->match(text, interval.end, end, flags)) {
    -
    3571 // Host is hostname
    -
    3572 interval.end = dns_host->interval.end;
    -
    3573 ipv4_host->invalidate();
    -
    3574 ipv6_host->invalidate();
    -
    3575 }
    -
    3576 else {
    -
    3577 invalidate();
    -
    3578 return false;
    -
    3579 }
    -
    3580
    -
    3581 if (m_colon->match(text, interval.end, end, flags) &&
    -
    3582 port->match(text, m_colon->interval.end, end, flags))
    -
    3583 {
    -
    3584 // Port
    -
    3585 interval.end = port->interval.end;
    -
    3586 }
    -
    3587 else
    -
    3588 port->invalidate();
    -
    3589
    -
    3590 if (path->match(text, interval.end, end, flags)) {
    -
    3591 // Path
    -
    3592 interval.end = path->interval.end;
    -
    3593 }
    -
    3594
    -
    3595 interval.start = start;
    -
    3596 return true;
    -
    3597 }
    -
    3598
    -
    3599 if (mailto_scheme->interval) {
    -
    3600 if (username->match(text, interval.end, end, flags) &&
    -
    3601 m_at->match(text, username->interval.end, end, flags))
    -
    3602 {
    -
    3603 // Username
    -
    3604 interval.end = m_at->interval.end;
    -
    3605 }
    -
    3606 else {
    -
    3607 invalidate();
    -
    3608 return false;
    -
    3609 }
    -
    3610
    -
    3611 if (m_ip_lbracket->match(text, interval.end, end, flags) &&
    -
    3612 ipv4_host->match(text, m_ip_lbracket->interval.end, end, flags) &&
    -
    3613 m_ip_rbracket->match(text, ipv4_host->interval.end, end, flags))
    -
    3614 {
    -
    3615 // Host is IPv4
    -
    3616 interval.end = m_ip_rbracket->interval.end;
    -
    3617 ipv6_host->invalidate();
    -
    3618 dns_host->invalidate();
    -
    3619 }
    -
    3620 else if (
    -
    3621 m_ip_lbracket->match(text, interval.end, end, flags) &&
    -
    3622 ipv6_host->match(text, m_ip_lbracket->interval.end, end, flags) &&
    -
    3623 m_ip_rbracket->match(text, ipv6_host->interval.end, end, flags))
    -
    3624 {
    -
    3625 // Host is IPv6
    -
    3626 interval.end = m_ip_rbracket->interval.end;
    -
    3627 ipv4_host->invalidate();
    -
    3628 dns_host->invalidate();
    -
    3629 }
    -
    3630 else if (dns_host->match(text, interval.end, end, flags)) {
    -
    3631 // Host is hostname
    -
    3632 interval.end = dns_host->interval.end;
    -
    3633 ipv4_host->invalidate();
    -
    3634 ipv6_host->invalidate();
    -
    3635 }
    -
    3636 else {
    -
    3637 invalidate();
    -
    3638 return false;
    -
    3639 }
    -
    3640
    -
    3641 password->invalidate();
    -
    3642 port->invalidate();
    -
    3643 path->invalidate();
    -
    3644 interval.start = start;
    -
    3645 return true;
    -
    3646 }
    -
    3647
    -
    3648 if (file_scheme->interval) {
    -
    3649 if (path->match(text, interval.end, end, flags)) {
    -
    3650 // Path
    -
    3651 interval.end = path->interval.end;
    -
    3652 }
    -
    3653
    -
    3654 username->invalidate();
    -
    3655 password->invalidate();
    -
    3656 ipv4_host->invalidate();
    -
    3657 ipv6_host->invalidate();
    -
    3658 dns_host->invalidate();
    -
    3659 port->invalidate();
    -
    3660 interval.start = start;
    -
    3661 return true;
    -
    3662 }
    -
    3663
    -
    3664 // "http://" found or defaulted to
    -
    3665
    -
    3666 // If "http://" explicit, test for username&password.
    -
    3667 if (http_scheme->interval &&
    -
    3668 username->match(text, interval.end, end, flags))
    -
    3669 {
    -
    3670 if (m_colon->match(text, username->interval.end, end, flags) &&
    -
    3671 password->match(text, m_colon->interval.end, end, flags) &&
    -
    3672 m_at->match(text, password->interval.end, end, flags))
    -
    3673 {
    -
    3674 // Username and password
    -
    3675 interval.end = m_at->interval.end;
    -
    3676 }
    -
    3677 else if (m_at->match(text, username->interval.end, end, flags)) {
    -
    3678 // Username only
    -
    3679 interval.end = m_at->interval.end;
    -
    3680 password->invalidate();
    -
    3681 }
    -
    3682 else {
    -
    3683 username->invalidate();
    -
    3684 password->invalidate();
    -
    3685 }
    -
    3686 }
    -
    3687 else {
    -
    3688 username->invalidate();
    -
    3689 password->invalidate();
    -
    3690 }
    -
    3691
    -
    3692 if (ipv4_host->match(text, interval.end, end, flags)) {
    -
    3693 // Host is IPv4
    -
    3694 interval.end = ipv4_host->interval.end;
    -
    3695 ipv6_host->invalidate();
    -
    3696 dns_host->invalidate();
    -
    3697 }
    -
    3698 else if (
    -
    3699 m_ip_lbracket->match(text, interval.end, end, flags) &&
    -
    3700 ipv6_host->match(text, m_ip_lbracket->interval.end, end, flags) &&
    -
    3701 m_ip_rbracket->match(text, ipv6_host->interval.end, end, flags))
    -
    3702 {
    -
    3703 // Host is IPv6
    -
    3704 interval.end = m_ip_rbracket->interval.end;
    -
    3705 ipv4_host->invalidate();
    -
    3706 dns_host->invalidate();
    -
    3707 }
    -
    3708 else if (dns_host->match(text, interval.end, end, flags)) {
    -
    3709 // Host is hostname
    -
    3710 interval.end = dns_host->interval.end;
    -
    3711 ipv4_host->invalidate();
    -
    3712 ipv6_host->invalidate();
    -
    3713 }
    -
    3714 else {
    -
    3715 invalidate();
    -
    3716 return false;
    -
    3717 }
    -
    3718
    -
    3719 if (m_colon->match(text, interval.end, end, flags) &&
    -
    3720 port->match(text, m_colon->interval.end, end, flags))
    -
    3721 {
    -
    3722 // Port
    -
    3723 interval.end = port->interval.end;
    -
    3724 }
    -
    3725 else
    -
    3726 port->invalidate();
    -
    3727
    -
    3728 if (path->match(text, interval.end, end, flags)) {
    -
    3729 // Path
    -
    3730 interval.end = path->interval.end;
    -
    3731 }
    -
    3732
    -
    3733 interval.start = start;
    -
    3734 return true;
    -
    3735 }
    -
    3736
    -
    3737 virtual void invalidate()
    -
    3738 {
    -
    3739 http_scheme->invalidate();
    -
    3740 ftp_scheme->invalidate();
    -
    3741 mailto_scheme->invalidate();
    -
    3742 file_scheme->invalidate();
    -
    3743 username->invalidate();
    -
    3744 password->invalidate();
    -
    3745 ipv4_host->invalidate();
    -
    3746 ipv6_host->invalidate();
    -
    3747 dns_host->invalidate();
    -
    3748 port->invalidate();
    -
    3749 path->invalidate();
    -
    3750 basic_parser<T>::invalidate();
    -
    3751 }
    -
    3752
    -
    3753 public:
    -
    3754 std::shared_ptr<basic_parser<T>> http_scheme;
    -
    3755 std::shared_ptr<basic_parser<T>> ftp_scheme;
    -
    3756 std::shared_ptr<basic_parser<T>> mailto_scheme;
    -
    3757 std::shared_ptr<basic_parser<T>> file_scheme;
    -
    3758 std::shared_ptr<basic_parser<T>> username;
    -
    3759 std::shared_ptr<basic_parser<T>> password;
    -
    3760 std::shared_ptr<basic_parser<T>> ipv4_host;
    -
    3761 std::shared_ptr<basic_parser<T>> ipv6_host;
    -
    3762 std::shared_ptr<basic_parser<T>> dns_host;
    -
    3763 std::shared_ptr<basic_parser<T>> port;
    -
    3764 std::shared_ptr<basic_parser<T>> path;
    -
    3765
    -
    3766 protected:
    -
    3767 std::shared_ptr<basic_parser<T>> m_colon;
    -
    3768 std::shared_ptr<basic_parser<T>> m_slash;
    -
    3769 std::shared_ptr<basic_parser<T>> m_at;
    -
    3770 std::shared_ptr<basic_parser<T>> m_ip_lbracket;
    -
    3771 std::shared_ptr<basic_parser<T>> m_ip_rbracket;
    -
    3772 };
    -
    3773
    -
    3774 using url = basic_url<char>;
    -
    3775 using wurl = basic_url<wchar_t>;
    -
    3776#ifdef _UNICODE
    -
    3777 using turl = wurl;
    -
    3778#else
    -
    3779 using turl = url;
    -
    3780#endif
    -
    3781 using sgml_url = basic_url<char>;
    -
    3782
    -
    3786 template <class T>
    -
    3787 class basic_email_address : public basic_parser<T>
    -
    3788 {
    -
    3789 public:
    -
    3790 basic_email_address(
    -
    3791 _In_ const std::shared_ptr<basic_parser<T>>& _username,
    -
    3792 _In_ const std::shared_ptr<basic_parser<T>>& at,
    -
    3793 _In_ const std::shared_ptr<basic_parser<T>>& ip_lbracket,
    -
    3794 _In_ const std::shared_ptr<basic_parser<T>>& ip_rbracket,
    -
    3795 _In_ const std::shared_ptr<basic_parser<T>>& _ipv4_host,
    -
    3796 _In_ const std::shared_ptr<basic_parser<T>>& _ipv6_host,
    -
    3797 _In_ const std::shared_ptr<basic_parser<T>>& _dns_host,
    -
    3798 _In_ const std::locale& locale = std::locale()) :
    -
    3799 basic_parser<T>(locale),
    -
    3800 username(_username),
    -
    3801 m_at(at),
    -
    3802 m_ip_lbracket(ip_lbracket),
    -
    3803 m_ip_rbracket(ip_rbracket),
    -
    3804 ipv4_host(_ipv4_host),
    -
    3805 ipv6_host(_ipv6_host),
    -
    3806 dns_host(_dns_host)
    -
    3807 {}
    -
    3808
    -
    3809 virtual bool match(
    -
    3810 _In_reads_or_z_(end) const T* text,
    -
    3811 _In_ size_t start = 0,
    -
    3812 _In_ size_t end = (size_t)-1,
    -
    3813 _In_ int flags = match_default)
    -
    3814 {
    -
    3815 assert(text || start >= end);
    -
    3816
    -
    3817 if (username->match(text, start, end, flags) &&
    -
    3818 m_at->match(text, username->interval.end, end, flags))
    -
    3819 {
    -
    3820 // Username@
    -
    3821 if (m_ip_lbracket->match(text, m_at->interval.end, end, flags) &&
    -
    3822 ipv4_host->match(text, m_ip_lbracket->interval.end, end, flags) &&
    -
    3823 m_ip_rbracket->match(text, ipv4_host->interval.end, end, flags))
    -
    3824 {
    -
    3825 // Host is IPv4
    -
    3826 interval.end = m_ip_rbracket->interval.end;
    -
    3827 ipv6_host->invalidate();
    -
    3828 dns_host->invalidate();
    -
    3829 }
    -
    3830 else if (
    -
    3831 m_ip_lbracket->match(text, m_at->interval.end, end, flags) &&
    -
    3832 ipv6_host->match(text, m_ip_lbracket->interval.end, end, flags) &&
    -
    3833 m_ip_rbracket->match(text, ipv6_host->interval.end, end, flags))
    -
    3834 {
    -
    3835 // Host is IPv6
    -
    3836 interval.end = m_ip_rbracket->interval.end;
    -
    3837 ipv4_host->invalidate();
    -
    3838 dns_host->invalidate();
    -
    3839 }
    -
    3840 else if (dns_host->match(text, m_at->interval.end, end, flags)) {
    -
    3841 // Host is hostname
    -
    3842 interval.end = dns_host->interval.end;
    -
    3843 ipv4_host->invalidate();
    -
    3844 ipv6_host->invalidate();
    -
    3845 }
    -
    3846 else
    -
    3847 goto error;
    -
    3848 interval.start = start;
    -
    3849 return true;
    -
    3850 }
    -
    3851
    -
    3852 error:
    -
    3853 username->invalidate();
    -
    3854 ipv4_host->invalidate();
    -
    3855 ipv6_host->invalidate();
    -
    3856 dns_host->invalidate();
    -
    3857 interval.start = (interval.end = start) + 1;
    -
    3858 return false;
    -
    3859 }
    -
    3860
    -
    3861 virtual void invalidate()
    -
    3862 {
    -
    3863 username->invalidate();
    -
    3864 ipv4_host->invalidate();
    -
    3865 ipv6_host->invalidate();
    -
    3866 dns_host->invalidate();
    -
    3867 basic_parser<T>::invalidate();
    -
    3868 }
    -
    3869
    -
    3870 public:
    -
    3871 std::shared_ptr<basic_parser<T>> username;
    -
    3872 std::shared_ptr<basic_parser<T>> ipv4_host;
    -
    3873 std::shared_ptr<basic_parser<T>> ipv6_host;
    -
    3874 std::shared_ptr<basic_parser<T>> dns_host;
    -
    3875
    -
    3876 protected:
    -
    3877 std::shared_ptr<basic_parser<T>> m_at;
    -
    3878 std::shared_ptr<basic_parser<T>> m_ip_lbracket;
    -
    3879 std::shared_ptr<basic_parser<T>> m_ip_rbracket;
    -
    3880 };
    -
    3881
    -
    3882 using email_address = basic_email_address<char>;
    -
    3883 using wemail_address = basic_email_address<wchar_t>;
    -
    3884#ifdef _UNICODE
    -
    3885 using temail_address = wemail_address;
    -
    3886#else
    -
    3887 using temail_address = email_address;
    -
    3888#endif
    -
    3889 using sgml_email_address = basic_email_address<char>;
    -
    3890
    -
    3894 template <class T>
    -
    3895 class basic_emoticon : public basic_parser<T>
    -
    3896 {
    -
    3897 public:
    -
    3898 basic_emoticon(
    -
    3899 _In_ const std::shared_ptr<basic_parser<T>>& _emoticon,
    -
    3900 _In_ const std::shared_ptr<basic_parser<T>>& _apex,
    -
    3901 _In_ const std::shared_ptr<basic_parser<T>>& _eyes,
    -
    3902 _In_ const std::shared_ptr<basic_parser<T>>& _nose,
    -
    3903 _In_ const std::shared_ptr<basic_set<T>>& _mouth,
    -
    3904 _In_ const std::locale& locale = std::locale()) :
    -
    3905 basic_parser<T>(locale),
    -
    3906 emoticon(_emoticon),
    -
    3907 apex(_apex),
    -
    3908 eyes(_eyes),
    -
    3909 nose(_nose),
    -
    3910 mouth(_mouth)
    -
    3911 {}
    -
    3912
    -
    3913 virtual bool match(
    -
    3914 _In_reads_or_z_(end) const T* text,
    -
    3915 _In_ size_t start = 0,
    -
    3916 _In_ size_t end = (size_t)-1,
    -
    3917 _In_ int flags = match_default)
    -
    3918 {
    -
    3919 assert(text || start >= end);
    -
    3920
    -
    3921 if (emoticon && emoticon->match(text, start, end, flags)) {
    -
    3922 if (apex) apex->invalidate();
    -
    3923 eyes->invalidate();
    -
    3924 if (nose) nose->invalidate();
    -
    3925 mouth->invalidate();
    -
    3926 interval.start = start;
    -
    3927 interval.end = emoticon->interval.end;
    -
    3928 return true;
    -
    3929 }
    -
    3930
    -
    3931 interval.end = start;
    -
    3932
    -
    3933 if (apex && apex->match(text, interval.end, end, flags))
    -
    3934 interval.end = apex->interval.end;
    -
    3935
    -
    3936 if (eyes->match(text, interval.end, end, flags)) {
    -
    3937 if (nose && nose->match(text, eyes->interval.end, end, flags) &&
    -
    3938 mouth->match(text, nose->interval.end, end, flags))
    -
    3939 {
    -
    3940 size_t
    -
    3941 start_mouth = mouth->interval.start,
    -
    3942 hit_offset = mouth->hit_offset;
    -
    3943 // Mouth may repeat :-)))))))
    -
    3944 for (interval.end = mouth->interval.end; mouth->match(text, interval.end, end, flags) && mouth->hit_offset == hit_offset; interval.end = mouth->interval.end);
    -
    3945 mouth->interval.start = start_mouth;
    -
    3946 mouth->interval.end = interval.end;
    -
    3947 interval.start = start;
    -
    3948 return true;
    -
    3949 }
    -
    3950 if (mouth->match(text, eyes->interval.end, end, flags)) {
    -
    3951 size_t
    -
    3952 start_mouth = mouth->interval.start,
    -
    3953 hit_offset = mouth->hit_offset;
    -
    3954 // Mouth may repeat :-)))))))
    -
    3955 for (interval.end = mouth->interval.end; mouth->match(text, interval.end, end, flags) && mouth->hit_offset == hit_offset; interval.end = mouth->interval.end);
    -
    3956 if (nose) nose->invalidate();
    -
    3957 mouth->interval.start = start_mouth;
    -
    3958 mouth->interval.end = interval.end;
    -
    3959 interval.start = start;
    -
    3960 return true;
    -
    3961 }
    -
    3962 }
    -
    3963
    -
    3964 if (emoticon) emoticon->invalidate();
    -
    3965 if (apex) apex->invalidate();
    -
    3966 eyes->invalidate();
    -
    3967 if (nose) nose->invalidate();
    -
    3968 mouth->invalidate();
    -
    3969 interval.start = (interval.end = start) + 1;
    -
    3970 return false;
    -
    3971 }
    -
    3972
    -
    3973 virtual void invalidate()
    -
    3974 {
    -
    3975 if (emoticon) emoticon->invalidate();
    -
    3976 if (apex) apex->invalidate();
    -
    3977 eyes->invalidate();
    -
    3978 if (nose) nose->invalidate();
    -
    3979 mouth->invalidate();
    -
    3980 basic_parser<T>::invalidate();
    -
    3981 }
    -
    3982
    -
    3983 public:
    -
    3984 std::shared_ptr<basic_parser<T>> emoticon;
    -
    3985 std::shared_ptr<basic_parser<T>> apex;
    -
    3986 std::shared_ptr<basic_parser<T>> eyes;
    -
    3987 std::shared_ptr<basic_parser<T>> nose;
    -
    3988 std::shared_ptr<basic_set<T>> mouth;
    -
    3989 };
    -
    3990
    -
    3991 using emoticon = basic_emoticon<char>;
    -
    3992 using wemoticon = basic_emoticon<wchar_t>;
    -
    3993#ifdef _UNICODE
    -
    3994 using temoticon = wemoticon;
    -
    3995#else
    -
    3996 using temoticon = emoticon;
    -
    3997#endif
    -
    3998 using sgml_emoticon = basic_emoticon<char>;
    -
    3999
    -
    4003 ENUM_FLAGS(date_format_t, int) {
    -
    4004 none = 0,
    -
    4005 dmy = 0x1,
    -
    4006 mdy = 0x2,
    -
    4007 ymd = 0x4,
    -
    4008 ym = 0x8,
    -
    4009 my = 0x10,
    -
    4010 dm = 0x20,
    -
    4011 md = 0x40,
    -
    4012 };
    -
    4013
    -
    4017 template <class T>
    -
    4018 class basic_date : public basic_parser<T>
    -
    4019 {
    -
    4020 public:
    -
    4021 basic_date(
    -
    4022 _In_ int format_mask,
    -
    4023 _In_ const std::shared_ptr<basic_integer<T>>& _day,
    -
    4024 _In_ const std::shared_ptr<basic_integer<T>>& _month,
    -
    4025 _In_ const std::shared_ptr<basic_integer<T>>& _year,
    -
    4026 _In_ const std::shared_ptr<basic_set<T>>& separator,
    -
    4027 _In_ const std::shared_ptr<basic_parser<T>>& space,
    -
    4028 _In_ const std::locale& locale = std::locale()) :
    -
    4029 basic_parser<T>(locale),
    -
    4030 format(date_format_t::none),
    -
    4031 m_format_mask(format_mask),
    -
    4032 day(_day),
    -
    4033 month(_month),
    -
    4034 year(_year),
    -
    4035 m_separator(separator),
    -
    4036 m_space(space)
    -
    4037 {}
    -
    4038
    -
    4039 virtual bool match(
    -
    4040 _In_reads_or_z_(end) const T* text,
    -
    4041 _In_ size_t start = 0,
    -
    4042 _In_ size_t end = (size_t)-1,
    -
    4043 _In_ int flags = match_default)
    -
    4044 {
    -
    4045 assert(text || start >= end);
    -
    4046
    -
    4047 const int space_match_flags = flags & ~match_multiline; // Spaces in dates must never be broken in new line.
    -
    4048 if ((m_format_mask & date_format_t::dmy) == date_format_t::dmy) {
    -
    4049 if (day->match(text, start, end, flags)) {
    -
    4050 for (interval.end = day->interval.end; m_space->match(text, interval.end, end, space_match_flags); interval.end = m_space->interval.end);
    -
    4051 if (m_separator->match(text, interval.end, end, flags)) {
    -
    4052 size_t hit_offset = m_separator->hit_offset;
    -
    4053 for (interval.end = m_separator->interval.end; m_space->match(text, interval.end, end, space_match_flags); interval.end = m_space->interval.end);
    -
    4054 if (month->match(text, interval.end, end, flags)) {
    -
    4055 for (interval.end = month->interval.end; m_space->match(text, interval.end, end, space_match_flags); interval.end = m_space->interval.end);
    -
    4056 if (m_separator->match(text, interval.end, end, flags) &&
    -
    4057 m_separator->hit_offset == hit_offset) // Both separators must match.
    -
    4058 {
    -
    4059 for (interval.end = m_separator->interval.end; m_space->match(text, interval.end, end, space_match_flags); interval.end = m_space->interval.end);
    -
    4060 if (year->match(text, interval.end, end, flags) &&
    -
    4061 is_valid(day->value, month->value))
    -
    4062 {
    -
    4063 interval.start = start;
    -
    4064 interval.end = year->interval.end;
    -
    4065 format = date_format_t::dmy;
    -
    4066 return true;
    -
    4067 }
    -
    4068 }
    -
    4069 }
    -
    4070 }
    -
    4071 }
    -
    4072 }
    -
    4073
    -
    4074 if ((m_format_mask & date_format_t::mdy) == date_format_t::mdy) {
    -
    4075 if (month->match(text, start, end, flags)) {
    -
    4076 for (interval.end = month->interval.end; m_space->match(text, interval.end, end, space_match_flags); interval.end = m_space->interval.end);
    -
    4077 if (m_separator->match(text, interval.end, end, flags)) {
    -
    4078 size_t hit_offset = m_separator->hit_offset;
    -
    4079 for (interval.end = m_separator->interval.end; m_space->match(text, interval.end, end, space_match_flags); interval.end = m_space->interval.end);
    -
    4080 if (day->match(text, interval.end, end, flags)) {
    -
    4081 for (interval.end = day->interval.end; m_space->match(text, interval.end, end, space_match_flags); interval.end = m_space->interval.end);
    -
    4082 if (m_separator->match(text, interval.end, end, flags) &&
    -
    4083 m_separator->hit_offset == hit_offset) // Both separators must match.
    -
    4084 {
    -
    4085 for (interval.end = m_separator->interval.end; m_space->match(text, interval.end, end, space_match_flags); interval.end = m_space->interval.end);
    -
    4086 if (year->match(text, interval.end, end, flags) &&
    -
    4087 is_valid(day->value, month->value))
    -
    4088 {
    -
    4089 interval.start = start;
    -
    4090 interval.end = year->interval.end;
    -
    4091 format = date_format_t::mdy;
    -
    4092 return true;
    -
    4093 }
    -
    4094 }
    -
    4095 }
    -
    4096 }
    -
    4097 }
    -
    4098 }
    -
    4099
    -
    4100 if ((m_format_mask & date_format_t::ymd) == date_format_t::ymd) {
    -
    4101 if (year->match(text, start, end, flags)) {
    -
    4102 for (interval.end = year->interval.end; m_space->match(text, interval.end, end, space_match_flags); interval.end = m_space->interval.end);
    -
    4103 if (m_separator->match(text, interval.end, end, flags)) {
    -
    4104 size_t hit_offset = m_separator->hit_offset;
    -
    4105 for (interval.end = m_separator->interval.end; m_space->match(text, interval.end, end, space_match_flags); interval.end = m_space->interval.end);
    -
    4106 if (month->match(text, interval.end, end, flags)) {
    -
    4107 for (interval.end = month->interval.end; m_space->match(text, interval.end, end, space_match_flags); interval.end = m_space->interval.end);
    -
    4108 if (m_separator->match(text, interval.end, end, flags) &&
    -
    4109 m_separator->hit_offset == hit_offset) // Both separators must match.
    -
    4110 {
    -
    4111 for (interval.end = m_separator->interval.end; m_space->match(text, interval.end, end, space_match_flags); interval.end = m_space->interval.end);
    -
    4112 if (day->match(text, interval.end, end, flags) &&
    -
    4113 is_valid(day->value, month->value))
    -
    4114 {
    -
    4115 interval.start = start;
    -
    4116 interval.end = day->interval.end;
    -
    4117 format = date_format_t::ymd;
    -
    4118 return true;
    -
    4119 }
    -
    4120 }
    -
    4121 }
    -
    4122 }
    -
    4123 }
    -
    4124 }
    -
    4125
    -
    4126 if ((m_format_mask & date_format_t::ym) == date_format_t::ym) {
    -
    4127 if (year->match(text, start, end, flags)) {
    -
    4128 for (interval.end = year->interval.end; m_space->match(text, interval.end, end, space_match_flags); interval.end = m_space->interval.end);
    -
    4129 if (m_separator->match(text, interval.end, end, flags)) {
    -
    4130 for (interval.end = m_separator->interval.end; m_space->match(text, interval.end, end, space_match_flags); interval.end = m_space->interval.end);
    -
    4131 if (month->match(text, interval.end, end, flags) &&
    -
    4132 is_valid((size_t)-1, month->value))
    -
    4133 {
    -
    4134 if (day) day->invalidate();
    -
    4135 interval.start = start;
    -
    4136 interval.end = month->interval.end;
    -
    4137 format = date_format_t::ym;
    -
    4138 return true;
    -
    4139 }
    -
    4140 }
    -
    4141 }
    -
    4142 }
    -
    4143
    -
    4144 if ((m_format_mask & date_format_t::my) == date_format_t::my) {
    -
    4145 if (month->match(text, start, end, flags)) {
    -
    4146 for (interval.end = month->interval.end; m_space->match(text, interval.end, end, space_match_flags); interval.end = m_space->interval.end);
    -
    4147 if (m_separator->match(text, interval.end, end, flags)) {
    -
    4148 for (interval.end = m_separator->interval.end; m_space->match(text, interval.end, end, space_match_flags); interval.end = m_space->interval.end);
    -
    4149 if (year->match(text, interval.end, end, flags) &&
    -
    4150 is_valid((size_t)-1, month->value))
    -
    4151 {
    -
    4152 if (day) day->invalidate();
    -
    4153 interval.start = start;
    -
    4154 interval.end = year->interval.end;
    -
    4155 format = date_format_t::my;
    -
    4156 return true;
    -
    4157 }
    -
    4158 }
    -
    4159 }
    -
    4160 }
    -
    4161
    -
    4162 if ((m_format_mask & date_format_t::dm) == date_format_t::dm) {
    -
    4163 if (day->match(text, start, end, flags)) {
    -
    4164 for (interval.end = day->interval.end; m_space->match(text, interval.end, end, space_match_flags); interval.end = m_space->interval.end);
    -
    4165 if (m_separator->match(text, interval.end, end, flags)) {
    -
    4166 size_t hit_offset = m_separator->hit_offset;
    -
    4167 for (interval.end = m_separator->interval.end; m_space->match(text, interval.end, end, space_match_flags); interval.end = m_space->interval.end);
    -
    4168 if (month->match(text, interval.end, end, flags) &&
    -
    4169 is_valid(day->value, month->value))
    -
    4170 {
    -
    4171 if (year) year->invalidate();
    -
    4172 interval.start = start;
    -
    4173 for (interval.end = month->interval.end; m_space->match(text, interval.end, end, space_match_flags); interval.end = m_space->interval.end);
    -
    4174 if (m_separator->match(text, interval.end, end, flags) &&
    -
    4175 m_separator->hit_offset == hit_offset) // Both separators must match.
    -
    4176 interval.end = m_separator->interval.end;
    -
    4177 else
    -
    4178 interval.end = month->interval.end;
    -
    4179 format = date_format_t::dm;
    -
    4180 return true;
    -
    4181 }
    -
    4182 }
    -
    4183 }
    -
    4184 }
    -
    4185
    -
    4186 if ((m_format_mask & date_format_t::md) == date_format_t::md) {
    -
    4187 if (month->match(text, start, end, flags)) {
    -
    4188 for (interval.end = month->interval.end; m_space->match(text, interval.end, end, space_match_flags); interval.end = m_space->interval.end);
    -
    4189 if (m_separator->match(text, interval.end, end, flags)) {
    -
    4190 size_t hit_offset = m_separator->hit_offset;
    -
    4191 for (interval.end = m_separator->interval.end; m_space->match(text, interval.end, end, space_match_flags); interval.end = m_space->interval.end);
    -
    4192 if (day->match(text, interval.end, end, flags) &&
    -
    4193 is_valid(day->value, month->value))
    -
    4194 {
    -
    4195 if (year) year->invalidate();
    -
    4196 interval.start = start;
    -
    4197 for (interval.end = day->interval.end; m_space->match(text, interval.end, end, space_match_flags); interval.end = m_space->interval.end);
    -
    4198 if (m_separator->match(text, interval.end, end, flags) &&
    -
    4199 m_separator->hit_offset == hit_offset) // Both separators must match.
    -
    4200 interval.end = m_separator->interval.end;
    -
    4201 else
    -
    4202 interval.end = day->interval.end;
    -
    4203 format = date_format_t::md;
    -
    4204 return true;
    -
    4205 }
    -
    4206 }
    -
    4207 }
    -
    4208 }
    -
    4209
    -
    4210 if (day) day->invalidate();
    -
    4211 if (month) month->invalidate();
    -
    4212 if (year) year->invalidate();
    -
    4213 format = date_format_t::none;
    -
    4214 interval.start = (interval.end = start) + 1;
    -
    4215 return false;
    -
    4216 }
    -
    4217
    -
    4218 virtual void invalidate()
    -
    4219 {
    -
    4220 if (day) day->invalidate();
    -
    4221 if (month) month->invalidate();
    -
    4222 if (year) year->invalidate();
    -
    4223 format = date_format_t::none;
    -
    4224 basic_parser<T>::invalidate();
    -
    4225 }
    -
    4226
    -
    4227 protected:
    -
    4228 static inline bool is_valid(size_t day, size_t month)
    -
    4229 {
    -
    4230 if (month == (size_t)-1) {
    -
    4231 // Default to January. This allows validating day only, as January has all 31 days.
    -
    4232 month = 1;
    -
    4233 }
    -
    4234 if (day == (size_t)-1) {
    -
    4235 // Default to 1st day in month. This allows validating month only, as each month has 1st day.
    -
    4236 day = 1;
    -
    4237 }
    -
    4238
    -
    4239 switch (month) {
    -
    4240 case 1:
    -
    4241 case 3:
    -
    4242 case 5:
    -
    4243 case 7:
    -
    4244 case 8:
    -
    4245 case 10:
    -
    4246 case 12:
    -
    4247 return 1 <= day && day <= 31;
    -
    4248 case 2:
    -
    4249 return 1 <= day && day <= 29;
    -
    4250 case 4:
    -
    4251 case 6:
    -
    4252 case 9:
    -
    4253 case 11:
    -
    4254 return 1 <= day && day <= 30;
    -
    4255 default:
    -
    4256 return false;
    -
    4257 }
    -
    4258 }
    -
    4259
    -
    4260 public:
    -
    4261 date_format_t format;
    -
    4262 std::shared_ptr<basic_integer<T>> day;
    -
    4263 std::shared_ptr<basic_integer<T>> month;
    -
    4264 std::shared_ptr<basic_integer<T>> year;
    -
    4265
    -
    4266 protected:
    -
    4267 int m_format_mask;
    -
    4268 std::shared_ptr<basic_set<T>> m_separator;
    -
    4269 std::shared_ptr<basic_parser<T>> m_space;
    -
    4270 };
    -
    4271
    -
    4272 using date = basic_date<char>;
    -
    4273 using wdate = basic_date<wchar_t>;
    -
    4274#ifdef _UNICODE
    -
    4275 using tdate = wdate;
    -
    4276#else
    -
    4277 using tdate = date;
    -
    4278#endif
    -
    4279 using sgml_date = basic_date<char>;
    -
    4280
    -
    4284 template <class T>
    -
    4285 class basic_time : public basic_parser<T>
    -
    4286 {
    -
    4287 public:
    -
    4288 basic_time(
    -
    4289 _In_ const std::shared_ptr<basic_integer10<T>>& _hour,
    -
    4290 _In_ const std::shared_ptr<basic_integer10<T>>& _minute,
    -
    4291 _In_ const std::shared_ptr<basic_integer10<T>>& _second,
    -
    4292 _In_ const std::shared_ptr<basic_integer10<T>>& _millisecond,
    -
    4293 _In_ const std::shared_ptr<basic_set<T>>& separator,
    -
    4294 _In_ const std::shared_ptr<basic_parser<T>>& millisecond_separator,
    -
    4295 _In_ const std::locale& locale = std::locale()) :
    -
    4296 basic_parser<T>(locale),
    -
    4297 hour(_hour),
    -
    4298 minute(_minute),
    -
    4299 second(_second),
    -
    4300 millisecond(_millisecond),
    -
    4301 m_separator(separator),
    -
    4302 m_millisecond_separator(millisecond_separator)
    -
    4303 {}
    -
    4304
    -
    4305 virtual bool match(
    -
    4306 _In_reads_or_z_(end) const T* text,
    -
    4307 _In_ size_t start = 0,
    -
    4308 _In_ size_t end = (size_t)-1,
    -
    4309 _In_ int flags = match_default)
    -
    4310 {
    -
    4311 assert(text || start >= end);
    -
    4312
    -
    4313 if (hour->match(text, start, end, flags) &&
    -
    4314 m_separator->match(text, hour->interval.end, end, flags) &&
    -
    4315 minute->match(text, m_separator->interval.end, end, flags) &&
    -
    4316 minute->value < 60)
    -
    4317 {
    -
    4318 // hh::mm
    -
    4319 size_t hit_offset = m_separator->hit_offset;
    -
    4320 if (m_separator->match(text, minute->interval.end, end, flags) &&
    -
    4321 m_separator->hit_offset == hit_offset && // Both separators must match.
    -
    4322 second && second->match(text, m_separator->interval.end, end, flags) &&
    -
    4323 second->value < 60)
    -
    4324 {
    -
    4325 // hh::mm:ss
    -
    4326 if (m_millisecond_separator && m_millisecond_separator->match(text, second->interval.end, end, flags) &&
    -
    4327 millisecond && millisecond->match(text, m_millisecond_separator->interval.end, end, flags) &&
    -
    4328 millisecond->value < 1000)
    -
    4329 {
    -
    4330 // hh::mm:ss.mmmm
    -
    4331 interval.end = millisecond->interval.end;
    -
    4332 }
    -
    4333 else {
    -
    4334 if (millisecond) millisecond->invalidate();
    -
    4335 interval.end = second->interval.end;
    -
    4336 }
    -
    4337 }
    -
    4338 else {
    -
    4339 if (second) second->invalidate();
    -
    4340 if (millisecond) millisecond->invalidate();
    -
    4341 interval.end = minute->interval.end;
    -
    4342 }
    -
    4343 interval.start = start;
    -
    4344 return true;
    -
    4345 }
    -
    4346
    -
    4347 hour->invalidate();
    -
    4348 minute->invalidate();
    -
    4349 if (second) second->invalidate();
    -
    4350 if (millisecond) millisecond->invalidate();
    -
    4351 interval.start = (interval.end = start) + 1;
    -
    4352 return false;
    -
    4353 }
    -
    4354
    -
    4355 virtual void invalidate()
    -
    4356 {
    -
    4357 hour->invalidate();
    -
    4358 minute->invalidate();
    -
    4359 if (second) second->invalidate();
    -
    4360 if (millisecond) millisecond->invalidate();
    -
    4361 basic_parser<T>::invalidate();
    -
    4362 }
    -
    4363
    -
    4364 public:
    -
    4365 std::shared_ptr<basic_integer10<T>> hour;
    -
    4366 std::shared_ptr<basic_integer10<T>> minute;
    -
    4367 std::shared_ptr<basic_integer10<T>> second;
    -
    4368 std::shared_ptr<basic_integer10<T>> millisecond;
    -
    4369
    -
    4370 protected:
    -
    4371 std::shared_ptr<basic_set<T>> m_separator;
    -
    4372 std::shared_ptr<basic_parser<T>> m_millisecond_separator;
    -
    4373 };
    -
    4374
    -
    4375 using time = basic_time<char>;
    -
    4376 using wtime = basic_time<wchar_t>;
    -
    4377#ifdef _UNICODE
    -
    4378 using ttime = wtime;
    -
    4379#else
    -
    4380 using ttime = time;
    -
    4381#endif
    -
    4382 using sgml_time = basic_time<char>;
    -
    4383
    -
    4387 template <class T>
    -
    4388 class basic_angle : public basic_parser<T>
    -
    4389 {
    -
    4390 public:
    -
    4391 basic_angle(
    -
    4392 _In_ const std::shared_ptr<basic_integer10<T>>& _degree,
    -
    4393 _In_ const std::shared_ptr<basic_parser<T>>& _degree_separator,
    -
    4394 _In_ const std::shared_ptr<basic_integer10<T>>& _minute,
    -
    4395 _In_ const std::shared_ptr<basic_parser<T>>& _minute_separator,
    -
    4396 _In_ const std::shared_ptr<basic_integer10<T>>& _second,
    -
    4397 _In_ const std::shared_ptr<basic_parser<T>>& _second_separator,
    -
    4398 _In_ const std::shared_ptr<basic_parser<T>>& _decimal,
    -
    4399 _In_ const std::locale& locale = std::locale()) :
    -
    4400 basic_parser<T>(locale),
    -
    4401 degree(_degree),
    -
    4402 degree_separator(_degree_separator),
    -
    4403 minute(_minute),
    -
    4404 minute_separator(_minute_separator),
    -
    4405 second(_second),
    -
    4406 second_separator(_second_separator),
    -
    4407 decimal(_decimal)
    -
    4408 {}
    -
    4409
    -
    4410 virtual bool match(
    -
    4411 _In_reads_or_z_(end) const T* text,
    -
    4412 _In_ size_t start = 0,
    -
    4413 _In_ size_t end = (size_t)-1,
    -
    4414 _In_ int flags = match_default)
    -
    4415 {
    -
    4416 assert(text || start >= end);
    -
    4417
    -
    4418 interval.end = start;
    -
    4419
    -
    4420 if (degree->match(text, interval.end, end, flags) &&
    -
    4421 degree_separator->match(text, degree->interval.end, end, flags))
    -
    4422 {
    -
    4423 // Degrees
    -
    4424 interval.end = degree_separator->interval.end;
    -
    4425 }
    -
    4426 else {
    -
    4427 degree->invalidate();
    -
    4428 degree_separator->invalidate();
    -
    4429 }
    -
    4430
    -
    4431 if (minute->match(text, interval.end, end, flags) &&
    -
    4432 minute->value < 60 &&
    -
    4433 minute_separator->match(text, minute->interval.end, end, flags))
    -
    4434 {
    -
    4435 // Minutes
    -
    4436 interval.end = minute_separator->interval.end;
    -
    4437 }
    -
    4438 else {
    -
    4439 minute->invalidate();
    -
    4440 minute_separator->invalidate();
    -
    4441 }
    -
    4442
    -
    4443 if (second && second->match(text, interval.end, end, flags) &&
    -
    4444 second->value < 60)
    -
    4445 {
    -
    4446 // Seconds
    -
    4447 interval.end = second->interval.end;
    -
    4448 if (second_separator && second_separator->match(text, interval.end, end, flags))
    -
    4449 interval.end = second_separator->interval.end;
    -
    4450 else
    -
    4451 if (second_separator) second_separator->invalidate();
    -
    4452 }
    -
    4453 else {
    -
    4454 if (second) second->invalidate();
    -
    4455 if (second_separator) second_separator->invalidate();
    -
    4456 }
    -
    4457
    -
    4458 if (degree->interval.start < degree->interval.end ||
    -
    4459 minute->interval.start < minute->interval.end ||
    -
    4460 second && second->interval.start < second->interval.end)
    -
    4461 {
    -
    4462 if (decimal && decimal->match(text, interval.end, end, flags)) {
    -
    4463 // Decimals
    -
    4464 interval.end = decimal->interval.end;
    -
    4465 }
    -
    4466 else if (decimal)
    -
    4467 decimal->invalidate();
    -
    4468 interval.start = start;
    -
    4469 return true;
    -
    4470 }
    -
    4471 if (decimal) decimal->invalidate();
    -
    4472 interval.start = (interval.end = start) + 1;
    -
    4473 return false;
    -
    4474 }
    -
    4475
    -
    4476 virtual void invalidate()
    -
    4477 {
    -
    4478 degree->invalidate();
    -
    4479 degree_separator->invalidate();
    -
    4480 minute->invalidate();
    -
    4481 minute_separator->invalidate();
    -
    4482 if (second) second->invalidate();
    -
    4483 if (second_separator) second_separator->invalidate();
    -
    4484 if (decimal) decimal->invalidate();
    -
    4485 basic_parser<T>::invalidate();
    -
    4486 }
    -
    4487
    -
    4488 public:
    -
    4489 std::shared_ptr<basic_integer10<T>> degree;
    -
    4490 std::shared_ptr<basic_parser<T>> degree_separator;
    -
    4491 std::shared_ptr<basic_integer10<T>> minute;
    -
    4492 std::shared_ptr<basic_parser<T>> minute_separator;
    -
    4493 std::shared_ptr<basic_integer10<T>> second;
    -
    4494 std::shared_ptr<basic_parser<T>> second_separator;
    -
    4495 std::shared_ptr<basic_parser<T>> decimal;
    -
    4496 };
    -
    4497
    -
    4498 using angle = basic_angle<char>;
    -
    4499 using wangle = basic_angle<wchar_t>;
    -
    4500#ifdef _UNICODE
    -
    4501 using RRegElKot = wangle;
    -
    4502#else
    -
    4503 using RRegElKot = angle;
    -
    4504#endif
    -
    4505 using sgml_angle = basic_angle<char>;
    -
    4506
    -
    4510 template <class T>
    -
    4511 class basic_phone_number : public basic_parser<T>
    -
    4512 {
    -
    4513 public:
    -
    4514 basic_phone_number(
    -
    4515 _In_ const std::shared_ptr<basic_parser<T>>& digit,
    -
    4516 _In_ const std::shared_ptr<basic_parser<T>>& plus_sign,
    -
    4517 _In_ const std::shared_ptr<basic_set<T>>& lparenthesis,
    -
    4518 _In_ const std::shared_ptr<basic_set<T>>& rparenthesis,
    -
    4519 _In_ const std::shared_ptr<basic_parser<T>>& separator,
    -
    4520 _In_ const std::shared_ptr<basic_parser<T>>& space,
    -
    4521 _In_ const std::locale& locale = std::locale()) :
    -
    4522 basic_parser<T>(locale),
    -
    4523 m_digit(digit),
    -
    4524 m_plus_sign(plus_sign),
    -
    4525 m_lparenthesis(lparenthesis),
    -
    4526 m_rparenthesis(rparenthesis),
    -
    4527 m_separator(separator),
    -
    4528 m_space(space)
    -
    4529 {}
    -
    4530
    -
    4531 virtual bool match(
    -
    4532 _In_reads_or_z_(end) const T* text,
    -
    4533 _In_ size_t start = 0,
    -
    4534 _In_ size_t end = (size_t)-1,
    -
    4535 _In_ int flags = match_default)
    -
    4536 {
    -
    4537 assert(text || start >= end);
    -
    4538
    -
    4539 size_t safe_digit_end = start, safe_value_size = 0;
    -
    4540 bool has_digits = false, after_digit = false, in_parentheses = false, after_parentheses = false;
    -
    4541 const int space_match_flags = flags & ~match_multiline; // Spaces in phone numbers must never be broken in new line.
    -
    4542
    -
    4543 interval.end = start;
    -
    4544 value.clear();
    -
    4545 m_lparenthesis->invalidate();
    -
    4546 m_rparenthesis->invalidate();
    -
    4547
    -
    4548 if (m_plus_sign && m_plus_sign->match(text, interval.end, end, flags)) {
    -
    4549 value.append(text + m_plus_sign->interval.start, text + m_plus_sign->interval.end);
    -
    4550 safe_value_size = value.size();
    -
    4551 interval.end = m_plus_sign->interval.end;
    -
    4552 }
    -
    4553
    -
    4554 for (;;) {
    -
    4555 assert(text || interval.end >= end);
    -
    4556 if (interval.end >= end || !text[interval.end])
    -
    4557 break;
    -
    4558 if (m_digit->match(text, interval.end, end, flags)) {
    -
    4559 // Digit
    -
    4560 value.append(text + m_digit->interval.start, text + m_digit->interval.end);
    -
    4561 interval.end = m_digit->interval.end;
    -
    4562 if (!in_parentheses) {
    -
    4563 safe_digit_end = interval.end;
    -
    4564 safe_value_size = value.size();
    -
    4565 has_digits = true;
    -
    4566 }
    -
    4567 after_digit = true;
    -
    4568 after_parentheses = false;
    -
    4569 }
    -
    4570 else if (
    -
    4571 m_lparenthesis && !m_lparenthesis->interval && // No left parenthesis yet
    -
    4572 m_rparenthesis && !m_rparenthesis->interval && // Right parenthesis after left
    -
    4573 m_lparenthesis->match(text, interval.end, end, flags))
    -
    4574 {
    -
    4575 // Left parenthesis
    -
    4576 value.append(text + m_lparenthesis->interval.start, m_lparenthesis->interval.size());
    -
    4577 interval.end = m_lparenthesis->interval.end;
    -
    4578 in_parentheses = true;
    -
    4579 after_digit = false;
    -
    4580 after_parentheses = false;
    -
    4581 }
    -
    4582 else if (
    -
    4583 in_parentheses && // After left parenthesis
    -
    4584 m_rparenthesis && !m_rparenthesis->interval && // No right parenthesis yet
    -
    4585 m_rparenthesis->match(text, interval.end, end, flags) &&
    -
    4586 m_lparenthesis->hit_offset == m_rparenthesis->hit_offset) // Left and right parentheses must match
    -
    4587 {
    -
    4588 // Right parenthesis
    -
    4589 value.append(text + m_rparenthesis->interval.start, text + m_rparenthesis->interval.end);
    -
    4590 interval.end = m_rparenthesis->interval.end;
    -
    4591 safe_digit_end = interval.end;
    -
    4592 safe_value_size = value.size();
    -
    4593 in_parentheses = false;
    -
    4594 after_digit = false;
    -
    4595 after_parentheses = true;
    -
    4596 }
    -
    4597 else if (
    -
    4598 after_digit &&
    -
    4599 !in_parentheses && // No separators inside parentheses
    -
    4600 !after_parentheses && // No separators following right parenthesis
    -
    4601 m_separator && m_separator->match(text, interval.end, end, flags))
    -
    4602 {
    -
    4603 // Separator
    -
    4604 interval.end = m_separator->interval.end;
    -
    4605 after_digit = false;
    -
    4606 after_parentheses = false;
    -
    4607 }
    -
    4608 else if (
    -
    4609 (after_digit || after_parentheses) &&
    -
    4610 m_space && m_space->match(text, interval.end, end, space_match_flags))
    -
    4611 {
    -
    4612 // Space
    -
    4613 interval.end = m_space->interval.end;
    -
    4614 after_digit = false;
    -
    4615 after_parentheses = false;
    -
    4616 }
    -
    4617 else
    -
    4618 break;
    -
    4619 }
    -
    4620 if (has_digits) {
    -
    4621 value.erase(safe_value_size);
    -
    4622 interval.start = start;
    -
    4623 interval.end = safe_digit_end;
    -
    4624 return true;
    -
    4625 }
    -
    4626 value.clear();
    -
    4627 interval.start = (interval.end = start) + 1;
    -
    4628 return false;
    -
    4629 }
    -
    4630
    -
    4631 virtual void invalidate()
    -
    4632 {
    -
    4633 value.clear();
    -
    4634 basic_parser<T>::invalidate();
    -
    4635 }
    -
    4636
    -
    4637 public:
    -
    4638 std::basic_string<T> value;
    -
    4639
    -
    4640 protected:
    -
    4641 std::shared_ptr<basic_parser<T>> m_digit;
    -
    4642 std::shared_ptr<basic_parser<T>> m_plus_sign;
    -
    4643 std::shared_ptr<basic_set<T>> m_lparenthesis;
    -
    4644 std::shared_ptr<basic_set<T>> m_rparenthesis;
    -
    4645 std::shared_ptr<basic_parser<T>> m_separator;
    -
    4646 std::shared_ptr<basic_parser<T>> m_space;
    -
    4647 };
    -
    4648
    -
    4649 using phone_number = basic_phone_number<char>;
    -
    4650 using wphone_number = basic_phone_number<wchar_t>;
    -
    4651#ifdef _UNICODE
    -
    4652 using tphone_number = wphone_number;
    -
    4653#else
    -
    4654 using tphone_number = phone_number;
    -
    4655#endif
    -
    4656 using sgml_phone_number = basic_phone_number<char>;
    -
    4657
    -
    4661 template <class T>
    -
    4662 class basic_chemical_formula : public basic_parser<T>
    -
    4663 {
    -
    4664 public:
    -
    4665 basic_chemical_formula(
    -
    4666 _In_ const std::shared_ptr<basic_parser<T>>& element,
    -
    4667 _In_ const std::shared_ptr<basic_parser<T>>& digit,
    -
    4668 _In_ const std::shared_ptr<basic_parser<T>>& sign,
    -
    4669 _In_ const std::locale& locale = std::locale()) :
    -
    4670 basic_parser<T>(locale),
    -
    4671 m_element(element),
    -
    4672 m_digit(digit),
    -
    4673 m_sign(sign),
    -
    4674 has_digits(false),
    -
    4675 has_charge(false)
    -
    4676 {}
    -
    4677
    -
    4678 virtual bool match(
    -
    4679 _In_reads_or_z_(end) const T* text,
    -
    4680 _In_ size_t start = 0,
    -
    4681 _In_ size_t end = (size_t)-1,
    -
    4682 _In_ int flags = match_default)
    -
    4683 {
    -
    4684 assert(text || start >= end);
    -
    4685
    -
    4686 has_digits = false;
    -
    4687 has_charge = false;
    -
    4688 interval.end = start;
    -
    4689
    -
    4690 const int element_match_flags = flags & ~match_case_insensitive; // Chemical elements are always case-sensitive.
    -
    4691 for (;;) {
    -
    4692 if (m_element->match(text, interval.end, end, element_match_flags)) {
    -
    4693 interval.end = m_element->interval.end;
    -
    4694 while (m_digit->match(text, interval.end, end, flags)) {
    -
    4695 interval.end = m_digit->interval.end;
    -
    4696 has_digits = true;
    -
    4697 }
    -
    4698 }
    -
    4699 else if (start < interval.end) {
    -
    4700 if (m_sign->match(text, interval.end, end, flags)) {
    -
    4701 interval.end = m_sign->interval.end;
    -
    4702 has_charge = true;
    -
    4703 }
    -
    4704 interval.start = start;
    -
    4705 return true;
    -
    4706 }
    -
    4707 else {
    -
    4708 interval.start = (interval.end = start) + 1;
    -
    4709 return false;
    -
    4710 }
    -
    4711 }
    -
    4712 }
    -
    4713
    -
    4714 virtual void invalidate()
    -
    4715 {
    -
    4716 has_digits = false;
    -
    4717 has_charge = false;
    -
    4718 basic_parser<T>::invalidate();
    -
    4719 }
    -
    4720
    -
    4721 public:
    -
    4722 bool has_digits;
    -
    4723 bool has_charge;
    -
    4724
    -
    4725 protected:
    -
    4726 std::shared_ptr<basic_parser<T>> m_element;
    -
    4727 std::shared_ptr<basic_parser<T>> m_digit;
    -
    4728 std::shared_ptr<basic_parser<T>> m_sign;
    -
    4729 };
    -
    4730
    -
    4731 using chemical_formula = basic_chemical_formula<char>;
    -
    4732 using wchemical_formula = basic_chemical_formula<wchar_t>;
    -
    4733#ifdef _UNICODE
    -
    4734 using tchemical_formula = wchemical_formula;
    -
    4735#else
    -
    4736 using tchemical_formula = chemical_formula;
    -
    4737#endif
    -
    4738 using sgml_chemical_formula = basic_chemical_formula<char>;
    -
    4739
    -
    4743 class http_line_break : public parser
    -
    4744 {
    -
    4745 public:
    -
    4746 virtual bool match(
    -
    4747 _In_reads_or_z_(end) const char* text,
    -
    4748 _In_ size_t start = 0,
    -
    4749 _In_ size_t end = (size_t)-1,
    -
    4750 _In_ int flags = match_default)
    -
    4751 {
    -
    4752 assert(text || start >= end);
    -
    4753 interval.end = start;
    -
    4754
    -
    4755 assert(text || interval.end >= end);
    -
    4756 if (interval.end < end && text[interval.end]) {
    -
    4757 if (text[interval.end] == '\r') {
    -
    4758 interval.end++;
    -
    4759 if (interval.end < end && text[interval.end] == '\n') {
    -
    4760 interval.start = start;
    -
    4761 interval.end++;
    -
    4762 return true;
    -
    4763 }
    -
    4764 }
    -
    4765 else if (text[interval.end] == '\n') {
    -
    4766 interval.start = start;
    -
    4767 interval.end++;
    -
    4768 return true;
    -
    4769 }
    -
    4770 }
    -
    4771 interval.start = (interval.end = start) + 1;
    -
    4772 return false;
    -
    4773 }
    -
    4774 };
    -
    4775
    -
    4779 class http_space : public parser
    -
    4780 {
    -
    4781 public:
    -
    4782 virtual bool match(
    -
    4783 _In_reads_or_z_(end) const char* text,
    -
    4784 _In_ size_t start = 0,
    -
    4785 _In_ size_t end = (size_t)-1,
    -
    4786 _In_ int flags = match_default)
    -
    4787 {
    -
    4788 assert(text || start >= end);
    -
    4789 interval.end = start;
    -
    4790 if (m_line_break.match(text, interval.end, end, flags)) {
    -
    4791 interval.end = m_line_break.interval.end;
    -
    4792 if (interval.end < end && text[interval.end] && isspace(text[interval.end])) {
    -
    4793 interval.start = start;
    -
    4794 interval.end++;
    -
    4795 while (interval.end < end && text[interval.end] && isspace(text[interval.end])) interval.end++;
    -
    4796 return true;
    -
    4797 }
    -
    4798 }
    -
    4799 else if (interval.end < end && text[interval.end] && isspace(text[interval.end])) {
    -
    4800 interval.start = start;
    -
    4801 interval.end++;
    -
    4802 while (interval.end < end && text[interval.end] && isspace(text[interval.end])) interval.end++;
    -
    4803 return true;
    -
    4804 }
    -
    4805 interval.start = (interval.end = start) + 1;
    -
    4806 return false;
    -
    4807 }
    -
    4808
    -
    4809 protected:
    -
    4810 http_line_break m_line_break;
    -
    4811 };
    -
    4812
    -
    4816 class http_text_char : public parser
    -
    4817 {
    -
    4818 public:
    -
    4819 virtual bool match(
    -
    4820 _In_reads_or_z_(end) const char* text,
    -
    4821 _In_ size_t start = 0,
    -
    4822 _In_ size_t end = (size_t)-1,
    -
    4823 _In_ int flags = match_default)
    -
    4824 {
    -
    4825 assert(text || start >= end);
    -
    4826 interval.end = start;
    -
    4827
    -
    4828 assert(text || interval.end >= end);
    -
    4829 if (m_space.match(text, interval.end, end, flags)) {
    -
    4830 interval.start = start;
    -
    4831 interval.end = m_space.interval.end;
    -
    4832 return true;
    -
    4833 }
    -
    4834 else if (interval.end < end && text[interval.end] && text[interval.end] >= 0x20) {
    -
    4835 interval.start = start;
    -
    4836 interval.end++;
    -
    4837 return true;
    -
    4838 }
    -
    4839 interval.start = (interval.end = start) + 1;
    -
    4840 return false;
    -
    4841 }
    -
    4842
    -
    4843 protected:
    -
    4844 http_space m_space;
    -
    4845 };
    -
    4846
    -
    4850 class http_token : public parser
    -
    4851 {
    -
    4852 public:
    -
    4853 virtual bool match(
    -
    4854 _In_reads_or_z_(end) const char* text,
    -
    4855 _In_ size_t start = 0,
    -
    4856 _In_ size_t end = (size_t)-1,
    -
    4857 _In_ int flags = match_default)
    -
    4858 {
    -
    4859 assert(text || start >= end);
    -
    4860 interval.end = start;
    -
    4861 for (;;) {
    -
    4862 if (interval.end < end && text[interval.end]) {
    -
    4863 if ((unsigned int)text[interval.end] < 0x20 ||
    -
    4864 (unsigned int)text[interval.end] == 0x7f ||
    -
    4865 text[interval.end] == '(' ||
    -
    4866 text[interval.end] == ')' ||
    -
    4867 text[interval.end] == '<' ||
    -
    4868 text[interval.end] == '>' ||
    -
    4869 text[interval.end] == '@' ||
    -
    4870 text[interval.end] == ',' ||
    -
    4871 text[interval.end] == ';' ||
    -
    4872 text[interval.end] == ':' ||
    -
    4873 text[interval.end] == '\\' ||
    -
    4874 text[interval.end] == '\"' ||
    -
    4875 text[interval.end] == '/' ||
    -
    4876 text[interval.end] == '[' ||
    -
    4877 text[interval.end] == ']' ||
    -
    4878 text[interval.end] == '?' ||
    -
    4879 text[interval.end] == '=' ||
    -
    4880 text[interval.end] == '{' ||
    -
    4881 text[interval.end] == '}' ||
    -
    4882 isspace(text[interval.end]))
    -
    4883 break;
    -
    4884 else
    -
    4885 interval.end++;
    -
    4886 }
    -
    4887 else
    -
    4888 break;
    -
    4889 }
    -
    4890 if (start < interval.end) {
    -
    4891 interval.start = start;
    -
    4892 return true;
    -
    4893 }
    -
    4894 else {
    -
    4895 interval.start = (interval.end = start) + 1;
    -
    4896 return false;
    -
    4897 }
    -
    4898 }
    -
    4899 };
    -
    4900
    -
    4904 class http_quoted_string : public parser
    -
    4905 {
    -
    4906 public:
    -
    4907 virtual bool match(
    -
    4908 _In_reads_or_z_(end) const char* text,
    -
    4909 _In_ size_t start = 0,
    -
    4910 _In_ size_t end = (size_t)-1,
    -
    4911 _In_ int flags = match_default)
    -
    4912 {
    -
    4913 assert(text || start >= end);
    -
    4914 interval.end = start;
    -
    4915 if (interval.end < end && text[interval.end] != '"')
    -
    4916 goto error;
    -
    4917 interval.end++;
    -
    4918 content.start = interval.end;
    -
    4919 for (;;) {
    -
    4920 assert(text || interval.end >= end);
    -
    4921 if (interval.end < end && text[interval.end]) {
    -
    4922 if (text[interval.end] == '"') {
    -
    4923 content.end = interval.end;
    -
    4924 interval.end++;
    -
    4925 break;
    -
    4926 }
    -
    4927 else if (text[interval.end] == '\\') {
    -
    4928 interval.end++;
    -
    4929 if (interval.end < end && text[interval.end]) {
    -
    4930 interval.end++;
    -
    4931 }
    -
    4932 else
    -
    4933 goto error;
    -
    4934 }
    -
    4935 else if (m_chr.match(text, interval.end, end, flags))
    -
    4936 interval.end++;
    -
    4937 else
    -
    4938 goto error;
    -
    4939 }
    -
    4940 else
    -
    4941 goto error;
    -
    4942 }
    -
    4943 interval.start = start;
    -
    4944 return true;
    -
    4945
    -
    4946 error:
    -
    4947 content.start = 1;
    -
    4948 content.end = 0;
    -
    4949 interval.start = (interval.end = start) + 1;
    -
    4950 return false;
    -
    4951 }
    -
    4952
    -
    4953 virtual void invalidate()
    -
    4954 {
    -
    4955 content.start = 1;
    -
    4956 content.end = 0;
    -
    4957 parser::invalidate();
    -
    4958 }
    -
    4959
    -
    4960 public:
    -
    4961 stdex::interval<size_t> content;
    -
    4962
    -
    4963 protected:
    -
    4964 http_text_char m_chr;
    -
    4965 };
    -
    4966
    -
    4970 class http_value : public parser
    -
    4971 {
    -
    4972 public:
    -
    4973 virtual bool match(
    -
    4974 _In_reads_or_z_(end) const char* text,
    -
    4975 _In_ size_t start = 0,
    -
    4976 _In_ size_t end = (size_t)-1,
    -
    4977 _In_ int flags = match_default)
    -
    4978 {
    -
    4979 assert(text || start >= end);
    -
    4980 interval.end = start;
    -
    4981 if (string.match(text, interval.end, end, flags)) {
    -
    4982 token.invalidate();
    -
    4983 interval.end = string.interval.end;
    -
    4984 interval.start = start;
    -
    4985 return true;
    -
    4986 }
    -
    4987 else if (token.match(text, interval.end, end, flags)) {
    -
    4988 string.invalidate();
    -
    4989 interval.end = token.interval.end;
    -
    4990 interval.start = start;
    -
    4991 return true;
    -
    4992 }
    -
    4993 else {
    -
    4994 interval.start = (interval.end = start) + 1;
    -
    4995 return false;
    -
    4996 }
    -
    4997 }
    -
    4998
    -
    4999 virtual void invalidate()
    -
    5000 {
    -
    5001 string.invalidate();
    -
    5002 token.invalidate();
    -
    5003 parser::invalidate();
    -
    5004 }
    -
    5005
    -
    5006 public:
    -
    5007 http_quoted_string string;
    -
    5008 http_token token;
    -
    5009 };
    -
    5010
    -
    5014 class http_parameter : public parser
    -
    5015 {
    -
    5016 public:
    -
    5017 virtual bool match(
    -
    5018 _In_reads_or_z_(end) const char* text,
    -
    5019 _In_ size_t start = 0,
    -
    5020 _In_ size_t end = (size_t)-1,
    -
    5021 _In_ int flags = match_default)
    -
    5022 {
    -
    5023 assert(text || start >= end);
    -
    5024 interval.end = start;
    -
    5025 if (name.match(text, interval.end, end, flags))
    -
    5026 interval.end = name.interval.end;
    -
    5027 else
    -
    5028 goto error;
    -
    5029 while (m_space.match(text, interval.end, end, flags))
    -
    5030 interval.end = m_space.interval.end;
    -
    5031 assert(text || interval.end >= end);
    -
    5032 if (interval.end < end && text[interval.end] == '=')
    -
    5033 interval.end++;
    -
    5034 else
    -
    5035 while (m_space.match(text, interval.end, end, flags))
    -
    5036 interval.end = m_space.interval.end;
    -
    5037 if (value.match(text, interval.end, end, flags))
    -
    5038 interval.end = value.interval.end;
    -
    5039 else
    -
    5040 goto error;
    -
    5041 interval.start = start;
    -
    5042 return true;
    -
    5043
    -
    5044 error:
    -
    5045 name.invalidate();
    -
    5046 value.invalidate();
    -
    5047 interval.start = (interval.end = start) + 1;
    -
    5048 return false;
    -
    5049 }
    -
    5050
    -
    5051 virtual void invalidate()
    -
    5052 {
    -
    5053 name.invalidate();
    -
    5054 value.invalidate();
    -
    5055 parser::invalidate();
    -
    5056 }
    -
    5057
    -
    5058 public:
    -
    5059 http_token name;
    -
    5060 http_value value;
    -
    5061
    -
    5062 protected:
    -
    5063 http_space m_space;
    -
    5064 };
    -
    5065
    -
    5069 class http_any_type : public parser
    -
    5070 {
    -
    5071 public:
    -
    5072 virtual bool match(
    -
    5073 _In_reads_or_z_(end) const char* text,
    -
    5074 _In_ size_t start = 0,
    -
    5075 _In_ size_t end = (size_t)-1,
    -
    5076 _In_ int flags = match_default)
    -
    5077 {
    -
    5078 assert(text || start >= end);
    -
    5079 if (start + 2 < end &&
    -
    5080 text[start] == '*' &&
    -
    5081 text[start + 1] == '/' &&
    -
    5082 text[start + 2] == '*')
    -
    5083 {
    -
    5084 interval.end = (interval.start = start) + 3;
    -
    5085 return true;
    -
    5086 }
    -
    5087 else if (start < end && text[start] == '*') {
    -
    5088 interval.end = (interval.start = start) + 1;
    -
    5089 return true;
    -
    5090 }
    -
    5091 else {
    -
    5092 interval.start = (interval.end = start) + 1;
    -
    5093 return false;
    -
    5094 }
    -
    5095 }
    -
    5096 };
    -
    5097
    -
    5101 class http_media_range : public parser
    -
    5102 {
    -
    5103 public:
    -
    5104 virtual bool match(
    -
    5105 _In_reads_or_z_(end) const char* text,
    -
    5106 _In_ size_t start = 0,
    -
    5107 _In_ size_t end = (size_t)-1,
    -
    5108 _In_ int flags = match_default)
    -
    5109 {
    -
    5110 assert(text || start >= end);
    -
    5111 interval.end = start;
    -
    5112 if (type.match(text, interval.end, end, flags))
    -
    5113 interval.end = type.interval.end;
    -
    5114 else
    -
    5115 goto error;
    -
    5116 while (m_space.match(text, interval.end, end, flags))
    -
    5117 interval.end = m_space.interval.end;
    -
    5118 if (interval.end < end && text[interval.end] == '/')
    -
    5119 interval.end++;
    -
    5120 else
    -
    5121 goto error;
    -
    5122 while (m_space.match(text, interval.end, end, flags))
    -
    5123 interval.end = m_space.interval.end;
    -
    5124 if (subtype.match(text, interval.end, end, flags))
    -
    5125 interval.end = subtype.interval.end;
    -
    5126 else
    -
    5127 goto error;
    -
    5128 interval.start = start;
    -
    5129 return true;
    -
    5130
    -
    5131 error:
    -
    5132 type.invalidate();
    -
    5133 subtype.invalidate();
    -
    5134 interval.start = (interval.end = start) + 1;
    -
    5135 return false;
    -
    5136 }
    -
    5137
    -
    5138 virtual void invalidate()
    -
    5139 {
    -
    5140 type.invalidate();
    -
    5141 subtype.invalidate();
    -
    5142 parser::invalidate();
    -
    5143 }
    -
    5144
    -
    5145 public:
    -
    5146 http_token type;
    -
    5147 http_token subtype;
    -
    5148
    -
    5149 protected:
    -
    5150 http_space m_space;
    -
    5151 };
    -
    5152
    -
    5156 class http_media_type : public http_media_range
    -
    5157 {
    -
    5158 public:
    -
    5159 virtual bool match(
    -
    5160 _In_reads_or_z_(end) const char* text,
    -
    5161 _In_ size_t start = 0,
    -
    5162 _In_ size_t end = (size_t)-1,
    -
    5163 _In_ int flags = match_default)
    -
    5164 {
    -
    5165 assert(text || start >= end);
    -
    5166 if (!http_media_range::match(text, start, end, flags))
    -
    5167 goto error;
    -
    5168 params.clear();
    -
    5169 for (;;) {
    -
    5170 if (interval.end < end && text[interval.end]) {
    -
    5171 if (m_space.match(text, interval.end, end, flags))
    -
    5172 interval.end = m_space.interval.end;
    -
    5173 else if (text[interval.end] == ';') {
    -
    5174 interval.end++;
    -
    5175 while (m_space.match(text, interval.end, end, flags))
    -
    5176 interval.end = m_space.interval.end;
    -
    5177 http_parameter param;
    -
    5178 if (param.match(text, interval.end, end, flags)) {
    -
    5179 interval.end = param.interval.end;
    -
    5180 params.push_back(std::move(param));
    -
    5181 }
    -
    5182 else
    -
    5183 break;
    -
    5184 }
    -
    5185 else
    -
    5186 break;
    -
    5187 }
    -
    5188 else
    -
    5189 break;
    -
    5190 }
    -
    5191 interval.end = params.empty() ? subtype.interval.end : params.back().interval.end;
    -
    5192 return true;
    -
    5193
    -
    5194 error:
    -
    5195 http_media_range::invalidate();
    -
    5196 params.clear();
    -
    5197 interval.start = (interval.end = start) + 1;
    -
    5198 return false;
    -
    5199 }
    -
    5200
    -
    5201 virtual void invalidate()
    -
    5202 {
    -
    5203 params.clear();
    -
    5204 http_media_range::invalidate();
    -
    5205 }
    -
    5206
    -
    5207 public:
    -
    5208 std::list<http_parameter> params;
    -
    5209 };
    -
    5210
    -
    5214 class http_url_server : public parser
    -
    5215 {
    -
    5216 public:
    -
    5217 virtual bool match(
    -
    5218 _In_reads_or_z_(end) const char* text,
    -
    5219 _In_ size_t start = 0,
    -
    5220 _In_ size_t end = (size_t)-1,
    -
    5221 _In_ int flags = match_default)
    -
    5222 {
    -
    5223 assert(text || start >= end);
    -
    5224 interval.end = start;
    -
    5225 for (;;) {
    -
    5226 if (interval.end < end && text[interval.end]) {
    -
    5227 if ((unsigned int)text[interval.end] < 0x20 ||
    -
    5228 (unsigned int)text[interval.end] == 0x7f ||
    -
    5229 text[interval.end] == ':' ||
    -
    5230 text[interval.end] == '/' ||
    -
    5231 isspace(text[interval.end]))
    -
    5232 break;
    -
    5233 else
    -
    5234 interval.end++;
    -
    5235 }
    -
    5236 else
    -
    5237 break;
    -
    5238 }
    -
    5239 if (start < interval.end) {
    -
    5240 interval.start = start;
    -
    5241 return true;
    -
    5242 }
    -
    5243 interval.start = (interval.end = start) + 1;
    -
    5244 return false;
    -
    5245 }
    -
    5246 };
    -
    5247
    -
    5251 class http_url_port : public parser
    -
    5252 {
    -
    5253 public:
    -
    5254 http_url_port(_In_ const std::locale& locale = std::locale()) :
    -
    5255 parser(locale),
    -
    5256 value(0)
    -
    5257 {}
    -
    5258
    -
    5259 virtual bool match(
    -
    5260 _In_reads_or_z_(end) const char* text,
    -
    5261 _In_ size_t start = 0,
    -
    5262 _In_ size_t end = (size_t)-1,
    -
    5263 _In_ int flags = match_default)
    -
    5264 {
    -
    5265 assert(text || start >= end);
    -
    5266 value = 0;
    -
    5267 interval.end = start;
    -
    5268 for (;;) {
    -
    5269 if (interval.end < end && text[interval.end]) {
    -
    5270 if ('0' <= text[interval.end] && text[interval.end] <= '9') {
    -
    5271 size_t _value = (size_t)value * 10 + text[interval.end] - '0';
    -
    5272 if (_value > (uint16_t)-1) {
    -
    5273 value = 0;
    -
    5274 interval.start = (interval.end = start) + 1;
    -
    5275 return false;
    -
    5276 }
    -
    5277 value = (uint16_t)_value;
    -
    5278 interval.end++;
    -
    5279 }
    -
    5280 else
    -
    5281 break;
    -
    5282 }
    -
    5283 else
    -
    5284 break;
    -
    5285 }
    -
    5286 if (start < interval.end) {
    -
    5287 interval.start = start;
    -
    5288 return true;
    -
    5289 }
    -
    5290 interval.start = (interval.end = start) + 1;
    -
    5291 return false;
    -
    5292 }
    -
    5293
    -
    5294 virtual void invalidate()
    -
    5295 {
    -
    5296 value = 0;
    -
    5297 parser::invalidate();
    -
    5298 }
    -
    5299
    -
    5300 public:
    -
    5301 uint16_t value;
    -
    5302 };
    -
    5303
    -
    5307 class http_url_path_segment : public parser
    -
    5308 {
    -
    5309 public:
    -
    5310 virtual bool match(
    -
    5311 _In_reads_or_z_(end) const char* text,
    -
    5312 _In_ size_t start = 0,
    -
    5313 _In_ size_t end = (size_t)-1,
    -
    5314 _In_ int flags = match_default)
    -
    5315 {
    -
    5316 assert(text || start >= end);
    -
    5317 interval.end = start;
    -
    5318 for (;;) {
    -
    5319 if (interval.end < end && text[interval.end]) {
    -
    5320 if ((unsigned int)text[interval.end] < 0x20 ||
    -
    5321 (unsigned int)text[interval.end] == 0x7f ||
    -
    5322 text[interval.end] == '?' ||
    -
    5323 text[interval.end] == '/' ||
    -
    5324 isspace(text[interval.end]))
    -
    5325 break;
    -
    5326 else
    -
    5327 interval.end++;
    -
    5328 }
    -
    5329 else
    -
    5330 break;
    -
    5331 }
    -
    5332 interval.start = start;
    -
    5333 return true;
    -
    5334 }
    -
    5335 };
    -
    5336
    -
    5340 class http_url_path : public parser
    -
    5341 {
    -
    5342 public:
    -
    5343 virtual bool match(
    -
    5344 _In_reads_or_z_(end) const char* text,
    -
    5345 _In_ size_t start = 0,
    -
    5346 _In_ size_t end = (size_t)-1,
    -
    5347 _In_ int flags = match_default)
    -
    5348 {
    -
    5349 assert(text || start >= end);
    -
    5350 http_url_path_segment s;
    -
    5351 interval.end = start;
    -
    5352 segments.clear();
    -
    5353 assert(text || interval.end >= end);
    -
    5354 if (interval.end < end && text[interval.end] != '/')
    -
    5355 goto error;
    -
    5356 interval.end++;
    -
    5357 s.match(text, interval.end, end, flags);
    -
    5358 segments.push_back(s);
    -
    5359 interval.end = s.interval.end;
    -
    5360 for (;;) {
    -
    5361 if (interval.end < end && text[interval.end]) {
    -
    5362 if (text[interval.end] == '/') {
    -
    5363 interval.end++;
    -
    5364 s.match(text, interval.end, end, flags);
    -
    5365 segments.push_back(s);
    -
    5366 interval.end = s.interval.end;
    -
    5367 }
    -
    5368 else
    -
    5369 break;
    -
    5370 }
    -
    5371 else
    -
    5372 break;
    -
    5373 }
    -
    5374 interval.start = start;
    -
    5375 return true;
    -
    5376
    -
    5377 error:
    -
    5378 segments.clear();
    -
    5379 interval.start = (interval.end = start) + 1;
    -
    5380 return false;
    -
    5381 }
    -
    5382
    -
    5383 virtual void invalidate()
    -
    5384 {
    -
    5385 segments.clear();
    -
    5386 parser::invalidate();
    -
    5387 }
    -
    5388
    -
    5389 public:
    -
    5390 std::vector<http_url_path_segment> segments;
    -
    5391 };
    -
    5392
    -
    5396 class http_url_parameter : public parser
    -
    5397 {
    -
    5398 public:
    -
    5399 virtual bool match(
    -
    5400 _In_reads_or_z_(end) const char* text,
    -
    5401 _In_ size_t start = 0,
    -
    5402 _In_ size_t end = (size_t)-1,
    -
    5403 _In_ int flags = match_default)
    -
    5404 {
    -
    5405 assert(text || start >= end);
    -
    5406 interval.end = start;
    -
    5407 name.start = interval.end;
    -
    5408 for (;;) {
    -
    5409 if (interval.end < end && text[interval.end]) {
    -
    5410 if ((unsigned int)text[interval.end] < 0x20 ||
    -
    5411 (unsigned int)text[interval.end] == 0x7f ||
    -
    5412 text[interval.end] == '&' ||
    -
    5413 text[interval.end] == '=' ||
    -
    5414 isspace(text[interval.end]))
    -
    5415 break;
    -
    5416 else
    -
    5417 interval.end++;
    -
    5418 }
    -
    5419 else
    -
    5420 break;
    -
    5421 }
    -
    5422 if (start < interval.end)
    -
    5423 name.end = interval.end;
    -
    5424 else
    -
    5425 goto error;
    -
    5426 if (text[interval.end] == '=') {
    -
    5427 interval.end++;
    -
    5428 value.start = interval.end;
    -
    5429 for (;;) {
    -
    5430 if (interval.end < end && text[interval.end]) {
    -
    5431 if ((unsigned int)text[interval.end] < 0x20 ||
    -
    5432 (unsigned int)text[interval.end] == 0x7f ||
    -
    5433 text[interval.end] == '&' ||
    -
    5434 isspace(text[interval.end]))
    -
    5435 break;
    -
    5436 else
    -
    5437 interval.end++;
    -
    5438 }
    -
    5439 else
    -
    5440 break;
    -
    5441 }
    -
    5442 value.end = interval.end;
    -
    5443 }
    -
    5444 else {
    -
    5445 value.start = 1;
    -
    5446 value.end = 0;
    -
    5447 }
    -
    5448 interval.start = start;
    -
    5449 return true;
    -
    5450
    -
    5451 error:
    -
    5452 name.start = 1;
    -
    5453 name.end = 0;
    -
    5454 value.start = 1;
    -
    5455 value.end = 0;
    -
    5456 interval.start = (interval.end = start) + 1;
    -
    5457 return false;
    -
    5458 }
    -
    5459
    -
    5460 virtual void invalidate()
    -
    5461 {
    -
    5462 name.start = 1;
    -
    5463 name.end = 0;
    -
    5464 value.start = 1;
    -
    5465 value.end = 0;
    -
    5466 parser::invalidate();
    -
    5467 }
    -
    5468
    -
    5469 public:
    -
    5470 stdex::interval<size_t> name;
    -
    5471 stdex::interval<size_t> value;
    -
    5472 };
    -
    5473
    -
    5477 class http_url : public parser
    -
    5478 {
    -
    5479 public:
    -
    5480 http_url(_In_ const std::locale& locale = std::locale()) :
    -
    5481 parser(locale),
    -
    5482 port(locale)
    -
    5483 {}
    -
    5484
    -
    5485 virtual bool match(
    -
    5486 _In_reads_or_z_(end) const char* text,
    -
    5487 _In_ size_t start = 0,
    -
    5488 _In_ size_t end = (size_t)-1,
    -
    5489 _In_ int flags = match_default)
    -
    5490 {
    -
    5491 assert(text || start >= end);
    -
    5492 interval.end = start;
    -
    5493
    -
    5494 if (interval.end + 7 <= end && stdex::strnicmp(text + interval.end, 7, "http://", (size_t)-1, m_locale) == 0) {
    -
    5495 interval.end += 7;
    -
    5496 if (server.match(text, interval.end, end, flags))
    -
    5497 interval.end = server.interval.end;
    -
    5498 else
    -
    5499 goto error;
    -
    5500 if (interval.end < end && text[interval.end] == ':') {
    -
    5501 interval.end++;
    -
    5502 if (port.match(text, interval.end, end, flags))
    -
    5503 interval.end = port.interval.end;
    -
    5504 }
    -
    5505 else {
    -
    5506 port.invalidate();
    -
    5507 port.value = 80;
    -
    5508 }
    -
    5509 }
    -
    5510 else {
    -
    5511 server.invalidate();
    -
    5512 port.invalidate();
    -
    5513 port.value = 80;
    -
    5514 }
    -
    5515
    -
    5516 if (path.match(text, interval.end, end, flags))
    -
    5517 interval.end = path.interval.end;
    -
    5518 else
    -
    5519 goto error;
    -
    5520
    -
    5521 params.clear();
    -
    5522
    -
    5523 if (interval.end < end && text[interval.end] == '?') {
    -
    5524 interval.end++;
    -
    5525 for (;;) {
    -
    5526 if (interval.end < end && text[interval.end]) {
    -
    5527 if ((unsigned int)text[interval.end] < 0x20 ||
    -
    5528 (unsigned int)text[interval.end] == 0x7f ||
    -
    5529 isspace(text[interval.end]))
    -
    5530 break;
    -
    5531 else if (text[interval.end] == '&')
    -
    5532 interval.end++;
    -
    5533 else {
    -
    5534 http_url_parameter param;
    -
    5535 if (param.match(text, interval.end, end, flags)) {
    -
    5536 interval.end = param.interval.end;
    -
    5537 params.push_back(std::move(param));
    -
    5538 }
    -
    5539 else
    -
    5540 break;
    -
    5541 }
    -
    5542 }
    -
    5543 else
    -
    5544 break;
    -
    5545 }
    -
    5546 }
    -
    5547
    -
    5548 interval.start = start;
    -
    5549 return true;
    -
    5550
    -
    5551 error:
    -
    5552 server.invalidate();
    -
    5553 port.invalidate();
    -
    5554 path.invalidate();
    -
    5555 params.clear();
    -
    5556 interval.start = (interval.end = start) + 1;
    -
    5557 return false;
    -
    5558 }
    -
    5559
    -
    5560 virtual void invalidate()
    -
    5561 {
    -
    5562 server.invalidate();
    -
    5563 port.invalidate();
    -
    5564 path.invalidate();
    -
    5565 params.clear();
    -
    5566 parser::invalidate();
    -
    5567 }
    -
    5568
    -
    5569 public:
    -
    5570 http_url_server server;
    -
    5571 http_url_port port;
    -
    5572 http_url_path path;
    -
    5573 std::list<http_url_parameter> params;
    -
    5574 };
    -
    5575
    -
    5579 class http_language : public parser
    -
    5580 {
    -
    5581 public:
    -
    5582 virtual bool match(
    -
    5583 _In_reads_or_z_(end) const char* text,
    -
    5584 _In_ size_t start = 0,
    -
    5585 _In_ size_t end = (size_t)-1,
    -
    5586 _In_ int flags = match_default)
    -
    5587 {
    -
    5588 assert(text || start >= end);
    -
    5589 interval.end = start;
    -
    5590 components.clear();
    -
    5591 for (;;) {
    -
    5592 if (interval.end < end && text[interval.end]) {
    -
    5593 stdex::interval<size_t> k;
    -
    5594 k.end = interval.end;
    -
    5595 for (;;) {
    -
    5596 if (k.end < end && text[k.end]) {
    -
    5597 if (isalpha(text[k.end]))
    -
    5598 k.end++;
    -
    5599 else
    -
    5600 break;
    -
    5601 }
    -
    5602 else
    -
    5603 break;
    -
    5604 }
    -
    5605 if (interval.end < k.end) {
    -
    5606 k.start = interval.end;
    -
    5607 interval.end = k.end;
    -
    5608 components.push_back(k);
    -
    5609 }
    -
    5610 else
    -
    5611 break;
    -
    5612 if (interval.end < end && text[interval.end] == '-')
    -
    5613 interval.end++;
    -
    5614 else
    -
    5615 break;
    -
    5616 }
    -
    5617 else
    -
    5618 break;
    -
    5619 }
    -
    5620 if (!components.empty()) {
    -
    5621 interval.start = start;
    -
    5622 interval.end = components.back().end;
    -
    5623 return true;
    -
    5624 }
    -
    5625 interval.start = (interval.end = start) + 1;
    -
    5626 return false;
    -
    5627 }
    -
    5628
    -
    5629 virtual void invalidate()
    -
    5630 {
    -
    5631 components.clear();
    -
    5632 parser::invalidate();
    -
    5633 }
    -
    5634
    -
    5635 public:
    -
    5636 std::vector<stdex::interval<size_t>> components;
    -
    5637 };
    -
    5638
    -
    5642 class http_weight : public parser
    -
    5643 {
    -
    5644 public:
    -
    5645 http_weight(_In_ const std::locale& locale = std::locale()) :
    -
    5646 parser(locale),
    -
    5647 value(1.0f)
    -
    5648 {}
    -
    5649
    -
    5650 virtual bool match(
    -
    5651 _In_reads_or_z_(end) const char* text,
    -
    5652 _In_ size_t start = 0,
    -
    5653 _In_ size_t end = (size_t)-1,
    -
    5654 _In_ int flags = match_default)
    -
    5655 {
    -
    5656 assert(text || start >= end);
    -
    5657 size_t celi_del = 0, decimalni_del = 0, decimalni_del_n = 1;
    -
    5658 interval.end = start;
    -
    5659 for (;;) {
    -
    5660 if (interval.end < end && text[interval.end]) {
    -
    5661 if ('0' <= text[interval.end] && text[interval.end] <= '9') {
    -
    5662 celi_del = celi_del * 10 + text[interval.end] - '0';
    -
    5663 interval.end++;
    -
    5664 }
    -
    5665 else if (text[interval.end] == '.') {
    -
    5666 interval.end++;
    -
    5667 for (;;) {
    -
    5668 if (interval.end < end && text[interval.end]) {
    -
    5669 if ('0' <= text[interval.end] && text[interval.end] <= '9') {
    -
    5670 decimalni_del = decimalni_del * 10 + text[interval.end] - '0';
    -
    5671 decimalni_del_n *= 10;
    -
    5672 interval.end++;
    -
    5673 }
    -
    5674 else
    -
    5675 break;
    -
    5676 }
    -
    5677 else
    -
    5678 break;
    -
    5679 }
    -
    5680 break;
    -
    5681 }
    -
    5682 else
    -
    5683 break;
    -
    5684 }
    -
    5685 else
    -
    5686 break;
    -
    5687 }
    -
    5688 if (start < interval.end) {
    -
    5689 value = (float)((double)celi_del + (double)decimalni_del / decimalni_del_n);
    -
    5690 interval.start = start;
    -
    5691 return true;
    -
    5692 }
    -
    5693 value = 1.0f;
    -
    5694 interval.start = (interval.end = start) + 1;
    -
    5695 return false;
    -
    5696 }
    -
    5697
    -
    5698 virtual void invalidate()
    -
    5699 {
    -
    5700 value = 1.0f;
    -
    5701 parser::invalidate();
    -
    5702 }
    -
    5703
    -
    5704 public:
    -
    5705 float value;
    -
    5706 };
    -
    5707
    -
    5711 class http_asterisk : public parser
    -
    5712 {
    -
    5713 public:
    -
    5714 virtual bool match(
    -
    5715 _In_reads_or_z_(end) const char* text,
    -
    5716 _In_ size_t start = 0,
    -
    5717 _In_ size_t end = (size_t)-1,
    -
    5718 _In_ int flags = match_default)
    -
    5719 {
    -
    5720 assert(text || end <= start);
    -
    5721 if (start < end && text[start] == '*') {
    -
    5722 interval.end = (interval.start = start) + 1;
    -
    5723 return true;
    -
    5724 }
    -
    5725 interval.start = (interval.end = start) + 1;
    -
    5726 return false;
    -
    5727 }
    -
    5728 };
    -
    5729
    -
    5733 template <class T, class T_asterisk = http_asterisk>
    -
    5734 class http_weighted_value : public parser
    -
    5735 {
    -
    5736 public:
    -
    5737 http_weighted_value(_In_ const std::locale& locale = std::locale()) :
    -
    5738 parser(locale),
    -
    5739 factor(locale)
    -
    5740 {}
    -
    5741
    -
    5742 virtual bool match(
    -
    5743 _In_reads_or_z_(end) const char* text,
    -
    5744 _In_ size_t start = 0,
    -
    5745 _In_ size_t end = (size_t)-1,
    -
    5746 _In_ int flags = match_default)
    -
    5747 {
    -
    5748 assert(text || start >= end);
    -
    5749 size_t konec_vrednosti;
    -
    5750 interval.end = start;
    -
    5751 if (asterisk.match(text, interval.end, end, flags)) {
    -
    5752 interval.end = konec_vrednosti = asterisk.interval.end;
    -
    5753 value.invalidate();
    -
    5754 }
    -
    5755 else if (value.match(text, interval.end, end, flags)) {
    -
    5756 interval.end = konec_vrednosti = value.interval.end;
    -
    5757 asterisk.invalidate();
    -
    5758 }
    -
    5759 else {
    -
    5760 asterisk.invalidate();
    -
    5761 value.invalidate();
    -
    5762 interval.start = (interval.end = start) + 1;
    -
    5763 return false;
    -
    5764 }
    -
    5765
    -
    5766 while (interval.end < end && text[interval.end] && isspace(text[interval.end])) interval.end++;
    -
    5767 if (interval.end < end && text[interval.end] == ';') {
    -
    5768 interval.end++;
    -
    5769 while (interval.end < end && text[interval.end] && isspace(text[interval.end])) interval.end++;
    -
    5770 if (interval.end < end && (text[interval.end] == 'q' || text[interval.end] == 'Q')) {
    -
    5771 interval.end++;
    -
    5772 while (interval.end < end && text[interval.end] && isspace(text[interval.end])) interval.end++;
    -
    5773 if (interval.end < end && text[interval.end] == '=') {
    -
    5774 interval.end++;
    -
    5775 while (interval.end < end && text[interval.end] && isspace(text[interval.end])) interval.end++;
    -
    5776 if (factor.match(text, interval.end, end, flags))
    -
    5777 interval.end = factor.interval.end;
    -
    5778 }
    -
    5779 }
    -
    5780 }
    -
    5781 if (!factor.interval) {
    -
    5782 factor.invalidate();
    -
    5783 interval.end = konec_vrednosti;
    -
    5784 }
    -
    5785 interval.start = start;
    -
    5786 return true;
    -
    5787 }
    -
    5788
    -
    5789 virtual void invalidate()
    -
    5790 {
    -
    5791 asterisk.invalidate();
    -
    5792 value.invalidate();
    -
    5793 factor.invalidate();
    -
    5794 parser::invalidate();
    -
    5795 }
    -
    5796
    -
    5797 public:
    -
    5798 T_asterisk asterisk;
    -
    5799 T value;
    -
    5800 http_weight factor;
    -
    5801 };
    -
    5802
    -
    5806 class http_cookie_parameter : public parser
    -
    5807 {
    -
    5808 public:
    -
    5809 virtual bool match(
    -
    5810 _In_reads_or_z_(end) const char* text,
    -
    5811 _In_ size_t start = 0,
    -
    5812 _In_ size_t end = (size_t)-1,
    -
    5813 _In_ int flags = match_default)
    -
    5814 {
    -
    5815 assert(text || start >= end);
    -
    5816 interval.end = start;
    -
    5817 if (interval.end < end && text[interval.end] == '$')
    -
    5818 interval.end++;
    -
    5819 else
    -
    5820 goto error;
    -
    5821 if (name.match(text, interval.end, end, flags))
    -
    5822 interval.end = name.interval.end;
    -
    5823 else
    -
    5824 goto error;
    -
    5825 while (m_space.match(text, interval.end, end, flags))
    -
    5826 interval.end = m_space.interval.end;
    -
    5827 if (interval.end < end && text[interval.end] == '=')
    -
    5828 interval.end++;
    -
    5829 else
    -
    5830 goto error;
    -
    5831 while (m_space.match(text, interval.end, end, flags))
    -
    5832 interval.end = m_space.interval.end;
    -
    5833 if (value.match(text, interval.end, end, flags))
    -
    5834 interval.end = value.interval.end;
    -
    5835 else
    -
    5836 goto error;
    -
    5837 interval.start = start;
    -
    5838 return true;
    -
    5839
    -
    5840 error:
    -
    5841 name.invalidate();
    -
    5842 value.invalidate();
    -
    5843 interval.start = (interval.end = start) + 1;
    -
    5844 return false;
    -
    5845 }
    -
    5846
    -
    5847 virtual void invalidate()
    -
    5848 {
    -
    5849 name.invalidate();
    -
    5850 value.invalidate();
    -
    5851 parser::invalidate();
    -
    5852 }
    -
    5853
    -
    5854 public:
    -
    5855 http_token name;
    -
    5856 http_value value;
    -
    5857
    -
    5858 protected:
    -
    5859 http_space m_space;
    -
    5860 };
    -
    5861
    -
    5865 class http_cookie : public parser
    -
    5866 {
    -
    5867 public:
    -
    5868 virtual bool match(
    -
    5869 _In_reads_or_z_(end) const char* text,
    -
    5870 _In_ size_t start = 0,
    -
    5871 _In_ size_t end = (size_t)-1,
    -
    5872 _In_ int flags = match_default)
    -
    5873 {
    -
    5874 assert(text || start >= end);
    -
    5875 interval.end = start;
    -
    5876 if (name.match(text, interval.end, end, flags))
    -
    5877 interval.end = name.interval.end;
    -
    5878 else
    -
    5879 goto error;
    -
    5880 while (m_space.match(text, interval.end, end, flags))
    -
    5881 interval.end = m_space.interval.end;
    -
    5882 if (interval.end < end && text[interval.end] == '=')
    -
    5883 interval.end++;
    -
    5884 else
    -
    5885 goto error;
    -
    5886 while (m_space.match(text, interval.end, end, flags))
    -
    5887 interval.end = m_space.interval.end;
    -
    5888 if (value.match(text, interval.end, end, flags))
    -
    5889 interval.end = value.interval.end;
    -
    5890 else
    -
    5891 goto error;
    -
    5892 params.clear();
    -
    5893 for (;;) {
    -
    5894 if (interval.end < end && text[interval.end]) {
    -
    5895 if (m_space.match(text, interval.end, end, flags))
    -
    5896 interval.end = m_space.interval.end;
    -
    5897 else if (text[interval.end] == ';') {
    -
    5898 interval.end++;
    -
    5899 while (m_space.match(text, interval.end, end, flags))
    -
    5900 interval.end = m_space.interval.end;
    -
    5901 http_cookie_parameter param;
    -
    5902 if (param.match(text, interval.end, end, flags)) {
    -
    5903 interval.end = param.interval.end;
    -
    5904 params.push_back(std::move(param));
    -
    5905 }
    -
    5906 else
    -
    5907 break;
    -
    5908 }
    -
    5909 else
    -
    5910 break;
    -
    5911 }
    -
    5912 else
    -
    5913 break;
    -
    5914 }
    -
    5915 interval.start = start;
    -
    5916 interval.end = params.empty() ? value.interval.end : params.back().interval.end;
    -
    5917 return true;
    -
    5918
    -
    5919 error:
    -
    5920 name.invalidate();
    -
    5921 value.invalidate();
    -
    5922 params.clear();
    -
    5923 interval.start = (interval.end = start) + 1;
    -
    5924 return false;
    -
    5925 }
    -
    5926
    -
    5927 virtual void invalidate()
    -
    5928 {
    -
    5929 name.invalidate();
    -
    5930 value.invalidate();
    -
    5931 params.clear();
    -
    5932 parser::invalidate();
    -
    5933 }
    -
    5934
    -
    5935 public:
    -
    5936 http_token name;
    -
    5937 http_value value;
    -
    5938 std::list<http_cookie_parameter> params;
    -
    5939
    -
    5940 protected:
    -
    5941 http_space m_space;
    -
    5942 };
    -
    5943
    -
    5947 class http_agent : public parser
    -
    5948 {
    -
    5949 public:
    -
    5950 virtual bool match(
    -
    5951 _In_reads_or_z_(end) const char* text,
    -
    5952 _In_ size_t start = 0,
    -
    5953 _In_ size_t end = (size_t)-1,
    -
    5954 _In_ int flags = match_default)
    -
    5955 {
    -
    5956 assert(text || start >= end);
    -
    5957 interval.end = start;
    -
    5958 type.start = interval.end;
    -
    5959 for (;;) {
    -
    5960 if (interval.end < end && text[interval.end]) {
    -
    5961 if (text[interval.end] == '/') {
    -
    5962 type.end = interval.end;
    -
    5963 interval.end++;
    -
    5964 version.start = interval.end;
    -
    5965 for (;;) {
    -
    5966 if (interval.end < end && text[interval.end]) {
    -
    5967 if (isspace(text[interval.end])) {
    -
    5968 version.end = interval.end;
    -
    5969 break;
    -
    5970 }
    -
    5971 else
    -
    5972 interval.end++;
    -
    5973 }
    -
    5974 else {
    -
    5975 version.end = interval.end;
    -
    5976 break;
    -
    5977 }
    -
    5978 }
    -
    5979 break;
    -
    5980 }
    -
    5981 else if (isspace(text[interval.end])) {
    -
    5982 type.end = interval.end;
    -
    5983 break;
    -
    5984 }
    -
    5985 else
    -
    5986 interval.end++;
    -
    5987 }
    -
    5988 else {
    -
    5989 type.end = interval.end;
    -
    5990 break;
    -
    5991 }
    -
    5992 }
    -
    5993 if (start < interval.end) {
    -
    5994 interval.start = start;
    -
    5995 return true;
    -
    5996 }
    -
    5997 type.start = 1;
    -
    5998 type.end = 0;
    -
    5999 version.start = 1;
    -
    6000 version.end = 0;
    -
    6001 interval.start = 1;
    -
    6002 interval.end = 0;
    -
    6003 return false;
    -
    6004 }
    -
    6005
    -
    6006 virtual void invalidate()
    -
    6007 {
    -
    6008 type.start = 1;
    -
    6009 type.end = 0;
    -
    6010 version.start = 1;
    -
    6011 version.end = 0;
    -
    6012 parser::invalidate();
    -
    6013 }
    -
    6014
    -
    6015 public:
    -
    6016 stdex::interval<size_t> type;
    -
    6017 stdex::interval<size_t> version;
    -
    6018 };
    -
    6019
    -
    6023 class http_protocol : public parser
    -
    6024 {
    -
    6025 public:
    -
    6026 http_protocol(_In_ const std::locale& locale = std::locale()) :
    -
    6027 parser(locale),
    -
    6028 version(0x009)
    -
    6029 {}
    -
    6030
    -
    6031 virtual bool match(
    -
    6032 _In_reads_or_z_(end) const char* text,
    -
    6033 _In_ size_t start = 0,
    -
    6034 _In_ size_t end = (size_t)-1,
    -
    6035 _In_ int flags = match_default)
    -
    6036 {
    -
    6037 assert(text || start >= end);
    -
    6038 interval.end = start;
    -
    6039 type.start = interval.end;
    -
    6040 for (;;) {
    -
    6041 if (interval.end < end && text[interval.end]) {
    -
    6042 if (text[interval.end] == '/') {
    -
    6043 type.end = interval.end;
    -
    6044 interval.end++;
    -
    6045 break;
    -
    6046 }
    -
    6047 else if (isspace(text[interval.end]))
    -
    6048 goto error;
    -
    6049 else
    -
    6050 interval.end++;
    -
    6051 }
    -
    6052 else {
    -
    6053 type.end = interval.end;
    -
    6054 goto error;
    -
    6055 }
    -
    6056 }
    -
    6057 version_maj.start = interval.end;
    -
    6058 for (;;) {
    -
    6059 if (interval.end < end && text[interval.end]) {
    -
    6060 if (text[interval.end] == '.') {
    -
    6061 version_maj.end = interval.end;
    -
    6062 interval.end++;
    -
    6063 version_min.start = interval.end;
    -
    6064 for (;;) {
    -
    6065 if (interval.end < end && text[interval.end]) {
    -
    6066 if (isspace(text[interval.end])) {
    -
    6067 version_min.end = interval.end;
    -
    6068 version =
    -
    6069 (uint16_t)strtoui(text + version_maj.start, version_maj.size(), nullptr, 10) * 0x100 +
    -
    6070 (uint16_t)strtoui(text + version_min.start, version_min.size(), nullptr, 10);
    -
    6071 break;
    -
    6072 }
    -
    6073 else
    -
    6074 interval.end++;
    -
    6075 }
    -
    6076 else
    -
    6077 goto error;
    -
    6078 }
    -
    6079 break;
    -
    6080 }
    -
    6081 else if (isspace(text[interval.end])) {
    -
    6082 version_maj.end = interval.end;
    -
    6083 version_min.start = 1;
    -
    6084 version_min.end = 0;
    -
    6085 version = (uint16_t)strtoui(text + version_maj.start, version_maj.size(), nullptr, 10) * 0x100;
    -
    6086 break;
    -
    6087 }
    -
    6088 else
    -
    6089 interval.end++;
    -
    6090 }
    -
    6091 else
    -
    6092 goto error;
    -
    6093 }
    -
    6094 interval.start = start;
    -
    6095 return true;
    -
    6096
    -
    6097 error:
    -
    6098 type.start = 1;
    -
    6099 type.end = 0;
    -
    6100 version_maj.start = 1;
    -
    6101 version_maj.end = 0;
    -
    6102 version_min.start = 1;
    -
    6103 version_min.end = 0;
    -
    6104 version = 0x009;
    -
    6105 interval.start = 1;
    -
    6106 interval.end = 0;
    -
    6107 return false;
    -
    6108 }
    -
    6109
    -
    6110 virtual void invalidate()
    -
    6111 {
    -
    6112 type.start = 1;
    -
    6113 type.end = 0;
    -
    6114 version_maj.start = 1;
    -
    6115 version_maj.end = 0;
    -
    6116 version_min.start = 1;
    -
    6117 version_min.end = 0;
    -
    6118 version = 0x009;
    -
    6119 parser::invalidate();
    -
    6120 }
    -
    6121
    -
    6122 public:
    -
    6123 stdex::interval<size_t> type;
    -
    6124 stdex::interval<size_t> version_maj;
    -
    6125 stdex::interval<size_t> version_min;
    -
    6126 uint16_t version;
    -
    6127 };
    -
    6128
    -
    6132 class http_request : public parser
    -
    6133 {
    -
    6134 public:
    -
    6135 http_request(_In_ const std::locale& locale = std::locale()) :
    -
    6136 parser(locale),
    -
    6137 url(locale),
    -
    6138 protocol(locale)
    -
    6139 {}
    -
    6140
    -
    6141 virtual bool match(
    -
    6142 _In_reads_or_z_(end) const char* text,
    -
    6143 _In_ size_t start = 0,
    -
    6144 _In_ size_t end = (size_t)-1,
    -
    6145 _In_ int flags = match_default)
    -
    6146 {
    -
    6147 assert(text || start >= end);
    -
    6148 interval.end = start;
    -
    6149
    -
    6150 for (;;) {
    -
    6151 if (m_line_break.match(text, interval.end, end, flags))
    -
    6152 goto error;
    -
    6153 else if (interval.end < end && text[interval.end]) {
    -
    6154 if (isspace(text[interval.end]))
    -
    6155 interval.end++;
    -
    6156 else
    -
    6157 break;
    -
    6158 }
    -
    6159 else
    -
    6160 goto error;
    -
    6161 }
    -
    6162 verb.start = interval.end;
    -
    6163 for (;;) {
    -
    6164 if (m_line_break.match(text, interval.end, end, flags))
    -
    6165 goto error;
    -
    6166 else if (interval.end < end && text[interval.end]) {
    -
    6167 if (isspace(text[interval.end])) {
    -
    6168 verb.end = interval.end;
    -
    6169 interval.end++;
    -
    6170 break;
    -
    6171 }
    -
    6172 else
    -
    6173 interval.end++;
    -
    6174 }
    -
    6175 else
    -
    6176 goto error;
    -
    6177 }
    -
    6178
    -
    6179 for (;;) {
    -
    6180 if (m_line_break.match(text, interval.end, end, flags))
    -
    6181 goto error;
    -
    6182 else if (interval.end < end && text[interval.end]) {
    -
    6183 if (isspace(text[interval.end]))
    -
    6184 interval.end++;
    -
    6185 else
    -
    6186 break;
    -
    6187 }
    -
    6188 else
    -
    6189 goto error;
    -
    6190 }
    -
    6191 if (url.match(text, interval.end, end, flags))
    -
    6192 interval.end = url.interval.end;
    -
    6193 else
    -
    6194 goto error;
    -
    6195
    -
    6196 protocol.invalidate();
    -
    6197 for (;;) {
    -
    6198 if (m_line_break.match(text, interval.end, end, flags)) {
    -
    6199 interval.end = m_line_break.interval.end;
    -
    6200 goto end;
    -
    6201 }
    -
    6202 else if (interval.end < end && text[interval.end]) {
    -
    6203 if (isspace(text[interval.end]))
    -
    6204 interval.end++;
    -
    6205 else
    -
    6206 break;
    -
    6207 }
    -
    6208 else
    -
    6209 goto end;
    -
    6210 }
    -
    6211 for (;;) {
    -
    6212 if (m_line_break.match(text, interval.end, end, flags)) {
    -
    6213 interval.end = m_line_break.interval.end;
    -
    6214 goto end;
    -
    6215 }
    -
    6216 else if (protocol.match(text, interval.end, end, flags)) {
    -
    6217 interval.end = protocol.interval.end;
    -
    6218 break;
    -
    6219 }
    -
    6220 else
    -
    6221 goto end;
    -
    6222 }
    -
    6223
    -
    6224 for (;;) {
    -
    6225 if (m_line_break.match(text, interval.end, end, flags)) {
    -
    6226 interval.end = m_line_break.interval.end;
    -
    6227 break;
    -
    6228 }
    -
    6229 else if (interval.end < end && text[interval.end])
    -
    6230 interval.end++;
    -
    6231 else
    -
    6232 goto end;
    -
    6233 }
    -
    6234
    -
    6235 end:
    -
    6236 interval.start = start;
    -
    6237 return true;
    -
    6238
    -
    6239 error:
    -
    6240 verb.start = 1;
    -
    6241 verb.end = 0;
    -
    6242 url.invalidate();
    -
    6243 protocol.invalidate();
    -
    6244 interval.start = 1;
    -
    6245 interval.end = 0;
    -
    6246 return false;
    -
    6247 }
    -
    6248
    -
    6249 virtual void invalidate()
    -
    6250 {
    -
    6251 verb.start = 1;
    -
    6252 verb.end = 0;
    -
    6253 url.invalidate();
    -
    6254 protocol.invalidate();
    -
    6255 parser::invalidate();
    -
    6256 }
    -
    6257
    -
    6258 public:
    -
    6259 stdex::interval<size_t> verb;
    -
    6260 http_url url;
    -
    6261 http_protocol protocol;
    -
    6262
    -
    6263 protected:
    -
    6264 http_line_break m_line_break;
    -
    6265 };
    -
    6266
    -
    6270 class http_header : public parser
    -
    6271 {
    -
    6272 public:
    -
    6273 virtual bool match(
    -
    6274 _In_reads_or_z_(end) const char* text,
    -
    6275 _In_ size_t start = 0,
    -
    6276 _In_ size_t end = (size_t)-1,
    -
    6277 _In_ int flags = match_default)
    -
    6278 {
    -
    6279 assert(text || start >= end);
    -
    6280 interval.end = start;
    -
    6281
    -
    6282 if (m_line_break.match(text, interval.end, end, flags) ||
    -
    6283 interval.end < end && text[interval.end] && isspace(text[interval.end]))
    -
    6284 goto error;
    -
    6285 name.start = interval.end;
    -
    6286 for (;;) {
    -
    6287 if (m_line_break.match(text, interval.end, end, flags))
    -
    6288 goto error;
    -
    6289 else if (interval.end < end && text[interval.end]) {
    -
    6290 if (isspace(text[interval.end])) {
    -
    6291 name.end = interval.end;
    -
    6292 interval.end++;
    -
    6293 for (;;) {
    -
    6294 if (m_line_break.match(text, interval.end, end, flags))
    -
    6295 goto error;
    -
    6296 else if (interval.end < end && text[interval.end]) {
    -
    6297 if (isspace(text[interval.end]))
    -
    6298 interval.end++;
    -
    6299 else
    -
    6300 break;
    -
    6301 }
    -
    6302 else
    -
    6303 goto error;
    -
    6304 }
    -
    6305 if (interval.end < end && text[interval.end] == ':') {
    -
    6306 interval.end++;
    -
    6307 break;
    -
    6308 }
    -
    6309 else
    -
    6310 goto error;
    -
    6311 break;
    -
    6312 }
    -
    6313 else if (text[interval.end] == ':') {
    -
    6314 name.end = interval.end;
    -
    6315 interval.end++;
    -
    6316 break;
    -
    6317 }
    -
    6318 else
    -
    6319 interval.end++;
    -
    6320 }
    -
    6321 else
    -
    6322 goto error;
    -
    6323 }
    -
    6324 value.start = (size_t)-1;
    -
    6325 value.end = 0;
    -
    6326 for (;;) {
    -
    6327 if (m_line_break.match(text, interval.end, end, flags)) {
    -
    6328 interval.end = m_line_break.interval.end;
    -
    6329 if (!m_line_break.match(text, interval.end, end, flags) &&
    -
    6330 interval.end < end && text[interval.end] && isspace(text[interval.end]))
    -
    6331 interval.end++;
    -
    6332 else
    -
    6333 break;
    -
    6334 }
    -
    6335 else if (interval.end < end && text[interval.end]) {
    -
    6336 if (isspace(text[interval.end]))
    -
    6337 interval.end++;
    -
    6338 else {
    -
    6339 if (value.start == (size_t)-1) value.start = interval.end;
    -
    6340 value.end = ++interval.end;
    -
    6341 }
    -
    6342 }
    -
    6343 else
    -
    6344 break;
    -
    6345 }
    -
    6346 interval.start = start;
    -
    6347 return true;
    -
    6348
    -
    6349 error:
    -
    6350 name.start = 1;
    -
    6351 name.end = 0;
    -
    6352 value.start = 1;
    -
    6353 value.end = 0;
    -
    6354 interval.start = 1;
    -
    6355 interval.end = 0;
    -
    6356 return false;
    -
    6357 }
    -
    6358
    -
    6359 virtual void invalidate()
    -
    6360 {
    -
    6361 name.start = 1;
    -
    6362 name.end = 0;
    -
    6363 value.start = 1;
    -
    6364 value.end = 0;
    -
    6365 parser::invalidate();
    -
    6366 }
    -
    6367
    -
    6368 public:
    -
    6369 stdex::interval<size_t> name;
    -
    6370 stdex::interval<size_t> value;
    -
    6371
    -
    6372 protected:
    -
    6373 http_line_break m_line_break;
    -
    6374 };
    -
    6375
    -
    6379 template <class T>
    -
    6380 class http_value_collection : public T
    -
    6381 {
    -
    6382 public:
    -
    6383 void insert(
    -
    6384 _In_reads_or_z_(end) const char* text,
    -
    6385 _In_ size_t start = 0,
    -
    6386 _In_ size_t end = (size_t)-1,
    -
    6387 _In_ int flags = match_default)
    -
    6388 {
    -
    6389 while (start < end) {
    -
    6390 while (start < end && text[start] && isspace(text[start])) start++;
    -
    6391 if (start < end && text[start] == ',') {
    -
    6392 start++;
    -
    6393 while (start < end&& text[start] && isspace(text[start])) start++;
    -
    6394 }
    -
    6395 T::key_type el;
    -
    6396 if (el.match(text, start, end, flags)) {
    -
    6397 start = el.interval.end;
    -
    6398 T::insert(std::move(el));
    -
    6399 }
    -
    6400 else
    -
    6401 break;
    -
    6402 }
    -
    6403 }
    -
    6404 };
    -
    6405
    -
    6406 template <class T>
    -
    6407 struct http_factor_more {
    -
    6408 constexpr bool operator()(const T& a, const T& b) const noexcept
    -
    6409 {
    -
    6410 return a.factor.value > b.factor.value;
    -
    6411 }
    -
    6412 };
    -
    6413
    -
    6417 template <class T, class _Alloc = std::allocator<T>>
    -
    6418 using http_weighted_collection = http_value_collection<std::multiset<T, http_factor_more<T>, _Alloc>>;
    -
    6419
    -
    6423 template <class T>
    -
    6424 class basic_json_string : public basic_parser<T>
    -
    6425 {
    -
    6426 public:
    -
    6427 basic_json_string(
    -
    6428 _In_ const std::shared_ptr<basic_parser<T>>& quote,
    -
    6429 _In_ const std::shared_ptr<basic_parser<T>>& chr,
    -
    6430 _In_ const std::shared_ptr<basic_parser<T>>& escape,
    -
    6431 _In_ const std::shared_ptr<basic_parser<T>>& sol,
    -
    6432 _In_ const std::shared_ptr<basic_parser<T>>& bs,
    -
    6433 _In_ const std::shared_ptr<basic_parser<T>>& ff,
    -
    6434 _In_ const std::shared_ptr<basic_parser<T>>& lf,
    -
    6435 _In_ const std::shared_ptr<basic_parser<T>>& cr,
    -
    6436 _In_ const std::shared_ptr<basic_parser<T>>& htab,
    -
    6437 _In_ const std::shared_ptr<basic_parser<T>>& uni,
    -
    6438 _In_ const std::shared_ptr<basic_integer16<T>>& hex,
    -
    6439 _In_ const std::locale& locale = std::locale()) :
    -
    6440 basic_parser<T>(locale),
    -
    6441 m_quote(quote),
    -
    6442 m_chr(chr),
    -
    6443 m_escape(escape),
    -
    6444 m_sol(sol),
    -
    6445 m_bs(bs),
    -
    6446 m_ff(ff),
    -
    6447 m_lf(lf),
    -
    6448 m_cr(cr),
    -
    6449 m_htab(htab),
    -
    6450 m_uni(uni),
    -
    6451 m_hex(hex)
    -
    6452 {}
    -
    6453
    -
    6454 virtual bool match(
    -
    6455 _In_reads_or_z_(end) const T* text,
    -
    6456 _In_ size_t start = 0,
    -
    6457 _In_ size_t end = (size_t)-1,
    -
    6458 _In_ int flags = match_default)
    -
    6459 {
    -
    6460 assert(text || start >= end);
    -
    6461 interval.end = start;
    -
    6462 if (m_quote->match(text, interval.end, end, flags)) {
    -
    6463 interval.end = m_quote->interval.end;
    -
    6464 value.clear();
    -
    6465 for (;;) {
    -
    6466 if (m_quote->match(text, interval.end, end, flags)) {
    -
    6467 interval.start = start;
    -
    6468 interval.end = m_quote->interval.end;
    -
    6469 return true;
    -
    6470 }
    -
    6471 if (m_escape->match(text, interval.end, end, flags)) {
    -
    6472 if (m_quote->match(text, m_escape->interval.end, end, flags)) {
    -
    6473 value += '"'; interval.end = m_quote->interval.end;
    -
    6474 continue;
    -
    6475 }
    -
    6476 if (m_sol->match(text, m_escape->interval.end, end, flags)) {
    -
    6477 value += '/'; interval.end = m_sol->interval.end;
    -
    6478 continue;
    -
    6479 }
    -
    6480 if (m_bs->match(text, m_escape->interval.end, end, flags)) {
    -
    6481 value += '\b'; interval.end = m_bs->interval.end;
    -
    6482 continue;
    -
    6483 }
    -
    6484 if (m_ff->match(text, m_escape->interval.end, end, flags)) {
    -
    6485 value += '\f'; interval.end = m_ff->interval.end;
    -
    6486 continue;
    -
    6487 }
    -
    6488 if (m_lf->match(text, m_escape->interval.end, end, flags)) {
    -
    6489 value += '\n'; interval.end = m_lf->interval.end;
    -
    6490 continue;
    -
    6491 }
    -
    6492 if (m_cr->match(text, m_escape->interval.end, end, flags)) {
    -
    6493 value += '\r'; interval.end = m_cr->interval.end;
    -
    6494 continue;
    -
    6495 }
    -
    6496 if (m_htab->match(text, m_escape->interval.end, end, flags)) {
    -
    6497 value += '\t'; interval.end = m_htab->interval.end;
    -
    6498 continue;
    -
    6499 }
    -
    6500 if (
    -
    6501 m_uni->match(text, m_escape->interval.end, end, flags) &&
    -
    6502 m_hex->match(text, m_uni->interval.end, std::min(m_uni->interval.end + 4, end), flags | match_case_insensitive) &&
    -
    6503 m_hex->interval.size() == 4 /* JSON requests 4-digit Unicode sequneces: \u.... */)
    -
    6504 {
    -
    6505 assert(m_hex->value <= 0xffff);
    -
    6506 if (sizeof(T) == 1) {
    -
    6507 if (m_hex->value > 0x7ff) {
    -
    6508 value += (T)(0xe0 | (m_hex->value >> 12) & 0x0f);
    -
    6509 value += (T)(0x80 | (m_hex->value >> 6) & 0x3f);
    -
    6510 value += (T)(0x80 | m_hex->value & 0x3f);
    -
    6511 }
    -
    6512 else if (m_hex->value > 0x7f) {
    -
    6513 value += (T)(0xc0 | (m_hex->value >> 6) & 0x1f);
    -
    6514 value += (T)(0x80 | m_hex->value & 0x3f);
    -
    6515 }
    -
    6516 else
    -
    6517 value += (T)(m_hex->value & 0x7f);
    -
    6518 }
    -
    6519 else
    -
    6520 value += (T)m_hex->value;
    -
    6521 interval.end = m_hex->interval.end;
    -
    6522 continue;
    -
    6523 }
    -
    6524 if (m_escape->match(text, m_escape->interval.end, end, flags)) {
    -
    6525 value += '\\'; interval.end = m_escape->interval.end;
    -
    6526 continue;
    -
    6527 }
    -
    6528 }
    -
    6529 if (m_chr->match(text, interval.end, end, flags)) {
    -
    6530 value.Prilepi(text + m_chr->interval.start, m_chr->interval.size());
    -
    6531 interval.end = m_chr->interval.end;
    -
    6532 continue;
    -
    6533 }
    -
    6534 break;
    -
    6535 }
    -
    6536 }
    -
    6537 value.clear();
    -
    6538 interval.start = (interval.end = start) + 1;
    -
    6539 return false;
    -
    6540 }
    -
    6541
    -
    6542 virtual void invalidate()
    -
    6543 {
    -
    6544 value.clear();
    -
    6545 basic_parser<T>::invalidate();
    -
    6546 }
    -
    6547
    -
    6548 public:
    -
    6549 std::basic_string<T> value;
    -
    6550
    -
    6551 protected:
    -
    6552 std::shared_ptr<basic_parser<T>> m_quote;
    -
    6553 std::shared_ptr<basic_parser<T>> m_chr;
    -
    6554 std::shared_ptr<basic_parser<T>> m_escape;
    -
    6555 std::shared_ptr<basic_parser<T>> m_sol;
    -
    6556 std::shared_ptr<basic_parser<T>> m_bs;
    -
    6557 std::shared_ptr<basic_parser<T>> m_ff;
    -
    6558 std::shared_ptr<basic_parser<T>> m_lf;
    -
    6559 std::shared_ptr<basic_parser<T>> m_cr;
    -
    6560 std::shared_ptr<basic_parser<T>> m_htab;
    -
    6561 std::shared_ptr<basic_parser<T>> m_uni;
    -
    6562 std::shared_ptr<basic_integer16<T>> m_hex;
    -
    6563 };
    -
    6564
    -
    6565 using json_string = basic_json_string<char>;
    -
    6566 using wjson_string = basic_json_string<wchar_t>;
    -
    6567#ifdef _UNICODE
    -
    6568 using tjson_string = wjson_string;
    -
    6569#else
    -
    6570 using tjson_string = json_string;
    -
    6571#endif
    -
    6572 }
    -
    6573}
    -
    6574
    -
    6575#undef ENUM_FLAG_OPERATOR
    -
    6576#undef ENUM_FLAGS
    -
    6577
    -
    6578#ifdef _MSC_VER
    -
    6579#pragma warning(pop)
    -
    6580#endif
    -
    stdex::parser::basic_angle
    Test for angle in d°mm'ss.dddd form.
    Definition parser.hpp:4389
    -
    stdex::parser::basic_any_cu
    Test for any code unit.
    Definition parser.hpp:216
    -
    stdex::parser::basic_bol
    Test for beginning of line.
    Definition parser.hpp:610
    -
    stdex::parser::basic_branch
    Test for any.
    Definition parser.hpp:1052
    -
    stdex::parser::basic_chemical_formula
    Test for chemical formula.
    Definition parser.hpp:4663
    -
    stdex::parser::basic_cu_set
    Test for any code unit from a given string of code units.
    Definition parser.hpp:715
    -
    stdex::parser::basic_cu
    Test for specific code unit.
    Definition parser.hpp:286
    -
    stdex::parser::basic_date
    Test for date.
    Definition parser.hpp:4019
    -
    stdex::parser::basic_dns_domain_char
    Test for valid DNS domain character.
    Definition parser.hpp:2800
    -
    stdex::parser::basic_dns_domain_char::allow_on_edge
    bool allow_on_edge
    Is character allowed at the beginning or an end of a DNS domain?
    Definition parser.hpp:2838
    -
    stdex::parser::basic_dns_name
    Test for DNS domain/hostname.
    Definition parser.hpp:2900
    -
    stdex::parser::basic_dns_name::m_allow_absolute
    bool m_allow_absolute
    May DNS names end with a dot (absolute name)?
    Definition parser.hpp:2964
    -
    stdex::parser::basic_email_address
    Test for e-mail address.
    Definition parser.hpp:3788
    -
    stdex::parser::basic_emoticon
    Test for emoticon.
    Definition parser.hpp:3896
    -
    stdex::parser::basic_emoticon::apex
    std::shared_ptr< basic_parser< T > > apex
    apex/eyebrows/halo (e.g. O, 0)
    Definition parser.hpp:3985
    -
    stdex::parser::basic_emoticon::eyes
    std::shared_ptr< basic_parser< T > > eyes
    eyes (e.g. :, ;, >, |, B)
    Definition parser.hpp:3986
    -
    stdex::parser::basic_emoticon::mouth
    std::shared_ptr< basic_set< T > > mouth
    mouth (e.g. ), ), (, (, |, P, D, p, d)
    Definition parser.hpp:3988
    -
    stdex::parser::basic_emoticon::nose
    std::shared_ptr< basic_parser< T > > nose
    nose (e.g. -, o)
    Definition parser.hpp:3987
    -
    stdex::parser::basic_emoticon::emoticon
    std::shared_ptr< basic_parser< T > > emoticon
    emoticon as a whole (e.g. 😀, 🤔, 😶)
    Definition parser.hpp:3984
    -
    stdex::parser::basic_eol
    Test for end of line.
    Definition parser.hpp:648
    -
    stdex::parser::basic_fraction
    Test for fraction.
    Definition parser.hpp:1681
    -
    stdex::parser::basic_integer10
    Test for decimal integer.
    Definition parser.hpp:1290
    -
    stdex::parser::basic_integer10ts
    Test for decimal integer possibly containing thousand separators.
    Definition parser.hpp:1375
    -
    stdex::parser::basic_integer10ts::has_separators
    bool has_separators
    Did integer have any separators?
    Definition parser.hpp:1435
    -
    stdex::parser::basic_integer10ts::digit_count
    size_t digit_count
    Total number of digits in integer.
    Definition parser.hpp:1434
    -
    stdex::parser::basic_integer16
    Test for hexadecimal integer.
    Definition parser.hpp:1456
    -
    stdex::parser::basic_integer
    Base class for integer testing.
    Definition parser.hpp:1268
    -
    stdex::parser::basic_integer::value
    size_t value
    Calculated value of the numeral.
    Definition parser.hpp:1282
    -
    stdex::parser::basic_ipv4_address
    Test for IPv4 address.
    Definition parser.hpp:2340
    -
    stdex::parser::basic_ipv4_address::components
    stdex::interval< size_t > components[4]
    Individual component intervals.
    Definition parser.hpp:2455
    -
    stdex::parser::basic_ipv4_address::value
    struct in_addr value
    IPv4 address value.
    Definition parser.hpp:2456
    -
    stdex::parser::basic_ipv6_address
    Test for IPv6 address.
    Definition parser.hpp:2559
    -
    stdex::parser::basic_ipv6_address::scope_id
    std::shared_ptr< basic_parser< T > > scope_id
    Scope ID (e.g. NIC index with link-local addresses)
    Definition parser.hpp:2763
    -
    stdex::parser::basic_ipv6_address::components
    stdex::interval< size_t > components[8]
    Individual component intervals.
    Definition parser.hpp:2761
    -
    stdex::parser::basic_ipv6_address::value
    struct in6_addr value
    IPv6 address value.
    Definition parser.hpp:2762
    -
    stdex::parser::basic_ipv6_scope_id_char
    Test for valid IPv6 address scope ID character.
    Definition parser.hpp:2487
    -
    stdex::parser::basic_iterations
    Test for repeating.
    Definition parser.hpp:905
    -
    stdex::parser::basic_iterations::m_greedy
    bool m_greedy
    try to match as long sequence as possible
    Definition parser.hpp:944
    -
    stdex::parser::basic_iterations::m_el
    std::shared_ptr< basic_parser< T > > m_el
    repeating element
    Definition parser.hpp:941
    -
    stdex::parser::basic_iterations::m_min_iterations
    size_t m_min_iterations
    minimum number of iterations
    Definition parser.hpp:942
    -
    stdex::parser::basic_iterations::m_max_iterations
    size_t m_max_iterations
    maximum number of iterations
    Definition parser.hpp:943
    -
    stdex::parser::basic_json_string
    Test for JSON string.
    Definition parser.hpp:6425
    -
    stdex::parser::basic_mixed_numeral
    Test for mixed numeral.
    Definition parser.hpp:1916
    -
    stdex::parser::basic_mixed_numeral::fraction
    std::shared_ptr< basic_parser< T > > fraction
    fraction
    Definition parser.hpp:2022
    -
    stdex::parser::basic_mixed_numeral::special_sign
    std::shared_ptr< basic_parser< T > > special_sign
    Special sign (e.g. plus-minus '±')
    Definition parser.hpp:2020
    -
    stdex::parser::basic_mixed_numeral::negative_sign
    std::shared_ptr< basic_parser< T > > negative_sign
    Negative sign.
    Definition parser.hpp:2019
    -
    stdex::parser::basic_mixed_numeral::positive_sign
    std::shared_ptr< basic_parser< T > > positive_sign
    Positive sign.
    Definition parser.hpp:2018
    -
    stdex::parser::basic_mixed_numeral::integer
    std::shared_ptr< basic_parser< T > > integer
    Integer part.
    Definition parser.hpp:2021
    -
    stdex::parser::basic_monetary_numeral
    Test for monetary numeral.
    Definition parser.hpp:2211
    -
    stdex::parser::basic_monetary_numeral::positive_sign
    std::shared_ptr< basic_parser< T > > positive_sign
    Positive sign.
    Definition parser.hpp:2317
    -
    stdex::parser::basic_monetary_numeral::decimal_separator
    std::shared_ptr< basic_parser< T > > decimal_separator
    Decimal separator.
    Definition parser.hpp:2322
    -
    stdex::parser::basic_monetary_numeral::currency
    std::shared_ptr< basic_parser< T > > currency
    Currency part.
    Definition parser.hpp:2320
    -
    stdex::parser::basic_monetary_numeral::decimal
    std::shared_ptr< basic_parser< T > > decimal
    Decimal part.
    Definition parser.hpp:2323
    -
    stdex::parser::basic_monetary_numeral::integer
    std::shared_ptr< basic_parser< T > > integer
    Integer part.
    Definition parser.hpp:2321
    -
    stdex::parser::basic_monetary_numeral::negative_sign
    std::shared_ptr< basic_parser< T > > negative_sign
    Negative sign.
    Definition parser.hpp:2318
    -
    stdex::parser::basic_monetary_numeral::special_sign
    std::shared_ptr< basic_parser< T > > special_sign
    Special sign (e.g. plus-minus '±')
    Definition parser.hpp:2319
    -
    stdex::parser::basic_noop
    "No-op" match
    Definition parser.hpp:184
    -
    stdex::parser::basic_parser
    Base template for all parsers.
    Definition parser.hpp:65
    -
    stdex::parser::basic_parser::interval
    interval< size_t > interval
    Region of the last match.
    Definition parser.hpp:164
    -
    stdex::parser::basic_permutation
    Test for permutation.
    Definition parser.hpp:1192
    -
    stdex::parser::basic_phone_number
    Test for phone number.
    Definition parser.hpp:4512
    -
    stdex::parser::basic_phone_number::value
    std::basic_string< T > value
    Normalized phone number.
    Definition parser.hpp:4638
    -
    stdex::parser::basic_punct_cu
    Test for any punctuation code unit.
    Definition parser.hpp:458
    -
    stdex::parser::basic_roman_numeral
    Test for Roman numeral.
    Definition parser.hpp:1565
    -
    stdex::parser::basic_scientific_numeral
    Test for scientific numeral.
    Definition parser.hpp:2042
    -
    stdex::parser::basic_scientific_numeral::special_sign
    std::shared_ptr< basic_parser< T > > special_sign
    Special sign (e.g. plus-minus '±')
    Definition parser.hpp:2186
    -
    stdex::parser::basic_scientific_numeral::exponent_symbol
    std::shared_ptr< basic_parser< T > > exponent_symbol
    Exponent symbol (e.g. 'e')
    Definition parser.hpp:2190
    -
    stdex::parser::basic_scientific_numeral::positive_sign
    std::shared_ptr< basic_parser< T > > positive_sign
    Positive sign.
    Definition parser.hpp:2184
    -
    stdex::parser::basic_scientific_numeral::negative_sign
    std::shared_ptr< basic_parser< T > > negative_sign
    Negative sign.
    Definition parser.hpp:2185
    -
    stdex::parser::basic_scientific_numeral::value
    double value
    Calculated value of the numeral.
    Definition parser.hpp:2194
    -
    stdex::parser::basic_scientific_numeral::negative_exp_sign
    std::shared_ptr< basic_parser< T > > negative_exp_sign
    Negative exponent sign (e.g. '-')
    Definition parser.hpp:2192
    -
    stdex::parser::basic_scientific_numeral::decimal
    std::shared_ptr< basic_integer< T > > decimal
    Decimal part.
    Definition parser.hpp:2189
    -
    stdex::parser::basic_scientific_numeral::positive_exp_sign
    std::shared_ptr< basic_parser< T > > positive_exp_sign
    Positive exponent sign (e.g. '+')
    Definition parser.hpp:2191
    -
    stdex::parser::basic_scientific_numeral::exponent
    std::shared_ptr< basic_integer< T > > exponent
    Exponent part.
    Definition parser.hpp:2193
    -
    stdex::parser::basic_scientific_numeral::decimal_separator
    std::shared_ptr< basic_parser< T > > decimal_separator
    Decimal separator.
    Definition parser.hpp:2188
    -
    stdex::parser::basic_scientific_numeral::integer
    std::shared_ptr< basic_integer< T > > integer
    Integer part.
    Definition parser.hpp:2187
    -
    stdex::parser::basic_score
    Test for match score.
    Definition parser.hpp:1744
    -
    stdex::parser::basic_sequence
    Test for sequence.
    Definition parser.hpp:1001
    -
    stdex::parser::basic_set
    Definition parser.hpp:683
    -
    stdex::parser::basic_signed_numeral
    Test for signed numeral.
    Definition parser.hpp:1830
    -
    stdex::parser::basic_signed_numeral::special_sign
    std::shared_ptr< basic_parser< T > > special_sign
    Special sign (e.g. plus-minus '±')
    Definition parser.hpp:1898
    -
    stdex::parser::basic_signed_numeral::negative_sign
    std::shared_ptr< basic_parser< T > > negative_sign
    Negative sign.
    Definition parser.hpp:1897
    -
    stdex::parser::basic_signed_numeral::positive_sign
    std::shared_ptr< basic_parser< T > > positive_sign
    Positive sign.
    Definition parser.hpp:1896
    -
    stdex::parser::basic_signed_numeral::number
    std::shared_ptr< basic_parser< T > > number
    Number.
    Definition parser.hpp:1899
    -
    stdex::parser::basic_space_cu
    Test for any space code unit.
    Definition parser.hpp:379
    -
    stdex::parser::basic_space_or_punct_cu
    Test for any space or punctuation code unit.
    Definition parser.hpp:532
    -
    stdex::parser::basic_string_branch
    Test for any string.
    Definition parser.hpp:1120
    -
    stdex::parser::basic_string
    Test for given string.
    Definition parser.hpp:810
    -
    stdex::parser::basic_time
    Test for time.
    Definition parser.hpp:4286
    -
    stdex::parser::basic_url_password_char
    Test for valid URL password character.
    Definition parser.hpp:3082
    -
    stdex::parser::basic_url_path_char
    Test for valid URL path character.
    Definition parser.hpp:3182
    -
    stdex::parser::basic_url_path
    Test for URL path.
    Definition parser.hpp:3290
    -
    stdex::parser::basic_url_username_char
    Test for valid URL username character.
    Definition parser.hpp:2983
    -
    stdex::parser::basic_url
    Test for URL.
    Definition parser.hpp:3431
    -
    stdex::parser::http_agent
    Test for HTTP agent.
    Definition parser.hpp:5948
    -
    stdex::parser::http_any_type
    Test for HTTP any type.
    Definition parser.hpp:5070
    -
    stdex::parser::http_asterisk
    Test for HTTP asterisk.
    Definition parser.hpp:5712
    - - - - - -
    stdex::parser::http_header
    Test for HTTP header.
    Definition parser.hpp:6271
    -
    stdex::parser::http_language
    Test for HTTP language (RFC1766)
    Definition parser.hpp:5580
    -
    stdex::parser::http_line_break
    Test for HTTP line break (RFC2616: CRLF | LF)
    Definition parser.hpp:4744
    -
    stdex::parser::http_media_range
    Test for HTTP media range (RFC2616: media-range)
    Definition parser.hpp:5102
    -
    stdex::parser::http_media_type
    Test for HTTP media type (RFC2616: media-type)
    Definition parser.hpp:5157
    -
    stdex::parser::http_parameter
    Test for HTTP parameter (RFC2616: parameter)
    Definition parser.hpp:5015
    -
    stdex::parser::http_parameter::name
    http_token name
    Parameter name.
    Definition parser.hpp:5059
    -
    stdex::parser::http_parameter::value
    http_value value
    Parameter value.
    Definition parser.hpp:5060
    -
    stdex::parser::http_protocol
    Test for HTTP protocol.
    Definition parser.hpp:6024
    -
    stdex::parser::http_protocol::version
    uint16_t version
    HTTP protocol version: 0x100 = 1.0, 0x101 = 1.1...
    Definition parser.hpp:6126
    -
    stdex::parser::http_quoted_string
    Test for HTTP quoted string (RFC2616: quoted-string)
    Definition parser.hpp:4905
    -
    stdex::parser::http_quoted_string::content
    stdex::interval< size_t > content
    String content (without quotes)
    Definition parser.hpp:4961
    -
    stdex::parser::http_request
    Test for HTTP request.
    Definition parser.hpp:6133
    -
    stdex::parser::http_space
    Test for HTTP space (RFC2616: LWS)
    Definition parser.hpp:4780
    -
    stdex::parser::http_text_char
    Test for HTTP text character (RFC2616: TEXT)
    Definition parser.hpp:4817
    -
    stdex::parser::http_token
    Test for HTTP token (RFC2616: token - tolerates non-ASCII)
    Definition parser.hpp:4851
    -
    stdex::parser::http_url_parameter
    Test for HTTP URL parameter.
    Definition parser.hpp:5397
    -
    stdex::parser::http_url_path_segment
    Test for HTTP URL path segment.
    Definition parser.hpp:5308
    -
    stdex::parser::http_url_path
    Test for HTTP URL path segment.
    Definition parser.hpp:5341
    -
    stdex::parser::http_url_path::segments
    std::vector< http_url_path_segment > segments
    Path segments.
    Definition parser.hpp:5390
    -
    stdex::parser::http_url_port
    Test for HTTP URL port.
    Definition parser.hpp:5252
    -
    stdex::parser::http_url_server
    Test for HTTP URL server.
    Definition parser.hpp:5215
    -
    stdex::parser::http_url
    Test for HTTP URL.
    Definition parser.hpp:5478
    -
    stdex::parser::http_value_collection
    Collection of HTTP values.
    Definition parser.hpp:6381
    -
    stdex::parser::http_value
    Test for HTTP value (RFC2616: value)
    Definition parser.hpp:4971
    -
    stdex::parser::http_value::string
    http_quoted_string string
    Value when matched as quoted string.
    Definition parser.hpp:5007
    -
    stdex::parser::http_value::token
    http_token token
    Value when matched as token.
    Definition parser.hpp:5008
    -
    stdex::parser::http_weight
    Test for HTTP weight factor.
    Definition parser.hpp:5643
    -
    stdex::parser::http_weight::value
    float value
    Calculated value of the weight factor.
    Definition parser.hpp:5705
    -
    stdex::parser::http_weighted_value
    Test for HTTP weighted value.
    Definition parser.hpp:5735
    -
    stdex::parser::parser_collection
    Base template for collection-holding parsers.
    Definition parser.hpp:961
    -
    stdex::parser::sgml_any_cp
    Test for any SGML code point.
    Definition parser.hpp:248
    -
    stdex::parser::sgml_cp_set
    Test for any SGML code point from a given string of SGML code points.
    Definition parser.hpp:767
    -
    stdex::parser::sgml_cp
    Test for specific SGML code point.
    Definition parser.hpp:335
    -
    stdex::parser::sgml_dns_domain_char
    Test for valid DNS domain SGML character.
    Definition parser.hpp:2856
    -
    stdex::parser::sgml_ipv6_scope_id_char
    Test for valid IPv6 address scope ID SGML character.
    Definition parser.hpp:2525
    -
    stdex::parser::sgml_punct_cp
    Test for any SGML punctuation code point.
    Definition parser.hpp:499
    -
    stdex::parser::sgml_space_cp
    Test for any SGML space code point.
    Definition parser.hpp:422
    -
    stdex::parser::sgml_space_or_punct_cp
    Test for any SGML space or punctuation code point.
    Definition parser.hpp:575
    -
    stdex::parser::sgml_string
    Test for SGML given string.
    Definition parser.hpp:857
    -
    stdex::parser::sgml_url_password_char
    Test for valid URL password SGML character.
    Definition parser.hpp:3134
    -
    stdex::parser::sgml_url_path_char
    Test for valid URL path SGML character.
    Definition parser.hpp:3238
    -
    stdex::parser::sgml_url_username_char
    Test for valid URL username SGML character.
    Definition parser.hpp:3034
    +
    13#include "system.hpp"
    +
    14#include <assert.h>
    +
    15#include <stdarg.h>
    +
    16#include <stdint.h>
    +
    17#ifdef _WIN32
    +
    18#include <winsock2.h>
    +
    19#include <ws2ipdef.h>
    +
    20#else
    +
    21#include <inaddr.h>
    +
    22#include <in6addr.h>
    +
    23#endif
    +
    24#include <limits>
    +
    25#include <list>
    +
    26#include <locale>
    +
    27#include <memory>
    +
    28#include <set>
    +
    29#include <string>
    +
    30
    +
    31#ifdef _MSC_VER
    +
    32#pragma warning(push)
    +
    33#pragma warning(disable: 4100)
    +
    34#endif
    +
    35
    +
    36#define ENUM_FLAG_OPERATOR(T,X) \
    +
    37inline 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)); } \
    +
    38inline 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); } \
    +
    39inline 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)); } \
    +
    40inline T& operator X= (T& lhs, const T rhs) { return lhs = lhs X rhs; } \
    +
    41inline T& operator X= (T& lhs, const std::underlying_type_t<T> rhs) { return lhs = lhs X rhs; }
    +
    42#define ENUM_FLAGS(T, type) \
    +
    43enum class T : type; \
    +
    44inline T operator ~ (T t) { return (T) (~static_cast<std::underlying_type_t <T>>(t)); } \
    +
    45ENUM_FLAG_OPERATOR(T,|) \
    +
    46ENUM_FLAG_OPERATOR(T,^) \
    +
    47ENUM_FLAG_OPERATOR(T,&) \
    +
    48enum class T : type
    +
    49
    +
    50namespace stdex
    +
    51{
    +
    52 namespace parser
    +
    53 {
    +
    57 constexpr int match_default = 0;
    +
    58 constexpr int match_case_insensitive = 0x1;
    +
    59 constexpr int match_multiline = 0x2;
    +
    60
    +
    64 template <class T>
    +
    65 class basic_parser
    +
    66 {
    +
    67 public:
    +
    68 basic_parser(_In_ const std::locale& locale = std::locale()) : m_locale(locale) {}
    +
    69 virtual ~basic_parser() {}
    +
    70
    +
    71 bool search(
    +
    72 _In_reads_or_z_(end) const T* text,
    +
    73 _In_ size_t start = 0,
    +
    74 _In_ size_t end = (size_t)-1,
    +
    75 _In_ int flags = match_default)
    +
    76 {
    +
    77 for (size_t i = start; i < end && text[i]; i++)
    +
    78 if (match(text, i, end, flags))
    +
    79 return true;
    +
    80 return false;
    +
    81 }
    +
    82
    +
    83 virtual bool match(
    +
    84 _In_reads_or_z_(end) const T* text,
    +
    85 _In_ size_t start = 0,
    +
    86 _In_ size_t end = (size_t)-1,
    +
    87 _In_ int flags = match_default) = 0;
    +
    88
    +
    89 template<class _Traits, class _Ax>
    +
    90 inline bool match(
    +
    91 const std::basic_string<T, _Traits, _Ax>& text,
    +
    92 _In_ size_t start = 0,
    +
    93 _In_ size_t end = (size_t)-1,
    +
    94 _In_ int flags = match_default)
    +
    95 {
    +
    96 return match(text.c_str(), start, std::min<size_t>(end, text.size()), flags);
    +
    97 }
    +
    98
    +
    99 virtual void invalidate()
    +
    100 {
    +
    101 interval.start = 1;
    +
    102 interval.end = 0;
    +
    103 }
    +
    104
    +
    105 protected:
    +
    107 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])
    +
    108 {
    +
    109 if (text[start] == '&') {
    +
    110 // Potential entity start
    +
    111 const auto& ctype = std::use_facet<std::ctype<T>>(m_locale);
    +
    112 for (chr_end = start + 1;; chr_end++) {
    +
    113 if (chr_end >= end || text[chr_end] == 0) {
    +
    114 // Unterminated entity
    +
    115 break;
    +
    116 }
    +
    117 if (text[chr_end] == ';') {
    +
    118 // Entity end
    +
    119 size_t n = chr_end - start - 1;
    +
    120 if (n >= 2 && text[start + 1] == '#') {
    +
    121 // Numerical entity
    +
    122 char32_t unicode;
    +
    123 if (text[start + 2] == 'x' || text[start + 2] == 'X')
    +
    124 unicode = strtou32(text + start + 3, n - 2, nullptr, 16);
    +
    125 else
    +
    126 unicode = strtou32(text + start + 2, n - 1, nullptr, 10);
    +
    127#ifdef _WIN32
    +
    128 if (unicode < 0x10000) {
    +
    129 buf[0] = (wchar_t)unicode;
    +
    130 buf[1] = 0;
    +
    131 }
    +
    132 else {
    +
    133 ucs4_to_surrogate_pair(buf, unicode);
    +
    134 buf[2] = 0;
    +
    135 }
    +
    136#else
    +
    137 buf[0] = (wchar_t)unicode;
    +
    138 buf[1] = 0;
    +
    139#endif
    +
    140 chr_end++;
    +
    141 return buf;
    +
    142 }
    +
    143 const wchar_t* entity_w = sgml2uni(text + start + 1, n);
    +
    144 if (entity_w) {
    +
    145 chr_end++;
    +
    146 return entity_w;
    +
    147 }
    +
    148 // Unknown entity.
    +
    149 break;
    +
    150 }
    +
    151 else if (text[chr_end] == '&' || ctype.is(ctype.space, text[chr_end])) {
    +
    152 // This char cannot possibly be a part of entity.
    +
    153 break;
    +
    154 }
    +
    155 }
    +
    156 }
    +
    157 buf[0] = text[start];
    +
    158 buf[1] = 0;
    +
    159 chr_end = start + 1;
    +
    160 return buf;
    +
    161 }
    +
    163
    +
    164 public:
    +
    165 interval<size_t> interval;
    +
    166
    +
    167 protected:
    +
    168 std::locale m_locale;
    +
    169 };
    +
    170
    +
    171 using parser = basic_parser<char>;
    +
    172 using wparser = basic_parser<wchar_t>;
    +
    173#ifdef _UNICODE
    +
    174 using tparser = wparser;
    +
    175#else
    +
    176 using tparser = parser;
    +
    177#endif
    +
    178 using sgml_parser = basic_parser<char>;
    +
    179
    +
    183 template <class T>
    +
    184 class basic_noop : public basic_parser<T>
    +
    185 {
    +
    186 public:
    +
    187 virtual bool match(
    +
    188 _In_reads_or_z_(end) const T* text,
    +
    189 _In_ size_t start = 0,
    +
    190 _In_ size_t end = (size_t)-1,
    +
    191 _In_ int flags = match_default)
    +
    192 {
    +
    193 assert(text || start >= end);
    +
    194 if (start < end && text[start]) {
    +
    195 interval.start = interval.end = start;
    +
    196 return true;
    +
    197 }
    +
    198 interval.start = (interval.end = start) + 1;
    +
    199 return false;
    +
    200 }
    +
    201 };
    +
    202
    +
    203 using noop = basic_noop<char>;
    +
    204 using wnoop = basic_noop<wchar_t>;
    +
    205#ifdef _UNICODE
    +
    206 using tnoop = wnoop;
    +
    207#else
    +
    208 using tnoop = noop;
    +
    209#endif
    +
    210 using sgml_noop = basic_noop<char>;
    +
    211
    +
    215 template <class T>
    +
    216 class basic_any_cu : public basic_parser<T>
    +
    217 {
    +
    218 public:
    +
    219 basic_any_cu(_In_ const std::locale& locale = std::locale()) : basic_parser<T>(locale) {}
    +
    220
    +
    221 virtual bool match(
    +
    222 _In_reads_or_z_(end) const T* text,
    +
    223 _In_ size_t start = 0,
    +
    224 _In_ size_t end = (size_t)-1,
    +
    225 _In_ int flags = match_default)
    +
    226 {
    +
    227 assert(text || start >= end);
    +
    228 if (start < end && text[start]) {
    +
    229 interval.end = (interval.start = start) + 1;
    +
    230 return true;
    +
    231 }
    +
    232 interval.start = (interval.end = start) + 1;
    +
    233 return false;
    +
    234 }
    +
    235 };
    +
    236
    +
    237 using any_cu = basic_any_cu<char>;
    +
    238 using wany_cu = basic_any_cu<wchar_t>;
    +
    239#ifdef _UNICODE
    +
    240 using tany_cu = wany_cu;
    +
    241#else
    +
    242 using tany_cu = any_cu;
    +
    243#endif
    +
    244
    +
    248 class sgml_any_cp : public basic_any_cu<char>
    +
    249 {
    +
    250 public:
    +
    251 sgml_any_cp(_In_ const std::locale& locale = std::locale()) : basic_any_cu<char>(locale) {}
    +
    252
    +
    253 virtual bool match(
    +
    254 _In_reads_or_z_(end) const char* text,
    +
    255 _In_ size_t start = 0,
    +
    256 _In_ size_t end = (size_t)-1,
    +
    257 _In_ int flags = match_default)
    +
    258 {
    +
    259 assert(text || start >= end);
    +
    260 if (start < end && text[start]) {
    +
    261 if (text[start] == '&') {
    +
    262 // SGML entity
    +
    263 const auto& ctype = std::use_facet<std::ctype<char>>(m_locale);
    +
    264 for (interval.end = start + 1; interval.end < end && text[interval.end]; interval.end++)
    +
    265 if (text[interval.end] == ';') {
    +
    266 interval.end++;
    +
    267 interval.start = start;
    +
    268 return true;
    +
    269 }
    +
    270 else if (text[interval.end] == '&' || ctype.is(ctype.space, text[interval.end]))
    +
    271 break;
    +
    272 // Unterminated entity
    +
    273 }
    +
    274 interval.end = (interval.start = start) + 1;
    +
    275 return true;
    +
    276 }
    +
    277 interval.start = (interval.end = start) + 1;
    +
    278 return false;
    +
    279 }
    +
    280 };
    +
    281
    +
    285 template <class T>
    +
    286 class basic_cu : public basic_parser<T>
    +
    287 {
    +
    288 public:
    +
    289 basic_cu(T chr, bool invert = false, _In_ const std::locale& locale = std::locale()) :
    +
    290 basic_parser<T>(locale),
    +
    291 m_chr(chr),
    +
    292 m_invert(invert)
    +
    293 {}
    +
    294
    +
    295 virtual bool match(
    +
    296 _In_reads_or_z_(end) const T* text,
    +
    297 _In_ size_t start = 0,
    +
    298 _In_ size_t end = (size_t)-1,
    +
    299 _In_ int flags = match_default)
    +
    300 {
    +
    301 assert(text || start >= end);
    +
    302 if (start < end && text[start]) {
    +
    303 bool r;
    +
    304 if (flags & match_case_insensitive) {
    +
    305 const auto& ctype = std::use_facet<std::ctype<T>>(m_locale);
    +
    306 r = ctype.tolower(text[start]) == ctype.tolower(m_chr);
    +
    307 }
    +
    308 else
    +
    309 r = text[start] == m_chr;
    +
    310 if (r && !m_invert || !r && m_invert) {
    +
    311 interval.end = (interval.start = start) + 1;
    +
    312 return true;
    +
    313 }
    +
    314 }
    +
    315 interval.start = (interval.end = start) + 1;
    +
    316 return false;
    +
    317 }
    +
    318
    +
    319 protected:
    +
    320 T m_chr;
    +
    321 bool m_invert;
    +
    322 };
    +
    323
    +
    324 using cu = basic_cu<char>;
    +
    325 using wcu = basic_cu<wchar_t>;
    +
    326#ifdef _UNICODE
    +
    327 using tcu = wcu;
    +
    328#else
    +
    329 using tcu = cu;
    +
    330#endif
    +
    331
    +
    335 class sgml_cp : public sgml_parser
    +
    336 {
    +
    337 public:
    +
    338 sgml_cp(const char* chr, size_t count = (size_t)-1, bool invert = false, _In_ const std::locale& locale = std::locale()) :
    +
    339 sgml_parser(locale),
    +
    340 m_invert(invert)
    +
    341 {
    +
    342 assert(chr || !count);
    +
    343 wchar_t buf[3];
    +
    344 size_t chr_end;
    +
    345 m_chr.assign(count ? next_sgml_cp(chr, 0, count, chr_end, buf) : L"");
    +
    346 }
    +
    347
    +
    348 virtual bool match(
    +
    349 _In_reads_or_z_(end) const char* text,
    +
    350 _In_ size_t start = 0,
    +
    351 _In_ size_t end = (size_t)-1,
    +
    352 _In_ int flags = match_default)
    +
    353 {
    +
    354 assert(text || start >= end);
    +
    355 if (start < end && text[start]) {
    +
    356 wchar_t buf[3];
    +
    357 const wchar_t* chr = next_sgml_cp(text, start, end, interval.end, buf);
    +
    358 bool r = ((flags & match_case_insensitive) ?
    +
    359 stdex::strnicmp(chr, (size_t)-1, m_chr.c_str(), m_chr.size(), m_locale) :
    +
    360 stdex::strncmp(chr, (size_t)-1, m_chr.c_str(), m_chr.size())) == 0;
    +
    361 if (r && !m_invert || !r && m_invert) {
    +
    362 interval.start = start;
    +
    363 return true;
    +
    364 }
    +
    365 }
    +
    366 interval.start = (interval.end = start) + 1;
    +
    367 return false;
    +
    368 }
    +
    369
    +
    370 protected:
    +
    371 std::wstring m_chr;
    +
    372 bool m_invert;
    +
    373 };
    +
    374
    +
    378 template <class T>
    +
    379 class basic_space_cu : public basic_parser<T>
    +
    380 {
    +
    381 public:
    +
    382 basic_space_cu(bool invert = false, _In_ const std::locale& locale = std::locale()) :
    +
    383 basic_parser<T>(locale),
    +
    384 m_invert(invert)
    +
    385 {}
    +
    386
    +
    387 virtual bool match(
    +
    388 _In_reads_or_z_(end) const T* text,
    +
    389 _In_ size_t start = 0,
    +
    390 _In_ size_t end = (size_t)-1,
    +
    391 _In_ int flags = match_default)
    +
    392 {
    +
    393 assert(text || start >= end);
    +
    394 if (start < end && text[start]) {
    +
    395 bool r =
    +
    396 ((flags & match_multiline) || !islbreak(text[start])) &&
    +
    397 std::use_facet<std::ctype<T>>(m_locale).is(std::ctype_base::space, text[start]);
    +
    398 if (r && !m_invert || !r && m_invert) {
    +
    399 interval.end = (interval.start = start) + 1;
    +
    400 return true;
    +
    401 }
    +
    402 }
    +
    403 interval.start = (interval.end = start) + 1;
    +
    404 return false;
    +
    405 }
    +
    406
    +
    407 protected:
    +
    408 bool m_invert;
    +
    409 };
    +
    410
    +
    411 using space_cu = basic_space_cu<char>;
    +
    412 using wspace_cu = basic_space_cu<wchar_t>;
    +
    413#ifdef _UNICODE
    +
    414 using tspace_cu = wspace_cu;
    +
    415#else
    +
    416 using tspace_cu = space_cu;
    +
    417#endif
    +
    418
    +
    422 class sgml_space_cp : public basic_space_cu<char>
    +
    423 {
    +
    424 public:
    +
    425 sgml_space_cp(_In_ bool invert = false, _In_ const std::locale& locale = std::locale()) :
    +
    426 basic_space_cu<char>(invert, locale)
    +
    427 {}
    +
    428
    +
    429 virtual bool match(
    +
    430 _In_reads_or_z_(end) const char* text,
    +
    431 _In_ size_t start = 0,
    +
    432 _In_ size_t end = (size_t)-1,
    +
    433 _In_ int flags = match_default)
    +
    434 {
    +
    435 assert(text || start >= end);
    +
    436 if (start < end && text[start]) {
    +
    437 wchar_t buf[3];
    +
    438 const wchar_t* chr = next_sgml_cp(text, start, end, interval.end, buf);
    +
    439 const wchar_t* chr_end = chr + stdex::strlen(chr);
    +
    440 bool r =
    +
    441 ((flags & match_multiline) || !islbreak(chr, (size_t)-1)) &&
    +
    442 std::use_facet<std::ctype<wchar_t>>(m_locale).scan_not(std::ctype_base::space, chr, chr_end) == chr_end;
    +
    443 if (r && !m_invert || !r && m_invert) {
    +
    444 interval.start = start;
    +
    445 return true;
    +
    446 }
    +
    447 }
    +
    448
    +
    449 interval.start = (interval.end = start) + 1;
    +
    450 return false;
    +
    451 }
    +
    452 };
    +
    453
    +
    457 template <class T>
    +
    458 class basic_punct_cu : public basic_parser<T>
    +
    459 {
    +
    460 public:
    +
    461 basic_punct_cu(bool invert = false, _In_ const std::locale& locale = std::locale()) :
    +
    462 basic_parser<T>(locale),
    +
    463 m_invert(invert)
    +
    464 {}
    +
    465
    +
    466 virtual bool match(
    +
    467 _In_reads_or_z_(end) const T* text,
    +
    468 _In_ size_t start = 0,
    +
    469 _In_ size_t end = (size_t)-1,
    +
    470 _In_ int flags = match_default)
    +
    471 {
    +
    472 assert(text || start >= end);
    +
    473 if (start < end && text[start]) {
    +
    474 bool r = std::use_facet<std::ctype<T>>(m_locale).is(std::ctype_base::punct, text[start]);
    +
    475 if (r && !m_invert || !r && m_invert) {
    +
    476 interval.end = (interval.start = start) + 1;
    +
    477 return true;
    +
    478 }
    +
    479 }
    +
    480 interval.start = (interval.end = start) + 1;
    +
    481 return false;
    +
    482 }
    +
    483
    +
    484 protected:
    +
    485 bool m_invert;
    +
    486 };
    +
    487
    +
    488 using punct_cu = basic_punct_cu<char>;
    +
    489 using wpunct_cu = basic_punct_cu<wchar_t>;
    +
    490#ifdef _UNICODE
    +
    491 using tpunct_cu = wpunct_cu;
    +
    492#else
    +
    493 using tpunct_cu = punct_cu;
    +
    494#endif
    +
    495
    +
    499 class sgml_punct_cp : public basic_punct_cu<char>
    +
    500 {
    +
    501 public:
    +
    502 sgml_punct_cp(bool invert = false, _In_ const std::locale& locale = std::locale()) :
    +
    503 basic_punct_cu<char>(invert, locale)
    +
    504 {}
    +
    505
    +
    506 virtual bool match(
    +
    507 _In_reads_or_z_(end) const char* text,
    +
    508 _In_ size_t start = 0,
    +
    509 _In_ size_t end = (size_t)-1,
    +
    510 _In_ int flags = match_default)
    +
    511 {
    +
    512 assert(text || start >= end);
    +
    513 if (start < end && text[start]) {
    +
    514 wchar_t buf[3];
    +
    515 const wchar_t* chr = next_sgml_cp(text, start, end, interval.end, buf);
    +
    516 const wchar_t* chr_end = chr + stdex::strlen(chr);
    +
    517 bool r = std::use_facet<std::ctype<wchar_t>>(m_locale).scan_not(std::ctype_base::punct, chr, chr_end) == chr_end;
    +
    518 if (r && !m_invert || !r && m_invert) {
    +
    519 interval.start = start;
    +
    520 return true;
    +
    521 }
    +
    522 }
    +
    523 interval.start = (interval.end = start) + 1;
    +
    524 return false;
    +
    525 }
    +
    526 };
    +
    527
    +
    531 template <class T>
    +
    532 class basic_space_or_punct_cu : public basic_parser<T>
    +
    533 {
    +
    534 public:
    +
    535 basic_space_or_punct_cu(bool invert = false, _In_ const std::locale& locale = std::locale()) :
    +
    536 basic_parser<T>(locale),
    +
    537 m_invert(invert)
    +
    538 {}
    +
    539
    +
    540 virtual bool match(
    +
    541 _In_reads_or_z_(end) const T* text,
    +
    542 _In_ size_t start = 0,
    +
    543 _In_ size_t end = (size_t)-1,
    +
    544 _In_ int flags = match_default)
    +
    545 {
    +
    546 assert(text || start >= end);
    +
    547 if (start < end && text[start]) {
    +
    548 bool r =
    +
    549 ((flags & match_multiline) || !islbreak(text[start])) &&
    +
    550 std::use_facet<std::ctype<T>>(m_locale).is(std::ctype_base::space | std::ctype_base::punct, text[start]);
    +
    551 if (r && !m_invert || !r && m_invert) {
    +
    552 interval.end = (interval.start = start) + 1;
    +
    553 return true;
    +
    554 }
    +
    555 }
    +
    556 interval.start = (interval.end = start) + 1;
    +
    557 return false;
    +
    558 }
    +
    559
    +
    560 protected:
    +
    561 bool m_invert;
    +
    562 };
    +
    563
    +
    564 using space_or_punct_cu = basic_space_or_punct_cu<char>;
    +
    565 using wspace_or_punct_cu = basic_space_or_punct_cu<wchar_t>;
    +
    566#ifdef _UNICODE
    +
    567 using tspace_or_punct_cu = wspace_or_punct_cu;
    +
    568#else
    +
    569 using tspace_or_punct_cu = space_or_punct_cu;
    +
    570#endif
    +
    571
    +
    575 class sgml_space_or_punct_cp : public basic_space_or_punct_cu<char>
    +
    576 {
    +
    577 public:
    +
    578 sgml_space_or_punct_cp(bool invert = false, _In_ const std::locale& locale = std::locale()) :
    +
    579 basic_space_or_punct_cu<char>(invert, locale)
    +
    580 {}
    +
    581
    +
    582 virtual bool match(
    +
    583 _In_reads_or_z_(end) const char* text,
    +
    584 _In_ size_t start = 0,
    +
    585 _In_ size_t end = (size_t)-1,
    +
    586 _In_ int flags = match_default)
    +
    587 {
    +
    588 assert(text || start >= end);
    +
    589 if (start < end && text[start]) {
    +
    590 wchar_t buf[3];
    +
    591 const wchar_t* chr = next_sgml_cp(text, start, end, interval.end, buf);
    +
    592 const wchar_t* chr_end = chr + stdex::strlen(chr);
    +
    593 bool r =
    +
    594 ((flags & match_multiline) || !islbreak(chr, (size_t)-1)) &&
    +
    595 std::use_facet<std::ctype<wchar_t>>(m_locale).scan_not(std::ctype_base::space | std::ctype_base::punct, chr, chr_end) == chr_end;
    +
    596 if (r && !m_invert || !r && m_invert) {
    +
    597 interval.start = start;
    +
    598 return true;
    +
    599 }
    +
    600 }
    +
    601 interval.start = (interval.end = start) + 1;
    +
    602 return false;
    +
    603 }
    +
    604 };
    +
    605
    +
    609 template <class T>
    +
    610 class basic_bol : public basic_parser<T>
    +
    611 {
    +
    612 public:
    +
    613 basic_bol(bool invert = false) : m_invert(invert) {}
    +
    614
    +
    615 virtual bool match(
    +
    616 _In_reads_or_z_(end) const T* text,
    +
    617 _In_ size_t start = 0,
    +
    618 _In_ size_t end = (size_t)-1,
    +
    619 _In_ int flags = match_default)
    +
    620 {
    +
    621 assert(text || start >= end);
    +
    622 bool r = start == 0 || start <= end && islbreak(text[start - 1]);
    +
    623 if (r && !m_invert || !r && m_invert) {
    +
    624 interval.end = interval.start = start;
    +
    625 return true;
    +
    626 }
    +
    627 interval.start = (interval.end = start) + 1;
    +
    628 return false;
    +
    629 }
    +
    630
    +
    631 protected:
    +
    632 bool m_invert;
    +
    633 };
    +
    634
    +
    635 using bol = basic_bol<char>;
    +
    636 using wbol = basic_bol<wchar_t>;
    +
    637#ifdef _UNICODE
    +
    638 using tbol = wbol;
    +
    639#else
    +
    640 using tbol = bol;
    +
    641#endif
    +
    642 using sgml_bol = basic_bol<char>;
    +
    643
    +
    647 template <class T>
    +
    648 class basic_eol : public basic_parser<T>
    +
    649 {
    +
    650 public:
    +
    651 basic_eol(bool invert = false) : m_invert(invert) {}
    +
    652
    +
    653 virtual bool match(
    +
    654 _In_reads_or_z_(end) const T* text,
    +
    655 _In_ size_t start = 0,
    +
    656 _In_ size_t end = (size_t)-1,
    +
    657 _In_ int flags = match_default)
    +
    658 {
    +
    659 assert(text || start >= end);
    +
    660 bool r = islbreak(text[start]);
    +
    661 if (r && !m_invert || !r && m_invert) {
    +
    662 interval.end = interval.start = start;
    +
    663 return true;
    +
    664 }
    +
    665 interval.start = (interval.end = start) + 1;
    +
    666 return false;
    +
    667 }
    +
    668
    +
    669 protected:
    +
    670 bool m_invert;
    +
    671 };
    +
    672
    +
    673 using eol = basic_eol<char>;
    +
    674 using weol = basic_eol<wchar_t>;
    +
    675#ifdef _UNICODE
    +
    676 using teol = weol;
    +
    677#else
    +
    678 using teol = eol;
    +
    679#endif
    +
    680 using sgml_eol = basic_eol<char>;
    +
    681
    +
    682 template <class T>
    +
    683 class basic_set : public basic_parser<T>
    +
    684 {
    +
    685 public:
    +
    686 basic_set(bool invert = false, _In_ const std::locale& locale = std::locale()) :
    +
    687 basic_parser<T>(locale),
    +
    688 hit_offset((size_t)-1),
    +
    689 m_invert(invert)
    +
    690 {}
    +
    691
    +
    692 virtual bool match(
    +
    693 _In_reads_or_z_(end) const T* text,
    +
    694 _In_ size_t start = 0,
    +
    695 _In_ size_t end = (size_t)-1,
    +
    696 _In_ int flags = match_default) = 0;
    +
    697
    +
    698 virtual void invalidate()
    +
    699 {
    +
    700 hit_offset = (size_t)-1;
    +
    701 basic_parser<T>::invalidate();
    +
    702 }
    +
    703
    +
    704 public:
    +
    705 size_t hit_offset;
    +
    706
    +
    707 protected:
    +
    708 bool m_invert;
    +
    709 };
    +
    710
    +
    714 template <class T>
    +
    715 class basic_cu_set : public basic_set<T>
    +
    716 {
    +
    717 public:
    +
    718 basic_cu_set(
    +
    719 _In_reads_or_z_(count) const T* set,
    +
    720 _In_ size_t count = (size_t)-1,
    +
    721 _In_ bool invert = false,
    +
    722 _In_ const std::locale& locale = std::locale()) :
    +
    723 basic_set<T>(invert, locale)
    +
    724 {
    +
    725 if (set)
    +
    726 m_set.assign(set, set + stdex::strnlen(set, count));
    +
    727 }
    +
    728
    +
    729 virtual bool match(
    +
    730 _In_reads_or_z_(end) const T* text,
    +
    731 _In_ size_t start = 0,
    +
    732 _In_ size_t end = (size_t)-1,
    +
    733 _In_ int flags = match_default)
    +
    734 {
    +
    735 assert(text || start >= end);
    +
    736 if (start < end && text[start]) {
    +
    737 const T* set = m_set.c_str();
    +
    738 size_t r = (flags & match_case_insensitive) ?
    +
    739 stdex::strnichr(set, m_set.size(), text[start], m_locale) :
    +
    740 stdex::strnchr(set, m_set.size(), text[start]);
    +
    741 if (r != stdex::npos && !m_invert || r == stdex::npos && m_invert) {
    +
    742 hit_offset = r;
    +
    743 interval.end = (interval.start = start) + 1;
    +
    744 return true;
    +
    745 }
    +
    746 }
    +
    747 hit_offset = (size_t)-1;
    +
    748 interval.start = (interval.end = start) + 1;
    +
    749 return false;
    +
    750 }
    +
    751
    +
    752 protected:
    +
    753 std::basic_string<T> m_set;
    +
    754 };
    +
    755
    +
    756 using cu_set = basic_cu_set<char>;
    +
    757 using wcu_set = basic_cu_set<wchar_t>;
    +
    758#ifdef _UNICODE
    +
    759 using tcu_set = wcu_set;
    +
    760#else
    +
    761 using tcu_set = cu_set;
    +
    762#endif
    +
    763
    +
    767 class sgml_cp_set : public basic_set<char>
    +
    768 {
    +
    769 public:
    +
    770 sgml_cp_set(const char* set, size_t count = (size_t)-1, bool invert = false, _In_ const std::locale& locale = std::locale()) :
    +
    771 basic_set<char>(invert, locale)
    +
    772 {
    +
    773 if (set)
    +
    774 m_set = sgml2wstr(set, count);
    +
    775 }
    +
    776
    +
    777 virtual bool match(
    +
    778 _In_reads_or_z_(end) const char* text,
    +
    779 _In_ size_t start = 0,
    +
    780 _In_ size_t end = (size_t)-1,
    +
    781 _In_ int flags = match_default)
    +
    782 {
    +
    783 assert(text || start >= end);
    +
    784 if (start < end && text[start]) {
    +
    785 wchar_t buf[3];
    +
    786 const wchar_t* chr = next_sgml_cp(text, start, end, interval.end, buf);
    +
    787 const wchar_t* set = m_set.c_str();
    +
    788 size_t r = (flags & match_case_insensitive) ?
    +
    789 stdex::strnistr(set, m_set.size(), chr, m_locale) :
    +
    790 stdex::strnstr(set, m_set.size(), chr);
    +
    791 if (r != stdex::npos && !m_invert || r == stdex::npos && m_invert) {
    +
    792 hit_offset = r;
    +
    793 interval.start = start;
    +
    794 return true;
    +
    795 }
    +
    796 }
    +
    797 hit_offset = (size_t)-1;
    +
    798 interval.start = (interval.end = start) + 1;
    +
    799 return false;
    +
    800 }
    +
    801
    +
    802 protected:
    +
    803 std::wstring m_set;
    +
    804 };
    +
    805
    +
    809 template <class T>
    +
    810 class basic_string : public basic_parser<T>
    +
    811 {
    +
    812 public:
    +
    813 basic_string(
    +
    814 _In_reads_or_z_(count) const T* str,
    +
    815 _In_ size_t count = (size_t)-1,
    +
    816 _In_ const std::locale& locale = std::locale()) :
    +
    817 basic_parser<T>(locale),
    +
    818 m_str(str, str + stdex::strnlen(str, count))
    +
    819 {}
    +
    820
    +
    821 virtual bool match(
    +
    822 _In_reads_or_z_(end) const T* text,
    +
    823 _In_ size_t start = 0,
    +
    824 _In_ size_t end = (size_t)-1,
    +
    825 _In_ int flags = match_default)
    +
    826 {
    +
    827 assert(text || start >= end);
    +
    828 size_t
    +
    829 m = m_str.size(),
    +
    830 n = std::min<size_t>(end - start, m);
    +
    831 bool r = ((flags & match_case_insensitive) ?
    +
    832 stdex::strnicmp(text + start, n, m_str.c_str(), m, m_locale) :
    +
    833 stdex::strncmp(text + start, n, m_str.c_str(), m)) == 0;
    +
    834 if (r) {
    +
    835 interval.end = (interval.start = start) + n;
    +
    836 return true;
    +
    837 }
    +
    838 interval.start = (interval.end = start) + 1;
    +
    839 return false;
    +
    840 }
    +
    841
    +
    842 protected:
    +
    843 std::basic_string<T> m_str;
    +
    844 };
    +
    845
    +
    846 using string = basic_string<char>;
    +
    847 using wstring = basic_string<wchar_t>;
    +
    848#ifdef _UNICODE
    +
    849 using tstring = wstring;
    +
    850#else
    +
    851 using tstring = string;
    +
    852#endif
    +
    853
    +
    857 class sgml_string : public sgml_parser
    +
    858 {
    +
    859 public:
    +
    860 sgml_string(const char* str, size_t count = (size_t)-1, _In_ const std::locale& locale = std::locale()) :
    +
    861 sgml_parser(locale),
    +
    862 m_str(sgml2wstr(str, count))
    +
    863 {}
    +
    864
    +
    865 virtual bool match(
    +
    866 _In_reads_or_z_(end) const char* text,
    +
    867 _In_ size_t start = 0,
    +
    868 _In_ size_t end = (size_t)-1,
    +
    869 _In_ int flags = match_default)
    +
    870 {
    +
    871 assert(text || start >= end);
    +
    872 const wchar_t* str = m_str.c_str();
    +
    873 const bool case_insensitive = flags & match_case_insensitive ? true : false;
    +
    874 const auto& ctype = std::use_facet<std::ctype<wchar_t>>(m_locale);
    +
    875 for (interval.end = start;;) {
    +
    876 if (!*str) {
    +
    877 interval.start = start;
    +
    878 return true;
    +
    879 }
    +
    880 if (interval.end >= end || !text[interval.end]) {
    +
    881 interval.start = (interval.end = start) + 1;
    +
    882 return false;
    +
    883 }
    +
    884 wchar_t buf[3];
    +
    885 const wchar_t* chr = next_sgml_cp(text, interval.end, end, interval.end, buf);
    +
    886 for (; *chr; ++str, ++chr) {
    +
    887 if (!*str ||
    +
    888 (case_insensitive ? ctype.tolower(*str) != ctype.tolower(*chr) : *str != *chr))
    +
    889 {
    +
    890 interval.start = (interval.end = start) + 1;
    +
    891 return false;
    +
    892 }
    +
    893 }
    +
    894 }
    +
    895 }
    +
    896
    +
    897 protected:
    +
    898 std::wstring m_str;
    +
    899 };
    +
    900
    +
    904 template <class T>
    +
    905 class basic_iterations : public basic_parser<T>
    +
    906 {
    +
    907 public:
    +
    908 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) :
    +
    909 m_el(el),
    +
    910 m_min_iterations(min_iterations),
    +
    911 m_max_iterations(max_iterations),
    +
    912 m_greedy(greedy)
    +
    913 {}
    +
    914
    +
    915 virtual bool match(
    +
    916 _In_reads_or_z_(end) const T* text,
    +
    917 _In_ size_t start = 0,
    +
    918 _In_ size_t end = (size_t)-1,
    +
    919 _In_ int flags = match_default)
    +
    920 {
    +
    921 assert(text || start >= end);
    +
    922 interval.start = interval.end = start;
    +
    923 for (size_t i = 0; ; i++) {
    +
    924 if (!m_greedy && i >= m_min_iterations || i >= m_max_iterations)
    +
    925 return true;
    +
    926 if (!m_el->match(text, interval.end, end, flags)) {
    +
    927 if (i >= m_min_iterations)
    +
    928 return true;
    +
    929 break;
    +
    930 }
    +
    931 if (m_el->interval.end == interval.end) {
    +
    932 // Element did match, but the matching interval was empty. Quit instead of spinning.
    +
    933 return true;
    +
    934 }
    +
    935 interval.end = m_el->interval.end;
    +
    936 }
    +
    937 interval.start = (interval.end = start) + 1;
    +
    938 return false;
    +
    939 }
    +
    940
    +
    941 protected:
    +
    942 std::shared_ptr<basic_parser<T>> m_el;
    +
    943 size_t m_min_iterations;
    +
    944 size_t m_max_iterations;
    +
    945 bool m_greedy;
    +
    946 };
    +
    947
    +
    948 using iterations = basic_iterations<char>;
    +
    949 using witerations = basic_iterations<wchar_t>;
    +
    950#ifdef _UNICODE
    +
    951 using titerations = witerations;
    +
    952#else
    +
    953 using titerations = iterations;
    +
    954#endif
    +
    955 using sgml_iterations = basic_iterations<char>;
    +
    956
    +
    960 template <class T>
    +
    961 class parser_collection : public basic_parser<T>
    +
    962 {
    +
    963 protected:
    +
    964 parser_collection(_In_ const std::locale& locale) : basic_parser<T>(locale) {}
    +
    965
    +
    966 public:
    +
    967 parser_collection(
    +
    968 _In_count_(count) const std::shared_ptr<basic_parser<T>>* el,
    +
    969 _In_ size_t count,
    +
    970 _In_ const std::locale& locale = std::locale()) :
    +
    971 basic_parser<T>(locale)
    +
    972 {
    +
    973 assert(el || !count);
    +
    974 m_collection.reserve(count);
    +
    975 for (size_t i = 0; i < count; i++)
    +
    976 m_collection.push_back(el[i]);
    +
    977 }
    +
    978
    +
    979 parser_collection(
    +
    980 _Inout_ std::vector<std::shared_ptr<basic_parser<T>>>&& collection,
    +
    981 _In_ const std::locale& locale = std::locale()) :
    +
    982 basic_parser<T>(locale),
    +
    983 m_collection(std::move(collection))
    +
    984 {}
    +
    985
    +
    986 virtual void invalidate()
    +
    987 {
    +
    988 for (auto& el: m_collection)
    +
    989 el->invalidate();
    +
    990 basic_parser<T>::invalidate();
    +
    991 }
    +
    992
    +
    993 protected:
    +
    994 std::vector<std::shared_ptr<basic_parser<T>>> m_collection;
    +
    995 };
    +
    996
    +
    1000 template <class T>
    +
    1001 class basic_sequence : public parser_collection<T>
    +
    1002 {
    +
    1003 public:
    +
    1004 basic_sequence(
    +
    1005 _In_count_(count) const std::shared_ptr<basic_parser<T>>* el = nullptr,
    +
    1006 _In_ size_t count = 0,
    +
    1007 _In_ const std::locale& locale = std::locale()) :
    +
    1008 parser_collection<T>(el, count, locale)
    +
    1009 {}
    +
    1010
    +
    1011 basic_sequence(
    +
    1012 _Inout_ std::vector<std::shared_ptr<basic_parser<T>>>&& collection,
    +
    1013 _In_ const std::locale& locale = std::locale()) :
    +
    1014 parser_collection<T>(std::move(collection), locale)
    +
    1015 {}
    +
    1016
    +
    1017 virtual bool match(
    +
    1018 _In_reads_or_z_(end) const T* text,
    +
    1019 _In_ size_t start = 0,
    +
    1020 _In_ size_t end = (size_t)-1,
    +
    1021 _In_ int flags = match_default)
    +
    1022 {
    +
    1023 assert(text || start >= end);
    +
    1024 interval.end = start;
    +
    1025 for (auto i = m_collection.begin(); i != m_collection.end(); ++i) {
    +
    1026 if (!(*i)->match(text, interval.end, end, flags)) {
    +
    1027 for (++i; i != m_collection.end(); ++i)
    +
    1028 (*i)->invalidate();
    +
    1029 interval.start = (interval.end = start) + 1;
    +
    1030 return false;
    +
    1031 }
    +
    1032 interval.end = (*i)->interval.end;
    +
    1033 }
    +
    1034 interval.start = start;
    +
    1035 return true;
    +
    1036 }
    +
    1037 };
    +
    1038
    +
    1039 using sequence = basic_sequence<char>;
    +
    1040 using wsequence = basic_sequence<wchar_t>;
    +
    1041#ifdef _UNICODE
    +
    1042 using tsequence = wsequence;
    +
    1043#else
    +
    1044 using tsequence = sequence;
    +
    1045#endif
    +
    1046 using sgml_sequence = basic_sequence<char>;
    +
    1047
    +
    1051 template <class T>
    +
    1052 class basic_branch : public parser_collection<T>
    +
    1053 {
    +
    1054 protected:
    +
    1055 basic_branch(_In_ const std::locale& locale) :
    +
    1056 parser_collection<T>(locale),
    +
    1057 hit_offset((size_t)-1)
    +
    1058 {}
    +
    1059
    +
    1060 public:
    +
    1061 basic_branch(
    +
    1062 _In_count_(count) const std::shared_ptr<basic_parser<T>>* el = nullptr,
    +
    1063 _In_ size_t count = 0,
    +
    1064 _In_ const std::locale& locale = std::locale()) :
    +
    1065 parser_collection<T>(el, count, locale),
    +
    1066 hit_offset((size_t)-1)
    +
    1067 {}
    +
    1068
    +
    1069 basic_branch(
    +
    1070 _Inout_ std::vector<std::shared_ptr<basic_parser<T>>>&& collection,
    +
    1071 _In_ const std::locale& locale = std::locale()) :
    +
    1072 parser_collection<T>(std::move(collection), locale),
    +
    1073 hit_offset((size_t)-1)
    +
    1074 {}
    +
    1075
    +
    1076 virtual bool match(
    +
    1077 _In_reads_or_z_(end) const T* text,
    +
    1078 _In_ size_t start = 0,
    +
    1079 _In_ size_t end = (size_t)-1,
    +
    1080 _In_ int flags = match_default)
    +
    1081 {
    +
    1082 assert(text || start >= end);
    +
    1083 hit_offset = 0;
    +
    1084 for (auto i = m_collection.begin(); i != m_collection.end(); ++i, ++hit_offset) {
    +
    1085 if ((*i)->match(text, start, end, flags)) {
    +
    1086 interval = (*i)->interval;
    +
    1087 for (++i; i != m_collection.end(); ++i)
    +
    1088 (*i)->invalidate();
    +
    1089 return true;
    +
    1090 }
    +
    1091 }
    +
    1092 hit_offset = (size_t)-1;
    +
    1093 interval.start = (interval.end = start) + 1;
    +
    1094 return false;
    +
    1095 }
    +
    1096
    +
    1097 virtual void invalidate()
    +
    1098 {
    +
    1099 hit_offset = (size_t)-1;
    +
    1100 parser_collection<T>::invalidate();
    +
    1101 }
    +
    1102
    +
    1103 public:
    +
    1104 size_t hit_offset;
    +
    1105 };
    +
    1106
    +
    1107 using branch = basic_branch<char>;
    +
    1108 using wbranch = basic_branch<wchar_t>;
    +
    1109#ifdef _UNICODE
    +
    1110 using tbranch = wbranch;
    +
    1111#else
    +
    1112 using tbranch = branch;
    +
    1113#endif
    +
    1114 using sgml_branch = basic_branch<char>;
    +
    1115
    +
    1119 template <class T, class T_parser = basic_string<T>>
    +
    1120 class basic_string_branch : public basic_branch<T>
    +
    1121 {
    +
    1122 public:
    +
    1123 inline basic_string_branch(
    +
    1124 _In_reads_(count) const T* str_z = nullptr,
    +
    1125 _In_ size_t count = 0,
    +
    1126 _In_ const std::locale& locale = std::locale()) :
    +
    1127 basic_branch<T>(locale)
    +
    1128 {
    +
    1129 build(str_z, count);
    +
    1130 }
    +
    1131
    +
    1132 inline basic_string_branch(_In_z_ const T* str, ...) :
    +
    1133 basic_branch<T>(std::locale())
    +
    1134 {
    +
    1135 va_list params;
    +
    1136 va_start(params, str);
    +
    1137 build(str, params);
    +
    1138 va_end(params);
    +
    1139 }
    +
    1140
    +
    1141 inline basic_string_branch(_In_ const std::locale& locale, _In_z_ const T* str, ...) :
    +
    1142 basic_branch<T>(locale)
    +
    1143 {
    +
    1144 va_list params;
    +
    1145 va_start(params, str);
    +
    1146 build(str, params);
    +
    1147 va_end(params);
    +
    1148 }
    +
    1149
    +
    1150 protected:
    +
    1151 void build(_In_reads_(count) const T* str_z, _In_ size_t count)
    +
    1152 {
    +
    1153 assert(str_z || !count);
    +
    1154 if (count) {
    +
    1155 size_t offset, n;
    +
    1156 for (
    +
    1157 offset = n = 0;
    +
    1158 offset < count && str_z[offset];
    +
    1159 offset += stdex::strnlen(str_z + offset, count - offset) + 1, ++n);
    +
    1160 m_collection.reserve(n);
    +
    1161 for (
    +
    1162 offset = 0;
    +
    1163 offset < count && str_z[offset];
    +
    1164 offset += stdex::strnlen(str_z + offset, count - offset) + 1)
    +
    1165 m_collection.push_back(std::move(std::make_shared<T_parser>(str_z + offset, count - offset, m_locale)));
    +
    1166 }
    +
    1167 }
    +
    1168
    +
    1169 void build(_In_z_ const T* str, _In_ va_list params)
    +
    1170 {
    +
    1171 const T* p;
    +
    1172 for (
    +
    1173 m_collection.push_back(std::move(std::make_shared<T_parser>(str, (size_t)-1, m_locale)));
    +
    1174 (p = va_arg(params, const T*)) != nullptr;
    +
    1175 m_collection.push_back(std::move(std::make_shared<T_parser>(p, (size_t)-1, m_locale))));
    +
    1176 }
    +
    1177 };
    +
    1178
    +
    1179 using string_branch = basic_string_branch<char>;
    +
    1180 using wstring_branch = basic_string_branch<wchar_t>;
    +
    1181#ifdef _UNICODE
    +
    1182 using tstring_branch = wstring_branch;
    +
    1183#else
    +
    1184 using tstring_branch = string_branch;
    +
    1185#endif
    +
    1186 using sgml_string_branch = basic_string_branch<char, sgml_string>;
    +
    1187
    +
    1191 template <class T>
    +
    1192 class basic_permutation : public parser_collection<T>
    +
    1193 {
    +
    1194 public:
    +
    1195 basic_permutation(
    +
    1196 _In_count_(count) const std::shared_ptr<basic_parser<T>>* el = nullptr,
    +
    1197 _In_ size_t count = 0,
    +
    1198 _In_ const std::locale& locale = std::locale()) :
    +
    1199 parser_collection<T>(el, count, locale)
    +
    1200 {}
    +
    1201
    +
    1202 basic_permutation(
    +
    1203 _Inout_ std::vector<std::shared_ptr<basic_parser<T>>>&& collection,
    +
    1204 _In_ const std::locale& locale = std::locale()) :
    +
    1205 parser_collection<T>(std::move(collection), locale)
    +
    1206 {}
    +
    1207
    +
    1208 virtual bool match(
    +
    1209 _In_reads_or_z_(end) const T* text,
    +
    1210 _In_ size_t start = 0,
    +
    1211 _In_ size_t end = (size_t)-1,
    +
    1212 _In_ int flags = match_default)
    +
    1213 {
    +
    1214 assert(text || start >= end);
    +
    1215 for (auto& el: m_collection)
    +
    1216 el->invalidate();
    +
    1217 if (match_recursively(text, start, end, flags)) {
    +
    1218 interval.start = start;
    +
    1219 return true;
    +
    1220 }
    +
    1221 interval.start = (interval.end = start) + 1;
    +
    1222 return false;
    +
    1223 }
    +
    1224
    +
    1225 protected:
    +
    1226 bool match_recursively(
    +
    1227 _In_reads_or_z_(end) const T* text,
    +
    1228 _In_ size_t start = 0,
    +
    1229 _In_ size_t end = (size_t)-1,
    +
    1230 _In_ int flags = match_default)
    +
    1231 {
    +
    1232 bool all_matched = true;
    +
    1233 for (auto& el: m_collection) {
    +
    1234 if (!el->interval) {
    +
    1235 // Element was not matched in permutatuion yet.
    +
    1236 all_matched = false;
    +
    1237 if (el->match(text, start, end, flags)) {
    +
    1238 // Element matched for the first time.
    +
    1239 if (match_recursively(text, el->interval.end, end, flags)) {
    +
    1240 // Rest of the elements matched too.
    +
    1241 return true;
    +
    1242 }
    +
    1243 el->invalidate();
    +
    1244 }
    +
    1245 }
    +
    1246 }
    +
    1247 if (all_matched) {
    +
    1248 interval.end = start;
    +
    1249 return true;
    +
    1250 }
    +
    1251 return false;
    +
    1252 }
    +
    1253 };
    +
    1254
    +
    1255 using permutation = basic_permutation<char>;
    +
    1256 using wpermutation = basic_permutation<wchar_t>;
    +
    1257#ifdef _UNICODE
    +
    1258 using tpermutation = wpermutation;
    +
    1259#else
    +
    1260 using tpermutation = permutation;
    +
    1261#endif
    +
    1262 using sgml_permutation = basic_permutation<char>;
    +
    1263
    +
    1267 template <class T>
    +
    1268 class basic_integer : public basic_parser<T>
    +
    1269 {
    +
    1270 public:
    +
    1271 basic_integer(_In_ const std::locale& locale = std::locale()) :
    +
    1272 basic_parser<T>(locale),
    +
    1273 value(0)
    +
    1274 {}
    +
    1275
    +
    1276 virtual void invalidate()
    +
    1277 {
    +
    1278 value = 0;
    +
    1279 basic_parser<T>::invalidate();
    +
    1280 }
    +
    1281
    +
    1282 public:
    +
    1283 size_t value;
    +
    1284 };
    +
    1285
    +
    1289 template <class T>
    +
    1290 class basic_integer10 : public basic_integer<T>
    +
    1291 {
    +
    1292 public:
    +
    1293 basic_integer10(
    +
    1294 _In_ const std::shared_ptr<basic_parser<T>>& digit_0,
    +
    1295 _In_ const std::shared_ptr<basic_parser<T>>& digit_1,
    +
    1296 _In_ const std::shared_ptr<basic_parser<T>>& digit_2,
    +
    1297 _In_ const std::shared_ptr<basic_parser<T>>& digit_3,
    +
    1298 _In_ const std::shared_ptr<basic_parser<T>>& digit_4,
    +
    1299 _In_ const std::shared_ptr<basic_parser<T>>& digit_5,
    +
    1300 _In_ const std::shared_ptr<basic_parser<T>>& digit_6,
    +
    1301 _In_ const std::shared_ptr<basic_parser<T>>& digit_7,
    +
    1302 _In_ const std::shared_ptr<basic_parser<T>>& digit_8,
    +
    1303 _In_ const std::shared_ptr<basic_parser<T>>& digit_9,
    +
    1304 _In_ const std::locale& locale = std::locale()) :
    +
    1305 basic_integer<T>(locale),
    +
    1306 m_digit_0(digit_0),
    +
    1307 m_digit_1(digit_1),
    +
    1308 m_digit_2(digit_2),
    +
    1309 m_digit_3(digit_3),
    +
    1310 m_digit_4(digit_4),
    +
    1311 m_digit_5(digit_5),
    +
    1312 m_digit_6(digit_6),
    +
    1313 m_digit_7(digit_7),
    +
    1314 m_digit_8(digit_8),
    +
    1315 m_digit_9(digit_9)
    +
    1316 {}
    +
    1317
    +
    1318 virtual bool match(
    +
    1319 _In_reads_or_z_(end) const T* text,
    +
    1320 _In_ size_t start = 0,
    +
    1321 _In_ size_t end = (size_t)-1,
    +
    1322 _In_ int flags = match_default)
    +
    1323 {
    +
    1324 assert(text || start >= end);
    +
    1325 for (interval.end = start, value = 0; interval.end < end && text[interval.end];) {
    +
    1326 size_t dig;
    +
    1327 if (m_digit_0->match(text, interval.end, end, flags)) { dig = 0; interval.end = m_digit_0->interval.end; }
    +
    1328 else if (m_digit_1->match(text, interval.end, end, flags)) { dig = 1; interval.end = m_digit_1->interval.end; }
    +
    1329 else if (m_digit_2->match(text, interval.end, end, flags)) { dig = 2; interval.end = m_digit_2->interval.end; }
    +
    1330 else if (m_digit_3->match(text, interval.end, end, flags)) { dig = 3; interval.end = m_digit_3->interval.end; }
    +
    1331 else if (m_digit_4->match(text, interval.end, end, flags)) { dig = 4; interval.end = m_digit_4->interval.end; }
    +
    1332 else if (m_digit_5->match(text, interval.end, end, flags)) { dig = 5; interval.end = m_digit_5->interval.end; }
    +
    1333 else if (m_digit_6->match(text, interval.end, end, flags)) { dig = 6; interval.end = m_digit_6->interval.end; }
    +
    1334 else if (m_digit_7->match(text, interval.end, end, flags)) { dig = 7; interval.end = m_digit_7->interval.end; }
    +
    1335 else if (m_digit_8->match(text, interval.end, end, flags)) { dig = 8; interval.end = m_digit_8->interval.end; }
    +
    1336 else if (m_digit_9->match(text, interval.end, end, flags)) { dig = 9; interval.end = m_digit_9->interval.end; }
    +
    1337 else break;
    +
    1338 value = value * 10 + dig;
    +
    1339 }
    +
    1340 if (start < interval.end) {
    +
    1341 interval.start = start;
    +
    1342 return true;
    +
    1343 }
    +
    1344 interval.start = (interval.end = start) + 1;
    +
    1345 return false;
    +
    1346 }
    +
    1347
    +
    1348 protected:
    +
    1349 std::shared_ptr<basic_parser<T>>
    +
    1350 m_digit_0,
    +
    1351 m_digit_1,
    +
    1352 m_digit_2,
    +
    1353 m_digit_3,
    +
    1354 m_digit_4,
    +
    1355 m_digit_5,
    +
    1356 m_digit_6,
    +
    1357 m_digit_7,
    +
    1358 m_digit_8,
    +
    1359 m_digit_9;
    +
    1360 };
    +
    1361
    +
    1362 using integer10 = basic_integer10<char>;
    +
    1363 using winteger10 = basic_integer10<wchar_t>;
    +
    1364#ifdef _UNICODE
    +
    1365 using tinteger10 = winteger10;
    +
    1366#else
    +
    1367 using tinteger10 = integer10;
    +
    1368#endif
    +
    1369 using sgml_integer10 = basic_integer10<char>;
    +
    1370
    +
    1374 template <class T>
    +
    1375 class basic_integer10ts : public basic_integer<T>
    +
    1376 {
    +
    1377 public:
    +
    1378 basic_integer10ts(
    +
    1379 _In_ const std::shared_ptr<basic_integer10<T>>& digits,
    +
    1380 _In_ const std::shared_ptr<basic_set<T>>& separator,
    +
    1381 _In_ const std::locale& locale = std::locale()) :
    +
    1382 basic_integer<T>(locale),
    +
    1383 digit_count(0),
    +
    1384 has_separators(false),
    +
    1385 m_digits(digits),
    +
    1386 m_separator(separator)
    +
    1387 {}
    +
    1388
    +
    1389 virtual bool match(
    +
    1390 _In_reads_or_z_(end) const T* text,
    +
    1391 _In_ size_t start = 0,
    +
    1392 _In_ size_t end = (size_t)-1,
    +
    1393 _In_ int flags = match_default)
    +
    1394 {
    +
    1395 assert(text || start >= end);
    +
    1396 if (m_digits->match(text, start, end, flags)) {
    +
    1397 // Leading part match.
    +
    1398 value = m_digits->value;
    +
    1399 digit_count = m_digits->interval.size();
    +
    1400 has_separators = false;
    +
    1401 interval.start = start;
    +
    1402 interval.end = m_digits->interval.end;
    +
    1403 if (m_digits->interval.size() <= 3) {
    +
    1404 // Maybe separated with thousand separators?
    +
    1405 size_t hit_offset = (size_t)-1;
    +
    1406 while (m_separator->match(text, interval.end, end, flags) &&
    +
    1407 (hit_offset == (size_t)-1 || hit_offset == m_separator->hit_offset) && // All separators must be the same, no mixing.
    +
    1408 m_digits->match(text, m_separator->interval.end, end, flags) &&
    +
    1409 m_digits->interval.size() == 3)
    +
    1410 {
    +
    1411 // Thousand separator and three-digit integer followed.
    +
    1412 value = value * 1000 + m_digits->value;
    +
    1413 digit_count += 3;
    +
    1414 has_separators = true;
    +
    1415 interval.end = m_digits->interval.end;
    +
    1416 hit_offset = m_separator->hit_offset;
    +
    1417 }
    +
    1418 }
    +
    1419
    +
    1420 return true;
    +
    1421 }
    +
    1422 value = 0;
    +
    1423 interval.start = (interval.end = start) + 1;
    +
    1424 return false;
    +
    1425 }
    +
    1426
    +
    1427 virtual void invalidate()
    +
    1428 {
    +
    1429 digit_count = 0;
    +
    1430 has_separators = false;
    +
    1431 basic_integer<T>::invalidate();
    +
    1432 }
    +
    1433
    +
    1434 public:
    +
    1435 size_t digit_count;
    +
    1436 bool has_separators;
    +
    1437
    +
    1438 protected:
    +
    1439 std::shared_ptr<basic_integer10<T>> m_digits;
    +
    1440 std::shared_ptr<basic_set<T>> m_separator;
    +
    1441 };
    +
    1442
    +
    1443 using integer10ts = basic_integer10ts<char>;
    +
    1444 using winteger10ts = basic_integer10ts<wchar_t>;
    +
    1445#ifdef _UNICODE
    +
    1446 using tinteger10ts = winteger10ts;
    +
    1447#else
    +
    1448 using tinteger10ts = integer10ts;
    +
    1449#endif
    +
    1450 using sgml_integer10ts = basic_integer10ts<char>;
    +
    1451
    +
    1455 template <class T>
    +
    1456 class basic_integer16 : public basic_integer<T>
    +
    1457 {
    +
    1458 public:
    +
    1459 basic_integer16(
    +
    1460 _In_ const std::shared_ptr<basic_parser<T>>& digit_0,
    +
    1461 _In_ const std::shared_ptr<basic_parser<T>>& digit_1,
    +
    1462 _In_ const std::shared_ptr<basic_parser<T>>& digit_2,
    +
    1463 _In_ const std::shared_ptr<basic_parser<T>>& digit_3,
    +
    1464 _In_ const std::shared_ptr<basic_parser<T>>& digit_4,
    +
    1465 _In_ const std::shared_ptr<basic_parser<T>>& digit_5,
    +
    1466 _In_ const std::shared_ptr<basic_parser<T>>& digit_6,
    +
    1467 _In_ const std::shared_ptr<basic_parser<T>>& digit_7,
    +
    1468 _In_ const std::shared_ptr<basic_parser<T>>& digit_8,
    +
    1469 _In_ const std::shared_ptr<basic_parser<T>>& digit_9,
    +
    1470 _In_ const std::shared_ptr<basic_parser<T>>& digit_10,
    +
    1471 _In_ const std::shared_ptr<basic_parser<T>>& digit_11,
    +
    1472 _In_ const std::shared_ptr<basic_parser<T>>& digit_12,
    +
    1473 _In_ const std::shared_ptr<basic_parser<T>>& digit_13,
    +
    1474 _In_ const std::shared_ptr<basic_parser<T>>& digit_14,
    +
    1475 _In_ const std::shared_ptr<basic_parser<T>>& digit_15,
    +
    1476 _In_ const std::locale& locale = std::locale()) :
    +
    1477 basic_integer<T>(locale),
    +
    1478 m_digit_0(digit_0),
    +
    1479 m_digit_1(digit_1),
    +
    1480 m_digit_2(digit_2),
    +
    1481 m_digit_3(digit_3),
    +
    1482 m_digit_4(digit_4),
    +
    1483 m_digit_5(digit_5),
    +
    1484 m_digit_6(digit_6),
    +
    1485 m_digit_7(digit_7),
    +
    1486 m_digit_8(digit_8),
    +
    1487 m_digit_9(digit_9),
    +
    1488 m_digit_10(digit_10),
    +
    1489 m_digit_11(digit_11),
    +
    1490 m_digit_12(digit_12),
    +
    1491 m_digit_13(digit_13),
    +
    1492 m_digit_14(digit_14),
    +
    1493 m_digit_15(digit_15)
    +
    1494 {}
    +
    1495
    +
    1496 virtual bool match(
    +
    1497 _In_reads_or_z_(end) const T* text,
    +
    1498 _In_ size_t start = 0,
    +
    1499 _In_ size_t end = (size_t)-1,
    +
    1500 _In_ int flags = match_default)
    +
    1501 {
    +
    1502 assert(text || start >= end);
    +
    1503 for (interval.end = start, value = 0; interval.end < end && text[interval.end];) {
    +
    1504 size_t dig;
    +
    1505 if (m_digit_0->match(text, interval.end, end, flags)) { dig = 0; interval.end = m_digit_0->interval.end; }
    +
    1506 else if (m_digit_1->match(text, interval.end, end, flags)) { dig = 1; interval.end = m_digit_1->interval.end; }
    +
    1507 else if (m_digit_2->match(text, interval.end, end, flags)) { dig = 2; interval.end = m_digit_2->interval.end; }
    +
    1508 else if (m_digit_3->match(text, interval.end, end, flags)) { dig = 3; interval.end = m_digit_3->interval.end; }
    +
    1509 else if (m_digit_4->match(text, interval.end, end, flags)) { dig = 4; interval.end = m_digit_4->interval.end; }
    +
    1510 else if (m_digit_5->match(text, interval.end, end, flags)) { dig = 5; interval.end = m_digit_5->interval.end; }
    +
    1511 else if (m_digit_6->match(text, interval.end, end, flags)) { dig = 6; interval.end = m_digit_6->interval.end; }
    +
    1512 else if (m_digit_7->match(text, interval.end, end, flags)) { dig = 7; interval.end = m_digit_7->interval.end; }
    +
    1513 else if (m_digit_8->match(text, interval.end, end, flags)) { dig = 8; interval.end = m_digit_8->interval.end; }
    +
    1514 else if (m_digit_9->match(text, interval.end, end, flags)) { dig = 9; interval.end = m_digit_9->interval.end; }
    +
    1515 else if (m_digit_10->match(text, interval.end, end, flags)) { dig = 10; interval.end = m_digit_10->interval.end; }
    +
    1516 else if (m_digit_11->match(text, interval.end, end, flags)) { dig = 11; interval.end = m_digit_11->interval.end; }
    +
    1517 else if (m_digit_12->match(text, interval.end, end, flags)) { dig = 12; interval.end = m_digit_12->interval.end; }
    +
    1518 else if (m_digit_13->match(text, interval.end, end, flags)) { dig = 13; interval.end = m_digit_13->interval.end; }
    +
    1519 else if (m_digit_14->match(text, interval.end, end, flags)) { dig = 14; interval.end = m_digit_14->interval.end; }
    +
    1520 else if (m_digit_15->match(text, interval.end, end, flags)) { dig = 15; interval.end = m_digit_15->interval.end; }
    +
    1521 else break;
    +
    1522 value = value * 16 + dig;
    +
    1523 }
    +
    1524 if (start < interval.end) {
    +
    1525 interval.start = start;
    +
    1526 return true;
    +
    1527 }
    +
    1528 interval.start = (interval.end = start) + 1;
    +
    1529 return false;
    +
    1530 }
    +
    1531
    +
    1532 protected:
    +
    1533 std::shared_ptr<basic_parser<T>>
    +
    1534 m_digit_0,
    +
    1535 m_digit_1,
    +
    1536 m_digit_2,
    +
    1537 m_digit_3,
    +
    1538 m_digit_4,
    +
    1539 m_digit_5,
    +
    1540 m_digit_6,
    +
    1541 m_digit_7,
    +
    1542 m_digit_8,
    +
    1543 m_digit_9,
    +
    1544 m_digit_10,
    +
    1545 m_digit_11,
    +
    1546 m_digit_12,
    +
    1547 m_digit_13,
    +
    1548 m_digit_14,
    +
    1549 m_digit_15;
    +
    1550 };
    +
    1551
    +
    1552 using integer16 = basic_integer16<char>;
    +
    1553 using winteger16 = basic_integer16<wchar_t>;
    +
    1554#ifdef _UNICODE
    +
    1555 using tinteger16 = winteger16;
    +
    1556#else
    +
    1557 using tinteger16 = integer16;
    +
    1558#endif
    +
    1559 using sgml_integer16 = basic_integer16<char>;
    +
    1560
    +
    1564 template <class T>
    +
    1565 class basic_roman_numeral : public basic_integer<T>
    +
    1566 {
    +
    1567 public:
    +
    1568 basic_roman_numeral(
    +
    1569 _In_ const std::shared_ptr<basic_parser<T>>& digit_1,
    +
    1570 _In_ const std::shared_ptr<basic_parser<T>>& digit_5,
    +
    1571 _In_ const std::shared_ptr<basic_parser<T>>& digit_10,
    +
    1572 _In_ const std::shared_ptr<basic_parser<T>>& digit_50,
    +
    1573 _In_ const std::shared_ptr<basic_parser<T>>& digit_100,
    +
    1574 _In_ const std::shared_ptr<basic_parser<T>>& digit_500,
    +
    1575 _In_ const std::shared_ptr<basic_parser<T>>& digit_1000,
    +
    1576 _In_ const std::shared_ptr<basic_parser<T>>& digit_5000,
    +
    1577 _In_ const std::shared_ptr<basic_parser<T>>& digit_10000,
    +
    1578 _In_ const std::locale& locale = std::locale()) :
    +
    1579 basic_integer<T>(locale),
    +
    1580 m_digit_1(digit_1),
    +
    1581 m_digit_5(digit_5),
    +
    1582 m_digit_10(digit_10),
    +
    1583 m_digit_50(digit_50),
    +
    1584 m_digit_100(digit_100),
    +
    1585 m_digit_500(digit_500),
    +
    1586 m_digit_1000(digit_1000),
    +
    1587 m_digit_5000(digit_5000),
    +
    1588 m_digit_10000(digit_10000)
    +
    1589 {}
    +
    1590
    +
    1591 virtual bool match(
    +
    1592 _In_reads_or_z_(end) const T* text,
    +
    1593 _In_ size_t start = 0,
    +
    1594 _In_ size_t end = (size_t)-1,
    +
    1595 _In_ int flags = match_default)
    +
    1596 {
    +
    1597 assert(text || start >= end);
    +
    1598 size_t
    +
    1599 dig[5] = { (size_t)-1, (size_t)-1, (size_t)-1, (size_t)-1, (size_t)-1 },
    +
    1600 end2;
    +
    1601
    +
    1602 for (interval.end = start, value = 0; interval.end < end && text[interval.end]; dig[3] = dig[2], dig[2] = dig[1], dig[1] = dig[0], interval.end = end2) {
    +
    1603 if (m_digit_1 && m_digit_1->match(text, interval.end, end, flags)) { dig[0] = 1; end2 = m_digit_1->interval.end; }
    +
    1604 else if (m_digit_5 && m_digit_5->match(text, interval.end, end, flags)) { dig[0] = 5; end2 = m_digit_5->interval.end; }
    +
    1605 else if (m_digit_10 && m_digit_10->match(text, interval.end, end, flags)) { dig[0] = 10; end2 = m_digit_10->interval.end; }
    +
    1606 else if (m_digit_50 && m_digit_50->match(text, interval.end, end, flags)) { dig[0] = 50; end2 = m_digit_50->interval.end; }
    +
    1607 else if (m_digit_100 && m_digit_100->match(text, interval.end, end, flags)) { dig[0] = 100; end2 = m_digit_100->interval.end; }
    +
    1608 else if (m_digit_500 && m_digit_500->match(text, interval.end, end, flags)) { dig[0] = 500; end2 = m_digit_500->interval.end; }
    +
    1609 else if (m_digit_1000 && m_digit_1000->match(text, interval.end, end, flags)) { dig[0] = 1000; end2 = m_digit_1000->interval.end; }
    +
    1610 else if (m_digit_5000 && m_digit_5000->match(text, interval.end, end, flags)) { dig[0] = 5000; end2 = m_digit_5000->interval.end; }
    +
    1611 else if (m_digit_10000 && m_digit_10000->match(text, interval.end, end, flags)) { dig[0] = 10000; end2 = m_digit_10000->interval.end; }
    +
    1612 else break;
    +
    1613
    +
    1614 // Store first digit.
    +
    1615 if (dig[4] == (size_t)-1) dig[4] = dig[0];
    +
    1616
    +
    1617 if (dig[3] == dig[2] && dig[2] == dig[1] && dig[1] == dig[0] && dig[0] != dig[4]) {
    +
    1618 // Same digit repeated four times. No-go, unless first digit. E.g. XIIII vs. XIV. MMMMMCD allowed, IIII also...
    +
    1619 break;
    +
    1620 }
    +
    1621 if (dig[0] <= dig[1]) {
    +
    1622 // Digit is less or equal previous one: add.
    +
    1623 value += dig[0];
    +
    1624 }
    +
    1625 else if (
    +
    1626 dig[1] == 1 && (dig[0] == 5 || dig[0] == 10) ||
    +
    1627 dig[1] == 10 && (dig[0] == 50 || dig[0] == 100) ||
    +
    1628 dig[1] == 100 && (dig[0] == 500 || dig[0] == 1000) ||
    +
    1629 dig[1] == 1000 && (dig[0] == 5000 || dig[0] == 10000))
    +
    1630 {
    +
    1631 // Digit is up to two orders bigger than previous one: subtract. But...
    +
    1632 if (dig[2] < dig[0]) {
    +
    1633 // Digit is also bigger than pre-previous one. E.g. VIX (V < X => invalid)
    +
    1634 break;
    +
    1635 }
    +
    1636 value -= dig[1]; // Cancel addition in the previous step.
    +
    1637 dig[0] -= dig[1]; // Combine last two digits.
    +
    1638 dig[1] = dig[2]; // The true previous digit is now pre-previous one. :)
    +
    1639 dig[2] = dig[3]; // The true pre-previous digit is now pre-pre-previous one. :)
    +
    1640 value += dig[0]; // Add combined value.
    +
    1641 }
    +
    1642 else {
    +
    1643 // New digit is too big than the previous one. E.g. VX (V < X => invalid)
    +
    1644 break;
    +
    1645 }
    +
    1646 }
    +
    1647 if (value) {
    +
    1648 interval.start = start;
    +
    1649 return true;
    +
    1650 }
    +
    1651 interval.start = (interval.end = start) + 1;
    +
    1652 return false;
    +
    1653 }
    +
    1654
    +
    1655 protected:
    +
    1656 std::shared_ptr<basic_parser<T>>
    +
    1657 m_digit_1,
    +
    1658 m_digit_5,
    +
    1659 m_digit_10,
    +
    1660 m_digit_50,
    +
    1661 m_digit_100,
    +
    1662 m_digit_500,
    +
    1663 m_digit_1000,
    +
    1664 m_digit_5000,
    +
    1665 m_digit_10000;
    +
    1666 };
    +
    1667
    +
    1668 using roman_numeral = basic_roman_numeral<char>;
    +
    1669 using wroman_numeral = basic_roman_numeral<wchar_t>;
    +
    1670#ifdef _UNICODE
    +
    1671 using troman_numeral = wroman_numeral;
    +
    1672#else
    +
    1673 using troman_numeral = roman_numeral;
    +
    1674#endif
    +
    1675 using sgml_roman_numeral = basic_roman_numeral<char>;
    +
    1676
    +
    1680 template <class T>
    +
    1681 class basic_fraction : public basic_parser<T>
    +
    1682 {
    +
    1683 public:
    +
    1684 basic_fraction(
    +
    1685 _In_ const std::shared_ptr<basic_parser<T>>& _numerator,
    +
    1686 _In_ const std::shared_ptr<basic_parser<T>>& _fraction_line,
    +
    1687 _In_ const std::shared_ptr<basic_parser<T>>& _denominator,
    +
    1688 _In_ const std::locale& locale = std::locale()) :
    +
    1689 basic_parser<T>(locale),
    +
    1690 numerator(_numerator),
    +
    1691 fraction_line(_fraction_line),
    +
    1692 denominator(_denominator)
    +
    1693 {}
    +
    1694
    +
    1695 virtual bool match(
    +
    1696 _In_reads_or_z_(end) const T* text,
    +
    1697 _In_ size_t start = 0,
    +
    1698 _In_ size_t end = (size_t)-1,
    +
    1699 _In_ int flags = match_default)
    +
    1700 {
    +
    1701 assert(text || start >= end);
    +
    1702 if (numerator->match(text, start, end, flags) &&
    +
    1703 fraction_line->match(text, numerator->interval.end, end, flags) &&
    +
    1704 denominator->match(text, fraction_line->interval.end, end, flags))
    +
    1705 {
    +
    1706 interval.start = start;
    +
    1707 interval.end = denominator->interval.end;
    +
    1708 return true;
    +
    1709 }
    +
    1710 numerator->invalidate();
    +
    1711 fraction_line->invalidate();
    +
    1712 denominator->invalidate();
    +
    1713 interval.start = (interval.end = start) + 1;
    +
    1714 return false;
    +
    1715 }
    +
    1716
    +
    1717 virtual void invalidate()
    +
    1718 {
    +
    1719 numerator->invalidate();
    +
    1720 fraction_line->invalidate();
    +
    1721 denominator->invalidate();
    +
    1722 basic_parser<T>::invalidate();
    +
    1723 }
    +
    1724
    +
    1725 public:
    +
    1726 std::shared_ptr<basic_parser<T>> numerator;
    +
    1727 std::shared_ptr<basic_parser<T>> fraction_line;
    +
    1728 std::shared_ptr<basic_parser<T>> denominator;
    +
    1729 };
    +
    1730
    +
    1731 using fraction = basic_fraction<char>;
    +
    1732 using wfraction = basic_fraction<wchar_t>;
    +
    1733#ifdef _UNICODE
    +
    1734 using tfraction = wfraction;
    +
    1735#else
    +
    1736 using tfraction = fraction;
    +
    1737#endif
    +
    1738 using sgml_fraction = basic_fraction<char>;
    +
    1739
    +
    1743 template <class T>
    +
    1744 class basic_score : public basic_parser<T>
    +
    1745 {
    +
    1746 public:
    +
    1747 basic_score(
    +
    1748 _In_ const std::shared_ptr<basic_parser<T>>& _home,
    +
    1749 _In_ const std::shared_ptr<basic_parser<T>>& _separator,
    +
    1750 _In_ const std::shared_ptr<basic_parser<T>>& _guest,
    +
    1751 _In_ const std::shared_ptr<basic_parser<T>>& space,
    +
    1752 _In_ const std::locale& locale = std::locale()) :
    +
    1753 basic_parser<T>(locale),
    +
    1754 home(_home),
    +
    1755 separator(_separator),
    +
    1756 guest(_guest),
    +
    1757 m_space(space)
    +
    1758 {}
    +
    1759
    +
    1760 virtual bool match(
    +
    1761 _In_reads_or_z_(end) const T* text,
    +
    1762 _In_ size_t start = 0,
    +
    1763 _In_ size_t end = (size_t)-1,
    +
    1764 _In_ int flags = match_default)
    +
    1765 {
    +
    1766 assert(text || start >= end);
    +
    1767 interval.end = start;
    +
    1768
    +
    1769 if (home->match(text, interval.end, end, flags))
    +
    1770 interval.end = home->interval.end;
    +
    1771 else
    +
    1772 goto end;
    +
    1773
    +
    1774 const int space_match_flags = flags & ~match_multiline; // Spaces in score must never be broken in new line.
    +
    1775 for (; m_space->match(text, interval.end, end, space_match_flags); interval.end = m_space->interval.end);
    +
    1776
    +
    1777 if (separator->match(text, interval.end, end, flags))
    +
    1778 interval.end = separator->interval.end;
    +
    1779 else
    +
    1780 goto end;
    +
    1781
    +
    1782 for (; m_space->match(text, interval.end, end, space_match_flags); interval.end = m_space->interval.end);
    +
    1783
    +
    1784 if (guest->match(text, interval.end, end, flags))
    +
    1785 interval.end = guest->interval.end;
    +
    1786 else
    +
    1787 goto end;
    +
    1788
    +
    1789 interval.start = start;
    +
    1790 return true;
    +
    1791
    +
    1792 end:
    +
    1793 home->invalidate();
    +
    1794 separator->invalidate();
    +
    1795 guest->invalidate();
    +
    1796 interval.start = (interval.end = start) + 1;
    +
    1797 return false;
    +
    1798 }
    +
    1799
    +
    1800 virtual void invalidate()
    +
    1801 {
    +
    1802 home->invalidate();
    +
    1803 separator->invalidate();
    +
    1804 guest->invalidate();
    +
    1805 basic_parser<T>::invalidate();
    +
    1806 }
    +
    1807
    +
    1808 public:
    +
    1809 std::shared_ptr<basic_parser<T>> home;
    +
    1810 std::shared_ptr<basic_parser<T>> separator;
    +
    1811 std::shared_ptr<basic_parser<T>> guest;
    +
    1812
    +
    1813 protected:
    +
    1814 std::shared_ptr<basic_parser<T>> m_space;
    +
    1815 };
    +
    1816
    +
    1817 using score = basic_score<char>;
    +
    1818 using wscore = basic_score<wchar_t>;
    +
    1819#ifdef _UNICODE
    +
    1820 using tscore = wscore;
    +
    1821#else
    +
    1822 using tscore = score;
    +
    1823#endif
    +
    1824 using sgml_score = basic_score<char>;
    +
    1825
    +
    1829 template <class T>
    +
    1830 class basic_signed_numeral : public basic_parser<T>
    +
    1831 {
    +
    1832 public:
    +
    1833 basic_signed_numeral(
    +
    1834 _In_ const std::shared_ptr<basic_parser<T>>& _positive_sign,
    +
    1835 _In_ const std::shared_ptr<basic_parser<T>>& _negative_sign,
    +
    1836 _In_ const std::shared_ptr<basic_parser<T>>& _special_sign,
    +
    1837 _In_ const std::shared_ptr<basic_parser<T>>& _number,
    +
    1838 _In_ const std::locale& locale = std::locale()) :
    +
    1839 basic_parser<T>(locale),
    +
    1840 positive_sign(_positive_sign),
    +
    1841 negative_sign(_negative_sign),
    +
    1842 special_sign(_special_sign),
    +
    1843 number(_number)
    +
    1844 {}
    +
    1845
    +
    1846 virtual bool match(
    +
    1847 _In_reads_or_z_(end) const T* text,
    +
    1848 _In_ size_t start = 0,
    +
    1849 _In_ size_t end = (size_t)-1,
    +
    1850 _In_ int flags = match_default)
    +
    1851 {
    +
    1852 assert(text || start >= end);
    +
    1853 interval.end = start;
    +
    1854 if (positive_sign && positive_sign->match(text, interval.end, end, flags)) {
    +
    1855 interval.end = positive_sign->interval.end;
    +
    1856 if (negative_sign) negative_sign->invalidate();
    +
    1857 if (special_sign) special_sign->invalidate();
    +
    1858 }
    +
    1859 else if (negative_sign && negative_sign->match(text, interval.end, end, flags)) {
    +
    1860 interval.end = negative_sign->interval.end;
    +
    1861 if (positive_sign) positive_sign->invalidate();
    +
    1862 if (special_sign) special_sign->invalidate();
    +
    1863 }
    +
    1864 else if (special_sign && special_sign->match(text, interval.end, end, flags)) {
    +
    1865 interval.end = special_sign->interval.end;
    +
    1866 if (positive_sign) positive_sign->invalidate();
    +
    1867 if (negative_sign) negative_sign->invalidate();
    +
    1868 }
    +
    1869 else {
    +
    1870 if (positive_sign) positive_sign->invalidate();
    +
    1871 if (negative_sign) negative_sign->invalidate();
    +
    1872 if (special_sign) special_sign->invalidate();
    +
    1873 }
    +
    1874 if (number->match(text, interval.end, end, flags)) {
    +
    1875 interval.start = start;
    +
    1876 interval.end = number->interval.end;
    +
    1877 return true;
    +
    1878 }
    +
    1879 if (positive_sign) positive_sign->invalidate();
    +
    1880 if (negative_sign) negative_sign->invalidate();
    +
    1881 if (special_sign) special_sign->invalidate();
    +
    1882 number->invalidate();
    +
    1883 interval.start = (interval.end = start) + 1;
    +
    1884 return false;
    +
    1885 }
    +
    1886
    +
    1887 virtual void invalidate()
    +
    1888 {
    +
    1889 if (positive_sign) positive_sign->invalidate();
    +
    1890 if (negative_sign) negative_sign->invalidate();
    +
    1891 if (special_sign) special_sign->invalidate();
    +
    1892 number->invalidate();
    +
    1893 basic_parser<T>::invalidate();
    +
    1894 }
    +
    1895
    +
    1896 public:
    +
    1897 std::shared_ptr<basic_parser<T>> positive_sign;
    +
    1898 std::shared_ptr<basic_parser<T>> negative_sign;
    +
    1899 std::shared_ptr<basic_parser<T>> special_sign;
    +
    1900 std::shared_ptr<basic_parser<T>> number;
    +
    1901 };
    +
    1902
    +
    1903 using signed_numeral = basic_signed_numeral<char>;
    +
    1904 using wsigned_numeral = basic_signed_numeral<wchar_t>;
    +
    1905#ifdef _UNICODE
    +
    1906 using tsigned_numeral = wsigned_numeral;
    +
    1907#else
    +
    1908 using tsigned_numeral = signed_numeral;
    +
    1909#endif
    +
    1910 using sgml_signed_numeral = basic_signed_numeral<char>;
    +
    1911
    +
    1915 template <class T>
    +
    1916 class basic_mixed_numeral : public basic_parser<T>
    +
    1917 {
    +
    1918 public:
    +
    1919 basic_mixed_numeral(
    +
    1920 _In_ const std::shared_ptr<basic_parser<T>>& _positive_sign,
    +
    1921 _In_ const std::shared_ptr<basic_parser<T>>& _negative_sign,
    +
    1922 _In_ const std::shared_ptr<basic_parser<T>>& _special_sign,
    +
    1923 _In_ const std::shared_ptr<basic_parser<T>>& _integer,
    +
    1924 _In_ const std::shared_ptr<basic_parser<T>>& space,
    +
    1925 _In_ const std::shared_ptr<basic_parser<T>>& _fraction,
    +
    1926 _In_ const std::locale& locale = std::locale()) :
    +
    1927 basic_parser<T>(locale),
    +
    1928 positive_sign(_positive_sign),
    +
    1929 negative_sign(_negative_sign),
    +
    1930 special_sign(_special_sign),
    +
    1931 integer(_integer),
    +
    1932 fraction(_fraction),
    +
    1933 m_space(space)
    +
    1934 {}
    +
    1935
    +
    1936 virtual bool match(
    +
    1937 _In_reads_or_z_(end) const T* text,
    +
    1938 _In_ size_t start = 0,
    +
    1939 _In_ size_t end = (size_t)-1,
    +
    1940 _In_ int flags = match_default)
    +
    1941 {
    +
    1942 assert(text || start >= end);
    +
    1943 interval.end = start;
    +
    1944
    +
    1945 if (positive_sign && positive_sign->match(text, interval.end, end, flags)) {
    +
    1946 interval.end = positive_sign->interval.end;
    +
    1947 if (negative_sign) negative_sign->invalidate();
    +
    1948 if (special_sign) special_sign->invalidate();
    +
    1949 }
    +
    1950 else if (negative_sign && negative_sign->match(text, interval.end, end, flags)) {
    +
    1951 interval.end = negative_sign->interval.end;
    +
    1952 if (positive_sign) positive_sign->invalidate();
    +
    1953 if (special_sign) special_sign->invalidate();
    +
    1954 }
    +
    1955 else if (special_sign && special_sign->match(text, interval.end, end, flags)) {
    +
    1956 interval.end = special_sign->interval.end;
    +
    1957 if (positive_sign) positive_sign->invalidate();
    +
    1958 if (negative_sign) negative_sign->invalidate();
    +
    1959 }
    +
    1960 else {
    +
    1961 if (positive_sign) positive_sign->invalidate();
    +
    1962 if (negative_sign) negative_sign->invalidate();
    +
    1963 if (special_sign) special_sign->invalidate();
    +
    1964 }
    +
    1965
    +
    1966 // Check for <integer> <fraction>
    +
    1967 const int space_match_flags = flags & ~match_multiline; // Spaces in fractions must never be broken in new line.
    +
    1968 if (integer->match(text, interval.end, end, flags) &&
    +
    1969 m_space->match(text, integer->interval.end, end, space_match_flags))
    +
    1970 {
    +
    1971 for (interval.end = m_space->interval.end; m_space->match(text, interval.end, end, space_match_flags); interval.end = m_space->interval.end);
    +
    1972 if (fraction->match(text, interval.end, end, flags)) {
    +
    1973 interval.start = start;
    +
    1974 interval.end = fraction->interval.end;
    +
    1975 return true;
    +
    1976 }
    +
    1977 fraction->invalidate();
    +
    1978 interval.start = start;
    +
    1979 interval.end = integer->interval.end;
    +
    1980 return true;
    +
    1981 }
    +
    1982
    +
    1983 // Check for <fraction>
    +
    1984 if (fraction->match(text, interval.end, end, flags)) {
    +
    1985 integer->invalidate();
    +
    1986 interval.start = start;
    +
    1987 interval.end = fraction->interval.end;
    +
    1988 return true;
    +
    1989 }
    +
    1990
    +
    1991 // Check for <integer>
    +
    1992 if (integer->match(text, interval.end, end, flags)) {
    +
    1993 fraction->invalidate();
    +
    1994 interval.start = start;
    +
    1995 interval.end = integer->interval.end;
    +
    1996 return true;
    +
    1997 }
    +
    1998
    +
    1999 if (positive_sign) positive_sign->invalidate();
    +
    2000 if (negative_sign) negative_sign->invalidate();
    +
    2001 if (special_sign) special_sign->invalidate();
    +
    2002 integer->invalidate();
    +
    2003 fraction->invalidate();
    +
    2004 interval.start = (interval.end = start) + 1;
    +
    2005 return false;
    +
    2006 }
    +
    2007
    +
    2008 virtual void invalidate()
    +
    2009 {
    +
    2010 if (positive_sign) positive_sign->invalidate();
    +
    2011 if (negative_sign) negative_sign->invalidate();
    +
    2012 if (special_sign) special_sign->invalidate();
    +
    2013 integer->invalidate();
    +
    2014 fraction->invalidate();
    +
    2015 basic_parser<T>::invalidate();
    +
    2016 }
    +
    2017
    +
    2018 public:
    +
    2019 std::shared_ptr<basic_parser<T>> positive_sign;
    +
    2020 std::shared_ptr<basic_parser<T>> negative_sign;
    +
    2021 std::shared_ptr<basic_parser<T>> special_sign;
    +
    2022 std::shared_ptr<basic_parser<T>> integer;
    +
    2023 std::shared_ptr<basic_parser<T>> fraction;
    +
    2024
    +
    2025 protected:
    +
    2026 std::shared_ptr<basic_parser<T>> m_space;
    +
    2027 };
    +
    2028
    +
    2029 using mixed_numeral = basic_mixed_numeral<char>;
    +
    2030 using wmixed_numeral = basic_mixed_numeral<wchar_t>;
    +
    2031#ifdef _UNICODE
    +
    2032 using tmixed_numeral = wmixed_numeral;
    +
    2033#else
    +
    2034 using tmixed_numeral = mixed_numeral;
    +
    2035#endif
    +
    2036 using sgml_mixed_numeral = basic_mixed_numeral<char>;
    +
    2037
    +
    2041 template <class T>
    +
    2042 class basic_scientific_numeral : public basic_parser<T>
    +
    2043 {
    +
    2044 public:
    +
    2045 basic_scientific_numeral(
    +
    2046 _In_ const std::shared_ptr<basic_parser<T>>& _positive_sign,
    +
    2047 _In_ const std::shared_ptr<basic_parser<T>>& _negative_sign,
    +
    2048 _In_ const std::shared_ptr<basic_parser<T>>& _special_sign,
    +
    2049 _In_ const std::shared_ptr<basic_integer<T>>& _integer,
    +
    2050 _In_ const std::shared_ptr<basic_parser<T>>& _decimal_separator,
    +
    2051 _In_ const std::shared_ptr<basic_integer<T>>& _decimal,
    +
    2052 _In_ const std::shared_ptr<basic_parser<T>>& _exponent_symbol,
    +
    2053 _In_ const std::shared_ptr<basic_parser<T>>& _positive_exp_sign,
    +
    2054 _In_ const std::shared_ptr<basic_parser<T>>& _negative_exp_sign,
    +
    2055 _In_ const std::shared_ptr<basic_integer<T>>& _exponent,
    +
    2056 _In_ const std::locale& locale = std::locale()) :
    +
    2057 basic_parser<T>(locale),
    +
    2058 positive_sign(_positive_sign),
    +
    2059 negative_sign(_negative_sign),
    +
    2060 special_sign(_special_sign),
    +
    2061 integer(_integer),
    +
    2062 decimal_separator(_decimal_separator),
    +
    2063 decimal(_decimal),
    +
    2064 exponent_symbol(_exponent_symbol),
    +
    2065 positive_exp_sign(_positive_exp_sign),
    +
    2066 negative_exp_sign(_negative_exp_sign),
    +
    2067 exponent(_exponent),
    +
    2068 value(std::numeric_limits<double>::quiet_NaN())
    +
    2069 {}
    +
    2070
    +
    2071 virtual bool match(
    +
    2072 _In_reads_or_z_(end) const T* text,
    +
    2073 _In_ size_t start = 0,
    +
    2074 _In_ size_t end = (size_t)-1,
    +
    2075 _In_ int flags = match_default)
    +
    2076 {
    +
    2077 assert(text || start >= end);
    +
    2078 interval.end = start;
    +
    2079
    +
    2080 if (positive_sign && positive_sign->match(text, interval.end, end, flags)) {
    +
    2081 interval.end = positive_sign->interval.end;
    +
    2082 if (negative_sign) negative_sign->invalidate();
    +
    2083 if (special_sign) special_sign->invalidate();
    +
    2084 }
    +
    2085 else if (negative_sign && negative_sign->match(text, interval.end, end, flags)) {
    +
    2086 interval.end = negative_sign->interval.end;
    +
    2087 if (positive_sign) positive_sign->invalidate();
    +
    2088 if (special_sign) special_sign->invalidate();
    +
    2089 }
    +
    2090 else if (special_sign && special_sign->match(text, interval.end, end, flags)) {
    +
    2091 interval.end = special_sign->interval.end;
    +
    2092 if (positive_sign) positive_sign->invalidate();
    +
    2093 if (negative_sign) negative_sign->invalidate();
    +
    2094 }
    +
    2095 else {
    +
    2096 if (positive_sign) positive_sign->invalidate();
    +
    2097 if (negative_sign) negative_sign->invalidate();
    +
    2098 if (special_sign) special_sign->invalidate();
    +
    2099 }
    +
    2100
    +
    2101 if (integer->match(text, interval.end, end, flags))
    +
    2102 interval.end = integer->interval.end;
    +
    2103
    +
    2104 if (decimal_separator->match(text, interval.end, end, flags) &&
    +
    2105 decimal->match(text, decimal_separator->interval.end, end, flags))
    +
    2106 interval.end = decimal->interval.end;
    +
    2107 else {
    +
    2108 decimal_separator->invalidate();
    +
    2109 decimal->invalidate();
    +
    2110 }
    +
    2111
    +
    2112 if (integer->interval.empty() &&
    +
    2113 decimal->interval.empty())
    +
    2114 {
    +
    2115 // No integer part, no decimal part.
    +
    2116 if (positive_sign) positive_sign->invalidate();
    +
    2117 if (negative_sign) negative_sign->invalidate();
    +
    2118 if (special_sign) special_sign->invalidate();
    +
    2119 integer->invalidate();
    +
    2120 decimal_separator->invalidate();
    +
    2121 decimal->invalidate();
    +
    2122 if (exponent_symbol) exponent_symbol->invalidate();
    +
    2123 if (positive_exp_sign) positive_exp_sign->invalidate();
    +
    2124 if (negative_exp_sign) negative_exp_sign->invalidate();
    +
    2125 if (exponent) exponent->invalidate();
    +
    2126 interval.start = (interval.end = start) + 1;
    +
    2127 return false;
    +
    2128 }
    +
    2129
    +
    2130 if (exponent_symbol && exponent_symbol->match(text, interval.end, end, flags) &&
    +
    2131 (positive_exp_sign && positive_exp_sign->match(text, exponent_symbol->interval.end, end, flags) &&
    +
    2132 exponent && exponent->match(text, positive_exp_sign->interval.end, end, flags) ||
    +
    2133 exponent && exponent->match(text, exponent_symbol->interval.end, end, flags)))
    +
    2134 {
    +
    2135 interval.end = exponent->interval.end;
    +
    2136 if (negative_exp_sign) negative_exp_sign->invalidate();
    +
    2137 }
    +
    2138 else if (exponent_symbol && exponent_symbol->match(text, interval.end, end, flags) &&
    +
    2139 negative_exp_sign && negative_exp_sign->match(text, exponent_symbol->interval.end, end, flags) &&
    +
    2140 exponent && exponent->match(text, negative_exp_sign->interval.end, end, flags))
    +
    2141 {
    +
    2142 interval.end = exponent->interval.end;
    +
    2143 if (positive_exp_sign) positive_exp_sign->invalidate();
    +
    2144 }
    +
    2145 else {
    +
    2146 if (exponent_symbol) exponent_symbol->invalidate();
    +
    2147 if (positive_exp_sign) positive_exp_sign->invalidate();
    +
    2148 if (negative_exp_sign) negative_exp_sign->invalidate();
    +
    2149 if (exponent) exponent->invalidate();
    +
    2150 }
    +
    2151
    +
    2152 value = (double)integer->value;
    +
    2153 if (decimal->interval)
    +
    2154 value += (double)decimal->value * pow(10.0, -(double)decimal->interval.size());
    +
    2155 if (negative_sign && negative_sign->interval)
    +
    2156 value = -value;
    +
    2157 if (exponent && exponent->interval) {
    +
    2158 double e = (double)exponent->value;
    +
    2159 if (negative_exp_sign && negative_exp_sign->interval)
    +
    2160 e = -e;
    +
    2161 value *= pow(10.0, e);
    +
    2162 }
    +
    2163
    +
    2164 interval.start = start;
    +
    2165 return true;
    +
    2166 }
    +
    2167
    +
    2168 virtual void invalidate()
    +
    2169 {
    +
    2170 if (positive_sign) positive_sign->invalidate();
    +
    2171 if (negative_sign) negative_sign->invalidate();
    +
    2172 if (special_sign) special_sign->invalidate();
    +
    2173 integer->invalidate();
    +
    2174 decimal_separator->invalidate();
    +
    2175 decimal->invalidate();
    +
    2176 if (exponent_symbol) exponent_symbol->invalidate();
    +
    2177 if (positive_exp_sign) positive_exp_sign->invalidate();
    +
    2178 if (negative_exp_sign) negative_exp_sign->invalidate();
    +
    2179 if (exponent) exponent->invalidate();
    +
    2180 value = std::numeric_limits<double>::quiet_NaN();
    +
    2181 basic_parser<T>::invalidate();
    +
    2182 }
    +
    2183
    +
    2184 public:
    +
    2185 std::shared_ptr<basic_parser<T>> positive_sign;
    +
    2186 std::shared_ptr<basic_parser<T>> negative_sign;
    +
    2187 std::shared_ptr<basic_parser<T>> special_sign;
    +
    2188 std::shared_ptr<basic_integer<T>> integer;
    +
    2189 std::shared_ptr<basic_parser<T>> decimal_separator;
    +
    2190 std::shared_ptr<basic_integer<T>> decimal;
    +
    2191 std::shared_ptr<basic_parser<T>> exponent_symbol;
    +
    2192 std::shared_ptr<basic_parser<T>> positive_exp_sign;
    +
    2193 std::shared_ptr<basic_parser<T>> negative_exp_sign;
    +
    2194 std::shared_ptr<basic_integer<T>> exponent;
    +
    2195 double value;
    +
    2196 };
    +
    2197
    +
    2198 using scientific_numeral = basic_scientific_numeral<char>;
    +
    2199 using wscientific_numeral = basic_scientific_numeral<wchar_t>;
    +
    2200#ifdef _UNICODE
    +
    2201 using tscientific_numeral = wscientific_numeral;
    +
    2202#else
    +
    2203 using tscientific_numeral = scientific_numeral;
    +
    2204#endif
    +
    2205 using sgml_scientific_numeral = basic_scientific_numeral<char>;
    +
    2206
    +
    2210 template <class T>
    +
    2211 class basic_monetary_numeral : public basic_parser<T>
    +
    2212 {
    +
    2213 public:
    +
    2214 basic_monetary_numeral(
    +
    2215 _In_ const std::shared_ptr<basic_parser<T>>& _positive_sign,
    +
    2216 _In_ const std::shared_ptr<basic_parser<T>>& _negative_sign,
    +
    2217 _In_ const std::shared_ptr<basic_parser<T>>& _special_sign,
    +
    2218 _In_ const std::shared_ptr<basic_parser<T>>& _currency,
    +
    2219 _In_ const std::shared_ptr<basic_parser<T>>& _integer,
    +
    2220 _In_ const std::shared_ptr<basic_parser<T>>& _decimal_separator,
    +
    2221 _In_ const std::shared_ptr<basic_parser<T>>& _decimal,
    +
    2222 _In_ const std::locale& locale = std::locale()) :
    +
    2223 basic_parser<T>(locale),
    +
    2224 positive_sign(_positive_sign),
    +
    2225 negative_sign(_negative_sign),
    +
    2226 special_sign(_special_sign),
    +
    2227 currency(_currency),
    +
    2228 integer(_integer),
    +
    2229 decimal_separator(_decimal_separator),
    +
    2230 decimal(_decimal)
    +
    2231 {}
    +
    2232
    +
    2233 virtual bool match(
    +
    2234 _In_reads_or_z_(end) const T* text,
    +
    2235 _In_ size_t start = 0,
    +
    2236 _In_ size_t end = (size_t)-1,
    +
    2237 _In_ int flags = match_default)
    +
    2238 {
    +
    2239 assert(text || start >= end);
    +
    2240 interval.end = start;
    +
    2241
    +
    2242 if (positive_sign->match(text, interval.end, end, flags)) {
    +
    2243 interval.end = positive_sign->interval.end;
    +
    2244 if (negative_sign) negative_sign->invalidate();
    +
    2245 if (special_sign) special_sign->invalidate();
    +
    2246 }
    +
    2247 else if (negative_sign->match(text, interval.end, end, flags)) {
    +
    2248 interval.end = negative_sign->interval.end;
    +
    2249 if (positive_sign) positive_sign->invalidate();
    +
    2250 if (special_sign) special_sign->invalidate();
    +
    2251 }
    +
    2252 else if (special_sign->match(text, interval.end, end, flags)) {
    +
    2253 interval.end = special_sign->interval.end;
    +
    2254 if (positive_sign) positive_sign->invalidate();
    +
    2255 if (negative_sign) negative_sign->invalidate();
    +
    2256 }
    +
    2257 else {
    +
    2258 if (positive_sign) positive_sign->invalidate();
    +
    2259 if (negative_sign) negative_sign->invalidate();
    +
    2260 if (special_sign) special_sign->invalidate();
    +
    2261 }
    +
    2262
    +
    2263 if (currency->match(text, interval.end, end, flags))
    +
    2264 interval.end = currency->interval.end;
    +
    2265 else {
    +
    2266 if (positive_sign) positive_sign->invalidate();
    +
    2267 if (negative_sign) negative_sign->invalidate();
    +
    2268 if (special_sign) special_sign->invalidate();
    +
    2269 integer->invalidate();
    +
    2270 decimal_separator->invalidate();
    +
    2271 decimal->invalidate();
    +
    2272 interval.start = (interval.end = start) + 1;
    +
    2273 return false;
    +
    2274 }
    +
    2275
    +
    2276 if (integer->match(text, interval.end, end, flags))
    +
    2277 interval.end = integer->interval.end;
    +
    2278 if (decimal_separator->match(text, interval.end, end, flags) &&
    +
    2279 decimal->match(text, decimal_separator->interval.end, end, flags))
    +
    2280 interval.end = decimal->interval.end;
    +
    2281 else {
    +
    2282 decimal_separator->invalidate();
    +
    2283 decimal->invalidate();
    +
    2284 }
    +
    2285
    +
    2286 if (integer->interval.empty() &&
    +
    2287 decimal->interval.empty())
    +
    2288 {
    +
    2289 // No integer part, no decimal part.
    +
    2290 if (positive_sign) positive_sign->invalidate();
    +
    2291 if (negative_sign) negative_sign->invalidate();
    +
    2292 if (special_sign) special_sign->invalidate();
    +
    2293 currency->invalidate();
    +
    2294 integer->invalidate();
    +
    2295 decimal_separator->invalidate();
    +
    2296 decimal->invalidate();
    +
    2297 interval.start = (interval.end = start) + 1;
    +
    2298 return false;
    +
    2299 }
    +
    2300
    +
    2301 interval.start = start;
    +
    2302 return true;
    +
    2303 }
    +
    2304
    +
    2305 virtual void invalidate()
    +
    2306 {
    +
    2307 if (positive_sign) positive_sign->invalidate();
    +
    2308 if (negative_sign) negative_sign->invalidate();
    +
    2309 if (special_sign) special_sign->invalidate();
    +
    2310 currency->invalidate();
    +
    2311 integer->invalidate();
    +
    2312 decimal_separator->invalidate();
    +
    2313 decimal->invalidate();
    +
    2314 basic_parser<T>::invalidate();
    +
    2315 }
    +
    2316
    +
    2317 public:
    +
    2318 std::shared_ptr<basic_parser<T>> positive_sign;
    +
    2319 std::shared_ptr<basic_parser<T>> negative_sign;
    +
    2320 std::shared_ptr<basic_parser<T>> special_sign;
    +
    2321 std::shared_ptr<basic_parser<T>> currency;
    +
    2322 std::shared_ptr<basic_parser<T>> integer;
    +
    2323 std::shared_ptr<basic_parser<T>> decimal_separator;
    +
    2324 std::shared_ptr<basic_parser<T>> decimal;
    +
    2325 };
    +
    2326
    +
    2327 using monetary_numeral = basic_monetary_numeral<char>;
    +
    2328 using wmonetary_numeral = basic_monetary_numeral<wchar_t>;
    +
    2329#ifdef _UNICODE
    +
    2330 using tmonetary_numeral = wmonetary_numeral;
    +
    2331#else
    +
    2332 using tmonetary_numeral = monetary_numeral;
    +
    2333#endif
    +
    2334 using sgml_monetary_numeral = basic_monetary_numeral<char>;
    +
    2335
    +
    2339 template <class T>
    +
    2340 class basic_ipv4_address : public basic_parser<T>
    +
    2341 {
    +
    2342 public:
    +
    2343 basic_ipv4_address(
    +
    2344 _In_ const std::shared_ptr<basic_parser<T>>& digit_0,
    +
    2345 _In_ const std::shared_ptr<basic_parser<T>>& digit_1,
    +
    2346 _In_ const std::shared_ptr<basic_parser<T>>& digit_2,
    +
    2347 _In_ const std::shared_ptr<basic_parser<T>>& digit_3,
    +
    2348 _In_ const std::shared_ptr<basic_parser<T>>& digit_4,
    +
    2349 _In_ const std::shared_ptr<basic_parser<T>>& digit_5,
    +
    2350 _In_ const std::shared_ptr<basic_parser<T>>& digit_6,
    +
    2351 _In_ const std::shared_ptr<basic_parser<T>>& digit_7,
    +
    2352 _In_ const std::shared_ptr<basic_parser<T>>& digit_8,
    +
    2353 _In_ const std::shared_ptr<basic_parser<T>>& digit_9,
    +
    2354 _In_ const std::shared_ptr<basic_parser<T>>& separator,
    +
    2355 _In_ const std::locale& locale = std::locale()) :
    +
    2356 basic_parser<T>(locale),
    +
    2357 m_digit_0(digit_0),
    +
    2358 m_digit_1(digit_1),
    +
    2359 m_digit_2(digit_2),
    +
    2360 m_digit_3(digit_3),
    +
    2361 m_digit_4(digit_4),
    +
    2362 m_digit_5(digit_5),
    +
    2363 m_digit_6(digit_6),
    +
    2364 m_digit_7(digit_7),
    +
    2365 m_digit_8(digit_8),
    +
    2366 m_digit_9(digit_9),
    +
    2367 m_separator(separator)
    +
    2368 {
    +
    2369 value.s_addr = 0;
    +
    2370 }
    +
    2371
    +
    2372 virtual bool match(
    +
    2373 _In_reads_or_z_(end) const T* text,
    +
    2374 _In_ size_t start = 0,
    +
    2375 _In_ size_t end = (size_t)-1,
    +
    2376 _In_ int flags = match_default)
    +
    2377 {
    +
    2378 assert(text || start >= end);
    +
    2379 interval.end = start;
    +
    2380 value.s_addr = 0;
    +
    2381
    +
    2382 size_t i;
    +
    2383 for (i = 0; i < 4; i++) {
    +
    2384 if (i) {
    +
    2385 if (m_separator->match(text, interval.end, end, flags))
    +
    2386 interval.end = m_separator->interval.end;
    +
    2387 else
    +
    2388 goto error;
    +
    2389 }
    +
    2390
    +
    2391 components[i].start = interval.end;
    +
    2392 bool is_empty = true;
    +
    2393 size_t x;
    +
    2394 for (x = 0; interval.end < end && text[interval.end];) {
    +
    2395 size_t dig, digit_end;
    +
    2396 if (m_digit_0->match(text, interval.end, end, flags)) { dig = 0; digit_end = m_digit_0->interval.end; }
    +
    2397 else if (m_digit_1->match(text, interval.end, end, flags)) { dig = 1; digit_end = m_digit_1->interval.end; }
    +
    2398 else if (m_digit_2->match(text, interval.end, end, flags)) { dig = 2; digit_end = m_digit_2->interval.end; }
    +
    2399 else if (m_digit_3->match(text, interval.end, end, flags)) { dig = 3; digit_end = m_digit_3->interval.end; }
    +
    2400 else if (m_digit_4->match(text, interval.end, end, flags)) { dig = 4; digit_end = m_digit_4->interval.end; }
    +
    2401 else if (m_digit_5->match(text, interval.end, end, flags)) { dig = 5; digit_end = m_digit_5->interval.end; }
    +
    2402 else if (m_digit_6->match(text, interval.end, end, flags)) { dig = 6; digit_end = m_digit_6->interval.end; }
    +
    2403 else if (m_digit_7->match(text, interval.end, end, flags)) { dig = 7; digit_end = m_digit_7->interval.end; }
    +
    2404 else if (m_digit_8->match(text, interval.end, end, flags)) { dig = 8; digit_end = m_digit_8->interval.end; }
    +
    2405 else if (m_digit_9->match(text, interval.end, end, flags)) { dig = 9; digit_end = m_digit_9->interval.end; }
    +
    2406 else break;
    +
    2407 size_t x_n = x * 10 + dig;
    +
    2408 if (x_n <= 255) {
    +
    2409 x = x_n;
    +
    2410 interval.end = digit_end;
    +
    2411 is_empty = false;
    +
    2412 }
    +
    2413 else
    +
    2414 break;
    +
    2415 }
    +
    2416 if (is_empty)
    +
    2417 goto error;
    +
    2418 components[i].end = interval.end;
    +
    2419 value.s_addr = (value.s_addr << 8) | (uint8_t)x;
    +
    2420 }
    +
    2421 if (i < 4)
    +
    2422 goto error;
    +
    2423
    +
    2424 interval.start = start;
    +
    2425 return true;
    +
    2426
    +
    2427 error:
    +
    2428 components[0].start = 1;
    +
    2429 components[0].end = 0;
    +
    2430 components[1].start = 1;
    +
    2431 components[1].end = 0;
    +
    2432 components[2].start = 1;
    +
    2433 components[2].end = 0;
    +
    2434 components[3].start = 1;
    +
    2435 components[3].end = 0;
    +
    2436 value.s_addr = 0;
    +
    2437 interval.start = (interval.end = start) + 1;
    +
    2438 return false;
    +
    2439 }
    +
    2440
    +
    2441 virtual void invalidate()
    +
    2442 {
    +
    2443 components[0].start = 1;
    +
    2444 components[0].end = 0;
    +
    2445 components[1].start = 1;
    +
    2446 components[1].end = 0;
    +
    2447 components[2].start = 1;
    +
    2448 components[2].end = 0;
    +
    2449 components[3].start = 1;
    +
    2450 components[3].end = 0;
    +
    2451 value.s_addr = 0;
    +
    2452 basic_parser<T>::invalidate();
    +
    2453 }
    +
    2454
    +
    2455 public:
    +
    2456 stdex::interval<size_t> components[4];
    +
    2457 struct in_addr value;
    +
    2458
    +
    2459 protected:
    +
    2460 std::shared_ptr<basic_parser<T>>
    +
    2461 m_digit_0,
    +
    2462 m_digit_1,
    +
    2463 m_digit_2,
    +
    2464 m_digit_3,
    +
    2465 m_digit_4,
    +
    2466 m_digit_5,
    +
    2467 m_digit_6,
    +
    2468 m_digit_7,
    +
    2469 m_digit_8,
    +
    2470 m_digit_9;
    +
    2471 std::shared_ptr<basic_parser<T>> m_separator;
    +
    2472 };
    +
    2473
    +
    2474 using ipv4_address = basic_ipv4_address<char>;
    +
    2475 using wipv4_address = basic_ipv4_address<wchar_t>;
    +
    2476#ifdef _UNICODE
    +
    2477 using tipv4_address = wipv4_address;
    +
    2478#else
    +
    2479 using tipv4_address = ipv4_address;
    +
    2480#endif
    +
    2481 using sgml_ipv4_address = basic_ipv4_address<char>;
    +
    2482
    +
    2486 template <class T>
    +
    2487 class basic_ipv6_scope_id_char : public basic_parser<T>
    +
    2488 {
    +
    2489 public:
    +
    2490 basic_ipv6_scope_id_char(_In_ const std::locale& locale = std::locale()) : basic_parser<T>(locale) {}
    +
    2491
    +
    2492 virtual bool match(
    +
    2493 _In_reads_or_z_(end) const T* text,
    +
    2494 _In_ size_t start = 0,
    +
    2495 _In_ size_t end = (size_t)-1,
    +
    2496 _In_ int flags = match_default)
    +
    2497 {
    +
    2498 assert(text || start >= end);
    +
    2499 if (start < end && text[start]) {
    +
    2500 if (text[start] == '-' ||
    +
    2501 text[start] == '_' ||
    +
    2502 text[start] == ':' ||
    +
    2503 std::use_facet<std::ctype<T>>(m_locale).is(std::ctype_base::alnum, text[start]))
    +
    2504 {
    +
    2505 interval.end = (interval.start = start) + 1;
    +
    2506 return true;
    +
    2507 }
    +
    2508 }
    +
    2509 interval.start = (interval.end = start) + 1;
    +
    2510 return false;
    +
    2511 }
    +
    2512 };
    +
    2513
    +
    2514 using ipv6_scope_id_char = basic_ipv6_scope_id_char<char>;
    +
    2515 using wipv6_scope_id_char = basic_ipv6_scope_id_char<wchar_t>;
    +
    2516#ifdef _UNICODE
    +
    2517 using tipv6_scope_id_char = wipv6_scope_id_char;
    +
    2518#else
    +
    2519 using tipv6_scope_id_char = ipv6_scope_id_char;
    +
    2520#endif
    +
    2521
    +
    2525 class sgml_ipv6_scope_id_char : public sgml_parser
    +
    2526 {
    +
    2527 public:
    +
    2528 sgml_ipv6_scope_id_char(_In_ const std::locale& locale = std::locale()) : sgml_parser(locale) {}
    +
    2529
    +
    2530 virtual bool match(
    +
    2531 _In_reads_or_z_(end) const char* text,
    +
    2532 _In_ size_t start = 0,
    +
    2533 _In_ size_t end = (size_t)-1,
    +
    2534 _In_ int flags = match_default)
    +
    2535 {
    +
    2536 assert(text || start >= end);
    +
    2537 if (start < end && text[start]) {
    +
    2538 wchar_t buf[3];
    +
    2539 const wchar_t* chr = next_sgml_cp(text, start, end, interval.end, buf);
    +
    2540 const wchar_t* chr_end = chr + stdex::strlen(chr);
    +
    2541 if ((chr[0] == L'-' ||
    +
    2542 chr[0] == L'_' ||
    +
    2543 chr[0] == L':') && chr[1] == 0 ||
    +
    2544 std::use_facet<std::ctype<wchar_t>>(m_locale).scan_not(std::ctype_base::alnum, chr, chr_end) == chr_end)
    +
    2545 {
    +
    2546 interval.start = start;
    +
    2547 return true;
    +
    2548 }
    +
    2549 }
    +
    2550 interval.start = (interval.end = start) + 1;
    +
    2551 return false;
    +
    2552 }
    +
    2553 };
    +
    2554
    +
    2558 template <class T>
    +
    2559 class basic_ipv6_address : public basic_parser<T>
    +
    2560 {
    +
    2561 public:
    +
    2562 basic_ipv6_address(
    +
    2563 _In_ const std::shared_ptr<basic_parser<T>>& digit_0,
    +
    2564 _In_ const std::shared_ptr<basic_parser<T>>& digit_1,
    +
    2565 _In_ const std::shared_ptr<basic_parser<T>>& digit_2,
    +
    2566 _In_ const std::shared_ptr<basic_parser<T>>& digit_3,
    +
    2567 _In_ const std::shared_ptr<basic_parser<T>>& digit_4,
    +
    2568 _In_ const std::shared_ptr<basic_parser<T>>& digit_5,
    +
    2569 _In_ const std::shared_ptr<basic_parser<T>>& digit_6,
    +
    2570 _In_ const std::shared_ptr<basic_parser<T>>& digit_7,
    +
    2571 _In_ const std::shared_ptr<basic_parser<T>>& digit_8,
    +
    2572 _In_ const std::shared_ptr<basic_parser<T>>& digit_9,
    +
    2573 _In_ const std::shared_ptr<basic_parser<T>>& digit_10,
    +
    2574 _In_ const std::shared_ptr<basic_parser<T>>& digit_11,
    +
    2575 _In_ const std::shared_ptr<basic_parser<T>>& digit_12,
    +
    2576 _In_ const std::shared_ptr<basic_parser<T>>& digit_13,
    +
    2577 _In_ const std::shared_ptr<basic_parser<T>>& digit_14,
    +
    2578 _In_ const std::shared_ptr<basic_parser<T>>& digit_15,
    +
    2579 _In_ const std::shared_ptr<basic_parser<T>>& separator,
    +
    2580 _In_ const std::shared_ptr<basic_parser<T>>& scope_id_separator = nullptr,
    +
    2581 _In_ const std::shared_ptr<basic_parser<T>>& _scope_id = nullptr,
    +
    2582 _In_ const std::locale& locale = std::locale()) :
    +
    2583 basic_parser<T>(locale),
    +
    2584 m_digit_0(digit_0),
    +
    2585 m_digit_1(digit_1),
    +
    2586 m_digit_2(digit_2),
    +
    2587 m_digit_3(digit_3),
    +
    2588 m_digit_4(digit_4),
    +
    2589 m_digit_5(digit_5),
    +
    2590 m_digit_6(digit_6),
    +
    2591 m_digit_7(digit_7),
    +
    2592 m_digit_8(digit_8),
    +
    2593 m_digit_9(digit_9),
    +
    2594 m_digit_10(digit_10),
    +
    2595 m_digit_11(digit_11),
    +
    2596 m_digit_12(digit_12),
    +
    2597 m_digit_13(digit_13),
    +
    2598 m_digit_14(digit_14),
    +
    2599 m_digit_15(digit_15),
    +
    2600 m_separator(separator),
    +
    2601 m_scope_id_separator(scope_id_separator),
    +
    2602 scope_id(_scope_id)
    +
    2603 {
    +
    2604 memset(&value, 0, sizeof(value));
    +
    2605 }
    +
    2606
    +
    2607 virtual bool match(
    +
    2608 _In_reads_or_z_(end) const T* text,
    +
    2609 _In_ size_t start = 0,
    +
    2610 _In_ size_t end = (size_t)-1,
    +
    2611 _In_ int flags = match_default)
    +
    2612 {
    +
    2613 assert(text || start >= end);
    +
    2614 interval.end = start;
    +
    2615 memset(&value, 0, sizeof(value));
    +
    2616
    +
    2617 size_t i, compaction_i = (size_t)-1, compaction_start = start;
    +
    2618 for (i = 0; i < 8; i++) {
    +
    2619 bool is_empty = true;
    +
    2620
    +
    2621 if (m_separator->match(text, interval.end, end, flags)) {
    +
    2622 if (m_separator->match(text, m_separator->interval.end, end, flags)) {
    +
    2623 // :: found
    +
    2624 if (compaction_i == (size_t)-1) {
    +
    2625 // Zero compaction start
    +
    2626 compaction_i = i;
    +
    2627 compaction_start = m_separator->interval.start;
    +
    2628 interval.end = m_separator->interval.end;
    +
    2629 }
    +
    2630 else {
    +
    2631 // More than one zero compaction
    +
    2632 break;
    +
    2633 }
    +
    2634 }
    +
    2635 else if (i) {
    +
    2636 // Inner : found
    +
    2637 interval.end = m_separator->interval.end;
    +
    2638 }
    +
    2639 else {
    +
    2640 // Leading : found
    +
    2641 goto error;
    +
    2642 }
    +
    2643 }
    +
    2644 else if (i) {
    +
    2645 // : missing
    +
    2646 break;
    +
    2647 }
    +
    2648
    +
    2649 components[i].start = interval.end;
    +
    2650 size_t x;
    +
    2651 for (x = 0; interval.end < end && text[interval.end];) {
    +
    2652 size_t dig, digit_end;
    +
    2653 if (m_digit_0->match(text, interval.end, end, flags)) { dig = 0; digit_end = m_digit_0->interval.end; }
    +
    2654 else if (m_digit_1->match(text, interval.end, end, flags)) { dig = 1; digit_end = m_digit_1->interval.end; }
    +
    2655 else if (m_digit_2->match(text, interval.end, end, flags)) { dig = 2; digit_end = m_digit_2->interval.end; }
    +
    2656 else if (m_digit_3->match(text, interval.end, end, flags)) { dig = 3; digit_end = m_digit_3->interval.end; }
    +
    2657 else if (m_digit_4->match(text, interval.end, end, flags)) { dig = 4; digit_end = m_digit_4->interval.end; }
    +
    2658 else if (m_digit_5->match(text, interval.end, end, flags)) { dig = 5; digit_end = m_digit_5->interval.end; }
    +
    2659 else if (m_digit_6->match(text, interval.end, end, flags)) { dig = 6; digit_end = m_digit_6->interval.end; }
    +
    2660 else if (m_digit_7->match(text, interval.end, end, flags)) { dig = 7; digit_end = m_digit_7->interval.end; }
    +
    2661 else if (m_digit_8->match(text, interval.end, end, flags)) { dig = 8; digit_end = m_digit_8->interval.end; }
    +
    2662 else if (m_digit_9->match(text, interval.end, end, flags)) { dig = 9; digit_end = m_digit_9->interval.end; }
    +
    2663 else if (m_digit_10->match(text, interval.end, end, flags)) { dig = 10; digit_end = m_digit_10->interval.end; }
    +
    2664 else if (m_digit_11->match(text, interval.end, end, flags)) { dig = 11; digit_end = m_digit_11->interval.end; }
    +
    2665 else if (m_digit_12->match(text, interval.end, end, flags)) { dig = 12; digit_end = m_digit_12->interval.end; }
    +
    2666 else if (m_digit_13->match(text, interval.end, end, flags)) { dig = 13; digit_end = m_digit_13->interval.end; }
    +
    2667 else if (m_digit_14->match(text, interval.end, end, flags)) { dig = 14; digit_end = m_digit_14->interval.end; }
    +
    2668 else if (m_digit_15->match(text, interval.end, end, flags)) { dig = 15; digit_end = m_digit_15->interval.end; }
    +
    2669 else break;
    +
    2670 size_t x_n = x * 16 + dig;
    +
    2671 if (x_n <= 0xffff) {
    +
    2672 x = x_n;
    +
    2673 interval.end = digit_end;
    +
    2674 is_empty = false;
    +
    2675 }
    +
    2676 else
    +
    2677 break;
    +
    2678 }
    +
    2679 if (is_empty) {
    +
    2680 if (compaction_i != (size_t)-1) {
    +
    2681 // Zero compaction active: no sweat.
    +
    2682 break;
    +
    2683 }
    +
    2684 goto error;
    +
    2685 }
    +
    2686 components[i].end = interval.end;
    +
    2687 value.s6_words[i] = (uint16_t)x;
    +
    2688 }
    +
    2689
    +
    2690 if (compaction_i != (size_t)-1) {
    +
    2691 // Align components right due to zero compaction.
    +
    2692 size_t j, k;
    +
    2693 for (j = 8, k = i; k > compaction_i;) {
    +
    2694 value.s6_words[--j] = value.s6_words[--k];
    +
    2695 components[j] = components[k];
    +
    2696 }
    +
    2697 for (; j > compaction_i;) {
    +
    2698 value.s6_words[--j] = 0;
    +
    2699 components[j].start =
    +
    2700 components[j].end = compaction_start;
    +
    2701 }
    +
    2702 }
    +
    2703 else if (i < 8)
    +
    2704 goto error;
    +
    2705
    +
    2706 if (m_scope_id_separator && m_scope_id_separator->match(text, interval.end, end, flags) &&
    +
    2707 scope_id && scope_id->match(text, m_scope_id_separator->interval.end, end, flags))
    +
    2708 interval.end = scope_id->interval.end;
    +
    2709 else if (scope_id)
    +
    2710 scope_id->invalidate();
    +
    2711
    +
    2712 interval.start = start;
    +
    2713 return true;
    +
    2714
    +
    2715 error:
    +
    2716 components[0].start = 1;
    +
    2717 components[0].end = 0;
    +
    2718 components[1].start = 1;
    +
    2719 components[1].end = 0;
    +
    2720 components[2].start = 1;
    +
    2721 components[2].end = 0;
    +
    2722 components[3].start = 1;
    +
    2723 components[3].end = 0;
    +
    2724 components[4].start = 1;
    +
    2725 components[4].end = 0;
    +
    2726 components[5].start = 1;
    +
    2727 components[5].end = 0;
    +
    2728 components[6].start = 1;
    +
    2729 components[6].end = 0;
    +
    2730 components[7].start = 1;
    +
    2731 components[7].end = 0;
    +
    2732 memset(&value, 0, sizeof(value));
    +
    2733 if (scope_id) scope_id->invalidate();
    +
    2734 interval.start = (interval.end = start) + 1;
    +
    2735 return false;
    +
    2736 }
    +
    2737
    +
    2738 virtual void invalidate()
    +
    2739 {
    +
    2740 components[0].start = 1;
    +
    2741 components[0].end = 0;
    +
    2742 components[1].start = 1;
    +
    2743 components[1].end = 0;
    +
    2744 components[2].start = 1;
    +
    2745 components[2].end = 0;
    +
    2746 components[3].start = 1;
    +
    2747 components[3].end = 0;
    +
    2748 components[4].start = 1;
    +
    2749 components[4].end = 0;
    +
    2750 components[5].start = 1;
    +
    2751 components[5].end = 0;
    +
    2752 components[6].start = 1;
    +
    2753 components[6].end = 0;
    +
    2754 components[7].start = 1;
    +
    2755 components[7].end = 0;
    +
    2756 memset(&value, 0, sizeof(value));
    +
    2757 if (scope_id) scope_id->invalidate();
    +
    2758 basic_parser<T>::invalidate();
    +
    2759 }
    +
    2760
    +
    2761 public:
    +
    2762 stdex::interval<size_t> components[8];
    +
    2763 struct in6_addr value;
    +
    2764 std::shared_ptr<basic_parser<T>> scope_id;
    +
    2765
    +
    2766 protected:
    +
    2767 std::shared_ptr<basic_parser<T>>
    +
    2768 m_digit_0,
    +
    2769 m_digit_1,
    +
    2770 m_digit_2,
    +
    2771 m_digit_3,
    +
    2772 m_digit_4,
    +
    2773 m_digit_5,
    +
    2774 m_digit_6,
    +
    2775 m_digit_7,
    +
    2776 m_digit_8,
    +
    2777 m_digit_9,
    +
    2778 m_digit_10,
    +
    2779 m_digit_11,
    +
    2780 m_digit_12,
    +
    2781 m_digit_13,
    +
    2782 m_digit_14,
    +
    2783 m_digit_15;
    +
    2784 std::shared_ptr<basic_parser<T>> m_separator, m_scope_id_separator;
    +
    2785 };
    +
    2786
    +
    2787 using ipv6_address = basic_ipv6_address<char>;
    +
    2788 using wipv6_address = basic_ipv6_address<wchar_t>;
    +
    2789#ifdef _UNICODE
    +
    2790 using tipv6_address = wipv6_address;
    +
    2791#else
    +
    2792 using tipv6_address = ipv6_address;
    +
    2793#endif
    +
    2794 using sgml_ipv6_address = basic_ipv6_address<char>;
    +
    2795
    +
    2799 template <class T>
    +
    2800 class basic_dns_domain_char : public basic_parser<T>
    +
    2801 {
    +
    2802 public:
    +
    2803 basic_dns_domain_char(
    +
    2804 _In_ bool allow_idn,
    +
    2805 _In_ const std::locale& locale = std::locale()) :
    +
    2806 basic_parser<T>(locale),
    +
    2807 m_allow_idn(allow_idn),
    +
    2808 allow_on_edge(true)
    +
    2809 {}
    +
    2810
    +
    2811 virtual bool match(
    +
    2812 _In_reads_or_z_(end) const T* text,
    +
    2813 _In_ size_t start = 0,
    +
    2814 _In_ size_t end = (size_t)-1,
    +
    2815 _In_ int flags = match_default)
    +
    2816 {
    +
    2817 assert(text || start >= end);
    +
    2818 if (start < end && text[start]) {
    +
    2819 if (('A' <= text[start] && text[start] <= 'Z') ||
    +
    2820 ('a' <= text[start] && text[start] <= 'z') ||
    +
    2821 ('0' <= text[start] && text[start] <= '9'))
    +
    2822 allow_on_edge = true;
    +
    2823 else if (text[start] == '-')
    +
    2824 allow_on_edge = false;
    +
    2825 else if (m_allow_idn && std::use_facet<std::ctype<T>>(m_locale).is(std::ctype_base::alnum, text[start]))
    +
    2826 allow_on_edge = true;
    +
    2827 else {
    +
    2828 interval.start = (interval.end = start) + 1;
    +
    2829 return false;
    +
    2830 }
    +
    2831 interval.end = (interval.start = start) + 1;
    +
    2832 return true;
    +
    2833 }
    +
    2834 interval.start = (interval.end = start) + 1;
    +
    2835 return false;
    +
    2836 }
    +
    2837
    +
    2838 public:
    +
    2839 bool allow_on_edge;
    +
    2840
    +
    2841 protected:
    +
    2842 bool m_allow_idn;
    +
    2843 };
    +
    2844
    +
    2845 using dns_domain_char = basic_dns_domain_char<char>;
    +
    2846 using wdns_domain_char = basic_dns_domain_char<wchar_t>;
    +
    2847#ifdef _UNICODE
    +
    2848 using tdns_domain_char = wdns_domain_char;
    +
    2849#else
    +
    2850 using tdns_domain_char = dns_domain_char;
    +
    2851#endif
    +
    2852
    +
    2856 class sgml_dns_domain_char : public basic_dns_domain_char<char>
    +
    2857 {
    +
    2858 public:
    +
    2859 sgml_dns_domain_char(
    +
    2860 _In_ bool allow_idn,
    +
    2861 _In_ const std::locale& locale = std::locale()) :
    +
    2862 basic_dns_domain_char<char>(allow_idn, locale)
    +
    2863 {}
    +
    2864
    +
    2865 virtual bool match(
    +
    2866 _In_reads_or_z_(end) const char* text,
    +
    2867 _In_ size_t start = 0,
    +
    2868 _In_ size_t end = (size_t)-1,
    +
    2869 _In_ int flags = match_default)
    +
    2870 {
    +
    2871 assert(text || start >= end);
    +
    2872 if (start < end && text[start]) {
    +
    2873 wchar_t buf[3];
    +
    2874 const wchar_t* chr = next_sgml_cp(text, start, end, interval.end, buf);
    +
    2875 const wchar_t* chr_end = chr + stdex::strlen(chr);
    +
    2876 if ((('A' <= chr[0] && chr[0] <= 'Z') ||
    +
    2877 ('a' <= chr[0] && chr[0] <= 'z') ||
    +
    2878 ('0' <= chr[0] && chr[0] <= '9')) && chr[1] == 0)
    +
    2879 allow_on_edge = true;
    +
    2880 else if (chr[0] == '-' && chr[1] == 0)
    +
    2881 allow_on_edge = false;
    +
    2882 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)
    +
    2883 allow_on_edge = true;
    +
    2884 else {
    +
    2885 interval.start = (interval.end = start) + 1;
    +
    2886 return false;
    +
    2887 }
    +
    2888 interval.start = start;
    +
    2889 return true;
    +
    2890 }
    +
    2891 interval.start = (interval.end = start) + 1;
    +
    2892 return false;
    +
    2893 }
    +
    2894 };
    +
    2895
    +
    2899 template <class T>
    +
    2900 class basic_dns_name : public basic_parser<T>
    +
    2901 {
    +
    2902 public:
    +
    2903 basic_dns_name(
    +
    2904 _In_ bool allow_absolute,
    +
    2905 _In_ const std::shared_ptr<basic_dns_domain_char<T>>& domain_char,
    +
    2906 _In_ const std::shared_ptr<basic_parser<T>>& separator,
    +
    2907 _In_ const std::locale& locale = std::locale()) :
    +
    2908 basic_parser<T>(locale),
    +
    2909 m_allow_absolute(allow_absolute),
    +
    2910 m_domain_char(domain_char),
    +
    2911 m_separator(separator)
    +
    2912 {}
    +
    2913
    +
    2914 virtual bool match(
    +
    2915 _In_reads_or_z_(end) const T* text,
    +
    2916 _In_ size_t start = 0,
    +
    2917 _In_ size_t end = (size_t)-1,
    +
    2918 _In_ int flags = match_default)
    +
    2919 {
    +
    2920 assert(text || start >= end);
    +
    2921 size_t i = start, count;
    +
    2922 for (count = 0; i < end && text[i] && count < 127; count++) {
    +
    2923 if (m_domain_char->match(text, i, end, flags) &&
    +
    2924 m_domain_char->allow_on_edge)
    +
    2925 {
    +
    2926 // Domain start
    +
    2927 interval.end = i = m_domain_char->interval.end;
    +
    2928 while (i < end && text[i]) {
    +
    2929 if (m_domain_char->allow_on_edge &&
    +
    2930 m_separator->match(text, i, end, flags))
    +
    2931 {
    +
    2932 // Domain end
    +
    2933 if (m_allow_absolute)
    +
    2934 interval.end = i = m_separator->interval.end;
    +
    2935 else {
    +
    2936 interval.end = i;
    +
    2937 i = m_separator->interval.end;
    +
    2938 }
    +
    2939 break;
    +
    2940 }
    +
    2941 if (m_domain_char->match(text, i, end, flags)) {
    +
    2942 if (m_domain_char->allow_on_edge)
    +
    2943 interval.end = i = m_domain_char->interval.end;
    +
    2944 else
    +
    2945 i = m_domain_char->interval.end;
    +
    2946 }
    +
    2947 else {
    +
    2948 interval.start = start;
    +
    2949 return true;
    +
    2950 }
    +
    2951 }
    +
    2952 }
    +
    2953 else
    +
    2954 break;
    +
    2955 }
    +
    2956 if (count) {
    +
    2957 interval.start = start;
    +
    2958 return true;
    +
    2959 }
    +
    2960 interval.start = (interval.end = start) + 1;
    +
    2961 return false;
    +
    2962 }
    +
    2963
    +
    2964 protected:
    +
    2965 bool m_allow_absolute;
    +
    2966 std::shared_ptr<basic_dns_domain_char<T>> m_domain_char;
    +
    2967 std::shared_ptr<basic_parser<T>> m_separator;
    +
    2968 };
    +
    2969
    +
    2970 using dns_name = basic_dns_name<char>;
    +
    2971 using wdns_name = basic_dns_name<wchar_t>;
    +
    2972#ifdef _UNICODE
    +
    2973 using tdns_name = wdns_name;
    +
    2974#else
    +
    2975 using tdns_name = dns_name;
    +
    2976#endif
    +
    2977 using sgml_dns_name = basic_dns_name<char>;
    +
    2978
    +
    2982 template <class T>
    +
    2983 class basic_url_username_char : public basic_parser<T>
    +
    2984 {
    +
    2985 public:
    +
    2986 basic_url_username_char(_In_ const std::locale& locale = std::locale()) : basic_parser<T>(locale) {}
    +
    2987
    +
    2988 virtual bool match(
    +
    2989 _In_reads_or_z_(end) const T* text,
    +
    2990 _In_ size_t start = 0,
    +
    2991 _In_ size_t end = (size_t)-1,
    +
    2992 _In_ int flags = match_default)
    +
    2993 {
    +
    2994 assert(text || start >= end);
    +
    2995 if (start < end && text[start]) {
    +
    2996 if (text[start] == '-' ||
    +
    2997 text[start] == '.' ||
    +
    2998 text[start] == '_' ||
    +
    2999 text[start] == '~' ||
    +
    3000 text[start] == '%' ||
    +
    3001 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 std::use_facet<std::ctype<T>>(m_locale).is(std::ctype_base::alnum, text[start]))
    +
    3013 {
    +
    3014 interval.end = (interval.start = start) + 1;
    +
    3015 return true;
    +
    3016 }
    +
    3017 }
    +
    3018 interval.start = (interval.end = start) + 1;
    +
    3019 return false;
    +
    3020 }
    +
    3021 };
    +
    3022
    +
    3023 using url_username_char = basic_url_username_char<char>;
    +
    3024 using wurl_username_char = basic_url_username_char<wchar_t>;
    +
    3025#ifdef _UNICODE
    +
    3026 using turl_username_char = wurl_username_char;
    +
    3027#else
    +
    3028 using turl_username_char = url_username_char;
    +
    3029#endif
    +
    3030
    +
    3034 class sgml_url_username_char : public basic_url_username_char<char>
    +
    3035 {
    +
    3036 public:
    +
    3037 sgml_url_username_char(_In_ const std::locale& locale = std::locale()) : basic_url_username_char<char>(locale) {}
    +
    3038
    +
    3039 virtual bool match(
    +
    3040 _In_reads_or_z_(end) const char* text,
    +
    3041 _In_ size_t start = 0,
    +
    3042 _In_ size_t end = (size_t)-1,
    +
    3043 _In_ int flags = match_default)
    +
    3044 {
    +
    3045 assert(text || start >= end);
    +
    3046 if (start < end && text[start]) {
    +
    3047 wchar_t buf[3];
    +
    3048 const wchar_t* chr = next_sgml_cp(text, start, end, interval.end, buf);
    +
    3049 const wchar_t* chr_end = chr + stdex::strlen(chr);
    +
    3050 if ((chr[0] == L'-' ||
    +
    3051 chr[0] == L'.' ||
    +
    3052 chr[0] == L'_' ||
    +
    3053 chr[0] == L'~' ||
    +
    3054 chr[0] == L'%' ||
    +
    3055 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'=') && chr[1] == 0 ||
    +
    3066 std::use_facet<std::ctype<wchar_t>>(m_locale).scan_not(std::ctype_base::alnum, chr, chr_end) == chr_end)
    +
    3067 {
    +
    3068 interval.start = start;
    +
    3069 return true;
    +
    3070 }
    +
    3071 }
    +
    3072
    +
    3073 interval.start = (interval.end = start) + 1;
    +
    3074 return false;
    +
    3075 }
    +
    3076 };
    +
    3077
    +
    3081 template <class T>
    +
    3082 class basic_url_password_char : public basic_parser<T>
    +
    3083 {
    +
    3084 public:
    +
    3085 basic_url_password_char(_In_ const std::locale& locale = std::locale()) : basic_parser<T>(locale) {}
    +
    3086
    +
    3087 virtual bool match(
    +
    3088 _In_reads_or_z_(end) const T* text,
    +
    3089 _In_ size_t start = 0,
    +
    3090 _In_ size_t end = (size_t)-1,
    +
    3091 _In_ int flags = match_default)
    +
    3092 {
    +
    3093 assert(text || start >= end);
    +
    3094 if (start < end && text[start]) {
    +
    3095 if (text[start] == '-' ||
    +
    3096 text[start] == '.' ||
    +
    3097 text[start] == '_' ||
    +
    3098 text[start] == '~' ||
    +
    3099 text[start] == '%' ||
    +
    3100 text[start] == '!' ||
    +
    3101 text[start] == '$' ||
    +
    3102 text[start] == '&' ||
    +
    3103 text[start] == '\'' ||
    +
    3104 text[start] == '(' ||
    +
    3105 text[start] == ')' ||
    +
    3106 text[start] == '*' ||
    +
    3107 text[start] == '+' ||
    +
    3108 text[start] == ',' ||
    +
    3109 text[start] == ';' ||
    +
    3110 text[start] == '=' ||
    +
    3111 text[start] == ':' ||
    +
    3112 std::use_facet<std::ctype<T>>(m_locale).is(std::ctype_base::alnum, text[start]))
    +
    3113 {
    +
    3114 interval.end = (interval.start = start) + 1;
    +
    3115 return true;
    +
    3116 }
    +
    3117 }
    +
    3118 interval.start = (interval.end = start) + 1;
    +
    3119 return false;
    +
    3120 }
    +
    3121 };
    +
    3122
    +
    3123 using url_password_char = basic_url_password_char<char>;
    +
    3124 using wurl_password_char = basic_url_password_char<wchar_t>;
    +
    3125#ifdef _UNICODE
    +
    3126 using turl_password_char = wurl_password_char;
    +
    3127#else
    +
    3128 using turl_password_char = url_password_char;
    +
    3129#endif
    +
    3130
    +
    3134 class sgml_url_password_char : public basic_url_password_char<char>
    +
    3135 {
    +
    3136 public:
    +
    3137 sgml_url_password_char(_In_ const std::locale& locale = std::locale()) : basic_url_password_char<char>(locale) {}
    +
    3138
    +
    3139 virtual bool match(
    +
    3140 _In_reads_or_z_(end) const char* text,
    +
    3141 _In_ size_t start = 0,
    +
    3142 _In_ size_t end = (size_t)-1,
    +
    3143 _In_ int flags = match_default)
    +
    3144 {
    +
    3145 assert(text || start >= end);
    +
    3146 if (start < end && text[start]) {
    +
    3147 wchar_t buf[3];
    +
    3148 const wchar_t* chr = next_sgml_cp(text, start, end, interval.end, buf);
    +
    3149 const wchar_t* chr_end = chr + stdex::strlen(chr);
    +
    3150 if ((chr[0] == L'-' ||
    +
    3151 chr[0] == L'.' ||
    +
    3152 chr[0] == L'_' ||
    +
    3153 chr[0] == L'~' ||
    +
    3154 chr[0] == L'%' ||
    +
    3155 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':') && chr[1] == 0 ||
    +
    3167 std::use_facet<std::ctype<wchar_t>>(m_locale).scan_not(std::ctype_base::alnum, chr, chr_end) == chr_end)
    +
    3168 {
    +
    3169 interval.start = start;
    +
    3170 return true;
    +
    3171 }
    +
    3172 }
    +
    3173 interval.start = (interval.end = start) + 1;
    +
    3174 return false;
    +
    3175 }
    +
    3176 };
    +
    3177
    +
    3181 template <class T>
    +
    3182 class basic_url_path_char : public basic_parser<T>
    +
    3183 {
    +
    3184 public:
    +
    3185 basic_url_path_char(_In_ const std::locale& locale = std::locale()) : basic_parser<T>(locale) {}
    +
    3186
    +
    3187 virtual bool match(
    +
    3188 _In_reads_or_z_(end) const T* text,
    +
    3189 _In_ size_t start = 0,
    +
    3190 _In_ size_t end = (size_t)-1,
    +
    3191 _In_ int flags = match_default)
    +
    3192 {
    +
    3193 assert(text || start >= end);
    +
    3194 if (start < end && text[start]) {
    +
    3195 if (text[start] == '/' ||
    +
    3196 text[start] == '-' ||
    +
    3197 text[start] == '.' ||
    +
    3198 text[start] == '_' ||
    +
    3199 text[start] == '~' ||
    +
    3200 text[start] == '%' ||
    +
    3201 text[start] == '!' ||
    +
    3202 text[start] == '$' ||
    +
    3203 text[start] == '&' ||
    +
    3204 text[start] == '\'' ||
    +
    3205 text[start] == '(' ||
    +
    3206 text[start] == ')' ||
    +
    3207 text[start] == '*' ||
    +
    3208 text[start] == '+' ||
    +
    3209 text[start] == ',' ||
    +
    3210 text[start] == ';' ||
    +
    3211 text[start] == '=' ||
    +
    3212 text[start] == ':' ||
    +
    3213 text[start] == '@' ||
    +
    3214 text[start] == '?' ||
    +
    3215 text[start] == '#' ||
    +
    3216 std::use_facet<std::ctype<T>>(m_locale).is(std::ctype_base::alnum, text[start]))
    +
    3217 {
    +
    3218 interval.end = (interval.start = start) + 1;
    +
    3219 return true;
    +
    3220 }
    +
    3221 }
    +
    3222 interval.start = (interval.end = start) + 1;
    +
    3223 return false;
    +
    3224 }
    +
    3225 };
    +
    3226
    +
    3227 using url_path_char = basic_url_path_char<char>;
    +
    3228 using wurl_path_char = basic_url_path_char<wchar_t>;
    +
    3229#ifdef _UNICODE
    +
    3230 using turl_path_char = wurl_path_char;
    +
    3231#else
    +
    3232 using turl_path_char = url_path_char;
    +
    3233#endif
    +
    3234
    +
    3238 class sgml_url_path_char : public basic_url_path_char<char>
    +
    3239 {
    +
    3240 public:
    +
    3241 sgml_url_path_char(_In_ const std::locale& locale = std::locale()) : basic_url_path_char<char>(locale) {}
    +
    3242
    +
    3243 virtual bool match(
    +
    3244 _In_reads_or_z_(end) const char* text,
    +
    3245 _In_ size_t start = 0,
    +
    3246 _In_ size_t end = (size_t)-1,
    +
    3247 _In_ int flags = match_default)
    +
    3248 {
    +
    3249 assert(text || start >= end);
    +
    3250 if (start < end && text[start]) {
    +
    3251 wchar_t buf[3];
    +
    3252 const wchar_t* chr = next_sgml_cp(text, start, end, interval.end, buf);
    +
    3253 const wchar_t* chr_end = chr + stdex::strlen(chr);
    +
    3254 if ((chr[0] == L'/' ||
    +
    3255 chr[0] == L'-' ||
    +
    3256 chr[0] == L'.' ||
    +
    3257 chr[0] == L'_' ||
    +
    3258 chr[0] == L'~' ||
    +
    3259 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'#') && chr[1] == 0 ||
    +
    3275 std::use_facet<std::ctype<wchar_t>>(m_locale).scan_not(std::ctype_base::alnum, chr, chr_end) == chr_end)
    +
    3276 {
    +
    3277 interval.start = start;
    +
    3278 return true;
    +
    3279 }
    +
    3280 }
    +
    3281 interval.start = (interval.end = start) + 1;
    +
    3282 return false;
    +
    3283 }
    +
    3284 };
    +
    3285
    +
    3289 template <class T>
    +
    3290 class basic_url_path : public basic_parser<T>
    +
    3291 {
    +
    3292 public:
    +
    3293 basic_url_path(
    +
    3294 _In_ const std::shared_ptr<basic_parser<T>>& path_char,
    +
    3295 _In_ const std::shared_ptr<basic_parser<T>>& query_start,
    +
    3296 _In_ const std::shared_ptr<basic_parser<T>>& bookmark_start,
    +
    3297 _In_ const std::locale& locale = std::locale()) :
    +
    3298 basic_parser<T>(locale),
    +
    3299 m_path_char(path_char),
    +
    3300 m_query_start(query_start),
    +
    3301 m_bookmark_start(bookmark_start)
    +
    3302 {}
    +
    3303
    +
    3304 virtual bool match(
    +
    3305 _In_reads_or_z_(end) const T* text,
    +
    3306 _In_ size_t start = 0,
    +
    3307 _In_ size_t end = (size_t)-1,
    +
    3308 _In_ int flags = match_default)
    +
    3309 {
    +
    3310 assert(text || start >= end);
    +
    3311
    +
    3312 interval.end = start;
    +
    3313 path.start = start;
    +
    3314 query.start = 1;
    +
    3315 query.end = 0;
    +
    3316 bookmark.start = 1;
    +
    3317 bookmark.end = 0;
    +
    3318
    +
    3319 for (;;) {
    +
    3320 if (interval.end >= end || !text[interval.end])
    +
    3321 break;
    +
    3322 if (m_query_start->match(text, interval.end, end, flags)) {
    +
    3323 path.end = interval.end;
    +
    3324 query.start = interval.end = m_query_start->interval.end;
    +
    3325 for (;;) {
    +
    3326 if (interval.end >= end || !text[interval.end]) {
    +
    3327 query.end = interval.end;
    +
    3328 break;
    +
    3329 }
    +
    3330 if (m_bookmark_start->match(text, interval.end, end, flags)) {
    +
    3331 query.end = interval.end;
    +
    3332 bookmark.start = interval.end = m_bookmark_start->interval.end;
    +
    3333 for (;;) {
    +
    3334 if (interval.end >= end || !text[interval.end]) {
    +
    3335 bookmark.end = interval.end;
    +
    3336 break;
    +
    3337 }
    +
    3338 if (m_path_char->match(text, interval.end, end, flags))
    +
    3339 interval.end = m_path_char->interval.end;
    +
    3340 else {
    +
    3341 bookmark.end = interval.end;
    +
    3342 break;
    +
    3343 }
    +
    3344 }
    +
    3345 interval.start = start;
    +
    3346 return true;
    +
    3347 }
    +
    3348 if (m_path_char->match(text, interval.end, end, flags))
    +
    3349 interval.end = m_path_char->interval.end;
    +
    3350 else {
    +
    3351 query.end = interval.end;
    +
    3352 break;
    +
    3353 }
    +
    3354 }
    +
    3355 interval.start = start;
    +
    3356 return true;
    +
    3357 }
    +
    3358 if (m_bookmark_start->match(text, interval.end, end, flags)) {
    +
    3359 path.end = interval.end;
    +
    3360 bookmark.start = interval.end = m_bookmark_start->interval.end;
    +
    3361 for (;;) {
    +
    3362 if (interval.end >= end || !text[interval.end]) {
    +
    3363 bookmark.end = interval.end;
    +
    3364 break;
    +
    3365 }
    +
    3366 if (m_path_char->match(text, interval.end, end, flags))
    +
    3367 interval.end = m_path_char->interval.end;
    +
    3368 else {
    +
    3369 bookmark.end = interval.end;
    +
    3370 break;
    +
    3371 }
    +
    3372 }
    +
    3373 interval.start = start;
    +
    3374 return true;
    +
    3375 }
    +
    3376 if (m_path_char->match(text, interval.end, end, flags))
    +
    3377 interval.end = m_path_char->interval.end;
    +
    3378 else
    +
    3379 break;
    +
    3380 }
    +
    3381
    +
    3382 if (start < interval.end) {
    +
    3383 path.end = interval.end;
    +
    3384 interval.start = start;
    +
    3385 return true;
    +
    3386 }
    +
    3387
    +
    3388 path.start = 1;
    +
    3389 path.end = 0;
    +
    3390 bookmark.start = 1;
    +
    3391 bookmark.end = 0;
    +
    3392 interval.start = (interval.end = start) + 1;
    +
    3393 return false;
    +
    3394 }
    +
    3395
    +
    3396 virtual void invalidate()
    +
    3397 {
    +
    3398 path.start = 1;
    +
    3399 path.end = 0;
    +
    3400 query.start = 1;
    +
    3401 query.end = 0;
    +
    3402 bookmark.start = 1;
    +
    3403 bookmark.end = 0;
    +
    3404 basic_parser<T>::invalidate();
    +
    3405 }
    +
    3406
    +
    3407 public:
    +
    3408 stdex::interval<size_t> path;
    +
    3409 stdex::interval<size_t> query;
    +
    3410 stdex::interval<size_t> bookmark;
    +
    3411
    +
    3412 protected:
    +
    3413 std::shared_ptr<basic_parser<T>> m_path_char;
    +
    3414 std::shared_ptr<basic_parser<T>> m_query_start;
    +
    3415 std::shared_ptr<basic_parser<T>> m_bookmark_start;
    +
    3416 };
    +
    3417
    +
    3418 using url_path = basic_url_path<char>;
    +
    3419 using wurl_path = basic_url_path<wchar_t>;
    +
    3420#ifdef _UNICODE
    +
    3421 using turl_path = wurl_path;
    +
    3422#else
    +
    3423 using turl_path = url_path;
    +
    3424#endif
    +
    3425 using sgml_url_path = basic_url_path<char>;
    +
    3426
    +
    3430 template <class T>
    +
    3431 class basic_url : public basic_parser<T>
    +
    3432 {
    +
    3433 public:
    +
    3434 basic_url(
    +
    3435 _In_ const std::shared_ptr<basic_parser<T>>& _http_scheme,
    +
    3436 _In_ const std::shared_ptr<basic_parser<T>>& _ftp_scheme,
    +
    3437 _In_ const std::shared_ptr<basic_parser<T>>& _mailto_scheme,
    +
    3438 _In_ const std::shared_ptr<basic_parser<T>>& _file_scheme,
    +
    3439 _In_ const std::shared_ptr<basic_parser<T>>& colon,
    +
    3440 _In_ const std::shared_ptr<basic_parser<T>>& slash,
    +
    3441 _In_ const std::shared_ptr<basic_parser<T>>& _username,
    +
    3442 _In_ const std::shared_ptr<basic_parser<T>>& _password,
    +
    3443 _In_ const std::shared_ptr<basic_parser<T>>& at,
    +
    3444 _In_ const std::shared_ptr<basic_parser<T>>& ip_lbracket,
    +
    3445 _In_ const std::shared_ptr<basic_parser<T>>& ip_rbracket,
    +
    3446 _In_ const std::shared_ptr<basic_parser<T>>& _ipv4_host,
    +
    3447 _In_ const std::shared_ptr<basic_parser<T>>& _ipv6_host,
    +
    3448 _In_ const std::shared_ptr<basic_parser<T>>& _dns_host,
    +
    3449 _In_ const std::shared_ptr<basic_parser<T>>& _port,
    +
    3450 _In_ const std::shared_ptr<basic_parser<T>>& _path,
    +
    3451 _In_ const std::locale& locale = std::locale()) :
    +
    3452 basic_parser<T>(locale),
    +
    3453 http_scheme(_http_scheme),
    +
    3454 ftp_scheme(_ftp_scheme),
    +
    3455 mailto_scheme(_mailto_scheme),
    +
    3456 file_scheme(_file_scheme),
    +
    3457 m_colon(colon),
    +
    3458 m_slash(slash),
    +
    3459 username(_username),
    +
    3460 password(_password),
    +
    3461 m_at(at),
    +
    3462 m_ip_lbracket(ip_lbracket),
    +
    3463 m_ip_rbracket(ip_rbracket),
    +
    3464 ipv4_host(_ipv4_host),
    +
    3465 ipv6_host(_ipv6_host),
    +
    3466 dns_host(_dns_host),
    +
    3467 port(_port),
    +
    3468 path(_path)
    +
    3469 {}
    +
    3470
    +
    3471 virtual bool match(
    +
    3472 _In_reads_or_z_(end) const T* text,
    +
    3473 _In_ size_t start = 0,
    +
    3474 _In_ size_t end = (size_t)-1,
    +
    3475 _In_ int flags = match_default)
    +
    3476 {
    +
    3477 assert(text || start >= end);
    +
    3478
    +
    3479 interval.end = start;
    +
    3480
    +
    3481 if (http_scheme->match(text, interval.end, end, flags) &&
    +
    3482 m_colon->match(text, http_scheme->interval.end, end, flags) &&
    +
    3483 m_slash->match(text, m_colon->interval.end, end, flags) &&
    +
    3484 m_slash->match(text, m_slash->interval.end, end, flags))
    +
    3485 {
    +
    3486 // http://
    +
    3487 interval.end = m_slash->interval.end;
    +
    3488 ftp_scheme->invalidate();
    +
    3489 mailto_scheme->invalidate();
    +
    3490 file_scheme->invalidate();
    +
    3491 }
    +
    3492 else if (ftp_scheme->match(text, interval.end, end, flags) &&
    +
    3493 m_colon->match(text, ftp_scheme->interval.end, end, flags) &&
    +
    3494 m_slash->match(text, m_colon->interval.end, end, flags) &&
    +
    3495 m_slash->match(text, m_slash->interval.end, end, flags))
    +
    3496 {
    +
    3497 // ftp://
    +
    3498 interval.end = m_slash->interval.end;
    +
    3499 http_scheme->invalidate();
    +
    3500 mailto_scheme->invalidate();
    +
    3501 file_scheme->invalidate();
    +
    3502 }
    +
    3503 else if (mailto_scheme->match(text, interval.end, end, flags) &&
    +
    3504 m_colon->match(text, mailto_scheme->interval.end, end, flags))
    +
    3505 {
    +
    3506 // mailto:
    +
    3507 interval.end = m_colon->interval.end;
    +
    3508 http_scheme->invalidate();
    +
    3509 ftp_scheme->invalidate();
    +
    3510 file_scheme->invalidate();
    +
    3511 }
    +
    3512 else if (file_scheme->match(text, interval.end, end, flags) &&
    +
    3513 m_colon->match(text, file_scheme->interval.end, end, flags) &&
    +
    3514 m_slash->match(text, m_colon->interval.end, end, flags) &&
    +
    3515 m_slash->match(text, m_slash->interval.end, end, flags))
    +
    3516 {
    +
    3517 // file://
    +
    3518 interval.end = m_slash->interval.end;
    +
    3519 http_scheme->invalidate();
    +
    3520 ftp_scheme->invalidate();
    +
    3521 mailto_scheme->invalidate();
    +
    3522 }
    +
    3523 else {
    +
    3524 // Default to http:
    +
    3525 http_scheme->invalidate();
    +
    3526 ftp_scheme->invalidate();
    +
    3527 mailto_scheme->invalidate();
    +
    3528 file_scheme->invalidate();
    +
    3529 }
    +
    3530
    +
    3531 if (ftp_scheme->interval) {
    +
    3532 if (username->match(text, interval.end, end, flags)) {
    +
    3533 if (m_colon->match(text, username->interval.end, end, flags) &&
    +
    3534 password->match(text, m_colon->interval.end, end, flags) &&
    +
    3535 m_at->match(text, password->interval.end, end, flags))
    +
    3536 {
    +
    3537 // Username and password
    +
    3538 interval.end = m_at->interval.end;
    +
    3539 }
    +
    3540 else if (m_at->match(text, interval.end, end, flags)) {
    +
    3541 // Username only
    +
    3542 interval.end = m_at->interval.end;
    +
    3543 password->invalidate();
    +
    3544 }
    +
    3545 else {
    +
    3546 username->invalidate();
    +
    3547 password->invalidate();
    +
    3548 }
    +
    3549 }
    +
    3550 else {
    +
    3551 username->invalidate();
    +
    3552 password->invalidate();
    +
    3553 }
    +
    3554
    +
    3555 if (ipv4_host->match(text, interval.end, end, flags)) {
    +
    3556 // Host is IPv4
    +
    3557 interval.end = ipv4_host->interval.end;
    +
    3558 ipv6_host->invalidate();
    +
    3559 dns_host->invalidate();
    +
    3560 }
    +
    3561 else if (
    +
    3562 m_ip_lbracket->match(text, interval.end, end, flags) &&
    +
    3563 ipv6_host->match(text, m_ip_lbracket->interval.end, end, flags) &&
    +
    3564 m_ip_rbracket->match(text, ipv6_host->interval.end, end, flags))
    +
    3565 {
    +
    3566 // Host is IPv6
    +
    3567 interval.end = m_ip_rbracket->interval.end;
    +
    3568 ipv4_host->invalidate();
    +
    3569 dns_host->invalidate();
    +
    3570 }
    +
    3571 else if (dns_host->match(text, interval.end, end, flags)) {
    +
    3572 // Host is hostname
    +
    3573 interval.end = dns_host->interval.end;
    +
    3574 ipv4_host->invalidate();
    +
    3575 ipv6_host->invalidate();
    +
    3576 }
    +
    3577 else {
    +
    3578 invalidate();
    +
    3579 return false;
    +
    3580 }
    +
    3581
    +
    3582 if (m_colon->match(text, interval.end, end, flags) &&
    +
    3583 port->match(text, m_colon->interval.end, end, flags))
    +
    3584 {
    +
    3585 // Port
    +
    3586 interval.end = port->interval.end;
    +
    3587 }
    +
    3588 else
    +
    3589 port->invalidate();
    +
    3590
    +
    3591 if (path->match(text, interval.end, end, flags)) {
    +
    3592 // Path
    +
    3593 interval.end = path->interval.end;
    +
    3594 }
    +
    3595
    +
    3596 interval.start = start;
    +
    3597 return true;
    +
    3598 }
    +
    3599
    +
    3600 if (mailto_scheme->interval) {
    +
    3601 if (username->match(text, interval.end, end, flags) &&
    +
    3602 m_at->match(text, username->interval.end, end, flags))
    +
    3603 {
    +
    3604 // Username
    +
    3605 interval.end = m_at->interval.end;
    +
    3606 }
    +
    3607 else {
    +
    3608 invalidate();
    +
    3609 return false;
    +
    3610 }
    +
    3611
    +
    3612 if (m_ip_lbracket->match(text, interval.end, end, flags) &&
    +
    3613 ipv4_host->match(text, m_ip_lbracket->interval.end, end, flags) &&
    +
    3614 m_ip_rbracket->match(text, ipv4_host->interval.end, end, flags))
    +
    3615 {
    +
    3616 // Host is IPv4
    +
    3617 interval.end = m_ip_rbracket->interval.end;
    +
    3618 ipv6_host->invalidate();
    +
    3619 dns_host->invalidate();
    +
    3620 }
    +
    3621 else if (
    +
    3622 m_ip_lbracket->match(text, interval.end, end, flags) &&
    +
    3623 ipv6_host->match(text, m_ip_lbracket->interval.end, end, flags) &&
    +
    3624 m_ip_rbracket->match(text, ipv6_host->interval.end, end, flags))
    +
    3625 {
    +
    3626 // Host is IPv6
    +
    3627 interval.end = m_ip_rbracket->interval.end;
    +
    3628 ipv4_host->invalidate();
    +
    3629 dns_host->invalidate();
    +
    3630 }
    +
    3631 else if (dns_host->match(text, interval.end, end, flags)) {
    +
    3632 // Host is hostname
    +
    3633 interval.end = dns_host->interval.end;
    +
    3634 ipv4_host->invalidate();
    +
    3635 ipv6_host->invalidate();
    +
    3636 }
    +
    3637 else {
    +
    3638 invalidate();
    +
    3639 return false;
    +
    3640 }
    +
    3641
    +
    3642 password->invalidate();
    +
    3643 port->invalidate();
    +
    3644 path->invalidate();
    +
    3645 interval.start = start;
    +
    3646 return true;
    +
    3647 }
    +
    3648
    +
    3649 if (file_scheme->interval) {
    +
    3650 if (path->match(text, interval.end, end, flags)) {
    +
    3651 // Path
    +
    3652 interval.end = path->interval.end;
    +
    3653 }
    +
    3654
    +
    3655 username->invalidate();
    +
    3656 password->invalidate();
    +
    3657 ipv4_host->invalidate();
    +
    3658 ipv6_host->invalidate();
    +
    3659 dns_host->invalidate();
    +
    3660 port->invalidate();
    +
    3661 interval.start = start;
    +
    3662 return true;
    +
    3663 }
    +
    3664
    +
    3665 // "http://" found or defaulted to
    +
    3666
    +
    3667 // If "http://" explicit, test for username&password.
    +
    3668 if (http_scheme->interval &&
    +
    3669 username->match(text, interval.end, end, flags))
    +
    3670 {
    +
    3671 if (m_colon->match(text, username->interval.end, end, flags) &&
    +
    3672 password->match(text, m_colon->interval.end, end, flags) &&
    +
    3673 m_at->match(text, password->interval.end, end, flags))
    +
    3674 {
    +
    3675 // Username and password
    +
    3676 interval.end = m_at->interval.end;
    +
    3677 }
    +
    3678 else if (m_at->match(text, username->interval.end, end, flags)) {
    +
    3679 // Username only
    +
    3680 interval.end = m_at->interval.end;
    +
    3681 password->invalidate();
    +
    3682 }
    +
    3683 else {
    +
    3684 username->invalidate();
    +
    3685 password->invalidate();
    +
    3686 }
    +
    3687 }
    +
    3688 else {
    +
    3689 username->invalidate();
    +
    3690 password->invalidate();
    +
    3691 }
    +
    3692
    +
    3693 if (ipv4_host->match(text, interval.end, end, flags)) {
    +
    3694 // Host is IPv4
    +
    3695 interval.end = ipv4_host->interval.end;
    +
    3696 ipv6_host->invalidate();
    +
    3697 dns_host->invalidate();
    +
    3698 }
    +
    3699 else if (
    +
    3700 m_ip_lbracket->match(text, interval.end, end, flags) &&
    +
    3701 ipv6_host->match(text, m_ip_lbracket->interval.end, end, flags) &&
    +
    3702 m_ip_rbracket->match(text, ipv6_host->interval.end, end, flags))
    +
    3703 {
    +
    3704 // Host is IPv6
    +
    3705 interval.end = m_ip_rbracket->interval.end;
    +
    3706 ipv4_host->invalidate();
    +
    3707 dns_host->invalidate();
    +
    3708 }
    +
    3709 else if (dns_host->match(text, interval.end, end, flags)) {
    +
    3710 // Host is hostname
    +
    3711 interval.end = dns_host->interval.end;
    +
    3712 ipv4_host->invalidate();
    +
    3713 ipv6_host->invalidate();
    +
    3714 }
    +
    3715 else {
    +
    3716 invalidate();
    +
    3717 return false;
    +
    3718 }
    +
    3719
    +
    3720 if (m_colon->match(text, interval.end, end, flags) &&
    +
    3721 port->match(text, m_colon->interval.end, end, flags))
    +
    3722 {
    +
    3723 // Port
    +
    3724 interval.end = port->interval.end;
    +
    3725 }
    +
    3726 else
    +
    3727 port->invalidate();
    +
    3728
    +
    3729 if (path->match(text, interval.end, end, flags)) {
    +
    3730 // Path
    +
    3731 interval.end = path->interval.end;
    +
    3732 }
    +
    3733
    +
    3734 interval.start = start;
    +
    3735 return true;
    +
    3736 }
    +
    3737
    +
    3738 virtual void invalidate()
    +
    3739 {
    +
    3740 http_scheme->invalidate();
    +
    3741 ftp_scheme->invalidate();
    +
    3742 mailto_scheme->invalidate();
    +
    3743 file_scheme->invalidate();
    +
    3744 username->invalidate();
    +
    3745 password->invalidate();
    +
    3746 ipv4_host->invalidate();
    +
    3747 ipv6_host->invalidate();
    +
    3748 dns_host->invalidate();
    +
    3749 port->invalidate();
    +
    3750 path->invalidate();
    +
    3751 basic_parser<T>::invalidate();
    +
    3752 }
    +
    3753
    +
    3754 public:
    +
    3755 std::shared_ptr<basic_parser<T>> http_scheme;
    +
    3756 std::shared_ptr<basic_parser<T>> ftp_scheme;
    +
    3757 std::shared_ptr<basic_parser<T>> mailto_scheme;
    +
    3758 std::shared_ptr<basic_parser<T>> file_scheme;
    +
    3759 std::shared_ptr<basic_parser<T>> username;
    +
    3760 std::shared_ptr<basic_parser<T>> password;
    +
    3761 std::shared_ptr<basic_parser<T>> ipv4_host;
    +
    3762 std::shared_ptr<basic_parser<T>> ipv6_host;
    +
    3763 std::shared_ptr<basic_parser<T>> dns_host;
    +
    3764 std::shared_ptr<basic_parser<T>> port;
    +
    3765 std::shared_ptr<basic_parser<T>> path;
    +
    3766
    +
    3767 protected:
    +
    3768 std::shared_ptr<basic_parser<T>> m_colon;
    +
    3769 std::shared_ptr<basic_parser<T>> m_slash;
    +
    3770 std::shared_ptr<basic_parser<T>> m_at;
    +
    3771 std::shared_ptr<basic_parser<T>> m_ip_lbracket;
    +
    3772 std::shared_ptr<basic_parser<T>> m_ip_rbracket;
    +
    3773 };
    +
    3774
    +
    3775 using url = basic_url<char>;
    +
    3776 using wurl = basic_url<wchar_t>;
    +
    3777#ifdef _UNICODE
    +
    3778 using turl = wurl;
    +
    3779#else
    +
    3780 using turl = url;
    +
    3781#endif
    +
    3782 using sgml_url = basic_url<char>;
    +
    3783
    +
    3787 template <class T>
    +
    3788 class basic_email_address : public basic_parser<T>
    +
    3789 {
    +
    3790 public:
    +
    3791 basic_email_address(
    +
    3792 _In_ const std::shared_ptr<basic_parser<T>>& _username,
    +
    3793 _In_ const std::shared_ptr<basic_parser<T>>& at,
    +
    3794 _In_ const std::shared_ptr<basic_parser<T>>& ip_lbracket,
    +
    3795 _In_ const std::shared_ptr<basic_parser<T>>& ip_rbracket,
    +
    3796 _In_ const std::shared_ptr<basic_parser<T>>& _ipv4_host,
    +
    3797 _In_ const std::shared_ptr<basic_parser<T>>& _ipv6_host,
    +
    3798 _In_ const std::shared_ptr<basic_parser<T>>& _dns_host,
    +
    3799 _In_ const std::locale& locale = std::locale()) :
    +
    3800 basic_parser<T>(locale),
    +
    3801 username(_username),
    +
    3802 m_at(at),
    +
    3803 m_ip_lbracket(ip_lbracket),
    +
    3804 m_ip_rbracket(ip_rbracket),
    +
    3805 ipv4_host(_ipv4_host),
    +
    3806 ipv6_host(_ipv6_host),
    +
    3807 dns_host(_dns_host)
    +
    3808 {}
    +
    3809
    +
    3810 virtual bool match(
    +
    3811 _In_reads_or_z_(end) const T* text,
    +
    3812 _In_ size_t start = 0,
    +
    3813 _In_ size_t end = (size_t)-1,
    +
    3814 _In_ int flags = match_default)
    +
    3815 {
    +
    3816 assert(text || start >= end);
    +
    3817
    +
    3818 if (username->match(text, start, end, flags) &&
    +
    3819 m_at->match(text, username->interval.end, end, flags))
    +
    3820 {
    +
    3821 // Username@
    +
    3822 if (m_ip_lbracket->match(text, m_at->interval.end, end, flags) &&
    +
    3823 ipv4_host->match(text, m_ip_lbracket->interval.end, end, flags) &&
    +
    3824 m_ip_rbracket->match(text, ipv4_host->interval.end, end, flags))
    +
    3825 {
    +
    3826 // Host is IPv4
    +
    3827 interval.end = m_ip_rbracket->interval.end;
    +
    3828 ipv6_host->invalidate();
    +
    3829 dns_host->invalidate();
    +
    3830 }
    +
    3831 else if (
    +
    3832 m_ip_lbracket->match(text, m_at->interval.end, end, flags) &&
    +
    3833 ipv6_host->match(text, m_ip_lbracket->interval.end, end, flags) &&
    +
    3834 m_ip_rbracket->match(text, ipv6_host->interval.end, end, flags))
    +
    3835 {
    +
    3836 // Host is IPv6
    +
    3837 interval.end = m_ip_rbracket->interval.end;
    +
    3838 ipv4_host->invalidate();
    +
    3839 dns_host->invalidate();
    +
    3840 }
    +
    3841 else if (dns_host->match(text, m_at->interval.end, end, flags)) {
    +
    3842 // Host is hostname
    +
    3843 interval.end = dns_host->interval.end;
    +
    3844 ipv4_host->invalidate();
    +
    3845 ipv6_host->invalidate();
    +
    3846 }
    +
    3847 else
    +
    3848 goto error;
    +
    3849 interval.start = start;
    +
    3850 return true;
    +
    3851 }
    +
    3852
    +
    3853 error:
    +
    3854 username->invalidate();
    +
    3855 ipv4_host->invalidate();
    +
    3856 ipv6_host->invalidate();
    +
    3857 dns_host->invalidate();
    +
    3858 interval.start = (interval.end = start) + 1;
    +
    3859 return false;
    +
    3860 }
    +
    3861
    +
    3862 virtual void invalidate()
    +
    3863 {
    +
    3864 username->invalidate();
    +
    3865 ipv4_host->invalidate();
    +
    3866 ipv6_host->invalidate();
    +
    3867 dns_host->invalidate();
    +
    3868 basic_parser<T>::invalidate();
    +
    3869 }
    +
    3870
    +
    3871 public:
    +
    3872 std::shared_ptr<basic_parser<T>> username;
    +
    3873 std::shared_ptr<basic_parser<T>> ipv4_host;
    +
    3874 std::shared_ptr<basic_parser<T>> ipv6_host;
    +
    3875 std::shared_ptr<basic_parser<T>> dns_host;
    +
    3876
    +
    3877 protected:
    +
    3878 std::shared_ptr<basic_parser<T>> m_at;
    +
    3879 std::shared_ptr<basic_parser<T>> m_ip_lbracket;
    +
    3880 std::shared_ptr<basic_parser<T>> m_ip_rbracket;
    +
    3881 };
    +
    3882
    +
    3883 using email_address = basic_email_address<char>;
    +
    3884 using wemail_address = basic_email_address<wchar_t>;
    +
    3885#ifdef _UNICODE
    +
    3886 using temail_address = wemail_address;
    +
    3887#else
    +
    3888 using temail_address = email_address;
    +
    3889#endif
    +
    3890 using sgml_email_address = basic_email_address<char>;
    +
    3891
    +
    3895 template <class T>
    +
    3896 class basic_emoticon : public basic_parser<T>
    +
    3897 {
    +
    3898 public:
    +
    3899 basic_emoticon(
    +
    3900 _In_ const std::shared_ptr<basic_parser<T>>& _emoticon,
    +
    3901 _In_ const std::shared_ptr<basic_parser<T>>& _apex,
    +
    3902 _In_ const std::shared_ptr<basic_parser<T>>& _eyes,
    +
    3903 _In_ const std::shared_ptr<basic_parser<T>>& _nose,
    +
    3904 _In_ const std::shared_ptr<basic_set<T>>& _mouth,
    +
    3905 _In_ const std::locale& locale = std::locale()) :
    +
    3906 basic_parser<T>(locale),
    +
    3907 emoticon(_emoticon),
    +
    3908 apex(_apex),
    +
    3909 eyes(_eyes),
    +
    3910 nose(_nose),
    +
    3911 mouth(_mouth)
    +
    3912 {}
    +
    3913
    +
    3914 virtual bool match(
    +
    3915 _In_reads_or_z_(end) const T* text,
    +
    3916 _In_ size_t start = 0,
    +
    3917 _In_ size_t end = (size_t)-1,
    +
    3918 _In_ int flags = match_default)
    +
    3919 {
    +
    3920 assert(text || start >= end);
    +
    3921
    +
    3922 if (emoticon && emoticon->match(text, start, end, flags)) {
    +
    3923 if (apex) apex->invalidate();
    +
    3924 eyes->invalidate();
    +
    3925 if (nose) nose->invalidate();
    +
    3926 mouth->invalidate();
    +
    3927 interval.start = start;
    +
    3928 interval.end = emoticon->interval.end;
    +
    3929 return true;
    +
    3930 }
    +
    3931
    +
    3932 interval.end = start;
    +
    3933
    +
    3934 if (apex && apex->match(text, interval.end, end, flags))
    +
    3935 interval.end = apex->interval.end;
    +
    3936
    +
    3937 if (eyes->match(text, interval.end, end, flags)) {
    +
    3938 if (nose && nose->match(text, eyes->interval.end, end, flags) &&
    +
    3939 mouth->match(text, nose->interval.end, end, flags))
    +
    3940 {
    +
    3941 size_t
    +
    3942 start_mouth = mouth->interval.start,
    +
    3943 hit_offset = mouth->hit_offset;
    +
    3944 // Mouth may repeat :-)))))))
    +
    3945 for (interval.end = mouth->interval.end; mouth->match(text, interval.end, end, flags) && mouth->hit_offset == hit_offset; interval.end = mouth->interval.end);
    +
    3946 mouth->interval.start = start_mouth;
    +
    3947 mouth->interval.end = interval.end;
    +
    3948 interval.start = start;
    +
    3949 return true;
    +
    3950 }
    +
    3951 if (mouth->match(text, eyes->interval.end, end, flags)) {
    +
    3952 size_t
    +
    3953 start_mouth = mouth->interval.start,
    +
    3954 hit_offset = mouth->hit_offset;
    +
    3955 // Mouth may repeat :-)))))))
    +
    3956 for (interval.end = mouth->interval.end; mouth->match(text, interval.end, end, flags) && mouth->hit_offset == hit_offset; interval.end = mouth->interval.end);
    +
    3957 if (nose) nose->invalidate();
    +
    3958 mouth->interval.start = start_mouth;
    +
    3959 mouth->interval.end = interval.end;
    +
    3960 interval.start = start;
    +
    3961 return true;
    +
    3962 }
    +
    3963 }
    +
    3964
    +
    3965 if (emoticon) emoticon->invalidate();
    +
    3966 if (apex) apex->invalidate();
    +
    3967 eyes->invalidate();
    +
    3968 if (nose) nose->invalidate();
    +
    3969 mouth->invalidate();
    +
    3970 interval.start = (interval.end = start) + 1;
    +
    3971 return false;
    +
    3972 }
    +
    3973
    +
    3974 virtual void invalidate()
    +
    3975 {
    +
    3976 if (emoticon) emoticon->invalidate();
    +
    3977 if (apex) apex->invalidate();
    +
    3978 eyes->invalidate();
    +
    3979 if (nose) nose->invalidate();
    +
    3980 mouth->invalidate();
    +
    3981 basic_parser<T>::invalidate();
    +
    3982 }
    +
    3983
    +
    3984 public:
    +
    3985 std::shared_ptr<basic_parser<T>> emoticon;
    +
    3986 std::shared_ptr<basic_parser<T>> apex;
    +
    3987 std::shared_ptr<basic_parser<T>> eyes;
    +
    3988 std::shared_ptr<basic_parser<T>> nose;
    +
    3989 std::shared_ptr<basic_set<T>> mouth;
    +
    3990 };
    +
    3991
    +
    3992 using emoticon = basic_emoticon<char>;
    +
    3993 using wemoticon = basic_emoticon<wchar_t>;
    +
    3994#ifdef _UNICODE
    +
    3995 using temoticon = wemoticon;
    +
    3996#else
    +
    3997 using temoticon = emoticon;
    +
    3998#endif
    +
    3999 using sgml_emoticon = basic_emoticon<char>;
    +
    4000
    +
    4004 ENUM_FLAGS(date_format_t, int) {
    +
    4005 none = 0,
    +
    4006 dmy = 0x1,
    +
    4007 mdy = 0x2,
    +
    4008 ymd = 0x4,
    +
    4009 ym = 0x8,
    +
    4010 my = 0x10,
    +
    4011 dm = 0x20,
    +
    4012 md = 0x40,
    +
    4013 };
    +
    4014
    +
    4018 template <class T>
    +
    4019 class basic_date : public basic_parser<T>
    +
    4020 {
    +
    4021 public:
    +
    4022 basic_date(
    +
    4023 _In_ int format_mask,
    +
    4024 _In_ const std::shared_ptr<basic_integer<T>>& _day,
    +
    4025 _In_ const std::shared_ptr<basic_integer<T>>& _month,
    +
    4026 _In_ const std::shared_ptr<basic_integer<T>>& _year,
    +
    4027 _In_ const std::shared_ptr<basic_set<T>>& separator,
    +
    4028 _In_ const std::shared_ptr<basic_parser<T>>& space,
    +
    4029 _In_ const std::locale& locale = std::locale()) :
    +
    4030 basic_parser<T>(locale),
    +
    4031 format(date_format_t::none),
    +
    4032 m_format_mask(format_mask),
    +
    4033 day(_day),
    +
    4034 month(_month),
    +
    4035 year(_year),
    +
    4036 m_separator(separator),
    +
    4037 m_space(space)
    +
    4038 {}
    +
    4039
    +
    4040 virtual bool match(
    +
    4041 _In_reads_or_z_(end) const T* text,
    +
    4042 _In_ size_t start = 0,
    +
    4043 _In_ size_t end = (size_t)-1,
    +
    4044 _In_ int flags = match_default)
    +
    4045 {
    +
    4046 assert(text || start >= end);
    +
    4047
    +
    4048 const int space_match_flags = flags & ~match_multiline; // Spaces in dates must never be broken in new line.
    +
    4049 if ((m_format_mask & date_format_t::dmy) == date_format_t::dmy) {
    +
    4050 if (day->match(text, start, end, flags)) {
    +
    4051 for (interval.end = day->interval.end; m_space->match(text, interval.end, end, space_match_flags); interval.end = m_space->interval.end);
    +
    4052 if (m_separator->match(text, interval.end, end, flags)) {
    +
    4053 size_t hit_offset = m_separator->hit_offset;
    +
    4054 for (interval.end = m_separator->interval.end; m_space->match(text, interval.end, end, space_match_flags); interval.end = m_space->interval.end);
    +
    4055 if (month->match(text, interval.end, end, flags)) {
    +
    4056 for (interval.end = month->interval.end; m_space->match(text, interval.end, end, space_match_flags); interval.end = m_space->interval.end);
    +
    4057 if (m_separator->match(text, interval.end, end, flags) &&
    +
    4058 m_separator->hit_offset == hit_offset) // Both separators must match.
    +
    4059 {
    +
    4060 for (interval.end = m_separator->interval.end; m_space->match(text, interval.end, end, space_match_flags); interval.end = m_space->interval.end);
    +
    4061 if (year->match(text, interval.end, end, flags) &&
    +
    4062 is_valid(day->value, month->value))
    +
    4063 {
    +
    4064 interval.start = start;
    +
    4065 interval.end = year->interval.end;
    +
    4066 format = date_format_t::dmy;
    +
    4067 return true;
    +
    4068 }
    +
    4069 }
    +
    4070 }
    +
    4071 }
    +
    4072 }
    +
    4073 }
    +
    4074
    +
    4075 if ((m_format_mask & date_format_t::mdy) == date_format_t::mdy) {
    +
    4076 if (month->match(text, start, end, flags)) {
    +
    4077 for (interval.end = month->interval.end; m_space->match(text, interval.end, end, space_match_flags); interval.end = m_space->interval.end);
    +
    4078 if (m_separator->match(text, interval.end, end, flags)) {
    +
    4079 size_t hit_offset = m_separator->hit_offset;
    +
    4080 for (interval.end = m_separator->interval.end; m_space->match(text, interval.end, end, space_match_flags); interval.end = m_space->interval.end);
    +
    4081 if (day->match(text, interval.end, end, flags)) {
    +
    4082 for (interval.end = day->interval.end; m_space->match(text, interval.end, end, space_match_flags); interval.end = m_space->interval.end);
    +
    4083 if (m_separator->match(text, interval.end, end, flags) &&
    +
    4084 m_separator->hit_offset == hit_offset) // Both separators must match.
    +
    4085 {
    +
    4086 for (interval.end = m_separator->interval.end; m_space->match(text, interval.end, end, space_match_flags); interval.end = m_space->interval.end);
    +
    4087 if (year->match(text, interval.end, end, flags) &&
    +
    4088 is_valid(day->value, month->value))
    +
    4089 {
    +
    4090 interval.start = start;
    +
    4091 interval.end = year->interval.end;
    +
    4092 format = date_format_t::mdy;
    +
    4093 return true;
    +
    4094 }
    +
    4095 }
    +
    4096 }
    +
    4097 }
    +
    4098 }
    +
    4099 }
    +
    4100
    +
    4101 if ((m_format_mask & date_format_t::ymd) == date_format_t::ymd) {
    +
    4102 if (year->match(text, start, end, flags)) {
    +
    4103 for (interval.end = year->interval.end; m_space->match(text, interval.end, end, space_match_flags); interval.end = m_space->interval.end);
    +
    4104 if (m_separator->match(text, interval.end, end, flags)) {
    +
    4105 size_t hit_offset = m_separator->hit_offset;
    +
    4106 for (interval.end = m_separator->interval.end; m_space->match(text, interval.end, end, space_match_flags); interval.end = m_space->interval.end);
    +
    4107 if (month->match(text, interval.end, end, flags)) {
    +
    4108 for (interval.end = month->interval.end; m_space->match(text, interval.end, end, space_match_flags); interval.end = m_space->interval.end);
    +
    4109 if (m_separator->match(text, interval.end, end, flags) &&
    +
    4110 m_separator->hit_offset == hit_offset) // Both separators must match.
    +
    4111 {
    +
    4112 for (interval.end = m_separator->interval.end; m_space->match(text, interval.end, end, space_match_flags); interval.end = m_space->interval.end);
    +
    4113 if (day->match(text, interval.end, end, flags) &&
    +
    4114 is_valid(day->value, month->value))
    +
    4115 {
    +
    4116 interval.start = start;
    +
    4117 interval.end = day->interval.end;
    +
    4118 format = date_format_t::ymd;
    +
    4119 return true;
    +
    4120 }
    +
    4121 }
    +
    4122 }
    +
    4123 }
    +
    4124 }
    +
    4125 }
    +
    4126
    +
    4127 if ((m_format_mask & date_format_t::ym) == date_format_t::ym) {
    +
    4128 if (year->match(text, start, end, flags)) {
    +
    4129 for (interval.end = year->interval.end; m_space->match(text, interval.end, end, space_match_flags); interval.end = m_space->interval.end);
    +
    4130 if (m_separator->match(text, interval.end, end, flags)) {
    +
    4131 for (interval.end = m_separator->interval.end; m_space->match(text, interval.end, end, space_match_flags); interval.end = m_space->interval.end);
    +
    4132 if (month->match(text, interval.end, end, flags) &&
    +
    4133 is_valid((size_t)-1, month->value))
    +
    4134 {
    +
    4135 if (day) day->invalidate();
    +
    4136 interval.start = start;
    +
    4137 interval.end = month->interval.end;
    +
    4138 format = date_format_t::ym;
    +
    4139 return true;
    +
    4140 }
    +
    4141 }
    +
    4142 }
    +
    4143 }
    +
    4144
    +
    4145 if ((m_format_mask & date_format_t::my) == date_format_t::my) {
    +
    4146 if (month->match(text, start, end, flags)) {
    +
    4147 for (interval.end = month->interval.end; m_space->match(text, interval.end, end, space_match_flags); interval.end = m_space->interval.end);
    +
    4148 if (m_separator->match(text, interval.end, end, flags)) {
    +
    4149 for (interval.end = m_separator->interval.end; m_space->match(text, interval.end, end, space_match_flags); interval.end = m_space->interval.end);
    +
    4150 if (year->match(text, interval.end, end, flags) &&
    +
    4151 is_valid((size_t)-1, month->value))
    +
    4152 {
    +
    4153 if (day) day->invalidate();
    +
    4154 interval.start = start;
    +
    4155 interval.end = year->interval.end;
    +
    4156 format = date_format_t::my;
    +
    4157 return true;
    +
    4158 }
    +
    4159 }
    +
    4160 }
    +
    4161 }
    +
    4162
    +
    4163 if ((m_format_mask & date_format_t::dm) == date_format_t::dm) {
    +
    4164 if (day->match(text, start, end, flags)) {
    +
    4165 for (interval.end = day->interval.end; m_space->match(text, interval.end, end, space_match_flags); interval.end = m_space->interval.end);
    +
    4166 if (m_separator->match(text, interval.end, end, flags)) {
    +
    4167 size_t hit_offset = m_separator->hit_offset;
    +
    4168 for (interval.end = m_separator->interval.end; m_space->match(text, interval.end, end, space_match_flags); interval.end = m_space->interval.end);
    +
    4169 if (month->match(text, interval.end, end, flags) &&
    +
    4170 is_valid(day->value, month->value))
    +
    4171 {
    +
    4172 if (year) year->invalidate();
    +
    4173 interval.start = start;
    +
    4174 for (interval.end = month->interval.end; m_space->match(text, interval.end, end, space_match_flags); interval.end = m_space->interval.end);
    +
    4175 if (m_separator->match(text, interval.end, end, flags) &&
    +
    4176 m_separator->hit_offset == hit_offset) // Both separators must match.
    +
    4177 interval.end = m_separator->interval.end;
    +
    4178 else
    +
    4179 interval.end = month->interval.end;
    +
    4180 format = date_format_t::dm;
    +
    4181 return true;
    +
    4182 }
    +
    4183 }
    +
    4184 }
    +
    4185 }
    +
    4186
    +
    4187 if ((m_format_mask & date_format_t::md) == date_format_t::md) {
    +
    4188 if (month->match(text, start, end, flags)) {
    +
    4189 for (interval.end = month->interval.end; m_space->match(text, interval.end, end, space_match_flags); interval.end = m_space->interval.end);
    +
    4190 if (m_separator->match(text, interval.end, end, flags)) {
    +
    4191 size_t hit_offset = m_separator->hit_offset;
    +
    4192 for (interval.end = m_separator->interval.end; m_space->match(text, interval.end, end, space_match_flags); interval.end = m_space->interval.end);
    +
    4193 if (day->match(text, interval.end, end, flags) &&
    +
    4194 is_valid(day->value, month->value))
    +
    4195 {
    +
    4196 if (year) year->invalidate();
    +
    4197 interval.start = start;
    +
    4198 for (interval.end = day->interval.end; m_space->match(text, interval.end, end, space_match_flags); interval.end = m_space->interval.end);
    +
    4199 if (m_separator->match(text, interval.end, end, flags) &&
    +
    4200 m_separator->hit_offset == hit_offset) // Both separators must match.
    +
    4201 interval.end = m_separator->interval.end;
    +
    4202 else
    +
    4203 interval.end = day->interval.end;
    +
    4204 format = date_format_t::md;
    +
    4205 return true;
    +
    4206 }
    +
    4207 }
    +
    4208 }
    +
    4209 }
    +
    4210
    +
    4211 if (day) day->invalidate();
    +
    4212 if (month) month->invalidate();
    +
    4213 if (year) year->invalidate();
    +
    4214 format = date_format_t::none;
    +
    4215 interval.start = (interval.end = start) + 1;
    +
    4216 return false;
    +
    4217 }
    +
    4218
    +
    4219 virtual void invalidate()
    +
    4220 {
    +
    4221 if (day) day->invalidate();
    +
    4222 if (month) month->invalidate();
    +
    4223 if (year) year->invalidate();
    +
    4224 format = date_format_t::none;
    +
    4225 basic_parser<T>::invalidate();
    +
    4226 }
    +
    4227
    +
    4228 protected:
    +
    4229 static inline bool is_valid(size_t day, size_t month)
    +
    4230 {
    +
    4231 if (month == (size_t)-1) {
    +
    4232 // Default to January. This allows validating day only, as January has all 31 days.
    +
    4233 month = 1;
    +
    4234 }
    +
    4235 if (day == (size_t)-1) {
    +
    4236 // Default to 1st day in month. This allows validating month only, as each month has 1st day.
    +
    4237 day = 1;
    +
    4238 }
    +
    4239
    +
    4240 switch (month) {
    +
    4241 case 1:
    +
    4242 case 3:
    +
    4243 case 5:
    +
    4244 case 7:
    +
    4245 case 8:
    +
    4246 case 10:
    +
    4247 case 12:
    +
    4248 return 1 <= day && day <= 31;
    +
    4249 case 2:
    +
    4250 return 1 <= day && day <= 29;
    +
    4251 case 4:
    +
    4252 case 6:
    +
    4253 case 9:
    +
    4254 case 11:
    +
    4255 return 1 <= day && day <= 30;
    +
    4256 default:
    +
    4257 return false;
    +
    4258 }
    +
    4259 }
    +
    4260
    +
    4261 public:
    +
    4262 date_format_t format;
    +
    4263 std::shared_ptr<basic_integer<T>> day;
    +
    4264 std::shared_ptr<basic_integer<T>> month;
    +
    4265 std::shared_ptr<basic_integer<T>> year;
    +
    4266
    +
    4267 protected:
    +
    4268 int m_format_mask;
    +
    4269 std::shared_ptr<basic_set<T>> m_separator;
    +
    4270 std::shared_ptr<basic_parser<T>> m_space;
    +
    4271 };
    +
    4272
    +
    4273 using date = basic_date<char>;
    +
    4274 using wdate = basic_date<wchar_t>;
    +
    4275#ifdef _UNICODE
    +
    4276 using tdate = wdate;
    +
    4277#else
    +
    4278 using tdate = date;
    +
    4279#endif
    +
    4280 using sgml_date = basic_date<char>;
    +
    4281
    +
    4285 template <class T>
    +
    4286 class basic_time : public basic_parser<T>
    +
    4287 {
    +
    4288 public:
    +
    4289 basic_time(
    +
    4290 _In_ const std::shared_ptr<basic_integer10<T>>& _hour,
    +
    4291 _In_ const std::shared_ptr<basic_integer10<T>>& _minute,
    +
    4292 _In_ const std::shared_ptr<basic_integer10<T>>& _second,
    +
    4293 _In_ const std::shared_ptr<basic_integer10<T>>& _millisecond,
    +
    4294 _In_ const std::shared_ptr<basic_set<T>>& separator,
    +
    4295 _In_ const std::shared_ptr<basic_parser<T>>& millisecond_separator,
    +
    4296 _In_ const std::locale& locale = std::locale()) :
    +
    4297 basic_parser<T>(locale),
    +
    4298 hour(_hour),
    +
    4299 minute(_minute),
    +
    4300 second(_second),
    +
    4301 millisecond(_millisecond),
    +
    4302 m_separator(separator),
    +
    4303 m_millisecond_separator(millisecond_separator)
    +
    4304 {}
    +
    4305
    +
    4306 virtual bool match(
    +
    4307 _In_reads_or_z_(end) const T* text,
    +
    4308 _In_ size_t start = 0,
    +
    4309 _In_ size_t end = (size_t)-1,
    +
    4310 _In_ int flags = match_default)
    +
    4311 {
    +
    4312 assert(text || start >= end);
    +
    4313
    +
    4314 if (hour->match(text, start, end, flags) &&
    +
    4315 m_separator->match(text, hour->interval.end, end, flags) &&
    +
    4316 minute->match(text, m_separator->interval.end, end, flags) &&
    +
    4317 minute->value < 60)
    +
    4318 {
    +
    4319 // hh::mm
    +
    4320 size_t hit_offset = m_separator->hit_offset;
    +
    4321 if (m_separator->match(text, minute->interval.end, end, flags) &&
    +
    4322 m_separator->hit_offset == hit_offset && // Both separators must match.
    +
    4323 second && second->match(text, m_separator->interval.end, end, flags) &&
    +
    4324 second->value < 60)
    +
    4325 {
    +
    4326 // hh::mm:ss
    +
    4327 if (m_millisecond_separator && m_millisecond_separator->match(text, second->interval.end, end, flags) &&
    +
    4328 millisecond && millisecond->match(text, m_millisecond_separator->interval.end, end, flags) &&
    +
    4329 millisecond->value < 1000)
    +
    4330 {
    +
    4331 // hh::mm:ss.mmmm
    +
    4332 interval.end = millisecond->interval.end;
    +
    4333 }
    +
    4334 else {
    +
    4335 if (millisecond) millisecond->invalidate();
    +
    4336 interval.end = second->interval.end;
    +
    4337 }
    +
    4338 }
    +
    4339 else {
    +
    4340 if (second) second->invalidate();
    +
    4341 if (millisecond) millisecond->invalidate();
    +
    4342 interval.end = minute->interval.end;
    +
    4343 }
    +
    4344 interval.start = start;
    +
    4345 return true;
    +
    4346 }
    +
    4347
    +
    4348 hour->invalidate();
    +
    4349 minute->invalidate();
    +
    4350 if (second) second->invalidate();
    +
    4351 if (millisecond) millisecond->invalidate();
    +
    4352 interval.start = (interval.end = start) + 1;
    +
    4353 return false;
    +
    4354 }
    +
    4355
    +
    4356 virtual void invalidate()
    +
    4357 {
    +
    4358 hour->invalidate();
    +
    4359 minute->invalidate();
    +
    4360 if (second) second->invalidate();
    +
    4361 if (millisecond) millisecond->invalidate();
    +
    4362 basic_parser<T>::invalidate();
    +
    4363 }
    +
    4364
    +
    4365 public:
    +
    4366 std::shared_ptr<basic_integer10<T>> hour;
    +
    4367 std::shared_ptr<basic_integer10<T>> minute;
    +
    4368 std::shared_ptr<basic_integer10<T>> second;
    +
    4369 std::shared_ptr<basic_integer10<T>> millisecond;
    +
    4370
    +
    4371 protected:
    +
    4372 std::shared_ptr<basic_set<T>> m_separator;
    +
    4373 std::shared_ptr<basic_parser<T>> m_millisecond_separator;
    +
    4374 };
    +
    4375
    +
    4376 using time = basic_time<char>;
    +
    4377 using wtime = basic_time<wchar_t>;
    +
    4378#ifdef _UNICODE
    +
    4379 using ttime = wtime;
    +
    4380#else
    +
    4381 using ttime = time;
    +
    4382#endif
    +
    4383 using sgml_time = basic_time<char>;
    +
    4384
    +
    4388 template <class T>
    +
    4389 class basic_angle : public basic_parser<T>
    +
    4390 {
    +
    4391 public:
    +
    4392 basic_angle(
    +
    4393 _In_ const std::shared_ptr<basic_integer10<T>>& _degree,
    +
    4394 _In_ const std::shared_ptr<basic_parser<T>>& _degree_separator,
    +
    4395 _In_ const std::shared_ptr<basic_integer10<T>>& _minute,
    +
    4396 _In_ const std::shared_ptr<basic_parser<T>>& _minute_separator,
    +
    4397 _In_ const std::shared_ptr<basic_integer10<T>>& _second,
    +
    4398 _In_ const std::shared_ptr<basic_parser<T>>& _second_separator,
    +
    4399 _In_ const std::shared_ptr<basic_parser<T>>& _decimal,
    +
    4400 _In_ const std::locale& locale = std::locale()) :
    +
    4401 basic_parser<T>(locale),
    +
    4402 degree(_degree),
    +
    4403 degree_separator(_degree_separator),
    +
    4404 minute(_minute),
    +
    4405 minute_separator(_minute_separator),
    +
    4406 second(_second),
    +
    4407 second_separator(_second_separator),
    +
    4408 decimal(_decimal)
    +
    4409 {}
    +
    4410
    +
    4411 virtual bool match(
    +
    4412 _In_reads_or_z_(end) const T* text,
    +
    4413 _In_ size_t start = 0,
    +
    4414 _In_ size_t end = (size_t)-1,
    +
    4415 _In_ int flags = match_default)
    +
    4416 {
    +
    4417 assert(text || start >= end);
    +
    4418
    +
    4419 interval.end = start;
    +
    4420
    +
    4421 if (degree->match(text, interval.end, end, flags) &&
    +
    4422 degree_separator->match(text, degree->interval.end, end, flags))
    +
    4423 {
    +
    4424 // Degrees
    +
    4425 interval.end = degree_separator->interval.end;
    +
    4426 }
    +
    4427 else {
    +
    4428 degree->invalidate();
    +
    4429 degree_separator->invalidate();
    +
    4430 }
    +
    4431
    +
    4432 if (minute->match(text, interval.end, end, flags) &&
    +
    4433 minute->value < 60 &&
    +
    4434 minute_separator->match(text, minute->interval.end, end, flags))
    +
    4435 {
    +
    4436 // Minutes
    +
    4437 interval.end = minute_separator->interval.end;
    +
    4438 }
    +
    4439 else {
    +
    4440 minute->invalidate();
    +
    4441 minute_separator->invalidate();
    +
    4442 }
    +
    4443
    +
    4444 if (second && second->match(text, interval.end, end, flags) &&
    +
    4445 second->value < 60)
    +
    4446 {
    +
    4447 // Seconds
    +
    4448 interval.end = second->interval.end;
    +
    4449 if (second_separator && second_separator->match(text, interval.end, end, flags))
    +
    4450 interval.end = second_separator->interval.end;
    +
    4451 else
    +
    4452 if (second_separator) second_separator->invalidate();
    +
    4453 }
    +
    4454 else {
    +
    4455 if (second) second->invalidate();
    +
    4456 if (second_separator) second_separator->invalidate();
    +
    4457 }
    +
    4458
    +
    4459 if (degree->interval.start < degree->interval.end ||
    +
    4460 minute->interval.start < minute->interval.end ||
    +
    4461 second && second->interval.start < second->interval.end)
    +
    4462 {
    +
    4463 if (decimal && decimal->match(text, interval.end, end, flags)) {
    +
    4464 // Decimals
    +
    4465 interval.end = decimal->interval.end;
    +
    4466 }
    +
    4467 else if (decimal)
    +
    4468 decimal->invalidate();
    +
    4469 interval.start = start;
    +
    4470 return true;
    +
    4471 }
    +
    4472 if (decimal) decimal->invalidate();
    +
    4473 interval.start = (interval.end = start) + 1;
    +
    4474 return false;
    +
    4475 }
    +
    4476
    +
    4477 virtual void invalidate()
    +
    4478 {
    +
    4479 degree->invalidate();
    +
    4480 degree_separator->invalidate();
    +
    4481 minute->invalidate();
    +
    4482 minute_separator->invalidate();
    +
    4483 if (second) second->invalidate();
    +
    4484 if (second_separator) second_separator->invalidate();
    +
    4485 if (decimal) decimal->invalidate();
    +
    4486 basic_parser<T>::invalidate();
    +
    4487 }
    +
    4488
    +
    4489 public:
    +
    4490 std::shared_ptr<basic_integer10<T>> degree;
    +
    4491 std::shared_ptr<basic_parser<T>> degree_separator;
    +
    4492 std::shared_ptr<basic_integer10<T>> minute;
    +
    4493 std::shared_ptr<basic_parser<T>> minute_separator;
    +
    4494 std::shared_ptr<basic_integer10<T>> second;
    +
    4495 std::shared_ptr<basic_parser<T>> second_separator;
    +
    4496 std::shared_ptr<basic_parser<T>> decimal;
    +
    4497 };
    +
    4498
    +
    4499 using angle = basic_angle<char>;
    +
    4500 using wangle = basic_angle<wchar_t>;
    +
    4501#ifdef _UNICODE
    +
    4502 using RRegElKot = wangle;
    +
    4503#else
    +
    4504 using RRegElKot = angle;
    +
    4505#endif
    +
    4506 using sgml_angle = basic_angle<char>;
    +
    4507
    +
    4511 template <class T>
    +
    4512 class basic_phone_number : public basic_parser<T>
    +
    4513 {
    +
    4514 public:
    +
    4515 basic_phone_number(
    +
    4516 _In_ const std::shared_ptr<basic_parser<T>>& digit,
    +
    4517 _In_ const std::shared_ptr<basic_parser<T>>& plus_sign,
    +
    4518 _In_ const std::shared_ptr<basic_set<T>>& lparenthesis,
    +
    4519 _In_ const std::shared_ptr<basic_set<T>>& rparenthesis,
    +
    4520 _In_ const std::shared_ptr<basic_parser<T>>& separator,
    +
    4521 _In_ const std::shared_ptr<basic_parser<T>>& space,
    +
    4522 _In_ const std::locale& locale = std::locale()) :
    +
    4523 basic_parser<T>(locale),
    +
    4524 m_digit(digit),
    +
    4525 m_plus_sign(plus_sign),
    +
    4526 m_lparenthesis(lparenthesis),
    +
    4527 m_rparenthesis(rparenthesis),
    +
    4528 m_separator(separator),
    +
    4529 m_space(space)
    +
    4530 {}
    +
    4531
    +
    4532 virtual bool match(
    +
    4533 _In_reads_or_z_(end) const T* text,
    +
    4534 _In_ size_t start = 0,
    +
    4535 _In_ size_t end = (size_t)-1,
    +
    4536 _In_ int flags = match_default)
    +
    4537 {
    +
    4538 assert(text || start >= end);
    +
    4539
    +
    4540 size_t safe_digit_end = start, safe_value_size = 0;
    +
    4541 bool has_digits = false, after_digit = false, in_parentheses = false, after_parentheses = false;
    +
    4542 const int space_match_flags = flags & ~match_multiline; // Spaces in phone numbers must never be broken in new line.
    +
    4543
    +
    4544 interval.end = start;
    +
    4545 value.clear();
    +
    4546 m_lparenthesis->invalidate();
    +
    4547 m_rparenthesis->invalidate();
    +
    4548
    +
    4549 if (m_plus_sign && m_plus_sign->match(text, interval.end, end, flags)) {
    +
    4550 value.append(text + m_plus_sign->interval.start, text + m_plus_sign->interval.end);
    +
    4551 safe_value_size = value.size();
    +
    4552 interval.end = m_plus_sign->interval.end;
    +
    4553 }
    +
    4554
    +
    4555 for (;;) {
    +
    4556 assert(text || interval.end >= end);
    +
    4557 if (interval.end >= end || !text[interval.end])
    +
    4558 break;
    +
    4559 if (m_digit->match(text, interval.end, end, flags)) {
    +
    4560 // Digit
    +
    4561 value.append(text + m_digit->interval.start, text + m_digit->interval.end);
    +
    4562 interval.end = m_digit->interval.end;
    +
    4563 if (!in_parentheses) {
    +
    4564 safe_digit_end = interval.end;
    +
    4565 safe_value_size = value.size();
    +
    4566 has_digits = true;
    +
    4567 }
    +
    4568 after_digit = true;
    +
    4569 after_parentheses = false;
    +
    4570 }
    +
    4571 else if (
    +
    4572 m_lparenthesis && !m_lparenthesis->interval && // No left parenthesis yet
    +
    4573 m_rparenthesis && !m_rparenthesis->interval && // Right parenthesis after left
    +
    4574 m_lparenthesis->match(text, interval.end, end, flags))
    +
    4575 {
    +
    4576 // Left parenthesis
    +
    4577 value.append(text + m_lparenthesis->interval.start, m_lparenthesis->interval.size());
    +
    4578 interval.end = m_lparenthesis->interval.end;
    +
    4579 in_parentheses = true;
    +
    4580 after_digit = false;
    +
    4581 after_parentheses = false;
    +
    4582 }
    +
    4583 else if (
    +
    4584 in_parentheses && // After left parenthesis
    +
    4585 m_rparenthesis && !m_rparenthesis->interval && // No right parenthesis yet
    +
    4586 m_rparenthesis->match(text, interval.end, end, flags) &&
    +
    4587 m_lparenthesis->hit_offset == m_rparenthesis->hit_offset) // Left and right parentheses must match
    +
    4588 {
    +
    4589 // Right parenthesis
    +
    4590 value.append(text + m_rparenthesis->interval.start, text + m_rparenthesis->interval.end);
    +
    4591 interval.end = m_rparenthesis->interval.end;
    +
    4592 safe_digit_end = interval.end;
    +
    4593 safe_value_size = value.size();
    +
    4594 in_parentheses = false;
    +
    4595 after_digit = false;
    +
    4596 after_parentheses = true;
    +
    4597 }
    +
    4598 else if (
    +
    4599 after_digit &&
    +
    4600 !in_parentheses && // No separators inside parentheses
    +
    4601 !after_parentheses && // No separators following right parenthesis
    +
    4602 m_separator && m_separator->match(text, interval.end, end, flags))
    +
    4603 {
    +
    4604 // Separator
    +
    4605 interval.end = m_separator->interval.end;
    +
    4606 after_digit = false;
    +
    4607 after_parentheses = false;
    +
    4608 }
    +
    4609 else if (
    +
    4610 (after_digit || after_parentheses) &&
    +
    4611 m_space && m_space->match(text, interval.end, end, space_match_flags))
    +
    4612 {
    +
    4613 // Space
    +
    4614 interval.end = m_space->interval.end;
    +
    4615 after_digit = false;
    +
    4616 after_parentheses = false;
    +
    4617 }
    +
    4618 else
    +
    4619 break;
    +
    4620 }
    +
    4621 if (has_digits) {
    +
    4622 value.erase(safe_value_size);
    +
    4623 interval.start = start;
    +
    4624 interval.end = safe_digit_end;
    +
    4625 return true;
    +
    4626 }
    +
    4627 value.clear();
    +
    4628 interval.start = (interval.end = start) + 1;
    +
    4629 return false;
    +
    4630 }
    +
    4631
    +
    4632 virtual void invalidate()
    +
    4633 {
    +
    4634 value.clear();
    +
    4635 basic_parser<T>::invalidate();
    +
    4636 }
    +
    4637
    +
    4638 public:
    +
    4639 std::basic_string<T> value;
    +
    4640
    +
    4641 protected:
    +
    4642 std::shared_ptr<basic_parser<T>> m_digit;
    +
    4643 std::shared_ptr<basic_parser<T>> m_plus_sign;
    +
    4644 std::shared_ptr<basic_set<T>> m_lparenthesis;
    +
    4645 std::shared_ptr<basic_set<T>> m_rparenthesis;
    +
    4646 std::shared_ptr<basic_parser<T>> m_separator;
    +
    4647 std::shared_ptr<basic_parser<T>> m_space;
    +
    4648 };
    +
    4649
    +
    4650 using phone_number = basic_phone_number<char>;
    +
    4651 using wphone_number = basic_phone_number<wchar_t>;
    +
    4652#ifdef _UNICODE
    +
    4653 using tphone_number = wphone_number;
    +
    4654#else
    +
    4655 using tphone_number = phone_number;
    +
    4656#endif
    +
    4657 using sgml_phone_number = basic_phone_number<char>;
    +
    4658
    +
    4662 template <class T>
    +
    4663 class basic_chemical_formula : public basic_parser<T>
    +
    4664 {
    +
    4665 public:
    +
    4666 basic_chemical_formula(
    +
    4667 _In_ const std::shared_ptr<basic_parser<T>>& element,
    +
    4668 _In_ const std::shared_ptr<basic_parser<T>>& digit,
    +
    4669 _In_ const std::shared_ptr<basic_parser<T>>& sign,
    +
    4670 _In_ const std::locale& locale = std::locale()) :
    +
    4671 basic_parser<T>(locale),
    +
    4672 m_element(element),
    +
    4673 m_digit(digit),
    +
    4674 m_sign(sign),
    +
    4675 has_digits(false),
    +
    4676 has_charge(false)
    +
    4677 {}
    +
    4678
    +
    4679 virtual bool match(
    +
    4680 _In_reads_or_z_(end) const T* text,
    +
    4681 _In_ size_t start = 0,
    +
    4682 _In_ size_t end = (size_t)-1,
    +
    4683 _In_ int flags = match_default)
    +
    4684 {
    +
    4685 assert(text || start >= end);
    +
    4686
    +
    4687 has_digits = false;
    +
    4688 has_charge = false;
    +
    4689 interval.end = start;
    +
    4690
    +
    4691 const int element_match_flags = flags & ~match_case_insensitive; // Chemical elements are always case-sensitive.
    +
    4692 for (;;) {
    +
    4693 if (m_element->match(text, interval.end, end, element_match_flags)) {
    +
    4694 interval.end = m_element->interval.end;
    +
    4695 while (m_digit->match(text, interval.end, end, flags)) {
    +
    4696 interval.end = m_digit->interval.end;
    +
    4697 has_digits = true;
    +
    4698 }
    +
    4699 }
    +
    4700 else if (start < interval.end) {
    +
    4701 if (m_sign->match(text, interval.end, end, flags)) {
    +
    4702 interval.end = m_sign->interval.end;
    +
    4703 has_charge = true;
    +
    4704 }
    +
    4705 interval.start = start;
    +
    4706 return true;
    +
    4707 }
    +
    4708 else {
    +
    4709 interval.start = (interval.end = start) + 1;
    +
    4710 return false;
    +
    4711 }
    +
    4712 }
    +
    4713 }
    +
    4714
    +
    4715 virtual void invalidate()
    +
    4716 {
    +
    4717 has_digits = false;
    +
    4718 has_charge = false;
    +
    4719 basic_parser<T>::invalidate();
    +
    4720 }
    +
    4721
    +
    4722 public:
    +
    4723 bool has_digits;
    +
    4724 bool has_charge;
    +
    4725
    +
    4726 protected:
    +
    4727 std::shared_ptr<basic_parser<T>> m_element;
    +
    4728 std::shared_ptr<basic_parser<T>> m_digit;
    +
    4729 std::shared_ptr<basic_parser<T>> m_sign;
    +
    4730 };
    +
    4731
    +
    4732 using chemical_formula = basic_chemical_formula<char>;
    +
    4733 using wchemical_formula = basic_chemical_formula<wchar_t>;
    +
    4734#ifdef _UNICODE
    +
    4735 using tchemical_formula = wchemical_formula;
    +
    4736#else
    +
    4737 using tchemical_formula = chemical_formula;
    +
    4738#endif
    +
    4739 using sgml_chemical_formula = basic_chemical_formula<char>;
    +
    4740
    +
    4744 class http_line_break : public parser
    +
    4745 {
    +
    4746 public:
    +
    4747 virtual bool match(
    +
    4748 _In_reads_or_z_(end) const char* text,
    +
    4749 _In_ size_t start = 0,
    +
    4750 _In_ size_t end = (size_t)-1,
    +
    4751 _In_ int flags = match_default)
    +
    4752 {
    +
    4753 assert(text || start >= end);
    +
    4754 interval.end = start;
    +
    4755
    +
    4756 assert(text || interval.end >= end);
    +
    4757 if (interval.end < end && text[interval.end]) {
    +
    4758 if (text[interval.end] == '\r') {
    +
    4759 interval.end++;
    +
    4760 if (interval.end < end && text[interval.end] == '\n') {
    +
    4761 interval.start = start;
    +
    4762 interval.end++;
    +
    4763 return true;
    +
    4764 }
    +
    4765 }
    +
    4766 else if (text[interval.end] == '\n') {
    +
    4767 interval.start = start;
    +
    4768 interval.end++;
    +
    4769 return true;
    +
    4770 }
    +
    4771 }
    +
    4772 interval.start = (interval.end = start) + 1;
    +
    4773 return false;
    +
    4774 }
    +
    4775 };
    +
    4776
    +
    4780 class http_space : public parser
    +
    4781 {
    +
    4782 public:
    +
    4783 virtual bool match(
    +
    4784 _In_reads_or_z_(end) const char* text,
    +
    4785 _In_ size_t start = 0,
    +
    4786 _In_ size_t end = (size_t)-1,
    +
    4787 _In_ int flags = match_default)
    +
    4788 {
    +
    4789 assert(text || start >= end);
    +
    4790 interval.end = start;
    +
    4791 if (m_line_break.match(text, interval.end, end, flags)) {
    +
    4792 interval.end = m_line_break.interval.end;
    +
    4793 if (interval.end < end && text[interval.end] && isspace(text[interval.end])) {
    +
    4794 interval.start = start;
    +
    4795 interval.end++;
    +
    4796 while (interval.end < end && text[interval.end] && isspace(text[interval.end])) interval.end++;
    +
    4797 return true;
    +
    4798 }
    +
    4799 }
    +
    4800 else if (interval.end < end && text[interval.end] && isspace(text[interval.end])) {
    +
    4801 interval.start = start;
    +
    4802 interval.end++;
    +
    4803 while (interval.end < end && text[interval.end] && isspace(text[interval.end])) interval.end++;
    +
    4804 return true;
    +
    4805 }
    +
    4806 interval.start = (interval.end = start) + 1;
    +
    4807 return false;
    +
    4808 }
    +
    4809
    +
    4810 protected:
    +
    4811 http_line_break m_line_break;
    +
    4812 };
    +
    4813
    +
    4817 class http_text_char : public parser
    +
    4818 {
    +
    4819 public:
    +
    4820 virtual bool match(
    +
    4821 _In_reads_or_z_(end) const char* text,
    +
    4822 _In_ size_t start = 0,
    +
    4823 _In_ size_t end = (size_t)-1,
    +
    4824 _In_ int flags = match_default)
    +
    4825 {
    +
    4826 assert(text || start >= end);
    +
    4827 interval.end = start;
    +
    4828
    +
    4829 assert(text || interval.end >= end);
    +
    4830 if (m_space.match(text, interval.end, end, flags)) {
    +
    4831 interval.start = start;
    +
    4832 interval.end = m_space.interval.end;
    +
    4833 return true;
    +
    4834 }
    +
    4835 else if (interval.end < end && text[interval.end] && text[interval.end] >= 0x20) {
    +
    4836 interval.start = start;
    +
    4837 interval.end++;
    +
    4838 return true;
    +
    4839 }
    +
    4840 interval.start = (interval.end = start) + 1;
    +
    4841 return false;
    +
    4842 }
    +
    4843
    +
    4844 protected:
    +
    4845 http_space m_space;
    +
    4846 };
    +
    4847
    +
    4851 class http_token : public parser
    +
    4852 {
    +
    4853 public:
    +
    4854 virtual bool match(
    +
    4855 _In_reads_or_z_(end) const char* text,
    +
    4856 _In_ size_t start = 0,
    +
    4857 _In_ size_t end = (size_t)-1,
    +
    4858 _In_ int flags = match_default)
    +
    4859 {
    +
    4860 assert(text || start >= end);
    +
    4861 interval.end = start;
    +
    4862 for (;;) {
    +
    4863 if (interval.end < end && text[interval.end]) {
    +
    4864 if ((unsigned int)text[interval.end] < 0x20 ||
    +
    4865 (unsigned int)text[interval.end] == 0x7f ||
    +
    4866 text[interval.end] == '(' ||
    +
    4867 text[interval.end] == ')' ||
    +
    4868 text[interval.end] == '<' ||
    +
    4869 text[interval.end] == '>' ||
    +
    4870 text[interval.end] == '@' ||
    +
    4871 text[interval.end] == ',' ||
    +
    4872 text[interval.end] == ';' ||
    +
    4873 text[interval.end] == ':' ||
    +
    4874 text[interval.end] == '\\' ||
    +
    4875 text[interval.end] == '\"' ||
    +
    4876 text[interval.end] == '/' ||
    +
    4877 text[interval.end] == '[' ||
    +
    4878 text[interval.end] == ']' ||
    +
    4879 text[interval.end] == '?' ||
    +
    4880 text[interval.end] == '=' ||
    +
    4881 text[interval.end] == '{' ||
    +
    4882 text[interval.end] == '}' ||
    +
    4883 isspace(text[interval.end]))
    +
    4884 break;
    +
    4885 else
    +
    4886 interval.end++;
    +
    4887 }
    +
    4888 else
    +
    4889 break;
    +
    4890 }
    +
    4891 if (start < interval.end) {
    +
    4892 interval.start = start;
    +
    4893 return true;
    +
    4894 }
    +
    4895 else {
    +
    4896 interval.start = (interval.end = start) + 1;
    +
    4897 return false;
    +
    4898 }
    +
    4899 }
    +
    4900 };
    +
    4901
    +
    4905 class http_quoted_string : public parser
    +
    4906 {
    +
    4907 public:
    +
    4908 virtual bool match(
    +
    4909 _In_reads_or_z_(end) const char* text,
    +
    4910 _In_ size_t start = 0,
    +
    4911 _In_ size_t end = (size_t)-1,
    +
    4912 _In_ int flags = match_default)
    +
    4913 {
    +
    4914 assert(text || start >= end);
    +
    4915 interval.end = start;
    +
    4916 if (interval.end < end && text[interval.end] != '"')
    +
    4917 goto error;
    +
    4918 interval.end++;
    +
    4919 content.start = interval.end;
    +
    4920 for (;;) {
    +
    4921 assert(text || interval.end >= end);
    +
    4922 if (interval.end < end && text[interval.end]) {
    +
    4923 if (text[interval.end] == '"') {
    +
    4924 content.end = interval.end;
    +
    4925 interval.end++;
    +
    4926 break;
    +
    4927 }
    +
    4928 else if (text[interval.end] == '\\') {
    +
    4929 interval.end++;
    +
    4930 if (interval.end < end && text[interval.end]) {
    +
    4931 interval.end++;
    +
    4932 }
    +
    4933 else
    +
    4934 goto error;
    +
    4935 }
    +
    4936 else if (m_chr.match(text, interval.end, end, flags))
    +
    4937 interval.end++;
    +
    4938 else
    +
    4939 goto error;
    +
    4940 }
    +
    4941 else
    +
    4942 goto error;
    +
    4943 }
    +
    4944 interval.start = start;
    +
    4945 return true;
    +
    4946
    +
    4947 error:
    +
    4948 content.start = 1;
    +
    4949 content.end = 0;
    +
    4950 interval.start = (interval.end = start) + 1;
    +
    4951 return false;
    +
    4952 }
    +
    4953
    +
    4954 virtual void invalidate()
    +
    4955 {
    +
    4956 content.start = 1;
    +
    4957 content.end = 0;
    +
    4958 parser::invalidate();
    +
    4959 }
    +
    4960
    +
    4961 public:
    +
    4962 stdex::interval<size_t> content;
    +
    4963
    +
    4964 protected:
    +
    4965 http_text_char m_chr;
    +
    4966 };
    +
    4967
    +
    4971 class http_value : public parser
    +
    4972 {
    +
    4973 public:
    +
    4974 virtual bool match(
    +
    4975 _In_reads_or_z_(end) const char* text,
    +
    4976 _In_ size_t start = 0,
    +
    4977 _In_ size_t end = (size_t)-1,
    +
    4978 _In_ int flags = match_default)
    +
    4979 {
    +
    4980 assert(text || start >= end);
    +
    4981 interval.end = start;
    +
    4982 if (string.match(text, interval.end, end, flags)) {
    +
    4983 token.invalidate();
    +
    4984 interval.end = string.interval.end;
    +
    4985 interval.start = start;
    +
    4986 return true;
    +
    4987 }
    +
    4988 else if (token.match(text, interval.end, end, flags)) {
    +
    4989 string.invalidate();
    +
    4990 interval.end = token.interval.end;
    +
    4991 interval.start = start;
    +
    4992 return true;
    +
    4993 }
    +
    4994 else {
    +
    4995 interval.start = (interval.end = start) + 1;
    +
    4996 return false;
    +
    4997 }
    +
    4998 }
    +
    4999
    +
    5000 virtual void invalidate()
    +
    5001 {
    +
    5002 string.invalidate();
    +
    5003 token.invalidate();
    +
    5004 parser::invalidate();
    +
    5005 }
    +
    5006
    +
    5007 public:
    +
    5008 http_quoted_string string;
    +
    5009 http_token token;
    +
    5010 };
    +
    5011
    +
    5015 class http_parameter : public parser
    +
    5016 {
    +
    5017 public:
    +
    5018 virtual bool match(
    +
    5019 _In_reads_or_z_(end) const char* text,
    +
    5020 _In_ size_t start = 0,
    +
    5021 _In_ size_t end = (size_t)-1,
    +
    5022 _In_ int flags = match_default)
    +
    5023 {
    +
    5024 assert(text || start >= end);
    +
    5025 interval.end = start;
    +
    5026 if (name.match(text, interval.end, end, flags))
    +
    5027 interval.end = name.interval.end;
    +
    5028 else
    +
    5029 goto error;
    +
    5030 while (m_space.match(text, interval.end, end, flags))
    +
    5031 interval.end = m_space.interval.end;
    +
    5032 assert(text || interval.end >= end);
    +
    5033 if (interval.end < end && text[interval.end] == '=')
    +
    5034 interval.end++;
    +
    5035 else
    +
    5036 while (m_space.match(text, interval.end, end, flags))
    +
    5037 interval.end = m_space.interval.end;
    +
    5038 if (value.match(text, interval.end, end, flags))
    +
    5039 interval.end = value.interval.end;
    +
    5040 else
    +
    5041 goto error;
    +
    5042 interval.start = start;
    +
    5043 return true;
    +
    5044
    +
    5045 error:
    +
    5046 name.invalidate();
    +
    5047 value.invalidate();
    +
    5048 interval.start = (interval.end = start) + 1;
    +
    5049 return false;
    +
    5050 }
    +
    5051
    +
    5052 virtual void invalidate()
    +
    5053 {
    +
    5054 name.invalidate();
    +
    5055 value.invalidate();
    +
    5056 parser::invalidate();
    +
    5057 }
    +
    5058
    +
    5059 public:
    +
    5060 http_token name;
    +
    5061 http_value value;
    +
    5062
    +
    5063 protected:
    +
    5064 http_space m_space;
    +
    5065 };
    +
    5066
    +
    5070 class http_any_type : public parser
    +
    5071 {
    +
    5072 public:
    +
    5073 virtual bool match(
    +
    5074 _In_reads_or_z_(end) const char* text,
    +
    5075 _In_ size_t start = 0,
    +
    5076 _In_ size_t end = (size_t)-1,
    +
    5077 _In_ int flags = match_default)
    +
    5078 {
    +
    5079 assert(text || start >= end);
    +
    5080 if (start + 2 < end &&
    +
    5081 text[start] == '*' &&
    +
    5082 text[start + 1] == '/' &&
    +
    5083 text[start + 2] == '*')
    +
    5084 {
    +
    5085 interval.end = (interval.start = start) + 3;
    +
    5086 return true;
    +
    5087 }
    +
    5088 else if (start < end && text[start] == '*') {
    +
    5089 interval.end = (interval.start = start) + 1;
    +
    5090 return true;
    +
    5091 }
    +
    5092 else {
    +
    5093 interval.start = (interval.end = start) + 1;
    +
    5094 return false;
    +
    5095 }
    +
    5096 }
    +
    5097 };
    +
    5098
    +
    5102 class http_media_range : public parser
    +
    5103 {
    +
    5104 public:
    +
    5105 virtual bool match(
    +
    5106 _In_reads_or_z_(end) const char* text,
    +
    5107 _In_ size_t start = 0,
    +
    5108 _In_ size_t end = (size_t)-1,
    +
    5109 _In_ int flags = match_default)
    +
    5110 {
    +
    5111 assert(text || start >= end);
    +
    5112 interval.end = start;
    +
    5113 if (type.match(text, interval.end, end, flags))
    +
    5114 interval.end = type.interval.end;
    +
    5115 else
    +
    5116 goto error;
    +
    5117 while (m_space.match(text, interval.end, end, flags))
    +
    5118 interval.end = m_space.interval.end;
    +
    5119 if (interval.end < end && text[interval.end] == '/')
    +
    5120 interval.end++;
    +
    5121 else
    +
    5122 goto error;
    +
    5123 while (m_space.match(text, interval.end, end, flags))
    +
    5124 interval.end = m_space.interval.end;
    +
    5125 if (subtype.match(text, interval.end, end, flags))
    +
    5126 interval.end = subtype.interval.end;
    +
    5127 else
    +
    5128 goto error;
    +
    5129 interval.start = start;
    +
    5130 return true;
    +
    5131
    +
    5132 error:
    +
    5133 type.invalidate();
    +
    5134 subtype.invalidate();
    +
    5135 interval.start = (interval.end = start) + 1;
    +
    5136 return false;
    +
    5137 }
    +
    5138
    +
    5139 virtual void invalidate()
    +
    5140 {
    +
    5141 type.invalidate();
    +
    5142 subtype.invalidate();
    +
    5143 parser::invalidate();
    +
    5144 }
    +
    5145
    +
    5146 public:
    +
    5147 http_token type;
    +
    5148 http_token subtype;
    +
    5149
    +
    5150 protected:
    +
    5151 http_space m_space;
    +
    5152 };
    +
    5153
    +
    5157 class http_media_type : public http_media_range
    +
    5158 {
    +
    5159 public:
    +
    5160 virtual bool match(
    +
    5161 _In_reads_or_z_(end) const char* text,
    +
    5162 _In_ size_t start = 0,
    +
    5163 _In_ size_t end = (size_t)-1,
    +
    5164 _In_ int flags = match_default)
    +
    5165 {
    +
    5166 assert(text || start >= end);
    +
    5167 if (!http_media_range::match(text, start, end, flags))
    +
    5168 goto error;
    +
    5169 params.clear();
    +
    5170 for (;;) {
    +
    5171 if (interval.end < end && text[interval.end]) {
    +
    5172 if (m_space.match(text, interval.end, end, flags))
    +
    5173 interval.end = m_space.interval.end;
    +
    5174 else if (text[interval.end] == ';') {
    +
    5175 interval.end++;
    +
    5176 while (m_space.match(text, interval.end, end, flags))
    +
    5177 interval.end = m_space.interval.end;
    +
    5178 http_parameter param;
    +
    5179 if (param.match(text, interval.end, end, flags)) {
    +
    5180 interval.end = param.interval.end;
    +
    5181 params.push_back(std::move(param));
    +
    5182 }
    +
    5183 else
    +
    5184 break;
    +
    5185 }
    +
    5186 else
    +
    5187 break;
    +
    5188 }
    +
    5189 else
    +
    5190 break;
    +
    5191 }
    +
    5192 interval.end = params.empty() ? subtype.interval.end : params.back().interval.end;
    +
    5193 return true;
    +
    5194
    +
    5195 error:
    +
    5196 http_media_range::invalidate();
    +
    5197 params.clear();
    +
    5198 interval.start = (interval.end = start) + 1;
    +
    5199 return false;
    +
    5200 }
    +
    5201
    +
    5202 virtual void invalidate()
    +
    5203 {
    +
    5204 params.clear();
    +
    5205 http_media_range::invalidate();
    +
    5206 }
    +
    5207
    +
    5208 public:
    +
    5209 std::list<http_parameter> params;
    +
    5210 };
    +
    5211
    +
    5215 class http_url_server : public parser
    +
    5216 {
    +
    5217 public:
    +
    5218 virtual bool match(
    +
    5219 _In_reads_or_z_(end) const char* text,
    +
    5220 _In_ size_t start = 0,
    +
    5221 _In_ size_t end = (size_t)-1,
    +
    5222 _In_ int flags = match_default)
    +
    5223 {
    +
    5224 assert(text || start >= end);
    +
    5225 interval.end = start;
    +
    5226 for (;;) {
    +
    5227 if (interval.end < end && text[interval.end]) {
    +
    5228 if ((unsigned int)text[interval.end] < 0x20 ||
    +
    5229 (unsigned int)text[interval.end] == 0x7f ||
    +
    5230 text[interval.end] == ':' ||
    +
    5231 text[interval.end] == '/' ||
    +
    5232 isspace(text[interval.end]))
    +
    5233 break;
    +
    5234 else
    +
    5235 interval.end++;
    +
    5236 }
    +
    5237 else
    +
    5238 break;
    +
    5239 }
    +
    5240 if (start < interval.end) {
    +
    5241 interval.start = start;
    +
    5242 return true;
    +
    5243 }
    +
    5244 interval.start = (interval.end = start) + 1;
    +
    5245 return false;
    +
    5246 }
    +
    5247 };
    +
    5248
    +
    5252 class http_url_port : public parser
    +
    5253 {
    +
    5254 public:
    +
    5255 http_url_port(_In_ const std::locale& locale = std::locale()) :
    +
    5256 parser(locale),
    +
    5257 value(0)
    +
    5258 {}
    +
    5259
    +
    5260 virtual bool match(
    +
    5261 _In_reads_or_z_(end) const char* text,
    +
    5262 _In_ size_t start = 0,
    +
    5263 _In_ size_t end = (size_t)-1,
    +
    5264 _In_ int flags = match_default)
    +
    5265 {
    +
    5266 assert(text || start >= end);
    +
    5267 value = 0;
    +
    5268 interval.end = start;
    +
    5269 for (;;) {
    +
    5270 if (interval.end < end && text[interval.end]) {
    +
    5271 if ('0' <= text[interval.end] && text[interval.end] <= '9') {
    +
    5272 size_t _value = (size_t)value * 10 + text[interval.end] - '0';
    +
    5273 if (_value > (uint16_t)-1) {
    +
    5274 value = 0;
    +
    5275 interval.start = (interval.end = start) + 1;
    +
    5276 return false;
    +
    5277 }
    +
    5278 value = (uint16_t)_value;
    +
    5279 interval.end++;
    +
    5280 }
    +
    5281 else
    +
    5282 break;
    +
    5283 }
    +
    5284 else
    +
    5285 break;
    +
    5286 }
    +
    5287 if (start < interval.end) {
    +
    5288 interval.start = start;
    +
    5289 return true;
    +
    5290 }
    +
    5291 interval.start = (interval.end = start) + 1;
    +
    5292 return false;
    +
    5293 }
    +
    5294
    +
    5295 virtual void invalidate()
    +
    5296 {
    +
    5297 value = 0;
    +
    5298 parser::invalidate();
    +
    5299 }
    +
    5300
    +
    5301 public:
    +
    5302 uint16_t value;
    +
    5303 };
    +
    5304
    +
    5308 class http_url_path_segment : public parser
    +
    5309 {
    +
    5310 public:
    +
    5311 virtual bool match(
    +
    5312 _In_reads_or_z_(end) const char* text,
    +
    5313 _In_ size_t start = 0,
    +
    5314 _In_ size_t end = (size_t)-1,
    +
    5315 _In_ int flags = match_default)
    +
    5316 {
    +
    5317 assert(text || start >= end);
    +
    5318 interval.end = start;
    +
    5319 for (;;) {
    +
    5320 if (interval.end < end && text[interval.end]) {
    +
    5321 if ((unsigned int)text[interval.end] < 0x20 ||
    +
    5322 (unsigned int)text[interval.end] == 0x7f ||
    +
    5323 text[interval.end] == '?' ||
    +
    5324 text[interval.end] == '/' ||
    +
    5325 isspace(text[interval.end]))
    +
    5326 break;
    +
    5327 else
    +
    5328 interval.end++;
    +
    5329 }
    +
    5330 else
    +
    5331 break;
    +
    5332 }
    +
    5333 interval.start = start;
    +
    5334 return true;
    +
    5335 }
    +
    5336 };
    +
    5337
    +
    5341 class http_url_path : public parser
    +
    5342 {
    +
    5343 public:
    +
    5344 virtual bool match(
    +
    5345 _In_reads_or_z_(end) const char* text,
    +
    5346 _In_ size_t start = 0,
    +
    5347 _In_ size_t end = (size_t)-1,
    +
    5348 _In_ int flags = match_default)
    +
    5349 {
    +
    5350 assert(text || start >= end);
    +
    5351 http_url_path_segment s;
    +
    5352 interval.end = start;
    +
    5353 segments.clear();
    +
    5354 assert(text || interval.end >= end);
    +
    5355 if (interval.end < end && text[interval.end] != '/')
    +
    5356 goto error;
    +
    5357 interval.end++;
    +
    5358 s.match(text, interval.end, end, flags);
    +
    5359 segments.push_back(s);
    +
    5360 interval.end = s.interval.end;
    +
    5361 for (;;) {
    +
    5362 if (interval.end < end && text[interval.end]) {
    +
    5363 if (text[interval.end] == '/') {
    +
    5364 interval.end++;
    +
    5365 s.match(text, interval.end, end, flags);
    +
    5366 segments.push_back(s);
    +
    5367 interval.end = s.interval.end;
    +
    5368 }
    +
    5369 else
    +
    5370 break;
    +
    5371 }
    +
    5372 else
    +
    5373 break;
    +
    5374 }
    +
    5375 interval.start = start;
    +
    5376 return true;
    +
    5377
    +
    5378 error:
    +
    5379 segments.clear();
    +
    5380 interval.start = (interval.end = start) + 1;
    +
    5381 return false;
    +
    5382 }
    +
    5383
    +
    5384 virtual void invalidate()
    +
    5385 {
    +
    5386 segments.clear();
    +
    5387 parser::invalidate();
    +
    5388 }
    +
    5389
    +
    5390 public:
    +
    5391 std::vector<http_url_path_segment> segments;
    +
    5392 };
    +
    5393
    +
    5397 class http_url_parameter : public parser
    +
    5398 {
    +
    5399 public:
    +
    5400 virtual bool match(
    +
    5401 _In_reads_or_z_(end) const char* text,
    +
    5402 _In_ size_t start = 0,
    +
    5403 _In_ size_t end = (size_t)-1,
    +
    5404 _In_ int flags = match_default)
    +
    5405 {
    +
    5406 assert(text || start >= end);
    +
    5407 interval.end = start;
    +
    5408 name.start = interval.end;
    +
    5409 for (;;) {
    +
    5410 if (interval.end < end && text[interval.end]) {
    +
    5411 if ((unsigned int)text[interval.end] < 0x20 ||
    +
    5412 (unsigned int)text[interval.end] == 0x7f ||
    +
    5413 text[interval.end] == '&' ||
    +
    5414 text[interval.end] == '=' ||
    +
    5415 isspace(text[interval.end]))
    +
    5416 break;
    +
    5417 else
    +
    5418 interval.end++;
    +
    5419 }
    +
    5420 else
    +
    5421 break;
    +
    5422 }
    +
    5423 if (start < interval.end)
    +
    5424 name.end = interval.end;
    +
    5425 else
    +
    5426 goto error;
    +
    5427 if (text[interval.end] == '=') {
    +
    5428 interval.end++;
    +
    5429 value.start = interval.end;
    +
    5430 for (;;) {
    +
    5431 if (interval.end < end && text[interval.end]) {
    +
    5432 if ((unsigned int)text[interval.end] < 0x20 ||
    +
    5433 (unsigned int)text[interval.end] == 0x7f ||
    +
    5434 text[interval.end] == '&' ||
    +
    5435 isspace(text[interval.end]))
    +
    5436 break;
    +
    5437 else
    +
    5438 interval.end++;
    +
    5439 }
    +
    5440 else
    +
    5441 break;
    +
    5442 }
    +
    5443 value.end = interval.end;
    +
    5444 }
    +
    5445 else {
    +
    5446 value.start = 1;
    +
    5447 value.end = 0;
    +
    5448 }
    +
    5449 interval.start = start;
    +
    5450 return true;
    +
    5451
    +
    5452 error:
    +
    5453 name.start = 1;
    +
    5454 name.end = 0;
    +
    5455 value.start = 1;
    +
    5456 value.end = 0;
    +
    5457 interval.start = (interval.end = start) + 1;
    +
    5458 return false;
    +
    5459 }
    +
    5460
    +
    5461 virtual void invalidate()
    +
    5462 {
    +
    5463 name.start = 1;
    +
    5464 name.end = 0;
    +
    5465 value.start = 1;
    +
    5466 value.end = 0;
    +
    5467 parser::invalidate();
    +
    5468 }
    +
    5469
    +
    5470 public:
    +
    5471 stdex::interval<size_t> name;
    +
    5472 stdex::interval<size_t> value;
    +
    5473 };
    +
    5474
    +
    5478 class http_url : public parser
    +
    5479 {
    +
    5480 public:
    +
    5481 http_url(_In_ const std::locale& locale = std::locale()) :
    +
    5482 parser(locale),
    +
    5483 port(locale)
    +
    5484 {}
    +
    5485
    +
    5486 virtual bool match(
    +
    5487 _In_reads_or_z_(end) const char* text,
    +
    5488 _In_ size_t start = 0,
    +
    5489 _In_ size_t end = (size_t)-1,
    +
    5490 _In_ int flags = match_default)
    +
    5491 {
    +
    5492 assert(text || start >= end);
    +
    5493 interval.end = start;
    +
    5494
    +
    5495 if (interval.end + 7 <= end && stdex::strnicmp(text + interval.end, 7, "http://", (size_t)-1, m_locale) == 0) {
    +
    5496 interval.end += 7;
    +
    5497 if (server.match(text, interval.end, end, flags))
    +
    5498 interval.end = server.interval.end;
    +
    5499 else
    +
    5500 goto error;
    +
    5501 if (interval.end < end && text[interval.end] == ':') {
    +
    5502 interval.end++;
    +
    5503 if (port.match(text, interval.end, end, flags))
    +
    5504 interval.end = port.interval.end;
    +
    5505 }
    +
    5506 else {
    +
    5507 port.invalidate();
    +
    5508 port.value = 80;
    +
    5509 }
    +
    5510 }
    +
    5511 else {
    +
    5512 server.invalidate();
    +
    5513 port.invalidate();
    +
    5514 port.value = 80;
    +
    5515 }
    +
    5516
    +
    5517 if (path.match(text, interval.end, end, flags))
    +
    5518 interval.end = path.interval.end;
    +
    5519 else
    +
    5520 goto error;
    +
    5521
    +
    5522 params.clear();
    +
    5523
    +
    5524 if (interval.end < end && text[interval.end] == '?') {
    +
    5525 interval.end++;
    +
    5526 for (;;) {
    +
    5527 if (interval.end < end && text[interval.end]) {
    +
    5528 if ((unsigned int)text[interval.end] < 0x20 ||
    +
    5529 (unsigned int)text[interval.end] == 0x7f ||
    +
    5530 isspace(text[interval.end]))
    +
    5531 break;
    +
    5532 else if (text[interval.end] == '&')
    +
    5533 interval.end++;
    +
    5534 else {
    +
    5535 http_url_parameter param;
    +
    5536 if (param.match(text, interval.end, end, flags)) {
    +
    5537 interval.end = param.interval.end;
    +
    5538 params.push_back(std::move(param));
    +
    5539 }
    +
    5540 else
    +
    5541 break;
    +
    5542 }
    +
    5543 }
    +
    5544 else
    +
    5545 break;
    +
    5546 }
    +
    5547 }
    +
    5548
    +
    5549 interval.start = start;
    +
    5550 return true;
    +
    5551
    +
    5552 error:
    +
    5553 server.invalidate();
    +
    5554 port.invalidate();
    +
    5555 path.invalidate();
    +
    5556 params.clear();
    +
    5557 interval.start = (interval.end = start) + 1;
    +
    5558 return false;
    +
    5559 }
    +
    5560
    +
    5561 virtual void invalidate()
    +
    5562 {
    +
    5563 server.invalidate();
    +
    5564 port.invalidate();
    +
    5565 path.invalidate();
    +
    5566 params.clear();
    +
    5567 parser::invalidate();
    +
    5568 }
    +
    5569
    +
    5570 public:
    +
    5571 http_url_server server;
    +
    5572 http_url_port port;
    +
    5573 http_url_path path;
    +
    5574 std::list<http_url_parameter> params;
    +
    5575 };
    +
    5576
    +
    5580 class http_language : public parser
    +
    5581 {
    +
    5582 public:
    +
    5583 virtual bool match(
    +
    5584 _In_reads_or_z_(end) const char* text,
    +
    5585 _In_ size_t start = 0,
    +
    5586 _In_ size_t end = (size_t)-1,
    +
    5587 _In_ int flags = match_default)
    +
    5588 {
    +
    5589 assert(text || start >= end);
    +
    5590 interval.end = start;
    +
    5591 components.clear();
    +
    5592 for (;;) {
    +
    5593 if (interval.end < end && text[interval.end]) {
    +
    5594 stdex::interval<size_t> k;
    +
    5595 k.end = interval.end;
    +
    5596 for (;;) {
    +
    5597 if (k.end < end && text[k.end]) {
    +
    5598 if (isalpha(text[k.end]))
    +
    5599 k.end++;
    +
    5600 else
    +
    5601 break;
    +
    5602 }
    +
    5603 else
    +
    5604 break;
    +
    5605 }
    +
    5606 if (interval.end < k.end) {
    +
    5607 k.start = interval.end;
    +
    5608 interval.end = k.end;
    +
    5609 components.push_back(k);
    +
    5610 }
    +
    5611 else
    +
    5612 break;
    +
    5613 if (interval.end < end && text[interval.end] == '-')
    +
    5614 interval.end++;
    +
    5615 else
    +
    5616 break;
    +
    5617 }
    +
    5618 else
    +
    5619 break;
    +
    5620 }
    +
    5621 if (!components.empty()) {
    +
    5622 interval.start = start;
    +
    5623 interval.end = components.back().end;
    +
    5624 return true;
    +
    5625 }
    +
    5626 interval.start = (interval.end = start) + 1;
    +
    5627 return false;
    +
    5628 }
    +
    5629
    +
    5630 virtual void invalidate()
    +
    5631 {
    +
    5632 components.clear();
    +
    5633 parser::invalidate();
    +
    5634 }
    +
    5635
    +
    5636 public:
    +
    5637 std::vector<stdex::interval<size_t>> components;
    +
    5638 };
    +
    5639
    +
    5643 class http_weight : public parser
    +
    5644 {
    +
    5645 public:
    +
    5646 http_weight(_In_ const std::locale& locale = std::locale()) :
    +
    5647 parser(locale),
    +
    5648 value(1.0f)
    +
    5649 {}
    +
    5650
    +
    5651 virtual bool match(
    +
    5652 _In_reads_or_z_(end) const char* text,
    +
    5653 _In_ size_t start = 0,
    +
    5654 _In_ size_t end = (size_t)-1,
    +
    5655 _In_ int flags = match_default)
    +
    5656 {
    +
    5657 assert(text || start >= end);
    +
    5658 size_t celi_del = 0, decimalni_del = 0, decimalni_del_n = 1;
    +
    5659 interval.end = start;
    +
    5660 for (;;) {
    +
    5661 if (interval.end < end && text[interval.end]) {
    +
    5662 if ('0' <= text[interval.end] && text[interval.end] <= '9') {
    +
    5663 celi_del = celi_del * 10 + text[interval.end] - '0';
    +
    5664 interval.end++;
    +
    5665 }
    +
    5666 else if (text[interval.end] == '.') {
    +
    5667 interval.end++;
    +
    5668 for (;;) {
    +
    5669 if (interval.end < end && text[interval.end]) {
    +
    5670 if ('0' <= text[interval.end] && text[interval.end] <= '9') {
    +
    5671 decimalni_del = decimalni_del * 10 + text[interval.end] - '0';
    +
    5672 decimalni_del_n *= 10;
    +
    5673 interval.end++;
    +
    5674 }
    +
    5675 else
    +
    5676 break;
    +
    5677 }
    +
    5678 else
    +
    5679 break;
    +
    5680 }
    +
    5681 break;
    +
    5682 }
    +
    5683 else
    +
    5684 break;
    +
    5685 }
    +
    5686 else
    +
    5687 break;
    +
    5688 }
    +
    5689 if (start < interval.end) {
    +
    5690 value = (float)((double)celi_del + (double)decimalni_del / decimalni_del_n);
    +
    5691 interval.start = start;
    +
    5692 return true;
    +
    5693 }
    +
    5694 value = 1.0f;
    +
    5695 interval.start = (interval.end = start) + 1;
    +
    5696 return false;
    +
    5697 }
    +
    5698
    +
    5699 virtual void invalidate()
    +
    5700 {
    +
    5701 value = 1.0f;
    +
    5702 parser::invalidate();
    +
    5703 }
    +
    5704
    +
    5705 public:
    +
    5706 float value;
    +
    5707 };
    +
    5708
    +
    5712 class http_asterisk : public parser
    +
    5713 {
    +
    5714 public:
    +
    5715 virtual bool match(
    +
    5716 _In_reads_or_z_(end) const char* text,
    +
    5717 _In_ size_t start = 0,
    +
    5718 _In_ size_t end = (size_t)-1,
    +
    5719 _In_ int flags = match_default)
    +
    5720 {
    +
    5721 assert(text || end <= start);
    +
    5722 if (start < end && text[start] == '*') {
    +
    5723 interval.end = (interval.start = start) + 1;
    +
    5724 return true;
    +
    5725 }
    +
    5726 interval.start = (interval.end = start) + 1;
    +
    5727 return false;
    +
    5728 }
    +
    5729 };
    +
    5730
    +
    5734 template <class T, class T_asterisk = http_asterisk>
    +
    5735 class http_weighted_value : public parser
    +
    5736 {
    +
    5737 public:
    +
    5738 http_weighted_value(_In_ const std::locale& locale = std::locale()) :
    +
    5739 parser(locale),
    +
    5740 factor(locale)
    +
    5741 {}
    +
    5742
    +
    5743 virtual bool match(
    +
    5744 _In_reads_or_z_(end) const char* text,
    +
    5745 _In_ size_t start = 0,
    +
    5746 _In_ size_t end = (size_t)-1,
    +
    5747 _In_ int flags = match_default)
    +
    5748 {
    +
    5749 assert(text || start >= end);
    +
    5750 size_t konec_vrednosti;
    +
    5751 interval.end = start;
    +
    5752 if (asterisk.match(text, interval.end, end, flags)) {
    +
    5753 interval.end = konec_vrednosti = asterisk.interval.end;
    +
    5754 value.invalidate();
    +
    5755 }
    +
    5756 else if (value.match(text, interval.end, end, flags)) {
    +
    5757 interval.end = konec_vrednosti = value.interval.end;
    +
    5758 asterisk.invalidate();
    +
    5759 }
    +
    5760 else {
    +
    5761 asterisk.invalidate();
    +
    5762 value.invalidate();
    +
    5763 interval.start = (interval.end = start) + 1;
    +
    5764 return false;
    +
    5765 }
    +
    5766
    +
    5767 while (interval.end < end && text[interval.end] && isspace(text[interval.end])) interval.end++;
    +
    5768 if (interval.end < end && text[interval.end] == ';') {
    +
    5769 interval.end++;
    +
    5770 while (interval.end < end && text[interval.end] && isspace(text[interval.end])) interval.end++;
    +
    5771 if (interval.end < end && (text[interval.end] == 'q' || text[interval.end] == 'Q')) {
    +
    5772 interval.end++;
    +
    5773 while (interval.end < end && text[interval.end] && isspace(text[interval.end])) interval.end++;
    +
    5774 if (interval.end < end && text[interval.end] == '=') {
    +
    5775 interval.end++;
    +
    5776 while (interval.end < end && text[interval.end] && isspace(text[interval.end])) interval.end++;
    +
    5777 if (factor.match(text, interval.end, end, flags))
    +
    5778 interval.end = factor.interval.end;
    +
    5779 }
    +
    5780 }
    +
    5781 }
    +
    5782 if (!factor.interval) {
    +
    5783 factor.invalidate();
    +
    5784 interval.end = konec_vrednosti;
    +
    5785 }
    +
    5786 interval.start = start;
    +
    5787 return true;
    +
    5788 }
    +
    5789
    +
    5790 virtual void invalidate()
    +
    5791 {
    +
    5792 asterisk.invalidate();
    +
    5793 value.invalidate();
    +
    5794 factor.invalidate();
    +
    5795 parser::invalidate();
    +
    5796 }
    +
    5797
    +
    5798 public:
    +
    5799 T_asterisk asterisk;
    +
    5800 T value;
    +
    5801 http_weight factor;
    +
    5802 };
    +
    5803
    +
    5807 class http_cookie_parameter : public parser
    +
    5808 {
    +
    5809 public:
    +
    5810 virtual bool match(
    +
    5811 _In_reads_or_z_(end) const char* text,
    +
    5812 _In_ size_t start = 0,
    +
    5813 _In_ size_t end = (size_t)-1,
    +
    5814 _In_ int flags = match_default)
    +
    5815 {
    +
    5816 assert(text || start >= end);
    +
    5817 interval.end = start;
    +
    5818 if (interval.end < end && text[interval.end] == '$')
    +
    5819 interval.end++;
    +
    5820 else
    +
    5821 goto error;
    +
    5822 if (name.match(text, interval.end, end, flags))
    +
    5823 interval.end = name.interval.end;
    +
    5824 else
    +
    5825 goto error;
    +
    5826 while (m_space.match(text, interval.end, end, flags))
    +
    5827 interval.end = m_space.interval.end;
    +
    5828 if (interval.end < end && text[interval.end] == '=')
    +
    5829 interval.end++;
    +
    5830 else
    +
    5831 goto error;
    +
    5832 while (m_space.match(text, interval.end, end, flags))
    +
    5833 interval.end = m_space.interval.end;
    +
    5834 if (value.match(text, interval.end, end, flags))
    +
    5835 interval.end = value.interval.end;
    +
    5836 else
    +
    5837 goto error;
    +
    5838 interval.start = start;
    +
    5839 return true;
    +
    5840
    +
    5841 error:
    +
    5842 name.invalidate();
    +
    5843 value.invalidate();
    +
    5844 interval.start = (interval.end = start) + 1;
    +
    5845 return false;
    +
    5846 }
    +
    5847
    +
    5848 virtual void invalidate()
    +
    5849 {
    +
    5850 name.invalidate();
    +
    5851 value.invalidate();
    +
    5852 parser::invalidate();
    +
    5853 }
    +
    5854
    +
    5855 public:
    +
    5856 http_token name;
    +
    5857 http_value value;
    +
    5858
    +
    5859 protected:
    +
    5860 http_space m_space;
    +
    5861 };
    +
    5862
    +
    5866 class http_cookie : public parser
    +
    5867 {
    +
    5868 public:
    +
    5869 virtual bool match(
    +
    5870 _In_reads_or_z_(end) const char* text,
    +
    5871 _In_ size_t start = 0,
    +
    5872 _In_ size_t end = (size_t)-1,
    +
    5873 _In_ int flags = match_default)
    +
    5874 {
    +
    5875 assert(text || start >= end);
    +
    5876 interval.end = start;
    +
    5877 if (name.match(text, interval.end, end, flags))
    +
    5878 interval.end = name.interval.end;
    +
    5879 else
    +
    5880 goto error;
    +
    5881 while (m_space.match(text, interval.end, end, flags))
    +
    5882 interval.end = m_space.interval.end;
    +
    5883 if (interval.end < end && text[interval.end] == '=')
    +
    5884 interval.end++;
    +
    5885 else
    +
    5886 goto error;
    +
    5887 while (m_space.match(text, interval.end, end, flags))
    +
    5888 interval.end = m_space.interval.end;
    +
    5889 if (value.match(text, interval.end, end, flags))
    +
    5890 interval.end = value.interval.end;
    +
    5891 else
    +
    5892 goto error;
    +
    5893 params.clear();
    +
    5894 for (;;) {
    +
    5895 if (interval.end < end && text[interval.end]) {
    +
    5896 if (m_space.match(text, interval.end, end, flags))
    +
    5897 interval.end = m_space.interval.end;
    +
    5898 else if (text[interval.end] == ';') {
    +
    5899 interval.end++;
    +
    5900 while (m_space.match(text, interval.end, end, flags))
    +
    5901 interval.end = m_space.interval.end;
    +
    5902 http_cookie_parameter param;
    +
    5903 if (param.match(text, interval.end, end, flags)) {
    +
    5904 interval.end = param.interval.end;
    +
    5905 params.push_back(std::move(param));
    +
    5906 }
    +
    5907 else
    +
    5908 break;
    +
    5909 }
    +
    5910 else
    +
    5911 break;
    +
    5912 }
    +
    5913 else
    +
    5914 break;
    +
    5915 }
    +
    5916 interval.start = start;
    +
    5917 interval.end = params.empty() ? value.interval.end : params.back().interval.end;
    +
    5918 return true;
    +
    5919
    +
    5920 error:
    +
    5921 name.invalidate();
    +
    5922 value.invalidate();
    +
    5923 params.clear();
    +
    5924 interval.start = (interval.end = start) + 1;
    +
    5925 return false;
    +
    5926 }
    +
    5927
    +
    5928 virtual void invalidate()
    +
    5929 {
    +
    5930 name.invalidate();
    +
    5931 value.invalidate();
    +
    5932 params.clear();
    +
    5933 parser::invalidate();
    +
    5934 }
    +
    5935
    +
    5936 public:
    +
    5937 http_token name;
    +
    5938 http_value value;
    +
    5939 std::list<http_cookie_parameter> params;
    +
    5940
    +
    5941 protected:
    +
    5942 http_space m_space;
    +
    5943 };
    +
    5944
    +
    5948 class http_agent : public parser
    +
    5949 {
    +
    5950 public:
    +
    5951 virtual bool match(
    +
    5952 _In_reads_or_z_(end) const char* text,
    +
    5953 _In_ size_t start = 0,
    +
    5954 _In_ size_t end = (size_t)-1,
    +
    5955 _In_ int flags = match_default)
    +
    5956 {
    +
    5957 assert(text || start >= end);
    +
    5958 interval.end = start;
    +
    5959 type.start = interval.end;
    +
    5960 for (;;) {
    +
    5961 if (interval.end < end && text[interval.end]) {
    +
    5962 if (text[interval.end] == '/') {
    +
    5963 type.end = interval.end;
    +
    5964 interval.end++;
    +
    5965 version.start = interval.end;
    +
    5966 for (;;) {
    +
    5967 if (interval.end < end && text[interval.end]) {
    +
    5968 if (isspace(text[interval.end])) {
    +
    5969 version.end = interval.end;
    +
    5970 break;
    +
    5971 }
    +
    5972 else
    +
    5973 interval.end++;
    +
    5974 }
    +
    5975 else {
    +
    5976 version.end = interval.end;
    +
    5977 break;
    +
    5978 }
    +
    5979 }
    +
    5980 break;
    +
    5981 }
    +
    5982 else if (isspace(text[interval.end])) {
    +
    5983 type.end = interval.end;
    +
    5984 break;
    +
    5985 }
    +
    5986 else
    +
    5987 interval.end++;
    +
    5988 }
    +
    5989 else {
    +
    5990 type.end = interval.end;
    +
    5991 break;
    +
    5992 }
    +
    5993 }
    +
    5994 if (start < interval.end) {
    +
    5995 interval.start = start;
    +
    5996 return true;
    +
    5997 }
    +
    5998 type.start = 1;
    +
    5999 type.end = 0;
    +
    6000 version.start = 1;
    +
    6001 version.end = 0;
    +
    6002 interval.start = 1;
    +
    6003 interval.end = 0;
    +
    6004 return false;
    +
    6005 }
    +
    6006
    +
    6007 virtual void invalidate()
    +
    6008 {
    +
    6009 type.start = 1;
    +
    6010 type.end = 0;
    +
    6011 version.start = 1;
    +
    6012 version.end = 0;
    +
    6013 parser::invalidate();
    +
    6014 }
    +
    6015
    +
    6016 public:
    +
    6017 stdex::interval<size_t> type;
    +
    6018 stdex::interval<size_t> version;
    +
    6019 };
    +
    6020
    +
    6024 class http_protocol : public parser
    +
    6025 {
    +
    6026 public:
    +
    6027 http_protocol(_In_ const std::locale& locale = std::locale()) :
    +
    6028 parser(locale),
    +
    6029 version(0x009)
    +
    6030 {}
    +
    6031
    +
    6032 virtual bool match(
    +
    6033 _In_reads_or_z_(end) const char* text,
    +
    6034 _In_ size_t start = 0,
    +
    6035 _In_ size_t end = (size_t)-1,
    +
    6036 _In_ int flags = match_default)
    +
    6037 {
    +
    6038 assert(text || start >= end);
    +
    6039 interval.end = start;
    +
    6040 type.start = interval.end;
    +
    6041 for (;;) {
    +
    6042 if (interval.end < end && text[interval.end]) {
    +
    6043 if (text[interval.end] == '/') {
    +
    6044 type.end = interval.end;
    +
    6045 interval.end++;
    +
    6046 break;
    +
    6047 }
    +
    6048 else if (isspace(text[interval.end]))
    +
    6049 goto error;
    +
    6050 else
    +
    6051 interval.end++;
    +
    6052 }
    +
    6053 else {
    +
    6054 type.end = interval.end;
    +
    6055 goto error;
    +
    6056 }
    +
    6057 }
    +
    6058 version_maj.start = interval.end;
    +
    6059 for (;;) {
    +
    6060 if (interval.end < end && text[interval.end]) {
    +
    6061 if (text[interval.end] == '.') {
    +
    6062 version_maj.end = interval.end;
    +
    6063 interval.end++;
    +
    6064 version_min.start = interval.end;
    +
    6065 for (;;) {
    +
    6066 if (interval.end < end && text[interval.end]) {
    +
    6067 if (isspace(text[interval.end])) {
    +
    6068 version_min.end = interval.end;
    +
    6069 version =
    +
    6070 (uint16_t)strtoui(text + version_maj.start, version_maj.size(), nullptr, 10) * 0x100 +
    +
    6071 (uint16_t)strtoui(text + version_min.start, version_min.size(), nullptr, 10);
    +
    6072 break;
    +
    6073 }
    +
    6074 else
    +
    6075 interval.end++;
    +
    6076 }
    +
    6077 else
    +
    6078 goto error;
    +
    6079 }
    +
    6080 break;
    +
    6081 }
    +
    6082 else if (isspace(text[interval.end])) {
    +
    6083 version_maj.end = interval.end;
    +
    6084 version_min.start = 1;
    +
    6085 version_min.end = 0;
    +
    6086 version = (uint16_t)strtoui(text + version_maj.start, version_maj.size(), nullptr, 10) * 0x100;
    +
    6087 break;
    +
    6088 }
    +
    6089 else
    +
    6090 interval.end++;
    +
    6091 }
    +
    6092 else
    +
    6093 goto error;
    +
    6094 }
    +
    6095 interval.start = start;
    +
    6096 return true;
    +
    6097
    +
    6098 error:
    +
    6099 type.start = 1;
    +
    6100 type.end = 0;
    +
    6101 version_maj.start = 1;
    +
    6102 version_maj.end = 0;
    +
    6103 version_min.start = 1;
    +
    6104 version_min.end = 0;
    +
    6105 version = 0x009;
    +
    6106 interval.start = 1;
    +
    6107 interval.end = 0;
    +
    6108 return false;
    +
    6109 }
    +
    6110
    +
    6111 virtual void invalidate()
    +
    6112 {
    +
    6113 type.start = 1;
    +
    6114 type.end = 0;
    +
    6115 version_maj.start = 1;
    +
    6116 version_maj.end = 0;
    +
    6117 version_min.start = 1;
    +
    6118 version_min.end = 0;
    +
    6119 version = 0x009;
    +
    6120 parser::invalidate();
    +
    6121 }
    +
    6122
    +
    6123 public:
    +
    6124 stdex::interval<size_t> type;
    +
    6125 stdex::interval<size_t> version_maj;
    +
    6126 stdex::interval<size_t> version_min;
    +
    6127 uint16_t version;
    +
    6128 };
    +
    6129
    +
    6133 class http_request : public parser
    +
    6134 {
    +
    6135 public:
    +
    6136 http_request(_In_ const std::locale& locale = std::locale()) :
    +
    6137 parser(locale),
    +
    6138 url(locale),
    +
    6139 protocol(locale)
    +
    6140 {}
    +
    6141
    +
    6142 virtual bool match(
    +
    6143 _In_reads_or_z_(end) const char* text,
    +
    6144 _In_ size_t start = 0,
    +
    6145 _In_ size_t end = (size_t)-1,
    +
    6146 _In_ int flags = match_default)
    +
    6147 {
    +
    6148 assert(text || start >= end);
    +
    6149 interval.end = start;
    +
    6150
    +
    6151 for (;;) {
    +
    6152 if (m_line_break.match(text, interval.end, end, flags))
    +
    6153 goto error;
    +
    6154 else if (interval.end < end && text[interval.end]) {
    +
    6155 if (isspace(text[interval.end]))
    +
    6156 interval.end++;
    +
    6157 else
    +
    6158 break;
    +
    6159 }
    +
    6160 else
    +
    6161 goto error;
    +
    6162 }
    +
    6163 verb.start = interval.end;
    +
    6164 for (;;) {
    +
    6165 if (m_line_break.match(text, interval.end, end, flags))
    +
    6166 goto error;
    +
    6167 else if (interval.end < end && text[interval.end]) {
    +
    6168 if (isspace(text[interval.end])) {
    +
    6169 verb.end = interval.end;
    +
    6170 interval.end++;
    +
    6171 break;
    +
    6172 }
    +
    6173 else
    +
    6174 interval.end++;
    +
    6175 }
    +
    6176 else
    +
    6177 goto error;
    +
    6178 }
    +
    6179
    +
    6180 for (;;) {
    +
    6181 if (m_line_break.match(text, interval.end, end, flags))
    +
    6182 goto error;
    +
    6183 else if (interval.end < end && text[interval.end]) {
    +
    6184 if (isspace(text[interval.end]))
    +
    6185 interval.end++;
    +
    6186 else
    +
    6187 break;
    +
    6188 }
    +
    6189 else
    +
    6190 goto error;
    +
    6191 }
    +
    6192 if (url.match(text, interval.end, end, flags))
    +
    6193 interval.end = url.interval.end;
    +
    6194 else
    +
    6195 goto error;
    +
    6196
    +
    6197 protocol.invalidate();
    +
    6198 for (;;) {
    +
    6199 if (m_line_break.match(text, interval.end, end, flags)) {
    +
    6200 interval.end = m_line_break.interval.end;
    +
    6201 goto end;
    +
    6202 }
    +
    6203 else if (interval.end < end && text[interval.end]) {
    +
    6204 if (isspace(text[interval.end]))
    +
    6205 interval.end++;
    +
    6206 else
    +
    6207 break;
    +
    6208 }
    +
    6209 else
    +
    6210 goto end;
    +
    6211 }
    +
    6212 for (;;) {
    +
    6213 if (m_line_break.match(text, interval.end, end, flags)) {
    +
    6214 interval.end = m_line_break.interval.end;
    +
    6215 goto end;
    +
    6216 }
    +
    6217 else if (protocol.match(text, interval.end, end, flags)) {
    +
    6218 interval.end = protocol.interval.end;
    +
    6219 break;
    +
    6220 }
    +
    6221 else
    +
    6222 goto end;
    +
    6223 }
    +
    6224
    +
    6225 for (;;) {
    +
    6226 if (m_line_break.match(text, interval.end, end, flags)) {
    +
    6227 interval.end = m_line_break.interval.end;
    +
    6228 break;
    +
    6229 }
    +
    6230 else if (interval.end < end && text[interval.end])
    +
    6231 interval.end++;
    +
    6232 else
    +
    6233 goto end;
    +
    6234 }
    +
    6235
    +
    6236 end:
    +
    6237 interval.start = start;
    +
    6238 return true;
    +
    6239
    +
    6240 error:
    +
    6241 verb.start = 1;
    +
    6242 verb.end = 0;
    +
    6243 url.invalidate();
    +
    6244 protocol.invalidate();
    +
    6245 interval.start = 1;
    +
    6246 interval.end = 0;
    +
    6247 return false;
    +
    6248 }
    +
    6249
    +
    6250 virtual void invalidate()
    +
    6251 {
    +
    6252 verb.start = 1;
    +
    6253 verb.end = 0;
    +
    6254 url.invalidate();
    +
    6255 protocol.invalidate();
    +
    6256 parser::invalidate();
    +
    6257 }
    +
    6258
    +
    6259 public:
    +
    6260 stdex::interval<size_t> verb;
    +
    6261 http_url url;
    +
    6262 http_protocol protocol;
    +
    6263
    +
    6264 protected:
    +
    6265 http_line_break m_line_break;
    +
    6266 };
    +
    6267
    +
    6271 class http_header : public parser
    +
    6272 {
    +
    6273 public:
    +
    6274 virtual bool match(
    +
    6275 _In_reads_or_z_(end) const char* text,
    +
    6276 _In_ size_t start = 0,
    +
    6277 _In_ size_t end = (size_t)-1,
    +
    6278 _In_ int flags = match_default)
    +
    6279 {
    +
    6280 assert(text || start >= end);
    +
    6281 interval.end = start;
    +
    6282
    +
    6283 if (m_line_break.match(text, interval.end, end, flags) ||
    +
    6284 interval.end < end && text[interval.end] && isspace(text[interval.end]))
    +
    6285 goto error;
    +
    6286 name.start = interval.end;
    +
    6287 for (;;) {
    +
    6288 if (m_line_break.match(text, interval.end, end, flags))
    +
    6289 goto error;
    +
    6290 else if (interval.end < end && text[interval.end]) {
    +
    6291 if (isspace(text[interval.end])) {
    +
    6292 name.end = interval.end;
    +
    6293 interval.end++;
    +
    6294 for (;;) {
    +
    6295 if (m_line_break.match(text, interval.end, end, flags))
    +
    6296 goto error;
    +
    6297 else if (interval.end < end && text[interval.end]) {
    +
    6298 if (isspace(text[interval.end]))
    +
    6299 interval.end++;
    +
    6300 else
    +
    6301 break;
    +
    6302 }
    +
    6303 else
    +
    6304 goto error;
    +
    6305 }
    +
    6306 if (interval.end < end && text[interval.end] == ':') {
    +
    6307 interval.end++;
    +
    6308 break;
    +
    6309 }
    +
    6310 else
    +
    6311 goto error;
    +
    6312 break;
    +
    6313 }
    +
    6314 else if (text[interval.end] == ':') {
    +
    6315 name.end = interval.end;
    +
    6316 interval.end++;
    +
    6317 break;
    +
    6318 }
    +
    6319 else
    +
    6320 interval.end++;
    +
    6321 }
    +
    6322 else
    +
    6323 goto error;
    +
    6324 }
    +
    6325 value.start = (size_t)-1;
    +
    6326 value.end = 0;
    +
    6327 for (;;) {
    +
    6328 if (m_line_break.match(text, interval.end, end, flags)) {
    +
    6329 interval.end = m_line_break.interval.end;
    +
    6330 if (!m_line_break.match(text, interval.end, end, flags) &&
    +
    6331 interval.end < end && text[interval.end] && isspace(text[interval.end]))
    +
    6332 interval.end++;
    +
    6333 else
    +
    6334 break;
    +
    6335 }
    +
    6336 else if (interval.end < end && text[interval.end]) {
    +
    6337 if (isspace(text[interval.end]))
    +
    6338 interval.end++;
    +
    6339 else {
    +
    6340 if (value.start == (size_t)-1) value.start = interval.end;
    +
    6341 value.end = ++interval.end;
    +
    6342 }
    +
    6343 }
    +
    6344 else
    +
    6345 break;
    +
    6346 }
    +
    6347 interval.start = start;
    +
    6348 return true;
    +
    6349
    +
    6350 error:
    +
    6351 name.start = 1;
    +
    6352 name.end = 0;
    +
    6353 value.start = 1;
    +
    6354 value.end = 0;
    +
    6355 interval.start = 1;
    +
    6356 interval.end = 0;
    +
    6357 return false;
    +
    6358 }
    +
    6359
    +
    6360 virtual void invalidate()
    +
    6361 {
    +
    6362 name.start = 1;
    +
    6363 name.end = 0;
    +
    6364 value.start = 1;
    +
    6365 value.end = 0;
    +
    6366 parser::invalidate();
    +
    6367 }
    +
    6368
    +
    6369 public:
    +
    6370 stdex::interval<size_t> name;
    +
    6371 stdex::interval<size_t> value;
    +
    6372
    +
    6373 protected:
    +
    6374 http_line_break m_line_break;
    +
    6375 };
    +
    6376
    +
    6380 template <class T>
    +
    6381 class http_value_collection : public T
    +
    6382 {
    +
    6383 public:
    +
    6384 void insert(
    +
    6385 _In_reads_or_z_(end) const char* text,
    +
    6386 _In_ size_t start = 0,
    +
    6387 _In_ size_t end = (size_t)-1,
    +
    6388 _In_ int flags = match_default)
    +
    6389 {
    +
    6390 while (start < end) {
    +
    6391 while (start < end && text[start] && isspace(text[start])) start++;
    +
    6392 if (start < end && text[start] == ',') {
    +
    6393 start++;
    +
    6394 while (start < end&& text[start] && isspace(text[start])) start++;
    +
    6395 }
    +
    6396 T::key_type el;
    +
    6397 if (el.match(text, start, end, flags)) {
    +
    6398 start = el.interval.end;
    +
    6399 T::insert(std::move(el));
    +
    6400 }
    +
    6401 else
    +
    6402 break;
    +
    6403 }
    +
    6404 }
    +
    6405 };
    +
    6406
    +
    6407 template <class T>
    +
    6408 struct http_factor_more {
    +
    6409 constexpr bool operator()(const T& a, const T& b) const noexcept
    +
    6410 {
    +
    6411 return a.factor.value > b.factor.value;
    +
    6412 }
    +
    6413 };
    +
    6414
    +
    6418 template <class T, class _Alloc = std::allocator<T>>
    +
    6419 using http_weighted_collection = http_value_collection<std::multiset<T, http_factor_more<T>, _Alloc>>;
    +
    6420
    +
    6424 template <class T>
    +
    6425 class basic_json_string : public basic_parser<T>
    +
    6426 {
    +
    6427 public:
    +
    6428 basic_json_string(
    +
    6429 _In_ const std::shared_ptr<basic_parser<T>>& quote,
    +
    6430 _In_ const std::shared_ptr<basic_parser<T>>& chr,
    +
    6431 _In_ const std::shared_ptr<basic_parser<T>>& escape,
    +
    6432 _In_ const std::shared_ptr<basic_parser<T>>& sol,
    +
    6433 _In_ const std::shared_ptr<basic_parser<T>>& bs,
    +
    6434 _In_ const std::shared_ptr<basic_parser<T>>& ff,
    +
    6435 _In_ const std::shared_ptr<basic_parser<T>>& lf,
    +
    6436 _In_ const std::shared_ptr<basic_parser<T>>& cr,
    +
    6437 _In_ const std::shared_ptr<basic_parser<T>>& htab,
    +
    6438 _In_ const std::shared_ptr<basic_parser<T>>& uni,
    +
    6439 _In_ const std::shared_ptr<basic_integer16<T>>& hex,
    +
    6440 _In_ const std::locale& locale = std::locale()) :
    +
    6441 basic_parser<T>(locale),
    +
    6442 m_quote(quote),
    +
    6443 m_chr(chr),
    +
    6444 m_escape(escape),
    +
    6445 m_sol(sol),
    +
    6446 m_bs(bs),
    +
    6447 m_ff(ff),
    +
    6448 m_lf(lf),
    +
    6449 m_cr(cr),
    +
    6450 m_htab(htab),
    +
    6451 m_uni(uni),
    +
    6452 m_hex(hex)
    +
    6453 {}
    +
    6454
    +
    6455 virtual bool match(
    +
    6456 _In_reads_or_z_(end) const T* text,
    +
    6457 _In_ size_t start = 0,
    +
    6458 _In_ size_t end = (size_t)-1,
    +
    6459 _In_ int flags = match_default)
    +
    6460 {
    +
    6461 assert(text || start >= end);
    +
    6462 interval.end = start;
    +
    6463 if (m_quote->match(text, interval.end, end, flags)) {
    +
    6464 interval.end = m_quote->interval.end;
    +
    6465 value.clear();
    +
    6466 for (;;) {
    +
    6467 if (m_quote->match(text, interval.end, end, flags)) {
    +
    6468 interval.start = start;
    +
    6469 interval.end = m_quote->interval.end;
    +
    6470 return true;
    +
    6471 }
    +
    6472 if (m_escape->match(text, interval.end, end, flags)) {
    +
    6473 if (m_quote->match(text, m_escape->interval.end, end, flags)) {
    +
    6474 value += '"'; interval.end = m_quote->interval.end;
    +
    6475 continue;
    +
    6476 }
    +
    6477 if (m_sol->match(text, m_escape->interval.end, end, flags)) {
    +
    6478 value += '/'; interval.end = m_sol->interval.end;
    +
    6479 continue;
    +
    6480 }
    +
    6481 if (m_bs->match(text, m_escape->interval.end, end, flags)) {
    +
    6482 value += '\b'; interval.end = m_bs->interval.end;
    +
    6483 continue;
    +
    6484 }
    +
    6485 if (m_ff->match(text, m_escape->interval.end, end, flags)) {
    +
    6486 value += '\f'; interval.end = m_ff->interval.end;
    +
    6487 continue;
    +
    6488 }
    +
    6489 if (m_lf->match(text, m_escape->interval.end, end, flags)) {
    +
    6490 value += '\n'; interval.end = m_lf->interval.end;
    +
    6491 continue;
    +
    6492 }
    +
    6493 if (m_cr->match(text, m_escape->interval.end, end, flags)) {
    +
    6494 value += '\r'; interval.end = m_cr->interval.end;
    +
    6495 continue;
    +
    6496 }
    +
    6497 if (m_htab->match(text, m_escape->interval.end, end, flags)) {
    +
    6498 value += '\t'; interval.end = m_htab->interval.end;
    +
    6499 continue;
    +
    6500 }
    +
    6501 if (
    +
    6502 m_uni->match(text, m_escape->interval.end, end, flags) &&
    +
    6503 m_hex->match(text, m_uni->interval.end, std::min(m_uni->interval.end + 4, end), flags | match_case_insensitive) &&
    +
    6504 m_hex->interval.size() == 4 /* JSON requests 4-digit Unicode sequneces: \u.... */)
    +
    6505 {
    +
    6506 assert(m_hex->value <= 0xffff);
    +
    6507 if (sizeof(T) == 1) {
    +
    6508 if (m_hex->value > 0x7ff) {
    +
    6509 value += (T)(0xe0 | (m_hex->value >> 12) & 0x0f);
    +
    6510 value += (T)(0x80 | (m_hex->value >> 6) & 0x3f);
    +
    6511 value += (T)(0x80 | m_hex->value & 0x3f);
    +
    6512 }
    +
    6513 else if (m_hex->value > 0x7f) {
    +
    6514 value += (T)(0xc0 | (m_hex->value >> 6) & 0x1f);
    +
    6515 value += (T)(0x80 | m_hex->value & 0x3f);
    +
    6516 }
    +
    6517 else
    +
    6518 value += (T)(m_hex->value & 0x7f);
    +
    6519 }
    +
    6520 else
    +
    6521 value += (T)m_hex->value;
    +
    6522 interval.end = m_hex->interval.end;
    +
    6523 continue;
    +
    6524 }
    +
    6525 if (m_escape->match(text, m_escape->interval.end, end, flags)) {
    +
    6526 value += '\\'; interval.end = m_escape->interval.end;
    +
    6527 continue;
    +
    6528 }
    +
    6529 }
    +
    6530 if (m_chr->match(text, interval.end, end, flags)) {
    +
    6531 value.Prilepi(text + m_chr->interval.start, m_chr->interval.size());
    +
    6532 interval.end = m_chr->interval.end;
    +
    6533 continue;
    +
    6534 }
    +
    6535 break;
    +
    6536 }
    +
    6537 }
    +
    6538 value.clear();
    +
    6539 interval.start = (interval.end = start) + 1;
    +
    6540 return false;
    +
    6541 }
    +
    6542
    +
    6543 virtual void invalidate()
    +
    6544 {
    +
    6545 value.clear();
    +
    6546 basic_parser<T>::invalidate();
    +
    6547 }
    +
    6548
    +
    6549 public:
    +
    6550 std::basic_string<T> value;
    +
    6551
    +
    6552 protected:
    +
    6553 std::shared_ptr<basic_parser<T>> m_quote;
    +
    6554 std::shared_ptr<basic_parser<T>> m_chr;
    +
    6555 std::shared_ptr<basic_parser<T>> m_escape;
    +
    6556 std::shared_ptr<basic_parser<T>> m_sol;
    +
    6557 std::shared_ptr<basic_parser<T>> m_bs;
    +
    6558 std::shared_ptr<basic_parser<T>> m_ff;
    +
    6559 std::shared_ptr<basic_parser<T>> m_lf;
    +
    6560 std::shared_ptr<basic_parser<T>> m_cr;
    +
    6561 std::shared_ptr<basic_parser<T>> m_htab;
    +
    6562 std::shared_ptr<basic_parser<T>> m_uni;
    +
    6563 std::shared_ptr<basic_integer16<T>> m_hex;
    +
    6564 };
    +
    6565
    +
    6566 using json_string = basic_json_string<char>;
    +
    6567 using wjson_string = basic_json_string<wchar_t>;
    +
    6568#ifdef _UNICODE
    +
    6569 using tjson_string = wjson_string;
    +
    6570#else
    +
    6571 using tjson_string = json_string;
    +
    6572#endif
    +
    6573 }
    +
    6574}
    +
    6575
    +
    6576#undef ENUM_FLAG_OPERATOR
    +
    6577#undef ENUM_FLAGS
    +
    6578
    +
    6579#ifdef _MSC_VER
    +
    6580#pragma warning(pop)
    +
    6581#endif
    +
    stdex::parser::basic_angle
    Test for angle in d°mm'ss.dddd form.
    Definition parser.hpp:4390
    +
    stdex::parser::basic_any_cu
    Test for any code unit.
    Definition parser.hpp:217
    +
    stdex::parser::basic_bol
    Test for beginning of line.
    Definition parser.hpp:611
    +
    stdex::parser::basic_branch
    Test for any.
    Definition parser.hpp:1053
    +
    stdex::parser::basic_chemical_formula
    Test for chemical formula.
    Definition parser.hpp:4664
    +
    stdex::parser::basic_cu_set
    Test for any code unit from a given string of code units.
    Definition parser.hpp:716
    +
    stdex::parser::basic_cu
    Test for specific code unit.
    Definition parser.hpp:287
    +
    stdex::parser::basic_date
    Test for date.
    Definition parser.hpp:4020
    +
    stdex::parser::basic_dns_domain_char
    Test for valid DNS domain character.
    Definition parser.hpp:2801
    +
    stdex::parser::basic_dns_domain_char::allow_on_edge
    bool allow_on_edge
    Is character allowed at the beginning or an end of a DNS domain?
    Definition parser.hpp:2839
    +
    stdex::parser::basic_dns_name
    Test for DNS domain/hostname.
    Definition parser.hpp:2901
    +
    stdex::parser::basic_dns_name::m_allow_absolute
    bool m_allow_absolute
    May DNS names end with a dot (absolute name)?
    Definition parser.hpp:2965
    +
    stdex::parser::basic_email_address
    Test for e-mail address.
    Definition parser.hpp:3789
    +
    stdex::parser::basic_emoticon
    Test for emoticon.
    Definition parser.hpp:3897
    +
    stdex::parser::basic_emoticon::apex
    std::shared_ptr< basic_parser< T > > apex
    apex/eyebrows/halo (e.g. O, 0)
    Definition parser.hpp:3986
    +
    stdex::parser::basic_emoticon::eyes
    std::shared_ptr< basic_parser< T > > eyes
    eyes (e.g. :, ;, >, |, B)
    Definition parser.hpp:3987
    +
    stdex::parser::basic_emoticon::mouth
    std::shared_ptr< basic_set< T > > mouth
    mouth (e.g. ), ), (, (, |, P, D, p, d)
    Definition parser.hpp:3989
    +
    stdex::parser::basic_emoticon::nose
    std::shared_ptr< basic_parser< T > > nose
    nose (e.g. -, o)
    Definition parser.hpp:3988
    +
    stdex::parser::basic_emoticon::emoticon
    std::shared_ptr< basic_parser< T > > emoticon
    emoticon as a whole (e.g. 😀, 🤔, 😶)
    Definition parser.hpp:3985
    +
    stdex::parser::basic_eol
    Test for end of line.
    Definition parser.hpp:649
    +
    stdex::parser::basic_fraction
    Test for fraction.
    Definition parser.hpp:1682
    +
    stdex::parser::basic_integer10
    Test for decimal integer.
    Definition parser.hpp:1291
    +
    stdex::parser::basic_integer10ts
    Test for decimal integer possibly containing thousand separators.
    Definition parser.hpp:1376
    +
    stdex::parser::basic_integer10ts::has_separators
    bool has_separators
    Did integer have any separators?
    Definition parser.hpp:1436
    +
    stdex::parser::basic_integer10ts::digit_count
    size_t digit_count
    Total number of digits in integer.
    Definition parser.hpp:1435
    +
    stdex::parser::basic_integer16
    Test for hexadecimal integer.
    Definition parser.hpp:1457
    +
    stdex::parser::basic_integer
    Base class for integer testing.
    Definition parser.hpp:1269
    +
    stdex::parser::basic_integer::value
    size_t value
    Calculated value of the numeral.
    Definition parser.hpp:1283
    +
    stdex::parser::basic_ipv4_address
    Test for IPv4 address.
    Definition parser.hpp:2341
    +
    stdex::parser::basic_ipv4_address::components
    stdex::interval< size_t > components[4]
    Individual component intervals.
    Definition parser.hpp:2456
    +
    stdex::parser::basic_ipv4_address::value
    struct in_addr value
    IPv4 address value.
    Definition parser.hpp:2457
    +
    stdex::parser::basic_ipv6_address
    Test for IPv6 address.
    Definition parser.hpp:2560
    +
    stdex::parser::basic_ipv6_address::scope_id
    std::shared_ptr< basic_parser< T > > scope_id
    Scope ID (e.g. NIC index with link-local addresses)
    Definition parser.hpp:2764
    +
    stdex::parser::basic_ipv6_address::components
    stdex::interval< size_t > components[8]
    Individual component intervals.
    Definition parser.hpp:2762
    +
    stdex::parser::basic_ipv6_address::value
    struct in6_addr value
    IPv6 address value.
    Definition parser.hpp:2763
    +
    stdex::parser::basic_ipv6_scope_id_char
    Test for valid IPv6 address scope ID character.
    Definition parser.hpp:2488
    +
    stdex::parser::basic_iterations
    Test for repeating.
    Definition parser.hpp:906
    +
    stdex::parser::basic_iterations::m_greedy
    bool m_greedy
    try to match as long sequence as possible
    Definition parser.hpp:945
    +
    stdex::parser::basic_iterations::m_el
    std::shared_ptr< basic_parser< T > > m_el
    repeating element
    Definition parser.hpp:942
    +
    stdex::parser::basic_iterations::m_min_iterations
    size_t m_min_iterations
    minimum number of iterations
    Definition parser.hpp:943
    +
    stdex::parser::basic_iterations::m_max_iterations
    size_t m_max_iterations
    maximum number of iterations
    Definition parser.hpp:944
    +
    stdex::parser::basic_json_string
    Test for JSON string.
    Definition parser.hpp:6426
    +
    stdex::parser::basic_mixed_numeral
    Test for mixed numeral.
    Definition parser.hpp:1917
    +
    stdex::parser::basic_mixed_numeral::fraction
    std::shared_ptr< basic_parser< T > > fraction
    fraction
    Definition parser.hpp:2023
    +
    stdex::parser::basic_mixed_numeral::special_sign
    std::shared_ptr< basic_parser< T > > special_sign
    Special sign (e.g. plus-minus '±')
    Definition parser.hpp:2021
    +
    stdex::parser::basic_mixed_numeral::negative_sign
    std::shared_ptr< basic_parser< T > > negative_sign
    Negative sign.
    Definition parser.hpp:2020
    +
    stdex::parser::basic_mixed_numeral::positive_sign
    std::shared_ptr< basic_parser< T > > positive_sign
    Positive sign.
    Definition parser.hpp:2019
    +
    stdex::parser::basic_mixed_numeral::integer
    std::shared_ptr< basic_parser< T > > integer
    Integer part.
    Definition parser.hpp:2022
    +
    stdex::parser::basic_monetary_numeral
    Test for monetary numeral.
    Definition parser.hpp:2212
    +
    stdex::parser::basic_monetary_numeral::positive_sign
    std::shared_ptr< basic_parser< T > > positive_sign
    Positive sign.
    Definition parser.hpp:2318
    +
    stdex::parser::basic_monetary_numeral::decimal_separator
    std::shared_ptr< basic_parser< T > > decimal_separator
    Decimal separator.
    Definition parser.hpp:2323
    +
    stdex::parser::basic_monetary_numeral::currency
    std::shared_ptr< basic_parser< T > > currency
    Currency part.
    Definition parser.hpp:2321
    +
    stdex::parser::basic_monetary_numeral::decimal
    std::shared_ptr< basic_parser< T > > decimal
    Decimal part.
    Definition parser.hpp:2324
    +
    stdex::parser::basic_monetary_numeral::integer
    std::shared_ptr< basic_parser< T > > integer
    Integer part.
    Definition parser.hpp:2322
    +
    stdex::parser::basic_monetary_numeral::negative_sign
    std::shared_ptr< basic_parser< T > > negative_sign
    Negative sign.
    Definition parser.hpp:2319
    +
    stdex::parser::basic_monetary_numeral::special_sign
    std::shared_ptr< basic_parser< T > > special_sign
    Special sign (e.g. plus-minus '±')
    Definition parser.hpp:2320
    +
    stdex::parser::basic_noop
    "No-op" match
    Definition parser.hpp:185
    +
    stdex::parser::basic_parser
    Base template for all parsers.
    Definition parser.hpp:66
    +
    stdex::parser::basic_parser::interval
    interval< size_t > interval
    Region of the last match.
    Definition parser.hpp:165
    +
    stdex::parser::basic_permutation
    Test for permutation.
    Definition parser.hpp:1193
    +
    stdex::parser::basic_phone_number
    Test for phone number.
    Definition parser.hpp:4513
    +
    stdex::parser::basic_phone_number::value
    std::basic_string< T > value
    Normalized phone number.
    Definition parser.hpp:4639
    +
    stdex::parser::basic_punct_cu
    Test for any punctuation code unit.
    Definition parser.hpp:459
    +
    stdex::parser::basic_roman_numeral
    Test for Roman numeral.
    Definition parser.hpp:1566
    +
    stdex::parser::basic_scientific_numeral
    Test for scientific numeral.
    Definition parser.hpp:2043
    +
    stdex::parser::basic_scientific_numeral::special_sign
    std::shared_ptr< basic_parser< T > > special_sign
    Special sign (e.g. plus-minus '±')
    Definition parser.hpp:2187
    +
    stdex::parser::basic_scientific_numeral::exponent_symbol
    std::shared_ptr< basic_parser< T > > exponent_symbol
    Exponent symbol (e.g. 'e')
    Definition parser.hpp:2191
    +
    stdex::parser::basic_scientific_numeral::positive_sign
    std::shared_ptr< basic_parser< T > > positive_sign
    Positive sign.
    Definition parser.hpp:2185
    +
    stdex::parser::basic_scientific_numeral::negative_sign
    std::shared_ptr< basic_parser< T > > negative_sign
    Negative sign.
    Definition parser.hpp:2186
    +
    stdex::parser::basic_scientific_numeral::value
    double value
    Calculated value of the numeral.
    Definition parser.hpp:2195
    +
    stdex::parser::basic_scientific_numeral::negative_exp_sign
    std::shared_ptr< basic_parser< T > > negative_exp_sign
    Negative exponent sign (e.g. '-')
    Definition parser.hpp:2193
    +
    stdex::parser::basic_scientific_numeral::decimal
    std::shared_ptr< basic_integer< T > > decimal
    Decimal part.
    Definition parser.hpp:2190
    +
    stdex::parser::basic_scientific_numeral::positive_exp_sign
    std::shared_ptr< basic_parser< T > > positive_exp_sign
    Positive exponent sign (e.g. '+')
    Definition parser.hpp:2192
    +
    stdex::parser::basic_scientific_numeral::exponent
    std::shared_ptr< basic_integer< T > > exponent
    Exponent part.
    Definition parser.hpp:2194
    +
    stdex::parser::basic_scientific_numeral::decimal_separator
    std::shared_ptr< basic_parser< T > > decimal_separator
    Decimal separator.
    Definition parser.hpp:2189
    +
    stdex::parser::basic_scientific_numeral::integer
    std::shared_ptr< basic_integer< T > > integer
    Integer part.
    Definition parser.hpp:2188
    +
    stdex::parser::basic_score
    Test for match score.
    Definition parser.hpp:1745
    +
    stdex::parser::basic_sequence
    Test for sequence.
    Definition parser.hpp:1002
    +
    stdex::parser::basic_set
    Definition parser.hpp:684
    +
    stdex::parser::basic_signed_numeral
    Test for signed numeral.
    Definition parser.hpp:1831
    +
    stdex::parser::basic_signed_numeral::special_sign
    std::shared_ptr< basic_parser< T > > special_sign
    Special sign (e.g. plus-minus '±')
    Definition parser.hpp:1899
    +
    stdex::parser::basic_signed_numeral::negative_sign
    std::shared_ptr< basic_parser< T > > negative_sign
    Negative sign.
    Definition parser.hpp:1898
    +
    stdex::parser::basic_signed_numeral::positive_sign
    std::shared_ptr< basic_parser< T > > positive_sign
    Positive sign.
    Definition parser.hpp:1897
    +
    stdex::parser::basic_signed_numeral::number
    std::shared_ptr< basic_parser< T > > number
    Number.
    Definition parser.hpp:1900
    +
    stdex::parser::basic_space_cu
    Test for any space code unit.
    Definition parser.hpp:380
    +
    stdex::parser::basic_space_or_punct_cu
    Test for any space or punctuation code unit.
    Definition parser.hpp:533
    +
    stdex::parser::basic_string_branch
    Test for any string.
    Definition parser.hpp:1121
    +
    stdex::parser::basic_string
    Test for given string.
    Definition parser.hpp:811
    +
    stdex::parser::basic_time
    Test for time.
    Definition parser.hpp:4287
    +
    stdex::parser::basic_url_password_char
    Test for valid URL password character.
    Definition parser.hpp:3083
    +
    stdex::parser::basic_url_path_char
    Test for valid URL path character.
    Definition parser.hpp:3183
    +
    stdex::parser::basic_url_path
    Test for URL path.
    Definition parser.hpp:3291
    +
    stdex::parser::basic_url_username_char
    Test for valid URL username character.
    Definition parser.hpp:2984
    +
    stdex::parser::basic_url
    Test for URL.
    Definition parser.hpp:3432
    +
    stdex::parser::http_agent
    Test for HTTP agent.
    Definition parser.hpp:5949
    +
    stdex::parser::http_any_type
    Test for HTTP any type.
    Definition parser.hpp:5071
    +
    stdex::parser::http_asterisk
    Test for HTTP asterisk.
    Definition parser.hpp:5713
    + + + + + +
    stdex::parser::http_header
    Test for HTTP header.
    Definition parser.hpp:6272
    +
    stdex::parser::http_language
    Test for HTTP language (RFC1766)
    Definition parser.hpp:5581
    +
    stdex::parser::http_line_break
    Test for HTTP line break (RFC2616: CRLF | LF)
    Definition parser.hpp:4745
    +
    stdex::parser::http_media_range
    Test for HTTP media range (RFC2616: media-range)
    Definition parser.hpp:5103
    +
    stdex::parser::http_media_type
    Test for HTTP media type (RFC2616: media-type)
    Definition parser.hpp:5158
    +
    stdex::parser::http_parameter
    Test for HTTP parameter (RFC2616: parameter)
    Definition parser.hpp:5016
    +
    stdex::parser::http_parameter::name
    http_token name
    Parameter name.
    Definition parser.hpp:5060
    +
    stdex::parser::http_parameter::value
    http_value value
    Parameter value.
    Definition parser.hpp:5061
    +
    stdex::parser::http_protocol
    Test for HTTP protocol.
    Definition parser.hpp:6025
    +
    stdex::parser::http_protocol::version
    uint16_t version
    HTTP protocol version: 0x100 = 1.0, 0x101 = 1.1...
    Definition parser.hpp:6127
    +
    stdex::parser::http_quoted_string
    Test for HTTP quoted string (RFC2616: quoted-string)
    Definition parser.hpp:4906
    +
    stdex::parser::http_quoted_string::content
    stdex::interval< size_t > content
    String content (without quotes)
    Definition parser.hpp:4962
    +
    stdex::parser::http_request
    Test for HTTP request.
    Definition parser.hpp:6134
    +
    stdex::parser::http_space
    Test for HTTP space (RFC2616: LWS)
    Definition parser.hpp:4781
    +
    stdex::parser::http_text_char
    Test for HTTP text character (RFC2616: TEXT)
    Definition parser.hpp:4818
    +
    stdex::parser::http_token
    Test for HTTP token (RFC2616: token - tolerates non-ASCII)
    Definition parser.hpp:4852
    +
    stdex::parser::http_url_parameter
    Test for HTTP URL parameter.
    Definition parser.hpp:5398
    +
    stdex::parser::http_url_path_segment
    Test for HTTP URL path segment.
    Definition parser.hpp:5309
    +
    stdex::parser::http_url_path
    Test for HTTP URL path segment.
    Definition parser.hpp:5342
    +
    stdex::parser::http_url_path::segments
    std::vector< http_url_path_segment > segments
    Path segments.
    Definition parser.hpp:5391
    +
    stdex::parser::http_url_port
    Test for HTTP URL port.
    Definition parser.hpp:5253
    +
    stdex::parser::http_url_server
    Test for HTTP URL server.
    Definition parser.hpp:5216
    +
    stdex::parser::http_url
    Test for HTTP URL.
    Definition parser.hpp:5479
    +
    stdex::parser::http_value_collection
    Collection of HTTP values.
    Definition parser.hpp:6382
    +
    stdex::parser::http_value
    Test for HTTP value (RFC2616: value)
    Definition parser.hpp:4972
    +
    stdex::parser::http_value::string
    http_quoted_string string
    Value when matched as quoted string.
    Definition parser.hpp:5008
    +
    stdex::parser::http_value::token
    http_token token
    Value when matched as token.
    Definition parser.hpp:5009
    +
    stdex::parser::http_weight
    Test for HTTP weight factor.
    Definition parser.hpp:5644
    +
    stdex::parser::http_weight::value
    float value
    Calculated value of the weight factor.
    Definition parser.hpp:5706
    +
    stdex::parser::http_weighted_value
    Test for HTTP weighted value.
    Definition parser.hpp:5736
    +
    stdex::parser::parser_collection
    Base template for collection-holding parsers.
    Definition parser.hpp:962
    +
    stdex::parser::sgml_any_cp
    Test for any SGML code point.
    Definition parser.hpp:249
    +
    stdex::parser::sgml_cp_set
    Test for any SGML code point from a given string of SGML code points.
    Definition parser.hpp:768
    +
    stdex::parser::sgml_cp
    Test for specific SGML code point.
    Definition parser.hpp:336
    +
    stdex::parser::sgml_dns_domain_char
    Test for valid DNS domain SGML character.
    Definition parser.hpp:2857
    +
    stdex::parser::sgml_ipv6_scope_id_char
    Test for valid IPv6 address scope ID SGML character.
    Definition parser.hpp:2526
    +
    stdex::parser::sgml_punct_cp
    Test for any SGML punctuation code point.
    Definition parser.hpp:500
    +
    stdex::parser::sgml_space_cp
    Test for any SGML space code point.
    Definition parser.hpp:423
    +
    stdex::parser::sgml_space_or_punct_cp
    Test for any SGML space or punctuation code point.
    Definition parser.hpp:576
    +
    stdex::parser::sgml_string
    Test for SGML given string.
    Definition parser.hpp:858
    +
    stdex::parser::sgml_url_password_char
    Test for valid URL password SGML character.
    Definition parser.hpp:3135
    +
    stdex::parser::sgml_url_path_char
    Test for valid URL path SGML character.
    Definition parser.hpp:3239
    +
    stdex::parser::sgml_url_username_char
    Test for valid URL username SGML character.
    Definition parser.hpp:3035
    stdex::interval
    Numerical interval.
    Definition interval.hpp:18
    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::interval
    interval() noexcept
    Constructs an invalid interval.
    Definition interval.hpp:25
    stdex::interval::start
    T start
    interval start
    Definition interval.hpp:19
    -
    stdex::parser::http_factor_more
    Definition parser.hpp:6407
    +
    stdex::parser::http_factor_more
    Definition parser.hpp:6408
    diff --git a/pch_8h_source.html b/pch_8h_source.html index 07a299b58..baf72ced4 100644 --- a/pch_8h_source.html +++ b/pch_8h_source.html @@ -93,22 +93,28 @@ $(function() {
    14#include <stdex/hex.hpp>
    15#include <stdex/idrec.hpp>
    16#include <stdex/interval.hpp>
    -
    17#include <stdex/ios.hpp>
    -
    18#include <stdex/mapping.hpp>
    +
    17#include <stdex/mapping.hpp>
    +
    18#include <stdex/math.hpp>
    19#include <stdex/parser.hpp>
    20#include <stdex/progress.hpp>
    -
    21#include <stdex/sal.hpp>
    -
    22#include <stdex/sgml.hpp>
    -
    23#include <stdex/string.hpp>
    -
    24#include <stdex/vector_queue.hpp>
    -
    25
    -
    26#include <CppUnitTest.h>
    -
    27
    -
    28#include <cstdlib>
    +
    21#include <stdex/ring.hpp>
    +
    22#include <stdex/sal.hpp>
    +
    23#include <stdex/sgml.hpp>
    +
    24#include <stdex/stream.hpp>
    +
    25#include <stdex/string.hpp>
    +
    26#include <stdex/system.hpp>
    +
    27#include <stdex/unicode.hpp>
    +
    28#include <stdex/vector_queue.hpp>
    +
    29
    +
    30#include <CppUnitTest.h>
    +
    31
    +
    32#include <cstdlib>
    +
    33#include <filesystem>
    +
    34#include <thread>
    diff --git a/progress_8hpp_source.html b/progress_8hpp_source.html index 02f623647..ccf44a5b6 100644 --- a/progress_8hpp_source.html +++ b/progress_8hpp_source.html @@ -282,7 +282,7 @@ $(function() { diff --git a/ring_8hpp_source.html b/ring_8hpp_source.html new file mode 100644 index 000000000..848fa104f --- /dev/null +++ b/ring_8hpp_source.html @@ -0,0 +1,211 @@ + + + + + + + +stdex: include/stdex/ring.hpp Source File + + + + + + + + + +
    +
    + + + + + + +
    +
    stdex +
    +
    Additional custom or not Standard C++ covered algorithms
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + + +
    +
    +
    ring.hpp
    +
    +
    +
    1/*
    +
    2 SPDX-License-Identifier: MIT
    +
    3 Copyright © 2023 Amebis
    +
    4*/
    +
    5
    +
    6#pragma once
    +
    7
    +
    8#include "sal.hpp"
    +
    9#include <assert.h>
    +
    10#include <condition_variable>
    +
    11#include <mutex>
    +
    12#include <tuple>
    +
    13
    +
    14namespace stdex
    +
    15{
    +
    22 template <class T, size_t CAPACITY>
    +
    23 class ring
    +
    24 {
    +
    25 public:
    +
    26#pragma warning(suppress:26495) // Don't bother to initialize m_data
    +
    27 ring() :
    +
    28 m_head(0),
    +
    29 m_size(0),
    +
    30 m_quit(false)
    +
    31 {}
    +
    32
    +
    38 std::tuple<T*, size_t> back()
    +
    39 {
    +
    40 std::unique_lock<std::mutex> lk(m_mutex);
    +
    41 if (!space()) {
    +
    42 m_head_moved.wait(lk, [&]{return m_quit || space();});
    +
    43 if (m_quit) _Unlikely_
    +
    44 return { nullptr, 0 };
    +
    45 }
    +
    46 size_t tail = wrap(m_head + m_size);
    +
    47 return { &m_data[tail], m_head <= tail ? CAPACITY - tail : m_head - tail };
    +
    48 }
    +
    49
    +
    55 void push(_In_ size_t size)
    +
    56 {
    +
    57 {
    +
    58 const std::lock_guard<std::mutex> lg(m_mutex);
    +
    59#ifdef _DEBUG
    +
    60 size_t tail = wrap(m_head + m_size);
    +
    61 assert(size <= (m_head <= tail ? CAPACITY - tail : m_head - tail));
    +
    62#endif
    +
    63 m_size += size;
    +
    64 }
    +
    65 m_tail_moved.notify_one();
    +
    66 }
    +
    67
    +
    73 std::tuple<T*, size_t> front()
    +
    74 {
    +
    75 std::unique_lock<std::mutex> lk(m_mutex);
    +
    76 if (empty()) {
    +
    77 m_tail_moved.wait(lk, [&]{return m_quit || !empty();});
    +
    78 if (m_quit && empty()) _Unlikely_
    +
    79 return { nullptr, 0 };
    +
    80 }
    +
    81 size_t tail = wrap(m_head + m_size);
    +
    82 return { &m_data[m_head], m_head < tail ? m_size : CAPACITY - m_head };
    +
    83 }
    +
    84
    +
    90 void pop(_In_ size_t size)
    +
    91 {
    +
    92 {
    +
    93 const std::lock_guard<std::mutex> lg(m_mutex);
    +
    94#ifdef _DEBUG
    +
    95 size_t tail = wrap(m_head + m_size);
    +
    96 assert(size <= (m_head < tail ? m_size : CAPACITY - m_head));
    +
    97#endif
    +
    98 m_head = wrap(m_head + size);
    +
    99 m_size -= size;
    +
    100 }
    +
    101 m_head_moved.notify_one();
    +
    102 }
    +
    103
    +
    107 void quit()
    +
    108 {
    +
    109 {
    +
    110 const std::lock_guard<std::mutex> lg(m_mutex);
    +
    111 m_quit = true;
    +
    112 }
    +
    113 m_head_moved.notify_one();
    +
    114 m_tail_moved.notify_one();
    +
    115 }
    +
    116
    +
    120 void sync()
    +
    121 {
    +
    122 std::unique_lock<std::mutex> lk(m_mutex);
    +
    123 m_head_moved.wait(lk, [&]{return m_quit || empty();});
    +
    124 }
    +
    125
    +
    126 protected:
    +
    127 inline size_t wrap(_In_ size_t idx) const
    +
    128 {
    +
    129 // TODO: When CAPACITY is power of 2, use & ~(CAPACITY - 1) instead.
    +
    130 return idx % CAPACITY;
    +
    131 }
    +
    132
    +
    133 inline size_t space() const
    +
    134 {
    +
    135 return CAPACITY - m_size;
    +
    136 }
    +
    137
    +
    138 inline bool empty() const
    +
    139 {
    +
    140 return !m_size;
    +
    141 }
    +
    142
    +
    143 protected:
    +
    144 std::mutex m_mutex;
    +
    145 std::condition_variable m_head_moved, m_tail_moved;
    +
    146 size_t m_head, m_size;
    +
    147 bool m_quit;
    +
    148 T m_data[CAPACITY];
    +
    149 };
    +
    150}
    +
    Ring buffer.
    Definition ring.hpp:24
    +
    void quit()
    Cancells waiting sender and receiver.
    Definition ring.hpp:107
    +
    std::tuple< T *, size_t > back()
    Allocates the data after the ring tail. Use push() after the allocated data is populated.
    Definition ring.hpp:38
    +
    void pop(size_t size)
    Notifies the sender the data was consumed.
    Definition ring.hpp:90
    +
    void sync()
    Waits until the ring is flush.
    Definition ring.hpp:120
    +
    std::tuple< T *, size_t > front()
    Peeks the data at the ring head. Use pop() after the data was consumed.
    Definition ring.hpp:73
    +
    void push(size_t size)
    Notifies the receiver the data was populated.
    Definition ring.hpp:55
    +
    + + + + diff --git a/sal_8hpp_source.html b/sal_8hpp_source.html index 96eacff22..21d1549f3 100644 --- a/sal_8hpp_source.html +++ b/sal_8hpp_source.html @@ -143,10 +143,32 @@ $(function() {
    64#ifndef _Success_
    65#define _Success_(p)
    66#endif
    +
    67#ifndef _Ret_notnull_
    +
    68#define _Ret_notnull_
    +
    69#endif
    +
    70#ifndef _Must_inspect_result_
    +
    71#define _Must_inspect_result_
    +
    72#endif
    +
    73
    +
    74#ifndef _Likely_
    +
    75#if _HAS_CXX20
    +
    76#define _Likely_ [[likely]]
    +
    77#else
    +
    78#define _Likely_
    +
    79#endif
    +
    80#endif
    +
    81
    +
    82#ifndef _Unlikely_
    +
    83#if _HAS_CXX20
    +
    84#define _Unlikely_ [[unlikely]]
    +
    85#else
    +
    86#define _Unlikely_
    +
    87#endif
    +
    88#endif
    diff --git a/search/all_0.js b/search/all_0.js index 211c619d6..55fa7376d 100644 --- a/search/all_0.js +++ b/search/all_0.js @@ -4,7 +4,10 @@ var searchData= ['allow_5fon_5fedge_1',['allow_on_edge',['../classstdex_1_1parser_1_1basic__dns__domain__char.html#a3307235d495a97c98f9efd1464e8a8a7',1,'stdex::parser::basic_dns_domain_char']]], ['aosn_5fclock_2',['aosn_clock',['../structstdex_1_1chrono_1_1aosn__clock.html',1,'stdex::chrono']]], ['apex_3',['apex',['../classstdex_1_1parser_1_1basic__emoticon.html#a1b6b7a024dea373b890c1c4516f5e9a4',1,'stdex::parser::basic_emoticon']]], - ['at_4',['at',['../classstdex_1_1vector__queue.html#ae135f77af0deabaa5f2cfe5ca25b9f09',1,'stdex::vector_queue::at(size_type pos)'],['../classstdex_1_1vector__queue.html#ac2b559184798a59ee5fed26f27d92e3c',1,'stdex::vector_queue::at(size_type pos) const']]], - ['at_5fabs_5',['at_abs',['../classstdex_1_1vector__queue.html#a881da485c13dcee1d35245570420877a',1,'stdex::vector_queue::at_abs(size_type pos)'],['../classstdex_1_1vector__queue.html#afee762c3280d33544ce8dd8ad20af40b',1,'stdex::vector_queue::at_abs(size_type pos) const']]], - ['attach_6',['attach',['../classstdex_1_1global__progress.html#aec91532fde2500a5458a397f91c88769',1,'stdex::global_progress']]] + ['async_5freader_4',['async_reader',['../classstdex_1_1stream_1_1async__reader.html',1,'stdex::stream']]], + ['async_5fwriter_5',['async_writer',['../classstdex_1_1stream_1_1async__writer.html',1,'stdex::stream']]], + ['at_6',['at',['../classstdex_1_1vector__queue.html#ae135f77af0deabaa5f2cfe5ca25b9f09',1,'stdex::vector_queue::at(size_type pos)'],['../classstdex_1_1vector__queue.html#ac2b559184798a59ee5fed26f27d92e3c',1,'stdex::vector_queue::at(size_type pos) const']]], + ['at_5fabs_7',['at_abs',['../classstdex_1_1vector__queue.html#a881da485c13dcee1d35245570420877a',1,'stdex::vector_queue::at_abs(size_type pos)'],['../classstdex_1_1vector__queue.html#afee762c3280d33544ce8dd8ad20af40b',1,'stdex::vector_queue::at_abs(size_type pos) const']]], + ['atime_8',['atime',['../classstdex_1_1stream_1_1basic__file.html#a84936e230100934793aad8a516efa826',1,'stdex::stream::basic_file::atime()'],['../classstdex_1_1stream_1_1cache.html#a5fd8962b5a49d549a36d96f3e8919cd7',1,'stdex::stream::cache::atime()'],['../classstdex_1_1stream_1_1file.html#a4b5cdfe6c9dccd20726df867e34f4af3',1,'stdex::stream::file::atime()']]], + ['attach_9',['attach',['../classstdex_1_1global__progress.html#aec91532fde2500a5458a397f91c88769',1,'stdex::global_progress']]] ]; diff --git a/search/all_1.js b/search/all_1.js index 86883e437..1e0144429 100644 --- a/search/all_1.js +++ b/search/all_1.js @@ -1,72 +1,69 @@ var searchData= [ - ['back_0',['back',['../classstdex_1_1vector__queue.html#a564c31d1a260f9f210541b7fd4803d3e',1,'stdex::vector_queue::back()'],['../classstdex_1_1vector__queue.html#a4a76efc22a2e2b9310b541ba44fd05e9',1,'stdex::vector_queue::back() const']]], + ['back_0',['back',['../classstdex_1_1ring.html#a3e41365e5bcb914099baff6b02686bca',1,'stdex::ring::back()'],['../classstdex_1_1vector__queue.html#a564c31d1a260f9f210541b7fd4803d3e',1,'stdex::vector_queue::back()'],['../classstdex_1_1vector__queue.html#a4a76efc22a2e2b9310b541ba44fd05e9',1,'stdex::vector_queue::back() const']]], ['base64_5fdec_1',['base64_dec',['../classstdex_1_1base64__dec.html#a17d956a883e99d8d884d2cb2edade8c5',1,'stdex::base64_dec::base64_dec()'],['../classstdex_1_1base64__dec.html',1,'stdex::base64_dec']]], ['base64_5fenc_2',['base64_enc',['../classstdex_1_1base64__enc.html#abc6c72530634c3fea8168710ab5b1a28',1,'stdex::base64_enc::base64_enc()'],['../classstdex_1_1base64__enc.html',1,'stdex::base64_enc']]], - ['basic_5fangle_3',['basic_angle',['../classstdex_1_1parser_1_1basic__angle.html',1,'stdex::parser']]], - ['basic_5fany_5fcu_4',['basic_any_cu',['../classstdex_1_1parser_1_1basic__any__cu.html',1,'stdex::parser']]], - ['basic_5fany_5fcu_3c_20char_20_3e_5',['basic_any_cu< char >',['../classstdex_1_1parser_1_1basic__any__cu.html',1,'stdex::parser']]], - ['basic_5fbol_6',['basic_bol',['../classstdex_1_1parser_1_1basic__bol.html',1,'stdex::parser']]], - ['basic_5fbranch_7',['basic_branch',['../classstdex_1_1parser_1_1basic__branch.html',1,'stdex::parser']]], - ['basic_5fchemical_5fformula_8',['basic_chemical_formula',['../classstdex_1_1parser_1_1basic__chemical__formula.html',1,'stdex::parser']]], - ['basic_5fcu_9',['basic_cu',['../classstdex_1_1parser_1_1basic__cu.html',1,'stdex::parser']]], - ['basic_5fcu_5fset_10',['basic_cu_set',['../classstdex_1_1parser_1_1basic__cu__set.html',1,'stdex::parser']]], - ['basic_5fdate_11',['basic_date',['../classstdex_1_1parser_1_1basic__date.html',1,'stdex::parser']]], - ['basic_5fdiagstream_12',['basic_diagstream',['../classstdex_1_1basic__diagstream.html',1,'stdex']]], - ['basic_5fdiagstreambuf_13',['basic_diagstreambuf',['../classstdex_1_1basic__diagstreambuf.html',1,'stdex']]], - ['basic_5fdns_5fdomain_5fchar_14',['basic_dns_domain_char',['../classstdex_1_1parser_1_1basic__dns__domain__char.html',1,'stdex::parser']]], - ['basic_5fdns_5fdomain_5fchar_3c_20char_20_3e_15',['basic_dns_domain_char< char >',['../classstdex_1_1parser_1_1basic__dns__domain__char.html',1,'stdex::parser']]], - ['basic_5fdns_5fname_16',['basic_dns_name',['../classstdex_1_1parser_1_1basic__dns__name.html',1,'stdex::parser']]], - ['basic_5femail_5faddress_17',['basic_email_address',['../classstdex_1_1parser_1_1basic__email__address.html',1,'stdex::parser']]], - ['basic_5femoticon_18',['basic_emoticon',['../classstdex_1_1parser_1_1basic__emoticon.html',1,'stdex::parser']]], - ['basic_5feol_19',['basic_eol',['../classstdex_1_1parser_1_1basic__eol.html',1,'stdex::parser']]], + ['basic_3',['basic',['../classstdex_1_1stream_1_1basic.html',1,'stdex::stream']]], + ['basic_5fangle_4',['basic_angle',['../classstdex_1_1parser_1_1basic__angle.html',1,'stdex::parser']]], + ['basic_5fany_5fcu_5',['basic_any_cu',['../classstdex_1_1parser_1_1basic__any__cu.html',1,'stdex::parser']]], + ['basic_5fany_5fcu_3c_20char_20_3e_6',['basic_any_cu< char >',['../classstdex_1_1parser_1_1basic__any__cu.html',1,'stdex::parser']]], + ['basic_5fbol_7',['basic_bol',['../classstdex_1_1parser_1_1basic__bol.html',1,'stdex::parser']]], + ['basic_5fbranch_8',['basic_branch',['../classstdex_1_1parser_1_1basic__branch.html',1,'stdex::parser']]], + ['basic_5fchemical_5fformula_9',['basic_chemical_formula',['../classstdex_1_1parser_1_1basic__chemical__formula.html',1,'stdex::parser']]], + ['basic_5fcu_10',['basic_cu',['../classstdex_1_1parser_1_1basic__cu.html',1,'stdex::parser']]], + ['basic_5fcu_5fset_11',['basic_cu_set',['../classstdex_1_1parser_1_1basic__cu__set.html',1,'stdex::parser']]], + ['basic_5fdate_12',['basic_date',['../classstdex_1_1parser_1_1basic__date.html',1,'stdex::parser']]], + ['basic_5fdns_5fdomain_5fchar_13',['basic_dns_domain_char',['../classstdex_1_1parser_1_1basic__dns__domain__char.html',1,'stdex::parser']]], + ['basic_5fdns_5fdomain_5fchar_3c_20char_20_3e_14',['basic_dns_domain_char< char >',['../classstdex_1_1parser_1_1basic__dns__domain__char.html',1,'stdex::parser']]], + ['basic_5fdns_5fname_15',['basic_dns_name',['../classstdex_1_1parser_1_1basic__dns__name.html',1,'stdex::parser']]], + ['basic_5femail_5faddress_16',['basic_email_address',['../classstdex_1_1parser_1_1basic__email__address.html',1,'stdex::parser']]], + ['basic_5femoticon_17',['basic_emoticon',['../classstdex_1_1parser_1_1basic__emoticon.html',1,'stdex::parser']]], + ['basic_5feol_18',['basic_eol',['../classstdex_1_1parser_1_1basic__eol.html',1,'stdex::parser']]], + ['basic_5ffile_19',['basic_file',['../classstdex_1_1stream_1_1basic__file.html',1,'stdex::stream']]], ['basic_5ffraction_20',['basic_fraction',['../classstdex_1_1parser_1_1basic__fraction.html',1,'stdex::parser']]], - ['basic_5ffstream_21',['basic_fstream',['../classstdex_1_1basic__fstream.html',1,'stdex']]], - ['basic_5finteger_22',['basic_integer',['../classstdex_1_1parser_1_1basic__integer.html',1,'stdex::parser']]], - ['basic_5finteger10_23',['basic_integer10',['../classstdex_1_1parser_1_1basic__integer10.html',1,'stdex::parser']]], - ['basic_5finteger10ts_24',['basic_integer10ts',['../classstdex_1_1parser_1_1basic__integer10ts.html',1,'stdex::parser']]], - ['basic_5finteger16_25',['basic_integer16',['../classstdex_1_1parser_1_1basic__integer16.html',1,'stdex::parser']]], - ['basic_5fiostreamfmt_26',['basic_iostreamfmt',['../classstdex_1_1basic__iostreamfmt.html',1,'stdex']]], - ['basic_5fipv4_5faddress_27',['basic_ipv4_address',['../classstdex_1_1parser_1_1basic__ipv4__address.html',1,'stdex::parser']]], - ['basic_5fipv6_5faddress_28',['basic_ipv6_address',['../classstdex_1_1parser_1_1basic__ipv6__address.html',1,'stdex::parser']]], - ['basic_5fipv6_5fscope_5fid_5fchar_29',['basic_ipv6_scope_id_char',['../classstdex_1_1parser_1_1basic__ipv6__scope__id__char.html',1,'stdex::parser']]], - ['basic_5fisharedstrstream_30',['basic_isharedstrstream',['../classstdex_1_1basic__isharedstrstream.html',1,'stdex']]], - ['basic_5fistreamfmt_31',['basic_istreamfmt',['../classstdex_1_1basic__istreamfmt.html',1,'stdex']]], - ['basic_5fiterations_32',['basic_iterations',['../classstdex_1_1parser_1_1basic__iterations.html',1,'stdex::parser']]], - ['basic_5fjson_5fstring_33',['basic_json_string',['../classstdex_1_1parser_1_1basic__json__string.html',1,'stdex::parser']]], - ['basic_5fmixed_5fnumeral_34',['basic_mixed_numeral',['../classstdex_1_1parser_1_1basic__mixed__numeral.html',1,'stdex::parser']]], - ['basic_5fmonetary_5fnumeral_35',['basic_monetary_numeral',['../classstdex_1_1parser_1_1basic__monetary__numeral.html',1,'stdex::parser']]], - ['basic_5fnoop_36',['basic_noop',['../classstdex_1_1parser_1_1basic__noop.html',1,'stdex::parser']]], - ['basic_5fostreamfmt_37',['basic_ostreamfmt',['../classstdex_1_1basic__ostreamfmt.html',1,'stdex']]], - ['basic_5fparser_38',['basic_parser',['../classstdex_1_1parser_1_1basic__parser.html',1,'stdex::parser']]], - ['basic_5fparser_3c_20char_20_3e_39',['basic_parser< char >',['../classstdex_1_1parser_1_1basic__parser.html',1,'stdex::parser']]], - ['basic_5fpermutation_40',['basic_permutation',['../classstdex_1_1parser_1_1basic__permutation.html',1,'stdex::parser']]], - ['basic_5fphone_5fnumber_41',['basic_phone_number',['../classstdex_1_1parser_1_1basic__phone__number.html',1,'stdex::parser']]], - ['basic_5fpunct_5fcu_42',['basic_punct_cu',['../classstdex_1_1parser_1_1basic__punct__cu.html',1,'stdex::parser']]], - ['basic_5fpunct_5fcu_3c_20char_20_3e_43',['basic_punct_cu< char >',['../classstdex_1_1parser_1_1basic__punct__cu.html',1,'stdex::parser']]], - ['basic_5froman_5fnumeral_44',['basic_roman_numeral',['../classstdex_1_1parser_1_1basic__roman__numeral.html',1,'stdex::parser']]], - ['basic_5fscientific_5fnumeral_45',['basic_scientific_numeral',['../classstdex_1_1parser_1_1basic__scientific__numeral.html',1,'stdex::parser']]], - ['basic_5fscore_46',['basic_score',['../classstdex_1_1parser_1_1basic__score.html',1,'stdex::parser']]], - ['basic_5fsequence_47',['basic_sequence',['../classstdex_1_1parser_1_1basic__sequence.html',1,'stdex::parser']]], - ['basic_5fset_48',['basic_set',['../classstdex_1_1parser_1_1basic__set.html',1,'stdex::parser']]], - ['basic_5fset_3c_20char_20_3e_49',['basic_set< char >',['../classstdex_1_1parser_1_1basic__set.html',1,'stdex::parser']]], - ['basic_5fsharedstrbuf_50',['basic_sharedstrbuf',['../classstdex_1_1basic__sharedstrbuf.html',1,'stdex']]], - ['basic_5fsigned_5fnumeral_51',['basic_signed_numeral',['../classstdex_1_1parser_1_1basic__signed__numeral.html',1,'stdex::parser']]], - ['basic_5fspace_5fcu_52',['basic_space_cu',['../classstdex_1_1parser_1_1basic__space__cu.html',1,'stdex::parser']]], - ['basic_5fspace_5fcu_3c_20char_20_3e_53',['basic_space_cu< char >',['../classstdex_1_1parser_1_1basic__space__cu.html',1,'stdex::parser']]], - ['basic_5fspace_5for_5fpunct_5fcu_54',['basic_space_or_punct_cu',['../classstdex_1_1parser_1_1basic__space__or__punct__cu.html',1,'stdex::parser']]], - ['basic_5fspace_5for_5fpunct_5fcu_3c_20char_20_3e_55',['basic_space_or_punct_cu< char >',['../classstdex_1_1parser_1_1basic__space__or__punct__cu.html',1,'stdex::parser']]], - ['basic_5fstring_56',['basic_string',['../classstdex_1_1parser_1_1basic__string.html',1,'stdex::parser']]], - ['basic_5fstring_5fbranch_57',['basic_string_branch',['../classstdex_1_1parser_1_1basic__string__branch.html',1,'stdex::parser']]], - ['basic_5fstringstream_58',['basic_stringstream',['../classstdex_1_1basic__stringstream.html#ab394645b71493be2725cd87c927b79fa',1,'stdex::basic_stringstream::basic_stringstream(const std::basic_string< _Elem2, _Traits2, _Alloc2 > &filename, std::ios_base::openmode mode=std::ios_base::in, int prot=std::ios_base::_Default_open_prot)'],['../classstdex_1_1basic__stringstream.html#a2b348acda5a00a457b177a121666c074',1,'stdex::basic_stringstream::basic_stringstream(const T *filename, std::ios_base::openmode mode=std::ios_base::in, int prot=std::ios_base::_Default_open_prot)'],['../classstdex_1_1basic__stringstream.html',1,'stdex::basic_stringstream< _Elem, _Traits, _Alloc >']]], - ['basic_5ftime_59',['basic_time',['../classstdex_1_1parser_1_1basic__time.html',1,'stdex::parser']]], - ['basic_5furl_60',['basic_url',['../classstdex_1_1parser_1_1basic__url.html',1,'stdex::parser']]], - ['basic_5furl_5fpassword_5fchar_61',['basic_url_password_char',['../classstdex_1_1parser_1_1basic__url__password__char.html',1,'stdex::parser']]], - ['basic_5furl_5fpassword_5fchar_3c_20char_20_3e_62',['basic_url_password_char< char >',['../classstdex_1_1parser_1_1basic__url__password__char.html',1,'stdex::parser']]], - ['basic_5furl_5fpath_63',['basic_url_path',['../classstdex_1_1parser_1_1basic__url__path.html',1,'stdex::parser']]], - ['basic_5furl_5fpath_5fchar_64',['basic_url_path_char',['../classstdex_1_1parser_1_1basic__url__path__char.html',1,'stdex::parser']]], - ['basic_5furl_5fpath_5fchar_3c_20char_20_3e_65',['basic_url_path_char< char >',['../classstdex_1_1parser_1_1basic__url__path__char.html',1,'stdex::parser']]], - ['basic_5furl_5fusername_5fchar_66',['basic_url_username_char',['../classstdex_1_1parser_1_1basic__url__username__char.html',1,'stdex::parser']]], - ['basic_5furl_5fusername_5fchar_3c_20char_20_3e_67',['basic_url_username_char< char >',['../classstdex_1_1parser_1_1basic__url__username__char.html',1,'stdex::parser']]], - ['buf_68',['buf',['../classstdex_1_1base64__enc.html#aea9a31d698c85699d492b095ea569d73',1,'stdex::base64_enc::buf'],['../classstdex_1_1base64__dec.html#a4080daff84dfd499b3a15fe876ada2ca',1,'stdex::base64_dec::buf'],['../classstdex_1_1hex__dec.html#a47a6b05d03e3cd075fe74505675b5126',1,'stdex::hex_dec::buf']]] + ['basic_5finteger_21',['basic_integer',['../classstdex_1_1parser_1_1basic__integer.html',1,'stdex::parser']]], + ['basic_5finteger10_22',['basic_integer10',['../classstdex_1_1parser_1_1basic__integer10.html',1,'stdex::parser']]], + ['basic_5finteger10ts_23',['basic_integer10ts',['../classstdex_1_1parser_1_1basic__integer10ts.html',1,'stdex::parser']]], + ['basic_5finteger16_24',['basic_integer16',['../classstdex_1_1parser_1_1basic__integer16.html',1,'stdex::parser']]], + ['basic_5fipv4_5faddress_25',['basic_ipv4_address',['../classstdex_1_1parser_1_1basic__ipv4__address.html',1,'stdex::parser']]], + ['basic_5fipv6_5faddress_26',['basic_ipv6_address',['../classstdex_1_1parser_1_1basic__ipv6__address.html',1,'stdex::parser']]], + ['basic_5fipv6_5fscope_5fid_5fchar_27',['basic_ipv6_scope_id_char',['../classstdex_1_1parser_1_1basic__ipv6__scope__id__char.html',1,'stdex::parser']]], + ['basic_5fiterations_28',['basic_iterations',['../classstdex_1_1parser_1_1basic__iterations.html',1,'stdex::parser']]], + ['basic_5fjson_5fstring_29',['basic_json_string',['../classstdex_1_1parser_1_1basic__json__string.html',1,'stdex::parser']]], + ['basic_5fmixed_5fnumeral_30',['basic_mixed_numeral',['../classstdex_1_1parser_1_1basic__mixed__numeral.html',1,'stdex::parser']]], + ['basic_5fmonetary_5fnumeral_31',['basic_monetary_numeral',['../classstdex_1_1parser_1_1basic__monetary__numeral.html',1,'stdex::parser']]], + ['basic_5fnoop_32',['basic_noop',['../classstdex_1_1parser_1_1basic__noop.html',1,'stdex::parser']]], + ['basic_5fparser_33',['basic_parser',['../classstdex_1_1parser_1_1basic__parser.html',1,'stdex::parser']]], + ['basic_5fparser_3c_20char_20_3e_34',['basic_parser< char >',['../classstdex_1_1parser_1_1basic__parser.html',1,'stdex::parser']]], + ['basic_5fpermutation_35',['basic_permutation',['../classstdex_1_1parser_1_1basic__permutation.html',1,'stdex::parser']]], + ['basic_5fphone_5fnumber_36',['basic_phone_number',['../classstdex_1_1parser_1_1basic__phone__number.html',1,'stdex::parser']]], + ['basic_5fpunct_5fcu_37',['basic_punct_cu',['../classstdex_1_1parser_1_1basic__punct__cu.html',1,'stdex::parser']]], + ['basic_5fpunct_5fcu_3c_20char_20_3e_38',['basic_punct_cu< char >',['../classstdex_1_1parser_1_1basic__punct__cu.html',1,'stdex::parser']]], + ['basic_5froman_5fnumeral_39',['basic_roman_numeral',['../classstdex_1_1parser_1_1basic__roman__numeral.html',1,'stdex::parser']]], + ['basic_5fscientific_5fnumeral_40',['basic_scientific_numeral',['../classstdex_1_1parser_1_1basic__scientific__numeral.html',1,'stdex::parser']]], + ['basic_5fscore_41',['basic_score',['../classstdex_1_1parser_1_1basic__score.html',1,'stdex::parser']]], + ['basic_5fsequence_42',['basic_sequence',['../classstdex_1_1parser_1_1basic__sequence.html',1,'stdex::parser']]], + ['basic_5fset_43',['basic_set',['../classstdex_1_1parser_1_1basic__set.html',1,'stdex::parser']]], + ['basic_5fset_3c_20char_20_3e_44',['basic_set< char >',['../classstdex_1_1parser_1_1basic__set.html',1,'stdex::parser']]], + ['basic_5fsigned_5fnumeral_45',['basic_signed_numeral',['../classstdex_1_1parser_1_1basic__signed__numeral.html',1,'stdex::parser']]], + ['basic_5fspace_5fcu_46',['basic_space_cu',['../classstdex_1_1parser_1_1basic__space__cu.html',1,'stdex::parser']]], + ['basic_5fspace_5fcu_3c_20char_20_3e_47',['basic_space_cu< char >',['../classstdex_1_1parser_1_1basic__space__cu.html',1,'stdex::parser']]], + ['basic_5fspace_5for_5fpunct_5fcu_48',['basic_space_or_punct_cu',['../classstdex_1_1parser_1_1basic__space__or__punct__cu.html',1,'stdex::parser']]], + ['basic_5fspace_5for_5fpunct_5fcu_3c_20char_20_3e_49',['basic_space_or_punct_cu< char >',['../classstdex_1_1parser_1_1basic__space__or__punct__cu.html',1,'stdex::parser']]], + ['basic_5fstring_50',['basic_string',['../classstdex_1_1parser_1_1basic__string.html',1,'stdex::parser']]], + ['basic_5fstring_5fbranch_51',['basic_string_branch',['../classstdex_1_1parser_1_1basic__string__branch.html',1,'stdex::parser']]], + ['basic_5fsys_52',['basic_sys',['../classstdex_1_1stream_1_1basic__sys.html',1,'stdex::stream']]], + ['basic_5ftime_53',['basic_time',['../classstdex_1_1parser_1_1basic__time.html',1,'stdex::parser']]], + ['basic_5furl_54',['basic_url',['../classstdex_1_1parser_1_1basic__url.html',1,'stdex::parser']]], + ['basic_5furl_5fpassword_5fchar_55',['basic_url_password_char',['../classstdex_1_1parser_1_1basic__url__password__char.html',1,'stdex::parser']]], + ['basic_5furl_5fpassword_5fchar_3c_20char_20_3e_56',['basic_url_password_char< char >',['../classstdex_1_1parser_1_1basic__url__password__char.html',1,'stdex::parser']]], + ['basic_5furl_5fpath_57',['basic_url_path',['../classstdex_1_1parser_1_1basic__url__path.html',1,'stdex::parser']]], + ['basic_5furl_5fpath_5fchar_58',['basic_url_path_char',['../classstdex_1_1parser_1_1basic__url__path__char.html',1,'stdex::parser']]], + ['basic_5furl_5fpath_5fchar_3c_20char_20_3e_59',['basic_url_path_char< char >',['../classstdex_1_1parser_1_1basic__url__path__char.html',1,'stdex::parser']]], + ['basic_5furl_5fusername_5fchar_60',['basic_url_username_char',['../classstdex_1_1parser_1_1basic__url__username__char.html',1,'stdex::parser']]], + ['basic_5furl_5fusername_5fchar_3c_20char_20_3e_61',['basic_url_username_char< char >',['../classstdex_1_1parser_1_1basic__url__username__char.html',1,'stdex::parser']]], + ['buf_62',['buf',['../classstdex_1_1base64__enc.html#aea9a31d698c85699d492b095ea569d73',1,'stdex::base64_enc::buf'],['../classstdex_1_1base64__dec.html#a4080daff84dfd499b3a15fe876ada2ca',1,'stdex::base64_dec::buf'],['../classstdex_1_1hex__dec.html#a47a6b05d03e3cd075fe74505675b5126',1,'stdex::hex_dec::buf']]], + ['buffer_63',['buffer',['../classstdex_1_1stream_1_1buffer.html',1,'stdex::stream']]], + ['buffer_5ft_64',['buffer_t',['../structstdex_1_1stream_1_1buffer_1_1buffer__t.html',1,'stdex::stream::buffer']]], + ['buffered_5fsys_65',['buffered_sys',['../classstdex_1_1stream_1_1buffered__sys.html',1,'stdex::stream']]] ]; diff --git a/search/all_10.js b/search/all_10.js index 0ff4a9fd7..e3e137797 100644 --- a/search/all_10.js +++ b/search/all_10.js @@ -1,6 +1,40 @@ var searchData= [ - ['tail_0',['tail',['../classstdex_1_1vector__queue.html#a1b87831a03da17b15d8c330a47708d00',1,'stdex::vector_queue']]], - ['token_1',['token',['../classstdex_1_1parser_1_1http__value.html#aecdecacd265379c1d6e12a75424c5573',1,'stdex::parser::http_value']]], - ['truncate_2',['truncate',['../classstdex_1_1basic__fstream.html#a1bd50e0c0e4cd1f3e6c6919df8417d3d',1,'stdex::basic_fstream']]] + ['save_0',['save',['../classstdex_1_1stream_1_1memory__file.html#aef50ff3c88577d89d83ee625cc5d1bfd',1,'stdex::stream::memory_file']]], + ['scope_5fid_1',['scope_id',['../classstdex_1_1parser_1_1basic__ipv6__address.html#a67486e83888f48afc62b031f745012c0',1,'stdex::parser::basic_ipv6_address']]], + ['seek_2',['seek',['../classstdex_1_1stream_1_1diag__file.html#a9f616580a2547b37beccd7d114ed06d0',1,'stdex::stream::diag_file::seek()'],['../classstdex_1_1stream_1_1memory__file.html#a9e67e40e9e3c0f7b002fcdab5220b4e7',1,'stdex::stream::memory_file::seek()'],['../classstdex_1_1stream_1_1file.html#acdfc1dc079ebeaeb05312e03925485ff',1,'stdex::stream::file::seek()'],['../classstdex_1_1stream_1_1cache.html#af2979118bdeca35cbfd84a8a2be00f8a',1,'stdex::stream::cache::seek()'],['../classstdex_1_1stream_1_1file__window.html#a53a12a1979b770030c0de05b349f1e55',1,'stdex::stream::file_window::seek()'],['../classstdex_1_1stream_1_1basic__file.html#afcaac612398bd7d02d8d146dcad74465',1,'stdex::stream::basic_file::seek(foff_t offset, seek_t how=seek_t::beg)=0']]], + ['seekbeg_3',['seekbeg',['../classstdex_1_1stream_1_1basic__file.html#a6a8da9a1b0a3926b9bc453bf0209ee5e',1,'stdex::stream::basic_file']]], + ['seekcur_4',['seekcur',['../classstdex_1_1stream_1_1basic__file.html#a8158cb89ef54a737b7bcfed635c215d6',1,'stdex::stream::basic_file']]], + ['seekend_5',['seekend',['../classstdex_1_1stream_1_1basic__file.html#ae13b5941415b3dbb9883c1da9bcd39c7',1,'stdex::stream::basic_file']]], + ['segments_6',['segments',['../classstdex_1_1parser_1_1http__url__path.html#a9a5f4002c55cb4500ce43536512b02b9',1,'stdex::parser::http_url_path']]], + ['set_7',['set',['../classstdex_1_1progress.html#acf3a29daf22709bf7e94e864c8be95a1',1,'stdex::progress::set()'],['../classstdex_1_1lazy__progress.html#a4e3e7a80da8cce7ccec69c78fcaaabae',1,'stdex::lazy_progress::set()'],['../classstdex_1_1global__progress.html#a76e66104444c77b89b687b4ad4945e8e',1,'stdex::global_progress::set()'],['../classstdex_1_1stream_1_1memory__file.html#a8ccb02a23999882255d5c16c83f91571',1,'stdex::stream::memory_file::set()']]], + ['set_5fatime_8',['set_atime',['../classstdex_1_1stream_1_1basic__file.html#ae76436514ac66d88bbd584ea07d879d0',1,'stdex::stream::basic_file::set_atime()'],['../classstdex_1_1stream_1_1cache.html#af026881969ee78e2aef1bf02922aea93',1,'stdex::stream::cache::set_atime()'],['../classstdex_1_1stream_1_1file.html#a64ded627a8843c155ea3a59b94c225f6',1,'stdex::stream::file::set_atime()']]], + ['set_5fctime_9',['set_ctime',['../classstdex_1_1stream_1_1cache.html#ae62a75156ff79910e1b9afc506e38e44',1,'stdex::stream::cache::set_ctime()'],['../classstdex_1_1stream_1_1basic__file.html#aba668e53fc4709cd545f12a49521ed56',1,'stdex::stream::basic_file::set_ctime()'],['../classstdex_1_1stream_1_1file.html#a337a27cd63975e155b6ba29a18ed9a23',1,'stdex::stream::file::set_ctime()']]], + ['set_5fglobal_5frange_10',['set_global_range',['../classstdex_1_1global__progress.html#ac68b491c62861fae1b16abb3477cb9c1',1,'stdex::global_progress']]], + ['set_5fmtime_11',['set_mtime',['../classstdex_1_1stream_1_1basic__file.html#a814a080cb6da2041013749cc125bfd2b',1,'stdex::stream::basic_file::set_mtime()'],['../classstdex_1_1stream_1_1cache.html#aafad7bfb4c03d0d56854b4c148ae0ee1',1,'stdex::stream::cache::set_mtime()'],['../classstdex_1_1stream_1_1file.html#a567620d1eb84032e460f3e173f9bd762',1,'stdex::stream::file::set_mtime()']]], + ['set_5frange_12',['set_range',['../classstdex_1_1progress.html#afbb1513bdb20340ebb21bd988f4e424a',1,'stdex::progress::set_range()'],['../classstdex_1_1lazy__progress.html#ada3a0d4f0086823558115a8064ffffb6',1,'stdex::lazy_progress::set_range()'],['../classstdex_1_1global__progress.html#afb204b820637c19b494976af4a284704',1,'stdex::global_progress::set_range(T start, T end)']]], + ['set_5fsection_5frange_13',['set_section_range',['../classstdex_1_1global__progress.html#a242009bce7ac595975bbfd703ec58c3b',1,'stdex::global_progress']]], + ['set_5ftext_14',['set_text',['../classstdex_1_1progress.html#a2cab8b5ac137d16fced31ee205264b01',1,'stdex::progress::set_text()'],['../classstdex_1_1global__progress.html#a89b7116003ab3b6344d90f130c14933e',1,'stdex::global_progress::set_text()']]], + ['sgml_5fany_5fcp_15',['sgml_any_cp',['../classstdex_1_1parser_1_1sgml__any__cp.html',1,'stdex::parser']]], + ['sgml_5fcp_16',['sgml_cp',['../classstdex_1_1parser_1_1sgml__cp.html',1,'stdex::parser']]], + ['sgml_5fcp_5fset_17',['sgml_cp_set',['../classstdex_1_1parser_1_1sgml__cp__set.html',1,'stdex::parser']]], + ['sgml_5fdns_5fdomain_5fchar_18',['sgml_dns_domain_char',['../classstdex_1_1parser_1_1sgml__dns__domain__char.html',1,'stdex::parser']]], + ['sgml_5fipv6_5fscope_5fid_5fchar_19',['sgml_ipv6_scope_id_char',['../classstdex_1_1parser_1_1sgml__ipv6__scope__id__char.html',1,'stdex::parser']]], + ['sgml_5fpunct_5fcp_20',['sgml_punct_cp',['../classstdex_1_1parser_1_1sgml__punct__cp.html',1,'stdex::parser']]], + ['sgml_5fspace_5fcp_21',['sgml_space_cp',['../classstdex_1_1parser_1_1sgml__space__cp.html',1,'stdex::parser']]], + ['sgml_5fspace_5for_5fpunct_5fcp_22',['sgml_space_or_punct_cp',['../classstdex_1_1parser_1_1sgml__space__or__punct__cp.html',1,'stdex::parser']]], + ['sgml_5fstring_23',['sgml_string',['../classstdex_1_1parser_1_1sgml__string.html',1,'stdex::parser']]], + ['sgml_5furl_5fpassword_5fchar_24',['sgml_url_password_char',['../classstdex_1_1parser_1_1sgml__url__password__char.html',1,'stdex::parser']]], + ['sgml_5furl_5fpath_5fchar_25',['sgml_url_path_char',['../classstdex_1_1parser_1_1sgml__url__path__char.html',1,'stdex::parser']]], + ['sgml_5furl_5fusername_5fchar_26',['sgml_url_username_char',['../classstdex_1_1parser_1_1sgml__url__username__char.html',1,'stdex::parser']]], + ['show_27',['show',['../classstdex_1_1progress.html#ab6e57aed9e7a18a501e8a63cef199d8e',1,'stdex::progress::show()'],['../classstdex_1_1global__progress.html#a32350e02d5904867402187e81a3c4a26',1,'stdex::global_progress::show()']]], + ['size_28',['size',['../classstdex_1_1stream_1_1file.html#acc591c2378e51340b7af7fbf12d1a98f',1,'stdex::stream::file::size()'],['../classstdex_1_1vector__queue.html#ad704df8c3664a6d3f3e0977d87162114',1,'stdex::vector_queue::size()'],['../classstdex_1_1stream_1_1diag__file.html#a0797e4eba9f702022e1c467694302871',1,'stdex::stream::diag_file::size()'],['../classstdex_1_1stream_1_1fifo.html#a3272bc89573fe75fe0e6de2600967c10',1,'stdex::stream::fifo::size()'],['../classstdex_1_1stream_1_1memory__file.html#a99b32855f1f85ccc7c08d71786c17a1c',1,'stdex::stream::memory_file::size()'],['../classstdex_1_1stream_1_1cache.html#a769034b8641a17210a916091b112af2d',1,'stdex::stream::cache::size()'],['../classstdex_1_1stream_1_1file__window.html#a70d596dd863a5265303aab11db59768e',1,'stdex::stream::file_window::size()'],['../classstdex_1_1stream_1_1basic__file.html#ad868d7c25aa45cefc95dd54a24febf2f',1,'stdex::stream::basic_file::size()'],['../structstdex_1_1interval.html#a8c5222bc73fc66ba78bfabc1b985c864',1,'stdex::interval::size()']]], + ['size_5ftype_29',['size_type',['../classstdex_1_1vector__queue.html#a2a044b4eb0242a00568d08b4d8b6343a',1,'stdex::vector_queue']]], + ['skip_30',['skip',['../classstdex_1_1stream_1_1file__window.html#a4202fcc2b9e69e40bf15aaa3b5f50dda',1,'stdex::stream::file_window::skip()'],['../classstdex_1_1stream_1_1basic__file.html#a15a1e6a778adefea421f32d14c8178dd',1,'stdex::stream::basic_file::skip()'],['../classstdex_1_1stream_1_1basic.html#a52ce3bdf28a9a7fc5a881616c8db2da4',1,'stdex::stream::basic::skip()']]], + ['special_5fsign_31',['special_sign',['../classstdex_1_1parser_1_1basic__signed__numeral.html#a38b8207e2b384ed5ffb3f2bfb3e8755f',1,'stdex::parser::basic_signed_numeral::special_sign'],['../classstdex_1_1parser_1_1basic__mixed__numeral.html#a46c6721810cc8f90218aee66a4c27132',1,'stdex::parser::basic_mixed_numeral::special_sign'],['../classstdex_1_1parser_1_1basic__scientific__numeral.html#a5ce9abfbcdc1247e8f504ae13492e7ea',1,'stdex::parser::basic_scientific_numeral::special_sign'],['../classstdex_1_1parser_1_1basic__monetary__numeral.html#af0190fa4b0de5e894a14c05550e78365',1,'stdex::parser::basic_monetary_numeral::special_sign']]], + ['start_32',['start',['../structstdex_1_1interval.html#ab6a104de0f15b29bea77fe181b49c40b',1,'stdex::interval']]], + ['state_33',['state',['../classstdex_1_1stream_1_1basic.html#a2aa36b007017c2052a0118c1df4910d0',1,'stdex::stream::basic']]], + ['string_34',['string',['../classstdex_1_1parser_1_1http__value.html#a808ed411ff6816162a54b99fb7307315',1,'stdex::parser::http_value']]], + ['sync_35',['sync',['../classstdex_1_1ring.html#a68e471c5801c9c8232464005a3225eb3',1,'stdex::ring']]], + ['sys_5fobject_36',['sys_object',['../classstdex_1_1sys__object.html',1,'stdex']]] ]; diff --git a/search/all_11.js b/search/all_11.js index b6fb500dc..89a1b0dee 100644 --- a/search/all_11.js +++ b/search/all_11.js @@ -1,4 +1,7 @@ var searchData= [ - ['user_5fcancelled_0',['user_cancelled',['../classstdex_1_1user__cancelled.html',1,'stdex::user_cancelled'],['../classstdex_1_1user__cancelled.html#a69f77539ead37dbd249143ad4b4048bd',1,'stdex::user_cancelled::user_cancelled()']]] + ['tail_0',['tail',['../classstdex_1_1vector__queue.html#a1b87831a03da17b15d8c330a47708d00',1,'stdex::vector_queue']]], + ['tell_1',['tell',['../classstdex_1_1stream_1_1basic__file.html#ae072990f9c42b372048045717de438c3',1,'stdex::stream::basic_file::tell()'],['../classstdex_1_1stream_1_1file__window.html#ac5977ca09563126e2976abb356cb3b36',1,'stdex::stream::file_window::tell()'],['../classstdex_1_1stream_1_1cache.html#ae790c5f526771cfe2cb3b28d38a11dd9',1,'stdex::stream::cache::tell()'],['../classstdex_1_1stream_1_1file.html#aead21702bfdb09193a202afbce35421b',1,'stdex::stream::file::tell()'],['../classstdex_1_1stream_1_1memory__file.html#a665d78bdb906762139530035ba6013fa',1,'stdex::stream::memory_file::tell()'],['../classstdex_1_1stream_1_1diag__file.html#aa4ea6e5ca1ff91a6f5c9726f4251f3ce',1,'stdex::stream::diag_file::tell()']]], + ['token_2',['token',['../classstdex_1_1parser_1_1http__value.html#aecdecacd265379c1d6e12a75424c5573',1,'stdex::parser::http_value']]], + ['truncate_3',['truncate',['../classstdex_1_1stream_1_1basic__file.html#a522305da60cc442ca3cd6b7aa2214d6e',1,'stdex::stream::basic_file::truncate()'],['../classstdex_1_1stream_1_1file__window.html#a10f67434e8f3784933e3f7fddd20ce54',1,'stdex::stream::file_window::truncate()'],['../classstdex_1_1stream_1_1cache.html#a2e19026e55cda14db786948b66d63aba',1,'stdex::stream::cache::truncate()'],['../classstdex_1_1stream_1_1file.html#aa1c4de0bca72ddc02db4e8328cefcf17',1,'stdex::stream::file::truncate()'],['../classstdex_1_1stream_1_1memory__file.html#aa35db1681e5c56046eaf0c70068b0d42',1,'stdex::stream::memory_file::truncate()'],['../classstdex_1_1stream_1_1diag__file.html#a1d0824a191f261a1c552b71a92584745',1,'stdex::stream::diag_file::truncate()']]] ]; diff --git a/search/all_12.js b/search/all_12.js index 9ce86b37b..4248b1a41 100644 --- a/search/all_12.js +++ b/search/all_12.js @@ -1,8 +1,5 @@ var searchData= [ - ['value_0',['value',['../classstdex_1_1parser_1_1basic__integer.html#ac42a57e08e8189c89817bfde6e507c95',1,'stdex::parser::basic_integer::value'],['../classstdex_1_1parser_1_1basic__scientific__numeral.html#a9aa6f1cbde1efccf75fd0df385f03477',1,'stdex::parser::basic_scientific_numeral::value'],['../classstdex_1_1parser_1_1basic__ipv4__address.html#ad50e8e52cf16226e57fa25e48bf17deb',1,'stdex::parser::basic_ipv4_address::value'],['../classstdex_1_1parser_1_1basic__ipv6__address.html#aee9fca8501ba3cd5e5c875ecdb419376',1,'stdex::parser::basic_ipv6_address::value'],['../classstdex_1_1parser_1_1basic__phone__number.html#aa0650f9f19dfe2d50bcdd79884dd6475',1,'stdex::parser::basic_phone_number::value'],['../classstdex_1_1parser_1_1http__parameter.html#a616b1cd7f872c3ff453c8d854a7db638',1,'stdex::parser::http_parameter::value'],['../classstdex_1_1parser_1_1http__weight.html#ac889015ae4b2640eaf067b343f7c05ff',1,'stdex::parser::http_weight::value'],['../classstdex_1_1parser_1_1http__cookie.html#add653aef947c19d25730adc728089a9f',1,'stdex::parser::http_cookie::value']]], - ['value_5ftype_1',['value_type',['../classstdex_1_1vector__queue.html#aa1f9e69fd453bc2a2e72cf937a50995e',1,'stdex::vector_queue']]], - ['vector_5fqueue_2',['vector_queue',['../classstdex_1_1vector__queue.html',1,'stdex::vector_queue< T >'],['../classstdex_1_1vector__queue.html#a9cb327539aca0293920c0d436c6ea29b',1,'stdex::vector_queue::vector_queue(size_type size_max)'],['../classstdex_1_1vector__queue.html#a224fc214f514bb6dd333511613d89683',1,'stdex::vector_queue::vector_queue(const vector_queue< value_type > &other)'],['../classstdex_1_1vector__queue.html#a50fcb4c564c100ad02f963969572a7fb',1,'stdex::vector_queue::vector_queue(vector_queue< value_type > &&other)']]], - ['version_3',['version',['../classstdex_1_1parser_1_1http__protocol.html#a49afaa7910baf6092f5042eca86824c7',1,'stdex::parser::http_protocol']]], - ['vprintf_4',['vprintf',['../classstdex_1_1basic__ostreamfmt.html#a6b57c4ecee218d7fbb2128727fe4edd9',1,'stdex::basic_ostreamfmt']]] + ['unlock_0',['unlock',['../classstdex_1_1stream_1_1basic__file.html#adf1a39e7aec3f14fedf6ce5c0984a791',1,'stdex::stream::basic_file::unlock()'],['../classstdex_1_1stream_1_1file__window.html#ac3d9a3cf3636010b43612d2c298e7c3d',1,'stdex::stream::file_window::unlock()'],['../classstdex_1_1stream_1_1cache.html#a7a15ab17abc847b380b13b43b4f1d12e',1,'stdex::stream::cache::unlock()'],['../classstdex_1_1stream_1_1file.html#a28e6d46e4183e094ef9fdcf591ebec46',1,'stdex::stream::file::unlock()'],['../classstdex_1_1stream_1_1diag__file.html#a9f0c158f4875c862f981282b818e7296',1,'stdex::stream::diag_file::unlock()']]], + ['user_5fcancelled_1',['user_cancelled',['../classstdex_1_1user__cancelled.html',1,'stdex::user_cancelled'],['../classstdex_1_1user__cancelled.html#a69f77539ead37dbd249143ad4b4048bd',1,'stdex::user_cancelled::user_cancelled()']]] ]; diff --git a/search/all_13.js b/search/all_13.js index 2d0adf0d9..9a1b09106 100644 --- a/search/all_13.js +++ b/search/all_13.js @@ -1,4 +1,7 @@ var searchData= [ - ['_7evector_5fqueue_0',['~vector_queue',['../classstdex_1_1vector__queue.html#a61460b8386f0ebc0a9c76db9951d342d',1,'stdex::vector_queue']]] + ['value_0',['value',['../classstdex_1_1parser_1_1basic__integer.html#ac42a57e08e8189c89817bfde6e507c95',1,'stdex::parser::basic_integer::value'],['../classstdex_1_1parser_1_1basic__scientific__numeral.html#a9aa6f1cbde1efccf75fd0df385f03477',1,'stdex::parser::basic_scientific_numeral::value'],['../classstdex_1_1parser_1_1basic__ipv4__address.html#ad50e8e52cf16226e57fa25e48bf17deb',1,'stdex::parser::basic_ipv4_address::value'],['../classstdex_1_1parser_1_1basic__ipv6__address.html#aee9fca8501ba3cd5e5c875ecdb419376',1,'stdex::parser::basic_ipv6_address::value'],['../classstdex_1_1parser_1_1basic__phone__number.html#aa0650f9f19dfe2d50bcdd79884dd6475',1,'stdex::parser::basic_phone_number::value'],['../classstdex_1_1parser_1_1http__parameter.html#a616b1cd7f872c3ff453c8d854a7db638',1,'stdex::parser::http_parameter::value'],['../classstdex_1_1parser_1_1http__weight.html#ac889015ae4b2640eaf067b343f7c05ff',1,'stdex::parser::http_weight::value'],['../classstdex_1_1parser_1_1http__cookie.html#add653aef947c19d25730adc728089a9f',1,'stdex::parser::http_cookie::value']]], + ['value_5ftype_1',['value_type',['../classstdex_1_1vector__queue.html#aa1f9e69fd453bc2a2e72cf937a50995e',1,'stdex::vector_queue']]], + ['vector_5fqueue_2',['vector_queue',['../classstdex_1_1vector__queue.html',1,'stdex::vector_queue< T >'],['../classstdex_1_1vector__queue.html#a9cb327539aca0293920c0d436c6ea29b',1,'stdex::vector_queue::vector_queue(size_type size_max)'],['../classstdex_1_1vector__queue.html#a224fc214f514bb6dd333511613d89683',1,'stdex::vector_queue::vector_queue(const vector_queue< value_type > &other)'],['../classstdex_1_1vector__queue.html#a50fcb4c564c100ad02f963969572a7fb',1,'stdex::vector_queue::vector_queue(vector_queue< value_type > &&other)']]], + ['version_3',['version',['../classstdex_1_1parser_1_1http__protocol.html#a49afaa7910baf6092f5042eca86824c7',1,'stdex::parser::http_protocol']]] ]; diff --git a/search/all_14.js b/search/all_14.js new file mode 100644 index 000000000..dbde63688 --- /dev/null +++ b/search/all_14.js @@ -0,0 +1,16 @@ +var searchData= +[ + ['window_0',['window',['../classstdex_1_1stream_1_1window.html',1,'stdex::stream']]], + ['worker_1',['worker',['../classstdex_1_1stream_1_1replicator_1_1worker.html',1,'stdex::stream::replicator']]], + ['write_2',['write',['../classstdex_1_1stream_1_1basic.html#ad8af0444273509eb36ad81046ac92081',1,'stdex::stream::basic::write()'],['../classstdex_1_1stream_1_1converter.html#ae84a5c8d64942dbaa81ed54a181b3d7a',1,'stdex::stream::converter::write()'],['../classstdex_1_1stream_1_1replicator.html#abbbaa912a887b00a4a7a5d518079f5ec',1,'stdex::stream::replicator::write()'],['../classstdex_1_1stream_1_1async__writer.html#a39d3fc4fffb8aa9b971fa15beaa8149b',1,'stdex::stream::async_writer::write()'],['../classstdex_1_1stream_1_1buffer.html#a489a01a4c187e85f06ebe10314a891ae',1,'stdex::stream::buffer::write()'],['../classstdex_1_1stream_1_1limiter.html#a8fe783b504f019e29034c0572cec7834',1,'stdex::stream::limiter::write()'],['../classstdex_1_1stream_1_1window.html#a06f05191c35fdbadebc49e05a19d9f3c',1,'stdex::stream::window::write()'],['../classstdex_1_1stream_1_1file__window.html#a7a264381cf344fcd6fa70e0a4964cc93',1,'stdex::stream::file_window::write()'],['../classstdex_1_1stream_1_1cache.html#ac436fbcac7eddf95b6e25d6368da3fb7',1,'stdex::stream::cache::write()'],['../classstdex_1_1stream_1_1basic__sys.html#a06666e09bf1e7486d277996267b51618',1,'stdex::stream::basic_sys::write()'],['../classstdex_1_1stream_1_1memory__file.html#ae5b6602e176f1053ab2eef88d8312b49',1,'stdex::stream::memory_file::write()'],['../classstdex_1_1stream_1_1fifo.html#a30c7adb43b6f4bd0cb5d9c72f15fe9bf',1,'stdex::stream::fifo::write()'],['../classstdex_1_1stream_1_1diag__file.html#a3157aee8e9c754b02e876897fcb82236',1,'stdex::stream::diag_file::write()']]], + ['write_5farray_3',['write_array',['../classstdex_1_1stream_1_1basic.html#a248d5e688633f04139ee36aacc0258ad',1,'stdex::stream::basic::write_array(_In_reads_or_z_opt_(num_chars) const wchar_t *wstr, size_t num_chars, charset_id charset)'],['../classstdex_1_1stream_1_1basic.html#af6c10ec4ab181b5ed5b061d115059b7a',1,'stdex::stream::basic::write_array(_In_reads_bytes_opt_(size *count) const void *array, size_t size, size_t count)']]], + ['write_5fbyte_4',['write_byte',['../classstdex_1_1stream_1_1basic.html#af83cd6902f3f3bf18df2f08045570603',1,'stdex::stream::basic::write_byte()'],['../classstdex_1_1stream_1_1memory__file.html#a7d2187e9f98729b2c711a9cd242b7fc2',1,'stdex::stream::memory_file::write_byte()']]], + ['write_5fcharset_5',['write_charset',['../classstdex_1_1stream_1_1basic.html#ab61abc19936554288ea929e0eb299144',1,'stdex::stream::basic']]], + ['write_5fdata_6',['write_data',['../classstdex_1_1stream_1_1basic.html#acabab42a910d149fec6ef60090a34aab',1,'stdex::stream::basic::write_data()'],['../classstdex_1_1stream_1_1memory__file.html#ab0bcf389dd3540a5f978ef13dff5d332',1,'stdex::stream::memory_file::write_data()']]], + ['write_5flimit_7',['write_limit',['../classstdex_1_1stream_1_1limiter.html#af3d8db598efea694c0274b5420787873',1,'stdex::stream::limiter']]], + ['write_5foffset_8',['write_offset',['../classstdex_1_1stream_1_1window.html#a01d191d653be7a6d218c7feffa1b0ec3',1,'stdex::stream::window']]], + ['write_5fsprintf_9',['write_sprintf',['../classstdex_1_1stream_1_1basic.html#a63528d1cf030257c9d7f24d0d1d668f7',1,'stdex::stream::basic::write_sprintf(_Printf_format_string_params_(2) const char *format, locale_t locale,...)'],['../classstdex_1_1stream_1_1basic.html#a32f854944dc108d99c5ea5e87b19db7e',1,'stdex::stream::basic::write_sprintf(_Printf_format_string_params_(2) const wchar_t *format, locale_t locale,...)']]], + ['write_5fstr_10',['write_str',['../classstdex_1_1stream_1_1basic.html#a815369ef1a8ba07b289b8236fce018ac',1,'stdex::stream::basic::write_str()'],['../classstdex_1_1stream_1_1memory__file.html#ab8326c16c06548801982b07c930d7dfd',1,'stdex::stream::memory_file::write_str()']]], + ['write_5fstream_11',['write_stream',['../classstdex_1_1stream_1_1basic.html#ad28b193e6afa1352a00864bd28193cc2',1,'stdex::stream::basic::write_stream()'],['../classstdex_1_1stream_1_1memory__file.html#a4216e7ae6e306170357aef1ea1c304c7',1,'stdex::stream::memory_file::write_stream()']]], + ['write_5fvsprintf_12',['write_vsprintf',['../classstdex_1_1stream_1_1basic.html#a14931af91db2bab8204d6352a59c1bf7',1,'stdex::stream::basic::write_vsprintf(_Printf_format_string_params_(2) const char *format, locale_t locale, va_list params)'],['../classstdex_1_1stream_1_1basic.html#a3a7ac9211cd81b2203b55f1a2f131bc1',1,'stdex::stream::basic::write_vsprintf(_Printf_format_string_params_(2) const wchar_t *format, locale_t locale, va_list params)']]] +]; diff --git a/search/all_15.js b/search/all_15.js new file mode 100644 index 000000000..2d0adf0d9 --- /dev/null +++ b/search/all_15.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['_7evector_5fqueue_0',['~vector_queue',['../classstdex_1_1vector__queue.html#a61460b8386f0ebc0a9c76db9951d342d',1,'stdex::vector_queue']]] +]; diff --git a/search/all_2.js b/search/all_2.js index 6b870c98b..7d283cd10 100644 --- a/search/all_2.js +++ b/search/all_2.js @@ -1,12 +1,18 @@ var searchData= [ - ['cancel_0',['cancel',['../classstdex_1_1progress.html#a03380c822297092b3bb9867deee26202',1,'stdex::progress::cancel()'],['../classstdex_1_1global__progress.html#a74a5ea9089ff7b7015ea4a2071f3113e',1,'stdex::global_progress::cancel()']]], - ['capacity_1',['capacity',['../classstdex_1_1vector__queue.html#add3d6ed93d3c1471b80351c56639bab7',1,'stdex::vector_queue']]], - ['clear_2',['clear',['../classstdex_1_1base64__enc.html#afb6a85176589d9ce1f65ce6355592fe7',1,'stdex::base64_enc::clear()'],['../classstdex_1_1base64__dec.html#a94738b63789489022e0c16063b732305',1,'stdex::base64_dec::clear()'],['../classstdex_1_1hex__dec.html#a282bf5db0d16b29b12c71b73d3a33cc4',1,'stdex::hex_dec::clear()'],['../classstdex_1_1vector__queue.html#a93259be5f471580d2f8d7bee41032f9b',1,'stdex::vector_queue::clear()']]], - ['close_3',['close',['../classstdex_1_1idrec_1_1record.html#ae63ba9487daaf8ec39dfe7dd04c13cc9',1,'stdex::idrec::record']]], - ['components_4',['components',['../classstdex_1_1parser_1_1basic__ipv4__address.html#a0dfb21ee671894048c831edef7257931',1,'stdex::parser::basic_ipv4_address::components'],['../classstdex_1_1parser_1_1basic__ipv6__address.html#abe14c21fb1d4cb35c0121ca610e6e87e',1,'stdex::parser::basic_ipv6_address::components']]], - ['const_5fpointer_5',['const_pointer',['../classstdex_1_1vector__queue.html#a0da411250e23047a37c4ac09abfa109d',1,'stdex::vector_queue']]], - ['const_5freference_6',['const_reference',['../classstdex_1_1vector__queue.html#afc37b516c234d4be0102412b28f46562',1,'stdex::vector_queue']]], - ['content_7',['content',['../classstdex_1_1parser_1_1http__quoted__string.html#ab6e413ccf79e9f3dddd35c2a607381dd',1,'stdex::parser::http_quoted_string']]], - ['currency_8',['currency',['../classstdex_1_1parser_1_1basic__monetary__numeral.html#a62545d1c49178d4412da46d3cb2eba25',1,'stdex::parser::basic_monetary_numeral']]] + ['cache_0',['cache',['../classstdex_1_1stream_1_1cache.html',1,'stdex::stream']]], + ['cache_5ft_1',['cache_t',['../structstdex_1_1stream_1_1cache_1_1cache__t.html',1,'stdex::stream::cache']]], + ['cached_5ffile_2',['cached_file',['../classstdex_1_1stream_1_1cached__file.html#aace5ebb17927a869e6e923b592d8b3da',1,'stdex::stream::cached_file::cached_file()'],['../classstdex_1_1stream_1_1cached__file.html',1,'stdex::stream::cached_file']]], + ['cancel_3',['cancel',['../classstdex_1_1progress.html#a03380c822297092b3bb9867deee26202',1,'stdex::progress::cancel()'],['../classstdex_1_1global__progress.html#a74a5ea9089ff7b7015ea4a2071f3113e',1,'stdex::global_progress::cancel()']]], + ['capacity_4',['capacity',['../classstdex_1_1vector__queue.html#add3d6ed93d3c1471b80351c56639bab7',1,'stdex::vector_queue']]], + ['clear_5',['clear',['../classstdex_1_1base64__enc.html#afb6a85176589d9ce1f65ce6355592fe7',1,'stdex::base64_enc::clear()'],['../classstdex_1_1base64__dec.html#a94738b63789489022e0c16063b732305',1,'stdex::base64_dec::clear()'],['../classstdex_1_1hex__dec.html#a282bf5db0d16b29b12c71b73d3a33cc4',1,'stdex::hex_dec::clear()'],['../classstdex_1_1vector__queue.html#a93259be5f471580d2f8d7bee41032f9b',1,'stdex::vector_queue::clear()']]], + ['close_6',['close',['../classstdex_1_1sys__object.html#acbb82c6c1fce7ee39518f94b1209b0b8',1,'stdex::sys_object::close(sys_handle h)'],['../classstdex_1_1sys__object.html#ab8c0119bc4958f78f51ef2f3b7c91f66',1,'stdex::sys_object::close()'],['../classstdex_1_1stream_1_1diag__file.html#a4367a6d2840c1a2c5d9ab2ab3483ed2c',1,'stdex::stream::diag_file::close()'],['../classstdex_1_1stream_1_1fifo.html#a29e0a95836f4e2692bea3783acaf692d',1,'stdex::stream::fifo::close()'],['../classstdex_1_1stream_1_1memory__file.html#a4cf33faaf1686335bd3e3a7e72813dd6',1,'stdex::stream::memory_file::close()'],['../classstdex_1_1stream_1_1basic__sys.html#aee56fbeb8b576a4337cb205ae865fafc',1,'stdex::stream::basic_sys::close()'],['../classstdex_1_1stream_1_1cache.html#aa88074bb669bcb654e027b76e32a2799',1,'stdex::stream::cache::close()'],['../classstdex_1_1stream_1_1file__window.html#acace60a7ba95a139852f85aa4232bb14',1,'stdex::stream::file_window::close()'],['../classstdex_1_1stream_1_1replicator.html#afa3e2cec6e254e7bb53cc5e1b1ea0f90',1,'stdex::stream::replicator::close()'],['../classstdex_1_1stream_1_1converter.html#a96c368204acf32239318a026762cd22c',1,'stdex::stream::converter::close()'],['../classstdex_1_1stream_1_1basic.html#a5392748c19b5799da94a5fe031f7ec3b',1,'stdex::stream::basic::close()'],['../classstdex_1_1idrec_1_1record.html#ae63ba9487daaf8ec39dfe7dd04c13cc9',1,'stdex::idrec::record::close()']]], + ['components_7',['components',['../classstdex_1_1parser_1_1basic__ipv4__address.html#a0dfb21ee671894048c831edef7257931',1,'stdex::parser::basic_ipv4_address::components'],['../classstdex_1_1parser_1_1basic__ipv6__address.html#abe14c21fb1d4cb35c0121ca610e6e87e',1,'stdex::parser::basic_ipv6_address::components']]], + ['const_5fpointer_8',['const_pointer',['../classstdex_1_1vector__queue.html#a0da411250e23047a37c4ac09abfa109d',1,'stdex::vector_queue']]], + ['const_5freference_9',['const_reference',['../classstdex_1_1vector__queue.html#afc37b516c234d4be0102412b28f46562',1,'stdex::vector_queue']]], + ['contains_10',['contains',['../structstdex_1_1interval.html#a1624ca77e8c9cb45cef61f7f8b532222',1,'stdex::interval']]], + ['content_11',['content',['../classstdex_1_1parser_1_1http__quoted__string.html#ab6e413ccf79e9f3dddd35c2a607381dd',1,'stdex::parser::http_quoted_string']]], + ['converter_12',['converter',['../classstdex_1_1stream_1_1converter.html',1,'stdex::stream']]], + ['ctime_13',['ctime',['../classstdex_1_1stream_1_1basic__file.html#a3c02c83246c43ed868dab1dd5a5d698d',1,'stdex::stream::basic_file::ctime()'],['../classstdex_1_1stream_1_1cache.html#a0306f70f169f924f41306c71646c9276',1,'stdex::stream::cache::ctime()'],['../classstdex_1_1stream_1_1file.html#aa54131619fe782de419ed74bab377dd5',1,'stdex::stream::file::ctime()']]], + ['currency_14',['currency',['../classstdex_1_1parser_1_1basic__monetary__numeral.html#a62545d1c49178d4412da46d3cb2eba25',1,'stdex::parser::basic_monetary_numeral']]] ]; diff --git a/search/all_3.js b/search/all_3.js index e0aaed13a..576b48008 100644 --- a/search/all_3.js +++ b/search/all_3.js @@ -1,11 +1,13 @@ var searchData= [ - ['data_0',['data',['../classstdex_1_1idrec_1_1record.html#a1ab09fae53142836c958a63137fb37cb',1,'stdex::idrec::record']]], + ['data_0',['data',['../classstdex_1_1idrec_1_1record.html#a1ab09fae53142836c958a63137fb37cb',1,'stdex::idrec::record::data'],['../classstdex_1_1stream_1_1replicator_1_1worker.html#af37e1df8c6e0189e856a2bb38dd603bf',1,'stdex::stream::replicator::worker::data'],['../classstdex_1_1stream_1_1memory__file.html#aff374fc64c7453dc0cef22f19bc400ce',1,'stdex::stream::memory_file::data()']]], ['dec_5fsize_1',['dec_size',['../classstdex_1_1base64__dec.html#a203f2afa5839242c1230cb22e0a65b25',1,'stdex::base64_dec::dec_size()'],['../classstdex_1_1hex__dec.html#acf3d5adf4766056a630d1ceeab946b55',1,'stdex::hex_dec::dec_size()']]], ['decimal_2',['decimal',['../classstdex_1_1parser_1_1basic__scientific__numeral.html#ab002d811ce7c7590863492bbc4ac355f',1,'stdex::parser::basic_scientific_numeral::decimal'],['../classstdex_1_1parser_1_1basic__monetary__numeral.html#ac1442f0871a1b43db2d4cd45e05803ac',1,'stdex::parser::basic_monetary_numeral::decimal']]], ['decimal_5fseparator_3',['decimal_separator',['../classstdex_1_1parser_1_1basic__scientific__numeral.html#ae09233c93964704acf2bbd762fc14372',1,'stdex::parser::basic_scientific_numeral::decimal_separator'],['../classstdex_1_1parser_1_1basic__monetary__numeral.html#a5393628850b747e190a4e0d50eb97144',1,'stdex::parser::basic_monetary_numeral::decimal_separator']]], ['decode_4',['decode',['../classstdex_1_1base64__dec.html#a1beaf09718d63d49f9d95cf0e75a50bf',1,'stdex::base64_dec::decode(std::vector< _Ty, _Ax > &out, bool &is_last, const _Tchr *data, size_t size)'],['../classstdex_1_1base64__dec.html#a4b5f0334d5d5f85b7d02b6b21db8759e',1,'stdex::base64_dec::decode(std::vector< _Ty, _Ax > &out)'],['../classstdex_1_1hex__dec.html#ab5ac7cfefa8db97c8196d1ef2c327406',1,'stdex::hex_dec::decode()']]], ['detach_5',['detach',['../classstdex_1_1global__progress.html#aa2c5391aa2f1f30e72a700768bc52f84',1,'stdex::global_progress']]], - ['digit_5fcount_6',['digit_count',['../classstdex_1_1parser_1_1basic__integer10ts.html#a3c400d7c6e0edf695e7cf5e9f43ae388',1,'stdex::parser::basic_integer10ts']]], - ['do_5fset_7',['do_set',['../classstdex_1_1lazy__progress.html#ad0242cb4f3ece8aacfaab8804e7c646e',1,'stdex::lazy_progress']]] + ['diag_5ffile_6',['diag_file',['../classstdex_1_1stream_1_1diag__file.html',1,'stdex::stream']]], + ['digit_5fcount_7',['digit_count',['../classstdex_1_1parser_1_1basic__integer10ts.html#a3c400d7c6e0edf695e7cf5e9f43ae388',1,'stdex::parser::basic_integer10ts']]], + ['do_5fset_8',['do_set',['../classstdex_1_1lazy__progress.html#ad0242cb4f3ece8aacfaab8804e7c646e',1,'stdex::lazy_progress']]], + ['duplicate_9',['duplicate',['../classstdex_1_1sys__object.html#abf438fb703eeed47147841b07b44d46d',1,'stdex::sys_object']]] ]; diff --git a/search/all_5.js b/search/all_5.js index 9817624b1..e4cdc7ad4 100644 --- a/search/all_5.js +++ b/search/all_5.js @@ -1,6 +1,10 @@ var searchData= [ - ['find_0',['find',['../classstdex_1_1idrec_1_1record.html#a19523040d07119055884a7a2f8ef25fd',1,'stdex::idrec::record']]], - ['fraction_1',['fraction',['../classstdex_1_1parser_1_1basic__mixed__numeral.html#a288fa70b3073080487d6d253600dca34',1,'stdex::parser::basic_mixed_numeral']]], - ['front_2',['front',['../classstdex_1_1vector__queue.html#a61df210878f6b8b2c1b213a93b8af581',1,'stdex::vector_queue::front()'],['../classstdex_1_1vector__queue.html#a96ea84ab879a3190beabdbac5ad7e0ab',1,'stdex::vector_queue::front() const']]] + ['fifo_0',['fifo',['../classstdex_1_1stream_1_1fifo.html',1,'stdex::stream']]], + ['file_1',['file',['../classstdex_1_1stream_1_1file.html#a3324c7a122b9debf2fde7f4e4f340683',1,'stdex::stream::file::file()'],['../classstdex_1_1stream_1_1file.html',1,'stdex::stream::file']]], + ['file_5fwindow_2',['file_window',['../classstdex_1_1stream_1_1file__window.html',1,'stdex::stream']]], + ['find_3',['find',['../classstdex_1_1idrec_1_1record.html#a19523040d07119055884a7a2f8ef25fd',1,'stdex::idrec::record']]], + ['flush_4',['flush',['../classstdex_1_1stream_1_1buffer.html#a18f9edc9af41f3a71d84f7eb4e7d5332',1,'stdex::stream::buffer::flush()'],['../classstdex_1_1stream_1_1diag__file.html#aadb3e9de2c84e317bf454ae764d8fcdf',1,'stdex::stream::diag_file::flush()'],['../classstdex_1_1stream_1_1basic__sys.html#a6eae9769feea69fa9ce8b127ca2f7891',1,'stdex::stream::basic_sys::flush()'],['../classstdex_1_1stream_1_1cache.html#ac33e763d8103ad8e910b75085a4cf3ac',1,'stdex::stream::cache::flush()'],['../classstdex_1_1stream_1_1file__window.html#a2a2b88934b073b456da579ca3e3b43ff',1,'stdex::stream::file_window::flush()'],['../classstdex_1_1stream_1_1async__writer.html#a25c72d3b2edaba300eb158d06dfd03d2',1,'stdex::stream::async_writer::flush()'],['../classstdex_1_1stream_1_1replicator.html#a77d2ddda29ef5dfb835453ff1dd90f2e',1,'stdex::stream::replicator::flush()'],['../classstdex_1_1stream_1_1converter.html#a0d6af4c223625bc8ab677978b225d06e',1,'stdex::stream::converter::flush()'],['../classstdex_1_1stream_1_1basic.html#a46c70519f3e4b1f3436e85a6623555dc',1,'stdex::stream::basic::flush()']]], + ['fraction_5',['fraction',['../classstdex_1_1parser_1_1basic__mixed__numeral.html#a288fa70b3073080487d6d253600dca34',1,'stdex::parser::basic_mixed_numeral']]], + ['front_6',['front',['../classstdex_1_1ring.html#a9b6571832cc636d98885af61651a0998',1,'stdex::ring::front()'],['../classstdex_1_1vector__queue.html#a61df210878f6b8b2c1b213a93b8af581',1,'stdex::vector_queue::front()'],['../classstdex_1_1vector__queue.html#a96ea84ab879a3190beabdbac5ad7e0ab',1,'stdex::vector_queue::front() const']]] ]; diff --git a/search/all_6.js b/search/all_6.js index f447153bd..34ccbb274 100644 --- a/search/all_6.js +++ b/search/all_6.js @@ -1,5 +1,5 @@ var searchData= [ - ['getter_0',['getter',['../structstdex_1_1getter.html',1,'stdex']]], + ['get_0',['get',['../classstdex_1_1stream_1_1memory__file.html#a41124fc38a3439c4407ea1c9ef4962b1',1,'stdex::stream::memory_file::get()'],['../classstdex_1_1sys__object.html#a68edd83d50aee1dd85645aa0506c8769',1,'stdex::sys_object::get()']]], ['global_5fprogress_1',['global_progress',['../classstdex_1_1global__progress.html#a0ffa6fafa04588c0df06d077ae51d037',1,'stdex::global_progress::global_progress()'],['../classstdex_1_1global__progress.html',1,'stdex::global_progress< T >']]] ]; diff --git a/search/all_8.js b/search/all_8.js index c569eecf2..97e8cd037 100644 --- a/search/all_8.js +++ b/search/all_8.js @@ -3,5 +3,6 @@ var searchData= ['id_0',['id',['../classstdex_1_1idrec_1_1record.html#a24e54541a476b01e332290c57a495926',1,'stdex::idrec::record']]], ['integer_1',['integer',['../classstdex_1_1parser_1_1basic__mixed__numeral.html#af42e711d277a70c9624864e5f74a0bfd',1,'stdex::parser::basic_mixed_numeral::integer'],['../classstdex_1_1parser_1_1basic__scientific__numeral.html#aff899e847d2b78df90ab367ef824505a',1,'stdex::parser::basic_scientific_numeral::integer'],['../classstdex_1_1parser_1_1basic__monetary__numeral.html#acdbf4ca7d154c8723e8c318000853cce',1,'stdex::parser::basic_monetary_numeral::integer']]], ['interval_2',['interval',['../classstdex_1_1parser_1_1basic__parser.html#a0b46b1904e5af116c34a10087a5bc056',1,'stdex::parser::basic_parser::interval'],['../structstdex_1_1interval.html#a9f6c66e8a3fd15c693011216bb45d6b9',1,'stdex::interval::interval() noexcept'],['../structstdex_1_1interval.html#a100a68cd81867cbf1b275cd5ab5d2160',1,'stdex::interval::interval(T x) noexcept'],['../structstdex_1_1interval.html#a41ac8e9fdb33a2dfaae6113006b792d8',1,'stdex::interval::interval(T _start, T _end) noexcept'],['../structstdex_1_1interval.html',1,'stdex::interval< T >']]], - ['interval_3c_20size_5ft_20_3e_3',['interval< size_t >',['../structstdex_1_1interval.html',1,'stdex']]] + ['interval_3c_20fpos_5ft_20_3e_3',['interval< fpos_t >',['../structstdex_1_1interval.html',1,'stdex']]], + ['interval_3c_20size_5ft_20_3e_4',['interval< size_t >',['../structstdex_1_1interval.html',1,'stdex']]] ]; diff --git a/search/all_9.js b/search/all_9.js index 51180c77d..f2a2437d5 100644 --- a/search/all_9.js +++ b/search/all_9.js @@ -1,4 +1,8 @@ var searchData= [ - ['lazy_5fprogress_0',['lazy_progress',['../classstdex_1_1lazy__progress.html#a90d8aaa2e2135537f7bb103bf795956a',1,'stdex::lazy_progress::lazy_progress()'],['../classstdex_1_1lazy__progress.html',1,'stdex::lazy_progress< T >']]] + ['lazy_5fprogress_0',['lazy_progress',['../classstdex_1_1lazy__progress.html#a90d8aaa2e2135537f7bb103bf795956a',1,'stdex::lazy_progress::lazy_progress()'],['../classstdex_1_1lazy__progress.html',1,'stdex::lazy_progress< T >']]], + ['length_1',['length',['../classstdex_1_1stream_1_1replicator_1_1worker.html#acdf8a4a4f07271bc7bd4f634640e7f5a',1,'stdex::stream::replicator::worker']]], + ['limiter_2',['limiter',['../classstdex_1_1stream_1_1limiter.html',1,'stdex::stream']]], + ['load_3',['load',['../classstdex_1_1stream_1_1memory__file.html#a3333329f0e94c0d08caf326cfb483d15',1,'stdex::stream::memory_file']]], + ['lock_4',['lock',['../classstdex_1_1stream_1_1basic__file.html#a484ec74004fe0b4528c11675b91161e0',1,'stdex::stream::basic_file::lock()'],['../classstdex_1_1stream_1_1file__window.html#a820fea50931a0769161f617a524f72c6',1,'stdex::stream::file_window::lock()'],['../classstdex_1_1stream_1_1cache.html#ac1ca25b572574b35cd4895964e835204',1,'stdex::stream::cache::lock()'],['../classstdex_1_1stream_1_1file.html#a74fdb70cb8ce4d0ee73f6db9d7051d86',1,'stdex::stream::file::lock()'],['../classstdex_1_1stream_1_1diag__file.html#a5d4bcde718ef182590c742f0c600e54b',1,'stdex::stream::diag_file::lock()']]] ]; diff --git a/search/all_a.js b/search/all_a.js index 7be0c4e7c..0be010daa 100644 --- a/search/all_a.js +++ b/search/all_a.js @@ -2,15 +2,20 @@ var searchData= [ ['m_5fallow_5fabsolute_0',['m_allow_absolute',['../classstdex_1_1parser_1_1basic__dns__name.html#abfe3327023b10cb9759c13ec987701ab',1,'stdex::parser::basic_dns_name']]], ['m_5fcount_1',['m_count',['../classstdex_1_1vector__queue.html#a6070ca156773c17c6b75bacc5251c04c',1,'stdex::vector_queue']]], - ['m_5fdata_2',['m_data',['../classstdex_1_1vector__queue.html#a289d86508a91fbe61e0425e318d735cf',1,'stdex::vector_queue']]], + ['m_5fdata_2',['m_data',['../classstdex_1_1stream_1_1memory__file.html#a4a2082f1017478d1ce940d8dcd6e234b',1,'stdex::stream::memory_file::m_data'],['../classstdex_1_1vector__queue.html#a289d86508a91fbe61e0425e318d735cf',1,'stdex::vector_queue::m_data']]], ['m_5fel_3',['m_el',['../classstdex_1_1parser_1_1basic__iterations.html#a8a06638fea659f03fddc9d41dfc4efac',1,'stdex::parser::basic_iterations']]], ['m_5fgreedy_4',['m_greedy',['../classstdex_1_1parser_1_1basic__iterations.html#a2523c18948003ca4726eaed098e6de12',1,'stdex::parser::basic_iterations']]], ['m_5fhead_5',['m_head',['../classstdex_1_1vector__queue.html#abd8208a4a9e92ec5c38d3718f383e41e',1,'stdex::vector_queue']]], - ['m_5fmax_5fiterations_6',['m_max_iterations',['../classstdex_1_1parser_1_1basic__iterations.html#aca0b8e1f9522a5306db5fe173269e8b1',1,'stdex::parser::basic_iterations']]], - ['m_5fmin_5fiterations_7',['m_min_iterations',['../classstdex_1_1parser_1_1basic__iterations.html#aab86447331f306ff85c49764a5d0d646',1,'stdex::parser::basic_iterations']]], - ['m_5fnum_8',['m_num',['../classstdex_1_1errno__error.html#a3712510d0659db4ad2ef4082a5980575',1,'stdex::errno_error']]], - ['m_5fsize_5fmax_9',['m_size_max',['../classstdex_1_1vector__queue.html#a7192dc2991d690b04a2fb24dd6fdc325',1,'stdex::vector_queue']]], - ['mapping_10',['mapping',['../structstdex_1_1mapping.html#a9634b5ef182398e24b61c2ca78cc8e46',1,'stdex::mapping::mapping()'],['../structstdex_1_1mapping.html#a48069d4eb38c276e856d650075f6c3bd',1,'stdex::mapping::mapping(T x)'],['../structstdex_1_1mapping.html#ae72436dbc2b54e2062822cd7772de830',1,'stdex::mapping::mapping(T _from, T _to)'],['../structstdex_1_1mapping.html',1,'stdex::mapping< T >']]], - ['mouth_11',['mouth',['../classstdex_1_1parser_1_1basic__emoticon.html#a43d0de6a54546e509807c7c888bb8dc8',1,'stdex::parser::basic_emoticon']]], - ['mtime_12',['mtime',['../classstdex_1_1basic__fstream.html#a183cd8e046c5ae2c3720204a8e61c54d',1,'stdex::basic_fstream']]] + ['m_5fmanage_6',['m_manage',['../classstdex_1_1stream_1_1memory__file.html#aca812d996b5b60660fa121787e4c0e68',1,'stdex::stream::memory_file']]], + ['m_5fmax_5fiterations_7',['m_max_iterations',['../classstdex_1_1parser_1_1basic__iterations.html#aca0b8e1f9522a5306db5fe173269e8b1',1,'stdex::parser::basic_iterations']]], + ['m_5fmin_5fiterations_8',['m_min_iterations',['../classstdex_1_1parser_1_1basic__iterations.html#aab86447331f306ff85c49764a5d0d646',1,'stdex::parser::basic_iterations']]], + ['m_5fnum_9',['m_num',['../classstdex_1_1errno__error.html#a3712510d0659db4ad2ef4082a5980575',1,'stdex::errno_error']]], + ['m_5foffset_10',['m_offset',['../classstdex_1_1stream_1_1cache.html#a1132b6554bec05e4da1d493d18516640',1,'stdex::stream::cache::m_offset'],['../classstdex_1_1stream_1_1memory__file.html#a91ca49273fc49d70b98180fc828d5b5d',1,'stdex::stream::memory_file::m_offset']]], + ['m_5freserved_11',['m_reserved',['../classstdex_1_1stream_1_1memory__file.html#a6aa8c2deeabc66f065c858ba399d911c',1,'stdex::stream::memory_file']]], + ['m_5fsize_12',['m_size',['../classstdex_1_1stream_1_1memory__file.html#a41121ff122745e109c1b9851632abce3',1,'stdex::stream::memory_file']]], + ['m_5fsize_5fmax_13',['m_size_max',['../classstdex_1_1vector__queue.html#a7192dc2991d690b04a2fb24dd6fdc325',1,'stdex::vector_queue']]], + ['mapping_14',['mapping',['../structstdex_1_1mapping.html#a9634b5ef182398e24b61c2ca78cc8e46',1,'stdex::mapping::mapping()'],['../structstdex_1_1mapping.html#a48069d4eb38c276e856d650075f6c3bd',1,'stdex::mapping::mapping(T x)'],['../structstdex_1_1mapping.html#ae72436dbc2b54e2062822cd7772de830',1,'stdex::mapping::mapping(T _from, T _to)'],['../structstdex_1_1mapping.html',1,'stdex::mapping< T >']]], + ['memory_5ffile_15',['memory_file',['../classstdex_1_1stream_1_1memory__file.html#a6b4b9daa088fb20678a502e81553c745',1,'stdex::stream::memory_file::memory_file(size_t size, state_t state=state_t::ok)'],['../classstdex_1_1stream_1_1memory__file.html#af7fdc0b7ffcd3713487a75cfd9c1704f',1,'stdex::stream::memory_file::memory_file(void *data, size_t size, size_t reserved, bool manage=false, state_t state=state_t::ok)'],['../classstdex_1_1stream_1_1memory__file.html#ad0da8c8758672af312026957e2556b60',1,'stdex::stream::memory_file::memory_file(void *data, size_t size, bool manage=false, state_t state=state_t::ok)'],['../classstdex_1_1stream_1_1memory__file.html#a92f7f489afbe28ed27c4c48c2a54891c',1,'stdex::stream::memory_file::memory_file(const sys_char *filename, int mode)'],['../classstdex_1_1stream_1_1memory__file.html',1,'stdex::stream::memory_file']]], + ['mouth_16',['mouth',['../classstdex_1_1parser_1_1basic__emoticon.html#a43d0de6a54546e509807c7c888bb8dc8',1,'stdex::parser::basic_emoticon']]], + ['mtime_17',['mtime',['../classstdex_1_1stream_1_1basic__file.html#ae10432137e01b7ce7c254c2a455c719e',1,'stdex::stream::basic_file::mtime()'],['../classstdex_1_1stream_1_1cache.html#a8350e6c158982e5511da18ed122bf24d',1,'stdex::stream::cache::mtime()'],['../classstdex_1_1stream_1_1file.html#a23e1061f6a9473241ef8af99f6a3f08f',1,'stdex::stream::file::mtime()']]] ]; diff --git a/search/all_b.js b/search/all_b.js index 1082912b1..7657c9e7d 100644 --- a/search/all_b.js +++ b/search/all_b.js @@ -2,11 +2,13 @@ var searchData= [ ['name_0',['name',['../classstdex_1_1parser_1_1http__parameter.html#a565c731685b779b2c0a90e8c5b7dbd55',1,'stdex::parser::http_parameter::name'],['../classstdex_1_1parser_1_1http__cookie.html#aca58f2d8164c41be287a7fe16432ba48',1,'stdex::parser::http_cookie::name']]], ['negative_5fexp_5fsign_1',['negative_exp_sign',['../classstdex_1_1parser_1_1basic__scientific__numeral.html#aaeec0779d7bd8f5429108be5b80ba95c',1,'stdex::parser::basic_scientific_numeral']]], - ['negative_5fsign_2',['negative_sign',['../classstdex_1_1parser_1_1basic__signed__numeral.html#a50271856db8a0e66bef91e4e05949bb3',1,'stdex::parser::basic_signed_numeral::negative_sign'],['../classstdex_1_1parser_1_1basic__mixed__numeral.html#a76a2ae3e988b901ae4745a5ba8c22d46',1,'stdex::parser::basic_mixed_numeral::negative_sign'],['../classstdex_1_1parser_1_1basic__scientific__numeral.html#a8e625f598299499379b3f9e067ad9384',1,'stdex::parser::basic_scientific_numeral::negative_sign'],['../classstdex_1_1parser_1_1basic__monetary__numeral.html#aef90350963cc64fb710674eedf260708',1,'stdex::parser::basic_monetary_numeral::negative_sign']]], + ['negative_5fsign_2',['negative_sign',['../classstdex_1_1parser_1_1basic__monetary__numeral.html#aef90350963cc64fb710674eedf260708',1,'stdex::parser::basic_monetary_numeral::negative_sign'],['../classstdex_1_1parser_1_1basic__signed__numeral.html#a50271856db8a0e66bef91e4e05949bb3',1,'stdex::parser::basic_signed_numeral::negative_sign'],['../classstdex_1_1parser_1_1basic__mixed__numeral.html#a76a2ae3e988b901ae4745a5ba8c22d46',1,'stdex::parser::basic_mixed_numeral::negative_sign'],['../classstdex_1_1parser_1_1basic__scientific__numeral.html#a8e625f598299499379b3f9e067ad9384',1,'stdex::parser::basic_scientific_numeral::negative_sign']]], ['no_5fdelete_3',['no_delete',['../structstdex_1_1no__delete.html',1,'stdex']]], ['no_5fdelete_3c_20t_5b_5d_3e_4',['no_delete< T[]>',['../structstdex_1_1no__delete_3_01_t_0f_0e_4.html',1,'stdex']]], - ['nose_5',['nose',['../classstdex_1_1parser_1_1basic__emoticon.html#a865f28a87ef1561bca53445e2d1ae253',1,'stdex::parser::basic_emoticon']]], - ['now_6',['now',['../structstdex_1_1chrono_1_1aosn__clock.html#af186981246295f8d1a41784802b0f0f2',1,'stdex::chrono::aosn_clock']]], - ['num_7',['num',['../classstdex_1_1base64__enc.html#a58e4759143972065f71ed68f6dbc90d8',1,'stdex::base64_enc::num'],['../classstdex_1_1base64__dec.html#a08acef30d97e7f8213e0c834b93ee849',1,'stdex::base64_dec::num'],['../classstdex_1_1hex__dec.html#a99111436d6b30595cd1fee112e3200ae',1,'stdex::hex_dec::num']]], - ['number_8',['number',['../classstdex_1_1parser_1_1basic__signed__numeral.html#ae43853317fc7ca8b6df2eda5d466a2aa',1,'stdex::parser::basic_signed_numeral::number'],['../classstdex_1_1errno__error.html#a6b3c265199470fe39b89f5c9941cc86f',1,'stdex::errno_error::number()']]] + ['node_5ft_5',['node_t',['../structstdex_1_1stream_1_1fifo_1_1node__t.html',1,'stdex::stream::fifo']]], + ['nose_6',['nose',['../classstdex_1_1parser_1_1basic__emoticon.html#a865f28a87ef1561bca53445e2d1ae253',1,'stdex::parser::basic_emoticon']]], + ['now_7',['now',['../structstdex_1_1chrono_1_1aosn__clock.html#af186981246295f8d1a41784802b0f0f2',1,'stdex::chrono::aosn_clock']]], + ['num_8',['num',['../classstdex_1_1base64__enc.html#a58e4759143972065f71ed68f6dbc90d8',1,'stdex::base64_enc::num'],['../classstdex_1_1base64__dec.html#a08acef30d97e7f8213e0c834b93ee849',1,'stdex::base64_dec::num'],['../classstdex_1_1hex__dec.html#a99111436d6b30595cd1fee112e3200ae',1,'stdex::hex_dec::num']]], + ['num_5fwritten_9',['num_written',['../classstdex_1_1stream_1_1replicator_1_1worker.html#acd6595e01accdb9d3c8d97f8f19b8cf1',1,'stdex::stream::replicator::worker']]], + ['number_10',['number',['../classstdex_1_1parser_1_1basic__signed__numeral.html#ae43853317fc7ca8b6df2eda5d466a2aa',1,'stdex::parser::basic_signed_numeral::number'],['../classstdex_1_1errno__error.html#a6b3c265199470fe39b89f5c9941cc86f',1,'stdex::errno_error::number()']]] ]; diff --git a/search/all_c.js b/search/all_c.js index 69b1b7482..dd1550d5d 100644 --- a/search/all_c.js +++ b/search/all_c.js @@ -1,9 +1,11 @@ var searchData= [ - ['open_0',['open',['../classstdex_1_1idrec_1_1record.html#a379d9eeac3c52375982ba75df33604ca',1,'stdex::idrec::record']]], - ['operator_20bool_1',['operator bool',['../structstdex_1_1interval.html#a15945d1ba829410c61466d95922000d0',1,'stdex::interval']]], - ['operator_21_3d_2',['operator!=',['../structstdex_1_1interval.html#aa5e6ff5a63e3cd9f8e36a32663ebfda8',1,'stdex::interval::operator!=()'],['../structstdex_1_1mapping.html#a99e44b5840a155e5ce366d440cbe234b',1,'stdex::mapping::operator!=()']]], - ['operator_3d_3',['operator=',['../classstdex_1_1idrec_1_1record.html#a3d4bff1bf080fb8cb3960b5b5018392c',1,'stdex::idrec::record::operator=()'],['../classstdex_1_1vector__queue.html#a00e42f0b6c31aa16e47a1093e90fd1aa',1,'stdex::vector_queue::operator=(const vector_queue< value_type > &other)'],['../classstdex_1_1vector__queue.html#a840d69192e880fcce588c6368a7d1bab',1,'stdex::vector_queue::operator=(vector_queue< value_type > &&other)']]], - ['operator_3d_3d_4',['operator==',['../structstdex_1_1interval.html#abec7b896ea0d650fc086955b0cba00a9',1,'stdex::interval::operator==()'],['../structstdex_1_1mapping.html#a6d9fa746849e2ea27f53e40b8b44fb46',1,'stdex::mapping::operator==()']]], - ['operator_5b_5d_5',['operator[]',['../classstdex_1_1vector__queue.html#a21497b5396ef80a2d641f8ee767a3b17',1,'stdex::vector_queue::operator[](size_type pos)'],['../classstdex_1_1vector__queue.html#ace07c52caf736c3285909d64b22a2c4c',1,'stdex::vector_queue::operator[](size_type pos) const']]] + ['ok_0',['ok',['../classstdex_1_1stream_1_1basic.html#a0295e4efe18eef2a8962680274957ac1',1,'stdex::stream::basic']]], + ['op_1',['op',['../classstdex_1_1stream_1_1replicator_1_1worker.html#a9ddd37c6da22d559f6deb46102833f31',1,'stdex::stream::replicator::worker']]], + ['open_2',['open',['../classstdex_1_1idrec_1_1record.html#a379d9eeac3c52375982ba75df33604ca',1,'stdex::idrec::record::open()'],['../classstdex_1_1stream_1_1file.html#a70b9101a911ed513fb0097d3bec5023a',1,'stdex::stream::file::open()'],['../classstdex_1_1stream_1_1cached__file.html#ac2a52fed78cb08987e63210b4f34fd1b',1,'stdex::stream::cached_file::open()']]], + ['operator_20bool_3',['operator bool',['../structstdex_1_1interval.html#a15945d1ba829410c61466d95922000d0',1,'stdex::interval::operator bool()'],['../classstdex_1_1sys__object.html#a529b0f9294ed46591389ca3dd9c540f3',1,'stdex::sys_object::operator bool()']]], + ['operator_21_3d_4',['operator!=',['../structstdex_1_1interval.html#aa5e6ff5a63e3cd9f8e36a32663ebfda8',1,'stdex::interval::operator!=()'],['../structstdex_1_1mapping.html#a99e44b5840a155e5ce366d440cbe234b',1,'stdex::mapping::operator!=()']]], + ['operator_3d_5',['operator=',['../classstdex_1_1idrec_1_1record.html#a3d4bff1bf080fb8cb3960b5b5018392c',1,'stdex::idrec::record::operator=()'],['../classstdex_1_1vector__queue.html#a00e42f0b6c31aa16e47a1093e90fd1aa',1,'stdex::vector_queue::operator=(const vector_queue< value_type > &other)'],['../classstdex_1_1vector__queue.html#a840d69192e880fcce588c6368a7d1bab',1,'stdex::vector_queue::operator=(vector_queue< value_type > &&other)']]], + ['operator_3d_3d_6',['operator==',['../structstdex_1_1interval.html#abec7b896ea0d650fc086955b0cba00a9',1,'stdex::interval::operator==()'],['../structstdex_1_1mapping.html#a6d9fa746849e2ea27f53e40b8b44fb46',1,'stdex::mapping::operator==()']]], + ['operator_5b_5d_7',['operator[]',['../classstdex_1_1vector__queue.html#a21497b5396ef80a2d641f8ee767a3b17',1,'stdex::vector_queue::operator[](size_type pos)'],['../classstdex_1_1vector__queue.html#ace07c52caf736c3285909d64b22a2c4c',1,'stdex::vector_queue::operator[](size_type pos) const']]] ]; diff --git a/search/all_d.js b/search/all_d.js index 0ae4322e2..d8f9f2591 100644 --- a/search/all_d.js +++ b/search/all_d.js @@ -3,13 +3,14 @@ var searchData= ['params_0',['params',['../classstdex_1_1parser_1_1http__cookie.html#aa3d227ae38c1f63b445097ca07091616',1,'stdex::parser::http_cookie']]], ['parser_5fcollection_1',['parser_collection',['../classstdex_1_1parser_1_1parser__collection.html',1,'stdex::parser']]], ['pointer_2',['pointer',['../classstdex_1_1vector__queue.html#abf6db5997ee272e03e8db1696a162148',1,'stdex::vector_queue']]], - ['pop_5fback_3',['pop_back',['../classstdex_1_1vector__queue.html#abd0fdb316392da76bac13bdd9d176eb6',1,'stdex::vector_queue']]], - ['pop_5ffront_4',['pop_front',['../classstdex_1_1vector__queue.html#adc05fb6cec951f736337dc340996271f',1,'stdex::vector_queue']]], - ['positive_5fexp_5fsign_5',['positive_exp_sign',['../classstdex_1_1parser_1_1basic__scientific__numeral.html#abb5d26d24a7bb58d244b7d51722b117a',1,'stdex::parser::basic_scientific_numeral']]], - ['positive_5fsign_6',['positive_sign',['../classstdex_1_1parser_1_1basic__signed__numeral.html#ac7c9dde1f5b3600a21c1b7935c0a5caf',1,'stdex::parser::basic_signed_numeral::positive_sign'],['../classstdex_1_1parser_1_1basic__mixed__numeral.html#aee09625077f56e1139e3a6c26e24e93f',1,'stdex::parser::basic_mixed_numeral::positive_sign'],['../classstdex_1_1parser_1_1basic__scientific__numeral.html#a6e6e08dd8ade04c9aa85fba70e12b7c4',1,'stdex::parser::basic_scientific_numeral::positive_sign'],['../classstdex_1_1parser_1_1basic__monetary__numeral.html#a23fedf450adaace6a027c7788e4a8c61',1,'stdex::parser::basic_monetary_numeral::positive_sign']]], - ['printf_7',['printf',['../classstdex_1_1basic__ostreamfmt.html#add8b8c13cfef4492c5b5b5d68e860ce8',1,'stdex::basic_ostreamfmt']]], + ['pop_3',['pop',['../classstdex_1_1ring.html#a6360d8186fa2bda1ef4b4ddbcae93749',1,'stdex::ring']]], + ['pop_5fback_4',['pop_back',['../classstdex_1_1vector__queue.html#abd0fdb316392da76bac13bdd9d176eb6',1,'stdex::vector_queue']]], + ['pop_5ffront_5',['pop_front',['../classstdex_1_1vector__queue.html#adc05fb6cec951f736337dc340996271f',1,'stdex::vector_queue']]], + ['positive_5fexp_5fsign_6',['positive_exp_sign',['../classstdex_1_1parser_1_1basic__scientific__numeral.html#abb5d26d24a7bb58d244b7d51722b117a',1,'stdex::parser::basic_scientific_numeral']]], + ['positive_5fsign_7',['positive_sign',['../classstdex_1_1parser_1_1basic__monetary__numeral.html#a23fedf450adaace6a027c7788e4a8c61',1,'stdex::parser::basic_monetary_numeral::positive_sign'],['../classstdex_1_1parser_1_1basic__signed__numeral.html#ac7c9dde1f5b3600a21c1b7935c0a5caf',1,'stdex::parser::basic_signed_numeral::positive_sign'],['../classstdex_1_1parser_1_1basic__mixed__numeral.html#aee09625077f56e1139e3a6c26e24e93f',1,'stdex::parser::basic_mixed_numeral::positive_sign'],['../classstdex_1_1parser_1_1basic__scientific__numeral.html#a6e6e08dd8ade04c9aa85fba70e12b7c4',1,'stdex::parser::basic_scientific_numeral::positive_sign']]], ['progress_8',['progress',['../classstdex_1_1progress.html',1,'stdex']]], ['progress_5fswitcher_9',['progress_switcher',['../classstdex_1_1progress__switcher.html',1,'stdex']]], - ['push_5fback_10',['push_back',['../classstdex_1_1vector__queue.html#ab063bf18b16eed7f4d67e0720bcb8f4f',1,'stdex::vector_queue::push_back(const value_type &v)'],['../classstdex_1_1vector__queue.html#a5b39a88669c8b7e21f1ada2aa8993b2e',1,'stdex::vector_queue::push_back(value_type &&v)']]], - ['push_5ffront_11',['push_front',['../classstdex_1_1vector__queue.html#adfc0d837fa11c1203e9c96a1a5c081b9',1,'stdex::vector_queue::push_front(const value_type &v)'],['../classstdex_1_1vector__queue.html#af307e59213be692f7918c3c541923373',1,'stdex::vector_queue::push_front(value_type &&v)']]] + ['push_10',['push',['../classstdex_1_1ring.html#ab8b671ab4a84c370bdf8d4d2df7c0d9d',1,'stdex::ring']]], + ['push_5fback_11',['push_back',['../classstdex_1_1stream_1_1replicator.html#a26a983c6d340261ef1c55af0e9916701',1,'stdex::stream::replicator::push_back()'],['../classstdex_1_1vector__queue.html#ab063bf18b16eed7f4d67e0720bcb8f4f',1,'stdex::vector_queue::push_back(const value_type &v)'],['../classstdex_1_1vector__queue.html#a5b39a88669c8b7e21f1ada2aa8993b2e',1,'stdex::vector_queue::push_back(value_type &&v)']]], + ['push_5ffront_12',['push_front',['../classstdex_1_1vector__queue.html#adfc0d837fa11c1203e9c96a1a5c081b9',1,'stdex::vector_queue::push_front(const value_type &v)'],['../classstdex_1_1vector__queue.html#af307e59213be692f7918c3c541923373',1,'stdex::vector_queue::push_front(value_type &&v)']]] ]; diff --git a/search/all_e.js b/search/all_e.js index ee14b31a9..7779c2e86 100644 --- a/search/all_e.js +++ b/search/all_e.js @@ -1,6 +1,4 @@ var searchData= [ - ['record_0',['record',['../classstdex_1_1idrec_1_1record.html#a611da3801d9e7215324c9a5992a27f39',1,'stdex::idrec::record::record(T &d)'],['../classstdex_1_1idrec_1_1record.html#ab84a09093bd1a2cbf720329b84c6d73b',1,'stdex::idrec::record::record(const T &d)'],['../classstdex_1_1idrec_1_1record.html',1,'stdex::idrec::record< T, T_ID, ID, T_SIZE, ALIGN >']]], - ['reference_1',['reference',['../classstdex_1_1vector__queue.html#a3e8d68368eb5014a2df5b3e26943e28c',1,'stdex::vector_queue']]], - ['robber_2',['robber',['../structstdex_1_1robber.html',1,'stdex']]] + ['quit_0',['quit',['../classstdex_1_1ring.html#a385d1648c6fb8e61154e518f954a0a0e',1,'stdex::ring']]] ]; diff --git a/search/all_f.js b/search/all_f.js index 2ef77a76c..154d456e1 100644 --- a/search/all_f.js +++ b/search/all_f.js @@ -1,29 +1,22 @@ var searchData= [ - ['save_0',['save',['../classstdex_1_1basic__stringstream.html#a437a7ba5d9b18508e541e061f37188e3',1,'stdex::basic_stringstream']]], - ['scope_5fid_1',['scope_id',['../classstdex_1_1parser_1_1basic__ipv6__address.html#a67486e83888f48afc62b031f745012c0',1,'stdex::parser::basic_ipv6_address']]], - ['segments_2',['segments',['../classstdex_1_1parser_1_1http__url__path.html#a9a5f4002c55cb4500ce43536512b02b9',1,'stdex::parser::http_url_path']]], - ['set_3',['set',['../classstdex_1_1global__progress.html#a76e66104444c77b89b687b4ad4945e8e',1,'stdex::global_progress::set()'],['../classstdex_1_1lazy__progress.html#a4e3e7a80da8cce7ccec69c78fcaaabae',1,'stdex::lazy_progress::set()'],['../classstdex_1_1progress.html#acf3a29daf22709bf7e94e864c8be95a1',1,'stdex::progress::set()']]], - ['set_5fglobal_5frange_4',['set_global_range',['../classstdex_1_1global__progress.html#ac68b491c62861fae1b16abb3477cb9c1',1,'stdex::global_progress']]], - ['set_5frange_5',['set_range',['../classstdex_1_1global__progress.html#afb204b820637c19b494976af4a284704',1,'stdex::global_progress::set_range()'],['../classstdex_1_1lazy__progress.html#ada3a0d4f0086823558115a8064ffffb6',1,'stdex::lazy_progress::set_range()'],['../classstdex_1_1progress.html#afbb1513bdb20340ebb21bd988f4e424a',1,'stdex::progress::set_range()']]], - ['set_5fsection_5frange_6',['set_section_range',['../classstdex_1_1global__progress.html#a242009bce7ac595975bbfd703ec58c3b',1,'stdex::global_progress']]], - ['set_5ftext_7',['set_text',['../classstdex_1_1global__progress.html#a89b7116003ab3b6344d90f130c14933e',1,'stdex::global_progress::set_text()'],['../classstdex_1_1progress.html#a2cab8b5ac137d16fced31ee205264b01',1,'stdex::progress::set_text()']]], - ['sgml_5fany_5fcp_8',['sgml_any_cp',['../classstdex_1_1parser_1_1sgml__any__cp.html',1,'stdex::parser']]], - ['sgml_5fcp_9',['sgml_cp',['../classstdex_1_1parser_1_1sgml__cp.html',1,'stdex::parser']]], - ['sgml_5fcp_5fset_10',['sgml_cp_set',['../classstdex_1_1parser_1_1sgml__cp__set.html',1,'stdex::parser']]], - ['sgml_5fdns_5fdomain_5fchar_11',['sgml_dns_domain_char',['../classstdex_1_1parser_1_1sgml__dns__domain__char.html',1,'stdex::parser']]], - ['sgml_5fipv6_5fscope_5fid_5fchar_12',['sgml_ipv6_scope_id_char',['../classstdex_1_1parser_1_1sgml__ipv6__scope__id__char.html',1,'stdex::parser']]], - ['sgml_5fpunct_5fcp_13',['sgml_punct_cp',['../classstdex_1_1parser_1_1sgml__punct__cp.html',1,'stdex::parser']]], - ['sgml_5fspace_5fcp_14',['sgml_space_cp',['../classstdex_1_1parser_1_1sgml__space__cp.html',1,'stdex::parser']]], - ['sgml_5fspace_5for_5fpunct_5fcp_15',['sgml_space_or_punct_cp',['../classstdex_1_1parser_1_1sgml__space__or__punct__cp.html',1,'stdex::parser']]], - ['sgml_5fstring_16',['sgml_string',['../classstdex_1_1parser_1_1sgml__string.html',1,'stdex::parser']]], - ['sgml_5furl_5fpassword_5fchar_17',['sgml_url_password_char',['../classstdex_1_1parser_1_1sgml__url__password__char.html',1,'stdex::parser']]], - ['sgml_5furl_5fpath_5fchar_18',['sgml_url_path_char',['../classstdex_1_1parser_1_1sgml__url__path__char.html',1,'stdex::parser']]], - ['sgml_5furl_5fusername_5fchar_19',['sgml_url_username_char',['../classstdex_1_1parser_1_1sgml__url__username__char.html',1,'stdex::parser']]], - ['show_20',['show',['../classstdex_1_1progress.html#ab6e57aed9e7a18a501e8a63cef199d8e',1,'stdex::progress::show()'],['../classstdex_1_1global__progress.html#a32350e02d5904867402187e81a3c4a26',1,'stdex::global_progress::show()']]], - ['size_21',['size',['../structstdex_1_1interval.html#a8c5222bc73fc66ba78bfabc1b985c864',1,'stdex::interval::size()'],['../classstdex_1_1vector__queue.html#ad704df8c3664a6d3f3e0977d87162114',1,'stdex::vector_queue::size() const']]], - ['size_5ftype_22',['size_type',['../classstdex_1_1vector__queue.html#a2a044b4eb0242a00568d08b4d8b6343a',1,'stdex::vector_queue']]], - ['special_5fsign_23',['special_sign',['../classstdex_1_1parser_1_1basic__signed__numeral.html#a38b8207e2b384ed5ffb3f2bfb3e8755f',1,'stdex::parser::basic_signed_numeral::special_sign'],['../classstdex_1_1parser_1_1basic__mixed__numeral.html#a46c6721810cc8f90218aee66a4c27132',1,'stdex::parser::basic_mixed_numeral::special_sign'],['../classstdex_1_1parser_1_1basic__scientific__numeral.html#a5ce9abfbcdc1247e8f504ae13492e7ea',1,'stdex::parser::basic_scientific_numeral::special_sign'],['../classstdex_1_1parser_1_1basic__monetary__numeral.html#af0190fa4b0de5e894a14c05550e78365',1,'stdex::parser::basic_monetary_numeral::special_sign']]], - ['start_24',['start',['../structstdex_1_1interval.html#ab6a104de0f15b29bea77fe181b49c40b',1,'stdex::interval']]], - ['string_25',['string',['../classstdex_1_1parser_1_1http__value.html#a808ed411ff6816162a54b99fb7307315',1,'stdex::parser::http_value']]] + ['read_0',['read',['../classstdex_1_1stream_1_1diag__file.html#ac1eaf4a0cfce7e4426cff5f32fc33e6e',1,'stdex::stream::diag_file::read()'],['../classstdex_1_1stream_1_1basic.html#aa5d4693fd583cd7ef0ffa9b846136a5a',1,'stdex::stream::basic::read()'],['../classstdex_1_1stream_1_1converter.html#abdca66af4847c6f8b6d87a0909fc061f',1,'stdex::stream::converter::read()'],['../classstdex_1_1stream_1_1async__reader.html#a841c1e3cb01cb96df94701465086a529',1,'stdex::stream::async_reader::read()'],['../classstdex_1_1stream_1_1buffer.html#a2ef05f2df784dce1d1c4319a98cd22e0',1,'stdex::stream::buffer::read()'],['../classstdex_1_1stream_1_1limiter.html#a80b68f1b4a8fb8c72c09b1313e9d02ed',1,'stdex::stream::limiter::read()'],['../classstdex_1_1stream_1_1window.html#a45f2420dfc94c07e101186ae2e541e13',1,'stdex::stream::window::read()'],['../classstdex_1_1stream_1_1file__window.html#a9cdfe9f40ccb1f84e121b1b949a21246',1,'stdex::stream::file_window::read()'],['../classstdex_1_1stream_1_1cache.html#a43dd464dd032888de79f5cd606adffa9',1,'stdex::stream::cache::read()'],['../classstdex_1_1stream_1_1basic__sys.html#ad5daf3c776b615dcfbb0b0891afdb9d0',1,'stdex::stream::basic_sys::read()'],['../classstdex_1_1stream_1_1memory__file.html#a62a05e7dfb1f374dff881f922543e601',1,'stdex::stream::memory_file::read()'],['../classstdex_1_1stream_1_1fifo.html#a84357513740c64a8317370b289c34e40',1,'stdex::stream::fifo::read()']]], + ['read_5farray_1',['read_array',['../classstdex_1_1stream_1_1basic.html#a7723ae23bc35c2ffb74380eab5b0a9ba',1,'stdex::stream::basic']]], + ['read_5fbyte_2',['read_byte',['../classstdex_1_1stream_1_1basic.html#a600e123c10d6f0604d58ae0e9be95f0b',1,'stdex::stream::basic']]], + ['read_5fcharset_3',['read_charset',['../classstdex_1_1stream_1_1basic__file.html#a688cd1e67a5802cdb5c37a7e9691f7e3',1,'stdex::stream::basic_file']]], + ['read_5fdata_4',['read_data',['../classstdex_1_1stream_1_1basic.html#afd5a1268365027ed8c5108183dc498df',1,'stdex::stream::basic::read_data()'],['../classstdex_1_1stream_1_1memory__file.html#a4aa784758856b70a2b6f2b7ca0ffa72b',1,'stdex::stream::memory_file::read_data()']]], + ['read_5flimit_5',['read_limit',['../classstdex_1_1stream_1_1limiter.html#a455a9e38efe1e7473e501dd00fb3d7f0',1,'stdex::stream::limiter']]], + ['read_5foffset_6',['read_offset',['../classstdex_1_1stream_1_1window.html#acff67a2931b8f1a85f12806002e7e131',1,'stdex::stream::window']]], + ['read_5fremainder_7',['read_remainder',['../classstdex_1_1stream_1_1basic.html#a6148810b1d873b9f5a3496b06b1aa90b',1,'stdex::stream::basic::read_remainder()'],['../classstdex_1_1stream_1_1basic__file.html#a72aa16169eea2156e83053ba9bd91cd8',1,'stdex::stream::basic_file::read_remainder()']]], + ['read_5fstr_8',['read_str',['../classstdex_1_1stream_1_1basic.html#a2fece103fa6ca15dfe093fe90ceae65e',1,'stdex::stream::basic::read_str()'],['../classstdex_1_1stream_1_1memory__file.html#a7a8abbdd7f86e10ffb711621015645f6',1,'stdex::stream::memory_file::read_str()']]], + ['readln_9',['readln',['../classstdex_1_1stream_1_1basic.html#a674d87b6ac5ca7b50cb0498a7ffcefcb',1,'stdex::stream::basic::readln(std::basic_string< char, _Traits, _Ax > &str)'],['../classstdex_1_1stream_1_1basic.html#aa8ab653a03de90f7e60242915c3b5378',1,'stdex::stream::basic::readln(std::basic_string< wchar_t, _Traits, _Ax > &wstr)'],['../classstdex_1_1stream_1_1basic.html#ab93d06a993faf3b5f5026c0f5da326a1',1,'stdex::stream::basic::readln(std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)']]], + ['readln_5fand_5fattach_10',['readln_and_attach',['../classstdex_1_1stream_1_1basic.html#a6e67bf06f20bc1743cd75622c4b83892',1,'stdex::stream::basic::readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)'],['../classstdex_1_1stream_1_1basic.html#a6386d7eb1316122d6403bcb83b7edfc9',1,'stdex::stream::basic::readln_and_attach(std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)']]], + ['record_11',['record',['../classstdex_1_1idrec_1_1record.html#a611da3801d9e7215324c9a5992a27f39',1,'stdex::idrec::record::record(T &d)'],['../classstdex_1_1idrec_1_1record.html#ab84a09093bd1a2cbf720329b84c6d73b',1,'stdex::idrec::record::record(const T &d)'],['../classstdex_1_1idrec_1_1record.html',1,'stdex::idrec::record< T, T_ID, ID, T_SIZE, ALIGN >']]], + ['reference_12',['reference',['../classstdex_1_1vector__queue.html#a3e8d68368eb5014a2df5b3e26943e28c',1,'stdex::vector_queue']]], + ['region_13',['region',['../structstdex_1_1stream_1_1cache_1_1cache__t.html#ae4bbbd45000cca2b17d32c0d4b3609db',1,'stdex::stream::cache::cache_t']]], + ['remove_14',['remove',['../classstdex_1_1stream_1_1replicator.html#a7916a391dfa9484df02b1202c0a03edf',1,'stdex::stream::replicator']]], + ['replicator_15',['replicator',['../classstdex_1_1stream_1_1replicator.html',1,'stdex::stream']]], + ['reserve_16',['reserve',['../classstdex_1_1stream_1_1memory__file.html#a6b59e4dd13195dd91211ece4c680cb9b',1,'stdex::stream::memory_file']]], + ['ring_17',['ring',['../classstdex_1_1ring.html',1,'stdex']]], + ['ring_3c_20uint8_5ft_2c_20default_5fasync_5flimit_20_3e_18',['ring< uint8_t, default_async_limit >',['../classstdex_1_1ring.html',1,'stdex']]] ]; diff --git a/search/classes_0.js b/search/classes_0.js index 148c54024..2555737f6 100644 --- a/search/classes_0.js +++ b/search/classes_0.js @@ -1,4 +1,6 @@ var searchData= [ - ['aosn_5fclock_0',['aosn_clock',['../structstdex_1_1chrono_1_1aosn__clock.html',1,'stdex::chrono']]] + ['aosn_5fclock_0',['aosn_clock',['../structstdex_1_1chrono_1_1aosn__clock.html',1,'stdex::chrono']]], + ['async_5freader_1',['async_reader',['../classstdex_1_1stream_1_1async__reader.html',1,'stdex::stream']]], + ['async_5fwriter_2',['async_writer',['../classstdex_1_1stream_1_1async__writer.html',1,'stdex::stream']]] ]; diff --git a/search/classes_1.js b/search/classes_1.js index a79d2682f..9129fc332 100644 --- a/search/classes_1.js +++ b/search/classes_1.js @@ -2,69 +2,66 @@ var searchData= [ ['base64_5fdec_0',['base64_dec',['../classstdex_1_1base64__dec.html',1,'stdex']]], ['base64_5fenc_1',['base64_enc',['../classstdex_1_1base64__enc.html',1,'stdex']]], - ['basic_5fangle_2',['basic_angle',['../classstdex_1_1parser_1_1basic__angle.html',1,'stdex::parser']]], - ['basic_5fany_5fcu_3',['basic_any_cu',['../classstdex_1_1parser_1_1basic__any__cu.html',1,'stdex::parser']]], - ['basic_5fany_5fcu_3c_20char_20_3e_4',['basic_any_cu< char >',['../classstdex_1_1parser_1_1basic__any__cu.html',1,'stdex::parser']]], - ['basic_5fbol_5',['basic_bol',['../classstdex_1_1parser_1_1basic__bol.html',1,'stdex::parser']]], - ['basic_5fbranch_6',['basic_branch',['../classstdex_1_1parser_1_1basic__branch.html',1,'stdex::parser']]], - ['basic_5fchemical_5fformula_7',['basic_chemical_formula',['../classstdex_1_1parser_1_1basic__chemical__formula.html',1,'stdex::parser']]], - ['basic_5fcu_8',['basic_cu',['../classstdex_1_1parser_1_1basic__cu.html',1,'stdex::parser']]], - ['basic_5fcu_5fset_9',['basic_cu_set',['../classstdex_1_1parser_1_1basic__cu__set.html',1,'stdex::parser']]], - ['basic_5fdate_10',['basic_date',['../classstdex_1_1parser_1_1basic__date.html',1,'stdex::parser']]], - ['basic_5fdiagstream_11',['basic_diagstream',['../classstdex_1_1basic__diagstream.html',1,'stdex']]], - ['basic_5fdiagstreambuf_12',['basic_diagstreambuf',['../classstdex_1_1basic__diagstreambuf.html',1,'stdex']]], - ['basic_5fdns_5fdomain_5fchar_13',['basic_dns_domain_char',['../classstdex_1_1parser_1_1basic__dns__domain__char.html',1,'stdex::parser']]], - ['basic_5fdns_5fdomain_5fchar_3c_20char_20_3e_14',['basic_dns_domain_char< char >',['../classstdex_1_1parser_1_1basic__dns__domain__char.html',1,'stdex::parser']]], - ['basic_5fdns_5fname_15',['basic_dns_name',['../classstdex_1_1parser_1_1basic__dns__name.html',1,'stdex::parser']]], - ['basic_5femail_5faddress_16',['basic_email_address',['../classstdex_1_1parser_1_1basic__email__address.html',1,'stdex::parser']]], - ['basic_5femoticon_17',['basic_emoticon',['../classstdex_1_1parser_1_1basic__emoticon.html',1,'stdex::parser']]], - ['basic_5feol_18',['basic_eol',['../classstdex_1_1parser_1_1basic__eol.html',1,'stdex::parser']]], + ['basic_2',['basic',['../classstdex_1_1stream_1_1basic.html',1,'stdex::stream']]], + ['basic_5fangle_3',['basic_angle',['../classstdex_1_1parser_1_1basic__angle.html',1,'stdex::parser']]], + ['basic_5fany_5fcu_4',['basic_any_cu',['../classstdex_1_1parser_1_1basic__any__cu.html',1,'stdex::parser']]], + ['basic_5fany_5fcu_3c_20char_20_3e_5',['basic_any_cu< char >',['../classstdex_1_1parser_1_1basic__any__cu.html',1,'stdex::parser']]], + ['basic_5fbol_6',['basic_bol',['../classstdex_1_1parser_1_1basic__bol.html',1,'stdex::parser']]], + ['basic_5fbranch_7',['basic_branch',['../classstdex_1_1parser_1_1basic__branch.html',1,'stdex::parser']]], + ['basic_5fchemical_5fformula_8',['basic_chemical_formula',['../classstdex_1_1parser_1_1basic__chemical__formula.html',1,'stdex::parser']]], + ['basic_5fcu_9',['basic_cu',['../classstdex_1_1parser_1_1basic__cu.html',1,'stdex::parser']]], + ['basic_5fcu_5fset_10',['basic_cu_set',['../classstdex_1_1parser_1_1basic__cu__set.html',1,'stdex::parser']]], + ['basic_5fdate_11',['basic_date',['../classstdex_1_1parser_1_1basic__date.html',1,'stdex::parser']]], + ['basic_5fdns_5fdomain_5fchar_12',['basic_dns_domain_char',['../classstdex_1_1parser_1_1basic__dns__domain__char.html',1,'stdex::parser']]], + ['basic_5fdns_5fdomain_5fchar_3c_20char_20_3e_13',['basic_dns_domain_char< char >',['../classstdex_1_1parser_1_1basic__dns__domain__char.html',1,'stdex::parser']]], + ['basic_5fdns_5fname_14',['basic_dns_name',['../classstdex_1_1parser_1_1basic__dns__name.html',1,'stdex::parser']]], + ['basic_5femail_5faddress_15',['basic_email_address',['../classstdex_1_1parser_1_1basic__email__address.html',1,'stdex::parser']]], + ['basic_5femoticon_16',['basic_emoticon',['../classstdex_1_1parser_1_1basic__emoticon.html',1,'stdex::parser']]], + ['basic_5feol_17',['basic_eol',['../classstdex_1_1parser_1_1basic__eol.html',1,'stdex::parser']]], + ['basic_5ffile_18',['basic_file',['../classstdex_1_1stream_1_1basic__file.html',1,'stdex::stream']]], ['basic_5ffraction_19',['basic_fraction',['../classstdex_1_1parser_1_1basic__fraction.html',1,'stdex::parser']]], - ['basic_5ffstream_20',['basic_fstream',['../classstdex_1_1basic__fstream.html',1,'stdex']]], - ['basic_5finteger_21',['basic_integer',['../classstdex_1_1parser_1_1basic__integer.html',1,'stdex::parser']]], - ['basic_5finteger10_22',['basic_integer10',['../classstdex_1_1parser_1_1basic__integer10.html',1,'stdex::parser']]], - ['basic_5finteger10ts_23',['basic_integer10ts',['../classstdex_1_1parser_1_1basic__integer10ts.html',1,'stdex::parser']]], - ['basic_5finteger16_24',['basic_integer16',['../classstdex_1_1parser_1_1basic__integer16.html',1,'stdex::parser']]], - ['basic_5fiostreamfmt_25',['basic_iostreamfmt',['../classstdex_1_1basic__iostreamfmt.html',1,'stdex']]], - ['basic_5fipv4_5faddress_26',['basic_ipv4_address',['../classstdex_1_1parser_1_1basic__ipv4__address.html',1,'stdex::parser']]], - ['basic_5fipv6_5faddress_27',['basic_ipv6_address',['../classstdex_1_1parser_1_1basic__ipv6__address.html',1,'stdex::parser']]], - ['basic_5fipv6_5fscope_5fid_5fchar_28',['basic_ipv6_scope_id_char',['../classstdex_1_1parser_1_1basic__ipv6__scope__id__char.html',1,'stdex::parser']]], - ['basic_5fisharedstrstream_29',['basic_isharedstrstream',['../classstdex_1_1basic__isharedstrstream.html',1,'stdex']]], - ['basic_5fistreamfmt_30',['basic_istreamfmt',['../classstdex_1_1basic__istreamfmt.html',1,'stdex']]], - ['basic_5fiterations_31',['basic_iterations',['../classstdex_1_1parser_1_1basic__iterations.html',1,'stdex::parser']]], - ['basic_5fjson_5fstring_32',['basic_json_string',['../classstdex_1_1parser_1_1basic__json__string.html',1,'stdex::parser']]], - ['basic_5fmixed_5fnumeral_33',['basic_mixed_numeral',['../classstdex_1_1parser_1_1basic__mixed__numeral.html',1,'stdex::parser']]], - ['basic_5fmonetary_5fnumeral_34',['basic_monetary_numeral',['../classstdex_1_1parser_1_1basic__monetary__numeral.html',1,'stdex::parser']]], - ['basic_5fnoop_35',['basic_noop',['../classstdex_1_1parser_1_1basic__noop.html',1,'stdex::parser']]], - ['basic_5fostreamfmt_36',['basic_ostreamfmt',['../classstdex_1_1basic__ostreamfmt.html',1,'stdex']]], - ['basic_5fparser_37',['basic_parser',['../classstdex_1_1parser_1_1basic__parser.html',1,'stdex::parser']]], - ['basic_5fparser_3c_20char_20_3e_38',['basic_parser< char >',['../classstdex_1_1parser_1_1basic__parser.html',1,'stdex::parser']]], - ['basic_5fpermutation_39',['basic_permutation',['../classstdex_1_1parser_1_1basic__permutation.html',1,'stdex::parser']]], - ['basic_5fphone_5fnumber_40',['basic_phone_number',['../classstdex_1_1parser_1_1basic__phone__number.html',1,'stdex::parser']]], - ['basic_5fpunct_5fcu_41',['basic_punct_cu',['../classstdex_1_1parser_1_1basic__punct__cu.html',1,'stdex::parser']]], - ['basic_5fpunct_5fcu_3c_20char_20_3e_42',['basic_punct_cu< char >',['../classstdex_1_1parser_1_1basic__punct__cu.html',1,'stdex::parser']]], - ['basic_5froman_5fnumeral_43',['basic_roman_numeral',['../classstdex_1_1parser_1_1basic__roman__numeral.html',1,'stdex::parser']]], - ['basic_5fscientific_5fnumeral_44',['basic_scientific_numeral',['../classstdex_1_1parser_1_1basic__scientific__numeral.html',1,'stdex::parser']]], - ['basic_5fscore_45',['basic_score',['../classstdex_1_1parser_1_1basic__score.html',1,'stdex::parser']]], - ['basic_5fsequence_46',['basic_sequence',['../classstdex_1_1parser_1_1basic__sequence.html',1,'stdex::parser']]], - ['basic_5fset_47',['basic_set',['../classstdex_1_1parser_1_1basic__set.html',1,'stdex::parser']]], - ['basic_5fset_3c_20char_20_3e_48',['basic_set< char >',['../classstdex_1_1parser_1_1basic__set.html',1,'stdex::parser']]], - ['basic_5fsharedstrbuf_49',['basic_sharedstrbuf',['../classstdex_1_1basic__sharedstrbuf.html',1,'stdex']]], - ['basic_5fsigned_5fnumeral_50',['basic_signed_numeral',['../classstdex_1_1parser_1_1basic__signed__numeral.html',1,'stdex::parser']]], - ['basic_5fspace_5fcu_51',['basic_space_cu',['../classstdex_1_1parser_1_1basic__space__cu.html',1,'stdex::parser']]], - ['basic_5fspace_5fcu_3c_20char_20_3e_52',['basic_space_cu< char >',['../classstdex_1_1parser_1_1basic__space__cu.html',1,'stdex::parser']]], - ['basic_5fspace_5for_5fpunct_5fcu_53',['basic_space_or_punct_cu',['../classstdex_1_1parser_1_1basic__space__or__punct__cu.html',1,'stdex::parser']]], - ['basic_5fspace_5for_5fpunct_5fcu_3c_20char_20_3e_54',['basic_space_or_punct_cu< char >',['../classstdex_1_1parser_1_1basic__space__or__punct__cu.html',1,'stdex::parser']]], - ['basic_5fstring_55',['basic_string',['../classstdex_1_1parser_1_1basic__string.html',1,'stdex::parser']]], - ['basic_5fstring_5fbranch_56',['basic_string_branch',['../classstdex_1_1parser_1_1basic__string__branch.html',1,'stdex::parser']]], - ['basic_5fstringstream_57',['basic_stringstream',['../classstdex_1_1basic__stringstream.html',1,'stdex']]], - ['basic_5ftime_58',['basic_time',['../classstdex_1_1parser_1_1basic__time.html',1,'stdex::parser']]], - ['basic_5furl_59',['basic_url',['../classstdex_1_1parser_1_1basic__url.html',1,'stdex::parser']]], - ['basic_5furl_5fpassword_5fchar_60',['basic_url_password_char',['../classstdex_1_1parser_1_1basic__url__password__char.html',1,'stdex::parser']]], - ['basic_5furl_5fpassword_5fchar_3c_20char_20_3e_61',['basic_url_password_char< char >',['../classstdex_1_1parser_1_1basic__url__password__char.html',1,'stdex::parser']]], - ['basic_5furl_5fpath_62',['basic_url_path',['../classstdex_1_1parser_1_1basic__url__path.html',1,'stdex::parser']]], - ['basic_5furl_5fpath_5fchar_63',['basic_url_path_char',['../classstdex_1_1parser_1_1basic__url__path__char.html',1,'stdex::parser']]], - ['basic_5furl_5fpath_5fchar_3c_20char_20_3e_64',['basic_url_path_char< char >',['../classstdex_1_1parser_1_1basic__url__path__char.html',1,'stdex::parser']]], - ['basic_5furl_5fusername_5fchar_65',['basic_url_username_char',['../classstdex_1_1parser_1_1basic__url__username__char.html',1,'stdex::parser']]], - ['basic_5furl_5fusername_5fchar_3c_20char_20_3e_66',['basic_url_username_char< char >',['../classstdex_1_1parser_1_1basic__url__username__char.html',1,'stdex::parser']]] + ['basic_5finteger_20',['basic_integer',['../classstdex_1_1parser_1_1basic__integer.html',1,'stdex::parser']]], + ['basic_5finteger10_21',['basic_integer10',['../classstdex_1_1parser_1_1basic__integer10.html',1,'stdex::parser']]], + ['basic_5finteger10ts_22',['basic_integer10ts',['../classstdex_1_1parser_1_1basic__integer10ts.html',1,'stdex::parser']]], + ['basic_5finteger16_23',['basic_integer16',['../classstdex_1_1parser_1_1basic__integer16.html',1,'stdex::parser']]], + ['basic_5fipv4_5faddress_24',['basic_ipv4_address',['../classstdex_1_1parser_1_1basic__ipv4__address.html',1,'stdex::parser']]], + ['basic_5fipv6_5faddress_25',['basic_ipv6_address',['../classstdex_1_1parser_1_1basic__ipv6__address.html',1,'stdex::parser']]], + ['basic_5fipv6_5fscope_5fid_5fchar_26',['basic_ipv6_scope_id_char',['../classstdex_1_1parser_1_1basic__ipv6__scope__id__char.html',1,'stdex::parser']]], + ['basic_5fiterations_27',['basic_iterations',['../classstdex_1_1parser_1_1basic__iterations.html',1,'stdex::parser']]], + ['basic_5fjson_5fstring_28',['basic_json_string',['../classstdex_1_1parser_1_1basic__json__string.html',1,'stdex::parser']]], + ['basic_5fmixed_5fnumeral_29',['basic_mixed_numeral',['../classstdex_1_1parser_1_1basic__mixed__numeral.html',1,'stdex::parser']]], + ['basic_5fmonetary_5fnumeral_30',['basic_monetary_numeral',['../classstdex_1_1parser_1_1basic__monetary__numeral.html',1,'stdex::parser']]], + ['basic_5fnoop_31',['basic_noop',['../classstdex_1_1parser_1_1basic__noop.html',1,'stdex::parser']]], + ['basic_5fparser_32',['basic_parser',['../classstdex_1_1parser_1_1basic__parser.html',1,'stdex::parser']]], + ['basic_5fparser_3c_20char_20_3e_33',['basic_parser< char >',['../classstdex_1_1parser_1_1basic__parser.html',1,'stdex::parser']]], + ['basic_5fpermutation_34',['basic_permutation',['../classstdex_1_1parser_1_1basic__permutation.html',1,'stdex::parser']]], + ['basic_5fphone_5fnumber_35',['basic_phone_number',['../classstdex_1_1parser_1_1basic__phone__number.html',1,'stdex::parser']]], + ['basic_5fpunct_5fcu_36',['basic_punct_cu',['../classstdex_1_1parser_1_1basic__punct__cu.html',1,'stdex::parser']]], + ['basic_5fpunct_5fcu_3c_20char_20_3e_37',['basic_punct_cu< char >',['../classstdex_1_1parser_1_1basic__punct__cu.html',1,'stdex::parser']]], + ['basic_5froman_5fnumeral_38',['basic_roman_numeral',['../classstdex_1_1parser_1_1basic__roman__numeral.html',1,'stdex::parser']]], + ['basic_5fscientific_5fnumeral_39',['basic_scientific_numeral',['../classstdex_1_1parser_1_1basic__scientific__numeral.html',1,'stdex::parser']]], + ['basic_5fscore_40',['basic_score',['../classstdex_1_1parser_1_1basic__score.html',1,'stdex::parser']]], + ['basic_5fsequence_41',['basic_sequence',['../classstdex_1_1parser_1_1basic__sequence.html',1,'stdex::parser']]], + ['basic_5fset_42',['basic_set',['../classstdex_1_1parser_1_1basic__set.html',1,'stdex::parser']]], + ['basic_5fset_3c_20char_20_3e_43',['basic_set< char >',['../classstdex_1_1parser_1_1basic__set.html',1,'stdex::parser']]], + ['basic_5fsigned_5fnumeral_44',['basic_signed_numeral',['../classstdex_1_1parser_1_1basic__signed__numeral.html',1,'stdex::parser']]], + ['basic_5fspace_5fcu_45',['basic_space_cu',['../classstdex_1_1parser_1_1basic__space__cu.html',1,'stdex::parser']]], + ['basic_5fspace_5fcu_3c_20char_20_3e_46',['basic_space_cu< char >',['../classstdex_1_1parser_1_1basic__space__cu.html',1,'stdex::parser']]], + ['basic_5fspace_5for_5fpunct_5fcu_47',['basic_space_or_punct_cu',['../classstdex_1_1parser_1_1basic__space__or__punct__cu.html',1,'stdex::parser']]], + ['basic_5fspace_5for_5fpunct_5fcu_3c_20char_20_3e_48',['basic_space_or_punct_cu< char >',['../classstdex_1_1parser_1_1basic__space__or__punct__cu.html',1,'stdex::parser']]], + ['basic_5fstring_49',['basic_string',['../classstdex_1_1parser_1_1basic__string.html',1,'stdex::parser']]], + ['basic_5fstring_5fbranch_50',['basic_string_branch',['../classstdex_1_1parser_1_1basic__string__branch.html',1,'stdex::parser']]], + ['basic_5fsys_51',['basic_sys',['../classstdex_1_1stream_1_1basic__sys.html',1,'stdex::stream']]], + ['basic_5ftime_52',['basic_time',['../classstdex_1_1parser_1_1basic__time.html',1,'stdex::parser']]], + ['basic_5furl_53',['basic_url',['../classstdex_1_1parser_1_1basic__url.html',1,'stdex::parser']]], + ['basic_5furl_5fpassword_5fchar_54',['basic_url_password_char',['../classstdex_1_1parser_1_1basic__url__password__char.html',1,'stdex::parser']]], + ['basic_5furl_5fpassword_5fchar_3c_20char_20_3e_55',['basic_url_password_char< char >',['../classstdex_1_1parser_1_1basic__url__password__char.html',1,'stdex::parser']]], + ['basic_5furl_5fpath_56',['basic_url_path',['../classstdex_1_1parser_1_1basic__url__path.html',1,'stdex::parser']]], + ['basic_5furl_5fpath_5fchar_57',['basic_url_path_char',['../classstdex_1_1parser_1_1basic__url__path__char.html',1,'stdex::parser']]], + ['basic_5furl_5fpath_5fchar_3c_20char_20_3e_58',['basic_url_path_char< char >',['../classstdex_1_1parser_1_1basic__url__path__char.html',1,'stdex::parser']]], + ['basic_5furl_5fusername_5fchar_59',['basic_url_username_char',['../classstdex_1_1parser_1_1basic__url__username__char.html',1,'stdex::parser']]], + ['basic_5furl_5fusername_5fchar_3c_20char_20_3e_60',['basic_url_username_char< char >',['../classstdex_1_1parser_1_1basic__url__username__char.html',1,'stdex::parser']]], + ['buffer_61',['buffer',['../classstdex_1_1stream_1_1buffer.html',1,'stdex::stream']]], + ['buffer_5ft_62',['buffer_t',['../structstdex_1_1stream_1_1buffer_1_1buffer__t.html',1,'stdex::stream::buffer']]], + ['buffered_5fsys_63',['buffered_sys',['../classstdex_1_1stream_1_1buffered__sys.html',1,'stdex::stream']]] ]; diff --git a/search/classes_10.js b/search/classes_10.js new file mode 100644 index 000000000..3c6b76703 --- /dev/null +++ b/search/classes_10.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['vector_5fqueue_0',['vector_queue',['../classstdex_1_1vector__queue.html',1,'stdex']]] +]; diff --git a/search/classes_11.js b/search/classes_11.js new file mode 100644 index 000000000..069bcc8ee --- /dev/null +++ b/search/classes_11.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['window_0',['window',['../classstdex_1_1stream_1_1window.html',1,'stdex::stream']]], + ['worker_1',['worker',['../classstdex_1_1stream_1_1replicator_1_1worker.html',1,'stdex::stream::replicator']]] +]; diff --git a/search/classes_2.js b/search/classes_2.js index 80d4a30be..50659e104 100644 --- a/search/classes_2.js +++ b/search/classes_2.js @@ -1,4 +1,7 @@ var searchData= [ - ['errno_5ferror_0',['errno_error',['../classstdex_1_1errno__error.html',1,'stdex']]] + ['cache_0',['cache',['../classstdex_1_1stream_1_1cache.html',1,'stdex::stream']]], + ['cache_5ft_1',['cache_t',['../structstdex_1_1stream_1_1cache_1_1cache__t.html',1,'stdex::stream::cache']]], + ['cached_5ffile_2',['cached_file',['../classstdex_1_1stream_1_1cached__file.html',1,'stdex::stream']]], + ['converter_3',['converter',['../classstdex_1_1stream_1_1converter.html',1,'stdex::stream']]] ]; diff --git a/search/classes_3.js b/search/classes_3.js index 60e029d9b..12e5c0ffc 100644 --- a/search/classes_3.js +++ b/search/classes_3.js @@ -1,5 +1,4 @@ var searchData= [ - ['getter_0',['getter',['../structstdex_1_1getter.html',1,'stdex']]], - ['global_5fprogress_1',['global_progress',['../classstdex_1_1global__progress.html',1,'stdex']]] + ['diag_5ffile_0',['diag_file',['../classstdex_1_1stream_1_1diag__file.html',1,'stdex::stream']]] ]; diff --git a/search/classes_4.js b/search/classes_4.js index 18a83bcf2..80d4a30be 100644 --- a/search/classes_4.js +++ b/search/classes_4.js @@ -1,33 +1,4 @@ var searchData= [ - ['hex_5fdec_0',['hex_dec',['../classstdex_1_1hex__dec.html',1,'stdex']]], - ['hex_5fenc_1',['hex_enc',['../classstdex_1_1hex__enc.html',1,'stdex']]], - ['http_5fagent_2',['http_agent',['../classstdex_1_1parser_1_1http__agent.html',1,'stdex::parser']]], - ['http_5fany_5ftype_3',['http_any_type',['../classstdex_1_1parser_1_1http__any__type.html',1,'stdex::parser']]], - ['http_5fasterisk_4',['http_asterisk',['../classstdex_1_1parser_1_1http__asterisk.html',1,'stdex::parser']]], - ['http_5fcookie_5',['http_cookie',['../classstdex_1_1parser_1_1http__cookie.html',1,'stdex::parser']]], - ['http_5fcookie_5fparameter_6',['http_cookie_parameter',['../classstdex_1_1parser_1_1http__cookie__parameter.html',1,'stdex::parser']]], - ['http_5ffactor_5fmore_7',['http_factor_more',['../structstdex_1_1parser_1_1http__factor__more.html',1,'stdex::parser']]], - ['http_5fheader_8',['http_header',['../classstdex_1_1parser_1_1http__header.html',1,'stdex::parser']]], - ['http_5flanguage_9',['http_language',['../classstdex_1_1parser_1_1http__language.html',1,'stdex::parser']]], - ['http_5fline_5fbreak_10',['http_line_break',['../classstdex_1_1parser_1_1http__line__break.html',1,'stdex::parser']]], - ['http_5fmedia_5frange_11',['http_media_range',['../classstdex_1_1parser_1_1http__media__range.html',1,'stdex::parser']]], - ['http_5fmedia_5ftype_12',['http_media_type',['../classstdex_1_1parser_1_1http__media__type.html',1,'stdex::parser']]], - ['http_5fparameter_13',['http_parameter',['../classstdex_1_1parser_1_1http__parameter.html',1,'stdex::parser']]], - ['http_5fprotocol_14',['http_protocol',['../classstdex_1_1parser_1_1http__protocol.html',1,'stdex::parser']]], - ['http_5fquoted_5fstring_15',['http_quoted_string',['../classstdex_1_1parser_1_1http__quoted__string.html',1,'stdex::parser']]], - ['http_5frequest_16',['http_request',['../classstdex_1_1parser_1_1http__request.html',1,'stdex::parser']]], - ['http_5fspace_17',['http_space',['../classstdex_1_1parser_1_1http__space.html',1,'stdex::parser']]], - ['http_5ftext_5fchar_18',['http_text_char',['../classstdex_1_1parser_1_1http__text__char.html',1,'stdex::parser']]], - ['http_5ftoken_19',['http_token',['../classstdex_1_1parser_1_1http__token.html',1,'stdex::parser']]], - ['http_5furl_20',['http_url',['../classstdex_1_1parser_1_1http__url.html',1,'stdex::parser']]], - ['http_5furl_5fparameter_21',['http_url_parameter',['../classstdex_1_1parser_1_1http__url__parameter.html',1,'stdex::parser']]], - ['http_5furl_5fpath_22',['http_url_path',['../classstdex_1_1parser_1_1http__url__path.html',1,'stdex::parser']]], - ['http_5furl_5fpath_5fsegment_23',['http_url_path_segment',['../classstdex_1_1parser_1_1http__url__path__segment.html',1,'stdex::parser']]], - ['http_5furl_5fport_24',['http_url_port',['../classstdex_1_1parser_1_1http__url__port.html',1,'stdex::parser']]], - ['http_5furl_5fserver_25',['http_url_server',['../classstdex_1_1parser_1_1http__url__server.html',1,'stdex::parser']]], - ['http_5fvalue_26',['http_value',['../classstdex_1_1parser_1_1http__value.html',1,'stdex::parser']]], - ['http_5fvalue_5fcollection_27',['http_value_collection',['../classstdex_1_1parser_1_1http__value__collection.html',1,'stdex::parser']]], - ['http_5fweight_28',['http_weight',['../classstdex_1_1parser_1_1http__weight.html',1,'stdex::parser']]], - ['http_5fweighted_5fvalue_29',['http_weighted_value',['../classstdex_1_1parser_1_1http__weighted__value.html',1,'stdex::parser']]] + ['errno_5ferror_0',['errno_error',['../classstdex_1_1errno__error.html',1,'stdex']]] ]; diff --git a/search/classes_5.js b/search/classes_5.js index a9ad3560e..669ed7ecc 100644 --- a/search/classes_5.js +++ b/search/classes_5.js @@ -1,5 +1,6 @@ var searchData= [ - ['interval_0',['interval',['../structstdex_1_1interval.html',1,'stdex']]], - ['interval_3c_20size_5ft_20_3e_1',['interval< size_t >',['../structstdex_1_1interval.html',1,'stdex']]] + ['fifo_0',['fifo',['../classstdex_1_1stream_1_1fifo.html',1,'stdex::stream']]], + ['file_1',['file',['../classstdex_1_1stream_1_1file.html',1,'stdex::stream']]], + ['file_5fwindow_2',['file_window',['../classstdex_1_1stream_1_1file__window.html',1,'stdex::stream']]] ]; diff --git a/search/classes_6.js b/search/classes_6.js index b4910aa4f..27d47497a 100644 --- a/search/classes_6.js +++ b/search/classes_6.js @@ -1,4 +1,4 @@ var searchData= [ - ['lazy_5fprogress_0',['lazy_progress',['../classstdex_1_1lazy__progress.html',1,'stdex']]] + ['global_5fprogress_0',['global_progress',['../classstdex_1_1global__progress.html',1,'stdex']]] ]; diff --git a/search/classes_7.js b/search/classes_7.js index edb3a8af9..18a83bcf2 100644 --- a/search/classes_7.js +++ b/search/classes_7.js @@ -1,4 +1,33 @@ var searchData= [ - ['mapping_0',['mapping',['../structstdex_1_1mapping.html',1,'stdex']]] + ['hex_5fdec_0',['hex_dec',['../classstdex_1_1hex__dec.html',1,'stdex']]], + ['hex_5fenc_1',['hex_enc',['../classstdex_1_1hex__enc.html',1,'stdex']]], + ['http_5fagent_2',['http_agent',['../classstdex_1_1parser_1_1http__agent.html',1,'stdex::parser']]], + ['http_5fany_5ftype_3',['http_any_type',['../classstdex_1_1parser_1_1http__any__type.html',1,'stdex::parser']]], + ['http_5fasterisk_4',['http_asterisk',['../classstdex_1_1parser_1_1http__asterisk.html',1,'stdex::parser']]], + ['http_5fcookie_5',['http_cookie',['../classstdex_1_1parser_1_1http__cookie.html',1,'stdex::parser']]], + ['http_5fcookie_5fparameter_6',['http_cookie_parameter',['../classstdex_1_1parser_1_1http__cookie__parameter.html',1,'stdex::parser']]], + ['http_5ffactor_5fmore_7',['http_factor_more',['../structstdex_1_1parser_1_1http__factor__more.html',1,'stdex::parser']]], + ['http_5fheader_8',['http_header',['../classstdex_1_1parser_1_1http__header.html',1,'stdex::parser']]], + ['http_5flanguage_9',['http_language',['../classstdex_1_1parser_1_1http__language.html',1,'stdex::parser']]], + ['http_5fline_5fbreak_10',['http_line_break',['../classstdex_1_1parser_1_1http__line__break.html',1,'stdex::parser']]], + ['http_5fmedia_5frange_11',['http_media_range',['../classstdex_1_1parser_1_1http__media__range.html',1,'stdex::parser']]], + ['http_5fmedia_5ftype_12',['http_media_type',['../classstdex_1_1parser_1_1http__media__type.html',1,'stdex::parser']]], + ['http_5fparameter_13',['http_parameter',['../classstdex_1_1parser_1_1http__parameter.html',1,'stdex::parser']]], + ['http_5fprotocol_14',['http_protocol',['../classstdex_1_1parser_1_1http__protocol.html',1,'stdex::parser']]], + ['http_5fquoted_5fstring_15',['http_quoted_string',['../classstdex_1_1parser_1_1http__quoted__string.html',1,'stdex::parser']]], + ['http_5frequest_16',['http_request',['../classstdex_1_1parser_1_1http__request.html',1,'stdex::parser']]], + ['http_5fspace_17',['http_space',['../classstdex_1_1parser_1_1http__space.html',1,'stdex::parser']]], + ['http_5ftext_5fchar_18',['http_text_char',['../classstdex_1_1parser_1_1http__text__char.html',1,'stdex::parser']]], + ['http_5ftoken_19',['http_token',['../classstdex_1_1parser_1_1http__token.html',1,'stdex::parser']]], + ['http_5furl_20',['http_url',['../classstdex_1_1parser_1_1http__url.html',1,'stdex::parser']]], + ['http_5furl_5fparameter_21',['http_url_parameter',['../classstdex_1_1parser_1_1http__url__parameter.html',1,'stdex::parser']]], + ['http_5furl_5fpath_22',['http_url_path',['../classstdex_1_1parser_1_1http__url__path.html',1,'stdex::parser']]], + ['http_5furl_5fpath_5fsegment_23',['http_url_path_segment',['../classstdex_1_1parser_1_1http__url__path__segment.html',1,'stdex::parser']]], + ['http_5furl_5fport_24',['http_url_port',['../classstdex_1_1parser_1_1http__url__port.html',1,'stdex::parser']]], + ['http_5furl_5fserver_25',['http_url_server',['../classstdex_1_1parser_1_1http__url__server.html',1,'stdex::parser']]], + ['http_5fvalue_26',['http_value',['../classstdex_1_1parser_1_1http__value.html',1,'stdex::parser']]], + ['http_5fvalue_5fcollection_27',['http_value_collection',['../classstdex_1_1parser_1_1http__value__collection.html',1,'stdex::parser']]], + ['http_5fweight_28',['http_weight',['../classstdex_1_1parser_1_1http__weight.html',1,'stdex::parser']]], + ['http_5fweighted_5fvalue_29',['http_weighted_value',['../classstdex_1_1parser_1_1http__weighted__value.html',1,'stdex::parser']]] ]; diff --git a/search/classes_8.js b/search/classes_8.js index 44e87a729..33252d03c 100644 --- a/search/classes_8.js +++ b/search/classes_8.js @@ -1,5 +1,6 @@ var searchData= [ - ['no_5fdelete_0',['no_delete',['../structstdex_1_1no__delete.html',1,'stdex']]], - ['no_5fdelete_3c_20t_5b_5d_3e_1',['no_delete< T[]>',['../structstdex_1_1no__delete_3_01_t_0f_0e_4.html',1,'stdex']]] + ['interval_0',['interval',['../structstdex_1_1interval.html',1,'stdex']]], + ['interval_3c_20fpos_5ft_20_3e_1',['interval< fpos_t >',['../structstdex_1_1interval.html',1,'stdex']]], + ['interval_3c_20size_5ft_20_3e_2',['interval< size_t >',['../structstdex_1_1interval.html',1,'stdex']]] ]; diff --git a/search/classes_9.js b/search/classes_9.js index dd70db9bc..f81f87d94 100644 --- a/search/classes_9.js +++ b/search/classes_9.js @@ -1,6 +1,5 @@ var searchData= [ - ['parser_5fcollection_0',['parser_collection',['../classstdex_1_1parser_1_1parser__collection.html',1,'stdex::parser']]], - ['progress_1',['progress',['../classstdex_1_1progress.html',1,'stdex']]], - ['progress_5fswitcher_2',['progress_switcher',['../classstdex_1_1progress__switcher.html',1,'stdex']]] + ['lazy_5fprogress_0',['lazy_progress',['../classstdex_1_1lazy__progress.html',1,'stdex']]], + ['limiter_1',['limiter',['../classstdex_1_1stream_1_1limiter.html',1,'stdex::stream']]] ]; diff --git a/search/classes_a.js b/search/classes_a.js index 2f18c4081..fac6d5bce 100644 --- a/search/classes_a.js +++ b/search/classes_a.js @@ -1,5 +1,5 @@ var searchData= [ - ['record_0',['record',['../classstdex_1_1idrec_1_1record.html',1,'stdex::idrec']]], - ['robber_1',['robber',['../structstdex_1_1robber.html',1,'stdex']]] + ['mapping_0',['mapping',['../structstdex_1_1mapping.html',1,'stdex']]], + ['memory_5ffile_1',['memory_file',['../classstdex_1_1stream_1_1memory__file.html',1,'stdex::stream']]] ]; diff --git a/search/classes_b.js b/search/classes_b.js index 5dfa2cc87..6869127a6 100644 --- a/search/classes_b.js +++ b/search/classes_b.js @@ -1,15 +1,6 @@ var searchData= [ - ['sgml_5fany_5fcp_0',['sgml_any_cp',['../classstdex_1_1parser_1_1sgml__any__cp.html',1,'stdex::parser']]], - ['sgml_5fcp_1',['sgml_cp',['../classstdex_1_1parser_1_1sgml__cp.html',1,'stdex::parser']]], - ['sgml_5fcp_5fset_2',['sgml_cp_set',['../classstdex_1_1parser_1_1sgml__cp__set.html',1,'stdex::parser']]], - ['sgml_5fdns_5fdomain_5fchar_3',['sgml_dns_domain_char',['../classstdex_1_1parser_1_1sgml__dns__domain__char.html',1,'stdex::parser']]], - ['sgml_5fipv6_5fscope_5fid_5fchar_4',['sgml_ipv6_scope_id_char',['../classstdex_1_1parser_1_1sgml__ipv6__scope__id__char.html',1,'stdex::parser']]], - ['sgml_5fpunct_5fcp_5',['sgml_punct_cp',['../classstdex_1_1parser_1_1sgml__punct__cp.html',1,'stdex::parser']]], - ['sgml_5fspace_5fcp_6',['sgml_space_cp',['../classstdex_1_1parser_1_1sgml__space__cp.html',1,'stdex::parser']]], - ['sgml_5fspace_5for_5fpunct_5fcp_7',['sgml_space_or_punct_cp',['../classstdex_1_1parser_1_1sgml__space__or__punct__cp.html',1,'stdex::parser']]], - ['sgml_5fstring_8',['sgml_string',['../classstdex_1_1parser_1_1sgml__string.html',1,'stdex::parser']]], - ['sgml_5furl_5fpassword_5fchar_9',['sgml_url_password_char',['../classstdex_1_1parser_1_1sgml__url__password__char.html',1,'stdex::parser']]], - ['sgml_5furl_5fpath_5fchar_10',['sgml_url_path_char',['../classstdex_1_1parser_1_1sgml__url__path__char.html',1,'stdex::parser']]], - ['sgml_5furl_5fusername_5fchar_11',['sgml_url_username_char',['../classstdex_1_1parser_1_1sgml__url__username__char.html',1,'stdex::parser']]] + ['no_5fdelete_0',['no_delete',['../structstdex_1_1no__delete.html',1,'stdex']]], + ['no_5fdelete_3c_20t_5b_5d_3e_1',['no_delete< T[]>',['../structstdex_1_1no__delete_3_01_t_0f_0e_4.html',1,'stdex']]], + ['node_5ft_2',['node_t',['../structstdex_1_1stream_1_1fifo_1_1node__t.html',1,'stdex::stream::fifo']]] ]; diff --git a/search/classes_c.js b/search/classes_c.js index a27d9a257..dd70db9bc 100644 --- a/search/classes_c.js +++ b/search/classes_c.js @@ -1,4 +1,6 @@ var searchData= [ - ['user_5fcancelled_0',['user_cancelled',['../classstdex_1_1user__cancelled.html',1,'stdex']]] + ['parser_5fcollection_0',['parser_collection',['../classstdex_1_1parser_1_1parser__collection.html',1,'stdex::parser']]], + ['progress_1',['progress',['../classstdex_1_1progress.html',1,'stdex']]], + ['progress_5fswitcher_2',['progress_switcher',['../classstdex_1_1progress__switcher.html',1,'stdex']]] ]; diff --git a/search/classes_d.js b/search/classes_d.js index 3c6b76703..9381891ab 100644 --- a/search/classes_d.js +++ b/search/classes_d.js @@ -1,4 +1,7 @@ var searchData= [ - ['vector_5fqueue_0',['vector_queue',['../classstdex_1_1vector__queue.html',1,'stdex']]] + ['record_0',['record',['../classstdex_1_1idrec_1_1record.html',1,'stdex::idrec']]], + ['replicator_1',['replicator',['../classstdex_1_1stream_1_1replicator.html',1,'stdex::stream']]], + ['ring_2',['ring',['../classstdex_1_1ring.html',1,'stdex']]], + ['ring_3c_20uint8_5ft_2c_20default_5fasync_5flimit_20_3e_3',['ring< uint8_t, default_async_limit >',['../classstdex_1_1ring.html',1,'stdex']]] ]; diff --git a/search/classes_e.js b/search/classes_e.js new file mode 100644 index 000000000..126348ddf --- /dev/null +++ b/search/classes_e.js @@ -0,0 +1,16 @@ +var searchData= +[ + ['sgml_5fany_5fcp_0',['sgml_any_cp',['../classstdex_1_1parser_1_1sgml__any__cp.html',1,'stdex::parser']]], + ['sgml_5fcp_1',['sgml_cp',['../classstdex_1_1parser_1_1sgml__cp.html',1,'stdex::parser']]], + ['sgml_5fcp_5fset_2',['sgml_cp_set',['../classstdex_1_1parser_1_1sgml__cp__set.html',1,'stdex::parser']]], + ['sgml_5fdns_5fdomain_5fchar_3',['sgml_dns_domain_char',['../classstdex_1_1parser_1_1sgml__dns__domain__char.html',1,'stdex::parser']]], + ['sgml_5fipv6_5fscope_5fid_5fchar_4',['sgml_ipv6_scope_id_char',['../classstdex_1_1parser_1_1sgml__ipv6__scope__id__char.html',1,'stdex::parser']]], + ['sgml_5fpunct_5fcp_5',['sgml_punct_cp',['../classstdex_1_1parser_1_1sgml__punct__cp.html',1,'stdex::parser']]], + ['sgml_5fspace_5fcp_6',['sgml_space_cp',['../classstdex_1_1parser_1_1sgml__space__cp.html',1,'stdex::parser']]], + ['sgml_5fspace_5for_5fpunct_5fcp_7',['sgml_space_or_punct_cp',['../classstdex_1_1parser_1_1sgml__space__or__punct__cp.html',1,'stdex::parser']]], + ['sgml_5fstring_8',['sgml_string',['../classstdex_1_1parser_1_1sgml__string.html',1,'stdex::parser']]], + ['sgml_5furl_5fpassword_5fchar_9',['sgml_url_password_char',['../classstdex_1_1parser_1_1sgml__url__password__char.html',1,'stdex::parser']]], + ['sgml_5furl_5fpath_5fchar_10',['sgml_url_path_char',['../classstdex_1_1parser_1_1sgml__url__path__char.html',1,'stdex::parser']]], + ['sgml_5furl_5fusername_5fchar_11',['sgml_url_username_char',['../classstdex_1_1parser_1_1sgml__url__username__char.html',1,'stdex::parser']]], + ['sys_5fobject_12',['sys_object',['../classstdex_1_1sys__object.html',1,'stdex']]] +]; diff --git a/search/classes_f.js b/search/classes_f.js new file mode 100644 index 000000000..a27d9a257 --- /dev/null +++ b/search/classes_f.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['user_5fcancelled_0',['user_cancelled',['../classstdex_1_1user__cancelled.html',1,'stdex']]] +]; diff --git a/search/functions_0.js b/search/functions_0.js index dbda1c5c1..0864cd382 100644 --- a/search/functions_0.js +++ b/search/functions_0.js @@ -3,5 +3,6 @@ var searchData= ['abs_0',['abs',['../classstdex_1_1vector__queue.html#ae31dd1a45546dc1ff91eaa82b97c0e1b',1,'stdex::vector_queue']]], ['at_1',['at',['../classstdex_1_1vector__queue.html#ae135f77af0deabaa5f2cfe5ca25b9f09',1,'stdex::vector_queue::at(size_type pos)'],['../classstdex_1_1vector__queue.html#ac2b559184798a59ee5fed26f27d92e3c',1,'stdex::vector_queue::at(size_type pos) const']]], ['at_5fabs_2',['at_abs',['../classstdex_1_1vector__queue.html#a881da485c13dcee1d35245570420877a',1,'stdex::vector_queue::at_abs(size_type pos)'],['../classstdex_1_1vector__queue.html#afee762c3280d33544ce8dd8ad20af40b',1,'stdex::vector_queue::at_abs(size_type pos) const']]], - ['attach_3',['attach',['../classstdex_1_1global__progress.html#aec91532fde2500a5458a397f91c88769',1,'stdex::global_progress']]] + ['atime_3',['atime',['../classstdex_1_1stream_1_1basic__file.html#a84936e230100934793aad8a516efa826',1,'stdex::stream::basic_file::atime()'],['../classstdex_1_1stream_1_1cache.html#a5fd8962b5a49d549a36d96f3e8919cd7',1,'stdex::stream::cache::atime()'],['../classstdex_1_1stream_1_1file.html#a4b5cdfe6c9dccd20726df867e34f4af3',1,'stdex::stream::file::atime()']]], + ['attach_4',['attach',['../classstdex_1_1global__progress.html#aec91532fde2500a5458a397f91c88769',1,'stdex::global_progress']]] ]; diff --git a/search/functions_1.js b/search/functions_1.js index d1583350b..411386a6d 100644 --- a/search/functions_1.js +++ b/search/functions_1.js @@ -1,7 +1,6 @@ var searchData= [ - ['back_0',['back',['../classstdex_1_1vector__queue.html#a564c31d1a260f9f210541b7fd4803d3e',1,'stdex::vector_queue::back()'],['../classstdex_1_1vector__queue.html#a4a76efc22a2e2b9310b541ba44fd05e9',1,'stdex::vector_queue::back() const']]], + ['back_0',['back',['../classstdex_1_1ring.html#a3e41365e5bcb914099baff6b02686bca',1,'stdex::ring::back()'],['../classstdex_1_1vector__queue.html#a564c31d1a260f9f210541b7fd4803d3e',1,'stdex::vector_queue::back()'],['../classstdex_1_1vector__queue.html#a4a76efc22a2e2b9310b541ba44fd05e9',1,'stdex::vector_queue::back() const']]], ['base64_5fdec_1',['base64_dec',['../classstdex_1_1base64__dec.html#a17d956a883e99d8d884d2cb2edade8c5',1,'stdex::base64_dec']]], - ['base64_5fenc_2',['base64_enc',['../classstdex_1_1base64__enc.html#abc6c72530634c3fea8168710ab5b1a28',1,'stdex::base64_enc']]], - ['basic_5fstringstream_3',['basic_stringstream',['../classstdex_1_1basic__stringstream.html#a2b348acda5a00a457b177a121666c074',1,'stdex::basic_stringstream::basic_stringstream(const T *filename, std::ios_base::openmode mode=std::ios_base::in, int prot=std::ios_base::_Default_open_prot)'],['../classstdex_1_1basic__stringstream.html#ab394645b71493be2725cd87c927b79fa',1,'stdex::basic_stringstream::basic_stringstream(const std::basic_string< _Elem2, _Traits2, _Alloc2 > &filename, std::ios_base::openmode mode=std::ios_base::in, int prot=std::ios_base::_Default_open_prot)']]] + ['base64_5fenc_2',['base64_enc',['../classstdex_1_1base64__enc.html#abc6c72530634c3fea8168710ab5b1a28',1,'stdex::base64_enc']]] ]; diff --git a/search/functions_10.js b/search/functions_10.js index 69757a5af..f9633d8ff 100644 --- a/search/functions_10.js +++ b/search/functions_10.js @@ -1,5 +1,21 @@ var searchData= [ - ['tail_0',['tail',['../classstdex_1_1vector__queue.html#a1b87831a03da17b15d8c330a47708d00',1,'stdex::vector_queue']]], - ['truncate_1',['truncate',['../classstdex_1_1basic__fstream.html#a1bd50e0c0e4cd1f3e6c6919df8417d3d',1,'stdex::basic_fstream']]] + ['save_0',['save',['../classstdex_1_1stream_1_1memory__file.html#aef50ff3c88577d89d83ee625cc5d1bfd',1,'stdex::stream::memory_file']]], + ['seek_1',['seek',['../classstdex_1_1stream_1_1basic__file.html#afcaac612398bd7d02d8d146dcad74465',1,'stdex::stream::basic_file::seek()'],['../classstdex_1_1stream_1_1diag__file.html#a9f616580a2547b37beccd7d114ed06d0',1,'stdex::stream::diag_file::seek()'],['../classstdex_1_1stream_1_1memory__file.html#a9e67e40e9e3c0f7b002fcdab5220b4e7',1,'stdex::stream::memory_file::seek()'],['../classstdex_1_1stream_1_1cache.html#af2979118bdeca35cbfd84a8a2be00f8a',1,'stdex::stream::cache::seek()'],['../classstdex_1_1stream_1_1file__window.html#a53a12a1979b770030c0de05b349f1e55',1,'stdex::stream::file_window::seek()'],['../classstdex_1_1stream_1_1file.html#acdfc1dc079ebeaeb05312e03925485ff',1,'stdex::stream::file::seek()']]], + ['seekbeg_2',['seekbeg',['../classstdex_1_1stream_1_1basic__file.html#a6a8da9a1b0a3926b9bc453bf0209ee5e',1,'stdex::stream::basic_file']]], + ['seekcur_3',['seekcur',['../classstdex_1_1stream_1_1basic__file.html#a8158cb89ef54a737b7bcfed635c215d6',1,'stdex::stream::basic_file']]], + ['seekend_4',['seekend',['../classstdex_1_1stream_1_1basic__file.html#ae13b5941415b3dbb9883c1da9bcd39c7',1,'stdex::stream::basic_file']]], + ['set_5',['set',['../classstdex_1_1stream_1_1memory__file.html#a8ccb02a23999882255d5c16c83f91571',1,'stdex::stream::memory_file::set()'],['../classstdex_1_1global__progress.html#a76e66104444c77b89b687b4ad4945e8e',1,'stdex::global_progress::set()'],['../classstdex_1_1lazy__progress.html#a4e3e7a80da8cce7ccec69c78fcaaabae',1,'stdex::lazy_progress::set()'],['../classstdex_1_1progress.html#acf3a29daf22709bf7e94e864c8be95a1',1,'stdex::progress::set()']]], + ['set_5fatime_6',['set_atime',['../classstdex_1_1stream_1_1basic__file.html#ae76436514ac66d88bbd584ea07d879d0',1,'stdex::stream::basic_file::set_atime()'],['../classstdex_1_1stream_1_1cache.html#af026881969ee78e2aef1bf02922aea93',1,'stdex::stream::cache::set_atime()'],['../classstdex_1_1stream_1_1file.html#a64ded627a8843c155ea3a59b94c225f6',1,'stdex::stream::file::set_atime()']]], + ['set_5fctime_7',['set_ctime',['../classstdex_1_1stream_1_1basic__file.html#aba668e53fc4709cd545f12a49521ed56',1,'stdex::stream::basic_file::set_ctime()'],['../classstdex_1_1stream_1_1cache.html#ae62a75156ff79910e1b9afc506e38e44',1,'stdex::stream::cache::set_ctime()'],['../classstdex_1_1stream_1_1file.html#a337a27cd63975e155b6ba29a18ed9a23',1,'stdex::stream::file::set_ctime()']]], + ['set_5fglobal_5frange_8',['set_global_range',['../classstdex_1_1global__progress.html#ac68b491c62861fae1b16abb3477cb9c1',1,'stdex::global_progress']]], + ['set_5fmtime_9',['set_mtime',['../classstdex_1_1stream_1_1file.html#a567620d1eb84032e460f3e173f9bd762',1,'stdex::stream::file::set_mtime()'],['../classstdex_1_1stream_1_1basic__file.html#a814a080cb6da2041013749cc125bfd2b',1,'stdex::stream::basic_file::set_mtime()'],['../classstdex_1_1stream_1_1cache.html#aafad7bfb4c03d0d56854b4c148ae0ee1',1,'stdex::stream::cache::set_mtime()']]], + ['set_5frange_10',['set_range',['../classstdex_1_1progress.html#afbb1513bdb20340ebb21bd988f4e424a',1,'stdex::progress::set_range()'],['../classstdex_1_1lazy__progress.html#ada3a0d4f0086823558115a8064ffffb6',1,'stdex::lazy_progress::set_range()'],['../classstdex_1_1global__progress.html#afb204b820637c19b494976af4a284704',1,'stdex::global_progress::set_range(T start, T end)']]], + ['set_5fsection_5frange_11',['set_section_range',['../classstdex_1_1global__progress.html#a242009bce7ac595975bbfd703ec58c3b',1,'stdex::global_progress']]], + ['set_5ftext_12',['set_text',['../classstdex_1_1progress.html#a2cab8b5ac137d16fced31ee205264b01',1,'stdex::progress::set_text()'],['../classstdex_1_1global__progress.html#a89b7116003ab3b6344d90f130c14933e',1,'stdex::global_progress::set_text()']]], + ['show_13',['show',['../classstdex_1_1progress.html#ab6e57aed9e7a18a501e8a63cef199d8e',1,'stdex::progress::show()'],['../classstdex_1_1global__progress.html#a32350e02d5904867402187e81a3c4a26',1,'stdex::global_progress::show()']]], + ['size_14',['size',['../classstdex_1_1stream_1_1file__window.html#a70d596dd863a5265303aab11db59768e',1,'stdex::stream::file_window::size()'],['../classstdex_1_1vector__queue.html#ad704df8c3664a6d3f3e0977d87162114',1,'stdex::vector_queue::size()'],['../classstdex_1_1stream_1_1diag__file.html#a0797e4eba9f702022e1c467694302871',1,'stdex::stream::diag_file::size()'],['../classstdex_1_1stream_1_1fifo.html#a3272bc89573fe75fe0e6de2600967c10',1,'stdex::stream::fifo::size()'],['../classstdex_1_1stream_1_1memory__file.html#a99b32855f1f85ccc7c08d71786c17a1c',1,'stdex::stream::memory_file::size()'],['../classstdex_1_1stream_1_1file.html#acc591c2378e51340b7af7fbf12d1a98f',1,'stdex::stream::file::size()'],['../classstdex_1_1stream_1_1cache.html#a769034b8641a17210a916091b112af2d',1,'stdex::stream::cache::size()'],['../classstdex_1_1stream_1_1basic__file.html#ad868d7c25aa45cefc95dd54a24febf2f',1,'stdex::stream::basic_file::size()'],['../structstdex_1_1interval.html#a8c5222bc73fc66ba78bfabc1b985c864',1,'stdex::interval::size()']]], + ['skip_15',['skip',['../classstdex_1_1stream_1_1basic.html#a52ce3bdf28a9a7fc5a881616c8db2da4',1,'stdex::stream::basic::skip()'],['../classstdex_1_1stream_1_1basic__file.html#a15a1e6a778adefea421f32d14c8178dd',1,'stdex::stream::basic_file::skip()'],['../classstdex_1_1stream_1_1file__window.html#a4202fcc2b9e69e40bf15aaa3b5f50dda',1,'stdex::stream::file_window::skip()']]], + ['state_16',['state',['../classstdex_1_1stream_1_1basic.html#a2aa36b007017c2052a0118c1df4910d0',1,'stdex::stream::basic']]], + ['sync_17',['sync',['../classstdex_1_1ring.html#a68e471c5801c9c8232464005a3225eb3',1,'stdex::ring']]] ]; diff --git a/search/functions_11.js b/search/functions_11.js index 07846fd6c..d38fcab0d 100644 --- a/search/functions_11.js +++ b/search/functions_11.js @@ -1,4 +1,6 @@ var searchData= [ - ['user_5fcancelled_0',['user_cancelled',['../classstdex_1_1user__cancelled.html#a69f77539ead37dbd249143ad4b4048bd',1,'stdex::user_cancelled']]] + ['tail_0',['tail',['../classstdex_1_1vector__queue.html#a1b87831a03da17b15d8c330a47708d00',1,'stdex::vector_queue']]], + ['tell_1',['tell',['../classstdex_1_1stream_1_1basic__file.html#ae072990f9c42b372048045717de438c3',1,'stdex::stream::basic_file::tell()'],['../classstdex_1_1stream_1_1file__window.html#ac5977ca09563126e2976abb356cb3b36',1,'stdex::stream::file_window::tell()'],['../classstdex_1_1stream_1_1cache.html#ae790c5f526771cfe2cb3b28d38a11dd9',1,'stdex::stream::cache::tell()'],['../classstdex_1_1stream_1_1file.html#aead21702bfdb09193a202afbce35421b',1,'stdex::stream::file::tell()'],['../classstdex_1_1stream_1_1memory__file.html#a665d78bdb906762139530035ba6013fa',1,'stdex::stream::memory_file::tell()'],['../classstdex_1_1stream_1_1diag__file.html#aa4ea6e5ca1ff91a6f5c9726f4251f3ce',1,'stdex::stream::diag_file::tell()']]], + ['truncate_2',['truncate',['../classstdex_1_1stream_1_1basic__file.html#a522305da60cc442ca3cd6b7aa2214d6e',1,'stdex::stream::basic_file::truncate()'],['../classstdex_1_1stream_1_1file__window.html#a10f67434e8f3784933e3f7fddd20ce54',1,'stdex::stream::file_window::truncate()'],['../classstdex_1_1stream_1_1cache.html#a2e19026e55cda14db786948b66d63aba',1,'stdex::stream::cache::truncate()'],['../classstdex_1_1stream_1_1file.html#aa1c4de0bca72ddc02db4e8328cefcf17',1,'stdex::stream::file::truncate()'],['../classstdex_1_1stream_1_1memory__file.html#aa35db1681e5c56046eaf0c70068b0d42',1,'stdex::stream::memory_file::truncate()'],['../classstdex_1_1stream_1_1diag__file.html#a1d0824a191f261a1c552b71a92584745',1,'stdex::stream::diag_file::truncate()']]] ]; diff --git a/search/functions_12.js b/search/functions_12.js index fa7ba73e9..868b7e440 100644 --- a/search/functions_12.js +++ b/search/functions_12.js @@ -1,5 +1,5 @@ var searchData= [ - ['vector_5fqueue_0',['vector_queue',['../classstdex_1_1vector__queue.html#a9cb327539aca0293920c0d436c6ea29b',1,'stdex::vector_queue::vector_queue(size_type size_max)'],['../classstdex_1_1vector__queue.html#a224fc214f514bb6dd333511613d89683',1,'stdex::vector_queue::vector_queue(const vector_queue< value_type > &other)'],['../classstdex_1_1vector__queue.html#a50fcb4c564c100ad02f963969572a7fb',1,'stdex::vector_queue::vector_queue(vector_queue< value_type > &&other)']]], - ['vprintf_1',['vprintf',['../classstdex_1_1basic__ostreamfmt.html#a6b57c4ecee218d7fbb2128727fe4edd9',1,'stdex::basic_ostreamfmt']]] + ['unlock_0',['unlock',['../classstdex_1_1stream_1_1basic__file.html#adf1a39e7aec3f14fedf6ce5c0984a791',1,'stdex::stream::basic_file::unlock()'],['../classstdex_1_1stream_1_1file__window.html#ac3d9a3cf3636010b43612d2c298e7c3d',1,'stdex::stream::file_window::unlock()'],['../classstdex_1_1stream_1_1cache.html#a7a15ab17abc847b380b13b43b4f1d12e',1,'stdex::stream::cache::unlock()'],['../classstdex_1_1stream_1_1file.html#a28e6d46e4183e094ef9fdcf591ebec46',1,'stdex::stream::file::unlock()'],['../classstdex_1_1stream_1_1diag__file.html#a9f0c158f4875c862f981282b818e7296',1,'stdex::stream::diag_file::unlock()']]], + ['user_5fcancelled_1',['user_cancelled',['../classstdex_1_1user__cancelled.html#a69f77539ead37dbd249143ad4b4048bd',1,'stdex::user_cancelled']]] ]; diff --git a/search/functions_13.js b/search/functions_13.js index 2d0adf0d9..2794eb10f 100644 --- a/search/functions_13.js +++ b/search/functions_13.js @@ -1,4 +1,4 @@ var searchData= [ - ['_7evector_5fqueue_0',['~vector_queue',['../classstdex_1_1vector__queue.html#a61460b8386f0ebc0a9c76db9951d342d',1,'stdex::vector_queue']]] + ['vector_5fqueue_0',['vector_queue',['../classstdex_1_1vector__queue.html#a9cb327539aca0293920c0d436c6ea29b',1,'stdex::vector_queue::vector_queue(size_type size_max)'],['../classstdex_1_1vector__queue.html#a224fc214f514bb6dd333511613d89683',1,'stdex::vector_queue::vector_queue(const vector_queue< value_type > &other)'],['../classstdex_1_1vector__queue.html#a50fcb4c564c100ad02f963969572a7fb',1,'stdex::vector_queue::vector_queue(vector_queue< value_type > &&other)']]] ]; diff --git a/search/functions_14.js b/search/functions_14.js new file mode 100644 index 000000000..e5d8cbd54 --- /dev/null +++ b/search/functions_14.js @@ -0,0 +1,12 @@ +var searchData= +[ + ['write_0',['write',['../classstdex_1_1stream_1_1converter.html#ae84a5c8d64942dbaa81ed54a181b3d7a',1,'stdex::stream::converter::write()'],['../classstdex_1_1stream_1_1replicator.html#abbbaa912a887b00a4a7a5d518079f5ec',1,'stdex::stream::replicator::write()'],['../classstdex_1_1stream_1_1async__writer.html#a39d3fc4fffb8aa9b971fa15beaa8149b',1,'stdex::stream::async_writer::write()'],['../classstdex_1_1stream_1_1buffer.html#a489a01a4c187e85f06ebe10314a891ae',1,'stdex::stream::buffer::write()'],['../classstdex_1_1stream_1_1limiter.html#a8fe783b504f019e29034c0572cec7834',1,'stdex::stream::limiter::write()'],['../classstdex_1_1stream_1_1window.html#a06f05191c35fdbadebc49e05a19d9f3c',1,'stdex::stream::window::write()'],['../classstdex_1_1stream_1_1file__window.html#a7a264381cf344fcd6fa70e0a4964cc93',1,'stdex::stream::file_window::write()'],['../classstdex_1_1stream_1_1cache.html#ac436fbcac7eddf95b6e25d6368da3fb7',1,'stdex::stream::cache::write()'],['../classstdex_1_1stream_1_1basic__sys.html#a06666e09bf1e7486d277996267b51618',1,'stdex::stream::basic_sys::write()'],['../classstdex_1_1stream_1_1memory__file.html#ae5b6602e176f1053ab2eef88d8312b49',1,'stdex::stream::memory_file::write()'],['../classstdex_1_1stream_1_1fifo.html#a30c7adb43b6f4bd0cb5d9c72f15fe9bf',1,'stdex::stream::fifo::write()'],['../classstdex_1_1stream_1_1diag__file.html#a3157aee8e9c754b02e876897fcb82236',1,'stdex::stream::diag_file::write()'],['../classstdex_1_1stream_1_1basic.html#ad8af0444273509eb36ad81046ac92081',1,'stdex::stream::basic::write(_In_reads_bytes_opt_(length) const void *data, size_t length)']]], + ['write_5farray_1',['write_array',['../classstdex_1_1stream_1_1basic.html#a248d5e688633f04139ee36aacc0258ad',1,'stdex::stream::basic::write_array(_In_reads_or_z_opt_(num_chars) const wchar_t *wstr, size_t num_chars, charset_id charset)'],['../classstdex_1_1stream_1_1basic.html#af6c10ec4ab181b5ed5b061d115059b7a',1,'stdex::stream::basic::write_array(_In_reads_bytes_opt_(size *count) const void *array, size_t size, size_t count)']]], + ['write_5fbyte_2',['write_byte',['../classstdex_1_1stream_1_1basic.html#af83cd6902f3f3bf18df2f08045570603',1,'stdex::stream::basic::write_byte()'],['../classstdex_1_1stream_1_1memory__file.html#a7d2187e9f98729b2c711a9cd242b7fc2',1,'stdex::stream::memory_file::write_byte()']]], + ['write_5fcharset_3',['write_charset',['../classstdex_1_1stream_1_1basic.html#ab61abc19936554288ea929e0eb299144',1,'stdex::stream::basic']]], + ['write_5fdata_4',['write_data',['../classstdex_1_1stream_1_1basic.html#acabab42a910d149fec6ef60090a34aab',1,'stdex::stream::basic::write_data()'],['../classstdex_1_1stream_1_1memory__file.html#ab0bcf389dd3540a5f978ef13dff5d332',1,'stdex::stream::memory_file::write_data()']]], + ['write_5fsprintf_5',['write_sprintf',['../classstdex_1_1stream_1_1basic.html#a63528d1cf030257c9d7f24d0d1d668f7',1,'stdex::stream::basic::write_sprintf(_Printf_format_string_params_(2) const char *format, locale_t locale,...)'],['../classstdex_1_1stream_1_1basic.html#a32f854944dc108d99c5ea5e87b19db7e',1,'stdex::stream::basic::write_sprintf(_Printf_format_string_params_(2) const wchar_t *format, locale_t locale,...)']]], + ['write_5fstr_6',['write_str',['../classstdex_1_1stream_1_1basic.html#a815369ef1a8ba07b289b8236fce018ac',1,'stdex::stream::basic::write_str()'],['../classstdex_1_1stream_1_1memory__file.html#ab8326c16c06548801982b07c930d7dfd',1,'stdex::stream::memory_file::write_str()']]], + ['write_5fstream_7',['write_stream',['../classstdex_1_1stream_1_1basic.html#ad28b193e6afa1352a00864bd28193cc2',1,'stdex::stream::basic::write_stream()'],['../classstdex_1_1stream_1_1memory__file.html#a4216e7ae6e306170357aef1ea1c304c7',1,'stdex::stream::memory_file::write_stream()']]], + ['write_5fvsprintf_8',['write_vsprintf',['../classstdex_1_1stream_1_1basic.html#a14931af91db2bab8204d6352a59c1bf7',1,'stdex::stream::basic::write_vsprintf(_Printf_format_string_params_(2) const char *format, locale_t locale, va_list params)'],['../classstdex_1_1stream_1_1basic.html#a3a7ac9211cd81b2203b55f1a2f131bc1',1,'stdex::stream::basic::write_vsprintf(_Printf_format_string_params_(2) const wchar_t *format, locale_t locale, va_list params)']]] +]; diff --git a/search/functions_15.js b/search/functions_15.js new file mode 100644 index 000000000..2d0adf0d9 --- /dev/null +++ b/search/functions_15.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['_7evector_5fqueue_0',['~vector_queue',['../classstdex_1_1vector__queue.html#a61460b8386f0ebc0a9c76db9951d342d',1,'stdex::vector_queue']]] +]; diff --git a/search/functions_2.js b/search/functions_2.js index adc49238e..fe8320309 100644 --- a/search/functions_2.js +++ b/search/functions_2.js @@ -1,7 +1,10 @@ var searchData= [ - ['cancel_0',['cancel',['../classstdex_1_1progress.html#a03380c822297092b3bb9867deee26202',1,'stdex::progress::cancel()'],['../classstdex_1_1global__progress.html#a74a5ea9089ff7b7015ea4a2071f3113e',1,'stdex::global_progress::cancel()']]], - ['capacity_1',['capacity',['../classstdex_1_1vector__queue.html#add3d6ed93d3c1471b80351c56639bab7',1,'stdex::vector_queue']]], - ['clear_2',['clear',['../classstdex_1_1base64__enc.html#afb6a85176589d9ce1f65ce6355592fe7',1,'stdex::base64_enc::clear()'],['../classstdex_1_1base64__dec.html#a94738b63789489022e0c16063b732305',1,'stdex::base64_dec::clear()'],['../classstdex_1_1hex__dec.html#a282bf5db0d16b29b12c71b73d3a33cc4',1,'stdex::hex_dec::clear()'],['../classstdex_1_1vector__queue.html#a93259be5f471580d2f8d7bee41032f9b',1,'stdex::vector_queue::clear()']]], - ['close_3',['close',['../classstdex_1_1idrec_1_1record.html#ae63ba9487daaf8ec39dfe7dd04c13cc9',1,'stdex::idrec::record']]] + ['cached_5ffile_0',['cached_file',['../classstdex_1_1stream_1_1cached__file.html#aace5ebb17927a869e6e923b592d8b3da',1,'stdex::stream::cached_file']]], + ['cancel_1',['cancel',['../classstdex_1_1progress.html#a03380c822297092b3bb9867deee26202',1,'stdex::progress::cancel()'],['../classstdex_1_1global__progress.html#a74a5ea9089ff7b7015ea4a2071f3113e',1,'stdex::global_progress::cancel()']]], + ['capacity_2',['capacity',['../classstdex_1_1vector__queue.html#add3d6ed93d3c1471b80351c56639bab7',1,'stdex::vector_queue']]], + ['clear_3',['clear',['../classstdex_1_1base64__enc.html#afb6a85176589d9ce1f65ce6355592fe7',1,'stdex::base64_enc::clear()'],['../classstdex_1_1base64__dec.html#a94738b63789489022e0c16063b732305',1,'stdex::base64_dec::clear()'],['../classstdex_1_1hex__dec.html#a282bf5db0d16b29b12c71b73d3a33cc4',1,'stdex::hex_dec::clear()'],['../classstdex_1_1vector__queue.html#a93259be5f471580d2f8d7bee41032f9b',1,'stdex::vector_queue::clear()']]], + ['close_4',['close',['../classstdex_1_1stream_1_1file__window.html#acace60a7ba95a139852f85aa4232bb14',1,'stdex::stream::file_window::close()'],['../classstdex_1_1sys__object.html#acbb82c6c1fce7ee39518f94b1209b0b8',1,'stdex::sys_object::close(sys_handle h)'],['../classstdex_1_1sys__object.html#ab8c0119bc4958f78f51ef2f3b7c91f66',1,'stdex::sys_object::close()'],['../classstdex_1_1stream_1_1diag__file.html#a4367a6d2840c1a2c5d9ab2ab3483ed2c',1,'stdex::stream::diag_file::close()'],['../classstdex_1_1stream_1_1fifo.html#a29e0a95836f4e2692bea3783acaf692d',1,'stdex::stream::fifo::close()'],['../classstdex_1_1stream_1_1memory__file.html#a4cf33faaf1686335bd3e3a7e72813dd6',1,'stdex::stream::memory_file::close()'],['../classstdex_1_1stream_1_1basic__sys.html#aee56fbeb8b576a4337cb205ae865fafc',1,'stdex::stream::basic_sys::close()'],['../classstdex_1_1stream_1_1cache.html#aa88074bb669bcb654e027b76e32a2799',1,'stdex::stream::cache::close()'],['../classstdex_1_1stream_1_1replicator.html#afa3e2cec6e254e7bb53cc5e1b1ea0f90',1,'stdex::stream::replicator::close()'],['../classstdex_1_1stream_1_1converter.html#a96c368204acf32239318a026762cd22c',1,'stdex::stream::converter::close()'],['../classstdex_1_1stream_1_1basic.html#a5392748c19b5799da94a5fe031f7ec3b',1,'stdex::stream::basic::close()'],['../classstdex_1_1idrec_1_1record.html#ae63ba9487daaf8ec39dfe7dd04c13cc9',1,'stdex::idrec::record::close()']]], + ['contains_5',['contains',['../structstdex_1_1interval.html#a1624ca77e8c9cb45cef61f7f8b532222',1,'stdex::interval']]], + ['ctime_6',['ctime',['../classstdex_1_1stream_1_1basic__file.html#a3c02c83246c43ed868dab1dd5a5d698d',1,'stdex::stream::basic_file::ctime()'],['../classstdex_1_1stream_1_1cache.html#a0306f70f169f924f41306c71646c9276',1,'stdex::stream::cache::ctime()'],['../classstdex_1_1stream_1_1file.html#aa54131619fe782de419ed74bab377dd5',1,'stdex::stream::file::ctime()']]] ]; diff --git a/search/functions_3.js b/search/functions_3.js index d072a1ea2..849560f2a 100644 --- a/search/functions_3.js +++ b/search/functions_3.js @@ -1,7 +1,9 @@ var searchData= [ - ['dec_5fsize_0',['dec_size',['../classstdex_1_1base64__dec.html#a203f2afa5839242c1230cb22e0a65b25',1,'stdex::base64_dec::dec_size()'],['../classstdex_1_1hex__dec.html#acf3d5adf4766056a630d1ceeab946b55',1,'stdex::hex_dec::dec_size()']]], - ['decode_1',['decode',['../classstdex_1_1base64__dec.html#a1beaf09718d63d49f9d95cf0e75a50bf',1,'stdex::base64_dec::decode(std::vector< _Ty, _Ax > &out, bool &is_last, const _Tchr *data, size_t size)'],['../classstdex_1_1base64__dec.html#a4b5f0334d5d5f85b7d02b6b21db8759e',1,'stdex::base64_dec::decode(std::vector< _Ty, _Ax > &out)'],['../classstdex_1_1hex__dec.html#ab5ac7cfefa8db97c8196d1ef2c327406',1,'stdex::hex_dec::decode()']]], - ['detach_2',['detach',['../classstdex_1_1global__progress.html#aa2c5391aa2f1f30e72a700768bc52f84',1,'stdex::global_progress']]], - ['do_5fset_3',['do_set',['../classstdex_1_1lazy__progress.html#ad0242cb4f3ece8aacfaab8804e7c646e',1,'stdex::lazy_progress']]] + ['data_0',['data',['../classstdex_1_1stream_1_1memory__file.html#aff374fc64c7453dc0cef22f19bc400ce',1,'stdex::stream::memory_file']]], + ['dec_5fsize_1',['dec_size',['../classstdex_1_1base64__dec.html#a203f2afa5839242c1230cb22e0a65b25',1,'stdex::base64_dec::dec_size()'],['../classstdex_1_1hex__dec.html#acf3d5adf4766056a630d1ceeab946b55',1,'stdex::hex_dec::dec_size()']]], + ['decode_2',['decode',['../classstdex_1_1base64__dec.html#a1beaf09718d63d49f9d95cf0e75a50bf',1,'stdex::base64_dec::decode(std::vector< _Ty, _Ax > &out, bool &is_last, const _Tchr *data, size_t size)'],['../classstdex_1_1base64__dec.html#a4b5f0334d5d5f85b7d02b6b21db8759e',1,'stdex::base64_dec::decode(std::vector< _Ty, _Ax > &out)'],['../classstdex_1_1hex__dec.html#ab5ac7cfefa8db97c8196d1ef2c327406',1,'stdex::hex_dec::decode()']]], + ['detach_3',['detach',['../classstdex_1_1global__progress.html#aa2c5391aa2f1f30e72a700768bc52f84',1,'stdex::global_progress']]], + ['do_5fset_4',['do_set',['../classstdex_1_1lazy__progress.html#ad0242cb4f3ece8aacfaab8804e7c646e',1,'stdex::lazy_progress']]], + ['duplicate_5',['duplicate',['../classstdex_1_1sys__object.html#abf438fb703eeed47147841b07b44d46d',1,'stdex::sys_object']]] ]; diff --git a/search/functions_5.js b/search/functions_5.js index beade29f3..37a825f0d 100644 --- a/search/functions_5.js +++ b/search/functions_5.js @@ -1,5 +1,7 @@ var searchData= [ - ['find_0',['find',['../classstdex_1_1idrec_1_1record.html#a19523040d07119055884a7a2f8ef25fd',1,'stdex::idrec::record']]], - ['front_1',['front',['../classstdex_1_1vector__queue.html#a61df210878f6b8b2c1b213a93b8af581',1,'stdex::vector_queue::front()'],['../classstdex_1_1vector__queue.html#a96ea84ab879a3190beabdbac5ad7e0ab',1,'stdex::vector_queue::front() const']]] + ['file_0',['file',['../classstdex_1_1stream_1_1file.html#a3324c7a122b9debf2fde7f4e4f340683',1,'stdex::stream::file']]], + ['find_1',['find',['../classstdex_1_1idrec_1_1record.html#a19523040d07119055884a7a2f8ef25fd',1,'stdex::idrec::record']]], + ['flush_2',['flush',['../classstdex_1_1stream_1_1basic.html#a46c70519f3e4b1f3436e85a6623555dc',1,'stdex::stream::basic::flush()'],['../classstdex_1_1stream_1_1converter.html#a0d6af4c223625bc8ab677978b225d06e',1,'stdex::stream::converter::flush()'],['../classstdex_1_1stream_1_1replicator.html#a77d2ddda29ef5dfb835453ff1dd90f2e',1,'stdex::stream::replicator::flush()'],['../classstdex_1_1stream_1_1async__writer.html#a25c72d3b2edaba300eb158d06dfd03d2',1,'stdex::stream::async_writer::flush()'],['../classstdex_1_1stream_1_1buffer.html#a18f9edc9af41f3a71d84f7eb4e7d5332',1,'stdex::stream::buffer::flush()'],['../classstdex_1_1stream_1_1file__window.html#a2a2b88934b073b456da579ca3e3b43ff',1,'stdex::stream::file_window::flush()'],['../classstdex_1_1stream_1_1cache.html#ac33e763d8103ad8e910b75085a4cf3ac',1,'stdex::stream::cache::flush()'],['../classstdex_1_1stream_1_1basic__sys.html#a6eae9769feea69fa9ce8b127ca2f7891',1,'stdex::stream::basic_sys::flush()'],['../classstdex_1_1stream_1_1diag__file.html#aadb3e9de2c84e317bf454ae764d8fcdf',1,'stdex::stream::diag_file::flush()']]], + ['front_3',['front',['../classstdex_1_1ring.html#a9b6571832cc636d98885af61651a0998',1,'stdex::ring::front()'],['../classstdex_1_1vector__queue.html#a61df210878f6b8b2c1b213a93b8af581',1,'stdex::vector_queue::front()'],['../classstdex_1_1vector__queue.html#a96ea84ab879a3190beabdbac5ad7e0ab',1,'stdex::vector_queue::front() const']]] ]; diff --git a/search/functions_6.js b/search/functions_6.js index 6d002fba7..07c814c6c 100644 --- a/search/functions_6.js +++ b/search/functions_6.js @@ -1,4 +1,5 @@ var searchData= [ - ['global_5fprogress_0',['global_progress',['../classstdex_1_1global__progress.html#a0ffa6fafa04588c0df06d077ae51d037',1,'stdex::global_progress']]] + ['get_0',['get',['../classstdex_1_1stream_1_1memory__file.html#a41124fc38a3439c4407ea1c9ef4962b1',1,'stdex::stream::memory_file::get()'],['../classstdex_1_1sys__object.html#a68edd83d50aee1dd85645aa0506c8769',1,'stdex::sys_object::get()']]], + ['global_5fprogress_1',['global_progress',['../classstdex_1_1global__progress.html#a0ffa6fafa04588c0df06d077ae51d037',1,'stdex::global_progress']]] ]; diff --git a/search/functions_9.js b/search/functions_9.js index 958214fc5..c8d9e8f4e 100644 --- a/search/functions_9.js +++ b/search/functions_9.js @@ -1,4 +1,6 @@ var searchData= [ - ['lazy_5fprogress_0',['lazy_progress',['../classstdex_1_1lazy__progress.html#a90d8aaa2e2135537f7bb103bf795956a',1,'stdex::lazy_progress']]] + ['lazy_5fprogress_0',['lazy_progress',['../classstdex_1_1lazy__progress.html#a90d8aaa2e2135537f7bb103bf795956a',1,'stdex::lazy_progress']]], + ['load_1',['load',['../classstdex_1_1stream_1_1memory__file.html#a3333329f0e94c0d08caf326cfb483d15',1,'stdex::stream::memory_file']]], + ['lock_2',['lock',['../classstdex_1_1stream_1_1basic__file.html#a484ec74004fe0b4528c11675b91161e0',1,'stdex::stream::basic_file::lock()'],['../classstdex_1_1stream_1_1file__window.html#a820fea50931a0769161f617a524f72c6',1,'stdex::stream::file_window::lock()'],['../classstdex_1_1stream_1_1cache.html#ac1ca25b572574b35cd4895964e835204',1,'stdex::stream::cache::lock()'],['../classstdex_1_1stream_1_1file.html#a74fdb70cb8ce4d0ee73f6db9d7051d86',1,'stdex::stream::file::lock()'],['../classstdex_1_1stream_1_1diag__file.html#a5d4bcde718ef182590c742f0c600e54b',1,'stdex::stream::diag_file::lock()']]] ]; diff --git a/search/functions_a.js b/search/functions_a.js index 86e3a2889..004702923 100644 --- a/search/functions_a.js +++ b/search/functions_a.js @@ -1,5 +1,6 @@ var searchData= [ ['mapping_0',['mapping',['../structstdex_1_1mapping.html#a9634b5ef182398e24b61c2ca78cc8e46',1,'stdex::mapping::mapping()'],['../structstdex_1_1mapping.html#a48069d4eb38c276e856d650075f6c3bd',1,'stdex::mapping::mapping(T x)'],['../structstdex_1_1mapping.html#ae72436dbc2b54e2062822cd7772de830',1,'stdex::mapping::mapping(T _from, T _to)']]], - ['mtime_1',['mtime',['../classstdex_1_1basic__fstream.html#a183cd8e046c5ae2c3720204a8e61c54d',1,'stdex::basic_fstream']]] + ['memory_5ffile_1',['memory_file',['../classstdex_1_1stream_1_1memory__file.html#a6b4b9daa088fb20678a502e81553c745',1,'stdex::stream::memory_file::memory_file(size_t size, state_t state=state_t::ok)'],['../classstdex_1_1stream_1_1memory__file.html#af7fdc0b7ffcd3713487a75cfd9c1704f',1,'stdex::stream::memory_file::memory_file(void *data, size_t size, size_t reserved, bool manage=false, state_t state=state_t::ok)'],['../classstdex_1_1stream_1_1memory__file.html#ad0da8c8758672af312026957e2556b60',1,'stdex::stream::memory_file::memory_file(void *data, size_t size, bool manage=false, state_t state=state_t::ok)'],['../classstdex_1_1stream_1_1memory__file.html#a92f7f489afbe28ed27c4c48c2a54891c',1,'stdex::stream::memory_file::memory_file(const sys_char *filename, int mode)']]], + ['mtime_2',['mtime',['../classstdex_1_1stream_1_1basic__file.html#ae10432137e01b7ce7c254c2a455c719e',1,'stdex::stream::basic_file::mtime()'],['../classstdex_1_1stream_1_1cache.html#a8350e6c158982e5511da18ed122bf24d',1,'stdex::stream::cache::mtime()'],['../classstdex_1_1stream_1_1file.html#a23e1061f6a9473241ef8af99f6a3f08f',1,'stdex::stream::file::mtime()']]] ]; diff --git a/search/functions_c.js b/search/functions_c.js index 69b1b7482..25a8bb999 100644 --- a/search/functions_c.js +++ b/search/functions_c.js @@ -1,9 +1,10 @@ var searchData= [ - ['open_0',['open',['../classstdex_1_1idrec_1_1record.html#a379d9eeac3c52375982ba75df33604ca',1,'stdex::idrec::record']]], - ['operator_20bool_1',['operator bool',['../structstdex_1_1interval.html#a15945d1ba829410c61466d95922000d0',1,'stdex::interval']]], - ['operator_21_3d_2',['operator!=',['../structstdex_1_1interval.html#aa5e6ff5a63e3cd9f8e36a32663ebfda8',1,'stdex::interval::operator!=()'],['../structstdex_1_1mapping.html#a99e44b5840a155e5ce366d440cbe234b',1,'stdex::mapping::operator!=()']]], - ['operator_3d_3',['operator=',['../classstdex_1_1idrec_1_1record.html#a3d4bff1bf080fb8cb3960b5b5018392c',1,'stdex::idrec::record::operator=()'],['../classstdex_1_1vector__queue.html#a00e42f0b6c31aa16e47a1093e90fd1aa',1,'stdex::vector_queue::operator=(const vector_queue< value_type > &other)'],['../classstdex_1_1vector__queue.html#a840d69192e880fcce588c6368a7d1bab',1,'stdex::vector_queue::operator=(vector_queue< value_type > &&other)']]], - ['operator_3d_3d_4',['operator==',['../structstdex_1_1interval.html#abec7b896ea0d650fc086955b0cba00a9',1,'stdex::interval::operator==()'],['../structstdex_1_1mapping.html#a6d9fa746849e2ea27f53e40b8b44fb46',1,'stdex::mapping::operator==()']]], - ['operator_5b_5d_5',['operator[]',['../classstdex_1_1vector__queue.html#a21497b5396ef80a2d641f8ee767a3b17',1,'stdex::vector_queue::operator[](size_type pos)'],['../classstdex_1_1vector__queue.html#ace07c52caf736c3285909d64b22a2c4c',1,'stdex::vector_queue::operator[](size_type pos) const']]] + ['ok_0',['ok',['../classstdex_1_1stream_1_1basic.html#a0295e4efe18eef2a8962680274957ac1',1,'stdex::stream::basic']]], + ['open_1',['open',['../classstdex_1_1idrec_1_1record.html#a379d9eeac3c52375982ba75df33604ca',1,'stdex::idrec::record::open()'],['../classstdex_1_1stream_1_1file.html#a70b9101a911ed513fb0097d3bec5023a',1,'stdex::stream::file::open()'],['../classstdex_1_1stream_1_1cached__file.html#ac2a52fed78cb08987e63210b4f34fd1b',1,'stdex::stream::cached_file::open()']]], + ['operator_20bool_2',['operator bool',['../structstdex_1_1interval.html#a15945d1ba829410c61466d95922000d0',1,'stdex::interval::operator bool()'],['../classstdex_1_1sys__object.html#a529b0f9294ed46591389ca3dd9c540f3',1,'stdex::sys_object::operator bool()']]], + ['operator_21_3d_3',['operator!=',['../structstdex_1_1interval.html#aa5e6ff5a63e3cd9f8e36a32663ebfda8',1,'stdex::interval::operator!=()'],['../structstdex_1_1mapping.html#a99e44b5840a155e5ce366d440cbe234b',1,'stdex::mapping::operator!=()']]], + ['operator_3d_4',['operator=',['../classstdex_1_1idrec_1_1record.html#a3d4bff1bf080fb8cb3960b5b5018392c',1,'stdex::idrec::record::operator=()'],['../classstdex_1_1vector__queue.html#a00e42f0b6c31aa16e47a1093e90fd1aa',1,'stdex::vector_queue::operator=(const vector_queue< value_type > &other)'],['../classstdex_1_1vector__queue.html#a840d69192e880fcce588c6368a7d1bab',1,'stdex::vector_queue::operator=(vector_queue< value_type > &&other)']]], + ['operator_3d_3d_5',['operator==',['../structstdex_1_1interval.html#abec7b896ea0d650fc086955b0cba00a9',1,'stdex::interval::operator==()'],['../structstdex_1_1mapping.html#a6d9fa746849e2ea27f53e40b8b44fb46',1,'stdex::mapping::operator==()']]], + ['operator_5b_5d_6',['operator[]',['../classstdex_1_1vector__queue.html#a21497b5396ef80a2d641f8ee767a3b17',1,'stdex::vector_queue::operator[](size_type pos)'],['../classstdex_1_1vector__queue.html#ace07c52caf736c3285909d64b22a2c4c',1,'stdex::vector_queue::operator[](size_type pos) const']]] ]; diff --git a/search/functions_d.js b/search/functions_d.js index b31cc917a..3cf8211a7 100644 --- a/search/functions_d.js +++ b/search/functions_d.js @@ -1,8 +1,9 @@ var searchData= [ - ['pop_5fback_0',['pop_back',['../classstdex_1_1vector__queue.html#abd0fdb316392da76bac13bdd9d176eb6',1,'stdex::vector_queue']]], - ['pop_5ffront_1',['pop_front',['../classstdex_1_1vector__queue.html#adc05fb6cec951f736337dc340996271f',1,'stdex::vector_queue']]], - ['printf_2',['printf',['../classstdex_1_1basic__ostreamfmt.html#add8b8c13cfef4492c5b5b5d68e860ce8',1,'stdex::basic_ostreamfmt']]], - ['push_5fback_3',['push_back',['../classstdex_1_1vector__queue.html#ab063bf18b16eed7f4d67e0720bcb8f4f',1,'stdex::vector_queue::push_back(const value_type &v)'],['../classstdex_1_1vector__queue.html#a5b39a88669c8b7e21f1ada2aa8993b2e',1,'stdex::vector_queue::push_back(value_type &&v)']]], - ['push_5ffront_4',['push_front',['../classstdex_1_1vector__queue.html#adfc0d837fa11c1203e9c96a1a5c081b9',1,'stdex::vector_queue::push_front(const value_type &v)'],['../classstdex_1_1vector__queue.html#af307e59213be692f7918c3c541923373',1,'stdex::vector_queue::push_front(value_type &&v)']]] + ['pop_0',['pop',['../classstdex_1_1ring.html#a6360d8186fa2bda1ef4b4ddbcae93749',1,'stdex::ring']]], + ['pop_5fback_1',['pop_back',['../classstdex_1_1vector__queue.html#abd0fdb316392da76bac13bdd9d176eb6',1,'stdex::vector_queue']]], + ['pop_5ffront_2',['pop_front',['../classstdex_1_1vector__queue.html#adc05fb6cec951f736337dc340996271f',1,'stdex::vector_queue']]], + ['push_3',['push',['../classstdex_1_1ring.html#ab8b671ab4a84c370bdf8d4d2df7c0d9d',1,'stdex::ring']]], + ['push_5fback_4',['push_back',['../classstdex_1_1stream_1_1replicator.html#a26a983c6d340261ef1c55af0e9916701',1,'stdex::stream::replicator::push_back()'],['../classstdex_1_1vector__queue.html#ab063bf18b16eed7f4d67e0720bcb8f4f',1,'stdex::vector_queue::push_back(const value_type &v)'],['../classstdex_1_1vector__queue.html#a5b39a88669c8b7e21f1ada2aa8993b2e',1,'stdex::vector_queue::push_back(value_type &&v)']]], + ['push_5ffront_5',['push_front',['../classstdex_1_1vector__queue.html#adfc0d837fa11c1203e9c96a1a5c081b9',1,'stdex::vector_queue::push_front(const value_type &v)'],['../classstdex_1_1vector__queue.html#af307e59213be692f7918c3c541923373',1,'stdex::vector_queue::push_front(value_type &&v)']]] ]; diff --git a/search/functions_e.js b/search/functions_e.js index 3ad5e54d0..7779c2e86 100644 --- a/search/functions_e.js +++ b/search/functions_e.js @@ -1,4 +1,4 @@ var searchData= [ - ['record_0',['record',['../classstdex_1_1idrec_1_1record.html#a611da3801d9e7215324c9a5992a27f39',1,'stdex::idrec::record::record(T &d)'],['../classstdex_1_1idrec_1_1record.html#ab84a09093bd1a2cbf720329b84c6d73b',1,'stdex::idrec::record::record(const T &d)']]] + ['quit_0',['quit',['../classstdex_1_1ring.html#a385d1648c6fb8e61154e518f954a0a0e',1,'stdex::ring']]] ]; diff --git a/search/functions_f.js b/search/functions_f.js index ab45b281c..346ec6edd 100644 --- a/search/functions_f.js +++ b/search/functions_f.js @@ -1,11 +1,15 @@ var searchData= [ - ['save_0',['save',['../classstdex_1_1basic__stringstream.html#a437a7ba5d9b18508e541e061f37188e3',1,'stdex::basic_stringstream']]], - ['set_1',['set',['../classstdex_1_1progress.html#acf3a29daf22709bf7e94e864c8be95a1',1,'stdex::progress::set()'],['../classstdex_1_1lazy__progress.html#a4e3e7a80da8cce7ccec69c78fcaaabae',1,'stdex::lazy_progress::set()'],['../classstdex_1_1global__progress.html#a76e66104444c77b89b687b4ad4945e8e',1,'stdex::global_progress::set(T value)']]], - ['set_5fglobal_5frange_2',['set_global_range',['../classstdex_1_1global__progress.html#ac68b491c62861fae1b16abb3477cb9c1',1,'stdex::global_progress']]], - ['set_5frange_3',['set_range',['../classstdex_1_1progress.html#afbb1513bdb20340ebb21bd988f4e424a',1,'stdex::progress::set_range()'],['../classstdex_1_1lazy__progress.html#ada3a0d4f0086823558115a8064ffffb6',1,'stdex::lazy_progress::set_range()'],['../classstdex_1_1global__progress.html#afb204b820637c19b494976af4a284704',1,'stdex::global_progress::set_range(T start, T end)']]], - ['set_5fsection_5frange_4',['set_section_range',['../classstdex_1_1global__progress.html#a242009bce7ac595975bbfd703ec58c3b',1,'stdex::global_progress']]], - ['set_5ftext_5',['set_text',['../classstdex_1_1progress.html#a2cab8b5ac137d16fced31ee205264b01',1,'stdex::progress::set_text()'],['../classstdex_1_1global__progress.html#a89b7116003ab3b6344d90f130c14933e',1,'stdex::global_progress::set_text()']]], - ['show_6',['show',['../classstdex_1_1progress.html#ab6e57aed9e7a18a501e8a63cef199d8e',1,'stdex::progress::show()'],['../classstdex_1_1global__progress.html#a32350e02d5904867402187e81a3c4a26',1,'stdex::global_progress::show()']]], - ['size_7',['size',['../structstdex_1_1interval.html#a8c5222bc73fc66ba78bfabc1b985c864',1,'stdex::interval::size()'],['../classstdex_1_1vector__queue.html#ad704df8c3664a6d3f3e0977d87162114',1,'stdex::vector_queue::size()']]] + ['read_0',['read',['../classstdex_1_1stream_1_1converter.html#abdca66af4847c6f8b6d87a0909fc061f',1,'stdex::stream::converter::read()'],['../classstdex_1_1stream_1_1async__reader.html#a841c1e3cb01cb96df94701465086a529',1,'stdex::stream::async_reader::read()'],['../classstdex_1_1stream_1_1buffer.html#a2ef05f2df784dce1d1c4319a98cd22e0',1,'stdex::stream::buffer::read()'],['../classstdex_1_1stream_1_1limiter.html#a80b68f1b4a8fb8c72c09b1313e9d02ed',1,'stdex::stream::limiter::read()'],['../classstdex_1_1stream_1_1window.html#a45f2420dfc94c07e101186ae2e541e13',1,'stdex::stream::window::read()'],['../classstdex_1_1stream_1_1file__window.html#a9cdfe9f40ccb1f84e121b1b949a21246',1,'stdex::stream::file_window::read()'],['../classstdex_1_1stream_1_1cache.html#a43dd464dd032888de79f5cd606adffa9',1,'stdex::stream::cache::read()'],['../classstdex_1_1stream_1_1basic__sys.html#ad5daf3c776b615dcfbb0b0891afdb9d0',1,'stdex::stream::basic_sys::read()'],['../classstdex_1_1stream_1_1memory__file.html#a62a05e7dfb1f374dff881f922543e601',1,'stdex::stream::memory_file::read()'],['../classstdex_1_1stream_1_1fifo.html#a84357513740c64a8317370b289c34e40',1,'stdex::stream::fifo::read()'],['../classstdex_1_1stream_1_1diag__file.html#ac1eaf4a0cfce7e4426cff5f32fc33e6e',1,'stdex::stream::diag_file::read()'],['../classstdex_1_1stream_1_1basic.html#aa5d4693fd583cd7ef0ffa9b846136a5a',1,'stdex::stream::basic::read(_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)']]], + ['read_5farray_1',['read_array',['../classstdex_1_1stream_1_1basic.html#a7723ae23bc35c2ffb74380eab5b0a9ba',1,'stdex::stream::basic']]], + ['read_5fbyte_2',['read_byte',['../classstdex_1_1stream_1_1basic.html#a600e123c10d6f0604d58ae0e9be95f0b',1,'stdex::stream::basic']]], + ['read_5fcharset_3',['read_charset',['../classstdex_1_1stream_1_1basic__file.html#a688cd1e67a5802cdb5c37a7e9691f7e3',1,'stdex::stream::basic_file']]], + ['read_5fdata_4',['read_data',['../classstdex_1_1stream_1_1basic.html#afd5a1268365027ed8c5108183dc498df',1,'stdex::stream::basic::read_data()'],['../classstdex_1_1stream_1_1memory__file.html#a4aa784758856b70a2b6f2b7ca0ffa72b',1,'stdex::stream::memory_file::read_data()']]], + ['read_5fremainder_5',['read_remainder',['../classstdex_1_1stream_1_1basic.html#a6148810b1d873b9f5a3496b06b1aa90b',1,'stdex::stream::basic::read_remainder()'],['../classstdex_1_1stream_1_1basic__file.html#a72aa16169eea2156e83053ba9bd91cd8',1,'stdex::stream::basic_file::read_remainder()']]], + ['read_5fstr_6',['read_str',['../classstdex_1_1stream_1_1basic.html#a2fece103fa6ca15dfe093fe90ceae65e',1,'stdex::stream::basic::read_str()'],['../classstdex_1_1stream_1_1memory__file.html#a7a8abbdd7f86e10ffb711621015645f6',1,'stdex::stream::memory_file::read_str()']]], + ['readln_7',['readln',['../classstdex_1_1stream_1_1basic.html#a674d87b6ac5ca7b50cb0498a7ffcefcb',1,'stdex::stream::basic::readln(std::basic_string< char, _Traits, _Ax > &str)'],['../classstdex_1_1stream_1_1basic.html#aa8ab653a03de90f7e60242915c3b5378',1,'stdex::stream::basic::readln(std::basic_string< wchar_t, _Traits, _Ax > &wstr)'],['../classstdex_1_1stream_1_1basic.html#ab93d06a993faf3b5f5026c0f5da326a1',1,'stdex::stream::basic::readln(std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)']]], + ['readln_5fand_5fattach_8',['readln_and_attach',['../classstdex_1_1stream_1_1basic.html#a6e67bf06f20bc1743cd75622c4b83892',1,'stdex::stream::basic::readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)'],['../classstdex_1_1stream_1_1basic.html#a6386d7eb1316122d6403bcb83b7edfc9',1,'stdex::stream::basic::readln_and_attach(std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)']]], + ['record_9',['record',['../classstdex_1_1idrec_1_1record.html#a611da3801d9e7215324c9a5992a27f39',1,'stdex::idrec::record::record(T &d)'],['../classstdex_1_1idrec_1_1record.html#ab84a09093bd1a2cbf720329b84c6d73b',1,'stdex::idrec::record::record(const T &d)']]], + ['remove_10',['remove',['../classstdex_1_1stream_1_1replicator.html#a7916a391dfa9484df02b1202c0a03edf',1,'stdex::stream::replicator']]], + ['reserve_11',['reserve',['../classstdex_1_1stream_1_1memory__file.html#a6b59e4dd13195dd91211ece4c680cb9b',1,'stdex::stream::memory_file']]] ]; diff --git a/search/searchdata.js b/search/searchdata.js index 7e504ce38..df6d0a897 100644 --- a/search/searchdata.js +++ b/search/searchdata.js @@ -1,9 +1,9 @@ var indexSectionsWithContent = { - 0: "abcdefghilmnoprstuv~", - 1: "abeghilmnprsuv", - 2: "abcdefghilmnoprstuv~", - 3: "abcdefhimnpstv", + 0: "abcdefghilmnopqrstuvw~", + 1: "abcdefghilmnprsuvw", + 2: "abcdefghilmnopqrstuvw~", + 3: "abcdefhilmnoprstvw", 4: "cprsv" }; diff --git a/search/variables_10.js b/search/variables_10.js new file mode 100644 index 000000000..8b18e2efd --- /dev/null +++ b/search/variables_10.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['value_0',['value',['../classstdex_1_1parser_1_1basic__integer.html#ac42a57e08e8189c89817bfde6e507c95',1,'stdex::parser::basic_integer::value'],['../classstdex_1_1parser_1_1basic__scientific__numeral.html#a9aa6f1cbde1efccf75fd0df385f03477',1,'stdex::parser::basic_scientific_numeral::value'],['../classstdex_1_1parser_1_1basic__ipv4__address.html#ad50e8e52cf16226e57fa25e48bf17deb',1,'stdex::parser::basic_ipv4_address::value'],['../classstdex_1_1parser_1_1basic__ipv6__address.html#aee9fca8501ba3cd5e5c875ecdb419376',1,'stdex::parser::basic_ipv6_address::value'],['../classstdex_1_1parser_1_1basic__phone__number.html#aa0650f9f19dfe2d50bcdd79884dd6475',1,'stdex::parser::basic_phone_number::value'],['../classstdex_1_1parser_1_1http__parameter.html#a616b1cd7f872c3ff453c8d854a7db638',1,'stdex::parser::http_parameter::value'],['../classstdex_1_1parser_1_1http__weight.html#ac889015ae4b2640eaf067b343f7c05ff',1,'stdex::parser::http_weight::value'],['../classstdex_1_1parser_1_1http__cookie.html#add653aef947c19d25730adc728089a9f',1,'stdex::parser::http_cookie::value']]], + ['version_1',['version',['../classstdex_1_1parser_1_1http__protocol.html#a49afaa7910baf6092f5042eca86824c7',1,'stdex::parser::http_protocol']]] +]; diff --git a/search/variables_11.js b/search/variables_11.js new file mode 100644 index 000000000..0539a4ca9 --- /dev/null +++ b/search/variables_11.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['write_5flimit_0',['write_limit',['../classstdex_1_1stream_1_1limiter.html#af3d8db598efea694c0274b5420787873',1,'stdex::stream::limiter']]], + ['write_5foffset_1',['write_offset',['../classstdex_1_1stream_1_1window.html#a01d191d653be7a6d218c7feffa1b0ec3',1,'stdex::stream::window']]] +]; diff --git a/search/variables_3.js b/search/variables_3.js index 707f75d13..615425f78 100644 --- a/search/variables_3.js +++ b/search/variables_3.js @@ -1,6 +1,6 @@ var searchData= [ - ['data_0',['data',['../classstdex_1_1idrec_1_1record.html#a1ab09fae53142836c958a63137fb37cb',1,'stdex::idrec::record']]], + ['data_0',['data',['../classstdex_1_1idrec_1_1record.html#a1ab09fae53142836c958a63137fb37cb',1,'stdex::idrec::record::data'],['../classstdex_1_1stream_1_1replicator_1_1worker.html#af37e1df8c6e0189e856a2bb38dd603bf',1,'stdex::stream::replicator::worker::data']]], ['decimal_1',['decimal',['../classstdex_1_1parser_1_1basic__scientific__numeral.html#ab002d811ce7c7590863492bbc4ac355f',1,'stdex::parser::basic_scientific_numeral::decimal'],['../classstdex_1_1parser_1_1basic__monetary__numeral.html#ac1442f0871a1b43db2d4cd45e05803ac',1,'stdex::parser::basic_monetary_numeral::decimal']]], ['decimal_5fseparator_2',['decimal_separator',['../classstdex_1_1parser_1_1basic__scientific__numeral.html#ae09233c93964704acf2bbd762fc14372',1,'stdex::parser::basic_scientific_numeral::decimal_separator'],['../classstdex_1_1parser_1_1basic__monetary__numeral.html#a5393628850b747e190a4e0d50eb97144',1,'stdex::parser::basic_monetary_numeral::decimal_separator']]], ['digit_5fcount_3',['digit_count',['../classstdex_1_1parser_1_1basic__integer10ts.html#a3c400d7c6e0edf695e7cf5e9f43ae388',1,'stdex::parser::basic_integer10ts']]] diff --git a/search/variables_8.js b/search/variables_8.js index bf3f02f67..c26514af2 100644 --- a/search/variables_8.js +++ b/search/variables_8.js @@ -1,14 +1,4 @@ var searchData= [ - ['m_5fallow_5fabsolute_0',['m_allow_absolute',['../classstdex_1_1parser_1_1basic__dns__name.html#abfe3327023b10cb9759c13ec987701ab',1,'stdex::parser::basic_dns_name']]], - ['m_5fcount_1',['m_count',['../classstdex_1_1vector__queue.html#a6070ca156773c17c6b75bacc5251c04c',1,'stdex::vector_queue']]], - ['m_5fdata_2',['m_data',['../classstdex_1_1vector__queue.html#a289d86508a91fbe61e0425e318d735cf',1,'stdex::vector_queue']]], - ['m_5fel_3',['m_el',['../classstdex_1_1parser_1_1basic__iterations.html#a8a06638fea659f03fddc9d41dfc4efac',1,'stdex::parser::basic_iterations']]], - ['m_5fgreedy_4',['m_greedy',['../classstdex_1_1parser_1_1basic__iterations.html#a2523c18948003ca4726eaed098e6de12',1,'stdex::parser::basic_iterations']]], - ['m_5fhead_5',['m_head',['../classstdex_1_1vector__queue.html#abd8208a4a9e92ec5c38d3718f383e41e',1,'stdex::vector_queue']]], - ['m_5fmax_5fiterations_6',['m_max_iterations',['../classstdex_1_1parser_1_1basic__iterations.html#aca0b8e1f9522a5306db5fe173269e8b1',1,'stdex::parser::basic_iterations']]], - ['m_5fmin_5fiterations_7',['m_min_iterations',['../classstdex_1_1parser_1_1basic__iterations.html#aab86447331f306ff85c49764a5d0d646',1,'stdex::parser::basic_iterations']]], - ['m_5fnum_8',['m_num',['../classstdex_1_1errno__error.html#a3712510d0659db4ad2ef4082a5980575',1,'stdex::errno_error']]], - ['m_5fsize_5fmax_9',['m_size_max',['../classstdex_1_1vector__queue.html#a7192dc2991d690b04a2fb24dd6fdc325',1,'stdex::vector_queue']]], - ['mouth_10',['mouth',['../classstdex_1_1parser_1_1basic__emoticon.html#a43d0de6a54546e509807c7c888bb8dc8',1,'stdex::parser::basic_emoticon']]] + ['length_0',['length',['../classstdex_1_1stream_1_1replicator_1_1worker.html#acdf8a4a4f07271bc7bd4f634640e7f5a',1,'stdex::stream::replicator::worker']]] ]; diff --git a/search/variables_9.js b/search/variables_9.js index bc9e462db..5b3a6523d 100644 --- a/search/variables_9.js +++ b/search/variables_9.js @@ -1,9 +1,18 @@ var searchData= [ - ['name_0',['name',['../classstdex_1_1parser_1_1http__parameter.html#a565c731685b779b2c0a90e8c5b7dbd55',1,'stdex::parser::http_parameter::name'],['../classstdex_1_1parser_1_1http__cookie.html#aca58f2d8164c41be287a7fe16432ba48',1,'stdex::parser::http_cookie::name']]], - ['negative_5fexp_5fsign_1',['negative_exp_sign',['../classstdex_1_1parser_1_1basic__scientific__numeral.html#aaeec0779d7bd8f5429108be5b80ba95c',1,'stdex::parser::basic_scientific_numeral']]], - ['negative_5fsign_2',['negative_sign',['../classstdex_1_1parser_1_1basic__signed__numeral.html#a50271856db8a0e66bef91e4e05949bb3',1,'stdex::parser::basic_signed_numeral::negative_sign'],['../classstdex_1_1parser_1_1basic__mixed__numeral.html#a76a2ae3e988b901ae4745a5ba8c22d46',1,'stdex::parser::basic_mixed_numeral::negative_sign'],['../classstdex_1_1parser_1_1basic__scientific__numeral.html#a8e625f598299499379b3f9e067ad9384',1,'stdex::parser::basic_scientific_numeral::negative_sign'],['../classstdex_1_1parser_1_1basic__monetary__numeral.html#aef90350963cc64fb710674eedf260708',1,'stdex::parser::basic_monetary_numeral::negative_sign']]], - ['nose_3',['nose',['../classstdex_1_1parser_1_1basic__emoticon.html#a865f28a87ef1561bca53445e2d1ae253',1,'stdex::parser::basic_emoticon']]], - ['num_4',['num',['../classstdex_1_1base64__enc.html#a58e4759143972065f71ed68f6dbc90d8',1,'stdex::base64_enc::num'],['../classstdex_1_1base64__dec.html#a08acef30d97e7f8213e0c834b93ee849',1,'stdex::base64_dec::num'],['../classstdex_1_1hex__dec.html#a99111436d6b30595cd1fee112e3200ae',1,'stdex::hex_dec::num']]], - ['number_5',['number',['../classstdex_1_1parser_1_1basic__signed__numeral.html#ae43853317fc7ca8b6df2eda5d466a2aa',1,'stdex::parser::basic_signed_numeral']]] + ['m_5fallow_5fabsolute_0',['m_allow_absolute',['../classstdex_1_1parser_1_1basic__dns__name.html#abfe3327023b10cb9759c13ec987701ab',1,'stdex::parser::basic_dns_name']]], + ['m_5fcount_1',['m_count',['../classstdex_1_1vector__queue.html#a6070ca156773c17c6b75bacc5251c04c',1,'stdex::vector_queue']]], + ['m_5fdata_2',['m_data',['../classstdex_1_1stream_1_1memory__file.html#a4a2082f1017478d1ce940d8dcd6e234b',1,'stdex::stream::memory_file::m_data'],['../classstdex_1_1vector__queue.html#a289d86508a91fbe61e0425e318d735cf',1,'stdex::vector_queue::m_data']]], + ['m_5fel_3',['m_el',['../classstdex_1_1parser_1_1basic__iterations.html#a8a06638fea659f03fddc9d41dfc4efac',1,'stdex::parser::basic_iterations']]], + ['m_5fgreedy_4',['m_greedy',['../classstdex_1_1parser_1_1basic__iterations.html#a2523c18948003ca4726eaed098e6de12',1,'stdex::parser::basic_iterations']]], + ['m_5fhead_5',['m_head',['../classstdex_1_1vector__queue.html#abd8208a4a9e92ec5c38d3718f383e41e',1,'stdex::vector_queue']]], + ['m_5fmanage_6',['m_manage',['../classstdex_1_1stream_1_1memory__file.html#aca812d996b5b60660fa121787e4c0e68',1,'stdex::stream::memory_file']]], + ['m_5fmax_5fiterations_7',['m_max_iterations',['../classstdex_1_1parser_1_1basic__iterations.html#aca0b8e1f9522a5306db5fe173269e8b1',1,'stdex::parser::basic_iterations']]], + ['m_5fmin_5fiterations_8',['m_min_iterations',['../classstdex_1_1parser_1_1basic__iterations.html#aab86447331f306ff85c49764a5d0d646',1,'stdex::parser::basic_iterations']]], + ['m_5fnum_9',['m_num',['../classstdex_1_1errno__error.html#a3712510d0659db4ad2ef4082a5980575',1,'stdex::errno_error']]], + ['m_5foffset_10',['m_offset',['../classstdex_1_1stream_1_1cache.html#a1132b6554bec05e4da1d493d18516640',1,'stdex::stream::cache::m_offset'],['../classstdex_1_1stream_1_1memory__file.html#a91ca49273fc49d70b98180fc828d5b5d',1,'stdex::stream::memory_file::m_offset']]], + ['m_5freserved_11',['m_reserved',['../classstdex_1_1stream_1_1memory__file.html#a6aa8c2deeabc66f065c858ba399d911c',1,'stdex::stream::memory_file']]], + ['m_5fsize_12',['m_size',['../classstdex_1_1stream_1_1memory__file.html#a41121ff122745e109c1b9851632abce3',1,'stdex::stream::memory_file']]], + ['m_5fsize_5fmax_13',['m_size_max',['../classstdex_1_1vector__queue.html#a7192dc2991d690b04a2fb24dd6fdc325',1,'stdex::vector_queue']]], + ['mouth_14',['mouth',['../classstdex_1_1parser_1_1basic__emoticon.html#a43d0de6a54546e509807c7c888bb8dc8',1,'stdex::parser::basic_emoticon']]] ]; diff --git a/search/variables_a.js b/search/variables_a.js index a58b60fcf..974aa398b 100644 --- a/search/variables_a.js +++ b/search/variables_a.js @@ -1,6 +1,10 @@ var searchData= [ - ['params_0',['params',['../classstdex_1_1parser_1_1http__cookie.html#aa3d227ae38c1f63b445097ca07091616',1,'stdex::parser::http_cookie']]], - ['positive_5fexp_5fsign_1',['positive_exp_sign',['../classstdex_1_1parser_1_1basic__scientific__numeral.html#abb5d26d24a7bb58d244b7d51722b117a',1,'stdex::parser::basic_scientific_numeral']]], - ['positive_5fsign_2',['positive_sign',['../classstdex_1_1parser_1_1basic__signed__numeral.html#ac7c9dde1f5b3600a21c1b7935c0a5caf',1,'stdex::parser::basic_signed_numeral::positive_sign'],['../classstdex_1_1parser_1_1basic__mixed__numeral.html#aee09625077f56e1139e3a6c26e24e93f',1,'stdex::parser::basic_mixed_numeral::positive_sign'],['../classstdex_1_1parser_1_1basic__scientific__numeral.html#a6e6e08dd8ade04c9aa85fba70e12b7c4',1,'stdex::parser::basic_scientific_numeral::positive_sign'],['../classstdex_1_1parser_1_1basic__monetary__numeral.html#a23fedf450adaace6a027c7788e4a8c61',1,'stdex::parser::basic_monetary_numeral::positive_sign']]] + ['name_0',['name',['../classstdex_1_1parser_1_1http__parameter.html#a565c731685b779b2c0a90e8c5b7dbd55',1,'stdex::parser::http_parameter::name'],['../classstdex_1_1parser_1_1http__cookie.html#aca58f2d8164c41be287a7fe16432ba48',1,'stdex::parser::http_cookie::name']]], + ['negative_5fexp_5fsign_1',['negative_exp_sign',['../classstdex_1_1parser_1_1basic__scientific__numeral.html#aaeec0779d7bd8f5429108be5b80ba95c',1,'stdex::parser::basic_scientific_numeral']]], + ['negative_5fsign_2',['negative_sign',['../classstdex_1_1parser_1_1basic__signed__numeral.html#a50271856db8a0e66bef91e4e05949bb3',1,'stdex::parser::basic_signed_numeral::negative_sign'],['../classstdex_1_1parser_1_1basic__mixed__numeral.html#a76a2ae3e988b901ae4745a5ba8c22d46',1,'stdex::parser::basic_mixed_numeral::negative_sign'],['../classstdex_1_1parser_1_1basic__scientific__numeral.html#a8e625f598299499379b3f9e067ad9384',1,'stdex::parser::basic_scientific_numeral::negative_sign'],['../classstdex_1_1parser_1_1basic__monetary__numeral.html#aef90350963cc64fb710674eedf260708',1,'stdex::parser::basic_monetary_numeral::negative_sign']]], + ['nose_3',['nose',['../classstdex_1_1parser_1_1basic__emoticon.html#a865f28a87ef1561bca53445e2d1ae253',1,'stdex::parser::basic_emoticon']]], + ['num_4',['num',['../classstdex_1_1base64__enc.html#a58e4759143972065f71ed68f6dbc90d8',1,'stdex::base64_enc::num'],['../classstdex_1_1base64__dec.html#a08acef30d97e7f8213e0c834b93ee849',1,'stdex::base64_dec::num'],['../classstdex_1_1hex__dec.html#a99111436d6b30595cd1fee112e3200ae',1,'stdex::hex_dec::num']]], + ['num_5fwritten_5',['num_written',['../classstdex_1_1stream_1_1replicator_1_1worker.html#acd6595e01accdb9d3c8d97f8f19b8cf1',1,'stdex::stream::replicator::worker']]], + ['number_6',['number',['../classstdex_1_1parser_1_1basic__signed__numeral.html#ae43853317fc7ca8b6df2eda5d466a2aa',1,'stdex::parser::basic_signed_numeral']]] ]; diff --git a/search/variables_b.js b/search/variables_b.js index 103b1da1c..8fc37664b 100644 --- a/search/variables_b.js +++ b/search/variables_b.js @@ -1,8 +1,4 @@ var searchData= [ - ['scope_5fid_0',['scope_id',['../classstdex_1_1parser_1_1basic__ipv6__address.html#a67486e83888f48afc62b031f745012c0',1,'stdex::parser::basic_ipv6_address']]], - ['segments_1',['segments',['../classstdex_1_1parser_1_1http__url__path.html#a9a5f4002c55cb4500ce43536512b02b9',1,'stdex::parser::http_url_path']]], - ['special_5fsign_2',['special_sign',['../classstdex_1_1parser_1_1basic__signed__numeral.html#a38b8207e2b384ed5ffb3f2bfb3e8755f',1,'stdex::parser::basic_signed_numeral::special_sign'],['../classstdex_1_1parser_1_1basic__mixed__numeral.html#a46c6721810cc8f90218aee66a4c27132',1,'stdex::parser::basic_mixed_numeral::special_sign'],['../classstdex_1_1parser_1_1basic__scientific__numeral.html#a5ce9abfbcdc1247e8f504ae13492e7ea',1,'stdex::parser::basic_scientific_numeral::special_sign'],['../classstdex_1_1parser_1_1basic__monetary__numeral.html#af0190fa4b0de5e894a14c05550e78365',1,'stdex::parser::basic_monetary_numeral::special_sign']]], - ['start_3',['start',['../structstdex_1_1interval.html#ab6a104de0f15b29bea77fe181b49c40b',1,'stdex::interval']]], - ['string_4',['string',['../classstdex_1_1parser_1_1http__value.html#a808ed411ff6816162a54b99fb7307315',1,'stdex::parser::http_value']]] + ['op_0',['op',['../classstdex_1_1stream_1_1replicator_1_1worker.html#a9ddd37c6da22d559f6deb46102833f31',1,'stdex::stream::replicator::worker']]] ]; diff --git a/search/variables_c.js b/search/variables_c.js index 86dea09c5..a58b60fcf 100644 --- a/search/variables_c.js +++ b/search/variables_c.js @@ -1,4 +1,6 @@ var searchData= [ - ['token_0',['token',['../classstdex_1_1parser_1_1http__value.html#aecdecacd265379c1d6e12a75424c5573',1,'stdex::parser::http_value']]] + ['params_0',['params',['../classstdex_1_1parser_1_1http__cookie.html#aa3d227ae38c1f63b445097ca07091616',1,'stdex::parser::http_cookie']]], + ['positive_5fexp_5fsign_1',['positive_exp_sign',['../classstdex_1_1parser_1_1basic__scientific__numeral.html#abb5d26d24a7bb58d244b7d51722b117a',1,'stdex::parser::basic_scientific_numeral']]], + ['positive_5fsign_2',['positive_sign',['../classstdex_1_1parser_1_1basic__signed__numeral.html#ac7c9dde1f5b3600a21c1b7935c0a5caf',1,'stdex::parser::basic_signed_numeral::positive_sign'],['../classstdex_1_1parser_1_1basic__mixed__numeral.html#aee09625077f56e1139e3a6c26e24e93f',1,'stdex::parser::basic_mixed_numeral::positive_sign'],['../classstdex_1_1parser_1_1basic__scientific__numeral.html#a6e6e08dd8ade04c9aa85fba70e12b7c4',1,'stdex::parser::basic_scientific_numeral::positive_sign'],['../classstdex_1_1parser_1_1basic__monetary__numeral.html#a23fedf450adaace6a027c7788e4a8c61',1,'stdex::parser::basic_monetary_numeral::positive_sign']]] ]; diff --git a/search/variables_d.js b/search/variables_d.js index 8b18e2efd..445f091d6 100644 --- a/search/variables_d.js +++ b/search/variables_d.js @@ -1,5 +1,6 @@ var searchData= [ - ['value_0',['value',['../classstdex_1_1parser_1_1basic__integer.html#ac42a57e08e8189c89817bfde6e507c95',1,'stdex::parser::basic_integer::value'],['../classstdex_1_1parser_1_1basic__scientific__numeral.html#a9aa6f1cbde1efccf75fd0df385f03477',1,'stdex::parser::basic_scientific_numeral::value'],['../classstdex_1_1parser_1_1basic__ipv4__address.html#ad50e8e52cf16226e57fa25e48bf17deb',1,'stdex::parser::basic_ipv4_address::value'],['../classstdex_1_1parser_1_1basic__ipv6__address.html#aee9fca8501ba3cd5e5c875ecdb419376',1,'stdex::parser::basic_ipv6_address::value'],['../classstdex_1_1parser_1_1basic__phone__number.html#aa0650f9f19dfe2d50bcdd79884dd6475',1,'stdex::parser::basic_phone_number::value'],['../classstdex_1_1parser_1_1http__parameter.html#a616b1cd7f872c3ff453c8d854a7db638',1,'stdex::parser::http_parameter::value'],['../classstdex_1_1parser_1_1http__weight.html#ac889015ae4b2640eaf067b343f7c05ff',1,'stdex::parser::http_weight::value'],['../classstdex_1_1parser_1_1http__cookie.html#add653aef947c19d25730adc728089a9f',1,'stdex::parser::http_cookie::value']]], - ['version_1',['version',['../classstdex_1_1parser_1_1http__protocol.html#a49afaa7910baf6092f5042eca86824c7',1,'stdex::parser::http_protocol']]] + ['read_5flimit_0',['read_limit',['../classstdex_1_1stream_1_1limiter.html#a455a9e38efe1e7473e501dd00fb3d7f0',1,'stdex::stream::limiter']]], + ['read_5foffset_1',['read_offset',['../classstdex_1_1stream_1_1window.html#acff67a2931b8f1a85f12806002e7e131',1,'stdex::stream::window']]], + ['region_2',['region',['../structstdex_1_1stream_1_1cache_1_1cache__t.html#ae4bbbd45000cca2b17d32c0d4b3609db',1,'stdex::stream::cache::cache_t']]] ]; diff --git a/search/variables_e.js b/search/variables_e.js new file mode 100644 index 000000000..103b1da1c --- /dev/null +++ b/search/variables_e.js @@ -0,0 +1,8 @@ +var searchData= +[ + ['scope_5fid_0',['scope_id',['../classstdex_1_1parser_1_1basic__ipv6__address.html#a67486e83888f48afc62b031f745012c0',1,'stdex::parser::basic_ipv6_address']]], + ['segments_1',['segments',['../classstdex_1_1parser_1_1http__url__path.html#a9a5f4002c55cb4500ce43536512b02b9',1,'stdex::parser::http_url_path']]], + ['special_5fsign_2',['special_sign',['../classstdex_1_1parser_1_1basic__signed__numeral.html#a38b8207e2b384ed5ffb3f2bfb3e8755f',1,'stdex::parser::basic_signed_numeral::special_sign'],['../classstdex_1_1parser_1_1basic__mixed__numeral.html#a46c6721810cc8f90218aee66a4c27132',1,'stdex::parser::basic_mixed_numeral::special_sign'],['../classstdex_1_1parser_1_1basic__scientific__numeral.html#a5ce9abfbcdc1247e8f504ae13492e7ea',1,'stdex::parser::basic_scientific_numeral::special_sign'],['../classstdex_1_1parser_1_1basic__monetary__numeral.html#af0190fa4b0de5e894a14c05550e78365',1,'stdex::parser::basic_monetary_numeral::special_sign']]], + ['start_3',['start',['../structstdex_1_1interval.html#ab6a104de0f15b29bea77fe181b49c40b',1,'stdex::interval']]], + ['string_4',['string',['../classstdex_1_1parser_1_1http__value.html#a808ed411ff6816162a54b99fb7307315',1,'stdex::parser::http_value']]] +]; diff --git a/search/variables_f.js b/search/variables_f.js new file mode 100644 index 000000000..86dea09c5 --- /dev/null +++ b/search/variables_f.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['token_0',['token',['../classstdex_1_1parser_1_1http__value.html#aecdecacd265379c1d6e12a75424c5573',1,'stdex::parser::http_value']]] +]; diff --git a/sgml_8hpp_source.html b/sgml_8hpp_source.html index 0248fe823..d1fb1fd69 100644 --- a/sgml_8hpp_source.html +++ b/sgml_8hpp_source.html @@ -423,7 +423,7 @@ $(function() { diff --git a/sgml__unicode_8hpp_source.html b/sgml__unicode_8hpp_source.html index 8b417c763..5d4e0b556 100644 --- a/sgml__unicode_8hpp_source.html +++ b/sgml__unicode_8hpp_source.html @@ -3170,7 +3170,7 @@ $(function() { diff --git a/stream_8hpp_source.html b/stream_8hpp_source.html new file mode 100644 index 000000000..4fb6c8d7c --- /dev/null +++ b/stream_8hpp_source.html @@ -0,0 +1,3465 @@ + + + + + + + +stdex: include/stdex/stream.hpp Source File + + + + + + + + + +
    +
    + + + + + + +
    +
    stdex +
    +
    Additional custom or not Standard C++ covered algorithms
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + + +
    +
    +
    stream.hpp
    +
    +
    +
    1/*
    +
    2 SPDX-License-Identifier: MIT
    +
    3 Copyright © 2023 Amebis
    +
    4*/
    +
    5
    +
    6#pragma once
    +
    7
    +
    8#include "endian.hpp"
    +
    9#include "interval.hpp"
    +
    10#include "math.hpp"
    +
    11#include "ring.hpp"
    +
    12#include "sal.hpp"
    +
    13#include "string.hpp"
    +
    14#include "system.hpp"
    +
    15#include "unicode.hpp"
    +
    16#include <assert.h>
    +
    17#include <stdint.h>
    +
    18#include <stdlib.h>
    +
    19#if defined(_WIN32) && !defined(WIN32_LEAN_AND_MEAN)
    +
    20#include <asptlb.h>
    +
    21#endif
    +
    22#include <chrono>
    +
    23#include <condition_variable>
    +
    24#include <list>
    +
    25#include <memory>
    +
    26#include <string>
    +
    27#include <thread>
    +
    28#include <vector>
    +
    29
    +
    30#if !defined(SET_FILE_OP_TIMES) && defined(RDAT_BELEZI_CAS_DOSTOPA_VER)
    +
    31#define SET_FILE_OP_TIMES 1
    +
    32#pragma message("RDAT_BELEZI_CAS_DOSTOPA_VER is deprecated. Use SET_FILE_OP_TIMES instead.")
    +
    33#elif !defined(SET_FILE_OP_TIMES)
    +
    34#define SET_FILE_OP_TIMES 0
    +
    35#endif
    +
    36#if !defined(CHECK_STREAM_STATE) && defined(RDAT_NE_PREVERJAJ_STANJA_VER)
    +
    37#define CHECK_STREAM_STATE 0
    +
    38#pragma message("RDAT_NE_PREVERJAJ_EOF_VER is deprecated. Use CHECK_STREAM_STATE=0 instead.")
    +
    39#else
    +
    40#define CHECK_STREAM_STATE 1
    +
    41#endif
    +
    42
    +
    43namespace stdex
    +
    44{
    +
    45 namespace stream
    +
    46 {
    +
    50 enum class state_t {
    +
    51 ok = 0,
    +
    52 eof,
    +
    53 fail,
    +
    54 };
    +
    55
    +
    59 using fsize_t = uint64_t;
    +
    60 constexpr fsize_t fsize_max = UINT64_MAX;
    +
    61
    +
    62 constexpr size_t iterate_count = 0x10;
    +
    63 constexpr size_t default_block_size = 0x10000;
    +
    64 constexpr wchar_t utf16_bom = L'\ufeff';
    +
    65 constexpr const char utf8_bom[3] = { '\xef', '\xbb', '\xbf' };
    +
    66
    +
    70 class basic
    +
    71 {
    +
    72 public:
    +
    73 basic(_In_ state_t state = state_t::ok) : m_state(state) {}
    +
    74
    +
    86 virtual _Success_(return != 0 || length == 0) size_t read(
    +
    87 _Out_writes_bytes_to_opt_(length, return) void* data, _In_ size_t length)
    +
    88 {
    +
    89 UNREFERENCED_PARAMETER(data);
    +
    90 UNREFERENCED_PARAMETER(length);
    +
    91 m_state = state_t::fail;
    +
    92 return 0;
    +
    93 }
    +
    94
    +
    104 virtual _Success_(return != 0) size_t write(
    +
    105 _In_reads_bytes_opt_(length) const void* data, _In_ size_t length)
    +
    106 {
    +
    107 UNREFERENCED_PARAMETER(data);
    +
    108 UNREFERENCED_PARAMETER(length);
    +
    109 m_state = state_t::fail;
    +
    110 return 0;
    +
    111 }
    +
    112
    +
    116 virtual void flush()
    +
    117 {
    +
    118 m_state = state_t::ok;
    +
    119 }
    +
    120
    +
    124 virtual void close()
    +
    125 {
    +
    126 m_state = state_t::ok;
    +
    127 }
    +
    128
    +
    132 virtual void skip(_In_ fsize_t amount)
    +
    133 {
    +
    134 if (amount == 1)
    +
    135 read_byte();
    +
    136 else if (amount < iterate_count) {
    +
    137 for (size_t i = 0; i < static_cast<size_t>(amount); i++) {
    +
    138 read_byte();
    +
    139 if (!ok()) _Unlikely_
    +
    140 break;
    +
    141 }
    +
    142 }
    +
    143 else {
    +
    144 size_t block = static_cast<size_t>(std::min<fsize_t>(amount, default_block_size));
    +
    145 try {
    +
    146 std::unique_ptr<uint8_t[]> dummy(new uint8_t[block]);
    +
    147 while (amount) {
    +
    148 amount -= read_array(dummy.get(), sizeof(uint8_t), static_cast<size_t>(std::min<fsize_t>(amount, block)));
    +
    149 if (!ok()) _Unlikely_
    +
    150 break;
    +
    151 }
    +
    152 }
    +
    153 catch (std::bad_alloc) { m_state = state_t::fail; }
    +
    154 }
    +
    155 }
    +
    156
    +
    160 inline state_t state() const { return m_state; };
    +
    161
    +
    165 inline bool ok() const { return m_state == state_t::ok; };
    +
    166
    +
    174 virtual std::vector<uint8_t> read_remainder(_In_ size_t max_length = SIZE_MAX)
    +
    175 {
    +
    176 std::vector<uint8_t> result;
    +
    177 size_t offset, length;
    +
    178 offset = 0;
    +
    179 length = default_block_size;
    +
    180 while (offset < max_length) {
    +
    181 length = std::min(length, max_length);
    +
    182 try { result.resize(length); }
    +
    183 catch (std::bad_alloc) {
    +
    184 m_state = state_t::fail;
    +
    185 return result;
    +
    186 }
    +
    187 auto num_read = read_array(result.data() + offset, sizeof(uint8_t), length - offset);
    +
    188 offset += num_read;
    +
    189 if (!ok()) _Unlikely_
    +
    190 break;
    +
    191 length += default_block_size;
    +
    192 }
    +
    193 result.resize(offset);
    +
    194 return result;
    +
    195 }
    +
    196
    +
    200 inline uint8_t read_byte()
    +
    201 {
    +
    202 uint8_t byte;
    +
    203 if (read_array(&byte, sizeof(byte), 1) == 1)
    +
    204 return byte;
    +
    205 throw std::runtime_error("failed to read");
    +
    206 }
    +
    207
    +
    211 void write_byte(_In_ uint8_t byte, _In_ fsize_t amount = 1)
    +
    212 {
    +
    213 if (amount == 1)
    +
    214 write(&byte, sizeof(uint8_t));
    +
    215 else if (amount < iterate_count) {
    +
    216 for (size_t i = 0; i < static_cast<size_t>(amount); i++) {
    +
    217 write(&byte, sizeof(uint8_t));
    +
    218 if (!ok()) _Unlikely_
    +
    219 break;
    +
    220 }
    +
    221 }
    +
    222 else {
    +
    223 size_t block = static_cast<size_t>(std::min<fsize_t>(amount, default_block_size));
    +
    224 try {
    +
    225 std::unique_ptr<uint8_t[]> dummy(new uint8_t[block]);
    +
    226 memset(dummy.get(), byte, block);
    +
    227 while (amount) {
    +
    228 amount -= write_array(dummy.get(), sizeof(uint8_t), static_cast<size_t>(std::min<fsize_t>(amount, block)));
    +
    229 if (!ok()) _Unlikely_
    +
    230 break;
    +
    231 }
    +
    232 }
    +
    233 catch (std::bad_alloc) { m_state = state_t::fail; }
    +
    234 }
    +
    235 }
    +
    236
    +
    248 template <class T>
    +
    249 inline basic& read_data(_Out_ T& data)
    +
    250 {
    +
    251 if (!ok()) _Unlikely_ {
    +
    252 data = 0;
    +
    253 return *this;
    +
    254 }
    +
    255 if (read_array(&data, sizeof(T), 1) == 1)
    +
    256 LE2HE(&data);
    +
    257 else {
    +
    258 data = 0;
    +
    259 if (ok())
    +
    260 m_state = state_t::eof;
    +
    261 }
    +
    262 return *this;
    +
    263 }
    +
    264
    +
    276 template <class T>
    +
    277 inline basic& write_data(_In_ const T data)
    +
    278 {
    +
    279 if (!ok()) _Unlikely_
    +
    280 return *this;
    +
    281#ifdef BIG_ENDIAN
    +
    282 T data_le = HE2LE(data);
    +
    283 write(&data_le, sizeof(T));
    +
    284#else
    +
    285 write(&data, sizeof(T));
    +
    286#endif
    +
    287 return *this;
    +
    288 }
    +
    289
    +
    295 template<class _Traits = std::char_traits<char>, class _Ax = std::allocator<char>>
    +
    296 inline size_t readln(_Inout_ std::basic_string<char, _Traits, _Ax>& str)
    +
    297 {
    +
    298 str.clear();
    +
    299 return readln_and_attach(str);
    +
    300 }
    +
    301
    +
    307 template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
    +
    308 inline size_t readln(_Inout_ std::basic_string<wchar_t, _Traits, _Ax>& wstr)
    +
    309 {
    +
    310 wstr.clear();
    +
    311 return readln_and_attach(wstr);
    +
    312 }
    +
    313
    +
    319 template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
    +
    320 size_t readln(_Inout_ std::basic_string<wchar_t, _Traits, _Ax>& wstr, _In_ charset_id charset)
    +
    321 {
    +
    322 if (charset == charset_id::utf16)
    +
    323 return readln(wstr);
    +
    324 std::string str;
    + +
    326 wstr.clear();
    +
    327 str2wstr(wstr, str, charset);
    +
    328 return wstr.size();
    +
    329 }
    +
    330
    +
    336 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
    +
    337 size_t readln_and_attach(_Inout_ std::basic_string<_Elem, _Traits, _Ax>& str)
    +
    338 {
    +
    339 bool initial = true;
    +
    340 _Elem chr, previous = (_Elem)0;
    +
    341 do {
    +
    342 read_array(&chr, sizeof(_Elem), 1);
    +
    343 if (!initial && !(previous == static_cast<_Elem>('\r') && chr == static_cast<_Elem>('\n')))
    +
    344 str += previous;
    +
    345 else
    +
    346 initial = false;
    +
    347 previous = chr;
    +
    348 } while (ok() && chr != static_cast<_Elem>('\n'));
    +
    349 return str.size();
    +
    350 }
    +
    351
    +
    357 template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
    +
    358 size_t readln_and_attach(_Inout_ std::basic_string<wchar_t, _Traits, _Ax>& wstr, _In_ charset_id charset)
    +
    359 {
    +
    360 if (charset == charset_id::utf16)
    +
    361 return readln_and_attach(wstr);
    +
    362 std::string str;
    + +
    364 str2wstr(wstr, str, charset);
    +
    365 return wstr.size();
    +
    366 }
    +
    367
    +
    373 size_t read_array(_Out_writes_bytes_(size* count) void* array, _In_ size_t size, _In_ size_t count)
    +
    374 {
    +
    375 for (size_t to_read = mul(size, count);;) {
    +
    376 size_t num_read = read(array, to_read);
    +
    377 to_read -= num_read;
    +
    378 if (!to_read)
    +
    379 return count;
    +
    380 if (!ok()) _Unlikely_
    +
    381 return count - to_read / size;
    +
    382 reinterpret_cast<uint8_t*&>(array) += num_read;
    +
    383 }
    +
    384 }
    +
    385
    +
    391 inline size_t write_array(_In_reads_bytes_opt_(size* count) const void* array, _In_ size_t size, _In_ size_t count)
    +
    392 {
    +
    393 return write(array, mul(size, count)) / size;
    +
    394 }
    +
    395
    +
    405 size_t write_array(_In_reads_or_z_opt_(num_chars) const wchar_t* wstr, _In_ size_t num_chars, _In_ charset_id charset)
    +
    406 {
    +
    407 if (!ok()) _Unlikely_
    +
    408 return 0;
    +
    409 num_chars = stdex::strnlen(wstr, num_chars);
    +
    410 if (charset != charset_id::utf16) {
    +
    411 std::string str(wstr2str(wstr, num_chars, charset));
    +
    412 return write_array(str.data(), sizeof(char), str.size());
    +
    413 }
    +
    414 return write_array(wstr, sizeof(wchar_t), num_chars);
    +
    415 }
    +
    416
    +
    428 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
    +
    429 inline basic& read_str(_Inout_ std::basic_string<_Elem, _Traits, _Ax>& data)
    +
    430 {
    +
    431 uint32_t num_chars;
    +
    432 read_data(num_chars);
    +
    433 if (!ok()) _Unlikely_ {
    +
    434 data.clear();
    +
    435 return *this;
    +
    436 }
    +
    437 data.resize(num_chars);
    +
    438 data.resize(read_array(data.data(), sizeof(_Elem), num_chars));
    +
    439 return *this;
    +
    440 }
    +
    441
    +
    453 template <class T>
    +
    454 inline basic& write_str(_In_z_ const T* data)
    +
    455 {
    +
    456 // Stream state will be checked in write_data.
    +
    457 size_t num_chars = stdex::strlen(data);
    +
    458 if (num_chars > UINT32_MAX)
    +
    459 throw std::invalid_argument("string too long");
    +
    460 write_data((uint32_t)num_chars);
    +
    461 if (!ok()) _Unlikely_
    +
    462 return *this;
    +
    463 write_array(data, sizeof(T), num_chars);
    +
    464 return *this;
    +
    465 }
    +
    466
    +
    467#ifdef _WIN32
    +
    473 size_t write_sa(_In_ LPSAFEARRAY sa)
    +
    474 {
    +
    475 safearray_accessor<void> a(sa);
    +
    476 long ubound, lbound;
    +
    477 if (FAILED(SafeArrayGetUBound(sa, 1, &ubound)) ||
    +
    478 FAILED(SafeArrayGetLBound(sa, 1, &lbound)))
    +
    479 throw std::invalid_argument("SafeArrayGet[UL]Bound failed");
    +
    480 return write(a.data(), static_cast<size_t>(ubound) - lbound + 1);
    +
    481 }
    +
    482#endif
    +
    483
    +
    489 fsize_t write_stream(_Inout_ basic& stream, _In_ fsize_t amount = fsize_max)
    +
    490 {
    +
    491 std::unique_ptr<uint8_t[]> data(new uint8_t[static_cast<size_t>(std::min<fsize_t>(amount, default_block_size))]);
    +
    492 fsize_t num_copied = 0, to_write = amount;
    +
    493 m_state = state_t::ok;
    +
    494 while (to_write) {
    +
    495 size_t num_read = stream.read(data.get(), static_cast<size_t>(std::min<fsize_t>(default_block_size, to_write)));
    +
    496 size_t num_written = write(data.get(), num_read);
    +
    497 num_copied += num_written;
    +
    498 to_write -= num_written;
    +
    499 if (stream.m_state == state_t::eof) {
    +
    500 // EOF is not an error.
    +
    501 m_state = state_t::ok;
    +
    502 break;
    +
    503 }
    +
    504 m_state = stream.m_state;
    +
    505 if (!ok())
    +
    506 break;
    +
    507 }
    +
    508 return num_copied;
    +
    509 }
    +
    510
    +
    514 void write_charset(_In_ charset_id charset)
    +
    515 {
    +
    516 if (charset == charset_id::utf16)
    +
    517 write_data(utf16_bom);
    +
    518 else if (charset == charset_id::utf8)
    +
    519 write_array(utf8_bom, sizeof(utf8_bom), 1);
    +
    520 }
    +
    521
    +
    527 size_t write_sprintf(_In_z_ _Printf_format_string_params_(2) const char* format, _In_opt_ locale_t locale, ...)
    +
    528 {
    +
    529 va_list params;
    +
    530 va_start(params, locale);
    +
    531 size_t num_chars = write_vsprintf(format, locale, params);
    +
    532 va_end(params);
    +
    533 return num_chars;
    +
    534 }
    +
    535
    +
    541 size_t write_sprintf(_In_z_ _Printf_format_string_params_(2) const wchar_t* format, _In_opt_ locale_t locale, ...)
    +
    542 {
    +
    543 va_list params;
    +
    544 va_start(params, locale);
    +
    545 size_t num_chars = write_vsprintf(format, locale, params);
    +
    546 va_end(params);
    +
    547 return num_chars;
    +
    548 }
    +
    549
    +
    555 size_t write_vsprintf(_In_z_ _Printf_format_string_params_(2) const char* format, _In_opt_ locale_t locale, _In_ va_list params)
    +
    556 {
    +
    557 std::string str;
    +
    558 str.reserve(default_block_size);
    +
    559 vappendf(str, format, locale, params);
    +
    560 return write_array(str.data(), sizeof(char), str.size());
    +
    561 }
    +
    562
    +
    568 size_t write_vsprintf(_In_z_ _Printf_format_string_params_(2) const wchar_t* format, _In_opt_ locale_t locale, _In_ va_list params)
    +
    569 {
    +
    570 std::wstring str;
    +
    571 str.reserve(default_block_size);
    +
    572 vappendf(str, format, locale, params);
    +
    573 return write_array(str.data(), sizeof(wchar_t), str.size());
    +
    574 }
    +
    575
    +
    576 inline basic& operator >>(_Out_ int8_t& data) { return read_data(data); }
    +
    577 inline basic& operator <<(_In_ const int8_t data) { return write_data(data); }
    +
    578 inline basic& operator >>(_Out_ int16_t& data) { return read_data(data); }
    +
    579 inline basic& operator <<(_In_ const int16_t data) { return write_data(data); }
    +
    580 inline basic& operator >>(_Out_ int32_t& data) { return read_data(data); }
    +
    581 inline basic& operator <<(_In_ const int32_t data) { return write_data(data); }
    +
    582 inline basic& operator >>(_Out_ int64_t& data) { return read_data(data); }
    +
    583 inline basic& operator <<(_In_ const int64_t data) { return write_data(data); }
    +
    584 inline basic& operator >>(_Out_ uint8_t& data) { return read_data(data); }
    +
    585 inline basic& operator <<(_In_ const uint8_t data) { return write_data(data); }
    +
    586 inline basic& operator >>(_Out_ uint16_t& data) { return read_data(data); }
    +
    587 inline basic& operator <<(_In_ const uint16_t data) { return write_data(data); }
    +
    588 inline basic& operator >>(_Out_ uint32_t& data) { return read_data(data); }
    +
    589 inline basic& operator <<(_In_ const uint32_t data) { return write_data(data); }
    +
    590 inline basic& operator >>(_Out_ uint64_t& data) { return read_data(data); }
    +
    591 inline basic& operator <<(_In_ const uint64_t data) { return write_data(data); }
    +
    592#ifdef _NATIVE_SIZE_T_DEFINED
    +
    593 inline basic& operator >>(_Out_ size_t& data) { return read_data(data); }
    +
    594 inline basic& operator <<(_In_ const size_t data) { return write_data(data); }
    +
    595#endif
    +
    596 inline basic& operator >>(_Out_ float& data) { return read_data(data); }
    +
    597 inline basic& operator <<(_In_ const float data) { return write_data(data); }
    +
    598 inline basic& operator >>(_Out_ double& data) { return read_data(data); }
    +
    599 inline basic& operator <<(_In_ const double data) { return write_data(data); }
    +
    600 inline basic& operator >>(_Out_ char& data) { return read_data(data); }
    +
    601 inline basic& operator <<(_In_ const char data) { return write_data(data); }
    +
    602#ifdef _NATIVE_WCHAR_T_DEFINED
    +
    603 inline basic& operator >>(_Out_ wchar_t& data) { return read_data(data); }
    +
    604 inline basic& operator <<(_In_ const wchar_t data) { return write_data(data); }
    +
    605#endif
    +
    606 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
    +
    607 inline basic& operator >>(_Inout_ std::basic_string<_Elem, _Traits, _Ax>& data) { return read_str(data); }
    +
    608 template <class T>
    +
    609 inline basic& operator <<(_In_ const T* data) { return write_str(data); }
    +
    610
    +
    611 protected:
    +
    612 state_t m_state;
    +
    613 };
    +
    614
    +
    618 using fpos_t = uint64_t;
    +
    619 constexpr fpos_t fpos_max = UINT64_MAX;
    +
    620 constexpr fpos_t fpos_min = 0;
    +
    621
    +
    625 using foff_t = int64_t;
    +
    626 constexpr foff_t foff_max = INT64_MAX;
    +
    627 constexpr foff_t foff_min = INT64_MIN;
    +
    628
    +
    632 enum class seek_t {
    +
    633#ifdef _WIN32
    +
    634 beg = FILE_BEGIN,
    +
    635 cur = FILE_CURRENT,
    +
    636 end = FILE_END
    +
    637#else
    +
    638 beg = SEEK_SET,
    +
    639 cur = SEEK_CUR,
    +
    640 end = SEEK_END
    +
    641#endif
    +
    642 };
    +
    643
    +
    644#if _HAS_CXX20
    +
    645 using time_point = std::chrono::time_point<std::chrono::file_clock>;
    +
    646#else
    +
    647 using time_point = std::chrono::time_point<std::chrono::system_clock>;
    +
    648#endif
    +
    649
    +
    653 class basic_file : virtual public basic
    +
    654 {
    +
    655 public:
    +
    656 virtual std::vector<uint8_t> read_remainder(_In_ size_t max_length = SIZE_MAX)
    +
    657 {
    +
    658 size_t length = std::min<size_t>(max_length, static_cast<size_t>(size() - tell()));
    +
    659 std::vector<uint8_t> result;
    +
    660 try { result.resize(length); }
    +
    661 catch (std::bad_alloc) {
    +
    662 m_state = state_t::fail;
    +
    663 return result;
    +
    664 }
    +
    665 result.resize(read_array(result.data(), sizeof(uint8_t), length));
    +
    666 return result;
    +
    667 }
    +
    668
    +
    674 virtual fpos_t seek(_In_ foff_t offset, _In_ seek_t how = seek_t::beg) = 0;
    +
    675
    +
    681 inline fpos_t seekbeg(_In_ fpos_t offset) { return seek(offset, seek_t::beg); }
    +
    682
    +
    688 inline fpos_t seekcur(_In_ foff_t offset) { return seek(offset, seek_t::cur); }
    +
    689
    +
    695 inline fpos_t seekend(_In_ foff_t offset) { return seek(offset, seek_t::end); }
    +
    696
    +
    697 virtual void skip(_In_ fsize_t amount)
    +
    698 {
    +
    699 seek(amount, seek_t::cur);
    +
    700 }
    +
    701
    +
    708 virtual fpos_t tell() const = 0;
    +
    709
    +
    713 virtual void lock(_In_ fpos_t offset, _In_ fsize_t length)
    +
    714 {
    +
    715 UNREFERENCED_PARAMETER(offset);
    +
    716 UNREFERENCED_PARAMETER(length);
    +
    717 throw std::exception("not implemented");
    +
    718 }
    +
    719
    +
    723 virtual void unlock(_In_ fpos_t offset, _In_ fsize_t length)
    +
    724 {
    +
    725 UNREFERENCED_PARAMETER(offset);
    +
    726 UNREFERENCED_PARAMETER(length);
    +
    727 throw std::exception("not implemented");
    +
    728 }
    +
    729
    +
    734 virtual fsize_t size() = 0;
    +
    735
    +
    739 virtual void truncate() = 0;
    +
    740
    +
    744 virtual time_point ctime() const
    +
    745 {
    +
    746 return time_point::min();
    +
    747 }
    +
    748
    +
    752 virtual time_point atime() const
    +
    753 {
    +
    754 return time_point::min();
    +
    755 }
    +
    756
    +
    760 virtual time_point mtime() const
    +
    761 {
    +
    762 return time_point::min();
    +
    763 }
    +
    764
    +
    768 virtual void set_ctime(time_point date)
    +
    769 {
    +
    770 UNREFERENCED_PARAMETER(date);
    +
    771 throw std::exception("not implemented");
    +
    772 }
    +
    773
    +
    777 virtual void set_atime(time_point date)
    +
    778 {
    +
    779 UNREFERENCED_PARAMETER(date);
    +
    780 throw std::exception("not implemented");
    +
    781 }
    +
    782
    +
    786 virtual void set_mtime(time_point date)
    +
    787 {
    +
    788 UNREFERENCED_PARAMETER(date);
    +
    789 throw std::exception("not implemented");
    +
    790 }
    +
    791
    +
    792#ifdef _WIN32
    +
    796 LPSAFEARRAY read_sa()
    +
    797 {
    +
    798 assert(size() <= SIZE_MAX);
    +
    799 size_t length = static_cast<size_t>(size());
    +
    800 std::unique_ptr<SAFEARRAY, SafeArrayDestroy_delete> sa(SafeArrayCreateVector(VT_UI1, 0, (ULONG)length));
    +
    801 if (!sa)
    +
    802 throw std::runtime_error("SafeArrayCreateVector failed");
    +
    803 safearray_accessor<void> a(sa.get());
    +
    804 if (seek(0) != 0)
    +
    805 throw std::runtime_error("failed to seek");
    +
    806 if (read_array(a.data(), 1, length) != length)
    +
    807 throw std::runtime_error("failed to read");
    +
    808 return sa.release();
    +
    809 }
    +
    810#endif
    +
    811
    +
    817 charset_id read_charset(_In_ charset_id default_charset = charset_id::default)
    +
    818 {
    +
    819 if (seek(0) != 0)
    +
    820 throw std::runtime_error("failed to seek");
    +
    821 wchar_t id_utf16;
    +
    822 read_array(&id_utf16, sizeof(wchar_t), 1);
    +
    823 if (!ok()) _Unlikely_
    +
    824 return default_charset;
    +
    825 if (id_utf16 == utf16_bom)
    +
    826 return charset_id::utf16;
    +
    827
    +
    828 if (seek(0) != 0)
    +
    829 throw std::runtime_error("failed to seek");
    +
    830 char id_utf8[3] = { 0 };
    +
    831 read_array(id_utf8, sizeof(id_utf8), 1);
    +
    832 if (!ok()) _Unlikely_
    +
    833 return default_charset;
    +
    834 if (strncmp(id_utf8, _countof(id_utf8), utf8_bom, _countof(utf8_bom)) == 0)
    +
    835 return charset_id::utf8;
    +
    836
    +
    837 if (seek(0) != 0)
    +
    838 throw std::runtime_error("failed to seek");
    +
    839 return default_charset;
    +
    840 }
    +
    841 };
    +
    842
    +
    846 class converter : public basic
    +
    847 {
    +
    848 protected:
    +
    849 explicit converter() :
    +
    850 basic(state_t::fail),
    +
    851 m_source(nullptr)
    +
    852 {}
    +
    853
    +
    854 void init(_Inout_ basic& source)
    +
    855 {
    +
    856 m_state = source.state();
    +
    857 m_source = &source;
    +
    858 }
    +
    859
    +
    860 public:
    +
    861 converter(_Inout_ basic& source) :
    +
    862 basic(source.state()),
    +
    863 m_source(&source)
    +
    864 {}
    +
    865
    +
    866 virtual _Success_(return != 0 || length == 0) size_t read(
    +
    867 _Out_writes_bytes_to_opt_(length, return) void* data, _In_ size_t length)
    +
    868 {
    +
    869 size_t num_read = m_source->read(data, length);
    +
    870 m_state = m_source->state();
    +
    871 return num_read;
    +
    872 }
    +
    873
    +
    874 virtual _Success_(return != 0) size_t write(
    +
    875 _In_reads_bytes_opt_(length) const void* data, _In_ size_t length)
    +
    876 {
    +
    877 size_t num_written = m_source->write(data, length);
    +
    878 m_state = m_source->state();
    +
    879 return num_written;
    +
    880 }
    +
    881
    +
    882 virtual void close()
    +
    883 {
    +
    884 m_source->close();
    +
    885 m_state = m_source->state();
    +
    886 }
    +
    887
    +
    888 virtual void flush()
    +
    889 {
    +
    890 m_source->flush();
    +
    891 m_state = m_source->state();
    +
    892 }
    +
    893
    +
    894 protected:
    +
    895 basic* m_source;
    +
    896 };
    +
    897
    +
    901 class replicator : public basic
    +
    902 {
    +
    903 public:
    +
    904 virtual ~replicator()
    +
    905 {
    +
    906 for (auto w = m_workers.begin(), w_end = m_workers.end(); w != w_end; ++w) {
    +
    907 auto _w = w->get();
    +
    908 {
    +
    909 const std::lock_guard<std::mutex> lk(_w->mutex);
    +
    910 _w->op = worker::op_t::quit;
    +
    911 }
    +
    912 _w->cv.notify_one();
    +
    913 }
    +
    914 for (auto w = m_workers.begin(), w_end = m_workers.end(); w != w_end; ++w)
    +
    915 w->get()->thread.join();
    +
    916 }
    +
    917
    +
    921 void push_back(_In_ basic* source)
    +
    922 {
    +
    923 m_workers.push_back(std::unique_ptr<worker>(new worker(source)));
    +
    924 }
    +
    925
    +
    929 void remove(basic* source)
    +
    930 {
    +
    931 for (auto w = m_workers.begin(), w_end = m_workers.end(); w != w_end; ++w) {
    +
    932 auto _w = w->get();
    +
    933 if (_w->source == source) {
    +
    934 {
    +
    935 const std::lock_guard<std::mutex> lk(_w->mutex);
    +
    936 _w->op = worker::op_t::quit;
    +
    937 }
    +
    938 _w->cv.notify_one();
    +
    939 _w->thread.join();
    +
    940 m_workers.erase(w);
    +
    941 return;
    +
    942 }
    +
    943 }
    +
    944 }
    +
    945
    +
    946 virtual _Success_(return != 0) size_t write(
    +
    947 _In_reads_bytes_opt_(length) const void* data, _In_ size_t length)
    +
    948 {
    +
    949 for (auto w = m_workers.begin(), w_end = m_workers.end(); w != w_end; ++w) {
    +
    950 auto _w = w->get();
    +
    951 {
    +
    952 const std::lock_guard<std::mutex> lk(_w->mutex);
    +
    953 _w->op = worker::op_t::write;
    +
    954 _w->data = data;
    +
    955 _w->length = length;
    +
    956 }
    +
    957 _w->cv.notify_one();
    +
    958 }
    +
    959 size_t num_written = length;
    +
    960 m_state = state_t::ok;
    +
    961 for (auto w = m_workers.begin(), w_end = m_workers.end(); w != w_end; ++w) {
    +
    962 auto _w = w->get();
    +
    963 std::unique_lock<std::mutex> lk(_w->mutex);
    +
    964 _w->cv.wait(lk, [&] {return _w->op == worker::op_t::noop; });
    +
    965 if (_w->num_written < num_written)
    +
    966 num_written = _w->num_written;
    +
    967 if (ok() && !_w->source->ok())
    +
    968 m_state = _w->source->state();
    +
    969 }
    +
    970 return num_written;
    +
    971 }
    +
    972
    +
    973 virtual void close()
    +
    974 {
    +
    975 foreach_worker(worker::op_t::close);
    +
    976 }
    +
    977
    +
    978 virtual void flush()
    +
    979 {
    +
    980 foreach_worker(worker::op_t::flush);
    +
    981 }
    +
    982
    +
    983 protected:
    +
    984 class worker
    +
    985 {
    +
    986 public:
    +
    987 worker(_In_ basic* _source) :
    +
    988 source(_source),
    +
    989 op(op_t::noop),
    +
    990 data(nullptr),
    +
    991 length(0),
    +
    992 num_written(0),
    +
    993 thread(process_op, std::ref(*this))
    +
    994 {}
    +
    995
    +
    996 protected:
    +
    997 static void process_op(_Inout_ worker& w)
    +
    998 {
    +
    999 for (;;) {
    +
    1000 std::unique_lock<std::mutex> lk(w.mutex);
    +
    1001 w.cv.wait(lk, [&] {return w.op != op_t::noop; });
    +
    1002 switch (w.op) {
    +
    1003 case op_t::quit:
    +
    1004 return;
    +
    1005 case op_t::write:
    +
    1006 w.num_written = w.source->write(w.data, w.length);
    +
    1007 break;
    +
    1008 case op_t::close:
    +
    1009 w.source->close();
    +
    1010 break;
    +
    1011 case op_t::flush:
    +
    1012 w.source->flush();
    +
    1013 break;
    +
    1014 }
    +
    1015 w.op = op_t::noop;
    +
    1016 lk.unlock();
    +
    1017 w.cv.notify_one();
    +
    1018 }
    +
    1019 }
    +
    1020
    +
    1021 public:
    +
    1022 basic* source;
    +
    1023 enum class op_t {
    +
    1024 noop = 0,
    +
    1025 quit,
    +
    1026 write,
    +
    1027 close,
    +
    1028 flush,
    +
    1029 } op;
    +
    1030 const void* data;
    +
    1031 size_t length;
    + +
    1033 std::mutex mutex;
    +
    1034 std::condition_variable cv;
    +
    1035 std::thread thread;
    +
    1036 };
    +
    1037
    +
    1038 void foreach_worker(_In_ worker::op_t op)
    +
    1039 {
    +
    1040 for (auto w = m_workers.begin(), w_end = m_workers.end(); w != w_end; ++w) {
    +
    1041 auto _w = w->get();
    +
    1042 {
    +
    1043 const std::lock_guard<std::mutex> lk(_w->mutex);
    +
    1044 _w->op = op;
    +
    1045 }
    +
    1046 _w->cv.notify_one();
    +
    1047 }
    +
    1048 m_state = state_t::ok;
    +
    1049 for (auto w = m_workers.begin(), w_end = m_workers.end(); w != w_end; ++w) {
    +
    1050 auto _w = w->get();
    +
    1051 std::unique_lock<std::mutex> lk(_w->mutex);
    +
    1052 _w->cv.wait(lk, [&] {return _w->op == worker::op_t::noop; });
    +
    1053 if (ok())
    +
    1054 m_state = _w->source->state();
    +
    1055 }
    +
    1056 }
    +
    1057
    +
    1058 std::list<std::unique_ptr<worker>> m_workers;
    +
    1059 };
    +
    1060
    +
    1061 constexpr size_t default_async_limit = 0x100000;
    +
    1062
    +
    1068 template <size_t CAPACITY = default_async_limit>
    + +
    1070 {
    +
    1071 public:
    +
    1072 async_reader(_Inout_ basic& source) :
    +
    1073 converter(source),
    +
    1074 m_worker(process, std::ref(*this))
    +
    1075 {}
    +
    1076
    +
    1077 virtual ~async_reader()
    +
    1078 {
    +
    1079 m_ring.quit();
    +
    1080 m_worker.join();
    +
    1081 }
    +
    1082
    +
    1083#pragma warning(suppress: 6101) // See [1] below
    +
    1084 virtual _Success_(return != 0 || length == 0) size_t read(
    +
    1085 _Out_writes_bytes_to_opt_(length, return) void* data, _In_ size_t length)
    +
    1086 {
    +
    1087 assert(data || !length);
    +
    1088 for (size_t to_read = length;;) {
    +
    1089 uint8_t* ptr; size_t num_read;
    +
    1090 std::tie(ptr, num_read) = m_ring.front();
    +
    1091 if (!ptr) _Unlikely_ {
    +
    1092 // [1] Code analysis misses length - to_read bytes were written to data in previous loop iterations.
    +
    1093 m_state = to_read < length || !length ? state_t::ok : m_source->state();
    +
    1094 return length - to_read;
    +
    1095 }
    +
    1096 if (to_read < num_read)
    +
    1097 num_read = to_read;
    +
    1098 memcpy(data, ptr, num_read);
    +
    1099 m_ring.pop(num_read);
    +
    1100 to_read -= num_read;
    +
    1101 if (!to_read) {
    +
    1102 m_state = state_t::ok;
    +
    1103 return length;
    +
    1104 }
    +
    1105 reinterpret_cast<uint8_t*&>(data) += num_read;
    +
    1106 }
    +
    1107 }
    +
    1108
    +
    1109 protected:
    +
    1110 static void process(_Inout_ async_reader& w)
    +
    1111 {
    +
    1112 for (;;) {
    +
    1113 uint8_t* ptr; size_t num_write;
    +
    1114 std::tie(ptr, num_write) = w.m_ring.back();
    +
    1115 if (!ptr) _Unlikely_
    +
    1116 break;
    +
    1117 num_write = w.m_source->read(ptr, num_write);
    +
    1118 w.m_ring.push(num_write);
    +
    1119 if (!w.m_source->ok()) {
    +
    1120 w.m_ring.quit();
    +
    1121 break;
    +
    1122 }
    +
    1123 }
    +
    1124 }
    +
    1125
    +
    1126 protected:
    +
    1127 ring<uint8_t, CAPACITY> m_ring;
    +
    1128 std::thread m_worker;
    +
    1129 };
    +
    1130
    +
    1136 template <size_t CAPACITY = default_async_limit>
    + +
    1138 {
    +
    1139 public:
    +
    1140 async_writer(_Inout_ basic& source) :
    +
    1141 converter(source),
    +
    1142 m_worker(process, std::ref(*this))
    +
    1143 {}
    +
    1144
    +
    1145 virtual ~async_writer()
    +
    1146 {
    +
    1147 m_ring.quit();
    +
    1148 m_worker.join();
    +
    1149 }
    +
    1150
    +
    1151 virtual _Success_(return != 0) size_t write(
    +
    1152 _In_reads_bytes_opt_(length) const void* data, _In_ size_t length)
    +
    1153 {
    +
    1154 assert(data || !length);
    +
    1155 for (size_t to_write = length;;) {
    +
    1156 uint8_t* ptr; size_t num_write;
    +
    1157 std::tie(ptr, num_write) = m_ring.back();
    +
    1158 if (!ptr) _Unlikely_ {
    +
    1159 m_state = state_t::fail;
    +
    1160 return length - to_write;
    +
    1161 }
    +
    1162 if (to_write < num_write)
    +
    1163 num_write = to_write;
    +
    1164 memcpy(ptr, data, num_write);
    +
    1165 m_ring.push(num_write);
    +
    1166 to_write -= num_write;
    +
    1167 if (!to_write) {
    +
    1168 m_state = state_t::ok;
    +
    1169 return length;
    +
    1170 }
    +
    1171 reinterpret_cast<const uint8_t*&>(data) += num_write;
    +
    1172 }
    +
    1173 }
    +
    1174
    +
    1175 virtual void flush()
    +
    1176 {
    +
    1177 m_ring.sync();
    + +
    1179 }
    +
    1180
    +
    1181 protected:
    +
    1182 static void process(_Inout_ async_writer& w)
    +
    1183 {
    +
    1184 for (;;) {
    +
    1185 uint8_t* ptr; size_t num_read;
    +
    1186 std::tie(ptr, num_read) = w.m_ring.front();
    +
    1187 if (!ptr)
    +
    1188 break;
    +
    1189 num_read = w.m_source->write(ptr, num_read);
    +
    1190 w.m_ring.pop(num_read);
    +
    1191 if (!w.m_source->ok()) {
    +
    1192 w.m_ring.quit();
    +
    1193 break;
    +
    1194 }
    +
    1195 }
    +
    1196 }
    +
    1197
    +
    1198 protected:
    +
    1199 ring<uint8_t, CAPACITY> m_ring;
    +
    1200 std::thread m_worker;
    +
    1201 };
    +
    1202
    +
    1203 constexpr size_t default_buffer_size = 0x400;
    +
    1204
    +
    1208 class buffer : public converter
    +
    1209 {
    +
    1210 protected:
    +
    1211 explicit buffer(_In_ size_t read_buffer_size = default_buffer_size, _In_ size_t write_buffer_size = default_buffer_size) :
    +
    1212 converter(),
    +
    1213 m_read_buffer(read_buffer_size),
    +
    1214 m_write_buffer(write_buffer_size)
    +
    1215 {}
    +
    1216
    +
    1217 public:
    +
    1218 buffer(_Inout_ basic& source, _In_ size_t read_buffer_size = default_buffer_size, _In_ size_t write_buffer_size = default_buffer_size) :
    +
    1219 converter(source),
    +
    1220 m_read_buffer(read_buffer_size),
    +
    1221 m_write_buffer(write_buffer_size)
    +
    1222 {}
    +
    1223
    +
    1224 virtual ~buffer()
    +
    1225 {
    +
    1226 if (m_source)
    +
    1227 flush_write();
    +
    1228 }
    +
    1229
    +
    1230 virtual _Success_(return != 0 || length == 0) size_t read(
    +
    1231 _Out_writes_bytes_to_opt_(length, return) void* data, _In_ size_t length)
    +
    1232 {
    +
    1233 assert(data || !length);
    +
    1234 for (size_t to_read = length;;) {
    +
    1235 size_t buffer_size = m_read_buffer.tail - m_read_buffer.head;
    +
    1236 if (to_read <= buffer_size) {
    +
    1237 memcpy(data, m_read_buffer.data + m_read_buffer.head, to_read);
    +
    1238 m_read_buffer.head += to_read;
    +
    1239 m_state = state_t::ok;
    +
    1240 return length;
    +
    1241 }
    +
    1242 if (buffer_size) {
    +
    1243 memcpy(data, m_read_buffer.data + m_read_buffer.head, buffer_size);
    +
    1244 reinterpret_cast<uint8_t*&>(data) += buffer_size;
    +
    1245 to_read -= buffer_size;
    +
    1246 }
    +
    1247 m_read_buffer.head = 0;
    +
    1248 if (to_read > m_read_buffer.capacity) {
    +
    1249 // When needing to read more data than buffer capacity, bypass the buffer.
    +
    1250 m_read_buffer.tail = 0;
    +
    1251 to_read -= m_source->read(data, to_read);
    +
    1252 m_state = to_read < length ? state_t::ok : m_source->state();
    +
    1253 return length - to_read;
    +
    1254 }
    +
    1255 m_read_buffer.tail = m_source->read(m_read_buffer.data, m_read_buffer.capacity);
    +
    1256 if (m_read_buffer.tail < m_read_buffer.capacity && m_read_buffer.tail < to_read) _Unlikely_ {
    +
    1257 memcpy(data, m_read_buffer.data, m_read_buffer.tail);
    +
    1258 m_read_buffer.head = m_read_buffer.tail;
    +
    1259 to_read -= m_read_buffer.tail;
    +
    1260 m_state = to_read < length ? state_t::ok : m_source->state();
    +
    1261 return length - to_read;
    +
    1262 }
    +
    1263 }
    +
    1264 }
    +
    1265
    +
    1266 virtual _Success_(return != 0) size_t write(
    +
    1267 _In_reads_bytes_opt_(length) const void* data, _In_ size_t length)
    +
    1268 {
    +
    1269 assert(data || !length);
    +
    1270 if (!length) _Unlikely_ {
    +
    1271 // Pass null writes (zero-byte length). Null write operations have special meaning with with Windows pipes.
    +
    1272 flush_write();
    +
    1273 if (!ok()) _Unlikely_
    +
    1274 return 0;
    +
    1275 m_source->write(nullptr, 0);
    +
    1276 m_state = m_source->state();
    +
    1277 return 0;
    +
    1278 }
    +
    1279
    +
    1280 for (size_t to_write = length;;) {
    +
    1281 size_t available_buffer = m_write_buffer.capacity - m_write_buffer.tail;
    +
    1282 if (to_write <= available_buffer) {
    +
    1283 memcpy(m_write_buffer.data + m_write_buffer.tail, data, to_write);
    +
    1284 m_write_buffer.tail += to_write;
    +
    1285 m_state = state_t::ok;
    +
    1286 return length;
    +
    1287 }
    +
    1288 if (available_buffer) {
    +
    1289 memcpy(m_write_buffer.data + m_write_buffer.tail, data, available_buffer);
    +
    1290 reinterpret_cast<const uint8_t*&>(data) += available_buffer;
    +
    1291 to_write -= available_buffer;
    +
    1292 m_write_buffer.tail += available_buffer;
    +
    1293 }
    +
    1294 size_t buffer_size = m_write_buffer.tail - m_write_buffer.head;
    +
    1295 if (buffer_size) {
    +
    1296 m_write_buffer.head += m_source->write(m_write_buffer.data + m_write_buffer.head, buffer_size);
    +
    1297 m_state = m_source->state();
    +
    1298 if (m_write_buffer.head == m_write_buffer.tail)
    +
    1299 m_write_buffer.head = m_write_buffer.tail = 0;
    +
    1300 else
    +
    1301 return length - to_write;
    +
    1302 }
    +
    1303 if (to_write > m_write_buffer.capacity) {
    +
    1304 // When needing to write more data than buffer capacity, bypass the buffer.
    +
    1305 to_write -= m_source->write(data, to_write);
    +
    1306 m_state = m_source->state();
    +
    1307 return length - to_write;
    +
    1308 }
    +
    1309 }
    +
    1310 }
    +
    1311
    +
    1312 virtual void flush()
    +
    1313 {
    +
    1314 flush_write();
    +
    1315 if (ok())
    + +
    1317 }
    +
    1318
    +
    1319 protected:
    +
    1320 void flush_write()
    +
    1321 {
    +
    1322 size_t buffer_size = m_write_buffer.tail - m_write_buffer.head;
    +
    1323 if (buffer_size) {
    +
    1324 m_write_buffer.head += m_source->write(m_write_buffer.data + m_write_buffer.head, buffer_size);
    +
    1325 if (m_write_buffer.head == m_write_buffer.tail) {
    +
    1326 m_write_buffer.head = 0;
    +
    1327 m_write_buffer.tail = 0;
    +
    1328 }
    +
    1329 else {
    +
    1330 m_state = m_source->state();
    +
    1331 return;
    +
    1332 }
    +
    1333 }
    +
    1334 m_state = state_t::ok;
    +
    1335 }
    +
    1336
    +
    1337 struct buffer_t {
    +
    1338 uint8_t* data;
    +
    1339 size_t head, tail, capacity;
    +
    1340
    +
    1341 buffer_t(_In_ size_t buffer_size) :
    +
    1342 head(0),
    +
    1343 tail(0),
    +
    1344 capacity(buffer_size),
    +
    1345 data(buffer_size ? new uint8_t[buffer_size] : nullptr)
    +
    1346 {}
    +
    1347
    +
    1348 ~buffer_t()
    +
    1349 {
    +
    1350 if (data)
    +
    1351 delete[] data;
    +
    1352 }
    +
    1353 } m_read_buffer, m_write_buffer;
    +
    1354 };
    +
    1355
    +
    1359 class limiter : public converter
    +
    1360 {
    +
    1361 public:
    +
    1362 limiter(_Inout_ basic& source, _In_ fsize_t _read_limit = 0, _In_ fsize_t _write_limit = 0) :
    +
    1363 converter(source),
    +
    1364 read_limit(_read_limit),
    +
    1365 write_limit(_write_limit)
    +
    1366 {}
    +
    1367
    +
    1368 virtual _Success_(return != 0 || length == 0) size_t read(
    +
    1369 _Out_writes_bytes_to_opt_(length, return) void* data, _In_ size_t length)
    +
    1370 {
    +
    1371 size_t num_read;
    +
    1372 if (read_limit == fsize_max) {
    +
    1373 num_read = m_source->read(data, length);
    +
    1374 m_state = m_source->state();
    +
    1375 }
    +
    1376 else if (length <= read_limit) {
    +
    1377 num_read = m_source->read(data, length);
    +
    1378 m_state = m_source->state();
    +
    1379 read_limit -= num_read;
    +
    1380 }
    +
    1381 else if (length && !read_limit) {
    +
    1382 num_read = 0;
    +
    1383 m_state = state_t::eof;
    +
    1384 }
    +
    1385 else {
    +
    1386 num_read = m_source->read(data, static_cast<size_t>(read_limit));
    +
    1387 m_state = m_source->state();
    +
    1388 read_limit -= num_read;
    +
    1389 }
    +
    1390 return num_read;
    +
    1391 }
    +
    1392
    +
    1393 virtual _Success_(return != 0) size_t write(
    +
    1394 _In_reads_bytes_opt_(length) const void* data, _In_ size_t length)
    +
    1395 {
    +
    1396 size_t num_written;
    +
    1397 if (write_limit == fsize_max) {
    +
    1398 num_written = m_source->write(data, length);
    +
    1399 m_state = m_source->state();
    +
    1400 }
    +
    1401 else if (length <= write_limit) {
    +
    1402 num_written = m_source->write(data, length);
    +
    1403 m_state = m_source->state();
    +
    1404 write_limit -= num_written;
    +
    1405 }
    +
    1406 else if (length && !write_limit) {
    +
    1407 num_written = 0;
    +
    1408 m_state = state_t::fail;
    +
    1409 }
    +
    1410 else {
    +
    1411 num_written = m_source->write(data, static_cast<size_t>(write_limit));
    +
    1412 m_state = m_source->state();
    +
    1413 write_limit -= num_written;
    +
    1414 }
    +
    1415 return num_written;
    +
    1416 }
    +
    1417
    +
    1418 public:
    +
    1419 fsize_t
    + + +
    1422 };
    +
    1423
    +
    1427 class window : public limiter
    +
    1428 {
    +
    1429 public:
    +
    1430 window(_Inout_ basic& source, _In_ fpos_t _read_offset = 0, _In_ fsize_t read_limit = fsize_max, _In_ fpos_t _write_offset = 0, _In_ fsize_t write_limit = fsize_max) :
    +
    1431 limiter(source, read_limit, write_limit),
    +
    1432 read_offset(_read_offset),
    +
    1433 write_offset(_write_offset)
    +
    1434 {}
    +
    1435
    +
    1436 virtual _Success_(return != 0 || length == 0) size_t read(
    +
    1437 _Out_writes_bytes_to_opt_(length, return) void* data, _In_ size_t length)
    +
    1438 {
    +
    1439 if (read_offset) {
    +
    1440 m_source->skip(read_offset);
    +
    1441 m_state = m_source->state();
    +
    1442 if (!ok()) _Unlikely_
    +
    1443 return 0;
    +
    1444 read_offset = 0;
    +
    1445 }
    +
    1446 size_t num_read;
    +
    1447 if (read_limit == fsize_max) {
    +
    1448 num_read = m_source->read(data, length);
    +
    1449 m_state = m_source->state();
    +
    1450 }
    +
    1451 else if (length <= read_limit) {
    +
    1452 num_read = m_source->read(data, length);
    +
    1453 m_state = m_source->state();
    +
    1454 read_limit -= num_read;
    +
    1455 }
    +
    1456 else if (length && !read_limit) {
    +
    1457 num_read = 0;
    +
    1458 m_source->skip(length);
    +
    1459 m_state = state_t::eof;
    +
    1460 }
    +
    1461 else {
    +
    1462 num_read = m_source->read(data, static_cast<size_t>(read_limit));
    +
    1463 m_state = m_source->state();
    +
    1464 read_limit -= num_read;
    +
    1465 }
    +
    1466 return num_read;
    +
    1467 }
    +
    1468
    +
    1469 virtual _Success_(return != 0) size_t write(
    +
    1470 _In_reads_bytes_opt_(length) const void* data, _In_ size_t length)
    +
    1471 {
    +
    1472 size_t num_skipped, num_written;
    +
    1473 if (length <= write_offset) {
    +
    1474 write_offset -= length;
    +
    1475 m_state = state_t::ok;
    +
    1476 return length;
    +
    1477 }
    +
    1478 if (write_offset) {
    +
    1479 reinterpret_cast<const uint8_t*&>(data) += static_cast<size_t>(write_offset);
    +
    1480 length -= static_cast<size_t>(write_offset);
    +
    1481 num_skipped = static_cast<size_t>(write_offset);
    +
    1482 write_offset = 0;
    +
    1483 }
    +
    1484 else
    +
    1485 num_skipped = 0;
    +
    1486 if (write_limit == fsize_max) {
    +
    1487 num_written = m_source->write(data, length);
    +
    1488 m_state = m_source->state();
    +
    1489 }
    +
    1490 else if (length <= write_limit) {
    +
    1491 num_written = m_source->write(data, length);
    +
    1492 m_state = m_source->state();
    +
    1493 write_limit -= num_written;
    +
    1494 }
    +
    1495 else if (length && !write_limit) {
    +
    1496 num_skipped += length;
    +
    1497 num_written = 0;
    +
    1498 m_state = state_t::ok;
    +
    1499 }
    +
    1500 else {
    +
    1501 num_skipped += length - static_cast<size_t>(write_limit);
    +
    1502 num_written = m_source->write(data, static_cast<size_t>(write_limit));
    +
    1503 m_state = m_source->state();
    +
    1504 write_limit -= num_written;
    +
    1505 }
    +
    1506 return num_skipped + num_written;
    +
    1507 }
    +
    1508
    +
    1509 public:
    +
    1510 fpos_t
    + + +
    1513 };
    +
    1514
    + +
    1519 {
    +
    1520 public:
    +
    1521 file_window(_Inout_ basic_file& source, fpos_t offset = 0, fsize_t length = 0) :
    +
    1522 basic(source.state()),
    +
    1523 m_source(source),
    +
    1524 m_offset(source.tell()),
    +
    1525 m_region(offset, offset + length)
    +
    1526 {}
    +
    1527
    +
    1528 virtual _Success_(return != 0 || length == 0) size_t read(
    +
    1529 _Out_writes_bytes_to_opt_(length, return) void* data, _In_ size_t length)
    +
    1530 {
    +
    1531 assert(data || !length);
    +
    1532 if (m_region.contains(m_offset)) {
    +
    1533 size_t num_read = m_source.read(data, static_cast<size_t>(std::min<fpos_t>(length, m_region.end - m_offset)));
    +
    1534 m_state = m_source.state();
    +
    1535 m_offset += num_read;
    +
    1536 return num_read;
    +
    1537 }
    +
    1538 m_state = length ? state_t::eof : state_t::ok;
    +
    1539 return 0;
    +
    1540 }
    +
    1541
    +
    1542 virtual _Success_(return != 0) size_t write(
    +
    1543 _In_reads_bytes_opt_(length) const void* data, _In_ size_t length)
    +
    1544 {
    +
    1545 assert(data || !length);
    +
    1546 if (m_region.contains(m_offset)) {
    +
    1547 size_t num_written = m_source.write(data, static_cast<size_t>(std::min<fpos_t>(length, m_region.end - m_offset)));
    +
    1548 m_state = m_source.state();
    +
    1549 m_offset += num_written;
    +
    1550 return num_written;
    +
    1551 }
    +
    1552 m_state = state_t::fail;
    +
    1553 return 0;
    +
    1554 }
    +
    1555
    +
    1556 virtual void close()
    +
    1557 {
    +
    1558 m_source.close();
    +
    1559 m_state = m_source.state();
    +
    1560 }
    +
    1561
    +
    1562 virtual void flush()
    +
    1563 {
    +
    1564 m_source.flush();
    +
    1565 m_state = m_source.state();
    +
    1566 }
    +
    1567
    +
    1568 virtual fpos_t seek(_In_ foff_t offset, _In_ seek_t how = seek_t::beg)
    +
    1569 {
    +
    1570 m_offset = m_source.seek(offset, how);
    +
    1571 m_state = m_source.state();
    +
    1572 return ok() ? m_offset - m_region.start : fpos_max;
    +
    1573 }
    +
    1574
    +
    1575 virtual void skip(_In_ fsize_t amount)
    +
    1576 {
    +
    1577 m_source.skip(amount);
    +
    1578 m_state = m_source.state();
    +
    1579 }
    +
    1580
    +
    1581 virtual fpos_t tell() const
    +
    1582 {
    +
    1583 fpos_t offset = m_source.tell();
    +
    1584 return m_region.contains(offset) ? offset - m_region.start : fpos_max;
    +
    1585 }
    +
    1586
    +
    1587 virtual void lock(_In_ fpos_t offset, _In_ fsize_t length)
    +
    1588 {
    +
    1589 if (m_region.contains(offset)) {
    +
    1590 m_source.lock(m_region.start + offset, std::min<fsize_t>(length, m_region.end - offset));
    +
    1591 m_state = m_source.state();
    +
    1592 }
    +
    1593 else
    +
    1594 m_state = state_t::fail;
    +
    1595 }
    +
    1596
    +
    1597 virtual void unlock(_In_ fpos_t offset, _In_ fsize_t length)
    +
    1598 {
    +
    1599 if (m_region.contains(offset)) {
    +
    1600 m_source.unlock(m_region.start + offset, std::min<fsize_t>(length, m_region.end - offset));
    +
    1601 m_state = m_source.state();
    +
    1602 }
    +
    1603 else
    +
    1604 m_state = state_t::fail;
    +
    1605 }
    +
    1606
    +
    1607 virtual fsize_t size()
    +
    1608 {
    +
    1609 return m_region.size();
    +
    1610 }
    +
    1611
    +
    1612 virtual void truncate()
    +
    1613 {
    +
    1614 m_state = state_t::fail;
    +
    1615 }
    +
    1616
    +
    1617 protected:
    +
    1618 basic_file& m_source;
    +
    1619 fpos_t m_offset;
    +
    1620 interval<fpos_t> m_region;
    +
    1621 };
    +
    1622
    +
    1623 constexpr size_t default_cache_size = 0x1000;
    +
    1624
    +
    1628 class cache : public basic_file
    +
    1629 {
    +
    1630 protected:
    +
    1631 explicit cache(_In_ size_t cache_size = default_cache_size) :
    +
    1632 basic(state_t::fail),
    +
    1633 m_source(nullptr),
    +
    1634 m_cache(cache_size),
    +
    1635 m_offset(0)
    +
    1636#if SET_FILE_OP_TIMES
    +
    1637 , m_atime(time_point::min()),
    +
    1638 m_mtime(time_point::min())
    +
    1639#endif
    +
    1640 {}
    +
    1641
    +
    1642 void init(_Inout_ basic_file& source)
    +
    1643 {
    +
    1644 m_state = source.state();
    +
    1645 m_source = &source;
    +
    1646 m_offset = source.tell();
    +
    1647 }
    +
    1648
    +
    1649 public:
    +
    1650 cache(_Inout_ basic_file& source, _In_ size_t cache_size = default_cache_size) :
    +
    1651 basic(source.state()),
    +
    1652 m_source(&source),
    +
    1653 m_cache(cache_size),
    +
    1654 m_offset(source.tell())
    +
    1655#if SET_FILE_OP_TIMES
    +
    1656 , m_atime(time_point::min()),
    +
    1657 m_mtime(time_point::min())
    +
    1658#endif
    +
    1659 {}
    +
    1660
    +
    1661 virtual ~cache()
    +
    1662 {
    +
    1663 if (m_source) {
    +
    1664 flush_cache();
    +
    1665 m_source->seek(m_offset);
    +
    1666 }
    +
    1667 }
    +
    1668
    +
    1669 virtual _Success_(return != 0 || length == 0) size_t read(
    +
    1670 _Out_writes_bytes_to_opt_(length, return) void* data, _In_ size_t length)
    +
    1671 {
    +
    1672 assert(data || !length);
    +
    1673#if SET_FILE_OP_TIMES
    +
    1674 m_atime = time_point::now();
    +
    1675#endif
    +
    1676 for (size_t to_read = length;;) {
    +
    1677 if (m_cache.status != cache_t::cache_t::status_t::empty) {
    +
    1678 if (m_cache.region.contains(m_offset)) {
    +
    1679 size_t remaining_cache = static_cast<size_t>(m_cache.region.end - m_offset);
    +
    1680 if (to_read <= remaining_cache) {
    +
    1681 memcpy(data, m_cache.data + static_cast<size_t>(m_offset - m_cache.region.start), to_read);
    +
    1682 m_offset += to_read;
    +
    1683 m_state = state_t::ok;
    +
    1684 return length;
    +
    1685 }
    +
    1686 memcpy(data, m_cache.data + static_cast<size_t>(m_offset - m_cache.region.start), remaining_cache);
    +
    1687 reinterpret_cast<uint8_t*&>(data) += remaining_cache;
    +
    1688 to_read -= remaining_cache;
    +
    1689 m_offset += remaining_cache;
    +
    1690 }
    +
    1691 flush_cache();
    +
    1692 if (!ok()) _Unlikely_ {
    +
    1693 if (to_read < length)
    +
    1694 m_state = state_t::ok;
    +
    1695 return length - to_read;
    +
    1696 }
    +
    1697 }
    +
    1698 {
    +
    1699 fpos_t end_max = m_offset + to_read;
    +
    1700 if (m_offset / m_cache.capacity < end_max / m_cache.capacity) {
    +
    1701 // Read spans multiple cache blocks. Bypass cache to the last block.
    +
    1702 m_source->seek(m_offset);
    +
    1703 if (!m_source->ok()) _Unlikely_ {
    +
    1704 m_state = to_read < length ? state_t::ok : state_t::fail;
    +
    1705 return length - to_read;
    +
    1706 }
    +
    1707 size_t num_read = m_source->read(data, to_read - static_cast<size_t>(end_max % m_cache.capacity));
    +
    1708 m_offset += num_read;
    +
    1709 to_read -= num_read;
    +
    1710 if (!to_read) {
    +
    1711 m_state = state_t::ok;
    +
    1712 return length;
    +
    1713 }
    +
    1714 reinterpret_cast<uint8_t*&>(data) += num_read;
    +
    1715 m_state = m_source->state();
    +
    1716 if (!ok()) {
    +
    1717 if (to_read < length)
    +
    1718 m_state = state_t::ok;
    +
    1719 return length - to_read;
    +
    1720 }
    +
    1721 }
    +
    1722 }
    +
    1723 load_cache(m_offset);
    +
    1724 if (!ok() || m_cache.region.end <= m_offset) _Unlikely_ {
    +
    1725 m_state = to_read < length ? state_t::ok : state_t::fail;
    +
    1726 return length - to_read;
    +
    1727 }
    +
    1728 }
    +
    1729 }
    +
    1730
    +
    1731 virtual _Success_(return != 0) size_t write(
    +
    1732 _In_reads_bytes_opt_(length) const void* data, _In_ size_t length)
    +
    1733 {
    +
    1734 assert(data || !length);
    +
    1735#if SET_FILE_OP_TIMES
    +
    1736 m_atime = m_mtime = time_point::now();
    +
    1737#endif
    +
    1738 for (size_t to_write = length;;) {
    +
    1739 if (m_cache.status != cache_t::cache_t::status_t::empty) {
    +
    1740 fpos_t end_max = m_cache.region.start + m_cache.capacity;
    +
    1741 if (m_cache.region.start <= m_offset && m_offset < end_max) {
    +
    1742 size_t remaining_cache = static_cast<size_t>(end_max - m_offset);
    +
    1743 if (to_write <= remaining_cache) {
    +
    1744 memcpy(m_cache.data + static_cast<size_t>(m_offset - m_cache.region.start), data, to_write);
    +
    1745 m_offset += to_write;
    +
    1746 m_cache.status = cache_t::cache_t::status_t::dirty;
    +
    1747 m_cache.region.end = std::max(m_cache.region.end, m_offset);
    +
    1748 m_state = state_t::ok;
    +
    1749 return length;
    +
    1750 }
    +
    1751 memcpy(m_cache.data + static_cast<size_t>(m_offset - m_cache.region.start), data, remaining_cache);
    +
    1752 reinterpret_cast<const uint8_t*&>(data) += remaining_cache;
    +
    1753 to_write -= remaining_cache;
    +
    1754 m_offset += remaining_cache;
    +
    1755 m_cache.status = cache_t::cache_t::status_t::dirty;
    +
    1756 m_cache.region.end = end_max;
    +
    1757 }
    +
    1758 flush_cache();
    +
    1759 if (!ok()) _Unlikely_
    +
    1760 return length - to_write;
    +
    1761 }
    +
    1762 {
    +
    1763 fpos_t end_max = m_offset + to_write;
    +
    1764 if (m_offset / m_cache.capacity < end_max / m_cache.capacity) {
    +
    1765 // Write spans multiple cache blocks. Bypass cache to the last block.
    +
    1766 m_source->seek(m_offset);
    +
    1767 if (!ok()) _Unlikely_
    +
    1768 return length - to_write;
    +
    1769 size_t num_written = m_source->write(data, to_write - static_cast<size_t>(end_max % m_cache.capacity));
    +
    1770 reinterpret_cast<const uint8_t*&>(data) += num_written;
    +
    1771 to_write -= num_written;
    +
    1772 m_offset += num_written;
    +
    1773 m_state = m_source->state();
    +
    1774 if (!to_write || !ok())
    +
    1775 return length - to_write;
    +
    1776 }
    +
    1777 }
    +
    1778 load_cache(m_offset);
    +
    1779 if (!ok()) _Unlikely_
    +
    1780 return length - to_write;
    +
    1781 }
    +
    1782 }
    +
    1783
    +
    1784 virtual void close()
    +
    1785 {
    +
    1786 flush_cache();
    +
    1787 m_source->close();
    +
    1788 m_state = m_source->state();
    +
    1789 }
    +
    1790
    +
    1791 virtual void flush()
    +
    1792 {
    +
    1793#if SET_FILE_OP_TIMES
    +
    1794 m_atime = m_mtime = time_point::min();
    +
    1795#endif
    +
    1796 flush_cache();
    +
    1797 if (!ok()) _Unlikely_
    +
    1798 return;
    +
    1799 m_source->flush();
    +
    1800 }
    +
    1801
    +
    1802 virtual fpos_t seek(_In_ foff_t offset, _In_ seek_t how = seek_t::beg)
    +
    1803 {
    +
    1804 m_state = state_t::ok;
    +
    1805 switch (how) {
    +
    1806 case seek_t::beg:
    +
    1807 return m_offset = offset;
    +
    1808 case seek_t::cur:
    +
    1809 return m_offset += offset;
    +
    1810 case seek_t::end:
    +
    1811 return m_offset = size() + offset;
    +
    1812 default:
    +
    1813 throw std::invalid_argument("unknown seek origin");
    +
    1814 }
    +
    1815 }
    +
    1816
    +
    1817 virtual fpos_t tell() const
    +
    1818 {
    +
    1819 return m_offset;
    +
    1820 }
    +
    1821
    +
    1822 virtual void lock(_In_ fpos_t offset, _In_ fsize_t length)
    +
    1823 {
    +
    1824 m_source->lock(offset, length);
    +
    1825 m_state = m_source->state();
    +
    1826 }
    +
    1827
    +
    1828 virtual void unlock(_In_ fpos_t offset, _In_ fsize_t length)
    +
    1829 {
    +
    1830 m_source->unlock(offset, length);
    +
    1831 m_state = m_source->state();
    +
    1832 }
    +
    1833
    +
    1834 virtual fsize_t size()
    +
    1835 {
    +
    1836 return m_cache.data ? std::max(m_source->size(), m_cache.region.end) : m_source->size();
    +
    1837 }
    +
    1838
    +
    1839 virtual void truncate()
    +
    1840 {
    +
    1841#if SET_FILE_OP_TIMES
    +
    1842 m_atime = m_mtime = time_point::now();
    +
    1843#endif
    +
    1844 m_source->seek(m_offset);
    +
    1845 if (m_cache.region.end <= m_offset) {
    +
    1846 // Truncation does not affect cache.
    +
    1847 }
    +
    1848 else if (m_cache.region.start <= m_offset) {
    +
    1849 // Truncation truncates cache.
    +
    1850 m_cache.region.end = m_offset;
    +
    1851 }
    +
    1852 else {
    +
    1853 // Truncation invalidates cache.
    +
    1854 m_cache.region = 0;
    +
    1855 m_cache.status = cache_t::cache_t::status_t::empty;
    +
    1856 }
    +
    1857 m_source->truncate();
    +
    1858 m_state = m_source->state();
    +
    1859 }
    +
    1860
    +
    1861 virtual time_point ctime() const
    +
    1862 {
    +
    1863 return m_source->ctime();
    +
    1864 }
    +
    1865
    +
    1866 virtual time_point atime() const
    +
    1867 {
    +
    1868#if SET_FILE_OP_TIMES
    +
    1869 return std::max(m_atime, m_source->atime());
    +
    1870#else
    +
    1871 return m_source->atime();
    +
    1872#endif
    +
    1873 }
    +
    1874
    +
    1875 virtual time_point mtime() const
    +
    1876 {
    +
    1877#if SET_FILE_OP_TIMES
    +
    1878 return std::max(m_mtime, m_source->mtime());
    +
    1879#else
    +
    1880 return m_source->mtime();
    +
    1881#endif
    +
    1882 }
    +
    1883
    +
    1884 virtual void set_ctime(time_point date)
    +
    1885 {
    +
    1886 m_source->set_ctime(date);
    +
    1887 }
    +
    1888
    +
    1889 virtual void set_atime(time_point date)
    +
    1890 {
    +
    1891#if SET_FILE_OP_TIMES
    +
    1892 m_atime = date;
    +
    1893#endif
    +
    1894 m_source->set_atime(date);
    +
    1895 }
    +
    1896
    +
    1897 virtual void set_mtime(time_point date)
    +
    1898 {
    +
    1899#if SET_FILE_OP_TIMES
    +
    1900 m_mtime = date;
    +
    1901#endif
    +
    1902 m_source->set_mtime(date);
    +
    1903 }
    +
    1904
    +
    1905 protected:
    +
    1906 void flush_cache()
    +
    1907 {
    +
    1908 if (m_cache.status != cache_t::cache_t::status_t::dirty) {
    +
    1909 m_state = state_t::ok;
    +
    1910 }
    +
    1911 else if (!m_cache.region.empty()) {
    +
    1912 m_source->seek(m_cache.region.start);
    +
    1913 m_source->write(m_cache.data, static_cast<size_t>(m_cache.region.size()));
    +
    1914 m_state = m_source->state();
    +
    1915 if (ok())
    +
    1916 m_cache.status = cache_t::cache_t::status_t::loaded;
    +
    1917 }
    +
    1918 else {
    +
    1919 m_state = state_t::ok;
    +
    1920 m_cache.status = cache_t::cache_t::status_t::loaded;
    +
    1921 }
    +
    1922 }
    +
    1923
    +
    1924 void invalidate_cache()
    +
    1925 {
    +
    1926 flush_cache();
    +
    1927 if (ok()) {
    +
    1928 m_cache.region = 0;
    +
    1929 m_cache.status = cache_t::cache_t::status_t::empty;
    +
    1930 }
    +
    1931 }
    +
    1932
    +
    1933 void load_cache(_In_ fpos_t start)
    +
    1934 {
    +
    1935 assert(m_cache.status != cache_t::cache_t::status_t::dirty);
    +
    1936 start -= start % m_cache.capacity; // Align to cache block size.
    +
    1937 m_source->seek(m_cache.region.start = start);
    +
    1938 if (m_source->ok()) {
    +
    1939 m_cache.region.end = start + m_source->read(m_cache.data, m_cache.capacity);
    +
    1940 m_cache.status = cache_t::cache_t::status_t::loaded;
    +
    1941 m_state = state_t::ok; // Regardless the read failure, we still might have cached some data.
    +
    1942 }
    +
    1943 else
    +
    1944 m_state = state_t::fail;
    +
    1945 }
    +
    1946
    +
    1947 basic_file* m_source;
    +
    1948 struct cache_t {
    +
    1949 uint8_t* data;
    +
    1950 size_t capacity;
    +
    1951 enum class status_t {
    +
    1952 empty = 0,
    +
    1953 loaded,
    +
    1954 dirty,
    +
    1955 } status;
    + +
    1957
    +
    1958 cache_t(_In_ size_t _capacity) :
    +
    1959 data(new uint8_t[_capacity]),
    +
    1960 capacity(_capacity),
    +
    1961 status(status_t::empty),
    +
    1962 region(0)
    +
    1963 {}
    +
    1964
    +
    1965 ~cache_t()
    +
    1966 {
    +
    1967 delete[] data;
    +
    1968 }
    +
    1969 } m_cache;
    +
    1970 fpos_t m_offset;
    +
    1971#if SET_FILE_OP_TIMES
    +
    1972 time_point
    +
    1973 m_atime,
    +
    1974 m_mtime;
    +
    1975#endif
    +
    1976 };
    +
    1977
    +
    1981 class basic_sys : virtual public basic, public sys_object
    +
    1982 {
    +
    1983 public:
    +
    1984 basic_sys(_In_opt_ sys_handle h = invalid_handle, _In_ state_t state = state_t::ok) :
    +
    1985 basic(state),
    +
    1986 sys_object(h)
    +
    1987 {}
    +
    1988
    +
    1989 virtual _Success_(return != 0 || length == 0) size_t read(
    +
    1990 _Out_writes_bytes_to_opt_(length, return) void* data, _In_ size_t length)
    +
    1991 {
    +
    1992 assert(data || !length);
    +
    1993 // Windows Server 2003 and Windows XP: Pipe write operations across a network are limited in size per write.
    +
    1994 // The amount varies per platform. For x86 platforms it's 63.97 MB. For x64 platforms it's 31.97 MB. For Itanium
    +
    1995 // it's 63.95 MB. For more information regarding pipes, see the Remarks section.
    +
    1996 size_t
    +
    1997#if defined(_WIN64)
    +
    1998 block_size = 0x1F80000;
    +
    1999#elif defined(_WIN32)
    +
    2000 block_size = 0x3f00000;
    +
    2001#else
    +
    2002 block_size = SSIZE_MAX;
    +
    2003#endif
    +
    2004 for (size_t to_read = length;;) {
    +
    2005#ifdef _WIN32
    +
    2006 // ReadFile() might raise exception (e.g. STATUS_FILE_BAD_FORMAT/0xE0000002).
    +
    2007 BOOL succeeded;
    +
    2008 DWORD num_read;
    +
    2009 __try { succeeded = ReadFile(m_h, data, static_cast<DWORD>(std::min<size_t>(to_read, block_size)), &num_read, nullptr); }
    +
    2010 __except (EXCEPTION_EXECUTE_HANDLER) { succeeded = FALSE; SetLastError(ERROR_UNHANDLED_EXCEPTION); num_read = 0; }
    +
    2011 if (!succeeded && GetLastError() == ERROR_NO_SYSTEM_RESOURCES && block_size > default_block_size) _Unlikely_ {
    +
    2012 // Error "Insufficient system resources exist to complete the requested service." occurs
    +
    2013 // ocasionally, when attempting to read too much data at once (e.g. over \\TSClient).
    +
    2014 block_size = default_block_size;
    +
    2015 continue;
    +
    2016 }
    +
    2017 if (!succeeded) _Unlikely_
    +
    2018#else
    +
    2019 ssize_t num_read = static_cast<ssize_t>(std::min<size_t>(to_read, block_size));
    +
    2020 num_read = read(m_h, data, num_read);
    +
    2021 if (num_read < 0) _Unlikely_
    +
    2022#endif
    +
    2023 {
    +
    2024 m_state = to_read < length ? state_t::ok : state_t::fail;
    +
    2025 return length - to_read;
    +
    2026 }
    +
    2027 if (!num_read) _Unlikely_ {
    +
    2028 m_state = to_read < length || !length ? state_t::ok : state_t::eof;
    +
    2029 return length - to_read;
    +
    2030 }
    +
    2031 to_read -= num_read;
    +
    2032 if (!to_read) {
    +
    2033 m_state = state_t::ok;
    +
    2034 return length;
    +
    2035 }
    +
    2036 reinterpret_cast<uint8_t*&>(data) += num_read;
    +
    2037 }
    +
    2038 }
    +
    2039
    +
    2040 virtual _Success_(return != 0) size_t write(
    +
    2041 _In_reads_bytes_opt_(length) const void* data, _In_ size_t length)
    +
    2042 {
    +
    2043 // Windows Server 2003 and Windows XP: Pipe write operations across a network are limited in size per write.
    +
    2044 // The amount varies per platform. For x86 platforms it's 63.97 MB. For x64 platforms it's 31.97 MB. For Itanium
    +
    2045 // it's 63.95 MB. For more information regarding pipes, see the Remarks section.
    +
    2046 constexpr size_t
    +
    2047#if defined(_WIN64)
    +
    2048 block_size = 0x1F80000;
    +
    2049#elif defined(_WIN32)
    +
    2050 block_size = 0x3f00000;
    +
    2051#else
    +
    2052 block_size = SSIZE_MAX;
    +
    2053#endif
    +
    2054 for (size_t to_write = length;;) {
    +
    2055#ifdef _WIN32
    +
    2056 // ReadFile() might raise an exception. Be cautious with WriteFile() too.
    +
    2057 BOOL succeeded;
    +
    2058 DWORD num_written;
    +
    2059 __try { succeeded = WriteFile(m_h, data, static_cast<DWORD>(std::min<size_t>(to_write, block_size)), &num_written, nullptr); }
    +
    2060 __except (EXCEPTION_EXECUTE_HANDLER) { succeeded = FALSE; SetLastError(ERROR_UNHANDLED_EXCEPTION); num_written = 0; }
    +
    2061 to_write -= num_written;
    +
    2062 if (!to_write) {
    +
    2063 m_state = state_t::ok;
    +
    2064 return length;
    +
    2065 }
    +
    2066 reinterpret_cast<const uint8_t*&>(data) += num_written;
    +
    2067 if (!succeeded) _Unlikely_ {
    +
    2068 m_state = state_t::fail;
    +
    2069 return length - to_write;
    +
    2070 }
    +
    2071#else
    +
    2072 ssize_t num_written = write(m_h, data, static_cast<ssize_t>(std::min<size_t>(to_write, block_size)));
    +
    2073 if (num_written < 0) _Unlikely_ {
    +
    2074 m_state = state_t::fail;
    +
    2075 return length - to_write;
    +
    2076 }
    +
    2077 to_write -= num_written;
    +
    2078 if (!to_write) {
    +
    2079 m_state = state_t::ok;
    +
    2080 return length;
    +
    2081 }
    +
    2082 reinterpret_cast<const uint8_t*&>(data) += num_written;
    +
    2083#endif
    +
    2084 }
    +
    2085 }
    +
    2086
    +
    2087 virtual void close()
    +
    2088 {
    +
    2089 try {
    + +
    2091 m_state = state_t::ok;
    +
    2092 }
    +
    2093 catch (std::exception) {
    +
    2094 m_state = state_t::fail;
    +
    2095 }
    +
    2096 }
    +
    2097
    +
    2098 virtual void flush()
    +
    2099 {
    +
    2100#ifdef _WIN32
    +
    2101 m_state = FlushFileBuffers(m_h) ? state_t::ok : state_t::fail;
    +
    2102#else
    +
    2103 m_state = fsync(m_h) >= 0 ? state_t::ok : state_t::fail;
    +
    2104#endif
    +
    2105 }
    +
    2106 };
    +
    2107
    +
    2111 class buffered_sys : public buffer
    +
    2112 {
    +
    2113 public:
    +
    2114 buffered_sys(_In_opt_ sys_handle h = invalid_handle, size_t read_buffer_size = default_buffer_size, size_t write_buffer_size = default_buffer_size) :
    +
    2115 buffer(read_buffer_size, write_buffer_size),
    +
    2116 m_source(h)
    +
    2117 {
    +
    2118 init(m_source);
    +
    2119 }
    +
    2120
    +
    2121 protected:
    +
    2122 basic_sys m_source;
    +
    2123 };
    +
    2124
    +
    2125#ifdef _WIN32
    +
    2129 class ISequentialStream : public basic
    +
    2130 {
    +
    2131 public:
    +
    2132 ISequentialStream(_In_::ISequentialStream* source) : m_source(source)
    +
    2133 {
    +
    2134 m_source->AddRef();
    +
    2135 }
    +
    2136
    +
    2137 virtual ~ISequentialStream()
    +
    2138 {
    +
    2139 m_source->Release();
    +
    2140 }
    +
    2141
    +
    2142 virtual _Success_(return != 0 || length == 0) size_t read(
    +
    2143 _Out_writes_bytes_to_opt_(length, return) void* data, _In_ size_t length)
    +
    2144 {
    +
    2145 assert(data || !length);
    +
    2146 for (size_t to_read = length;;) {
    +
    2147 HRESULT hr;
    +
    2148 ULONG num_read = 0;
    +
    2149 __try { hr = m_source->Read(data, (ULONG)std::min<size_t>(to_read, ULONG_MAX), &num_read); }
    +
    2150 __except (EXCEPTION_EXECUTE_HANDLER) { hr = E_FAIL; }
    +
    2151 if (FAILED(hr)) _Unlikely_ {
    +
    2152 m_state = to_read < length ? state_t::ok : state_t::fail;
    +
    2153 return length - to_read;
    +
    2154 }
    +
    2155 to_read -= num_read;
    +
    2156 if (hr == S_FALSE) _Unlikely_ {
    +
    2157 m_state = to_read < length || !length ? state_t::ok : state_t::eof;
    +
    2158 return length - to_read;
    +
    2159 }
    +
    2160 if (!to_read) {
    +
    2161 m_state = state_t::ok;
    +
    2162 return length;
    +
    2163 }
    +
    2164 reinterpret_cast<uint8_t*&>(data) += num_read;
    +
    2165 }
    +
    2166 }
    +
    2167
    +
    2168 virtual _Success_(return != 0) size_t write(
    +
    2169 _In_reads_bytes_opt_(length) const void* data, _In_ size_t length)
    +
    2170 {
    +
    2171 assert(data || !length);
    +
    2172 for (size_t to_write = length;;) {
    +
    2173 HRESULT hr;
    +
    2174 ULONG num_written = 0;
    +
    2175 __try { hr = m_source->Write(data, static_cast<ULONG>(std::min<size_t>(to_write, ULONG_MAX)), &num_written); }
    +
    2176 __except (EXCEPTION_EXECUTE_HANDLER) { hr = E_FAIL; }
    +
    2177 // In abscence of documentation whether num_written gets set when FAILED(hr) (i.e. partially succesful writes),
    +
    2178 // assume write failed completely.
    +
    2179 if (FAILED(hr)) _Unlikely_ {
    +
    2180 m_state = state_t::fail;
    +
    2181 return length - to_write;
    +
    2182 }
    +
    2183 to_write -= num_written;
    +
    2184 if (!to_write) {
    +
    2185 m_state = state_t::ok;
    +
    2186 return length;
    +
    2187 }
    +
    2188 reinterpret_cast<const uint8_t*&>(data) += num_written;
    +
    2189 }
    +
    2190 }
    +
    2191
    +
    2192 protected:
    +
    2193 ::ISequentialStream* m_source;
    +
    2194 };
    +
    2195
    +
    2196#ifndef WIN32_LEAN_AND_MEAN
    +
    2200 class asp : public basic
    +
    2201 {
    +
    2202 public:
    +
    2203 asp(_In_opt_ IRequest* request, _In_opt_ IResponse* response) :
    +
    2204 m_request(request),
    +
    2205 m_response(response)
    +
    2206 {
    +
    2207 if (m_request)
    +
    2208 m_request->AddRef();
    +
    2209 if (m_response)
    +
    2210 m_response->AddRef();
    +
    2211 }
    +
    2212
    +
    2213 virtual ~asp()
    +
    2214 {
    +
    2215 if (m_request)
    +
    2216 m_request->Release();
    +
    2217 if (m_response)
    +
    2218 m_response->Release();
    +
    2219 }
    +
    2220
    +
    2221 virtual _Success_(return != 0 || length == 0) size_t read(
    +
    2222 _Out_writes_bytes_to_opt_(length, return) void* data, _In_ size_t length)
    +
    2223 {
    +
    2224 assert(data || !length);
    +
    2225 if (!m_request) _Unlikely_ {
    +
    2226 m_state = state_t::fail;
    +
    2227 return 0;
    +
    2228 }
    +
    2229 for (size_t to_read = length;;) {
    +
    2230 VARIANT var_amount, var_data;
    +
    2231 V_VT(&var_amount) = VT_I4;
    +
    2232 V_I4(&var_amount) = (LONG)std::min<size_t>(to_read, LONG_MAX);
    +
    2233 V_VT(&var_data) = VT_EMPTY;
    +
    2234 HRESULT hr = [&]() {
    +
    2235 __try { return m_request->BinaryRead(&var_amount, &var_data); }
    +
    2236 __except (EXCEPTION_EXECUTE_HANDLER) { return E_FAIL; }
    +
    2237 }();
    +
    2238 if (FAILED(hr)) _Unlikely_ {
    +
    2239 m_state = to_read < length ? state_t::ok : state_t::fail;
    +
    2240 return length - to_read;
    +
    2241 }
    +
    2242 assert(V_VT(&var_amount) == VT_I4);
    +
    2243 assert(V_VT(&var_data) == (VT_ARRAY | VT_UI1));
    +
    2244 std::unique_ptr<SAFEARRAY, SafeArrayDestroy_delete> sa(V_ARRAY(&var_data));
    +
    2245 if (!V_I4(&var_amount)) _Unlikely_ {
    +
    2246 m_state = to_read < length || !length ? state_t::ok : state_t::eof;
    +
    2247 return length - to_read;
    +
    2248 }
    +
    2249 safearray_accessor<uint8_t> a(sa.get());
    +
    2250 memcpy(data, a.data(), V_I4(&var_amount));
    +
    2251 to_read -= V_I4(&var_amount);
    +
    2252 if (!to_read) {
    +
    2253 m_state = state_t::ok;
    +
    2254 return length;
    +
    2255 }
    +
    2256 reinterpret_cast<uint8_t*&>(data) += V_I4(&var_amount);
    +
    2257 }
    +
    2258 }
    +
    2259
    +
    2260 virtual _Success_(return != 0) size_t write(
    +
    2261 _In_reads_bytes_opt_(length) const void* data, _In_ size_t length)
    +
    2262 {
    +
    2263 if (!m_response) {
    +
    2264 m_state = state_t::fail;
    +
    2265 return 0;
    +
    2266 }
    +
    2267 for (size_t to_write = length;;) {
    +
    2268 UINT num_written = static_cast<UINT>(std::min<size_t>(to_write, UINT_MAX));
    +
    2269 std::unique_ptr<OLECHAR, SysFreeString_delete> bstr_data(SysAllocStringByteLen(reinterpret_cast<LPCSTR>(data), num_written));
    +
    2270 VARIANT var_data;
    +
    2271 V_VT(&var_data) = VT_BSTR;
    +
    2272 V_BSTR(&var_data) = bstr_data.get();
    +
    2273 HRESULT hr = [&]() {
    +
    2274 __try { return m_response->BinaryWrite(var_data); }
    +
    2275 __except (EXCEPTION_EXECUTE_HANDLER) { return E_FAIL; }
    +
    2276 }();
    +
    2277 if (FAILED(hr)) _Unlikely_ {
    +
    2278 m_state = state_t::fail;
    +
    2279 return length - to_write;
    +
    2280 }
    +
    2281 to_write -= num_written;
    +
    2282 if (!to_write) {
    +
    2283 m_state = state_t::ok;
    +
    2284 return length;
    +
    2285 }
    +
    2286 reinterpret_cast<const uint8_t*&>(data) += num_written;
    +
    2287 }
    +
    2288 }
    +
    2289
    +
    2290 virtual void close()
    +
    2291 {
    +
    2292 if (m_response) {
    +
    2293 __try { m_response->End(); }
    +
    2294 __except (EXCEPTION_EXECUTE_HANDLER) {}
    +
    2295 }
    +
    2296 m_state = state_t::ok;
    +
    2297 }
    +
    2298
    +
    2299 virtual void flush()
    +
    2300 {
    +
    2301 if (m_response) {
    +
    2302 HRESULT hr;
    +
    2303 __try { hr = m_response->Flush(); }
    +
    2304 __except (EXCEPTION_EXECUTE_HANDLER) { hr = E_FAIL; }
    +
    2305 m_state = SUCCEEDED(hr) ? state_t::ok : state_t::fail;
    +
    2306 }
    +
    2307 }
    +
    2308
    +
    2309 protected:
    +
    2310 IRequest* m_request;
    +
    2311 IResponse* m_response;
    +
    2312 };
    +
    2313#endif
    +
    2314#endif
    +
    2315
    +
    2319 enum mode_t
    +
    2320 {
    +
    2321 mode_for_reading = 1 << 0,
    +
    2322 mode_for_writing = 1 << 1,
    +
    2323 mode_for_chmod = 1 << 2,
    +
    2324 mode_create = 1 << 3,
    +
    2325 mode_preserve_existing = mode_create | (1 << 4),
    +
    2326 mode_append = 1 << 5,
    +
    2327 mode_text = 0,
    +
    2328 mode_binary = 1 << 6,
    +
    2329
    +
    2330 share_none = 0,
    +
    2331 share_reading = 1 << 7,
    +
    2332 share_writing = 1 << 8,
    +
    2333 share_deleting = 1 << 9,
    +
    2334 share_all = share_reading | share_writing | share_deleting, // Allow others all operations on our file
    +
    2335
    +
    2336 inherit_handle = 1 << 10,
    +
    2337
    +
    2338 hint_write_thru = 1 << 11,
    +
    2339 hint_no_buffering = 1 << 12,
    +
    2340 hint_random_access = 1 << 13,
    +
    2341 hint_sequential_access = 1 << 14,
    +
    2342 };
    +
    2343
    +
    2344#pragma warning(push)
    +
    2345#pragma warning(disable: 4250)
    +
    2349 class file : virtual public basic_file, virtual public basic_sys
    +
    2350 {
    +
    2351 public:
    +
    2352 file(_In_opt_ sys_handle h = invalid_handle, _In_ state_t state = state_t::ok) : basic_sys(h, state) {}
    +
    2353
    +
    2360 file(_In_z_ const sys_char* filename, _In_ int mode)
    +
    2361 {
    +
    2362 open(filename, mode);
    +
    2363 }
    +
    2364
    +
    2371 void open(_In_z_ const sys_char* filename, _In_ int mode)
    +
    2372 {
    +
    2373 if (m_h != invalid_handle)
    +
    2374 close();
    +
    2375
    +
    2376#ifdef _WIN32
    +
    2377 DWORD dwDesiredAccess = 0;
    +
    2378 if (mode & mode_for_reading) dwDesiredAccess |= GENERIC_READ;
    +
    2379 if (mode & mode_for_writing) dwDesiredAccess |= GENERIC_WRITE;
    +
    2380 if (mode & mode_for_chmod) dwDesiredAccess |= FILE_WRITE_ATTRIBUTES;
    +
    2381
    +
    2382 DWORD dwShareMode = 0;
    +
    2383 if (mode & share_reading) dwShareMode |= FILE_SHARE_READ;
    +
    2384 if (mode & share_writing) dwShareMode |= FILE_SHARE_WRITE;
    +
    2385 if (mode & share_deleting) dwShareMode |= FILE_SHARE_DELETE;
    +
    2386
    +
    2387 SECURITY_ATTRIBUTES sa = { sizeof(SECURITY_ATTRIBUTES) };
    +
    2388 sa.bInheritHandle = mode & inherit_handle ? true : false;
    +
    2389
    +
    2390 DWORD dwCreationDisposition;
    +
    2391 switch (mode & mode_preserve_existing) {
    +
    2392 case mode_create: dwCreationDisposition = CREATE_ALWAYS; break;
    +
    2393 case mode_preserve_existing: dwCreationDisposition = OPEN_ALWAYS; break;
    +
    2394 case 0: dwCreationDisposition = OPEN_EXISTING; break;
    +
    2395 default: throw std::invalid_argument("invalid mode");
    +
    2396 }
    +
    2397
    +
    2398 DWORD dwFlagsAndAttributes = FILE_ATTRIBUTE_NORMAL;
    +
    2399 if (mode & hint_write_thru) dwFlagsAndAttributes |= FILE_FLAG_WRITE_THROUGH;
    +
    2400 if (mode & hint_no_buffering) dwFlagsAndAttributes |= FILE_FLAG_NO_BUFFERING;
    +
    2401 if (mode & hint_random_access) dwFlagsAndAttributes |= FILE_FLAG_RANDOM_ACCESS;
    +
    2402 if (mode & hint_sequential_access) dwFlagsAndAttributes |= FILE_FLAG_SEQUENTIAL_SCAN;
    +
    2403
    +
    2404 m_h = CreateFile(filename, dwDesiredAccess, dwShareMode, &sa, dwCreationDisposition, dwFlagsAndAttributes, nullptr);
    +
    2405#else
    +
    2406 int flags = 0;
    +
    2407 if (mode & mode_for_reading) flags |= O_RDONLY;
    +
    2408 if (mode & mode_for_writing) flags |= O_WRONLY;
    +
    2409 if (mode & mode_create) flags |= mode & mode_preserve_existing ? O_CREAT : (O_CREAT | O_EXCL);
    +
    2410 if (mode & hint_write_thru) flags |= O_DSYNC;
    +
    2411 if (mode & hint_no_buffering) flags |= O_RSYNC;
    +
    2412
    +
    2413 m_h = open(filename, flags, DEFFILEMODE);
    +
    2414#endif
    +
    2415 if (m_h != invalid_handle) {
    +
    2416 m_state = state_t::ok;
    +
    2417 if (mode & mode_append)
    +
    2418 seek(0, seek_t::end);
    +
    2419 }
    +
    2420 else
    +
    2421 m_state = state_t::fail;
    +
    2422 }
    +
    2423
    +
    2424 virtual fpos_t seek(_In_ foff_t offset, _In_ seek_t how = seek_t::beg)
    +
    2425 {
    +
    2426#ifdef _WIN32
    +
    2427 LARGE_INTEGER li;
    +
    2428 li.QuadPart = offset;
    +
    2429 li.LowPart = SetFilePointer(m_h, li.LowPart, &li.HighPart, static_cast<DWORD>(how));
    +
    2430 if (li.LowPart != 0xFFFFFFFF || GetLastError() == NO_ERROR) {
    +
    2431 m_state = state_t::ok;
    +
    2432 return li.QuadPart;
    +
    2433 }
    +
    2434#else
    +
    2435 off64_t result = lseek64(m_h, offset, how);
    +
    2436 if (result >= 0) {
    +
    2437 m_state = state_t::ok;
    +
    2438 return result;
    +
    2439 }
    +
    2440#endif
    +
    2441 m_state = state_t::fail;
    +
    2442 return fpos_max;
    +
    2443 }
    +
    2444
    +
    2445 virtual fpos_t tell() const
    +
    2446 {
    +
    2447 if (m_h != invalid_handle) {
    +
    2448#ifdef _WIN32
    +
    2449 LARGE_INTEGER li;
    +
    2450 li.QuadPart = 0;
    +
    2451 li.LowPart = SetFilePointer(m_h, 0, &li.HighPart, FILE_CURRENT);
    +
    2452 if (li.LowPart != 0xFFFFFFFF || GetLastError() == NO_ERROR)
    +
    2453 return li.QuadPart;
    +
    2454#else
    +
    2455 off64_t result = lseek64(m_h, 0, SEEK_CUR);
    +
    2456 if (result >= 0)
    +
    2457 return result;
    +
    2458#endif
    +
    2459 }
    +
    2460 return fpos_max;
    +
    2461 }
    +
    2462
    +
    2463 virtual void lock(_In_ fpos_t offset, _In_ fsize_t length)
    +
    2464 {
    +
    2465#ifdef _WIN32
    +
    2466 LARGE_INTEGER liOffset;
    +
    2467 LARGE_INTEGER liSize;
    +
    2468 liOffset.QuadPart = offset;
    +
    2469 liSize.QuadPart = length;
    +
    2470 if (LockFile(m_h, liOffset.LowPart, liOffset.HighPart, liSize.LowPart, liSize.HighPart)) {
    +
    2471 m_state = state_t::ok;
    +
    2472 return;
    +
    2473 }
    +
    2474#else
    +
    2475 off64_t orig = lseek64(m_h, 0, SEEK_CUR);
    +
    2476 if (orig >= 0) {
    +
    2477 m_state = lseek64(m_h, offset, SEEK_SET) >= 0 && lockf64(m_h, F_LOCK, length) >= 0 ? state_t::ok : state_t::fail;
    +
    2478 lseek64(m_h, orig, SEEK_SET);
    +
    2479 m_state = state_t::ok;
    +
    2480 return;
    +
    2481 }
    +
    2482#endif
    +
    2483 m_state = state_t::fail;
    +
    2484 }
    +
    2485
    +
    2486 virtual void unlock(_In_ fpos_t offset, _In_ fsize_t length)
    +
    2487 {
    +
    2488#ifdef _WIN32
    +
    2489 LARGE_INTEGER liOffset;
    +
    2490 LARGE_INTEGER liSize;
    +
    2491 liOffset.QuadPart = offset;
    +
    2492 liSize.QuadPart = length;
    +
    2493 if (UnlockFile(m_h, liOffset.LowPart, liOffset.HighPart, liSize.LowPart, liSize.HighPart)) {
    +
    2494 m_state = state_t::ok;
    +
    2495 return;
    +
    2496 }
    +
    2497#else
    +
    2498 off64_t orig = lseek64(m_h, 0, SEEK_CUR);
    +
    2499 if (orig >= 0) {
    +
    2500 if (lseek64(m_h, offset, SEEK_SET) >= 0 && lockf64(m_h, F_ULOCK, length) >= 0) {
    +
    2501 lseek64(m_h, orig, SEEK_SET);
    +
    2502 m_state = state_t::ok;
    +
    2503 return;
    +
    2504 }
    +
    2505 lseek64(m_h, orig, SEEK_SET);
    +
    2506 }
    +
    2507#endif
    +
    2508 m_state = state_t::fail;
    +
    2509 }
    +
    2510
    +
    2511 virtual fsize_t size()
    +
    2512 {
    +
    2513#ifdef _WIN32
    +
    2514 LARGE_INTEGER li;
    +
    2515 li.LowPart = GetFileSize(m_h, (LPDWORD)&li.HighPart);
    +
    2516 if (li.LowPart == 0xFFFFFFFF && GetLastError() != NO_ERROR)
    +
    2517 li.QuadPart = -1;
    +
    2518 return li.QuadPart;
    +
    2519#else
    +
    2520 off64_t length = -1, orig = lseek64(m_h, 0, SEEK_CUR);
    +
    2521 if (orig >= 0) {
    +
    2522 length = lseek64(m_h, 0, SEEK_END);
    +
    2523 lseek64(m_h, orig, SEEK_SET);
    +
    2524 }
    +
    2525 return length;
    +
    2526#endif
    +
    2527 }
    +
    2528
    +
    2529 virtual void truncate()
    +
    2530 {
    +
    2531#ifdef _WIN32
    +
    2532 if (SetEndOfFile(m_h)) {
    +
    2533 m_state = state_t::ok;
    +
    2534 return;
    +
    2535 }
    +
    2536#else
    +
    2537 off64_t length = lseek64(m_h, 0, SEEK_CUR);
    +
    2538 if (length >= 0 && ftruncate64(m_h, length) >= 0) {
    +
    2539 m_state = state_t::ok;
    +
    2540 return;
    +
    2541 }
    +
    2542#endif
    +
    2543 m_state = state_t::fail;
    +
    2544 }
    +
    2545
    +
    2546#ifdef _WIN32
    +
    2547 static inline time_point ft2tp(_In_ const FILETIME& ft)
    +
    2548 {
    +
    2549#if _HAS_CXX20
    +
    2550 uint64_t t = (static_cast<int64_t>(ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
    +
    2551#else
    +
    2552 uint64_t t = ((static_cast<int64_t>(ft.dwHighDateTime) << 32) | ft.dwLowDateTime) - 116444736000000000ll;
    +
    2553#endif
    +
    2554 return time_point(time_point::duration(t));
    +
    2555 }
    +
    2556
    +
    2557 static inline void tp2ft(_In_ time_point tp, _Out_ FILETIME& ft)
    +
    2558 {
    +
    2559#if _HAS_CXX20
    +
    2560 uint64_t t = tp.time_since_epoch().count();
    +
    2561#else
    +
    2562 uint64_t t = tp.time_since_epoch().count() + 116444736000000000ll;
    +
    2563#endif
    +
    2564 ft.dwHighDateTime = static_cast<DWORD>((t >> 32) & 0xffffffff);
    +
    2565 ft.dwLowDateTime = static_cast<DWORD>(t & 0xffffffff);
    +
    2566 }
    +
    2567#endif
    +
    2568
    +
    2569 virtual time_point ctime() const
    +
    2570 {
    +
    2571#ifdef _WIN32
    +
    2572 FILETIME ft;
    +
    2573 if (GetFileTime(m_h, &ft, nullptr, nullptr))
    +
    2574 return ft2tp(ft);
    +
    2575#endif
    +
    2576 return time_point::min();
    +
    2577 }
    +
    2578
    +
    2579 virtual time_point atime() const
    +
    2580 {
    +
    2581#ifdef _WIN32
    +
    2582 FILETIME ft;
    +
    2583 if (GetFileTime(m_h, nullptr, &ft, nullptr))
    +
    2584 return ft2tp(ft);
    +
    2585#else
    +
    2586 struct stat buf;
    +
    2587 if (fstat(m_h, &buf) >= 0);
    +
    2588 return time_point::from_time_t(buf.st_atim);
    +
    2589#endif
    +
    2590 return time_point::min();
    +
    2591 }
    +
    2592
    +
    2593 virtual time_point mtime() const
    +
    2594 {
    +
    2595#ifdef _WIN32
    +
    2596 FILETIME ft;
    +
    2597 if (GetFileTime(m_h, nullptr, nullptr, &ft))
    +
    2598 return ft2tp(ft);
    +
    2599#else
    +
    2600 struct stat buf;
    +
    2601 if (fstat(m_h, &buf) >= 0)
    +
    2602 return time_point::from_time_t(buf.st_mtim);
    +
    2603#endif
    +
    2604 return time_point::min();
    +
    2605 }
    +
    2606
    +
    2607 virtual void set_ctime(time_point date)
    +
    2608 {
    +
    2609 assert(m_h != invalid_handle);
    +
    2610#ifdef _WIN32
    +
    2611 FILETIME ft;
    +
    2612 tp2ft(date, ft);
    +
    2613 if (SetFileTime(m_h, &ft, nullptr, nullptr))
    +
    2614 return;
    +
    2615#endif
    +
    2616 throw std::runtime_error("failed to set file ctime");
    +
    2617 }
    +
    2618
    +
    2619 virtual void set_atime(time_point date)
    +
    2620 {
    +
    2621 assert(m_h != invalid_handle);
    +
    2622#ifdef _WIN32
    +
    2623 FILETIME ft;
    +
    2624 tp2ft(date, ft);
    +
    2625 if (SetFileTime(m_h, nullptr, &ft, nullptr))
    +
    2626 return;
    +
    2627#else
    +
    2628 struct timespec ts[2];
    +
    2629 ts[0].tv_sec = date;
    +
    2630 ts[1].tv_nsec = UTIME_OMIT;
    +
    2631 if (futimens(m_h, ts) >= 0)
    +
    2632 return;
    +
    2633#endif
    +
    2634 throw std::runtime_error("failed to set file atime");
    +
    2635 }
    +
    2636
    +
    2637 virtual void set_mtime(time_point date)
    +
    2638 {
    +
    2639#ifdef _WIN32
    +
    2640 FILETIME ft;
    +
    2641 tp2ft(date, ft);
    +
    2642 if (SetFileTime(m_h, nullptr, nullptr, &ft))
    +
    2643 return;
    +
    2644#else
    +
    2645 struct timespec ts[2];
    +
    2646 ts[0].tv_nsec = UTIME_OMIT;
    +
    2647 ts[1].tv_sec = date;
    +
    2648 if (futimens(m_h, ts) >= 0)
    +
    2649 return;
    +
    2650#endif
    +
    2651 throw std::runtime_error("failed to set file mtime");
    +
    2652 }
    +
    2653 };
    +
    2654#pragma warning(pop)
    +
    2655
    +
    2659 class cached_file : public cache
    +
    2660 {
    +
    2661 public:
    +
    2662 cached_file(_In_opt_ sys_handle h = invalid_handle, _In_ state_t state = state_t::ok, _In_ size_t cache_size = default_cache_size) :
    +
    2663 cache(cache_size),
    +
    2664 m_source(h, state)
    +
    2665 {
    +
    2666 init(m_source);
    +
    2667 }
    +
    2668
    +
    2676 cached_file(_In_z_ const sys_char* filename, _In_ int mode, _In_ size_t cache_size = default_cache_size) :
    +
    2677 cache(cache_size),
    +
    2678 m_source(filename, mode& mode_for_writing ? mode | mode_for_reading : mode)
    +
    2679 {
    +
    2680 init(m_source);
    +
    2681 }
    +
    2682
    +
    2690 void open(_In_z_ const sys_char* filename, _In_ int mode)
    +
    2691 {
    +
    2692 if (mode & mode_for_writing) mode |= mode_for_reading;
    +
    2693 m_source.open(filename, mode);
    +
    2694 if (m_source.ok()) {
    +
    2695#if SET_FILE_OP_TIMES
    +
    2696 m_atime = m_mtime = time_point::min();
    +
    2697#endif
    +
    2698 m_offset = m_source.tell();
    +
    2699 m_state = state_t::ok;
    +
    2700 return;
    +
    2701 }
    +
    2702 m_state = state_t::fail;
    +
    2703 }
    +
    2704
    +
    2705 protected:
    +
    2706 file m_source;
    +
    2707 };
    +
    2708
    + +
    2713 {
    +
    2714 public:
    +
    2715 memory_file(_In_ state_t state = state_t::ok) :
    +
    2716 basic(state),
    +
    2717 m_data(nullptr),
    +
    2718 m_offset(0),
    +
    2719 m_size(0),
    +
    2720 m_reserved(0),
    +
    2721 m_manage(true)
    +
    2722 {
    +
    2723#if SET_FILE_OP_TIMES
    +
    2724 m_ctime = m_atime = m_mtime = time_point::now();
    +
    2725#endif
    +
    2726 }
    +
    2727
    +
    2734 memory_file(_In_ size_t size, _In_ state_t state = state_t::ok) :
    +
    2735 basic(state),
    +
    2736 m_data(reinterpret_cast<uint8_t*>(malloc(size))),
    +
    2737 m_offset(0),
    +
    2738 m_size(0),
    + +
    2740 m_manage(true)
    +
    2741 {
    +
    2742 if (!m_data)
    +
    2743 throw std::bad_alloc();
    +
    2744#if SET_FILE_OP_TIMES
    +
    2745 m_ctime = m_atime = m_mtime = time_point::now();
    +
    2746#endif
    +
    2747 }
    +
    2748
    +
    2758 memory_file(_Inout_ void* data, _In_ size_t size, _In_ size_t reserved, _In_ bool manage = false, _In_ state_t state = state_t::ok) :
    +
    2759 basic(state),
    +
    2760 m_data(reinterpret_cast<uint8_t*>(data)),
    +
    2761 m_offset(0),
    +
    2762 m_size(size),
    +
    2763 m_reserved(reserved),
    +
    2764 m_manage(manage)
    +
    2765 {
    +
    2766 assert(data || !size);
    +
    2767 assert(reserved >= size);
    +
    2768#if SET_FILE_OP_TIMES
    +
    2769 m_ctime = m_atime = m_mtime = time_point::now();
    +
    2770#endif
    +
    2771 }
    +
    2772
    +
    2781 memory_file(_Inout_ void* data, _In_ size_t size, _In_ bool manage = false, _In_ state_t state = state_t::ok) :
    +
    2782 memory_file(data, size, size, manage, state)
    +
    2783 {}
    +
    2784
    +
    2791 memory_file(_In_z_ const sys_char* filename, _In_ int mode) : memory_file()
    +
    2792 {
    +
    2793 load(filename, mode);
    +
    2794 }
    +
    2795
    +
    2796 virtual ~memory_file()
    +
    2797 {
    +
    2798 if (m_manage && m_data)
    +
    2799 free(m_data);
    +
    2800 }
    +
    2801
    +
    2808 void reserve(_In_ size_t required, _In_ bool tight = false) noexcept
    +
    2809 {
    +
    2810 if (required <= m_reserved && (!tight || required >= m_reserved)) {
    +
    2811 m_state = state_t::ok;
    +
    2812 return;
    +
    2813 }
    +
    2814 if (!m_manage) {
    +
    2815 m_state = state_t::fail;
    +
    2816 return;
    +
    2817 }
    +
    2818 size_t reserved = tight ? required : ((required + required / 4 + (default_block_size - 1)) / default_block_size) * default_block_size;
    +
    2819 auto data = reinterpret_cast<uint8_t*>(realloc(m_data, reserved));
    +
    2820 if (!data && reserved) _Unlikely_ {
    +
    2821 m_state = state_t::fail;
    +
    2822 return;
    +
    2823 }
    +
    2824 m_data = data;
    +
    2825 if (reserved < m_size)
    +
    2826 m_size = reserved;
    +
    2827 m_reserved = reserved;
    +
    2828 m_state = state_t::ok;
    +
    2829 }
    +
    2830
    +
    2837 void load(_In_z_ const sys_char* filename, _In_ int mode)
    +
    2838 {
    +
    2839 file f(filename, (mode & ~hint_random_access) | mode_for_reading | hint_sequential_access);
    +
    2840 if (!f.ok()) {
    +
    2841 m_state = state_t::fail;
    +
    2842 return;
    +
    2843 }
    +
    2844 fsize_t size = f.size();
    +
    2845 if (size > SIZE_MAX) {
    +
    2846 m_state = state_t::fail;
    +
    2847 return;
    +
    2848 }
    +
    2849 reserve(static_cast<size_t>(size), true);
    +
    2850 if (!ok()) _Unlikely_ {
    +
    2851 return;
    +
    2852 }
    +
    2853 m_offset = m_size = 0;
    +
    2854 write_stream(f);
    +
    2855 if (ok())
    +
    2856 m_offset = 0;
    +
    2857#if SET_FILE_OP_TIMES
    +
    2858 m_ctime = f.ctime();
    +
    2859 m_atime = f.atime();
    +
    2860 m_mtime = f.mtime();
    +
    2861#endif
    +
    2862 }
    +
    2863
    +
    2870 void save(_In_z_ const sys_char* filename, _In_ int mode)
    +
    2871 {
    +
    2872 file f(filename, (mode & ~hint_random_access) | mode_for_writing | hint_sequential_access);
    +
    2873 if (!f.ok()) {
    +
    2874 m_state = state_t::fail;
    +
    2875 return;
    +
    2876 }
    +
    2877 f.write(m_data, m_size);
    +
    2878 if (!f.ok()) {
    +
    2879 m_state = state_t::fail;
    +
    2880 return;
    +
    2881 }
    +
    2882 f.truncate();
    +
    2883#if SET_FILE_OP_TIMES
    +
    2884 f.set_ctime(m_ctime);
    +
    2885 f.set_atime(m_atime);
    +
    2886 f.set_mtime(m_mtime);
    +
    2887#endif
    +
    2888 }
    +
    2889
    +
    2893 inline const void* data() const { return m_data; }
    +
    2894
    +
    2895 virtual _Success_(return != 0 || length == 0) size_t read(
    +
    2896 _Out_writes_bytes_to_opt_(length, return) void* data, _In_ size_t length)
    +
    2897 {
    +
    2898 assert(data || !length);
    +
    2899#if SET_FILE_OP_TIMES
    +
    2900 m_atime = time_point::now();
    +
    2901#endif
    +
    2902 size_t available = m_size - m_offset;
    +
    2903 if (length <= available) {
    +
    2904 memcpy(data, m_data + m_offset, length);
    +
    2905 m_offset += length;
    +
    2906 m_state = state_t::ok;
    +
    2907 return length;
    +
    2908 }
    +
    2909 if (length && !available) {
    +
    2910 m_state = state_t::eof;
    +
    2911 return 0;
    +
    2912 }
    +
    2913 memcpy(data, m_data + m_offset, available);
    +
    2914 m_offset += available;
    +
    2915 m_state = state_t::ok;
    +
    2916 return available;
    +
    2917 }
    +
    2918
    +
    2933 template <class T>
    + +
    2935 {
    +
    2936#if SET_FILE_OP_TIMES
    +
    2937 m_atime = time_point::now();
    +
    2938#endif
    +
    2939 if (CHECK_STREAM_STATE && !ok()) _Unlikely_ {
    +
    2940 data = 0;
    +
    2941 return *this;
    +
    2942 }
    +
    2943 size_t end_offset = m_offset + sizeof(T);
    +
    2944 if (end_offset <= m_size) {
    +
    2945 data = LE2HE(*reinterpret_cast<T*>(m_data + m_offset));
    +
    2946 m_offset = end_offset;
    +
    2947#if !CHECK_STREAM_STATE
    +
    2948 m_state = state_t::ok;
    +
    2949#endif
    +
    2950 }
    +
    2951 else {
    +
    2952 data = 0;
    +
    2953 m_offset = m_size;
    +
    2954 m_state = state_t::eof;
    +
    2955 }
    +
    2956 return *this;
    +
    2957 }
    +
    2958
    +
    2973 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
    +
    2974 memory_file& read_str(_Inout_ std::basic_string<_Elem, _Traits, _Ax>&data)
    +
    2975 {
    +
    2976#if SET_FILE_OP_TIMES
    +
    2977 m_atime = time_point::now();
    +
    2978#endif
    +
    2979 if (CHECK_STREAM_STATE && !ok()) _Unlikely_ {
    +
    2980 data.clear();
    +
    2981 return *this;
    +
    2982 }
    +
    2983 size_t end_offset = m_offset + sizeof(uint32_t);
    +
    2984 if (end_offset <= m_size) {
    +
    2985 uint32_t num_chars = LE2HE(*reinterpret_cast<uint32_t*>(m_data + m_offset));
    +
    2986 m_offset = end_offset;
    +
    2987 end_offset = stdex::add(m_offset + stdex::mul(num_chars, sizeof(_Elem)));
    +
    2988 _Elem* start = reinterpret_cast<_Elem*>(m_data + m_offset);
    +
    2989 if (end_offset <= m_size) {
    +
    2990 data.assign(start, start + num_chars);
    +
    2991 m_offset = end_offset;
    +
    2992#if !CHECK_STREAM_STATE
    +
    2993 m_state = state_t::ok;
    +
    2994#endif
    +
    2995 return *this;
    +
    2996 }
    +
    2997 if (end_offset <= m_size)
    +
    2998 data.assign(start, reinterpret_cast<_Elem*>(m_data + m_size));
    +
    2999 }
    +
    3000 m_offset = m_size;
    +
    3001 m_state = state_t::eof;
    +
    3002 return *this;
    +
    3003 }
    +
    3004
    +
    3005 virtual _Success_(return != 0) size_t write(
    +
    3006 _In_reads_bytes_opt_(length) const void* data, _In_ size_t length)
    +
    3007 {
    +
    3008 assert(data || !length);
    +
    3009#if SET_FILE_OP_TIMES
    +
    3010 m_atime = m_mtime = time_point::now();
    +
    3011#endif
    +
    3012 size_t end_offset = m_offset + length;
    +
    3013 if (end_offset > m_reserved) {
    +
    3014 reserve(end_offset);
    +
    3015 if (!ok()) _Unlikely_
    +
    3016 return 0;
    +
    3017 }
    +
    3018 memcpy(m_data + m_offset, data, length);
    +
    3019 m_offset = end_offset;
    +
    3020 if (m_offset > m_size)
    +
    3021 m_size = m_offset;
    +
    3022 m_state = state_t::ok;
    +
    3023 return length;
    +
    3024 }
    +
    3025
    +
    3029 void write_byte(_In_ uint8_t byte, _In_ size_t amount = 1)
    +
    3030 {
    +
    3031#if SET_FILE_OP_TIMES
    +
    3032 m_atime = m_mtime = time_point::now();
    +
    3033#endif
    +
    3034 size_t end_offset = m_offset + amount;
    +
    3035 if (end_offset > m_reserved) {
    +
    3036 reserve(end_offset);
    +
    3037 if (!ok()) _Unlikely_
    +
    3038 return;
    +
    3039 }
    +
    3040 memset(m_data + m_offset, byte, amount);
    +
    3041 m_offset = end_offset;
    +
    3042 if (m_offset > m_size)
    +
    3043 m_size = m_offset;
    +
    3044 m_state = state_t::ok;
    +
    3045 }
    +
    3046
    +
    3061 template <class T>
    +
    3062 inline memory_file& write_data(const T data)
    +
    3063 {
    +
    3064#if SET_FILE_OP_TIMES
    +
    3065 m_atime = m_mtime = time_point::now();
    +
    3066#endif
    +
    3067 if (CHECK_STREAM_STATE && !ok()) _Unlikely_
    +
    3068 return *this;
    +
    3069 size_t end_offset = m_offset + sizeof(T);
    +
    3070 if (end_offset > m_reserved) {
    +
    3071 reserve(end_offset);
    +
    3072 if (!ok()) _Unlikely_
    +
    3073 return *this;
    +
    3074 }
    +
    3075 (*reinterpret_cast<T*>(m_data + m_offset)) = HE2LE(data);
    +
    3076 m_offset = end_offset;
    +
    3077 if (m_offset > m_size)
    +
    3078 m_size = m_offset;
    +
    3079#if !CHECK_STREAM_STATE
    +
    3080 m_state = state_t::ok;
    +
    3081#endif
    +
    3082 return *this;
    +
    3083 }
    +
    3084
    +
    3099 template <class T>
    +
    3100 inline memory_file& write_str(_In_z_ const T * data)
    +
    3101 {
    +
    3102#if SET_FILE_OP_TIMES
    +
    3103 m_atime = m_mtime = time_point::now();
    +
    3104#endif
    +
    3105 if (CHECK_STREAM_STATE && !ok()) _Unlikely_
    +
    3106 return *this;
    +
    3107 size_t num_chars = stdex::strlen(data);
    +
    3108 if (num_chars > UINT32_MAX)
    +
    3109 throw std::invalid_argument("string too long");
    +
    3110 size_t size_chars = num_chars * sizeof(T);
    +
    3111 size_t size = sizeof(uint32_t) + size_chars;
    +
    3112 size_t end_offset = m_offset + size;
    +
    3113 if (end_offset > m_reserved) {
    +
    3114 reserve(end_offset);
    +
    3115 if (!ok()) _Unlikely_
    +
    3116 return *this;
    +
    3117 }
    +
    3118 auto p = tok.m_podatki + m_offset;
    +
    3119 *reinterpret_cast<uint32_t*>(p) = HE2LE((uint32_t)num_chars);
    +
    3120 memcpy(p + sizeof(uint32_t), data, size_chars);
    +
    3121 m_offset = end_offset;
    +
    3122 if (m_offset > m_size)
    +
    3123 m_size = m_offset;
    +
    3124#if !CHECK_STREAM_STATE
    +
    3125 m_state = state_t::ok;
    +
    3126#endif
    +
    3127 return *this;
    +
    3128 }
    +
    3129
    +
    3135 size_t write_stream(_Inout_ basic & stream, _In_ size_t amount = SIZE_MAX)
    +
    3136 {
    +
    3137#if SET_FILE_OP_TIMES
    +
    3138 m_atime = m_mtime = time_point::now();
    +
    3139#endif
    +
    3140 size_t num_read, dst_offset = m_offset, dst_size = m_offset;
    +
    3141 size_t num_copied = 0, to_write = amount;
    +
    3142 m_state = state_t::ok;
    +
    3143 if (amount != SIZE_MAX) {
    +
    3144 dst_size = stdex::add(dst_size, amount);
    +
    3145 reserve(dst_size);
    +
    3146 if (!ok()) _Unlikely_
    +
    3147 return 0;
    +
    3148 while (to_write) {
    +
    3149 num_read = stream.read(m_data + dst_offset, to_write);
    +
    3150 dst_size = dst_offset += num_read;
    +
    3151 num_copied += num_read;
    +
    3152 to_write -= num_read;
    +
    3153 if (!stream.ok()) {
    +
    3154 if (stream.state() != state_t::eof)
    +
    3155 m_state = state_t::fail;
    +
    3156 break;
    +
    3157 }
    +
    3158 };
    +
    3159 }
    +
    3160 else {
    +
    3161 size_t block_size;
    +
    3162 while (to_write) {
    +
    3163 block_size = std::min(to_write, default_block_size);
    +
    3164 dst_size = stdex::add(dst_size, block_size);
    +
    3165 reserve(dst_size);
    +
    3166 if (!ok()) _Unlikely_
    +
    3167 break;
    +
    3168 num_read = stream.read(m_data + dst_offset, block_size);
    +
    3169 dst_size = dst_offset += num_read;
    +
    3170 num_copied += num_read;
    +
    3171 to_write -= num_read;
    +
    3172 if (!stream.ok()) {
    +
    3173 if (stream.state() != state_t::eof)
    +
    3174 m_state = state_t::fail;
    +
    3175 break;
    +
    3176 }
    +
    3177 };
    +
    3178 }
    +
    3179 m_offset = dst_offset;
    +
    3180 if (m_offset > m_size)
    +
    3181 m_size = m_offset;
    +
    3182 return num_copied;
    +
    3183 }
    +
    3184
    +
    3185 virtual void close()
    +
    3186 {
    +
    3187 if (m_manage && m_data)
    +
    3188 free(m_data);
    +
    3189 m_data = nullptr;
    +
    3190 m_manage = true;
    +
    3191 m_offset = 0;
    +
    3192 m_size = m_reserved = 0;
    +
    3193#if SET_FILE_OP_TIMES
    +
    3194 m_ctime = m_atime = m_mtime = time_point::min();
    +
    3195#endif
    +
    3196 m_state = state_t::ok;
    +
    3197 }
    +
    3198
    +
    3199 virtual fpos_t seek(_In_ foff_t offset, _In_ seek_t how = seek_t::beg)
    +
    3200 {
    +
    3201 fpos_t target;
    +
    3202 switch (how) {
    +
    3203 case seek_t::beg: target = offset; break;
    +
    3204 case seek_t::cur: target = static_cast<fpos_t>(m_offset) + offset; break;
    +
    3205 case seek_t::end: target = static_cast<fpos_t>(m_size) + offset; break;
    +
    3206 default: throw std::invalid_argument("unknown seek origin");
    +
    3207 }
    +
    3208 if (target <= SIZE_MAX) {
    +
    3209 m_state = state_t::ok;
    +
    3210 return m_offset = static_cast<size_t>(target);
    +
    3211 }
    +
    3212 m_state = state_t::fail;
    +
    3213 return fpos_max;
    +
    3214 }
    +
    3215
    +
    3216 virtual fpos_t tell() const
    +
    3217 {
    +
    3218 return m_offset;
    +
    3219 }
    +
    3220
    +
    3221 virtual fsize_t size()
    +
    3222 {
    +
    3223 return m_size;
    +
    3224 }
    +
    3225
    +
    3226 virtual void truncate()
    +
    3227 {
    +
    3228#if SET_FILE_OP_TIMES
    +
    3229 m_atime = m_mtime = time_point::now();
    +
    3230#endif
    +
    3231 m_size = m_offset;
    + +
    3233 }
    +
    3234
    +
    3235#if SET_FILE_OP_TIMES
    +
    3236 virtual time_point ctime() const
    +
    3237 {
    +
    3238 return m_ctime;
    +
    3239 }
    +
    3240
    +
    3241 virtual time_point atime() const
    +
    3242 {
    +
    3243 return m_atime;
    +
    3244 }
    +
    3245
    +
    3246 virtual time_point mtime() const
    +
    3247 {
    +
    3248 return m_mtime;
    +
    3249 }
    +
    3250
    +
    3251 virtual void set_ctime(time_point date)
    +
    3252 {
    +
    3253 m_ctime = date;
    +
    3254 }
    +
    3255
    +
    3256 virtual void set_atime(time_point date)
    +
    3257 {
    +
    3258 m_atime = date;
    +
    3259 }
    +
    3260
    +
    3261 virtual void set_mtime(time_point date)
    +
    3262 {
    +
    3263 m_mtime = date;
    +
    3264 }
    +
    3265#endif
    +
    3266
    +
    3267 protected:
    +
    3275 template <class T>
    +
    3276 inline void set(_In_ fpos_t offset, _In_ const T data)
    +
    3277 {
    +
    3278#if SET_FILE_OP_TIMES
    +
    3279 m_atime = m_mtime = time_point::now();
    +
    3280#endif
    +
    3281 assert(offset + sizeof(T) < m_size);
    +
    3282 (*reinterpret_cast<T*>(m_data + offset)) = HE2LE(data);
    +
    3283 }
    +
    3284
    +
    3285 public:
    +
    3286 inline void set(_In_ fpos_t offset, _In_ const int8_t data) { set<int8_t>(offset, data); }
    +
    3287 inline void set(_In_ fpos_t offset, _In_ const int16_t data) { set<int16_t>(offset, data); }
    +
    3288 inline void set(_In_ fpos_t offset, _In_ const int32_t data) { set<int32_t>(offset, data); }
    +
    3289 inline void set(_In_ fpos_t offset, _In_ const int64_t data) { set<int64_t>(offset, data); }
    +
    3290 inline void set(_In_ fpos_t offset, _In_ const uint8_t data) { set<uint8_t>(offset, data); }
    +
    3291 inline void set(_In_ fpos_t offset, _In_ const uint16_t data) { set<uint16_t>(offset, data); }
    +
    3292 inline void set(_In_ fpos_t offset, _In_ const uint32_t data) { set<uint32_t>(offset, data); }
    +
    3293 inline void set(_In_ fpos_t offset, _In_ const uint64_t data) { set<uint64_t>(offset, data); }
    +
    3294#ifdef _NATIVE_SIZE_T_DEFINED
    +
    3295 inline void set(_In_ fpos_t offset, _In_ const size_t data) { set<size_t>(offset, data); }
    +
    3296#endif
    +
    3297 inline void set(_In_ fpos_t offset, _In_ const float data) { set<float>(offset, data); }
    +
    3298 inline void set(_In_ fpos_t offset, _In_ const double data) { set<double>(offset, data); }
    +
    3299 inline void set(_In_ fpos_t offset, _In_ const char data) { set<char>(offset, data); }
    +
    3300#ifdef _NATIVE_WCHAR_T_DEFINED
    +
    3301 inline void set(_In_ fpos_t offset, _In_ const wchar_t data) { set<wchar_t>(offset, data); }
    +
    3302#endif
    +
    3303
    +
    3311 protected:
    +
    3312 template <class T>
    +
    3313 inline void get(_In_ fpos_t offset, _Out_ T & data)
    +
    3314 {
    +
    3315 assert(offset + sizeof(T) < m_size);
    +
    3316 data = LE2HE(*(T*)(m_data + offset));
    +
    3317#if SET_FILE_OP_TIMES
    +
    3318 m_atime = time_point::now();
    +
    3319#endif
    +
    3320 }
    +
    3321
    +
    3322 public:
    +
    3323 inline void get(_In_ fpos_t offset, _Out_ int8_t & data) { get<int8_t>(offset, data); }
    +
    3324 inline void get(_In_ fpos_t offset, _Out_ int16_t & data) { get<int16_t>(offset, data); }
    +
    3325 inline void get(_In_ fpos_t offset, _Out_ int32_t & data) { get<int32_t>(offset, data); }
    +
    3326 inline void get(_In_ fpos_t offset, _Out_ int64_t & data) { get<int64_t>(offset, data); }
    +
    3327 inline void get(_In_ fpos_t offset, _Out_ uint8_t & data) { get<uint8_t>(offset, data); }
    +
    3328 inline void get(_In_ fpos_t offset, _Out_ uint16_t & data) { get<uint16_t>(offset, data); }
    +
    3329 inline void get(_In_ fpos_t offset, _Out_ uint32_t & data) { get<uint32_t>(offset, data); }
    +
    3330 inline void get(_In_ fpos_t offset, _Out_ uint64_t & data) { get<uint64_t>(offset, data); }
    +
    3331#ifdef _NATIVE_SIZE_T_DEFINED
    +
    3332 inline void get(_In_ fpos_t offset, _Out_ size_t & data) { get<size_t>(offset, data); }
    +
    3333#endif
    +
    3334 inline void get(_In_ fpos_t offset, _Out_ float& data) { get<float>(offset, data); }
    +
    3335 inline void get(_In_ fpos_t offset, _Out_ double& data) { get<double>(offset, data); }
    +
    3336 inline void get(_In_ fpos_t offset, _Out_ char& data) { get<char>(offset, data); }
    +
    3337#ifdef _NATIVE_WCHAR_T_DEFINED
    +
    3338 inline void get(_In_ fpos_t offset, _Out_ wchar_t& data) { get<wchar_t>(offset, data); }
    +
    3339#endif
    +
    3340
    +
    3341 inline memory_file& operator <<(_In_ const int8_t data) { return write_data(data); }
    +
    3342 inline memory_file& operator >>(_Out_ int8_t & data) { return read_data(data); }
    +
    3343 inline memory_file& operator <<(_In_ const int16_t data) { return write_data(data); }
    +
    3344 inline memory_file& operator >>(_Out_ int16_t & data) { return read_data(data); }
    +
    3345 inline memory_file& operator <<(_In_ const int32_t data) { return write_data(data); }
    +
    3346 inline memory_file& operator >>(_Out_ int32_t & data) { return read_data(data); }
    +
    3347 inline memory_file& operator <<(_In_ const int64_t data) { return write_data(data); }
    +
    3348 inline memory_file& operator >>(_Out_ int64_t & data) { return read_data(data); }
    +
    3349 inline memory_file& operator <<(_In_ const uint8_t data) { return write_data(data); }
    +
    3350 inline memory_file& operator >>(_Out_ uint8_t & data) { return read_data(data); }
    +
    3351 inline memory_file& operator <<(_In_ const uint16_t data) { return write_data(data); }
    +
    3352 inline memory_file& operator >>(_Out_ uint16_t & data) { return read_data(data); }
    +
    3353 inline memory_file& operator <<(_In_ const uint32_t data) { return write_data(data); }
    +
    3354 inline memory_file& operator >>(_Out_ uint32_t & data) { return read_data(data); }
    +
    3355 inline memory_file& operator <<(_In_ const uint64_t data) { return write_data(data); }
    +
    3356 inline memory_file& operator >>(_Out_ uint64_t & data) { return read_data(data); }
    +
    3357#ifdef _NATIVE_SIZE_T_DEFINED
    +
    3358 inline memory_file& operator <<(_In_ const size_t data) { return write_data(data); }
    +
    3359 inline memory_file& operator >>(_Out_ size_t & data) { return read_data(data); }
    +
    3360#endif
    +
    3361 inline memory_file& operator <<(_In_ const float data) { return write_data(data); }
    +
    3362 inline memory_file& operator >>(_Out_ float& data) { return read_data(data); }
    +
    3363 inline memory_file& operator <<(_In_ const double data) { return write_data(data); }
    +
    3364 inline memory_file& operator >>(_Out_ double& data) { return read_data(data); }
    +
    3365 inline memory_file& operator <<(_In_ const char data) { return write_data(data); }
    +
    3366 inline memory_file& operator >>(_Out_ char& data) { return read_data(data); }
    +
    3367#ifdef _NATIVE_WCHAR_T_DEFINED
    +
    3368 inline memory_file& operator <<(_In_ const wchar_t data) { return write_data(data); }
    +
    3369 inline memory_file& operator >>(_Out_ wchar_t& data) { return read_data(data); }
    +
    3370#endif
    +
    3371 template <class T>
    +
    3372 inline memory_file& operator <<(_In_ const T * data) { return write_str(data); }
    +
    3373 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
    +
    3374 inline memory_file& operator >>(_Inout_ std::basic_string<_Elem, _Traits, _Ax>&data) { return read_str(data); }
    +
    3375
    +
    3376 protected:
    +
    3377 uint8_t* m_data;
    + +
    3379 size_t m_offset;
    +
    3380 size_t m_size;
    +
    3381 size_t m_reserved;
    +
    3382#if SET_FILE_OP_TIMES
    +
    3383 time_point
    +
    3384 m_ctime,
    +
    3385 m_atime,
    +
    3386 m_mtime;
    +
    3387#endif
    +
    3388 };
    +
    3389
    +
    3393 class fifo : public basic {
    +
    3394 public:
    +
    3395 fifo() :
    +
    3396 m_offset(0),
    +
    3397 m_size(0),
    +
    3398 m_head(nullptr),
    +
    3399 m_tail(nullptr)
    +
    3400 {}
    +
    3401
    +
    3402 virtual ~fifo()
    +
    3403 {
    +
    3404 while (m_head) {
    +
    3405 auto p = m_head;
    +
    3406 m_head = p->next;
    +
    3407 delete p;
    +
    3408 }
    +
    3409 }
    +
    3410
    +
    3411#pragma warning(suppress: 6101) // See [2] below
    +
    3412 virtual _Success_(return != 0 || length == 0) size_t read(
    +
    3413 _Out_writes_bytes_to_opt_(length, return) void* data, _In_ size_t length)
    +
    3414 {
    +
    3415 assert(data || !length);
    +
    3416 for (size_t to_read = length;;) {
    +
    3417 if (!m_head) _Unlikely_ {
    +
    3418 // [1] Code analysis misses length - to_read bytes were written to data in previous loop iterations.
    +
    3419 m_state = to_read < length || !length ? state_t::ok : state_t::eof;
    +
    3420 return length - to_read;
    +
    3421 }
    +
    3422 size_t remaining = m_head->size - m_offset;
    +
    3423 if (remaining > to_read) {
    +
    3424 memcpy(data, m_head->data + m_offset, to_read);
    +
    3425 m_offset += to_read;
    +
    3426 m_size -= to_read;
    +
    3427 m_state = state_t::ok;
    +
    3428 return length;
    +
    3429 }
    +
    3430 memcpy(data, m_head->data + m_offset, remaining);
    +
    3431 m_offset = 0;
    +
    3432 m_size -= remaining;
    +
    3433 reinterpret_cast<uint8_t*&>(data) += remaining;
    +
    3434 to_read -= remaining;
    +
    3435 auto p = m_head;
    +
    3436 m_head = p->next;
    +
    3437 delete p;
    +
    3438 }
    +
    3439 }
    +
    3440
    +
    3441 virtual _Success_(return != 0) size_t write(
    +
    3442 _In_reads_bytes_opt_(length) const void* data, _In_ size_t length)
    +
    3443 {
    +
    3444 assert(data || !length);
    +
    3445 try {
    +
    3446 std::unique_ptr<node_t> n(reinterpret_cast<node_t*>(new uint8_t[sizeof(node_t) + length]));
    +
    3447 n->next = nullptr;
    +
    3448 n->size = length;
    +
    3449 memcpy(n->data, data, length);
    +
    3450 m_size += length;
    +
    3451 if (m_head)
    +
    3452 m_tail = m_tail->next = n.release();
    +
    3453 else
    +
    3454 m_head = m_tail = n.release();
    +
    3455 m_state = state_t::ok;
    +
    3456 return length;
    +
    3457 }
    +
    3458 catch (std::bad_alloc) {
    +
    3459 m_state = state_t::fail;
    +
    3460 return 0;
    +
    3461 }
    +
    3462 }
    +
    3463
    +
    3464 virtual void close()
    +
    3465 {
    +
    3466 m_size = m_offset = 0;
    +
    3467 while (m_head) {
    +
    3468 auto p = m_head;
    +
    3469 m_head = p->next;
    +
    3470 delete p;
    +
    3471 }
    +
    3472 m_state = state_t::ok;
    +
    3473 }
    +
    3474
    +
    3478 inline size_t size() const { return m_size; };
    +
    3479
    +
    3480 protected:
    +
    3481 size_t m_offset, m_size;
    +
    3482 struct node_t {
    +
    3483 node_t* next;
    +
    3484 size_t size;
    +
    3485#pragma warning(suppress:4200)
    +
    3486 uint8_t data[0];
    +
    3487 } *m_head, * m_tail;
    +
    3488 };
    +
    3489
    +
    3493 class diag_file : public basic_file {
    +
    3494 public:
    +
    3495 diag_file(_In_count_(num_files) basic_file* const* files, _In_ size_t num_files) :
    +
    3496 basic(num_files ? files[0]->state() : state_t::fail),
    +
    3497 m_files(files, files + num_files)
    +
    3498 {
    +
    3499 }
    +
    3500
    +
    3501 virtual _Success_(return != 0 || length == 0) size_t read(
    +
    3502 _Out_writes_bytes_to_opt_(length, return) void* data, _In_ size_t length)
    +
    3503 {
    +
    3504 assert(data || !length);
    +
    3505 if (m_files.empty()) {
    +
    3506 m_state = state_t::fail;
    +
    3507 return 0;
    +
    3508 }
    +
    3509 size_t result = m_files[0]->read(data, length);
    +
    3510 _Analysis_assume_(result <= length);
    +
    3511 m_state = m_files[0]->state();
    +
    3512 if (length > m_tmp.size())
    +
    3513 m_tmp.resize(length);
    +
    3514 for (size_t i = 1, n = m_files.size(); i < n; ++i) {
    +
    3515 if (m_files[i]->read(m_tmp.data(), length) != result ||
    +
    3516 memcmp(m_tmp.data(), data, result))
    +
    3517 throw std::runtime_error("read mismatch");
    +
    3518 if (m_files[i]->state() != m_state)
    +
    3519 throw std::runtime_error("state mismatch");
    +
    3520 }
    +
    3521 return result;
    +
    3522 }
    +
    3523
    +
    3524 virtual _Success_(return != 0) size_t write(
    +
    3525 _In_reads_bytes_opt_(length) const void* data, _In_ size_t length)
    +
    3526 {
    +
    3527 if (m_files.empty()) {
    +
    3528 m_state = state_t::fail;
    +
    3529 return 0;
    +
    3530 }
    +
    3531 size_t result = m_files[0]->write(data, length);
    +
    3532 m_state = m_files[0]->state();
    +
    3533 for (size_t i = 1, n = m_files.size(); i < n; ++i) {
    +
    3534 if (m_files[i]->write(data, length) != result)
    +
    3535 throw std::runtime_error("write mismatch");
    +
    3536 if (m_files[i]->state() != m_state)
    +
    3537 throw std::runtime_error("state mismatch");
    +
    3538 }
    +
    3539 return result;
    +
    3540 }
    +
    3541
    +
    3542 virtual void flush()
    +
    3543 {
    +
    3544 if (m_files.empty()) {
    +
    3545 m_state = state_t::ok;
    +
    3546 return;
    +
    3547 }
    +
    3548 m_files[0]->flush();
    +
    3549 m_state = m_files[0]->state();
    +
    3550 for (size_t i = 1, n = m_files.size(); i < n; ++i) {
    +
    3551 m_files[i]->flush();
    +
    3552 if (m_files[i]->state() != m_state)
    +
    3553 throw std::runtime_error("state mismatch");
    +
    3554 }
    +
    3555 }
    +
    3556
    +
    3557 virtual void close()
    +
    3558 {
    +
    3559 if (m_files.empty()) {
    +
    3560 m_state = state_t::ok;
    +
    3561 return;
    +
    3562 }
    +
    3563 m_files[0]->close();
    +
    3564 m_state = m_files[0]->state();
    +
    3565 for (size_t i = 1, n = m_files.size(); i < n; ++i) {
    +
    3566 m_files[i]->close();
    +
    3567 if (m_files[i]->state() != m_state)
    +
    3568 throw std::runtime_error("state mismatch");
    +
    3569 }
    +
    3570 m_tmp.clear();
    +
    3571 m_tmp.shrink_to_fit();
    +
    3572 }
    +
    3573
    +
    3574 virtual fpos_t seek(_In_ foff_t offset, _In_ seek_t how = seek_t::beg)
    +
    3575 {
    +
    3576 if (m_files.empty()) {
    +
    3577 m_state = state_t::fail;
    +
    3578 return fpos_max;
    +
    3579 }
    +
    3580 fpos_t result = m_files[0]->seek(offset, how);
    +
    3581 m_state = m_files[0]->state();
    +
    3582 for (size_t i = 1, n = m_files.size(); i < n; ++i) {
    +
    3583 if (m_files[i]->seek(offset, how) != result)
    +
    3584 throw std::runtime_error("seek mismatch");
    +
    3585 if (m_files[i]->state() != m_state)
    +
    3586 throw std::runtime_error("state mismatch");
    +
    3587 }
    +
    3588 return result;
    +
    3589 }
    +
    3590
    +
    3591 virtual fpos_t tell() const
    +
    3592 {
    +
    3593 if (m_files.empty())
    +
    3594 return fpos_max;
    +
    3595 fpos_t result = m_files[0]->tell();
    +
    3596 for (size_t i = 1, n = m_files.size(); i < n; ++i) {
    +
    3597 if (m_files[i]->tell() != result)
    +
    3598 throw std::runtime_error("tell mismatch");
    +
    3599 }
    +
    3600 return result;
    +
    3601 }
    +
    3602
    +
    3603 virtual void lock(_In_ fpos_t offset, _In_ fsize_t length)
    +
    3604 {
    +
    3605 if (m_files.empty())
    +
    3606 m_state = state_t::fail;
    +
    3607 m_files[0]->lock(offset, length);
    +
    3608 m_state = m_files[0]->state();
    +
    3609 for (size_t i = 1, n = m_files.size(); i < n; ++i) {
    +
    3610 m_files[i]->lock(offset, length);
    +
    3611 if (m_files[i]->state() != m_state)
    +
    3612 throw std::runtime_error("state mismatch");
    +
    3613 }
    +
    3614 }
    +
    3615
    +
    3616 virtual void unlock(_In_ fpos_t offset, _In_ fsize_t length)
    +
    3617 {
    +
    3618 if (m_files.empty())
    +
    3619 m_state = state_t::fail;
    +
    3620 m_files[0]->unlock(offset, length);
    +
    3621 m_state = m_files[0]->state();
    +
    3622 for (size_t i = 1, n = m_files.size(); i < n; ++i) {
    +
    3623 m_files[i]->unlock(offset, length);
    +
    3624 if (m_files[i]->state() != m_state)
    +
    3625 throw std::runtime_error("state mismatch");
    +
    3626 }
    +
    3627 }
    +
    3628
    +
    3629 virtual fsize_t size()
    +
    3630 {
    +
    3631 if (m_files.empty()) {
    +
    3632 m_state = state_t::fail;
    +
    3633 return 0;
    +
    3634 }
    +
    3635 fsize_t result = m_files[0]->size();
    +
    3636 m_state = m_files[0]->state();
    +
    3637 for (size_t i = 1, n = m_files.size(); i < n; ++i) {
    +
    3638 if (m_files[i]->size() != result)
    +
    3639 throw std::runtime_error("size mismatch");
    +
    3640 if (m_files[i]->state() != m_state)
    +
    3641 throw std::runtime_error("state mismatch");
    +
    3642 }
    +
    3643 return result;
    +
    3644 }
    +
    3645
    +
    3646 virtual void truncate()
    +
    3647 {
    +
    3648 if (m_files.empty())
    +
    3649 m_state = state_t::fail;
    +
    3650 m_files[0]->truncate();
    +
    3651 m_state = m_files[0]->state();
    +
    3652 for (size_t i = 1, n = m_files.size(); i < n; ++i) {
    +
    3653 m_files[i]->truncate();
    +
    3654 if (m_files[i]->state() != m_state)
    +
    3655 throw std::runtime_error("state mismatch");
    +
    3656 }
    +
    3657 }
    +
    3658
    +
    3659 protected:
    +
    3660 std::vector<basic_file*> m_files;
    +
    3661 std::vector<uint8_t> m_tmp;
    +
    3662 };
    +
    3663 }
    +
    3664}
    +
    Provides read-ahead stream capability.
    Definition stream.hpp:1070
    +
    virtual size_t read(_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
    Reads block of data from the stream.
    Definition stream.hpp:1084
    +
    Provides write-back stream capability.
    Definition stream.hpp:1138
    +
    virtual void flush()
    Persists volatile element data.
    Definition stream.hpp:1175
    +
    virtual size_t write(_In_reads_bytes_opt_(length) const void *data, size_t length)
    Writes block of data to the stream.
    Definition stream.hpp:1151
    +
    Basic seekable stream operations.
    Definition stream.hpp:654
    +
    virtual void skip(fsize_t amount)
    Skips given amount of bytes of data on the stream.
    Definition stream.hpp:697
    +
    virtual time_point ctime() const
    Returns file creation time.
    Definition stream.hpp:744
    +
    virtual void lock(fpos_t offset, fsize_t length)
    Locks file section for exclusive access.
    Definition stream.hpp:713
    +
    virtual void truncate()=0
    Sets file size - truncates the remainder of file content from the current file position to the end of...
    +
    charset_id read_charset(charset_id default_charset=charset_id::default)
    Attempts to detect textfile charset based on UTF16 or UTF8 BOM.
    Definition stream.hpp:817
    +
    fpos_t seekbeg(fpos_t offset)
    Seeks to absolute file position.
    Definition stream.hpp:681
    +
    virtual std::vector< uint8_t > read_remainder(size_t max_length=SIZE_MAX)
    Reads and returns remainder of the stream.
    Definition stream.hpp:656
    +
    virtual void set_mtime(time_point date)
    Sets file modification time.
    Definition stream.hpp:786
    +
    fpos_t seekcur(foff_t offset)
    Seeks to relative from current file position.
    Definition stream.hpp:688
    +
    virtual time_point atime() const
    Returns file access time.
    Definition stream.hpp:752
    +
    virtual void set_ctime(time_point date)
    Sets file create time.
    Definition stream.hpp:768
    +
    virtual fsize_t size()=0
    Returns file size Should the file size cannot be determined, the method returns fsize_max and it does...
    +
    virtual void unlock(fpos_t offset, fsize_t length)
    Unlocks file section for exclusive access.
    Definition stream.hpp:723
    +
    virtual fpos_t tell() const =0
    Returns absolute file position in file or fpos_max if fails. This method does not update stream state...
    +
    virtual time_point mtime() const
    Returns file modification time.
    Definition stream.hpp:760
    +
    fpos_t seekend(foff_t offset)
    Seeks to relative from end file position.
    Definition stream.hpp:695
    +
    virtual void set_atime(time_point date)
    Sets file access time.
    Definition stream.hpp:777
    +
    virtual fpos_t seek(foff_t offset, seek_t how=seek_t::beg)=0
    Seeks to specified relative file position.
    +
    OS data stream (file, pipe, socket...)
    Definition stream.hpp:1982
    +
    virtual size_t write(_In_reads_bytes_opt_(length) const void *data, size_t length)
    Writes block of data to the stream.
    Definition stream.hpp:2040
    +
    virtual void flush()
    Persists volatile element data.
    Definition stream.hpp:2098
    +
    virtual size_t read(_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
    Reads block of data from the stream.
    Definition stream.hpp:1989
    +
    virtual void close()
    Closes the stream.
    Definition stream.hpp:2087
    +
    ‍UTF-8 byte-order-mark
    Definition stream.hpp:71
    +
    bool ok() const
    Returns true if the stream state is clean i.e. previous operation was succesful.
    Definition stream.hpp:165
    +
    size_t write_vsprintf(_Printf_format_string_params_(2) const char *format, locale_t locale, va_list params)
    Writes formatted string to the stream.
    Definition stream.hpp:555
    +
    size_t write_array(_In_reads_or_z_opt_(num_chars) const wchar_t *wstr, size_t num_chars, charset_id charset)
    Writes array of characters to the stream.
    Definition stream.hpp:405
    +
    state_t state() const
    Returns stream state after last operation.
    Definition stream.hpp:160
    +
    basic & read_str(std::basic_string< _Elem, _Traits, _Ax > &data)
    Reads length-prefixed string from the stream.
    Definition stream.hpp:429
    +
    size_t write_sprintf(_Printf_format_string_params_(2) const wchar_t *format, locale_t locale,...)
    Writes formatted string to the stream.
    Definition stream.hpp:541
    +
    size_t write_vsprintf(_Printf_format_string_params_(2) const wchar_t *format, locale_t locale, va_list params)
    Writes formatted string to the stream.
    Definition stream.hpp:568
    +
    virtual void flush()
    Persists volatile element data.
    Definition stream.hpp:116
    +
    virtual void skip(fsize_t amount)
    Skips given amount of bytes of data on the stream.
    Definition stream.hpp:132
    +
    virtual void close()
    Closes the stream.
    Definition stream.hpp:124
    +
    uint8_t read_byte()
    Reads one byte of data.
    Definition stream.hpp:200
    +
    virtual std::vector< uint8_t > read_remainder(size_t max_length=SIZE_MAX)
    Reads and returns remainder of the stream.
    Definition stream.hpp:174
    +
    size_t write_sprintf(_Printf_format_string_params_(2) const char *format, locale_t locale,...)
    Writes formatted string to the stream.
    Definition stream.hpp:527
    +
    size_t readln_and_attach(std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)
    Reads stream to the end-of-line or end-of-file and append to str.
    Definition stream.hpp:358
    +
    size_t readln(std::basic_string< char, _Traits, _Ax > &str)
    Reads stream to the end-of-line or end-of-file.
    Definition stream.hpp:296
    +
    size_t readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)
    Reads stream to the end-of-line or end-of-file and append to str.
    Definition stream.hpp:337
    +
    size_t read_array(_Out_writes_bytes_(size *count) void *array, size_t size, size_t count)
    Reads an array of data from the stream.
    Definition stream.hpp:373
    +
    basic & write_str(const T *data)
    Writes string to the stream length-prefixed.
    Definition stream.hpp:454
    +
    virtual size_t read(_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
    Reads block of data from the stream.
    Definition stream.hpp:86
    +
    size_t readln(std::basic_string< wchar_t, _Traits, _Ax > &wstr)
    Reads stream to the end-of-line or end-of-file.
    Definition stream.hpp:308
    +
    void write_charset(charset_id charset)
    Writes UTF8 or UTF-16 byte-order-mark.
    Definition stream.hpp:514
    +
    size_t readln(std::basic_string< wchar_t, _Traits, _Ax > &wstr, charset_id charset)
    Reads stream to the end-of-line or end-of-file.
    Definition stream.hpp:320
    +
    basic & write_data(const T data)
    Writes one primitive data type.
    Definition stream.hpp:277
    +
    fsize_t write_stream(basic &stream, fsize_t amount=fsize_max)
    Writes content of another stream.
    Definition stream.hpp:489
    +
    virtual size_t write(_In_reads_bytes_opt_(length) const void *data, size_t length)
    Writes block of data to the stream.
    Definition stream.hpp:104
    +
    size_t write_array(_In_reads_bytes_opt_(size *count) const void *array, size_t size, size_t count)
    Writes an array of data to the stream.
    Definition stream.hpp:391
    +
    void write_byte(uint8_t byte, fsize_t amount=1)
    Writes a byte of data.
    Definition stream.hpp:211
    +
    basic & read_data(T &data)
    Reads one primitive data type.
    Definition stream.hpp:249
    +
    Buffered read/write stream.
    Definition stream.hpp:1209
    +
    virtual void flush()
    Persists volatile element data.
    Definition stream.hpp:1312
    +
    virtual size_t read(_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
    Reads block of data from the stream.
    Definition stream.hpp:1230
    +
    virtual size_t write(_In_reads_bytes_opt_(length) const void *data, size_t length)
    Writes block of data to the stream.
    Definition stream.hpp:1266
    +
    Buffered OS data stream (file, pipe, socket...)
    Definition stream.hpp:2112
    +
    Cached file.
    Definition stream.hpp:1629
    +
    virtual time_point ctime() const
    Returns file creation time.
    Definition stream.hpp:1861
    +
    fpos_t m_offset
    Logical absolute file position.
    Definition stream.hpp:1970
    +
    virtual void truncate()
    Sets file size - truncates the remainder of file content from the current file position to the end of...
    Definition stream.hpp:1839
    +
    virtual size_t read(_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
    Reads block of data from the stream.
    Definition stream.hpp:1669
    +
    virtual time_point atime() const
    Returns file access time.
    Definition stream.hpp:1866
    +
    virtual fsize_t size()
    Returns file size Should the file size cannot be determined, the method returns fsize_max and it does...
    Definition stream.hpp:1834
    +
    virtual void unlock(fpos_t offset, fsize_t length)
    Unlocks file section for exclusive access.
    Definition stream.hpp:1828
    +
    virtual time_point mtime() const
    Returns file modification time.
    Definition stream.hpp:1875
    +
    virtual void close()
    Closes the stream.
    Definition stream.hpp:1784
    +
    virtual void set_mtime(time_point date)
    Sets file modification time.
    Definition stream.hpp:1897
    +
    virtual void lock(fpos_t offset, fsize_t length)
    Locks file section for exclusive access.
    Definition stream.hpp:1822
    +
    virtual void flush()
    Persists volatile element data.
    Definition stream.hpp:1791
    +
    virtual size_t write(_In_reads_bytes_opt_(length) const void *data, size_t length)
    Writes block of data to the stream.
    Definition stream.hpp:1731
    +
    virtual void set_ctime(time_point date)
    Sets file create time.
    Definition stream.hpp:1884
    +
    virtual fpos_t tell() const
    Returns absolute file position in file or fpos_max if fails. This method does not update stream state...
    Definition stream.hpp:1817
    +
    virtual void set_atime(time_point date)
    Sets file access time.
    Definition stream.hpp:1889
    +
    virtual fpos_t seek(foff_t offset, seek_t how=seek_t::beg)
    Seeks to specified relative file position.
    Definition stream.hpp:1802
    +
    Cached file-system file.
    Definition stream.hpp:2660
    +
    cached_file(const sys_char *filename, int mode, size_t cache_size=default_cache_size)
    Opens file.
    Definition stream.hpp:2676
    +
    void open(const sys_char *filename, int mode)
    Opens file.
    Definition stream.hpp:2690
    +
    Modifies data on the fly when reading from/writing to a source stream.
    Definition stream.hpp:847
    +
    virtual void flush()
    Persists volatile element data.
    Definition stream.hpp:888
    +
    virtual void close()
    Closes the stream.
    Definition stream.hpp:882
    +
    virtual size_t read(_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
    Reads block of data from the stream.
    Definition stream.hpp:866
    +
    virtual size_t write(_In_reads_bytes_opt_(length) const void *data, size_t length)
    Writes block of data to the stream.
    Definition stream.hpp:874
    +
    Compares multiple files to perform the same.
    Definition stream.hpp:3493
    +
    virtual fsize_t size()
    Returns file size Should the file size cannot be determined, the method returns fsize_max and it does...
    Definition stream.hpp:3629
    +
    virtual void truncate()
    Sets file size - truncates the remainder of file content from the current file position to the end of...
    Definition stream.hpp:3646
    +
    virtual size_t write(_In_reads_bytes_opt_(length) const void *data, size_t length)
    Writes block of data to the stream.
    Definition stream.hpp:3524
    +
    virtual void close()
    Closes the stream.
    Definition stream.hpp:3557
    +
    virtual void lock(fpos_t offset, fsize_t length)
    Locks file section for exclusive access.
    Definition stream.hpp:3603
    +
    virtual void unlock(fpos_t offset, fsize_t length)
    Unlocks file section for exclusive access.
    Definition stream.hpp:3616
    +
    virtual fpos_t seek(foff_t offset, seek_t how=seek_t::beg)
    Seeks to specified relative file position.
    Definition stream.hpp:3574
    +
    virtual fpos_t tell() const
    Returns absolute file position in file or fpos_max if fails. This method does not update stream state...
    Definition stream.hpp:3591
    +
    virtual void flush()
    Persists volatile element data.
    Definition stream.hpp:3542
    +
    virtual size_t read(_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
    Reads block of data from the stream.
    Definition stream.hpp:3501
    +
    In-memory FIFO queue.
    Definition stream.hpp:3393
    +
    virtual void close()
    Closes the stream.
    Definition stream.hpp:3464
    +
    virtual size_t write(_In_reads_bytes_opt_(length) const void *data, size_t length)
    Writes block of data to the stream.
    Definition stream.hpp:3441
    +
    size_t size() const
    Returns total size of pending data in the queue.
    Definition stream.hpp:3478
    +
    virtual size_t read(_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
    Reads block of data from the stream.
    Definition stream.hpp:3412
    +
    Limits file reading/writing to a predefined window.
    Definition stream.hpp:1519
    +
    virtual void truncate()
    Sets file size - truncates the remainder of file content from the current file position to the end of...
    Definition stream.hpp:1612
    +
    virtual void flush()
    Persists volatile element data.
    Definition stream.hpp:1562
    +
    virtual void skip(fsize_t amount)
    Skips given amount of bytes of data on the stream.
    Definition stream.hpp:1575
    +
    virtual fpos_t seek(foff_t offset, seek_t how=seek_t::beg)
    Seeks to specified relative file position.
    Definition stream.hpp:1568
    +
    virtual fsize_t size()
    Returns file size Should the file size cannot be determined, the method returns fsize_max and it does...
    Definition stream.hpp:1607
    +
    virtual size_t write(_In_reads_bytes_opt_(length) const void *data, size_t length)
    Writes block of data to the stream.
    Definition stream.hpp:1542
    +
    virtual void lock(fpos_t offset, fsize_t length)
    Locks file section for exclusive access.
    Definition stream.hpp:1587
    +
    virtual size_t read(_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
    Reads block of data from the stream.
    Definition stream.hpp:1528
    +
    virtual void unlock(fpos_t offset, fsize_t length)
    Unlocks file section for exclusive access.
    Definition stream.hpp:1597
    +
    virtual fpos_t tell() const
    Returns absolute file position in file or fpos_max if fails. This method does not update stream state...
    Definition stream.hpp:1581
    +
    virtual void close()
    Closes the stream.
    Definition stream.hpp:1556
    +
    File-system file.
    Definition stream.hpp:2350
    +
    virtual time_point mtime() const
    Returns file modification time.
    Definition stream.hpp:2593
    +
    virtual void unlock(fpos_t offset, fsize_t length)
    Unlocks file section for exclusive access.
    Definition stream.hpp:2486
    +
    file(const sys_char *filename, int mode)
    Opens file.
    Definition stream.hpp:2360
    +
    virtual void set_ctime(time_point date)
    Sets file create time.
    Definition stream.hpp:2607
    +
    virtual time_point atime() const
    Returns file access time.
    Definition stream.hpp:2579
    +
    virtual void set_mtime(time_point date)
    Sets file modification time.
    Definition stream.hpp:2637
    +
    virtual void set_atime(time_point date)
    Sets file access time.
    Definition stream.hpp:2619
    +
    void open(const sys_char *filename, int mode)
    Opens file.
    Definition stream.hpp:2371
    +
    virtual void lock(fpos_t offset, fsize_t length)
    Locks file section for exclusive access.
    Definition stream.hpp:2463
    +
    virtual void truncate()
    Sets file size - truncates the remainder of file content from the current file position to the end of...
    Definition stream.hpp:2529
    +
    virtual time_point ctime() const
    Returns file creation time.
    Definition stream.hpp:2569
    +
    virtual fsize_t size()
    Returns file size Should the file size cannot be determined, the method returns fsize_max and it does...
    Definition stream.hpp:2511
    +
    virtual fpos_t seek(foff_t offset, seek_t how=seek_t::beg)
    Seeks to specified relative file position.
    Definition stream.hpp:2424
    +
    virtual fpos_t tell() const
    Returns absolute file position in file or fpos_max if fails. This method does not update stream state...
    Definition stream.hpp:2445
    +
    Limits reading from/writing to stream to a predefined number of bytes.
    Definition stream.hpp:1360
    +
    fsize_t read_limit
    Number of bytes left that may be read from the stream.
    Definition stream.hpp:1420
    +
    virtual size_t read(_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
    Reads block of data from the stream.
    Definition stream.hpp:1368
    +
    virtual size_t write(_In_reads_bytes_opt_(length) const void *data, size_t length)
    Writes block of data to the stream.
    Definition stream.hpp:1393
    +
    fsize_t write_limit
    Number of bytes left, that can be written to the stream.
    Definition stream.hpp:1421
    +
    In-memory file.
    Definition stream.hpp:2713
    +
    void load(const sys_char *filename, int mode)
    Loads content from a file-system file.
    Definition stream.hpp:2837
    +
    size_t m_size
    file size
    Definition stream.hpp:3380
    +
    void get(fpos_t offset, T &data)
    Reads data from specified file location This does not move file pointer. It checks for data size asse...
    Definition stream.hpp:3313
    +
    size_t write_stream(basic &stream, size_t amount=SIZE_MAX)
    Writes content of another stream.
    Definition stream.hpp:3135
    +
    uint8_t * m_data
    file data
    Definition stream.hpp:3377
    +
    memory_file & read_data(T &data)
    Reads one primitive data type.
    Definition stream.hpp:2934
    +
    virtual void close()
    Closes the stream.
    Definition stream.hpp:3185
    +
    virtual size_t read(_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
    Reads block of data from the stream.
    Definition stream.hpp:2895
    +
    virtual fpos_t tell() const
    Returns absolute file position in file or fpos_max if fails. This method does not update stream state...
    Definition stream.hpp:3216
    +
    size_t m_reserved
    reserved file size
    Definition stream.hpp:3381
    +
    memory_file(size_t size, state_t state=state_t::ok)
    Creates an empty file of reserved size.
    Definition stream.hpp:2734
    +
    void reserve(size_t required, bool tight=false) noexcept
    Reallocates memory.
    Definition stream.hpp:2808
    +
    memory_file & read_str(std::basic_string< _Elem, _Traits, _Ax > &data)
    Reads length-prefixed string from the stream.
    Definition stream.hpp:2974
    +
    void write_byte(uint8_t byte, size_t amount=1)
    Writes a byte of data.
    Definition stream.hpp:3029
    +
    void set(fpos_t offset, const T data)
    Writes data to specified file location This does not move file pointer nor update file size....
    Definition stream.hpp:3276
    +
    size_t m_offset
    file pointer
    Definition stream.hpp:3379
    +
    memory_file(const sys_char *filename, int mode)
    Loads content from file-system file.
    Definition stream.hpp:2791
    +
    virtual fsize_t size()
    Returns file size Should the file size cannot be determined, the method returns fsize_max and it does...
    Definition stream.hpp:3221
    +
    virtual fpos_t seek(foff_t offset, seek_t how=seek_t::beg)
    Seeks to specified relative file position.
    Definition stream.hpp:3199
    +
    virtual void truncate()
    Sets file size - truncates the remainder of file content from the current file position to the end of...
    Definition stream.hpp:3226
    +
    memory_file & write_data(const T data)
    Writes one primitive data type.
    Definition stream.hpp:3062
    +
    memory_file & write_str(const T *data)
    Writes string to the stream length-prefixed.
    Definition stream.hpp:3100
    +
    bool m_manage
    may reallocate m_data?
    Definition stream.hpp:3378
    +
    memory_file(void *data, size_t size, bool manage=false, state_t state=state_t::ok)
    Creates a file based on available data.
    Definition stream.hpp:2781
    +
    virtual size_t write(_In_reads_bytes_opt_(length) const void *data, size_t length)
    Writes block of data to the stream.
    Definition stream.hpp:3005
    +
    void save(const sys_char *filename, int mode)
    Saves content to a file-system file.
    Definition stream.hpp:2870
    +
    memory_file(void *data, size_t size, size_t reserved, bool manage=false, state_t state=state_t::ok)
    Creates a file based on available data.
    Definition stream.hpp:2758
    +
    const void * data() const
    Returns pointer to data.
    Definition stream.hpp:2893
    +
    Definition stream.hpp:985
    +
    enum stdex::stream::replicator::worker::op_t op
    Operation to perform.
    +
    size_t num_written
    Number of bytes written.
    Definition stream.hpp:1032
    +
    size_t length
    Byte limit of data to write.
    Definition stream.hpp:1031
    +
    const void * data
    Data to write.
    Definition stream.hpp:1030
    +
    Replicates writing of the same data to multiple streams.
    Definition stream.hpp:902
    +
    void push_back(basic *source)
    Adds stream on the list.
    Definition stream.hpp:921
    +
    virtual void flush()
    Persists volatile element data.
    Definition stream.hpp:978
    +
    void remove(basic *source)
    Removes stream from the list.
    Definition stream.hpp:929
    +
    virtual size_t write(_In_reads_bytes_opt_(length) const void *data, size_t length)
    Writes block of data to the stream.
    Definition stream.hpp:946
    +
    virtual void close()
    Closes the stream.
    Definition stream.hpp:973
    +
    Limits reading from/writing to stream to a predefined window.
    Definition stream.hpp:1428
    +
    fpos_t write_offset
    Number of bytes to discard on write.
    Definition stream.hpp:1512
    +
    virtual size_t write(_In_reads_bytes_opt_(length) const void *data, size_t length)
    Writes block of data to the stream.
    Definition stream.hpp:1469
    +
    virtual size_t read(_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
    Reads block of data from the stream.
    Definition stream.hpp:1436
    +
    fpos_t read_offset
    Number of bytes to skip on read.
    Definition stream.hpp:1511
    +
    Operating system object (file, pipe, anything with an OS handle etc.)
    Definition system.hpp:57
    +
    virtual void close()
    Closes object.
    Definition system.hpp:98
    +
    Numerical interval.
    Definition interval.hpp:18
    +
    bool contains(T x) const
    Is value in interval?
    Definition interval.hpp:88
    +
    bool empty() const
    Is interval empty?
    Definition interval.hpp:54
    +
    T size() const
    Returns interval size.
    Definition interval.hpp:47
    +
    T end
    interval end
    Definition interval.hpp:20
    +
    T start
    interval start
    Definition interval.hpp:19
    +
    Definition stream.hpp:1337
    +
    Definition stream.hpp:1948
    +
    interval< fpos_t > region
    valid data region
    Definition stream.hpp:1956
    +
    Definition stream.hpp:3482
    +
    + + + + diff --git a/string_8hpp_source.html b/string_8hpp_source.html index 684def263..b72b2d63d 100644 --- a/string_8hpp_source.html +++ b/string_8hpp_source.html @@ -569,7 +569,7 @@ $(function() {
    714 (flags & 0x01) ? -value : value;
    715
    716 case 2:
    -
    717 value = (T_bin)strtoint<T, T_U2>(str, count, end, radix, flags);
    +
    717 value = (T_bin)strtoint<T, uint16_t>(str, count, end, radix, flags);
    718 if ((flags & 0x01) && (value & 0x8000)) {
    719 // Sign bit is 1 => overflow.
    720 flags |= 0x02;
    @@ -798,7 +798,7 @@ $(function() { diff --git a/structstdex_1_1chrono_1_1aosn__clock-members.html b/structstdex_1_1chrono_1_1aosn__clock-members.html index 594445c3c..162b0535b 100644 --- a/structstdex_1_1chrono_1_1aosn__clock-members.html +++ b/structstdex_1_1chrono_1_1aosn__clock-members.html @@ -105,7 +105,7 @@ $(function() { diff --git a/structstdex_1_1chrono_1_1aosn__clock.html b/structstdex_1_1chrono_1_1aosn__clock.html index 0ff519415..75a303ea1 100644 --- a/structstdex_1_1chrono_1_1aosn__clock.html +++ b/structstdex_1_1chrono_1_1aosn__clock.html @@ -165,7 +165,7 @@ static constexpr rep week< diff --git a/structstdex_1_1getter.html b/structstdex_1_1getter.html deleted file mode 100644 index 67da931f4..000000000 --- a/structstdex_1_1getter.html +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - - -stdex: stdex::getter< _Type, _Class > Struct Template Reference - - - - - - - - - -
    -
    - - - - - - -
    -
    stdex -
    -
    Additional custom or not Standard C++ covered algorithms
    -
    -
    - - - - - - - - -
    -
    - - -
    -
    -
    -
    -
    -
    Loading...
    -
    Searching...
    -
    No Matches
    -
    -
    -
    -
    - - -
    -
    - -
    stdex::getter< _Type, _Class > Struct Template Reference
    -
    -
    - -

    Helper template to allow access to internal std C++ private members. - More...

    - -

    #include <stdex/internal.hpp>

    - - - - -

    -Public Types

    -typedef _Type _Class::* type
     
    - - - -

    -Friends

    -type get (getter< _Type, _Class >)
     
    -

    Detailed Description

    -
    template<typename _Type, typename _Class>
    -struct stdex::getter< _Type, _Class >

    Helper template to allow access to internal std C++ private members.

    -
    See also
    http://bloglitb.blogspot.com/2011/12/access-to-private-members-safer.html
    -

    The documentation for this struct was generated from the following file: -
    - - - - diff --git a/structstdex_1_1interval-members.html b/structstdex_1_1interval-members.html index 235f628b3..d1e0831d8 100644 --- a/structstdex_1_1interval-members.html +++ b/structstdex_1_1interval-members.html @@ -80,20 +80,21 @@ $(function() {

    This is the complete list of members for stdex::interval< T >, including all inherited members.

    - - - - - - - - - - + + + + + + + + + + +
    empty() conststdex::interval< T >inline
    endstdex::interval< T >
    interval() noexceptstdex::interval< T >inline
    interval(T x) noexceptstdex::interval< T >inline
    interval(T _start, T _end) noexceptstdex::interval< T >inline
    operator bool() conststdex::interval< T >inline
    operator!=(const interval &other) conststdex::interval< T >inline
    operator==(const interval &other) conststdex::interval< T >inline
    size() conststdex::interval< T >inline
    startstdex::interval< T >
    contains(T x) conststdex::interval< T >inline
    empty() conststdex::interval< T >inline
    endstdex::interval< T >
    interval() noexceptstdex::interval< T >inline
    interval(T x) noexceptstdex::interval< T >inline
    interval(T _start, T _end) noexceptstdex::interval< T >inline
    operator bool() conststdex::interval< T >inline
    operator!=(const interval &other) conststdex::interval< T >inline
    operator==(const interval &other) conststdex::interval< T >inline
    size() conststdex::interval< T >inline
    startstdex::interval< T >
    diff --git a/structstdex_1_1interval.html b/structstdex_1_1interval.html index 9329af0a6..d065f6f0a 100644 --- a/structstdex_1_1interval.html +++ b/structstdex_1_1interval.html @@ -114,6 +114,9 @@ Public Member Functions bool operator!= (const interval &other) const  Are intervals different?
      +bool contains (T x) const + Is value in interval?
    +  @@ -214,6 +217,43 @@ template<class T >

    Member Function Documentation

    + +

    ◆ contains()

    + +
    +
    +
    +template<class T >
    +

    Public Attributes

    + + + + +
    + + + + + + + + +
    bool stdex::interval< T >::contains (x) const
    +
    +inline
    +
    + +

    Is value in interval?

    +
    Parameters
    + + +
    [in]xValue to test
    +
    +
    +
    Returns
    true if x is in [start, end) or false otherwise
    + +
    +

    ◆ empty()

    @@ -384,7 +424,7 @@ template<class T > diff --git a/structstdex_1_1mapping-members.html b/structstdex_1_1mapping-members.html index 32d4e2faa..abcb844bd 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 75d86f158..462ce6d35 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 69afb5831..67ac7fc8d 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 cd9033dff..93a925525 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 823af45dc..6b8668164 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 eadea268b..cf8ce2669 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 473e192ba..8a6cc73f6 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 6df6e13e9..73f523d60 100644 --- a/structstdex_1_1parser_1_1http__factor__more.html +++ b/structstdex_1_1parser_1_1http__factor__more.html @@ -93,7 +93,7 @@ constexpr bool operator()< diff --git a/classstdex_1_1basic__diagstream-members.html b/structstdex_1_1stream_1_1buffer_1_1buffer__t-members.html similarity index 52% rename from classstdex_1_1basic__diagstream-members.html rename to structstdex_1_1stream_1_1buffer_1_1buffer__t-members.html index 72f3026e1..a4f77b1d4 100644 --- a/classstdex_1_1basic__diagstream-members.html +++ b/structstdex_1_1stream_1_1buffer_1_1buffer__t-members.html @@ -70,24 +70,26 @@ $(function() {
    -
    stdex::basic_diagstream< _Elem, _Traits > Member List
    +
    stdex::stream::buffer::buffer_t Member List
    -

    This is the complete list of members for stdex::basic_diagstream< _Elem, _Traits >, including all inherited members.

    +

    This is the complete list of members for stdex::stream::buffer::buffer_t, including all inherited members.

    - - - - + + + + + +
    basic_diagstream(const _Iter first, const _Iter last) (defined in stdex::basic_diagstream< _Elem, _Traits >)stdex::basic_diagstream< _Elem, _Traits >inline
    basic_diagstream(guest_stream *const *streams, size_t count) (defined in stdex::basic_diagstream< _Elem, _Traits >)stdex::basic_diagstream< _Elem, _Traits >inline
    guest_stream typedef (defined in stdex::basic_diagstream< _Elem, _Traits >)stdex::basic_diagstream< _Elem, _Traits >
    m_buf (defined in stdex::basic_diagstream< _Elem, _Traits >)stdex::basic_diagstream< _Elem, _Traits >protected
    buffer_t(size_t buffer_size) (defined in stdex::stream::buffer::buffer_t)stdex::stream::buffer::buffer_tinline
    capacity (defined in stdex::stream::buffer::buffer_t)stdex::stream::buffer::buffer_t
    data (defined in stdex::stream::buffer::buffer_t)stdex::stream::buffer::buffer_t
    head (defined in stdex::stream::buffer::buffer_t)stdex::stream::buffer::buffer_t
    tail (defined in stdex::stream::buffer::buffer_t)stdex::stream::buffer::buffer_t
    ~buffer_t() (defined in stdex::stream::buffer::buffer_t)stdex::stream::buffer::buffer_tinline
    diff --git a/classstdex_1_1basic__isharedstrstream.html b/structstdex_1_1stream_1_1buffer_1_1buffer__t.html similarity index 55% rename from classstdex_1_1basic__isharedstrstream.html rename to structstdex_1_1stream_1_1buffer_1_1buffer__t.html index 298cd1cd6..3b5b71610 100644 --- a/classstdex_1_1basic__isharedstrstream.html +++ b/structstdex_1_1stream_1_1buffer_1_1buffer__t.html @@ -5,7 +5,7 @@ -stdex: stdex::basic_isharedstrstream< _Elem, _Traits > Class Template Reference +stdex: stdex::stream::buffer::buffer_t Struct Reference @@ -70,43 +70,46 @@ $(function() {
    -
    stdex::basic_isharedstrstream< _Elem, _Traits > Class Template Reference
    +Public Attributes | +List of all members
    +
    stdex::stream::buffer::buffer_t Struct Reference
    -
    -Inheritance diagram for stdex::basic_isharedstrstream< _Elem, _Traits >:
    -
    -
    - -
    - - + +

    Public Member Functions

    basic_isharedstrstream (const _Elem *data, size_t size)
     
    buffer_t (size_t buffer_size)
     
    - - - + + + + + + + + +

    -Protected Attributes

    -basic_sharedstrbuf< _Elem, _Traits > m_buf
     

    +Public Attributes

    +uint8_t * data
     
    +size_t head
     
    +size_t tail
     
    +size_t capacity
     
    -
    The documentation for this class was generated from the following file:
      -
    • include/stdex/ios.hpp
    • +
      The documentation for this struct was generated from the following file:
    diff --git a/classstdex_1_1basic__sharedstrbuf-members.html b/structstdex_1_1stream_1_1cache_1_1cache__t-members.html similarity index 50% rename from classstdex_1_1basic__sharedstrbuf-members.html rename to structstdex_1_1stream_1_1cache_1_1cache__t-members.html index 80803829c..8b864626f 100644 --- a/classstdex_1_1basic__sharedstrbuf-members.html +++ b/structstdex_1_1stream_1_1cache_1_1cache__t-members.html @@ -70,25 +70,27 @@ $(function() {
    -
    stdex::basic_sharedstrbuf< _Elem, _Traits > Member List
    +
    stdex::stream::cache::cache_t Member List
    -

    This is the complete list of members for stdex::basic_sharedstrbuf< _Elem, _Traits >, including all inherited members.

    +

    This is the complete list of members for stdex::stream::cache::cache_t, including all inherited members.

    - - - - - + + + + + + +
    basic_sharedstrbuf(const _Elem *data, size_t size) (defined in stdex::basic_sharedstrbuf< _Elem, _Traits >)stdex::basic_sharedstrbuf< _Elem, _Traits >inline
    basic_sharedstrbuf(const basic_sharedstrbuf< _Elem, _Traits > &other) (defined in stdex::basic_sharedstrbuf< _Elem, _Traits >)stdex::basic_sharedstrbuf< _Elem, _Traits >inline
    operator=(const basic_sharedstrbuf< _Elem, _Traits > &other) (defined in stdex::basic_sharedstrbuf< _Elem, _Traits >)stdex::basic_sharedstrbuf< _Elem, _Traits >inline
    seekoff(off_type off, std::ios_base::seekdir way, std::ios_base::openmode which=std::ios_base::in|std::ios_base::out) (defined in stdex::basic_sharedstrbuf< _Elem, _Traits >)stdex::basic_sharedstrbuf< _Elem, _Traits >inlineprotectedvirtual
    seekpos(pos_type pos, std::ios_base::openmode which=std::ios_base::in|std::ios_base::out) (defined in stdex::basic_sharedstrbuf< _Elem, _Traits >)stdex::basic_sharedstrbuf< _Elem, _Traits >inlineprotectedvirtual
    cache_t(size_t _capacity) (defined in stdex::stream::cache::cache_t)stdex::stream::cache::cache_tinline
    capacity (defined in stdex::stream::cache::cache_t)stdex::stream::cache::cache_t
    data (defined in stdex::stream::cache::cache_t)stdex::stream::cache::cache_t
    regionstdex::stream::cache::cache_t
    status (defined in stdex::stream::cache::cache_t)stdex::stream::cache::cache_t
    status_t enum name (defined in stdex::stream::cache::cache_t)stdex::stream::cache::cache_t
    ~cache_t() (defined in stdex::stream::cache::cache_t)stdex::stream::cache::cache_tinline
    diff --git a/classstdex_1_1basic__diagstream.html b/structstdex_1_1stream_1_1cache_1_1cache__t.html similarity index 52% rename from classstdex_1_1basic__diagstream.html rename to structstdex_1_1stream_1_1cache_1_1cache__t.html index f356d59f1..9619bd61d 100644 --- a/classstdex_1_1basic__diagstream.html +++ b/structstdex_1_1stream_1_1cache_1_1cache__t.html @@ -5,7 +5,7 @@ -stdex: stdex::basic_diagstream< _Elem, _Traits > Class Template Reference +stdex: stdex::stream::cache::cache_t Struct Reference @@ -70,63 +70,56 @@ $(function() {
    -
    stdex::basic_diagstream< _Elem, _Traits > Class Template Reference
    +Public Attributes | +List of all members
    +
    stdex::stream::cache::cache_t Struct Reference
    - -

    Diagnostic input/output stream. - More...

    - -

    #include <stdex/ios.hpp>

    -
    -Inheritance diagram for stdex::basic_diagstream< _Elem, _Traits >:
    -
    -
    - -
    - - + +

    Public Types

    -using guest_stream = std::basic_iostream< _Elem, _Traits >
     
    enum class  status_t { empty = 0 +, loaded +, dirty + }
     
    - - - - - + +

    Public Member Functions

    -template<typename _Iter >
     basic_diagstream (const _Iter first, const _Iter last)
     
    basic_diagstream (guest_stream *const *streams, size_t count)
     
    cache_t (size_t _capacity)
     
    - - - + + + + + + + + + +

    -Protected Attributes

    -basic_diagstreambuf< _Elem, _Traits > m_buf
     

    +Public Attributes

    +uint8_t * data
     
    +size_t capacity
     
    +enum stdex::stream::cache::cache_t::status_t status
     
    +interval< fpos_t > region
     valid data region
     
    -

    Detailed Description

    -
    template<class _Elem, class _Traits>
    -class stdex::basic_diagstream< _Elem, _Traits >

    Diagnostic input/output stream.

    -

    Verifies multiple input streams read the same data. Writes to multiple output streams the same data.

    -

    The documentation for this class was generated from the following file:
      -
    • include/stdex/ios.hpp
    • +
      The documentation for this struct was generated from the following file:
    diff --git a/classstdex_1_1basic__isharedstrstream-members.html b/structstdex_1_1stream_1_1fifo_1_1node__t-members.html similarity index 66% rename from classstdex_1_1basic__isharedstrstream-members.html rename to structstdex_1_1stream_1_1fifo_1_1node__t-members.html index d9f1aeed8..e1706d6f9 100644 --- a/classstdex_1_1basic__isharedstrstream-members.html +++ b/structstdex_1_1stream_1_1fifo_1_1node__t-members.html @@ -70,22 +70,23 @@ $(function() {
    -
    stdex::basic_isharedstrstream< _Elem, _Traits > Member List
    +
    stdex::stream::fifo::node_t Member List
    -

    This is the complete list of members for stdex::basic_isharedstrstream< _Elem, _Traits >, including all inherited members.

    +

    This is the complete list of members for stdex::stream::fifo::node_t, including all inherited members.

    - - + + +
    basic_isharedstrstream(const _Elem *data, size_t size) (defined in stdex::basic_isharedstrstream< _Elem, _Traits >)stdex::basic_isharedstrstream< _Elem, _Traits >inline
    m_buf (defined in stdex::basic_isharedstrstream< _Elem, _Traits >)stdex::basic_isharedstrstream< _Elem, _Traits >protected
    data (defined in stdex::stream::fifo::node_t)stdex::stream::fifo::node_t
    next (defined in stdex::stream::fifo::node_t)stdex::stream::fifo::node_t
    size (defined in stdex::stream::fifo::node_t)stdex::stream::fifo::node_t
    diff --git a/structstdex_1_1robber.html b/structstdex_1_1stream_1_1fifo_1_1node__t.html similarity index 60% rename from structstdex_1_1robber.html rename to structstdex_1_1stream_1_1fifo_1_1node__t.html index bd282bc53..67c5a709e 100644 --- a/structstdex_1_1robber.html +++ b/structstdex_1_1stream_1_1fifo_1_1node__t.html @@ -5,7 +5,7 @@ -stdex: stdex::robber< _Tag, _Member > Struct Template Reference +stdex: stdex::stream::fifo::node_t Struct Reference @@ -70,39 +70,36 @@ $(function() {
    -
    stdex::robber< _Tag, _Member > Struct Template Reference
    +Public Attributes | +List of all members
    +
    stdex::stream::fifo::node_t Struct Reference
    - -

    Helper template to allow access to internal std C++ private members. - More...

    - -

    #include <stdex/internal.hpp>

    - - - + + + + + + +

    -Friends

    -_Tag::type get (_Tag)
     

    +Public Attributes

    +node_tnext
     
    +size_t size
     
    +uint8_t data [0]
     
    -

    Detailed Description

    -
    template<typename _Tag, typename _Tag::type _Member>
    -struct stdex::robber< _Tag, _Member >

    Helper template to allow access to internal std C++ private members.

    -
    See also
    http://bloglitb.blogspot.com/2011/12/access-to-private-members-safer.html
    -

    The documentation for this struct was generated from the following file:
      -
    • include/stdex/internal.hpp
    • +
      The documentation for this struct was generated from the following file:
    diff --git a/system_8hpp_source.html b/system_8hpp_source.html new file mode 100644 index 000000000..b7d2f3371 --- /dev/null +++ b/system_8hpp_source.html @@ -0,0 +1,259 @@ + + + + + + + +stdex: include/stdex/system.hpp Source File + + + + + + + + + +
    +
    + + + + + + +
    +
    stdex +
    +
    Additional custom or not Standard C++ covered algorithms
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + + +
    +
    +
    system.hpp
    +
    +
    +
    1/*
    +
    2 SPDX-License-Identifier: MIT
    +
    3 Copyright © 2023 Amebis
    +
    4*/
    +
    5
    +
    6#pragma once
    +
    7
    +
    8#ifdef _WIN32
    +
    9#define NOMINMAX // Collides with std::min/max
    +
    10#include <windows.h>
    +
    11#include <intsafe.h>
    +
    12#include <tchar.h>
    +
    13#else
    +
    14#include <unistd.h>
    +
    15#endif
    +
    16#include "sal.hpp"
    +
    17#include <assert.h>
    +
    18#include <stdexcept>
    +
    19
    +
    20// In case somebody #included <windows.h> before us and didn't #define NOMINMAX
    +
    21#ifdef _WIN32
    +
    22#ifdef min
    +
    23#undef min
    +
    24#endif
    +
    25#ifdef max
    +
    26#undef max
    +
    27#endif
    +
    28#endif
    +
    29
    +
    30namespace stdex
    +
    31{
    +
    35#if defined(_WIN32)
    +
    36 using sys_handle = HANDLE;
    +
    37 const sys_handle invalid_handle = INVALID_HANDLE_VALUE;
    +
    38#else
    +
    39 using sys_handle = int;
    +
    40 const sys_handle invalid_handle = (sys_handle)-1;
    +
    41#endif
    +
    42
    +
    46#if defined(_WIN32)
    +
    47 using sys_char = TCHAR;
    +
    48#else
    +
    49 using sys_char = char;
    +
    50#define _T(x) x
    +
    51#endif
    +
    52
    + +
    57 {
    +
    58 public:
    +
    59 sys_object(_In_opt_ sys_handle h = invalid_handle) : m_h(h) {}
    +
    60
    +
    61 sys_object(_In_ const sys_object& other) : m_h(other.m_h != invalid_handle ? duplicate(other.m_h, false) : invalid_handle) {}
    +
    62
    +
    63 sys_object& operator =(_In_ const sys_object& other)
    +
    64 {
    +
    65 if (this != std::addressof(other)) {
    +
    66 if (m_h != invalid_handle)
    +
    67 close(m_h);
    +
    68 m_h = other.m_h != invalid_handle ? duplicate(other.m_h, false) : invalid_handle;
    +
    69 }
    +
    70 return *this;
    +
    71 }
    +
    72
    +
    73 sys_object(_Inout_ sys_object&& other) noexcept : m_h(other.m_h)
    +
    74 {
    +
    75 other.m_h = invalid_handle;
    +
    76 }
    +
    77
    +
    78 sys_object& operator =(_Inout_ sys_object&& other) noexcept
    +
    79 {
    +
    80 if (this != std::addressof(other)) {
    +
    81 if (m_h != invalid_handle)
    +
    82 close(m_h);
    +
    83 m_h = other.m_h;
    +
    84 other.m_h = invalid_handle;
    +
    85 }
    +
    86 return *this;
    +
    87 }
    +
    88
    +
    89 virtual ~sys_object()
    +
    90 {
    +
    91 if (m_h != invalid_handle)
    +
    92 close(m_h);
    +
    93 }
    +
    94
    +
    98 virtual void close()
    +
    99 {
    +
    100 if (m_h != invalid_handle) {
    +
    101 close(m_h);
    +
    102 m_h = invalid_handle;
    +
    103 }
    +
    104 }
    +
    105
    +
    109 inline operator bool() const noexcept { return m_h != invalid_handle; }
    +
    110
    +
    114 inline sys_handle get() const noexcept { return m_h; }
    +
    115
    +
    116 protected:
    +
    120 static void close(sys_handle h)
    +
    121 {
    +
    122#ifdef _WIN32
    +
    123 if (CloseHandle(h) || GetLastError() == ERROR_INVALID_HANDLE)
    +
    124#else
    +
    125 if (close(h) >= 0 || errno == EBADF)
    +
    126#endif
    +
    127 return;
    +
    128 throw std::runtime_error("failed to close handle");
    +
    129 }
    +
    130
    +
    134 static sys_handle duplicate(_In_ sys_handle h, _In_ bool inherit)
    +
    135 {
    +
    136 sys_handle h_new;
    +
    137#ifdef _WIN32
    +
    138 HANDLE process = GetCurrentProcess();
    +
    139 if (DuplicateHandle(process, h, process, &h_new, 0, inherit, DUPLICATE_SAME_ACCESS))
    +
    140#else
    +
    141 UNREFERENCED_PARAMETER(inherit);
    +
    142 if ((h_new = dup(h)) >= 0)
    +
    143#endif
    +
    144 return h_new;
    +
    145 throw std::runtime_error("failed to duplicate handle");
    +
    146 }
    +
    147
    +
    148 protected:
    +
    149 sys_handle m_h;
    +
    150 };
    +
    151
    +
    152#ifdef _WIN32
    +
    153 template <class T>
    +
    154 class safearray_accessor
    +
    155 {
    +
    156 public:
    +
    157 safearray_accessor(_In_ LPSAFEARRAY sa) : m_sa(sa)
    +
    158 {
    +
    159 HRESULT hr = SafeArrayAccessData(sa, reinterpret_cast<void HUGEP**>(&m_data));
    +
    160 if (FAILED(hr))
    +
    161 throw std::invalid_argument("SafeArrayAccessData failed");
    +
    162 }
    +
    163
    +
    164 ~safearray_accessor()
    +
    165 {
    +
    166 SafeArrayUnaccessData(m_sa);
    +
    167 }
    +
    168
    +
    169 T* data() const { return m_data; }
    +
    170
    +
    171 protected:
    +
    172 LPSAFEARRAY m_sa;
    +
    173 T* m_data;
    +
    174 };
    +
    175
    +
    179 struct SafeArrayDestroy_delete
    +
    180 {
    +
    184 void operator()(_In_ LPSAFEARRAY sa) const
    +
    185 {
    +
    186 SafeArrayDestroy(sa);
    +
    187 }
    +
    188 };
    +
    189
    +
    193 struct SysFreeString_delete
    +
    194 {
    +
    198 void operator()(_In_ BSTR sa) const
    +
    199 {
    +
    200 SysFreeString(sa);
    +
    201 }
    +
    202 };
    +
    203#endif
    +
    204}
    +
    Operating system object (file, pipe, anything with an OS handle etc.)
    Definition system.hpp:57
    +
    sys_handle get() const noexcept
    Returns object handle.
    Definition system.hpp:114
    +
    virtual void close()
    Closes object.
    Definition system.hpp:98
    +
    static sys_handle duplicate(sys_handle h, bool inherit)
    Duplicates given object.
    Definition system.hpp:134
    +
    static void close(sys_handle h)
    Closes object.
    Definition system.hpp:120
    +
    + + + + diff --git a/unicode_8hpp_source.html b/unicode_8hpp_source.html index 3397ce3aa..3bdda20f4 100644 --- a/unicode_8hpp_source.html +++ b/unicode_8hpp_source.html @@ -85,133 +85,137 @@ $(function() {
    6#pragma once
    7
    8#include "sal.hpp"
    -
    9#include <assert.h>
    -
    10#ifdef _WIN32
    -
    11#include <windows.h>
    -
    12#endif
    -
    13#include <memory>
    -
    14#include <string>
    -
    15
    -
    16namespace stdex
    -
    17{
    -
    18 enum class charset_id {
    -
    19 default = 0,
    -
    20#ifdef _WIN32
    -
    21 utf8 = CP_UTF8,
    -
    22#endif
    -
    23 };
    -
    24
    -
    35 inline void str2wstr(
    -
    36 _Inout_ std::wstring& dst,
    -
    37 _In_reads_or_z_opt_(count_src) const char* src, _In_ size_t count_src,
    -
    38 _In_ charset_id charset = charset_id::default)
    -
    39 {
    -
    40 assert(src || !count_src);
    -
    41#ifdef _WIN32
    -
    42 assert(count_src < INT_MAX || count_src == SIZE_MAX);
    -
    43 constexpr DWORD dwFlags = MB_PRECOMPOSED;
    -
    44
    -
    45 // Try to convert to stack buffer first.
    -
    46 WCHAR szStackBuffer[1024/sizeof(WCHAR)];
    -
    47 int cch = MultiByteToWideChar(static_cast<UINT>(charset), dwFlags, src, static_cast<int>(count_src), szStackBuffer, _countof(szStackBuffer));
    -
    48 if (cch) {
    -
    49 // Append from stack.
    -
    50 dst.append(szStackBuffer, count_src != SIZE_MAX ? wcsnlen(szStackBuffer, cch) : (size_t)cch - 1);
    -
    51 } else if (::GetLastError() == ERROR_INSUFFICIENT_BUFFER) {
    -
    52 // Query the required output size. Allocate buffer. Then convert again.
    -
    53 cch = MultiByteToWideChar(static_cast<UINT>(charset), dwFlags, src, static_cast<int>(count_src), NULL, 0);
    -
    54 std::unique_ptr<WCHAR[]> szBuffer(new WCHAR[cch]);
    -
    55 cch = MultiByteToWideChar(static_cast<UINT>(charset), dwFlags, src, static_cast<int>(count_src), szBuffer.get(), cch);
    -
    56 dst.append(szBuffer.get(), count_src != SIZE_MAX ? wcsnlen(szBuffer.get(), cch) : (size_t)cch - 1);
    -
    57 }
    -
    58#else
    -
    59 throw std::exception("not implemented");
    -
    60#endif
    -
    61 }
    -
    62
    -
    72 inline void str2wstr(
    -
    73 _Inout_ std::wstring& dst,
    -
    74 _In_ const std::string& src,
    -
    75 _In_ charset_id charset = charset_id::default)
    -
    76 {
    -
    77 str2wstr(dst, src.data(), src.size(), charset);
    -
    78 }
    -
    79
    -
    89 inline std::wstring str2wstr(
    -
    90 _In_reads_or_z_opt_(count_src) const char* src, _In_ size_t count_src,
    -
    91 _In_ charset_id charset = charset_id::default)
    -
    92 {
    -
    93 std::wstring dst;
    -
    94 str2wstr(dst, src, count_src, charset);
    -
    95 return dst;
    -
    96 }
    -
    97
    -
    106 inline std::wstring str2wstr(
    -
    107 _In_ const std::string& src,
    -
    108 _In_ charset_id charset = charset_id::default)
    -
    109 {
    -
    110 return str2wstr(src.c_str(), src.size(), charset);
    -
    111 }
    -
    112
    -
    121 inline void wstr2str(
    -
    122 _Inout_ std::string& dst,
    -
    123 _In_reads_or_z_opt_(count_src) const wchar_t* src,
    -
    124 _In_ size_t count_src,
    -
    125 _In_ charset_id charset = charset_id::default)
    -
    126 {
    -
    127 assert(src || !count_src);
    -
    128#ifdef _WIN32
    -
    129 assert(count_src < INT_MAX || count_src == SIZE_MAX);
    -
    130 constexpr DWORD dwFlags = 0;
    -
    131 constexpr LPCCH lpDefaultChar = NULL;
    -
    132
    -
    133 // Try to convert to stack buffer first.
    -
    134 CHAR szStackBuffer[1024/sizeof(CHAR)];
    -
    135 int cch = WideCharToMultiByte(static_cast<UINT>(charset), dwFlags, src, static_cast<int>(count_src), szStackBuffer, _countof(szStackBuffer), lpDefaultChar, NULL);
    -
    136 if (cch) {
    -
    137 // Copy from stack. Be careful not to include zero terminator.
    -
    138 dst.append(szStackBuffer, count_src != SIZE_MAX ? strnlen(szStackBuffer, cch) : (size_t)cch - 1);
    -
    139 } else if (::GetLastError() == ERROR_INSUFFICIENT_BUFFER) {
    -
    140 // Query the required output size. Allocate buffer. Then convert again.
    -
    141 cch = WideCharToMultiByte(static_cast<UINT>(charset), dwFlags, 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>(charset), dwFlags, src, static_cast<int>(count_src), szBuffer.get(), cch, lpDefaultChar, NULL);
    -
    144 dst.append(szBuffer.get(), count_src != SIZE_MAX ? strnlen(szBuffer.get(), cch) : (size_t)cch - 1);
    -
    145 }
    -
    146#else
    -
    147 throw std::exception("not implemented");
    -
    148#endif
    -
    149 }
    -
    150
    -
    158 inline void wstr2str(
    -
    159 _Inout_ std::string& dst,
    -
    160 _In_ const std::wstring& src,
    -
    161 _In_ charset_id charset = charset_id::default)
    -
    162 {
    -
    163 wstr2str(dst, src.c_str(), src.size(), charset);
    -
    164 }
    -
    165
    -
    175 inline std::string wstr2str(
    -
    176 _In_reads_or_z_opt_(count_src) const wchar_t* src,
    -
    177 _In_ size_t count_src,
    -
    178 _In_ charset_id charset = charset_id::default)
    -
    179 {
    -
    180 std::string dst;
    -
    181 wstr2str(dst, src, count_src, charset);
    -
    182 return dst;
    -
    183 }
    -
    184
    -
    193 inline std::string wstr2str(
    -
    194 _In_ const std::wstring& src,
    -
    195 _In_ charset_id charset = charset_id::default)
    -
    196 {
    -
    197 return wstr2str(src.c_str(), src.size(), charset);
    -
    198 }
    -
    199}
    +
    9#include "system.hpp"
    +
    10#include <assert.h>
    +
    11#include <stdint.h>
    +
    12#include <memory>
    +
    13#include <string>
    +
    14
    +
    15namespace stdex
    +
    16{
    +
    17 enum class charset_id : uint16_t {
    +
    18#ifdef _WIN32
    +
    19 default = CP_ACP,
    +
    20 utf8 = CP_UTF8,
    +
    21 utf16 = 1200 /*CP_WINUNICODE*/,
    +
    22#else
    +
    23 default = 0,
    +
    24#endif
    +
    25 };
    +
    26
    +
    37 inline void str2wstr(
    +
    38 _Inout_ std::wstring& dst,
    +
    39 _In_reads_or_z_opt_(count_src) const char* src, _In_ size_t count_src,
    +
    40 _In_ charset_id charset = charset_id::default)
    +
    41 {
    +
    42 assert(src || !count_src);
    +
    43#ifdef _WIN32
    +
    44 assert(count_src < INT_MAX || count_src == SIZE_MAX);
    +
    45 constexpr DWORD dwFlags = MB_PRECOMPOSED;
    +
    46
    +
    47 // Try to convert to stack buffer first.
    +
    48 WCHAR szStackBuffer[1024/sizeof(WCHAR)];
    +
    49#pragma warning(suppress: 6387) // Testing indicates src may be NULL when count_src is also 0. Is SAL of the lpMultiByteStr parameter wrong?
    +
    50 int cch = MultiByteToWideChar(static_cast<UINT>(charset), dwFlags, src, static_cast<int>(count_src), szStackBuffer, _countof(szStackBuffer));
    +
    51 if (cch) {
    +
    52 // Append from stack.
    +
    53 dst.append(szStackBuffer, count_src != SIZE_MAX ? wcsnlen(szStackBuffer, cch) : (size_t)cch - 1);
    +
    54 } else if (::GetLastError() == ERROR_INSUFFICIENT_BUFFER) {
    +
    55 // Query the required output size. Allocate buffer. Then convert again.
    +
    56 cch = MultiByteToWideChar(static_cast<UINT>(charset), dwFlags, src, static_cast<int>(count_src), NULL, 0);
    +
    57 std::unique_ptr<WCHAR[]> szBuffer(new WCHAR[cch]);
    +
    58 cch = MultiByteToWideChar(static_cast<UINT>(charset), dwFlags, src, static_cast<int>(count_src), szBuffer.get(), cch);
    +
    59 dst.append(szBuffer.get(), count_src != SIZE_MAX ? wcsnlen(szBuffer.get(), cch) : (size_t)cch - 1);
    +
    60 }
    +
    61#else
    +
    62 throw std::exception("not implemented");
    +
    63#endif
    +
    64 }
    +
    65
    +
    75 inline void str2wstr(
    +
    76 _Inout_ std::wstring& dst,
    +
    77 _In_ const std::string& src,
    +
    78 _In_ charset_id charset = charset_id::default)
    +
    79 {
    +
    80 str2wstr(dst, src.data(), src.size(), charset);
    +
    81 }
    +
    82
    +
    92 inline std::wstring str2wstr(
    +
    93 _In_reads_or_z_opt_(count_src) const char* src, _In_ size_t count_src,
    +
    94 _In_ charset_id charset = charset_id::default)
    +
    95 {
    +
    96 std::wstring dst;
    +
    97 str2wstr(dst, src, count_src, charset);
    +
    98 return dst;
    +
    99 }
    +
    100
    +
    109 inline std::wstring str2wstr(
    +
    110 _In_ const std::string& src,
    +
    111 _In_ charset_id charset = charset_id::default)
    +
    112 {
    +
    113 return str2wstr(src.c_str(), src.size(), charset);
    +
    114 }
    +
    115
    +
    124 inline void wstr2str(
    +
    125 _Inout_ std::string& dst,
    +
    126 _In_reads_or_z_opt_(count_src) const wchar_t* src,
    +
    127 _In_ size_t count_src,
    +
    128 _In_ charset_id charset = charset_id::default)
    +
    129 {
    +
    130 assert(src || !count_src);
    +
    131#ifdef _WIN32
    +
    132 assert(count_src < INT_MAX || count_src == SIZE_MAX);
    +
    133 constexpr DWORD dwFlags = 0;
    +
    134 constexpr LPCCH lpDefaultChar = NULL;
    +
    135
    +
    136 // Try to convert to stack buffer first.
    +
    137 CHAR szStackBuffer[1024/sizeof(CHAR)];
    +
    138#pragma warning(suppress: 6387) // Testing indicates src may be NULL when count_src is also 0. Is SAL of the lpWideCharStr parameter wrong?
    +
    139 int cch = WideCharToMultiByte(static_cast<UINT>(charset), dwFlags, src, static_cast<int>(count_src), szStackBuffer, _countof(szStackBuffer), lpDefaultChar, NULL);
    +
    140 if (cch) {
    +
    141 // Copy from stack. Be careful not to include zero terminator.
    +
    142 dst.append(szStackBuffer, count_src != SIZE_MAX ? strnlen(szStackBuffer, cch) : (size_t)cch - 1);
    +
    143 } else if (::GetLastError() == ERROR_INSUFFICIENT_BUFFER) {
    +
    144 // Query the required output size. Allocate buffer. Then convert again.
    +
    145 cch = WideCharToMultiByte(static_cast<UINT>(charset), dwFlags, src, static_cast<int>(count_src), NULL, 0, lpDefaultChar, NULL);
    +
    146 std::unique_ptr<CHAR[]> szBuffer(new CHAR[cch]);
    +
    147 cch = WideCharToMultiByte(static_cast<UINT>(charset), dwFlags, src, static_cast<int>(count_src), szBuffer.get(), cch, lpDefaultChar, NULL);
    +
    148 dst.append(szBuffer.get(), count_src != SIZE_MAX ? strnlen(szBuffer.get(), cch) : (size_t)cch - 1);
    +
    149 }
    +
    150#else
    +
    151 throw std::exception("not implemented");
    +
    152#endif
    +
    153 }
    +
    154
    +
    162 inline void wstr2str(
    +
    163 _Inout_ std::string& dst,
    +
    164 _In_ const std::wstring& src,
    +
    165 _In_ charset_id charset = charset_id::default)
    +
    166 {
    +
    167 wstr2str(dst, src.c_str(), src.size(), charset);
    +
    168 }
    +
    169
    +
    179 inline std::string wstr2str(
    +
    180 _In_reads_or_z_opt_(count_src) const wchar_t* src,
    +
    181 _In_ size_t count_src,
    +
    182 _In_ charset_id charset = charset_id::default)
    +
    183 {
    +
    184 std::string dst;
    +
    185 wstr2str(dst, src, count_src, charset);
    +
    186 return dst;
    +
    187 }
    +
    188
    +
    197 inline std::string wstr2str(
    +
    198 _In_ const std::wstring& src,
    +
    199 _In_ charset_id charset = charset_id::default)
    +
    200 {
    +
    201 return wstr2str(src.c_str(), src.size(), charset);
    +
    202 }
    +
    203}
    diff --git a/vector__queue_8hpp_source.html b/vector__queue_8hpp_source.html index ecb185546..eb8af5789 100644 --- a/vector__queue_8hpp_source.html +++ b/vector__queue_8hpp_source.html @@ -386,7 +386,7 @@ $(function() {