From b265e6076020bca6d117704567a0d8d1e7026c1c Mon Sep 17 00:00:00 2001 From: rozmansi Date: Thu, 15 Sep 2022 10:22:58 +0000 Subject: [PATCH] deploy: ff8ca7f073a34e4e2e7829e914e1db43271a15c4 --- annotated.html | 2 +- base64_8h_source.html | 421 +++++++++++---------- classes.html | 2 +- classstdex_1_1base64__dec-members.html | 4 +- classstdex_1_1base64__dec.html | 10 +- classstdex_1_1base64__enc-members.html | 4 +- classstdex_1_1base64__enc.html | 10 +- classstdex_1_1hex__dec-members.html | 4 +- classstdex_1_1hex__dec.html | 10 +- classstdex_1_1hex__enc-members.html | 2 +- classstdex_1_1hex__enc.html | 2 +- classstdex_1_1idrec_1_1record-members.html | 2 +- classstdex_1_1idrec_1_1record.html | 2 +- classstdex_1_1vector__queue-members.html | 2 +- classstdex_1_1vector__queue.html | 2 +- dir_d44c64559bbebec7f509842c48db8b23.html | 2 +- dir_fca3c47b2ea228727bd6729832f89576.html | 2 +- files.html | 2 +- functions.html | 4 +- functions_func.html | 2 +- functions_type.html | 2 +- functions_vars.html | 4 +- hex_8h_source.html | 225 +++++------ idrec_8h_source.html | 2 +- index.html | 2 +- sal_8h_source.html | 2 +- search/all_1.js | 2 +- search/variables_0.js | 2 +- vector__queue_8h_source.html | 2 +- 29 files changed, 368 insertions(+), 366 deletions(-) diff --git a/annotated.html b/annotated.html index 06762a173..dc4ef9e06 100644 --- a/annotated.html +++ b/annotated.html @@ -88,7 +88,7 @@ $(function() { diff --git a/base64_8h_source.html b/base64_8h_source.html index db643d014..5ca207a3d 100644 --- a/base64_8h_source.html +++ b/base64_8h_source.html @@ -85,238 +85,239 @@ $(function() {
6#pragma once
7
8#include "sal.h"
-
9#include <string>
-
10#include <vector>
-
11
+
9#include <cstdint>
+
10#include <string>
+
11#include <vector>
12
-
13namespace stdex
-
14{
-
18 class base64_enc
-
19 {
-
20 public:
-
24 base64_enc() noexcept : num(0)
-
25 {
-
26 buf[0] = 0;
-
27 buf[1] = 0;
-
28 buf[2] = 0;
-
29 }
-
30
+
13
+
14namespace stdex
+
15{
+
19 class base64_enc
+
20 {
+
21 public:
+
25 base64_enc() noexcept : num(0)
+
26 {
+
27 buf[0] = 0;
+
28 buf[1] = 0;
+
29 buf[2] = 0;
+
30 }
31
-
40 template<class _Elem, class _Traits, class _Ax>
-
41 void encode(_Inout_ std::basic_string<_Elem, _Traits, _Ax> &out, _In_bytecount_(size) const void *data, _In_ size_t size, _In_opt_ bool is_last = true)
-
42 {
-
43 assert(data || !size);
-
44
-
45 // Preallocate output
-
46 out.reserve(out.size() + enc_size(size));
-
47
-
48 // Convert data character by character.
-
49 for (size_t i = 0;; i++) {
-
50 if (num >= 3) {
-
51 encode(out);
-
52 num = 0;
-
53 }
-
54
-
55 if (i >= size)
-
56 break;
-
57
-
58 buf[num++] = reinterpret_cast<const unsigned char*>(data)[i];
-
59 }
-
60
-
61 // If this is the last block, flush the buffer.
-
62 if (is_last && num) {
-
63 encode(out, num);
-
64 num = 0;
-
65 }
-
66 }
-
67
+
32
+
41 template<class _Elem, class _Traits, class _Ax>
+
42 void encode(_Inout_ std::basic_string<_Elem, _Traits, _Ax> &out, _In_bytecount_(size) const void *data, _In_ size_t size, _In_opt_ bool is_last = true)
+
43 {
+
44 assert(data || !size);
+
45
+
46 // Preallocate output
+
47 out.reserve(out.size() + enc_size(size));
+
48
+
49 // Convert data character by character.
+
50 for (size_t i = 0;; i++) {
+
51 if (num >= 3) {
+
52 encode(out);
+
53 num = 0;
+
54 }
+
55
+
56 if (i >= size)
+
57 break;
+
58
+
59 buf[num++] = reinterpret_cast<const uint8_t*>(data)[i];
+
60 }
+
61
+
62 // If this is the last block, flush the buffer.
+
63 if (is_last && num) {
+
64 encode(out, num);
+
65 num = 0;
+
66 }
+
67 }
68
-
72 void clear() noexcept
-
73 {
-
74 num = 0;
-
75 }
-
76
+
69
+
73 void clear() noexcept
+
74 {
+
75 num = 0;
+
76 }
77
-
85 size_t enc_size(_In_ size_t size) const noexcept
-
86 {
-
87 return ((num + size + 2)/3)*4;
-
88 }
-
89
+
78
+
86 size_t enc_size(_In_ size_t size) const noexcept
+
87 {
+
88 return ((num + size + 2)/3)*4;
+
89 }
90
-
91 protected:
-
95 template<class _Elem, class _Traits, class _Ax>
-
96 void encode(_Inout_ std::basic_string<_Elem, _Traits, _Ax> &out)
-
97 {
-
98 out += base64_enc_lookup[ buf[0] >> 2 ];
-
99 out += base64_enc_lookup[((buf[0] << 4) | (buf[1] >> 4)) & 0x3f];
-
100 out += base64_enc_lookup[((buf[1] << 2) | (buf[2] >> 6)) & 0x3f];
-
101 out += base64_enc_lookup[ buf[2] & 0x3f];
-
102 }
-
103
+
91
+
92 protected:
+
96 template<class _Elem, class _Traits, class _Ax>
+
97 void encode(_Inout_ std::basic_string<_Elem, _Traits, _Ax> &out)
+
98 {
+
99 out += base64_enc_lookup[ buf[0] >> 2 ];
+
100 out += base64_enc_lookup[((buf[0] << 4) | (buf[1] >> 4)) & 0x3f];
+
101 out += base64_enc_lookup[((buf[1] << 2) | (buf[2] >> 6)) & 0x3f];
+
102 out += base64_enc_lookup[ buf[2] & 0x3f];
+
103 }
104
-
108 template<class _Elem, class _Traits, class _Ax>
-
109 void encode(_Inout_ std::basic_string<_Elem, _Traits, _Ax> &out, _In_ size_t size)
-
110 {
-
111 if (size > 0) {
-
112 out += base64_enc_lookup[buf[0] >> 2];
-
113 if (size > 1) {
-
114 out += base64_enc_lookup[((buf[0] << 4) | (buf[1] >> 4)) & 0x3f];
-
115 if (size > 2) {
-
116 out += base64_enc_lookup[((buf[1] << 2) | (buf[2] >> 6)) & 0x3f];
-
117 out += base64_enc_lookup[buf[2] & 0x3f];
-
118 } else {
-
119 out += base64_enc_lookup[(buf[1] << 2) & 0x3f];
-
120 out += '=';
-
121 }
-
122 } else {
-
123 out += base64_enc_lookup[(buf[0] << 4) & 0x3f];
-
124 out += '=';
+
105
+
109 template<class _Elem, class _Traits, class _Ax>
+
110 void encode(_Inout_ std::basic_string<_Elem, _Traits, _Ax> &out, _In_ size_t size)
+
111 {
+
112 if (size > 0) {
+
113 out += base64_enc_lookup[buf[0] >> 2];
+
114 if (size > 1) {
+
115 out += base64_enc_lookup[((buf[0] << 4) | (buf[1] >> 4)) & 0x3f];
+
116 if (size > 2) {
+
117 out += base64_enc_lookup[((buf[1] << 2) | (buf[2] >> 6)) & 0x3f];
+
118 out += base64_enc_lookup[buf[2] & 0x3f];
+
119 } else {
+
120 out += base64_enc_lookup[(buf[1] << 2) & 0x3f];
+
121 out += '=';
+
122 }
+
123 } else {
+
124 out += base64_enc_lookup[(buf[0] << 4) & 0x3f];
125 out += '=';
-
126 }
-
127 } else {
-
128 out += '=';
+
126 out += '=';
+
127 }
+
128 } else {
129 out += '=';
130 out += '=';
131 out += '=';
-
132 }
-
133 }
-
134
+
132 out += '=';
+
133 }
+
134 }
135
-
136 protected:
-
137 unsigned char buf[3];
-
138 size_t num;
-
139 };
-
140
+
136
+
137 protected:
+
138 uint8_t buf[3];
+
139 size_t num;
+
140 };
141
-
143 static const char base64_enc_lookup[64] = {
-
144 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
-
145 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f',
-
146 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
-
147 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/'
-
148 };
-
150
+
142
+
144 static const char base64_enc_lookup[64] = {
+
145 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
+
146 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f',
+
147 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
+
148 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/'
+
149 };
151
-
155 class base64_dec
-
156 {
-
157 public:
-
161 base64_dec() noexcept : num(0)
-
162 {
-
163 buf[0] = 0;
-
164 buf[1] = 0;
-
165 buf[2] = 0;
-
166 buf[3] = 0;
-
167 }
-
168
+
152
+
156 class base64_dec
+
157 {
+
158 public:
+
162 base64_dec() noexcept : num(0)
+
163 {
+
164 buf[0] = 0;
+
165 buf[1] = 0;
+
166 buf[2] = 0;
+
167 buf[3] = 0;
+
168 }
169
-
178 template<class _Ty, class _Ax, class _Tchr>
-
179 void decode(_Inout_ std::vector<_Ty, _Ax> &out, _Out_ bool &is_last, _In_z_count_(size) const _Tchr *data, _In_ size_t size)
-
180 {
-
181 is_last = false;
-
182
-
183 // Trim data size to first terminator.
-
184 for (size_t k = 0; k < size; k++)
-
185 if (!data[k]) { size = k; break; }
-
186
-
187 // Preallocate output
-
188 out.reserve(out.size() + dec_size(size));
-
189
-
190 for (size_t i = 0;; i++) {
-
191 if (num >= 4) {
-
192 // Buffer full; decode it.
-
193 size_t nibbles = decode(out);
-
194 num = 0;
-
195 if (nibbles < 3) {
-
196 is_last = true;
-
197 break;
-
198 }
-
199 }
-
200
-
201 if (i >= size)
-
202 break;
-
203
-
204 int x = data[i];
-
205 if ((buf[num] = x < _countof(base64_dec_lookup) ? base64_dec_lookup[x] : 255) != 255)
-
206 num++;
-
207 }
-
208 }
-
209
+
170
+
179 template<class _Ty, class _Ax, class _Tchr>
+
180 void decode(_Inout_ std::vector<_Ty, _Ax> &out, _Out_ bool &is_last, _In_z_count_(size) const _Tchr *data, _In_ size_t size)
+
181 {
+
182 is_last = false;
+
183
+
184 // Trim data size to first terminator.
+
185 for (size_t k = 0; k < size; k++)
+
186 if (!data[k]) { size = k; break; }
+
187
+
188 // Preallocate output
+
189 out.reserve(out.size() + dec_size(size));
+
190
+
191 for (size_t i = 0;; i++) {
+
192 if (num >= 4) {
+
193 // Buffer full; decode it.
+
194 size_t nibbles = decode(out);
+
195 num = 0;
+
196 if (nibbles < 3) {
+
197 is_last = true;
+
198 break;
+
199 }
+
200 }
+
201
+
202 if (i >= size)
+
203 break;
+
204
+
205 int x = data[i];
+
206 if ((buf[num] = x < _countof(base64_dec_lookup) ? base64_dec_lookup[x] : 255) != 255)
+
207 num++;
+
208 }
+
209 }
210
-
214 void clear() noexcept
-
215 {
-
216 num = 0;
-
217 }
-
218
+
211
+
215 void clear() noexcept
+
216 {
+
217 num = 0;
+
218 }
219
-
227 size_t dec_size(_In_ size_t size) const noexcept
-
228 {
-
229 return ((num + size + 3)/4)*3;
-
230 }
-
231
+
220
+
228 size_t dec_size(_In_ size_t size) const noexcept
+
229 {
+
230 return ((num + size + 3)/4)*3;
+
231 }
232
-
233 protected:
-
237 template<class _Ty, class _Ax>
-
238 size_t decode(_Inout_ std::vector<_Ty, _Ax> &out)
-
239 {
-
240 out.push_back((_Ty)(((buf[0] << 2) | (buf[1] >> 4)) & 0xff));
-
241 if (buf[2] < 64) {
-
242 out.push_back((_Ty)(((buf[1] << 4) | (buf[2] >> 2)) & 0xff));
-
243 if (buf[3] < 64) {
-
244 out.push_back((_Ty)(((buf[2] << 6) | buf[3]) & 0xff));
-
245 return 3;
-
246 } else
-
247 return 2;
-
248 } else
-
249 return 1;
-
250 }
-
251
+
233
+
234 protected:
+
238 template<class _Ty, class _Ax>
+
239 size_t decode(_Inout_ std::vector<_Ty, _Ax> &out)
+
240 {
+
241 out.push_back((_Ty)(((buf[0] << 2) | (buf[1] >> 4)) & 0xff));
+
242 if (buf[2] < 64) {
+
243 out.push_back((_Ty)(((buf[1] << 4) | (buf[2] >> 2)) & 0xff));
+
244 if (buf[3] < 64) {
+
245 out.push_back((_Ty)(((buf[2] << 6) | buf[3]) & 0xff));
+
246 return 3;
+
247 } else
+
248 return 2;
+
249 } else
+
250 return 1;
+
251 }
252
-
253 protected:
-
254 unsigned char buf[4];
-
255 size_t num;
-
256 };
-
257
+
253
+
254 protected:
+
255 uint8_t buf[4];
+
256 size_t num;
+
257 };
258
-
260 static const unsigned char base64_dec_lookup[256] = {
-
261 /* 0 1 2 3 4 5 6 7 8 9 A B C D E F */
-
262 /* 0 */ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
-
263 /* 1 */ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
-
264 /* 2 */ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 62, 255, 255, 255, 63,
-
265 /* 3 */ 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 255, 255, 255, 64, 255, 255,
-
266 /* 4 */ 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
-
267 /* 5 */ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 255, 255, 255, 255, 255,
-
268 /* 6 */ 255, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
-
269 /* 7 */ 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 255, 255, 255, 255, 255,
-
270 /* 8 */ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
-
271 /* 9 */ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
-
272 /* A */ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
-
273 /* B */ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
-
274 /* C */ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
-
275 /* D */ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
-
276 /* E */ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
-
277 /* F */ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255
-
278 };
-
280}
-
Base64 decoding session.
Definition: base64.h:156
-
size_t num
Number of bytes used in buf
Definition: base64.h:255
-
base64_dec() noexcept
Constructs blank decoding session.
Definition: base64.h:161
-
void decode(std::vector< _Ty, _Ax > &out, bool &is_last, const _Tchr *data, size_t size)
Decodes one block of information, and appends it to the output.
Definition: base64.h:179
-
size_t dec_size(size_t size) const noexcept
Returns maximum decoded size.
Definition: base64.h:227
-
size_t decode(std::vector< _Ty, _Ax > &out)
Decodes one complete internal buffer of data.
Definition: base64.h:238
-
void clear() noexcept
Resets decoding session.
Definition: base64.h:214
-
unsigned char buf[4]
Internal buffer.
Definition: base64.h:254
-
Base64 encoding session.
Definition: base64.h:19
-
void encode(std::basic_string< _Elem, _Traits, _Ax > &out, const void *data, size_t size, bool is_last=true)
Encodes one block of information, and appends it to the output.
Definition: base64.h:41
-
unsigned char buf[3]
Internal buffer.
Definition: base64.h:137
-
void encode(std::basic_string< _Elem, _Traits, _Ax > &out)
Encodes one complete internal buffer of data.
Definition: base64.h:96
-
size_t num
Number of bytes used in buf
Definition: base64.h:138
-
void encode(std::basic_string< _Elem, _Traits, _Ax > &out, size_t size)
Encodes partial internal buffer of data.
Definition: base64.h:109
-
base64_enc() noexcept
Constructs blank encoding session.
Definition: base64.h:24
-
void clear() noexcept
Resets encoding session.
Definition: base64.h:72
-
size_t enc_size(size_t size) const noexcept
Returns maximum encoded size.
Definition: base64.h:85
+
259
+
261 static const uint8_t base64_dec_lookup[256] = {
+
262 /* 0 1 2 3 4 5 6 7 8 9 A B C D E F */
+
263 /* 0 */ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+
264 /* 1 */ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+
265 /* 2 */ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 62, 255, 255, 255, 63,
+
266 /* 3 */ 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 255, 255, 255, 64, 255, 255,
+
267 /* 4 */ 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
+
268 /* 5 */ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 255, 255, 255, 255, 255,
+
269 /* 6 */ 255, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
+
270 /* 7 */ 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 255, 255, 255, 255, 255,
+
271 /* 8 */ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+
272 /* 9 */ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+
273 /* A */ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+
274 /* B */ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+
275 /* C */ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+
276 /* D */ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+
277 /* E */ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+
278 /* F */ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255
+
279 };
+
281}
+
Base64 decoding session.
Definition: base64.h:157
+
size_t num
Number of bytes used in buf
Definition: base64.h:256
+
base64_dec() noexcept
Constructs blank decoding session.
Definition: base64.h:162
+
void decode(std::vector< _Ty, _Ax > &out, bool &is_last, const _Tchr *data, size_t size)
Decodes one block of information, and appends it to the output.
Definition: base64.h:180
+
size_t dec_size(size_t size) const noexcept
Returns maximum decoded size.
Definition: base64.h:228
+
uint8_t buf[4]
Internal buffer.
Definition: base64.h:255
+
size_t decode(std::vector< _Ty, _Ax > &out)
Decodes one complete internal buffer of data.
Definition: base64.h:239
+
void clear() noexcept
Resets decoding session.
Definition: base64.h:215
+
Base64 encoding session.
Definition: base64.h:20
+
void encode(std::basic_string< _Elem, _Traits, _Ax > &out, const void *data, size_t size, bool is_last=true)
Encodes one block of information, and appends it to the output.
Definition: base64.h:42
+
void encode(std::basic_string< _Elem, _Traits, _Ax > &out)
Encodes one complete internal buffer of data.
Definition: base64.h:97
+
size_t num
Number of bytes used in buf
Definition: base64.h:139
+
void encode(std::basic_string< _Elem, _Traits, _Ax > &out, size_t size)
Encodes partial internal buffer of data.
Definition: base64.h:110
+
base64_enc() noexcept
Constructs blank encoding session.
Definition: base64.h:25
+
uint8_t buf[3]
Internal buffer.
Definition: base64.h:138
+
void clear() noexcept
Resets encoding session.
Definition: base64.h:73
+
size_t enc_size(size_t size) const noexcept
Returns maximum encoded size.
Definition: base64.h:86
diff --git a/classes.html b/classes.html index a2d466576..e80af1330 100644 --- a/classes.html +++ b/classes.html @@ -91,7 +91,7 @@ $(function() { diff --git a/classstdex_1_1base64__dec-members.html b/classstdex_1_1base64__dec-members.html index 4428394d3..28ada678a 100644 --- a/classstdex_1_1base64__dec-members.html +++ b/classstdex_1_1base64__dec-members.html @@ -81,7 +81,7 @@ $(function() {

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

- + @@ -90,7 +90,7 @@ $(function() {
base64_dec() noexceptstdex::base64_decinline
bufstdex::base64_decprotected
bufstdex::base64_decprotected
clear() noexceptstdex::base64_decinline
dec_size(size_t size) const noexceptstdex::base64_decinline
decode(std::vector< _Ty, _Ax > &out, bool &is_last, const _Tchr *data, size_t size)stdex::base64_decinline
diff --git a/classstdex_1_1base64__dec.html b/classstdex_1_1base64__dec.html index 4e58bf299..985df49ea 100644 --- a/classstdex_1_1base64__dec.html +++ b/classstdex_1_1base64__dec.html @@ -116,10 +116,10 @@ template<class _Ty , class _Ax > - - - + + + @@ -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 d5bca0d80..a01ec7952 100644 --- a/classstdex_1_1base64__enc-members.html +++ b/classstdex_1_1base64__enc-members.html @@ -81,7 +81,7 @@ $(function() {

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

Protected Attributes

-unsigned char buf [4]
 Internal buffer.
 
+uint8_t buf [4]
 Internal buffer.
 
size_t num
 Number of bytes used in buf
- + @@ -91,7 +91,7 @@ $(function() {
base64_enc() noexceptstdex::base64_encinline
bufstdex::base64_encprotected
bufstdex::base64_encprotected
clear() noexceptstdex::base64_encinline
enc_size(size_t size) const noexceptstdex::base64_encinline
encode(std::basic_string< _Elem, _Traits, _Ax > &out, const void *data, size_t size, bool is_last=true)stdex::base64_encinline
diff --git a/classstdex_1_1base64__enc.html b/classstdex_1_1base64__enc.html index 6b7e23290..92ce2d66a 100644 --- a/classstdex_1_1base64__enc.html +++ b/classstdex_1_1base64__enc.html @@ -121,10 +121,10 @@ template<class _Elem , class _Traits , class _Ax > - - - + + + @@ -235,7 +235,7 @@ template<class _Elem , class _Traits , class _Ax > diff --git a/classstdex_1_1hex__dec-members.html b/classstdex_1_1hex__dec-members.html index 9c51ff235..c8801632c 100644 --- a/classstdex_1_1hex__dec-members.html +++ b/classstdex_1_1hex__dec-members.html @@ -80,7 +80,7 @@ $(function() {

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

Protected Attributes

-unsigned char buf [3]
 Internal buffer.
 
+uint8_t buf [3]
 Internal buffer.
 
size_t num
 Number of bytes used in buf
- + @@ -89,7 +89,7 @@ $(function() {
bufstdex::hex_decprotected
bufstdex::hex_decprotected
clear() noexceptstdex::hex_decinline
dec_size(size_t size) const noexceptstdex::hex_decinline
decode(std::vector< _Ty, _Ax > &out, bool &is_last, const _Tchr *data, size_t size)stdex::hex_decinline
diff --git a/classstdex_1_1hex__dec.html b/classstdex_1_1hex__dec.html index c719901e7..900b3f08a 100644 --- a/classstdex_1_1hex__dec.html +++ b/classstdex_1_1hex__dec.html @@ -107,10 +107,10 @@ void clear () noexcept - - - + + + @@ -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 aa1040db7..2f761201a 100644 --- a/classstdex_1_1hex__enc-members.html +++ b/classstdex_1_1hex__enc-members.html @@ -86,7 +86,7 @@ $(function() {

Protected Attributes

-unsigned char buf
 Internal buffer.
 
+uint8_t buf
 Internal buffer.
 
size_t num
 Number of nibbles used in buf
diff --git a/classstdex_1_1hex__enc.html b/classstdex_1_1hex__enc.html index 2373c4d92..23cdccbf1 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 249bc36d6..ab7e9e6f4 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 431ddde14..d2a8f3aa5 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_1vector__queue-members.html b/classstdex_1_1vector__queue-members.html index 06c87c3d1..1139dbb6f 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 3b5b1f88e..6934de1f5 100644 --- a/classstdex_1_1vector__queue.html +++ b/classstdex_1_1vector__queue.html @@ -795,7 +795,7 @@ template<class T > diff --git a/dir_d44c64559bbebec7f509842c48db8b23.html b/dir_d44c64559bbebec7f509842c48db8b23.html index 801d51316..e2038938b 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 3f5014619..ace64d1b0 100644 --- a/dir_fca3c47b2ea228727bd6729832f89576.html +++ b/dir_fca3c47b2ea228727bd6729832f89576.html @@ -94,7 +94,7 @@ Files diff --git a/files.html b/files.html index 971c35269..42daaeaf7 100644 --- a/files.html +++ b/files.html @@ -87,7 +87,7 @@ $(function() { diff --git a/functions.html b/functions.html index 07b8f83c9..e0f08bf4a 100644 --- a/functions.html +++ b/functions.html @@ -83,7 +83,7 @@ $(function() {
  • back() : stdex::vector_queue< T >
  • base64_dec() : stdex::base64_dec
  • base64_enc() : stdex::base64_enc
  • -
  • buf : stdex::base64_dec, stdex::base64_enc, stdex::hex_dec
  • +
  • buf : stdex::base64_dec, stdex::base64_enc, stdex::hex_dec
  • @@ -186,7 +186,7 @@ $(function() { diff --git a/functions_func.html b/functions_func.html index 6a8e7176d..7f95068fc 100644 --- a/functions_func.html +++ b/functions_func.html @@ -165,7 +165,7 @@ $(function() { diff --git a/functions_type.html b/functions_type.html index bac5aabf8..b87103010 100644 --- a/functions_type.html +++ b/functions_type.html @@ -81,7 +81,7 @@ $(function() { diff --git a/functions_vars.html b/functions_vars.html index 9adc8a934..01c348be0 100644 --- a/functions_vars.html +++ b/functions_vars.html @@ -71,7 +71,7 @@ $(function() {
     
    diff --git a/hex_8h_source.html b/hex_8h_source.html index 8e991f7c2..412d5efbd 100644 --- a/hex_8h_source.html +++ b/hex_8h_source.html @@ -85,129 +85,130 @@ $(function() {
    6#pragma once
    7
    8#include "sal.h"
    -
    9#include <string>
    -
    10#include <vector>
    -
    11
    +
    9#include <cstdint>
    +
    10#include <string>
    +
    11#include <vector>
    12
    -
    13namespace stdex
    -
    14{
    -
    18 class hex_enc
    -
    19 {
    -
    20 public:
    -
    24 hex_enc() noexcept
    -
    25 {
    -
    26 }
    -
    27
    +
    13
    +
    14namespace stdex
    +
    15{
    +
    19 class hex_enc
    +
    20 {
    +
    21 public:
    +
    25 hex_enc() noexcept
    +
    26 {
    +
    27 }
    28
    -
    36 template<class _Elem, class _Traits, class _Ax>
    -
    37 void encode(_Inout_ std::basic_string<_Elem, _Traits, _Ax> &out, _In_bytecount_(size) const void *data, _In_ size_t size)
    -
    38 {
    -
    39 assert(data || !size);
    -
    40
    -
    41 // Preallocate output
    -
    42 out.reserve(out.size() + enc_size(size));
    -
    43
    -
    44 // Convert data character by character.
    -
    45 for (size_t i = 0; i < size; i++) {
    -
    46 unsigned char
    -
    47 x = reinterpret_cast<const unsigned char*>(data)[i],
    -
    48 x_h = ((x & 0xf0) >> 4),
    -
    49 x_l = ((x & 0x0f) );
    -
    50
    -
    51 out += x_h < 10 ? '0' + x_h : 'A' - 10 + x_h;
    -
    52 out += x_l < 10 ? '0' + x_l : 'A' - 10 + x_l;
    -
    53 }
    -
    54 }
    -
    55
    +
    29
    +
    37 template<class _Elem, class _Traits, class _Ax>
    +
    38 void encode(_Inout_ std::basic_string<_Elem, _Traits, _Ax> &out, _In_bytecount_(size) const void *data, _In_ size_t size)
    +
    39 {
    +
    40 assert(data || !size);
    +
    41
    +
    42 // Preallocate output
    +
    43 out.reserve(out.size() + enc_size(size));
    +
    44
    +
    45 // Convert data character by character.
    +
    46 for (size_t i = 0; i < size; i++) {
    +
    47 uint8_t
    +
    48 x = reinterpret_cast<const uint8_t*>(data)[i],
    +
    49 x_h = ((x & 0xf0) >> 4),
    +
    50 x_l = ((x & 0x0f) );
    +
    51
    +
    52 out += x_h < 10 ? '0' + x_h : 'A' - 10 + x_h;
    +
    53 out += x_l < 10 ? '0' + x_l : 'A' - 10 + x_l;
    +
    54 }
    +
    55 }
    56
    -
    64 size_t enc_size(_In_ size_t size) const noexcept
    -
    65 {
    -
    66 return size*2;
    -
    67 }
    -
    68 };
    -
    69
    +
    57
    +
    65 size_t enc_size(_In_ size_t size) const noexcept
    +
    66 {
    +
    67 return size*2;
    +
    68 }
    +
    69 };
    70
    -
    74 class hex_dec
    -
    75 {
    -
    76 public:
    -
    80 hex_dec() noexcept :
    -
    81 buf(0),
    -
    82 num(0)
    -
    83 {
    -
    84 }
    -
    85
    +
    71
    +
    75 class hex_dec
    +
    76 {
    +
    77 public:
    +
    81 hex_dec() noexcept :
    +
    82 buf(0),
    +
    83 num(0)
    +
    84 {
    +
    85 }
    86
    -
    95 template<class _Ty, class _Ax, class _Tchr>
    -
    96 void decode(_Inout_ std::vector<_Ty, _Ax> &out, _Out_ bool &is_last, _In_z_count_(size) const _Tchr *data, _In_ size_t size)
    -
    97 {
    -
    98 is_last = false;
    -
    99
    -
    100 // Trim data size to first terminator.
    -
    101 for (size_t k = 0; k < size; k++)
    -
    102 if (!data[k]) { size = k; break; }
    -
    103
    -
    104 // Preallocate output
    -
    105 out.reserve(out.size() + dec_size(size));
    -
    106
    -
    107 for (size_t i = 0;; i++) {
    -
    108 if (num >= 2) {
    -
    109 // Buffer full.
    -
    110 out.push_back(buf);
    -
    111 num = 0;
    -
    112 is_last = true;
    -
    113 } else
    -
    114 is_last = false;
    -
    115
    -
    116 if (i >= size)
    -
    117 break;
    -
    118
    -
    119 int x = data[i];
    -
    120 if ('0' <= x && x <= '9') {
    -
    121 buf = ((buf & 0xf) << 4) | (unsigned char)(x - '0');
    -
    122 num++;
    -
    123 } else if ('A' <= x && x <= 'F') {
    -
    124 buf = ((buf & 0xf) << 4) | (unsigned char)(x - ('A' - 10));
    -
    125 num++;
    -
    126 } else if ('a' <= x && x <= 'f') {
    -
    127 buf = ((buf & 0xf) << 4) | (unsigned char)(x - ('a' - 10));
    -
    128 num++;
    -
    129 }
    -
    130 }
    -
    131 }
    -
    132
    +
    87
    +
    96 template<class _Ty, class _Ax, class _Tchr>
    +
    97 void decode(_Inout_ std::vector<_Ty, _Ax> &out, _Out_ bool &is_last, _In_z_count_(size) const _Tchr *data, _In_ size_t size)
    +
    98 {
    +
    99 is_last = false;
    +
    100
    +
    101 // Trim data size to first terminator.
    +
    102 for (size_t k = 0; k < size; k++)
    +
    103 if (!data[k]) { size = k; break; }
    +
    104
    +
    105 // Preallocate output
    +
    106 out.reserve(out.size() + dec_size(size));
    +
    107
    +
    108 for (size_t i = 0;; i++) {
    +
    109 if (num >= 2) {
    +
    110 // Buffer full.
    +
    111 out.push_back(buf);
    +
    112 num = 0;
    +
    113 is_last = true;
    +
    114 } else
    +
    115 is_last = false;
    +
    116
    +
    117 if (i >= size)
    +
    118 break;
    +
    119
    +
    120 int x = data[i];
    +
    121 if ('0' <= x && x <= '9') {
    +
    122 buf = ((buf & 0xf) << 4) | (uint8_t)(x - '0');
    +
    123 num++;
    +
    124 } else if ('A' <= x && x <= 'F') {
    +
    125 buf = ((buf & 0xf) << 4) | (uint8_t)(x - ('A' - 10));
    +
    126 num++;
    +
    127 } else if ('a' <= x && x <= 'f') {
    +
    128 buf = ((buf & 0xf) << 4) | (uint8_t)(x - ('a' - 10));
    +
    129 num++;
    +
    130 }
    +
    131 }
    +
    132 }
    133
    -
    137 void clear() noexcept
    -
    138 {
    -
    139 num = 0;
    -
    140 }
    -
    141
    +
    134
    +
    138 void clear() noexcept
    +
    139 {
    +
    140 num = 0;
    +
    141 }
    142
    -
    150 size_t dec_size(_In_ size_t size) const noexcept
    -
    151 {
    -
    152 return (size + 1)/2;
    -
    153 }
    -
    154
    +
    143
    +
    151 size_t dec_size(_In_ size_t size) const noexcept
    +
    152 {
    +
    153 return (size + 1)/2;
    +
    154 }
    155
    -
    156 protected:
    -
    157 unsigned char buf;
    -
    158 size_t num;
    -
    159 };
    -
    160}
    -
    Hexadecimal decoding session.
    Definition: hex.h:75
    -
    unsigned char buf
    Internal buffer.
    Definition: hex.h:157
    -
    void clear() noexcept
    Resets decoding session.
    Definition: hex.h:137
    -
    hex_dec() noexcept
    Constructs blank decoding session.
    Definition: hex.h:80
    -
    size_t num
    Number of nibbles used in buf
    Definition: hex.h:158
    -
    void decode(std::vector< _Ty, _Ax > &out, bool &is_last, const _Tchr *data, size_t size)
    Decodes one block of information, and appends it to the output.
    Definition: hex.h:96
    -
    size_t dec_size(size_t size) const noexcept
    Returns maximum decoded size.
    Definition: hex.h:150
    -
    Hexadecimal encoding session.
    Definition: hex.h:19
    -
    size_t enc_size(size_t size) const noexcept
    Returns maximum encoded size.
    Definition: hex.h:64
    -
    void encode(std::basic_string< _Elem, _Traits, _Ax > &out, const void *data, size_t size)
    Encodes one block of information, and appends it to the output.
    Definition: hex.h:37
    -
    hex_enc() noexcept
    Constructs blank encoding session.
    Definition: hex.h:24
    +
    156
    +
    157 protected:
    +
    158 uint8_t buf;
    +
    159 size_t num;
    +
    160 };
    +
    161}
    +
    Hexadecimal decoding session.
    Definition: hex.h:76
    +
    void clear() noexcept
    Resets decoding session.
    Definition: hex.h:138
    +
    uint8_t buf
    Internal buffer.
    Definition: hex.h:158
    +
    hex_dec() noexcept
    Constructs blank decoding session.
    Definition: hex.h:81
    +
    size_t num
    Number of nibbles used in buf
    Definition: hex.h:159
    +
    void decode(std::vector< _Ty, _Ax > &out, bool &is_last, const _Tchr *data, size_t size)
    Decodes one block of information, and appends it to the output.
    Definition: hex.h:97
    +
    size_t dec_size(size_t size) const noexcept
    Returns maximum decoded size.
    Definition: hex.h:151
    +
    Hexadecimal encoding session.
    Definition: hex.h:20
    +
    size_t enc_size(size_t size) const noexcept
    Returns maximum encoded size.
    Definition: hex.h:65
    +
    void encode(std::basic_string< _Elem, _Traits, _Ax > &out, const void *data, size_t size)
    Encodes one block of information, and appends it to the output.
    Definition: hex.h:38
    +
    hex_enc() noexcept
    Constructs blank encoding session.
    Definition: hex.h:25
    diff --git a/idrec_8h_source.html b/idrec_8h_source.html index 5b1a8c1c5..f5c07552a 100644 --- a/idrec_8h_source.html +++ b/idrec_8h_source.html @@ -275,7 +275,7 @@ $(function() { diff --git a/index.html b/index.html index f92aa7c60..0c2461224 100644 --- a/index.html +++ b/index.html @@ -76,7 +76,7 @@ $(function() { diff --git a/sal_8h_source.html b/sal_8h_source.html index c9cfa1013..65c5d93d7 100644 --- a/sal_8h_source.html +++ b/sal_8h_source.html @@ -134,7 +134,7 @@ $(function() { diff --git a/search/all_1.js b/search/all_1.js index 8fef839ab..f9d42ab1b 100644 --- a/search/all_1.js +++ b/search/all_1.js @@ -3,5 +3,5 @@ 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']]], ['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']]], - ['buf_3',['buf',['../classstdex_1_1base64__enc.html#a3f7550fc14177eab9ddcbbf039c55b23',1,'stdex::base64_enc::buf()'],['../classstdex_1_1base64__dec.html#afacd53895a47f8f3de5f6616c27a8fd4',1,'stdex::base64_dec::buf()'],['../classstdex_1_1hex__dec.html#a105c56e5f4249ebcf4faa5e46f0842ce',1,'stdex::hex_dec::buf()']]] + ['buf_3',['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()']]] ]; diff --git a/search/variables_0.js b/search/variables_0.js index e32eb658d..6fbbd142e 100644 --- a/search/variables_0.js +++ b/search/variables_0.js @@ -1,4 +1,4 @@ var searchData= [ - ['buf_0',['buf',['../classstdex_1_1base64__enc.html#a3f7550fc14177eab9ddcbbf039c55b23',1,'stdex::base64_enc::buf()'],['../classstdex_1_1base64__dec.html#afacd53895a47f8f3de5f6616c27a8fd4',1,'stdex::base64_dec::buf()'],['../classstdex_1_1hex__dec.html#a105c56e5f4249ebcf4faa5e46f0842ce',1,'stdex::hex_dec::buf()']]] + ['buf_0',['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()']]] ]; diff --git a/vector__queue_8h_source.html b/vector__queue_8h_source.html index e5709df8d..6e577ac80 100644 --- a/vector__queue_8h_source.html +++ b/vector__queue_8h_source.html @@ -386,7 +386,7 @@ $(function() {