From 70856131c82ed68feaf74567eec1f3f31a33b2e9 Mon Sep 17 00:00:00 2001 From: rozmansi Date: Thu, 7 Dec 2023 17:49:55 +0000 Subject: [PATCH] deploy: 5215d5e6dcb9020198093788af5322ea338eec8f --- _unit_tests_2compat_8hpp_source.html | 2 +- annotated.html | 2 +- base64_8hpp_source.html | 6 +- chrono_8hpp_source.html | 2 +- classes.html | 2 +- classstdex_1_1base64__dec-members.html | 2 +- classstdex_1_1base64__dec.html | 2 +- classstdex_1_1base64__enc-members.html | 2 +- classstdex_1_1base64__enc.html | 2 +- classstdex_1_1base64__reader-members.html | 47 +- classstdex_1_1base64__reader.html | 54 +- classstdex_1_1base64__writer-members.html | 49 +- classstdex_1_1base64__writer.html | 54 +- classstdex_1_1basic__hash-members.html | 2 +- classstdex_1_1basic__hash.html | 2 +- classstdex_1_1block__hash-members.html | 2 +- classstdex_1_1block__hash.html | 2 +- classstdex_1_1charset__encoder-members.html | 2 +- classstdex_1_1charset__encoder.html | 2 +- classstdex_1_1crc32__hash-members.html | 2 +- classstdex_1_1crc32__hash.html | 2 +- classstdex_1_1global__progress-members.html | 2 +- classstdex_1_1global__progress.html | 2 +- classstdex_1_1hex__dec-members.html | 2 +- classstdex_1_1hex__dec.html | 2 +- classstdex_1_1hex__enc-members.html | 2 +- classstdex_1_1hex__enc.html | 2 +- classstdex_1_1html_1_1comment-members.html | 2 +- classstdex_1_1html_1_1comment.html | 2 +- ...sstdex_1_1html_1_1declaration-members.html | 2 +- classstdex_1_1html_1_1declaration.html | 2 +- classstdex_1_1html_1_1document-members.html | 6 +- classstdex_1_1html_1_1document.html | 18 +- classstdex_1_1html_1_1element-members.html | 2 +- classstdex_1_1html_1_1element.html | 2 +- ...stdex_1_1html_1_1element__end-members.html | 2 +- classstdex_1_1html_1_1element__end.html | 2 +- ...dex_1_1html_1_1element__start-members.html | 2 +- classstdex_1_1html_1_1element__start.html | 2 +- ...sstdex_1_1html_1_1instruction-members.html | 2 +- classstdex_1_1html_1_1instruction.html | 2 +- classstdex_1_1html_1_1parser-members.html | 4 +- classstdex_1_1html_1_1parser.html | 10 +- classstdex_1_1html_1_1sequence-members.html | 2 +- classstdex_1_1html_1_1sequence.html | 2 +- ...ex_1_1html_1_1starting__token-members.html | 2 +- classstdex_1_1html_1_1starting__token.html | 2 +- ...sstdex_1_1html_1_1text__token-members.html | 2 +- classstdex_1_1html_1_1text__token.html | 2 +- classstdex_1_1html_1_1token-members.html | 2 +- classstdex_1_1html_1_1token.html | 2 +- classstdex_1_1html_1_1url__token-members.html | 2 +- classstdex_1_1html_1_1url__token.html | 2 +- classstdex_1_1idrec_1_1record-members.html | 2 +- classstdex_1_1idrec_1_1record.html | 2 +- classstdex_1_1lazy__progress-members.html | 2 +- classstdex_1_1lazy__progress.html | 2 +- classstdex_1_1md5__hash-members.html | 2 +- classstdex_1_1md5__hash.html | 2 +- ...dex_1_1parser_1_1basic__angle-members.html | 2 +- classstdex_1_1parser_1_1basic__angle.html | 2 +- ...x_1_1parser_1_1basic__any__cu-members.html | 2 +- classstdex_1_1parser_1_1basic__any__cu.html | 2 +- ...stdex_1_1parser_1_1basic__bol-members.html | 2 +- classstdex_1_1parser_1_1basic__bol.html | 2 +- ...ex_1_1parser_1_1basic__branch-members.html | 2 +- classstdex_1_1parser_1_1basic__branch.html | 2 +- ...r_1_1basic__chemical__formula-members.html | 2 +- ...1_1parser_1_1basic__chemical__formula.html | 2 +- ...1_1basic__creditor__reference-members.html | 2 +- ...1parser_1_1basic__creditor__reference.html | 2 +- ..._1_1parser_1_1basic__css__cdc-members.html | 2 +- classstdex_1_1parser_1_1basic__css__cdc.html | 2 +- ..._1_1parser_1_1basic__css__cdo-members.html | 2 +- classstdex_1_1parser_1_1basic__css__cdo.html | 2 +- ...parser_1_1basic__css__comment-members.html | 2 +- ...tdex_1_1parser_1_1basic__css__comment.html | 2 +- ...1parser_1_1basic__css__import-members.html | 2 +- ...stdex_1_1parser_1_1basic__css__import.html | 2 +- ...1parser_1_1basic__css__string-members.html | 2 +- ...stdex_1_1parser_1_1basic__css__string.html | 2 +- ..._1_1parser_1_1basic__css__uri-members.html | 2 +- classstdex_1_1parser_1_1basic__css__uri.html | 2 +- ...sstdex_1_1parser_1_1basic__cu-members.html | 2 +- classstdex_1_1parser_1_1basic__cu.html | 2 +- ...x_1_1parser_1_1basic__cu__set-members.html | 2 +- classstdex_1_1parser_1_1basic__cu__set.html | 2 +- ...tdex_1_1parser_1_1basic__date-members.html | 2 +- classstdex_1_1parser_1_1basic__date.html | 2 +- ...r_1_1basic__dns__domain__char-members.html | 2 +- ...1_1parser_1_1basic__dns__domain__char.html | 2 +- ...1_1parser_1_1basic__dns__name-members.html | 2 +- classstdex_1_1parser_1_1basic__dns__name.html | 2 +- ...rser_1_1basic__email__address-members.html | 2 +- ...ex_1_1parser_1_1basic__email__address.html | 2 +- ..._1_1parser_1_1basic__emoticon-members.html | 2 +- classstdex_1_1parser_1_1basic__emoticon.html | 2 +- ...stdex_1_1parser_1_1basic__eol-members.html | 2 +- classstdex_1_1parser_1_1basic__eol.html | 2 +- ..._1_1parser_1_1basic__fraction-members.html | 2 +- classstdex_1_1parser_1_1basic__fraction.html | 2 +- ...__declaration__condition__end-members.html | 2 +- ...ic__html__declaration__condition__end.html | 2 +- ...declaration__condition__start-members.html | 2 +- ...__html__declaration__condition__start.html | 2 +- ...1parser_1_1basic__html__ident-members.html | 2 +- ...stdex_1_1parser_1_1basic__html__ident.html | 2 +- ...1_1parser_1_1basic__html__tag-members.html | 2 +- classstdex_1_1parser_1_1basic__html__tag.html | 2 +- ...1parser_1_1basic__html__value-members.html | 2 +- ...stdex_1_1parser_1_1basic__html__value.html | 2 +- ...tdex_1_1parser_1_1basic__iban-members.html | 2 +- classstdex_1_1parser_1_1basic__iban.html | 2 +- ...x_1_1parser_1_1basic__integer-members.html | 2 +- classstdex_1_1parser_1_1basic__integer.html | 2 +- ...1_1parser_1_1basic__integer10-members.html | 2 +- classstdex_1_1parser_1_1basic__integer10.html | 2 +- ...1parser_1_1basic__integer10ts-members.html | 2 +- ...stdex_1_1parser_1_1basic__integer10ts.html | 2 +- ...1_1parser_1_1basic__integer16-members.html | 2 +- classstdex_1_1parser_1_1basic__integer16.html | 2 +- ...arser_1_1basic__ipv4__address-members.html | 2 +- ...dex_1_1parser_1_1basic__ipv4__address.html | 2 +- ...arser_1_1basic__ipv6__address-members.html | 2 +- ...dex_1_1parser_1_1basic__ipv6__address.html | 2 +- ...1basic__ipv6__scope__id__char-members.html | 2 +- ...arser_1_1basic__ipv6__scope__id__char.html | 2 +- ..._1parser_1_1basic__iterations-members.html | 2 +- ...sstdex_1_1parser_1_1basic__iterations.html | 2 +- ...parser_1_1basic__json__string-members.html | 2 +- ...tdex_1_1parser_1_1basic__json__string.html | 2 +- ..._1parser_1_1basic__mime__type-members.html | 2 +- ...sstdex_1_1parser_1_1basic__mime__type.html | 2 +- ...rser_1_1basic__mixed__numeral-members.html | 2 +- ...ex_1_1parser_1_1basic__mixed__numeral.html | 2 +- ...r_1_1basic__monetary__numeral-members.html | 2 +- ...1_1parser_1_1basic__monetary__numeral.html | 2 +- ...tdex_1_1parser_1_1basic__noop-members.html | 2 +- classstdex_1_1parser_1_1basic__noop.html | 2 +- ...ex_1_1parser_1_1basic__parser-members.html | 2 +- classstdex_1_1parser_1_1basic__parser.html | 2 +- ...1parser_1_1basic__permutation-members.html | 2 +- ...stdex_1_1parser_1_1basic__permutation.html | 2 +- ...arser_1_1basic__phone__number-members.html | 2 +- ...dex_1_1parser_1_1basic__phone__number.html | 2 +- ...1_1parser_1_1basic__punct__cu-members.html | 2 +- classstdex_1_1parser_1_1basic__punct__cu.html | 2 +- ...rser_1_1basic__roman__numeral-members.html | 2 +- ...ex_1_1parser_1_1basic__roman__numeral.html | 2 +- ...1_1basic__scientific__numeral-members.html | 2 +- ...1parser_1_1basic__scientific__numeral.html | 2 +- ...dex_1_1parser_1_1basic__score-members.html | 2 +- classstdex_1_1parser_1_1basic__score.html | 2 +- ..._1_1parser_1_1basic__sequence-members.html | 2 +- classstdex_1_1parser_1_1basic__sequence.html | 2 +- ...stdex_1_1parser_1_1basic__set-members.html | 2 +- classstdex_1_1parser_1_1basic__set.html | 2 +- ...arser_1_1basic__si__reference-members.html | 2 +- ...dex_1_1parser_1_1basic__si__reference.html | 2 +- ...sic__si__reference__delimiter-members.html | 2 +- ...er_1_1basic__si__reference__delimiter.html | 2 +- ...1_1basic__si__reference__part-members.html | 2 +- ...1parser_1_1basic__si__reference__part.html | 2 +- ...ser_1_1basic__signed__numeral-members.html | 2 +- ...x_1_1parser_1_1basic__signed__numeral.html | 2 +- ...1_1parser_1_1basic__space__cu-members.html | 2 +- classstdex_1_1parser_1_1basic__space__cu.html | 2 +- ..._1basic__space__or__punct__cu-members.html | 2 +- ...parser_1_1basic__space__or__punct__cu.html | 2 +- ...ex_1_1parser_1_1basic__string-members.html | 2 +- classstdex_1_1parser_1_1basic__string.html | 2 +- ...rser_1_1basic__string__branch-members.html | 2 +- ...ex_1_1parser_1_1basic__string__branch.html | 2 +- ...tdex_1_1parser_1_1basic__time-members.html | 2 +- classstdex_1_1parser_1_1basic__time.html | 2 +- ...stdex_1_1parser_1_1basic__url-members.html | 2 +- classstdex_1_1parser_1_1basic__url.html | 2 +- ...1_1basic__url__password__char-members.html | 2 +- ...1parser_1_1basic__url__password__char.html | 2 +- ...1_1parser_1_1basic__url__path-members.html | 2 +- classstdex_1_1parser_1_1basic__url__path.html | 2 +- ...ser_1_1basic__url__path__char-members.html | 2 +- ...x_1_1parser_1_1basic__url__path__char.html | 2 +- ...1_1basic__url__username__char-members.html | 2 +- ...1parser_1_1basic__url__username__char.html | 2 +- ...tdex_1_1parser_1_1http__agent-members.html | 2 +- classstdex_1_1parser_1_1http__agent.html | 2 +- ..._1_1parser_1_1http__any__type-members.html | 2 +- classstdex_1_1parser_1_1http__any__type.html | 2 +- ...x_1_1parser_1_1http__asterisk-members.html | 2 +- classstdex_1_1parser_1_1http__asterisk.html | 2 +- ...dex_1_1parser_1_1http__cookie-members.html | 2 +- classstdex_1_1parser_1_1http__cookie.html | 2 +- ...er_1_1http__cookie__parameter-members.html | 2 +- ..._1_1parser_1_1http__cookie__parameter.html | 2 +- ...dex_1_1parser_1_1http__header-members.html | 2 +- classstdex_1_1parser_1_1http__header.html | 2 +- ...x_1_1parser_1_1http__language-members.html | 2 +- classstdex_1_1parser_1_1http__language.html | 2 +- ..._1parser_1_1http__line__break-members.html | 2 +- ...sstdex_1_1parser_1_1http__line__break.html | 2 +- ...1parser_1_1http__media__range-members.html | 2 +- ...stdex_1_1parser_1_1http__media__range.html | 2 +- ..._1parser_1_1http__media__type-members.html | 2 +- ...sstdex_1_1parser_1_1http__media__type.html | 2 +- ..._1_1parser_1_1http__parameter-members.html | 2 +- classstdex_1_1parser_1_1http__parameter.html | 2 +- ...x_1_1parser_1_1http__protocol-members.html | 2 +- classstdex_1_1parser_1_1http__protocol.html | 2 +- ...arser_1_1http__quoted__string-members.html | 2 +- ...dex_1_1parser_1_1http__quoted__string.html | 2 +- ...ex_1_1parser_1_1http__request-members.html | 2 +- classstdex_1_1parser_1_1http__request.html | 2 +- ...tdex_1_1parser_1_1http__space-members.html | 2 +- classstdex_1_1parser_1_1http__space.html | 2 +- ...1_1parser_1_1http__text__char-members.html | 2 +- classstdex_1_1parser_1_1http__text__char.html | 2 +- ...tdex_1_1parser_1_1http__token-members.html | 2 +- classstdex_1_1parser_1_1http__token.html | 2 +- ...sstdex_1_1parser_1_1http__url-members.html | 2 +- classstdex_1_1parser_1_1http__url.html | 2 +- ...arser_1_1http__url__parameter-members.html | 2 +- ...dex_1_1parser_1_1http__url__parameter.html | 2 +- ..._1_1parser_1_1http__url__path-members.html | 2 +- classstdex_1_1parser_1_1http__url__path.html | 2 +- ...r_1_1http__url__path__segment-members.html | 2 +- ...1_1parser_1_1http__url__path__segment.html | 2 +- ..._1_1parser_1_1http__url__port-members.html | 2 +- classstdex_1_1parser_1_1http__url__port.html | 2 +- ..._1parser_1_1http__url__server-members.html | 2 +- ...sstdex_1_1parser_1_1http__url__server.html | 2 +- ...tdex_1_1parser_1_1http__value-members.html | 2 +- classstdex_1_1parser_1_1http__value.html | 2 +- ...er_1_1http__value__collection-members.html | 2 +- ..._1_1parser_1_1http__value__collection.html | 2 +- ...dex_1_1parser_1_1http__weight-members.html | 2 +- classstdex_1_1parser_1_1http__weight.html | 2 +- ...rser_1_1http__weighted__value-members.html | 2 +- ...ex_1_1parser_1_1http__weighted__value.html | 2 +- ...1parser_1_1parser__collection-members.html | 2 +- ...stdex_1_1parser_1_1parser__collection.html | 2 +- ...ex_1_1parser_1_1sgml__any__cp-members.html | 2 +- classstdex_1_1parser_1_1sgml__any__cp.html | 2 +- classstdex_1_1parser_1_1sgml__cp-members.html | 2 +- classstdex_1_1parser_1_1sgml__cp.html | 2 +- ...ex_1_1parser_1_1sgml__cp__set-members.html | 2 +- classstdex_1_1parser_1_1sgml__cp__set.html | 2 +- ...er_1_1sgml__dns__domain__char-members.html | 2 +- ..._1_1parser_1_1sgml__dns__domain__char.html | 2 +- ..._1sgml__ipv6__scope__id__char-members.html | 2 +- ...parser_1_1sgml__ipv6__scope__id__char.html | 2 +- ..._1_1parser_1_1sgml__punct__cp-members.html | 2 +- classstdex_1_1parser_1_1sgml__punct__cp.html | 2 +- ..._1_1parser_1_1sgml__space__cp-members.html | 2 +- classstdex_1_1parser_1_1sgml__space__cp.html | 2 +- ...1_1sgml__space__or__punct__cp-members.html | 2 +- ...1parser_1_1sgml__space__or__punct__cp.html | 2 +- ...dex_1_1parser_1_1sgml__string-members.html | 2 +- classstdex_1_1parser_1_1sgml__string.html | 2 +- ..._1_1sgml__url__password__char-members.html | 2 +- ..._1parser_1_1sgml__url__password__char.html | 2 +- ...rser_1_1sgml__url__path__char-members.html | 2 +- ...ex_1_1parser_1_1sgml__url__path__char.html | 2 +- ..._1_1sgml__url__username__char-members.html | 2 +- ..._1parser_1_1sgml__url__username__char.html | 2 +- classstdex_1_1pool-members.html | 2 +- classstdex_1_1pool.html | 2 +- classstdex_1_1progress-members.html | 2 +- classstdex_1_1progress.html | 2 +- classstdex_1_1progress__switcher-members.html | 2 +- classstdex_1_1progress__switcher.html | 2 +- classstdex_1_1ring-members.html | 2 +- classstdex_1_1ring.html | 2 +- classstdex_1_1sha1__hash-members.html | 2 +- classstdex_1_1sha1__hash.html | 2 +- classstdex_1_1spinlock-members.html | 2 +- classstdex_1_1spinlock.html | 2 +- ...ex_1_1stream_1_1async__reader-members.html | 49 +- classstdex_1_1stream_1_1async__reader.html | 54 +- ...ex_1_1stream_1_1async__writer-members.html | 49 +- classstdex_1_1stream_1_1async__writer.html | 54 +- classstdex_1_1stream_1_1basic-members.html | 47 +- classstdex_1_1stream_1_1basic.html | 129 +- ...tdex_1_1stream_1_1basic__file-members.html | 69 +- classstdex_1_1stream_1_1basic__file.html | 54 +- ...stdex_1_1stream_1_1basic__sys-members.html | 55 +- classstdex_1_1stream_1_1basic__sys.html | 54 +- classstdex_1_1stream_1_1buffer-members.html | 49 +- classstdex_1_1stream_1_1buffer.html | 54 +- ...ex_1_1stream_1_1buffered__sys-members.html | 51 +- classstdex_1_1stream_1_1buffered__sys.html | 54 +- classstdex_1_1stream_1_1cache-members.html | 71 +- classstdex_1_1stream_1_1cache.html | 54 +- ...dex_1_1stream_1_1cached__file-members.html | 92 +- classstdex_1_1stream_1_1cached__file.html | 58 +- ...sstdex_1_1stream_1_1converter-members.html | 47 +- classstdex_1_1stream_1_1converter.html | 54 +- ...stdex_1_1stream_1_1diag__file-members.html | 69 +- classstdex_1_1stream_1_1diag__file.html | 54 +- classstdex_1_1stream_1_1fifo-members.html | 51 +- classstdex_1_1stream_1_1fifo.html | 54 +- classstdex_1_1stream_1_1file-members.html | 83 +- classstdex_1_1stream_1_1file.html | 54 +- ...dex_1_1stream_1_1file__window-members.html | 69 +- classstdex_1_1stream_1_1file__window.html | 54 +- classstdex_1_1stream_1_1limiter-members.html | 49 +- classstdex_1_1stream_1_1limiter.html | 54 +- ...dex_1_1stream_1_1memory__file-members.html | 105 +- classstdex_1_1stream_1_1memory__file.html | 54 +- ...stdex_1_1stream_1_1replicator-members.html | 51 +- classstdex_1_1stream_1_1replicator.html | 54 +- ...tream_1_1replicator_1_1worker-members.html | 2 +- ...dex_1_1stream_1_1replicator_1_1worker.html | 2 +- classstdex_1_1stream_1_1socket-members.html | 55 +- classstdex_1_1stream_1_1socket.html | 54 +- classstdex_1_1stream_1_1window-members.html | 53 +- classstdex_1_1stream_1_1window.html | 54 +- classstdex_1_1stream__hasher-members.html | 49 +- classstdex_1_1stream__hasher.html | 54 +- classstdex_1_1sys__object-members.html | 2 +- classstdex_1_1sys__object.html | 2 +- classstdex_1_1user__cancelled-members.html | 2 +- classstdex_1_1user__cancelled.html | 2 +- classstdex_1_1vector__queue-members.html | 2 +- classstdex_1_1vector__queue.html | 2 +- classstdex_1_1watchdog-members.html | 2 +- classstdex_1_1watchdog.html | 2 +- dir_4be4f7b278e009bf0f1906cf31fb73bd.html | 2 +- dir_d44c64559bbebec7f509842c48db8b23.html | 2 +- dir_fca3c47b2ea228727bd6729832f89576.html | 2 +- endian_8hpp_source.html | 2 +- exception_8hpp_source.html | 2 +- files.html | 2 +- functions.html | 6 +- functions_b.html | 2 +- functions_c.html | 2 +- functions_d.html | 2 +- functions_e.html | 2 +- functions_enum.html | 2 +- functions_f.html | 2 +- functions_func.html | 6 +- functions_func_b.html | 2 +- functions_func_c.html | 2 +- functions_func_d.html | 2 +- functions_func_e.html | 2 +- functions_func_f.html | 2 +- functions_func_g.html | 2 +- functions_func_h.html | 2 +- functions_func_i.html | 2 +- functions_func_l.html | 2 +- functions_func_m.html | 2 +- functions_func_n.html | 2 +- functions_func_o.html | 4 +- functions_func_p.html | 2 +- functions_func_q.html | 2 +- functions_func_r.html | 6 +- functions_func_s.html | 2 +- functions_func_t.html | 2 +- functions_func_u.html | 2 +- functions_func_v.html | 2 +- functions_func_w.html | 4 +- functions_func_~.html | 2 +- functions_g.html | 2 +- functions_h.html | 2 +- functions_i.html | 2 +- functions_l.html | 2 +- functions_m.html | 4 +- functions_n.html | 2 +- functions_o.html | 4 +- functions_p.html | 2 +- functions_q.html | 2 +- functions_r.html | 4 +- functions_rela.html | 2 +- functions_s.html | 2 +- functions_t.html | 2 +- functions_type.html | 2 +- functions_u.html | 2 +- functions_v.html | 2 +- functions_vars.html | 2 +- functions_vars_b.html | 2 +- functions_vars_c.html | 2 +- functions_vars_d.html | 2 +- functions_vars_e.html | 2 +- functions_vars_f.html | 2 +- functions_vars_h.html | 2 +- functions_vars_i.html | 2 +- functions_vars_l.html | 2 +- functions_vars_m.html | 4 +- functions_vars_n.html | 2 +- functions_vars_o.html | 2 +- functions_vars_p.html | 2 +- functions_vars_r.html | 2 +- functions_vars_s.html | 2 +- functions_vars_t.html | 2 +- functions_vars_u.html | 2 +- functions_vars_v.html | 2 +- functions_vars_w.html | 2 +- functions_w.html | 4 +- functions_~.html | 2 +- hash_8cpp_source.html | 2 +- hash_8hpp_source.html | 8 +- hex_8hpp_source.html | 2 +- hierarchy.html | 2 +- html_8hpp_source.html | 4558 +++++----- idrec_8hpp_source.html | 14 +- include_2stdex_2compat_8hpp_source.html | 2 +- index.html | 2 +- interval_8hpp_source.html | 2 +- locale_8hpp_source.html | 2 +- mapping_8hpp_source.html | 2 +- math_8cpp_source.html | 2 +- math_8hpp_source.html | 2 +- memory_8hpp_source.html | 2 +- parser_8cpp_source.html | 2 +- parser_8hpp_source.html | 2 +- pch_8hpp_source.html | 2 +- pool_8hpp_source.html | 2 +- progress_8hpp_source.html | 2 +- ring_8cpp_source.html | 2 +- ring_8hpp_source.html | 2 +- search/all_0.js | 4 +- search/all_14.js | 2 +- search/all_a.js | 2 +- search/all_c.js | 2 +- search/all_f.js | 6 +- search/functions_0.js | 4 +- search/functions_14.js | 2 +- search/functions_c.js | 2 +- search/functions_f.js | 4 +- search/variables_9.js | 2 +- sgml_8cpp_source.html | 2 +- sgml_8hpp_source.html | 1100 ++- sgml__unicode_8hpp_source.html | 2 +- socket_8hpp_source.html | 2 +- spinlock_8hpp_source.html | 2 +- stream_8cpp_source.html | 22 +- stream_8hpp_source.html | 7524 ++++++++--------- string_8hpp_source.html | 2456 +++--- ...stdex_1_1chrono_1_1aosn__date-members.html | 2 +- structstdex_1_1chrono_1_1aosn__date.html | 2 +- ..._1_1chrono_1_1aosn__timestamp-members.html | 2 +- structstdex_1_1chrono_1_1aosn__timestamp.html | 2 +- ...stdex_1_1free__locale__delete-members.html | 2 +- structstdex_1_1free__locale__delete.html | 2 +- ...ex_1_1html_1_1element__traits-members.html | 2 +- structstdex_1_1html_1_1element__traits.html | 2 +- structstdex_1_1html_1_1entity-members.html | 2 +- structstdex_1_1html_1_1entity.html | 2 +- ...ex_1_1html_1_1inserted__token-members.html | 2 +- structstdex_1_1html_1_1inserted__token.html | 2 +- structstdex_1_1interval-members.html | 2 +- structstdex_1_1interval.html | 2 +- structstdex_1_1mapping-members.html | 2 +- structstdex_1_1mapping.html | 2 +- structstdex_1_1no__delete-members.html | 2 +- structstdex_1_1no__delete.html | 2 +- ..._1_1no__delete_3_01_t_0f_0e_4-members.html | 2 +- structstdex_1_1no__delete_3_01_t_0f_0e_4.html | 2 +- ..._1_1parser_1_1html__attribute-members.html | 2 +- structstdex_1_1parser_1_1html__attribute.html | 2 +- ...1parser_1_1http__factor__more-members.html | 2 +- ...stdex_1_1parser_1_1http__factor__more.html | 2 +- ...stream_1_1buffer_1_1buffer__t-members.html | 2 +- ...tdex_1_1stream_1_1buffer_1_1buffer__t.html | 2 +- ..._1_1stream_1_1fifo_1_1node__t-members.html | 2 +- structstdex_1_1stream_1_1fifo_1_1node__t.html | 2 +- structstdex_1_1sys__info__t-members.html | 2 +- structstdex_1_1sys__info__t.html | 2 +- structstdex_1_1wav_1_1cue-members.html | 2 +- structstdex_1_1wav_1_1cue.html | 2 +- structstdex_1_1wav_1_1cue__ex-members.html | 2 +- structstdex_1_1wav_1_1cue__ex.html | 2 +- structstdex_1_1wav_1_1data-members.html | 2 +- structstdex_1_1wav_1_1data.html | 2 +- structstdex_1_1wav_1_1format-members.html | 2 +- structstdex_1_1wav_1_1format.html | 2 +- structstdex_1_1wav_1_1header-members.html | 2 +- structstdex_1_1wav_1_1header.html | 2 +- structstdex_1_1wav_1_1label-members.html | 2 +- structstdex_1_1wav_1_1label.html | 2 +- structstdex_1_1wav_1_1list-members.html | 2 +- structstdex_1_1wav_1_1list.html | 2 +- structstdex_1_1wav_1_1ltxt-members.html | 2 +- structstdex_1_1wav_1_1ltxt.html | 2 +- structstdex_1_1wav_1_1note-members.html | 2 +- structstdex_1_1wav_1_1note.html | 2 +- structstdex_1_1wav_1_1silence-members.html | 2 +- structstdex_1_1wav_1_1silence.html | 2 +- structstdex_1_1wav_1_1wave-members.html | 2 +- structstdex_1_1wav_1_1wave.html | 2 +- sys__info_8hpp_source.html | 2 +- system_8hpp_source.html | 2 +- unicode_8cpp_source.html | 2 +- unicode_8hpp_source.html | 95 +- unionstdex_1_1md2__t-members.html | 2 +- unionstdex_1_1md2__t.html | 2 +- unionstdex_1_1sha256__t-members.html | 2 +- unionstdex_1_1sha256__t.html | 2 +- unionstdex_1_1sha__t-members.html | 2 +- unionstdex_1_1sha__t.html | 2 +- uuid_8hpp_source.html | 2 +- vector__queue_8hpp_source.html | 2 +- watchdog_8cpp_source.html | 2 +- watchdog_8hpp_source.html | 2 +- wav_8hpp_source.html | 18 +- windows_8h_source.html | 2 +- 506 files changed, 9712 insertions(+), 9635 deletions(-) diff --git a/_unit_tests_2compat_8hpp_source.html b/_unit_tests_2compat_8hpp_source.html index 5dc175618..4a5cdb884 100644 --- a/_unit_tests_2compat_8hpp_source.html +++ b/_unit_tests_2compat_8hpp_source.html @@ -170,7 +170,7 @@ $(document).ready(function() { init_codefold(0); }); diff --git a/annotated.html b/annotated.html index 285d93a0b..e07488e2d 100644 --- a/annotated.html +++ b/annotated.html @@ -280,7 +280,7 @@ $(function() { diff --git a/base64_8hpp_source.html b/base64_8hpp_source.html index 606246444..e9240967f 100644 --- a/base64_8hpp_source.html +++ b/base64_8hpp_source.html @@ -536,12 +536,12 @@ $(document).ready(function() { init_codefold(0); });
‍UTF-8 byte-order-mark
Definition stream.hpp:79
bool ok() const
Returns true if the stream state is clean i.e. previous operation was succesful.
Definition stream.hpp:175
state_t state() const
Returns stream state after last operation.
Definition stream.hpp:170
-
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:400
-
Modifies data on the fly when reading from/writing to a source stream. Could also be used to modify r...
Definition stream.hpp:1022
+
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:388
+
Modifies data on the fly when reading from/writing to a source stream. Could also be used to modify r...
Definition stream.hpp:1010
diff --git a/chrono_8hpp_source.html b/chrono_8hpp_source.html index e89a8f336..765eab6e6 100644 --- a/chrono_8hpp_source.html +++ b/chrono_8hpp_source.html @@ -466,7 +466,7 @@ $(document).ready(function() { init_codefold(0); }); diff --git a/classes.html b/classes.html index f34700815..545d29141 100644 --- a/classes.html +++ b/classes.html @@ -136,7 +136,7 @@ $(function() { diff --git a/classstdex_1_1base64__dec-members.html b/classstdex_1_1base64__dec-members.html index 9782e7562..4ba7e1faa 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 9616dd4a2..19cdbf197 100644 --- a/classstdex_1_1base64__dec.html +++ b/classstdex_1_1base64__dec.html @@ -239,7 +239,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 58b29567c..6d5132451 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 36937bb64..e402249b0 100644 --- a/classstdex_1_1base64__enc.html +++ b/classstdex_1_1base64__enc.html @@ -244,7 +244,7 @@ template<class _Elem , class _Traits , class _Ax > diff --git a/classstdex_1_1base64__reader-members.html b/classstdex_1_1base64__reader-members.html index ce87b23ec..6dfacf94d 100644 --- a/classstdex_1_1base64__reader-members.html +++ b/classstdex_1_1base64__reader-members.html @@ -136,33 +136,32 @@ $(function() { 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< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline - readln_and_attach(std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)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(const T_from *wstr, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - write_array(_In_reads_or_z_opt_(num_chars) const T_from *wstr, size_t num_chars, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - write_array(const std::basic_string< T_from, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)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_str(const std::basic_string< _Elem, _Traits, _Ax > &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 - ~basic() noexcept(false) (defined in stdex::stream::basic)stdex::stream::basicinlinevirtual + readln(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline + readln(std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline + readln_and_attach(std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)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(const T_from *str, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + write_array(_In_reads_or_z_opt_(num_chars) const T_from *str, size_t num_chars, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + write_array(const std::basic_string< T_from, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)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_str(const std::basic_string< _Elem, _Traits, _Ax > &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 + ~basic() noexcept(false) (defined in stdex::stream::basic)stdex::stream::basicinlinevirtual diff --git a/classstdex_1_1base64__reader.html b/classstdex_1_1base64__reader.html index 6ae5f655f..21806ee18 100644 --- a/classstdex_1_1base64__reader.html +++ b/classstdex_1_1base64__reader.html @@ -154,44 +154,40 @@ void write_byte (uint8 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 T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> -size_t readln (std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - 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 (std::basic_string< _Elem, _Traits, _Ax > &str) + Reads stream to the end-of-line or end-of-file.
+  +template<class T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> +size_t readln (std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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 T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> -size_t readln_and_attach (std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - Reads stream to the end-of-line or end-of-file and append to str.
-  +template<class T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> +size_t readln_and_attach (std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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.
  -template<class T_from , class T_to > -size_t write_array (const T_from *wstr, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  -template<class T_from , class T_to > -size_t write_array (_In_reads_or_z_opt_(num_chars) const T_from *wstr, size_t num_chars, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  -template<class T_from , class T_to , class _Traits = std::char_traits<T_from>, class _Ax = std::allocator<T_from>> -size_t write_array (const std::basic_string< T_from, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  +template<class T_from , class T_to > +size_t write_array (const T_from *str, charset_encoder< T_from, T_to > &encoder) + Writes array of characters to the stream.
+  +template<class T_from , class T_to > +size_t write_array (_In_reads_or_z_opt_(num_chars) const T_from *str, size_t num_chars, charset_encoder< T_from, T_to > &encoder) + Writes array of characters to the stream.
+  +template<class T_from , class T_to , class _Traits = std::char_traits<T_from>, class _Ax = std::allocator<T_from>> +size_t write_array (const std::basic_string< T_from, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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.
@@ -443,7 +439,7 @@ size_t m_num diff --git a/classstdex_1_1base64__writer-members.html b/classstdex_1_1base64__writer-members.html index 41d8b7679..2ed69f6a1 100644 --- a/classstdex_1_1base64__writer-members.html +++ b/classstdex_1_1base64__writer-members.html @@ -137,34 +137,33 @@ $(function() { 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< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline - readln_and_attach(std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)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::base64_writerinlinevirtual - write_array(_In_reads_bytes_opt_(size *count) const void *array, size_t size, size_t count)stdex::stream::basicinline - write_array(const T_from *wstr, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - write_array(_In_reads_or_z_opt_(num_chars) const T_from *wstr, size_t num_chars, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - write_array(const std::basic_string< T_from, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)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_str(const std::basic_string< _Elem, _Traits, _Ax > &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 - ~base64_writer() (defined in stdex::base64_writer)stdex::base64_writerinlinevirtual - ~basic() noexcept(false) (defined in stdex::stream::basic)stdex::stream::basicinlinevirtual + readln(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline + readln(std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline + readln_and_attach(std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)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::base64_writerinlinevirtual + write_array(_In_reads_bytes_opt_(size *count) const void *array, size_t size, size_t count)stdex::stream::basicinline + write_array(const T_from *str, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + write_array(_In_reads_or_z_opt_(num_chars) const T_from *str, size_t num_chars, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + write_array(const std::basic_string< T_from, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)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_str(const std::basic_string< _Elem, _Traits, _Ax > &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 + ~base64_writer() (defined in stdex::base64_writer)stdex::base64_writerinlinevirtual + ~basic() noexcept(false) (defined in stdex::stream::basic)stdex::stream::basicinlinevirtual diff --git a/classstdex_1_1base64__writer.html b/classstdex_1_1base64__writer.html index ce07b7219..4dba5a470 100644 --- a/classstdex_1_1base64__writer.html +++ b/classstdex_1_1base64__writer.html @@ -154,44 +154,40 @@ void write_byte (uint8 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 T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> -size_t readln (std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - 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 (std::basic_string< _Elem, _Traits, _Ax > &str) + Reads stream to the end-of-line or end-of-file.
+  +template<class T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> +size_t readln (std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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 T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> -size_t readln_and_attach (std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - Reads stream to the end-of-line or end-of-file and append to str.
-  +template<class T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> +size_t readln_and_attach (std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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.
  -template<class T_from , class T_to > -size_t write_array (const T_from *wstr, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  -template<class T_from , class T_to > -size_t write_array (_In_reads_or_z_opt_(num_chars) const T_from *wstr, size_t num_chars, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  -template<class T_from , class T_to , class _Traits = std::char_traits<T_from>, class _Ax = std::allocator<T_from>> -size_t write_array (const std::basic_string< T_from, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  +template<class T_from , class T_to > +size_t write_array (const T_from *str, charset_encoder< T_from, T_to > &encoder) + Writes array of characters to the stream.
+  +template<class T_from , class T_to > +size_t write_array (_In_reads_or_z_opt_(num_chars) const T_from *str, size_t num_chars, charset_encoder< T_from, T_to > &encoder) + Writes array of characters to the stream.
+  +template<class T_from , class T_to , class _Traits = std::char_traits<T_from>, class _Ax = std::allocator<T_from>> +size_t write_array (const std::basic_string< T_from, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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.
@@ -450,7 +446,7 @@ size_t m_num diff --git a/classstdex_1_1basic__hash-members.html b/classstdex_1_1basic__hash-members.html index 06d7b8c15..0ea96f666 100644 --- a/classstdex_1_1basic__hash-members.html +++ b/classstdex_1_1basic__hash-members.html @@ -90,7 +90,7 @@ $(function() { diff --git a/classstdex_1_1basic__hash.html b/classstdex_1_1basic__hash.html index 50bf34d70..465535415 100644 --- a/classstdex_1_1basic__hash.html +++ b/classstdex_1_1basic__hash.html @@ -255,7 +255,7 @@ template<class T > diff --git a/classstdex_1_1block__hash-members.html b/classstdex_1_1block__hash-members.html index d9cbd6a15..3174b4c15 100644 --- a/classstdex_1_1block__hash-members.html +++ b/classstdex_1_1block__hash-members.html @@ -94,7 +94,7 @@ $(function() { diff --git a/classstdex_1_1block__hash.html b/classstdex_1_1block__hash.html index 39f6c352f..a3b3d74a9 100644 --- a/classstdex_1_1block__hash.html +++ b/classstdex_1_1block__hash.html @@ -245,7 +245,7 @@ template<class T > diff --git a/classstdex_1_1charset__encoder-members.html b/classstdex_1_1charset__encoder-members.html index aba812817..8a60e922f 100644 --- a/classstdex_1_1charset__encoder-members.html +++ b/classstdex_1_1charset__encoder-members.html @@ -102,7 +102,7 @@ $(function() { diff --git a/classstdex_1_1charset__encoder.html b/classstdex_1_1charset__encoder.html index 67ef5f807..afa024cff 100644 --- a/classstdex_1_1charset__encoder.html +++ b/classstdex_1_1charset__encoder.html @@ -607,7 +607,7 @@ template<class _Traits_to = std::char_traits<T_to>, class _Alloc_to = diff --git a/classstdex_1_1crc32__hash-members.html b/classstdex_1_1crc32__hash-members.html index 18ccb1909..74dbafec6 100644 --- a/classstdex_1_1crc32__hash-members.html +++ b/classstdex_1_1crc32__hash-members.html @@ -90,7 +90,7 @@ $(function() { diff --git a/classstdex_1_1crc32__hash.html b/classstdex_1_1crc32__hash.html index 5cb131956..f2b0e93c4 100644 --- a/classstdex_1_1crc32__hash.html +++ b/classstdex_1_1crc32__hash.html @@ -245,7 +245,7 @@ crc32_t m_value diff --git a/classstdex_1_1global__progress-members.html b/classstdex_1_1global__progress-members.html index cfa378ec8..3d24b30a7 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 bedfe8513..aea9bea59 100644 --- a/classstdex_1_1global__progress.html +++ b/classstdex_1_1global__progress.html @@ -547,7 +547,7 @@ template<class T > diff --git a/classstdex_1_1hex__dec-members.html b/classstdex_1_1hex__dec-members.html index 627649f75..280cb0d51 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 bcfba4de1..eef90accb 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 a8a9aaa05..87e21e7c4 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 2f7b9b0d0..8af0c9793 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_1html_1_1comment-members.html b/classstdex_1_1html_1_1comment-members.html index 2aac4c955..96ca4172e 100644 --- a/classstdex_1_1html_1_1comment-members.html +++ b/classstdex_1_1html_1_1comment-members.html @@ -90,7 +90,7 @@ $(function() { diff --git a/classstdex_1_1html_1_1comment.html b/classstdex_1_1html_1_1comment.html index 853737d42..952090485 100644 --- a/classstdex_1_1html_1_1comment.html +++ b/classstdex_1_1html_1_1comment.html @@ -135,7 +135,7 @@ stdex::parser::html_sequence_t  diff --git a/classstdex_1_1html_1_1declaration-members.html b/classstdex_1_1html_1_1declaration-members.html index 8fde39085..854d53ca2 100644 --- a/classstdex_1_1html_1_1declaration-members.html +++ b/classstdex_1_1html_1_1declaration-members.html @@ -91,7 +91,7 @@ $(function() { diff --git a/classstdex_1_1html_1_1declaration.html b/classstdex_1_1html_1_1declaration.html index 767f2d1ab..ecf6ef990 100644 --- a/classstdex_1_1html_1_1declaration.html +++ b/classstdex_1_1html_1_1declaration.html @@ -139,7 +139,7 @@ stdex::parser::html_sequence_t  diff --git a/classstdex_1_1html_1_1document-members.html b/classstdex_1_1html_1_1document-members.html index 71416118b..d61f11efa 100644 --- a/classstdex_1_1html_1_1document-members.html +++ b/classstdex_1_1html_1_1document-members.html @@ -81,8 +81,8 @@ $(function() {

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

- - + + @@ -107,7 +107,7 @@ $(function() {
active_element() conststdex::html::document< _Elem, _Traits, _Alloc >inlineprotected
append(_In_reads_or_z_opt_(num_chars) const _Elem *source, size_t num_chars=SIZE_MAX)stdex::html::document< _Elem, _Traits, _Alloc >inline
assign(_In_reads_or_z_opt_(num_chars) const _Elem *source, size_t num_chars=SIZE_MAX)stdex::html::document< _Elem, _Traits, _Alloc >inline
append(_In_reads_or_z_opt_(num_chars) const _Elem *source, size_t num_chars)stdex::html::document< _Elem, _Traits, _Alloc >inline
assign(_In_reads_or_z_opt_(num_chars) const _Elem *source, size_t num_chars)stdex::html::document< _Elem, _Traits, _Alloc >inline
clear()stdex::html::document< _Elem, _Traits, _Alloc >inline
document() (defined in stdex::html::document< _Elem, _Traits, _Alloc >)stdex::html::document< _Elem, _Traits, _Alloc >inline
finalize()stdex::html::document< _Elem, _Traits, _Alloc >inline
diff --git a/classstdex_1_1html_1_1document.html b/classstdex_1_1html_1_1document.html index 963c5e9b6..4a7ecc4dd 100644 --- a/classstdex_1_1html_1_1document.html +++ b/classstdex_1_1html_1_1document.html @@ -95,18 +95,18 @@ Public Member Functions void clear ()  Empties document.
  - -void append (_In_reads_or_z_opt_(num_chars) const _Elem *source, size_t num_chars=SIZE_MAX) - Parses HTML source code by chunks.
-  + +void append (_In_reads_or_z_opt_(num_chars) const _Elem *source, size_t num_chars) + Parses HTML source code by chunks.
void finalize ()  Finalizes document when no more appending is planned.
  - -void assign (_In_reads_or_z_opt_(num_chars) const _Elem *source, size_t num_chars=SIZE_MAX) - Parses HTML document source code.
-  + +void assign (_In_reads_or_z_opt_(num_chars) const _Elem *source, size_t num_chars) + Parses HTML document source code.
const std::basic_string< _Elem, _Traits, _Alloc > & source () const  Returns document HTML source code.
@@ -197,7 +197,7 @@ class stdex::html::document< _Elem, _Traits, _Alloc >

HTML documen

diff --git a/classstdex_1_1html_1_1element-members.html b/classstdex_1_1html_1_1element-members.html index cf1f75329..f7a6e5e8c 100644 --- a/classstdex_1_1html_1_1element-members.html +++ b/classstdex_1_1html_1_1element-members.html @@ -93,7 +93,7 @@ $(function() { diff --git a/classstdex_1_1html_1_1element.html b/classstdex_1_1html_1_1element.html index 354ee45bb..4aeffbd25 100644 --- a/classstdex_1_1html_1_1element.html +++ b/classstdex_1_1html_1_1element.html @@ -152,7 +152,7 @@ stdex::parser::html_sequence_t  diff --git a/classstdex_1_1html_1_1element__end-members.html b/classstdex_1_1html_1_1element__end-members.html index b38dc69f9..cc3c5cb98 100644 --- a/classstdex_1_1html_1_1element__end-members.html +++ b/classstdex_1_1html_1_1element__end-members.html @@ -92,7 +92,7 @@ $(function() { diff --git a/classstdex_1_1html_1_1element__end.html b/classstdex_1_1html_1_1element__end.html index b768550e1..7b2315d87 100644 --- a/classstdex_1_1html_1_1element__end.html +++ b/classstdex_1_1html_1_1element__end.html @@ -143,7 +143,7 @@ stdex::parser::html_sequence_t  diff --git a/classstdex_1_1html_1_1element__start-members.html b/classstdex_1_1html_1_1element__start-members.html index 8ec15692c..9ba4da705 100644 --- a/classstdex_1_1html_1_1element__start-members.html +++ b/classstdex_1_1html_1_1element__start-members.html @@ -95,7 +95,7 @@ $(function() { diff --git a/classstdex_1_1html_1_1element__start.html b/classstdex_1_1html_1_1element__start.html index 79fed20aa..bf08528d0 100644 --- a/classstdex_1_1html_1_1element__start.html +++ b/classstdex_1_1html_1_1element__start.html @@ -162,7 +162,7 @@ template<class T > diff --git a/classstdex_1_1html_1_1instruction-members.html b/classstdex_1_1html_1_1instruction-members.html index 96b66e4b2..cf71b8fd3 100644 --- a/classstdex_1_1html_1_1instruction-members.html +++ b/classstdex_1_1html_1_1instruction-members.html @@ -90,7 +90,7 @@ $(function() { diff --git a/classstdex_1_1html_1_1instruction.html b/classstdex_1_1html_1_1instruction.html index bf5da97ea..4e53a2314 100644 --- a/classstdex_1_1html_1_1instruction.html +++ b/classstdex_1_1html_1_1instruction.html @@ -135,7 +135,7 @@ stdex::parser::html_sequence_t  diff --git a/classstdex_1_1html_1_1parser-members.html b/classstdex_1_1html_1_1parser-members.html index 60d18174d..bcf5ac51e 100644 --- a/classstdex_1_1html_1_1parser-members.html +++ b/classstdex_1_1html_1_1parser-members.html @@ -98,7 +98,7 @@ $(function() { m_progressstdex::html::parser< _Elem, _Traits, _Alloc >protected m_sourcestdex::html::parser< _Elem, _Traits, _Alloc >protected m_tokensstdex::html::parser< _Elem, _Traits, _Alloc >protected - m_urlstdex::html::parser< _Elem, _Traits, _Alloc >protected + m_urlstdex::html::parser< _Elem, _Traits, _Alloc >protected make_absolute_url(std::basic_string< _Elem, _Traits, _Alloc > &rel)stdex::html::parser< _Elem, _Traits, _Alloc >inline merge(token_list &a, const token_list &b)stdex::html::parser< _Elem, _Traits, _Alloc >inlinestatic parse()stdex::html::parser< _Elem, _Traits, _Alloc >inline @@ -110,7 +110,7 @@ $(function() { diff --git a/classstdex_1_1html_1_1parser.html b/classstdex_1_1html_1_1parser.html index fcbae66dc..11bbeb093 100644 --- a/classstdex_1_1html_1_1parser.html +++ b/classstdex_1_1html_1_1parser.html @@ -147,10 +147,10 @@ Protected Attributes const document< _Elem, _Traits, _Alloc > & m_document  Document being analyzed.
  - -const stdex::sys_string m_url - Absolute document URL.
-  + +const stdex::sstring m_url + Absolute document URL.
const bool m_parse_frames  Parse frames.
@@ -618,7 +618,7 @@ template<class _Elem , class _Traits , class _Alloc > diff --git a/classstdex_1_1html_1_1sequence-members.html b/classstdex_1_1html_1_1sequence-members.html index 56e6d6993..6d5c15ffb 100644 --- a/classstdex_1_1html_1_1sequence-members.html +++ b/classstdex_1_1html_1_1sequence-members.html @@ -88,7 +88,7 @@ $(function() { diff --git a/classstdex_1_1html_1_1sequence.html b/classstdex_1_1html_1_1sequence.html index c12070c7d..9f2520176 100644 --- a/classstdex_1_1html_1_1sequence.html +++ b/classstdex_1_1html_1_1sequence.html @@ -130,7 +130,7 @@ stdex::parser::html_sequence_t  diff --git a/classstdex_1_1html_1_1starting__token-members.html b/classstdex_1_1html_1_1starting__token-members.html index 429bae654..27a079224 100644 --- a/classstdex_1_1html_1_1starting__token-members.html +++ b/classstdex_1_1html_1_1starting__token-members.html @@ -99,7 +99,7 @@ $(function() { diff --git a/classstdex_1_1html_1_1starting__token.html b/classstdex_1_1html_1_1starting__token.html index cadf51d44..3add0d264 100644 --- a/classstdex_1_1html_1_1starting__token.html +++ b/classstdex_1_1html_1_1starting__token.html @@ -181,7 +181,7 @@ class stdex::html::starting_token< _Elem, _Traits, _Alloc >

Token

diff --git a/classstdex_1_1html_1_1text__token-members.html b/classstdex_1_1html_1_1text__token-members.html index d7204aa37..1f8275941 100644 --- a/classstdex_1_1html_1_1text__token-members.html +++ b/classstdex_1_1html_1_1text__token-members.html @@ -96,7 +96,7 @@ $(function() { diff --git a/classstdex_1_1html_1_1text__token.html b/classstdex_1_1html_1_1text__token.html index 56b3dc867..7899a336c 100644 --- a/classstdex_1_1html_1_1text__token.html +++ b/classstdex_1_1html_1_1text__token.html @@ -168,7 +168,7 @@ class stdex::html::text_token< _Elem, _Traits, _Alloc >

Token repr

diff --git a/classstdex_1_1html_1_1token-members.html b/classstdex_1_1html_1_1token-members.html index 28d9be21b..cdcf70182 100644 --- a/classstdex_1_1html_1_1token-members.html +++ b/classstdex_1_1html_1_1token-members.html @@ -92,7 +92,7 @@ $(function() { diff --git a/classstdex_1_1html_1_1token.html b/classstdex_1_1html_1_1token.html index adbd32832..e6497119a 100644 --- a/classstdex_1_1html_1_1token.html +++ b/classstdex_1_1html_1_1token.html @@ -231,7 +231,7 @@ template<class _Traits = std::char_traits<wchar_t>, class _Alloc = st diff --git a/classstdex_1_1html_1_1url__token-members.html b/classstdex_1_1html_1_1url__token-members.html index b112be996..fec5488c5 100644 --- a/classstdex_1_1html_1_1url__token-members.html +++ b/classstdex_1_1html_1_1url__token-members.html @@ -95,7 +95,7 @@ $(function() { diff --git a/classstdex_1_1html_1_1url__token.html b/classstdex_1_1html_1_1url__token.html index 83aa22152..742ed0fa7 100644 --- a/classstdex_1_1html_1_1url__token.html +++ b/classstdex_1_1html_1_1url__token.html @@ -163,7 +163,7 @@ class stdex::html::url_token< _Elem, _Traits, _Alloc >

HTTP token

diff --git a/classstdex_1_1idrec_1_1record-members.html b/classstdex_1_1idrec_1_1record-members.html index c82151eb4..8db8a9755 100644 --- a/classstdex_1_1idrec_1_1record-members.html +++ b/classstdex_1_1idrec_1_1record-members.html @@ -100,7 +100,7 @@ $(function() { diff --git a/classstdex_1_1idrec_1_1record.html b/classstdex_1_1idrec_1_1record.html index 7bd6620b8..47a44a2a6 100644 --- a/classstdex_1_1idrec_1_1record.html +++ b/classstdex_1_1idrec_1_1record.html @@ -837,7 +837,7 @@ template<class T , class T_ID , const T_ID ID, class T_SIZE , T_SIZE ALIGN> diff --git a/classstdex_1_1lazy__progress-members.html b/classstdex_1_1lazy__progress-members.html index 67772d3e7..8f957ba41 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 7d68a7fe4..f42fc404c 100644 --- a/classstdex_1_1lazy__progress.html +++ b/classstdex_1_1lazy__progress.html @@ -279,7 +279,7 @@ template<class T > diff --git a/classstdex_1_1md5__hash-members.html b/classstdex_1_1md5__hash-members.html index b56d50203..a13a4d2f5 100644 --- a/classstdex_1_1md5__hash-members.html +++ b/classstdex_1_1md5__hash-members.html @@ -93,7 +93,7 @@ $(function() { diff --git a/classstdex_1_1md5__hash.html b/classstdex_1_1md5__hash.html index 1cde214ba..e93f85452 100644 --- a/classstdex_1_1md5__hash.html +++ b/classstdex_1_1md5__hash.html @@ -259,7 +259,7 @@ uint32_t m_temp [16] diff --git a/classstdex_1_1parser_1_1basic__angle-members.html b/classstdex_1_1parser_1_1basic__angle-members.html index 6337f3fb5..85c833a84 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 6678db5ec..db68b6512 100644 --- a/classstdex_1_1parser_1_1basic__angle.html +++ b/classstdex_1_1parser_1_1basic__angle.html @@ -244,7 +244,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__any__cu-members.html b/classstdex_1_1parser_1_1basic__any__cu-members.html index 425044117..fad13169b 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 a74cc45dc..b9a1dd104 100644 --- a/classstdex_1_1parser_1_1basic__any__cu.html +++ b/classstdex_1_1parser_1_1basic__any__cu.html @@ -191,7 +191,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__bol-members.html b/classstdex_1_1parser_1_1basic__bol-members.html index c50a97903..be94615f0 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 ae65a93d3..b34582a95 100644 --- a/classstdex_1_1parser_1_1basic__bol.html +++ b/classstdex_1_1parser_1_1basic__bol.html @@ -198,7 +198,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__branch-members.html b/classstdex_1_1parser_1_1basic__branch-members.html index 6ec2737d4..bb8115345 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 dad4f693f..374624a6c 100644 --- a/classstdex_1_1parser_1_1basic__branch.html +++ b/classstdex_1_1parser_1_1basic__branch.html @@ -253,7 +253,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__chemical__formula-members.html b/classstdex_1_1parser_1_1basic__chemical__formula-members.html index db4e98246..31addbfd6 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 5b569539e..0e6e06378 100644 --- a/classstdex_1_1parser_1_1basic__chemical__formula.html +++ b/classstdex_1_1parser_1_1basic__chemical__formula.html @@ -239,7 +239,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__creditor__reference-members.html b/classstdex_1_1parser_1_1basic__creditor__reference-members.html index 2e8b4b3b2..94677d045 100644 --- a/classstdex_1_1parser_1_1basic__creditor__reference-members.html +++ b/classstdex_1_1parser_1_1basic__creditor__reference-members.html @@ -96,7 +96,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__creditor__reference.html b/classstdex_1_1parser_1_1basic__creditor__reference.html index 059e0b769..037845e99 100644 --- a/classstdex_1_1parser_1_1basic__creditor__reference.html +++ b/classstdex_1_1parser_1_1basic__creditor__reference.html @@ -240,7 +240,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__css__cdc-members.html b/classstdex_1_1parser_1_1basic__css__cdc-members.html index fda80831f..f5ba3c2b2 100644 --- a/classstdex_1_1parser_1_1basic__css__cdc-members.html +++ b/classstdex_1_1parser_1_1basic__css__cdc-members.html @@ -92,7 +92,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__css__cdc.html b/classstdex_1_1parser_1_1basic__css__cdc.html index 3b1e05345..1f9fe5da5 100644 --- a/classstdex_1_1parser_1_1basic__css__cdc.html +++ b/classstdex_1_1parser_1_1basic__css__cdc.html @@ -139,7 +139,7 @@ class stdex::parser::basic_css_cdc< T >

Legacy CSS comment end

diff --git a/classstdex_1_1parser_1_1basic__css__cdo-members.html b/classstdex_1_1parser_1_1basic__css__cdo-members.html index 78875c0f7..ee7c16e56 100644 --- a/classstdex_1_1parser_1_1basic__css__cdo-members.html +++ b/classstdex_1_1parser_1_1basic__css__cdo-members.html @@ -92,7 +92,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__css__cdo.html b/classstdex_1_1parser_1_1basic__css__cdo.html index 804bc241a..ba53063c5 100644 --- a/classstdex_1_1parser_1_1basic__css__cdo.html +++ b/classstdex_1_1parser_1_1basic__css__cdo.html @@ -139,7 +139,7 @@ class stdex::parser::basic_css_cdo< T >

Legacy CSS comment start <

diff --git a/classstdex_1_1parser_1_1basic__css__comment-members.html b/classstdex_1_1parser_1_1basic__css__comment-members.html index d7e708b81..10d930d14 100644 --- a/classstdex_1_1parser_1_1basic__css__comment-members.html +++ b/classstdex_1_1parser_1_1basic__css__comment-members.html @@ -93,7 +93,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__css__comment.html b/classstdex_1_1parser_1_1basic__css__comment.html index 43c646b35..cac10396f 100644 --- a/classstdex_1_1parser_1_1basic__css__comment.html +++ b/classstdex_1_1parser_1_1basic__css__comment.html @@ -176,7 +176,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__css__import-members.html b/classstdex_1_1parser_1_1basic__css__import-members.html index c81850747..18bf4915a 100644 --- a/classstdex_1_1parser_1_1basic__css__import-members.html +++ b/classstdex_1_1parser_1_1basic__css__import-members.html @@ -93,7 +93,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__css__import.html b/classstdex_1_1parser_1_1basic__css__import.html index 39031686c..8c2c0a1bf 100644 --- a/classstdex_1_1parser_1_1basic__css__import.html +++ b/classstdex_1_1parser_1_1basic__css__import.html @@ -176,7 +176,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__css__string-members.html b/classstdex_1_1parser_1_1basic__css__string-members.html index 6c8355b46..949abc48c 100644 --- a/classstdex_1_1parser_1_1basic__css__string-members.html +++ b/classstdex_1_1parser_1_1basic__css__string-members.html @@ -93,7 +93,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__css__string.html b/classstdex_1_1parser_1_1basic__css__string.html index 10ccb90d3..2d239b4ec 100644 --- a/classstdex_1_1parser_1_1basic__css__string.html +++ b/classstdex_1_1parser_1_1basic__css__string.html @@ -176,7 +176,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__css__uri-members.html b/classstdex_1_1parser_1_1basic__css__uri-members.html index 7a3f15d97..5e276b5c5 100644 --- a/classstdex_1_1parser_1_1basic__css__uri-members.html +++ b/classstdex_1_1parser_1_1basic__css__uri-members.html @@ -93,7 +93,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__css__uri.html b/classstdex_1_1parser_1_1basic__css__uri.html index 25454538e..82aadb468 100644 --- a/classstdex_1_1parser_1_1basic__css__uri.html +++ b/classstdex_1_1parser_1_1basic__css__uri.html @@ -176,7 +176,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__cu-members.html b/classstdex_1_1parser_1_1basic__cu-members.html index cc8d2f196..9d10bd161 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 2cd922ecf..8fa3de28a 100644 --- a/classstdex_1_1parser_1_1basic__cu.html +++ b/classstdex_1_1parser_1_1basic__cu.html @@ -201,7 +201,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__cu__set-members.html b/classstdex_1_1parser_1_1basic__cu__set-members.html index 3439fae18..1f503e573 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 000beea7a..6e3b8684d 100644 --- a/classstdex_1_1parser_1_1basic__cu__set.html +++ b/classstdex_1_1parser_1_1basic__cu__set.html @@ -210,7 +210,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__date-members.html b/classstdex_1_1parser_1_1basic__date-members.html index fa945defe..af7fbd3aa 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 8dc6433f4..8e439aeb4 100644 --- a/classstdex_1_1parser_1_1basic__date.html +++ b/classstdex_1_1parser_1_1basic__date.html @@ -252,7 +252,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__dns__domain__char-members.html b/classstdex_1_1parser_1_1basic__dns__domain__char-members.html index 24c5a0bac..6d39095e4 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 d5d0a6770..0f3c51728 100644 --- a/classstdex_1_1parser_1_1basic__dns__domain__char.html +++ b/classstdex_1_1parser_1_1basic__dns__domain__char.html @@ -203,7 +203,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__dns__name-members.html b/classstdex_1_1parser_1_1basic__dns__name-members.html index 24517699a..642f8e6bf 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 a7a16523c..2bac74696 100644 --- a/classstdex_1_1parser_1_1basic__dns__name.html +++ b/classstdex_1_1parser_1_1basic__dns__name.html @@ -205,7 +205,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__email__address-members.html b/classstdex_1_1parser_1_1basic__email__address-members.html index a708d6c1d..7ebc8cc7b 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 9486b94f7..95604cfb6 100644 --- a/classstdex_1_1parser_1_1basic__email__address.html +++ b/classstdex_1_1parser_1_1basic__email__address.html @@ -245,7 +245,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__emoticon-members.html b/classstdex_1_1parser_1_1basic__emoticon-members.html index a9d09e050..7ac2c0531 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 dce96b448..86f25af84 100644 --- a/classstdex_1_1parser_1_1basic__emoticon.html +++ b/classstdex_1_1parser_1_1basic__emoticon.html @@ -243,7 +243,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__eol-members.html b/classstdex_1_1parser_1_1basic__eol-members.html index 9e9ab261c..139a55e51 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 adc211371..6fe9c08c3 100644 --- a/classstdex_1_1parser_1_1basic__eol.html +++ b/classstdex_1_1parser_1_1basic__eol.html @@ -198,7 +198,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__fraction-members.html b/classstdex_1_1parser_1_1basic__fraction-members.html index 6fdb07e65..fe343f1ae 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 a2c494f9f..b66c6f71f 100644 --- a/classstdex_1_1parser_1_1basic__fraction.html +++ b/classstdex_1_1parser_1_1basic__fraction.html @@ -232,7 +232,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__html__declaration__condition__end-members.html b/classstdex_1_1parser_1_1basic__html__declaration__condition__end-members.html index 09fd65845..804e93d02 100644 --- a/classstdex_1_1parser_1_1basic__html__declaration__condition__end-members.html +++ b/classstdex_1_1parser_1_1basic__html__declaration__condition__end-members.html @@ -92,7 +92,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__html__declaration__condition__end.html b/classstdex_1_1parser_1_1basic__html__declaration__condition__end.html index a5a797def..261f73707 100644 --- a/classstdex_1_1parser_1_1basic__html__declaration__condition__end.html +++ b/classstdex_1_1parser_1_1basic__html__declaration__condition__end.html @@ -139,7 +139,7 @@ class stdex::parser::basic_html_declaration_condition_end< T >

End

diff --git a/classstdex_1_1parser_1_1basic__html__declaration__condition__start-members.html b/classstdex_1_1parser_1_1basic__html__declaration__condition__start-members.html index e8540a71f..369f23c37 100644 --- a/classstdex_1_1parser_1_1basic__html__declaration__condition__start-members.html +++ b/classstdex_1_1parser_1_1basic__html__declaration__condition__start-members.html @@ -93,7 +93,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__html__declaration__condition__start.html b/classstdex_1_1parser_1_1basic__html__declaration__condition__start.html index aec3fb58b..d91196c17 100644 --- a/classstdex_1_1parser_1_1basic__html__declaration__condition__start.html +++ b/classstdex_1_1parser_1_1basic__html__declaration__condition__start.html @@ -175,7 +175,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__html__ident-members.html b/classstdex_1_1parser_1_1basic__html__ident-members.html index d549af99b..3de6b92ac 100644 --- a/classstdex_1_1parser_1_1basic__html__ident-members.html +++ b/classstdex_1_1parser_1_1basic__html__ident-members.html @@ -92,7 +92,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__html__ident.html b/classstdex_1_1parser_1_1basic__html__ident.html index 3a77bc541..1e4799f74 100644 --- a/classstdex_1_1parser_1_1basic__html__ident.html +++ b/classstdex_1_1parser_1_1basic__html__ident.html @@ -139,7 +139,7 @@ class stdex::parser::basic_html_ident< T >

Contiguous sequence of

diff --git a/classstdex_1_1parser_1_1basic__html__tag-members.html b/classstdex_1_1parser_1_1basic__html__tag-members.html index a45224778..952493e70 100644 --- a/classstdex_1_1parser_1_1basic__html__tag-members.html +++ b/classstdex_1_1parser_1_1basic__html__tag-members.html @@ -98,7 +98,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__html__tag.html b/classstdex_1_1parser_1_1basic__html__tag.html index 85cf6490c..cad779ae4 100644 --- a/classstdex_1_1parser_1_1basic__html__tag.html +++ b/classstdex_1_1parser_1_1basic__html__tag.html @@ -194,7 +194,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__html__value-members.html b/classstdex_1_1parser_1_1basic__html__value-members.html index e9e3042ca..41e282d94 100644 --- a/classstdex_1_1parser_1_1basic__html__value-members.html +++ b/classstdex_1_1parser_1_1basic__html__value-members.html @@ -93,7 +93,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__html__value.html b/classstdex_1_1parser_1_1basic__html__value.html index b94cefbaf..76e890125 100644 --- a/classstdex_1_1parser_1_1basic__html__value.html +++ b/classstdex_1_1parser_1_1basic__html__value.html @@ -176,7 +176,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__iban-members.html b/classstdex_1_1parser_1_1basic__iban-members.html index 1c4c1c46f..6e9d4b376 100644 --- a/classstdex_1_1parser_1_1basic__iban-members.html +++ b/classstdex_1_1parser_1_1basic__iban-members.html @@ -97,7 +97,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__iban.html b/classstdex_1_1parser_1_1basic__iban.html index 62fc1adb2..0b4a7207c 100644 --- a/classstdex_1_1parser_1_1basic__iban.html +++ b/classstdex_1_1parser_1_1basic__iban.html @@ -244,7 +244,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__integer-members.html b/classstdex_1_1parser_1_1basic__integer-members.html index 28efedf88..3d7bf2c2d 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 293f8915a..a249a47e0 100644 --- a/classstdex_1_1parser_1_1basic__integer.html +++ b/classstdex_1_1parser_1_1basic__integer.html @@ -180,7 +180,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__integer10-members.html b/classstdex_1_1parser_1_1basic__integer10-members.html index 5132c137b..10b9fac6d 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 9c5b02fab..6f3e4ba5a 100644 --- a/classstdex_1_1parser_1_1basic__integer10.html +++ b/classstdex_1_1parser_1_1basic__integer10.html @@ -234,7 +234,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__integer10ts-members.html b/classstdex_1_1parser_1_1basic__integer10ts-members.html index a2cb96455..529ac6543 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 24a344d70..c04d70708 100644 --- a/classstdex_1_1parser_1_1basic__integer10ts.html +++ b/classstdex_1_1parser_1_1basic__integer10ts.html @@ -248,7 +248,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__integer16-members.html b/classstdex_1_1parser_1_1basic__integer16-members.html index 15c3e0d9e..a4c0d4ec2 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 55ab22919..a872cfaa3 100644 --- a/classstdex_1_1parser_1_1basic__integer16.html +++ b/classstdex_1_1parser_1_1basic__integer16.html @@ -252,7 +252,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__ipv4__address-members.html b/classstdex_1_1parser_1_1basic__ipv4__address-members.html index 996203f70..51bec3be1 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 bde842ce4..b7fb5f22a 100644 --- a/classstdex_1_1parser_1_1basic__ipv4__address.html +++ b/classstdex_1_1parser_1_1basic__ipv4__address.html @@ -265,7 +265,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__ipv6__address-members.html b/classstdex_1_1parser_1_1basic__ipv6__address-members.html index 11ea26a04..6926e5ef1 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 b955a61f3..7d9b309db 100644 --- a/classstdex_1_1parser_1_1basic__ipv6__address.html +++ b/classstdex_1_1parser_1_1basic__ipv6__address.html @@ -290,7 +290,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__ipv6__scope__id__char-members.html b/classstdex_1_1parser_1_1basic__ipv6__scope__id__char-members.html index e0166e9c5..cd1c769e9 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 40b1162bd..781ada9e4 100644 --- a/classstdex_1_1parser_1_1basic__ipv6__scope__id__char.html +++ b/classstdex_1_1parser_1_1basic__ipv6__scope__id__char.html @@ -191,7 +191,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__iterations-members.html b/classstdex_1_1parser_1_1basic__iterations-members.html index 2afad510a..34f5c5c2b 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 9e41bb821..25363e52f 100644 --- a/classstdex_1_1parser_1_1basic__iterations.html +++ b/classstdex_1_1parser_1_1basic__iterations.html @@ -211,7 +211,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__json__string-members.html b/classstdex_1_1parser_1_1basic__json__string-members.html index a63ed736d..957302d69 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 1307949e4..57decce76 100644 --- a/classstdex_1_1parser_1_1basic__json__string.html +++ b/classstdex_1_1parser_1_1basic__json__string.html @@ -260,7 +260,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__mime__type-members.html b/classstdex_1_1parser_1_1basic__mime__type-members.html index 6a71cfa03..da74d1b03 100644 --- a/classstdex_1_1parser_1_1basic__mime__type-members.html +++ b/classstdex_1_1parser_1_1basic__mime__type-members.html @@ -95,7 +95,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__mime__type.html b/classstdex_1_1parser_1_1basic__mime__type.html index 1c8d20ecc..189114dc3 100644 --- a/classstdex_1_1parser_1_1basic__mime__type.html +++ b/classstdex_1_1parser_1_1basic__mime__type.html @@ -184,7 +184,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__mixed__numeral-members.html b/classstdex_1_1parser_1_1basic__mixed__numeral-members.html index 56afc3f9e..692c0b52c 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 fe239a54f..d142bc243 100644 --- a/classstdex_1_1parser_1_1basic__mixed__numeral.html +++ b/classstdex_1_1parser_1_1basic__mixed__numeral.html @@ -247,7 +247,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__monetary__numeral-members.html b/classstdex_1_1parser_1_1basic__monetary__numeral-members.html index 8a9f3fce2..79b5b1329 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 0fffdfe9f..f48e1eae7 100644 --- a/classstdex_1_1parser_1_1basic__monetary__numeral.html +++ b/classstdex_1_1parser_1_1basic__monetary__numeral.html @@ -251,7 +251,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__noop-members.html b/classstdex_1_1parser_1_1basic__noop-members.html index 588368c55..182959843 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 3b71ade43..75deb29f2 100644 --- a/classstdex_1_1parser_1_1basic__noop.html +++ b/classstdex_1_1parser_1_1basic__noop.html @@ -188,7 +188,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__parser-members.html b/classstdex_1_1parser_1_1basic__parser-members.html index 81a16e84c..76799e3f4 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 7b5a70b2d..a7a854fc8 100644 --- a/classstdex_1_1parser_1_1basic__parser.html +++ b/classstdex_1_1parser_1_1basic__parser.html @@ -212,7 +212,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 b4bfa8bb5..326ae185a 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 50a5d6434..49c8c3896 100644 --- a/classstdex_1_1parser_1_1basic__permutation.html +++ b/classstdex_1_1parser_1_1basic__permutation.html @@ -216,7 +216,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__phone__number-members.html b/classstdex_1_1parser_1_1basic__phone__number-members.html index 74a94eacd..589eb0fc5 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 a50dd101b..3afa2511f 100644 --- a/classstdex_1_1parser_1_1basic__phone__number.html +++ b/classstdex_1_1parser_1_1basic__phone__number.html @@ -246,7 +246,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__punct__cu-members.html b/classstdex_1_1parser_1_1basic__punct__cu-members.html index ba77167b6..5e525a577 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 0b2e03c6c..2afe9933b 100644 --- a/classstdex_1_1parser_1_1basic__punct__cu.html +++ b/classstdex_1_1parser_1_1basic__punct__cu.html @@ -198,7 +198,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__roman__numeral-members.html b/classstdex_1_1parser_1_1basic__roman__numeral-members.html index c0f46d2f1..087f3ca6f 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 176c11669..b161941b4 100644 --- a/classstdex_1_1parser_1_1basic__roman__numeral.html +++ b/classstdex_1_1parser_1_1basic__roman__numeral.html @@ -231,7 +231,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__scientific__numeral-members.html b/classstdex_1_1parser_1_1basic__scientific__numeral-members.html index 787ae8721..2f3cfec45 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 e0108642c..2af6ef65d 100644 --- a/classstdex_1_1parser_1_1basic__scientific__numeral.html +++ b/classstdex_1_1parser_1_1basic__scientific__numeral.html @@ -267,7 +267,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__score-members.html b/classstdex_1_1parser_1_1basic__score-members.html index c485cfdc0..c877f9308 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 547b901b0..6d5824283 100644 --- a/classstdex_1_1parser_1_1basic__score.html +++ b/classstdex_1_1parser_1_1basic__score.html @@ -236,7 +236,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__sequence-members.html b/classstdex_1_1parser_1_1basic__sequence-members.html index b30011564..77f3a895c 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 5e3c6f519..5836bf6ea 100644 --- a/classstdex_1_1parser_1_1basic__sequence.html +++ b/classstdex_1_1parser_1_1basic__sequence.html @@ -209,7 +209,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__set-members.html b/classstdex_1_1parser_1_1basic__set-members.html index e91209979..fd495a8e9 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 a90c83614..3dd6bec53 100644 --- a/classstdex_1_1parser_1_1basic__set.html +++ b/classstdex_1_1parser_1_1basic__set.html @@ -223,7 +223,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__si__reference-members.html b/classstdex_1_1parser_1_1basic__si__reference-members.html index d2a5a39b0..a0411a97a 100644 --- a/classstdex_1_1parser_1_1basic__si__reference-members.html +++ b/classstdex_1_1parser_1_1basic__si__reference-members.html @@ -102,7 +102,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__si__reference.html b/classstdex_1_1parser_1_1basic__si__reference.html index 73b625d67..4300ef462 100644 --- a/classstdex_1_1parser_1_1basic__si__reference.html +++ b/classstdex_1_1parser_1_1basic__si__reference.html @@ -265,7 +265,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__si__reference__delimiter-members.html b/classstdex_1_1parser_1_1basic__si__reference__delimiter-members.html index bd5e314d3..3357b2728 100644 --- a/classstdex_1_1parser_1_1basic__si__reference__delimiter-members.html +++ b/classstdex_1_1parser_1_1basic__si__reference__delimiter-members.html @@ -92,7 +92,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__si__reference__delimiter.html b/classstdex_1_1parser_1_1basic__si__reference__delimiter.html index fdf97b513..0a3feac5b 100644 --- a/classstdex_1_1parser_1_1basic__si__reference__delimiter.html +++ b/classstdex_1_1parser_1_1basic__si__reference__delimiter.html @@ -192,7 +192,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__si__reference__part-members.html b/classstdex_1_1parser_1_1basic__si__reference__part-members.html index 75618efff..d5e383752 100644 --- a/classstdex_1_1parser_1_1basic__si__reference__part-members.html +++ b/classstdex_1_1parser_1_1basic__si__reference__part-members.html @@ -92,7 +92,7 @@ $(function() { diff --git a/classstdex_1_1parser_1_1basic__si__reference__part.html b/classstdex_1_1parser_1_1basic__si__reference__part.html index 5fde178e5..766d1a9b9 100644 --- a/classstdex_1_1parser_1_1basic__si__reference__part.html +++ b/classstdex_1_1parser_1_1basic__si__reference__part.html @@ -192,7 +192,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__signed__numeral-members.html b/classstdex_1_1parser_1_1basic__signed__numeral-members.html index 239cba7aa..a1934367a 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 53bbeb267..2bc2a917e 100644 --- a/classstdex_1_1parser_1_1basic__signed__numeral.html +++ b/classstdex_1_1parser_1_1basic__signed__numeral.html @@ -239,7 +239,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__space__cu-members.html b/classstdex_1_1parser_1_1basic__space__cu-members.html index 814ad0ede..3e0d2a3ef 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 5f2389f79..bdd8e92ef 100644 --- a/classstdex_1_1parser_1_1basic__space__cu.html +++ b/classstdex_1_1parser_1_1basic__space__cu.html @@ -198,7 +198,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__space__or__punct__cu-members.html b/classstdex_1_1parser_1_1basic__space__or__punct__cu-members.html index 490fc4b30..8be6101b4 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 00bf24552..d96feed87 100644 --- a/classstdex_1_1parser_1_1basic__space__or__punct__cu.html +++ b/classstdex_1_1parser_1_1basic__space__or__punct__cu.html @@ -198,7 +198,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__string-members.html b/classstdex_1_1parser_1_1basic__string-members.html index 527e9c892..552ecf4e1 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 d2b672848..bc7818bd2 100644 --- a/classstdex_1_1parser_1_1basic__string.html +++ b/classstdex_1_1parser_1_1basic__string.html @@ -198,7 +198,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__string__branch-members.html b/classstdex_1_1parser_1_1basic__string__branch-members.html index 232576fb9..ccc785880 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 88b331650..4d5d8034e 100644 --- a/classstdex_1_1parser_1_1basic__string__branch.html +++ b/classstdex_1_1parser_1_1basic__string__branch.html @@ -185,7 +185,7 @@ class stdex::parser::basic_string_branch< T, T_parser >

Test for a

diff --git a/classstdex_1_1parser_1_1basic__time-members.html b/classstdex_1_1parser_1_1basic__time-members.html index 1c53a4e23..6bfa7c46c 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 bff2e786c..df37458dc 100644 --- a/classstdex_1_1parser_1_1basic__time.html +++ b/classstdex_1_1parser_1_1basic__time.html @@ -242,7 +242,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__url-members.html b/classstdex_1_1parser_1_1basic__url-members.html index b47dc378e..59c41db47 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 c1030ba02..94020f722 100644 --- a/classstdex_1_1parser_1_1basic__url.html +++ b/classstdex_1_1parser_1_1basic__url.html @@ -272,7 +272,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__url__password__char-members.html b/classstdex_1_1parser_1_1basic__url__password__char-members.html index 5aec1daea..c8f3a6cb6 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 bd74c8f84..d9238d262 100644 --- a/classstdex_1_1parser_1_1basic__url__password__char.html +++ b/classstdex_1_1parser_1_1basic__url__password__char.html @@ -191,7 +191,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__url__path-members.html b/classstdex_1_1parser_1_1basic__url__path-members.html index 11192f7ca..152780298 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 c36599d7d..411c21134 100644 --- a/classstdex_1_1parser_1_1basic__url__path.html +++ b/classstdex_1_1parser_1_1basic__url__path.html @@ -242,7 +242,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__url__path__char-members.html b/classstdex_1_1parser_1_1basic__url__path__char-members.html index 1b1431de4..f9887ab3e 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 7673f336d..03563cd8d 100644 --- a/classstdex_1_1parser_1_1basic__url__path__char.html +++ b/classstdex_1_1parser_1_1basic__url__path__char.html @@ -191,7 +191,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1basic__url__username__char-members.html b/classstdex_1_1parser_1_1basic__url__username__char-members.html index af7d686b2..c75064c19 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 640411730..5ee00057c 100644 --- a/classstdex_1_1parser_1_1basic__url__username__char.html +++ b/classstdex_1_1parser_1_1basic__url__username__char.html @@ -191,7 +191,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1http__agent-members.html b/classstdex_1_1parser_1_1http__agent-members.html index 2cc4c829a..39612bec6 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 333559991..79acaf9a1 100644 --- a/classstdex_1_1parser_1_1http__agent.html +++ b/classstdex_1_1parser_1_1http__agent.html @@ -220,7 +220,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1http__any__type-members.html b/classstdex_1_1parser_1_1http__any__type-members.html index 361dfcd32..82add8b75 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 552a0daf0..a5c58141b 100644 --- a/classstdex_1_1parser_1_1http__any__type.html +++ b/classstdex_1_1parser_1_1http__any__type.html @@ -184,7 +184,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1http__asterisk-members.html b/classstdex_1_1parser_1_1http__asterisk-members.html index 7b4c1c701..0e1870ed8 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 fac69ab32..afa102fc4 100644 --- a/classstdex_1_1parser_1_1http__asterisk.html +++ b/classstdex_1_1parser_1_1http__asterisk.html @@ -184,7 +184,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1http__cookie-members.html b/classstdex_1_1parser_1_1http__cookie-members.html index 9adeeaf24..bca6c6b7a 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 85a04a3d1..941b19a23 100644 --- a/classstdex_1_1parser_1_1http__cookie.html +++ b/classstdex_1_1parser_1_1http__cookie.html @@ -230,7 +230,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1http__cookie__parameter-members.html b/classstdex_1_1parser_1_1http__cookie__parameter-members.html index 00fb20726..718d625c2 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 c2dbcd892..c061dc0ea 100644 --- a/classstdex_1_1parser_1_1http__cookie__parameter.html +++ b/classstdex_1_1parser_1_1http__cookie__parameter.html @@ -224,7 +224,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1http__header-members.html b/classstdex_1_1parser_1_1http__header-members.html index ccdb334f3..30058c635 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 dc4ba1a96..d48445034 100644 --- a/classstdex_1_1parser_1_1http__header.html +++ b/classstdex_1_1parser_1_1http__header.html @@ -224,7 +224,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1http__language-members.html b/classstdex_1_1parser_1_1http__language-members.html index 9f9b37229..326837bf5 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 6cededa81..cb71c8f69 100644 --- a/classstdex_1_1parser_1_1http__language.html +++ b/classstdex_1_1parser_1_1http__language.html @@ -217,7 +217,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1http__line__break-members.html b/classstdex_1_1parser_1_1http__line__break-members.html index 247583664..956ce3481 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 ec09eb499..caa2b3b6c 100644 --- a/classstdex_1_1parser_1_1http__line__break.html +++ b/classstdex_1_1parser_1_1http__line__break.html @@ -184,7 +184,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1http__media__range-members.html b/classstdex_1_1parser_1_1http__media__range-members.html index 06c1dfb55..623c00935 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 6d0a7c356..12c45f38c 100644 --- a/classstdex_1_1parser_1_1http__media__range.html +++ b/classstdex_1_1parser_1_1http__media__range.html @@ -225,7 +225,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1http__media__type-members.html b/classstdex_1_1parser_1_1http__media__type-members.html index 7fb81d2bf..654aee1c3 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 b2403d0c7..881630336 100644 --- a/classstdex_1_1parser_1_1http__media__type.html +++ b/classstdex_1_1parser_1_1http__media__type.html @@ -229,7 +229,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1http__parameter-members.html b/classstdex_1_1parser_1_1http__parameter-members.html index ec71bad0d..75ac609f4 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 ed288d6d7..ad34b0292 100644 --- a/classstdex_1_1parser_1_1http__parameter.html +++ b/classstdex_1_1parser_1_1http__parameter.html @@ -226,7 +226,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1http__protocol-members.html b/classstdex_1_1parser_1_1http__protocol-members.html index fceb0180b..f2e15f4ba 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 cac451f09..f09198c91 100644 --- a/classstdex_1_1parser_1_1http__protocol.html +++ b/classstdex_1_1parser_1_1http__protocol.html @@ -230,7 +230,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1http__quoted__string-members.html b/classstdex_1_1parser_1_1http__quoted__string-members.html index 7971161b9..47a6d28af 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 00b2fa844..be1fcdcca 100644 --- a/classstdex_1_1parser_1_1http__quoted__string.html +++ b/classstdex_1_1parser_1_1http__quoted__string.html @@ -222,7 +222,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1http__request-members.html b/classstdex_1_1parser_1_1http__request-members.html index a566217d0..3172607db 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 5c8072f50..edde156ad 100644 --- a/classstdex_1_1parser_1_1http__request.html +++ b/classstdex_1_1parser_1_1http__request.html @@ -230,7 +230,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1http__space-members.html b/classstdex_1_1parser_1_1http__space-members.html index fd7ba5456..d1f428d94 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 83e08d898..48041a631 100644 --- a/classstdex_1_1parser_1_1http__space.html +++ b/classstdex_1_1parser_1_1http__space.html @@ -191,7 +191,7 @@ Additional Inherited Members diff --git a/classstdex_1_1parser_1_1http__text__char-members.html b/classstdex_1_1parser_1_1http__text__char-members.html index ce2da39ae..53ef40361 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 00452e571..27417ce71 100644 --- a/classstdex_1_1parser_1_1http__text__char.html +++ b/classstdex_1_1parser_1_1http__text__char.html @@ -191,7 +191,7 @@ Additional Inherited Members diff --git a/classstdex_1_1parser_1_1http__token-members.html b/classstdex_1_1parser_1_1http__token-members.html index 780476936..76bea4317 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 8f56bc4c1..3111ee36e 100644 --- a/classstdex_1_1parser_1_1http__token.html +++ b/classstdex_1_1parser_1_1http__token.html @@ -184,7 +184,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1http__url-members.html b/classstdex_1_1parser_1_1http__url-members.html index 6d73a5bad..2dd054d3e 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 f7384fdf0..17994725e 100644 --- a/classstdex_1_1parser_1_1http__url.html +++ b/classstdex_1_1parser_1_1http__url.html @@ -229,7 +229,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1http__url__parameter-members.html b/classstdex_1_1parser_1_1http__url__parameter-members.html index 2788c848b..ecbd4a360 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 22810dca7..fdb7aedde 100644 --- a/classstdex_1_1parser_1_1http__url__parameter.html +++ b/classstdex_1_1parser_1_1http__url__parameter.html @@ -220,7 +220,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1http__url__path-members.html b/classstdex_1_1parser_1_1http__url__path-members.html index df0bff59b..b33f3483e 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 5e86fa132..5f354801d 100644 --- a/classstdex_1_1parser_1_1http__url__path.html +++ b/classstdex_1_1parser_1_1http__url__path.html @@ -218,7 +218,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1http__url__path__segment-members.html b/classstdex_1_1parser_1_1http__url__path__segment-members.html index fcc294795..14d2f2d8d 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 ef775f11e..e28f13bc0 100644 --- a/classstdex_1_1parser_1_1http__url__path__segment.html +++ b/classstdex_1_1parser_1_1http__url__path__segment.html @@ -184,7 +184,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1http__url__port-members.html b/classstdex_1_1parser_1_1http__url__port-members.html index 431325bec..811d1afd0 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 f81a198d4..6c2d562f5 100644 --- a/classstdex_1_1parser_1_1http__url__port.html +++ b/classstdex_1_1parser_1_1http__url__port.html @@ -220,7 +220,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1http__url__server-members.html b/classstdex_1_1parser_1_1http__url__server-members.html index 815811d1f..7a50b8ace 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 06f120a7c..71b1d04a6 100644 --- a/classstdex_1_1parser_1_1http__url__server.html +++ b/classstdex_1_1parser_1_1http__url__server.html @@ -184,7 +184,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1http__value-members.html b/classstdex_1_1parser_1_1http__value-members.html index 8e00030bb..9ab63ddbe 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 1be6462cb..a4c78bd4a 100644 --- a/classstdex_1_1parser_1_1http__value.html +++ b/classstdex_1_1parser_1_1http__value.html @@ -222,7 +222,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1http__value__collection-members.html b/classstdex_1_1parser_1_1http__value__collection-members.html index bbd980025..4c69008ed 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 cfda70dba..0616d9e79 100644 --- a/classstdex_1_1parser_1_1http__value__collection.html +++ b/classstdex_1_1parser_1_1http__value__collection.html @@ -107,7 +107,7 @@ class stdex::parser::http_value_collection< _Key, T >

Collection o

diff --git a/classstdex_1_1parser_1_1http__weight-members.html b/classstdex_1_1parser_1_1http__weight-members.html index 47bcb539d..060311428 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 9b360d5b7..57ae1eab7 100644 --- a/classstdex_1_1parser_1_1http__weight.html +++ b/classstdex_1_1parser_1_1http__weight.html @@ -221,7 +221,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1http__weighted__value-members.html b/classstdex_1_1parser_1_1http__weighted__value-members.html index eaa95f962..c3382509b 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 0b9b3a7c4..119c41f11 100644 --- a/classstdex_1_1parser_1_1http__weighted__value.html +++ b/classstdex_1_1parser_1_1http__weighted__value.html @@ -231,7 +231,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1parser__collection-members.html b/classstdex_1_1parser_1_1parser__collection-members.html index 461ad8485..1209585a4 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 74867cd24..7c3e334d3 100644 --- a/classstdex_1_1parser_1_1parser__collection.html +++ b/classstdex_1_1parser_1_1parser__collection.html @@ -189,7 +189,7 @@ template<clas diff --git a/classstdex_1_1parser_1_1sgml__any__cp-members.html b/classstdex_1_1parser_1_1sgml__any__cp-members.html index 663395a89..15b99d5da 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 078361e05..68ec18602 100644 --- a/classstdex_1_1parser_1_1sgml__any__cp.html +++ b/classstdex_1_1parser_1_1sgml__any__cp.html @@ -196,7 +196,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1sgml__cp-members.html b/classstdex_1_1parser_1_1sgml__cp-members.html index aa2cbcd98..13b94c52c 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 20b0dc680..9a0fa7f5e 100644 --- a/classstdex_1_1parser_1_1sgml__cp.html +++ b/classstdex_1_1parser_1_1sgml__cp.html @@ -197,7 +197,7 @@ Additional Inherited Members diff --git a/classstdex_1_1parser_1_1sgml__cp__set-members.html b/classstdex_1_1parser_1_1sgml__cp__set-members.html index c489b0343..9c130e64e 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 07e48ce1b..33d7bc211 100644 --- a/classstdex_1_1parser_1_1sgml__cp__set.html +++ b/classstdex_1_1parser_1_1sgml__cp__set.html @@ -210,7 +210,7 @@ Additional Inherited Members diff --git a/classstdex_1_1parser_1_1sgml__dns__domain__char-members.html b/classstdex_1_1parser_1_1sgml__dns__domain__char-members.html index b8a68927e..7271fa86f 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 3f9e7128e..e85fe71c4 100644 --- a/classstdex_1_1parser_1_1sgml__dns__domain__char.html +++ b/classstdex_1_1parser_1_1sgml__dns__domain__char.html @@ -205,7 +205,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1sgml__ipv6__scope__id__char-members.html b/classstdex_1_1parser_1_1sgml__ipv6__scope__id__char-members.html index 084c42889..7f385aa3d 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 3e5ee4691..185612aef 100644 --- a/classstdex_1_1parser_1_1sgml__ipv6__scope__id__char.html +++ b/classstdex_1_1parser_1_1sgml__ipv6__scope__id__char.html @@ -187,7 +187,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1sgml__punct__cp-members.html b/classstdex_1_1parser_1_1sgml__punct__cp-members.html index b4cd2c547..8fd6a84bc 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 0b5df4eb6..5c377ff05 100644 --- a/classstdex_1_1parser_1_1sgml__punct__cp.html +++ b/classstdex_1_1parser_1_1sgml__punct__cp.html @@ -200,7 +200,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1sgml__space__cp-members.html b/classstdex_1_1parser_1_1sgml__space__cp-members.html index 3ccc7121e..5e97a1b4c 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 4e365ef74..a5a8ba79e 100644 --- a/classstdex_1_1parser_1_1sgml__space__cp.html +++ b/classstdex_1_1parser_1_1sgml__space__cp.html @@ -200,7 +200,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1sgml__space__or__punct__cp-members.html b/classstdex_1_1parser_1_1sgml__space__or__punct__cp-members.html index 904dcf53e..2b9ec2a72 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 7ba82350d..d1c88994b 100644 --- a/classstdex_1_1parser_1_1sgml__space__or__punct__cp.html +++ b/classstdex_1_1parser_1_1sgml__space__or__punct__cp.html @@ -200,7 +200,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1sgml__string-members.html b/classstdex_1_1parser_1_1sgml__string-members.html index b3cadc163..abb02d569 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 3d4efaea0..8d0c7c75f 100644 --- a/classstdex_1_1parser_1_1sgml__string.html +++ b/classstdex_1_1parser_1_1sgml__string.html @@ -194,7 +194,7 @@ Additional Inherited Members diff --git a/classstdex_1_1parser_1_1sgml__url__password__char-members.html b/classstdex_1_1parser_1_1sgml__url__password__char-members.html index 1a80b5cd0..d2cf0f0b9 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 1702735d6..1a0f228c4 100644 --- a/classstdex_1_1parser_1_1sgml__url__password__char.html +++ b/classstdex_1_1parser_1_1sgml__url__password__char.html @@ -196,7 +196,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1sgml__url__path__char-members.html b/classstdex_1_1parser_1_1sgml__url__path__char-members.html index fb06c9fcc..be48af9a2 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 4aa1fc646..7735eecb7 100644 --- a/classstdex_1_1parser_1_1sgml__url__path__char.html +++ b/classstdex_1_1parser_1_1sgml__url__path__char.html @@ -196,7 +196,7 @@ std::locale m_locale diff --git a/classstdex_1_1parser_1_1sgml__url__username__char-members.html b/classstdex_1_1parser_1_1sgml__url__username__char-members.html index 3d919708b..14406e8fd 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 2b9276187..255e72dff 100644 --- a/classstdex_1_1parser_1_1sgml__url__username__char.html +++ b/classstdex_1_1parser_1_1sgml__url__username__char.html @@ -196,7 +196,7 @@ std::locale m_locale diff --git a/classstdex_1_1pool-members.html b/classstdex_1_1pool-members.html index a447381cc..d97804547 100644 --- a/classstdex_1_1pool-members.html +++ b/classstdex_1_1pool-members.html @@ -86,7 +86,7 @@ $(function() { diff --git a/classstdex_1_1pool.html b/classstdex_1_1pool.html index 39f692d59..287c46778 100644 --- a/classstdex_1_1pool.html +++ b/classstdex_1_1pool.html @@ -197,7 +197,7 @@ template<class T > diff --git a/classstdex_1_1progress-members.html b/classstdex_1_1progress-members.html index e3be62bf3..a1af2c2d2 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 ed423093f..d38588ccb 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 b6cf028ac..23f3305c5 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 510f61aa3..4a649bea8 100644 --- a/classstdex_1_1progress__switcher.html +++ b/classstdex_1_1progress__switcher.html @@ -163,7 +163,7 @@ class stdex::progress_switcher< T >

Progress indicator switcher. <

diff --git a/classstdex_1_1ring-members.html b/classstdex_1_1ring-members.html index 29ace79b8..8404b4435 100644 --- a/classstdex_1_1ring-members.html +++ b/classstdex_1_1ring-members.html @@ -100,7 +100,7 @@ $(function() { diff --git a/classstdex_1_1ring.html b/classstdex_1_1ring.html index bfbb6fa81..161e0cef3 100644 --- a/classstdex_1_1ring.html +++ b/classstdex_1_1ring.html @@ -296,7 +296,7 @@ template<class T , size_t CAPACITY> diff --git a/classstdex_1_1sha1__hash-members.html b/classstdex_1_1sha1__hash-members.html index c6dc04667..0c9977386 100644 --- a/classstdex_1_1sha1__hash-members.html +++ b/classstdex_1_1sha1__hash-members.html @@ -93,7 +93,7 @@ $(function() { diff --git a/classstdex_1_1sha1__hash.html b/classstdex_1_1sha1__hash.html index 7070d7d2f..fd328dd2c 100644 --- a/classstdex_1_1sha1__hash.html +++ b/classstdex_1_1sha1__hash.html @@ -259,7 +259,7 @@ uint32_t m_temp [16] diff --git a/classstdex_1_1spinlock-members.html b/classstdex_1_1spinlock-members.html index bd38d51cc..7f9f8d8a0 100644 --- a/classstdex_1_1spinlock-members.html +++ b/classstdex_1_1spinlock-members.html @@ -86,7 +86,7 @@ $(function() { diff --git a/classstdex_1_1spinlock.html b/classstdex_1_1spinlock.html index a56ba6a03..0649a73b0 100644 --- a/classstdex_1_1spinlock.html +++ b/classstdex_1_1spinlock.html @@ -138,7 +138,7 @@ void unlock () noexcep diff --git a/classstdex_1_1stream_1_1async__reader-members.html b/classstdex_1_1stream_1_1async__reader-members.html index 3311d0386..98cc13455 100644 --- a/classstdex_1_1stream_1_1async__reader-members.html +++ b/classstdex_1_1stream_1_1async__reader-members.html @@ -128,34 +128,33 @@ $(function() { 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< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline - readln_and_attach(std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)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(const T_from *wstr, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - write_array(_In_reads_or_z_opt_(num_chars) const T_from *wstr, size_t num_chars, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - write_array(const std::basic_string< T_from, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)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_str(const std::basic_string< _Elem, _Traits, _Ax > &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 - ~basic() noexcept(false) (defined in stdex::stream::basic)stdex::stream::basicinlinevirtual + readln(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline + readln(std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline + readln_and_attach(std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)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(const T_from *str, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + write_array(_In_reads_or_z_opt_(num_chars) const T_from *str, size_t num_chars, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + write_array(const std::basic_string< T_from, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)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_str(const std::basic_string< _Elem, _Traits, _Ax > &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 + ~basic() noexcept(false) (defined in stdex::stream::basic)stdex::stream::basicinlinevirtual diff --git a/classstdex_1_1stream_1_1async__reader.html b/classstdex_1_1stream_1_1async__reader.html index 144bc7e76..ef650afb6 100644 --- a/classstdex_1_1stream_1_1async__reader.html +++ b/classstdex_1_1stream_1_1async__reader.html @@ -153,44 +153,40 @@ void write_byte (uint8 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 T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> -size_t readln (std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - 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 (std::basic_string< _Elem, _Traits, _Ax > &str) + Reads stream to the end-of-line or end-of-file.
+  +template<class T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> +size_t readln (std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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 T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> -size_t readln_and_attach (std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - Reads stream to the end-of-line or end-of-file and append to str.
-  +template<class T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> +size_t readln_and_attach (std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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.
  -template<class T_from , class T_to > -size_t write_array (const T_from *wstr, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  -template<class T_from , class T_to > -size_t write_array (_In_reads_or_z_opt_(num_chars) const T_from *wstr, size_t num_chars, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  -template<class T_from , class T_to , class _Traits = std::char_traits<T_from>, class _Ax = std::allocator<T_from>> -size_t write_array (const std::basic_string< T_from, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  +template<class T_from , class T_to > +size_t write_array (const T_from *str, charset_encoder< T_from, T_to > &encoder) + Writes array of characters to the stream.
+  +template<class T_from , class T_to > +size_t write_array (_In_reads_or_z_opt_(num_chars) const T_from *str, size_t num_chars, charset_encoder< T_from, T_to > &encoder) + Writes array of characters to the stream.
+  +template<class T_from , class T_to , class _Traits = std::char_traits<T_from>, class _Ax = std::allocator<T_from>> +size_t write_array (const std::basic_string< T_from, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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.
@@ -414,7 +410,7 @@ template<size_t CAPACITY = default_async_limit> diff --git a/classstdex_1_1stream_1_1async__writer-members.html b/classstdex_1_1stream_1_1async__writer-members.html index e2552ab5d..38c55d8ba 100644 --- a/classstdex_1_1stream_1_1async__writer-members.html +++ b/classstdex_1_1stream_1_1async__writer-members.html @@ -128,34 +128,33 @@ $(function() { 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< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline - readln_and_attach(std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)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(const T_from *wstr, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - write_array(_In_reads_or_z_opt_(num_chars) const T_from *wstr, size_t num_chars, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - write_array(const std::basic_string< T_from, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)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_str(const std::basic_string< _Elem, _Traits, _Ax > &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 - ~basic() noexcept(false) (defined in stdex::stream::basic)stdex::stream::basicinlinevirtual + readln(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline + readln(std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline + readln_and_attach(std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)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(const T_from *str, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + write_array(_In_reads_or_z_opt_(num_chars) const T_from *str, size_t num_chars, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + write_array(const std::basic_string< T_from, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)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_str(const std::basic_string< _Elem, _Traits, _Ax > &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 + ~basic() noexcept(false) (defined in stdex::stream::basic)stdex::stream::basicinlinevirtual diff --git a/classstdex_1_1stream_1_1async__writer.html b/classstdex_1_1stream_1_1async__writer.html index 09cb01532..9893091ac 100644 --- a/classstdex_1_1stream_1_1async__writer.html +++ b/classstdex_1_1stream_1_1async__writer.html @@ -153,44 +153,40 @@ void write_byte (uint8 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 T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> -size_t readln (std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - 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 (std::basic_string< _Elem, _Traits, _Ax > &str) + Reads stream to the end-of-line or end-of-file.
+  +template<class T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> +size_t readln (std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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 T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> -size_t readln_and_attach (std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - Reads stream to the end-of-line or end-of-file and append to str.
-  +template<class T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> +size_t readln_and_attach (std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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.
  -template<class T_from , class T_to > -size_t write_array (const T_from *wstr, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  -template<class T_from , class T_to > -size_t write_array (_In_reads_or_z_opt_(num_chars) const T_from *wstr, size_t num_chars, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  -template<class T_from , class T_to , class _Traits = std::char_traits<T_from>, class _Ax = std::allocator<T_from>> -size_t write_array (const std::basic_string< T_from, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  +template<class T_from , class T_to > +size_t write_array (const T_from *str, charset_encoder< T_from, T_to > &encoder) + Writes array of characters to the stream.
+  +template<class T_from , class T_to > +size_t write_array (_In_reads_or_z_opt_(num_chars) const T_from *str, size_t num_chars, charset_encoder< T_from, T_to > &encoder) + Writes array of characters to the stream.
+  +template<class T_from , class T_to , class _Traits = std::char_traits<T_from>, class _Ax = std::allocator<T_from>> +size_t write_array (const std::basic_string< T_from, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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.
@@ -445,7 +441,7 @@ template<size_t CAPACITY = default_async_limit> diff --git a/classstdex_1_1stream_1_1basic-members.html b/classstdex_1_1stream_1_1basic-members.html index 670badb98..eeb4d28cd 100644 --- a/classstdex_1_1stream_1_1basic-members.html +++ b/classstdex_1_1stream_1_1basic-members.html @@ -122,33 +122,32 @@ $(function() { 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< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline - readln_and_attach(std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)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(const T_from *wstr, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - write_array(_In_reads_or_z_opt_(num_chars) const T_from *wstr, size_t num_chars, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - write_array(const std::basic_string< T_from, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)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_str(const std::basic_string< _Elem, _Traits, _Ax > &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 - ~basic() noexcept(false) (defined in stdex::stream::basic)stdex::stream::basicinlinevirtual + readln(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline + readln(std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline + readln_and_attach(std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)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(const T_from *str, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + write_array(_In_reads_or_z_opt_(num_chars) const T_from *str, size_t num_chars, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + write_array(const std::basic_string< T_from, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)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_str(const std::basic_string< _Elem, _Traits, _Ax > &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 + ~basic() noexcept(false) (defined in stdex::stream::basic)stdex::stream::basicinlinevirtual diff --git a/classstdex_1_1stream_1_1basic.html b/classstdex_1_1stream_1_1basic.html index bc8b41c0f..8f0cc2019 100644 --- a/classstdex_1_1stream_1_1basic.html +++ b/classstdex_1_1stream_1_1basic.html @@ -164,44 +164,40 @@ void write_byte (uint8 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 T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> -size_t readln (std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - 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 (std::basic_string< _Elem, _Traits, _Ax > &str) + Reads stream to the end-of-line or end-of-file.
+  +template<class T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> +size_t readln (std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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 T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> -size_t readln_and_attach (std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - Reads stream to the end-of-line or end-of-file and append to str.
-  +template<class T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> +size_t readln_and_attach (std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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.
  -template<class T_from , class T_to > -size_t write_array (const T_from *wstr, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  -template<class T_from , class T_to > -size_t write_array (_In_reads_or_z_opt_(num_chars) const T_from *wstr, size_t num_chars, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  -template<class T_from , class T_to , class _Traits = std::char_traits<T_from>, class _Ax = std::allocator<T_from>> -size_t write_array (const std::basic_string< T_from, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  +template<class T_from , class T_to > +size_t write_array (const T_from *str, charset_encoder< T_from, T_to > &encoder) + Writes array of characters to the stream.
+  +template<class T_from , class T_to > +size_t write_array (_In_reads_or_z_opt_(num_chars) const T_from *str, size_t num_chars, charset_encoder< T_from, T_to > &encoder) + Writes array of characters to the stream.
+  +template<class T_from , class T_to , class _Traits = std::char_traits<T_from>, class _Ax = std::allocator<T_from>> +size_t write_array (const std::basic_string< T_from, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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.
@@ -612,13 +608,13 @@ template<class _Elem , class _Traits = std::char_traits<_Elem>, class - -

◆ readln() [1/3]

+ +

◆ readln() [1/2]

-template<class _Traits = std::char_traits<char>, class _Ax = std::allocator<char>>
+template<class _Elem , class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
- + @@ -643,8 +639,8 @@ template<class _Traits = std::char_traits<char>, class _Ax = std::all - -

◆ readln() [2/3]

+ +

◆ readln() [2/2]

@@ -658,7 +654,7 @@ template<class T_from , class T_to , class _Traits = std::char_traits<T_t
- + @@ -682,37 +678,6 @@ template<class T_from , class T_to , class _Traits = std::char_traits<T_t

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>>
-
@@ -626,7 +622,7 @@ template<class _Traits = std::char_traits<char>, class _Ax = std::all
size_t stdex::stream::basic::readln (std::basic_string< char, _Traits, _Ax > & std::basic_string< _Elem, _Traits, _Ax > &  str)
size_t stdex::stream::basic::readln ( std::basic_string< T_to, _Traits, _Ax > & wstr, str,
- - - - -
- - - - - - - - -
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
-
@@ -746,8 +711,8 @@ template<class _Elem , class _Traits = std::char_traits<_Elem>, class - -

◆ readln_and_attach() [2/2]

+ +

◆ readln_and_attach() [2/2]

@@ -761,7 +726,7 @@ template<class T_from , class T_to , class _Traits = std::char_traits<T_t size_t stdex::stream::basic::readln_and_attach ( std::basic_string< T_to, _Traits, _Ax > &  - wstr, + str, @@ -910,8 +875,8 @@ template<class T_from , class T_to , class _Traits = std::char_traits<T_t
- -

◆ write_array() [2/4]

+ +

◆ write_array() [2/4]

@@ -925,7 +890,7 @@ template<class T_from , class T_to >
size_t stdex::stream::basic::write_array ( _In_reads_or_z_opt_(num_chars) const T_from *  - wstr, + str, @@ -955,7 +920,7 @@ template<class T_from , class T_to >

Writes array of characters to the stream.

Parameters
- +
[in]wstrString to write
[in]strString to write
[in]num_charsString code unit count limit
[in]encoderEncoder for encoding string
@@ -965,8 +930,8 @@ template<class T_from , class T_to > - -

◆ write_array() [3/4]

+ +

◆ write_array() [3/4]

@@ -980,7 +945,7 @@ template<class T_from , class T_to , class _Traits = std::char_traits<T_f size_t stdex::stream::basic::write_array ( const std::basic_string< T_from, _Traits, _Ax > &  - wstr, + str, @@ -1004,7 +969,7 @@ template<class T_from , class T_to , class _Traits = std::char_traits<T_f

Writes array of characters to the stream.

Parameters
- +
[in]wstrString to write
[in]strString to write
[in]encoderEncoder for encoding string
@@ -1013,8 +978,8 @@ template<class T_from , class T_to , class _Traits = std::char_traits<T_f
- -

◆ write_array() [4/4]

+ +

◆ write_array() [4/4]

@@ -1028,7 +993,7 @@ template<class T_from , class T_to >
size_t stdex::stream::basic::write_array ( const T_from *  - wstr, + str, @@ -1052,7 +1017,7 @@ template<class T_from , class T_to >

Writes array of characters to the stream.

Parameters
- +
[in]wstrString to write. Must be zero-terminated.
[in]strString to write. Must be zero-terminated.
[in]encoderEncoder for encoding string
@@ -1400,7 +1365,7 @@ template<class T > diff --git a/classstdex_1_1stream_1_1basic__file-members.html b/classstdex_1_1stream_1_1basic__file-members.html index acd9cfc52..64f4046f8 100644 --- a/classstdex_1_1stream_1_1basic__file-members.html +++ b/classstdex_1_1stream_1_1basic__file-members.html @@ -127,44 +127,43 @@ $(function() { 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< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline - readln_and_attach(std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)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() const =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(const T_from *wstr, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - write_array(_In_reads_or_z_opt_(num_chars) const T_from *wstr, size_t num_chars, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - write_array(const std::basic_string< T_from, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)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_str(const std::basic_string< _Elem, _Traits, _Ax > &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 - ~basic() noexcept(false) (defined in stdex::stream::basic)stdex::stream::basicinlinevirtual + readln(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline + readln(std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline + readln_and_attach(std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)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() const =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(const T_from *str, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + write_array(_In_reads_or_z_opt_(num_chars) const T_from *str, size_t num_chars, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + write_array(const std::basic_string< T_from, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)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_str(const std::basic_string< _Elem, _Traits, _Ax > &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 + ~basic() noexcept(false) (defined in stdex::stream::basic)stdex::stream::basicinlinevirtual diff --git a/classstdex_1_1stream_1_1basic__file.html b/classstdex_1_1stream_1_1basic__file.html index 1a07871f3..0eac2e122 100644 --- a/classstdex_1_1stream_1_1basic__file.html +++ b/classstdex_1_1stream_1_1basic__file.html @@ -197,44 +197,40 @@ void write_byte (uint8 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 T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> -size_t readln (std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - 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 (std::basic_string< _Elem, _Traits, _Ax > &str) + Reads stream to the end-of-line or end-of-file.
+  +template<class T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> +size_t readln (std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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 T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> -size_t readln_and_attach (std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - Reads stream to the end-of-line or end-of-file and append to str.
-  +template<class T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> +size_t readln_and_attach (std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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.
  -template<class T_from , class T_to > -size_t write_array (const T_from *wstr, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  -template<class T_from , class T_to > -size_t write_array (_In_reads_or_z_opt_(num_chars) const T_from *wstr, size_t num_chars, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  -template<class T_from , class T_to , class _Traits = std::char_traits<T_from>, class _Ax = std::allocator<T_from>> -size_t write_array (const std::basic_string< T_from, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  +template<class T_from , class T_to > +size_t write_array (const T_from *str, charset_encoder< T_from, T_to > &encoder) + Writes array of characters to the stream.
+  +template<class T_from , class T_to > +size_t write_array (_In_reads_or_z_opt_(num_chars) const T_from *str, size_t num_chars, charset_encoder< T_from, T_to > &encoder) + Writes array of characters to the stream.
+  +template<class T_from , class T_to , class _Traits = std::char_traits<T_from>, class _Ax = std::allocator<T_from>> +size_t write_array (const std::basic_string< T_from, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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.
@@ -961,7 +957,7 @@ state_t m_state diff --git a/classstdex_1_1stream_1_1basic__sys-members.html b/classstdex_1_1stream_1_1basic__sys-members.html index 6d05ac4cf..ab991fbb6 100644 --- a/classstdex_1_1stream_1_1basic__sys-members.html +++ b/classstdex_1_1stream_1_1basic__sys-members.html @@ -130,37 +130,36 @@ $(function() { 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< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline - readln_and_attach(std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)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(const T_from *wstr, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - write_array(_In_reads_or_z_opt_(num_chars) const T_from *wstr, size_t num_chars, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - write_array(const std::basic_string< T_from, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)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_str(const std::basic_string< _Elem, _Traits, _Ax > &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 - ~basic() noexcept(false) (defined in stdex::stream::basic)stdex::stream::basicinlinevirtual - ~sys_object() noexcept(false) (defined in stdex::sys_object)stdex::sys_objectinlinevirtual + readln(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline + readln(std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline + readln_and_attach(std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)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(const T_from *str, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + write_array(_In_reads_or_z_opt_(num_chars) const T_from *str, size_t num_chars, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + write_array(const std::basic_string< T_from, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)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_str(const std::basic_string< _Elem, _Traits, _Ax > &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 + ~basic() noexcept(false) (defined in stdex::stream::basic)stdex::stream::basicinlinevirtual + ~sys_object() noexcept(false) (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 index 02c8f85ae..93a8d9d5f 100644 --- a/classstdex_1_1stream_1_1basic__sys.html +++ b/classstdex_1_1stream_1_1basic__sys.html @@ -148,44 +148,40 @@ void write_byte (uint8 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 T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> -size_t readln (std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - 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 (std::basic_string< _Elem, _Traits, _Ax > &str) + Reads stream to the end-of-line or end-of-file.
+  +template<class T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> +size_t readln (std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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 T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> -size_t readln_and_attach (std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - Reads stream to the end-of-line or end-of-file and append to str.
-  +template<class T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> +size_t readln_and_attach (std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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.
  -template<class T_from , class T_to > -size_t write_array (const T_from *wstr, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  -template<class T_from , class T_to > -size_t write_array (_In_reads_or_z_opt_(num_chars) const T_from *wstr, size_t num_chars, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  -template<class T_from , class T_to , class _Traits = std::char_traits<T_from>, class _Ax = std::allocator<T_from>> -size_t write_array (const std::basic_string< T_from, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  +template<class T_from , class T_to > +size_t write_array (const T_from *str, charset_encoder< T_from, T_to > &encoder) + Writes array of characters to the stream.
+  +template<class T_from , class T_to > +size_t write_array (_In_reads_or_z_opt_(num_chars) const T_from *str, size_t num_chars, charset_encoder< T_from, T_to > &encoder) + Writes array of characters to the stream.
+  +template<class T_from , class T_to , class _Traits = std::char_traits<T_from>, class _Ax = std::allocator<T_from>> +size_t write_array (const std::basic_string< T_from, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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.
@@ -527,7 +523,7 @@ sys_handle m_h diff --git a/classstdex_1_1stream_1_1buffer-members.html b/classstdex_1_1stream_1_1buffer-members.html index 6ca3d5a4a..09f5118d2 100644 --- a/classstdex_1_1stream_1_1buffer-members.html +++ b/classstdex_1_1stream_1_1buffer-members.html @@ -128,34 +128,33 @@ $(function() { 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< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline - readln_and_attach(std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)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(const T_from *wstr, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - write_array(_In_reads_or_z_opt_(num_chars) const T_from *wstr, size_t num_chars, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - write_array(const std::basic_string< T_from, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)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_str(const std::basic_string< _Elem, _Traits, _Ax > &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 - ~basic() noexcept(false) (defined in stdex::stream::basic)stdex::stream::basicinlinevirtual - ~buffer() (defined in stdex::stream::buffer)stdex::stream::bufferinlinevirtual + readln(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline + readln(std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline + readln_and_attach(std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)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(const T_from *str, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + write_array(_In_reads_or_z_opt_(num_chars) const T_from *str, size_t num_chars, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + write_array(const std::basic_string< T_from, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)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_str(const std::basic_string< _Elem, _Traits, _Ax > &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 + ~basic() noexcept(false) (defined in stdex::stream::basic)stdex::stream::basicinlinevirtual + ~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 index f8c2de3c4..2a4facedb 100644 --- a/classstdex_1_1stream_1_1buffer.html +++ b/classstdex_1_1stream_1_1buffer.html @@ -160,44 +160,40 @@ void write_byte (uint8 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 T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> -size_t readln (std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - 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 (std::basic_string< _Elem, _Traits, _Ax > &str) + Reads stream to the end-of-line or end-of-file.
+  +template<class T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> +size_t readln (std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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 T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> -size_t readln_and_attach (std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - Reads stream to the end-of-line or end-of-file and append to str.
-  +template<class T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> +size_t readln_and_attach (std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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.
  -template<class T_from , class T_to > -size_t write_array (const T_from *wstr, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  -template<class T_from , class T_to > -size_t write_array (_In_reads_or_z_opt_(num_chars) const T_from *wstr, size_t num_chars, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  -template<class T_from , class T_to , class _Traits = std::char_traits<T_from>, class _Ax = std::allocator<T_from>> -size_t write_array (const std::basic_string< T_from, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  +template<class T_from , class T_to > +size_t write_array (const T_from *str, charset_encoder< T_from, T_to > &encoder) + Writes array of characters to the stream.
+  +template<class T_from , class T_to > +size_t write_array (_In_reads_or_z_opt_(num_chars) const T_from *str, size_t num_chars, charset_encoder< T_from, T_to > &encoder) + Writes array of characters to the stream.
+  +template<class T_from , class T_to , class _Traits = std::char_traits<T_from>, class _Ax = std::allocator<T_from>> +size_t write_array (const std::basic_string< T_from, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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.
@@ -489,7 +485,7 @@ state_t m_state diff --git a/classstdex_1_1stream_1_1buffered__sys-members.html b/classstdex_1_1stream_1_1buffered__sys-members.html index da9601890..248acbf96 100644 --- a/classstdex_1_1stream_1_1buffered__sys-members.html +++ b/classstdex_1_1stream_1_1buffered__sys-members.html @@ -129,35 +129,34 @@ $(function() { 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< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline - readln_and_attach(std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)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(const T_from *wstr, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - write_array(_In_reads_or_z_opt_(num_chars) const T_from *wstr, size_t num_chars, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - write_array(const std::basic_string< T_from, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)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_str(const std::basic_string< _Elem, _Traits, _Ax > &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 - ~basic() noexcept(false) (defined in stdex::stream::basic)stdex::stream::basicinlinevirtual - ~buffer() (defined in stdex::stream::buffer)stdex::stream::bufferinlinevirtual - ~buffered_sys() (defined in stdex::stream::buffered_sys)stdex::stream::buffered_sysinlinevirtual + readln(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline + readln(std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline + readln_and_attach(std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)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(const T_from *str, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + write_array(_In_reads_or_z_opt_(num_chars) const T_from *str, size_t num_chars, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + write_array(const std::basic_string< T_from, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)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_str(const std::basic_string< _Elem, _Traits, _Ax > &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 + ~basic() noexcept(false) (defined in stdex::stream::basic)stdex::stream::basicinlinevirtual + ~buffer() (defined in stdex::stream::buffer)stdex::stream::bufferinlinevirtual + ~buffered_sys() (defined in stdex::stream::buffered_sys)stdex::stream::buffered_sysinlinevirtual diff --git a/classstdex_1_1stream_1_1buffered__sys.html b/classstdex_1_1stream_1_1buffered__sys.html index 633953781..d8b570133 100644 --- a/classstdex_1_1stream_1_1buffered__sys.html +++ b/classstdex_1_1stream_1_1buffered__sys.html @@ -157,44 +157,40 @@ void write_byte (uint8 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 T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> -size_t readln (std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - 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 (std::basic_string< _Elem, _Traits, _Ax > &str) + Reads stream to the end-of-line or end-of-file.
+  +template<class T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> +size_t readln (std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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 T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> -size_t readln_and_attach (std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - Reads stream to the end-of-line or end-of-file and append to str.
-  +template<class T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> +size_t readln_and_attach (std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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.
  -template<class T_from , class T_to > -size_t write_array (const T_from *wstr, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  -template<class T_from , class T_to > -size_t write_array (_In_reads_or_z_opt_(num_chars) const T_from *wstr, size_t num_chars, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  -template<class T_from , class T_to , class _Traits = std::char_traits<T_from>, class _Ax = std::allocator<T_from>> -size_t write_array (const std::basic_string< T_from, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  +template<class T_from , class T_to > +size_t write_array (const T_from *str, charset_encoder< T_from, T_to > &encoder) + Writes array of characters to the stream.
+  +template<class T_from , class T_to > +size_t write_array (_In_reads_or_z_opt_(num_chars) const T_from *str, size_t num_chars, charset_encoder< T_from, T_to > &encoder) + Writes array of characters to the stream.
+  +template<class T_from , class T_to , class _Traits = std::char_traits<T_from>, class _Ax = std::allocator<T_from>> +size_t write_array (const std::basic_string< T_from, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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.
@@ -365,7 +361,7 @@ void flush_write () diff --git a/classstdex_1_1stream_1_1cache-members.html b/classstdex_1_1stream_1_1cache-members.html index cb520294b..8248efdc4 100644 --- a/classstdex_1_1stream_1_1cache-members.html +++ b/classstdex_1_1stream_1_1cache-members.html @@ -128,45 +128,44 @@ $(function() { 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< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline - readln_and_attach(std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)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() conststdex::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(const T_from *wstr, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - write_array(_In_reads_or_z_opt_(num_chars) const T_from *wstr, size_t num_chars, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - write_array(const std::basic_string< T_from, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)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_str(const std::basic_string< _Elem, _Traits, _Ax > &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 - ~basic() noexcept(false) (defined in stdex::stream::basic)stdex::stream::basicinlinevirtual - ~cache() noexcept(false) (defined in stdex::stream::cache)stdex::stream::cacheinlinevirtual + readln(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline + readln(std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline + readln_and_attach(std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)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() conststdex::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(const T_from *str, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + write_array(_In_reads_or_z_opt_(num_chars) const T_from *str, size_t num_chars, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + write_array(const std::basic_string< T_from, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)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_str(const std::basic_string< _Elem, _Traits, _Ax > &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 + ~basic() noexcept(false) (defined in stdex::stream::basic)stdex::stream::basicinlinevirtual + ~cache() noexcept(false) (defined in stdex::stream::cache)stdex::stream::cacheinlinevirtual diff --git a/classstdex_1_1stream_1_1cache.html b/classstdex_1_1stream_1_1cache.html index 06623ce65..99a925a7e 100644 --- a/classstdex_1_1stream_1_1cache.html +++ b/classstdex_1_1stream_1_1cache.html @@ -197,44 +197,40 @@ void write_byte (uint8 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 T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> -size_t readln (std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - 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 (std::basic_string< _Elem, _Traits, _Ax > &str) + Reads stream to the end-of-line or end-of-file.
+  +template<class T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> +size_t readln (std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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 T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> -size_t readln_and_attach (std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - Reads stream to the end-of-line or end-of-file and append to str.
-  +template<class T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> +size_t readln_and_attach (std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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.
  -template<class T_from , class T_to > -size_t write_array (const T_from *wstr, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  -template<class T_from , class T_to > -size_t write_array (_In_reads_or_z_opt_(num_chars) const T_from *wstr, size_t num_chars, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  -template<class T_from , class T_to , class _Traits = std::char_traits<T_from>, class _Ax = std::allocator<T_from>> -size_t write_array (const std::basic_string< T_from, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  +template<class T_from , class T_to > +size_t write_array (const T_from *str, charset_encoder< T_from, T_to > &encoder) + Writes array of characters to the stream.
+  +template<class T_from , class T_to > +size_t write_array (_In_reads_or_z_opt_(num_chars) const T_from *str, size_t num_chars, charset_encoder< T_from, T_to > &encoder) + Writes array of characters to the stream.
+  +template<class T_from , class T_to , class _Traits = std::char_traits<T_from>, class _Ax = std::allocator<T_from>> +size_t write_array (const std::basic_string< T_from, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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.
@@ -925,7 +921,7 @@ state_t m_state diff --git a/classstdex_1_1stream_1_1cached__file-members.html b/classstdex_1_1stream_1_1cached__file-members.html index b4eaed086..1c284c7b9 100644 --- a/classstdex_1_1stream_1_1cached__file-members.html +++ b/classstdex_1_1stream_1_1cached__file-members.html @@ -96,49 +96,49 @@ $(function() { ok() conststdex::stream::basicinline open(const schar_t *filename, int mode)stdex::stream::cached_fileinline open(const stdex::sstring &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<<(const std::basic_string< _Elem, _Traits, _Ax > &data) (defined in stdex::stream::basic)stdex::stream::basicinline - operator<<(const std::vector< _Ty, _Alloc > &data) (defined in stdex::stream::basic)stdex::stream::basicinline - operator<<(const std::set< _Kty, _Pr, _Alloc > &data) (defined in stdex::stream::basic)stdex::stream::basicinline - operator<<(const std::multiset< _Kty, _Pr, _Alloc > &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 - operator>>(std::vector< _Ty, _Alloc > &data) (defined in stdex::stream::basic)stdex::stream::basicinline - operator>>(std::set< _Kty, _Pr, _Alloc > &data) (defined in stdex::stream::basic)stdex::stream::basicinline - operator>>(std::multiset< _Kty, _Pr, _Alloc > &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::system)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< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + operator bool() const noexceptstdex::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<<(const std::basic_string< _Elem, _Traits, _Ax > &data) (defined in stdex::stream::basic)stdex::stream::basicinline + operator<<(const std::vector< _Ty, _Alloc > &data) (defined in stdex::stream::basic)stdex::stream::basicinline + operator<<(const std::set< _Kty, _Pr, _Alloc > &data) (defined in stdex::stream::basic)stdex::stream::basicinline + operator<<(const std::multiset< _Kty, _Pr, _Alloc > &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 + operator>>(std::vector< _Ty, _Alloc > &data) (defined in stdex::stream::basic)stdex::stream::basicinline + operator>>(std::set< _Kty, _Pr, _Alloc > &data) (defined in stdex::stream::basic)stdex::stream::basicinline + operator>>(std::multiset< _Kty, _Pr, _Alloc > &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::system)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< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline + readln(std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline - readln_and_attach(std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + readln_and_attach(std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)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 @@ -154,9 +154,9 @@ $(function() { 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(const T_from *wstr, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - write_array(_In_reads_or_z_opt_(num_chars) const T_from *wstr, size_t num_chars, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - write_array(const std::basic_string< T_from, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + write_array(const T_from *str, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + write_array(_In_reads_or_z_opt_(num_chars) const T_from *str, size_t num_chars, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + write_array(const std::basic_string< T_from, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)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 @@ -173,7 +173,7 @@ $(function() { diff --git a/classstdex_1_1stream_1_1cached__file.html b/classstdex_1_1stream_1_1cached__file.html index 16ffe7431..d23cd9b6b 100644 --- a/classstdex_1_1stream_1_1cached__file.html +++ b/classstdex_1_1stream_1_1cached__file.html @@ -115,6 +115,10 @@ Public Member Functions void open (const stdex::sstring &filename, int mode)  Opens file.
  +operator bool () const noexcept + Returns true if file has a valid handle.
- Public Member Functions inherited from stdex::stream::cache  cache (basic_file &source, size_t cache_size=default_cache_size) @@ -214,44 +218,40 @@ void write_byte (uint8 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 T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> -size_t readln (std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - 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 (std::basic_string< _Elem, _Traits, _Ax > &str) + Reads stream to the end-of-line or end-of-file.
+  +template<class T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> +size_t readln (std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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 T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> -size_t readln_and_attach (std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - Reads stream to the end-of-line or end-of-file and append to str.
-  +template<class T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> +size_t readln_and_attach (std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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.
  -template<class T_from , class T_to > -size_t write_array (const T_from *wstr, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  -template<class T_from , class T_to > -size_t write_array (_In_reads_or_z_opt_(num_chars) const T_from *wstr, size_t num_chars, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  -template<class T_from , class T_to , class _Traits = std::char_traits<T_from>, class _Ax = std::allocator<T_from>> -size_t write_array (const std::basic_string< T_from, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  +template<class T_from , class T_to > +size_t write_array (const T_from *str, charset_encoder< T_from, T_to > &encoder) + Writes array of characters to the stream.
+  +template<class T_from , class T_to > +size_t write_array (_In_reads_or_z_opt_(num_chars) const T_from *str, size_t num_chars, charset_encoder< T_from, T_to > &encoder) + Writes array of characters to the stream.
+  +template<class T_from , class T_to , class _Traits = std::char_traits<T_from>, class _Ax = std::allocator<T_from>> +size_t write_array (const std::basic_string< T_from, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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.
@@ -600,7 +600,7 @@ state_t m_state diff --git a/classstdex_1_1stream_1_1converter-members.html b/classstdex_1_1stream_1_1converter-members.html index 16f68884a..b5551bed4 100644 --- a/classstdex_1_1stream_1_1converter-members.html +++ b/classstdex_1_1stream_1_1converter-members.html @@ -124,33 +124,32 @@ $(function() { 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< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline - readln_and_attach(std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)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(const T_from *wstr, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - write_array(_In_reads_or_z_opt_(num_chars) const T_from *wstr, size_t num_chars, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - write_array(const std::basic_string< T_from, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)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_str(const std::basic_string< _Elem, _Traits, _Ax > &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 - ~basic() noexcept(false) (defined in stdex::stream::basic)stdex::stream::basicinlinevirtual + readln(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline + readln(std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline + readln_and_attach(std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)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(const T_from *str, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + write_array(_In_reads_or_z_opt_(num_chars) const T_from *str, size_t num_chars, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + write_array(const std::basic_string< T_from, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)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_str(const std::basic_string< _Elem, _Traits, _Ax > &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 + ~basic() noexcept(false) (defined in stdex::stream::basic)stdex::stream::basicinlinevirtual diff --git a/classstdex_1_1stream_1_1converter.html b/classstdex_1_1stream_1_1converter.html index 39b785908..03fde2efe 100644 --- a/classstdex_1_1stream_1_1converter.html +++ b/classstdex_1_1stream_1_1converter.html @@ -156,44 +156,40 @@ void write_byte (uint8 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 T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> -size_t readln (std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - 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 (std::basic_string< _Elem, _Traits, _Ax > &str) + Reads stream to the end-of-line or end-of-file.
+  +template<class T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> +size_t readln (std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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 T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> -size_t readln_and_attach (std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - Reads stream to the end-of-line or end-of-file and append to str.
-  +template<class T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> +size_t readln_and_attach (std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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.
  -template<class T_from , class T_to > -size_t write_array (const T_from *wstr, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  -template<class T_from , class T_to > -size_t write_array (_In_reads_or_z_opt_(num_chars) const T_from *wstr, size_t num_chars, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  -template<class T_from , class T_to , class _Traits = std::char_traits<T_from>, class _Ax = std::allocator<T_from>> -size_t write_array (const std::basic_string< T_from, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  +template<class T_from , class T_to > +size_t write_array (const T_from *str, charset_encoder< T_from, T_to > &encoder) + Writes array of characters to the stream.
+  +template<class T_from , class T_to > +size_t write_array (_In_reads_or_z_opt_(num_chars) const T_from *str, size_t num_chars, charset_encoder< T_from, T_to > &encoder) + Writes array of characters to the stream.
+  +template<class T_from , class T_to , class _Traits = std::char_traits<T_from>, class _Ax = std::allocator<T_from>> +size_t write_array (const std::basic_string< T_from, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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.
@@ -507,7 +503,7 @@ state_t m_state diff --git a/classstdex_1_1stream_1_1diag__file-members.html b/classstdex_1_1stream_1_1diag__file-members.html index c8ad572fa..7367ef801 100644 --- a/classstdex_1_1stream_1_1diag__file-members.html +++ b/classstdex_1_1stream_1_1diag__file-members.html @@ -130,44 +130,43 @@ $(function() { 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< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline - readln_and_attach(std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)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() conststdex::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(const T_from *wstr, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - write_array(_In_reads_or_z_opt_(num_chars) const T_from *wstr, size_t num_chars, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - write_array(const std::basic_string< T_from, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)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_str(const std::basic_string< _Elem, _Traits, _Ax > &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 - ~basic() noexcept(false) (defined in stdex::stream::basic)stdex::stream::basicinlinevirtual + readln(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline + readln(std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline + readln_and_attach(std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)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() conststdex::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(const T_from *str, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + write_array(_In_reads_or_z_opt_(num_chars) const T_from *str, size_t num_chars, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + write_array(const std::basic_string< T_from, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)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_str(const std::basic_string< _Elem, _Traits, _Ax > &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 + ~basic() noexcept(false) (defined in stdex::stream::basic)stdex::stream::basicinlinevirtual diff --git a/classstdex_1_1stream_1_1diag__file.html b/classstdex_1_1stream_1_1diag__file.html index 265ef4a18..f73b721f6 100644 --- a/classstdex_1_1stream_1_1diag__file.html +++ b/classstdex_1_1stream_1_1diag__file.html @@ -197,44 +197,40 @@ void write_byte (uint8 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 T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> -size_t readln (std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - 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 (std::basic_string< _Elem, _Traits, _Ax > &str) + Reads stream to the end-of-line or end-of-file.
+  +template<class T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> +size_t readln (std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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 T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> -size_t readln_and_attach (std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - Reads stream to the end-of-line or end-of-file and append to str.
-  +template<class T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> +size_t readln_and_attach (std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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.
  -template<class T_from , class T_to > -size_t write_array (const T_from *wstr, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  -template<class T_from , class T_to > -size_t write_array (_In_reads_or_z_opt_(num_chars) const T_from *wstr, size_t num_chars, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  -template<class T_from , class T_to , class _Traits = std::char_traits<T_from>, class _Ax = std::allocator<T_from>> -size_t write_array (const std::basic_string< T_from, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  +template<class T_from , class T_to > +size_t write_array (const T_from *str, charset_encoder< T_from, T_to > &encoder) + Writes array of characters to the stream.
+  +template<class T_from , class T_to > +size_t write_array (_In_reads_or_z_opt_(num_chars) const T_from *str, size_t num_chars, charset_encoder< T_from, T_to > &encoder) + Writes array of characters to the stream.
+  +template<class T_from , class T_to , class _Traits = std::char_traits<T_from>, class _Ax = std::allocator<T_from>> +size_t write_array (const std::basic_string< T_from, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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.
@@ -754,7 +750,7 @@ state_t m_state diff --git a/classstdex_1_1stream_1_1fifo-members.html b/classstdex_1_1stream_1_1fifo-members.html index cccdd4c96..4b3644c91 100644 --- a/classstdex_1_1stream_1_1fifo-members.html +++ b/classstdex_1_1stream_1_1fifo-members.html @@ -127,35 +127,34 @@ $(function() { 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< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline - readln_and_attach(std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)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(const T_from *wstr, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - write_array(_In_reads_or_z_opt_(num_chars) const T_from *wstr, size_t num_chars, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - write_array(const std::basic_string< T_from, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)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_str(const std::basic_string< _Elem, _Traits, _Ax > &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 - ~basic() noexcept(false) (defined in stdex::stream::basic)stdex::stream::basicinlinevirtual - ~fifo() (defined in stdex::stream::fifo)stdex::stream::fifoinlinevirtual + readln(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline + readln(std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline + readln_and_attach(std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)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(const T_from *str, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + write_array(_In_reads_or_z_opt_(num_chars) const T_from *str, size_t num_chars, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + write_array(const std::basic_string< T_from, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)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_str(const std::basic_string< _Elem, _Traits, _Ax > &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 + ~basic() noexcept(false) (defined in stdex::stream::basic)stdex::stream::basicinlinevirtual + ~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 index 04e221bc8..4f956bd83 100644 --- a/classstdex_1_1stream_1_1fifo.html +++ b/classstdex_1_1stream_1_1fifo.html @@ -154,44 +154,40 @@ void write_byte (uint8 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 T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> -size_t readln (std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - 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 (std::basic_string< _Elem, _Traits, _Ax > &str) + Reads stream to the end-of-line or end-of-file.
+  +template<class T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> +size_t readln (std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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 T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> -size_t readln_and_attach (std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - Reads stream to the end-of-line or end-of-file and append to str.
-  +template<class T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> +size_t readln_and_attach (std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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.
  -template<class T_from , class T_to > -size_t write_array (const T_from *wstr, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  -template<class T_from , class T_to > -size_t write_array (_In_reads_or_z_opt_(num_chars) const T_from *wstr, size_t num_chars, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  -template<class T_from , class T_to , class _Traits = std::char_traits<T_from>, class _Ax = std::allocator<T_from>> -size_t write_array (const std::basic_string< T_from, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  +template<class T_from , class T_to > +size_t write_array (const T_from *str, charset_encoder< T_from, T_to > &encoder) + Writes array of characters to the stream.
+  +template<class T_from , class T_to > +size_t write_array (_In_reads_or_z_opt_(num_chars) const T_from *str, size_t num_chars, charset_encoder< T_from, T_to > &encoder) + Writes array of characters to the stream.
+  +template<class T_from , class T_to , class _Traits = std::char_traits<T_from>, class _Ax = std::allocator<T_from>> +size_t write_array (const std::basic_string< T_from, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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.
@@ -479,7 +475,7 @@ state_t m_state diff --git a/classstdex_1_1stream_1_1file-members.html b/classstdex_1_1stream_1_1file-members.html index 369f888bf..dcbc2ed22 100644 --- a/classstdex_1_1stream_1_1file-members.html +++ b/classstdex_1_1stream_1_1file-members.html @@ -145,51 +145,50 @@ $(function() { 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< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline - readln_and_attach(std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - readonly(const stdex::schar_t *filename)stdex::stream::fileinlinestatic - readonly(const stdex::sstring &filename)stdex::stream::fileinlinestatic - 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() conststdex::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(const T_from *wstr, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - write_array(_In_reads_or_z_opt_(num_chars) const T_from *wstr, size_t num_chars, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - write_array(const std::basic_string< T_from, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)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_str(const std::basic_string< _Elem, _Traits, _Ax > &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 - ~basic() noexcept(false) (defined in stdex::stream::basic)stdex::stream::basicinlinevirtual - ~sys_object() noexcept(false) (defined in stdex::sys_object)stdex::sys_objectinlinevirtual + readln(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline + readln(std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline + readln_and_attach(std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + readonly(const stdex::schar_t *filename)stdex::stream::fileinlinestatic + readonly(const stdex::sstring &filename)stdex::stream::fileinlinestatic + 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() conststdex::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(const T_from *str, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + write_array(_In_reads_or_z_opt_(num_chars) const T_from *str, size_t num_chars, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + write_array(const std::basic_string< T_from, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)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_str(const std::basic_string< _Elem, _Traits, _Ax > &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 + ~basic() noexcept(false) (defined in stdex::stream::basic)stdex::stream::basicinlinevirtual + ~sys_object() noexcept(false) (defined in stdex::sys_object)stdex::sys_objectinlinevirtual diff --git a/classstdex_1_1stream_1_1file.html b/classstdex_1_1stream_1_1file.html index f9d3398bf..81d6a4714 100644 --- a/classstdex_1_1stream_1_1file.html +++ b/classstdex_1_1stream_1_1file.html @@ -200,44 +200,40 @@ void write_byte (uint8 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 T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> -size_t readln (std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - 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 (std::basic_string< _Elem, _Traits, _Ax > &str) + Reads stream to the end-of-line or end-of-file.
+  +template<class T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> +size_t readln (std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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 T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> -size_t readln_and_attach (std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - Reads stream to the end-of-line or end-of-file and append to str.
-  +template<class T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> +size_t readln_and_attach (std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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.
  -template<class T_from , class T_to > -size_t write_array (const T_from *wstr, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  -template<class T_from , class T_to > -size_t write_array (_In_reads_or_z_opt_(num_chars) const T_from *wstr, size_t num_chars, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  -template<class T_from , class T_to , class _Traits = std::char_traits<T_from>, class _Ax = std::allocator<T_from>> -size_t write_array (const std::basic_string< T_from, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  +template<class T_from , class T_to > +size_t write_array (const T_from *str, charset_encoder< T_from, T_to > &encoder) + Writes array of characters to the stream.
+  +template<class T_from , class T_to > +size_t write_array (_In_reads_or_z_opt_(num_chars) const T_from *str, size_t num_chars, charset_encoder< T_from, T_to > &encoder) + Writes array of characters to the stream.
+  +template<class T_from , class T_to , class _Traits = std::char_traits<T_from>, class _Ax = std::allocator<T_from>> +size_t write_array (const std::basic_string< T_from, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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.
@@ -1161,7 +1157,7 @@ sys_handle m_h diff --git a/classstdex_1_1stream_1_1file__window-members.html b/classstdex_1_1stream_1_1file__window-members.html index 931b8a2c8..ffa3f1636 100644 --- a/classstdex_1_1stream_1_1file__window-members.html +++ b/classstdex_1_1stream_1_1file__window-members.html @@ -131,44 +131,43 @@ $(function() { 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< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline - readln_and_attach(std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)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() conststdex::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(const T_from *wstr, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - write_array(_In_reads_or_z_opt_(num_chars) const T_from *wstr, size_t num_chars, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - write_array(const std::basic_string< T_from, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)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_str(const std::basic_string< _Elem, _Traits, _Ax > &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 - ~basic() noexcept(false) (defined in stdex::stream::basic)stdex::stream::basicinlinevirtual + readln(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline + readln(std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline + readln_and_attach(std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)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() conststdex::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(const T_from *str, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + write_array(_In_reads_or_z_opt_(num_chars) const T_from *str, size_t num_chars, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + write_array(const std::basic_string< T_from, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)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_str(const std::basic_string< _Elem, _Traits, _Ax > &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 + ~basic() noexcept(false) (defined in stdex::stream::basic)stdex::stream::basicinlinevirtual diff --git a/classstdex_1_1stream_1_1file__window.html b/classstdex_1_1stream_1_1file__window.html index ac0461a73..b1c39b590 100644 --- a/classstdex_1_1stream_1_1file__window.html +++ b/classstdex_1_1stream_1_1file__window.html @@ -197,44 +197,40 @@ void write_byte (uint8 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 T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> -size_t readln (std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - 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 (std::basic_string< _Elem, _Traits, _Ax > &str) + Reads stream to the end-of-line or end-of-file.
+  +template<class T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> +size_t readln (std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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 T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> -size_t readln_and_attach (std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - Reads stream to the end-of-line or end-of-file and append to str.
-  +template<class T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> +size_t readln_and_attach (std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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.
  -template<class T_from , class T_to > -size_t write_array (const T_from *wstr, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  -template<class T_from , class T_to > -size_t write_array (_In_reads_or_z_opt_(num_chars) const T_from *wstr, size_t num_chars, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  -template<class T_from , class T_to , class _Traits = std::char_traits<T_from>, class _Ax = std::allocator<T_from>> -size_t write_array (const std::basic_string< T_from, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  +template<class T_from , class T_to > +size_t write_array (const T_from *str, charset_encoder< T_from, T_to > &encoder) + Writes array of characters to the stream.
+  +template<class T_from , class T_to > +size_t write_array (_In_reads_or_z_opt_(num_chars) const T_from *str, size_t num_chars, charset_encoder< T_from, T_to > &encoder) + Writes array of characters to the stream.
+  +template<class T_from , class T_to , class _Traits = std::char_traits<T_from>, class _Ax = std::allocator<T_from>> +size_t write_array (const std::basic_string< T_from, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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.
@@ -787,7 +783,7 @@ state_t m_state diff --git a/classstdex_1_1stream_1_1limiter-members.html b/classstdex_1_1stream_1_1limiter-members.html index 6069e9c0a..27cc9bada 100644 --- a/classstdex_1_1stream_1_1limiter-members.html +++ b/classstdex_1_1stream_1_1limiter-members.html @@ -126,34 +126,33 @@ $(function() { 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< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline - readln_and_attach(std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)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(const T_from *wstr, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - write_array(_In_reads_or_z_opt_(num_chars) const T_from *wstr, size_t num_chars, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - write_array(const std::basic_string< T_from, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)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_str(const std::basic_string< _Elem, _Traits, _Ax > &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 - ~basic() noexcept(false) (defined in stdex::stream::basic)stdex::stream::basicinlinevirtual + readln(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline + readln(std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline + readln_and_attach(std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)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(const T_from *str, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + write_array(_In_reads_or_z_opt_(num_chars) const T_from *str, size_t num_chars, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + write_array(const std::basic_string< T_from, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)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_str(const std::basic_string< _Elem, _Traits, _Ax > &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 + ~basic() noexcept(false) (defined in stdex::stream::basic)stdex::stream::basicinlinevirtual diff --git a/classstdex_1_1stream_1_1limiter.html b/classstdex_1_1stream_1_1limiter.html index 9136afc2f..379e8495d 100644 --- a/classstdex_1_1stream_1_1limiter.html +++ b/classstdex_1_1stream_1_1limiter.html @@ -153,44 +153,40 @@ void write_byte (uint8 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 T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> -size_t readln (std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - 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 (std::basic_string< _Elem, _Traits, _Ax > &str) + Reads stream to the end-of-line or end-of-file.
+  +template<class T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> +size_t readln (std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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 T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> -size_t readln_and_attach (std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - Reads stream to the end-of-line or end-of-file and append to str.
-  +template<class T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> +size_t readln_and_attach (std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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.
  -template<class T_from , class T_to > -size_t write_array (const T_from *wstr, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  -template<class T_from , class T_to > -size_t write_array (_In_reads_or_z_opt_(num_chars) const T_from *wstr, size_t num_chars, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  -template<class T_from , class T_to , class _Traits = std::char_traits<T_from>, class _Ax = std::allocator<T_from>> -size_t write_array (const std::basic_string< T_from, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  +template<class T_from , class T_to > +size_t write_array (const T_from *str, charset_encoder< T_from, T_to > &encoder) + Writes array of characters to the stream.
+  +template<class T_from , class T_to > +size_t write_array (_In_reads_or_z_opt_(num_chars) const T_from *str, size_t num_chars, charset_encoder< T_from, T_to > &encoder) + Writes array of characters to the stream.
+  +template<class T_from , class T_to , class _Traits = std::char_traits<T_from>, class _Ax = std::allocator<T_from>> +size_t write_array (const std::basic_string< T_from, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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.
@@ -456,7 +452,7 @@ state_t m_state diff --git a/classstdex_1_1stream_1_1memory__file-members.html b/classstdex_1_1stream_1_1memory__file-members.html index 12ca52fad..356fb96c7 100644 --- a/classstdex_1_1stream_1_1memory__file-members.html +++ b/classstdex_1_1stream_1_1memory__file-members.html @@ -157,62 +157,61 @@ $(function() { 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< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline - readln_and_attach(std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - reserve(size_t required, bool tight=false) noexceptstdex::stream::memory_fileinline - save(const schar_t *filename, int mode)stdex::stream::memory_fileinline - save(const stdex::sstring &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() conststdex::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(const T_from *wstr, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - write_array(_In_reads_or_z_opt_(num_chars) const T_from *wstr, size_t num_chars, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - write_array(const std::basic_string< T_from, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)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_str(const std::basic_string< _Elem, _Traits, _Ax > &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 - ~basic() noexcept(false) (defined in stdex::stream::basic)stdex::stream::basicinlinevirtual - ~memory_file() (defined in stdex::stream::memory_file)stdex::stream::memory_fileinlinevirtual + readln(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline + readln(std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline + readln_and_attach(std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + reserve(size_t required, bool tight=false) noexceptstdex::stream::memory_fileinline + save(const schar_t *filename, int mode)stdex::stream::memory_fileinline + save(const stdex::sstring &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() conststdex::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(const T_from *str, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + write_array(_In_reads_or_z_opt_(num_chars) const T_from *str, size_t num_chars, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + write_array(const std::basic_string< T_from, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)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_str(const std::basic_string< _Elem, _Traits, _Ax > &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 + ~basic() noexcept(false) (defined in stdex::stream::basic)stdex::stream::basicinlinevirtual + ~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 index 6e1cf5736..3ae319f96 100644 --- a/classstdex_1_1stream_1_1memory__file.html +++ b/classstdex_1_1stream_1_1memory__file.html @@ -415,44 +415,40 @@ void write_byte (uint8 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 T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> -size_t readln (std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - 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 (std::basic_string< _Elem, _Traits, _Ax > &str) + Reads stream to the end-of-line or end-of-file.
+  +template<class T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> +size_t readln (std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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 T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> -size_t readln_and_attach (std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - Reads stream to the end-of-line or end-of-file and append to str.
-  +template<class T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> +size_t readln_and_attach (std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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.
  -template<class T_from , class T_to > -size_t write_array (const T_from *wstr, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  -template<class T_from , class T_to > -size_t write_array (_In_reads_or_z_opt_(num_chars) const T_from *wstr, size_t num_chars, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  -template<class T_from , class T_to , class _Traits = std::char_traits<T_from>, class _Ax = std::allocator<T_from>> -size_t write_array (const std::basic_string< T_from, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  +template<class T_from , class T_to > +size_t write_array (const T_from *str, charset_encoder< T_from, T_to > &encoder) + Writes array of characters to the stream.
+  +template<class T_from , class T_to > +size_t write_array (_In_reads_or_z_opt_(num_chars) const T_from *str, size_t num_chars, charset_encoder< T_from, T_to > &encoder) + Writes array of characters to the stream.
+  +template<class T_from , class T_to , class _Traits = std::char_traits<T_from>, class _Ax = std::allocator<T_from>> +size_t write_array (const std::basic_string< T_from, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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.
@@ -1838,7 +1834,7 @@ template<class T > diff --git a/classstdex_1_1stream_1_1replicator-members.html b/classstdex_1_1stream_1_1replicator-members.html index e6ac9c468..621c4e5f5 100644 --- a/classstdex_1_1stream_1_1replicator-members.html +++ b/classstdex_1_1stream_1_1replicator-members.html @@ -125,35 +125,34 @@ $(function() { 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< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline - readln_and_attach(std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)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(const T_from *wstr, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - write_array(_In_reads_or_z_opt_(num_chars) const T_from *wstr, size_t num_chars, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - write_array(const std::basic_string< T_from, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)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_str(const std::basic_string< _Elem, _Traits, _Ax > &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 - ~basic() noexcept(false) (defined in stdex::stream::basic)stdex::stream::basicinlinevirtual - ~replicator() (defined in stdex::stream::replicator)stdex::stream::replicatorinlinevirtual + readln(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline + readln(std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline + readln_and_attach(std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)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(const T_from *str, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + write_array(_In_reads_or_z_opt_(num_chars) const T_from *str, size_t num_chars, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + write_array(const std::basic_string< T_from, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)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_str(const std::basic_string< _Elem, _Traits, _Ax > &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 + ~basic() noexcept(false) (defined in stdex::stream::basic)stdex::stream::basicinlinevirtual + ~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 index fb3aba5bf..36e5b346f 100644 --- a/classstdex_1_1stream_1_1replicator.html +++ b/classstdex_1_1stream_1_1replicator.html @@ -159,44 +159,40 @@ void write_byte (uint8 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 T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> -size_t readln (std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - 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 (std::basic_string< _Elem, _Traits, _Ax > &str) + Reads stream to the end-of-line or end-of-file.
+  +template<class T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> +size_t readln (std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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 T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> -size_t readln_and_attach (std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - Reads stream to the end-of-line or end-of-file and append to str.
-  +template<class T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> +size_t readln_and_attach (std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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.
  -template<class T_from , class T_to > -size_t write_array (const T_from *wstr, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  -template<class T_from , class T_to > -size_t write_array (_In_reads_or_z_opt_(num_chars) const T_from *wstr, size_t num_chars, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  -template<class T_from , class T_to , class _Traits = std::char_traits<T_from>, class _Ax = std::allocator<T_from>> -size_t write_array (const std::basic_string< T_from, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  +template<class T_from , class T_to > +size_t write_array (const T_from *str, charset_encoder< T_from, T_to > &encoder) + Writes array of characters to the stream.
+  +template<class T_from , class T_to > +size_t write_array (_In_reads_or_z_opt_(num_chars) const T_from *str, size_t num_chars, charset_encoder< T_from, T_to > &encoder) + Writes array of characters to the stream.
+  +template<class T_from , class T_to , class _Traits = std::char_traits<T_from>, class _Ax = std::allocator<T_from>> +size_t write_array (const std::basic_string< T_from, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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.
@@ -462,7 +458,7 @@ state_t m_state diff --git a/classstdex_1_1stream_1_1replicator_1_1worker-members.html b/classstdex_1_1stream_1_1replicator_1_1worker-members.html index 2202522aa..37f9652e6 100644 --- a/classstdex_1_1stream_1_1replicator_1_1worker-members.html +++ b/classstdex_1_1stream_1_1replicator_1_1worker-members.html @@ -93,7 +93,7 @@ $(function() { diff --git a/classstdex_1_1stream_1_1replicator_1_1worker.html b/classstdex_1_1stream_1_1replicator_1_1worker.html index bcfcf713a..97422ba80 100644 --- a/classstdex_1_1stream_1_1replicator_1_1worker.html +++ b/classstdex_1_1stream_1_1replicator_1_1worker.html @@ -149,7 +149,7 @@ void process_op () diff --git a/classstdex_1_1stream_1_1socket-members.html b/classstdex_1_1stream_1_1socket-members.html index 45c66a0de..79e3b6592 100644 --- a/classstdex_1_1stream_1_1socket-members.html +++ b/classstdex_1_1stream_1_1socket-members.html @@ -126,37 +126,36 @@ $(function() { 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< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline - readln_and_attach(std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - skip(fsize_t amount)stdex::stream::basicinlinevirtual - socket(socket_t h=invalid_socket, state_t state=state_t::ok) (defined in stdex::stream::socket)stdex::stream::socketinline - socket(socket &&other) noexcept (defined in stdex::stream::socket)stdex::stream::socketinline - socket(int af, int type, int protocol)stdex::stream::socketinline - state() conststdex::stream::basicinline - write(_In_reads_bytes_opt_(length) const void *data, size_t length)stdex::stream::socketinlinevirtual - write_array(_In_reads_bytes_opt_(size *count) const void *array, size_t size, size_t count)stdex::stream::basicinline - write_array(const T_from *wstr, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - write_array(_In_reads_or_z_opt_(num_chars) const T_from *wstr, size_t num_chars, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - write_array(const std::basic_string< T_from, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)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_str(const std::basic_string< _Elem, _Traits, _Ax > &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 - ~basic() noexcept(false) (defined in stdex::stream::basic)stdex::stream::basicinlinevirtual - ~socket() (defined in stdex::stream::socket)stdex::stream::socketinlinevirtual + readln(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline + readln(std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline + readln_and_attach(std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + skip(fsize_t amount)stdex::stream::basicinlinevirtual + socket(socket_t h=invalid_socket, state_t state=state_t::ok) (defined in stdex::stream::socket)stdex::stream::socketinline + socket(socket &&other) noexcept (defined in stdex::stream::socket)stdex::stream::socketinline + socket(int af, int type, int protocol)stdex::stream::socketinline + state() conststdex::stream::basicinline + write(_In_reads_bytes_opt_(length) const void *data, size_t length)stdex::stream::socketinlinevirtual + write_array(_In_reads_bytes_opt_(size *count) const void *array, size_t size, size_t count)stdex::stream::basicinline + write_array(const T_from *str, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + write_array(_In_reads_or_z_opt_(num_chars) const T_from *str, size_t num_chars, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + write_array(const std::basic_string< T_from, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)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_str(const std::basic_string< _Elem, _Traits, _Ax > &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 + ~basic() noexcept(false) (defined in stdex::stream::basic)stdex::stream::basicinlinevirtual + ~socket() (defined in stdex::stream::socket)stdex::stream::socketinlinevirtual diff --git a/classstdex_1_1stream_1_1socket.html b/classstdex_1_1stream_1_1socket.html index 0c9847f08..5865907a2 100644 --- a/classstdex_1_1stream_1_1socket.html +++ b/classstdex_1_1stream_1_1socket.html @@ -164,44 +164,40 @@ void write_byte (uint8 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 T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> -size_t readln (std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - 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 (std::basic_string< _Elem, _Traits, _Ax > &str) + Reads stream to the end-of-line or end-of-file.
+  +template<class T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> +size_t readln (std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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 T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> -size_t readln_and_attach (std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - Reads stream to the end-of-line or end-of-file and append to str.
-  +template<class T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> +size_t readln_and_attach (std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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.
  -template<class T_from , class T_to > -size_t write_array (const T_from *wstr, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  -template<class T_from , class T_to > -size_t write_array (_In_reads_or_z_opt_(num_chars) const T_from *wstr, size_t num_chars, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  -template<class T_from , class T_to , class _Traits = std::char_traits<T_from>, class _Ax = std::allocator<T_from>> -size_t write_array (const std::basic_string< T_from, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  +template<class T_from , class T_to > +size_t write_array (const T_from *str, charset_encoder< T_from, T_to > &encoder) + Writes array of characters to the stream.
+  +template<class T_from , class T_to > +size_t write_array (_In_reads_or_z_opt_(num_chars) const T_from *str, size_t num_chars, charset_encoder< T_from, T_to > &encoder) + Writes array of characters to the stream.
+  +template<class T_from , class T_to , class _Traits = std::char_traits<T_from>, class _Ax = std::allocator<T_from>> +size_t write_array (const std::basic_string< T_from, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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.
@@ -533,7 +529,7 @@ state_t m_state diff --git a/classstdex_1_1stream_1_1window-members.html b/classstdex_1_1stream_1_1window-members.html index 80d26f5ee..4d6ce9500 100644 --- a/classstdex_1_1stream_1_1window-members.html +++ b/classstdex_1_1stream_1_1window-members.html @@ -127,36 +127,35 @@ $(function() { 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< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline - readln_and_attach(std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)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(const T_from *wstr, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - write_array(_In_reads_or_z_opt_(num_chars) const T_from *wstr, size_t num_chars, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - write_array(const std::basic_string< T_from, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)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_str(const std::basic_string< _Elem, _Traits, _Ax > &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 - ~basic() noexcept(false) (defined in stdex::stream::basic)stdex::stream::basicinlinevirtual + readln(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline + readln(std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline + readln_and_attach(std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)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(const T_from *str, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + write_array(_In_reads_or_z_opt_(num_chars) const T_from *str, size_t num_chars, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + write_array(const std::basic_string< T_from, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)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_str(const std::basic_string< _Elem, _Traits, _Ax > &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 + ~basic() noexcept(false) (defined in stdex::stream::basic)stdex::stream::basicinlinevirtual diff --git a/classstdex_1_1stream_1_1window.html b/classstdex_1_1stream_1_1window.html index f71a4d781..fe56df9f7 100644 --- a/classstdex_1_1stream_1_1window.html +++ b/classstdex_1_1stream_1_1window.html @@ -157,44 +157,40 @@ void write_byte (uint8 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 T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> -size_t readln (std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - 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 (std::basic_string< _Elem, _Traits, _Ax > &str) + Reads stream to the end-of-line or end-of-file.
+  +template<class T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> +size_t readln (std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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 T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> -size_t readln_and_attach (std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - Reads stream to the end-of-line or end-of-file and append to str.
-  +template<class T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> +size_t readln_and_attach (std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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.
  -template<class T_from , class T_to > -size_t write_array (const T_from *wstr, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  -template<class T_from , class T_to > -size_t write_array (_In_reads_or_z_opt_(num_chars) const T_from *wstr, size_t num_chars, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  -template<class T_from , class T_to , class _Traits = std::char_traits<T_from>, class _Ax = std::allocator<T_from>> -size_t write_array (const std::basic_string< T_from, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  +template<class T_from , class T_to > +size_t write_array (const T_from *str, charset_encoder< T_from, T_to > &encoder) + Writes array of characters to the stream.
+  +template<class T_from , class T_to > +size_t write_array (_In_reads_or_z_opt_(num_chars) const T_from *str, size_t num_chars, charset_encoder< T_from, T_to > &encoder) + Writes array of characters to the stream.
+  +template<class T_from , class T_to , class _Traits = std::char_traits<T_from>, class _Ax = std::allocator<T_from>> +size_t write_array (const std::basic_string< T_from, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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.
@@ -465,7 +461,7 @@ state_t m_state diff --git a/classstdex_1_1stream__hasher-members.html b/classstdex_1_1stream__hasher-members.html index c3377e5c3..f0c985d50 100644 --- a/classstdex_1_1stream__hasher-members.html +++ b/classstdex_1_1stream__hasher-members.html @@ -125,34 +125,33 @@ $(function() { 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< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline - readln_and_attach(std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - skip(fsize_t amount)stdex::stream::basicinlinevirtual - state() conststdex::stream::basicinline - stream_hasher(basic_hash< T > &hash, stdex::stream::basic &source) (defined in stdex::stream_hasher< T >)stdex::stream_hasher< T >inline - write(_In_reads_bytes_opt_(length) const void *data, size_t length)stdex::stream_hasher< T >inlinevirtual - write_array(_In_reads_bytes_opt_(size *count) const void *array, size_t size, size_t count)stdex::stream::basicinline - write_array(const T_from *wstr, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - write_array(_In_reads_or_z_opt_(num_chars) const T_from *wstr, size_t num_chars, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline - write_array(const std::basic_string< T_from, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)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_str(const std::basic_string< _Elem, _Traits, _Ax > &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 - ~basic() noexcept(false) (defined in stdex::stream::basic)stdex::stream::basicinlinevirtual + readln(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline + readln(std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)stdex::stream::basicinline + readln_and_attach(std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + skip(fsize_t amount)stdex::stream::basicinlinevirtual + state() conststdex::stream::basicinline + stream_hasher(basic_hash< T > &hash, stdex::stream::basic &source) (defined in stdex::stream_hasher< T >)stdex::stream_hasher< T >inline + write(_In_reads_bytes_opt_(length) const void *data, size_t length)stdex::stream_hasher< T >inlinevirtual + write_array(_In_reads_bytes_opt_(size *count) const void *array, size_t size, size_t count)stdex::stream::basicinline + write_array(const T_from *str, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + write_array(_In_reads_or_z_opt_(num_chars) const T_from *str, size_t num_chars, charset_encoder< T_from, T_to > &encoder)stdex::stream::basicinline + write_array(const std::basic_string< T_from, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)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_str(const std::basic_string< _Elem, _Traits, _Ax > &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 + ~basic() noexcept(false) (defined in stdex::stream::basic)stdex::stream::basicinlinevirtual diff --git a/classstdex_1_1stream__hasher.html b/classstdex_1_1stream__hasher.html index 392e07057..772cf3eeb 100644 --- a/classstdex_1_1stream__hasher.html +++ b/classstdex_1_1stream__hasher.html @@ -152,44 +152,40 @@ void write_byte (uint8 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 T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> -size_t readln (std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - 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 (std::basic_string< _Elem, _Traits, _Ax > &str) + Reads stream to the end-of-line or end-of-file.
+  +template<class T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> +size_t readln (std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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 T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> -size_t readln_and_attach (std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - Reads stream to the end-of-line or end-of-file and append to str.
-  +template<class T_from , class T_to , class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>> +size_t readln_and_attach (std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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.
  -template<class T_from , class T_to > -size_t write_array (const T_from *wstr, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  -template<class T_from , class T_to > -size_t write_array (_In_reads_or_z_opt_(num_chars) const T_from *wstr, size_t num_chars, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  -template<class T_from , class T_to , class _Traits = std::char_traits<T_from>, class _Ax = std::allocator<T_from>> -size_t write_array (const std::basic_string< T_from, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder) - Writes array of characters to the stream.
-  +template<class T_from , class T_to > +size_t write_array (const T_from *str, charset_encoder< T_from, T_to > &encoder) + Writes array of characters to the stream.
+  +template<class T_from , class T_to > +size_t write_array (_In_reads_or_z_opt_(num_chars) const T_from *str, size_t num_chars, charset_encoder< T_from, T_to > &encoder) + Writes array of characters to the stream.
+  +template<class T_from , class T_to , class _Traits = std::char_traits<T_from>, class _Ax = std::allocator<T_from>> +size_t write_array (const std::basic_string< T_from, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder) + 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.
@@ -448,7 +444,7 @@ template<class T > diff --git a/classstdex_1_1sys__object-members.html b/classstdex_1_1sys__object-members.html index 543d07d40..2e2400af3 100644 --- a/classstdex_1_1sys__object-members.html +++ b/classstdex_1_1sys__object-members.html @@ -95,7 +95,7 @@ $(function() { diff --git a/classstdex_1_1sys__object.html b/classstdex_1_1sys__object.html index 5e9f3de21..abe9d2644 100644 --- a/classstdex_1_1sys__object.html +++ b/classstdex_1_1sys__object.html @@ -182,7 +182,7 @@ sys_handle m_h diff --git a/classstdex_1_1user__cancelled-members.html b/classstdex_1_1user__cancelled-members.html index 964cd91ea..f7f545789 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 6f9ab0463..f27d116dc 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 bdce89f0e..b89703fa5 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 650c1ed71..be9afd6d0 100644 --- a/classstdex_1_1vector__queue.html +++ b/classstdex_1_1vector__queue.html @@ -795,7 +795,7 @@ template<class T > diff --git a/classstdex_1_1watchdog-members.html b/classstdex_1_1watchdog-members.html index d9d49027b..731d518da 100644 --- a/classstdex_1_1watchdog-members.html +++ b/classstdex_1_1watchdog-members.html @@ -94,7 +94,7 @@ $(function() { diff --git a/classstdex_1_1watchdog.html b/classstdex_1_1watchdog.html index 1dc3036ce..b1ea6dbc5 100644 --- a/classstdex_1_1watchdog.html +++ b/classstdex_1_1watchdog.html @@ -223,7 +223,7 @@ template<class _Clock , class _Duration = typename _Clock::duration> diff --git a/dir_4be4f7b278e009bf0f1906cf31fb73bd.html b/dir_4be4f7b278e009bf0f1906cf31fb73bd.html index 9edd21a77..84aa380b9 100644 --- a/dir_4be4f7b278e009bf0f1906cf31fb73bd.html +++ b/dir_4be4f7b278e009bf0f1906cf31fb73bd.html @@ -104,7 +104,7 @@ Files diff --git a/dir_d44c64559bbebec7f509842c48db8b23.html b/dir_d44c64559bbebec7f509842c48db8b23.html index 7404aad08..e344aa699 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 7cd8eac16..277180306 100644 --- a/dir_fca3c47b2ea228727bd6729832f89576.html +++ b/dir_fca3c47b2ea228727bd6729832f89576.html @@ -148,7 +148,7 @@ Files diff --git a/endian_8hpp_source.html b/endian_8hpp_source.html index 7597ae6bb..610948a14 100644 --- a/endian_8hpp_source.html +++ b/endian_8hpp_source.html @@ -225,7 +225,7 @@ $(document).ready(function() { init_codefold(0); }); diff --git a/exception_8hpp_source.html b/exception_8hpp_source.html index 6a0eb9fcc..206392fa8 100644 --- a/exception_8hpp_source.html +++ b/exception_8hpp_source.html @@ -107,7 +107,7 @@ $(document).ready(function() { init_codefold(0); }); diff --git a/files.html b/files.html index 266540f54..3e093b245 100644 --- a/files.html +++ b/files.html @@ -125,7 +125,7 @@ $(function() { diff --git a/functions.html b/functions.html index b53283a01..4cc6ad78f 100644 --- a/functions.html +++ b/functions.html @@ -80,11 +80,11 @@ $(function() {
  • after_word : stdex::html::inserted_token
  • allow_on_edge : stdex::parser::basic_dns_domain_char< T >
  • apex : stdex::parser::basic_emoticon< T >
  • -
  • append() : stdex::html::document< _Elem, _Traits, _Alloc >
  • +
  • append() : stdex::html::document< _Elem, _Traits, _Alloc >
  • append_inserted_tokens() : stdex::html::parser< _Elem, _Traits, _Alloc >
  • append_tag() : stdex::html::token
  • append_token() : stdex::html::parser< _Elem, _Traits, _Alloc >
  • -
  • assign() : stdex::html::document< _Elem, _Traits, _Alloc >
  • +
  • assign() : stdex::html::document< _Elem, _Traits, _Alloc >
  • at() : stdex::vector_queue< T >
  • at_abs() : stdex::vector_queue< T >
  • atime() : stdex::stream::basic_file, stdex::stream::cache, stdex::stream::file
  • @@ -94,7 +94,7 @@ $(function() { diff --git a/functions_b.html b/functions_b.html index 22033ec46..e92208737 100644 --- a/functions_b.html +++ b/functions_b.html @@ -88,7 +88,7 @@ $(function() { diff --git a/functions_c.html b/functions_c.html index b97f57742..45920edf4 100644 --- a/functions_c.html +++ b/functions_c.html @@ -98,7 +98,7 @@ $(function() { diff --git a/functions_d.html b/functions_d.html index 7b9b09a43..0ba9fbbc8 100644 --- a/functions_d.html +++ b/functions_d.html @@ -90,7 +90,7 @@ $(function() { diff --git a/functions_e.html b/functions_e.html index 7b96f53d8..ff03ca5f6 100644 --- a/functions_e.html +++ b/functions_e.html @@ -91,7 +91,7 @@ $(function() { diff --git a/functions_enum.html b/functions_enum.html index 5ce2746ef..7cf008471 100644 --- a/functions_enum.html +++ b/functions_enum.html @@ -76,7 +76,7 @@ $(function() { diff --git a/functions_f.html b/functions_f.html index 4ad7a03b6..df962671f 100644 --- a/functions_f.html +++ b/functions_f.html @@ -87,7 +87,7 @@ $(function() { diff --git a/functions_func.html b/functions_func.html index 553693e5b..90a05b45f 100644 --- a/functions_func.html +++ b/functions_func.html @@ -75,11 +75,11 @@ $(function() {

    - a -

    • abs() : stdex::vector_queue< T >
    • active_element() : stdex::html::document< _Elem, _Traits, _Alloc >
    • -
    • append() : stdex::html::document< _Elem, _Traits, _Alloc >
    • +
    • append() : stdex::html::document< _Elem, _Traits, _Alloc >
    • append_inserted_tokens() : stdex::html::parser< _Elem, _Traits, _Alloc >
    • append_tag() : stdex::html::token
    • append_token() : stdex::html::parser< _Elem, _Traits, _Alloc >
    • -
    • assign() : stdex::html::document< _Elem, _Traits, _Alloc >
    • +
    • assign() : stdex::html::document< _Elem, _Traits, _Alloc >
    • at() : stdex::vector_queue< T >
    • at_abs() : stdex::vector_queue< T >
    • atime() : stdex::stream::basic_file, stdex::stream::cache, stdex::stream::file
    • @@ -88,7 +88,7 @@ $(function() { diff --git a/functions_func_b.html b/functions_func_b.html index f1d6bc00c..4985d7de9 100644 --- a/functions_func_b.html +++ b/functions_func_b.html @@ -80,7 +80,7 @@ $(function() { diff --git a/functions_func_c.html b/functions_func_c.html index 9aae533de..0d72efe71 100644 --- a/functions_func_c.html +++ b/functions_func_c.html @@ -85,7 +85,7 @@ $(function() { diff --git a/functions_func_d.html b/functions_func_d.html index 12b8b199c..d1f502f28 100644 --- a/functions_func_d.html +++ b/functions_func_d.html @@ -84,7 +84,7 @@ $(function() { diff --git a/functions_func_e.html b/functions_func_e.html index aebf5457f..bd8d03fd0 100644 --- a/functions_func_e.html +++ b/functions_func_e.html @@ -82,7 +82,7 @@ $(function() { diff --git a/functions_func_f.html b/functions_func_f.html index 13bca00ab..e47c61922 100644 --- a/functions_func_f.html +++ b/functions_func_f.html @@ -86,7 +86,7 @@ $(function() { diff --git a/functions_func_g.html b/functions_func_g.html index 153751d9f..3768276a7 100644 --- a/functions_func_g.html +++ b/functions_func_g.html @@ -79,7 +79,7 @@ $(function() { diff --git a/functions_func_h.html b/functions_func_h.html index da3378b35..be4c0df2c 100644 --- a/functions_func_h.html +++ b/functions_func_h.html @@ -81,7 +81,7 @@ $(function() { diff --git a/functions_func_i.html b/functions_func_i.html index 541a431e5..ac43c0b46 100644 --- a/functions_func_i.html +++ b/functions_func_i.html @@ -97,7 +97,7 @@ $(function() { diff --git a/functions_func_l.html b/functions_func_l.html index 8802efeaa..ff1f88b5a 100644 --- a/functions_func_l.html +++ b/functions_func_l.html @@ -81,7 +81,7 @@ $(function() { diff --git a/functions_func_m.html b/functions_func_m.html index 1685656ad..861a0042b 100644 --- a/functions_func_m.html +++ b/functions_func_m.html @@ -83,7 +83,7 @@ $(function() { diff --git a/functions_func_n.html b/functions_func_n.html index 966129541..6e48e7723 100644 --- a/functions_func_n.html +++ b/functions_func_n.html @@ -78,7 +78,7 @@ $(function() { diff --git a/functions_func_o.html b/functions_func_o.html index ead8a4e71..ea6dbcd62 100644 --- a/functions_func_o.html +++ b/functions_func_o.html @@ -75,7 +75,7 @@ $(function() {

      - o -

      • ok() : stdex::stream::basic
      • open() : stdex::idrec::record< T, T_ID, ID, T_SIZE, ALIGN >, stdex::stream::cached_file, stdex::stream::file
      • -
      • operator bool() : stdex::interval< T >, stdex::stream::socket, stdex::sys_object
      • +
      • operator bool() : stdex::interval< T >, stdex::stream::cached_file, stdex::stream::socket, stdex::sys_object
      • operator const T &() : stdex::basic_hash< T >
      • operator!=() : stdex::interval< T >, stdex::mapping< T >
      • operator()() : stdex::free_locale_delete
      • @@ -90,7 +90,7 @@ $(function() { diff --git a/functions_func_p.html b/functions_func_p.html index 8d9c695b2..119845f33 100644 --- a/functions_func_p.html +++ b/functions_func_p.html @@ -85,7 +85,7 @@ $(function() { diff --git a/functions_func_q.html b/functions_func_q.html index cab68a80c..2819e3a7a 100644 --- a/functions_func_q.html +++ b/functions_func_q.html @@ -78,7 +78,7 @@ $(function() { diff --git a/functions_func_r.html b/functions_func_r.html index a13205632..a5fd73248 100644 --- a/functions_func_r.html +++ b/functions_func_r.html @@ -80,8 +80,8 @@ $(function() {
      • read_data() : stdex::stream::basic, stdex::stream::memory_file
      • read_remainder() : stdex::stream::basic, stdex::stream::basic_file
      • read_str() : stdex::stream::basic, stdex::stream::memory_file
      • -
      • readln() : stdex::stream::basic
      • -
      • readln_and_attach() : stdex::stream::basic
      • +
      • readln() : stdex::stream::basic
      • +
      • readln_and_attach() : stdex::stream::basic
      • readonly() : stdex::stream::file
      • record() : stdex::idrec::record< T, T_ID, ID, T_SIZE, ALIGN >
      • remove() : stdex::stream::replicator
      • @@ -92,7 +92,7 @@ $(function() { diff --git a/functions_func_s.html b/functions_func_s.html index c68859aca..6adc3d1c1 100644 --- a/functions_func_s.html +++ b/functions_func_s.html @@ -101,7 +101,7 @@ $(function() { diff --git a/functions_func_t.html b/functions_func_t.html index c848a270e..783702360 100644 --- a/functions_func_t.html +++ b/functions_func_t.html @@ -85,7 +85,7 @@ $(function() { diff --git a/functions_func_u.html b/functions_func_u.html index 1c0788c40..6b110b660 100644 --- a/functions_func_u.html +++ b/functions_func_u.html @@ -79,7 +79,7 @@ $(function() { diff --git a/functions_func_v.html b/functions_func_v.html index 72c14c31a..d1c682c78 100644 --- a/functions_func_v.html +++ b/functions_func_v.html @@ -78,7 +78,7 @@ $(function() { diff --git a/functions_func_w.html b/functions_func_w.html index a760a798c..6b104874a 100644 --- a/functions_func_w.html +++ b/functions_func_w.html @@ -75,7 +75,7 @@ $(function() {

        - w -

        • watchdog() : stdex::watchdog< _Clock, _Duration >
        • write() : stdex::base64_writer, stdex::stream::async_writer< CAPACITY >, stdex::stream::basic, stdex::stream::basic_sys, stdex::stream::buffer, stdex::stream::cache, stdex::stream::converter, stdex::stream::diag_file, stdex::stream::fifo, stdex::stream::file_window, stdex::stream::limiter, stdex::stream::memory_file, stdex::stream::replicator, stdex::stream::socket, stdex::stream::window, stdex::stream_hasher< T >
        • -
        • write_array() : stdex::stream::basic
        • +
        • write_array() : stdex::stream::basic
        • write_byte() : stdex::stream::basic, stdex::stream::memory_file
        • write_charset() : stdex::stream::basic
        • write_data() : stdex::stream::basic, stdex::stream::memory_file
        • @@ -87,7 +87,7 @@ $(function() { diff --git a/functions_func_~.html b/functions_func_~.html index f96ce1306..f9d3de140 100644 --- a/functions_func_~.html +++ b/functions_func_~.html @@ -79,7 +79,7 @@ $(function() { diff --git a/functions_g.html b/functions_g.html index b4aec131b..461b0c651 100644 --- a/functions_g.html +++ b/functions_g.html @@ -79,7 +79,7 @@ $(function() { diff --git a/functions_h.html b/functions_h.html index 06a02475e..624a7d8f1 100644 --- a/functions_h.html +++ b/functions_h.html @@ -82,7 +82,7 @@ $(function() { diff --git a/functions_i.html b/functions_i.html index 515f7007b..cca613c24 100644 --- a/functions_i.html +++ b/functions_i.html @@ -100,7 +100,7 @@ $(function() { diff --git a/functions_l.html b/functions_l.html index b9c403acd..86a4c28d7 100644 --- a/functions_l.html +++ b/functions_l.html @@ -83,7 +83,7 @@ $(function() { diff --git a/functions_m.html b/functions_m.html index 82dd583ec..c47917e77 100644 --- a/functions_m.html +++ b/functions_m.html @@ -111,7 +111,7 @@ $(function() {
        • m_temp_off : stdex::base64_reader
        • m_timeout : stdex::watchdog< _Clock, _Duration >
        • m_tokens : stdex::html::parser< _Elem, _Traits, _Alloc >
        • -
        • m_url : stdex::html::parser< _Elem, _Traits, _Alloc >
        • +
        • m_url : stdex::html::parser< _Elem, _Traits, _Alloc >
        • make_absolute_url() : stdex::html::parser< _Elem, _Traits, _Alloc >
        • mapping : stdex::html::text_token< _Elem, _Traits, _Alloc >, stdex::mapping< T >
        • may_contain() : stdex::html::element_traits
        • @@ -124,7 +124,7 @@ $(function() { diff --git a/functions_n.html b/functions_n.html index b6651bf0a..108cdbd8b 100644 --- a/functions_n.html +++ b/functions_n.html @@ -88,7 +88,7 @@ $(function() { diff --git a/functions_o.html b/functions_o.html index e02b22423..547ea328c 100644 --- a/functions_o.html +++ b/functions_o.html @@ -76,7 +76,7 @@ $(function() {
        • ok() : stdex::stream::basic
        • op : stdex::stream::replicator::worker
        • open() : stdex::idrec::record< T, T_ID, ID, T_SIZE, ALIGN >, stdex::stream::cached_file, stdex::stream::file
        • -
        • operator bool() : stdex::interval< T >, stdex::stream::socket, stdex::sys_object
        • +
        • operator bool() : stdex::interval< T >, stdex::stream::cached_file, stdex::stream::socket, stdex::sys_object
        • operator const T &() : stdex::basic_hash< T >
        • operator!=() : stdex::interval< T >, stdex::mapping< T >
        • operator()() : stdex::free_locale_delete
        • @@ -94,7 +94,7 @@ $(function() { diff --git a/functions_p.html b/functions_p.html index 363342fe4..7049e3638 100644 --- a/functions_p.html +++ b/functions_p.html @@ -95,7 +95,7 @@ $(function() { diff --git a/functions_q.html b/functions_q.html index de2237193..5b8830f4f 100644 --- a/functions_q.html +++ b/functions_q.html @@ -78,7 +78,7 @@ $(function() { diff --git a/functions_r.html b/functions_r.html index d588044e6..d6d311bbe 100644 --- a/functions_r.html +++ b/functions_r.html @@ -82,7 +82,7 @@ $(function() {
        • read_offset : stdex::stream::window
        • read_remainder() : stdex::stream::basic, stdex::stream::basic_file
        • read_str() : stdex::stream::basic, stdex::stream::memory_file
        • -
        • readln() : stdex::stream::basic
        • +
        • readln() : stdex::stream::basic
        • readln_and_attach() : stdex::stream::basic
        • readonly() : stdex::stream::file
        • record() : stdex::idrec::record< T, T_ID, ID, T_SIZE, ALIGN >
        • @@ -95,7 +95,7 @@ $(function() { diff --git a/functions_rela.html b/functions_rela.html index bd5240ea8..977633e0b 100644 --- a/functions_rela.html +++ b/functions_rela.html @@ -77,7 +77,7 @@ $(function() { diff --git a/functions_s.html b/functions_s.html index 4e77e3e8a..127d0982c 100644 --- a/functions_s.html +++ b/functions_s.html @@ -110,7 +110,7 @@ $(function() { diff --git a/functions_t.html b/functions_t.html index 043b765ea..57b6e053d 100644 --- a/functions_t.html +++ b/functions_t.html @@ -90,7 +90,7 @@ $(function() { diff --git a/functions_type.html b/functions_type.html index 95e5ab6d8..df954d435 100644 --- a/functions_type.html +++ b/functions_type.html @@ -81,7 +81,7 @@ $(function() { diff --git a/functions_u.html b/functions_u.html index c146076e5..d31e5a9b9 100644 --- a/functions_u.html +++ b/functions_u.html @@ -80,7 +80,7 @@ $(function() { diff --git a/functions_v.html b/functions_v.html index bf5b1fb87..386f11ade 100644 --- a/functions_v.html +++ b/functions_v.html @@ -81,7 +81,7 @@ $(function() { diff --git a/functions_vars.html b/functions_vars.html index f0ca76841..cacc144ed 100644 --- a/functions_vars.html +++ b/functions_vars.html @@ -83,7 +83,7 @@ $(function() { diff --git a/functions_vars_b.html b/functions_vars_b.html index 0fcd33695..757dbed4c 100644 --- a/functions_vars_b.html +++ b/functions_vars_b.html @@ -85,7 +85,7 @@ $(function() { diff --git a/functions_vars_c.html b/functions_vars_c.html index e3e7c34c9..cd5068126 100644 --- a/functions_vars_c.html +++ b/functions_vars_c.html @@ -87,7 +87,7 @@ $(function() { diff --git a/functions_vars_d.html b/functions_vars_d.html index 8030b22e5..644a64602 100644 --- a/functions_vars_d.html +++ b/functions_vars_d.html @@ -84,7 +84,7 @@ $(function() { diff --git a/functions_vars_e.html b/functions_vars_e.html index 167433a1c..dad798816 100644 --- a/functions_vars_e.html +++ b/functions_vars_e.html @@ -86,7 +86,7 @@ $(function() { diff --git a/functions_vars_f.html b/functions_vars_f.html index 237b94e26..e8b5897ed 100644 --- a/functions_vars_f.html +++ b/functions_vars_f.html @@ -78,7 +78,7 @@ $(function() { diff --git a/functions_vars_h.html b/functions_vars_h.html index be063c0b4..23d999c60 100644 --- a/functions_vars_h.html +++ b/functions_vars_h.html @@ -78,7 +78,7 @@ $(function() { diff --git a/functions_vars_i.html b/functions_vars_i.html index 1a51fd813..cecde2410 100644 --- a/functions_vars_i.html +++ b/functions_vars_i.html @@ -82,7 +82,7 @@ $(function() { diff --git a/functions_vars_l.html b/functions_vars_l.html index 6b8a370b1..b64b9c14b 100644 --- a/functions_vars_l.html +++ b/functions_vars_l.html @@ -79,7 +79,7 @@ $(function() { diff --git a/functions_vars_m.html b/functions_vars_m.html index f3b5e4408..6d83b90da 100644 --- a/functions_vars_m.html +++ b/functions_vars_m.html @@ -111,7 +111,7 @@ $(function() {
        • m_temp_off : stdex::base64_reader
        • m_timeout : stdex::watchdog< _Clock, _Duration >
        • m_tokens : stdex::html::parser< _Elem, _Traits, _Alloc >
        • -
        • m_url : stdex::html::parser< _Elem, _Traits, _Alloc >
        • +
        • m_url : stdex::html::parser< _Elem, _Traits, _Alloc >
        • mapping : stdex::html::text_token< _Elem, _Traits, _Alloc >
        • model : stdex::parser::basic_si_reference< T >
        • mouth : stdex::parser::basic_emoticon< T >
        • @@ -119,7 +119,7 @@ $(function() { diff --git a/functions_vars_n.html b/functions_vars_n.html index f3a8ebe76..6b4773119 100644 --- a/functions_vars_n.html +++ b/functions_vars_n.html @@ -87,7 +87,7 @@ $(function() { diff --git a/functions_vars_o.html b/functions_vars_o.html index 47f787e15..6942c0eef 100644 --- a/functions_vars_o.html +++ b/functions_vars_o.html @@ -79,7 +79,7 @@ $(function() { diff --git a/functions_vars_p.html b/functions_vars_p.html index 53ecda26d..f8a8fff86 100644 --- a/functions_vars_p.html +++ b/functions_vars_p.html @@ -86,7 +86,7 @@ $(function() { diff --git a/functions_vars_r.html b/functions_vars_r.html index e0c11dbfb..f5806d38d 100644 --- a/functions_vars_r.html +++ b/functions_vars_r.html @@ -80,7 +80,7 @@ $(function() { diff --git a/functions_vars_s.html b/functions_vars_s.html index 4274665c2..38ea3c814 100644 --- a/functions_vars_s.html +++ b/functions_vars_s.html @@ -85,7 +85,7 @@ $(function() { diff --git a/functions_vars_t.html b/functions_vars_t.html index 7d6352132..ed62b9171 100644 --- a/functions_vars_t.html +++ b/functions_vars_t.html @@ -82,7 +82,7 @@ $(function() { diff --git a/functions_vars_u.html b/functions_vars_u.html index 9fbebe08c..5e700801f 100644 --- a/functions_vars_u.html +++ b/functions_vars_u.html @@ -78,7 +78,7 @@ $(function() { diff --git a/functions_vars_v.html b/functions_vars_v.html index ceccdbd45..0d96371f1 100644 --- a/functions_vars_v.html +++ b/functions_vars_v.html @@ -79,7 +79,7 @@ $(function() { diff --git a/functions_vars_w.html b/functions_vars_w.html index 78fd7e08b..8e8ed9ef9 100644 --- a/functions_vars_w.html +++ b/functions_vars_w.html @@ -80,7 +80,7 @@ $(function() { diff --git a/functions_w.html b/functions_w.html index 2bf824a94..e9a0a018f 100644 --- a/functions_w.html +++ b/functions_w.html @@ -76,7 +76,7 @@ $(function() {
        • watchdog() : stdex::watchdog< _Clock, _Duration >
        • word_index : stdex::html::inserted_token
        • write() : stdex::base64_writer, stdex::stream::async_writer< CAPACITY >, stdex::stream::basic, stdex::stream::basic_sys, stdex::stream::buffer, stdex::stream::cache, stdex::stream::converter, stdex::stream::diag_file, stdex::stream::fifo, stdex::stream::file_window, stdex::stream::limiter, stdex::stream::memory_file, stdex::stream::replicator, stdex::stream::socket, stdex::stream::window, stdex::stream_hasher< T >
        • -
        • write_array() : stdex::stream::basic
        • +
        • write_array() : stdex::stream::basic
        • write_byte() : stdex::stream::basic, stdex::stream::memory_file
        • write_charset() : stdex::stream::basic
        • write_data() : stdex::stream::basic, stdex::stream::memory_file
        • @@ -90,7 +90,7 @@ $(function() { diff --git a/functions_~.html b/functions_~.html index 2e813eb90..27f5cfffa 100644 --- a/functions_~.html +++ b/functions_~.html @@ -79,7 +79,7 @@ $(function() { diff --git a/hash_8cpp_source.html b/hash_8cpp_source.html index 785e2c26b..e91ad9979 100644 --- a/hash_8cpp_source.html +++ b/hash_8cpp_source.html @@ -164,7 +164,7 @@ $(document).ready(function() { init_codefold(0); }); diff --git a/hash_8hpp_source.html b/hash_8hpp_source.html index 3e763d3d3..71146bd67 100644 --- a/hash_8hpp_source.html +++ b/hash_8hpp_source.html @@ -731,9 +731,9 @@ $(document).ready(function() { init_codefold(0); });
          virtual void clear()
          Initializes hash value and internal state.
          Definition hash.hpp:511
          virtual void finalize()
          Finalizes hash value.
          Definition hash.hpp:523
          ‍UTF-8 byte-order-mark
          Definition stream.hpp:79
          -
          Modifies data on the fly when reading from/writing to a source stream. Could also be used to modify r...
          Definition stream.hpp:1022
          -
          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:1051
          -
          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:1059
          +
          Modifies data on the fly when reading from/writing to a source stream. Could also be used to modify r...
          Definition stream.hpp:1010
          +
          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:1039
          +
          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:1047
          Hashes read to or write from data of the stream.
          Definition hash.hpp:138
          virtual size_t read(_Out_writes_bytes_to_opt_(length, return) void *data, size_t length)
          Reads block of data from the stream.
          Definition hash.hpp:145
          virtual size_t write(_In_reads_bytes_opt_(length) const void *data, size_t length)
          Writes block of data to the stream.
          Definition hash.hpp:153
          @@ -743,7 +743,7 @@ $(document).ready(function() { init_codefold(0); }); diff --git a/hex_8hpp_source.html b/hex_8hpp_source.html index 6aa522c1d..21904388a 100644 --- a/hex_8hpp_source.html +++ b/hex_8hpp_source.html @@ -231,7 +231,7 @@ $(document).ready(function() { init_codefold(0); }); diff --git a/hierarchy.html b/hierarchy.html index 2502315f4..3922ea80f 100644 --- a/hierarchy.html +++ b/hierarchy.html @@ -314,7 +314,7 @@ $(function() { diff --git a/html_8hpp_source.html b/html_8hpp_source.html index ca289e288..cf3e5047c 100644 --- a/html_8hpp_source.html +++ b/html_8hpp_source.html @@ -117,7 +117,7 @@ $(document).ready(function() { init_codefold(0); });
          40 template<class _Traits = std::char_traits<char>, class _Alloc = std::allocator<char>>
          41 inline void escape(
          42 _Inout_ std::basic_string<char, _Traits, _Alloc>& dst,
          -
          43 _In_reads_or_z_opt_(num_chars) const char* src, _In_ size_t num_chars = SIZE_MAX)
          +
          43 _In_reads_or_z_opt_(num_chars) const char* src, _In_ size_t num_chars)
          44 {
          45 _Assume_(src || !num_chars);
          46 for (size_t i = 0; i < num_chars && src[i]; ++i) {
          @@ -137,7 +137,7 @@ $(document).ready(function() { init_codefold(0); });
          67 template<class _Traits = std::char_traits<wchar_t>, class _Alloc = std::allocator<wchar_t>>
          68 inline void escape(
          69 _Inout_ std::basic_string<wchar_t, _Traits, _Alloc>& dst,
          -
          70 _In_reads_or_z_opt_(num_chars) const wchar_t* src, _In_ size_t num_chars = SIZE_MAX)
          +
          70 _In_reads_or_z_opt_(num_chars) const wchar_t* src, _In_ size_t num_chars)
          71 {
          72 _Assume_(src || !num_chars);
          73 for (size_t i = 0; i < num_chars && src[i]; ++i) {
          @@ -154,2258 +154,2354 @@ $(document).ready(function() { init_codefold(0); });
          84 }
          85 }
          86
          -
          93 template<class _Traits = std::char_traits<char>, class _Alloc = std::allocator<char>>
          -
          94 inline void escape_min(_Inout_ std::basic_string<char, _Traits, _Alloc>& dst, _In_ char chr)
          -
          95 {
          -
          96 switch (chr) {
          -
          97 case '&': dst += "&amp;"; break;
          -
          98 case '<': dst += "&lt;"; break;
          -
          99 case '>': dst += "&gt;"; break;
          -
          100 case 0x00a0: dst += "&nbsp;"; break; // No-break space must be escaped as SGML entity, otherwise browsers treat it as a normal space.
          -
          101 default: dst += chr; break;
          -
          102 }
          -
          103 }
          -
          104
          -
          111 template<class _Traits = std::char_traits<wchar_t>, class _Alloc = std::allocator<wchar_t>>
          -
          112 inline void escape_min(_Inout_ std::basic_string<wchar_t, _Traits, _Alloc>& dst, _In_ wchar_t chr)
          -
          113 {
          -
          114 switch (chr) {
          -
          115 case L'&': dst += L"&amp;"; break;
          -
          116 case L'<': dst += L"&lt;"; break;
          -
          117 case L'>': dst += L"&gt;"; break;
          -
          118 case L'\u00a0': dst += L"&nbsp;"; break; // No-break space must be escaped as SGML entity, otherwise browsers treat it as a normal space.
          -
          119 default: dst += chr; break;
          -
          120 }
          -
          121 }
          -
          122
          -
          130 template<class _Traits = std::char_traits<char>, class _Alloc = std::allocator<char>>
          -
          131 inline void escape_min(
          -
          132 _Inout_ std::basic_string<char, _Traits, _Alloc>& dst,
          -
          133 _In_reads_or_z_opt_(num_chars) const char* src, _In_ size_t num_chars = SIZE_MAX)
          -
          134 {
          -
          135 _Assume_(src || !num_chars);
          -
          136 for (size_t i = 0; i < num_chars && src[i]; ++i) {
          -
          137 switch (src[i]) {
          -
          138 case '&': dst += "&amp;"; break;
          -
          139 case '<': dst += "&lt;"; break;
          -
          140 case '>': dst += "&gt;"; break;
          -
          141 case 0x00a0: dst += "&nbsp;"; break; // No-break space must be escaped as SGML entity, otherwise browsers treat it as a normal space.
          -
          142 default: dst += src[i]; break;
          -
          143 }
          -
          144 }
          -
          145 }
          -
          146
          -
          154 template<class _Traits = std::char_traits<wchar_t>, class _Alloc = std::allocator<wchar_t>>
          -
          155 inline void escape_min(
          -
          156 _Inout_ std::basic_string<wchar_t, _Traits, _Alloc>& dst,
          -
          157 _In_reads_or_z_opt_(num_chars) const wchar_t* src, _In_ size_t num_chars = SIZE_MAX)
          -
          158 {
          -
          159 _Assume_(src || !num_chars);
          -
          160 for (size_t i = 0; i < num_chars && src[i]; ++i) {
          -
          161 switch (src[i]) {
          -
          162 case L'&': dst += L"&amp;"; break;
          -
          163 case L'<': dst += L"&lt;"; break;
          -
          164 case L'>': dst += L"&gt;"; break;
          -
          165 case L'\u00a0': dst += L"&nbsp;"; break; // No-break space must be escaped as SGML entity, otherwise browsers treat it as a normal space.
          -
          166 default: dst += src[i]; break;
          -
          167 }
          -
          168 }
          -
          169 }
          -
          170
          -
          178 template<class _Traits = std::char_traits<char>, class _Alloc = std::allocator<char>>
          -
          179 inline void url_unescape(
          -
          180 _Inout_ std::basic_string<char, _Traits, _Alloc>& dst,
          -
          181 _In_reads_or_z_opt_(num_chars) const char* src, _In_ size_t num_chars = SIZE_MAX)
          -
          182 {
          -
          183 _Assume_(src || !num_chars);
          -
          184 for (size_t i = 0; i < num_chars && src[i];) {
          -
          185 switch (src[i]) {
          -
          186 case '+':
          -
          187 dst += ' '; i++;
          -
          188 break;
          -
          189
          -
          190 case '%': {
          -
          191 i++;
          -
          192
          -
          193 uint8_t chr;
          -
          194 if ('0' <= src[i] && src[i] <= '9') chr = (src[i++] - '0') << 4;
          -
          195 else if ('A' <= src[i] && src[i] <= 'F') chr = (src[i++] - 'A' + 10) << 4;
          -
          196 else if ('a' <= src[i] && src[i] <= 'f') chr = (src[i++] - 'a' + 10) << 4;
          -
          197 else { dst += '%'; continue; }
          -
          198 if ('0' <= src[i] && src[i] <= '9') chr |= (src[i++] - '0');
          -
          199 else if ('A' <= src[i] && src[i] <= 'F') chr |= (src[i++] - 'A' + 10);
          -
          200 else if ('a' <= src[i] && src[i] <= 'f') chr |= (src[i++] - 'a' + 10);
          -
          201 else { dst += '%'; dst += src[i - 1]; continue; }
          -
          202
          -
          203 dst += static_cast<char>(chr);
          -
          204 break;
          -
          205 }
          -
          206
          -
          207 default:
          -
          208 dst += src[i++];
          -
          209 }
          -
          210 }
          +
          93 template<class _Elem, size_t _Size, class _Traits = std::char_traits<_Elem>, class _Alloc = std::allocator<_Elem>>
          +
          94 inline void escape(
          +
          95 _Inout_ std::basic_string<_Elem, _Traits, _Alloc>& dst,
          +
          96 _In_ const _Elem (&src)[_Size])
          +
          97 {
          +
          98 escape(dst, src, _Size);
          +
          99 }
          +
          100
          +
          107 template<class _Elem, class _Traits_dst = std::char_traits<_Elem>, class _Alloc_dst = std::allocator<_Elem>, class _Traits_src = std::char_traits<_Elem>, class _Alloc_src = std::allocator<_Elem>>
          +
          108 inline void escape(
          +
          109 _Inout_ std::basic_string<_Elem, _Traits_dst, _Alloc_dst>& dst,
          +
          110 _In_ const std::basic_string<_Elem, _Traits_src, _Alloc_src>& src)
          +
          111 {
          +
          112 escape(dst, src.data(), src.size());
          +
          113 }
          +
          114
          +
          121 template<class _Traits = std::char_traits<char>, class _Alloc = std::allocator<char>>
          +
          122 inline void escape_min(_Inout_ std::basic_string<char, _Traits, _Alloc>& dst, _In_ char chr)
          +
          123 {
          +
          124 switch (chr) {
          +
          125 case '&': dst += "&amp;"; break;
          +
          126 case '<': dst += "&lt;"; break;
          +
          127 case '>': dst += "&gt;"; break;
          +
          128 case 0x00a0: dst += "&nbsp;"; break; // No-break space must be escaped as SGML entity, otherwise browsers treat it as a normal space.
          +
          129 default: dst += chr; break;
          +
          130 }
          +
          131 }
          +
          132
          +
          139 template<class _Traits = std::char_traits<wchar_t>, class _Alloc = std::allocator<wchar_t>>
          +
          140 inline void escape_min(_Inout_ std::basic_string<wchar_t, _Traits, _Alloc>& dst, _In_ wchar_t chr)
          +
          141 {
          +
          142 switch (chr) {
          +
          143 case L'&': dst += L"&amp;"; break;
          +
          144 case L'<': dst += L"&lt;"; break;
          +
          145 case L'>': dst += L"&gt;"; break;
          +
          146 case L'\u00a0': dst += L"&nbsp;"; break; // No-break space must be escaped as SGML entity, otherwise browsers treat it as a normal space.
          +
          147 default: dst += chr; break;
          +
          148 }
          +
          149 }
          +
          150
          +
          158 template<class _Traits = std::char_traits<char>, class _Alloc = std::allocator<char>>
          +
          159 inline void escape_min(
          +
          160 _Inout_ std::basic_string<char, _Traits, _Alloc>& dst,
          +
          161 _In_reads_or_z_opt_(num_chars) const char* src, _In_ size_t num_chars)
          +
          162 {
          +
          163 _Assume_(src || !num_chars);
          +
          164 for (size_t i = 0; i < num_chars && src[i]; ++i) {
          +
          165 switch (src[i]) {
          +
          166 case '&': dst += "&amp;"; break;
          +
          167 case '<': dst += "&lt;"; break;
          +
          168 case '>': dst += "&gt;"; break;
          +
          169 case 0x00a0: dst += "&nbsp;"; break; // No-break space must be escaped as SGML entity, otherwise browsers treat it as a normal space.
          +
          170 default: dst += src[i]; break;
          +
          171 }
          +
          172 }
          +
          173 }
          +
          174
          +
          182 template<class _Traits = std::char_traits<wchar_t>, class _Alloc = std::allocator<wchar_t>>
          +
          183 inline void escape_min(
          +
          184 _Inout_ std::basic_string<wchar_t, _Traits, _Alloc>& dst,
          +
          185 _In_reads_or_z_opt_(num_chars) const wchar_t* src, _In_ size_t num_chars)
          +
          186 {
          +
          187 _Assume_(src || !num_chars);
          +
          188 for (size_t i = 0; i < num_chars && src[i]; ++i) {
          +
          189 switch (src[i]) {
          +
          190 case L'&': dst += L"&amp;"; break;
          +
          191 case L'<': dst += L"&lt;"; break;
          +
          192 case L'>': dst += L"&gt;"; break;
          +
          193 case L'\u00a0': dst += L"&nbsp;"; break; // No-break space must be escaped as SGML entity, otherwise browsers treat it as a normal space.
          +
          194 default: dst += src[i]; break;
          +
          195 }
          +
          196 }
          +
          197 }
          +
          198
          +
          205 template<class _Elem, size_t _Size, class _Traits = std::char_traits<_Elem>, class _Alloc = std::allocator<_Elem>>
          +
          206 inline void escape_min(
          +
          207 _Inout_ std::basic_string<_Elem, _Traits, _Alloc>& dst,
          +
          208 _In_ const _Elem (&src)[_Size])
          +
          209 {
          +
          210 escape_min(dst, src, _Size);
          211 }
          212
          -
          220 template<class _Traits = std::char_traits<char>, class _Alloc = std::allocator<char>>
          -
          221 inline void url_escape(
          -
          222 _Inout_ std::basic_string<char, _Traits, _Alloc>& dst,
          -
          223 _In_reads_or_z_opt_(num_chars) const char* src, _In_ size_t num_chars = SIZE_MAX)
          -
          224 {
          -
          225 _Assume_(src || !num_chars);
          -
          226 for (size_t i = 0; i < num_chars && src[i]; ++i) {
          -
          227 switch (src[i]) {
          -
          228 case ' ': dst += "+"; break;
          -
          229 case '<': dst += "%3C"; break;
          -
          230 case '>': dst += "%3E"; break;
          -
          231 case '#': dst += "%23"; break;
          -
          232 case '%': dst += "%25"; break;
          -
          233 case '{': dst += "%7B"; break;
          -
          234 case '}': dst += "%7D"; break;
          -
          235 case '|': dst += "%7C"; break;
          -
          236 case '\\': dst += "%5C"; break;
          -
          237 case '^': dst += "%5E"; break;
          -
          238 case '~': dst += "%7E"; break;
          -
          239 case '[': dst += "%5B"; break;
          -
          240 case ']': dst += "%5D"; break;
          -
          241 case '`': dst += "%60"; break;
          -
          242 case ';': dst += "%3B"; break;
          -
          243 case '/': dst += "%2F"; break;
          -
          244 case '?': dst += "%3F"; break;
          -
          245 case ':': dst += "%3A"; break;
          -
          246 case '@': dst += "%40"; break;
          -
          247 case '=': dst += "%3D"; break;
          -
          248 case '&': dst += "%26"; break;
          -
          249 case '$': dst += "%24"; break;
          -
          250 default:
          -
          251 if (0x20 < static_cast<uint8_t>(src[i]) && static_cast<uint8_t>(src[i]) < 0x7f)
          -
          252 dst += src[i];
          -
          253 else {
          -
          254 dst += '%';
          -
          255 uint8_t n = (static_cast<uint8_t>(src[i]) & 0xf0) >> 4;
          -
          256 dst += n < 10 ? static_cast<char>('0' + n) : static_cast<char>('A' + n - 10);
          -
          257 n = ((uint8_t)src[i] & 0x0f);
          -
          258 dst += n < 10 ? static_cast<char>('0' + n) : static_cast<char>('A' + n - 10);
          -
          259 }
          -
          260 }
          -
          261 }
          -
          262 }
          -
          263
          -
          271 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Alloc = std::allocator<_Elem>>
          -
          272 inline void css_unescape(
          -
          273 _Inout_ std::basic_string<_Elem, _Traits, _Alloc>& dst,
          -
          274 _In_reads_or_z_opt_(num_chars) const _Elem* src, _In_ size_t num_chars = SIZE_MAX)
          -
          275 {
          -
          276 _Assume_(src || !num_chars);
          -
          277 for (size_t i = 0; i < num_chars && src[i];) {
          -
          278 if (src[i] != '\\')
          -
          279 dst += src[i++];
          -
          280 else if (i + 1 < num_chars) {
          -
          281 i++;
          +
          219 template<class _Elem, class _Traits_dst = std::char_traits<_Elem>, class _Alloc_dst = std::allocator<_Elem>, class _Traits_src = std::char_traits<_Elem>, class _Alloc_src = std::allocator<_Elem>>
          +
          220 inline void escape_min(
          +
          221 _Inout_ std::basic_string<_Elem, _Traits_dst, _Alloc_dst>& dst,
          +
          222 _In_ const std::basic_string<_Elem, _Traits_src, _Alloc_src>& src)
          +
          223 {
          +
          224 escape_min(dst, src.data(), src.size());
          +
          225 }
          +
          226
          +
          234 template<class _Traits = std::char_traits<char>, class _Alloc = std::allocator<char>>
          +
          235 inline void url_unescape(
          +
          236 _Inout_ std::basic_string<char, _Traits, _Alloc>& dst,
          +
          237 _In_reads_or_z_opt_(num_chars) const char* src, _In_ size_t num_chars)
          +
          238 {
          +
          239 _Assume_(src || !num_chars);
          +
          240 for (size_t i = 0; i < num_chars && src[i];) {
          +
          241 switch (src[i]) {
          +
          242 case '+':
          +
          243 dst += ' '; i++;
          +
          244 break;
          +
          245
          +
          246 case '%': {
          +
          247 i++;
          +
          248
          +
          249 uint8_t chr;
          +
          250 if ('0' <= src[i] && src[i] <= '9') chr = (src[i++] - '0') << 4;
          +
          251 else if ('A' <= src[i] && src[i] <= 'F') chr = (src[i++] - 'A' + 10) << 4;
          +
          252 else if ('a' <= src[i] && src[i] <= 'f') chr = (src[i++] - 'a' + 10) << 4;
          +
          253 else { dst += '%'; continue; }
          +
          254 if ('0' <= src[i] && src[i] <= '9') chr |= (src[i++] - '0');
          +
          255 else if ('A' <= src[i] && src[i] <= 'F') chr |= (src[i++] - 'A' + 10);
          +
          256 else if ('a' <= src[i] && src[i] <= 'f') chr |= (src[i++] - 'a' + 10);
          +
          257 else { dst += '%'; dst += src[i - 1]; continue; }
          +
          258
          +
          259 dst += static_cast<char>(chr);
          +
          260 break;
          +
          261 }
          +
          262
          +
          263 default:
          +
          264 dst += src[i++];
          +
          265 }
          +
          266 }
          +
          267 }
          +
          268
          +
          275 template<size_t _Size, class _Traits = std::char_traits<char>, class _Alloc = std::allocator<char>>
          +
          276 inline void url_unescape(
          +
          277 _Inout_ std::basic_string<char, _Traits, _Alloc>& dst,
          +
          278 _In_ const char (&src)[_Size])
          +
          279 {
          +
          280 url_unescape(dst, src, _Size);
          +
          281 }
          282
          -
          283 switch (src[i]) {
          -
          284 // Classic escapes
          -
          285 case 'n': dst += '\n'; i++; break;
          -
          286 case 'r': dst += '\r'; i++; break;
          -
          287 case 't': dst += '\t'; i++; break;
          -
          288
          -
          289 // `\` at the end of the line
          -
          290 case '\n': i++; break;
          -
          291
          -
          292 // `\nnnn` escape
          -
          293 case '0':
          -
          294 case '1':
          -
          295 case '2':
          -
          296 case '3':
          -
          297 case '4':
          -
          298 case '5':
          -
          299 case '6':
          -
          300 case '7':
          -
          301 case '8':
          -
          302 case '9':
          -
          303 case 'A': case 'a':
          -
          304 case 'B': case 'b':
          -
          305 case 'C': case 'c':
          -
          306 case 'D': case 'd':
          -
          307 case 'E': case 'e':
          -
          308 case 'F': case 'f': {
          -
          309 wchar_t chr = 0;
          -
          310 size_t end = std::min(num_chars, i + 6);
          -
          311
          -
          312 for (; i < end; ++i) {
          -
          313 if ('0' <= src[i] && src[i] <= '9') chr = chr * 0x10 + src[i] - '0';
          -
          314 else if ('A' <= src[i] && src[i] <= 'F') chr = chr * 0x10 + src[i] - 'A' + 10;
          -
          315 else if ('a' <= src[i] && src[i] <= 'f') chr = chr * 0x10 + src[i] - 'a' + 10;
          -
          316 else break;
          -
          317 }
          -
          318
          -
          319 dst += static_cast<_Elem>(chr);
          -
          320
          -
          321 if (i < end && src[i] == ' ') {
          -
          322 // Skip space after `\nnnn`.
          -
          323 i++;
          -
          324 }
          -
          325 break;
          -
          326 }
          -
          327
          -
          328 default: dst += src[i++];
          -
          329 }
          -
          330 }
          -
          331 }
          -
          332 }
          -
          333
          -
          341 template<class _Traits = std::char_traits<char>, class _Alloc = std::allocator<char>>
          -
          342 inline void css_escape(
          -
          343 _Inout_ std::basic_string<char, _Traits, _Alloc>& dst,
          -
          344 _In_reads_or_z_opt_(num_chars) const char* src, _In_ size_t num_chars = SIZE_MAX)
          -
          345 {
          -
          346 _Assume_(src || !num_chars);
          -
          347 for (size_t i = 0; i < num_chars && src[i]; ++i) {
          -
          348 switch (src[i]) {
          -
          349 case '\\': dst += "\\\\"; break;
          -
          350 case '\n': dst += "\\n"; break;
          -
          351 case '\r': dst += "\\r"; break;
          -
          352 case '\t': dst += "\\t"; break;
          -
          353 case '\"': dst += "\\\""; break;
          -
          354 case '\'': dst += "\\'"; break;
          -
          355 default: dst += src[i]; break;
          -
          356 }
          -
          357 }
          -
          358 }
          -
          359
          -
          367 template<class _Traits = std::char_traits<wchar_t>, class _Alloc = std::allocator<wchar_t>>
          -
          368 inline void css_escape(
          -
          369 _Inout_ std::basic_string<wchar_t, _Traits, _Alloc>& dst,
          -
          370 _In_reads_or_z_opt_(num_chars) const wchar_t* src, _In_ size_t num_chars = SIZE_MAX)
          -
          371 {
          -
          372 _Assume_(src || !num_chars);
          -
          373 for (size_t i = 0; i < num_chars && src[i]; ++i) {
          -
          374 switch (src[i]) {
          -
          375 case L'\\': dst += L"\\\\"; break;
          -
          376 case L'\n': dst += L"\\n"; break;
          -
          377 case L'\r': dst += L"\\r"; break;
          -
          378 case L'\t': dst += L"\\t"; break;
          -
          379 case L'\"': dst += L"\\\""; break;
          -
          380 case L'\'': dst += L"\\'"; break;
          -
          381 default: dst += src[i]; break;
          -
          382 }
          -
          383 }
          -
          384 }
          -
          385
          -
          389 enum class element_t {
          -
          390 empty = 0,
          -
          391 a,
          -
          392 abbr,
          -
          393 acronym,
          -
          394 address,
          -
          395 applet,
          -
          396 area,
          -
          397 b,
          -
          398 base,
          -
          399 basefont,
          -
          400 bdo,
          -
          401 bgsound, // Microsoft Specific
          -
          402 big,
          -
          403 blink, // Microsoft Specific
          -
          404 blockquote,
          -
          405 body,
          -
          406 br,
          -
          407 button,
          -
          408 caption,
          -
          409 center,
          -
          410 cite,
          -
          411 code,
          -
          412 col,
          -
          413 colgroup,
          -
          414 comment, // Microsoft Specific
          -
          415 dd,
          -
          416 del,
          -
          417 dfn,
          -
          418 dir,
          -
          419 div,
          -
          420 dl,
          -
          421 dt,
          -
          422 em,
          -
          423 embed, // Microsoft Specific
          -
          424 fieldset,
          -
          425 font,
          -
          426 form,
          -
          427 frame,
          -
          428 frameset,
          -
          429 h1,
          -
          430 h2,
          -
          431 h3,
          -
          432 h4,
          -
          433 h5,
          -
          434 h6,
          -
          435 head,
          -
          436 hr,
          -
          437 html,
          -
          438 i,
          -
          439 iframe,
          -
          440 img,
          -
          441 input,
          -
          442 ins,
          -
          443 isindex,
          -
          444 kbd,
          -
          445 label,
          -
          446 legend,
          -
          447 li,
          -
          448 link,
          -
          449 listing, // Microsoft Specific
          -
          450 map,
          -
          451 marquee, // Microsoft Specific
          -
          452 menu,
          -
          453 meta,
          -
          454 nextid, // Microsoft Specific
          -
          455 nobr, // Microsoft Specific
          -
          456 noembed, // Microsoft Specific
          -
          457 noframes,
          -
          458 noscript,
          -
          459 object,
          -
          460 ol,
          -
          461 optgroup,
          -
          462 option,
          -
          463 p,
          -
          464 param,
          -
          465 plaintext, // Microsoft Specific
          -
          466 pre,
          -
          467 q,
          -
          468 rt, // Microsoft Specific
          -
          469 ruby, // Microsoft Specific
          -
          470 s,
          -
          471 samp,
          -
          472 script,
          -
          473 select,
          -
          474 small,
          -
          475 span,
          -
          476 strike,
          -
          477 strong,
          -
          478 style,
          -
          479 sub,
          -
          480 sup,
          -
          481 table,
          -
          482 tbody,
          -
          483 td,
          -
          484 textarea,
          -
          485 tfoot,
          -
          486 th,
          -
          487 thead,
          -
          488 title,
          -
          489 tr,
          -
          490 tt,
          -
          491 u,
          -
          492 ul,
          -
          493 var,
          -
          494 wbr, // Microsoft Specific
          -
          495 xmp, // Microsoft Specific
          -
          496
          -
          497 unknown = -1,
          -
          498 PCDATA = -2,
          -
          499 CDATA = -3,
          -
          500 };
          -
          501
          -
          505 enum class element_span_t {
          -
          506 needs_end = 0,
          -
          507 end_optional,
          -
          508 immediate,
          -
          509 };
          -
          510
          -
          - -
          515 {
          -
          -
          521 static inline element_span_t span(_In_ element_t code)
          -
          522 {
          -
          523 static element_span_t lookup[] = {
          -
          524 element_span_t::needs_end, // a
          -
          525 element_span_t::needs_end, // abbr
          -
          526 element_span_t::needs_end, // acronym
          -
          527 element_span_t::needs_end, // address
          -
          528 element_span_t::needs_end, // applet
          -
          529 element_span_t::immediate, // area
          -
          530 element_span_t::needs_end, // b
          -
          531 element_span_t::immediate, // base
          -
          532 element_span_t::immediate, // basefont
          -
          533 element_span_t::needs_end, // bdo
          -
          534 element_span_t::immediate, // bgsound
          -
          535 element_span_t::needs_end, // big
          -
          536 element_span_t::needs_end, // blink
          -
          537 element_span_t::needs_end, // blockquote
          -
          538 element_span_t::end_optional, // body
          -
          539 element_span_t::immediate, // br
          -
          540 element_span_t::needs_end, // button
          -
          541 element_span_t::needs_end, // caption
          -
          542 element_span_t::needs_end, // center
          -
          543 element_span_t::needs_end, // cite
          -
          544 element_span_t::needs_end, // code
          -
          545 element_span_t::immediate, // col
          -
          546 element_span_t::end_optional, // colgroup
          -
          547 element_span_t::needs_end, // comment
          -
          548 element_span_t::end_optional, // dd
          -
          549 element_span_t::needs_end, // del
          -
          550 element_span_t::needs_end, // dfn
          -
          551 element_span_t::needs_end, // dir
          -
          552 element_span_t::needs_end, // div
          -
          553 element_span_t::needs_end, // dl
          -
          554 element_span_t::end_optional, // dt
          -
          555 element_span_t::needs_end, // em
          -
          556 element_span_t::immediate, // embed
          -
          557 element_span_t::needs_end, // fieldset
          -
          558 element_span_t::needs_end, // font
          -
          559 element_span_t::needs_end, // form
          -
          560 element_span_t::immediate, // frame
          -
          561 element_span_t::needs_end, // frameset
          -
          562 element_span_t::needs_end, // h1
          -
          563 element_span_t::needs_end, // h2
          -
          564 element_span_t::needs_end, // h3
          -
          565 element_span_t::needs_end, // h4
          -
          566 element_span_t::needs_end, // h5
          -
          567 element_span_t::needs_end, // h6
          -
          568 element_span_t::end_optional, // head
          -
          569 element_span_t::immediate, // hr
          -
          570 element_span_t::end_optional, // html
          -
          571 element_span_t::needs_end, // i
          -
          572 element_span_t::needs_end, // iframe
          -
          573 element_span_t::immediate, // img
          -
          574 element_span_t::immediate, // input
          -
          575 element_span_t::needs_end, // ins
          -
          576 element_span_t::immediate, // isindex
          -
          577 element_span_t::needs_end, // kbd
          -
          578 element_span_t::needs_end, // label
          -
          579 element_span_t::needs_end, // legend
          -
          580 element_span_t::end_optional, // li
          -
          581 element_span_t::immediate, // link
          -
          582 element_span_t::needs_end, // listing
          -
          583 element_span_t::needs_end, // map
          -
          584 element_span_t::needs_end, // marquee
          -
          585 element_span_t::needs_end, // menu
          -
          586 element_span_t::immediate, // meta
          -
          587 element_span_t::immediate, // nextid
          -
          588 element_span_t::needs_end, // nobr
          -
          589 element_span_t::needs_end, // noembed
          -
          590 element_span_t::needs_end, // noframes
          -
          591 element_span_t::needs_end, // noscript
          -
          592 element_span_t::needs_end, // object
          -
          593 element_span_t::needs_end, // ol
          -
          594 element_span_t::needs_end, // optgroup
          -
          595 element_span_t::end_optional, // option
          -
          596 element_span_t::end_optional, // p
          -
          597 element_span_t::immediate, // param
          -
          598 element_span_t::end_optional, // plaintext
          -
          599 element_span_t::needs_end, // pre
          -
          600 element_span_t::needs_end, // q
          -
          601 element_span_t::immediate, // rt
          -
          602 element_span_t::needs_end, // ruby
          -
          603 element_span_t::needs_end, // s
          -
          604 element_span_t::needs_end, // samp
          -
          605 element_span_t::needs_end, // script
          -
          606 element_span_t::needs_end, // select
          -
          607 element_span_t::needs_end, // small
          -
          608 element_span_t::needs_end, // span
          -
          609 element_span_t::needs_end, // strike
          -
          610 element_span_t::needs_end, // strong
          -
          611 element_span_t::needs_end, // style
          -
          612 element_span_t::needs_end, // sub
          -
          613 element_span_t::needs_end, // sup
          -
          614 element_span_t::needs_end, // table
          -
          615 element_span_t::end_optional, // tbody
          -
          616 element_span_t::end_optional, // td
          -
          617 element_span_t::needs_end, // textarea
          -
          618 element_span_t::end_optional, // tfoot
          -
          619 element_span_t::end_optional, // th
          -
          620 element_span_t::end_optional, // thead
          -
          621 element_span_t::needs_end, // title
          -
          622 element_span_t::end_optional, // tr
          -
          623 element_span_t::needs_end, // tt
          -
          624 element_span_t::needs_end, // u
          -
          625 element_span_t::needs_end, // ul
          -
          626 element_span_t::needs_end, // var
          -
          627 element_span_t::immediate, // wbr
          -
          628 element_span_t::needs_end, // xmp
          -
          629 };
          -
          630 return element_t::a <= code && code <= element_t::xmp ?
          -
          631 lookup[static_cast<size_t>(code) - static_cast<size_t>(element_t::a)] :
          -
          632 element_span_t::needs_end;
          -
          633 }
          +
          289 template<class _Traits_dst = std::char_traits<char>, class _Alloc_dst = std::allocator<char>, class _Traits_src = std::char_traits<char>, class _Alloc_src = std::allocator<char>>
          +
          290 inline void url_unescape(
          +
          291 _Inout_ std::basic_string<char, _Traits_dst, _Alloc_dst>& dst,
          +
          292 _In_ const std::basic_string<char, _Traits_src, _Alloc_src>& src)
          +
          293 {
          +
          294 url_unescape(dst, src.data(), src.size());
          +
          295 }
          +
          296
          +
          304 template<class _Traits = std::char_traits<char>, class _Alloc = std::allocator<char>>
          +
          305 inline void url_escape(
          +
          306 _Inout_ std::basic_string<char, _Traits, _Alloc>& dst,
          +
          307 _In_reads_or_z_opt_(num_chars) const char* src, _In_ size_t num_chars)
          +
          308 {
          +
          309 _Assume_(src || !num_chars);
          +
          310 for (size_t i = 0; i < num_chars && src[i]; ++i) {
          +
          311 switch (src[i]) {
          +
          312 case ' ': dst += "+"; break;
          +
          313 case '<': dst += "%3C"; break;
          +
          314 case '>': dst += "%3E"; break;
          +
          315 case '#': dst += "%23"; break;
          +
          316 case '%': dst += "%25"; break;
          +
          317 case '{': dst += "%7B"; break;
          +
          318 case '}': dst += "%7D"; break;
          +
          319 case '|': dst += "%7C"; break;
          +
          320 case '\\': dst += "%5C"; break;
          +
          321 case '^': dst += "%5E"; break;
          +
          322 case '~': dst += "%7E"; break;
          +
          323 case '[': dst += "%5B"; break;
          +
          324 case ']': dst += "%5D"; break;
          +
          325 case '`': dst += "%60"; break;
          +
          326 case ';': dst += "%3B"; break;
          +
          327 case '/': dst += "%2F"; break;
          +
          328 case '?': dst += "%3F"; break;
          +
          329 case ':': dst += "%3A"; break;
          +
          330 case '@': dst += "%40"; break;
          +
          331 case '=': dst += "%3D"; break;
          +
          332 case '&': dst += "%26"; break;
          +
          333 case '$': dst += "%24"; break;
          +
          334 default:
          +
          335 if (0x20 < static_cast<uint8_t>(src[i]) && static_cast<uint8_t>(src[i]) < 0x7f)
          +
          336 dst += src[i];
          +
          337 else {
          +
          338 dst += '%';
          +
          339 uint8_t n = (static_cast<uint8_t>(src[i]) & 0xf0) >> 4;
          +
          340 dst += n < 10 ? static_cast<char>('0' + n) : static_cast<char>('A' + n - 10);
          +
          341 n = ((uint8_t)src[i] & 0x0f);
          +
          342 dst += n < 10 ? static_cast<char>('0' + n) : static_cast<char>('A' + n - 10);
          +
          343 }
          +
          344 }
          +
          345 }
          +
          346 }
          +
          347
          +
          354 template<size_t _Size, class _Traits = std::char_traits<char>, class _Alloc = std::allocator<char>>
          +
          355 inline void url_escape(
          +
          356 _Inout_ std::basic_string<char, _Traits, _Alloc>& dst,
          +
          357 _In_ const char (&src)[_Size])
          +
          358 {
          +
          359 url_escape(dst, src, _Size);
          +
          360 }
          +
          361
          +
          368 template<class _Traits_dst = std::char_traits<char>, class _Alloc_dst = std::allocator<char>, class _Traits_src = std::char_traits<char>, class _Alloc_src = std::allocator<char>>
          +
          369 inline void url_escape(
          +
          370 _Inout_ std::basic_string<char, _Traits_dst, _Alloc_dst>& dst,
          +
          371 _In_ const std::basic_string<char, _Traits_src, _Alloc_src>& src)
          +
          372 {
          +
          373 url_escape(dst, src.data(), src.size());
          +
          374 }
          +
          375
          +
          383 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Alloc = std::allocator<_Elem>>
          +
          384 inline void css_unescape(
          +
          385 _Inout_ std::basic_string<_Elem, _Traits, _Alloc>& dst,
          +
          386 _In_reads_or_z_opt_(num_chars) const _Elem* src, _In_ size_t num_chars)
          +
          387 {
          +
          388 _Assume_(src || !num_chars);
          +
          389 for (size_t i = 0; i < num_chars && src[i];) {
          +
          390 if (src[i] != '\\')
          +
          391 dst += src[i++];
          +
          392 else if (i + 1 < num_chars) {
          +
          393 i++;
          +
          394
          +
          395 switch (src[i]) {
          +
          396 // Classic escapes
          +
          397 case 'n': dst += '\n'; i++; break;
          +
          398 case 'r': dst += '\r'; i++; break;
          +
          399 case 't': dst += '\t'; i++; break;
          +
          400
          +
          401 // `\` at the end of the line
          +
          402 case '\n': i++; break;
          +
          403
          +
          404 // `\nnnn` escape
          +
          405 case '0':
          +
          406 case '1':
          +
          407 case '2':
          +
          408 case '3':
          +
          409 case '4':
          +
          410 case '5':
          +
          411 case '6':
          +
          412 case '7':
          +
          413 case '8':
          +
          414 case '9':
          +
          415 case 'A': case 'a':
          +
          416 case 'B': case 'b':
          +
          417 case 'C': case 'c':
          +
          418 case 'D': case 'd':
          +
          419 case 'E': case 'e':
          +
          420 case 'F': case 'f': {
          +
          421 wchar_t chr = 0;
          +
          422 size_t end = std::min(num_chars, i + 6);
          +
          423
          +
          424 for (; i < end; ++i) {
          +
          425 if ('0' <= src[i] && src[i] <= '9') chr = chr * 0x10 + src[i] - '0';
          +
          426 else if ('A' <= src[i] && src[i] <= 'F') chr = chr * 0x10 + src[i] - 'A' + 10;
          +
          427 else if ('a' <= src[i] && src[i] <= 'f') chr = chr * 0x10 + src[i] - 'a' + 10;
          +
          428 else break;
          +
          429 }
          +
          430
          +
          431 dst += static_cast<_Elem>(chr);
          +
          432
          +
          433 if (i < end && src[i] == ' ') {
          +
          434 // Skip space after `\nnnn`.
          +
          435 i++;
          +
          436 }
          +
          437 break;
          +
          438 }
          +
          439
          +
          440 default: dst += src[i++];
          +
          441 }
          +
          442 }
          +
          443 }
          +
          444 }
          +
          445
          +
          452 template<class _Elem, size_t _Size, class _Traits = std::char_traits<_Elem>, class _Alloc = std::allocator<_Elem>>
          +
          453 inline void css_unescape(
          +
          454 _Inout_ std::basic_string<_Elem, _Traits, _Alloc>& dst,
          +
          455 _In_ const _Elem (&src)[_Size])
          +
          456 {
          +
          457 css_unescape(dst, src, _Size);
          +
          458 }
          +
          459
          +
          466 template<class _Elem, class _Traits_dst = std::char_traits<_Elem>, class _Alloc_dst = std::allocator<_Elem>, class _Traits_src = std::char_traits<_Elem>, class _Alloc_src = std::allocator<_Elem>>
          +
          467 inline void css_unescape(
          +
          468 _Inout_ std::basic_string<_Elem, _Traits_dst, _Alloc_dst>& dst,
          +
          469 _In_ const std::basic_string<_Elem, _Traits_src, _Alloc_src>& src)
          +
          470 {
          +
          471 css_unescape(dst, src.data(), src.size());
          +
          472 }
          +
          473
          +
          481 template<class _Traits = std::char_traits<char>, class _Alloc = std::allocator<char>>
          +
          482 inline void css_escape(
          +
          483 _Inout_ std::basic_string<char, _Traits, _Alloc>& dst,
          +
          484 _In_reads_or_z_opt_(num_chars) const char* src, _In_ size_t num_chars)
          +
          485 {
          +
          486 _Assume_(src || !num_chars);
          +
          487 for (size_t i = 0; i < num_chars && src[i]; ++i) {
          +
          488 switch (src[i]) {
          +
          489 case '\\': dst += "\\\\"; break;
          +
          490 case '\n': dst += "\\n"; break;
          +
          491 case '\r': dst += "\\r"; break;
          +
          492 case '\t': dst += "\\t"; break;
          +
          493 case '\"': dst += "\\\""; break;
          +
          494 case '\'': dst += "\\'"; break;
          +
          495 default: dst += src[i]; break;
          +
          496 }
          +
          497 }
          +
          498 }
          +
          499
          +
          507 template<class _Traits = std::char_traits<wchar_t>, class _Alloc = std::allocator<wchar_t>>
          +
          508 inline void css_escape(
          +
          509 _Inout_ std::basic_string<wchar_t, _Traits, _Alloc>& dst,
          +
          510 _In_reads_or_z_opt_(num_chars) const wchar_t* src, _In_ size_t num_chars)
          +
          511 {
          +
          512 _Assume_(src || !num_chars);
          +
          513 for (size_t i = 0; i < num_chars && src[i]; ++i) {
          +
          514 switch (src[i]) {
          +
          515 case L'\\': dst += L"\\\\"; break;
          +
          516 case L'\n': dst += L"\\n"; break;
          +
          517 case L'\r': dst += L"\\r"; break;
          +
          518 case L'\t': dst += L"\\t"; break;
          +
          519 case L'\"': dst += L"\\\""; break;
          +
          520 case L'\'': dst += L"\\'"; break;
          +
          521 default: dst += src[i]; break;
          +
          522 }
          +
          523 }
          +
          524 }
          +
          525
          +
          532 template<class _Elem, size_t _Size, class _Traits = std::char_traits<_Elem>, class _Alloc = std::allocator<_Elem>>
          +
          533 inline void css_escape(
          +
          534 _Inout_ std::basic_string<_Elem, _Traits, _Alloc>& dst,
          +
          535 _In_ const _Elem (&src)[_Size])
          +
          536 {
          +
          537 css_escape(dst, src, _Size);
          +
          538 }
          +
          539
          +
          546 template<class _Elem, class _Traits_dst = std::char_traits<_Elem>, class _Alloc_dst = std::allocator<_Elem>, class _Traits_src = std::char_traits<_Elem>, class _Alloc_src = std::allocator<_Elem>>
          +
          547 inline void css_escape(
          +
          548 _Inout_ std::basic_string<_Elem, _Traits_dst, _Alloc_dst>& dst,
          +
          549 _In_ const std::basic_string<_Elem, _Traits_src, _Alloc_src>& src)
          +
          550 {
          +
          551 css_escape(dst, src.data(), src.size());
          +
          552 }
          +
          553
          +
          557 enum class element_t {
          +
          558 empty = 0,
          +
          559 a,
          +
          560 abbr,
          +
          561 acronym,
          +
          562 address,
          +
          563 applet,
          +
          564 area,
          +
          565 b,
          +
          566 base,
          +
          567 basefont,
          +
          568 bdo,
          +
          569 bgsound, // Microsoft Specific
          +
          570 big,
          +
          571 blink, // Microsoft Specific
          +
          572 blockquote,
          +
          573 body,
          +
          574 br,
          +
          575 button,
          +
          576 caption,
          +
          577 center,
          +
          578 cite,
          +
          579 code,
          +
          580 col,
          +
          581 colgroup,
          +
          582 comment, // Microsoft Specific
          +
          583 dd,
          +
          584 del,
          +
          585 dfn,
          +
          586 dir,
          +
          587 div,
          +
          588 dl,
          +
          589 dt,
          +
          590 em,
          +
          591 embed, // Microsoft Specific
          +
          592 fieldset,
          +
          593 font,
          +
          594 form,
          +
          595 frame,
          +
          596 frameset,
          +
          597 h1,
          +
          598 h2,
          +
          599 h3,
          +
          600 h4,
          +
          601 h5,
          +
          602 h6,
          +
          603 head,
          +
          604 hr,
          +
          605 html,
          +
          606 i,
          +
          607 iframe,
          +
          608 img,
          +
          609 input,
          +
          610 ins,
          +
          611 isindex,
          +
          612 kbd,
          +
          613 label,
          +
          614 legend,
          +
          615 li,
          +
          616 link,
          +
          617 listing, // Microsoft Specific
          +
          618 map,
          +
          619 marquee, // Microsoft Specific
          +
          620 menu,
          +
          621 meta,
          +
          622 nextid, // Microsoft Specific
          +
          623 nobr, // Microsoft Specific
          +
          624 noembed, // Microsoft Specific
          +
          625 noframes,
          +
          626 noscript,
          +
          627 object,
          +
          628 ol,
          +
          629 optgroup,
          +
          630 option,
          +
          631 p,
          +
          632 param,
          +
          633 plaintext, // Microsoft Specific
          +
          634 pre,
          +
          635 q,
          +
          636 rt, // Microsoft Specific
          +
          637 ruby, // Microsoft Specific
          +
          638 s,
          +
          639 samp,
          +
          640 script,
          +
          641 select,
          +
          642 small,
          +
          643 span,
          +
          644 strike,
          +
          645 strong,
          +
          646 style,
          +
          647 sub,
          +
          648 sup,
          +
          649 table,
          +
          650 tbody,
          +
          651 td,
          +
          652 textarea,
          +
          653 tfoot,
          +
          654 th,
          +
          655 thead,
          +
          656 title,
          +
          657 tr,
          +
          658 tt,
          +
          659 u,
          +
          660 ul,
          +
          661 var,
          +
          662 wbr, // Microsoft Specific
          +
          663 xmp, // Microsoft Specific
          +
          664
          +
          665 unknown = -1,
          +
          666 PCDATA = -2,
          +
          667 CDATA = -3,
          +
          668 };
          +
          669
          +
          673 enum class element_span_t {
          +
          674 needs_end = 0,
          +
          675 end_optional,
          +
          676 immediate,
          +
          677 };
          +
          678
          +
          + +
          683 {
          +
          +
          689 static inline element_span_t span(_In_ element_t code)
          +
          690 {
          +
          691 static element_span_t lookup[] = {
          +
          692 element_span_t::needs_end, // a
          +
          693 element_span_t::needs_end, // abbr
          +
          694 element_span_t::needs_end, // acronym
          +
          695 element_span_t::needs_end, // address
          +
          696 element_span_t::needs_end, // applet
          +
          697 element_span_t::immediate, // area
          +
          698 element_span_t::needs_end, // b
          +
          699 element_span_t::immediate, // base
          +
          700 element_span_t::immediate, // basefont
          +
          701 element_span_t::needs_end, // bdo
          +
          702 element_span_t::immediate, // bgsound
          +
          703 element_span_t::needs_end, // big
          +
          704 element_span_t::needs_end, // blink
          +
          705 element_span_t::needs_end, // blockquote
          +
          706 element_span_t::end_optional, // body
          +
          707 element_span_t::immediate, // br
          +
          708 element_span_t::needs_end, // button
          +
          709 element_span_t::needs_end, // caption
          +
          710 element_span_t::needs_end, // center
          +
          711 element_span_t::needs_end, // cite
          +
          712 element_span_t::needs_end, // code
          +
          713 element_span_t::immediate, // col
          +
          714 element_span_t::end_optional, // colgroup
          +
          715 element_span_t::needs_end, // comment
          +
          716 element_span_t::end_optional, // dd
          +
          717 element_span_t::needs_end, // del
          +
          718 element_span_t::needs_end, // dfn
          +
          719 element_span_t::needs_end, // dir
          +
          720 element_span_t::needs_end, // div
          +
          721 element_span_t::needs_end, // dl
          +
          722 element_span_t::end_optional, // dt
          +
          723 element_span_t::needs_end, // em
          +
          724 element_span_t::immediate, // embed
          +
          725 element_span_t::needs_end, // fieldset
          +
          726 element_span_t::needs_end, // font
          +
          727 element_span_t::needs_end, // form
          +
          728 element_span_t::immediate, // frame
          +
          729 element_span_t::needs_end, // frameset
          +
          730 element_span_t::needs_end, // h1
          +
          731 element_span_t::needs_end, // h2
          +
          732 element_span_t::needs_end, // h3
          +
          733 element_span_t::needs_end, // h4
          +
          734 element_span_t::needs_end, // h5
          +
          735 element_span_t::needs_end, // h6
          +
          736 element_span_t::end_optional, // head
          +
          737 element_span_t::immediate, // hr
          +
          738 element_span_t::end_optional, // html
          +
          739 element_span_t::needs_end, // i
          +
          740 element_span_t::needs_end, // iframe
          +
          741 element_span_t::immediate, // img
          +
          742 element_span_t::immediate, // input
          +
          743 element_span_t::needs_end, // ins
          +
          744 element_span_t::immediate, // isindex
          +
          745 element_span_t::needs_end, // kbd
          +
          746 element_span_t::needs_end, // label
          +
          747 element_span_t::needs_end, // legend
          +
          748 element_span_t::end_optional, // li
          +
          749 element_span_t::immediate, // link
          +
          750 element_span_t::needs_end, // listing
          +
          751 element_span_t::needs_end, // map
          +
          752 element_span_t::needs_end, // marquee
          +
          753 element_span_t::needs_end, // menu
          +
          754 element_span_t::immediate, // meta
          +
          755 element_span_t::immediate, // nextid
          +
          756 element_span_t::needs_end, // nobr
          +
          757 element_span_t::needs_end, // noembed
          +
          758 element_span_t::needs_end, // noframes
          +
          759 element_span_t::needs_end, // noscript
          +
          760 element_span_t::needs_end, // object
          +
          761 element_span_t::needs_end, // ol
          +
          762 element_span_t::needs_end, // optgroup
          +
          763 element_span_t::end_optional, // option
          +
          764 element_span_t::end_optional, // p
          +
          765 element_span_t::immediate, // param
          +
          766 element_span_t::end_optional, // plaintext
          +
          767 element_span_t::needs_end, // pre
          +
          768 element_span_t::needs_end, // q
          +
          769 element_span_t::immediate, // rt
          +
          770 element_span_t::needs_end, // ruby
          +
          771 element_span_t::needs_end, // s
          +
          772 element_span_t::needs_end, // samp
          +
          773 element_span_t::needs_end, // script
          +
          774 element_span_t::needs_end, // select
          +
          775 element_span_t::needs_end, // small
          +
          776 element_span_t::needs_end, // span
          +
          777 element_span_t::needs_end, // strike
          +
          778 element_span_t::needs_end, // strong
          +
          779 element_span_t::needs_end, // style
          +
          780 element_span_t::needs_end, // sub
          +
          781 element_span_t::needs_end, // sup
          +
          782 element_span_t::needs_end, // table
          +
          783 element_span_t::end_optional, // tbody
          +
          784 element_span_t::end_optional, // td
          +
          785 element_span_t::needs_end, // textarea
          +
          786 element_span_t::end_optional, // tfoot
          +
          787 element_span_t::end_optional, // th
          +
          788 element_span_t::end_optional, // thead
          +
          789 element_span_t::needs_end, // title
          +
          790 element_span_t::end_optional, // tr
          +
          791 element_span_t::needs_end, // tt
          +
          792 element_span_t::needs_end, // u
          +
          793 element_span_t::needs_end, // ul
          +
          794 element_span_t::needs_end, // var
          +
          795 element_span_t::immediate, // wbr
          +
          796 element_span_t::needs_end, // xmp
          +
          797 };
          +
          798 return element_t::a <= code && code <= element_t::xmp ?
          +
          799 lookup[static_cast<size_t>(code) - static_cast<size_t>(element_t::a)] :
          +
          800 element_span_t::needs_end;
          +
          801 }
          -
          634
          -
          -
          640 static inline bool is_fontstyle(_In_ element_t code)
          -
          641 {
          -
          642 switch (code) {
          -
          643 case element_t::tt:
          -
          644 case element_t::i:
          -
          645 case element_t::b:
          -
          646 case element_t::u:
          -
          647 case element_t::s:
          -
          648 case element_t::strike:
          -
          649 case element_t::blink:
          -
          650 case element_t::big:
          -
          651 case element_t::small:
          -
          652 return true;
          -
          653 };
          -
          654 return false;
          -
          655 }
          +
          802
          +
          +
          808 static inline bool is_fontstyle(_In_ element_t code)
          +
          809 {
          +
          810 switch (code) {
          +
          811 case element_t::tt:
          +
          812 case element_t::i:
          +
          813 case element_t::b:
          +
          814 case element_t::u:
          +
          815 case element_t::s:
          +
          816 case element_t::strike:
          +
          817 case element_t::blink:
          +
          818 case element_t::big:
          +
          819 case element_t::small:
          +
          820 return true;
          +
          821 };
          +
          822 return false;
          +
          823 }
          -
          656
          -
          -
          662 static inline bool is_phrase(_In_ element_t code)
          -
          663 {
          -
          664 switch (code) {
          -
          665 case element_t::em:
          -
          666 case element_t::strong:
          -
          667 case element_t::dfn:
          -
          668 case element_t::code:
          -
          669 case element_t::samp:
          -
          670 case element_t::kbd:
          -
          671 case element_t::var:
          -
          672 case element_t::cite:
          -
          673 case element_t::abbr:
          -
          674 case element_t::acronym:
          -
          675 case element_t::xmp:
          -
          676 return true;
          -
          677 };
          -
          678 return false;
          -
          679 }
          +
          824
          +
          +
          830 static inline bool is_phrase(_In_ element_t code)
          +
          831 {
          +
          832 switch (code) {
          +
          833 case element_t::em:
          +
          834 case element_t::strong:
          +
          835 case element_t::dfn:
          +
          836 case element_t::code:
          +
          837 case element_t::samp:
          +
          838 case element_t::kbd:
          +
          839 case element_t::var:
          +
          840 case element_t::cite:
          +
          841 case element_t::abbr:
          +
          842 case element_t::acronym:
          +
          843 case element_t::xmp:
          +
          844 return true;
          +
          845 };
          +
          846 return false;
          +
          847 }
          -
          680
          -
          -
          686 static inline bool is_special(_In_ element_t code)
          -
          687 {
          -
          688 switch (code) {
          -
          689 case element_t::a:
          -
          690 case element_t::img:
          -
          691 case element_t::applet:
          -
          692 case element_t::object:
          -
          693 case element_t::embed:
          -
          694 case element_t::font:
          -
          695 case element_t::basefont:
          -
          696 case element_t::br:
          -
          697 case element_t::wbr:
          -
          698 case element_t::rt:
          -
          699 case element_t::script:
          -
          700 case element_t::map:
          -
          701 case element_t::q:
          -
          702 case element_t::sub:
          -
          703 case element_t::sup:
          -
          704 case element_t::ruby:
          -
          705 case element_t::span:
          -
          706 case element_t::bdo:
          -
          707 case element_t::iframe:
          -
          708 case element_t::nobr:
          -
          709 return true;
          -
          710 };
          -
          711 return false;
          -
          712 }
          +
          848
          +
          +
          854 static inline bool is_special(_In_ element_t code)
          +
          855 {
          +
          856 switch (code) {
          +
          857 case element_t::a:
          +
          858 case element_t::img:
          +
          859 case element_t::applet:
          +
          860 case element_t::object:
          +
          861 case element_t::embed:
          +
          862 case element_t::font:
          +
          863 case element_t::basefont:
          +
          864 case element_t::br:
          +
          865 case element_t::wbr:
          +
          866 case element_t::rt:
          +
          867 case element_t::script:
          +
          868 case element_t::map:
          +
          869 case element_t::q:
          +
          870 case element_t::sub:
          +
          871 case element_t::sup:
          +
          872 case element_t::ruby:
          +
          873 case element_t::span:
          +
          874 case element_t::bdo:
          +
          875 case element_t::iframe:
          +
          876 case element_t::nobr:
          +
          877 return true;
          +
          878 };
          +
          879 return false;
          +
          880 }
          -
          713
          -
          -
          719 static inline bool is_formctrl(_In_ element_t code)
          -
          720 {
          -
          721 switch (code) {
          -
          722 case element_t::input:
          -
          723 case element_t::select:
          -
          724 case element_t::textarea:
          -
          725 case element_t::label:
          -
          726 case element_t::button:
          -
          727 return true;
          -
          728 };
          -
          729 return false;
          -
          730 }
          +
          881
          +
          +
          887 static inline bool is_formctrl(_In_ element_t code)
          +
          888 {
          +
          889 switch (code) {
          +
          890 case element_t::input:
          +
          891 case element_t::select:
          +
          892 case element_t::textarea:
          +
          893 case element_t::label:
          +
          894 case element_t::button:
          +
          895 return true;
          +
          896 };
          +
          897 return false;
          +
          898 }
          -
          731
          -
          -
          737 static inline bool is_inline(_In_ element_t code)
          -
          738 {
          -
          739 return
          -
          740 code == element_t::PCDATA ||
          -
          741 is_fontstyle(code) ||
          -
          742 is_phrase(code) ||
          -
          743 is_special(code) ||
          -
          744 is_formctrl(code);
          -
          745 }
          -
          -
          746
          -
          -
          752 static inline bool is_heading(_In_ element_t code)
          -
          753 {
          -
          754 switch (code) {
          -
          755 case element_t::h1:
          -
          756 case element_t::h2:
          -
          757 case element_t::h3:
          -
          758 case element_t::h4:
          -
          759 case element_t::h5:
          -
          760 case element_t::h6:
          -
          761 return true;
          -
          762 };
          -
          763 return false;
          -
          764 }
          -
          -
          765
          -
          -
          771 static inline bool is_list(_In_ element_t code)
          -
          772 {
          -
          773 switch (code) {
          -
          774 case element_t::ul:
          -
          775 case element_t::ol:
          -
          776 case element_t::dir:
          -
          777 case element_t::menu:
          -
          778 return true;
          -
          779 };
          -
          780 return false;
          -
          781 }
          -
          -
          782
          -
          -
          788 static inline bool is_preformatted(_In_ element_t code)
          -
          789 {
          -
          790 switch (code) {
          -
          791 case element_t::pre:
          -
          792 case element_t::listing:
          -
          793 return true;
          -
          794 }
          -
          795 return false;
          -
          796 }
          -
          -
          797
          -
          -
          803 static inline bool is_block(_In_ element_t code)
          -
          804 {
          -
          805 if (is_heading(code) ||
          -
          806 is_list(code) ||
          -
          807 is_preformatted(code)) return true;
          -
          808 switch (code) {
          -
          809 case element_t::p:
          -
          810 case element_t::dl:
          -
          811 case element_t::div:
          -
          812 case element_t::center:
          -
          813 case element_t::marquee:
          -
          814 case element_t::noscript:
          -
          815 case element_t::noframes:
          -
          816 case element_t::noembed:
          -
          817 case element_t::blockquote:
          -
          818 case element_t::form:
          -
          819 case element_t::isindex:
          -
          820 case element_t::hr:
          -
          821 case element_t::table:
          -
          822 case element_t::fieldset:
          -
          823 case element_t::address:
          -
          824 return true;
          -
          825 };
          -
          826 return false;
          -
          827 }
          -
          -
          828
          -
          -
          834 static inline bool is_flow(_In_ element_t code)
          -
          835 {
          -
          836 return is_block(code) || is_inline(code);
          -
          837 }
          -
          -
          838
          -
          -
          844 static inline bool is_head_content(_In_ element_t code)
          -
          845 {
          -
          846 switch (code) {
          -
          847 case element_t::title:
          -
          848 case element_t::isindex:
          -
          849 case element_t::base:
          -
          850 case element_t::nextid:
          -
          851 return true;
          -
          852 };
          -
          853 return false;
          -
          854 }
          -
          -
          855
          -
          -
          861 static inline bool is_head_misc(_In_ element_t code)
          -
          862 {
          -
          863 switch (code) {
          -
          864 case element_t::script:
          -
          865 case element_t::style:
          -
          866 case element_t::meta:
          -
          867 case element_t::link:
          -
          868 case element_t::object:
          -
          869 return true;
          -
          870 };
          -
          871 return false;
          -
          872 }
          -
          -
          873
          -
          -
          879 static inline bool is_pre_exclusion(_In_ element_t code)
          -
          880 {
          -
          881 switch (code) {
          -
          882 case element_t::img:
          -
          883 case element_t::object:
          -
          884 case element_t::applet:
          -
          885 case element_t::embed:
          -
          886 case element_t::big:
          -
          887 case element_t::small:
          -
          888 case element_t::sub:
          -
          889 case element_t::sup:
          -
          890 case element_t::ruby:
          -
          891 case element_t::font:
          -
          892 case element_t::basefont:
          -
          893 case element_t::nobr:
          -
          894 return true;
          -
          895 };
          -
          896 return false;
          -
          897 }
          -
          -
          898
          -
          -
          904 static inline bool is_html_content(_In_ element_t code)
          -
          905 {
          -
          906 switch (code) {
          -
          907 case element_t::head:
          -
          908 case element_t::body:
          -
          909 case element_t::frameset:
          -
          910 return true;
          -
          911 };
          -
          912 return false;
          +
          899
          +
          +
          905 static inline bool is_inline(_In_ element_t code)
          +
          906 {
          +
          907 return
          +
          908 code == element_t::PCDATA ||
          +
          909 is_fontstyle(code) ||
          +
          910 is_phrase(code) ||
          +
          911 is_special(code) ||
          +
          912 is_formctrl(code);
          913 }
          914
          -
          920 static inline bool is_group(_In_ element_t code)
          +
          920 static inline bool is_heading(_In_ element_t code)
          921 {
          -
          922 if (is_block(code) ||
          -
          923 is_html_content(code) ||
          -
          924 is_head_content(code)) return true;
          -
          925 switch (code) {
          -
          926 case element_t::col:
          -
          927 case element_t::colgroup:
          -
          928 case element_t::dd:
          -
          929 case element_t::dir:
          -
          930 case element_t::dt:
          -
          931 case element_t::frame:
          -
          932 case element_t::iframe:
          -
          933 case element_t::legend:
          -
          934 case element_t::td:
          -
          935 case element_t::th:
          -
          936 case element_t::tr:
          -
          937 return true;
          -
          938 };
          -
          939 return false;
          -
          940 }
          +
          922 switch (code) {
          +
          923 case element_t::h1:
          +
          924 case element_t::h2:
          +
          925 case element_t::h3:
          +
          926 case element_t::h4:
          +
          927 case element_t::h5:
          +
          928 case element_t::h6:
          +
          929 return true;
          +
          930 };
          +
          931 return false;
          +
          932 }
          -
          941
          -
          -
          950 static inline bool may_contain(_In_ element_t parent, _In_ element_t child)
          -
          951 {
          -
          952 if (child == element_t::unknown || child == element_t::comment)
          -
          953 return true;
          -
          954 if (is_fontstyle(parent) || is_phrase(parent))
          -
          955 return is_inline(child);
          -
          956 if (is_heading(parent))
          -
          957 return is_inline(child);
          -
          958
          -
          959 switch (parent) {
          -
          960 case element_t::a: return is_inline(child) && child != element_t::a;
          -
          961 case element_t::address: return is_inline(child) || child == element_t::p;
          -
          962 case element_t::applet: return is_flow(child) || child == element_t::param;
          -
          963 case element_t::area: return false;
          -
          964 case element_t::base: return false;
          -
          965 case element_t::basefont: return false;
          -
          966 case element_t::bdo: return is_inline(child);
          -
          967 case element_t::blockquote: return is_flow(child);
          -
          968 case element_t::body: return is_flow(child) || child == element_t::ins || child == element_t::del;
          -
          969 case element_t::br: return false;
          -
          970 case element_t::button: return is_flow(child) && !is_formctrl(child) && child != element_t::a && child != element_t::form && child != element_t::isindex && child != element_t::fieldset && child != element_t::iframe;
          -
          971 case element_t::caption: return is_inline(child);
          -
          972 case element_t::center: return is_flow(child);
          -
          973 case element_t::col: return false;
          -
          974 case element_t::colgroup: return child == element_t::col;
          -
          975 case element_t::comment: return child == element_t::CDATA;
          -
          976 case element_t::dd: return is_flow(child);
          -
          977 case element_t::del: return is_flow(child);
          -
          978 case element_t::dir: return child == element_t::li;
          -
          979 case element_t::div: return is_flow(child);
          -
          980 case element_t::dl: return child == element_t::dt || child == element_t::dd;
          -
          981 case element_t::dt: return is_inline(child);
          -
          982 case element_t::embed: return is_flow(child) || child == element_t::param;
          -
          983 case element_t::fieldset: return is_flow(child) || child == element_t::legend || child == element_t::PCDATA;
          -
          984 case element_t::font: return is_inline(child);
          -
          985 case element_t::form: return is_flow(child) && child != element_t::form;
          -
          986 case element_t::frame: return false;
          -
          987 case element_t::frameset: return child == element_t::frameset || child == element_t::frame || child == element_t::noframes;
          -
          988 case element_t::head: return is_head_content(child) || is_head_misc(child);
          -
          989 case element_t::hr: return false;
          -
          990 case element_t::html: return is_html_content(child);
          -
          991 case element_t::iframe: return is_flow(child);
          -
          992 case element_t::img: return false;
          -
          993 case element_t::input: return false;
          -
          994 case element_t::ins: return is_flow(child);
          -
          995 case element_t::isindex: return false;
          -
          996 case element_t::label: return is_inline(child) && child != element_t::label;
          -
          997 case element_t::legend: return is_inline(child);
          -
          998 case element_t::li: return is_flow(child);
          -
          999 case element_t::link: return false;
          -
          1000 case element_t::listing: return child == element_t::CDATA;
          -
          1001 case element_t::map: return is_block(child) || child == element_t::area;
          -
          1002 case element_t::marquee: return is_flow(child);
          -
          1003 case element_t::menu: return child == element_t::li;
          -
          1004 case element_t::meta: return false;
          -
          1005 case element_t::nobr: return is_inline(child) || child == element_t::wbr;
          -
          1006 case element_t::noframes: return (is_flow(child) || child == element_t::body) && child != element_t::noframes;
          -
          1007 case element_t::noscript: return is_flow(child);
          -
          1008 case element_t::noembed: return is_flow(child);
          -
          1009 case element_t::object: return is_flow(child) || child == element_t::param;
          -
          1010 case element_t::ol: return child == element_t::li;
          -
          1011 case element_t::optgroup: return child == element_t::option;
          -
          1012 case element_t::option: return child == element_t::PCDATA;
          -
          1013 case element_t::p: return is_inline(child);
          -
          1014 case element_t::param: return false;
          -
          1015 case element_t::plaintext: return is_flow(child);
          -
          1016 case element_t::pre: return is_inline(child) && !is_pre_exclusion(child);
          -
          1017 case element_t::q: return is_inline(child);
          -
          1018 case element_t::rt: return false;
          -
          1019 case element_t::ruby: return is_inline(child);
          -
          1020 case element_t::script: return child == element_t::CDATA;
          -
          1021 case element_t::select: return child == element_t::optgroup || child == element_t::option;
          -
          1022 case element_t::span: return is_inline(child);
          -
          1023 case element_t::style: return child == element_t::CDATA;
          -
          1024 case element_t::sub: return is_inline(child);
          -
          1025 case element_t::sup: return is_inline(child);
          -
          1026 case element_t::table: return child == element_t::caption || child == element_t::col || child == element_t::colgroup || child == element_t::thead || child == element_t::tfoot || child == element_t::tbody;
          -
          1027 case element_t::tbody: return child == element_t::tr;
          -
          1028 case element_t::td: return is_flow(child);
          -
          1029 case element_t::textarea: return child == element_t::PCDATA;
          -
          1030 case element_t::tfoot: return child == element_t::tr;
          -
          1031 case element_t::th: return is_flow(child);
          -
          1032 case element_t::thead: return child == element_t::tr;
          -
          1033 case element_t::title: return child == element_t::PCDATA;
          -
          1034 case element_t::tr: return child == element_t::td || child == element_t::th;
          -
          1035 case element_t::ul: return child == element_t::li;
          -
          1036 case element_t::wbr: return false;
          -
          1037 case element_t::unknown: return true;
          -
          1038 }
          +
          933
          +
          +
          939 static inline bool is_list(_In_ element_t code)
          +
          940 {
          +
          941 switch (code) {
          +
          942 case element_t::ul:
          +
          943 case element_t::ol:
          +
          944 case element_t::dir:
          +
          945 case element_t::menu:
          +
          946 return true;
          +
          947 };
          +
          948 return false;
          +
          949 }
          +
          +
          950
          +
          +
          956 static inline bool is_preformatted(_In_ element_t code)
          +
          957 {
          +
          958 switch (code) {
          +
          959 case element_t::pre:
          +
          960 case element_t::listing:
          +
          961 return true;
          +
          962 }
          +
          963 return false;
          +
          964 }
          +
          +
          965
          +
          +
          971 static inline bool is_block(_In_ element_t code)
          +
          972 {
          +
          973 if (is_heading(code) ||
          +
          974 is_list(code) ||
          +
          975 is_preformatted(code)) return true;
          +
          976 switch (code) {
          +
          977 case element_t::p:
          +
          978 case element_t::dl:
          +
          979 case element_t::div:
          +
          980 case element_t::center:
          +
          981 case element_t::marquee:
          +
          982 case element_t::noscript:
          +
          983 case element_t::noframes:
          +
          984 case element_t::noembed:
          +
          985 case element_t::blockquote:
          +
          986 case element_t::form:
          +
          987 case element_t::isindex:
          +
          988 case element_t::hr:
          +
          989 case element_t::table:
          +
          990 case element_t::fieldset:
          +
          991 case element_t::address:
          +
          992 return true;
          +
          993 };
          +
          994 return false;
          +
          995 }
          +
          +
          996
          +
          +
          1002 static inline bool is_flow(_In_ element_t code)
          +
          1003 {
          +
          1004 return is_block(code) || is_inline(code);
          +
          1005 }
          +
          +
          1006
          +
          +
          1012 static inline bool is_head_content(_In_ element_t code)
          +
          1013 {
          +
          1014 switch (code) {
          +
          1015 case element_t::title:
          +
          1016 case element_t::isindex:
          +
          1017 case element_t::base:
          +
          1018 case element_t::nextid:
          +
          1019 return true;
          +
          1020 };
          +
          1021 return false;
          +
          1022 }
          +
          +
          1023
          +
          +
          1029 static inline bool is_head_misc(_In_ element_t code)
          +
          1030 {
          +
          1031 switch (code) {
          +
          1032 case element_t::script:
          +
          1033 case element_t::style:
          +
          1034 case element_t::meta:
          +
          1035 case element_t::link:
          +
          1036 case element_t::object:
          +
          1037 return true;
          +
          1038 };
          1039 return false;
          1040 }
          1041
          -
          1049 template <class T>
          -
          -
          1050 static inline bool is_uri(_In_ element_t code, _In_reads_or_z_opt_(num_chars) const T* attr_name, _In_ size_t num_chars)
          -
          1051 {
          -
          1052 _Assume_(attr_name || !num_chars);
          -
          1053 switch (code) {
          -
          1054 case element_t::a: return !stdex::strnicmp(attr_name, num_chars, "href", SIZE_MAX);
          -
          1055 case element_t::applet: return !stdex::strnicmp(attr_name, num_chars, "code", SIZE_MAX) ||
          -
          1056 !stdex::strnicmp(attr_name, num_chars, "codebase", SIZE_MAX) ||
          -
          1057 !stdex::strnicmp(attr_name, num_chars, "src", SIZE_MAX);
          -
          1058 case element_t::area: return !stdex::strnicmp(attr_name, num_chars, "href", SIZE_MAX);
          -
          1059 case element_t::base: return !stdex::strnicmp(attr_name, num_chars, "href", SIZE_MAX);
          -
          1060 case element_t::bgsound: return !stdex::strnicmp(attr_name, num_chars, "src", SIZE_MAX);
          -
          1061 case element_t::blockquote: return !stdex::strnicmp(attr_name, num_chars, "cite", SIZE_MAX);
          -
          1062 case element_t::body: return !stdex::strnicmp(attr_name, num_chars, "background", SIZE_MAX);
          -
          1063 case element_t::comment: return !stdex::strnicmp(attr_name, num_chars, "data", SIZE_MAX);
          -
          1064 case element_t::del: return !stdex::strnicmp(attr_name, num_chars, "cite", SIZE_MAX);
          -
          1065 case element_t::embed: return !stdex::strnicmp(attr_name, num_chars, "pluginspage", SIZE_MAX) ||
          -
          1066 !stdex::strnicmp(attr_name, num_chars, "src", SIZE_MAX);
          -
          1067 case element_t::form: return !stdex::strnicmp(attr_name, num_chars, "action", SIZE_MAX);
          -
          1068 case element_t::frame: return !stdex::strnicmp(attr_name, num_chars, "longdesc", SIZE_MAX) ||
          -
          1069 !stdex::strnicmp(attr_name, num_chars, "src", SIZE_MAX);
          -
          1070 case element_t::head: return !stdex::strnicmp(attr_name, num_chars, "profile", SIZE_MAX);
          -
          1071 case element_t::iframe: return !stdex::strnicmp(attr_name, num_chars, "longdesc", SIZE_MAX) ||
          -
          1072 !stdex::strnicmp(attr_name, num_chars, "src", SIZE_MAX);
          -
          1073 case element_t::img: return !stdex::strnicmp(attr_name, num_chars, "longdesc", SIZE_MAX) ||
          -
          1074 !stdex::strnicmp(attr_name, num_chars, "lowsrc", SIZE_MAX) ||
          -
          1075 !stdex::strnicmp(attr_name, num_chars, "src", SIZE_MAX) ||
          -
          1076 !stdex::strnicmp(attr_name, num_chars, "usemap", SIZE_MAX);
          -
          1077 case element_t::input: return !stdex::strnicmp(attr_name, num_chars, "lowsrc", SIZE_MAX) ||
          -
          1078 !stdex::strnicmp(attr_name, num_chars, "src", SIZE_MAX) ||
          -
          1079 !stdex::strnicmp(attr_name, num_chars, "usemap", SIZE_MAX);
          -
          1080 case element_t::ins: return !stdex::strnicmp(attr_name, num_chars, "cite", SIZE_MAX);
          -
          1081 case element_t::link: return !stdex::strnicmp(attr_name, num_chars, "href", SIZE_MAX);
          -
          1082 case element_t::object: return !stdex::strnicmp(attr_name, num_chars, "basehref", SIZE_MAX) ||
          -
          1083 !stdex::strnicmp(attr_name, num_chars, "classid", SIZE_MAX) ||
          -
          1084 !stdex::strnicmp(attr_name, num_chars, "code", SIZE_MAX) ||
          -
          1085 !stdex::strnicmp(attr_name, num_chars, "codebase", SIZE_MAX) ||
          -
          1086 !stdex::strnicmp(attr_name, num_chars, "data", SIZE_MAX) ||
          -
          1087 !stdex::strnicmp(attr_name, num_chars, "usemap", SIZE_MAX);
          -
          1088 case element_t::q: return !stdex::strnicmp(attr_name, num_chars, "cite", SIZE_MAX);
          -
          1089 case element_t::script: return !stdex::strnicmp(attr_name, num_chars, "src", SIZE_MAX);
          -
          1090 case element_t::table: return !stdex::strnicmp(attr_name, num_chars, "background", SIZE_MAX);
          -
          1091 case element_t::td: return !stdex::strnicmp(attr_name, num_chars, "background", SIZE_MAX);
          -
          1092 case element_t::th: return !stdex::strnicmp(attr_name, num_chars, "background", SIZE_MAX);
          -
          1093 }
          -
          1094 return false;
          -
          1095 }
          +
          +
          1047 static inline bool is_pre_exclusion(_In_ element_t code)
          +
          1048 {
          +
          1049 switch (code) {
          +
          1050 case element_t::img:
          +
          1051 case element_t::object:
          +
          1052 case element_t::applet:
          +
          1053 case element_t::embed:
          +
          1054 case element_t::big:
          +
          1055 case element_t::small:
          +
          1056 case element_t::sub:
          +
          1057 case element_t::sup:
          +
          1058 case element_t::ruby:
          +
          1059 case element_t::font:
          +
          1060 case element_t::basefont:
          +
          1061 case element_t::nobr:
          +
          1062 return true;
          +
          1063 };
          +
          1064 return false;
          +
          1065 }
          -
          1096
          -
          1104 template <class T>
          -
          -
          1105 static inline bool is_localizable(element_t code, const T* attr_name, size_t num_chars)
          -
          1106 {
          -
          1107 _Assume_(attr_name || !num_chars);
          -
          1108 if (!stdex::strnicmp(attr_name, num_chars, "title", SIZE_MAX))
          -
          1109 return true;
          -
          1110 switch (code) {
          -
          1111 case element_t::applet: return !stdex::strnicmp(attr_name, num_chars, "alt", SIZE_MAX);
          -
          1112 case element_t::area: return !stdex::strnicmp(attr_name, num_chars, "alt", SIZE_MAX);
          -
          1113 case element_t::img: return !stdex::strnicmp(attr_name, num_chars, "alt", SIZE_MAX);
          -
          1114 case element_t::input: return !stdex::strnicmp(attr_name, num_chars, "alt", SIZE_MAX);
          -
          1115 case element_t::object: return !stdex::strnicmp(attr_name, num_chars, "alt", SIZE_MAX);
          -
          1116 case element_t::table: return !stdex::strnicmp(attr_name, num_chars, "summary", SIZE_MAX);
          -
          1117 case element_t::td: return !stdex::strnicmp(attr_name, num_chars, "abbr", SIZE_MAX);
          -
          1118 case element_t::th: return !stdex::strnicmp(attr_name, num_chars, "abbr", SIZE_MAX);
          -
          1119 }
          -
          1120 return false;
          -
          1121 }
          +
          1066
          +
          +
          1072 static inline bool is_html_content(_In_ element_t code)
          +
          1073 {
          +
          1074 switch (code) {
          +
          1075 case element_t::head:
          +
          1076 case element_t::body:
          +
          1077 case element_t::frameset:
          +
          1078 return true;
          +
          1079 };
          +
          1080 return false;
          +
          1081 }
          -
          1122 };
          +
          1082
          +
          +
          1088 static inline bool is_group(_In_ element_t code)
          +
          1089 {
          +
          1090 if (is_block(code) ||
          +
          1091 is_html_content(code) ||
          +
          1092 is_head_content(code)) return true;
          +
          1093 switch (code) {
          +
          1094 case element_t::col:
          +
          1095 case element_t::colgroup:
          +
          1096 case element_t::dd:
          +
          1097 case element_t::dir:
          +
          1098 case element_t::dt:
          +
          1099 case element_t::frame:
          +
          1100 case element_t::iframe:
          +
          1101 case element_t::legend:
          +
          1102 case element_t::td:
          +
          1103 case element_t::th:
          +
          1104 case element_t::tr:
          +
          1105 return true;
          +
          1106 };
          +
          1107 return false;
          +
          1108 }
          -
          1123
          -
          1124 class sequence;
          -
          1125 using sequence_store = std::vector<std::unique_ptr<sequence>>;
          +
          1109
          +
          +
          1118 static inline bool may_contain(_In_ element_t parent, _In_ element_t child)
          +
          1119 {
          +
          1120 if (child == element_t::unknown || child == element_t::comment)
          +
          1121 return true;
          +
          1122 if (is_fontstyle(parent) || is_phrase(parent))
          +
          1123 return is_inline(child);
          +
          1124 if (is_heading(parent))
          +
          1125 return is_inline(child);
          1126
          -
          - -
          1131 {
          -
          1132 public:
          -
          1133 stdex::parser::html_sequence_t type;
          - - -
          1136
          -
          1137 sequence(_In_ stdex::parser::html_sequence_t _type = stdex::parser::html_sequence_t::unknown, _In_ size_t start = 0, size_t end = 0, _In_opt_ sequence* _parent = nullptr) :
          -
          1138 type(_type),
          -
          1139 interval(start, end),
          -
          1140 parent(_parent)
          -
          1141 {}
          -
          1142
          -
          1143 virtual ~sequence() {} // make polymorphic
          -
          1144 };
          +
          1127 switch (parent) {
          +
          1128 case element_t::a: return is_inline(child) && child != element_t::a;
          +
          1129 case element_t::address: return is_inline(child) || child == element_t::p;
          +
          1130 case element_t::applet: return is_flow(child) || child == element_t::param;
          +
          1131 case element_t::area: return false;
          +
          1132 case element_t::base: return false;
          +
          1133 case element_t::basefont: return false;
          +
          1134 case element_t::bdo: return is_inline(child);
          +
          1135 case element_t::blockquote: return is_flow(child);
          +
          1136 case element_t::body: return is_flow(child) || child == element_t::ins || child == element_t::del;
          +
          1137 case element_t::br: return false;
          +
          1138 case element_t::button: return is_flow(child) && !is_formctrl(child) && child != element_t::a && child != element_t::form && child != element_t::isindex && child != element_t::fieldset && child != element_t::iframe;
          +
          1139 case element_t::caption: return is_inline(child);
          +
          1140 case element_t::center: return is_flow(child);
          +
          1141 case element_t::col: return false;
          +
          1142 case element_t::colgroup: return child == element_t::col;
          +
          1143 case element_t::comment: return child == element_t::CDATA;
          +
          1144 case element_t::dd: return is_flow(child);
          +
          1145 case element_t::del: return is_flow(child);
          +
          1146 case element_t::dir: return child == element_t::li;
          +
          1147 case element_t::div: return is_flow(child);
          +
          1148 case element_t::dl: return child == element_t::dt || child == element_t::dd;
          +
          1149 case element_t::dt: return is_inline(child);
          +
          1150 case element_t::embed: return is_flow(child) || child == element_t::param;
          +
          1151 case element_t::fieldset: return is_flow(child) || child == element_t::legend || child == element_t::PCDATA;
          +
          1152 case element_t::font: return is_inline(child);
          +
          1153 case element_t::form: return is_flow(child) && child != element_t::form;
          +
          1154 case element_t::frame: return false;
          +
          1155 case element_t::frameset: return child == element_t::frameset || child == element_t::frame || child == element_t::noframes;
          +
          1156 case element_t::head: return is_head_content(child) || is_head_misc(child);
          +
          1157 case element_t::hr: return false;
          +
          1158 case element_t::html: return is_html_content(child);
          +
          1159 case element_t::iframe: return is_flow(child);
          +
          1160 case element_t::img: return false;
          +
          1161 case element_t::input: return false;
          +
          1162 case element_t::ins: return is_flow(child);
          +
          1163 case element_t::isindex: return false;
          +
          1164 case element_t::label: return is_inline(child) && child != element_t::label;
          +
          1165 case element_t::legend: return is_inline(child);
          +
          1166 case element_t::li: return is_flow(child);
          +
          1167 case element_t::link: return false;
          +
          1168 case element_t::listing: return child == element_t::CDATA;
          +
          1169 case element_t::map: return is_block(child) || child == element_t::area;
          +
          1170 case element_t::marquee: return is_flow(child);
          +
          1171 case element_t::menu: return child == element_t::li;
          +
          1172 case element_t::meta: return false;
          +
          1173 case element_t::nobr: return is_inline(child) || child == element_t::wbr;
          +
          1174 case element_t::noframes: return (is_flow(child) || child == element_t::body) && child != element_t::noframes;
          +
          1175 case element_t::noscript: return is_flow(child);
          +
          1176 case element_t::noembed: return is_flow(child);
          +
          1177 case element_t::object: return is_flow(child) || child == element_t::param;
          +
          1178 case element_t::ol: return child == element_t::li;
          +
          1179 case element_t::optgroup: return child == element_t::option;
          +
          1180 case element_t::option: return child == element_t::PCDATA;
          +
          1181 case element_t::p: return is_inline(child);
          +
          1182 case element_t::param: return false;
          +
          1183 case element_t::plaintext: return is_flow(child);
          +
          1184 case element_t::pre: return is_inline(child) && !is_pre_exclusion(child);
          +
          1185 case element_t::q: return is_inline(child);
          +
          1186 case element_t::rt: return false;
          +
          1187 case element_t::ruby: return is_inline(child);
          +
          1188 case element_t::script: return child == element_t::CDATA;
          +
          1189 case element_t::select: return child == element_t::optgroup || child == element_t::option;
          +
          1190 case element_t::span: return is_inline(child);
          +
          1191 case element_t::style: return child == element_t::CDATA;
          +
          1192 case element_t::sub: return is_inline(child);
          +
          1193 case element_t::sup: return is_inline(child);
          +
          1194 case element_t::table: return child == element_t::caption || child == element_t::col || child == element_t::colgroup || child == element_t::thead || child == element_t::tfoot || child == element_t::tbody;
          +
          1195 case element_t::tbody: return child == element_t::tr;
          +
          1196 case element_t::td: return is_flow(child);
          +
          1197 case element_t::textarea: return child == element_t::PCDATA;
          +
          1198 case element_t::tfoot: return child == element_t::tr;
          +
          1199 case element_t::th: return is_flow(child);
          +
          1200 case element_t::thead: return child == element_t::tr;
          +
          1201 case element_t::title: return child == element_t::PCDATA;
          +
          1202 case element_t::tr: return child == element_t::td || child == element_t::th;
          +
          1203 case element_t::ul: return child == element_t::li;
          +
          1204 case element_t::wbr: return false;
          +
          1205 case element_t::unknown: return true;
          +
          1206 }
          +
          1207 return false;
          +
          1208 }
          -
          1145
          -
          -
          1149 class element : public sequence
          -
          1150 {
          -
          1151 public:
          -
          1152 template <class T>
          -
          1153 inline element(_Inout_ stdex::parser::basic_html_tag<T>&& tag, _In_z_ const T* src, _In_opt_ sequence* parent = nullptr) :
          -
          1154 sequence(tag.type, tag.interval.start, tag.interval.end, parent),
          -
          1155 code(element_code(src + tag.name.start, tag.name.size())),
          -
          1156 name(std::move(tag.name)),
          -
          1157 attributes(std::move(tag.attributes))
          -
          1158 {}
          -
          1159
          -
          1160 template <class T>
          -
          1161 static element_t element_code(_In_reads_z_(num_chars) const T* name, size_t num_chars)
          -
          1162 {
          -
          1163 static const struct {
          -
          1164 const char* name;
          -
          1165 element_t code;
          -
          1166 } mapping[] = {
          -
          1167 { "a", element_t::a, },
          -
          1168 { "abbr", element_t::abbr, },
          -
          1169 { "acronym", element_t::acronym, },
          -
          1170 { "address", element_t::address, },
          -
          1171 { "applet", element_t::applet, },
          -
          1172 { "area", element_t::area, },
          -
          1173 { "b", element_t::b, },
          -
          1174 { "base", element_t::base, },
          -
          1175 { "basefont", element_t::basefont, },
          -
          1176 { "bdo", element_t::bdo, },
          -
          1177 { "bgsound", element_t::bgsound, },
          -
          1178 { "big", element_t::big, },
          -
          1179 { "blink", element_t::blink, },
          -
          1180 { "blockquote", element_t::blockquote, },
          -
          1181 { "body", element_t::body, },
          -
          1182 { "br", element_t::br, },
          -
          1183 { "button", element_t::button, },
          -
          1184 { "caption", element_t::caption, },
          -
          1185 { "center", element_t::center, },
          -
          1186 { "cite", element_t::cite, },
          -
          1187 { "code", element_t::code, },
          -
          1188 { "col", element_t::col, },
          -
          1189 { "colgroup", element_t::colgroup, },
          -
          1190 { "comment", element_t::comment, },
          -
          1191 { "dd", element_t::dd, },
          -
          1192 { "del", element_t::del, },
          -
          1193 { "dfn", element_t::dfn, },
          -
          1194 { "dir", element_t::dir, },
          -
          1195 { "div", element_t::div, },
          -
          1196 { "dl", element_t::dl, },
          -
          1197 { "dt", element_t::dt, },
          -
          1198 { "em", element_t::em, },
          -
          1199 { "embed", element_t::embed, },
          -
          1200 { "fieldset", element_t::fieldset, },
          -
          1201 { "font", element_t::font, },
          -
          1202 { "form", element_t::form, },
          -
          1203 { "frame", element_t::frame, },
          -
          1204 { "frameset", element_t::frameset, },
          -
          1205 { "h1", element_t::h1, },
          -
          1206 { "h2", element_t::h2, },
          -
          1207 { "h3", element_t::h3, },
          -
          1208 { "h4", element_t::h4, },
          -
          1209 { "h5", element_t::h5, },
          -
          1210 { "h6", element_t::h6, },
          -
          1211 { "head", element_t::head, },
          -
          1212 { "hr", element_t::hr, },
          -
          1213 { "html", element_t::html, },
          -
          1214 { "i", element_t::i, },
          -
          1215 { "iframe", element_t::iframe, },
          -
          1216 { "img", element_t::img, },
          -
          1217 { "input", element_t::input, },
          -
          1218 { "ins", element_t::ins, },
          -
          1219 { "isindex", element_t::isindex, },
          -
          1220 { "kbd", element_t::kbd, },
          -
          1221 { "label", element_t::label, },
          -
          1222 { "legend", element_t::legend, },
          -
          1223 { "li", element_t::li, },
          -
          1224 { "link", element_t::link, },
          -
          1225 { "listing", element_t::listing, },
          -
          1226 { "map", element_t::map, },
          -
          1227 { "marquee", element_t::marquee, },
          -
          1228 { "menu", element_t::menu, },
          -
          1229 { "meta", element_t::meta, },
          -
          1230 { "nextid", element_t::nextid, },
          -
          1231 { "nobr", element_t::nobr, },
          -
          1232 { "noembed", element_t::noembed, },
          -
          1233 { "noframes", element_t::noframes, },
          -
          1234 { "noscript", element_t::noscript, },
          -
          1235 { "object", element_t::object, },
          -
          1236 { "ol", element_t::ol, },
          -
          1237 { "optgroup", element_t::optgroup, },
          -
          1238 { "option", element_t::option, },
          -
          1239 { "p", element_t::p, },
          -
          1240 { "param", element_t::param, },
          -
          1241 { "plaintext", element_t::plaintext, },
          -
          1242 { "pre", element_t::pre, },
          -
          1243 { "q", element_t::q, },
          -
          1244 { "rt", element_t::rt, },
          -
          1245 { "ruby", element_t::ruby, },
          -
          1246 { "s", element_t::s, },
          -
          1247 { "samp", element_t::samp, },
          -
          1248 { "script", element_t::script, },
          -
          1249 { "select", element_t::select, },
          -
          1250 { "small", element_t::small, },
          -
          1251 { "span", element_t::span, },
          -
          1252 { "strike", element_t::strike, },
          -
          1253 { "strong", element_t::strong, },
          -
          1254 { "style", element_t::style, },
          -
          1255 { "sub", element_t::sub, },
          -
          1256 { "sup", element_t::sup, },
          -
          1257 { "table", element_t::table, },
          -
          1258 { "tbody", element_t::tbody, },
          -
          1259 { "td", element_t::td, },
          -
          1260 { "textarea", element_t::textarea, },
          -
          1261 { "tfoot", element_t::tfoot, },
          -
          1262 { "th", element_t::th, },
          -
          1263 { "thead", element_t::thead, },
          -
          1264 { "title", element_t::title, },
          -
          1265 { "tr", element_t::tr, },
          -
          1266 { "tt", element_t::tt, },
          -
          1267 { "u", element_t::u, },
          -
          1268 { "ul", element_t::ul, },
          -
          1269 { "var", element_t::var, },
          -
          1270 { "wbr", element_t::wbr, },
          -
          1271 { "xmp", element_t::xmp, },
          -
          1272 };
          -
          1273#ifdef _DEBUG
          -
          1274 // The mapping table MUST be sorted and all names in lowercase.
          -
          1275 for (size_t i = 1; i < _countof(mapping); i++)
          -
          1276 _Assume_(stdex::strcmp(mapping[i - 1].name, mapping[i].name) <= 0);
          -
          1277 for (size_t i = 0; i < _countof(mapping); i++) {
          -
          1278 for (size_t j = 0; mapping[i].name[j]; j++)
          -
          1279 _Assume_(stdex::islower(mapping[i].name[j]) | stdex::isdigit(mapping[i].name[j]));
          -
          1280 }
          -
          1281#endif
          -
          1282 for (size_t i = 0, j = _countof(mapping); i < j; ) {
          -
          1283 size_t m = (i + j) / 2;
          -
          1284 int r = 0;
          -
          1285 for (size_t i1 = 0, i2 = 0;;) {
          -
          1286 if (!mapping[m].name[i1]) {
          -
          1287 r = i2 >= num_chars || !name[i2] ? 0 : -1;
          -
          1288 break;
          -
          1289 }
          -
          1290 if (i2 >= num_chars || !name[i2]) {
          -
          1291 r = 1;
          -
          1292 break;
          -
          1293 }
          +
          1209
          +
          1217 template <class T>
          +
          +
          1218 static inline bool is_uri(_In_ element_t code, _In_reads_or_z_opt_(num_chars) const T* attr_name, _In_ size_t num_chars)
          +
          1219 {
          +
          1220 _Assume_(attr_name || !num_chars);
          +
          1221 switch (code) {
          +
          1222 case element_t::a: return !stdex::strnicmp(attr_name, num_chars, "href", SIZE_MAX);
          +
          1223 case element_t::applet: return !stdex::strnicmp(attr_name, num_chars, "code", SIZE_MAX) ||
          +
          1224 !stdex::strnicmp(attr_name, num_chars, "codebase", SIZE_MAX) ||
          +
          1225 !stdex::strnicmp(attr_name, num_chars, "src", SIZE_MAX);
          +
          1226 case element_t::area: return !stdex::strnicmp(attr_name, num_chars, "href", SIZE_MAX);
          +
          1227 case element_t::base: return !stdex::strnicmp(attr_name, num_chars, "href", SIZE_MAX);
          +
          1228 case element_t::bgsound: return !stdex::strnicmp(attr_name, num_chars, "src", SIZE_MAX);
          +
          1229 case element_t::blockquote: return !stdex::strnicmp(attr_name, num_chars, "cite", SIZE_MAX);
          +
          1230 case element_t::body: return !stdex::strnicmp(attr_name, num_chars, "background", SIZE_MAX);
          +
          1231 case element_t::comment: return !stdex::strnicmp(attr_name, num_chars, "data", SIZE_MAX);
          +
          1232 case element_t::del: return !stdex::strnicmp(attr_name, num_chars, "cite", SIZE_MAX);
          +
          1233 case element_t::embed: return !stdex::strnicmp(attr_name, num_chars, "pluginspage", SIZE_MAX) ||
          +
          1234 !stdex::strnicmp(attr_name, num_chars, "src", SIZE_MAX);
          +
          1235 case element_t::form: return !stdex::strnicmp(attr_name, num_chars, "action", SIZE_MAX);
          +
          1236 case element_t::frame: return !stdex::strnicmp(attr_name, num_chars, "longdesc", SIZE_MAX) ||
          +
          1237 !stdex::strnicmp(attr_name, num_chars, "src", SIZE_MAX);
          +
          1238 case element_t::head: return !stdex::strnicmp(attr_name, num_chars, "profile", SIZE_MAX);
          +
          1239 case element_t::iframe: return !stdex::strnicmp(attr_name, num_chars, "longdesc", SIZE_MAX) ||
          +
          1240 !stdex::strnicmp(attr_name, num_chars, "src", SIZE_MAX);
          +
          1241 case element_t::img: return !stdex::strnicmp(attr_name, num_chars, "longdesc", SIZE_MAX) ||
          +
          1242 !stdex::strnicmp(attr_name, num_chars, "lowsrc", SIZE_MAX) ||
          +
          1243 !stdex::strnicmp(attr_name, num_chars, "src", SIZE_MAX) ||
          +
          1244 !stdex::strnicmp(attr_name, num_chars, "usemap", SIZE_MAX);
          +
          1245 case element_t::input: return !stdex::strnicmp(attr_name, num_chars, "lowsrc", SIZE_MAX) ||
          +
          1246 !stdex::strnicmp(attr_name, num_chars, "src", SIZE_MAX) ||
          +
          1247 !stdex::strnicmp(attr_name, num_chars, "usemap", SIZE_MAX);
          +
          1248 case element_t::ins: return !stdex::strnicmp(attr_name, num_chars, "cite", SIZE_MAX);
          +
          1249 case element_t::link: return !stdex::strnicmp(attr_name, num_chars, "href", SIZE_MAX);
          +
          1250 case element_t::object: return !stdex::strnicmp(attr_name, num_chars, "basehref", SIZE_MAX) ||
          +
          1251 !stdex::strnicmp(attr_name, num_chars, "classid", SIZE_MAX) ||
          +
          1252 !stdex::strnicmp(attr_name, num_chars, "code", SIZE_MAX) ||
          +
          1253 !stdex::strnicmp(attr_name, num_chars, "codebase", SIZE_MAX) ||
          +
          1254 !stdex::strnicmp(attr_name, num_chars, "data", SIZE_MAX) ||
          +
          1255 !stdex::strnicmp(attr_name, num_chars, "usemap", SIZE_MAX);
          +
          1256 case element_t::q: return !stdex::strnicmp(attr_name, num_chars, "cite", SIZE_MAX);
          +
          1257 case element_t::script: return !stdex::strnicmp(attr_name, num_chars, "src", SIZE_MAX);
          +
          1258 case element_t::table: return !stdex::strnicmp(attr_name, num_chars, "background", SIZE_MAX);
          +
          1259 case element_t::td: return !stdex::strnicmp(attr_name, num_chars, "background", SIZE_MAX);
          +
          1260 case element_t::th: return !stdex::strnicmp(attr_name, num_chars, "background", SIZE_MAX);
          +
          1261 }
          +
          1262 return false;
          +
          1263 }
          +
          +
          1264
          +
          1272 template <class T>
          +
          +
          1273 static inline bool is_localizable(element_t code, const T* attr_name, size_t num_chars)
          +
          1274 {
          +
          1275 _Assume_(attr_name || !num_chars);
          +
          1276 if (!stdex::strnicmp(attr_name, num_chars, "title", SIZE_MAX))
          +
          1277 return true;
          +
          1278 switch (code) {
          +
          1279 case element_t::applet: return !stdex::strnicmp(attr_name, num_chars, "alt", SIZE_MAX);
          +
          1280 case element_t::area: return !stdex::strnicmp(attr_name, num_chars, "alt", SIZE_MAX);
          +
          1281 case element_t::img: return !stdex::strnicmp(attr_name, num_chars, "alt", SIZE_MAX);
          +
          1282 case element_t::input: return !stdex::strnicmp(attr_name, num_chars, "alt", SIZE_MAX);
          +
          1283 case element_t::object: return !stdex::strnicmp(attr_name, num_chars, "alt", SIZE_MAX);
          +
          1284 case element_t::table: return !stdex::strnicmp(attr_name, num_chars, "summary", SIZE_MAX);
          +
          1285 case element_t::td: return !stdex::strnicmp(attr_name, num_chars, "abbr", SIZE_MAX);
          +
          1286 case element_t::th: return !stdex::strnicmp(attr_name, num_chars, "abbr", SIZE_MAX);
          +
          1287 }
          +
          1288 return false;
          +
          1289 }
          +
          +
          1290 };
          +
          +
          1291
          +
          1292 class sequence;
          +
          1293 using sequence_store = std::vector<std::unique_ptr<sequence>>;
          1294
          -
          1295 auto chr = static_cast<char>(stdex::tolower(name[i2++]));
          -
          1296 if (mapping[m].name[i1] > chr) {
          -
          1297 r = 1;
          -
          1298 break;
          -
          1299 }
          -
          1300 if (mapping[m].name[i1] < chr) {
          -
          1301 r = -1;
          -
          1302 break;
          -
          1303 }
          -
          1304 i1++;
          -
          1305 }
          -
          1306
          -
          1307 if (r < 0)
          -
          1308 i = m + 1;
          -
          1309 else if (r > 0)
          -
          1310 j = m;
          -
          1311 else
          -
          1312 return mapping[m].code;
          -
          1313 }
          -
          1314 return element_t::unknown;
          -
          1315 }
          -
          1316
          -
          1317 public:
          -
          1318 element_t code;
          - -
          1320 std::vector<stdex::parser::html_attribute> attributes;
          -
          1321 };
          +
          + +
          1299 {
          +
          1300 public:
          +
          1301 stdex::parser::html_sequence_t type;
          + + +
          1304
          +
          1305 sequence(_In_ stdex::parser::html_sequence_t _type = stdex::parser::html_sequence_t::unknown, _In_ size_t start = 0, size_t end = 0, _In_opt_ sequence* _parent = nullptr) :
          +
          1306 type(_type),
          +
          1307 interval(start, end),
          +
          1308 parent(_parent)
          +
          1309 {}
          +
          1310
          +
          1311 virtual ~sequence() {} // make polymorphic
          +
          1312 };
          -
          1322
          -
          1323 class element_end;
          -
          1324
          -
          -
          1328 class element_start : public element
          -
          1329 {
          -
          1330 public:
          -
          1331 template <class T>
          -
          1332 inline element_start(_Inout_ stdex::parser::basic_html_tag<T>&& tag, _In_z_ const T* src, _In_opt_ sequence* parent = nullptr, _In_opt_ sequence* _end = nullptr) :
          -
          1333 element(std::move(tag), src, parent),
          -
          1334 end(_end)
          -
          1335 {}
          -
          1336
          -
          1337 public:
          - -
          1339 };
          +
          1313
          +
          +
          1317 class element : public sequence
          +
          1318 {
          +
          1319 public:
          +
          1320 template <class T>
          +
          1321 inline element(_Inout_ stdex::parser::basic_html_tag<T>&& tag, _In_z_ const T* src, _In_opt_ sequence* parent = nullptr) :
          +
          1322 sequence(tag.type, tag.interval.start, tag.interval.end, parent),
          +
          1323 code(element_code(src + tag.name.start, tag.name.size())),
          +
          1324 name(std::move(tag.name)),
          +
          1325 attributes(std::move(tag.attributes))
          +
          1326 {}
          +
          1327
          +
          1328 template <class T>
          +
          1329 static element_t element_code(_In_reads_z_(num_chars) const T* name, size_t num_chars)
          +
          1330 {
          +
          1331 static const struct {
          +
          1332 const char* name;
          +
          1333 element_t code;
          +
          1334 } mapping[] = {
          +
          1335 { "a", element_t::a, },
          +
          1336 { "abbr", element_t::abbr, },
          +
          1337 { "acronym", element_t::acronym, },
          +
          1338 { "address", element_t::address, },
          +
          1339 { "applet", element_t::applet, },
          +
          1340 { "area", element_t::area, },
          +
          1341 { "b", element_t::b, },
          +
          1342 { "base", element_t::base, },
          +
          1343 { "basefont", element_t::basefont, },
          +
          1344 { "bdo", element_t::bdo, },
          +
          1345 { "bgsound", element_t::bgsound, },
          +
          1346 { "big", element_t::big, },
          +
          1347 { "blink", element_t::blink, },
          +
          1348 { "blockquote", element_t::blockquote, },
          +
          1349 { "body", element_t::body, },
          +
          1350 { "br", element_t::br, },
          +
          1351 { "button", element_t::button, },
          +
          1352 { "caption", element_t::caption, },
          +
          1353 { "center", element_t::center, },
          +
          1354 { "cite", element_t::cite, },
          +
          1355 { "code", element_t::code, },
          +
          1356 { "col", element_t::col, },
          +
          1357 { "colgroup", element_t::colgroup, },
          +
          1358 { "comment", element_t::comment, },
          +
          1359 { "dd", element_t::dd, },
          +
          1360 { "del", element_t::del, },
          +
          1361 { "dfn", element_t::dfn, },
          +
          1362 { "dir", element_t::dir, },
          +
          1363 { "div", element_t::div, },
          +
          1364 { "dl", element_t::dl, },
          +
          1365 { "dt", element_t::dt, },
          +
          1366 { "em", element_t::em, },
          +
          1367 { "embed", element_t::embed, },
          +
          1368 { "fieldset", element_t::fieldset, },
          +
          1369 { "font", element_t::font, },
          +
          1370 { "form", element_t::form, },
          +
          1371 { "frame", element_t::frame, },
          +
          1372 { "frameset", element_t::frameset, },
          +
          1373 { "h1", element_t::h1, },
          +
          1374 { "h2", element_t::h2, },
          +
          1375 { "h3", element_t::h3, },
          +
          1376 { "h4", element_t::h4, },
          +
          1377 { "h5", element_t::h5, },
          +
          1378 { "h6", element_t::h6, },
          +
          1379 { "head", element_t::head, },
          +
          1380 { "hr", element_t::hr, },
          +
          1381 { "html", element_t::html, },
          +
          1382 { "i", element_t::i, },
          +
          1383 { "iframe", element_t::iframe, },
          +
          1384 { "img", element_t::img, },
          +
          1385 { "input", element_t::input, },
          +
          1386 { "ins", element_t::ins, },
          +
          1387 { "isindex", element_t::isindex, },
          +
          1388 { "kbd", element_t::kbd, },
          +
          1389 { "label", element_t::label, },
          +
          1390 { "legend", element_t::legend, },
          +
          1391 { "li", element_t::li, },
          +
          1392 { "link", element_t::link, },
          +
          1393 { "listing", element_t::listing, },
          +
          1394 { "map", element_t::map, },
          +
          1395 { "marquee", element_t::marquee, },
          +
          1396 { "menu", element_t::menu, },
          +
          1397 { "meta", element_t::meta, },
          +
          1398 { "nextid", element_t::nextid, },
          +
          1399 { "nobr", element_t::nobr, },
          +
          1400 { "noembed", element_t::noembed, },
          +
          1401 { "noframes", element_t::noframes, },
          +
          1402 { "noscript", element_t::noscript, },
          +
          1403 { "object", element_t::object, },
          +
          1404 { "ol", element_t::ol, },
          +
          1405 { "optgroup", element_t::optgroup, },
          +
          1406 { "option", element_t::option, },
          +
          1407 { "p", element_t::p, },
          +
          1408 { "param", element_t::param, },
          +
          1409 { "plaintext", element_t::plaintext, },
          +
          1410 { "pre", element_t::pre, },
          +
          1411 { "q", element_t::q, },
          +
          1412 { "rt", element_t::rt, },
          +
          1413 { "ruby", element_t::ruby, },
          +
          1414 { "s", element_t::s, },
          +
          1415 { "samp", element_t::samp, },
          +
          1416 { "script", element_t::script, },
          +
          1417 { "select", element_t::select, },
          +
          1418 { "small", element_t::small, },
          +
          1419 { "span", element_t::span, },
          +
          1420 { "strike", element_t::strike, },
          +
          1421 { "strong", element_t::strong, },
          +
          1422 { "style", element_t::style, },
          +
          1423 { "sub", element_t::sub, },
          +
          1424 { "sup", element_t::sup, },
          +
          1425 { "table", element_t::table, },
          +
          1426 { "tbody", element_t::tbody, },
          +
          1427 { "td", element_t::td, },
          +
          1428 { "textarea", element_t::textarea, },
          +
          1429 { "tfoot", element_t::tfoot, },
          +
          1430 { "th", element_t::th, },
          +
          1431 { "thead", element_t::thead, },
          +
          1432 { "title", element_t::title, },
          +
          1433 { "tr", element_t::tr, },
          +
          1434 { "tt", element_t::tt, },
          +
          1435 { "u", element_t::u, },
          +
          1436 { "ul", element_t::ul, },
          +
          1437 { "var", element_t::var, },
          +
          1438 { "wbr", element_t::wbr, },
          +
          1439 { "xmp", element_t::xmp, },
          +
          1440 };
          +
          1441#ifdef _DEBUG
          +
          1442 // The mapping table MUST be sorted and all names in lowercase.
          +
          1443 for (size_t i = 1; i < _countof(mapping); i++)
          +
          1444 _Assume_(stdex::strcmp(mapping[i - 1].name, mapping[i].name) <= 0);
          +
          1445 for (size_t i = 0; i < _countof(mapping); i++) {
          +
          1446 for (size_t j = 0; mapping[i].name[j]; j++)
          +
          1447 _Assume_(stdex::islower(mapping[i].name[j]) | stdex::isdigit(mapping[i].name[j]));
          +
          1448 }
          +
          1449#endif
          +
          1450 for (size_t i = 0, j = _countof(mapping); i < j; ) {
          +
          1451 size_t m = (i + j) / 2;
          +
          1452 int r = 0;
          +
          1453 for (size_t i1 = 0, i2 = 0;;) {
          +
          1454 if (!mapping[m].name[i1]) {
          +
          1455 r = i2 >= num_chars || !name[i2] ? 0 : -1;
          +
          1456 break;
          +
          1457 }
          +
          1458 if (i2 >= num_chars || !name[i2]) {
          +
          1459 r = 1;
          +
          1460 break;
          +
          1461 }
          +
          1462
          +
          1463 auto chr = static_cast<char>(stdex::tolower(name[i2++]));
          +
          1464 if (mapping[m].name[i1] > chr) {
          +
          1465 r = 1;
          +
          1466 break;
          +
          1467 }
          +
          1468 if (mapping[m].name[i1] < chr) {
          +
          1469 r = -1;
          +
          1470 break;
          +
          1471 }
          +
          1472 i1++;
          +
          1473 }
          +
          1474
          +
          1475 if (r < 0)
          +
          1476 i = m + 1;
          +
          1477 else if (r > 0)
          +
          1478 j = m;
          +
          1479 else
          +
          1480 return mapping[m].code;
          +
          1481 }
          +
          1482 return element_t::unknown;
          +
          1483 }
          +
          1484
          +
          1485 public:
          +
          1486 element_t code;
          + +
          1488 std::vector<stdex::parser::html_attribute> attributes;
          +
          1489 };
          -
          1340
          -
          -
          1344 class element_end : public sequence
          -
          1345 {
          -
          1346 public:
          -
          1347 template <class T>
          -
          1348 inline element_end(_Inout_ stdex::parser::basic_html_tag<T>&& tag, _In_z_ const T* src, _In_opt_ sequence* parent = nullptr, _In_opt_ element_start* _start = nullptr) :
          -
          1349 sequence(tag.type, tag.interval.start, tag.interval.end, parent),
          -
          1350 code(element::element_code(src + tag.name.start, tag.name.size())),
          -
          1351 name(std::move(tag.name)),
          -
          1352 start(_start)
          -
          1353 {}
          -
          1354
          -
          1355 public:
          -
          1356 element_t code;
          - - -
          1359 };
          -
          -
          1360
          -
          -
          1364 class declaration : public sequence
          -
          1365 {
          -
          1366 public:
          -
          1367 template <class T>
          -
          1368 inline declaration(_Inout_ stdex::parser::basic_html_tag<T>&& tag, _In_opt_ sequence* parent = nullptr) :
          -
          1369 sequence(tag.type, tag.interval.start, tag.interval.end, parent),
          -
          1370 name(std::move(tag.name)),
          -
          1371 attributes(std::move(tag.attributes))
          -
          1372 {}
          -
          1373
          -
          1374 public:
          - -
          1376 std::vector<stdex::parser::html_attribute> attributes;
          -
          1377 };
          -
          -
          1378
          -
          -
          1382 class comment : public sequence
          -
          1383 {
          -
          1384 public:
          -
          1385 template <class T>
          -
          1386 inline comment(_Inout_ stdex::parser::basic_html_tag<T>&& tag, _In_opt_ sequence* parent = nullptr) :
          -
          1387 sequence(tag.type, tag.interval.start, tag.interval.end, parent),
          -
          1388 content(std::move(tag.name))
          -
          1389 {}
          -
          1390
          -
          1391 public:
          - -
          1393 };
          -
          -
          1394
          -
          -
          1398 class instruction : public sequence
          -
          1399 {
          -
          1400 public:
          -
          1401 template <class T>
          -
          1402 inline instruction(_Inout_ stdex::parser::basic_html_tag<T>&& tag, _In_opt_ sequence* parent = nullptr) :
          -
          1403 sequence(tag.type, tag.interval.start, tag.interval.end, parent),
          -
          1404 content(std::move(tag.name))
          -
          1405 {}
          -
          1406
          -
          1407 public:
          - -
          1409 };
          -
          -
          1410
          -
          1414 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Alloc = std::allocator<_Elem>>
          -
          -
          1415 struct entity
          -
          1416 {
          - -
          1418 std::basic_string<_Elem, _Traits, _Alloc> value;
          -
          1419 };
          -
          -
          1420
          -
          1424 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Alloc = std::allocator<_Elem>>
          -
          1425 class parser;
          -
          1426
          -
          1430 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Alloc = std::allocator<_Elem>>
          -
          - -
          1432 {
          -
          1433 public:
          -
          1434 document() :
          -
          1435 m_num_parsed(0),
          -
          1436 m_charset(stdex::charset_id::system),
          -
          1437
          -
          1438 // Declaration parsing data
          - - -
          1441 m_is_cdata(false),
          -
          1442 m_is_rcdata(false),
          -
          1443
          -
          1444 // Element parsing data
          - -
          1446 {}
          -
          1447
          -
          -
          1451 void clear()
          -
          1452 {
          -
          1453 m_source.clear();
          -
          1454 m_num_parsed = 0;
          -
          1455 m_charset = stdex::charset_id::system;
          -
          1456
          -
          1457 // Declaration parsing data
          - -
          1459 m_is_cdata = m_is_rcdata = false;
          -
          1460 m_entities.clear();
          -
          1461
          -
          1462 // Element parsing data
          -
          1463 m_sequences.clear();
          -
          1464
          -
          1465 m_element_stack.clear();
          -
          1466 m_is_special_element = false;
          -
          1467 }
          -
          -
          1468
          -
          -
          1472 void append(_In_reads_or_z_opt_(num_chars) const _Elem* source, _In_ size_t num_chars = SIZE_MAX)
          -
          1473 {
          -
          1474 _Assume_(source || !num_chars);
          -
          1475 m_source.append(source, stdex::strnlen(source, num_chars));
          -
          1476 source = m_source.data();
          -
          1477 num_chars = m_source.size();
          -
          1478
          -
          1479 for (size_t i = m_num_parsed; i < num_chars;) {
          -
          1480 if (m_is_cdata || m_is_rcdata) {
          -
          1481 if (m_condition_end.match(source, i, num_chars)) {
          -
          1482 m_sequences.push_back(std::move(std::unique_ptr<sequence>(new sequence(
          -
          1483 m_is_cdata ? stdex::parser::html_sequence_t::CDATA : stdex::parser::html_sequence_t::PCDATA,
          -
          1484 m_num_parsed, i,
          -
          1485 active_element()))));
          -
          1486 m_is_cdata = m_is_rcdata = false;
          -
          1487 i = m_num_parsed = m_condition_end.interval.end;
          -
          1488 continue;
          -
          1489 }
          -
          1490 goto next_char;
          -
          1491 }
          +
          1490
          +
          1491 class element_end;
          1492
          - -
          1494 if (m_condition_end.match(source, i, num_chars)) {
          - -
          1496 i = m_num_parsed = m_condition_end.interval.end;
          -
          1497 continue;
          -
          1498 }
          -
          1499 goto next_char;
          -
          1500 }
          -
          1501
          -
          1502 if (m_num_valid_conditions && m_condition_end.match(source, i, num_chars)) {
          -
          1503 if (m_num_parsed < i)
          -
          1504 m_sequences.push_back(std::move(std::unique_ptr<sequence>(new sequence(stdex::parser::html_sequence_t::text, m_num_parsed, i, active_element()))));
          -
          1505
          - -
          1507 i = m_num_parsed = m_condition_end.interval.end;
          -
          1508 continue;
          -
          1509 }
          -
          1510
          -
          1511 if (m_condition_start.match(source, i, num_chars)) {
          -
          1512 auto condition_src(replace_entities(source + m_condition_start.condition.start, m_condition_start.condition.size()));
          -
          1513 if (!stdex::strcmp(condition_src.c_str(), "CDATA"))
          -
          1514 m_is_cdata = true;
          -
          1515 else if (!stdex::strcmp(condition_src.c_str(), "RCDATA"))
          -
          1516 m_is_rcdata = true;
          - - -
          1519 else if (!stdex::strcmp(condition_src.c_str(), "IGNORE"))
          - -
          1521 else
          - -
          1523
          -
          1524 i = m_num_parsed = m_condition_start.interval.end;
          -
          1525 continue;
          -
          1526 }
          -
          1527
          - -
          1529 auto parent = active_element();
          -
          1530 _Assume_(parent);
          -
          1531 if (m_tag.match(source, i, num_chars) &&
          -
          1532 m_tag.type == stdex::parser::html_sequence_t::element_end &&
          -
          1533 element::element_code(source + m_tag.name.start, m_tag.name.size()) == parent->code)
          -
          1534 {
          -
          1535 if (m_num_parsed < i)
          -
          1536 m_sequences.push_back(std::move(std::unique_ptr<sequence>(new sequence(stdex::parser::html_sequence_t::text, m_num_parsed, i, parent))));
          -
          1537 i = m_num_parsed = m_tag.interval.end;
          -
          1538 std::unique_ptr<element_end> e(new element_end(std::move(m_tag), source, parent->parent, parent));
          -
          1539 parent->end = e.get();
          -
          1540 m_sequences.push_back(std::move(e));
          -
          1541 m_element_stack.pop_back();
          -
          1542 m_is_special_element = false;
          -
          1543 continue;
          -
          1544 }
          -
          1545 goto next_char;
          -
          1546 }
          -
          1547
          -
          1548 if (m_tag.match(source, i, num_chars)) {
          -
          1549 if (m_num_parsed < i)
          -
          1550 m_sequences.push_back(std::move(std::unique_ptr<sequence>(new sequence(stdex::parser::html_sequence_t::text, m_num_parsed, i, active_element()))));
          -
          1551 i = m_num_parsed = m_tag.interval.end;
          -
          1552
          -
          1553 switch (m_tag.type) {
          -
          1554 case stdex::parser::html_sequence_t::element:
          -
          1555 case stdex::parser::html_sequence_t::element_start: {
          -
          1556 std::unique_ptr<element> e(
          -
          1557 m_tag.type == stdex::parser::html_sequence_t::element ? new element(std::move(m_tag), source) :
          -
          1558 m_tag.type == stdex::parser::html_sequence_t::element_start ? new element_start(std::move(m_tag), source) :
          -
          1559 nullptr);
          -
          1560
          -
          1561 // Does this tag end any of the started elements?
          -
          1562 for (size_t j = m_element_stack.size(); j--; ) {
          -
          1563 auto starting_tag = m_element_stack[j];
          -
          1564 _Assume_(starting_tag && starting_tag->type == stdex::parser::html_sequence_t::element_start);
          -
          1565 if (element_traits::may_contain(starting_tag->code, e->code)) {
          -
          1566 e->parent = starting_tag;
          -
          1567 break;
          -
          1568 }
          -
          1569 e->parent = starting_tag->parent;
          -
          1570 starting_tag->end = e.get();
          -
          1571 m_element_stack.resize(j);
          -
          1572 }
          -
          1573
          -
          1574 if (e->type == stdex::parser::html_sequence_t::element_start) {
          -
          1575 auto e_start = static_cast<element_start*>(e.get());
          -
          1576 if (element_traits::span(e->code) == element_span_t::immediate)
          -
          1577 e_start->end = e.get();
          -
          1578 else {
          -
          1579 m_element_stack.push_back(e_start);
          -
          1580 switch (e->code) {
          -
          1581 case element_t::code:
          -
          1582 case element_t::comment:
          -
          1583 case element_t::script:
          -
          1584 case element_t::style:
          -
          1585 m_is_special_element = true;
          -
          1586 break;
          -
          1587 }
          -
          1588 }
          -
          1589 }
          -
          1590
          -
          1591 if (e->code == element_t::meta && m_charset == stdex::charset_id::system) {
          -
          1592 bool is_content_type = false;
          -
          1593 stdex::parser::html_attribute* content_attr = nullptr;
          -
          1594 for (auto& attr : e->attributes) {
          -
          1595 if (!stdex::strnicmp(source + attr.name.start, attr.name.size(), "http-equiv", SIZE_MAX) &&
          -
          1596 !stdex::strnicmp(source + attr.value.start, attr.value.size(), "content-type", SIZE_MAX))
          -
          1597 is_content_type = true;
          -
          1598 else if (!stdex::strnicmp(source + attr.name.start, attr.name.size(), "content", SIZE_MAX))
          -
          1599 content_attr = &attr;
          -
          1600 }
          -
          1601 if (is_content_type && content_attr) {
          -
          1602 // <meta http-equiv="Content-Type" content="..."> found.
          - -
          1604 if (content.match(source, content_attr->value.start, content_attr->value.end) &&
          -
          1605 content.charset)
          -
          1606 {
          -
          1607 std::string str;
          -
          1608 str.reserve(content.charset.size());
          -
          1609 for (size_t j = content.charset.start; j < content.charset.end; ++j)
          -
          1610 str.push_back(static_cast<char>(source[j]));
          -
          1611 m_charset = stdex::charset_from_name(str.c_str());
          -
          1612 }
          -
          1613 }
          -
          1614 }
          +
          +
          1496 class element_start : public element
          +
          1497 {
          +
          1498 public:
          +
          1499 template <class T>
          +
          1500 inline element_start(_Inout_ stdex::parser::basic_html_tag<T>&& tag, _In_z_ const T* src, _In_opt_ sequence* parent = nullptr, _In_opt_ sequence* _end = nullptr) :
          +
          1501 element(std::move(tag), src, parent),
          +
          1502 end(_end)
          +
          1503 {}
          +
          1504
          +
          1505 public:
          + +
          1507 };
          +
          +
          1508
          +
          +
          1512 class element_end : public sequence
          +
          1513 {
          +
          1514 public:
          +
          1515 template <class T>
          +
          1516 inline element_end(_Inout_ stdex::parser::basic_html_tag<T>&& tag, _In_z_ const T* src, _In_opt_ sequence* parent = nullptr, _In_opt_ element_start* _start = nullptr) :
          +
          1517 sequence(tag.type, tag.interval.start, tag.interval.end, parent),
          +
          1518 code(element::element_code(src + tag.name.start, tag.name.size())),
          +
          1519 name(std::move(tag.name)),
          +
          1520 start(_start)
          +
          1521 {}
          +
          1522
          +
          1523 public:
          +
          1524 element_t code;
          + + +
          1527 };
          +
          +
          1528
          +
          +
          1532 class declaration : public sequence
          +
          1533 {
          +
          1534 public:
          +
          1535 template <class T>
          +
          1536 inline declaration(_Inout_ stdex::parser::basic_html_tag<T>&& tag, _In_opt_ sequence* parent = nullptr) :
          +
          1537 sequence(tag.type, tag.interval.start, tag.interval.end, parent),
          +
          1538 name(std::move(tag.name)),
          +
          1539 attributes(std::move(tag.attributes))
          +
          1540 {}
          +
          1541
          +
          1542 public:
          + +
          1544 std::vector<stdex::parser::html_attribute> attributes;
          +
          1545 };
          +
          +
          1546
          +
          +
          1550 class comment : public sequence
          +
          1551 {
          +
          1552 public:
          +
          1553 template <class T>
          +
          1554 inline comment(_Inout_ stdex::parser::basic_html_tag<T>&& tag, _In_opt_ sequence* parent = nullptr) :
          +
          1555 sequence(tag.type, tag.interval.start, tag.interval.end, parent),
          +
          1556 content(std::move(tag.name))
          +
          1557 {}
          +
          1558
          +
          1559 public:
          + +
          1561 };
          +
          +
          1562
          +
          +
          1566 class instruction : public sequence
          +
          1567 {
          +
          1568 public:
          +
          1569 template <class T>
          +
          1570 inline instruction(_Inout_ stdex::parser::basic_html_tag<T>&& tag, _In_opt_ sequence* parent = nullptr) :
          +
          1571 sequence(tag.type, tag.interval.start, tag.interval.end, parent),
          +
          1572 content(std::move(tag.name))
          +
          1573 {}
          +
          1574
          +
          1575 public:
          + +
          1577 };
          +
          +
          1578
          +
          1582 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Alloc = std::allocator<_Elem>>
          +
          +
          1583 struct entity
          +
          1584 {
          + +
          1586 std::basic_string<_Elem, _Traits, _Alloc> value;
          +
          1587 };
          +
          +
          1588
          +
          1592 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Alloc = std::allocator<_Elem>>
          +
          1593 class parser;
          +
          1594
          +
          1598 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Alloc = std::allocator<_Elem>>
          +
          + +
          1600 {
          +
          1601 public:
          +
          1602 document() :
          +
          1603 m_num_parsed(0),
          +
          1604 m_charset(stdex::charset_id::system),
          +
          1605
          +
          1606 // Declaration parsing data
          + + +
          1609 m_is_cdata(false),
          +
          1610 m_is_rcdata(false),
          +
          1611
          +
          1612 // Element parsing data
          + +
          1614 {}
          1615
          -
          1616 m_sequences.push_back(std::move(e));
          -
          1617 break;
          -
          1618 }
          -
          1619 case stdex::parser::html_sequence_t::element_end: {
          -
          1620 std::unique_ptr<element_end> e(new element_end(std::move(m_tag), source, active_element()));
          -
          1621
          -
          1622 for (size_t j = m_element_stack.size(); j--; ) {
          -
          1623 auto starting_tag = m_element_stack[j];
          -
          1624 _Assume_(starting_tag && starting_tag->type == stdex::parser::html_sequence_t::element_start);
          -
          1625 if (starting_tag->code == e->code ||
          -
          1626 starting_tag->code == element_t::unknown && e->code == element_t::unknown && !stdex::strnicmp(source + starting_tag->name.start, starting_tag->name.size(), source + e->name.start, e->name.size()))
          -
          1627 {
          -
          1628 e->start = starting_tag;
          -
          1629 e->parent = starting_tag->parent;
          -
          1630 starting_tag->end = e.get();
          -
          1631 m_element_stack.resize(j);
          -
          1632 break;
          -
          1633 }
          -
          1634 }
          -
          1635
          -
          1636 m_sequences.push_back(std::move(e));
          -
          1637 break;
          -
          1638 }
          -
          1639 case stdex::parser::html_sequence_t::declaration:
          -
          1640 if (m_tag.attributes.size() > 3 &&
          -
          1641 !stdex::strnicmp(source + m_tag.attributes[0].name.start, m_tag.attributes[0].name.size(), "entity", SIZE_MAX))
          -
          1642 {
          -
          1643 if (!stdex::strncmp(source + m_tag.attributes[1].name.start, m_tag.attributes[1].name.size(), "%", SIZE_MAX) &&
          -
          1644 stdex::strncmp(source + m_tag.attributes[3].name.start, m_tag.attributes[3].name.size(), "SYSTEM", SIZE_MAX) &&
          -
          1645 stdex::strncmp(source + m_tag.attributes[3].name.start, m_tag.attributes[3].name.size(), "PUBLIC", SIZE_MAX))
          -
          1646 {
          -
          1647 std::unique_ptr<entity<_Elem, _Traits, _Alloc>> e(new entity<_Elem, _Traits, _Alloc>());
          -
          1648 e->name = m_tag.attributes[2].name;
          -
          1649 e->value = std::move(replace_entities(source + m_tag.attributes[3].name.start, m_tag.attributes[3].name.size()));
          -
          1650 m_entities.push_back(std::move(e));
          -
          1651 }
          -
          1652
          -
          1653 // TODO: Parse & entities and entities in SYSTEM and PUBLIC external files.
          -
          1654 }
          -
          1655 m_sequences.push_back(std::move(std::unique_ptr<sequence>(new declaration(std::move(m_tag), active_element()))));
          -
          1656 break;
          -
          1657 case stdex::parser::html_sequence_t::comment:
          -
          1658 m_sequences.push_back(std::move(std::unique_ptr<sequence>(new comment(std::move(m_tag), active_element()))));
          -
          1659 break;
          -
          1660 case stdex::parser::html_sequence_t::instruction:
          -
          1661 m_sequences.push_back(std::move(std::unique_ptr<sequence>(new instruction(std::move(m_tag), active_element()))));
          -
          1662 break;
          -
          1663 default:
          -
          1664 throw std::invalid_argument("unknown tag type");
          -
          1665 }
          -
          1666
          -
          1667 continue;
          +
          +
          1619 void clear()
          +
          1620 {
          +
          1621 m_source.clear();
          +
          1622 m_num_parsed = 0;
          +
          1623 m_charset = stdex::charset_id::system;
          +
          1624
          +
          1625 // Declaration parsing data
          + +
          1627 m_is_cdata = m_is_rcdata = false;
          +
          1628 m_entities.clear();
          +
          1629
          +
          1630 // Element parsing data
          +
          1631 m_sequences.clear();
          +
          1632
          +
          1633 m_element_stack.clear();
          +
          1634 m_is_special_element = false;
          +
          1635 }
          +
          +
          1636
          +
          +
          1640 void append(_In_reads_or_z_opt_(num_chars) const _Elem* source, _In_ size_t num_chars)
          +
          1641 {
          +
          1642 _Assume_(source || !num_chars);
          +
          1643 m_source.append(source, stdex::strnlen(source, num_chars));
          +
          1644 source = m_source.data();
          +
          1645 num_chars = m_source.size();
          +
          1646
          +
          1647 for (size_t i = m_num_parsed; i < num_chars;) {
          +
          1648 if (m_is_cdata || m_is_rcdata) {
          +
          1649 if (m_condition_end.match(source, i, num_chars)) {
          +
          1650 m_sequences.push_back(std::move(std::unique_ptr<sequence>(new sequence(
          +
          1651 m_is_cdata ? stdex::parser::html_sequence_t::CDATA : stdex::parser::html_sequence_t::PCDATA,
          +
          1652 m_num_parsed, i,
          +
          1653 active_element()))));
          +
          1654 m_is_cdata = m_is_rcdata = false;
          +
          1655 i = m_num_parsed = m_condition_end.interval.end;
          +
          1656 continue;
          +
          1657 }
          +
          1658 goto next_char;
          +
          1659 }
          +
          1660
          + +
          1662 if (m_condition_end.match(source, i, num_chars)) {
          + +
          1664 i = m_num_parsed = m_condition_end.interval.end;
          +
          1665 continue;
          +
          1666 }
          +
          1667 goto next_char;
          1668 }
          1669
          -
          1670 next_char:
          -
          1671 if (m_any_char.match(source, i, num_chars)) {
          -
          1672 // Skip any character, but don't declare it as parsed yet. It might be a part of unfinished tag.
          -
          1673 i = m_any_char.interval.end;
          -
          1674 }
          -
          1675 else
          -
          1676 break;
          -
          1677 }
          -
          1678 }
          -
          -
          1679
          -
          - -
          1684 {
          -
          1685 size_t i = m_source.size();
          -
          1686 if (m_num_parsed < i)
          -
          1687 m_sequences.push_back(std::move(std::unique_ptr<sequence>(new sequence(stdex::parser::html_sequence_t::text, m_num_parsed, i, active_element()))));
          -
          1688 m_num_parsed = i;
          -
          1689 m_element_stack.clear();
          -
          1690 }
          -
          +
          1670 if (m_num_valid_conditions && m_condition_end.match(source, i, num_chars)) {
          +
          1671 if (m_num_parsed < i)
          +
          1672 m_sequences.push_back(std::move(std::unique_ptr<sequence>(new sequence(stdex::parser::html_sequence_t::text, m_num_parsed, i, active_element()))));
          +
          1673
          + +
          1675 i = m_num_parsed = m_condition_end.interval.end;
          +
          1676 continue;
          +
          1677 }
          +
          1678
          +
          1679 if (m_condition_start.match(source, i, num_chars)) {
          +
          1680 auto condition_src(replace_entities(source + m_condition_start.condition.start, m_condition_start.condition.size()));
          +
          1681 if (!stdex::strcmp(condition_src.c_str(), "CDATA"))
          +
          1682 m_is_cdata = true;
          +
          1683 else if (!stdex::strcmp(condition_src.c_str(), "RCDATA"))
          +
          1684 m_is_rcdata = true;
          + + +
          1687 else if (!stdex::strcmp(condition_src.c_str(), "IGNORE"))
          + +
          1689 else
          +
          1691
          -
          -
          1695 inline void assign(_In_reads_or_z_opt_(num_chars) const _Elem* source, _In_ size_t num_chars = SIZE_MAX)
          -
          1696 {
          -
          1697 clear();
          -
          1698 append(source, num_chars);
          -
          1699 finalize();
          -
          1700 }
          -
          -
          1701
          -
          1705 inline const std::basic_string<_Elem, _Traits, _Alloc>& source() const { return m_source; }
          -
          1706
          -
          1707 friend class parser<_Elem, _Traits, _Alloc>;
          -
          1708
          -
          1709 protected:
          -
          - -
          1714 {
          -
          1715 return m_element_stack.empty() ? nullptr : m_element_stack.back();
          -
          1716 }
          -
          -
          1717
          -
          -
          1721 std::basic_string<_Elem, _Traits, _Alloc> replace_entities(_In_reads_or_z_opt_(num_chars) const _Elem* input, _In_ size_t num_chars) const
          -
          1722 {
          -
          1723 _Assume_(input || !num_chars);
          -
          1724 const size_t num_entities = m_entities.size();
          -
          1725 const _Elem* source = m_source.data();
          -
          1726 std::basic_string<_Elem, _Traits, _Alloc> output;
          -
          1727 for (size_t i = 0; i < num_chars && input[i];) {
          -
          1728 if (input[i] == '%') {
          -
          1729 for (size_t j = 0; j < num_entities; j++) {
          -
          1730 auto& e = m_entities[j];
          -
          1731 size_t entity_size = e->name.size();
          -
          1732 if (i + entity_size + 1 < num_chars &&
          -
          1733 !stdex::strncmp(input + i + 1, source + e->name.start, entity_size) &&
          -
          1734 input[i + entity_size + 1] == ';')
          -
          1735 {
          -
          1736 output += e->value;
          -
          1737 i += entity_size + 2;
          -
          1738 goto next_char;
          -
          1739 }
          -
          1740 }
          -
          1741 throw std::runtime_error("undefined entity");
          -
          1742 }
          -
          1743 output += input[i++];
          -
          1744 next_char:;
          -
          1745 }
          -
          1746 return output;
          -
          1747 }
          -
          -
          1748
          -
          1749 protected:
          -
          1750 std::basic_string<_Elem, _Traits, _Alloc> m_source;
          - -
          1752 stdex::charset_id m_charset;
          -
          1753
          -
          1754 // Declaration parsing data
          - - - - - - - -
          1762 std::vector<std::unique_ptr<entity<_Elem, _Traits, _Alloc>>> m_entities;
          -
          1763
          -
          1764 // Element parsing data
          - -
          1766 sequence_store m_sequences;
          -
          1767 std::vector<element_start*> m_element_stack;
          - -
          1769 };
          -
          -
          1770
          -
          1774 enum class token_t {
          -
          1775 root = 0,
          -
          1776 complete,
          -
          1777 starting,
          -
          1778 ending,
          -
          1779 url,
          -
          1780 };
          -
          1781
          -
          1785 constexpr size_t token_tag_max =
          -
          1786 sizeof(void*) * 2 // Memory address in hexadecimal
          -
          1787 + 2 // Leading and trailing parenthesis
          -
          1788 + 1; // Zero terminator
          +
          1692 i = m_num_parsed = m_condition_start.interval.end;
          +
          1693 continue;
          +
          1694 }
          +
          1695
          + +
          1697 auto parent = active_element();
          +
          1698 _Assume_(parent);
          +
          1699 if (m_tag.match(source, i, num_chars) &&
          +
          1700 m_tag.type == stdex::parser::html_sequence_t::element_end &&
          +
          1701 element::element_code(source + m_tag.name.start, m_tag.name.size()) == parent->code)
          +
          1702 {
          +
          1703 if (m_num_parsed < i)
          +
          1704 m_sequences.push_back(std::move(std::unique_ptr<sequence>(new sequence(stdex::parser::html_sequence_t::text, m_num_parsed, i, parent))));
          +
          1705 i = m_num_parsed = m_tag.interval.end;
          +
          1706 std::unique_ptr<element_end> e(new element_end(std::move(m_tag), source, parent->parent, parent));
          +
          1707 parent->end = e.get();
          +
          1708 m_sequences.push_back(std::move(e));
          +
          1709 m_element_stack.pop_back();
          +
          1710 m_is_special_element = false;
          +
          1711 continue;
          +
          1712 }
          +
          1713 goto next_char;
          +
          1714 }
          +
          1715
          +
          1716 if (m_tag.match(source, i, num_chars)) {
          +
          1717 if (m_num_parsed < i)
          +
          1718 m_sequences.push_back(std::move(std::unique_ptr<sequence>(new sequence(stdex::parser::html_sequence_t::text, m_num_parsed, i, active_element()))));
          +
          1719 i = m_num_parsed = m_tag.interval.end;
          +
          1720
          +
          1721 switch (m_tag.type) {
          +
          1722 case stdex::parser::html_sequence_t::element:
          +
          1723 case stdex::parser::html_sequence_t::element_start: {
          +
          1724 std::unique_ptr<element> e(
          +
          1725 m_tag.type == stdex::parser::html_sequence_t::element ? new element(std::move(m_tag), source) :
          +
          1726 m_tag.type == stdex::parser::html_sequence_t::element_start ? new element_start(std::move(m_tag), source) :
          +
          1727 nullptr);
          +
          1728
          +
          1729 // Does this tag end any of the started elements?
          +
          1730 for (size_t j = m_element_stack.size(); j--; ) {
          +
          1731 auto starting_tag = m_element_stack[j];
          +
          1732 _Assume_(starting_tag && starting_tag->type == stdex::parser::html_sequence_t::element_start);
          +
          1733 if (element_traits::may_contain(starting_tag->code, e->code)) {
          +
          1734 e->parent = starting_tag;
          +
          1735 break;
          +
          1736 }
          +
          1737 e->parent = starting_tag->parent;
          +
          1738 starting_tag->end = e.get();
          +
          1739 m_element_stack.resize(j);
          +
          1740 }
          +
          1741
          +
          1742 if (e->type == stdex::parser::html_sequence_t::element_start) {
          +
          1743 auto e_start = static_cast<element_start*>(e.get());
          +
          1744 if (element_traits::span(e->code) == element_span_t::immediate)
          +
          1745 e_start->end = e.get();
          +
          1746 else {
          +
          1747 m_element_stack.push_back(e_start);
          +
          1748 switch (e->code) {
          +
          1749 case element_t::code:
          +
          1750 case element_t::comment:
          +
          1751 case element_t::script:
          +
          1752 case element_t::style:
          +
          1753 m_is_special_element = true;
          +
          1754 break;
          +
          1755 }
          +
          1756 }
          +
          1757 }
          +
          1758
          +
          1759 if (e->code == element_t::meta && m_charset == stdex::charset_id::system) {
          +
          1760 bool is_content_type = false;
          +
          1761 stdex::parser::html_attribute* content_attr = nullptr;
          +
          1762 for (auto& attr : e->attributes) {
          +
          1763 if (!stdex::strnicmp(source + attr.name.start, attr.name.size(), "http-equiv", SIZE_MAX) &&
          +
          1764 !stdex::strnicmp(source + attr.value.start, attr.value.size(), "content-type", SIZE_MAX))
          +
          1765 is_content_type = true;
          +
          1766 else if (!stdex::strnicmp(source + attr.name.start, attr.name.size(), "content", SIZE_MAX))
          +
          1767 content_attr = &attr;
          +
          1768 }
          +
          1769 if (is_content_type && content_attr) {
          +
          1770 // <meta http-equiv="Content-Type" content="..."> found.
          + +
          1772 if (content.match(source, content_attr->value.start, content_attr->value.end) &&
          +
          1773 content.charset)
          +
          1774 {
          +
          1775 std::string str;
          +
          1776 str.reserve(content.charset.size());
          +
          1777 for (size_t j = content.charset.start; j < content.charset.end; ++j)
          +
          1778 str.push_back(static_cast<char>(source[j]));
          +
          1779 m_charset = stdex::charset_from_name(str.c_str());
          +
          1780 }
          +
          1781 }
          +
          1782 }
          +
          1783
          +
          1784 m_sequences.push_back(std::move(e));
          +
          1785 break;
          +
          1786 }
          +
          1787 case stdex::parser::html_sequence_t::element_end: {
          +
          1788 std::unique_ptr<element_end> e(new element_end(std::move(m_tag), source, active_element()));
          1789
          -
          1794 constexpr char token_tag_start = '\x12';
          -
          1795
          -
          1800 constexpr char token_tag_end = '\x13';
          -
          1801
          -
          -
          1805 class token
          -
          1806 {
          -
          1807 protected:
          -
          1808 inline token(_In_ token_t _type = token_t::root, _In_opt_ sequence* _sequence = nullptr, _In_ uintptr_t _data = 0) :
          -
          1809 type(_type),
          -
          1810 sequence(_sequence),
          -
          1811 data(_data)
          -
          1812 {}
          -
          1813
          -
          1814 template<class _Elem, class _Traits, class _Alloc>
          -
          1815 friend class parser;
          -
          1816
          -
          1817 public:
          -
          1818 virtual ~token() {} // make polymorphic
          -
          1819
          -
          1827 template<class _Traits = std::char_traits<char>, class _Alloc = std::allocator<char>>
          -
          -
          1828 inline size_t append_tag(_Inout_ std::basic_string<char, _Traits, _Alloc>& str) const
          -
          1829 {
          -
          1830 size_t n = str.size();
          -
          1831 // Use %X instead of %p to ommit leading zeros and save space.
          -
          1832 stdex::appendf(str, "%c%zX%c", stdex::locale_C.get(), token_tag_start, reinterpret_cast<uintptr_t>(this), token_tag_end);
          -
          1833 return str.size() - n;
          -
          1834 }
          +
          1790 for (size_t j = m_element_stack.size(); j--; ) {
          +
          1791 auto starting_tag = m_element_stack[j];
          +
          1792 _Assume_(starting_tag && starting_tag->type == stdex::parser::html_sequence_t::element_start);
          +
          1793 if (starting_tag->code == e->code ||
          +
          1794 starting_tag->code == element_t::unknown && e->code == element_t::unknown && !stdex::strnicmp(source + starting_tag->name.start, starting_tag->name.size(), source + e->name.start, e->name.size()))
          +
          1795 {
          +
          1796 e->start = starting_tag;
          +
          1797 e->parent = starting_tag->parent;
          +
          1798 starting_tag->end = e.get();
          +
          1799 m_element_stack.resize(j);
          +
          1800 break;
          +
          1801 }
          +
          1802 }
          +
          1803
          +
          1804 m_sequences.push_back(std::move(e));
          +
          1805 break;
          +
          1806 }
          +
          1807 case stdex::parser::html_sequence_t::declaration:
          +
          1808 if (m_tag.attributes.size() > 3 &&
          +
          1809 !stdex::strnicmp(source + m_tag.attributes[0].name.start, m_tag.attributes[0].name.size(), "entity", SIZE_MAX))
          +
          1810 {
          +
          1811 if (!stdex::strncmp(source + m_tag.attributes[1].name.start, m_tag.attributes[1].name.size(), "%", SIZE_MAX) &&
          +
          1812 stdex::strncmp(source + m_tag.attributes[3].name.start, m_tag.attributes[3].name.size(), "SYSTEM", SIZE_MAX) &&
          +
          1813 stdex::strncmp(source + m_tag.attributes[3].name.start, m_tag.attributes[3].name.size(), "PUBLIC", SIZE_MAX))
          +
          1814 {
          +
          1815 std::unique_ptr<entity<_Elem, _Traits, _Alloc>> e(new entity<_Elem, _Traits, _Alloc>());
          +
          1816 e->name = m_tag.attributes[2].name;
          +
          1817 e->value = std::move(replace_entities(source + m_tag.attributes[3].name.start, m_tag.attributes[3].name.size()));
          +
          1818 m_entities.push_back(std::move(e));
          +
          1819 }
          +
          1820
          +
          1821 // TODO: Parse & entities and entities in SYSTEM and PUBLIC external files.
          +
          1822 }
          +
          1823 m_sequences.push_back(std::move(std::unique_ptr<sequence>(new declaration(std::move(m_tag), active_element()))));
          +
          1824 break;
          +
          1825 case stdex::parser::html_sequence_t::comment:
          +
          1826 m_sequences.push_back(std::move(std::unique_ptr<sequence>(new comment(std::move(m_tag), active_element()))));
          +
          1827 break;
          +
          1828 case stdex::parser::html_sequence_t::instruction:
          +
          1829 m_sequences.push_back(std::move(std::unique_ptr<sequence>(new instruction(std::move(m_tag), active_element()))));
          +
          1830 break;
          +
          1831 default:
          +
          1832 throw std::invalid_argument("unknown tag type");
          +
          1833 }
          +
          1834
          +
          1835 continue;
          +
          1836 }
          +
          1837
          +
          1838 next_char:
          +
          1839 if (m_any_char.match(source, i, num_chars)) {
          +
          1840 // Skip any character, but don't declare it as parsed yet. It might be a part of unfinished tag.
          +
          1841 i = m_any_char.interval.end;
          +
          1842 }
          +
          1843 else
          +
          1844 break;
          +
          1845 }
          +
          1846 }
          -
          1835
          -
          1843 template<class _Traits = std::char_traits<wchar_t>, class _Alloc = std::allocator<wchar_t>>
          -
          -
          1844 inline size_t append_tag(_Inout_ std::basic_string<wchar_t, _Traits, _Alloc>& str) const
          -
          1845 {
          -
          1846 // Use %X instead of %p to ommit leading zeros and save space.
          -
          1847 return stdex::appendf(str, L"%c%zX%c", stdex::locale_C.get(), static_cast<wchar_t>(token_tag_start), reinterpret_cast<uintptr_t>(this), static_cast<wchar_t>(token_tag_end));
          -
          1848 }
          -
          -
          1849
          -
          1850 template<class T>
          -
          1851 static inline token* parse_tag(const T* str, size_t& offset)
          +
          1847
          +
          +
          1852 {
          -
          1853 if (str[offset] != static_cast<T>(token_tag_start))
          -
          1854 return nullptr;
          -
          1855
          -
          1856 // Locate tag end.
          -
          1857 size_t end;
          -
          1858 for (end = offset + 1; ; end++) {
          -
          1859 if (!str[end])
          -
          1860 return nullptr;
          -
          1861 if (str[end] == token_tag_end)
          -
          1862 break;
          -
          1863 }
          -
          1864
          -
          1865 // Parse hexadecimal token memory address.
          -
          1866 token* t = reinterpret_cast<token*>(stdex::strtouint<T, uintptr_t>(str + offset + 1, end - offset - 1, nullptr, 16));
          -
          1867 if (!t)
          -
          1868 throw std::invalid_argument("null token");
          -
          1869 offset = end + 1;
          -
          1870 return t;
          -
          1871 }
          -
          1872
          -
          1873 public:
          -
          1874 token_t type;
          - -
          1876 uintptr_t data;
          -
          1877 };
          +
          1853 size_t i = m_source.size();
          +
          1854 if (m_num_parsed < i)
          +
          1855 m_sequences.push_back(std::move(std::unique_ptr<sequence>(new sequence(stdex::parser::html_sequence_t::text, m_num_parsed, i, active_element()))));
          +
          1856 m_num_parsed = i;
          +
          1857 m_element_stack.clear();
          +
          1858 }
          -
          1878
          -
          1879 using token_vector = std::vector<std::unique_ptr<token>>;
          -
          1880 using token_list = std::list<token*>;
          -
          1881
          -
          1885 enum text_type_flag_t : uint32_t {
          -
          1886 has_tokens = 1 << 0,
          -
          1887 has_text = 1 << 1,
          -
          1888 is_title = 1 << 2,
          -
          1889 is_bullet = 1 << 3,
          -
          1890 };
          -
          1891
          -
          1895 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Alloc = std::allocator<_Elem>>
          -
          -
          1896 class text_token : public token
          -
          1897 {
          -
          1898 protected:
          -
          1899 inline text_token(
          -
          1900 _In_ token_t type = token_t::complete,
          -
          1901 _In_reads_or_z_opt_(num_chars) const _Elem* _text = nullptr, _In_ size_t num_chars = 0,
          -
          1902 _In_ uint32_t _text_type = 0,
          -
          1903 _In_opt_ stdex::html::sequence* sequence = nullptr, _In_ uintptr_t data = 0) :
          - -
          1905 text(_text, num_chars),
          -
          1906 text_type(_text_type)
          -
          1907 {}
          -
          1908
          -
          1909 friend class parser<_Elem, _Traits, _Alloc>;
          -
          1910
          -
          1911 public:
          -
          1912 std::basic_string<_Elem, _Traits, _Alloc> text;
          -
          1913 uint32_t text_type;
          -
          1914 stdex::mapping_vector<size_t> mapping;
          -
          1915 };
          +
          1859
          +
          +
          1863 inline void assign(_In_reads_or_z_opt_(num_chars) const _Elem* source, _In_ size_t num_chars)
          +
          1864 {
          +
          1865 clear();
          +
          1866 append(source, num_chars);
          +
          1867 finalize();
          +
          1868 }
          +
          +
          1869
          +
          1873 inline const std::basic_string<_Elem, _Traits, _Alloc>& source() const { return m_source; }
          +
          1874
          +
          1875 friend class parser<_Elem, _Traits, _Alloc>;
          +
          1876
          +
          1877 protected:
          +
          + +
          1882 {
          +
          1883 return m_element_stack.empty() ? nullptr : m_element_stack.back();
          +
          1884 }
          +
          +
          1885
          +
          +
          1889 std::basic_string<_Elem, _Traits, _Alloc> replace_entities(_In_reads_or_z_opt_(num_chars) const _Elem* input, _In_ size_t num_chars) const
          +
          1890 {
          +
          1891 _Assume_(input || !num_chars);
          +
          1892 const size_t num_entities = m_entities.size();
          +
          1893 const _Elem* source = m_source.data();
          +
          1894 std::basic_string<_Elem, _Traits, _Alloc> output;
          +
          1895 for (size_t i = 0; i < num_chars && input[i];) {
          +
          1896 if (input[i] == '%') {
          +
          1897 for (size_t j = 0; j < num_entities; j++) {
          +
          1898 auto& e = m_entities[j];
          +
          1899 size_t entity_size = e->name.size();
          +
          1900 if (i + entity_size + 1 < num_chars &&
          +
          1901 !stdex::strncmp(input + i + 1, source + e->name.start, entity_size) &&
          +
          1902 input[i + entity_size + 1] == ';')
          +
          1903 {
          +
          1904 output += e->value;
          +
          1905 i += entity_size + 2;
          +
          1906 goto next_char;
          +
          1907 }
          +
          1908 }
          +
          1909 throw std::runtime_error("undefined entity");
          +
          1910 }
          +
          1911 output += input[i++];
          +
          1912 next_char:;
          +
          1913 }
          +
          1914 return output;
          +
          1915 }
          1916
          -
          1920 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Alloc = std::allocator<_Elem>>
          -
          -
          1921 class starting_token : public text_token<_Elem, _Traits, _Alloc>
          -
          1922 {
          -
          1923 protected:
          -
          1924 inline starting_token(
          -
          1925 _In_reads_or_z_opt_(num_chars_text) const _Elem* _text = nullptr, _In_ size_t num_chars_text = 0,
          -
          1926 _In_reads_or_z_opt_(num_chars_name) const _Elem* _name = nullptr, _In_ size_t num_chars_name = 0,
          -
          1927 _In_ uint32_t text_type = 0,
          -
          1928 _In_opt_ stdex::html::sequence* sequence = nullptr,
          -
          1929 _In_opt_ stdex::html::sequence* _end_sequence = nullptr,
          -
          1930 _In_ uintptr_t data = 0) :
          -
          1931 text_token(token_t::starting, _text, num_chars_text, text_type, sequence, data),
          -
          1932 name(_name, num_chars_name),
          -
          1933 end_sequence(_end_sequence)
          -
          1934 {}
          -
          1935
          -
          1936 friend class parser<_Elem, _Traits, _Alloc>;
          -
          1937
          -
          1938 public:
          -
          1939 std::basic_string<_Elem, _Traits, _Alloc> name;
          - -
          1941 };
          +
          1917 protected:
          +
          1918 std::basic_string<_Elem, _Traits, _Alloc> m_source;
          + +
          1920 stdex::charset_id m_charset;
          +
          1921
          +
          1922 // Declaration parsing data
          + + + + + + + +
          1930 std::vector<std::unique_ptr<entity<_Elem, _Traits, _Alloc>>> m_entities;
          +
          1931
          +
          1932 // Element parsing data
          + +
          1934 sequence_store m_sequences;
          +
          1935 std::vector<element_start*> m_element_stack;
          + +
          1937 };
          -
          1942
          -
          1946 enum class token_url_t {
          -
          1947 plain = 0, // URL is not using any particular encoding scheme (as-is)
          -
          1948 sgml, // URL is encoded using SGML entities
          -
          1949 css, // URL is encoded using CSS escaping scheme
          -
          1950 };
          -
          1951
          -
          1955 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Alloc = std::allocator<_Elem>>
          -
          -
          1956 class url_token : public token
          -
          1957 {
          -
          1958 protected:
          -
          1959 inline url_token(
          -
          1960 _In_reads_or_z_opt_(num_chars) const _Elem* _url = nullptr, _In_ size_t num_chars = 0,
          -
          1961 token_url_t _encoding = token_url_t::plain,
          -
          1962 _In_opt_ stdex::html::sequence* sequence = nullptr, _In_ uintptr_t data = 0) :
          -
          1963 token(token_t::url, sequence, data),
          -
          1964 url(_url, num_chars),
          -
          1965 encoding(_encoding)
          -
          1966 {}
          -
          1967
          -
          1968 friend class parser<_Elem, _Traits, _Alloc>;
          +
          1938
          +
          1942 enum class token_t {
          +
          1943 root = 0,
          +
          1944 complete,
          +
          1945 starting,
          +
          1946 ending,
          +
          1947 url,
          +
          1948 };
          +
          1949
          +
          1953 constexpr size_t token_tag_max =
          +
          1954 sizeof(void*) * 2 // Memory address in hexadecimal
          +
          1955 + 2 // Leading and trailing parenthesis
          +
          1956 + 1; // Zero terminator
          +
          1957
          +
          1962 constexpr char token_tag_start = '\x12';
          +
          1963
          +
          1968 constexpr char token_tag_end = '\x13';
          1969
          -
          1970 public:
          -
          1971 std::basic_string<_Elem, _Traits, _Alloc> url;
          -
          1972 token_url_t encoding;
          -
          1973 };
          -
          -
          1974
          -
          - - -
          1980 std::list<stdex::html::token*> active_tokens;
          -
          1981 size_t word_index;
          - -
          1983 };
          -
          +
          +
          1973 class token
          +
          1974 {
          +
          1975 protected:
          +
          1976 inline token(_In_ token_t _type = token_t::root, _In_opt_ sequence* _sequence = nullptr, _In_ uintptr_t _data = 0) :
          +
          1977 type(_type),
          +
          1978 sequence(_sequence),
          +
          1979 data(_data)
          +
          1980 {}
          +
          1981
          +
          1982 template<class _Elem, class _Traits, class _Alloc>
          +
          1983 friend class parser;
          1984
          -
          1985 using inserted_token_list = std::list<inserted_token>;
          -
          1986
          -
          1987 template<class _Elem, class _Traits, class _Alloc>
          -
          - -
          1989 {
          -
          1990 public:
          -
          1991 inline parser(
          - -
          1993 _In_reads_or_z_opt_(num_chars) const stdex::schar_t* url = nullptr, _In_ size_t num_chars = 0,
          -
          1994 _In_ bool parse_frames = false, _In_ stdex::progress<size_t>* progress = nullptr) :
          - -
          1996 m_url(url, stdex::strnlen(url, num_chars)),
          -
          1997 m_parse_frames(parse_frames),
          - -
          1999 m_source(nullptr)
          -
          2000 {}
          -
          2001
          -
          - -
          2006 {
          -
          2007 _Assume_(m_tokens.empty());
          -
          2008
          -
          2009 if (m_progress) {
          -
          2010 m_progress->set_range(0, m_document.source().size());
          -
          2011 m_progress->set(0);
          -
          2012 }
          -
          2013
          -
          2014 m_source = m_document.source().data();
          - -
          2016 return parse(m_document.m_sequences.end());
          -
          2017 }
          +
          1985 public:
          +
          1986 virtual ~token() {} // make polymorphic
          +
          1987
          +
          1995 template<class _Traits = std::char_traits<char>, class _Alloc = std::allocator<char>>
          +
          +
          1996 inline size_t append_tag(_Inout_ std::basic_string<char, _Traits, _Alloc>& str) const
          +
          1997 {
          +
          1998 size_t n = str.size();
          +
          1999 // Use %X instead of %p to ommit leading zeros and save space.
          +
          2000 stdex::appendf(str, "%c%zX%c", stdex::locale_C.get(), token_tag_start, reinterpret_cast<uintptr_t>(this), token_tag_end);
          +
          2001 return str.size() - n;
          +
          2002 }
          -
          2018
          -
          -
          2025 static void link(_Inout_ std::basic_string<_Elem, _Traits, _Alloc>& source, _In_ const text_token<_Elem, _Traits, _Alloc>* t)
          -
          2026 {
          -
          2027 _Assume_(t);
          -
          2028 _Assume_(
          -
          2029 t->type == token_t::complete ||
          -
          2030 t->type == token_t::starting ||
          -
          2031 t->type == token_t::ending ||
          -
          2032 t->type == token_t::root);
          -
          2033
          -
          2034 if (t->text_type & has_tokens) {
          -
          2035 const _Elem* root = t->text.data();
          -
          2036 for (size_t i = 0, num_chars = t->text.size(); i < num_chars && root[i];) {
          -
          2037 _Assume_(root[i] != token_tag_end);
          -
          2038 const token* t2 = token::parse_tag(root, i);
          -
          2039 if (t2) {
          -
          2040 switch (t2->type) {
          -
          2041 case token_t::complete:
          -
          2042 case token_t::starting:
          -
          2043 case token_t::ending:
          -
          2044 case token_t::root:
          -
          2045 link(source, dynamic_cast<const text_token<_Elem, _Traits, _Alloc>*>(t2));
          -
          2046 break;
          -
          2047 case token_t::url: {
          -
          2048 auto t2_url = dynamic_cast<const url_token<_Elem, _Traits, _Alloc>*>(t2);
          -
          2049 switch (t2_url->encoding) {
          -
          2050 case token_url_t::plain:
          -
          2051 source += t2_url->url;
          -
          2052 break;
          -
          2053 case token_url_t::sgml:
          -
          2054 escape(source, t2_url->url.data(), t2_url->url.size());
          -
          2055 break;
          -
          2056 case token_url_t::css:
          -
          2057 css_escape(source, t2_url->url.data(), t2_url->url.size());
          -
          2058 break;
          -
          2059 default:
          -
          2060 throw std::invalid_argument("unsupported URL encoding");
          -
          2061 }
          -
          2062 break;
          -
          2063 }
          -
          2064 default:
          -
          2065 throw std::invalid_argument("unsupported token type");
          -
          2066 }
          -
          2067 }
          -
          2068 else if (t->text_type & has_text) {
          -
          2069 escape_min(source, root[i]);
          -
          2070 i++;
          -
          2071 }
          -
          2072 else
          -
          2073 source += root[i++];
          -
          2074 }
          -
          2075 }
          -
          2076 else if (t->text_type & has_text) {
          -
          2077 // Token contains no references to other tokens. But, it does contain text that requires escaping.
          -
          2078 escape_min(source, t->text.data(), t->text.size());
          -
          2079 }
          -
          2080 else
          -
          2081 source += t->text;
          -
          2082 }
          +
          2003
          +
          2011 template<class _Traits = std::char_traits<wchar_t>, class _Alloc = std::allocator<wchar_t>>
          +
          +
          2012 inline size_t append_tag(_Inout_ std::basic_string<wchar_t, _Traits, _Alloc>& str) const
          +
          2013 {
          +
          2014 // Use %X instead of %p to ommit leading zeros and save space.
          +
          2015 return stdex::appendf(str, L"%c%zX%c", stdex::locale_C.get(), static_cast<wchar_t>(token_tag_start), reinterpret_cast<uintptr_t>(this), static_cast<wchar_t>(token_tag_end));
          +
          2016 }
          -
          2083
          -
          -
          2092 static void start_tokens(_Inout_ std::basic_string<_Elem, _Traits, _Alloc>& source, _Inout_ token_list& active_tokens, _In_ const token_list& new_tokens, _In_ token_list::const_iterator from)
          -
          2093 {
          -
          2094 for (; from != new_tokens.cend(); ++from) {
          -
          2095 auto t = *from;
          -
          2096 t->append_tag(source);
          -
          2097 active_tokens.push_back(t);
          -
          2098 }
          -
          2099 }
          +
          2017
          +
          2018 template<class T>
          +
          2019 static inline token* parse_tag(const T* str, size_t& offset)
          +
          2020 {
          +
          2021 if (str[offset] != static_cast<T>(token_tag_start))
          +
          2022 return nullptr;
          +
          2023
          +
          2024 // Locate tag end.
          +
          2025 size_t end;
          +
          2026 for (end = offset + 1; ; end++) {
          +
          2027 if (!str[end])
          +
          2028 return nullptr;
          +
          2029 if (str[end] == token_tag_end)
          +
          2030 break;
          +
          2031 }
          +
          2032
          +
          2033 // Parse hexadecimal token memory address.
          +
          2034 token* t = reinterpret_cast<token*>(stdex::strtouint<T, uintptr_t>(str + offset + 1, end - offset - 1, nullptr, 16));
          +
          2035 if (!t)
          +
          2036 throw std::invalid_argument("null token");
          +
          2037 offset = end + 1;
          +
          2038 return t;
          +
          2039 }
          +
          2040
          +
          2041 public:
          +
          2042 token_t type;
          + +
          2044 uintptr_t data;
          +
          2045 };
          -
          2100
          -
          -
          2110 token_list::const_iterator end_tokens(_Inout_ std::basic_string<_Elem, _Traits, _Alloc>& source, _Inout_ token_list& active_tokens, _In_ const token_list& new_tokens)
          -
          2111 {
          -
          2112 // Skip matching tokens in active_tokens and new_tokens.
          -
          2113 token_list::const_iterator i1, i2;
          -
          2114 for (i1 = active_tokens.cbegin(), i2 = new_tokens.cbegin(); i1 != active_tokens.cend(); ++i1, ++i2) {
          -
          2115 if (i2 == new_tokens.cend() || *i1 != *i2) {
          -
          2116 // Got two tokens, where lists don't match anymore, or new_tokens list is out.
          -
          2117 // End tokens not relevant anymore in reverse order of starting.
          -
          2118 for (auto i = active_tokens.cend(); i != active_tokens.cbegin(); ) {
          -
          2119 auto t1 = dynamic_cast<starting_token<_Elem, _Traits, _Alloc>*>(*(--i));
          -
          2120 _Assume_(t1 && t1->type == token_t::starting);
          -
          2121
          -
          2122 std::unique_ptr<text_token<_Elem, _Traits, _Alloc>> t2(new text_token<_Elem, _Traits, _Alloc>(token_t::ending));
          -
          2123 t2->text.reserve(t1->name.size() + 3);
          -
          2124 t2->text += '<';
          -
          2125 t2->text += '/';
          -
          2126 t2->text += t1->name;
          -
          2127 t2->text += '>';
          -
          2128 append_token(std::move(t2), source);
          -
          2129
          -
          2130 // Pop the active token.
          -
          2131 if (i1 == i) {
          -
          2132 active_tokens.erase(i);
          -
          2133 break;
          -
          2134 }
          -
          2135 active_tokens.erase(i);
          -
          2136 i = active_tokens.cend();
          -
          2137 }
          -
          2138 break;
          -
          2139 }
          -
          2140 }
          -
          2141 return i2;
          -
          2142 }
          +
          2046
          +
          2047 using token_vector = std::vector<std::unique_ptr<token>>;
          +
          2048 using token_list = std::list<token*>;
          +
          2049
          +
          2053 enum text_type_flag_t : uint32_t {
          +
          2054 has_tokens = 1 << 0,
          +
          2055 has_text = 1 << 1,
          +
          2056 is_title = 1 << 2,
          +
          2057 is_bullet = 1 << 3,
          +
          2058 };
          +
          2059
          +
          2063 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Alloc = std::allocator<_Elem>>
          +
          +
          2064 class text_token : public token
          +
          2065 {
          +
          2066 protected:
          +
          2067 inline text_token(
          +
          2068 _In_ token_t type = token_t::complete,
          +
          2069 _In_reads_or_z_opt_(num_chars) const _Elem* _text = nullptr, _In_ size_t num_chars = 0,
          +
          2070 _In_ uint32_t _text_type = 0,
          +
          2071 _In_opt_ stdex::html::sequence* sequence = nullptr, _In_ uintptr_t data = 0) :
          + +
          2073 text(_text, num_chars),
          +
          2074 text_type(_text_type)
          +
          2075 {}
          +
          2076
          +
          2077 friend class parser<_Elem, _Traits, _Alloc>;
          +
          2078
          +
          2079 public:
          +
          2080 std::basic_string<_Elem, _Traits, _Alloc> text;
          +
          2081 uint32_t text_type;
          +
          2082 stdex::mapping_vector<size_t> mapping;
          +
          2083 };
          -
          2143
          -
          -
          2153 void append_inserted_tokens(_Inout_ std::basic_string<_Elem, _Traits, _Alloc>& source, _Inout_ inserted_token_list& inserted_tokens,
          -
          2154 _In_ size_t word_index, _In_ bool after_word,
          -
          2155 _Inout_ token_list& active_tokens)
          -
          2156 {
          -
          2157 for (auto i = inserted_tokens.begin(); i != inserted_tokens.end(); ) {
          -
          2158 auto& t = *i;
          -
          2159 _Assume_(t.token);
          -
          2160 if (t.word_index == word_index && t.after_word == after_word) {
          -
          2161 if (t.token->type != token_t::ending)
          -
          2162 start_tokens(source, active_tokens, t.active_tokens, end_tokens(source, active_tokens, t.active_tokens));
          -
          2163 t.token->append_tag(source);
          -
          2164 inserted_tokens.erase(i++);
          -
          2165 }
          -
          2166 else
          -
          2167 ++i;
          -
          2168 }
          -
          2169 }
          +
          2084
          +
          2088 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Alloc = std::allocator<_Elem>>
          +
          +
          2089 class starting_token : public text_token<_Elem, _Traits, _Alloc>
          +
          2090 {
          +
          2091 protected:
          +
          2092 inline starting_token(
          +
          2093 _In_reads_or_z_opt_(num_chars_text) const _Elem* _text = nullptr, _In_ size_t num_chars_text = 0,
          +
          2094 _In_reads_or_z_opt_(num_chars_name) const _Elem* _name = nullptr, _In_ size_t num_chars_name = 0,
          +
          2095 _In_ uint32_t text_type = 0,
          +
          2096 _In_opt_ stdex::html::sequence* sequence = nullptr,
          +
          2097 _In_opt_ stdex::html::sequence* _end_sequence = nullptr,
          +
          2098 _In_ uintptr_t data = 0) :
          +
          2099 text_token(token_t::starting, _text, num_chars_text, text_type, sequence, data),
          +
          2100 name(_name, num_chars_name),
          +
          2101 end_sequence(_end_sequence)
          +
          2102 {}
          +
          2103
          +
          2104 friend class parser<_Elem, _Traits, _Alloc>;
          +
          2105
          +
          2106 public:
          +
          2107 std::basic_string<_Elem, _Traits, _Alloc> name;
          + +
          2109 };
          -
          2170
          -
          -
          2177 static void merge(_Inout_ token_list& a, _In_ const token_list& b)
          -
          2178 {
          -
          2179 for (auto i2 = b.begin(); i2 != b.end(); ++i2) {
          -
          2180 auto t2 = *i2;
          -
          2181 for (auto i1 = a.begin(); i1 != a.end(); ++i1) {
          -
          2182 if (i1 == a.end()) {
          -
          2183 a.push_back(t2);
          -
          2184 break;
          -
          2185 }
          -
          2186 auto t1 = *i1;
          -
          2187 if (t1 == t2)
          -
          2188 break;
          -
          2189 }
          -
          2190 }
          -
          2191 }
          +
          2110
          +
          2114 enum class token_url_t {
          +
          2115 plain = 0, // URL is not using any particular encoding scheme (as-is)
          +
          2116 sgml, // URL is encoded using SGML entities
          +
          2117 css, // URL is encoded using CSS escaping scheme
          +
          2118 };
          +
          2119
          +
          2123 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Alloc = std::allocator<_Elem>>
          +
          +
          2124 class url_token : public token
          +
          2125 {
          +
          2126 protected:
          +
          2127 inline url_token(
          +
          2128 _In_reads_or_z_opt_(num_chars) const _Elem* _url = nullptr, _In_ size_t num_chars = 0,
          +
          2129 token_url_t _encoding = token_url_t::plain,
          +
          2130 _In_opt_ stdex::html::sequence* sequence = nullptr, _In_ uintptr_t data = 0) :
          +
          2131 token(token_t::url, sequence, data),
          +
          2132 url(_url, num_chars),
          +
          2133 encoding(_encoding)
          +
          2134 {}
          +
          2135
          +
          2136 friend class parser<_Elem, _Traits, _Alloc>;
          +
          2137
          +
          2138 public:
          +
          2139 std::basic_string<_Elem, _Traits, _Alloc> url;
          +
          2140 token_url_t encoding;
          +
          2141 };
          -
          2192
          -
          -
          2196 void make_absolute_url(std::basic_string<_Elem, _Traits, _Alloc>& rel)
          -
          2197 {
          -
          2198 _Unreferenced_(rel);
          -
          2199
          -
          2200 if (m_url.empty())
          -
          2201 return;
          -
          2202
          -
          2203 // TODO: Implement!
          -
          2204 }
          +
          2142
          +
          + + +
          2148 std::list<stdex::html::token*> active_tokens;
          +
          2149 size_t word_index;
          + +
          2151 };
          -
          2205
          -
          2209 inline const token_vector& tokens() const { return m_tokens; }
          -
          2210
          -
          2211 protected:
          -
          2219 template <class T>
          -
          -
          2220 inline T* append_token(_Inout_ std::unique_ptr<T>&& token)
          -
          2221 {
          -
          2222 if (!token)
          -
          2223 return nullptr;
          -
          2224 auto t = token.get();
          -
          2225 m_tokens.push_back(std::move(token));
          -
          2226 return t;
          -
          2227 }
          +
          2152
          +
          2153 using inserted_token_list = std::list<inserted_token>;
          +
          2154
          +
          2155 template<class _Elem, class _Traits, class _Alloc>
          +
          + +
          2157 {
          +
          2158 public:
          +
          2159 inline parser(
          + +
          2161 _In_reads_or_z_opt_(num_chars) const stdex::schar_t* url = nullptr, _In_ size_t num_chars = 0,
          +
          2162 _In_ bool parse_frames = false, _In_ stdex::progress<size_t>* progress = nullptr) :
          + +
          2164 m_url(url, stdex::strnlen(url, num_chars)),
          +
          2165 m_parse_frames(parse_frames),
          + +
          2167 m_source(nullptr)
          +
          2168 {}
          +
          2169
          +
          + +
          2174 {
          +
          2175 _Assume_(m_tokens.empty());
          +
          2176
          +
          2177 if (m_progress) {
          +
          2178 m_progress->set_range(0, m_document.source().size());
          +
          2179 m_progress->set(0);
          +
          2180 }
          +
          2181
          +
          2182 m_source = m_document.source().data();
          + +
          2184 return parse(m_document.m_sequences.end());
          +
          2185 }
          -
          2228
          -
          2237 template <class T>
          -
          -
          2238 inline size_t append_token(_Inout_ std::unique_ptr<T>&& token, _Inout_ std::basic_string<_Elem, _Traits, _Alloc>& source)
          -
          2239 {
          -
          2240 if (!token)
          -
          2241 return 0;
          -
          2242 size_t n = token->append_tag(source);
          -
          2243 m_tokens.push_back(std::move(token));
          -
          2244 return n;
          -
          2245 }
          +
          2186
          +
          +
          2193 static void link(_Inout_ std::basic_string<_Elem, _Traits, _Alloc>& source, _In_ const text_token<_Elem, _Traits, _Alloc>* t)
          +
          2194 {
          +
          2195 _Assume_(t);
          +
          2196 _Assume_(
          +
          2197 t->type == token_t::complete ||
          +
          2198 t->type == token_t::starting ||
          +
          2199 t->type == token_t::ending ||
          +
          2200 t->type == token_t::root);
          +
          2201
          +
          2202 if (t->text_type & has_tokens) {
          +
          2203 const _Elem* root = t->text.data();
          +
          2204 for (size_t i = 0, num_chars = t->text.size(); i < num_chars && root[i];) {
          +
          2205 _Assume_(root[i] != token_tag_end);
          +
          2206 const token* t2 = token::parse_tag(root, i);
          +
          2207 if (t2) {
          +
          2208 switch (t2->type) {
          +
          2209 case token_t::complete:
          +
          2210 case token_t::starting:
          +
          2211 case token_t::ending:
          +
          2212 case token_t::root:
          +
          2213 link(source, dynamic_cast<const text_token<_Elem, _Traits, _Alloc>*>(t2));
          +
          2214 break;
          +
          2215 case token_t::url: {
          +
          2216 auto t2_url = dynamic_cast<const url_token<_Elem, _Traits, _Alloc>*>(t2);
          +
          2217 switch (t2_url->encoding) {
          +
          2218 case token_url_t::plain:
          +
          2219 source += t2_url->url;
          +
          2220 break;
          +
          2221 case token_url_t::sgml:
          +
          2222 escape(source, t2_url->url.data(), t2_url->url.size());
          +
          2223 break;
          +
          2224 case token_url_t::css:
          +
          2225 css_escape(source, t2_url->url.data(), t2_url->url.size());
          +
          2226 break;
          +
          2227 default:
          +
          2228 throw std::invalid_argument("unsupported URL encoding");
          +
          2229 }
          +
          2230 break;
          +
          2231 }
          +
          2232 default:
          +
          2233 throw std::invalid_argument("unsupported token type");
          +
          2234 }
          +
          2235 }
          +
          2236 else if (t->text_type & has_text) {
          +
          2237 escape_min(source, root[i]);
          +
          2238 i++;
          +
          2239 }
          +
          2240 else
          +
          2241 source += root[i++];
          +
          2242 }
          +
          2243 }
          +
          2244 else if (t->text_type & has_text) {
          +
          2245 // Token contains no references to other tokens. But, it does contain text that requires escaping.
          +
          2246 escape_min(source, t->text.data(), t->text.size());
          +
          2247 }
          +
          2248 else
          +
          2249 source += t->text;
          +
          2250 }
          -
          2246
          -
          -
          2255 text_token<_Elem, _Traits, _Alloc>* parse(_In_ const sequence_store::const_iterator& end, _In_ uint32_t text_type = 0)
          -
          2256 {
          - -
          2258 std::unique_ptr<text_token<_Elem, _Traits, _Alloc>> token(new text_token<_Elem, _Traits, _Alloc>(
          -
          2259 token_t::complete,
          -
          2260 nullptr, 0,
          -
          2261 text_type,
          -
          2262 m_offset != end ? m_offset->get() : nullptr));
          -
          2263
          -
          2264 while (m_offset != end) {
          -
          2265 auto& s = *m_offset;
          -
          2266
          -
          2267 if (m_progress) {
          -
          2268 if (m_progress->cancel())
          -
          2269 throw stdex::user_cancelled();
          -
          2270 m_progress->set(s->interval.start);
          -
          2271 }
          -
          2272
          -
          2273 // No token_tag_start and token_tag_end chars, please.
          -
          2274 _Assume_(
          -
          2275 stdex::strnchr(m_source + s->interval.start, s->interval.size(), static_cast<_Elem>(token_tag_start)) == stdex::npos &&
          -
          2276 stdex::strnchr(m_source + s->interval.start, s->interval.size(), static_cast<_Elem>(token_tag_end)) == stdex::npos);
          -
          2277
          -
          2278 if (s->type == stdex::parser::html_sequence_t::text) {
          -
          2279 rel.from = s->interval.start;
          -
          2280 token->mapping.push_back(rel);
          -
          2281 stdex::sgml2strcat(token->text, m_source + s->interval.start, s->interval.size(), 0, rel, &token->mapping);
          -
          2282 rel.to = token->text.size();
          -
          2283 if (!(token->text_type & has_text) &&
          -
          2284 !stdex::isblank(m_source + s->interval.start, s->interval.size()))
          -
          2285 token->text_type |= has_text;
          -
          2286 ++m_offset;
          -
          2287 }
          -
          2288 else if (s->type == stdex::parser::html_sequence_t::element || s->type == stdex::parser::html_sequence_t::element_start) {
          -
          2289 const element* s_el = static_cast<const element*>(s.get());
          -
          2290 _Assume_(s_el);
          -
          2291 const element_start* s_el_start = s->type == stdex::parser::html_sequence_t::element_start ? static_cast<const element_start*>(s.get()) : nullptr;
          -
          2292 if (s_el->code == element_t::frameset && !m_parse_frames)
          -
          2293 throw std::invalid_argument("<frameset> detected");
          -
          2294
          -
          2295 {
          -
          2296 size_t offset = s->interval.start;
          -
          2297 std::unique_ptr<text_token<_Elem, _Traits, _Alloc>> t(s->type == stdex::parser::html_sequence_t::element || element_traits::span(s_el_start->code) == element_span_t::immediate ?
          -
          2298 new text_token<_Elem, _Traits, _Alloc>(token_t::complete, nullptr, 0, 0, s.get()) :
          -
          2299 new starting_token<_Elem, _Traits, _Alloc>(nullptr, 0, m_source + s_el_start->name.start, s_el_start->name.size(), 0, s.get(), s_el_start->end));
          -
          2300
          -
          2301 // Copy the tag contents, but mind any attributes containing localizable text.
          -
          2302 for (auto& a : s_el->attributes) {
          -
          2303 if (a.value.empty() ||
          -
          2304 stdex::isblank(m_source + a.value.start, a.value.size()))
          -
          2305 continue;
          -
          2306
          -
          2307 if (element_traits::is_uri(s_el->code, m_source + a.name.start, a.name.size())) {
          -
          2308 t->text.append(m_source + offset, a.value.start - offset);
          -
          2309 std::unique_ptr<url_token<_Elem, _Traits, _Alloc>> t_url(new url_token<_Elem, _Traits, _Alloc>(
          -
          2310 nullptr, 0,
          -
          2311 token_url_t::sgml,
          -
          2312 s.get()));
          -
          2313 stdex::sgml2strcat(t_url->url, m_source + a.value.start, a.value.size());
          -
          2314 append_token(std::move(t_url), t->text);
          -
          2315 t->text_type |= has_tokens;
          -
          2316 offset = a.value.end;
          -
          2317 }
          -
          2318 else if (element_traits::is_localizable(s_el->code, m_source + a.name.start, a.name.size())) {
          -
          2319 t->text.append(m_source + offset, a.value.start - offset);
          -
          2320 std::unique_ptr<text_token<_Elem, _Traits, _Alloc>> t_value(new text_token<_Elem, _Traits, _Alloc>(
          -
          2321 token_t::complete,
          -
          2322 nullptr, 0,
          -
          2323 has_text | is_title,
          -
          2324 s.get()));
          -
          2325 stdex::mapping<size_t> rel_value(a.value.start, 0);
          -
          2326 t_value->mapping.push_back(rel_value);
          -
          2327 stdex::sgml2strcat(t_value->text, m_source + a.value.start, a.value.size(), 0, rel_value, &t_value->mapping);
          -
          2328 append_token(std::move(t_value), t->text);
          -
          2329 t->text_type |= has_tokens;
          -
          2330 offset = a.value.end;
          -
          2331 }
          -
          2332 }
          -
          2333
          -
          2334 t->text.append(m_source + offset, s->interval.end - offset);
          -
          2335 rel.from = s->interval.start;
          -
          2336 token->mapping.push_back(rel);
          -
          2337 rel.to += append_token(std::move(t), token->text);
          -
          2338 token->text_type |= has_tokens;
          -
          2339 }
          -
          2340 ++m_offset;
          -
          2341
          -
          2342 if (s_el_start) {
          -
          2343 if (s_el_start->code == element_t::address ||
          -
          2344 s_el_start->code == element_t::code ||
          -
          2345 s_el_start->code == element_t::comment ||
          -
          2346 s_el_start->code == element_t::cite ||
          -
          2347 s_el_start->code == element_t::kbd ||
          -
          2348 s_el_start->code == element_t::samp ||
          -
          2349 s_el_start->code == element_t::script ||
          -
          2350 s_el_start->code == element_t::style)
          -
          2351 {
          -
          2352 // Non-localizable
          -
          2353 auto s_end = s_el_start->end;
          -
          2354 _Assume_(s_end);
          -
          2355
          -
          2356 if (s->interval.end < s_end->interval.start) {
          -
          2357 if (s_el_start->code != element_t::style) {
          -
          2358 rel.from = s->interval.start;
          -
          2359 token->mapping.push_back(rel);
          -
          2360 rel.to += append_token(std::move(std::unique_ptr<text_token<_Elem, _Traits, _Alloc>>(
          - -
          2362 token_t::complete,
          -
          2363 m_source + s->interval.end, s_end->interval.start - s->interval.end,
          -
          2364 0,
          -
          2365 m_offset->get()))),
          -
          2366 token->text);
          -
          2367 }
          -
          2368 else {
          -
          2369 // Partially parse CSS. It may contain URLs we need to make absolute.
          -
          2370 auto t = parse_css(s->interval.end, s_end->interval.start);
          -
          2371 _Assume_(t);
          -
          2372 rel.from = s->interval.start;
          -
          2373 token->mapping.push_back(rel);
          -
          2374 rel.to += t->append_tag(token->text);
          -
          2375 }
          -
          2376 token->text_type |= has_tokens;
          -
          2377 }
          -
          2378 while (m_offset != end && m_offset->get() != s_end)
          -
          2379 ++m_offset;
          -
          2380 }
          -
          2381 else if (element_traits::is_group(s_el_start->code)) {
          -
          2382 auto limit = m_offset;
          -
          2383 while (limit != end && limit->get() != s_el_start->end)
          -
          2384 ++limit;
          -
          2385 auto t = parse(limit,
          -
          2386 (element_traits::is_heading(s_el_start->code) || s_el_start->code == element_t::dt || s_el_start->code == element_t::title ? is_title : 0) |
          -
          2387 (element_traits::is_list(s_el_start->code) ? is_bullet : 0));
          -
          2388 rel.from = s->interval.start;
          -
          2389 token->mapping.push_back(rel);
          -
          2390 rel.to += t->append_tag(token->text);
          -
          2391 token->text_type |= has_tokens;
          -
          2392 }
          -
          2393 }
          -
          2394 }
          -
          2395 else if (s->type == stdex::parser::html_sequence_t::element_end) {
          -
          2396 rel.from = s->interval.start;
          -
          2397 token->mapping.push_back(rel);
          -
          2398 rel.to += append_token(std::move(std::unique_ptr<text_token<_Elem, _Traits, _Alloc>>(
          - -
          2400 token_t::ending,
          -
          2401 m_source + s->interval.start, s->interval.size(),
          -
          2402 0,
          -
          2403 s.get()))),
          -
          2404 token->text);
          -
          2405 token->text_type |= has_tokens;
          -
          2406 ++m_offset;
          -
          2407 }
          -
          2408 else {
          -
          2409 // Declaration, instruction, (P)CDATA section, comment...
          -
          2410 rel.from = s->interval.start;
          -
          2411 token->mapping.push_back(rel);
          -
          2412 rel.to += append_token(std::move(std::unique_ptr<text_token<_Elem, _Traits, _Alloc>>(
          - -
          2414 token_t::complete,
          -
          2415 m_source + s->interval.start, s->interval.size(),
          -
          2416 0,
          -
          2417 s.get()))),
          -
          2418 token->text);
          -
          2419 token->text_type |= has_tokens;
          -
          2420 ++m_offset;
          -
          2421 }
          -
          2422 }
          -
          2423
          -
          2424 return append_token(std::move(token));
          -
          2425 }
          +
          2251
          +
          +
          2260 static void start_tokens(_Inout_ std::basic_string<_Elem, _Traits, _Alloc>& source, _Inout_ token_list& active_tokens, _In_ const token_list& new_tokens, _In_ token_list::const_iterator from)
          +
          2261 {
          +
          2262 for (; from != new_tokens.cend(); ++from) {
          +
          2263 auto t = *from;
          +
          2264 t->append_tag(source);
          +
          2265 active_tokens.push_back(t);
          +
          2266 }
          +
          2267 }
          -
          2426
          -
          - -
          2431 {
          -
          2432 stdex::interval<size_t> section, content;
          -
          2433 std::unique_ptr<text_token<_Elem, _Traits, _Alloc>> token(
          - -
          2435 token_t::complete,
          -
          2436 nullptr, 0,
          -
          2437 0,
          -
          2438 m_offset->get()));
          -
          2439
          -
          2440 for (;;) {
          -
          2441 if (m_css_comment.match(m_source, start, end)) {
          -
          2442 token->text.append(m_source + start, m_css_comment.interval.end - start);
          -
          2443 start = m_css_comment.interval.end;
          -
          2444 }
          -
          2445 else if (m_css_cdo.match(m_source, start, end)) {
          -
          2446 token->text.append(m_source + start, m_css_cdo.interval.end - start);
          -
          2447 start = m_css_cdo.interval.end;
          -
          2448 }
          -
          2449 else if (m_css_cdc.match(m_source, start, end)) {
          -
          2450 token->text.append(m_source + start, m_css_cdc.interval.end - start);
          -
          2451 start = m_css_cdc.interval.end;
          -
          2452 }
          -
          2453 else if (
          -
          2454 m_css_import.match(m_source, start, end) && (section = m_css_import.interval, content = m_css_import.content, true) ||
          -
          2455 m_css_uri.match(m_source, start, end) && (section = m_css_uri.interval, content = m_css_uri.content, true))
          -
          2456 {
          -
          2457 std::unique_ptr<url_token<_Elem, _Traits, _Alloc>> t_url(
          - -
          2459 nullptr, 0,
          -
          2460 token_url_t::css,
          -
          2461 m_offset->get()));
          -
          2462 css_unescape(t_url->url, m_source + content.start, content.size());
          -
          2463 token->text.append(m_source + start, content.start - start);
          -
          2464 append_token(std::move(t_url), token->text);
          -
          2465 token->text.append(m_source + content.end, section.end - content.end);
          -
          2466 token->text_type |= has_tokens;
          -
          2467 start = section.end;
          -
          2468 }
          -
          2469 else if (m_any_char.match(m_source, start, end)) {
          -
          2470 token->text.append(m_source + start, m_any_char.interval.end - start);
          -
          2471 start = m_any_char.interval.end;
          -
          2472 }
          -
          2473 else
          -
          2474 break;
          -
          2475 }
          -
          2476
          -
          2477 return append_token(std::move(token));
          -
          2478 }
          +
          2268
          +
          +
          2278 token_list::const_iterator end_tokens(_Inout_ std::basic_string<_Elem, _Traits, _Alloc>& source, _Inout_ token_list& active_tokens, _In_ const token_list& new_tokens)
          +
          2279 {
          +
          2280 // Skip matching tokens in active_tokens and new_tokens.
          +
          2281 token_list::const_iterator i1, i2;
          +
          2282 for (i1 = active_tokens.cbegin(), i2 = new_tokens.cbegin(); i1 != active_tokens.cend(); ++i1, ++i2) {
          +
          2283 if (i2 == new_tokens.cend() || *i1 != *i2) {
          +
          2284 // Got two tokens, where lists don't match anymore, or new_tokens list is out.
          +
          2285 // End tokens not relevant anymore in reverse order of starting.
          +
          2286 for (auto i = active_tokens.cend(); i != active_tokens.cbegin(); ) {
          +
          2287 auto t1 = dynamic_cast<starting_token<_Elem, _Traits, _Alloc>*>(*(--i));
          +
          2288 _Assume_(t1 && t1->type == token_t::starting);
          +
          2289
          +
          2290 std::unique_ptr<text_token<_Elem, _Traits, _Alloc>> t2(new text_token<_Elem, _Traits, _Alloc>(token_t::ending));
          +
          2291 t2->text.reserve(t1->name.size() + 3);
          +
          2292 t2->text += '<';
          +
          2293 t2->text += '/';
          +
          2294 t2->text += t1->name;
          +
          2295 t2->text += '>';
          +
          2296 append_token(std::move(t2), source);
          +
          2297
          +
          2298 // Pop the active token.
          +
          2299 if (i1 == i) {
          +
          2300 active_tokens.erase(i);
          +
          2301 break;
          +
          2302 }
          +
          2303 active_tokens.erase(i);
          +
          2304 i = active_tokens.cend();
          +
          2305 }
          +
          2306 break;
          +
          2307 }
          +
          2308 }
          +
          2309 return i2;
          +
          2310 }
          -
          2479
          -
          2480 protected:
          - -
          2482 const stdex::sys_string m_url;
          -
          2483 const bool m_parse_frames;
          - -
          2485 const _Elem* m_source;
          -
          2486 token_vector m_tokens;
          -
          2487 sequence_store::const_iterator m_offset;
          -
          2488
          -
          2489 // For detecting URLs in CSS
          - - - - - - - -
          2497 };
          +
          2311
          +
          +
          2321 void append_inserted_tokens(_Inout_ std::basic_string<_Elem, _Traits, _Alloc>& source, _Inout_ inserted_token_list& inserted_tokens,
          +
          2322 _In_ size_t word_index, _In_ bool after_word,
          +
          2323 _Inout_ token_list& active_tokens)
          +
          2324 {
          +
          2325 for (auto i = inserted_tokens.begin(); i != inserted_tokens.end(); ) {
          +
          2326 auto& t = *i;
          +
          2327 _Assume_(t.token);
          +
          2328 if (t.word_index == word_index && t.after_word == after_word) {
          +
          2329 if (t.token->type != token_t::ending)
          +
          2330 start_tokens(source, active_tokens, t.active_tokens, end_tokens(source, active_tokens, t.active_tokens));
          +
          2331 t.token->append_tag(source);
          +
          2332 inserted_tokens.erase(i++);
          +
          2333 }
          +
          2334 else
          +
          2335 ++i;
          +
          2336 }
          +
          2337 }
          -
          2498 }
          -
          2499}
          -
          HTML comment.
          Definition html.hpp:1383
          -
          stdex::interval< size_t > content
          Comment content position in source.
          Definition html.hpp:1392
          -
          HTML declaration.
          Definition html.hpp:1365
          -
          stdex::interval< size_t > name
          Declaration name position in source.
          Definition html.hpp:1375
          -
          std::vector< stdex::parser::html_attribute > attributes
          Declaration attribute positions in source.
          Definition html.hpp:1376
          -
          HTML document.
          Definition html.hpp:1432
          -
          std::vector< element_start * > m_element_stack
          LIFO stack of started elements.
          Definition html.hpp:1767
          -
          void finalize()
          Finalizes document when no more appending is planned.
          Definition html.hpp:1683
          -
          stdex::charset_id m_charset
          Document charset.
          Definition html.hpp:1752
          -
          bool m_is_rcdata
          Inside of RCDATA?
          Definition html.hpp:1758
          -
          bool m_is_special_element
          Inside of a special element (<SCRIPT>, <STYLE>, ...)?
          Definition html.hpp:1768
          -
          void append(_In_reads_or_z_opt_(num_chars) const _Elem *source, size_t num_chars=SIZE_MAX)
          Parses HTML source code by chunks.
          Definition html.hpp:1472
          -
          sequence_store m_sequences
          Store of sequences.
          Definition html.hpp:1766
          -
          size_t m_num_invalid_conditions
          Number of started invalid conditions.
          Definition html.hpp:1756
          -
          void assign(_In_reads_or_z_opt_(num_chars) const _Elem *source, size_t num_chars=SIZE_MAX)
          Parses HTML document source code.
          Definition html.hpp:1695
          -
          std::vector< std::unique_ptr< entity< _Elem, _Traits, _Alloc > > > m_entities
          Array of entities.
          Definition html.hpp:1762
          -
          std::basic_string< _Elem, _Traits, _Alloc > m_source
          Document HTML source code.
          Definition html.hpp:1750
          -
          element_start * active_element() const
          Returns starting tag of currently active element or nullptr if no element is known to be started.
          Definition html.hpp:1713
          -
          std::basic_string< _Elem, _Traits, _Alloc > replace_entities(_In_reads_or_z_opt_(num_chars) const _Elem *input, size_t num_chars) const
          Replaces entities with their content.
          Definition html.hpp:1721
          -
          void clear()
          Empties document.
          Definition html.hpp:1451
          -
          size_t m_num_valid_conditions
          Number of started valid conditions.
          Definition html.hpp:1755
          -
          const std::basic_string< _Elem, _Traits, _Alloc > & source() const
          Returns document HTML source code.
          Definition html.hpp:1705
          -
          size_t m_num_parsed
          Number of characters already parsed.
          Definition html.hpp:1751
          -
          bool m_is_cdata
          Inside of CDATA?
          Definition html.hpp:1757
          -
          Ending tag of an HTML element </...>
          Definition html.hpp:1345
          -
          stdex::interval< size_t > name
          Element name position in source.
          Definition html.hpp:1357
          -
          element_start * start
          Corresponding starting tag.
          Definition html.hpp:1358
          -
          element_t code
          Element code.
          Definition html.hpp:1356
          -
          Starting tag of an HTML element <...>
          Definition html.hpp:1329
          -
          sequence * end
          Corresponding ending tag of type element_end; When element is ended by a start of another element,...
          Definition html.hpp:1338
          -
          HTML element <.../>
          Definition html.hpp:1150
          -
          stdex::interval< size_t > name
          Element name position in source.
          Definition html.hpp:1319
          -
          std::vector< stdex::parser::html_attribute > attributes
          Element attribute positions in source.
          Definition html.hpp:1320
          -
          element_t code
          Element code.
          Definition html.hpp:1318
          -
          HTML instruction.
          Definition html.hpp:1399
          -
          stdex::interval< size_t > content
          Instruction content position in source.
          Definition html.hpp:1408
          -
          HTML parser.
          Definition html.hpp:1989
          -
          stdex::progress< size_t > * m_progress
          Progress indicator.
          Definition html.hpp:2484
          -
          text_token< _Elem, _Traits, _Alloc > * parse_css(size_t start, size_t end)
          Parses CSS.
          Definition html.hpp:2430
          -
          static void merge(token_list &a, const token_list &b)
          Adds tokens from list b to list a creating an union.
          Definition html.hpp:2177
          -
          token_list::const_iterator end_tokens(std::basic_string< _Elem, _Traits, _Alloc > &source, token_list &active_tokens, const token_list &new_tokens)
          Pops ending tokens from the active token list and append their tags to the source code string.
          Definition html.hpp:2110
          -
          static void link(std::basic_string< _Elem, _Traits, _Alloc > &source, const text_token< _Elem, _Traits, _Alloc > *t)
          Rebuilds HTML source code from the token tree.
          Definition html.hpp:2025
          -
          text_token< _Elem, _Traits, _Alloc > * parse(const sequence_store::const_iterator &end, uint32_t text_type=0)
          Recursively parses HTML document.
          Definition html.hpp:2255
          -
          const _Elem * m_source
          HTML source code.
          Definition html.hpp:2485
          -
          token_vector m_tokens
          HTML token storage.
          Definition html.hpp:2486
          -
          text_token< _Elem, _Traits, _Alloc > * parse()
          Parses HTML document.
          Definition html.hpp:2005
          -
          const document< _Elem, _Traits, _Alloc > & m_document
          Document being analyzed.
          Definition html.hpp:2481
          -
          void make_absolute_url(std::basic_string< _Elem, _Traits, _Alloc > &rel)
          Converts URL to absolute.
          Definition html.hpp:2196
          -
          size_t append_token(std::unique_ptr< T > &&token, std::basic_string< _Elem, _Traits, _Alloc > &source)
          Adds token to the collection and appends its tag to the source code string.
          Definition html.hpp:2238
          -
          const token_vector & tokens() const
          Returns collection of tokens.
          Definition html.hpp:2209
          -
          const stdex::sys_string m_url
          Absolute document URL.
          Definition html.hpp:2482
          -
          const bool m_parse_frames
          Parse frames.
          Definition html.hpp:2483
          -
          static void start_tokens(std::basic_string< _Elem, _Traits, _Alloc > &source, token_list &active_tokens, const token_list &new_tokens, token_list::const_iterator from)
          Pushes tokens to the active token list and appends their tags to the source code string.
          Definition html.hpp:2092
          -
          T * append_token(std::unique_ptr< T > &&token)
          Adds token to the collection.
          Definition html.hpp:2220
          -
          void append_inserted_tokens(std::basic_string< _Elem, _Traits, _Alloc > &source, inserted_token_list &inserted_tokens, size_t word_index, bool after_word, token_list &active_tokens)
          Adds matching inserted tokens before/after the given word in source code.
          Definition html.hpp:2153
          -
          sequence_store::const_iterator m_offset
          Index of active section.
          Definition html.hpp:2487
          -
          Base class for HTML sequences.
          Definition html.hpp:1131
          -
          stdex::interval< size_t > interval
          Sequence position in source.
          Definition html.hpp:1134
          -
          stdex::parser::html_sequence_t type
          Sequence type. Enum is used for performance reasons (vs. dynamic_cast)
          Definition html.hpp:1133
          -
          sequence * parent
          Parent sequence.
          Definition html.hpp:1135
          -
          Token representing start HTML tag.
          Definition html.hpp:1922
          -
          stdex::html::sequence * end_sequence
          Ending tag sequence.
          Definition html.hpp:1940
          -
          std::basic_string< _Elem, _Traits, _Alloc > name
          Element name allowing later recreation of ending </tag>
          Definition html.hpp:1939
          -
          Token representing part of HTML text.
          Definition html.hpp:1897
          -
          stdex::mapping_vector< size_t > mapping
          Mapping between source and text positions.
          Definition html.hpp:1914
          -
          std::basic_string< _Elem, _Traits, _Alloc > text
          Token text.
          Definition html.hpp:1912
          -
          uint32_t text_type
          Mask of text_type_flag_t to specify text content.
          Definition html.hpp:1913
          -
          HTML token base class.
          Definition html.hpp:1806
          -
          sequence * sequence
          Pointer to the sequence this token represents or nullptr when it doesn't trivially represent one sequ...
          Definition html.hpp:1875
          -
          size_t append_tag(std::basic_string< char, _Traits, _Alloc > &str) const
          Appends token tag to the source code.
          Definition html.hpp:1828
          -
          uintptr_t data
          Any user-supplied data.
          Definition html.hpp:1876
          -
          token_t type
          Token type.
          Definition html.hpp:1874
          -
          size_t append_tag(std::basic_string< wchar_t, _Traits, _Alloc > &str) const
          Appends token tag to the source code.
          Definition html.hpp:1844
          -
          HTTP token representing an URL.
          Definition html.hpp:1957
          -
          token_url_t encoding
          URL encoding.
          Definition html.hpp:1972
          -
          std::basic_string< _Elem, _Traits, _Alloc > url
          URL.
          Definition html.hpp:1971
          +
          2338
          +
          +
          2345 static void merge(_Inout_ token_list& a, _In_ const token_list& b)
          +
          2346 {
          +
          2347 for (auto i2 = b.begin(); i2 != b.end(); ++i2) {
          +
          2348 auto t2 = *i2;
          +
          2349 for (auto i1 = a.begin(); i1 != a.end(); ++i1) {
          +
          2350 if (i1 == a.end()) {
          +
          2351 a.push_back(t2);
          +
          2352 break;
          +
          2353 }
          +
          2354 auto t1 = *i1;
          +
          2355 if (t1 == t2)
          +
          2356 break;
          +
          2357 }
          +
          2358 }
          +
          2359 }
          +
          +
          2360
          +
          +
          2364 void make_absolute_url(std::basic_string<_Elem, _Traits, _Alloc>& rel)
          +
          2365 {
          +
          2366 _Unreferenced_(rel);
          +
          2367
          +
          2368 if (m_url.empty())
          +
          2369 return;
          +
          2370
          +
          2371 // TODO: Implement!
          +
          2372 }
          +
          +
          2373
          +
          2377 inline const token_vector& tokens() const { return m_tokens; }
          +
          2378
          +
          2379 protected:
          +
          2387 template <class T>
          +
          +
          2388 inline T* append_token(_Inout_ std::unique_ptr<T>&& token)
          +
          2389 {
          +
          2390 if (!token)
          +
          2391 return nullptr;
          +
          2392 auto t = token.get();
          +
          2393 m_tokens.push_back(std::move(token));
          +
          2394 return t;
          +
          2395 }
          +
          +
          2396
          +
          2405 template <class T>
          +
          +
          2406 inline size_t append_token(_Inout_ std::unique_ptr<T>&& token, _Inout_ std::basic_string<_Elem, _Traits, _Alloc>& source)
          +
          2407 {
          +
          2408 if (!token)
          +
          2409 return 0;
          +
          2410 size_t n = token->append_tag(source);
          +
          2411 m_tokens.push_back(std::move(token));
          +
          2412 return n;
          +
          2413 }
          +
          +
          2414
          +
          +
          2423 text_token<_Elem, _Traits, _Alloc>* parse(_In_ const sequence_store::const_iterator& end, _In_ uint32_t text_type = 0)
          +
          2424 {
          + +
          2426 std::unique_ptr<text_token<_Elem, _Traits, _Alloc>> token(new text_token<_Elem, _Traits, _Alloc>(
          +
          2427 token_t::complete,
          +
          2428 nullptr, 0,
          +
          2429 text_type,
          +
          2430 m_offset != end ? m_offset->get() : nullptr));
          +
          2431
          +
          2432 while (m_offset != end) {
          +
          2433 auto& s = *m_offset;
          +
          2434
          +
          2435 if (m_progress) {
          +
          2436 if (m_progress->cancel())
          +
          2437 throw stdex::user_cancelled();
          +
          2438 m_progress->set(s->interval.start);
          +
          2439 }
          +
          2440
          +
          2441 // No token_tag_start and token_tag_end chars, please.
          +
          2442 _Assume_(
          +
          2443 stdex::strnchr(m_source + s->interval.start, s->interval.size(), static_cast<_Elem>(token_tag_start)) == stdex::npos &&
          +
          2444 stdex::strnchr(m_source + s->interval.start, s->interval.size(), static_cast<_Elem>(token_tag_end)) == stdex::npos);
          +
          2445
          +
          2446 if (s->type == stdex::parser::html_sequence_t::text) {
          +
          2447 rel.from = s->interval.start;
          +
          2448 token->mapping.push_back(rel);
          +
          2449 stdex::sgml2strcat(token->text, m_source + s->interval.start, s->interval.size(), 0, rel, &token->mapping);
          +
          2450 rel.to = token->text.size();
          +
          2451 if (!(token->text_type & has_text) &&
          +
          2452 !stdex::isblank(m_source + s->interval.start, s->interval.size()))
          +
          2453 token->text_type |= has_text;
          +
          2454 ++m_offset;
          +
          2455 }
          +
          2456 else if (s->type == stdex::parser::html_sequence_t::element || s->type == stdex::parser::html_sequence_t::element_start) {
          +
          2457 const element* s_el = static_cast<const element*>(s.get());
          +
          2458 _Assume_(s_el);
          +
          2459 const element_start* s_el_start = s->type == stdex::parser::html_sequence_t::element_start ? static_cast<const element_start*>(s.get()) : nullptr;
          +
          2460 if (s_el->code == element_t::frameset && !m_parse_frames)
          +
          2461 throw std::invalid_argument("<frameset> detected");
          +
          2462
          +
          2463 {
          +
          2464 size_t offset = s->interval.start;
          +
          2465 std::unique_ptr<text_token<_Elem, _Traits, _Alloc>> t(s->type == stdex::parser::html_sequence_t::element || element_traits::span(s_el_start->code) == element_span_t::immediate ?
          +
          2466 new text_token<_Elem, _Traits, _Alloc>(token_t::complete, nullptr, 0, 0, s.get()) :
          +
          2467 new starting_token<_Elem, _Traits, _Alloc>(nullptr, 0, m_source + s_el_start->name.start, s_el_start->name.size(), 0, s.get(), s_el_start->end));
          +
          2468
          +
          2469 // Copy the tag contents, but mind any attributes containing localizable text.
          +
          2470 for (auto& a : s_el->attributes) {
          +
          2471 if (a.value.empty() ||
          +
          2472 stdex::isblank(m_source + a.value.start, a.value.size()))
          +
          2473 continue;
          +
          2474
          +
          2475 if (element_traits::is_uri(s_el->code, m_source + a.name.start, a.name.size())) {
          +
          2476 t->text.append(m_source + offset, a.value.start - offset);
          +
          2477 std::unique_ptr<url_token<_Elem, _Traits, _Alloc>> t_url(new url_token<_Elem, _Traits, _Alloc>(
          +
          2478 nullptr, 0,
          +
          2479 token_url_t::sgml,
          +
          2480 s.get()));
          +
          2481 stdex::sgml2strcat(t_url->url, m_source + a.value.start, a.value.size());
          +
          2482 append_token(std::move(t_url), t->text);
          +
          2483 t->text_type |= has_tokens;
          +
          2484 offset = a.value.end;
          +
          2485 }
          +
          2486 else if (element_traits::is_localizable(s_el->code, m_source + a.name.start, a.name.size())) {
          +
          2487 t->text.append(m_source + offset, a.value.start - offset);
          +
          2488 std::unique_ptr<text_token<_Elem, _Traits, _Alloc>> t_value(new text_token<_Elem, _Traits, _Alloc>(
          +
          2489 token_t::complete,
          +
          2490 nullptr, 0,
          +
          2491 has_text | is_title,
          +
          2492 s.get()));
          +
          2493 stdex::mapping<size_t> rel_value(a.value.start, 0);
          +
          2494 t_value->mapping.push_back(rel_value);
          +
          2495 stdex::sgml2strcat(t_value->text, m_source + a.value.start, a.value.size(), 0, rel_value, &t_value->mapping);
          +
          2496 append_token(std::move(t_value), t->text);
          +
          2497 t->text_type |= has_tokens;
          +
          2498 offset = a.value.end;
          +
          2499 }
          +
          2500 }
          +
          2501
          +
          2502 t->text.append(m_source + offset, s->interval.end - offset);
          +
          2503 rel.from = s->interval.start;
          +
          2504 token->mapping.push_back(rel);
          +
          2505 rel.to += append_token(std::move(t), token->text);
          +
          2506 token->text_type |= has_tokens;
          +
          2507 }
          +
          2508 ++m_offset;
          +
          2509
          +
          2510 if (s_el_start) {
          +
          2511 if (s_el_start->code == element_t::address ||
          +
          2512 s_el_start->code == element_t::code ||
          +
          2513 s_el_start->code == element_t::comment ||
          +
          2514 s_el_start->code == element_t::cite ||
          +
          2515 s_el_start->code == element_t::kbd ||
          +
          2516 s_el_start->code == element_t::samp ||
          +
          2517 s_el_start->code == element_t::script ||
          +
          2518 s_el_start->code == element_t::style)
          +
          2519 {
          +
          2520 // Non-localizable
          +
          2521 auto s_end = s_el_start->end;
          +
          2522 _Assume_(s_end);
          +
          2523
          +
          2524 if (s->interval.end < s_end->interval.start) {
          +
          2525 if (s_el_start->code != element_t::style) {
          +
          2526 rel.from = s->interval.start;
          +
          2527 token->mapping.push_back(rel);
          +
          2528 rel.to += append_token(std::move(std::unique_ptr<text_token<_Elem, _Traits, _Alloc>>(
          + +
          2530 token_t::complete,
          +
          2531 m_source + s->interval.end, s_end->interval.start - s->interval.end,
          +
          2532 0,
          +
          2533 m_offset->get()))),
          +
          2534 token->text);
          +
          2535 }
          +
          2536 else {
          +
          2537 // Partially parse CSS. It may contain URLs we need to make absolute.
          +
          2538 auto t = parse_css(s->interval.end, s_end->interval.start);
          +
          2539 _Assume_(t);
          +
          2540 rel.from = s->interval.start;
          +
          2541 token->mapping.push_back(rel);
          +
          2542 rel.to += t->append_tag(token->text);
          +
          2543 }
          +
          2544 token->text_type |= has_tokens;
          +
          2545 }
          +
          2546 while (m_offset != end && m_offset->get() != s_end)
          +
          2547 ++m_offset;
          +
          2548 }
          +
          2549 else if (element_traits::is_group(s_el_start->code)) {
          +
          2550 auto limit = m_offset;
          +
          2551 while (limit != end && limit->get() != s_el_start->end)
          +
          2552 ++limit;
          +
          2553 auto t = parse(limit,
          +
          2554 (element_traits::is_heading(s_el_start->code) || s_el_start->code == element_t::dt || s_el_start->code == element_t::title ? is_title : 0) |
          +
          2555 (element_traits::is_list(s_el_start->code) ? is_bullet : 0));
          +
          2556 rel.from = s->interval.start;
          +
          2557 token->mapping.push_back(rel);
          +
          2558 rel.to += t->append_tag(token->text);
          +
          2559 token->text_type |= has_tokens;
          +
          2560 }
          +
          2561 }
          +
          2562 }
          +
          2563 else if (s->type == stdex::parser::html_sequence_t::element_end) {
          +
          2564 rel.from = s->interval.start;
          +
          2565 token->mapping.push_back(rel);
          +
          2566 rel.to += append_token(std::move(std::unique_ptr<text_token<_Elem, _Traits, _Alloc>>(
          + +
          2568 token_t::ending,
          +
          2569 m_source + s->interval.start, s->interval.size(),
          +
          2570 0,
          +
          2571 s.get()))),
          +
          2572 token->text);
          +
          2573 token->text_type |= has_tokens;
          +
          2574 ++m_offset;
          +
          2575 }
          +
          2576 else {
          +
          2577 // Declaration, instruction, (P)CDATA section, comment...
          +
          2578 rel.from = s->interval.start;
          +
          2579 token->mapping.push_back(rel);
          +
          2580 rel.to += append_token(std::move(std::unique_ptr<text_token<_Elem, _Traits, _Alloc>>(
          + +
          2582 token_t::complete,
          +
          2583 m_source + s->interval.start, s->interval.size(),
          +
          2584 0,
          +
          2585 s.get()))),
          +
          2586 token->text);
          +
          2587 token->text_type |= has_tokens;
          +
          2588 ++m_offset;
          +
          2589 }
          +
          2590 }
          +
          2591
          +
          2592 return append_token(std::move(token));
          +
          2593 }
          +
          +
          2594
          +
          + +
          2599 {
          +
          2600 stdex::interval<size_t> section, content;
          +
          2601 std::unique_ptr<text_token<_Elem, _Traits, _Alloc>> token(
          + +
          2603 token_t::complete,
          +
          2604 nullptr, 0,
          +
          2605 0,
          +
          2606 m_offset->get()));
          +
          2607
          +
          2608 for (;;) {
          +
          2609 if (m_css_comment.match(m_source, start, end)) {
          +
          2610 token->text.append(m_source + start, m_css_comment.interval.end - start);
          +
          2611 start = m_css_comment.interval.end;
          +
          2612 }
          +
          2613 else if (m_css_cdo.match(m_source, start, end)) {
          +
          2614 token->text.append(m_source + start, m_css_cdo.interval.end - start);
          +
          2615 start = m_css_cdo.interval.end;
          +
          2616 }
          +
          2617 else if (m_css_cdc.match(m_source, start, end)) {
          +
          2618 token->text.append(m_source + start, m_css_cdc.interval.end - start);
          +
          2619 start = m_css_cdc.interval.end;
          +
          2620 }
          +
          2621 else if (
          +
          2622 m_css_import.match(m_source, start, end) && (section = m_css_import.interval, content = m_css_import.content, true) ||
          +
          2623 m_css_uri.match(m_source, start, end) && (section = m_css_uri.interval, content = m_css_uri.content, true))
          +
          2624 {
          +
          2625 std::unique_ptr<url_token<_Elem, _Traits, _Alloc>> t_url(
          + +
          2627 nullptr, 0,
          +
          2628 token_url_t::css,
          +
          2629 m_offset->get()));
          +
          2630 css_unescape(t_url->url, m_source + content.start, content.size());
          +
          2631 token->text.append(m_source + start, content.start - start);
          +
          2632 append_token(std::move(t_url), token->text);
          +
          2633 token->text.append(m_source + content.end, section.end - content.end);
          +
          2634 token->text_type |= has_tokens;
          +
          2635 start = section.end;
          +
          2636 }
          +
          2637 else if (m_any_char.match(m_source, start, end)) {
          +
          2638 token->text.append(m_source + start, m_any_char.interval.end - start);
          +
          2639 start = m_any_char.interval.end;
          +
          2640 }
          +
          2641 else
          +
          2642 break;
          +
          2643 }
          +
          2644
          +
          2645 return append_token(std::move(token));
          +
          2646 }
          +
          +
          2647
          +
          2648 protected:
          + +
          2650 const stdex::sstring m_url;
          +
          2651 const bool m_parse_frames;
          + +
          2653 const _Elem* m_source;
          +
          2654 token_vector m_tokens;
          +
          2655 sequence_store::const_iterator m_offset;
          +
          2656
          +
          2657 // For detecting URLs in CSS
          + + + + + + + +
          2665 };
          +
          +
          2666 }
          +
          2667}
          +
          HTML comment.
          Definition html.hpp:1551
          +
          stdex::interval< size_t > content
          Comment content position in source.
          Definition html.hpp:1560
          +
          HTML declaration.
          Definition html.hpp:1533
          +
          stdex::interval< size_t > name
          Declaration name position in source.
          Definition html.hpp:1543
          +
          std::vector< stdex::parser::html_attribute > attributes
          Declaration attribute positions in source.
          Definition html.hpp:1544
          +
          HTML document.
          Definition html.hpp:1600
          +
          std::vector< element_start * > m_element_stack
          LIFO stack of started elements.
          Definition html.hpp:1935
          +
          void finalize()
          Finalizes document when no more appending is planned.
          Definition html.hpp:1851
          +
          stdex::charset_id m_charset
          Document charset.
          Definition html.hpp:1920
          +
          bool m_is_rcdata
          Inside of RCDATA?
          Definition html.hpp:1926
          +
          bool m_is_special_element
          Inside of a special element (<SCRIPT>, <STYLE>, ...)?
          Definition html.hpp:1936
          +
          sequence_store m_sequences
          Store of sequences.
          Definition html.hpp:1934
          +
          size_t m_num_invalid_conditions
          Number of started invalid conditions.
          Definition html.hpp:1924
          +
          std::vector< std::unique_ptr< entity< _Elem, _Traits, _Alloc > > > m_entities
          Array of entities.
          Definition html.hpp:1930
          +
          std::basic_string< _Elem, _Traits, _Alloc > m_source
          Document HTML source code.
          Definition html.hpp:1918
          +
          void assign(_In_reads_or_z_opt_(num_chars) const _Elem *source, size_t num_chars)
          Parses HTML document source code.
          Definition html.hpp:1863
          +
          element_start * active_element() const
          Returns starting tag of currently active element or nullptr if no element is known to be started.
          Definition html.hpp:1881
          +
          std::basic_string< _Elem, _Traits, _Alloc > replace_entities(_In_reads_or_z_opt_(num_chars) const _Elem *input, size_t num_chars) const
          Replaces entities with their content.
          Definition html.hpp:1889
          +
          void clear()
          Empties document.
          Definition html.hpp:1619
          +
          size_t m_num_valid_conditions
          Number of started valid conditions.
          Definition html.hpp:1923
          +
          const std::basic_string< _Elem, _Traits, _Alloc > & source() const
          Returns document HTML source code.
          Definition html.hpp:1873
          +
          size_t m_num_parsed
          Number of characters already parsed.
          Definition html.hpp:1919
          +
          bool m_is_cdata
          Inside of CDATA?
          Definition html.hpp:1925
          +
          void append(_In_reads_or_z_opt_(num_chars) const _Elem *source, size_t num_chars)
          Parses HTML source code by chunks.
          Definition html.hpp:1640
          +
          Ending tag of an HTML element </...>
          Definition html.hpp:1513
          +
          stdex::interval< size_t > name
          Element name position in source.
          Definition html.hpp:1525
          +
          element_start * start
          Corresponding starting tag.
          Definition html.hpp:1526
          +
          element_t code
          Element code.
          Definition html.hpp:1524
          +
          Starting tag of an HTML element <...>
          Definition html.hpp:1497
          +
          sequence * end
          Corresponding ending tag of type element_end; When element is ended by a start of another element,...
          Definition html.hpp:1506
          +
          HTML element <.../>
          Definition html.hpp:1318
          +
          stdex::interval< size_t > name
          Element name position in source.
          Definition html.hpp:1487
          +
          std::vector< stdex::parser::html_attribute > attributes
          Element attribute positions in source.
          Definition html.hpp:1488
          +
          element_t code
          Element code.
          Definition html.hpp:1486
          +
          HTML instruction.
          Definition html.hpp:1567
          +
          stdex::interval< size_t > content
          Instruction content position in source.
          Definition html.hpp:1576
          +
          HTML parser.
          Definition html.hpp:2157
          +
          stdex::progress< size_t > * m_progress
          Progress indicator.
          Definition html.hpp:2652
          +
          text_token< _Elem, _Traits, _Alloc > * parse_css(size_t start, size_t end)
          Parses CSS.
          Definition html.hpp:2598
          +
          static void merge(token_list &a, const token_list &b)
          Adds tokens from list b to list a creating an union.
          Definition html.hpp:2345
          +
          token_list::const_iterator end_tokens(std::basic_string< _Elem, _Traits, _Alloc > &source, token_list &active_tokens, const token_list &new_tokens)
          Pops ending tokens from the active token list and append their tags to the source code string.
          Definition html.hpp:2278
          +
          static void link(std::basic_string< _Elem, _Traits, _Alloc > &source, const text_token< _Elem, _Traits, _Alloc > *t)
          Rebuilds HTML source code from the token tree.
          Definition html.hpp:2193
          +
          text_token< _Elem, _Traits, _Alloc > * parse(const sequence_store::const_iterator &end, uint32_t text_type=0)
          Recursively parses HTML document.
          Definition html.hpp:2423
          +
          const _Elem * m_source
          HTML source code.
          Definition html.hpp:2653
          +
          token_vector m_tokens
          HTML token storage.
          Definition html.hpp:2654
          +
          text_token< _Elem, _Traits, _Alloc > * parse()
          Parses HTML document.
          Definition html.hpp:2173
          +
          const document< _Elem, _Traits, _Alloc > & m_document
          Document being analyzed.
          Definition html.hpp:2649
          +
          void make_absolute_url(std::basic_string< _Elem, _Traits, _Alloc > &rel)
          Converts URL to absolute.
          Definition html.hpp:2364
          +
          size_t append_token(std::unique_ptr< T > &&token, std::basic_string< _Elem, _Traits, _Alloc > &source)
          Adds token to the collection and appends its tag to the source code string.
          Definition html.hpp:2406
          +
          const token_vector & tokens() const
          Returns collection of tokens.
          Definition html.hpp:2377
          +
          const stdex::sstring m_url
          Absolute document URL.
          Definition html.hpp:2650
          +
          const bool m_parse_frames
          Parse frames.
          Definition html.hpp:2651
          +
          static void start_tokens(std::basic_string< _Elem, _Traits, _Alloc > &source, token_list &active_tokens, const token_list &new_tokens, token_list::const_iterator from)
          Pushes tokens to the active token list and appends their tags to the source code string.
          Definition html.hpp:2260
          +
          T * append_token(std::unique_ptr< T > &&token)
          Adds token to the collection.
          Definition html.hpp:2388
          +
          void append_inserted_tokens(std::basic_string< _Elem, _Traits, _Alloc > &source, inserted_token_list &inserted_tokens, size_t word_index, bool after_word, token_list &active_tokens)
          Adds matching inserted tokens before/after the given word in source code.
          Definition html.hpp:2321
          +
          sequence_store::const_iterator m_offset
          Index of active section.
          Definition html.hpp:2655
          +
          Base class for HTML sequences.
          Definition html.hpp:1299
          +
          stdex::interval< size_t > interval
          Sequence position in source.
          Definition html.hpp:1302
          +
          stdex::parser::html_sequence_t type
          Sequence type. Enum is used for performance reasons (vs. dynamic_cast)
          Definition html.hpp:1301
          +
          sequence * parent
          Parent sequence.
          Definition html.hpp:1303
          +
          Token representing start HTML tag.
          Definition html.hpp:2090
          +
          stdex::html::sequence * end_sequence
          Ending tag sequence.
          Definition html.hpp:2108
          +
          std::basic_string< _Elem, _Traits, _Alloc > name
          Element name allowing later recreation of ending </tag>
          Definition html.hpp:2107
          +
          Token representing part of HTML text.
          Definition html.hpp:2065
          +
          stdex::mapping_vector< size_t > mapping
          Mapping between source and text positions.
          Definition html.hpp:2082
          +
          std::basic_string< _Elem, _Traits, _Alloc > text
          Token text.
          Definition html.hpp:2080
          +
          uint32_t text_type
          Mask of text_type_flag_t to specify text content.
          Definition html.hpp:2081
          +
          HTML token base class.
          Definition html.hpp:1974
          +
          sequence * sequence
          Pointer to the sequence this token represents or nullptr when it doesn't trivially represent one sequ...
          Definition html.hpp:2043
          +
          size_t append_tag(std::basic_string< char, _Traits, _Alloc > &str) const
          Appends token tag to the source code.
          Definition html.hpp:1996
          +
          uintptr_t data
          Any user-supplied data.
          Definition html.hpp:2044
          +
          token_t type
          Token type.
          Definition html.hpp:2042
          +
          size_t append_tag(std::basic_string< wchar_t, _Traits, _Alloc > &str) const
          Appends token tag to the source code.
          Definition html.hpp:2012
          +
          HTTP token representing an URL.
          Definition html.hpp:2125
          +
          token_url_t encoding
          URL encoding.
          Definition html.hpp:2140
          +
          std::basic_string< _Elem, _Traits, _Alloc > url
          URL.
          Definition html.hpp:2139
          stdex::interval< size_t > content
          content position in source
          Definition parser.hpp:7833
          stdex::interval< size_t > content
          content position in source
          Definition parser.hpp:7748
          std::vector< html_attribute > attributes
          tag attributes
          Definition parser.hpp:8355
          @@ -2418,34 +2514,34 @@ $(document).ready(function() { init_codefold(0); });
          virtual void set(T value)
          Set current progress.
          Definition progress.hpp:47
          virtual void set_range(T start, T end)
          Set progress range extent.
          Definition progress.hpp:37
          User cancelled exception.
          Definition exception.hpp:17
          -
          Describes attributes associated with a HTML element.
          Definition html.hpp:515
          -
          static bool is_group(element_t code)
          Does element represent a separate part of text?
          Definition html.hpp:920
          -
          static bool is_flow(element_t code)
          Does element typically represent text?
          Definition html.hpp:834
          -
          static bool is_heading(element_t code)
          Does element represent a heading?
          Definition html.hpp:752
          -
          static bool is_head_content(element_t code)
          Is element part of the document head?
          Definition html.hpp:844
          -
          static bool is_fontstyle(element_t code)
          Does element represent font styling?
          Definition html.hpp:640
          -
          static bool is_block(element_t code)
          Is element typically displayed as a stand-alone section of text?
          Definition html.hpp:803
          -
          static bool is_head_misc(element_t code)
          May element be a part of document head?
          Definition html.hpp:861
          -
          static bool is_list(element_t code)
          Does element represent a list of items?
          Definition html.hpp:771
          -
          static bool is_uri(element_t code, _In_reads_or_z_opt_(num_chars) const T *attr_name, size_t num_chars)
          Checks if expected element attribute value is URI.
          Definition html.hpp:1050
          -
          static bool is_preformatted(element_t code)
          Does element represent preformatted text, source code etc.?
          Definition html.hpp:788
          -
          static bool is_localizable(element_t code, const T *attr_name, size_t num_chars)
          Checks if expected element attribute value is localizable.
          Definition html.hpp:1105
          -
          static bool is_special(element_t code)
          Does element represent non-textual item in the document?
          Definition html.hpp:686
          -
          static bool is_pre_exclusion(element_t code)
          May element be a part of.
          Definition html.hpp:879
          -
          static bool is_inline(element_t code)
          Is element typically displayed inline with text?
          Definition html.hpp:737
          -
          static bool is_html_content(element_t code)
          Does element represent the document body?
          Definition html.hpp:904
          -
          static bool is_formctrl(element_t code)
          Does element represent a form control?
          Definition html.hpp:719
          -
          static bool is_phrase(element_t code)
          Does element represent a phrase-of-speech?
          Definition html.hpp:662
          -
          static bool may_contain(element_t parent, element_t child)
          Checks if one element may nest inside another.
          Definition html.hpp:950
          -
          static element_span_t span(element_t code)
          Returns expected element span in HTML code.
          Definition html.hpp:521
          -
          HTML entity.
          Definition html.hpp:1416
          -
          stdex::interval< size_t > name
          Name position in source.
          Definition html.hpp:1417
          -
          std::basic_string< _Elem, _Traits, _Alloc > value
          Entity value.
          Definition html.hpp:1418
          -
          Inserted HTML token.
          Definition html.hpp:1978
          -
          bool after_word
          true if token is anchored after the word; false if anchored before the word
          Definition html.hpp:1982
          -
          std::list< stdex::html::token * > active_tokens
          List of started tokens at inserted token.
          Definition html.hpp:1980
          -
          size_t word_index
          Index of the word, token is anchored to.
          Definition html.hpp:1981
          -
          token * token
          Points to the token.
          Definition html.hpp:1979
          +
          Describes attributes associated with a HTML element.
          Definition html.hpp:683
          +
          static bool is_group(element_t code)
          Does element represent a separate part of text?
          Definition html.hpp:1088
          +
          static bool is_flow(element_t code)
          Does element typically represent text?
          Definition html.hpp:1002
          +
          static bool is_heading(element_t code)
          Does element represent a heading?
          Definition html.hpp:920
          +
          static bool is_head_content(element_t code)
          Is element part of the document head?
          Definition html.hpp:1012
          +
          static bool is_fontstyle(element_t code)
          Does element represent font styling?
          Definition html.hpp:808
          +
          static bool is_block(element_t code)
          Is element typically displayed as a stand-alone section of text?
          Definition html.hpp:971
          +
          static bool is_head_misc(element_t code)
          May element be a part of document head?
          Definition html.hpp:1029
          +
          static bool is_list(element_t code)
          Does element represent a list of items?
          Definition html.hpp:939
          +
          static bool is_uri(element_t code, _In_reads_or_z_opt_(num_chars) const T *attr_name, size_t num_chars)
          Checks if expected element attribute value is URI.
          Definition html.hpp:1218
          +
          static bool is_preformatted(element_t code)
          Does element represent preformatted text, source code etc.?
          Definition html.hpp:956
          +
          static bool is_localizable(element_t code, const T *attr_name, size_t num_chars)
          Checks if expected element attribute value is localizable.
          Definition html.hpp:1273
          +
          static bool is_special(element_t code)
          Does element represent non-textual item in the document?
          Definition html.hpp:854
          +
          static bool is_pre_exclusion(element_t code)
          May element be a part of.
          Definition html.hpp:1047
          +
          static bool is_inline(element_t code)
          Is element typically displayed inline with text?
          Definition html.hpp:905
          +
          static bool is_html_content(element_t code)
          Does element represent the document body?
          Definition html.hpp:1072
          +
          static bool is_formctrl(element_t code)
          Does element represent a form control?
          Definition html.hpp:887
          +
          static bool is_phrase(element_t code)
          Does element represent a phrase-of-speech?
          Definition html.hpp:830
          +
          static bool may_contain(element_t parent, element_t child)
          Checks if one element may nest inside another.
          Definition html.hpp:1118
          +
          static element_span_t span(element_t code)
          Returns expected element span in HTML code.
          Definition html.hpp:689
          +
          HTML entity.
          Definition html.hpp:1584
          +
          stdex::interval< size_t > name
          Name position in source.
          Definition html.hpp:1585
          +
          std::basic_string< _Elem, _Traits, _Alloc > value
          Entity value.
          Definition html.hpp:1586
          +
          Inserted HTML token.
          Definition html.hpp:2146
          +
          bool after_word
          true if token is anchored after the word; false if anchored before the word
          Definition html.hpp:2150
          +
          std::list< stdex::html::token * > active_tokens
          List of started tokens at inserted token.
          Definition html.hpp:2148
          +
          size_t word_index
          Index of the word, token is anchored to.
          Definition html.hpp:2149
          +
          token * token
          Points to the token.
          Definition html.hpp:2147
          Numerical interval.
          Definition interval.hpp:18
          T size() const
          Returns interval size.
          Definition interval.hpp:47
          T end
          interval end
          Definition interval.hpp:20
          @@ -2457,7 +2553,7 @@ $(document).ready(function() { init_codefold(0); });
          diff --git a/idrec_8hpp_source.html b/idrec_8hpp_source.html index 38beea8d4..442b95cb4 100644 --- a/idrec_8hpp_source.html +++ b/idrec_8hpp_source.html @@ -459,19 +459,19 @@ $(document).ready(function() { init_codefold(0); });
          friend std::ostream & operator<<(std::ostream &stream, const record< T, T_ID, ID, T_SIZE, ALIGN > r)
          Writes record to a stream.
          Definition idrec.hpp:405
          record(const T &d)
          Constructs the class.
          Definition idrec.hpp:292
          static std::streamoff close(std::ostream &stream, std::streamoff start)
          Updates record header.
          Definition idrec.hpp:347
          -
          Basic seekable stream operations.
          Definition stream.hpp:824
          +
          Basic seekable stream operations.
          Definition stream.hpp:812
          ‍UTF-8 byte-order-mark
          Definition stream.hpp:79
          bool ok() const
          Returns true if the stream state is clean i.e. previous operation was succesful.
          Definition stream.hpp:175
          virtual void skip(fsize_t amount)
          Skips given amount of bytes of data on the stream.
          Definition stream.hpp:142
          -
          Limits reading from/writing to stream to a predefined number of bytes.
          Definition stream.hpp:1551
          -
          fsize_t read_limit
          Number of bytes left that may be read from the stream.
          Definition stream.hpp:1603
          -
          In-memory file.
          Definition stream.hpp:3178
          -
          virtual fpos_t seek(foff_t offset, seek_t how=seek_t::beg)
          Seeks to specified relative file position.
          Definition stream.hpp:3856
          -
          const void * data() const
          Returns pointer to data.
          Definition stream.hpp:3505
          +
          Limits reading from/writing to stream to a predefined number of bytes.
          Definition stream.hpp:1539
          +
          fsize_t read_limit
          Number of bytes left that may be read from the stream.
          Definition stream.hpp:1591
          +
          In-memory file.
          Definition stream.hpp:3171
          +
          virtual fpos_t seek(foff_t offset, seek_t how=seek_t::beg)
          Seeks to specified relative file position.
          Definition stream.hpp:3849
          +
          const void * data() const
          Returns pointer to data.
          Definition stream.hpp:3498
          diff --git a/include_2stdex_2compat_8hpp_source.html b/include_2stdex_2compat_8hpp_source.html index 3b5f281d6..ca9962624 100644 --- a/include_2stdex_2compat_8hpp_source.html +++ b/include_2stdex_2compat_8hpp_source.html @@ -294,7 +294,7 @@ $(document).ready(function() { init_codefold(0); });
          diff --git a/index.html b/index.html index 90c3a84fb..d07aff1d1 100644 --- a/index.html +++ b/index.html @@ -84,7 +84,7 @@ Requirements
          diff --git a/interval_8hpp_source.html b/interval_8hpp_source.html index 87e91c6b6..4d40c77aa 100644 --- a/interval_8hpp_source.html +++ b/interval_8hpp_source.html @@ -231,7 +231,7 @@ $(document).ready(function() { init_codefold(0); });
          diff --git a/locale_8hpp_source.html b/locale_8hpp_source.html index 7a31b5509..cc07ec24f 100644 --- a/locale_8hpp_source.html +++ b/locale_8hpp_source.html @@ -149,7 +149,7 @@ $(document).ready(function() { init_codefold(0); });
          diff --git a/mapping_8hpp_source.html b/mapping_8hpp_source.html index b5f168769..d8be73446 100644 --- a/mapping_8hpp_source.html +++ b/mapping_8hpp_source.html @@ -124,7 +124,7 @@ $(document).ready(function() { init_codefold(0); });
          diff --git a/math_8cpp_source.html b/math_8cpp_source.html index dfbd8ca3b..964b4aa78 100644 --- a/math_8cpp_source.html +++ b/math_8cpp_source.html @@ -129,7 +129,7 @@ $(document).ready(function() { init_codefold(0); });
          diff --git a/math_8hpp_source.html b/math_8hpp_source.html index 19ac47094..030e8ff18 100644 --- a/math_8hpp_source.html +++ b/math_8hpp_source.html @@ -147,7 +147,7 @@ $(document).ready(function() { init_codefold(0); });
          diff --git a/memory_8hpp_source.html b/memory_8hpp_source.html index 4af1f8f55..2f68bf840 100644 --- a/memory_8hpp_source.html +++ b/memory_8hpp_source.html @@ -129,7 +129,7 @@ $(document).ready(function() { init_codefold(0); });
          diff --git a/parser_8cpp_source.html b/parser_8cpp_source.html index 0e5318f39..7c3aec89f 100644 --- a/parser_8cpp_source.html +++ b/parser_8cpp_source.html @@ -597,7 +597,7 @@ $(document).ready(function() { init_codefold(0); });
          diff --git a/parser_8hpp_source.html b/parser_8hpp_source.html index b9e0cf091..c826f01de 100644 --- a/parser_8hpp_source.html +++ b/parser_8hpp_source.html @@ -8635,7 +8635,7 @@ $(document).ready(function() { init_codefold(0); });
          diff --git a/pch_8hpp_source.html b/pch_8hpp_source.html index 84fe87dbf..99da0eb95 100644 --- a/pch_8hpp_source.html +++ b/pch_8hpp_source.html @@ -125,7 +125,7 @@ $(document).ready(function() { init_codefold(0); });
          diff --git a/pool_8hpp_source.html b/pool_8hpp_source.html index a5498e4a9..f7cf74836 100644 --- a/pool_8hpp_source.html +++ b/pool_8hpp_source.html @@ -170,7 +170,7 @@ $(document).ready(function() { init_codefold(0); });
          diff --git a/progress_8hpp_source.html b/progress_8hpp_source.html index 2c7742b75..af8f66e37 100644 --- a/progress_8hpp_source.html +++ b/progress_8hpp_source.html @@ -331,7 +331,7 @@ $(document).ready(function() { init_codefold(0); });
          diff --git a/ring_8cpp_source.html b/ring_8cpp_source.html index d72e17eb7..c81a0ac78 100644 --- a/ring_8cpp_source.html +++ b/ring_8cpp_source.html @@ -144,7 +144,7 @@ $(document).ready(function() { init_codefold(0); }); diff --git a/ring_8hpp_source.html b/ring_8hpp_source.html index ff47a1e35..08b0b8a29 100644 --- a/ring_8hpp_source.html +++ b/ring_8hpp_source.html @@ -223,7 +223,7 @@ $(document).ready(function() { init_codefold(0); }); diff --git a/search/all_0.js b/search/all_0.js index 64a643561..3f20f69cb 100644 --- a/search/all_0.js +++ b/search/all_0.js @@ -9,11 +9,11 @@ var searchData= ['aosn_5fdate_6',['aosn_date',['../structstdex_1_1chrono_1_1aosn__date.html',1,'stdex::chrono']]], ['aosn_5ftimestamp_7',['aosn_timestamp',['../structstdex_1_1chrono_1_1aosn__timestamp.html',1,'stdex::chrono']]], ['apex_8',['apex',['../classstdex_1_1parser_1_1basic__emoticon.html#a1b6b7a024dea373b890c1c4516f5e9a4',1,'stdex::parser::basic_emoticon']]], - ['append_9',['append',['../classstdex_1_1html_1_1document.html#a79585dbbf1916073dfa9ce8343f3137b',1,'stdex::html::document']]], + ['append_9',['append',['../classstdex_1_1html_1_1document.html#afcc498106968ff9a93b9d106e53152fa',1,'stdex::html::document']]], ['append_5finserted_5ftokens_10',['append_inserted_tokens',['../classstdex_1_1html_1_1parser.html#aee0d308698b67b5abb21442f14bd19d3',1,'stdex::html::parser']]], ['append_5ftag_11',['append_tag',['../classstdex_1_1html_1_1token.html#ae0dd3526834ebda56c0e0cc4639f979e',1,'stdex::html::token::append_tag(std::basic_string< wchar_t, _Traits, _Alloc > &str) const'],['../classstdex_1_1html_1_1token.html#a6f486618bd17716e68e8c51aeb8b39e0',1,'stdex::html::token::append_tag(std::basic_string< char, _Traits, _Alloc > &str) const']]], ['append_5ftoken_12',['append_token',['../classstdex_1_1html_1_1parser.html#aeb7c3071e98511d3215c4fa8c643d1f6',1,'stdex::html::parser::append_token(std::unique_ptr< T > &&token)'],['../classstdex_1_1html_1_1parser.html#a6fe16b4065b1ce300443794aa6d49044',1,'stdex::html::parser::append_token(std::unique_ptr< T > &&token, std::basic_string< _Elem, _Traits, _Alloc > &source)']]], - ['assign_13',['assign',['../classstdex_1_1html_1_1document.html#a85458aea6b21a1154c20e5d6183aa285',1,'stdex::html::document']]], + ['assign_13',['assign',['../classstdex_1_1html_1_1document.html#abc9dea6352db1d92ae7ef33babc50278',1,'stdex::html::document']]], ['async_5freader_14',['async_reader',['../classstdex_1_1stream_1_1async__reader.html',1,'stdex::stream']]], ['async_5fwriter_15',['async_writer',['../classstdex_1_1stream_1_1async__writer.html',1,'stdex::stream']]], ['at_16',['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']]], diff --git a/search/all_14.js b/search/all_14.js index 9acc1aecc..7736ca22c 100644 --- a/search/all_14.js +++ b/search/all_14.js @@ -6,7 +6,7 @@ var searchData= ['word_5findex_3',['word_index',['../structstdex_1_1html_1_1inserted__token.html#ada63f25062c74259e834a4ee0390d9a2',1,'stdex::html::inserted_token']]], ['worker_4',['worker',['../classstdex_1_1stream_1_1replicator_1_1worker.html',1,'stdex::stream::replicator']]], ['write_5',['write',['../classstdex_1_1stream_1_1diag__file.html#a3157aee8e9c754b02e876897fcb82236',1,'stdex::stream::diag_file::write()'],['../classstdex_1_1stream_1_1fifo.html#a30c7adb43b6f4bd0cb5d9c72f15fe9bf',1,'stdex::stream::fifo::write()'],['../classstdex_1_1stream_1_1memory__file.html#ae5b6602e176f1053ab2eef88d8312b49',1,'stdex::stream::memory_file::write()'],['../classstdex_1_1stream_1_1socket.html#ad83f6d5d4844092e9e6831a597c6e2e9',1,'stdex::stream::socket::write()'],['../classstdex_1_1stream_1_1basic__sys.html#a06666e09bf1e7486d277996267b51618',1,'stdex::stream::basic_sys::write()'],['../classstdex_1_1stream_1_1cache.html#ac436fbcac7eddf95b6e25d6368da3fb7',1,'stdex::stream::cache::write()'],['../classstdex_1_1stream_1_1file__window.html#a7a264381cf344fcd6fa70e0a4964cc93',1,'stdex::stream::file_window::write()'],['../classstdex_1_1stream_1_1window.html#a06f05191c35fdbadebc49e05a19d9f3c',1,'stdex::stream::window::write()'],['../classstdex_1_1stream_1_1buffer.html#a489a01a4c187e85f06ebe10314a891ae',1,'stdex::stream::buffer::write()'],['../classstdex_1_1stream_1_1async__writer.html#a39d3fc4fffb8aa9b971fa15beaa8149b',1,'stdex::stream::async_writer::write()'],['../classstdex_1_1stream_1_1replicator.html#abbbaa912a887b00a4a7a5d518079f5ec',1,'stdex::stream::replicator::write()'],['../classstdex_1_1stream_1_1converter.html#ae84a5c8d64942dbaa81ed54a181b3d7a',1,'stdex::stream::converter::write()'],['../classstdex_1_1stream_1_1basic.html#ad8af0444273509eb36ad81046ac92081',1,'stdex::stream::basic::write()'],['../classstdex_1_1stream__hasher.html#aea835790f7aba9fb6ad28363eaaf736b',1,'stdex::stream_hasher::write()'],['../classstdex_1_1base64__writer.html#aaca6933a48a0266e4e46cc93b03ef410',1,'stdex::base64_writer::write()'],['../classstdex_1_1stream_1_1limiter.html#a8fe783b504f019e29034c0572cec7834',1,'stdex::stream::limiter::write()']]], - ['write_5farray_6',['write_array',['../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)'],['../classstdex_1_1stream_1_1basic.html#acdf4521be87593a8d09b2263d04582f8',1,'stdex::stream::basic::write_array(const T_from *wstr, charset_encoder< T_from, T_to > &encoder)'],['../classstdex_1_1stream_1_1basic.html#af43fb72c91263bee7f39c4f51fe0e272',1,'stdex::stream::basic::write_array(_In_reads_or_z_opt_(num_chars) const T_from *wstr, size_t num_chars, charset_encoder< T_from, T_to > &encoder)'],['../classstdex_1_1stream_1_1basic.html#a22f9e1f6c1cf8fbd4e81b236ee41dcc6',1,'stdex::stream::basic::write_array(const std::basic_string< T_from, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)']]], + ['write_5farray_6',['write_array',['../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)'],['../classstdex_1_1stream_1_1basic.html#a01492b8338bf435a5240897085720814',1,'stdex::stream::basic::write_array(const T_from *str, charset_encoder< T_from, T_to > &encoder)'],['../classstdex_1_1stream_1_1basic.html#aeee42cba3d0a542355783241412f3630',1,'stdex::stream::basic::write_array(_In_reads_or_z_opt_(num_chars) const T_from *str, size_t num_chars, charset_encoder< T_from, T_to > &encoder)'],['../classstdex_1_1stream_1_1basic.html#ac817a6ab260e996c9b1b08c995e94ad9',1,'stdex::stream::basic::write_array(const std::basic_string< T_from, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)']]], ['write_5fbyte_7',['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_8',['write_charset',['../classstdex_1_1stream_1_1basic.html#ab61abc19936554288ea929e0eb299144',1,'stdex::stream::basic']]], ['write_5fdata_9',['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()']]], diff --git a/search/all_a.js b/search/all_a.js index 6bb422512..65678acf4 100644 --- a/search/all_a.js +++ b/search/all_a.js @@ -38,7 +38,7 @@ var searchData= ['m_5ftemp_5foff_35',['m_temp_off',['../classstdex_1_1base64__reader.html#affd26a488ea1b5d8b23cc98be45b2535',1,'stdex::base64_reader']]], ['m_5ftimeout_36',['m_timeout',['../classstdex_1_1watchdog.html#a816c03499d71d1fe73410d979744c817',1,'stdex::watchdog']]], ['m_5ftokens_37',['m_tokens',['../classstdex_1_1html_1_1parser.html#a5827d0faa87547c141a69a286fdc6b77',1,'stdex::html::parser']]], - ['m_5furl_38',['m_url',['../classstdex_1_1html_1_1parser.html#a7c40ad04981cca08398cd0d79853dc6a',1,'stdex::html::parser']]], + ['m_5furl_38',['m_url',['../classstdex_1_1html_1_1parser.html#a7804f7cfaeb01e5cbe7fdfe1321fea35',1,'stdex::html::parser']]], ['made_20it_20into_20std_20c_39',['stdex - Random stuff that didn't made it into std C++',['../index.html',1,'']]], ['make_5fabsolute_5furl_40',['make_absolute_url',['../classstdex_1_1html_1_1parser.html#a6eac9b41ad9579e93b8c5f0f3b95c601',1,'stdex::html::parser']]], ['mapping_41',['mapping',['../structstdex_1_1mapping.html',1,'stdex::mapping< T >'],['../classstdex_1_1html_1_1text__token.html#a45822e05f3df782f2abbdf5fa8ca4b8b',1,'stdex::html::text_token::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)']]], diff --git a/search/all_c.js b/search/all_c.js index cb3765555..2573f2620 100644 --- a/search/all_c.js +++ b/search/all_c.js @@ -3,7 +3,7 @@ var searchData= ['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#a0498a09948194be47553433c87121ec4',1,'stdex::idrec::record::open()'],['../classstdex_1_1stream_1_1file.html#a556c4cff7086d5f258dcdf914556084a',1,'stdex::stream::file::open(const schar_t *filename, int mode)'],['../classstdex_1_1stream_1_1file.html#ac00f351491cc50626286119cfdd428fa',1,'stdex::stream::file::open(const stdex::sstring &filename, int mode)'],['../classstdex_1_1stream_1_1cached__file.html#a8a1ac6ccd8e1d321112412d346eec0e1',1,'stdex::stream::cached_file::open(const schar_t *filename, int mode)'],['../classstdex_1_1stream_1_1cached__file.html#a57980b26ff1dcc5d1a328022f35f3336',1,'stdex::stream::cached_file::open(const stdex::sstring &filename, int mode)'],['../classstdex_1_1idrec_1_1record.html#a379d9eeac3c52375982ba75df33604ca',1,'stdex::idrec::record::open()']]], - ['operator_20bool_3',['operator bool',['../structstdex_1_1interval.html#a15945d1ba829410c61466d95922000d0',1,'stdex::interval::operator bool()'],['../classstdex_1_1stream_1_1socket.html#a045afb72557249f0f1f1d0f20d93c15d',1,'stdex::stream::socket::operator bool()'],['../classstdex_1_1sys__object.html#a529b0f9294ed46591389ca3dd9c540f3',1,'stdex::sys_object::operator bool()']]], + ['operator_20bool_3',['operator bool',['../classstdex_1_1sys__object.html#a529b0f9294ed46591389ca3dd9c540f3',1,'stdex::sys_object::operator bool()'],['../classstdex_1_1stream_1_1cached__file.html#acc2376f8b970dac688bc1ad1f99a81c0',1,'stdex::stream::cached_file::operator bool()'],['../classstdex_1_1stream_1_1socket.html#a045afb72557249f0f1f1d0f20d93c15d',1,'stdex::stream::socket::operator bool()'],['../structstdex_1_1interval.html#a15945d1ba829410c61466d95922000d0',1,'stdex::interval::operator bool()']]], ['operator_20const_20t_20_26_4',['operator const T &',['../classstdex_1_1basic__hash.html#a7cacac78cdfbf561da8d9f1a5841c5cb',1,'stdex::basic_hash']]], ['operator_21_3d_5',['operator!=',['../structstdex_1_1interval.html#aaeb80d954770418a600a4c30f6ce6c40',1,'stdex::interval::operator!=()'],['../structstdex_1_1mapping.html#a99e44b5840a155e5ce366d440cbe234b',1,'stdex::mapping::operator!=()']]], ['operator_28_29_6',['operator()',['../structstdex_1_1free__locale__delete.html#ab7a2cd4be45534b436a871e09805b36f',1,'stdex::free_locale_delete']]], diff --git a/search/all_f.js b/search/all_f.js index 0de36269c..a20ac67e3 100644 --- a/search/all_f.js +++ b/search/all_f.js @@ -1,7 +1,7 @@ var searchData= [ ['random_20stuff_20that_20didn_20t_20made_20it_20into_20std_20c_0',['stdex - Random stuff that didn't made it into std C++',['../index.html',1,'']]], - ['read_1',['read',['../classstdex_1_1stream_1_1buffer.html#a2ef05f2df784dce1d1c4319a98cd22e0',1,'stdex::stream::buffer::read()'],['../classstdex_1_1stream_1_1diag__file.html#ac1eaf4a0cfce7e4426cff5f32fc33e6e',1,'stdex::stream::diag_file::read()'],['../classstdex_1_1stream_1_1fifo.html#a84357513740c64a8317370b289c34e40',1,'stdex::stream::fifo::read()'],['../classstdex_1_1stream_1_1memory__file.html#a62a05e7dfb1f374dff881f922543e601',1,'stdex::stream::memory_file::read()'],['../classstdex_1_1stream_1_1socket.html#ad4d8e1368be57d2bd5abd971d880bc79',1,'stdex::stream::socket::read()'],['../classstdex_1_1stream_1_1basic__sys.html#ad5daf3c776b615dcfbb0b0891afdb9d0',1,'stdex::stream::basic_sys::read()'],['../classstdex_1_1stream_1_1cache.html#a43dd464dd032888de79f5cd606adffa9',1,'stdex::stream::cache::read()'],['../classstdex_1_1stream_1_1file__window.html#a9cdfe9f40ccb1f84e121b1b949a21246',1,'stdex::stream::file_window::read()'],['../classstdex_1_1stream_1_1window.html#a45f2420dfc94c07e101186ae2e541e13',1,'stdex::stream::window::read()'],['../classstdex_1_1stream_1_1limiter.html#a80b68f1b4a8fb8c72c09b1313e9d02ed',1,'stdex::stream::limiter::read()'],['../classstdex_1_1stream_1_1async__reader.html#a841c1e3cb01cb96df94701465086a529',1,'stdex::stream::async_reader::read()'],['../classstdex_1_1stream_1_1converter.html#abdca66af4847c6f8b6d87a0909fc061f',1,'stdex::stream::converter::read()'],['../classstdex_1_1stream_1_1basic.html#aa5d4693fd583cd7ef0ffa9b846136a5a',1,'stdex::stream::basic::read()'],['../classstdex_1_1stream__hasher.html#a9727f0c56f11978c2df6e31e8509a38b',1,'stdex::stream_hasher::read()'],['../classstdex_1_1base64__reader.html#af93e15e15612233224b39fc7324cc5ee',1,'stdex::base64_reader::read()']]], + ['read_1',['read',['../classstdex_1_1stream_1_1buffer.html#a2ef05f2df784dce1d1c4319a98cd22e0',1,'stdex::stream::buffer::read()'],['../classstdex_1_1stream_1_1fifo.html#a84357513740c64a8317370b289c34e40',1,'stdex::stream::fifo::read()'],['../classstdex_1_1stream_1_1memory__file.html#a62a05e7dfb1f374dff881f922543e601',1,'stdex::stream::memory_file::read()'],['../classstdex_1_1stream_1_1socket.html#ad4d8e1368be57d2bd5abd971d880bc79',1,'stdex::stream::socket::read()'],['../classstdex_1_1stream_1_1basic__sys.html#ad5daf3c776b615dcfbb0b0891afdb9d0',1,'stdex::stream::basic_sys::read()'],['../classstdex_1_1stream_1_1cache.html#a43dd464dd032888de79f5cd606adffa9',1,'stdex::stream::cache::read()'],['../classstdex_1_1stream_1_1file__window.html#a9cdfe9f40ccb1f84e121b1b949a21246',1,'stdex::stream::file_window::read()'],['../classstdex_1_1stream_1_1window.html#a45f2420dfc94c07e101186ae2e541e13',1,'stdex::stream::window::read()'],['../classstdex_1_1stream_1_1limiter.html#a80b68f1b4a8fb8c72c09b1313e9d02ed',1,'stdex::stream::limiter::read()'],['../classstdex_1_1stream_1_1async__reader.html#a841c1e3cb01cb96df94701465086a529',1,'stdex::stream::async_reader::read()'],['../classstdex_1_1stream_1_1converter.html#abdca66af4847c6f8b6d87a0909fc061f',1,'stdex::stream::converter::read()'],['../classstdex_1_1stream_1_1basic.html#aa5d4693fd583cd7ef0ffa9b846136a5a',1,'stdex::stream::basic::read()'],['../classstdex_1_1stream__hasher.html#a9727f0c56f11978c2df6e31e8509a38b',1,'stdex::stream_hasher::read()'],['../classstdex_1_1base64__reader.html#af93e15e15612233224b39fc7324cc5ee',1,'stdex::base64_reader::read()'],['../classstdex_1_1stream_1_1diag__file.html#ac1eaf4a0cfce7e4426cff5f32fc33e6e',1,'stdex::stream::diag_file::read()']]], ['read_5farray_2',['read_array',['../classstdex_1_1stream_1_1basic.html#a7723ae23bc35c2ffb74380eab5b0a9ba',1,'stdex::stream::basic']]], ['read_5fbyte_3',['read_byte',['../classstdex_1_1stream_1_1basic.html#a600e123c10d6f0604d58ae0e9be95f0b',1,'stdex::stream::basic']]], ['read_5fcharset_4',['read_charset',['../classstdex_1_1stream_1_1basic__file.html#a6a3bc2c76e78363a2232eff12dd5e370',1,'stdex::stream::basic_file']]], @@ -10,8 +10,8 @@ var searchData= ['read_5foffset_7',['read_offset',['../classstdex_1_1stream_1_1window.html#acff67a2931b8f1a85f12806002e7e131',1,'stdex::stream::window']]], ['read_5fremainder_8',['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_9',['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_10',['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#af638f940d1b33788a77cae0336106295',1,'stdex::stream::basic::readln(std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)']]], - ['readln_5fand_5fattach_11',['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#ad0fe3b79743c45e7e0ff426f04cfee08',1,'stdex::stream::basic::readln_and_attach(std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)']]], + ['readln_10',['readln',['../classstdex_1_1stream_1_1basic.html#a21ef1979e99bb0a705cfa9488808a0c7',1,'stdex::stream::basic::readln(std::basic_string< _Elem, _Traits, _Ax > &str)'],['../classstdex_1_1stream_1_1basic.html#a5409ff8fd988c1decbf291471098ac31',1,'stdex::stream::basic::readln(std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)']]], + ['readln_5fand_5fattach_11',['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#a5be6478eb4641c1d6f285f880b5fae50',1,'stdex::stream::basic::readln_and_attach(std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)']]], ['readonly_12',['readonly',['../classstdex_1_1stream_1_1file.html#a40e59814b5a52d659cc568285b9b39b3',1,'stdex::stream::file::readonly(const stdex::schar_t *filename)'],['../classstdex_1_1stream_1_1file.html#a1b4cdda97e50c9590ac85acba6f49467',1,'stdex::stream::file::readonly(const stdex::sstring &filename)']]], ['record_13',['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_14',['reference',['../classstdex_1_1vector__queue.html#a3e8d68368eb5014a2df5b3e26943e28c',1,'stdex::vector_queue::reference'],['../classstdex_1_1parser_1_1basic__creditor__reference.html#a0fe3a5c082dc0424000650eb04124573',1,'stdex::parser::basic_creditor_reference::reference']]], diff --git a/search/functions_0.js b/search/functions_0.js index 841dda4b3..ad725ac27 100644 --- a/search/functions_0.js +++ b/search/functions_0.js @@ -2,11 +2,11 @@ var searchData= [ ['abs_0',['abs',['../classstdex_1_1vector__queue.html#ae31dd1a45546dc1ff91eaa82b97c0e1b',1,'stdex::vector_queue']]], ['active_5felement_1',['active_element',['../classstdex_1_1html_1_1document.html#ac8d974ade6e33245a9354b0fa0c2a762',1,'stdex::html::document']]], - ['append_2',['append',['../classstdex_1_1html_1_1document.html#a79585dbbf1916073dfa9ce8343f3137b',1,'stdex::html::document']]], + ['append_2',['append',['../classstdex_1_1html_1_1document.html#afcc498106968ff9a93b9d106e53152fa',1,'stdex::html::document']]], ['append_5finserted_5ftokens_3',['append_inserted_tokens',['../classstdex_1_1html_1_1parser.html#aee0d308698b67b5abb21442f14bd19d3',1,'stdex::html::parser']]], ['append_5ftag_4',['append_tag',['../classstdex_1_1html_1_1token.html#a6f486618bd17716e68e8c51aeb8b39e0',1,'stdex::html::token::append_tag(std::basic_string< char, _Traits, _Alloc > &str) const'],['../classstdex_1_1html_1_1token.html#ae0dd3526834ebda56c0e0cc4639f979e',1,'stdex::html::token::append_tag(std::basic_string< wchar_t, _Traits, _Alloc > &str) const']]], ['append_5ftoken_5',['append_token',['../classstdex_1_1html_1_1parser.html#aeb7c3071e98511d3215c4fa8c643d1f6',1,'stdex::html::parser::append_token(std::unique_ptr< T > &&token)'],['../classstdex_1_1html_1_1parser.html#a6fe16b4065b1ce300443794aa6d49044',1,'stdex::html::parser::append_token(std::unique_ptr< T > &&token, std::basic_string< _Elem, _Traits, _Alloc > &source)']]], - ['assign_6',['assign',['../classstdex_1_1html_1_1document.html#a85458aea6b21a1154c20e5d6183aa285',1,'stdex::html::document']]], + ['assign_6',['assign',['../classstdex_1_1html_1_1document.html#abc9dea6352db1d92ae7ef33babc50278',1,'stdex::html::document']]], ['at_7',['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_8',['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_9',['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()']]], diff --git a/search/functions_14.js b/search/functions_14.js index 3b077b1ef..112fd0c12 100644 --- a/search/functions_14.js +++ b/search/functions_14.js @@ -2,7 +2,7 @@ var searchData= [ ['watchdog_0',['watchdog',['../classstdex_1_1watchdog.html#a045c86421267f195c45d7fa01c6147c0',1,'stdex::watchdog']]], ['write_1',['write',['../classstdex_1_1stream_1_1window.html#a06f05191c35fdbadebc49e05a19d9f3c',1,'stdex::stream::window::write()'],['../classstdex_1_1stream_1_1diag__file.html#a3157aee8e9c754b02e876897fcb82236',1,'stdex::stream::diag_file::write()'],['../classstdex_1_1stream_1_1fifo.html#a30c7adb43b6f4bd0cb5d9c72f15fe9bf',1,'stdex::stream::fifo::write()'],['../classstdex_1_1stream_1_1memory__file.html#ae5b6602e176f1053ab2eef88d8312b49',1,'stdex::stream::memory_file::write()'],['../classstdex_1_1stream_1_1socket.html#ad83f6d5d4844092e9e6831a597c6e2e9',1,'stdex::stream::socket::write()'],['../classstdex_1_1stream_1_1basic__sys.html#a06666e09bf1e7486d277996267b51618',1,'stdex::stream::basic_sys::write()'],['../classstdex_1_1stream_1_1cache.html#ac436fbcac7eddf95b6e25d6368da3fb7',1,'stdex::stream::cache::write()'],['../classstdex_1_1stream_1_1file__window.html#a7a264381cf344fcd6fa70e0a4964cc93',1,'stdex::stream::file_window::write()'],['../classstdex_1_1stream_1_1limiter.html#a8fe783b504f019e29034c0572cec7834',1,'stdex::stream::limiter::write()'],['../classstdex_1_1stream_1_1buffer.html#a489a01a4c187e85f06ebe10314a891ae',1,'stdex::stream::buffer::write()'],['../classstdex_1_1stream_1_1async__writer.html#a39d3fc4fffb8aa9b971fa15beaa8149b',1,'stdex::stream::async_writer::write()'],['../classstdex_1_1stream_1_1replicator.html#abbbaa912a887b00a4a7a5d518079f5ec',1,'stdex::stream::replicator::write()'],['../classstdex_1_1stream_1_1converter.html#ae84a5c8d64942dbaa81ed54a181b3d7a',1,'stdex::stream::converter::write()'],['../classstdex_1_1stream_1_1basic.html#ad8af0444273509eb36ad81046ac92081',1,'stdex::stream::basic::write()'],['../classstdex_1_1stream__hasher.html#aea835790f7aba9fb6ad28363eaaf736b',1,'stdex::stream_hasher::write()'],['../classstdex_1_1base64__writer.html#aaca6933a48a0266e4e46cc93b03ef410',1,'stdex::base64_writer::write()']]], - ['write_5farray_2',['write_array',['../classstdex_1_1stream_1_1basic.html#acdf4521be87593a8d09b2263d04582f8',1,'stdex::stream::basic::write_array(const T_from *wstr, charset_encoder< T_from, T_to > &encoder)'],['../classstdex_1_1stream_1_1basic.html#a22f9e1f6c1cf8fbd4e81b236ee41dcc6',1,'stdex::stream::basic::write_array(const std::basic_string< T_from, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)'],['../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)'],['../classstdex_1_1stream_1_1basic.html#af43fb72c91263bee7f39c4f51fe0e272',1,'stdex::stream::basic::write_array(_In_reads_or_z_opt_(num_chars) const T_from *wstr, size_t num_chars, charset_encoder< T_from, T_to > &encoder)']]], + ['write_5farray_2',['write_array',['../classstdex_1_1stream_1_1basic.html#a01492b8338bf435a5240897085720814',1,'stdex::stream::basic::write_array(const T_from *str, charset_encoder< T_from, T_to > &encoder)'],['../classstdex_1_1stream_1_1basic.html#ac817a6ab260e996c9b1b08c995e94ad9',1,'stdex::stream::basic::write_array(const std::basic_string< T_from, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)'],['../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)'],['../classstdex_1_1stream_1_1basic.html#aeee42cba3d0a542355783241412f3630',1,'stdex::stream::basic::write_array(_In_reads_or_z_opt_(num_chars) const T_from *str, size_t num_chars, charset_encoder< T_from, T_to > &encoder)']]], ['write_5fbyte_3',['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_4',['write_charset',['../classstdex_1_1stream_1_1basic.html#ab61abc19936554288ea929e0eb299144',1,'stdex::stream::basic']]], ['write_5fdata_5',['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()']]], diff --git a/search/functions_c.js b/search/functions_c.js index 20bffbfb3..b93975ae4 100644 --- a/search/functions_c.js +++ b/search/functions_c.js @@ -2,7 +2,7 @@ var searchData= [ ['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(std::ostream &stream)'],['../classstdex_1_1idrec_1_1record.html#a0498a09948194be47553433c87121ec4',1,'stdex::idrec::record::open(stdex::stream::basic_file &stream)'],['../classstdex_1_1stream_1_1file.html#a556c4cff7086d5f258dcdf914556084a',1,'stdex::stream::file::open(const schar_t *filename, int mode)'],['../classstdex_1_1stream_1_1file.html#ac00f351491cc50626286119cfdd428fa',1,'stdex::stream::file::open(const stdex::sstring &filename, int mode)'],['../classstdex_1_1stream_1_1cached__file.html#a8a1ac6ccd8e1d321112412d346eec0e1',1,'stdex::stream::cached_file::open(const schar_t *filename, int mode)'],['../classstdex_1_1stream_1_1cached__file.html#a57980b26ff1dcc5d1a328022f35f3336',1,'stdex::stream::cached_file::open(const stdex::sstring &filename, int mode)']]], - ['operator_20bool_2',['operator bool',['../structstdex_1_1interval.html#a15945d1ba829410c61466d95922000d0',1,'stdex::interval::operator bool()'],['../classstdex_1_1stream_1_1socket.html#a045afb72557249f0f1f1d0f20d93c15d',1,'stdex::stream::socket::operator bool()'],['../classstdex_1_1sys__object.html#a529b0f9294ed46591389ca3dd9c540f3',1,'stdex::sys_object::operator bool()']]], + ['operator_20bool_2',['operator bool',['../structstdex_1_1interval.html#a15945d1ba829410c61466d95922000d0',1,'stdex::interval::operator bool()'],['../classstdex_1_1stream_1_1socket.html#a045afb72557249f0f1f1d0f20d93c15d',1,'stdex::stream::socket::operator bool()'],['../classstdex_1_1stream_1_1cached__file.html#acc2376f8b970dac688bc1ad1f99a81c0',1,'stdex::stream::cached_file::operator bool()'],['../classstdex_1_1sys__object.html#a529b0f9294ed46591389ca3dd9c540f3',1,'stdex::sys_object::operator bool()']]], ['operator_20const_20t_20_26_3',['operator const T &',['../classstdex_1_1basic__hash.html#a7cacac78cdfbf561da8d9f1a5841c5cb',1,'stdex::basic_hash']]], ['operator_21_3d_4',['operator!=',['../structstdex_1_1interval.html#aaeb80d954770418a600a4c30f6ce6c40',1,'stdex::interval::operator!=()'],['../structstdex_1_1mapping.html#a99e44b5840a155e5ce366d440cbe234b',1,'stdex::mapping::operator!=()']]], ['operator_28_29_5',['operator()',['../structstdex_1_1free__locale__delete.html#ab7a2cd4be45534b436a871e09805b36f',1,'stdex::free_locale_delete']]], diff --git a/search/functions_f.js b/search/functions_f.js index e809cedf7..0bcc91c06 100644 --- a/search/functions_f.js +++ b/search/functions_f.js @@ -7,8 +7,8 @@ var searchData= ['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#af638f940d1b33788a77cae0336106295',1,'stdex::stream::basic::readln(std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)']]], - ['readln_5fand_5fattach_8',['readln_and_attach',['../classstdex_1_1stream_1_1basic.html#ad0fe3b79743c45e7e0ff426f04cfee08',1,'stdex::stream::basic::readln_and_attach(std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)'],['../classstdex_1_1stream_1_1basic.html#a6e67bf06f20bc1743cd75622c4b83892',1,'stdex::stream::basic::readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)']]], + ['readln_7',['readln',['../classstdex_1_1stream_1_1basic.html#a21ef1979e99bb0a705cfa9488808a0c7',1,'stdex::stream::basic::readln(std::basic_string< _Elem, _Traits, _Ax > &str)'],['../classstdex_1_1stream_1_1basic.html#a5409ff8fd988c1decbf291471098ac31',1,'stdex::stream::basic::readln(std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)']]], + ['readln_5fand_5fattach_8',['readln_and_attach',['../classstdex_1_1stream_1_1basic.html#a5be6478eb4641c1d6f285f880b5fae50',1,'stdex::stream::basic::readln_and_attach(std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)'],['../classstdex_1_1stream_1_1basic.html#a6e67bf06f20bc1743cd75622c4b83892',1,'stdex::stream::basic::readln_and_attach(std::basic_string< _Elem, _Traits, _Ax > &str)']]], ['readonly_9',['readonly',['../classstdex_1_1stream_1_1file.html#a40e59814b5a52d659cc568285b9b39b3',1,'stdex::stream::file::readonly(const stdex::schar_t *filename)'],['../classstdex_1_1stream_1_1file.html#a1b4cdda97e50c9590ac85acba6f49467',1,'stdex::stream::file::readonly(const stdex::sstring &filename)']]], ['record_10',['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_11',['remove',['../classstdex_1_1stream_1_1replicator.html#a7916a391dfa9484df02b1202c0a03edf',1,'stdex::stream::replicator']]], diff --git a/search/variables_9.js b/search/variables_9.js index b9227edd9..7418b1bf3 100644 --- a/search/variables_9.js +++ b/search/variables_9.js @@ -38,7 +38,7 @@ var searchData= ['m_5ftemp_5foff_35',['m_temp_off',['../classstdex_1_1base64__reader.html#affd26a488ea1b5d8b23cc98be45b2535',1,'stdex::base64_reader']]], ['m_5ftimeout_36',['m_timeout',['../classstdex_1_1watchdog.html#a816c03499d71d1fe73410d979744c817',1,'stdex::watchdog']]], ['m_5ftokens_37',['m_tokens',['../classstdex_1_1html_1_1parser.html#a5827d0faa87547c141a69a286fdc6b77',1,'stdex::html::parser']]], - ['m_5furl_38',['m_url',['../classstdex_1_1html_1_1parser.html#a7c40ad04981cca08398cd0d79853dc6a',1,'stdex::html::parser']]], + ['m_5furl_38',['m_url',['../classstdex_1_1html_1_1parser.html#a7804f7cfaeb01e5cbe7fdfe1321fea35',1,'stdex::html::parser']]], ['mapping_39',['mapping',['../classstdex_1_1html_1_1text__token.html#a45822e05f3df782f2abbdf5fa8ca4b8b',1,'stdex::html::text_token']]], ['model_40',['model',['../classstdex_1_1parser_1_1basic__si__reference.html#a934cc4a41d64ca1aec35a58b8558bf2e',1,'stdex::parser::basic_si_reference']]], ['mouth_41',['mouth',['../classstdex_1_1parser_1_1basic__emoticon.html#a43d0de6a54546e509807c7c888bb8dc8',1,'stdex::parser::basic_emoticon']]] diff --git a/sgml_8cpp_source.html b/sgml_8cpp_source.html index 59911ac05..ff3b2ef48 100644 --- a/sgml_8cpp_source.html +++ b/sgml_8cpp_source.html @@ -153,7 +153,7 @@ $(document).ready(function() { init_codefold(0); }); diff --git a/sgml_8hpp_source.html b/sgml_8hpp_source.html index 7d7352806..d573a489d 100644 --- a/sgml_8hpp_source.html +++ b/sgml_8hpp_source.html @@ -157,560 +157,558 @@ $(document).ready(function() { init_codefold(0); });
          75 constexpr int sgml_sgml = sgml_amp | sgml_lt_gt;
          76 constexpr int sgml_ml_attrib = sgml_amp | sgml_quot_apos;
          77 constexpr int sgml_c = sgml_amp | sgml_bsol | sgml_quot_apos;
          -
          78 // constexpr int sgml_ajt_lemma = sgml_amp | sgml_quot | sgml_dollar | sgml_percnt;
          -
          79 // constexpr int sgml_ajt_form = sgml_ajt_lemma;
          -
          80 // constexpr int sgml_kolos = sgml_amp | sgml_quot | sgml_dollar | sgml_percnt | sgml_lt_gt | sgml_bsol/* | sgml_commat | sgml_num*/ | sgml_lpar_rpar | sgml_lcub_rcub | sgml_lsqb_rsqb;
          -
          81
          -
          92 template <class T>
          -
          93 inline void sgml2strcat(
          -
          94 _Inout_ std::wstring& dst,
          -
          95 _In_reads_or_z_opt_(count_src) const T* src, _In_ size_t count_src,
          -
          96 _In_ int skip = 0,
          -
          97 _In_ const mapping<size_t>& offset = mapping<size_t>(0, 0),
          -
          98 _Inout_opt_ mapping_vector<size_t>* map = nullptr)
          -
          99 {
          -
          100 _Assume_(src || !count_src);
          -
          101
          -
          102 const bool
          -
          103 skip_quot = (skip & sgml_quot) == 0,
          -
          104 skip_apos = (skip & sgml_apos) == 0,
          -
          105 skip_amp = (skip & sgml_amp) == 0,
          -
          106 skip_lt_gt = (skip & sgml_lt_gt) == 0,
          -
          107 skip_bsol = (skip & sgml_bsol) == 0,
          -
          108 skip_dollar = (skip & sgml_dollar) == 0,
          -
          109 skip_percnt = (skip & sgml_percnt) == 0,
          -
          110 skip_commat = (skip & sgml_commat) == 0,
          -
          111 skip_num = (skip & sgml_num) == 0,
          -
          112 skip_lpar_rpar = (skip & sgml_lpar_rpar) == 0,
          -
          113 skip_lcub_rcub = (skip & sgml_lcub_rcub) == 0,
          -
          114 skip_lsqb_rsqb = (skip & sgml_lsqb_rsqb) == 0;
          -
          115
          -
          116 count_src = strnlen(src, count_src);
          -
          117 dst.reserve(dst.size() + count_src);
          -
          118 for (size_t i = 0; i < count_src;) {
          -
          119 if (src[i] == '&') {
          -
          120 auto end = sgmlend(src + i + 1, count_src - i - 1);
          -
          121 if (end) {
          -
          122 const wchar_t* entity_w;
          -
          123 wchar_t chr[3];
          -
          124 size_t n = end - src - i - 1;
          -
          125 if (n >= 2 && src[i + 1] == '#') {
          -
          126 uint32_t unicode;
          -
          127 if (src[i + 2] == 'x' || src[i + 2] == 'X')
          -
          128 unicode = strtou32(src + i + 3, n - 2, nullptr, 16);
          -
          129 else
          -
          130 unicode = strtou32(src + i + 2, n - 1, nullptr, 10);
          -
          131#ifdef _WIN32
          -
          132 if (unicode < 0x10000) {
          -
          133 chr[0] = (wchar_t)unicode;
          -
          134 chr[1] = 0;
          -
          135 }
          -
          136 else {
          -
          137 ucs4_to_surrogate_pair(chr, unicode);
          -
          138 chr[2] = 0;
          -
          139 }
          -
          140#else
          -
          141 chr[0] = (wchar_t)unicode;
          -
          142 chr[1] = 0;
          -
          143#endif
          -
          144 entity_w = chr;
          -
          145 }
          -
          146 else
          -
          147 entity_w = sgml2uni(src + i + 1, n);
          -
          148
          -
          149 if (entity_w &&
          -
          150 (skip_quot || (entity_w[0] != L'"')) &&
          -
          151 (skip_apos || (entity_w[0] != L'\'')) &&
          -
          152 (skip_amp || (entity_w[0] != L'&')) &&
          -
          153 (skip_lt_gt || (entity_w[0] != L'<' && entity_w[0] != L'>')) &&
          -
          154 (skip_bsol || (entity_w[0] != L'\\')) &&
          -
          155 (skip_dollar || (entity_w[0] != L'$')) &&
          -
          156 (skip_percnt || (entity_w[0] != L'%')) &&
          -
          157 (skip_commat || (entity_w[0] != L'@')) &&
          -
          158 (skip_num || (entity_w[0] != L'#')) &&
          -
          159 (skip_lpar_rpar || (entity_w[0] != L'(' && entity_w[0] != L')')) &&
          -
          160 (skip_lcub_rcub || (entity_w[0] != L'{' && entity_w[0] != L'}')) &&
          -
          161 (skip_lsqb_rsqb || (entity_w[0] != L'[' && entity_w[0] != L']')))
          -
          162 {
          -
          163 if (map) map->push_back(mapping<size_t>(offset.from + i, offset.to + dst.size()));
          -
          164 dst.append(entity_w);
          -
          165 i = end - src + 1;
          -
          166 if (map) map->push_back(mapping<size_t>(offset.from + i, offset.to + dst.size()));
          -
          167 continue;
          -
          168 }
          -
          169 }
          -
          170 }
          -
          171 dst.append(1, src[i++]);
          -
          172 }
          -
          173 }
          -
          174
          -
          184 template <class T>
          -
          185 inline void sgml2strcat(
          -
          186 _Inout_ std::wstring& dst,
          -
          187 _In_ const std::basic_string<T>& src,
          -
          188 _In_ int skip = 0,
          -
          189 _In_ const mapping<size_t>& offset = mapping<size_t>(0, 0),
          -
          190 _Inout_opt_ mapping_vector<size_t>* map = nullptr)
          -
          191 {
          -
          192 sgml2strcat(dst, src.data(), src.size(), skip, offset, map);
          -
          193 }
          -
          194
          -
          208 template <class T>
          -
          209 inline size_t sgml2strcat(
          -
          210 _Inout_cap_(count_dst) wchar_t* dst, _In_ size_t count_dst,
          -
          211 _In_reads_or_z_opt_(count_src) const T* src, _In_ size_t count_src,
          -
          212 _In_ int skip = 0,
          -
          213 _In_ const mapping<size_t>& offset = mapping<size_t>(0, 0),
          -
          214 _Inout_opt_ mapping_vector<size_t>* map = nullptr)
          -
          215 {
          -
          216 _Assume_(dst || !count_dst);
          -
          217 _Assume_(src || !count_src);
          -
          218
          -
          219 static const std::invalid_argument buffer_overrun("buffer overrun");
          -
          220 const bool
          -
          221 skip_quot = (skip & sgml_quot) == 0,
          -
          222 skip_apos = (skip & sgml_apos) == 0,
          -
          223 skip_amp = (skip & sgml_amp) == 0,
          -
          224 skip_lt_gt = (skip & sgml_lt_gt) == 0,
          -
          225 skip_bsol = (skip & sgml_bsol) == 0,
          -
          226 skip_dollar = (skip & sgml_dollar) == 0,
          -
          227 skip_percnt = (skip & sgml_percnt) == 0,
          -
          228 skip_commat = (skip & sgml_commat) == 0,
          -
          229 skip_num = (skip & sgml_num) == 0,
          -
          230 skip_lpar_rpar = (skip & sgml_lpar_rpar) == 0,
          -
          231 skip_lcub_rcub = (skip & sgml_lcub_rcub) == 0,
          -
          232 skip_lsqb_rsqb = (skip & sgml_lsqb_rsqb) == 0;
          -
          233
          -
          234 size_t j = wcsnlen(dst, count_dst);
          -
          235 count_src = strnlen(src, count_src);
          -
          236 for (size_t i = 0; i < count_src;) {
          -
          237 if (src[i] == '&') {
          -
          238 auto end = sgmlend(src + i + 1, count_src - i - 1);
          -
          239 if (end) {
          -
          240 const wchar_t* entity_w;
          -
          241 wchar_t chr[3];
          -
          242 size_t n = end - src - i - 1;
          -
          243 if (n >= 2 && src[i + 1] == '#') {
          -
          244 uint32_t unicode;
          -
          245 if (src[i + 2] == 'x' || src[i + 2] == 'X')
          -
          246 unicode = strtou32(src + i + 3, n - 2, nullptr, 16);
          -
          247 else
          -
          248 unicode = strtou32(src + i + 2, n - 1, nullptr, 10);
          -
          249#ifdef _WIN32
          -
          250 if (unicode < 0x10000) {
          -
          251 chr[0] = (wchar_t)unicode;
          -
          252 chr[1] = 0;
          -
          253 }
          -
          254 else {
          -
          255 ucs4_to_surrogate_pair(chr, unicode);
          -
          256 chr[2] = 0;
          -
          257 }
          -
          258#else
          -
          259 chr[0] = (wchar_t)unicode;
          -
          260 chr[1] = 0;
          -
          261#endif
          -
          262 entity_w = chr;
          -
          263 }
          -
          264 else
          -
          265 entity_w = sgml2uni(src + i + 1, n);
          -
          266
          -
          267 if (entity_w &&
          -
          268 (skip_quot || (entity_w[0] != L'"')) &&
          -
          269 (skip_apos || (entity_w[0] != L'\'')) &&
          -
          270 (skip_amp || (entity_w[0] != L'&')) &&
          -
          271 (skip_lt_gt || (entity_w[0] != L'<' && entity_w[0] != L'>')) &&
          -
          272 (skip_bsol || (entity_w[0] != L'\\')) &&
          -
          273 (skip_dollar || (entity_w[0] != L'$')) &&
          -
          274 (skip_percnt || (entity_w[0] != L'%')) &&
          -
          275 (skip_commat || (entity_w[0] != L'@')) &&
          -
          276 (skip_num || (entity_w[0] != L'#')) &&
          -
          277 (skip_lpar_rpar || (entity_w[0] != L'(' && entity_w[0] != L')')) &&
          -
          278 (skip_lcub_rcub || (entity_w[0] != L'{' && entity_w[0] != L'}')) &&
          -
          279 (skip_lsqb_rsqb || (entity_w[0] != L'[' && entity_w[0] != L']')))
          -
          280 {
          -
          281 if (map) map->push_back(mapping<size_t>(offset.from + i, offset.to + j));
          -
          282 size_t m = wcslen(entity_w);
          -
          283 if (j + m >= count_dst)
          -
          284 throw buffer_overrun;
          -
          285 memcpy(dst + j, entity_w, m * sizeof(wchar_t)); j += m;
          -
          286 i = end - src + 1;
          -
          287 if (map) map->push_back(mapping<size_t>(offset.from + i, offset.to + j));
          -
          288 continue;
          -
          289 }
          -
          290 }
          -
          291 }
          -
          292 if (j + 1 >= count_dst)
          -
          293 throw buffer_overrun;
          -
          294 dst[j++] = src[i++];
          -
          295 }
          -
          296 if (j >= count_dst)
          -
          297 throw buffer_overrun;
          -
          298 dst[j] = 0;
          -
          299 return j;
          -
          300 }
          -
          301
          -
          312 template <class T>
          -
          313 inline void sgml2strcpy(
          -
          314 _Inout_ std::wstring& dst,
          -
          315 _In_reads_or_z_opt_(count_src) const T* src, _In_ size_t count_src,
          -
          316 _In_ int skip = 0,
          -
          317 _In_ const mapping<size_t>& offset = mapping<size_t>(0, 0),
          -
          318 _Inout_opt_ mapping_vector<size_t>* map = nullptr)
          -
          319 {
          -
          320 dst.clear();
          -
          321 if (map)
          -
          322 map->clear();
          -
          323 sgml2strcat(dst, src, count_src, skip, offset, map);
          -
          324 }
          -
          325
          -
          335 template<class _Elem, class _Traits, class _Ax>
          -
          336 inline void sgml2strcpy(
          -
          337 _Inout_ std::wstring& dst,
          -
          338 _In_ const std::basic_string<_Elem, _Traits, _Ax>& src,
          -
          339 _In_ int skip = 0,
          -
          340 _In_ const mapping<size_t>& offset = mapping<size_t>(0, 0),
          -
          341 _Inout_opt_ mapping_vector<size_t>* map = nullptr)
          -
          342 {
          -
          343 sgml2strcpy(dst, src.data(), src.size(), skip, offset, map);
          -
          344 }
          -
          345
          -
          359 template <class T>
          -
          360 inline size_t sgml2strcpy(
          -
          361 _Inout_cap_(count_dst) wchar_t* dst, _In_ size_t count_dst,
          -
          362 _In_reads_or_z_opt_(count_src) const T* src, _In_ size_t count_src,
          -
          363 _In_ int skip = 0,
          -
          364 _In_ const mapping<size_t>& offset = mapping<size_t>(0, 0),
          -
          365 _Inout_opt_ mapping_vector<size_t>* map = nullptr)
          -
          366 {
          -
          367 _Assume_(dst || !count_dst);
          -
          368 if (count_dst)
          -
          369 dst[0] = 0;
          -
          370 if (map)
          -
          371 map->clear();
          -
          372 return sgml2strcat(dst, count_dst, src, count_src, skip, offset, map);
          -
          373 }
          -
          374
          -
          386 template <class T>
          -
          387 inline std::wstring sgml2str(
          -
          388 _In_reads_or_z_opt_(count_src) const T* src, _In_ size_t count_src,
          -
          389 _In_ int skip = 0,
          -
          390 _In_ const mapping<size_t>& offset = mapping<size_t>(0, 0),
          -
          391 _Inout_opt_ mapping_vector<size_t>* map = nullptr)
          -
          392 {
          -
          393 std::wstring dst;
          -
          394 sgml2strcat(dst, src, count_src, skip, offset, map);
          -
          395 return dst;
          -
          396 }
          -
          397
          -
          408 template <class T>
          -
          409 inline std::wstring sgml2str(
          -
          410 _In_ const std::basic_string<T>& src,
          -
          411 _In_ int skip = 0,
          -
          412 _In_ const mapping<size_t>& offset = mapping<size_t>(0, 0),
          -
          413 _Inout_opt_ mapping_vector<size_t>* map = nullptr)
          -
          414 {
          -
          415 return sgml2str(src.c_str(), src.size(), skip, offset, map);
          -
          416 }
          -
          417
          -
          419 inline const char* chr2sgml(_In_reads_or_z_(count) const wchar_t* entity, _In_ size_t count)
          -
          420 {
          -
          421 _Assume_(entity && count);
          -
          422
          -
          423 const wchar_t e2 = entity[0];
          -
          424 for (size_t i = 0, j = _countof(unicode_sgml); i < j; ) {
          -
          425 size_t m = (i + j) / 2;
          -
          426 wchar_t e1 = sgml_unicode[unicode_sgml[m]].unicode[0];
          -
          427 if (e1 < e2)
          -
          428 i = m + 1;
          -
          429 else if (e1 > e2)
          -
          430 j = m;
          -
          431 else {
          -
          432 auto r = strncmp(sgml_unicode[unicode_sgml[m]].unicode + 1, _countof(sgml_unicode[0].unicode) - 1, entity + 1, count - 1);
          -
          433 if (r < 0)
          -
          434 i = m + 1;
          -
          435 else if (r > 0)
          -
          436 j = m;
          -
          437 else {
          -
          438 for (; i < m && sgml_unicode[unicode_sgml[m - 1]].unicode[0] == e2 && strncmp(sgml_unicode[unicode_sgml[m - 1]].unicode + 1, _countof(sgml_unicode[0].unicode) - 1, entity + 1, count - 1) == 0; m--);
          -
          439 return sgml_unicode[unicode_sgml[m]].sgml;
          -
          440 }
          -
          441 }
          -
          442 }
          -
          443 return nullptr;
          -
          444 }
          -
          446
          -
          455 inline void str2sgmlcat(
          -
          456 _Inout_ std::string& dst,
          -
          457 _In_reads_or_z_opt_(count_src) const wchar_t* src, _In_ size_t count_src,
          -
          458 _In_ size_t what = 0)
          -
          459 {
          -
          460 _Assume_(src || !count_src);
          -
          461
          -
          462 const bool
          -
          463 do_ascii = (what & sgml_full) == 0,
          -
          464 do_quot = (what & sgml_quot) == 0,
          -
          465 do_apos = (what & sgml_apos) == 0,
          -
          466 do_lt_gt = (what & sgml_lt_gt) == 0,
          -
          467 do_bsol = (what & sgml_bsol) == 0,
          -
          468 do_dollar = (what & sgml_dollar) == 0,
          -
          469 do_percnt = (what & sgml_percnt) == 0,
          -
          470 do_commat = (what & sgml_commat) == 0,
          -
          471 do_num = (what & sgml_num) == 0,
          -
          472 do_lpar_rpar = (what & sgml_lpar_rpar) == 0,
          -
          473 do_lcub_rcub = (what & sgml_lcub_rcub) == 0,
          -
          474 do_lsqb_rsqb = (what & sgml_lsqb_rsqb) == 0;
          -
          475
          -
          476 count_src = wcsnlen(src, count_src);
          -
          477 dst.reserve(dst.size() + count_src);
          -
          478 for (size_t i = 0; i < count_src;) {
          -
          479 size_t n = glyphlen(src + i, count_src - i);
          -
          480 if (n == 1 &&
          -
          481 do_ascii && (unsigned int)src[i] < 128 &&
          -
          482 src[i] != L'&' &&
          -
          483 (do_quot || (src[i] != L'"')) &&
          -
          484 (do_apos || (src[i] != L'\'')) &&
          -
          485 (do_lt_gt || (src[i] != L'<' && src[i] != L'>')) &&
          -
          486 (do_bsol || (src[i] != L'\\')) &&
          -
          487 (do_dollar || (src[i] != L'$')) &&
          -
          488 (do_percnt || (src[i] != L'%')) &&
          -
          489 (do_commat || (src[i] != L'@')) &&
          -
          490 (do_num || (src[i] != L'#')) &&
          -
          491 (do_lpar_rpar || (src[i] != L'(' && src[i] != L')')) &&
          -
          492 (do_lcub_rcub || (src[i] != L'{' && src[i] != L'}')) &&
          -
          493 (do_lsqb_rsqb || (src[i] != L'[' && src[i] != L']')))
          -
          494 {
          -
          495 // 7-bit ASCII and no desire to encode it as an SGML entity.
          -
          496 dst.append(1, static_cast<char>(src[i++]));
          -
          497 }
          -
          498 else {
          -
          499 const char* entity = chr2sgml(src + i, n);
          -
          500 if (entity) {
          -
          501 dst.append(1, '&');
          -
          502 dst.append(entity);
          -
          503 dst.append(1, ';');
          -
          504 i += n;
          -
          505 }
          -
          506 else if (n == 1) {
          -
          507 // Trivial character (1 code unit, 1 glyph), no entity available.
          -
          508 if ((unsigned int)src[i] < 128)
          -
          509 dst.append(1, static_cast<char>(src[i++]));
          -
          510 else {
          -
          511 char tmp[3 + 8 + 1 + 1];
          -
          512 snprintf(tmp, _countof(tmp), "&#x%x;", src[i++]);
          -
          513 dst.append(tmp);
          -
          514 }
          -
          515 }
          -
          516 else {
          -
          517 // Non-trivial character. Decompose.
          -
          518 const size_t end = i + n;
          -
          519 while (i < end) {
          -
          520 if ((entity = chr2sgml(src + i, 1)) != nullptr) {
          -
          521 dst.append(1, '&');
          -
          522 dst.append(entity);
          -
          523 dst.append(1, ';');
          -
          524 i++;
          -
          525 }
          -
          526 else if ((unsigned int)src[i] < 128)
          -
          527 dst.append(1, static_cast<char>(src[i++]));
          -
          528 else {
          -
          529 uint32_t unicode;
          -
          530#ifdef _WIN32
          -
          531 if (i + 1 < end && is_surrogate_pair(src + i)) {
          -
          532 unicode = surrogate_pair_to_ucs4(src + i);
          -
          533 i += 2;
          -
          534 }
          -
          535 else
          -
          536#endif
          -
          537 {
          -
          538 unicode = src[i++];
          -
          539 }
          -
          540 char tmp[3 + 8 + 1 + 1];
          -
          541 snprintf(tmp, _countof(tmp), "&#x%x;", unicode);
          -
          542 dst.append(tmp);
          -
          543 }
          -
          544 }
          -
          545 }
          -
          546 }
          -
          547 }
          -
          548 }
          -
          549
          -
          557 inline void str2sgmlcat(
          -
          558 _Inout_ std::string& dst,
          -
          559 _In_ const std::wstring& src,
          -
          560 _In_ size_t what = 0)
          -
          561 {
          -
          562 str2sgmlcat(dst, src.c_str(), src.size(), what);
          -
          563 }
          -
          564
          -
          576 inline size_t str2sgmlcat(
          -
          577 _Inout_cap_(count_dst) char* dst, _In_ size_t count_dst,
          -
          578 _In_reads_or_z_opt_(count_src) const wchar_t* src, _In_ size_t count_src,
          -
          579 _In_ size_t what = 0)
          -
          580 {
          -
          581 _Assume_(dst || !count_dst);
          -
          582 _Assume_(src || !count_src);
          -
          583
          -
          584 static const std::invalid_argument buffer_overrun("buffer overrun");
          -
          585 const bool
          -
          586 do_ascii = (what & sgml_full) == 0,
          -
          587 do_quot = (what & sgml_quot) == 0,
          -
          588 do_apos = (what & sgml_apos) == 0,
          -
          589 do_lt_gt = (what & sgml_lt_gt) == 0,
          -
          590 do_bsol = (what & sgml_bsol) == 0,
          -
          591 do_dollar = (what & sgml_dollar) == 0,
          -
          592 do_percnt = (what & sgml_percnt) == 0,
          -
          593 do_commat = (what & sgml_commat) == 0,
          -
          594 do_num = (what & sgml_num) == 0,
          -
          595 do_lpar_rpar = (what & sgml_lpar_rpar) == 0,
          -
          596 do_lcub_rcub = (what & sgml_lcub_rcub) == 0,
          -
          597 do_lsqb_rsqb = (what & sgml_lsqb_rsqb) == 0;
          -
          598
          -
          599 size_t j = strnlen(dst, count_dst);
          -
          600 count_src = wcsnlen(src, count_src);
          -
          601 for (size_t i = 0; i < count_src;) {
          -
          602 size_t n = glyphlen(src + i, count_src - i);
          -
          603 if (n == 1 &&
          -
          604 do_ascii && (unsigned int)src[i] < 128 &&
          -
          605 src[i] != L'&' &&
          -
          606 (do_quot || (src[i] != L'"')) &&
          -
          607 (do_apos || (src[i] != L'\'')) &&
          -
          608 (do_lt_gt || (src[i] != L'<' && src[i] != L'>')) &&
          -
          609 (do_bsol || (src[i] != L'\\')) &&
          -
          610 (do_dollar || (src[i] != L'$')) &&
          -
          611 (do_percnt || (src[i] != L'%')) &&
          -
          612 (do_commat || (src[i] != L'@')) &&
          -
          613 (do_num || (src[i] != L'#')) &&
          -
          614 (do_lpar_rpar || (src[i] != L'(' && src[i] != L')')) &&
          -
          615 (do_lcub_rcub || (src[i] != L'{' && src[i] != L'}')) &&
          -
          616 (do_lsqb_rsqb || (src[i] != L'[' && src[i] != L']')))
          -
          617 {
          -
          618 // 7-bit ASCII and no desire to encode it as an SGML entity.
          -
          619 if (j + 1 >= count_dst)
          -
          620 throw buffer_overrun;
          -
          621 dst[j++] = static_cast<char>(src[i++]);
          -
          622 }
          -
          623 else {
          -
          624 const char* entity = chr2sgml(src + i, n);
          -
          625 if (entity) {
          -
          626 size_t m = strlen(entity);
          -
          627 if (j + m + 2 >= count_dst)
          -
          628 throw buffer_overrun;
          -
          629 dst[j++] = '&';
          -
          630 memcpy(dst + j, entity, m * sizeof(char)); j += m;
          -
          631 dst[j++] = ';';
          -
          632 i += n;
          -
          633 }
          -
          634 else if (n == 1) {
          -
          635 // Trivial character (1 code unit, 1 glyph), no entity available.
          -
          636 if ((unsigned int)src[i] < 128) {
          -
          637 if (j + 1 >= count_dst)
          -
          638 throw buffer_overrun;
          -
          639 dst[j++] = static_cast<char>(src[i++]);
          -
          640 }
          -
          641 else {
          -
          642 char tmp[3 + 8 + 1 + 1];
          -
          643 int m = snprintf(tmp, _countof(tmp), "&#x%x;", src[i++]);
          -
          644 _Assume_(m >= 0);
          -
          645 if (static_cast<size_t>(m) >= count_dst)
          -
          646 throw buffer_overrun;
          -
          647 memcpy(dst + j, tmp, m * sizeof(char)); j += m;
          -
          648 }
          -
          649 }
          -
          650 else {
          -
          651 // Non-trivial character. Decompose.
          -
          652 const size_t end = i + n;
          -
          653 while (i < end) {
          -
          654 if ((entity = chr2sgml(src + i, 1)) != nullptr) {
          -
          655 size_t m = strlen(entity);
          -
          656 if (j + m + 2 >= count_dst)
          -
          657 throw buffer_overrun;
          -
          658 dst[j++] = '&';
          -
          659 memcpy(dst + j, entity, m * sizeof(char)); j += m;
          -
          660 dst[j++] = ';';
          -
          661 i++;
          -
          662 }
          -
          663 else if ((unsigned int)src[i] < 128) {
          -
          664 if (j + 1 >= count_dst)
          -
          665 throw buffer_overrun;
          -
          666 dst[j++] = static_cast<char>(src[i++]);
          -
          667 }
          -
          668 else {
          -
          669 uint32_t unicode;
          -
          670#ifdef _WIN32
          -
          671 if (i + 1 < end && is_surrogate_pair(src + i)) {
          -
          672 unicode = surrogate_pair_to_ucs4(src + i);
          -
          673 i += 2;
          -
          674 }
          -
          675 else
          -
          676#endif
          -
          677 {
          -
          678 unicode = src[i++];
          -
          679 }
          -
          680 char tmp[3 + 8 + 1 + 1];
          -
          681 int m = snprintf(tmp, _countof(tmp), "&#x%x;", unicode);
          -
          682 _Assume_(m >= 0);
          -
          683 if (static_cast<size_t>(m) >= count_dst)
          -
          684 throw buffer_overrun;
          -
          685 memcpy(dst + j, tmp, m * sizeof(char)); j += m;
          -
          686 }
          -
          687 }
          -
          688 }
          -
          689 }
          -
          690 }
          -
          691 if (j >= count_dst)
          -
          692 throw buffer_overrun;
          -
          693 dst[j] = 0;
          -
          694 return j;
          -
          695 }
          -
          696
          -
          705 inline void str2sgmlcpy(
          -
          706 _Inout_ std::string& dst,
          -
          707 _In_reads_or_z_opt_(count_src) const wchar_t* src, _In_ size_t count_src,
          -
          708 _In_ size_t what = 0)
          -
          709 {
          -
          710 dst.clear();
          -
          711 str2sgmlcat(dst, src, count_src, what);
          -
          712 }
          -
          713
          -
          721 inline void str2sgmlcpy(
          -
          722 _Inout_ std::string& dst,
          -
          723 _In_ const std::wstring& src,
          -
          724 _In_ size_t what = 0)
          -
          725 {
          -
          726 str2sgmlcpy(dst, src.data(), src.size(), what);
          -
          727 }
          -
          728
          -
          740 inline size_t str2sgmlcpy(
          -
          741 _Inout_cap_(count_dst) char* dst, _In_ size_t count_dst,
          -
          742 _In_reads_or_z_opt_(count_src) const wchar_t* src, _In_ size_t count_src,
          -
          743 _In_ size_t what = 0)
          -
          744 {
          -
          745 _Assume_(dst || !count_dst);
          -
          746 if (count_dst)
          -
          747 dst[0] = 0;
          -
          748 return str2sgmlcat(dst, count_dst, src, count_src, what);
          -
          749 }
          -
          750
          -
          760 inline std::string str2sgml(
          -
          761 _In_reads_or_z_opt_(count_src) const wchar_t* src, _In_ size_t count_src,
          -
          762 _In_ size_t what = 0)
          -
          763 {
          -
          764 std::string dst;
          -
          765 str2sgmlcat(dst, src, count_src, what);
          -
          766 return dst;
          -
          767 }
          -
          768
          -
          777 inline std::string str2sgml(
          -
          778 _In_ const std::wstring& src,
          -
          779 _In_ size_t what = 0)
          -
          780 {
          -
          781 return str2sgml(src.c_str(), src.size(), what);
          -
          782 }
          -
          783}
          +
          78 // constexpr int sgml_kolos = sgml_amp | sgml_quot | sgml_dollar | sgml_percnt | sgml_lt_gt | sgml_bsol/* | sgml_commat | sgml_num*/ | sgml_lpar_rpar | sgml_lcub_rcub | sgml_lsqb_rsqb;
          +
          79
          +
          90 template <class T>
          +
          91 inline void sgml2strcat(
          +
          92 _Inout_ std::wstring& dst,
          +
          93 _In_reads_or_z_opt_(count_src) const T* src, _In_ size_t count_src,
          +
          94 _In_ int skip = 0,
          +
          95 _In_ const mapping<size_t>& offset = mapping<size_t>(0, 0),
          +
          96 _Inout_opt_ mapping_vector<size_t>* map = nullptr)
          +
          97 {
          +
          98 _Assume_(src || !count_src);
          +
          99
          +
          100 const bool
          +
          101 skip_quot = (skip & sgml_quot) == 0,
          +
          102 skip_apos = (skip & sgml_apos) == 0,
          +
          103 skip_amp = (skip & sgml_amp) == 0,
          +
          104 skip_lt_gt = (skip & sgml_lt_gt) == 0,
          +
          105 skip_bsol = (skip & sgml_bsol) == 0,
          +
          106 skip_dollar = (skip & sgml_dollar) == 0,
          +
          107 skip_percnt = (skip & sgml_percnt) == 0,
          +
          108 skip_commat = (skip & sgml_commat) == 0,
          +
          109 skip_num = (skip & sgml_num) == 0,
          +
          110 skip_lpar_rpar = (skip & sgml_lpar_rpar) == 0,
          +
          111 skip_lcub_rcub = (skip & sgml_lcub_rcub) == 0,
          +
          112 skip_lsqb_rsqb = (skip & sgml_lsqb_rsqb) == 0;
          +
          113
          +
          114 count_src = strnlen(src, count_src);
          +
          115 dst.reserve(dst.size() + count_src);
          +
          116 for (size_t i = 0; i < count_src;) {
          +
          117 if (src[i] == '&') {
          +
          118 auto end = sgmlend(src + i + 1, count_src - i - 1);
          +
          119 if (end) {
          +
          120 const wchar_t* entity_w;
          +
          121 wchar_t chr[3];
          +
          122 size_t n = end - src - i - 1;
          +
          123 if (n >= 2 && src[i + 1] == '#') {
          +
          124 uint32_t unicode;
          +
          125 if (src[i + 2] == 'x' || src[i + 2] == 'X')
          +
          126 unicode = strtou32(src + i + 3, n - 2, nullptr, 16);
          +
          127 else
          +
          128 unicode = strtou32(src + i + 2, n - 1, nullptr, 10);
          +
          129#ifdef _WIN32
          +
          130 if (unicode < 0x10000) {
          +
          131 chr[0] = (wchar_t)unicode;
          +
          132 chr[1] = 0;
          +
          133 }
          +
          134 else {
          +
          135 ucs4_to_surrogate_pair(chr, unicode);
          +
          136 chr[2] = 0;
          +
          137 }
          +
          138#else
          +
          139 chr[0] = (wchar_t)unicode;
          +
          140 chr[1] = 0;
          +
          141#endif
          +
          142 entity_w = chr;
          +
          143 }
          +
          144 else
          +
          145 entity_w = sgml2uni(src + i + 1, n);
          +
          146
          +
          147 if (entity_w &&
          +
          148 (skip_quot || (entity_w[0] != L'"')) &&
          +
          149 (skip_apos || (entity_w[0] != L'\'')) &&
          +
          150 (skip_amp || (entity_w[0] != L'&')) &&
          +
          151 (skip_lt_gt || (entity_w[0] != L'<' && entity_w[0] != L'>')) &&
          +
          152 (skip_bsol || (entity_w[0] != L'\\')) &&
          +
          153 (skip_dollar || (entity_w[0] != L'$')) &&
          +
          154 (skip_percnt || (entity_w[0] != L'%')) &&
          +
          155 (skip_commat || (entity_w[0] != L'@')) &&
          +
          156 (skip_num || (entity_w[0] != L'#')) &&
          +
          157 (skip_lpar_rpar || (entity_w[0] != L'(' && entity_w[0] != L')')) &&
          +
          158 (skip_lcub_rcub || (entity_w[0] != L'{' && entity_w[0] != L'}')) &&
          +
          159 (skip_lsqb_rsqb || (entity_w[0] != L'[' && entity_w[0] != L']')))
          +
          160 {
          +
          161 if (map) map->push_back(mapping<size_t>(offset.from + i, offset.to + dst.size()));
          +
          162 dst.append(entity_w);
          +
          163 i = end - src + 1;
          +
          164 if (map) map->push_back(mapping<size_t>(offset.from + i, offset.to + dst.size()));
          +
          165 continue;
          +
          166 }
          +
          167 }
          +
          168 }
          +
          169 dst.append(1, src[i++]);
          +
          170 }
          +
          171 }
          +
          172
          +
          182 template <class T>
          +
          183 inline void sgml2strcat(
          +
          184 _Inout_ std::wstring& dst,
          +
          185 _In_ const std::basic_string<T>& src,
          +
          186 _In_ int skip = 0,
          +
          187 _In_ const mapping<size_t>& offset = mapping<size_t>(0, 0),
          +
          188 _Inout_opt_ mapping_vector<size_t>* map = nullptr)
          +
          189 {
          +
          190 sgml2strcat(dst, src.data(), src.size(), skip, offset, map);
          +
          191 }
          +
          192
          +
          206 template <class T>
          +
          207 inline size_t sgml2strcat(
          +
          208 _Inout_cap_(count_dst) wchar_t* dst, _In_ size_t count_dst,
          +
          209 _In_reads_or_z_opt_(count_src) const T* src, _In_ size_t count_src,
          +
          210 _In_ int skip = 0,
          +
          211 _In_ const mapping<size_t>& offset = mapping<size_t>(0, 0),
          +
          212 _Inout_opt_ mapping_vector<size_t>* map = nullptr)
          +
          213 {
          +
          214 _Assume_(dst || !count_dst);
          +
          215 _Assume_(src || !count_src);
          +
          216
          +
          217 static const std::invalid_argument buffer_overrun("buffer overrun");
          +
          218 const bool
          +
          219 skip_quot = (skip & sgml_quot) == 0,
          +
          220 skip_apos = (skip & sgml_apos) == 0,
          +
          221 skip_amp = (skip & sgml_amp) == 0,
          +
          222 skip_lt_gt = (skip & sgml_lt_gt) == 0,
          +
          223 skip_bsol = (skip & sgml_bsol) == 0,
          +
          224 skip_dollar = (skip & sgml_dollar) == 0,
          +
          225 skip_percnt = (skip & sgml_percnt) == 0,
          +
          226 skip_commat = (skip & sgml_commat) == 0,
          +
          227 skip_num = (skip & sgml_num) == 0,
          +
          228 skip_lpar_rpar = (skip & sgml_lpar_rpar) == 0,
          +
          229 skip_lcub_rcub = (skip & sgml_lcub_rcub) == 0,
          +
          230 skip_lsqb_rsqb = (skip & sgml_lsqb_rsqb) == 0;
          +
          231
          +
          232 size_t j = wcsnlen(dst, count_dst);
          +
          233 count_src = strnlen(src, count_src);
          +
          234 for (size_t i = 0; i < count_src;) {
          +
          235 if (src[i] == '&') {
          +
          236 auto end = sgmlend(src + i + 1, count_src - i - 1);
          +
          237 if (end) {
          +
          238 const wchar_t* entity_w;
          +
          239 wchar_t chr[3];
          +
          240 size_t n = end - src - i - 1;
          +
          241 if (n >= 2 && src[i + 1] == '#') {
          +
          242 uint32_t unicode;
          +
          243 if (src[i + 2] == 'x' || src[i + 2] == 'X')
          +
          244 unicode = strtou32(src + i + 3, n - 2, nullptr, 16);
          +
          245 else
          +
          246 unicode = strtou32(src + i + 2, n - 1, nullptr, 10);
          +
          247#ifdef _WIN32
          +
          248 if (unicode < 0x10000) {
          +
          249 chr[0] = (wchar_t)unicode;
          +
          250 chr[1] = 0;
          +
          251 }
          +
          252 else {
          +
          253 ucs4_to_surrogate_pair(chr, unicode);
          +
          254 chr[2] = 0;
          +
          255 }
          +
          256#else
          +
          257 chr[0] = (wchar_t)unicode;
          +
          258 chr[1] = 0;
          +
          259#endif
          +
          260 entity_w = chr;
          +
          261 }
          +
          262 else
          +
          263 entity_w = sgml2uni(src + i + 1, n);
          +
          264
          +
          265 if (entity_w &&
          +
          266 (skip_quot || (entity_w[0] != L'"')) &&
          +
          267 (skip_apos || (entity_w[0] != L'\'')) &&
          +
          268 (skip_amp || (entity_w[0] != L'&')) &&
          +
          269 (skip_lt_gt || (entity_w[0] != L'<' && entity_w[0] != L'>')) &&
          +
          270 (skip_bsol || (entity_w[0] != L'\\')) &&
          +
          271 (skip_dollar || (entity_w[0] != L'$')) &&
          +
          272 (skip_percnt || (entity_w[0] != L'%')) &&
          +
          273 (skip_commat || (entity_w[0] != L'@')) &&
          +
          274 (skip_num || (entity_w[0] != L'#')) &&
          +
          275 (skip_lpar_rpar || (entity_w[0] != L'(' && entity_w[0] != L')')) &&
          +
          276 (skip_lcub_rcub || (entity_w[0] != L'{' && entity_w[0] != L'}')) &&
          +
          277 (skip_lsqb_rsqb || (entity_w[0] != L'[' && entity_w[0] != L']')))
          +
          278 {
          +
          279 if (map) map->push_back(mapping<size_t>(offset.from + i, offset.to + j));
          +
          280 size_t m = wcslen(entity_w);
          +
          281 if (j + m >= count_dst)
          +
          282 throw buffer_overrun;
          +
          283 memcpy(dst + j, entity_w, m * sizeof(wchar_t)); j += m;
          +
          284 i = end - src + 1;
          +
          285 if (map) map->push_back(mapping<size_t>(offset.from + i, offset.to + j));
          +
          286 continue;
          +
          287 }
          +
          288 }
          +
          289 }
          +
          290 if (j + 1 >= count_dst)
          +
          291 throw buffer_overrun;
          +
          292 dst[j++] = src[i++];
          +
          293 }
          +
          294 if (j >= count_dst)
          +
          295 throw buffer_overrun;
          +
          296 dst[j] = 0;
          +
          297 return j;
          +
          298 }
          +
          299
          +
          310 template <class T>
          +
          311 inline void sgml2strcpy(
          +
          312 _Inout_ std::wstring& dst,
          +
          313 _In_reads_or_z_opt_(count_src) const T* src, _In_ size_t count_src,
          +
          314 _In_ int skip = 0,
          +
          315 _In_ const mapping<size_t>& offset = mapping<size_t>(0, 0),
          +
          316 _Inout_opt_ mapping_vector<size_t>* map = nullptr)
          +
          317 {
          +
          318 dst.clear();
          +
          319 if (map)
          +
          320 map->clear();
          +
          321 sgml2strcat(dst, src, count_src, skip, offset, map);
          +
          322 }
          +
          323
          +
          333 template<class _Elem, class _Traits, class _Ax>
          +
          334 inline void sgml2strcpy(
          +
          335 _Inout_ std::wstring& dst,
          +
          336 _In_ const std::basic_string<_Elem, _Traits, _Ax>& src,
          +
          337 _In_ int skip = 0,
          +
          338 _In_ const mapping<size_t>& offset = mapping<size_t>(0, 0),
          +
          339 _Inout_opt_ mapping_vector<size_t>* map = nullptr)
          +
          340 {
          +
          341 sgml2strcpy(dst, src.data(), src.size(), skip, offset, map);
          +
          342 }
          +
          343
          +
          357 template <class T>
          +
          358 inline size_t sgml2strcpy(
          +
          359 _Inout_cap_(count_dst) wchar_t* dst, _In_ size_t count_dst,
          +
          360 _In_reads_or_z_opt_(count_src) const T* src, _In_ size_t count_src,
          +
          361 _In_ int skip = 0,
          +
          362 _In_ const mapping<size_t>& offset = mapping<size_t>(0, 0),
          +
          363 _Inout_opt_ mapping_vector<size_t>* map = nullptr)
          +
          364 {
          +
          365 _Assume_(dst || !count_dst);
          +
          366 if (count_dst)
          +
          367 dst[0] = 0;
          +
          368 if (map)
          +
          369 map->clear();
          +
          370 return sgml2strcat(dst, count_dst, src, count_src, skip, offset, map);
          +
          371 }
          +
          372
          +
          384 template <class T>
          +
          385 inline std::wstring sgml2str(
          +
          386 _In_reads_or_z_opt_(count_src) const T* src, _In_ size_t count_src,
          +
          387 _In_ int skip = 0,
          +
          388 _In_ const mapping<size_t>& offset = mapping<size_t>(0, 0),
          +
          389 _Inout_opt_ mapping_vector<size_t>* map = nullptr)
          +
          390 {
          +
          391 std::wstring dst;
          +
          392 sgml2strcat(dst, src, count_src, skip, offset, map);
          +
          393 return dst;
          +
          394 }
          +
          395
          +
          406 template <class T>
          +
          407 inline std::wstring sgml2str(
          +
          408 _In_ const std::basic_string<T>& src,
          +
          409 _In_ int skip = 0,
          +
          410 _In_ const mapping<size_t>& offset = mapping<size_t>(0, 0),
          +
          411 _Inout_opt_ mapping_vector<size_t>* map = nullptr)
          +
          412 {
          +
          413 return sgml2str(src.c_str(), src.size(), skip, offset, map);
          +
          414 }
          +
          415
          +
          417 inline const char* chr2sgml(_In_reads_or_z_(count) const wchar_t* entity, _In_ size_t count)
          +
          418 {
          +
          419 _Assume_(entity && count);
          +
          420
          +
          421 const wchar_t e2 = entity[0];
          +
          422 for (size_t i = 0, j = _countof(unicode_sgml); i < j; ) {
          +
          423 size_t m = (i + j) / 2;
          +
          424 wchar_t e1 = sgml_unicode[unicode_sgml[m]].unicode[0];
          +
          425 if (e1 < e2)
          +
          426 i = m + 1;
          +
          427 else if (e1 > e2)
          +
          428 j = m;
          +
          429 else {
          +
          430 auto r = strncmp(sgml_unicode[unicode_sgml[m]].unicode + 1, _countof(sgml_unicode[0].unicode) - 1, entity + 1, count - 1);
          +
          431 if (r < 0)
          +
          432 i = m + 1;
          +
          433 else if (r > 0)
          +
          434 j = m;
          +
          435 else {
          +
          436 for (; i < m && sgml_unicode[unicode_sgml[m - 1]].unicode[0] == e2 && strncmp(sgml_unicode[unicode_sgml[m - 1]].unicode + 1, _countof(sgml_unicode[0].unicode) - 1, entity + 1, count - 1) == 0; m--);
          +
          437 return sgml_unicode[unicode_sgml[m]].sgml;
          +
          438 }
          +
          439 }
          +
          440 }
          +
          441 return nullptr;
          +
          442 }
          +
          444
          +
          453 inline void str2sgmlcat(
          +
          454 _Inout_ std::string& dst,
          +
          455 _In_reads_or_z_opt_(count_src) const wchar_t* src, _In_ size_t count_src,
          +
          456 _In_ int what = 0)
          +
          457 {
          +
          458 _Assume_(src || !count_src);
          +
          459
          +
          460 const bool
          +
          461 do_ascii = (what & sgml_full) == 0,
          +
          462 do_quot = (what & sgml_quot) == 0,
          +
          463 do_apos = (what & sgml_apos) == 0,
          +
          464 do_lt_gt = (what & sgml_lt_gt) == 0,
          +
          465 do_bsol = (what & sgml_bsol) == 0,
          +
          466 do_dollar = (what & sgml_dollar) == 0,
          +
          467 do_percnt = (what & sgml_percnt) == 0,
          +
          468 do_commat = (what & sgml_commat) == 0,
          +
          469 do_num = (what & sgml_num) == 0,
          +
          470 do_lpar_rpar = (what & sgml_lpar_rpar) == 0,
          +
          471 do_lcub_rcub = (what & sgml_lcub_rcub) == 0,
          +
          472 do_lsqb_rsqb = (what & sgml_lsqb_rsqb) == 0;
          +
          473
          +
          474 count_src = wcsnlen(src, count_src);
          +
          475 dst.reserve(dst.size() + count_src);
          +
          476 for (size_t i = 0; i < count_src;) {
          +
          477 size_t n = glyphlen(src + i, count_src - i);
          +
          478 if (n == 1 &&
          +
          479 do_ascii && (unsigned int)src[i] < 128 &&
          +
          480 src[i] != L'&' &&
          +
          481 (do_quot || (src[i] != L'"')) &&
          +
          482 (do_apos || (src[i] != L'\'')) &&
          +
          483 (do_lt_gt || (src[i] != L'<' && src[i] != L'>')) &&
          +
          484 (do_bsol || (src[i] != L'\\')) &&
          +
          485 (do_dollar || (src[i] != L'$')) &&
          +
          486 (do_percnt || (src[i] != L'%')) &&
          +
          487 (do_commat || (src[i] != L'@')) &&
          +
          488 (do_num || (src[i] != L'#')) &&
          +
          489 (do_lpar_rpar || (src[i] != L'(' && src[i] != L')')) &&
          +
          490 (do_lcub_rcub || (src[i] != L'{' && src[i] != L'}')) &&
          +
          491 (do_lsqb_rsqb || (src[i] != L'[' && src[i] != L']')))
          +
          492 {
          +
          493 // 7-bit ASCII and no desire to encode it as an SGML entity.
          +
          494 dst.append(1, static_cast<char>(src[i++]));
          +
          495 }
          +
          496 else {
          +
          497 const char* entity = chr2sgml(src + i, n);
          +
          498 if (entity) {
          +
          499 dst.append(1, '&');
          +
          500 dst.append(entity);
          +
          501 dst.append(1, ';');
          +
          502 i += n;
          +
          503 }
          +
          504 else if (n == 1) {
          +
          505 // Trivial character (1 code unit, 1 glyph), no entity available.
          +
          506 if ((unsigned int)src[i] < 128)
          +
          507 dst.append(1, static_cast<char>(src[i++]));
          +
          508 else {
          +
          509 char tmp[3 + 8 + 1 + 1];
          +
          510 snprintf(tmp, _countof(tmp), "&#x%x;", src[i++]);
          +
          511 dst.append(tmp);
          +
          512 }
          +
          513 }
          +
          514 else {
          +
          515 // Non-trivial character. Decompose.
          +
          516 const size_t end = i + n;
          +
          517 while (i < end) {
          +
          518 if ((entity = chr2sgml(src + i, 1)) != nullptr) {
          +
          519 dst.append(1, '&');
          +
          520 dst.append(entity);
          +
          521 dst.append(1, ';');
          +
          522 i++;
          +
          523 }
          +
          524 else if ((unsigned int)src[i] < 128)
          +
          525 dst.append(1, static_cast<char>(src[i++]));
          +
          526 else {
          +
          527 uint32_t unicode;
          +
          528#ifdef _WIN32
          +
          529 if (i + 1 < end && is_surrogate_pair(src + i)) {
          +
          530 unicode = surrogate_pair_to_ucs4(src + i);
          +
          531 i += 2;
          +
          532 }
          +
          533 else
          +
          534#endif
          +
          535 {
          +
          536 unicode = src[i++];
          +
          537 }
          +
          538 char tmp[3 + 8 + 1 + 1];
          +
          539 snprintf(tmp, _countof(tmp), "&#x%x;", unicode);
          +
          540 dst.append(tmp);
          +
          541 }
          +
          542 }
          +
          543 }
          +
          544 }
          +
          545 }
          +
          546 }
          +
          547
          +
          555 inline void str2sgmlcat(
          +
          556 _Inout_ std::string& dst,
          +
          557 _In_ const std::wstring& src,
          +
          558 _In_ int what = 0)
          +
          559 {
          +
          560 str2sgmlcat(dst, src.c_str(), src.size(), what);
          +
          561 }
          +
          562
          +
          574 inline size_t str2sgmlcat(
          +
          575 _Inout_cap_(count_dst) char* dst, _In_ size_t count_dst,
          +
          576 _In_reads_or_z_opt_(count_src) const wchar_t* src, _In_ size_t count_src,
          +
          577 _In_ int what = 0)
          +
          578 {
          +
          579 _Assume_(dst || !count_dst);
          +
          580 _Assume_(src || !count_src);
          +
          581
          +
          582 static const std::invalid_argument buffer_overrun("buffer overrun");
          +
          583 const bool
          +
          584 do_ascii = (what & sgml_full) == 0,
          +
          585 do_quot = (what & sgml_quot) == 0,
          +
          586 do_apos = (what & sgml_apos) == 0,
          +
          587 do_lt_gt = (what & sgml_lt_gt) == 0,
          +
          588 do_bsol = (what & sgml_bsol) == 0,
          +
          589 do_dollar = (what & sgml_dollar) == 0,
          +
          590 do_percnt = (what & sgml_percnt) == 0,
          +
          591 do_commat = (what & sgml_commat) == 0,
          +
          592 do_num = (what & sgml_num) == 0,
          +
          593 do_lpar_rpar = (what & sgml_lpar_rpar) == 0,
          +
          594 do_lcub_rcub = (what & sgml_lcub_rcub) == 0,
          +
          595 do_lsqb_rsqb = (what & sgml_lsqb_rsqb) == 0;
          +
          596
          +
          597 size_t j = strnlen(dst, count_dst);
          +
          598 count_src = wcsnlen(src, count_src);
          +
          599 for (size_t i = 0; i < count_src;) {
          +
          600 size_t n = glyphlen(src + i, count_src - i);
          +
          601 if (n == 1 &&
          +
          602 do_ascii && (unsigned int)src[i] < 128 &&
          +
          603 src[i] != L'&' &&
          +
          604 (do_quot || (src[i] != L'"')) &&
          +
          605 (do_apos || (src[i] != L'\'')) &&
          +
          606 (do_lt_gt || (src[i] != L'<' && src[i] != L'>')) &&
          +
          607 (do_bsol || (src[i] != L'\\')) &&
          +
          608 (do_dollar || (src[i] != L'$')) &&
          +
          609 (do_percnt || (src[i] != L'%')) &&
          +
          610 (do_commat || (src[i] != L'@')) &&
          +
          611 (do_num || (src[i] != L'#')) &&
          +
          612 (do_lpar_rpar || (src[i] != L'(' && src[i] != L')')) &&
          +
          613 (do_lcub_rcub || (src[i] != L'{' && src[i] != L'}')) &&
          +
          614 (do_lsqb_rsqb || (src[i] != L'[' && src[i] != L']')))
          +
          615 {
          +
          616 // 7-bit ASCII and no desire to encode it as an SGML entity.
          +
          617 if (j + 1 >= count_dst)
          +
          618 throw buffer_overrun;
          +
          619 dst[j++] = static_cast<char>(src[i++]);
          +
          620 }
          +
          621 else {
          +
          622 const char* entity = chr2sgml(src + i, n);
          +
          623 if (entity) {
          +
          624 size_t m = strlen(entity);
          +
          625 if (j + m + 2 >= count_dst)
          +
          626 throw buffer_overrun;
          +
          627 dst[j++] = '&';
          +
          628 memcpy(dst + j, entity, m * sizeof(char)); j += m;
          +
          629 dst[j++] = ';';
          +
          630 i += n;
          +
          631 }
          +
          632 else if (n == 1) {
          +
          633 // Trivial character (1 code unit, 1 glyph), no entity available.
          +
          634 if ((unsigned int)src[i] < 128) {
          +
          635 if (j + 1 >= count_dst)
          +
          636 throw buffer_overrun;
          +
          637 dst[j++] = static_cast<char>(src[i++]);
          +
          638 }
          +
          639 else {
          +
          640 char tmp[3 + 8 + 1 + 1];
          +
          641 int m = snprintf(tmp, _countof(tmp), "&#x%x;", src[i++]);
          +
          642 _Assume_(m >= 0);
          +
          643 if (static_cast<size_t>(m) >= count_dst)
          +
          644 throw buffer_overrun;
          +
          645 memcpy(dst + j, tmp, m * sizeof(char)); j += m;
          +
          646 }
          +
          647 }
          +
          648 else {
          +
          649 // Non-trivial character. Decompose.
          +
          650 const size_t end = i + n;
          +
          651 while (i < end) {
          +
          652 if ((entity = chr2sgml(src + i, 1)) != nullptr) {
          +
          653 size_t m = strlen(entity);
          +
          654 if (j + m + 2 >= count_dst)
          +
          655 throw buffer_overrun;
          +
          656 dst[j++] = '&';
          +
          657 memcpy(dst + j, entity, m * sizeof(char)); j += m;
          +
          658 dst[j++] = ';';
          +
          659 i++;
          +
          660 }
          +
          661 else if ((unsigned int)src[i] < 128) {
          +
          662 if (j + 1 >= count_dst)
          +
          663 throw buffer_overrun;
          +
          664 dst[j++] = static_cast<char>(src[i++]);
          +
          665 }
          +
          666 else {
          +
          667 uint32_t unicode;
          +
          668#ifdef _WIN32
          +
          669 if (i + 1 < end && is_surrogate_pair(src + i)) {
          +
          670 unicode = surrogate_pair_to_ucs4(src + i);
          +
          671 i += 2;
          +
          672 }
          +
          673 else
          +
          674#endif
          +
          675 {
          +
          676 unicode = src[i++];
          +
          677 }
          +
          678 char tmp[3 + 8 + 1 + 1];
          +
          679 int m = snprintf(tmp, _countof(tmp), "&#x%x;", unicode);
          +
          680 _Assume_(m >= 0);
          +
          681 if (static_cast<size_t>(m) >= count_dst)
          +
          682 throw buffer_overrun;
          +
          683 memcpy(dst + j, tmp, m * sizeof(char)); j += m;
          +
          684 }
          +
          685 }
          +
          686 }
          +
          687 }
          +
          688 }
          +
          689 if (j >= count_dst)
          +
          690 throw buffer_overrun;
          +
          691 dst[j] = 0;
          +
          692 return j;
          +
          693 }
          +
          694
          +
          703 inline void str2sgmlcpy(
          +
          704 _Inout_ std::string& dst,
          +
          705 _In_reads_or_z_opt_(count_src) const wchar_t* src, _In_ size_t count_src,
          +
          706 _In_ int what = 0)
          +
          707 {
          +
          708 dst.clear();
          +
          709 str2sgmlcat(dst, src, count_src, what);
          +
          710 }
          +
          711
          +
          719 inline void str2sgmlcpy(
          +
          720 _Inout_ std::string& dst,
          +
          721 _In_ const std::wstring& src,
          +
          722 _In_ int what = 0)
          +
          723 {
          +
          724 str2sgmlcpy(dst, src.data(), src.size(), what);
          +
          725 }
          +
          726
          +
          738 inline size_t str2sgmlcpy(
          +
          739 _Inout_cap_(count_dst) char* dst, _In_ size_t count_dst,
          +
          740 _In_reads_or_z_opt_(count_src) const wchar_t* src, _In_ size_t count_src,
          +
          741 _In_ int what = 0)
          +
          742 {
          +
          743 _Assume_(dst || !count_dst);
          +
          744 if (count_dst)
          +
          745 dst[0] = 0;
          +
          746 return str2sgmlcat(dst, count_dst, src, count_src, what);
          +
          747 }
          +
          748
          +
          758 inline std::string str2sgml(
          +
          759 _In_reads_or_z_opt_(count_src) const wchar_t* src, _In_ size_t count_src,
          +
          760 _In_ int what = 0)
          +
          761 {
          +
          762 std::string dst;
          +
          763 str2sgmlcat(dst, src, count_src, what);
          +
          764 return dst;
          +
          765 }
          +
          766
          +
          775 inline std::string str2sgml(
          +
          776 _In_ const std::wstring& src,
          +
          777 _In_ int what = 0)
          +
          778 {
          +
          779 return str2sgml(src.c_str(), src.size(), what);
          +
          780 }
          +
          781}
          diff --git a/sgml__unicode_8hpp_source.html b/sgml__unicode_8hpp_source.html index 1b416a20d..6ce54501e 100644 --- a/sgml__unicode_8hpp_source.html +++ b/sgml__unicode_8hpp_source.html @@ -3175,7 +3175,7 @@ $(document).ready(function() { init_codefold(0); }); diff --git a/socket_8hpp_source.html b/socket_8hpp_source.html index cf4df8573..3cddebe9b 100644 --- a/socket_8hpp_source.html +++ b/socket_8hpp_source.html @@ -113,7 +113,7 @@ $(document).ready(function() { init_codefold(0); }); diff --git a/spinlock_8hpp_source.html b/spinlock_8hpp_source.html index 3dbd23ff7..9ee448b23 100644 --- a/spinlock_8hpp_source.html +++ b/spinlock_8hpp_source.html @@ -157,7 +157,7 @@ $(document).ready(function() { init_codefold(0); }); diff --git a/stream_8cpp_source.html b/stream_8cpp_source.html index 4b1a585d1..1ba857e47 100644 --- a/stream_8cpp_source.html +++ b/stream_8cpp_source.html @@ -243,21 +243,21 @@ $(document).ready(function() { init_codefold(0); });
          159 }
          160 };
          161}
          -
          Provides read-ahead stream capability.
          Definition stream.hpp:1256
          -
          Provides write-back stream capability.
          Definition stream.hpp:1323
          +
          Provides read-ahead stream capability.
          Definition stream.hpp:1244
          +
          Provides write-back stream capability.
          Definition stream.hpp:1311
          bool ok() const
          Returns true if the stream state is clean i.e. previous operation was succesful.
          Definition stream.hpp:175
          -
          Buffered read/write stream.
          Definition stream.hpp:1394
          -
          Cached file-system file.
          Definition stream.hpp:3101
          -
          File-system file.
          Definition stream.hpp:2697
          -
          static bool readonly(const stdex::schar_t *filename)
          Checks if file/folder/symlink is read-only.
          Definition stream.hpp:3072
          -
          static bool exists(const stdex::schar_t *filename)
          Checks if file/folder/symlink likely exists.
          Definition stream.hpp:3045
          -
          In-memory file.
          Definition stream.hpp:3178
          -
          Replicates writing of the same data to multiple streams.
          Definition stream.hpp:1087
          -
          void push_back(basic *source)
          Adds stream on the list.
          Definition stream.hpp:1106
          +
          Buffered read/write stream.
          Definition stream.hpp:1382
          +
          Cached file-system file.
          Definition stream.hpp:3089
          +
          File-system file.
          Definition stream.hpp:2685
          +
          static bool readonly(const stdex::schar_t *filename)
          Checks if file/folder/symlink is read-only.
          Definition stream.hpp:3060
          +
          static bool exists(const stdex::schar_t *filename)
          Checks if file/folder/symlink likely exists.
          Definition stream.hpp:3033
          +
          In-memory file.
          Definition stream.hpp:3171
          +
          Replicates writing of the same data to multiple streams.
          Definition stream.hpp:1075
          +
          void push_back(basic *source)
          Adds stream on the list.
          Definition stream.hpp:1094
          diff --git a/stream_8hpp_source.html b/stream_8hpp_source.html index ce2d2dab6..232b62a07 100644 --- a/stream_8hpp_source.html +++ b/stream_8hpp_source.html @@ -323,4006 +323,3998 @@ $(document).ready(function() { init_codefold(0); });
          298 }
          299
          -
          305 template<class _Traits = std::char_traits<char>, class _Ax = std::allocator<char>>
          +
          305 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
          -
          306 inline size_t readln(_Inout_ std::basic_string<char, _Traits, _Ax>& str)
          +
          306 inline size_t readln(_Inout_ std::basic_string<_Elem, _Traits, _Ax>& str)
          307 {
          308 str.clear();
          309 return readln_and_attach(str);
          310 }
          311
          -
          317 template<class _Traits = std::char_traits<wchar_t>, class _Ax = std::allocator<wchar_t>>
          +
          317 template<class T_from, class T_to, class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>>
          -
          318 inline size_t readln(_Inout_ std::basic_string<wchar_t, _Traits, _Ax>& wstr)
          +
          318 size_t readln(_Inout_ std::basic_string<T_to, _Traits, _Ax>& str, _In_ charset_encoder<T_from, T_to>& encoder)
          319 {
          -
          320 wstr.clear();
          -
          321 return readln_and_attach(wstr);
          -
          322 }
          +
          320 if (encoder.from_encoding() == encoder.to_encoding())
          +
          321 return readln(str);
          +
          322 std::basic_string<T_from> tmp;
          + +
          324 encoder.strcpy(str, tmp);
          +
          325 return str.size();
          +
          326 }
          -
          323
          -
          329 template<class T_from, class T_to, class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>>
          -
          -
          330 size_t readln(_Inout_ std::basic_string<T_to, _Traits, _Ax>& wstr, _In_ charset_encoder<T_from, T_to>& encoder)
          -
          331 {
          -
          332 if (encoder.from_encoding() == encoder.to_encoding())
          -
          333 return readln(wstr);
          -
          334 std::string str;
          - -
          336 encoder.strcpy(wstr, str);
          -
          337 return wstr.size();
          -
          338 }
          +
          327
          +
          333 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
          +
          +
          334 size_t readln_and_attach(_Inout_ std::basic_string<_Elem, _Traits, _Ax>& str)
          +
          335 {
          +
          336 bool initial = true;
          +
          337 _Elem chr, previous = (_Elem)0;
          +
          338 do {
          +
          339 read_array(&chr, sizeof(_Elem), 1);
          +
          340 if (!initial && !(previous == static_cast<_Elem>('\r') && chr == static_cast<_Elem>('\n')))
          +
          341 str += previous;
          +
          342 else
          +
          343 initial = false;
          +
          344 previous = chr;
          +
          345 } while (ok() && chr != static_cast<_Elem>('\n'));
          +
          346 return str.size();
          +
          347 }
          -
          339
          -
          345 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
          -
          -
          346 size_t readln_and_attach(_Inout_ std::basic_string<_Elem, _Traits, _Ax>& str)
          -
          347 {
          -
          348 bool initial = true;
          -
          349 _Elem chr, previous = (_Elem)0;
          -
          350 do {
          -
          351 read_array(&chr, sizeof(_Elem), 1);
          -
          352 if (!initial && !(previous == static_cast<_Elem>('\r') && chr == static_cast<_Elem>('\n')))
          -
          353 str += previous;
          -
          354 else
          -
          355 initial = false;
          -
          356 previous = chr;
          -
          357 } while (ok() && chr != static_cast<_Elem>('\n'));
          -
          358 return str.size();
          -
          359 }
          +
          348
          +
          354 template<class T_from, class T_to, class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>>
          +
          +
          355 size_t readln_and_attach(_Inout_ std::basic_string<T_to, _Traits, _Ax>& str, _In_ charset_encoder<T_from, T_to>& encoder)
          +
          356 {
          +
          357 if (encoder.from_encoding() == encoder.to_encoding())
          +
          358 return readln_and_attach(str);
          +
          359 std::basic_string<T_from> tmp;
          + +
          361 encoder.strcat(str, tmp);
          +
          362 return str.size();
          +
          363 }
          -
          360
          -
          366 template<class T_from, class T_to, class _Traits = std::char_traits<T_to>, class _Ax = std::allocator<T_to>>
          -
          -
          367 size_t readln_and_attach(_Inout_ std::basic_string<T_to, _Traits, _Ax>& wstr, _In_ charset_encoder<T_from, T_to>& encoder)
          -
          368 {
          -
          369 if (encoder.from_encoding() == encoder.to_encoding())
          -
          370 return readln_and_attach(wstr);
          -
          371 std::string str;
          - -
          373 encoder.strcat(wstr, str);
          -
          374 return wstr.size();
          -
          375 }
          +
          364
          +
          +
          370 size_t read_array(_Out_writes_bytes_(size* count) void* array, _In_ size_t size, _In_ size_t count)
          +
          371 {
          +
          372 for (size_t to_read = mul(size, count);;) {
          +
          373 size_t num_read = read(array, to_read);
          +
          374 to_read -= num_read;
          +
          375 if (!to_read)
          +
          376 return count;
          +
          377 if (!ok()) _Unlikely_
          +
          378 return count - to_read / size;
          +
          379 reinterpret_cast<uint8_t*&>(array) += num_read;
          +
          380 }
          +
          381 }
          -
          376
          -
          -
          382 size_t read_array(_Out_writes_bytes_(size* count) void* array, _In_ size_t size, _In_ size_t count)
          -
          383 {
          -
          384 for (size_t to_read = mul(size, count);;) {
          -
          385 size_t num_read = read(array, to_read);
          -
          386 to_read -= num_read;
          -
          387 if (!to_read)
          -
          388 return count;
          -
          389 if (!ok()) _Unlikely_
          -
          390 return count - to_read / size;
          -
          391 reinterpret_cast<uint8_t*&>(array) += num_read;
          -
          392 }
          -
          393 }
          +
          382
          +
          +
          388 inline size_t write_array(_In_reads_bytes_opt_(size* count) const void* array, _In_ size_t size, _In_ size_t count)
          +
          389 {
          +
          390 return write(array, mul(size, count)) / size;
          +
          391 }
          -
          394
          -
          -
          400 inline size_t write_array(_In_reads_bytes_opt_(size* count) const void* array, _In_ size_t size, _In_ size_t count)
          -
          401 {
          -
          402 return write(array, mul(size, count)) / size;
          -
          403 }
          +
          392
          +
          401 template <class T_from, class T_to>
          +
          +
          402 size_t write_array(_In_z_ const T_from* str, _In_ charset_encoder<T_from, T_to>& encoder)
          +
          403 {
          +
          404 if (!ok()) _Unlikely_
          +
          405 return 0;
          +
          406 size_t num_chars = stdex::strlen(str);
          +
          407 if (encoder.from_encoding() == encoder.to_encoding())
          +
          408 return write_array(str, sizeof(T_from), num_chars);
          +
          409 std::basic_string<T_to> tmp(encoder.convert(str, num_chars));
          +
          410 return write_array(tmp.data(), sizeof(T_to), tmp.size());
          +
          411 }
          -
          404
          -
          413 template <class T_from, class T_to>
          -
          -
          414 size_t write_array(_In_z_ const T_from* wstr, _In_ charset_encoder<T_from, T_to>& encoder)
          -
          415 {
          -
          416 if (!ok()) _Unlikely_
          -
          417 return 0;
          -
          418 size_t num_chars = stdex::strlen(wstr);
          -
          419 if (encoder.from_encoding() == encoder.to_encoding())
          -
          420 return write_array(wstr, sizeof(T_from), num_chars);
          -
          421 std::basic_string<T_to> str(encoder.convert(wstr, num_chars));
          -
          422 return write_array(str.data(), sizeof(T_to), str.size());
          -
          423 }
          +
          412
          +
          422 template <class T_from, class T_to>
          +
          +
          423 size_t write_array(_In_reads_or_z_opt_(num_chars) const T_from* str, _In_ size_t num_chars, _In_ charset_encoder<T_from, T_to>& encoder)
          +
          424 {
          +
          425 if (!ok()) _Unlikely_
          +
          426 return 0;
          +
          427 num_chars = stdex::strnlen(str, num_chars);
          +
          428 if (encoder.from_encoding() == encoder.to_encoding())
          +
          429 return write_array(str, sizeof(T_from), num_chars);
          +
          430 std::basic_string<T_to> tmp(encoder.convert(str, num_chars));
          +
          431 return write_array(tmp.data(), sizeof(T_to), tmp.size());
          +
          432 }
          -
          424
          -
          434 template <class T_from, class T_to>
          -
          -
          435 size_t write_array(_In_reads_or_z_opt_(num_chars) const T_from* wstr, _In_ size_t num_chars, _In_ charset_encoder<T_from, T_to>& encoder)
          -
          436 {
          -
          437 if (!ok()) _Unlikely_
          -
          438 return 0;
          -
          439 num_chars = stdex::strnlen(wstr, num_chars);
          -
          440 if (encoder.from_encoding() == encoder.to_encoding())
          -
          441 return write_array(wstr, sizeof(T_from), num_chars);
          -
          442 std::basic_string<T_to> str(encoder.convert(wstr, num_chars));
          -
          443 return write_array(str.data(), sizeof(T_to), str.size());
          -
          444 }
          +
          433
          +
          442 template<class T_from, class T_to, class _Traits = std::char_traits<T_from>, class _Ax = std::allocator<T_from>>
          +
          +
          443 size_t write_array(_In_ const std::basic_string<T_from, _Traits, _Ax>& str, _In_ charset_encoder<T_from, T_to>& encoder)
          +
          444 {
          +
          445 if (!ok()) _Unlikely_
          +
          446 return 0;
          +
          447 if (encoder.from_encoding() == encoder.to_encoding())
          +
          448 return write_array(str.data(), sizeof(T_from), str.size());
          +
          449 std::basic_string<T_to> tmp(encoder.convert(str));
          +
          450 return write_array(tmp.data(), sizeof(T_to), tmp.size());
          +
          451 }
          -
          445
          -
          454 template<class T_from, class T_to, class _Traits = std::char_traits<T_from>, class _Ax = std::allocator<T_from>>
          -
          -
          455 size_t write_array(_In_ const std::basic_string<T_from, _Traits, _Ax>& wstr, _In_ charset_encoder<T_from, T_to>& encoder)
          -
          456 {
          -
          457 if (!ok()) _Unlikely_
          -
          458 return 0;
          -
          459 if (encoder.from_encoding() == encoder.to_encoding())
          -
          460 return write_array(wstr.data(), sizeof(T_from), wstr.size());
          -
          461 std::basic_string<T_to> str(encoder.convert(wstr));
          -
          462 return write_array(str.data(), sizeof(T_to), str.size());
          -
          463 }
          +
          452
          +
          464 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
          +
          +
          465 inline basic& read_str(_Out_ std::basic_string<_Elem, _Traits, _Ax>& data)
          +
          466 {
          +
          467 data.clear();
          +
          468 if (!ok()) _Unlikely_
          +
          469 return *this;
          +
          470 uint32_t num_chars;
          +
          471 read_data(num_chars);
          +
          472 if (!ok()) _Unlikely_
          +
          473 return *this;
          +
          474 data.reserve(num_chars);
          +
          475 for (;;) {
          +
          476 _Elem buf[0x400];
          +
          477 uint32_t num_read = static_cast<uint32_t>(read_array(buf, sizeof(_Elem), std::min<uint32_t>(num_chars, _countof(buf))));
          +
          478 data.append(buf, buf + num_read);
          +
          479 num_chars -= num_read;
          +
          480 if (!num_chars || !ok())
          +
          481 return *this;
          +
          482 }
          +
          483 }
          -
          464
          -
          476 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
          -
          -
          477 inline basic& read_str(_Out_ std::basic_string<_Elem, _Traits, _Ax>& data)
          -
          478 {
          -
          479 data.clear();
          -
          480 if (!ok()) _Unlikely_
          -
          481 return *this;
          -
          482 uint32_t num_chars;
          -
          483 read_data(num_chars);
          -
          484 if (!ok()) _Unlikely_
          -
          485 return *this;
          -
          486 data.reserve(num_chars);
          -
          487 for (;;) {
          -
          488 _Elem buf[0x400];
          -
          489 uint32_t num_read = static_cast<uint32_t>(read_array(buf, sizeof(_Elem), std::min<uint32_t>(num_chars, _countof(buf))));
          -
          490 data.append(buf, buf + num_read);
          -
          491 num_chars -= num_read;
          -
          492 if (!num_chars || !ok())
          -
          493 return *this;
          -
          494 }
          -
          495 }
          +
          484
          +
          496 template <class T>
          +
          +
          497 inline basic& write_str(_In_z_ const T* data)
          +
          498 {
          +
          499 // Stream state will be checked in write_data.
          +
          500 size_t num_chars = stdex::strlen(data);
          +
          501 if (num_chars > UINT32_MAX)
          +
          502 throw std::invalid_argument("string too long");
          +
          503 write_data(static_cast<uint32_t>(num_chars));
          +
          504 if (!ok()) _Unlikely_
          +
          505 return *this;
          +
          506 write_array(data, sizeof(T), num_chars);
          +
          507 return *this;
          +
          508 }
          -
          496
          -
          508 template <class T>
          -
          -
          509 inline basic& write_str(_In_z_ const T* data)
          -
          510 {
          -
          511 // Stream state will be checked in write_data.
          -
          512 size_t num_chars = stdex::strlen(data);
          -
          513 if (num_chars > UINT32_MAX)
          -
          514 throw std::invalid_argument("string too long");
          -
          515 write_data(static_cast<uint32_t>(num_chars));
          -
          516 if (!ok()) _Unlikely_
          -
          517 return *this;
          -
          518 write_array(data, sizeof(T), num_chars);
          -
          519 return *this;
          -
          520 }
          +
          509
          +
          521 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
          +
          +
          522 inline basic& write_str(_In_ const std::basic_string<_Elem, _Traits, _Ax>& data)
          +
          523 {
          +
          524 // Stream state will be checked in write_data.
          +
          525 size_t num_chars = data.size();
          +
          526 if (num_chars > UINT32_MAX)
          +
          527 throw std::invalid_argument("string too long");
          +
          528 write_data(static_cast<uint32_t>(num_chars));
          +
          529 if (!ok()) _Unlikely_
          +
          530 return *this;
          +
          531 write_array(data.data(), sizeof(_Elem), num_chars);
          +
          532 return *this;
          +
          533 }
          -
          521
          -
          533 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
          -
          -
          534 inline basic& write_str(_In_ const std::basic_string<_Elem, _Traits, _Ax>& data)
          -
          535 {
          -
          536 // Stream state will be checked in write_data.
          -
          537 size_t num_chars = data.size();
          -
          538 if (num_chars > UINT32_MAX)
          -
          539 throw std::invalid_argument("string too long");
          -
          540 write_data(static_cast<uint32_t>(num_chars));
          -
          541 if (!ok()) _Unlikely_
          -
          542 return *this;
          -
          543 write_array(data.data(), sizeof(_Elem), num_chars);
          -
          544 return *this;
          -
          545 }
          +
          534
          +
          535#ifdef _WIN32
          +
          541 size_t write_sa(_In_ LPSAFEARRAY sa)
          +
          542 {
          +
          543 safearray_accessor<void> a(sa);
          +
          544 long ubound, lbound;
          +
          545 if (FAILED(SafeArrayGetUBound(sa, 1, &ubound)) ||
          +
          546 FAILED(SafeArrayGetLBound(sa, 1, &lbound)))
          +
          547 throw std::invalid_argument("SafeArrayGet[UL]Bound failed");
          +
          548 return write(a.data(), static_cast<size_t>(ubound) - lbound + 1);
          +
          549 }
          +
          550#endif
          +
          551
          +
          +
          557 fsize_t write_stream(_Inout_ basic& stream, _In_ fsize_t amount = fsize_max)
          +
          558 {
          +
          559 std::unique_ptr<uint8_t[]> data(new uint8_t[static_cast<size_t>(std::min<fsize_t>(amount, default_block_size))]);
          +
          560 fsize_t num_copied = 0, to_write = amount;
          +
          561 m_state = state_t::ok;
          +
          562 while (to_write) {
          +
          563 size_t num_read = stream.read(data.get(), static_cast<size_t>(std::min<fsize_t>(default_block_size, to_write)));
          +
          564 size_t num_written = write(data.get(), num_read);
          +
          565 num_copied += num_written;
          +
          566 to_write -= num_written;
          +
          567 if (stream.m_state == state_t::eof) {
          +
          568 // EOF is not an error.
          +
          569 m_state = state_t::ok;
          +
          570 break;
          +
          571 }
          +
          572 m_state = stream.m_state;
          +
          573 if (!ok())
          +
          574 break;
          +
          575 }
          +
          576 return num_copied;
          +
          577 }
          -
          546
          -
          547#ifdef _WIN32
          -
          553 size_t write_sa(_In_ LPSAFEARRAY sa)
          -
          554 {
          -
          555 safearray_accessor<void> a(sa);
          -
          556 long ubound, lbound;
          -
          557 if (FAILED(SafeArrayGetUBound(sa, 1, &ubound)) ||
          -
          558 FAILED(SafeArrayGetLBound(sa, 1, &lbound)))
          -
          559 throw std::invalid_argument("SafeArrayGet[UL]Bound failed");
          -
          560 return write(a.data(), static_cast<size_t>(ubound) - lbound + 1);
          -
          561 }
          -
          562#endif
          -
          563
          -
          -
          569 fsize_t write_stream(_Inout_ basic& stream, _In_ fsize_t amount = fsize_max)
          -
          570 {
          -
          571 std::unique_ptr<uint8_t[]> data(new uint8_t[static_cast<size_t>(std::min<fsize_t>(amount, default_block_size))]);
          -
          572 fsize_t num_copied = 0, to_write = amount;
          -
          573 m_state = state_t::ok;
          -
          574 while (to_write) {
          -
          575 size_t num_read = stream.read(data.get(), static_cast<size_t>(std::min<fsize_t>(default_block_size, to_write)));
          -
          576 size_t num_written = write(data.get(), num_read);
          -
          577 num_copied += num_written;
          -
          578 to_write -= num_written;
          -
          579 if (stream.m_state == state_t::eof) {
          -
          580 // EOF is not an error.
          -
          581 m_state = state_t::ok;
          -
          582 break;
          -
          583 }
          -
          584 m_state = stream.m_state;
          -
          585 if (!ok())
          -
          586 break;
          -
          587 }
          -
          588 return num_copied;
          -
          589 }
          +
          578
          +
          +
          582 void write_charset(_In_ charset_id charset)
          +
          583 {
          +
          584 if (charset == charset_id::utf32)
          +
          585 write_data(utf32_bom);
          +
          586 else if (charset == charset_id::utf16)
          +
          587 write_data(utf16_bom);
          +
          588 else if (charset == charset_id::utf8)
          +
          589 write_array(utf8_bom, sizeof(utf8_bom), 1);
          +
          590 }
          -
          590
          -
          -
          594 void write_charset(_In_ charset_id charset)
          -
          595 {
          -
          596 if (charset == charset_id::utf32)
          -
          597 write_data(utf32_bom);
          -
          598 else if (charset == charset_id::utf16)
          -
          599 write_data(utf16_bom);
          -
          600 else if (charset == charset_id::utf8)
          -
          601 write_array(utf8_bom, sizeof(utf8_bom), 1);
          -
          602 }
          +
          591
          +
          +
          597 size_t write_sprintf(_In_z_ _Printf_format_string_params_(2) const char* format, _In_opt_ locale_t locale, ...)
          +
          598 {
          +
          599 va_list params;
          +
          600 va_start(params, locale);
          +
          601 size_t num_chars = write_vsprintf(format, locale, params);
          +
          602 va_end(params);
          +
          603 return num_chars;
          +
          604 }
          -
          603
          -
          -
          609 size_t write_sprintf(_In_z_ _Printf_format_string_params_(2) const char* format, _In_opt_ locale_t locale, ...)
          -
          610 {
          -
          611 va_list params;
          -
          612 va_start(params, locale);
          -
          613 size_t num_chars = write_vsprintf(format, locale, params);
          -
          614 va_end(params);
          -
          615 return num_chars;
          -
          616 }
          +
          605
          +
          +
          611 size_t write_sprintf(_In_z_ _Printf_format_string_params_(2) const wchar_t* format, _In_opt_ locale_t locale, ...)
          +
          612 {
          +
          613 va_list params;
          +
          614 va_start(params, locale);
          +
          615 size_t num_chars = write_vsprintf(format, locale, params);
          +
          616 va_end(params);
          +
          617 return num_chars;
          +
          618 }
          -
          617
          -
          -
          623 size_t write_sprintf(_In_z_ _Printf_format_string_params_(2) const wchar_t* format, _In_opt_ locale_t locale, ...)
          -
          624 {
          -
          625 va_list params;
          -
          626 va_start(params, locale);
          -
          627 size_t num_chars = write_vsprintf(format, locale, params);
          -
          628 va_end(params);
          -
          629 return num_chars;
          -
          630 }
          +
          619
          +
          +
          625 size_t write_vsprintf(_In_z_ _Printf_format_string_params_(2) const char* format, _In_opt_ locale_t locale, _In_ va_list params)
          +
          626 {
          +
          627 std::string tmp;
          +
          628 tmp.reserve(default_block_size);
          +
          629 vappendf(tmp, format, locale, params);
          +
          630 return write_array(tmp.data(), sizeof(char), tmp.size());
          +
          631 }
          -
          631
          -
          -
          637 size_t write_vsprintf(_In_z_ _Printf_format_string_params_(2) const char* format, _In_opt_ locale_t locale, _In_ va_list params)
          -
          638 {
          -
          639 std::string str;
          -
          640 str.reserve(default_block_size);
          -
          641 vappendf(str, format, locale, params);
          -
          642 return write_array(str.data(), sizeof(char), str.size());
          -
          643 }
          +
          632
          +
          +
          638 size_t write_vsprintf(_In_z_ _Printf_format_string_params_(2) const wchar_t* format, _In_opt_ locale_t locale, _In_ va_list params)
          +
          639 {
          +
          640 std::wstring tmp;
          +
          641 tmp.reserve(default_block_size);
          +
          642 vappendf(tmp, format, locale, params);
          +
          643 return write_array(tmp.data(), sizeof(wchar_t), tmp.size());
          +
          644 }
          -
          644
          -
          -
          650 size_t write_vsprintf(_In_z_ _Printf_format_string_params_(2) const wchar_t* format, _In_opt_ locale_t locale, _In_ va_list params)
          -
          651 {
          -
          652 std::wstring str;
          -
          653 str.reserve(default_block_size);
          -
          654 vappendf(str, format, locale, params);
          -
          655 return write_array(str.data(), sizeof(wchar_t), str.size());
          -
          656 }
          -
          -
          657
          -
          658 inline basic& operator >>(_Out_ int8_t& data) { return read_data(data); }
          -
          659 inline basic& operator <<(_In_ const int8_t data) { return write_data(data); }
          -
          660 inline basic& operator >>(_Out_ int16_t& data) { return read_data(data); }
          -
          661 inline basic& operator <<(_In_ const int16_t data) { return write_data(data); }
          -
          662 inline basic& operator >>(_Out_ int32_t& data) { return read_data(data); }
          -
          663 inline basic& operator <<(_In_ const int32_t data) { return write_data(data); }
          -
          664 inline basic& operator >>(_Out_ int64_t& data) { return read_data(data); }
          -
          665 inline basic& operator <<(_In_ const int64_t data) { return write_data(data); }
          -
          666 inline basic& operator >>(_Out_ uint8_t& data) { return read_data(data); }
          -
          667 inline basic& operator <<(_In_ const uint8_t data) { return write_data(data); }
          -
          668 inline basic& operator >>(_Out_ uint16_t& data) { return read_data(data); }
          -
          669 inline basic& operator <<(_In_ const uint16_t data) { return write_data(data); }
          -
          670 inline basic& operator >>(_Out_ uint32_t& data) { return read_data(data); }
          -
          671 inline basic& operator <<(_In_ const uint32_t data) { return write_data(data); }
          -
          672 inline basic& operator >>(_Out_ uint64_t& data) { return read_data(data); }
          -
          673 inline basic& operator <<(_In_ const uint64_t data) { return write_data(data); }
          -
          674 inline basic& operator >>(_Out_ float& data) { return read_data(data); }
          -
          675 inline basic& operator <<(_In_ const float data) { return write_data(data); }
          -
          676 inline basic& operator >>(_Out_ double& data) { return read_data(data); }
          -
          677 inline basic& operator <<(_In_ const double data) { return write_data(data); }
          -
          678 inline basic& operator >>(_Out_ char& data) { return read_data(data); }
          -
          679 inline basic& operator <<(_In_ const char data) { return write_data(data); }
          -
          680#ifdef _NATIVE_WCHAR_T_DEFINED
          -
          681 inline basic& operator >>(_Out_ wchar_t& data) { return read_data(data); }
          -
          682 inline basic& operator <<(_In_ const wchar_t data) { return write_data(data); }
          -
          683#endif
          -
          684 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
          -
          685 inline basic& operator >>(_Out_ std::basic_string<_Elem, _Traits, _Ax>& data) { return read_str(data); }
          -
          686 template <class T>
          -
          687 inline basic& operator <<(_In_ const T* data) { return write_str(data); }
          -
          688 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
          -
          689 inline basic& operator <<(_In_ const std::basic_string<_Elem, _Traits, _Ax>& data) { return write_str(data); }
          +
          645
          +
          646 inline basic& operator >>(_Out_ int8_t& data) { return read_data(data); }
          +
          647 inline basic& operator <<(_In_ const int8_t data) { return write_data(data); }
          +
          648 inline basic& operator >>(_Out_ int16_t& data) { return read_data(data); }
          +
          649 inline basic& operator <<(_In_ const int16_t data) { return write_data(data); }
          +
          650 inline basic& operator >>(_Out_ int32_t& data) { return read_data(data); }
          +
          651 inline basic& operator <<(_In_ const int32_t data) { return write_data(data); }
          +
          652 inline basic& operator >>(_Out_ int64_t& data) { return read_data(data); }
          +
          653 inline basic& operator <<(_In_ const int64_t data) { return write_data(data); }
          +
          654 inline basic& operator >>(_Out_ uint8_t& data) { return read_data(data); }
          +
          655 inline basic& operator <<(_In_ const uint8_t data) { return write_data(data); }
          +
          656 inline basic& operator >>(_Out_ uint16_t& data) { return read_data(data); }
          +
          657 inline basic& operator <<(_In_ const uint16_t data) { return write_data(data); }
          +
          658 inline basic& operator >>(_Out_ uint32_t& data) { return read_data(data); }
          +
          659 inline basic& operator <<(_In_ const uint32_t data) { return write_data(data); }
          +
          660 inline basic& operator >>(_Out_ uint64_t& data) { return read_data(data); }
          +
          661 inline basic& operator <<(_In_ const uint64_t data) { return write_data(data); }
          +
          662 inline basic& operator >>(_Out_ float& data) { return read_data(data); }
          +
          663 inline basic& operator <<(_In_ const float data) { return write_data(data); }
          +
          664 inline basic& operator >>(_Out_ double& data) { return read_data(data); }
          +
          665 inline basic& operator <<(_In_ const double data) { return write_data(data); }
          +
          666 inline basic& operator >>(_Out_ char& data) { return read_data(data); }
          +
          667 inline basic& operator <<(_In_ const char data) { return write_data(data); }
          +
          668#ifdef _NATIVE_WCHAR_T_DEFINED
          +
          669 inline basic& operator >>(_Out_ wchar_t& data) { return read_data(data); }
          +
          670 inline basic& operator <<(_In_ const wchar_t data) { return write_data(data); }
          +
          671#endif
          +
          672 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
          +
          673 inline basic& operator >>(_Out_ std::basic_string<_Elem, _Traits, _Ax>& data) { return read_str(data); }
          +
          674 template <class T>
          +
          675 inline basic& operator <<(_In_ const T* data) { return write_str(data); }
          +
          676 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
          +
          677 inline basic& operator <<(_In_ const std::basic_string<_Elem, _Traits, _Ax>& data) { return write_str(data); }
          +
          678
          +
          679 template <class _Ty, class _Alloc = std::allocator<_Ty>>
          +
          680 basic& operator <<(_In_ const std::vector<_Ty, _Alloc>& data)
          +
          681 {
          +
          682 size_t num = data.size();
          +
          683 if (num > UINT32_MAX) _Unlikely_
          +
          684 throw std::invalid_argument("collection too big");
          +
          685 *this << static_cast<uint32_t>(num);
          +
          686 for (auto& el : data)
          +
          687 *this << el;
          +
          688 return *this;
          +
          689 }
          690
          691 template <class _Ty, class _Alloc = std::allocator<_Ty>>
          -
          692 basic& operator <<(_In_ const std::vector<_Ty, _Alloc>& data)
          +
          692 basic& operator >>(_Out_ std::vector<_Ty, _Alloc>& data)
          693 {
          -
          694 size_t num = data.size();
          -
          695 if (num > UINT32_MAX) _Unlikely_
          -
          696 throw std::invalid_argument("collection too big");
          -
          697 *this << static_cast<uint32_t>(num);
          -
          698 for (auto& el : data)
          -
          699 *this << el;
          -
          700 return *this;
          -
          701 }
          -
          702
          -
          703 template <class _Ty, class _Alloc = std::allocator<_Ty>>
          -
          704 basic& operator >>(_Out_ std::vector<_Ty, _Alloc>& data)
          -
          705 {
          -
          706 data.clear();
          -
          707 uint32_t num;
          -
          708 *this >> num;
          -
          709 if (!ok()) _Unlikely_
          -
          710 return *this;
          -
          711 data.reserve(num);
          -
          712 for (uint32_t i = 0; i < num; ++i) {
          -
          713 _Ty el;
          -
          714 *this >> el;
          -
          715 if (!ok()) _Unlikely_
          -
          716 return *this;
          -
          717 data.push_back(std::move(el));
          -
          718 }
          +
          694 data.clear();
          +
          695 uint32_t num;
          +
          696 *this >> num;
          +
          697 if (!ok()) _Unlikely_
          +
          698 return *this;
          +
          699 data.reserve(num);
          +
          700 for (uint32_t i = 0; i < num; ++i) {
          +
          701 _Ty el;
          +
          702 *this >> el;
          +
          703 if (!ok()) _Unlikely_
          +
          704 return *this;
          +
          705 data.push_back(std::move(el));
          +
          706 }
          +
          707 }
          +
          708
          +
          709 template <class _Kty, class _Pr = std::less<_Kty>, class _Alloc = std::allocator<_Kty>>
          +
          710 basic& operator <<(_In_ const std::set<_Kty, _Pr, _Alloc>& data)
          +
          711 {
          +
          712 size_t num = data.size();
          +
          713 if (num > UINT32_MAX) _Unlikely_
          +
          714 throw std::invalid_argument("collection too big");
          +
          715 *this << static_cast<uint32_t>(num);
          +
          716 for (auto& el : data)
          +
          717 *this << el;
          +
          718 return *this;
          719 }
          720
          721 template <class _Kty, class _Pr = std::less<_Kty>, class _Alloc = std::allocator<_Kty>>
          -
          722 basic& operator <<(_In_ const std::set<_Kty, _Pr, _Alloc>& data)
          +
          722 basic& operator >>(_Out_ std::set<_Kty, _Pr, _Alloc>& data)
          723 {
          -
          724 size_t num = data.size();
          -
          725 if (num > UINT32_MAX) _Unlikely_
          -
          726 throw std::invalid_argument("collection too big");
          -
          727 *this << static_cast<uint32_t>(num);
          -
          728 for (auto& el : data)
          -
          729 *this << el;
          -
          730 return *this;
          -
          731 }
          -
          732
          -
          733 template <class _Kty, class _Pr = std::less<_Kty>, class _Alloc = std::allocator<_Kty>>
          -
          734 basic& operator >>(_Out_ std::set<_Kty, _Pr, _Alloc>& data)
          -
          735 {
          -
          736 data.clear();
          -
          737 uint32_t num;
          -
          738 *this >> num;
          -
          739 if (!ok()) _Unlikely_
          -
          740 return *this;
          -
          741 for (uint32_t i = 0; i < num; ++i) {
          -
          742 _Kty el;
          -
          743 *this >> el;
          -
          744 if (!ok()) _Unlikely_
          -
          745 return *this;
          -
          746 data.insert(std::move(el));
          -
          747 }
          +
          724 data.clear();
          +
          725 uint32_t num;
          +
          726 *this >> num;
          +
          727 if (!ok()) _Unlikely_
          +
          728 return *this;
          +
          729 for (uint32_t i = 0; i < num; ++i) {
          +
          730 _Kty el;
          +
          731 *this >> el;
          +
          732 if (!ok()) _Unlikely_
          +
          733 return *this;
          +
          734 data.insert(std::move(el));
          +
          735 }
          +
          736 }
          +
          737
          +
          738 template <class _Kty, class _Pr = std::less<_Kty>, class _Alloc = std::allocator<_Kty>>
          +
          739 basic& operator <<(_In_ const std::multiset<_Kty, _Pr, _Alloc>& data)
          +
          740 {
          +
          741 size_t num = data.size();
          +
          742 if (num > UINT32_MAX) _Unlikely_
          +
          743 throw std::invalid_argument("collection too big");
          +
          744 *this << static_cast<uint32_t>(num);
          +
          745 for (auto& el : data)
          +
          746 *this << el;
          +
          747 return *this;
          748 }
          749
          750 template <class _Kty, class _Pr = std::less<_Kty>, class _Alloc = std::allocator<_Kty>>
          -
          751 basic& operator <<(_In_ const std::multiset<_Kty, _Pr, _Alloc>& data)
          +
          751 basic& operator >>(_Out_ std::multiset<_Kty, _Pr, _Alloc>& data)
          752 {
          -
          753 size_t num = data.size();
          -
          754 if (num > UINT32_MAX) _Unlikely_
          -
          755 throw std::invalid_argument("collection too big");
          -
          756 *this << static_cast<uint32_t>(num);
          -
          757 for (auto& el : data)
          -
          758 *this << el;
          -
          759 return *this;
          -
          760 }
          -
          761
          -
          762 template <class _Kty, class _Pr = std::less<_Kty>, class _Alloc = std::allocator<_Kty>>
          -
          763 basic& operator >>(_Out_ std::multiset<_Kty, _Pr, _Alloc>& data)
          -
          764 {
          -
          765 data.clear();
          -
          766 uint32_t num;
          -
          767 *this >> num;
          -
          768 if (!ok()) _Unlikely_
          -
          769 return *this;
          -
          770 for (uint32_t i = 0; i < num; ++i) {
          -
          771 _Kty el;
          -
          772 *this >> el;
          -
          773 if (!ok()) _Unlikely_
          -
          774 return *this;
          -
          775 data.insert(std::move(el));
          -
          776 }
          -
          777 return *this;
          -
          778 }
          -
          779
          -
          780 protected:
          -
          781 state_t m_state;
          -
          782 };
          +
          753 data.clear();
          +
          754 uint32_t num;
          +
          755 *this >> num;
          +
          756 if (!ok()) _Unlikely_
          +
          757 return *this;
          +
          758 for (uint32_t i = 0; i < num; ++i) {
          +
          759 _Kty el;
          +
          760 *this >> el;
          +
          761 if (!ok()) _Unlikely_
          +
          762 return *this;
          +
          763 data.insert(std::move(el));
          +
          764 }
          +
          765 return *this;
          +
          766 }
          +
          767
          +
          768 protected:
          +
          769 state_t m_state;
          +
          770 };
          -
          783
          -
          787 using fpos_t = uint64_t;
          -
          788 constexpr fpos_t fpos_max = UINT64_MAX;
          -
          789 constexpr fpos_t fpos_min = 0;
          -
          790
          -
          794 using foff_t = int64_t;
          -
          795 constexpr foff_t foff_max = INT64_MAX;
          -
          796 constexpr foff_t foff_min = INT64_MIN;
          -
          797
          -
          801 enum class seek_t {
          -
          802#ifdef _WIN32
          -
          803 beg = FILE_BEGIN,
          -
          804 cur = FILE_CURRENT,
          -
          805 end = FILE_END
          -
          806#else
          -
          807 beg = SEEK_SET,
          -
          808 cur = SEEK_CUR,
          -
          809 end = SEEK_END
          -
          810#endif
          -
          811 };
          -
          812
          -
          813#if _HAS_CXX20
          -
          814 using clock = std::chrono::file_clock;
          -
          815#else
          -
          816 using clock = std::chrono::system_clock;
          -
          817#endif
          -
          818 using time_point = std::chrono::time_point<clock>;
          -
          819
          -
          -
          823 class basic_file : virtual public basic
          -
          824 {
          -
          825 public:
          -
          -
          826 virtual std::vector<uint8_t> read_remainder(_In_ size_t max_length = SIZE_MAX)
          -
          827 {
          -
          828 size_t length = std::min<size_t>(max_length, static_cast<size_t>(size() - tell()));
          -
          829 std::vector<uint8_t> result;
          -
          830 try { result.resize(length); }
          -
          831 catch (const std::bad_alloc&) {
          -
          832 m_state = state_t::fail;
          -
          833 return result;
          -
          834 }
          -
          835 result.resize(read_array(result.data(), sizeof(uint8_t), length));
          -
          836 return result;
          -
          837 }
          +
          771
          +
          775 using fpos_t = uint64_t;
          +
          776 constexpr fpos_t fpos_max = UINT64_MAX;
          +
          777 constexpr fpos_t fpos_min = 0;
          +
          778
          +
          782 using foff_t = int64_t;
          +
          783 constexpr foff_t foff_max = INT64_MAX;
          +
          784 constexpr foff_t foff_min = INT64_MIN;
          +
          785
          +
          789 enum class seek_t {
          +
          790#ifdef _WIN32
          +
          791 beg = FILE_BEGIN,
          +
          792 cur = FILE_CURRENT,
          +
          793 end = FILE_END
          +
          794#else
          +
          795 beg = SEEK_SET,
          +
          796 cur = SEEK_CUR,
          +
          797 end = SEEK_END
          +
          798#endif
          +
          799 };
          +
          800
          +
          801#if _HAS_CXX20
          +
          802 using clock = std::chrono::file_clock;
          +
          803#else
          +
          804 using clock = std::chrono::system_clock;
          +
          805#endif
          +
          806 using time_point = std::chrono::time_point<clock>;
          +
          807
          +
          +
          811 class basic_file : virtual public basic
          +
          812 {
          +
          813 public:
          +
          +
          814 virtual std::vector<uint8_t> read_remainder(_In_ size_t max_length = SIZE_MAX)
          +
          815 {
          +
          816 size_t length = std::min<size_t>(max_length, static_cast<size_t>(size() - tell()));
          +
          817 std::vector<uint8_t> result;
          +
          818 try { result.resize(length); }
          +
          819 catch (const std::bad_alloc&) {
          +
          820 m_state = state_t::fail;
          +
          821 return result;
          +
          822 }
          +
          823 result.resize(read_array(result.data(), sizeof(uint8_t), length));
          +
          824 return result;
          +
          825 }
          +
          +
          826
          +
          832 virtual fpos_t seek(_In_ foff_t offset, _In_ seek_t how = seek_t::beg) = 0;
          +
          833
          +
          839 inline fpos_t seekbeg(_In_ fpos_t offset) { return seek(offset, seek_t::beg); }
          +
          840
          +
          846 inline fpos_t seekcur(_In_ foff_t offset) { return seek(offset, seek_t::cur); }
          +
          847
          +
          853 inline fpos_t seekend(_In_ foff_t offset) { return seek(offset, seek_t::end); }
          +
          854
          +
          +
          855 virtual void skip(_In_ fsize_t amount)
          +
          856 {
          +
          857 seek(amount, seek_t::cur);
          +
          858 }
          -
          838
          -
          844 virtual fpos_t seek(_In_ foff_t offset, _In_ seek_t how = seek_t::beg) = 0;
          -
          845
          -
          851 inline fpos_t seekbeg(_In_ fpos_t offset) { return seek(offset, seek_t::beg); }
          -
          852
          -
          858 inline fpos_t seekcur(_In_ foff_t offset) { return seek(offset, seek_t::cur); }
          859
          -
          865 inline fpos_t seekend(_In_ foff_t offset) { return seek(offset, seek_t::end); }
          -
          866
          -
          -
          867 virtual void skip(_In_ fsize_t amount)
          -
          868 {
          -
          869 seek(amount, seek_t::cur);
          -
          870 }
          +
          866 virtual fpos_t tell() const = 0;
          +
          867
          +
          +
          871 virtual void lock(_In_ fpos_t offset, _In_ fsize_t length)
          +
          872 {
          +
          873 _Unreferenced_(offset);
          +
          874 _Unreferenced_(length);
          +
          875 throw std::domain_error("not implemented");
          +
          876 }
          -
          871
          -
          878 virtual fpos_t tell() const = 0;
          -
          879
          -
          -
          883 virtual void lock(_In_ fpos_t offset, _In_ fsize_t length)
          -
          884 {
          -
          885 _Unreferenced_(offset);
          -
          886 _Unreferenced_(length);
          -
          887 throw std::domain_error("not implemented");
          -
          888 }
          +
          877
          +
          +
          881 virtual void unlock(_In_ fpos_t offset, _In_ fsize_t length)
          +
          882 {
          +
          883 _Unreferenced_(offset);
          +
          884 _Unreferenced_(length);
          +
          885 throw std::domain_error("not implemented");
          +
          886 }
          -
          889
          -
          -
          893 virtual void unlock(_In_ fpos_t offset, _In_ fsize_t length)
          -
          894 {
          -
          895 _Unreferenced_(offset);
          -
          896 _Unreferenced_(length);
          -
          897 throw std::domain_error("not implemented");
          -
          898 }
          +
          887
          +
          892 virtual fsize_t size() const = 0;
          +
          893
          +
          897 virtual void truncate() = 0;
          +
          898
          +
          +
          902 virtual time_point ctime() const
          +
          903 {
          +
          904 return time_point::min();
          +
          905 }
          -
          899
          -
          904 virtual fsize_t size() const = 0;
          -
          905
          -
          909 virtual void truncate() = 0;
          -
          910
          -
          -
          914 virtual time_point ctime() const
          -
          915 {
          -
          916 return time_point::min();
          -
          917 }
          +
          906
          +
          +
          910 virtual time_point atime() const
          +
          911 {
          +
          912 return time_point::min();
          +
          913 }
          -
          918
          -
          -
          922 virtual time_point atime() const
          -
          923 {
          -
          924 return time_point::min();
          -
          925 }
          +
          914
          +
          +
          918 virtual time_point mtime() const
          +
          919 {
          +
          920 return time_point::min();
          +
          921 }
          -
          926
          -
          -
          930 virtual time_point mtime() const
          -
          931 {
          -
          932 return time_point::min();
          -
          933 }
          +
          922
          +
          +
          926 virtual void set_ctime(time_point date)
          +
          927 {
          +
          928 _Unreferenced_(date);
          +
          929 throw std::domain_error("not implemented");
          +
          930 }
          -
          934
          -
          -
          938 virtual void set_ctime(time_point date)
          -
          939 {
          -
          940 _Unreferenced_(date);
          -
          941 throw std::domain_error("not implemented");
          -
          942 }
          +
          931
          +
          +
          935 virtual void set_atime(time_point date)
          +
          936 {
          +
          937 _Unreferenced_(date);
          +
          938 throw std::domain_error("not implemented");
          +
          939 }
          -
          943
          -
          -
          947 virtual void set_atime(time_point date)
          -
          948 {
          -
          949 _Unreferenced_(date);
          -
          950 throw std::domain_error("not implemented");
          -
          951 }
          +
          940
          +
          +
          944 virtual void set_mtime(time_point date)
          +
          945 {
          +
          946 _Unreferenced_(date);
          +
          947 throw std::domain_error("not implemented");
          +
          948 }
          -
          952
          -
          -
          956 virtual void set_mtime(time_point date)
          -
          957 {
          -
          958 _Unreferenced_(date);
          -
          959 throw std::domain_error("not implemented");
          -
          960 }
          +
          949
          +
          950#ifdef _WIN32
          +
          954 LPSAFEARRAY read_sa()
          +
          955 {
          +
          956 _Assume_(size() <= SIZE_MAX);
          +
          957 size_t length = static_cast<size_t>(size());
          +
          958 std::unique_ptr<SAFEARRAY, SafeArrayDestroy_delete> sa(SafeArrayCreateVector(VT_UI1, 0, (ULONG)length));
          +
          959 if (!sa) _Unlikely_
          +
          960 throw std::runtime_error("SafeArrayCreateVector failed");
          +
          961 safearray_accessor<void> a(sa.get());
          +
          962 if (seek(0) != 0) _Unlikely_
          +
          963 throw std::system_error(sys_error(), std::system_category(), "failed to seek");
          +
          964 if (read_array(a.data(), 1, length) != length)
          +
          965 throw std::system_error(sys_error(), std::system_category(), "failed to read");
          +
          966 return sa.release();
          +
          967 }
          +
          968#endif
          +
          969
          +
          +
          975 charset_id read_charset(_In_ charset_id default_charset = charset_id::system)
          +
          976 {
          +
          977 if (seek(0) != 0) _Unlikely_
          +
          978 throw std::system_error(sys_error(), std::system_category(), "failed to seek");
          +
          979 char32_t id_utf32;
          +
          980 read_array(&id_utf32, sizeof(char32_t), 1);
          +
          981 if (ok() && id_utf32 == utf32_bom)
          +
          982 return charset_id::utf32;
          +
          983
          +
          984 if (seek(0) != 0) _Unlikely_
          +
          985 throw std::system_error(sys_error(), std::system_category(), "failed to seek");
          +
          986 char16_t id_utf16;
          +
          987 read_array(&id_utf16, sizeof(char16_t), 1);
          +
          988 if (ok() && id_utf16 == utf16_bom)
          +
          989 return charset_id::utf16;
          +
          990
          +
          991 if (seek(0) != 0) _Unlikely_
          +
          992 throw std::system_error(sys_error(), std::system_category(), "failed to seek");
          +
          993 char id_utf8[3] = { 0 };
          +
          994 read_array(id_utf8, sizeof(id_utf8), 1);
          +
          995 if (ok() && strncmp(id_utf8, _countof(id_utf8), utf8_bom, _countof(utf8_bom)) == 0)
          +
          996 return charset_id::utf8;
          +
          997
          +
          998 if (seek(0) != 0) _Unlikely_
          +
          999 throw std::system_error(sys_error(), std::system_category(), "failed to seek");
          +
          1000 return default_charset;
          +
          1001 }
          -
          961
          -
          962#ifdef _WIN32
          -
          966 LPSAFEARRAY read_sa()
          -
          967 {
          -
          968 _Assume_(size() <= SIZE_MAX);
          -
          969 size_t length = static_cast<size_t>(size());
          -
          970 std::unique_ptr<SAFEARRAY, SafeArrayDestroy_delete> sa(SafeArrayCreateVector(VT_UI1, 0, (ULONG)length));
          -
          971 if (!sa) _Unlikely_
          -
          972 throw std::runtime_error("SafeArrayCreateVector failed");
          -
          973 safearray_accessor<void> a(sa.get());
          -
          974 if (seek(0) != 0) _Unlikely_
          -
          975 throw std::system_error(sys_error(), std::system_category(), "failed to seek");
          -
          976 if (read_array(a.data(), 1, length) != length)
          -
          977 throw std::system_error(sys_error(), std::system_category(), "failed to read");
          -
          978 return sa.release();
          -
          979 }
          -
          980#endif
          -
          981
          -
          -
          987 charset_id read_charset(_In_ charset_id default_charset = charset_id::system)
          -
          988 {
          -
          989 if (seek(0) != 0) _Unlikely_
          -
          990 throw std::system_error(sys_error(), std::system_category(), "failed to seek");
          -
          991 char32_t id_utf32;
          -
          992 read_array(&id_utf32, sizeof(char32_t), 1);
          -
          993 if (ok() && id_utf32 == utf32_bom)
          -
          994 return charset_id::utf32;
          -
          995
          -
          996 if (seek(0) != 0) _Unlikely_
          -
          997 throw std::system_error(sys_error(), std::system_category(), "failed to seek");
          -
          998 char16_t id_utf16;
          -
          999 read_array(&id_utf16, sizeof(char16_t), 1);
          -
          1000 if (ok() && id_utf16 == utf16_bom)
          -
          1001 return charset_id::utf16;
          -
          1002
          -
          1003 if (seek(0) != 0) _Unlikely_
          -
          1004 throw std::system_error(sys_error(), std::system_category(), "failed to seek");
          -
          1005 char id_utf8[3] = { 0 };
          -
          1006 read_array(id_utf8, sizeof(id_utf8), 1);
          -
          1007 if (ok() && strncmp(id_utf8, _countof(id_utf8), utf8_bom, _countof(utf8_bom)) == 0)
          -
          1008 return charset_id::utf8;
          -
          1009
          -
          1010 if (seek(0) != 0) _Unlikely_
          -
          1011 throw std::system_error(sys_error(), std::system_category(), "failed to seek");
          -
          1012 return default_charset;
          -
          1013 }
          -
          -
          1014 };
          +
          1002 };
          +
          1003
          +
          +
          1009 class converter : public basic
          +
          1010 {
          +
          1011 protected:
          +
          1013#pragma warning(suppress: 26495) // The delayed init call will finish initializing the class.
          +
          1014 explicit converter() : basic(state_t::fail) {}
          1015
          -
          -
          1021 class converter : public basic
          -
          1022 {
          -
          1023 protected:
          -
          1025#pragma warning(suppress: 26495) // The delayed init call will finish initializing the class.
          -
          1026 explicit converter() : basic(state_t::fail) {}
          -
          1027
          -
          1028 void init(_Inout_ basic& source)
          -
          1029 {
          -
          1030 m_source = &source;
          -
          1031 init();
          -
          1032 }
          -
          1033
          -
          1034 void init()
          -
          1035 {
          -
          1036 m_state = m_source->state();
          -
          1037 }
          +
          1016 void init(_Inout_ basic& source)
          +
          1017 {
          +
          1018 m_source = &source;
          +
          1019 init();
          +
          1020 }
          +
          1021
          +
          1022 void init()
          +
          1023 {
          +
          1024 m_state = m_source->state();
          +
          1025 }
          +
          1026
          +
          1027 void done()
          +
          1028 {
          +
          1029 m_source = nullptr;
          +
          1030 }
          +
          1032
          +
          1033 public:
          +
          1034 converter(_Inout_ basic& source) :
          +
          1035 basic(source.state()),
          +
          1036 m_source(&source)
          +
          1037 {}
          1038
          -
          1039 void done()
          -
          1040 {
          -
          1041 m_source = nullptr;
          -
          1042 }
          -
          1044
          -
          1045 public:
          -
          1046 converter(_Inout_ basic& source) :
          -
          1047 basic(source.state()),
          -
          1048 m_source(&source)
          -
          1049 {}
          -
          1050
          -
          -
          1051 virtual _Success_(return != 0 || length == 0) size_t read(
          -
          1052 _Out_writes_bytes_to_opt_(length, return) void* data, _In_ size_t length)
          -
          1053 {
          -
          1054 size_t num_read = m_source->read(data, length);
          -
          1055 m_state = m_source->state();
          -
          1056 return num_read;
          -
          1057 }
          +
          +
          1039 virtual _Success_(return != 0 || length == 0) size_t read(
          +
          1040 _Out_writes_bytes_to_opt_(length, return) void* data, _In_ size_t length)
          +
          1041 {
          +
          1042 size_t num_read = m_source->read(data, length);
          +
          1043 m_state = m_source->state();
          +
          1044 return num_read;
          +
          1045 }
          -
          1058
          -
          -
          1059 virtual _Success_(return != 0) size_t write(
          -
          1060 _In_reads_bytes_opt_(length) const void* data, _In_ size_t length)
          -
          1061 {
          -
          1062 size_t num_written = m_source->write(data, length);
          -
          1063 m_state = m_source->state();
          -
          1064 return num_written;
          +
          1046
          +
          +
          1047 virtual _Success_(return != 0) size_t write(
          +
          1048 _In_reads_bytes_opt_(length) const void* data, _In_ size_t length)
          +
          1049 {
          +
          1050 size_t num_written = m_source->write(data, length);
          +
          1051 m_state = m_source->state();
          +
          1052 return num_written;
          +
          1053 }
          +
          +
          1054
          +
          +
          1055 virtual void close()
          +
          1056 {
          +
          1057 m_source->close();
          +
          1058 m_state = m_source->state();
          +
          1059 }
          +
          +
          1060
          +
          +
          1061 virtual void flush()
          +
          1062 {
          +
          1063 m_source->flush();
          +
          1064 m_state = m_source->state();
          1065 }
          1066
          -
          -
          1067 virtual void close()
          -
          1068 {
          -
          1069 m_source->close();
          -
          1070 m_state = m_source->state();
          -
          1071 }
          +
          1067 protected:
          +
          1068 basic* m_source;
          +
          1069 };
          -
          1072
          -
          -
          1073 virtual void flush()
          -
          1074 {
          -
          1075 m_source->flush();
          -
          1076 m_state = m_source->state();
          -
          1077 }
          +
          1070
          +
          +
          1074 class replicator : public basic
          +
          1075 {
          +
          1076 public:
          +
          1077 virtual ~replicator()
          +
          1078 {
          +
          1079 for (auto w = m_workers.begin(), w_end = m_workers.end(); w != w_end; ++w) {
          +
          1080 auto _w = w->get();
          +
          1081 {
          +
          1082 const std::lock_guard<std::mutex> lk(_w->mutex);
          +
          1083 _w->op = worker::op_t::quit;
          +
          1084 }
          +
          1085 _w->cv.notify_one();
          +
          1086 }
          +
          1087 for (auto w = m_workers.begin(), w_end = m_workers.end(); w != w_end; ++w)
          +
          1088 w->get()->join();
          +
          1089 }
          +
          1090
          +
          +
          1094 void push_back(_In_ basic* source)
          +
          1095 {
          +
          1096 m_workers.push_back(std::unique_ptr<worker>(new worker(source)));
          +
          1097 }
          -
          1078
          -
          1079 protected:
          -
          1080 basic* m_source;
          -
          1081 };
          +
          1098
          +
          +
          1102 void remove(basic* source)
          +
          1103 {
          +
          1104 for (auto w = m_workers.begin(), w_end = m_workers.end(); w != w_end; ++w) {
          +
          1105 auto _w = w->get();
          +
          1106 if (_w->source == source) {
          +
          1107 {
          +
          1108 const std::lock_guard<std::mutex> lk(_w->mutex);
          +
          1109 _w->op = worker::op_t::quit;
          +
          1110 }
          +
          1111 _w->cv.notify_one();
          +
          1112 _w->join();
          +
          1113 m_workers.erase(w);
          +
          1114 return;
          +
          1115 }
          +
          1116 }
          +
          1117 }
          -
          1082
          -
          -
          1086 class replicator : public basic
          -
          1087 {
          -
          1088 public:
          -
          1089 virtual ~replicator()
          -
          1090 {
          -
          1091 for (auto w = m_workers.begin(), w_end = m_workers.end(); w != w_end; ++w) {
          -
          1092 auto _w = w->get();
          -
          1093 {
          -
          1094 const std::lock_guard<std::mutex> lk(_w->mutex);
          -
          1095 _w->op = worker::op_t::quit;
          -
          1096 }
          -
          1097 _w->cv.notify_one();
          -
          1098 }
          -
          1099 for (auto w = m_workers.begin(), w_end = m_workers.end(); w != w_end; ++w)
          -
          1100 w->get()->join();
          -
          1101 }
          -
          1102
          -
          -
          1106 void push_back(_In_ basic* source)
          -
          1107 {
          -
          1108 m_workers.push_back(std::unique_ptr<worker>(new worker(source)));
          -
          1109 }
          -
          -
          1110
          -
          -
          1114 void remove(basic* source)
          -
          1115 {
          -
          1116 for (auto w = m_workers.begin(), w_end = m_workers.end(); w != w_end; ++w) {
          -
          1117 auto _w = w->get();
          -
          1118 if (_w->source == source) {
          -
          1119 {
          -
          1120 const std::lock_guard<std::mutex> lk(_w->mutex);
          -
          1121 _w->op = worker::op_t::quit;
          -
          1122 }
          -
          1123 _w->cv.notify_one();
          -
          1124 _w->join();
          -
          1125 m_workers.erase(w);
          -
          1126 return;
          -
          1127 }
          -
          1128 }
          -
          1129 }
          -
          -
          1130
          -
          -
          1131 virtual _Success_(return != 0) size_t write(
          -
          1132 _In_reads_bytes_opt_(length) const void* data, _In_ size_t length)
          -
          1133 {
          +
          1118
          +
          +
          1119 virtual _Success_(return != 0) size_t write(
          +
          1120 _In_reads_bytes_opt_(length) const void* data, _In_ size_t length)
          +
          1121 {
          +
          1122 for (auto w = m_workers.begin(), w_end = m_workers.end(); w != w_end; ++w) {
          +
          1123 auto _w = w->get();
          +
          1124 {
          +
          1125 const std::lock_guard<std::mutex> lk(_w->mutex);
          +
          1126 _w->op = worker::op_t::write;
          +
          1127 _w->data = data;
          +
          1128 _w->length = length;
          +
          1129 }
          +
          1130 _w->cv.notify_one();
          +
          1131 }
          +
          1132 size_t num_written = length;
          +
          1133 m_state = state_t::ok;
          1134 for (auto w = m_workers.begin(), w_end = m_workers.end(); w != w_end; ++w) {
          1135 auto _w = w->get();
          -
          1136 {
          -
          1137 const std::lock_guard<std::mutex> lk(_w->mutex);
          -
          1138 _w->op = worker::op_t::write;
          -
          1139 _w->data = data;
          -
          1140 _w->length = length;
          -
          1141 }
          -
          1142 _w->cv.notify_one();
          -
          1143 }
          -
          1144 size_t num_written = length;
          -
          1145 m_state = state_t::ok;
          -
          1146 for (auto w = m_workers.begin(), w_end = m_workers.end(); w != w_end; ++w) {
          -
          1147 auto _w = w->get();
          -
          1148 std::unique_lock<std::mutex> lk(_w->mutex);
          -
          1149 _w->cv.wait(lk, [&] {return _w->op == worker::op_t::noop; });
          -
          1150 if (_w->num_written < num_written)
          -
          1151 num_written = _w->num_written;
          -
          1152 if (ok() && !_w->source->ok())
          -
          1153 m_state = _w->source->state();
          -
          1154 }
          -
          1155 return num_written;
          -
          1156 }
          +
          1136 std::unique_lock<std::mutex> lk(_w->mutex);
          +
          1137 _w->cv.wait(lk, [&] {return _w->op == worker::op_t::noop; });
          +
          1138 if (_w->num_written < num_written)
          +
          1139 num_written = _w->num_written;
          +
          1140 if (ok() && !_w->source->ok())
          +
          1141 m_state = _w->source->state();
          +
          1142 }
          +
          1143 return num_written;
          +
          1144 }
          -
          1157
          -
          -
          1158 virtual void close()
          -
          1159 {
          -
          1160 foreach_worker(worker::op_t::close);
          -
          1161 }
          +
          1145
          +
          +
          1146 virtual void close()
          +
          1147 {
          +
          1148 foreach_worker(worker::op_t::close);
          +
          1149 }
          -
          1162
          -
          -
          1163 virtual void flush()
          -
          1164 {
          -
          1165 foreach_worker(worker::op_t::flush);
          -
          1166 }
          +
          1150
          +
          +
          1151 virtual void flush()
          +
          1152 {
          +
          1153 foreach_worker(worker::op_t::flush);
          +
          1154 }
          -
          1167
          -
          1168 protected:
          -
          -
          1169 class worker : public std::thread
          -
          1170 {
          -
          1171 public:
          -
          1172 worker(_In_ basic* _source) :
          -
          1173 source(_source),
          -
          1174 op(op_t::noop),
          -
          1175 data(nullptr),
          -
          1176 length(0),
          -
          1177 num_written(0)
          -
          1178 {
          -
          1179 *static_cast<std::thread*>(this) = std::thread([](_Inout_ worker& w) { w.process_op(); }, std::ref(*this));
          -
          1180 }
          -
          1181
          -
          1182 protected:
          -
          1183 void process_op()
          -
          1184 {
          -
          1185 for (;;) {
          -
          1186 std::unique_lock<std::mutex> lk(mutex);
          -
          1187 cv.wait(lk, [&] {return op != op_t::noop; });
          -
          1188 switch (op) {
          -
          1189 case op_t::quit:
          -
          1190 return;
          -
          1191 case op_t::write:
          -
          1192 num_written = source->write(data, length);
          -
          1193 break;
          -
          1194 case op_t::close:
          -
          1195 source->close();
          -
          1196 break;
          -
          1197 case op_t::flush:
          -
          1198 source->flush();
          -
          1199 break;
          -
          1200 case op_t::noop:;
          -
          1201 }
          -
          1202 op = op_t::noop;
          -
          1203 lk.unlock();
          -
          1204 cv.notify_one();
          -
          1205 }
          -
          1206 }
          -
          1207
          -
          1208 public:
          -
          1209 basic* source;
          -
          1210 enum class op_t {
          -
          1211 noop = 0,
          -
          1212 quit,
          -
          1213 write,
          -
          1214 close,
          -
          1215 flush,
          -
          1216 } op;
          -
          1217 const void* data;
          -
          1218 size_t length;
          - -
          1220 std::mutex mutex;
          -
          1221 std::condition_variable cv;
          -
          1222 };
          +
          1155
          +
          1156 protected:
          +
          +
          1157 class worker : public std::thread
          +
          1158 {
          +
          1159 public:
          +
          1160 worker(_In_ basic* _source) :
          +
          1161 source(_source),
          +
          1162 op(op_t::noop),
          +
          1163 data(nullptr),
          +
          1164 length(0),
          +
          1165 num_written(0)
          +
          1166 {
          +
          1167 *static_cast<std::thread*>(this) = std::thread([](_Inout_ worker& w) { w.process_op(); }, std::ref(*this));
          +
          1168 }
          +
          1169
          +
          1170 protected:
          +
          1171 void process_op()
          +
          1172 {
          +
          1173 for (;;) {
          +
          1174 std::unique_lock<std::mutex> lk(mutex);
          +
          1175 cv.wait(lk, [&] {return op != op_t::noop; });
          +
          1176 switch (op) {
          +
          1177 case op_t::quit:
          +
          1178 return;
          +
          1179 case op_t::write:
          +
          1180 num_written = source->write(data, length);
          +
          1181 break;
          +
          1182 case op_t::close:
          +
          1183 source->close();
          +
          1184 break;
          +
          1185 case op_t::flush:
          +
          1186 source->flush();
          +
          1187 break;
          +
          1188 case op_t::noop:;
          +
          1189 }
          +
          1190 op = op_t::noop;
          +
          1191 lk.unlock();
          +
          1192 cv.notify_one();
          +
          1193 }
          +
          1194 }
          +
          1195
          +
          1196 public:
          +
          1197 basic* source;
          +
          1198 enum class op_t {
          +
          1199 noop = 0,
          +
          1200 quit,
          +
          1201 write,
          +
          1202 close,
          +
          1203 flush,
          +
          1204 } op;
          +
          1205 const void* data;
          +
          1206 size_t length;
          + +
          1208 std::mutex mutex;
          +
          1209 std::condition_variable cv;
          +
          1210 };
          -
          1223
          -
          1224 void foreach_worker(_In_ worker::op_t op)
          -
          1225 {
          -
          1226 for (auto w = m_workers.begin(), w_end = m_workers.end(); w != w_end; ++w) {
          -
          1227 auto _w = w->get();
          -
          1228 {
          -
          1229 const std::lock_guard<std::mutex> lk(_w->mutex);
          -
          1230 _w->op = op;
          -
          1231 }
          -
          1232 _w->cv.notify_one();
          -
          1233 }
          -
          1234 m_state = state_t::ok;
          -
          1235 for (auto w = m_workers.begin(), w_end = m_workers.end(); w != w_end; ++w) {
          -
          1236 auto _w = w->get();
          -
          1237 std::unique_lock<std::mutex> lk(_w->mutex);
          -
          1238 _w->cv.wait(lk, [&] {return _w->op == worker::op_t::noop; });
          -
          1239 if (ok())
          -
          1240 m_state = _w->source->state();
          -
          1241 }
          -
          1242 }
          -
          1243
          -
          1244 std::list<std::unique_ptr<worker>> m_workers;
          -
          1245 };
          +
          1211
          +
          1212 void foreach_worker(_In_ worker::op_t op)
          +
          1213 {
          +
          1214 for (auto w = m_workers.begin(), w_end = m_workers.end(); w != w_end; ++w) {
          +
          1215 auto _w = w->get();
          +
          1216 {
          +
          1217 const std::lock_guard<std::mutex> lk(_w->mutex);
          +
          1218 _w->op = op;
          +
          1219 }
          +
          1220 _w->cv.notify_one();
          +
          1221 }
          +
          1222 m_state = state_t::ok;
          +
          1223 for (auto w = m_workers.begin(), w_end = m_workers.end(); w != w_end; ++w) {
          +
          1224 auto _w = w->get();
          +
          1225 std::unique_lock<std::mutex> lk(_w->mutex);
          +
          1226 _w->cv.wait(lk, [&] {return _w->op == worker::op_t::noop; });
          +
          1227 if (ok())
          +
          1228 m_state = _w->source->state();
          +
          1229 }
          +
          1230 }
          +
          1231
          +
          1232 std::list<std::unique_ptr<worker>> m_workers;
          +
          1233 };
          -
          1246
          -
          1247 constexpr size_t default_async_limit = 0x100000;
          -
          1248
          -
          1254 template <size_t CAPACITY = default_async_limit>
          -
          - -
          1256 {
          -
          1257 public:
          -
          1258 async_reader(_Inout_ basic& source) :
          -
          1259 converter(source),
          -
          1260 m_worker([](_Inout_ async_reader& w) { w.process(); }, std::ref(*this))
          -
          1261 {}
          -
          1262
          -
          1263 virtual ~async_reader()
          -
          1264 {
          -
          1265 m_ring.quit();
          -
          1266 m_worker.join();
          -
          1267 }
          -
          1268
          -
          1269#pragma warning(suppress: 6101) // See [1] below
          -
          -
          1270 virtual _Success_(return != 0 || length == 0) size_t read(
          -
          1271 _Out_writes_bytes_to_opt_(length, return) void* data, _In_ size_t length)
          -
          1272 {
          -
          1273 _Assume_(data || !length);
          -
          1274 for (size_t to_read = length;;) {
          -
          1275 uint8_t* ptr; size_t num_read;
          -
          1276 std::tie(ptr, num_read) = m_ring.front();
          -
          1277 if (!ptr) _Unlikely_ {
          -
          1278 m_state = to_read < length || !length ? state_t::ok : m_source->state();
          -
          1279 return length - to_read; // [1] Code analysis misses `length - to_read` bytes were written to data in previous loop iterations.
          -
          1280 }
          -
          1281 if (to_read < num_read)
          -
          1282 num_read = to_read;
          -
          1283 memcpy(data, ptr, num_read);
          -
          1284 m_ring.pop(num_read);
          -
          1285 to_read -= num_read;
          -
          1286 if (!to_read) {
          -
          1287 m_state = state_t::ok;
          -
          1288 return length;
          -
          1289 }
          -
          1290 reinterpret_cast<uint8_t*&>(data) += num_read;
          -
          1291 }
          -
          1292 }
          +
          1234
          +
          1235 constexpr size_t default_async_limit = 0x100000;
          +
          1236
          +
          1242 template <size_t CAPACITY = default_async_limit>
          +
          + +
          1244 {
          +
          1245 public:
          +
          1246 async_reader(_Inout_ basic& source) :
          +
          1247 converter(source),
          +
          1248 m_worker([](_Inout_ async_reader& w) { w.process(); }, std::ref(*this))
          +
          1249 {}
          +
          1250
          +
          1251 virtual ~async_reader()
          +
          1252 {
          +
          1253 m_ring.quit();
          +
          1254 m_worker.join();
          +
          1255 }
          +
          1256
          +
          1257#pragma warning(suppress: 6101) // See [1] below
          +
          +
          1258 virtual _Success_(return != 0 || length == 0) size_t read(
          +
          1259 _Out_writes_bytes_to_opt_(length, return) void* data, _In_ size_t length)
          +
          1260 {
          +
          1261 _Assume_(data || !length);
          +
          1262 for (size_t to_read = length;;) {
          +
          1263 uint8_t* ptr; size_t num_read;
          +
          1264 std::tie(ptr, num_read) = m_ring.front();
          +
          1265 if (!ptr) _Unlikely_ {
          +
          1266 m_state = to_read < length || !length ? state_t::ok : m_source->state();
          +
          1267 return length - to_read; // [1] Code analysis misses `length - to_read` bytes were written to data in previous loop iterations.
          +
          1268 }
          +
          1269 if (to_read < num_read)
          +
          1270 num_read = to_read;
          +
          1271 memcpy(data, ptr, num_read);
          +
          1272 m_ring.pop(num_read);
          +
          1273 to_read -= num_read;
          +
          1274 if (!to_read) {
          +
          1275 m_state = state_t::ok;
          +
          1276 return length;
          +
          1277 }
          +
          1278 reinterpret_cast<uint8_t*&>(data) += num_read;
          +
          1279 }
          +
          1280 }
          -
          1293
          -
          1294 protected:
          -
          1295 void process()
          -
          1296 {
          -
          1297 for (;;) {
          -
          1298 uint8_t* ptr; size_t num_write;
          -
          1299 std::tie(ptr, num_write) = m_ring.back();
          -
          1300 if (!ptr) _Unlikely_
          -
          1301 break;
          -
          1302 num_write = m_source->read(ptr, num_write);
          -
          1303 m_ring.push(num_write);
          -
          1304 if (!m_source->ok()) {
          -
          1305 m_ring.quit();
          -
          1306 break;
          -
          1307 }
          -
          1308 }
          -
          1309 }
          -
          1310
          -
          1311 protected:
          -
          1312 ring<uint8_t, CAPACITY> m_ring;
          -
          1313 std::thread m_worker;
          -
          1314 };
          +
          1281
          +
          1282 protected:
          +
          1283 void process()
          +
          1284 {
          +
          1285 for (;;) {
          +
          1286 uint8_t* ptr; size_t num_write;
          +
          1287 std::tie(ptr, num_write) = m_ring.back();
          +
          1288 if (!ptr) _Unlikely_
          +
          1289 break;
          +
          1290 num_write = m_source->read(ptr, num_write);
          +
          1291 m_ring.push(num_write);
          +
          1292 if (!m_source->ok()) {
          +
          1293 m_ring.quit();
          +
          1294 break;
          +
          1295 }
          +
          1296 }
          +
          1297 }
          +
          1298
          +
          1299 protected:
          +
          1300 ring<uint8_t, CAPACITY> m_ring;
          +
          1301 std::thread m_worker;
          +
          1302 };
          -
          1315
          -
          1321 template <size_t CAPACITY = default_async_limit>
          -
          - -
          1323 {
          -
          1324 public:
          -
          1325 async_writer(_Inout_ basic& source) :
          -
          1326 converter(source),
          -
          1327 m_worker([](_Inout_ async_writer& w) { w.process(); }, std::ref(*this))
          -
          1328 {}
          -
          1329
          -
          1330 virtual ~async_writer()
          -
          1331 {
          -
          1332 m_ring.quit();
          -
          1333 m_worker.join();
          -
          1334 }
          -
          1335
          -
          -
          1336 virtual _Success_(return != 0) size_t write(
          -
          1337 _In_reads_bytes_opt_(length) const void* data, _In_ size_t length)
          -
          1338 {
          -
          1339 _Assume_(data || !length);
          -
          1340 for (size_t to_write = length;;) {
          -
          1341 uint8_t* ptr; size_t num_write;
          -
          1342 std::tie(ptr, num_write) = m_ring.back();
          -
          1343 if (!ptr) _Unlikely_ {
          -
          1344 m_state = state_t::fail;
          -
          1345 return length - to_write;
          -
          1346 }
          -
          1347 if (to_write < num_write)
          -
          1348 num_write = to_write;
          -
          1349 memcpy(ptr, data, num_write);
          -
          1350 m_ring.push(num_write);
          -
          1351 to_write -= num_write;
          -
          1352 if (!to_write) {
          -
          1353 m_state = state_t::ok;
          -
          1354 return length;
          -
          1355 }
          -
          1356 reinterpret_cast<const uint8_t*&>(data) += num_write;
          -
          1357 }
          -
          1358 }
          +
          1303
          +
          1309 template <size_t CAPACITY = default_async_limit>
          +
          + +
          1311 {
          +
          1312 public:
          +
          1313 async_writer(_Inout_ basic& source) :
          +
          1314 converter(source),
          +
          1315 m_worker([](_Inout_ async_writer& w) { w.process(); }, std::ref(*this))
          +
          1316 {}
          +
          1317
          +
          1318 virtual ~async_writer()
          +
          1319 {
          +
          1320 m_ring.quit();
          +
          1321 m_worker.join();
          +
          1322 }
          +
          1323
          +
          +
          1324 virtual _Success_(return != 0) size_t write(
          +
          1325 _In_reads_bytes_opt_(length) const void* data, _In_ size_t length)
          +
          1326 {
          +
          1327 _Assume_(data || !length);
          +
          1328 for (size_t to_write = length;;) {
          +
          1329 uint8_t* ptr; size_t num_write;
          +
          1330 std::tie(ptr, num_write) = m_ring.back();
          +
          1331 if (!ptr) _Unlikely_ {
          +
          1332 m_state = state_t::fail;
          +
          1333 return length - to_write;
          +
          1334 }
          +
          1335 if (to_write < num_write)
          +
          1336 num_write = to_write;
          +
          1337 memcpy(ptr, data, num_write);
          +
          1338 m_ring.push(num_write);
          +
          1339 to_write -= num_write;
          +
          1340 if (!to_write) {
          +
          1341 m_state = state_t::ok;
          +
          1342 return length;
          +
          1343 }
          +
          1344 reinterpret_cast<const uint8_t*&>(data) += num_write;
          +
          1345 }
          +
          1346 }
          -
          1359
          -
          -
          1360 virtual void flush()
          -
          1361 {
          -
          1362 m_ring.sync();
          - -
          1364 }
          +
          1347
          +
          +
          1348 virtual void flush()
          +
          1349 {
          +
          1350 m_ring.sync();
          + +
          1352 }
          -
          1365
          -
          1366 protected:
          -
          1367 void process()
          -
          1368 {
          -
          1369 for (;;) {
          -
          1370 uint8_t* ptr; size_t num_read;
          -
          1371 std::tie(ptr, num_read) = m_ring.front();
          -
          1372 if (!ptr)
          -
          1373 break;
          -
          1374 num_read = m_source->write(ptr, num_read);
          -
          1375 m_ring.pop(num_read);
          -
          1376 if (!m_source->ok()) {
          -
          1377 m_ring.quit();
          -
          1378 break;
          -
          1379 }
          -
          1380 }
          -
          1381 }
          -
          1382
          +
          1353
          +
          1354 protected:
          +
          1355 void process()
          +
          1356 {
          +
          1357 for (;;) {
          +
          1358 uint8_t* ptr; size_t num_read;
          +
          1359 std::tie(ptr, num_read) = m_ring.front();
          +
          1360 if (!ptr)
          +
          1361 break;
          +
          1362 num_read = m_source->write(ptr, num_read);
          +
          1363 m_ring.pop(num_read);
          +
          1364 if (!m_source->ok()) {
          +
          1365 m_ring.quit();
          +
          1366 break;
          +
          1367 }
          +
          1368 }
          +
          1369 }
          +
          1370
          +
          1371 protected:
          +
          1372 ring<uint8_t, CAPACITY> m_ring;
          +
          1373 std::thread m_worker;
          +
          1374 };
          +
          +
          1375
          +
          1376 constexpr size_t default_buffer_size = 0x400;
          +
          1377
          +
          +
          1381 class buffer : public converter
          +
          1382 {
          1383 protected:
          -
          1384 ring<uint8_t, CAPACITY> m_ring;
          -
          1385 std::thread m_worker;
          -
          1386 };
          +
          1385 explicit buffer(_In_ size_t read_buffer_size = default_buffer_size, _In_ size_t write_buffer_size = default_buffer_size) :
          +
          1386 converter(),
          +
          1387 m_read_buffer(read_buffer_size),
          +
          1388 m_write_buffer(write_buffer_size)
          +
          1389 {}
          +
          1390
          +
          1391 void done()
          +
          1392 {
          +
          1393 if (m_source)
          +
          1394 flush_write();
          +
          1395 converter::done();
          +
          1396 }
          +
          1398
          +
          1399 public:
          +
          1400 buffer(_Inout_ basic& source, _In_ size_t read_buffer_size = default_buffer_size, _In_ size_t write_buffer_size = default_buffer_size) :
          +
          1401 converter(source),
          +
          1402 m_read_buffer(read_buffer_size),
          +
          1403 m_write_buffer(write_buffer_size)
          +
          1404 {}
          +
          1405
          +
          1406 virtual ~buffer()
          +
          1407 {
          +
          1408 if (m_source)
          +
          1409 flush_write();
          +
          1410 }
          +
          1411
          +
          +
          1412 virtual _Success_(return != 0 || length == 0) size_t read(
          +
          1413 _Out_writes_bytes_to_opt_(length, return) void* data, _In_ size_t length)
          +
          1414 {
          +
          1415 _Assume_(data || !length);
          +
          1416 for (size_t to_read = length;;) {
          +
          1417 size_t buffer_size = m_read_buffer.tail - m_read_buffer.head;
          +
          1418 if (to_read <= buffer_size) {
          +
          1419 memcpy(data, m_read_buffer.data + m_read_buffer.head, to_read);
          +
          1420 m_read_buffer.head += to_read;
          +
          1421 m_state = state_t::ok;
          +
          1422 return length;
          +
          1423 }
          +
          1424 if (buffer_size) {
          +
          1425 memcpy(data, m_read_buffer.data + m_read_buffer.head, buffer_size);
          +
          1426 reinterpret_cast<uint8_t*&>(data) += buffer_size;
          +
          1427 to_read -= buffer_size;
          +
          1428 }
          +
          1429 m_read_buffer.head = 0;
          +
          1430 if (to_read > m_read_buffer.capacity) {
          +
          1431 // When needing to read more data than buffer capacity, bypass the buffer.
          +
          1432 m_read_buffer.tail = 0;
          +
          1433 to_read -= m_source->read(data, to_read);
          +
          1434 m_state = to_read < length ? state_t::ok : m_source->state();
          +
          1435 return length - to_read;
          +
          1436 }
          +
          1437 m_read_buffer.tail = m_source->read(m_read_buffer.data, m_read_buffer.capacity);
          +
          1438 if (m_read_buffer.tail < m_read_buffer.capacity && m_read_buffer.tail < to_read) _Unlikely_ {
          +
          1439 memcpy(data, m_read_buffer.data, m_read_buffer.tail);
          +
          1440 m_read_buffer.head = m_read_buffer.tail;
          +
          1441 to_read -= m_read_buffer.tail;
          +
          1442 m_state = to_read < length ? state_t::ok : m_source->state();
          +
          1443 return length - to_read;
          +
          1444 }
          +
          1445 }
          +
          1446 }
          -
          1387
          -
          1388 constexpr size_t default_buffer_size = 0x400;
          -
          1389
          -
          -
          1393 class buffer : public converter
          -
          1394 {
          -
          1395 protected:
          -
          1397 explicit buffer(_In_ size_t read_buffer_size = default_buffer_size, _In_ size_t write_buffer_size = default_buffer_size) :
          -
          1398 converter(),
          -
          1399 m_read_buffer(read_buffer_size),
          -
          1400 m_write_buffer(write_buffer_size)
          -
          1401 {}
          -
          1402
          -
          1403 void done()
          -
          1404 {
          -
          1405 if (m_source)
          -
          1406 flush_write();
          -
          1407 converter::done();
          -
          1408 }
          -
          1410
          -
          1411 public:
          -
          1412 buffer(_Inout_ basic& source, _In_ size_t read_buffer_size = default_buffer_size, _In_ size_t write_buffer_size = default_buffer_size) :
          -
          1413 converter(source),
          -
          1414 m_read_buffer(read_buffer_size),
          -
          1415 m_write_buffer(write_buffer_size)
          -
          1416 {}
          -
          1417
          -
          1418 virtual ~buffer()
          -
          1419 {
          -
          1420 if (m_source)
          -
          1421 flush_write();
          -
          1422 }
          -
          1423
          -
          -
          1424 virtual _Success_(return != 0 || length == 0) size_t read(
          -
          1425 _Out_writes_bytes_to_opt_(length, return) void* data, _In_ size_t length)
          -
          1426 {
          -
          1427 _Assume_(data || !length);
          -
          1428 for (size_t to_read = length;;) {
          -
          1429 size_t buffer_size = m_read_buffer.tail - m_read_buffer.head;
          -
          1430 if (to_read <= buffer_size) {
          -
          1431 memcpy(data, m_read_buffer.data + m_read_buffer.head, to_read);
          -
          1432 m_read_buffer.head += to_read;
          -
          1433 m_state = state_t::ok;
          -
          1434 return length;
          -
          1435 }
          -
          1436 if (buffer_size) {
          -
          1437 memcpy(data, m_read_buffer.data + m_read_buffer.head, buffer_size);
          -
          1438 reinterpret_cast<uint8_t*&>(data) += buffer_size;
          -
          1439 to_read -= buffer_size;
          -
          1440 }
          -
          1441 m_read_buffer.head = 0;
          -
          1442 if (to_read > m_read_buffer.capacity) {
          -
          1443 // When needing to read more data than buffer capacity, bypass the buffer.
          -
          1444 m_read_buffer.tail = 0;
          -
          1445 to_read -= m_source->read(data, to_read);
          -
          1446 m_state = to_read < length ? state_t::ok : m_source->state();
          -
          1447 return length - to_read;
          -
          1448 }
          -
          1449 m_read_buffer.tail = m_source->read(m_read_buffer.data, m_read_buffer.capacity);
          -
          1450 if (m_read_buffer.tail < m_read_buffer.capacity && m_read_buffer.tail < to_read) _Unlikely_ {
          -
          1451 memcpy(data, m_read_buffer.data, m_read_buffer.tail);
          -
          1452 m_read_buffer.head = m_read_buffer.tail;
          -
          1453 to_read -= m_read_buffer.tail;
          -
          1454 m_state = to_read < length ? state_t::ok : m_source->state();
          -
          1455 return length - to_read;
          -
          1456 }
          -
          1457 }
          -
          1458 }
          +
          1447
          +
          +
          1448 virtual _Success_(return != 0) size_t write(
          +
          1449 _In_reads_bytes_opt_(length) const void* data, _In_ size_t length)
          +
          1450 {
          +
          1451 _Assume_(data || !length);
          +
          1452 if (!length) _Unlikely_ {
          +
          1453 // Pass null writes (zero-byte length). Null write operations have special meaning with with Windows pipes.
          +
          1454 flush_write();
          +
          1455 if (!ok()) _Unlikely_
          +
          1456 return 0;
          +
          1457 converter::write(nullptr, 0);
          +
          1458 return 0;
          +
          1459 }
          +
          1460
          +
          1461 for (size_t to_write = length;;) {
          +
          1462 size_t available_buffer = m_write_buffer.capacity - m_write_buffer.tail;
          +
          1463 if (to_write <= available_buffer) {
          +
          1464 memcpy(m_write_buffer.data + m_write_buffer.tail, data, to_write);
          +
          1465 m_write_buffer.tail += to_write;
          +
          1466 m_state = state_t::ok;
          +
          1467 return length;
          +
          1468 }
          +
          1469 if (available_buffer) {
          +
          1470 memcpy(m_write_buffer.data + m_write_buffer.tail, data, available_buffer);
          +
          1471 reinterpret_cast<const uint8_t*&>(data) += available_buffer;
          +
          1472 to_write -= available_buffer;
          +
          1473 m_write_buffer.tail += available_buffer;
          +
          1474 }
          +
          1475 size_t buffer_size = m_write_buffer.tail - m_write_buffer.head;
          +
          1476 if (buffer_size) {
          +
          1477 m_write_buffer.head += converter::write(m_write_buffer.data + m_write_buffer.head, buffer_size);
          +
          1478 if (m_write_buffer.head == m_write_buffer.tail)
          +
          1479 m_write_buffer.head = m_write_buffer.tail = 0;
          +
          1480 else
          +
          1481 return length - to_write;
          +
          1482 }
          +
          1483 if (to_write > m_write_buffer.capacity) {
          +
          1484 // When needing to write more data than buffer capacity, bypass the buffer.
          +
          1485 to_write -= converter::write(data, to_write);
          +
          1486 return length - to_write;
          +
          1487 }
          +
          1488 }
          +
          1489 }
          -
          1459
          -
          -
          1460 virtual _Success_(return != 0) size_t write(
          -
          1461 _In_reads_bytes_opt_(length) const void* data, _In_ size_t length)
          -
          1462 {
          -
          1463 _Assume_(data || !length);
          -
          1464 if (!length) _Unlikely_ {
          -
          1465 // Pass null writes (zero-byte length). Null write operations have special meaning with with Windows pipes.
          -
          1466 flush_write();
          -
          1467 if (!ok()) _Unlikely_
          -
          1468 return 0;
          -
          1469 converter::write(nullptr, 0);
          -
          1470 return 0;
          -
          1471 }
          -
          1472
          -
          1473 for (size_t to_write = length;;) {
          -
          1474 size_t available_buffer = m_write_buffer.capacity - m_write_buffer.tail;
          -
          1475 if (to_write <= available_buffer) {
          -
          1476 memcpy(m_write_buffer.data + m_write_buffer.tail, data, to_write);
          -
          1477 m_write_buffer.tail += to_write;
          -
          1478 m_state = state_t::ok;
          -
          1479 return length;
          -
          1480 }
          -
          1481 if (available_buffer) {
          -
          1482 memcpy(m_write_buffer.data + m_write_buffer.tail, data, available_buffer);
          -
          1483 reinterpret_cast<const uint8_t*&>(data) += available_buffer;
          -
          1484 to_write -= available_buffer;
          -
          1485 m_write_buffer.tail += available_buffer;
          -
          1486 }
          -
          1487 size_t buffer_size = m_write_buffer.tail - m_write_buffer.head;
          -
          1488 if (buffer_size) {
          -
          1489 m_write_buffer.head += converter::write(m_write_buffer.data + m_write_buffer.head, buffer_size);
          -
          1490 if (m_write_buffer.head == m_write_buffer.tail)
          -
          1491 m_write_buffer.head = m_write_buffer.tail = 0;
          -
          1492 else
          -
          1493 return length - to_write;
          -
          1494 }
          -
          1495 if (to_write > m_write_buffer.capacity) {
          -
          1496 // When needing to write more data than buffer capacity, bypass the buffer.
          -
          1497 to_write -= converter::write(data, to_write);
          -
          1498 return length - to_write;
          -
          1499 }
          -
          1500 }
          -
          1501 }
          +
          1490
          +
          +
          1491 virtual void flush()
          +
          1492 {
          +
          1493 flush_write();
          +
          1494 if (ok())
          + +
          1496 }
          -
          1502
          -
          -
          1503 virtual void flush()
          -
          1504 {
          -
          1505 flush_write();
          -
          1506 if (ok())
          - -
          1508 }
          +
          1497
          +
          1498 protected:
          +
          1499 void flush_write()
          +
          1500 {
          +
          1501 size_t buffer_size = m_write_buffer.tail - m_write_buffer.head;
          +
          1502 if (buffer_size) {
          +
          1503 m_write_buffer.head += m_source->write(m_write_buffer.data + m_write_buffer.head, buffer_size);
          +
          1504 if (m_write_buffer.head == m_write_buffer.tail) {
          +
          1505 m_write_buffer.head = 0;
          +
          1506 m_write_buffer.tail = 0;
          +
          1507 }
          +
          1508 else {
          +
          1509 m_state = m_source->state();
          +
          1510 return;
          +
          1511 }
          +
          1512 }
          +
          1513 m_state = state_t::ok;
          +
          1514 }
          +
          1515
          +
          +
          1516 struct buffer_t {
          +
          1517 uint8_t* data;
          +
          1518 size_t head, tail, capacity;
          +
          1519
          +
          1520 buffer_t(_In_ size_t buffer_size) :
          +
          1521 head(0),
          +
          1522 tail(0),
          +
          1523 capacity(buffer_size),
          +
          1524 data(buffer_size ? new uint8_t[buffer_size] : nullptr)
          +
          1525 {}
          +
          1526
          +
          1527 ~buffer_t()
          +
          1528 {
          +
          1529 if (data)
          +
          1530 delete[] data;
          +
          1531 }
          +
          1532 } m_read_buffer, m_write_buffer;
          -
          1509
          -
          1510 protected:
          -
          1511 void flush_write()
          -
          1512 {
          -
          1513 size_t buffer_size = m_write_buffer.tail - m_write_buffer.head;
          -
          1514 if (buffer_size) {
          -
          1515 m_write_buffer.head += m_source->write(m_write_buffer.data + m_write_buffer.head, buffer_size);
          -
          1516 if (m_write_buffer.head == m_write_buffer.tail) {
          -
          1517 m_write_buffer.head = 0;
          -
          1518 m_write_buffer.tail = 0;
          -
          1519 }
          -
          1520 else {
          -
          1521 m_state = m_source->state();
          -
          1522 return;
          -
          1523 }
          -
          1524 }
          -
          1525 m_state = state_t::ok;
          -
          1526 }
          -
          1527
          -
          -
          1528 struct buffer_t {
          -
          1529 uint8_t* data;
          -
          1530 size_t head, tail, capacity;
          -
          1531
          -
          1532 buffer_t(_In_ size_t buffer_size) :
          -
          1533 head(0),
          -
          1534 tail(0),
          -
          1535 capacity(buffer_size),
          -
          1536 data(buffer_size ? new uint8_t[buffer_size] : nullptr)
          -
          1537 {}
          -
          1538
          -
          1539 ~buffer_t()
          -
          1540 {
          -
          1541 if (data)
          -
          1542 delete[] data;
          -
          1543 }
          -
          1544 } m_read_buffer, m_write_buffer;
          -
          -
          1545 };
          +
          1533 };
          +
          1534
          +
          +
          1538 class limiter : public converter
          +
          1539 {
          +
          1540 public:
          +
          1541 limiter(_Inout_ basic& source, _In_ fsize_t _read_limit = 0, _In_ fsize_t _write_limit = 0) :
          +
          1542 converter(source),
          +
          1543 read_limit(_read_limit),
          +
          1544 write_limit(_write_limit)
          +
          1545 {}
          1546
          -
          -
          1550 class limiter : public converter
          -
          1551 {
          -
          1552 public:
          -
          1553 limiter(_Inout_ basic& source, _In_ fsize_t _read_limit = 0, _In_ fsize_t _write_limit = 0) :
          -
          1554 converter(source),
          -
          1555 read_limit(_read_limit),
          -
          1556 write_limit(_write_limit)
          -
          1557 {}
          -
          1558
          -
          -
          1559 virtual _Success_(return != 0 || length == 0) size_t read(
          -
          1560 _Out_writes_bytes_to_opt_(length, return) void* data, _In_ size_t length)
          -
          1561 {
          -
          1562 size_t num_read;
          -
          1563 if (read_limit == fsize_max)
          -
          1564 num_read = converter::read(data, length);
          -
          1565 else if (length <= read_limit) {
          -
          1566 num_read = converter::read(data, length);
          -
          1567 read_limit -= num_read;
          -
          1568 }
          -
          1569 else if (length && !read_limit) {
          -
          1570 num_read = 0;
          -
          1571 m_state = state_t::eof;
          -
          1572 }
          -
          1573 else {
          -
          1574 num_read = converter::read(data, static_cast<size_t>(read_limit));
          -
          1575 read_limit -= num_read;
          -
          1576 }
          -
          1577 return num_read;
          -
          1578 }
          +
          +
          1547 virtual _Success_(return != 0 || length == 0) size_t read(
          +
          1548 _Out_writes_bytes_to_opt_(length, return) void* data, _In_ size_t length)
          +
          1549 {
          +
          1550 size_t num_read;
          +
          1551 if (read_limit == fsize_max)
          +
          1552 num_read = converter::read(data, length);
          +
          1553 else if (length <= read_limit) {
          +
          1554 num_read = converter::read(data, length);
          +
          1555 read_limit -= num_read;
          +
          1556 }
          +
          1557 else if (length && !read_limit) {
          +
          1558 num_read = 0;
          +
          1559 m_state = state_t::eof;
          +
          1560 }
          +
          1561 else {
          +
          1562 num_read = converter::read(data, static_cast<size_t>(read_limit));
          +
          1563 read_limit -= num_read;
          +
          1564 }
          +
          1565 return num_read;
          +
          1566 }
          -
          1579
          -
          -
          1580 virtual _Success_(return != 0) size_t write(
          -
          1581 _In_reads_bytes_opt_(length) const void* data, _In_ size_t length)
          -
          1582 {
          -
          1583 size_t num_written;
          -
          1584 if (write_limit == fsize_max)
          -
          1585 num_written = converter::write(data, length);
          -
          1586 else if (length <= write_limit) {
          -
          1587 num_written = converter::write(data, length);
          -
          1588 write_limit -= num_written;
          -
          1589 }
          -
          1590 else if (length && !write_limit) {
          -
          1591 num_written = 0;
          -
          1592 m_state = state_t::fail;
          -
          1593 }
          -
          1594 else {
          -
          1595 num_written = converter::write(data, static_cast<size_t>(write_limit));
          -
          1596 write_limit -= num_written;
          -
          1597 }
          -
          1598 return num_written;
          -
          1599 }
          +
          1567
          +
          +
          1568 virtual _Success_(return != 0) size_t write(
          +
          1569 _In_reads_bytes_opt_(length) const void* data, _In_ size_t length)
          +
          1570 {
          +
          1571 size_t num_written;
          +
          1572 if (write_limit == fsize_max)
          +
          1573 num_written = converter::write(data, length);
          +
          1574 else if (length <= write_limit) {
          +
          1575 num_written = converter::write(data, length);
          +
          1576 write_limit -= num_written;
          +
          1577 }
          +
          1578 else if (length && !write_limit) {
          +
          1579 num_written = 0;
          +
          1580 m_state = state_t::fail;
          +
          1581 }
          +
          1582 else {
          +
          1583 num_written = converter::write(data, static_cast<size_t>(write_limit));
          +
          1584 write_limit -= num_written;
          +
          1585 }
          +
          1586 return num_written;
          +
          1587 }
          -
          1600
          -
          1601 public:
          -
          1602 fsize_t
          - - -
          1605 };
          +
          1588
          +
          1589 public:
          +
          1590 fsize_t
          + + +
          1593 };
          +
          1594
          +
          +
          1598 class window : public limiter
          +
          1599 {
          +
          1600 public:
          +
          1601 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) :
          +
          1602 limiter(source, read_limit, write_limit),
          +
          1603 read_offset(_read_offset),
          +
          1604 write_offset(_write_offset)
          +
          1605 {}
          1606
          -
          -
          1610 class window : public limiter
          -
          1611 {
          -
          1612 public:
          -
          1613 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) :
          -
          1614 limiter(source, read_limit, write_limit),
          -
          1615 read_offset(_read_offset),
          -
          1616 write_offset(_write_offset)
          -
          1617 {}
          -
          1618
          -
          -
          1619 virtual _Success_(return != 0 || length == 0) size_t read(
          -
          1620 _Out_writes_bytes_to_opt_(length, return) void* data, _In_ size_t length)
          -
          1621 {
          -
          1622 if (read_offset) {
          -
          1623 m_source->skip(read_offset);
          -
          1624 m_state = m_source->state();
          -
          1625 if (!ok()) _Unlikely_
          -
          1626 return 0;
          -
          1627 read_offset = 0;
          +
          +
          1607 virtual _Success_(return != 0 || length == 0) size_t read(
          +
          1608 _Out_writes_bytes_to_opt_(length, return) void* data, _In_ size_t length)
          +
          1609 {
          +
          1610 if (read_offset) {
          +
          1611 m_source->skip(read_offset);
          +
          1612 m_state = m_source->state();
          +
          1613 if (!ok()) _Unlikely_
          +
          1614 return 0;
          +
          1615 read_offset = 0;
          +
          1616 }
          +
          1617 size_t num_read;
          +
          1618 if (read_limit == fsize_max)
          +
          1619 num_read = converter::read(data, length);
          +
          1620 else if (length <= read_limit) {
          +
          1621 num_read = converter::read(data, length);
          +
          1622 read_limit -= num_read;
          +
          1623 }
          +
          1624 else if (length && !read_limit) {
          +
          1625 num_read = 0;
          +
          1626 m_source->skip(length);
          +
          1627 m_state = state_t::eof;
          1628 }
          -
          1629 size_t num_read;
          -
          1630 if (read_limit == fsize_max)
          -
          1631 num_read = converter::read(data, length);
          -
          1632 else if (length <= read_limit) {
          -
          1633 num_read = converter::read(data, length);
          -
          1634 read_limit -= num_read;
          -
          1635 }
          -
          1636 else if (length && !read_limit) {
          -
          1637 num_read = 0;
          -
          1638 m_source->skip(length);
          -
          1639 m_state = state_t::eof;
          -
          1640 }
          -
          1641 else {
          -
          1642 num_read = converter::read(data, static_cast<size_t>(read_limit));
          -
          1643 read_limit -= num_read;
          +
          1629 else {
          +
          1630 num_read = converter::read(data, static_cast<size_t>(read_limit));
          +
          1631 read_limit -= num_read;
          +
          1632 }
          +
          1633 return num_read;
          +
          1634 }
          +
          +
          1635
          +
          +
          1636 virtual _Success_(return != 0) size_t write(
          +
          1637 _In_reads_bytes_opt_(length) const void* data, _In_ size_t length)
          +
          1638 {
          +
          1639 size_t num_skipped, num_written;
          +
          1640 if (length <= write_offset) {
          +
          1641 write_offset -= length;
          +
          1642 m_state = state_t::ok;
          +
          1643 return length;
          1644 }
          -
          1645 return num_read;
          -
          1646 }
          +
          1645 if (write_offset) {
          +
          1646 reinterpret_cast<const uint8_t*&>(data) += static_cast<size_t>(write_offset);
          +
          1647 length -= static_cast<size_t>(write_offset);
          +
          1648 num_skipped = static_cast<size_t>(write_offset);
          +
          1649 write_offset = 0;
          +
          1650 }
          +
          1651 else
          +
          1652 num_skipped = 0;
          +
          1653 if (write_limit == fsize_max)
          +
          1654 num_written = converter::write(data, length);
          +
          1655 else if (length <= write_limit) {
          +
          1656 num_written = converter::write(data, length);
          +
          1657 write_limit -= num_written;
          +
          1658 }
          +
          1659 else if (length && !write_limit) {
          +
          1660 num_skipped += length;
          +
          1661 num_written = 0;
          +
          1662 m_state = state_t::ok;
          +
          1663 }
          +
          1664 else {
          +
          1665 num_skipped += length - static_cast<size_t>(write_limit);
          +
          1666 num_written = converter::write(data, static_cast<size_t>(write_limit));
          +
          1667 write_limit -= num_written;
          +
          1668 }
          +
          1669 return num_skipped + num_written;
          +
          1670 }
          -
          1647
          -
          -
          1648 virtual _Success_(return != 0) size_t write(
          -
          1649 _In_reads_bytes_opt_(length) const void* data, _In_ size_t length)
          -
          1650 {
          -
          1651 size_t num_skipped, num_written;
          -
          1652 if (length <= write_offset) {
          -
          1653 write_offset -= length;
          -
          1654 m_state = state_t::ok;
          -
          1655 return length;
          -
          1656 }
          -
          1657 if (write_offset) {
          -
          1658 reinterpret_cast<const uint8_t*&>(data) += static_cast<size_t>(write_offset);
          -
          1659 length -= static_cast<size_t>(write_offset);
          -
          1660 num_skipped = static_cast<size_t>(write_offset);
          -
          1661 write_offset = 0;
          -
          1662 }
          -
          1663 else
          -
          1664 num_skipped = 0;
          -
          1665 if (write_limit == fsize_max)
          -
          1666 num_written = converter::write(data, length);
          -
          1667 else if (length <= write_limit) {
          -
          1668 num_written = converter::write(data, length);
          -
          1669 write_limit -= num_written;
          -
          1670 }
          -
          1671 else if (length && !write_limit) {
          -
          1672 num_skipped += length;
          -
          1673 num_written = 0;
          -
          1674 m_state = state_t::ok;
          -
          1675 }
          -
          1676 else {
          -
          1677 num_skipped += length - static_cast<size_t>(write_limit);
          -
          1678 num_written = converter::write(data, static_cast<size_t>(write_limit));
          -
          1679 write_limit -= num_written;
          -
          1680 }
          -
          1681 return num_skipped + num_written;
          -
          1682 }
          +
          1671
          +
          1672 public:
          +
          1673 fpos_t
          + + +
          1676 };
          -
          1683
          -
          1684 public:
          -
          1685 fpos_t
          - - -
          1688 };
          +
          1677
          +
          + +
          1682 {
          +
          1683 public:
          +
          1684 file_window(_Inout_ basic_file& source, fpos_t offset = 0, fsize_t length = 0) :
          +
          1685 basic(source.state()),
          +
          1686 m_source(source),
          +
          1687 m_offset(source.tell()),
          +
          1688 m_region(offset, offset + length)
          +
          1689 {}
          +
          1690
          +
          +
          1691 virtual _Success_(return != 0 || length == 0) size_t read(
          +
          1692 _Out_writes_bytes_to_opt_(length, return) void* data, _In_ size_t length)
          +
          1693 {
          +
          1694 _Assume_(data || !length);
          +
          1695 if (m_region.contains(m_offset)) {
          +
          1696 size_t num_read = m_source.read(data, static_cast<size_t>(std::min<fpos_t>(length, m_region.end - m_offset)));
          +
          1697 m_state = m_source.state();
          +
          1698 m_offset += num_read;
          +
          1699 return num_read;
          +
          1700 }
          +
          1701 m_state = length ? state_t::eof : state_t::ok;
          +
          1702 return 0;
          +
          1703 }
          -
          1689
          -
          - -
          1694 {
          -
          1695 public:
          -
          1696 file_window(_Inout_ basic_file& source, fpos_t offset = 0, fsize_t length = 0) :
          -
          1697 basic(source.state()),
          -
          1698 m_source(source),
          -
          1699 m_offset(source.tell()),
          -
          1700 m_region(offset, offset + length)
          -
          1701 {}
          -
          1702
          -
          -
          1703 virtual _Success_(return != 0 || length == 0) size_t read(
          -
          1704 _Out_writes_bytes_to_opt_(length, return) void* data, _In_ size_t length)
          -
          1705 {
          -
          1706 _Assume_(data || !length);
          -
          1707 if (m_region.contains(m_offset)) {
          -
          1708 size_t num_read = m_source.read(data, static_cast<size_t>(std::min<fpos_t>(length, m_region.end - m_offset)));
          -
          1709 m_state = m_source.state();
          -
          1710 m_offset += num_read;
          -
          1711 return num_read;
          -
          1712 }
          -
          1713 m_state = length ? state_t::eof : state_t::ok;
          -
          1714 return 0;
          -
          1715 }
          +
          1704
          +
          +
          1705 virtual _Success_(return != 0) size_t write(
          +
          1706 _In_reads_bytes_opt_(length) const void* data, _In_ size_t length)
          +
          1707 {
          +
          1708 _Assume_(data || !length);
          +
          1709 if (m_region.contains(m_offset)) {
          +
          1710 size_t num_written = m_source.write(data, static_cast<size_t>(std::min<fpos_t>(length, m_region.end - m_offset)));
          +
          1711 m_state = m_source.state();
          +
          1712 m_offset += num_written;
          +
          1713 return num_written;
          +
          1714 }
          +
          1715 m_state = state_t::fail;
          +
          1716 return 0;
          +
          1717 }
          -
          1716
          -
          -
          1717 virtual _Success_(return != 0) size_t write(
          -
          1718 _In_reads_bytes_opt_(length) const void* data, _In_ size_t length)
          -
          1719 {
          -
          1720 _Assume_(data || !length);
          -
          1721 if (m_region.contains(m_offset)) {
          -
          1722 size_t num_written = m_source.write(data, static_cast<size_t>(std::min<fpos_t>(length, m_region.end - m_offset)));
          -
          1723 m_state = m_source.state();
          -
          1724 m_offset += num_written;
          -
          1725 return num_written;
          -
          1726 }
          -
          1727 m_state = state_t::fail;
          -
          1728 return 0;
          +
          1718
          +
          +
          1719 virtual void close()
          +
          1720 {
          +
          1721 m_source.close();
          +
          1722 m_state = m_source.state();
          +
          1723 }
          +
          +
          1724
          +
          +
          1725 virtual void flush()
          +
          1726 {
          +
          1727 m_source.flush();
          +
          1728 m_state = m_source.state();
          1729 }
          1730
          -
          1731 virtual void close()
          +
          1731 virtual fpos_t seek(_In_ foff_t offset, _In_ seek_t how = seek_t::beg)
          1732 {
          -
          1733 m_source.close();
          +
          1733 m_offset = m_source.seek(offset, how);
          1734 m_state = m_source.state();
          -
          1735 }
          +
          1735 return ok() ? m_offset - m_region.start : fpos_max;
          +
          1736 }
          -
          1736
          -
          -
          1737 virtual void flush()
          -
          1738 {
          -
          1739 m_source.flush();
          -
          1740 m_state = m_source.state();
          -
          1741 }
          +
          1737
          +
          +
          1738 virtual void skip(_In_ fsize_t amount)
          +
          1739 {
          +
          1740 m_source.skip(amount);
          +
          1741 m_state = m_source.state();
          +
          1742 }
          -
          1742
          -
          -
          1743 virtual fpos_t seek(_In_ foff_t offset, _In_ seek_t how = seek_t::beg)
          -
          1744 {
          -
          1745 m_offset = m_source.seek(offset, how);
          -
          1746 m_state = m_source.state();
          -
          1747 return ok() ? m_offset - m_region.start : fpos_max;
          +
          1743
          +
          +
          1744 virtual fpos_t tell() const
          +
          1745 {
          +
          1746 fpos_t offset = m_source.tell();
          +
          1747 return m_region.contains(offset) ? offset - m_region.start : fpos_max;
          1748 }
          1749
          -
          1750 virtual void skip(_In_ fsize_t amount)
          +
          1750 virtual void lock(_In_ fpos_t offset, _In_ fsize_t length)
          1751 {
          -
          1752 m_source.skip(amount);
          -
          1753 m_state = m_source.state();
          -
          1754 }
          +
          1752 if (m_region.contains(offset)) {
          +
          1753 m_source.lock(m_region.start + offset, std::min<fsize_t>(length, m_region.end - offset));
          +
          1754 m_state = m_source.state();
          +
          1755 }
          +
          1756 else
          +
          1757 m_state = state_t::fail;
          +
          1758 }
          -
          1755
          -
          -
          1756 virtual fpos_t tell() const
          -
          1757 {
          -
          1758 fpos_t offset = m_source.tell();
          -
          1759 return m_region.contains(offset) ? offset - m_region.start : fpos_max;
          -
          1760 }
          +
          1759
          +
          +
          1760 virtual void unlock(_In_ fpos_t offset, _In_ fsize_t length)
          +
          1761 {
          +
          1762 if (m_region.contains(offset)) {
          +
          1763 m_source.unlock(m_region.start + offset, std::min<fsize_t>(length, m_region.end - offset));
          +
          1764 m_state = m_source.state();
          +
          1765 }
          +
          1766 else
          +
          1767 m_state = state_t::fail;
          +
          1768 }
          -
          1761
          -
          -
          1762 virtual void lock(_In_ fpos_t offset, _In_ fsize_t length)
          -
          1763 {
          -
          1764 if (m_region.contains(offset)) {
          -
          1765 m_source.lock(m_region.start + offset, std::min<fsize_t>(length, m_region.end - offset));
          -
          1766 m_state = m_source.state();
          -
          1767 }
          -
          1768 else
          -
          1769 m_state = state_t::fail;
          -
          1770 }
          +
          1769
          +
          +
          1770 virtual fsize_t size() const
          +
          1771 {
          +
          1772 return m_region.size();
          +
          1773 }
          -
          1771
          -
          -
          1772 virtual void unlock(_In_ fpos_t offset, _In_ fsize_t length)
          -
          1773 {
          -
          1774 if (m_region.contains(offset)) {
          -
          1775 m_source.unlock(m_region.start + offset, std::min<fsize_t>(length, m_region.end - offset));
          -
          1776 m_state = m_source.state();
          -
          1777 }
          -
          1778 else
          -
          1779 m_state = state_t::fail;
          -
          1780 }
          +
          1774
          +
          +
          1775 virtual void truncate()
          +
          1776 {
          +
          1777 m_state = state_t::fail;
          +
          1778 }
          -
          1781
          -
          -
          1782 virtual fsize_t size() const
          -
          1783 {
          -
          1784 return m_region.size();
          -
          1785 }
          +
          1779
          +
          1780 protected:
          +
          1781 basic_file& m_source;
          +
          1782 fpos_t m_offset;
          +
          1783 interval<fpos_t> m_region;
          +
          1784 };
          -
          1786
          -
          -
          1787 virtual void truncate()
          -
          1788 {
          -
          1789 m_state = state_t::fail;
          -
          1790 }
          -
          -
          1791
          -
          1792 protected:
          -
          1793 basic_file& m_source;
          -
          1794 fpos_t m_offset;
          -
          1795 interval<fpos_t> m_region;
          -
          1796 };
          -
          -
          1797
          -
          1798 constexpr size_t default_cache_size = 0x1000;
          -
          1799
          -
          -
          1803 class cache : public basic_file
          -
          1804 {
          -
          1805 protected:
          -
          1807#pragma warning(suppress: 26495) // The delayed init call will finish initializing the class.
          -
          1808 explicit cache(_In_ size_t cache_size = default_cache_size) :
          -
          1809 basic(state_t::fail),
          -
          1810 m_cache(cache_size)
          -
          1811 {}
          -
          1812
          -
          1813 void init(_Inout_ basic_file& source)
          -
          1814 {
          -
          1815 m_source = &source;
          -
          1816 init();
          -
          1817 }
          -
          1818
          -
          1819 void init()
          -
          1820 {
          -
          1821 m_state = m_source->state();
          -
          1822 m_offset = m_source->tell();
          -
          1823#if SET_FILE_OP_TIMES
          -
          1824 m_atime = m_source->atime();
          -
          1825 m_mtime = m_source->mtime();
          -
          1826#endif
          -
          1827 }
          -
          1828
          -
          1829 void done()
          -
          1830 {
          -
          1831 if (m_source) {
          -
          1832 flush_cache();
          -
          1833 if (!ok()) _Unlikely_
          -
          1834 throw std::system_error(sys_error(), std::system_category(), "failed to flush cache"); // Data loss occured
          -
          1835 m_source->seek(m_offset);
          -
          1836#if SET_FILE_OP_TIMES
          -
          1837 m_source->set_atime(m_atime);
          -
          1838 m_source->set_mtime(m_mtime);
          -
          1839#endif
          -
          1840 m_source = nullptr;
          -
          1841 }
          -
          1842 }
          +
          1785
          +
          1786 constexpr size_t default_cache_size = 0x1000;
          +
          1787
          +
          +
          1791 class cache : public basic_file
          +
          1792 {
          +
          1793 protected:
          +
          1795#pragma warning(suppress: 26495) // The delayed init call will finish initializing the class.
          +
          1796 explicit cache(_In_ size_t cache_size = default_cache_size) :
          +
          1797 basic(state_t::fail),
          +
          1798 m_cache(cache_size)
          +
          1799 {}
          +
          1800
          +
          1801 void init(_Inout_ basic_file& source)
          +
          1802 {
          +
          1803 m_source = &source;
          +
          1804 init();
          +
          1805 }
          +
          1806
          +
          1807 void init()
          +
          1808 {
          +
          1809 m_state = m_source->state();
          +
          1810 m_offset = m_source->tell();
          +
          1811#if SET_FILE_OP_TIMES
          +
          1812 m_atime = m_source->atime();
          +
          1813 m_mtime = m_source->mtime();
          +
          1814#endif
          +
          1815 }
          +
          1816
          +
          1817 void done()
          +
          1818 {
          +
          1819 if (m_source) {
          +
          1820 flush_cache();
          +
          1821 if (!ok()) _Unlikely_
          +
          1822 throw std::system_error(sys_error(), std::system_category(), "failed to flush cache"); // Data loss occured
          +
          1823 m_source->seek(m_offset);
          +
          1824#if SET_FILE_OP_TIMES
          +
          1825 m_source->set_atime(m_atime);
          +
          1826 m_source->set_mtime(m_mtime);
          +
          1827#endif
          +
          1828 m_source = nullptr;
          +
          1829 }
          +
          1830 }
          +
          1832
          +
          1833 public:
          +
          1834 cache(_Inout_ basic_file& source, _In_ size_t cache_size = default_cache_size) :
          +
          1835 basic(source.state()),
          +
          1836 m_source(&source),
          +
          1837 m_cache(cache_size),
          +
          1838 m_offset(source.tell())
          +
          1839#if SET_FILE_OP_TIMES
          +
          1840 , m_atime(source.atime())
          +
          1841 , m_mtime(source.mtime())
          +
          1842#endif
          +
          1843 {}
          1844
          -
          1845 public:
          -
          1846 cache(_Inout_ basic_file& source, _In_ size_t cache_size = default_cache_size) :
          -
          1847 basic(source.state()),
          -
          1848 m_source(&source),
          -
          1849 m_cache(cache_size),
          -
          1850 m_offset(source.tell())
          -
          1851#if SET_FILE_OP_TIMES
          -
          1852 , m_atime(source.atime())
          -
          1853 , m_mtime(source.mtime())
          -
          1854#endif
          -
          1855 {}
          -
          1856
          -
          1857 virtual ~cache() noexcept(false)
          -
          1858 {
          -
          1859 if (m_source) {
          -
          1860 flush_cache();
          -
          1861 if (!ok()) _Unlikely_
          -
          1862 throw std::system_error(sys_error(), std::system_category(), "failed to flush cache"); // Data loss occured
          -
          1863 m_source->seek(m_offset);
          -
          1864#if SET_FILE_OP_TIMES
          -
          1865 m_source->set_atime(m_atime);
          -
          1866 m_source->set_mtime(m_mtime);
          -
          1867#endif
          -
          1868 }
          -
          1869 }
          -
          1870
          -
          -
          1871 virtual _Success_(return != 0 || length == 0) size_t read(
          -
          1872 _Out_writes_bytes_to_opt_(length, return) void* data, _In_ size_t length)
          -
          1873 {
          -
          1874 _Assume_(data || !length);
          -
          1875#if SET_FILE_OP_TIMES
          -
          1876 m_atime = time_point::now();
          -
          1877#endif
          -
          1878 for (size_t to_read = length;;) {
          -
          1879 if (m_cache.status != cache_t::cache_t::status_t::empty) {
          -
          1880 if (m_cache.region.contains(m_offset)) {
          -
          1881 size_t remaining_cache = static_cast<size_t>(m_cache.region.end - m_offset);
          -
          1882 if (to_read <= remaining_cache) {
          -
          1883 memcpy(data, m_cache.data + static_cast<size_t>(m_offset - m_cache.region.start), to_read);
          -
          1884 m_offset += to_read;
          -
          1885 m_state = state_t::ok;
          -
          1886 return length;
          -
          1887 }
          -
          1888 memcpy(data, m_cache.data + static_cast<size_t>(m_offset - m_cache.region.start), remaining_cache);
          -
          1889 reinterpret_cast<uint8_t*&>(data) += remaining_cache;
          -
          1890 to_read -= remaining_cache;
          -
          1891 m_offset += remaining_cache;
          -
          1892 }
          -
          1893 flush_cache();
          -
          1894 if (!ok()) _Unlikely_ {
          -
          1895 if (to_read < length)
          -
          1896 m_state = state_t::ok;
          -
          1897 return length - to_read;
          -
          1898 }
          -
          1899 }
          -
          1900 {
          -
          1901 fpos_t end_max = m_offset + to_read;
          -
          1902 if (m_offset / m_cache.capacity < end_max / m_cache.capacity) {
          -
          1903 // Read spans multiple cache blocks. Bypass cache to the last block.
          -
          1904 m_source->seek(m_offset);
          -
          1905 if (!m_source->ok()) _Unlikely_ {
          -
          1906 m_state = to_read < length ? state_t::ok : state_t::fail;
          -
          1907 return length - to_read;
          -
          1908 }
          -
          1909 size_t num_read = m_source->read(data, to_read - static_cast<size_t>(end_max % m_cache.capacity));
          -
          1910 m_offset += num_read;
          -
          1911 to_read -= num_read;
          -
          1912 if (!to_read) {
          -
          1913 m_state = state_t::ok;
          -
          1914 return length;
          -
          1915 }
          -
          1916 reinterpret_cast<uint8_t*&>(data) += num_read;
          -
          1917 m_state = m_source->state();
          -
          1918 if (!ok()) {
          -
          1919 if (to_read < length)
          -
          1920 m_state = state_t::ok;
          -
          1921 return length - to_read;
          -
          1922 }
          -
          1923 }
          -
          1924 }
          -
          1925 load_cache(m_offset);
          -
          1926 if (!ok() || m_cache.region.end <= m_offset) _Unlikely_ {
          -
          1927 m_state = to_read < length ? state_t::ok : state_t::fail;
          -
          1928 return length - to_read;
          -
          1929 }
          -
          1930 }
          -
          1931 }
          +
          1845 virtual ~cache() noexcept(false)
          +
          1846 {
          +
          1847 if (m_source) {
          +
          1848 flush_cache();
          +
          1849 if (!ok()) _Unlikely_
          +
          1850 throw std::system_error(sys_error(), std::system_category(), "failed to flush cache"); // Data loss occured
          +
          1851 m_source->seek(m_offset);
          +
          1852#if SET_FILE_OP_TIMES
          +
          1853 m_source->set_atime(m_atime);
          +
          1854 m_source->set_mtime(m_mtime);
          +
          1855#endif
          +
          1856 }
          +
          1857 }
          +
          1858
          +
          +
          1859 virtual _Success_(return != 0 || length == 0) size_t read(
          +
          1860 _Out_writes_bytes_to_opt_(length, return) void* data, _In_ size_t length)
          +
          1861 {
          +
          1862 _Assume_(data || !length);
          +
          1863#if SET_FILE_OP_TIMES
          +
          1864 m_atime = time_point::now();
          +
          1865#endif
          +
          1866 for (size_t to_read = length;;) {
          +
          1867 if (m_cache.status != cache_t::cache_t::status_t::empty) {
          +
          1868 if (m_cache.region.contains(m_offset)) {
          +
          1869 size_t remaining_cache = static_cast<size_t>(m_cache.region.end - m_offset);
          +
          1870 if (to_read <= remaining_cache) {
          +
          1871 memcpy(data, m_cache.data + static_cast<size_t>(m_offset - m_cache.region.start), to_read);
          +
          1872 m_offset += to_read;
          +
          1873 m_state = state_t::ok;
          +
          1874 return length;
          +
          1875 }
          +
          1876 memcpy(data, m_cache.data + static_cast<size_t>(m_offset - m_cache.region.start), remaining_cache);
          +
          1877 reinterpret_cast<uint8_t*&>(data) += remaining_cache;
          +
          1878 to_read -= remaining_cache;
          +
          1879 m_offset += remaining_cache;
          +
          1880 }
          +
          1881 flush_cache();
          +
          1882 if (!ok()) _Unlikely_ {
          +
          1883 if (to_read < length)
          +
          1884 m_state = state_t::ok;
          +
          1885 return length - to_read;
          +
          1886 }
          +
          1887 }
          +
          1888 {
          +
          1889 fpos_t end_max = m_offset + to_read;
          +
          1890 if (m_offset / m_cache.capacity < end_max / m_cache.capacity) {
          +
          1891 // Read spans multiple cache blocks. Bypass cache to the last block.
          +
          1892 m_source->seek(m_offset);
          +
          1893 if (!m_source->ok()) _Unlikely_ {
          +
          1894 m_state = to_read < length ? state_t::ok : state_t::fail;
          +
          1895 return length - to_read;
          +
          1896 }
          +
          1897 size_t num_read = m_source->read(data, to_read - static_cast<size_t>(end_max % m_cache.capacity));
          +
          1898 m_offset += num_read;
          +
          1899 to_read -= num_read;
          +
          1900 if (!to_read) {
          +
          1901 m_state = state_t::ok;
          +
          1902 return length;
          +
          1903 }
          +
          1904 reinterpret_cast<uint8_t*&>(data) += num_read;
          +
          1905 m_state = m_source->state();
          +
          1906 if (!ok()) {
          +
          1907 if (to_read < length)
          +
          1908 m_state = state_t::ok;
          +
          1909 return length - to_read;
          +
          1910 }
          +
          1911 }
          +
          1912 }
          +
          1913 load_cache(m_offset);
          +
          1914 if (!ok() || m_cache.region.end <= m_offset) _Unlikely_ {
          +
          1915 m_state = to_read < length ? state_t::ok : state_t::fail;
          +
          1916 return length - to_read;
          +
          1917 }
          +
          1918 }
          +
          1919 }
          -
          1932
          -
          -
          1933 virtual _Success_(return != 0) size_t write(
          -
          1934 _In_reads_bytes_opt_(length) const void* data, _In_ size_t length)
          -
          1935 {
          -
          1936 _Assume_(data || !length);
          -
          1937#if SET_FILE_OP_TIMES
          -
          1938 m_atime = m_mtime = time_point::now();
          -
          1939#endif
          -
          1940 for (size_t to_write = length;;) {
          -
          1941 if (m_cache.status != cache_t::cache_t::status_t::empty) {
          -
          1942 fpos_t end_max = m_cache.region.start + m_cache.capacity;
          -
          1943 if (m_cache.region.start <= m_offset && m_offset < end_max) {
          -
          1944 size_t remaining_cache = static_cast<size_t>(end_max - m_offset);
          -
          1945 if (to_write <= remaining_cache) {
          -
          1946 memcpy(m_cache.data + static_cast<size_t>(m_offset - m_cache.region.start), data, to_write);
          -
          1947 m_offset += to_write;
          -
          1948 m_cache.status = cache_t::cache_t::status_t::dirty;
          -
          1949 m_cache.region.end = std::max(m_cache.region.end, m_offset);
          -
          1950 m_state = state_t::ok;
          -
          1951 return length;
          -
          1952 }
          -
          1953 memcpy(m_cache.data + static_cast<size_t>(m_offset - m_cache.region.start), data, remaining_cache);
          -
          1954 reinterpret_cast<const uint8_t*&>(data) += remaining_cache;
          -
          1955 to_write -= remaining_cache;
          -
          1956 m_offset += remaining_cache;
          -
          1957 m_cache.status = cache_t::cache_t::status_t::dirty;
          -
          1958 m_cache.region.end = end_max;
          -
          1959 }
          -
          1960 flush_cache();
          -
          1961 if (!ok()) _Unlikely_
          -
          1962 return length - to_write;
          -
          1963 }
          -
          1964 {
          -
          1965 fpos_t end_max = m_offset + to_write;
          -
          1966 if (m_offset / m_cache.capacity < end_max / m_cache.capacity) {
          -
          1967 // Write spans multiple cache blocks. Bypass cache to the last block.
          -
          1968 m_source->seek(m_offset);
          -
          1969 if (!ok()) _Unlikely_
          -
          1970 return length - to_write;
          -
          1971 size_t num_written = m_source->write(data, to_write - static_cast<size_t>(end_max % m_cache.capacity));
          -
          1972 m_offset += num_written;
          -
          1973 m_state = m_source->state();
          -
          1974 to_write -= num_written;
          -
          1975 if (!to_write || !ok())
          -
          1976 return length - to_write;
          -
          1977 reinterpret_cast<const uint8_t*&>(data) += num_written;
          -
          1978 }
          -
          1979 }
          -
          1980 load_cache(m_offset);
          -
          1981 if (!ok()) _Unlikely_
          -
          1982 return length - to_write;
          -
          1983 }
          -
          1984 }
          +
          1920
          +
          +
          1921 virtual _Success_(return != 0) size_t write(
          +
          1922 _In_reads_bytes_opt_(length) const void* data, _In_ size_t length)
          +
          1923 {
          +
          1924 _Assume_(data || !length);
          +
          1925#if SET_FILE_OP_TIMES
          +
          1926 m_atime = m_mtime = time_point::now();
          +
          1927#endif
          +
          1928 for (size_t to_write = length;;) {
          +
          1929 if (m_cache.status != cache_t::cache_t::status_t::empty) {
          +
          1930 fpos_t end_max = m_cache.region.start + m_cache.capacity;
          +
          1931 if (m_cache.region.start <= m_offset && m_offset < end_max) {
          +
          1932 size_t remaining_cache = static_cast<size_t>(end_max - m_offset);
          +
          1933 if (to_write <= remaining_cache) {
          +
          1934 memcpy(m_cache.data + static_cast<size_t>(m_offset - m_cache.region.start), data, to_write);
          +
          1935 m_offset += to_write;
          +
          1936 m_cache.status = cache_t::cache_t::status_t::dirty;
          +
          1937 m_cache.region.end = std::max(m_cache.region.end, m_offset);
          +
          1938 m_state = state_t::ok;
          +
          1939 return length;
          +
          1940 }
          +
          1941 memcpy(m_cache.data + static_cast<size_t>(m_offset - m_cache.region.start), data, remaining_cache);
          +
          1942 reinterpret_cast<const uint8_t*&>(data) += remaining_cache;
          +
          1943 to_write -= remaining_cache;
          +
          1944 m_offset += remaining_cache;
          +
          1945 m_cache.status = cache_t::cache_t::status_t::dirty;
          +
          1946 m_cache.region.end = end_max;
          +
          1947 }
          +
          1948 flush_cache();
          +
          1949 if (!ok()) _Unlikely_
          +
          1950 return length - to_write;
          +
          1951 }
          +
          1952 {
          +
          1953 fpos_t end_max = m_offset + to_write;
          +
          1954 if (m_offset / m_cache.capacity < end_max / m_cache.capacity) {
          +
          1955 // Write spans multiple cache blocks. Bypass cache to the last block.
          +
          1956 m_source->seek(m_offset);
          +
          1957 if (!ok()) _Unlikely_
          +
          1958 return length - to_write;
          +
          1959 size_t num_written = m_source->write(data, to_write - static_cast<size_t>(end_max % m_cache.capacity));
          +
          1960 m_offset += num_written;
          +
          1961 m_state = m_source->state();
          +
          1962 to_write -= num_written;
          +
          1963 if (!to_write || !ok())
          +
          1964 return length - to_write;
          +
          1965 reinterpret_cast<const uint8_t*&>(data) += num_written;
          +
          1966 }
          +
          1967 }
          +
          1968 load_cache(m_offset);
          +
          1969 if (!ok()) _Unlikely_
          +
          1970 return length - to_write;
          +
          1971 }
          +
          1972 }
          -
          1985
          -
          -
          1986 virtual void close()
          -
          1987 {
          -
          1988 invalidate_cache();
          +
          1973
          +
          +
          1974 virtual void close()
          +
          1975 {
          +
          1976 invalidate_cache();
          +
          1977 if (!ok()) _Unlikely_
          +
          1978 throw std::system_error(sys_error(), std::system_category(), "failed to flush cache"); // Data loss occured
          +
          1979 m_source->close();
          +
          1980 m_state = m_source->state();
          +
          1981 }
          +
          +
          1982
          +
          +
          1983 virtual void flush()
          +
          1984 {
          +
          1985#if SET_FILE_OP_TIMES
          +
          1986 m_atime = m_mtime = time_point::min();
          +
          1987#endif
          +
          1988 flush_cache();
          1989 if (!ok()) _Unlikely_
          -
          1990 throw std::system_error(sys_error(), std::system_category(), "failed to flush cache"); // Data loss occured
          -
          1991 m_source->close();
          -
          1992 m_state = m_source->state();
          -
          1993 }
          +
          1990 return;
          +
          1991 m_source->flush();
          +
          1992 }
          -
          1994
          -
          -
          1995 virtual void flush()
          -
          1996 {
          -
          1997#if SET_FILE_OP_TIMES
          -
          1998 m_atime = m_mtime = time_point::min();
          -
          1999#endif
          -
          2000 flush_cache();
          -
          2001 if (!ok()) _Unlikely_
          -
          2002 return;
          -
          2003 m_source->flush();
          -
          2004 }
          +
          1993
          +
          +
          1994 virtual fpos_t seek(_In_ foff_t offset, _In_ seek_t how = seek_t::beg)
          +
          1995 {
          +
          1996 m_state = state_t::ok;
          +
          1997 switch (how) {
          +
          1998 case seek_t::beg:
          +
          1999 return m_offset = offset;
          +
          2000 case seek_t::cur:
          +
          2001 return m_offset += offset;
          +
          2002 case seek_t::end: {
          +
          2003 auto n = size();
          +
          2004 if (n == fsize_max) _Unlikely_{
          +
          2005 m_state = state_t::fail;
          +
          2006 return fpos_max;
          +
          2007 }
          +
          2008 return m_offset = n + offset;
          +
          2009 }
          +
          2010 default:
          +
          2011 throw std::invalid_argument("unknown seek origin");
          +
          2012 }
          +
          2013 }
          -
          2005
          -
          -
          2006 virtual fpos_t seek(_In_ foff_t offset, _In_ seek_t how = seek_t::beg)
          -
          2007 {
          -
          2008 m_state = state_t::ok;
          -
          2009 switch (how) {
          -
          2010 case seek_t::beg:
          -
          2011 return m_offset = offset;
          -
          2012 case seek_t::cur:
          -
          2013 return m_offset += offset;
          -
          2014 case seek_t::end: {
          -
          2015 auto n = size();
          -
          2016 if (n == fsize_max) _Unlikely_{
          -
          2017 m_state = state_t::fail;
          -
          2018 return fpos_max;
          -
          2019 }
          -
          2020 return m_offset = n + offset;
          -
          2021 }
          -
          2022 default:
          -
          2023 throw std::invalid_argument("unknown seek origin");
          -
          2024 }
          -
          2025 }
          +
          2014
          +
          +
          2015 virtual fpos_t tell() const
          +
          2016 {
          +
          2017 return m_offset;
          +
          2018 }
          -
          2026
          -
          -
          2027 virtual fpos_t tell() const
          -
          2028 {
          -
          2029 return m_offset;
          +
          2019
          +
          +
          2020 virtual void lock(_In_ fpos_t offset, _In_ fsize_t length)
          +
          2021 {
          +
          2022 m_source->lock(offset, length);
          +
          2023 m_state = m_source->state();
          +
          2024 }
          +
          +
          2025
          +
          +
          2026 virtual void unlock(_In_ fpos_t offset, _In_ fsize_t length)
          +
          2027 {
          +
          2028 m_source->unlock(offset, length);
          +
          2029 m_state = m_source->state();
          2030 }
          2031
          -
          2032 virtual void lock(_In_ fpos_t offset, _In_ fsize_t length)
          -
          2033 {
          -
          2034 m_source->lock(offset, length);
          -
          2035 m_state = m_source->state();
          -
          2036 }
          +
          2032 virtual fsize_t size() const
          +
          2033 {
          +
          2034 return m_cache.status != cache_t::cache_t::status_t::empty ?
          +
          2035 std::max(m_source->size(), m_cache.region.end) :
          +
          2036 m_source->size();
          +
          2037 }
          -
          2037
          -
          -
          2038 virtual void unlock(_In_ fpos_t offset, _In_ fsize_t length)
          -
          2039 {
          -
          2040 m_source->unlock(offset, length);
          -
          2041 m_state = m_source->state();
          -
          2042 }
          +
          2038
          +
          +
          2039 virtual void truncate()
          +
          2040 {
          +
          2041#if SET_FILE_OP_TIMES
          +
          2042 m_atime = m_mtime = time_point::now();
          +
          2043#endif
          +
          2044 m_source->seek(m_offset);
          +
          2045 if (m_cache.region.end <= m_offset) {
          +
          2046 // Truncation does not affect cache.
          +
          2047 }
          +
          2048 else if (m_cache.region.start <= m_offset) {
          +
          2049 // Truncation truncates cache.
          +
          2050 m_cache.region.end = m_offset;
          +
          2051 }
          +
          2052 else {
          +
          2053 // Truncation invalidates cache.
          +
          2054 m_cache.status = cache_t::cache_t::status_t::empty;
          +
          2055 }
          +
          2056 m_source->truncate();
          +
          2057 m_state = m_source->state();
          +
          2058 }
          -
          2043
          -
          -
          2044 virtual fsize_t size() const
          -
          2045 {
          -
          2046 return m_cache.status != cache_t::cache_t::status_t::empty ?
          -
          2047 std::max(m_source->size(), m_cache.region.end) :
          -
          2048 m_source->size();
          -
          2049 }
          +
          2059
          +
          +
          2060 virtual time_point ctime() const
          +
          2061 {
          +
          2062 return m_source->ctime();
          +
          2063 }
          -
          2050
          -
          -
          2051 virtual void truncate()
          -
          2052 {
          -
          2053#if SET_FILE_OP_TIMES
          -
          2054 m_atime = m_mtime = time_point::now();
          -
          2055#endif
          -
          2056 m_source->seek(m_offset);
          -
          2057 if (m_cache.region.end <= m_offset) {
          -
          2058 // Truncation does not affect cache.
          -
          2059 }
          -
          2060 else if (m_cache.region.start <= m_offset) {
          -
          2061 // Truncation truncates cache.
          -
          2062 m_cache.region.end = m_offset;
          -
          2063 }
          -
          2064 else {
          -
          2065 // Truncation invalidates cache.
          -
          2066 m_cache.status = cache_t::cache_t::status_t::empty;
          -
          2067 }
          -
          2068 m_source->truncate();
          -
          2069 m_state = m_source->state();
          -
          2070 }
          +
          2064
          +
          +
          2065 virtual time_point atime() const
          +
          2066 {
          +
          2067#if SET_FILE_OP_TIMES
          +
          2068 return std::max(m_atime, m_source->atime());
          +
          2069#else
          +
          2070 return m_source->atime();
          +
          2071#endif
          +
          2072 }
          -
          2071
          -
          -
          2072 virtual time_point ctime() const
          -
          2073 {
          -
          2074 return m_source->ctime();
          -
          2075 }
          +
          2073
          +
          +
          2074 virtual time_point mtime() const
          +
          2075 {
          +
          2076#if SET_FILE_OP_TIMES
          +
          2077 return std::max(m_mtime, m_source->mtime());
          +
          2078#else
          +
          2079 return m_source->mtime();
          +
          2080#endif
          +
          2081 }
          -
          2076
          -
          -
          2077 virtual time_point atime() const
          -
          2078 {
          -
          2079#if SET_FILE_OP_TIMES
          -
          2080 return std::max(m_atime, m_source->atime());
          -
          2081#else
          -
          2082 return m_source->atime();
          -
          2083#endif
          -
          2084 }
          +
          2082
          +
          +
          2083 virtual void set_ctime(time_point date)
          +
          2084 {
          +
          2085 m_source->set_ctime(date);
          +
          2086 }
          -
          2085
          -
          -
          2086 virtual time_point mtime() const
          -
          2087 {
          -
          2088#if SET_FILE_OP_TIMES
          -
          2089 return std::max(m_mtime, m_source->mtime());
          -
          2090#else
          -
          2091 return m_source->mtime();
          +
          2087
          +
          +
          2088 virtual void set_atime(time_point date)
          +
          2089 {
          +
          2090#if SET_FILE_OP_TIMES
          +
          2091 m_atime = date;
          2092#endif
          -
          2093 }
          +
          2093 m_source->set_atime(date);
          +
          2094 }
          -
          2094
          -
          -
          2095 virtual void set_ctime(time_point date)
          -
          2096 {
          -
          2097 m_source->set_ctime(date);
          -
          2098 }
          +
          2095
          +
          +
          2096 virtual void set_mtime(time_point date)
          +
          2097 {
          +
          2098#if SET_FILE_OP_TIMES
          +
          2099 m_mtime = date;
          +
          2100#endif
          +
          2101 m_source->set_mtime(date);
          +
          2102 }
          -
          2099
          -
          -
          2100 virtual void set_atime(time_point date)
          -
          2101 {
          -
          2102#if SET_FILE_OP_TIMES
          -
          2103 m_atime = date;
          -
          2104#endif
          -
          2105 m_source->set_atime(date);
          -
          2106 }
          -
          -
          2107
          -
          -
          2108 virtual void set_mtime(time_point date)
          -
          2109 {
          -
          2110#if SET_FILE_OP_TIMES
          -
          2111 m_mtime = date;
          -
          2112#endif
          -
          2113 m_source->set_mtime(date);
          -
          2114 }
          -
          -
          2115
          -
          2116 protected:
          -
          2118 void flush_cache()
          -
          2119 {
          -
          2120 if (m_cache.status != cache_t::cache_t::status_t::dirty)
          -
          2121 m_state = state_t::ok;
          -
          2122 else if (!m_cache.region.empty()) {
          -
          2123 write_cache();
          -
          2124 if (ok())
          -
          2125 m_cache.status = cache_t::cache_t::status_t::loaded;
          -
          2126 }
          -
          2127 else {
          +
          2103
          +
          2104 protected:
          +
          2106 void flush_cache()
          +
          2107 {
          +
          2108 if (m_cache.status != cache_t::cache_t::status_t::dirty)
          +
          2109 m_state = state_t::ok;
          +
          2110 else if (!m_cache.region.empty()) {
          +
          2111 write_cache();
          +
          2112 if (ok())
          +
          2113 m_cache.status = cache_t::cache_t::status_t::loaded;
          +
          2114 }
          +
          2115 else {
          +
          2116 m_state = state_t::ok;
          +
          2117 m_cache.status = cache_t::cache_t::status_t::loaded;
          +
          2118 }
          +
          2119 }
          +
          2120
          +
          2121 void invalidate_cache()
          +
          2122 {
          +
          2123 if (m_cache.status == cache_t::cache_t::status_t::dirty && !m_cache.region.empty()) {
          +
          2124 write_cache();
          +
          2125 if (!ok()) _Unlikely_
          +
          2126 return;
          +
          2127 } else
          2128 m_state = state_t::ok;
          -
          2129 m_cache.status = cache_t::cache_t::status_t::loaded;
          -
          2130 }
          -
          2131 }
          -
          2132
          -
          2133 void invalidate_cache()
          -
          2134 {
          -
          2135 if (m_cache.status == cache_t::cache_t::status_t::dirty && !m_cache.region.empty()) {
          -
          2136 write_cache();
          -
          2137 if (!ok()) _Unlikely_
          -
          2138 return;
          -
          2139 } else
          -
          2140 m_state = state_t::ok;
          -
          2141 m_cache.status = cache_t::cache_t::status_t::empty;
          -
          2142 }
          -
          2143
          -
          2144 void load_cache(_In_ fpos_t start)
          -
          2145 {
          -
          2146 _Assume_(m_cache.status != cache_t::cache_t::status_t::dirty);
          -
          2147 start -= start % m_cache.capacity; // Align to cache block size.
          -
          2148 m_source->seek(m_cache.region.start = start);
          -
          2149 if (m_source->ok()) {
          -
          2150 m_cache.region.end = start + m_source->read(m_cache.data, m_cache.capacity);
          -
          2151 m_cache.status = cache_t::cache_t::status_t::loaded;
          -
          2152 m_state = state_t::ok; // Regardless the read failure, we still might have cached some data.
          -
          2153 }
          -
          2154 else
          -
          2155 m_state = state_t::fail;
          -
          2156 }
          -
          2157
          -
          2158 void write_cache()
          -
          2159 {
          -
          2160 _Assume_(m_cache.status == cache_t::cache_t::status_t::dirty);
          -
          2161 m_source->seek(m_cache.region.start);
          -
          2162 m_source->write(m_cache.data, static_cast<size_t>(m_cache.region.size()));
          -
          2163 m_state = m_source->state();
          -
          2164 }
          -
          2165
          -
          2166 basic_file* m_source;
          -
          2167 struct cache_t {
          -
          2168 uint8_t* data;
          -
          2169 size_t capacity;
          -
          2170 enum class status_t {
          -
          2171 empty = 0,
          -
          2172 loaded,
          -
          2173 dirty,
          -
          2174 } status;
          -
          2175 interval<fpos_t> region;
          -
          2176
          -
          2177 cache_t(_In_ size_t _capacity) :
          -
          2178 data(new uint8_t[_capacity]),
          -
          2179 capacity(_capacity),
          -
          2180 status(status_t::empty),
          -
          2181 region(0)
          -
          2182 {}
          -
          2183
          -
          2184 ~cache_t()
          -
          2185 {
          -
          2186 delete[] data;
          -
          2187 }
          -
          2188 } m_cache;
          -
          2189 fpos_t m_offset;
          -
          2190#if SET_FILE_OP_TIMES
          -
          2191 time_point
          -
          2192 m_atime,
          -
          2193 m_mtime;
          -
          2194#endif
          -
          2196 };
          +
          2129 m_cache.status = cache_t::cache_t::status_t::empty;
          +
          2130 }
          +
          2131
          +
          2132 void load_cache(_In_ fpos_t start)
          +
          2133 {
          +
          2134 _Assume_(m_cache.status != cache_t::cache_t::status_t::dirty);
          +
          2135 start -= start % m_cache.capacity; // Align to cache block size.
          +
          2136 m_source->seek(m_cache.region.start = start);
          +
          2137 if (m_source->ok()) {
          +
          2138 m_cache.region.end = start + m_source->read(m_cache.data, m_cache.capacity);
          +
          2139 m_cache.status = cache_t::cache_t::status_t::loaded;
          +
          2140 m_state = state_t::ok; // Regardless the read failure, we still might have cached some data.
          +
          2141 }
          +
          2142 else
          +
          2143 m_state = state_t::fail;
          +
          2144 }
          +
          2145
          +
          2146 void write_cache()
          +
          2147 {
          +
          2148 _Assume_(m_cache.status == cache_t::cache_t::status_t::dirty);
          +
          2149 m_source->seek(m_cache.region.start);
          +
          2150 m_source->write(m_cache.data, static_cast<size_t>(m_cache.region.size()));
          +
          2151 m_state = m_source->state();
          +
          2152 }
          +
          2153
          +
          2154 basic_file* m_source;
          +
          2155 struct cache_t {
          +
          2156 uint8_t* data;
          +
          2157 size_t capacity;
          +
          2158 enum class status_t {
          +
          2159 empty = 0,
          +
          2160 loaded,
          +
          2161 dirty,
          +
          2162 } status;
          +
          2163 interval<fpos_t> region;
          +
          2164
          +
          2165 cache_t(_In_ size_t _capacity) :
          +
          2166 data(new uint8_t[_capacity]),
          +
          2167 capacity(_capacity),
          +
          2168 status(status_t::empty),
          +
          2169 region(0)
          +
          2170 {}
          +
          2171
          +
          2172 ~cache_t()
          +
          2173 {
          +
          2174 delete[] data;
          +
          2175 }
          +
          2176 } m_cache;
          +
          2177 fpos_t m_offset;
          +
          2178#if SET_FILE_OP_TIMES
          +
          2179 time_point
          +
          2180 m_atime,
          +
          2181 m_mtime;
          +
          2182#endif
          +
          2184 };
          -
          2197
          -
          -
          2201 class basic_sys : virtual public basic, public sys_object
          -
          2202 {
          -
          2203 public:
          -
          2204 basic_sys(_In_opt_ sys_handle h = invalid_handle, _In_ state_t state = state_t::ok) :
          -
          2205 basic(state),
          -
          2206 sys_object(h)
          -
          2207 {}
          -
          2208
          -
          -
          2209 virtual _Success_(return != 0 || length == 0) size_t read(
          -
          2210 _Out_writes_bytes_to_opt_(length, return) void* data, _In_ size_t length)
          -
          2211 {
          -
          2212 _Assume_(data || !length);
          -
          2213 // Windows Server 2003 and Windows XP: Pipe write operations across a network are limited in size per write.
          -
          2214 // The amount varies per platform. For x86 platforms it's 63.97 MB. For x64 platforms it's 31.97 MB. For Itanium
          -
          2215 // it's 63.95 MB. For more information regarding pipes, see the Remarks section.
          -
          2216 size_t
          -
          2217#if defined(_WIN64)
          -
          2218 block_size = 0x1F80000;
          -
          2219#elif defined(_WIN32)
          -
          2220 block_size = 0x3f00000;
          -
          2221#else
          -
          2222 block_size = SSIZE_MAX;
          -
          2223#endif
          -
          2224 for (size_t to_read = length;;) {
          -
          2225#ifdef _WIN32
          -
          2226 // ReadFile() might raise exception (e.g. STATUS_FILE_BAD_FORMAT/0xE0000002).
          -
          2227 BOOL succeeded;
          -
          2228 DWORD num_read;
          -
          2229 __try { succeeded = ReadFile(m_h, data, static_cast<DWORD>(std::min<size_t>(to_read, block_size)), &num_read, nullptr); }
          -
          2230 __except (EXCEPTION_EXECUTE_HANDLER) { succeeded = FALSE; SetLastError(ERROR_UNHANDLED_EXCEPTION); num_read = 0; }
          -
          2231 if (!succeeded && GetLastError() == ERROR_NO_SYSTEM_RESOURCES && block_size > default_block_size) _Unlikely_ {
          -
          2232 // Error "Insufficient system resources exist to complete the requested service." occurs
          -
          2233 // ocasionally, when attempting to read too much data at once (e.g. over \\TSClient).
          -
          2234 block_size = default_block_size;
          -
          2235 continue;
          -
          2236 }
          -
          2237 if (!succeeded) _Unlikely_
          -
          2238#else
          -
          2239 ssize_t num_read = ::read(m_h, data, static_cast<ssize_t>(std::min<size_t>(to_read, block_size)));
          -
          2240 if (num_read < 0) _Unlikely_
          -
          2241#endif
          -
          2242 {
          -
          2243 m_state = to_read < length ? state_t::ok : state_t::fail;
          -
          2244 return length - to_read;
          -
          2245 }
          -
          2246 if (!num_read) _Unlikely_ {
          -
          2247 m_state = to_read < length || !length ? state_t::ok : state_t::eof;
          -
          2248 return length - to_read;
          -
          2249 }
          -
          2250 to_read -= num_read;
          -
          2251 if (!to_read) {
          -
          2252 m_state = state_t::ok;
          -
          2253 return length;
          -
          2254 }
          -
          2255 reinterpret_cast<uint8_t*&>(data) += num_read;
          -
          2256 }
          -
          2257 }
          +
          2185
          +
          +
          2189 class basic_sys : virtual public basic, public sys_object
          +
          2190 {
          +
          2191 public:
          +
          2192 basic_sys(_In_opt_ sys_handle h = invalid_handle, _In_ state_t state = state_t::ok) :
          +
          2193 basic(state),
          +
          2194 sys_object(h)
          +
          2195 {}
          +
          2196
          +
          +
          2197 virtual _Success_(return != 0 || length == 0) size_t read(
          +
          2198 _Out_writes_bytes_to_opt_(length, return) void* data, _In_ size_t length)
          +
          2199 {
          +
          2200 _Assume_(data || !length);
          +
          2201 // Windows Server 2003 and Windows XP: Pipe write operations across a network are limited in size per write.
          +
          2202 // The amount varies per platform. For x86 platforms it's 63.97 MB. For x64 platforms it's 31.97 MB. For Itanium
          +
          2203 // it's 63.95 MB. For more information regarding pipes, see the Remarks section.
          +
          2204 size_t
          +
          2205#if defined(_WIN64)
          +
          2206 block_size = 0x1F80000;
          +
          2207#elif defined(_WIN32)
          +
          2208 block_size = 0x3f00000;
          +
          2209#else
          +
          2210 block_size = SSIZE_MAX;
          +
          2211#endif
          +
          2212 for (size_t to_read = length;;) {
          +
          2213#ifdef _WIN32
          +
          2214 // ReadFile() might raise exception (e.g. STATUS_FILE_BAD_FORMAT/0xE0000002).
          +
          2215 BOOL succeeded;
          +
          2216 DWORD num_read;
          +
          2217 __try { succeeded = ReadFile(m_h, data, static_cast<DWORD>(std::min<size_t>(to_read, block_size)), &num_read, nullptr); }
          +
          2218 __except (EXCEPTION_EXECUTE_HANDLER) { succeeded = FALSE; SetLastError(ERROR_UNHANDLED_EXCEPTION); num_read = 0; }
          +
          2219 if (!succeeded && GetLastError() == ERROR_NO_SYSTEM_RESOURCES && block_size > default_block_size) _Unlikely_ {
          +
          2220 // Error "Insufficient system resources exist to complete the requested service." occurs
          +
          2221 // ocasionally, when attempting to read too much data at once (e.g. over \\TSClient).
          +
          2222 block_size = default_block_size;
          +
          2223 continue;
          +
          2224 }
          +
          2225 if (!succeeded) _Unlikely_
          +
          2226#else
          +
          2227 ssize_t num_read = ::read(m_h, data, static_cast<ssize_t>(std::min<size_t>(to_read, block_size)));
          +
          2228 if (num_read < 0) _Unlikely_
          +
          2229#endif
          +
          2230 {
          +
          2231 m_state = to_read < length ? state_t::ok : state_t::fail;
          +
          2232 return length - to_read;
          +
          2233 }
          +
          2234 if (!num_read) _Unlikely_ {
          +
          2235 m_state = to_read < length || !length ? state_t::ok : state_t::eof;
          +
          2236 return length - to_read;
          +
          2237 }
          +
          2238 to_read -= num_read;
          +
          2239 if (!to_read) {
          +
          2240 m_state = state_t::ok;
          +
          2241 return length;
          +
          2242 }
          +
          2243 reinterpret_cast<uint8_t*&>(data) += num_read;
          +
          2244 }
          +
          2245 }
          -
          2258
          -
          -
          2259 virtual _Success_(return != 0) size_t write(
          -
          2260 _In_reads_bytes_opt_(length) const void* data, _In_ size_t length)
          -
          2261 {
          -
          2262 // Windows Server 2003 and Windows XP: Pipe write operations across a network are limited in size per write.
          -
          2263 // The amount varies per platform. For x86 platforms it's 63.97 MB. For x64 platforms it's 31.97 MB. For Itanium
          -
          2264 // it's 63.95 MB. For more information regarding pipes, see the Remarks section.
          -
          2265 constexpr size_t
          -
          2266#if defined(_WIN64)
          -
          2267 block_size = 0x1F80000;
          -
          2268#elif defined(_WIN32)
          -
          2269 block_size = 0x3f00000;
          -
          2270#else
          -
          2271 block_size = SSIZE_MAX;
          -
          2272#endif
          -
          2273 for (size_t to_write = length;;) {
          -
          2274#ifdef _WIN32
          -
          2275 // ReadFile() might raise an exception. Be cautious with WriteFile() too.
          -
          2276 BOOL succeeded;
          -
          2277 DWORD num_written;
          -
          2278 __try { succeeded = WriteFile(m_h, data, static_cast<DWORD>(std::min<size_t>(to_write, block_size)), &num_written, nullptr); }
          -
          2279 __except (EXCEPTION_EXECUTE_HANDLER) { succeeded = FALSE; SetLastError(ERROR_UNHANDLED_EXCEPTION); num_written = 0; }
          -
          2280 to_write -= num_written;
          -
          2281 if (!to_write) {
          -
          2282 m_state = state_t::ok;
          -
          2283 return length;
          -
          2284 }
          -
          2285 reinterpret_cast<const uint8_t*&>(data) += num_written;
          -
          2286 if (!succeeded) _Unlikely_ {
          -
          2287 m_state = state_t::fail;
          -
          2288 return length - to_write;
          -
          2289 }
          -
          2290#else
          -
          2291 ssize_t num_written = ::write(m_h, data, static_cast<ssize_t>(std::min<size_t>(to_write, block_size)));
          -
          2292 if (num_written < 0) _Unlikely_ {
          -
          2293 m_state = state_t::fail;
          -
          2294 return length - to_write;
          -
          2295 }
          -
          2296 to_write -= num_written;
          -
          2297 if (!to_write) {
          -
          2298 m_state = state_t::ok;
          -
          2299 return length;
          -
          2300 }
          -
          2301 reinterpret_cast<const uint8_t*&>(data) += num_written;
          -
          2302#endif
          -
          2303 }
          -
          2304 }
          +
          2246
          +
          +
          2247 virtual _Success_(return != 0) size_t write(
          +
          2248 _In_reads_bytes_opt_(length) const void* data, _In_ size_t length)
          +
          2249 {
          +
          2250 // Windows Server 2003 and Windows XP: Pipe write operations across a network are limited in size per write.
          +
          2251 // The amount varies per platform. For x86 platforms it's 63.97 MB. For x64 platforms it's 31.97 MB. For Itanium
          +
          2252 // it's 63.95 MB. For more information regarding pipes, see the Remarks section.
          +
          2253 constexpr size_t
          +
          2254#if defined(_WIN64)
          +
          2255 block_size = 0x1F80000;
          +
          2256#elif defined(_WIN32)
          +
          2257 block_size = 0x3f00000;
          +
          2258#else
          +
          2259 block_size = SSIZE_MAX;
          +
          2260#endif
          +
          2261 for (size_t to_write = length;;) {
          +
          2262#ifdef _WIN32
          +
          2263 // ReadFile() might raise an exception. Be cautious with WriteFile() too.
          +
          2264 BOOL succeeded;
          +
          2265 DWORD num_written;
          +
          2266 __try { succeeded = WriteFile(m_h, data, static_cast<DWORD>(std::min<size_t>(to_write, block_size)), &num_written, nullptr); }
          +
          2267 __except (EXCEPTION_EXECUTE_HANDLER) { succeeded = FALSE; SetLastError(ERROR_UNHANDLED_EXCEPTION); num_written = 0; }
          +
          2268 to_write -= num_written;
          +
          2269 if (!to_write) {
          +
          2270 m_state = state_t::ok;
          +
          2271 return length;
          +
          2272 }
          +
          2273 reinterpret_cast<const uint8_t*&>(data) += num_written;
          +
          2274 if (!succeeded) _Unlikely_ {
          +
          2275 m_state = state_t::fail;
          +
          2276 return length - to_write;
          +
          2277 }
          +
          2278#else
          +
          2279 ssize_t num_written = ::write(m_h, data, static_cast<ssize_t>(std::min<size_t>(to_write, block_size)));
          +
          2280 if (num_written < 0) _Unlikely_ {
          +
          2281 m_state = state_t::fail;
          +
          2282 return length - to_write;
          +
          2283 }
          +
          2284 to_write -= num_written;
          +
          2285 if (!to_write) {
          +
          2286 m_state = state_t::ok;
          +
          2287 return length;
          +
          2288 }
          +
          2289 reinterpret_cast<const uint8_t*&>(data) += num_written;
          +
          2290#endif
          +
          2291 }
          +
          2292 }
          -
          2305
          -
          -
          2306 virtual void close()
          -
          2307 {
          -
          2308 try {
          - -
          2310 m_state = state_t::ok;
          -
          2311 }
          -
          2312 catch (...) {
          -
          2313 m_state = state_t::fail;
          -
          2314 }
          -
          2315 }
          +
          2293
          +
          +
          2294 virtual void close()
          +
          2295 {
          +
          2296 try {
          + +
          2298 m_state = state_t::ok;
          +
          2299 }
          +
          2300 catch (...) {
          +
          2301 m_state = state_t::fail;
          +
          2302 }
          +
          2303 }
          -
          2316
          -
          -
          2317 virtual void flush()
          -
          2318 {
          -
          2319#ifdef _WIN32
          -
          2320 m_state = FlushFileBuffers(m_h) ? state_t::ok : state_t::fail;
          -
          2321#else
          -
          2322 m_state = fsync(m_h) >= 0 ? state_t::ok : state_t::fail;
          -
          2323#endif
          -
          2324 }
          +
          2304
          +
          +
          2305 virtual void flush()
          +
          2306 {
          +
          2307#ifdef _WIN32
          +
          2308 m_state = FlushFileBuffers(m_h) ? state_t::ok : state_t::fail;
          +
          2309#else
          +
          2310 m_state = fsync(m_h) >= 0 ? state_t::ok : state_t::fail;
          +
          2311#endif
          +
          2312 }
          -
          2325 };
          +
          2313 };
          -
          2326
          -
          -
          2330 class buffered_sys : public buffer
          -
          2331 {
          -
          2332 public:
          -
          2333 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) :
          -
          2334 buffer(read_buffer_size, write_buffer_size),
          -
          2335 m_source(h)
          -
          2336 {
          -
          2337 init(m_source);
          -
          2338 }
          -
          2339
          -
          2340 virtual ~buffered_sys()
          -
          2341 {
          -
          2342 done();
          -
          2343 }
          -
          2344
          -
          2345 protected:
          -
          2346 basic_sys m_source;
          -
          2347 };
          +
          2314
          +
          +
          2318 class buffered_sys : public buffer
          +
          2319 {
          +
          2320 public:
          +
          2321 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) :
          +
          2322 buffer(read_buffer_size, write_buffer_size),
          +
          2323 m_source(h)
          +
          2324 {
          +
          2325 init(m_source);
          +
          2326 }
          +
          2327
          +
          2328 virtual ~buffered_sys()
          +
          2329 {
          +
          2330 done();
          +
          2331 }
          +
          2332
          +
          2333 protected:
          +
          2334 basic_sys m_source;
          +
          2335 };
          -
          2348
          -
          -
          2352 class socket : public basic
          -
          2353 {
          -
          2354 public:
          -
          2355 socket(_In_opt_ socket_t h = invalid_socket, _In_ state_t state = state_t::ok) :
          -
          2356 basic(state),
          -
          2357 m_h(h)
          -
          2358 {}
          -
          2359
          -
          2360 private:
          -
          2361 socket(_In_ const socket& other);
          -
          2362 socket& operator =(_In_ const socket& other);
          -
          2363
          -
          2364 public:
          -
          2365 socket(_Inout_ socket&& other) noexcept : m_h(other.m_h)
          -
          2366 {
          -
          2367 other.m_h = invalid_socket;
          -
          2368 }
          -
          2369
          -
          2370 socket& operator =(_Inout_ socket&& other) noexcept
          -
          2371 {
          -
          2372 if (this != std::addressof(other)) {
          -
          2373 if (m_h != invalid_socket)
          -
          2374 closesocket(m_h);
          -
          2375 m_h = other.m_h;
          -
          2376 other.m_h = invalid_socket;
          -
          2377 }
          -
          2378 return *this;
          -
          2379 }
          -
          2380
          -
          -
          2388 socket(_In_ int af, _In_ int type, _In_ int protocol)
          -
          2389 {
          -
          2390 m_h = ::socket(af, type, protocol);
          -
          2391 if (m_h == invalid_socket) _Unlikely_
          -
          2392 m_state = state_t::fail;
          -
          2393 }
          +
          2336
          +
          +
          2340 class socket : public basic
          +
          2341 {
          +
          2342 public:
          +
          2343 socket(_In_opt_ socket_t h = invalid_socket, _In_ state_t state = state_t::ok) :
          +
          2344 basic(state),
          +
          2345 m_h(h)
          +
          2346 {}
          +
          2347
          +
          2348 private:
          +
          2349 socket(_In_ const socket& other);
          +
          2350 socket& operator =(_In_ const socket& other);
          +
          2351
          +
          2352 public:
          +
          2353 socket(_Inout_ socket&& other) noexcept : m_h(other.m_h)
          +
          2354 {
          +
          2355 other.m_h = invalid_socket;
          +
          2356 }
          +
          2357
          +
          2358 socket& operator =(_Inout_ socket&& other) noexcept
          +
          2359 {
          +
          2360 if (this != std::addressof(other)) {
          +
          2361 if (m_h != invalid_socket)
          +
          2362 closesocket(m_h);
          +
          2363 m_h = other.m_h;
          +
          2364 other.m_h = invalid_socket;
          +
          2365 }
          +
          2366 return *this;
          +
          2367 }
          +
          2368
          +
          +
          2376 socket(_In_ int af, _In_ int type, _In_ int protocol)
          +
          2377 {
          +
          2378 m_h = ::socket(af, type, protocol);
          +
          2379 if (m_h == invalid_socket) _Unlikely_
          +
          2380 m_state = state_t::fail;
          +
          2381 }
          -
          2394
          -
          2395 virtual ~socket()
          -
          2396 {
          -
          2397 if (m_h != invalid_socket)
          -
          2398 closesocket(m_h);
          -
          2399 }
          -
          2400
          -
          2404 inline operator bool() const noexcept { return m_h != invalid_socket; }
          -
          2405
          -
          2409 inline socket_t get() const noexcept { return m_h; }
          -
          2410
          -
          -
          2411 virtual _Success_(return != 0 || length == 0) size_t read(
          -
          2412 _Out_writes_bytes_to_opt_(length, return) void* data, _In_ size_t length)
          -
          2413 {
          -
          2414 _Assume_(data || !length);
          -
          2415 constexpr int block_size = 0x10000000;
          -
          2416 for (size_t to_read = length;;) {
          -
          2417 int num_read = recv(m_h, reinterpret_cast<char*>(data), static_cast<int>(std::min<size_t>(to_read, block_size)), 0);
          -
          2418 if (num_read == SOCKET_ERROR) _Unlikely_ {
          -
          2419 m_state = to_read < length ? state_t::ok : state_t::fail;
          -
          2420 return length - to_read;
          -
          2421 }
          -
          2422 if (!num_read) {
          -
          2423 m_state = to_read < length || !length ? state_t::ok : state_t::eof;
          -
          2424 return length - to_read;
          -
          2425 }
          -
          2426 to_read -= num_read;
          -
          2427 if (!to_read) {
          -
          2428 m_state = state_t::ok;
          -
          2429 return length;
          -
          2430 }
          -
          2431 reinterpret_cast<uint8_t*&>(data) += num_read;
          -
          2432 }
          -
          2433 }
          +
          2382
          +
          2383 virtual ~socket()
          +
          2384 {
          +
          2385 if (m_h != invalid_socket)
          +
          2386 closesocket(m_h);
          +
          2387 }
          +
          2388
          +
          2392 inline operator bool() const noexcept { return m_h != invalid_socket; }
          +
          2393
          +
          2397 inline socket_t get() const noexcept { return m_h; }
          +
          2398
          +
          +
          2399 virtual _Success_(return != 0 || length == 0) size_t read(
          +
          2400 _Out_writes_bytes_to_opt_(length, return) void* data, _In_ size_t length)
          +
          2401 {
          +
          2402 _Assume_(data || !length);
          +
          2403 constexpr int block_size = 0x10000000;
          +
          2404 for (size_t to_read = length;;) {
          +
          2405 int num_read = recv(m_h, reinterpret_cast<char*>(data), static_cast<int>(std::min<size_t>(to_read, block_size)), 0);
          +
          2406 if (num_read == SOCKET_ERROR) _Unlikely_ {
          +
          2407 m_state = to_read < length ? state_t::ok : state_t::fail;
          +
          2408 return length - to_read;
          +
          2409 }
          +
          2410 if (!num_read) {
          +
          2411 m_state = to_read < length || !length ? state_t::ok : state_t::eof;
          +
          2412 return length - to_read;
          +
          2413 }
          +
          2414 to_read -= num_read;
          +
          2415 if (!to_read) {
          +
          2416 m_state = state_t::ok;
          +
          2417 return length;
          +
          2418 }
          +
          2419 reinterpret_cast<uint8_t*&>(data) += num_read;
          +
          2420 }
          +
          2421 }
          -
          2434
          -
          -
          2435 virtual _Success_(return != 0) size_t write(
          -
          2436 _In_reads_bytes_opt_(length) const void* data, _In_ size_t length)
          -
          2437 {
          -
          2438 _Assume_(data || !length);
          -
          2439 constexpr int block_size = 0x10000000;
          -
          2440 for (size_t to_write = length;;) {
          -
          2441 int num_written = send(m_h, reinterpret_cast<const char*>(data), static_cast<int>(std::min<size_t>(to_write, block_size)), 0);
          -
          2442 if (num_written == SOCKET_ERROR) _Unlikely_ {
          -
          2443 m_state = state_t::fail;
          -
          2444 return length - to_write;
          -
          2445 }
          -
          2446 to_write -= num_written;
          -
          2447 if (!to_write) {
          -
          2448 m_state = state_t::ok;
          -
          2449 return length;
          -
          2450 }
          -
          2451 reinterpret_cast<const uint8_t*&>(data) += num_written;
          -
          2452 }
          -
          2453 }
          +
          2422
          +
          +
          2423 virtual _Success_(return != 0) size_t write(
          +
          2424 _In_reads_bytes_opt_(length) const void* data, _In_ size_t length)
          +
          2425 {
          +
          2426 _Assume_(data || !length);
          +
          2427 constexpr int block_size = 0x10000000;
          +
          2428 for (size_t to_write = length;;) {
          +
          2429 int num_written = send(m_h, reinterpret_cast<const char*>(data), static_cast<int>(std::min<size_t>(to_write, block_size)), 0);
          +
          2430 if (num_written == SOCKET_ERROR) _Unlikely_ {
          +
          2431 m_state = state_t::fail;
          +
          2432 return length - to_write;
          +
          2433 }
          +
          2434 to_write -= num_written;
          +
          2435 if (!to_write) {
          +
          2436 m_state = state_t::ok;
          +
          2437 return length;
          +
          2438 }
          +
          2439 reinterpret_cast<const uint8_t*&>(data) += num_written;
          +
          2440 }
          +
          2441 }
          -
          2454
          -
          -
          2455 virtual void close()
          -
          2456 {
          -
          2457 if (m_h != invalid_socket) {
          -
          2458 closesocket(m_h);
          -
          2459 m_h = invalid_socket;
          -
          2460 }
          -
          2461 m_state = state_t::ok;
          -
          2462 }
          +
          2442
          +
          +
          2443 virtual void close()
          +
          2444 {
          +
          2445 if (m_h != invalid_socket) {
          +
          2446 closesocket(m_h);
          +
          2447 m_h = invalid_socket;
          +
          2448 }
          +
          2449 m_state = state_t::ok;
          +
          2450 }
          -
          2463
          -
          2464 protected:
          -
          2465 socket_t m_h;
          -
          2466 };
          +
          2451
          +
          2452 protected:
          +
          2453 socket_t m_h;
          +
          2454 };
          +
          2455
          +
          2456#ifdef _WIN32
          +
          2460 class sequential_stream : public basic
          +
          2461 {
          +
          2462 public:
          +
          2463 sequential_stream(_In_ ISequentialStream* source) : m_source(source)
          +
          2464 {
          +
          2465 m_source->AddRef();
          +
          2466 }
          2467
          -
          2468#ifdef _WIN32
          -
          2472 class sequential_stream : public basic
          -
          2473 {
          -
          2474 public:
          -
          2475 sequential_stream(_In_ ISequentialStream* source) : m_source(source)
          -
          2476 {
          -
          2477 m_source->AddRef();
          -
          2478 }
          -
          2479
          -
          2480 virtual ~sequential_stream()
          -
          2481 {
          -
          2482 m_source->Release();
          -
          2483 }
          -
          2484
          -
          2485 virtual _Success_(return != 0 || length == 0) size_t read(
          -
          2486 _Out_writes_bytes_to_opt_(length, return) void* data, _In_ size_t length)
          -
          2487 {
          -
          2488 _Assume_(data || !length);
          -
          2489 for (size_t to_read = length;;) {
          -
          2490 HRESULT hr;
          -
          2491 ULONG num_read = 0;
          -
          2492 __try { hr = m_source->Read(data, (ULONG)std::min<size_t>(to_read, ULONG_MAX), &num_read); }
          -
          2493 __except (EXCEPTION_EXECUTE_HANDLER) { hr = E_FAIL; }
          -
          2494 if (FAILED(hr)) _Unlikely_ {
          -
          2495 m_state = to_read < length ? state_t::ok : state_t::fail;
          -
          2496 return length - to_read;
          -
          2497 }
          -
          2498 to_read -= num_read;
          -
          2499 if (hr == S_FALSE) _Unlikely_ {
          -
          2500 m_state = to_read < length || !length ? state_t::ok : state_t::eof;
          -
          2501 return length - to_read;
          -
          2502 }
          -
          2503 if (!to_read) {
          -
          2504 m_state = state_t::ok;
          -
          2505 return length;
          -
          2506 }
          -
          2507 reinterpret_cast<uint8_t*&>(data) += num_read;
          -
          2508 }
          -
          2509 }
          -
          2510
          -
          2511 virtual _Success_(return != 0) size_t write(
          -
          2512 _In_reads_bytes_opt_(length) const void* data, _In_ size_t length)
          -
          2513 {
          -
          2514 _Assume_(data || !length);
          -
          2515 for (size_t to_write = length;;) {
          -
          2516 HRESULT hr;
          -
          2517 ULONG num_written = 0;
          -
          2518 __try { hr = m_source->Write(data, static_cast<ULONG>(std::min<size_t>(to_write, ULONG_MAX)), &num_written); }
          -
          2519 __except (EXCEPTION_EXECUTE_HANDLER) { hr = E_FAIL; }
          -
          2520 // In abscence of documentation whether num_written gets set when FAILED(hr) (i.e. partially succesful writes),
          -
          2521 // assume write failed completely.
          -
          2522 if (FAILED(hr)) _Unlikely_ {
          -
          2523 m_state = state_t::fail;
          -
          2524 return length - to_write;
          -
          2525 }
          -
          2526 to_write -= num_written;
          -
          2527 if (!to_write) {
          -
          2528 m_state = state_t::ok;
          -
          2529 return length;
          -
          2530 }
          -
          2531 reinterpret_cast<const uint8_t*&>(data) += num_written;
          -
          2532 }
          -
          2533 }
          -
          2534
          -
          2535 protected:
          -
          2536 ISequentialStream* m_source;
          -
          2537 };
          -
          2538
          -
          2542 class asp : public basic
          -
          2543 {
          -
          2544 public:
          -
          2545 asp(_In_opt_ IRequest* request, _In_opt_ IResponse* response) :
          -
          2546 m_request(request),
          -
          2547 m_response(response)
          -
          2548 {
          -
          2549 if (m_request)
          -
          2550 m_request->AddRef();
          -
          2551 if (m_response)
          -
          2552 m_response->AddRef();
          -
          2553 }
          -
          2554
          -
          2555 virtual ~asp()
          -
          2556 {
          -
          2557 if (m_request)
          -
          2558 m_request->Release();
          -
          2559 if (m_response)
          -
          2560 m_response->Release();
          -
          2561 }
          -
          2562
          -
          2563 virtual _Success_(return != 0 || length == 0) size_t read(
          -
          2564 _Out_writes_bytes_to_opt_(length, return) void* data, _In_ size_t length)
          -
          2565 {
          -
          2566 _Assume_(data || !length);
          -
          2567 if (!m_request) _Unlikely_ {
          -
          2568 m_state = state_t::fail;
          -
          2569 return 0;
          -
          2570 }
          -
          2571 for (size_t to_read = length;;) {
          -
          2572 VARIANT var_amount, var_data;
          -
          2573 V_VT(&var_amount) = VT_I4;
          -
          2574 V_I4(&var_amount) = (LONG)std::min<size_t>(to_read, LONG_MAX);
          -
          2575 V_VT(&var_data) = VT_EMPTY;
          -
          2576 HRESULT hr = [&]() {
          -
          2577 __try { return m_request->BinaryRead(&var_amount, &var_data); }
          -
          2578 __except (EXCEPTION_EXECUTE_HANDLER) { return E_FAIL; }
          -
          2579 }();
          -
          2580 if (FAILED(hr)) _Unlikely_ {
          -
          2581 m_state = to_read < length ? state_t::ok : state_t::fail;
          -
          2582 return length - to_read;
          -
          2583 }
          -
          2584 _Assume_(V_VT(&var_amount) == VT_I4);
          -
          2585 _Assume_(V_VT(&var_data) == (VT_ARRAY | VT_UI1));
          -
          2586 std::unique_ptr<SAFEARRAY, SafeArrayDestroy_delete> sa(V_ARRAY(&var_data));
          -
          2587 if (!V_I4(&var_amount)) _Unlikely_ {
          -
          2588 m_state = to_read < length || !length ? state_t::ok : state_t::eof;
          -
          2589 return length - to_read;
          -
          2590 }
          -
          2591 safearray_accessor<uint8_t> a(sa.get());
          -
          2592 memcpy(data, a.data(), V_I4(&var_amount));
          -
          2593 to_read -= V_I4(&var_amount);
          -
          2594 if (!to_read) {
          -
          2595 m_state = state_t::ok;
          -
          2596 return length;
          -
          2597 }
          -
          2598 reinterpret_cast<uint8_t*&>(data) += V_I4(&var_amount);
          -
          2599 }
          -
          2600 }
          -
          2601
          -
          2602 virtual _Success_(return != 0) size_t write(
          -
          2603 _In_reads_bytes_opt_(length) const void* data, _In_ size_t length)
          -
          2604 {
          -
          2605 if (!m_response) {
          -
          2606 m_state = state_t::fail;
          -
          2607 return 0;
          -
          2608 }
          -
          2609 for (size_t to_write = length;;) {
          -
          2610 UINT num_written = static_cast<UINT>(std::min<size_t>(to_write, UINT_MAX));
          -
          2611 std::unique_ptr<OLECHAR, SysFreeString_delete> bstr_data(SysAllocStringByteLen(reinterpret_cast<LPCSTR>(data), num_written));
          -
          2612 VARIANT var_data;
          -
          2613 V_VT(&var_data) = VT_BSTR;
          -
          2614 V_BSTR(&var_data) = bstr_data.get();
          -
          2615 HRESULT hr = [&]() {
          -
          2616 __try { return m_response->BinaryWrite(var_data); }
          -
          2617 __except (EXCEPTION_EXECUTE_HANDLER) { return E_FAIL; }
          -
          2618 }();
          -
          2619 if (FAILED(hr)) _Unlikely_ {
          -
          2620 m_state = state_t::fail;
          -
          2621 return length - to_write;
          -
          2622 }
          -
          2623 to_write -= num_written;
          -
          2624 if (!to_write) {
          -
          2625 m_state = state_t::ok;
          -
          2626 return length;
          -
          2627 }
          -
          2628 reinterpret_cast<const uint8_t*&>(data) += num_written;
          -
          2629 }
          -
          2630 }
          -
          2631
          -
          2632 virtual void close()
          -
          2633 {
          -
          2634 if (m_response) {
          -
          2635 __try { m_response->End(); }
          -
          2636 __except (EXCEPTION_EXECUTE_HANDLER) {}
          -
          2637 }
          -
          2638 m_state = state_t::ok;
          -
          2639 }
          -
          2640
          -
          2641 virtual void flush()
          -
          2642 {
          -
          2643 if (m_response) {
          -
          2644 HRESULT hr;
          -
          2645 __try { hr = m_response->Flush(); }
          -
          2646 __except (EXCEPTION_EXECUTE_HANDLER) { hr = E_FAIL; }
          -
          2647 m_state = SUCCEEDED(hr) ? state_t::ok : state_t::fail;
          -
          2648 }
          -
          2649 }
          -
          2650
          -
          2651 protected:
          -
          2652 IRequest* m_request;
          -
          2653 IResponse* m_response;
          -
          2654 };
          -
          2655#endif
          -
          2656
          -
          2660 enum mode_t
          -
          2661 {
          -
          2662 mode_for_reading = 1 << 0,
          -
          2663 mode_for_writing = 1 << 1,
          -
          2664 mode_for_chmod = 1 << 2,
          -
          2665
          -
          2666 mode_open_existing = 0 << 3,
          -
          2667 mode_truncate_existing = 1 << 3,
          -
          2668 mode_preserve_existing = 2 << 3,
          -
          2669 mode_create_new = 3 << 3,
          -
          2670 mode_create = 4 << 3,
          -
          2671 mode_disposition_mask = 7 << 3,
          +
          2468 virtual ~sequential_stream()
          +
          2469 {
          +
          2470 m_source->Release();
          +
          2471 }
          +
          2472
          +
          2473 virtual _Success_(return != 0 || length == 0) size_t read(
          +
          2474 _Out_writes_bytes_to_opt_(length, return) void* data, _In_ size_t length)
          +
          2475 {
          +
          2476 _Assume_(data || !length);
          +
          2477 for (size_t to_read = length;;) {
          +
          2478 HRESULT hr;
          +
          2479 ULONG num_read = 0;
          +
          2480 __try { hr = m_source->Read(data, (ULONG)std::min<size_t>(to_read, ULONG_MAX), &num_read); }
          +
          2481 __except (EXCEPTION_EXECUTE_HANDLER) { hr = E_FAIL; }
          +
          2482 if (FAILED(hr)) _Unlikely_ {
          +
          2483 m_state = to_read < length ? state_t::ok : state_t::fail;
          +
          2484 return length - to_read;
          +
          2485 }
          +
          2486 to_read -= num_read;
          +
          2487 if (hr == S_FALSE) _Unlikely_ {
          +
          2488 m_state = to_read < length || !length ? state_t::ok : state_t::eof;
          +
          2489 return length - to_read;
          +
          2490 }
          +
          2491 if (!to_read) {
          +
          2492 m_state = state_t::ok;
          +
          2493 return length;
          +
          2494 }
          +
          2495 reinterpret_cast<uint8_t*&>(data) += num_read;
          +
          2496 }
          +
          2497 }
          +
          2498
          +
          2499 virtual _Success_(return != 0) size_t write(
          +
          2500 _In_reads_bytes_opt_(length) const void* data, _In_ size_t length)
          +
          2501 {
          +
          2502 _Assume_(data || !length);
          +
          2503 for (size_t to_write = length;;) {
          +
          2504 HRESULT hr;
          +
          2505 ULONG num_written = 0;
          +
          2506 __try { hr = m_source->Write(data, static_cast<ULONG>(std::min<size_t>(to_write, ULONG_MAX)), &num_written); }
          +
          2507 __except (EXCEPTION_EXECUTE_HANDLER) { hr = E_FAIL; }
          +
          2508 // In abscence of documentation whether num_written gets set when FAILED(hr) (i.e. partially succesful writes),
          +
          2509 // assume write failed completely.
          +
          2510 if (FAILED(hr)) _Unlikely_ {
          +
          2511 m_state = state_t::fail;
          +
          2512 return length - to_write;
          +
          2513 }
          +
          2514 to_write -= num_written;
          +
          2515 if (!to_write) {
          +
          2516 m_state = state_t::ok;
          +
          2517 return length;
          +
          2518 }
          +
          2519 reinterpret_cast<const uint8_t*&>(data) += num_written;
          +
          2520 }
          +
          2521 }
          +
          2522
          +
          2523 protected:
          +
          2524 ISequentialStream* m_source;
          +
          2525 };
          +
          2526
          +
          2530 class asp : public basic
          +
          2531 {
          +
          2532 public:
          +
          2533 asp(_In_opt_ IRequest* request, _In_opt_ IResponse* response) :
          +
          2534 m_request(request),
          +
          2535 m_response(response)
          +
          2536 {
          +
          2537 if (m_request)
          +
          2538 m_request->AddRef();
          +
          2539 if (m_response)
          +
          2540 m_response->AddRef();
          +
          2541 }
          +
          2542
          +
          2543 virtual ~asp()
          +
          2544 {
          +
          2545 if (m_request)
          +
          2546 m_request->Release();
          +
          2547 if (m_response)
          +
          2548 m_response->Release();
          +
          2549 }
          +
          2550
          +
          2551 virtual _Success_(return != 0 || length == 0) size_t read(
          +
          2552 _Out_writes_bytes_to_opt_(length, return) void* data, _In_ size_t length)
          +
          2553 {
          +
          2554 _Assume_(data || !length);
          +
          2555 if (!m_request) _Unlikely_ {
          +
          2556 m_state = state_t::fail;
          +
          2557 return 0;
          +
          2558 }
          +
          2559 for (size_t to_read = length;;) {
          +
          2560 VARIANT var_amount, var_data;
          +
          2561 V_VT(&var_amount) = VT_I4;
          +
          2562 V_I4(&var_amount) = (LONG)std::min<size_t>(to_read, LONG_MAX);
          +
          2563 V_VT(&var_data) = VT_EMPTY;
          +
          2564 HRESULT hr = [&]() {
          +
          2565 __try { return m_request->BinaryRead(&var_amount, &var_data); }
          +
          2566 __except (EXCEPTION_EXECUTE_HANDLER) { return E_FAIL; }
          +
          2567 }();
          +
          2568 if (FAILED(hr)) _Unlikely_ {
          +
          2569 m_state = to_read < length ? state_t::ok : state_t::fail;
          +
          2570 return length - to_read;
          +
          2571 }
          +
          2572 _Assume_(V_VT(&var_amount) == VT_I4);
          +
          2573 _Assume_(V_VT(&var_data) == (VT_ARRAY | VT_UI1));
          +
          2574 std::unique_ptr<SAFEARRAY, SafeArrayDestroy_delete> sa(V_ARRAY(&var_data));
          +
          2575 if (!V_I4(&var_amount)) _Unlikely_ {
          +
          2576 m_state = to_read < length || !length ? state_t::ok : state_t::eof;
          +
          2577 return length - to_read;
          +
          2578 }
          +
          2579 safearray_accessor<uint8_t> a(sa.get());
          +
          2580 memcpy(data, a.data(), V_I4(&var_amount));
          +
          2581 to_read -= V_I4(&var_amount);
          +
          2582 if (!to_read) {
          +
          2583 m_state = state_t::ok;
          +
          2584 return length;
          +
          2585 }
          +
          2586 reinterpret_cast<uint8_t*&>(data) += V_I4(&var_amount);
          +
          2587 }
          +
          2588 }
          +
          2589
          +
          2590 virtual _Success_(return != 0) size_t write(
          +
          2591 _In_reads_bytes_opt_(length) const void* data, _In_ size_t length)
          +
          2592 {
          +
          2593 if (!m_response) {
          +
          2594 m_state = state_t::fail;
          +
          2595 return 0;
          +
          2596 }
          +
          2597 for (size_t to_write = length;;) {
          +
          2598 UINT num_written = static_cast<UINT>(std::min<size_t>(to_write, UINT_MAX));
          +
          2599 std::unique_ptr<OLECHAR, SysFreeString_delete> bstr_data(SysAllocStringByteLen(reinterpret_cast<LPCSTR>(data), num_written));
          +
          2600 VARIANT var_data;
          +
          2601 V_VT(&var_data) = VT_BSTR;
          +
          2602 V_BSTR(&var_data) = bstr_data.get();
          +
          2603 HRESULT hr = [&]() {
          +
          2604 __try { return m_response->BinaryWrite(var_data); }
          +
          2605 __except (EXCEPTION_EXECUTE_HANDLER) { return E_FAIL; }
          +
          2606 }();
          +
          2607 if (FAILED(hr)) _Unlikely_ {
          +
          2608 m_state = state_t::fail;
          +
          2609 return length - to_write;
          +
          2610 }
          +
          2611 to_write -= num_written;
          +
          2612 if (!to_write) {
          +
          2613 m_state = state_t::ok;
          +
          2614 return length;
          +
          2615 }
          +
          2616 reinterpret_cast<const uint8_t*&>(data) += num_written;
          +
          2617 }
          +
          2618 }
          +
          2619
          +
          2620 virtual void close()
          +
          2621 {
          +
          2622 if (m_response) {
          +
          2623 __try { m_response->End(); }
          +
          2624 __except (EXCEPTION_EXECUTE_HANDLER) {}
          +
          2625 }
          +
          2626 m_state = state_t::ok;
          +
          2627 }
          +
          2628
          +
          2629 virtual void flush()
          +
          2630 {
          +
          2631 if (m_response) {
          +
          2632 HRESULT hr;
          +
          2633 __try { hr = m_response->Flush(); }
          +
          2634 __except (EXCEPTION_EXECUTE_HANDLER) { hr = E_FAIL; }
          +
          2635 m_state = SUCCEEDED(hr) ? state_t::ok : state_t::fail;
          +
          2636 }
          +
          2637 }
          +
          2638
          +
          2639 protected:
          +
          2640 IRequest* m_request;
          +
          2641 IResponse* m_response;
          +
          2642 };
          +
          2643#endif
          +
          2644
          +
          2648 enum mode_t
          +
          2649 {
          +
          2650 mode_for_reading = 1 << 0,
          +
          2651 mode_for_writing = 1 << 1,
          +
          2652 mode_for_chmod = 1 << 2,
          +
          2653
          +
          2654 mode_open_existing = 0 << 3,
          +
          2655 mode_truncate_existing = 1 << 3,
          +
          2656 mode_preserve_existing = 2 << 3,
          +
          2657 mode_create_new = 3 << 3,
          +
          2658 mode_create = 4 << 3,
          +
          2659 mode_disposition_mask = 7 << 3,
          +
          2660
          +
          2661 mode_append = 1 << 6,
          +
          2662 mode_text = 0,
          +
          2663 mode_binary = 1 << 7,
          +
          2664
          +
          2665 share_none = 0,
          +
          2666 share_reading = 1 << 8,
          +
          2667 share_writing = 1 << 9,
          +
          2668 share_deleting = 1 << 10,
          +
          2669 share_all = share_reading | share_writing | share_deleting, // Allow others all operations on our file
          +
          2670
          +
          2671 inherit_handle = 1 << 11,
          2672
          -
          2673 mode_append = 1 << 6,
          -
          2674 mode_text = 0,
          -
          2675 mode_binary = 1 << 7,
          -
          2676
          -
          2677 share_none = 0,
          -
          2678 share_reading = 1 << 8,
          -
          2679 share_writing = 1 << 9,
          -
          2680 share_deleting = 1 << 10,
          -
          2681 share_all = share_reading | share_writing | share_deleting, // Allow others all operations on our file
          -
          2682
          -
          2683 inherit_handle = 1 << 11,
          -
          2684
          -
          2685 hint_write_thru = 1 << 12,
          -
          2686 hint_no_buffering = 1 << 13,
          -
          2687 hint_random_access = 1 << 14,
          -
          2688 hint_sequential_access = 1 << 15,
          -
          2689 };
          -
          2690
          -
          2691#pragma warning(push)
          -
          2692#pragma warning(disable: 4250)
          -
          -
          2696 class file : virtual public basic_file, virtual public basic_sys
          -
          2697 {
          -
          2698 public:
          -
          2699 file(_In_opt_ sys_handle h = invalid_handle, _In_ state_t state = state_t::ok) : basic_sys(h, state) {}
          -
          2700
          -
          -
          2707 file(_In_z_ const schar_t* filename, _In_ int mode)
          -
          2708 {
          -
          2709 open(filename, mode);
          -
          2710 }
          +
          2673 hint_write_thru = 1 << 12,
          +
          2674 hint_no_buffering = 1 << 13,
          +
          2675 hint_random_access = 1 << 14,
          +
          2676 hint_sequential_access = 1 << 15,
          +
          2677 };
          +
          2678
          +
          2679#pragma warning(push)
          +
          2680#pragma warning(disable: 4250)
          +
          +
          2684 class file : virtual public basic_file, virtual public basic_sys
          +
          2685 {
          +
          2686 public:
          +
          2687 file(_In_opt_ sys_handle h = invalid_handle, _In_ state_t state = state_t::ok) : basic_sys(h, state) {}
          +
          2688
          +
          +
          2695 file(_In_z_ const schar_t* filename, _In_ int mode)
          +
          2696 {
          +
          2697 open(filename, mode);
          +
          2698 }
          -
          2711
          -
          2718 inline file(_In_ const stdex::sstring& filename, _In_ int mode) : file(filename.c_str(), mode) {}
          -
          2719
          -
          -
          2726 void open(_In_z_ const schar_t* filename, _In_ int mode)
          -
          2727 {
          -
          2728 if (m_h != invalid_handle)
          -
          2729 close();
          -
          2730
          -
          2731#ifdef _WIN32
          -
          2732 DWORD dwDesiredAccess = 0;
          -
          2733 if (mode & mode_for_reading) dwDesiredAccess |= GENERIC_READ;
          -
          2734 if (mode & mode_for_writing) dwDesiredAccess |= GENERIC_WRITE;
          -
          2735 if (mode & mode_for_chmod) dwDesiredAccess |= FILE_WRITE_ATTRIBUTES;
          -
          2736
          -
          2737 DWORD dwShareMode = 0;
          -
          2738 if (mode & share_reading) dwShareMode |= FILE_SHARE_READ;
          -
          2739 if (mode & share_writing) dwShareMode |= FILE_SHARE_WRITE;
          -
          2740 if (mode & share_deleting) dwShareMode |= FILE_SHARE_DELETE;
          -
          2741
          -
          2742 SECURITY_ATTRIBUTES sa = { sizeof(SECURITY_ATTRIBUTES) };
          -
          2743 sa.bInheritHandle = mode & inherit_handle ? true : false;
          -
          2744
          -
          2745 DWORD dwCreationDisposition;
          -
          2746 switch (mode & mode_disposition_mask) {
          -
          2747 case mode_open_existing: dwCreationDisposition = OPEN_EXISTING; break;
          -
          2748 case mode_truncate_existing: dwCreationDisposition = TRUNCATE_EXISTING; break;
          -
          2749 case mode_preserve_existing: dwCreationDisposition = OPEN_ALWAYS; break;
          -
          2750 case mode_create_new: dwCreationDisposition = CREATE_NEW; break;
          -
          2751 case mode_create: dwCreationDisposition = CREATE_ALWAYS; break;
          -
          2752 default: throw std::invalid_argument("invalid mode");
          -
          2753 }
          -
          2754
          -
          2755 DWORD dwFlagsAndAttributes = FILE_ATTRIBUTE_NORMAL;
          -
          2756 if (mode & hint_write_thru) dwFlagsAndAttributes |= FILE_FLAG_WRITE_THROUGH;
          -
          2757 if (mode & hint_no_buffering) dwFlagsAndAttributes |= FILE_FLAG_NO_BUFFERING;
          -
          2758 if (mode & hint_random_access) dwFlagsAndAttributes |= FILE_FLAG_RANDOM_ACCESS;
          -
          2759 if (mode & hint_sequential_access) dwFlagsAndAttributes |= FILE_FLAG_SEQUENTIAL_SCAN;
          -
          2760
          -
          2761 m_h = CreateFile(filename, dwDesiredAccess, dwShareMode, &sa, dwCreationDisposition, dwFlagsAndAttributes, NULL);
          -
          2762#else
          -
          2763 int flags = 0;
          -
          2764 switch (mode & (mode_for_reading | mode_for_writing)) {
          -
          2765 case mode_for_reading: flags |= O_RDONLY; break;
          -
          2766 case mode_for_writing: flags |= O_WRONLY; break;
          -
          2767 case mode_for_reading | mode_for_writing: flags |= O_RDWR; break;
          -
          2768 }
          -
          2769 switch (mode & mode_disposition_mask) {
          -
          2770 case mode_open_existing: break;
          -
          2771 case mode_truncate_existing: flags |= O_TRUNC; break;
          -
          2772 case mode_preserve_existing: flags |= O_CREAT; break;
          -
          2773 case mode_create_new: flags |= O_CREAT | O_EXCL; break;
          -
          2774 case mode_create: flags |= O_CREAT | O_TRUNC; break;
          -
          2775 default: throw std::invalid_argument("invalid mode");
          +
          2699
          +
          2706 inline file(_In_ const stdex::sstring& filename, _In_ int mode) : file(filename.c_str(), mode) {}
          +
          2707
          +
          +
          2714 void open(_In_z_ const schar_t* filename, _In_ int mode)
          +
          2715 {
          +
          2716 if (m_h != invalid_handle)
          +
          2717 close();
          +
          2718
          +
          2719#ifdef _WIN32
          +
          2720 DWORD dwDesiredAccess = 0;
          +
          2721 if (mode & mode_for_reading) dwDesiredAccess |= GENERIC_READ;
          +
          2722 if (mode & mode_for_writing) dwDesiredAccess |= GENERIC_WRITE;
          +
          2723 if (mode & mode_for_chmod) dwDesiredAccess |= FILE_WRITE_ATTRIBUTES;
          +
          2724
          +
          2725 DWORD dwShareMode = 0;
          +
          2726 if (mode & share_reading) dwShareMode |= FILE_SHARE_READ;
          +
          2727 if (mode & share_writing) dwShareMode |= FILE_SHARE_WRITE;
          +
          2728 if (mode & share_deleting) dwShareMode |= FILE_SHARE_DELETE;
          +
          2729
          +
          2730 SECURITY_ATTRIBUTES sa = { sizeof(SECURITY_ATTRIBUTES) };
          +
          2731 sa.bInheritHandle = mode & inherit_handle ? true : false;
          +
          2732
          +
          2733 DWORD dwCreationDisposition;
          +
          2734 switch (mode & mode_disposition_mask) {
          +
          2735 case mode_open_existing: dwCreationDisposition = OPEN_EXISTING; break;
          +
          2736 case mode_truncate_existing: dwCreationDisposition = TRUNCATE_EXISTING; break;
          +
          2737 case mode_preserve_existing: dwCreationDisposition = OPEN_ALWAYS; break;
          +
          2738 case mode_create_new: dwCreationDisposition = CREATE_NEW; break;
          +
          2739 case mode_create: dwCreationDisposition = CREATE_ALWAYS; break;
          +
          2740 default: throw std::invalid_argument("invalid mode");
          +
          2741 }
          +
          2742
          +
          2743 DWORD dwFlagsAndAttributes = FILE_ATTRIBUTE_NORMAL;
          +
          2744 if (mode & hint_write_thru) dwFlagsAndAttributes |= FILE_FLAG_WRITE_THROUGH;
          +
          2745 if (mode & hint_no_buffering) dwFlagsAndAttributes |= FILE_FLAG_NO_BUFFERING;
          +
          2746 if (mode & hint_random_access) dwFlagsAndAttributes |= FILE_FLAG_RANDOM_ACCESS;
          +
          2747 if (mode & hint_sequential_access) dwFlagsAndAttributes |= FILE_FLAG_SEQUENTIAL_SCAN;
          +
          2748
          +
          2749 m_h = CreateFile(filename, dwDesiredAccess, dwShareMode, &sa, dwCreationDisposition, dwFlagsAndAttributes, NULL);
          +
          2750#else
          +
          2751 int flags = 0;
          +
          2752 switch (mode & (mode_for_reading | mode_for_writing)) {
          +
          2753 case mode_for_reading: flags |= O_RDONLY; break;
          +
          2754 case mode_for_writing: flags |= O_WRONLY; break;
          +
          2755 case mode_for_reading | mode_for_writing: flags |= O_RDWR; break;
          +
          2756 }
          +
          2757 switch (mode & mode_disposition_mask) {
          +
          2758 case mode_open_existing: break;
          +
          2759 case mode_truncate_existing: flags |= O_TRUNC; break;
          +
          2760 case mode_preserve_existing: flags |= O_CREAT; break;
          +
          2761 case mode_create_new: flags |= O_CREAT | O_EXCL; break;
          +
          2762 case mode_create: flags |= O_CREAT | O_TRUNC; break;
          +
          2763 default: throw std::invalid_argument("invalid mode");
          +
          2764 }
          +
          2765 if (mode & hint_write_thru) flags |= O_DSYNC;
          +
          2766#ifndef __APPLE__
          +
          2767 if (mode & hint_no_buffering) flags |= O_RSYNC;
          +
          2768#endif
          +
          2769
          +
          2770 m_h = ::open(filename, flags, DEFFILEMODE);
          +
          2771#endif
          +
          2772 if (m_h != invalid_handle) {
          +
          2773 m_state = state_t::ok;
          +
          2774 if (mode & mode_append)
          +
          2775 seek(0, seek_t::end);
          2776 }
          -
          2777 if (mode & hint_write_thru) flags |= O_DSYNC;
          -
          2778#ifndef __APPLE__
          -
          2779 if (mode & hint_no_buffering) flags |= O_RSYNC;
          -
          2780#endif
          -
          2781
          -
          2782 m_h = ::open(filename, flags, DEFFILEMODE);
          -
          2783#endif
          -
          2784 if (m_h != invalid_handle) {
          -
          2785 m_state = state_t::ok;
          -
          2786 if (mode & mode_append)
          -
          2787 seek(0, seek_t::end);
          -
          2788 }
          -
          2789 else
          -
          2790 m_state = state_t::fail;
          -
          2791 }
          +
          2777 else
          +
          2778 m_state = state_t::fail;
          +
          2779 }
          -
          2792
          -
          -
          2799 inline void open(_In_ const stdex::sstring& filename, _In_ int mode)
          -
          2800 {
          -
          2801 open(filename.c_str(), mode);
          -
          2802 }
          +
          2780
          +
          +
          2787 inline void open(_In_ const stdex::sstring& filename, _In_ int mode)
          +
          2788 {
          +
          2789 open(filename.c_str(), mode);
          +
          2790 }
          -
          2803
          -
          -
          2804 virtual fpos_t seek(_In_ foff_t offset, _In_ seek_t how = seek_t::beg)
          -
          2805 {
          -
          2806#ifdef _WIN32
          -
          2807 LARGE_INTEGER li;
          -
          2808 li.QuadPart = offset;
          -
          2809 li.LowPart = SetFilePointer(m_h, li.LowPart, &li.HighPart, static_cast<DWORD>(how));
          -
          2810 if (li.LowPart != 0xFFFFFFFF || GetLastError() == NO_ERROR) {
          -
          2811 m_state = state_t::ok;
          -
          2812 return li.QuadPart;
          -
          2813 }
          -
          2814#else
          -
          2815 off64_t result = lseek64(m_h, offset, static_cast<int>(how));
          -
          2816 if (result >= 0) {
          -
          2817 m_state = state_t::ok;
          -
          2818 return result;
          -
          2819 }
          -
          2820#endif
          -
          2821 m_state = state_t::fail;
          -
          2822 return fpos_max;
          -
          2823 }
          +
          2791
          +
          +
          2792 virtual fpos_t seek(_In_ foff_t offset, _In_ seek_t how = seek_t::beg)
          +
          2793 {
          +
          2794#ifdef _WIN32
          +
          2795 LARGE_INTEGER li;
          +
          2796 li.QuadPart = offset;
          +
          2797 li.LowPart = SetFilePointer(m_h, li.LowPart, &li.HighPart, static_cast<DWORD>(how));
          +
          2798 if (li.LowPart != 0xFFFFFFFF || GetLastError() == NO_ERROR) {
          +
          2799 m_state = state_t::ok;
          +
          2800 return li.QuadPart;
          +
          2801 }
          +
          2802#else
          +
          2803 off64_t result = lseek64(m_h, offset, static_cast<int>(how));
          +
          2804 if (result >= 0) {
          +
          2805 m_state = state_t::ok;
          +
          2806 return result;
          +
          2807 }
          +
          2808#endif
          +
          2809 m_state = state_t::fail;
          +
          2810 return fpos_max;
          +
          2811 }
          -
          2824
          -
          -
          2825 virtual fpos_t tell() const
          -
          2826 {
          -
          2827 if (m_h != invalid_handle) {
          -
          2828#ifdef _WIN32
          -
          2829 LARGE_INTEGER li;
          -
          2830 li.QuadPart = 0;
          -
          2831 li.LowPart = SetFilePointer(m_h, 0, &li.HighPart, FILE_CURRENT);
          -
          2832 if (li.LowPart != 0xFFFFFFFF || GetLastError() == NO_ERROR)
          -
          2833 return li.QuadPart;
          -
          2834#else
          -
          2835 off64_t result = lseek64(m_h, 0, SEEK_CUR);
          -
          2836 if (result >= 0)
          -
          2837 return result;
          -
          2838#endif
          -
          2839 }
          -
          2840 return fpos_max;
          -
          2841 }
          +
          2812
          +
          +
          2813 virtual fpos_t tell() const
          +
          2814 {
          +
          2815 if (m_h != invalid_handle) {
          +
          2816#ifdef _WIN32
          +
          2817 LARGE_INTEGER li;
          +
          2818 li.QuadPart = 0;
          +
          2819 li.LowPart = SetFilePointer(m_h, 0, &li.HighPart, FILE_CURRENT);
          +
          2820 if (li.LowPart != 0xFFFFFFFF || GetLastError() == NO_ERROR)
          +
          2821 return li.QuadPart;
          +
          2822#else
          +
          2823 off64_t result = lseek64(m_h, 0, SEEK_CUR);
          +
          2824 if (result >= 0)
          +
          2825 return result;
          +
          2826#endif
          +
          2827 }
          +
          2828 return fpos_max;
          +
          2829 }
          -
          2842
          -
          -
          2843 virtual void lock(_In_ fpos_t offset, _In_ fsize_t length)
          -
          2844 {
          -
          2845#ifdef _WIN32
          -
          2846 LARGE_INTEGER liOffset;
          -
          2847 LARGE_INTEGER liSize;
          -
          2848 liOffset.QuadPart = offset;
          -
          2849 liSize.QuadPart = length;
          -
          2850 if (LockFile(m_h, liOffset.LowPart, liOffset.HighPart, liSize.LowPart, liSize.HighPart)) {
          -
          2851 m_state = state_t::ok;
          -
          2852 return;
          -
          2853 }
          -
          2854#else
          -
          2855 off64_t orig = lseek64(m_h, 0, SEEK_CUR);
          -
          2856 if (orig >= 0) {
          -
          2857 m_state = lseek64(m_h, offset, SEEK_SET) >= 0 && lockf64(m_h, F_LOCK, length) >= 0 ? state_t::ok : state_t::fail;
          -
          2858 lseek64(m_h, orig, SEEK_SET);
          -
          2859 m_state = state_t::ok;
          -
          2860 return;
          -
          2861 }
          -
          2862#endif
          -
          2863 m_state = state_t::fail;
          -
          2864 }
          +
          2830
          +
          +
          2831 virtual void lock(_In_ fpos_t offset, _In_ fsize_t length)
          +
          2832 {
          +
          2833#ifdef _WIN32
          +
          2834 LARGE_INTEGER liOffset;
          +
          2835 LARGE_INTEGER liSize;
          +
          2836 liOffset.QuadPart = offset;
          +
          2837 liSize.QuadPart = length;
          +
          2838 if (LockFile(m_h, liOffset.LowPart, liOffset.HighPart, liSize.LowPart, liSize.HighPart)) {
          +
          2839 m_state = state_t::ok;
          +
          2840 return;
          +
          2841 }
          +
          2842#else
          +
          2843 off64_t orig = lseek64(m_h, 0, SEEK_CUR);
          +
          2844 if (orig >= 0) {
          +
          2845 m_state = lseek64(m_h, offset, SEEK_SET) >= 0 && lockf64(m_h, F_LOCK, length) >= 0 ? state_t::ok : state_t::fail;
          +
          2846 lseek64(m_h, orig, SEEK_SET);
          +
          2847 m_state = state_t::ok;
          +
          2848 return;
          +
          2849 }
          +
          2850#endif
          +
          2851 m_state = state_t::fail;
          +
          2852 }
          -
          2865
          -
          -
          2866 virtual void unlock(_In_ fpos_t offset, _In_ fsize_t length)
          -
          2867 {
          -
          2868#ifdef _WIN32
          -
          2869 LARGE_INTEGER liOffset;
          -
          2870 LARGE_INTEGER liSize;
          -
          2871 liOffset.QuadPart = offset;
          -
          2872 liSize.QuadPart = length;
          -
          2873 if (UnlockFile(m_h, liOffset.LowPart, liOffset.HighPart, liSize.LowPart, liSize.HighPart)) {
          -
          2874 m_state = state_t::ok;
          -
          2875 return;
          -
          2876 }
          -
          2877#else
          -
          2878 off64_t orig = lseek64(m_h, 0, SEEK_CUR);
          -
          2879 if (orig >= 0) {
          -
          2880 if (lseek64(m_h, offset, SEEK_SET) >= 0 && lockf64(m_h, F_ULOCK, length) >= 0) {
          -
          2881 lseek64(m_h, orig, SEEK_SET);
          -
          2882 m_state = state_t::ok;
          -
          2883 return;
          -
          2884 }
          -
          2885 lseek64(m_h, orig, SEEK_SET);
          -
          2886 }
          -
          2887#endif
          -
          2888 m_state = state_t::fail;
          -
          2889 }
          +
          2853
          +
          +
          2854 virtual void unlock(_In_ fpos_t offset, _In_ fsize_t length)
          +
          2855 {
          +
          2856#ifdef _WIN32
          +
          2857 LARGE_INTEGER liOffset;
          +
          2858 LARGE_INTEGER liSize;
          +
          2859 liOffset.QuadPart = offset;
          +
          2860 liSize.QuadPart = length;
          +
          2861 if (UnlockFile(m_h, liOffset.LowPart, liOffset.HighPart, liSize.LowPart, liSize.HighPart)) {
          +
          2862 m_state = state_t::ok;
          +
          2863 return;
          +
          2864 }
          +
          2865#else
          +
          2866 off64_t orig = lseek64(m_h, 0, SEEK_CUR);
          +
          2867 if (orig >= 0) {
          +
          2868 if (lseek64(m_h, offset, SEEK_SET) >= 0 && lockf64(m_h, F_ULOCK, length) >= 0) {
          +
          2869 lseek64(m_h, orig, SEEK_SET);
          +
          2870 m_state = state_t::ok;
          +
          2871 return;
          +
          2872 }
          +
          2873 lseek64(m_h, orig, SEEK_SET);
          +
          2874 }
          +
          2875#endif
          +
          2876 m_state = state_t::fail;
          +
          2877 }
          -
          2890
          -
          -
          2891 virtual fsize_t size() const
          -
          2892 {
          -
          2893#ifdef _WIN32
          -
          2894 LARGE_INTEGER li;
          -
          2895 li.LowPart = GetFileSize(m_h, (LPDWORD)&li.HighPart);
          -
          2896 if (li.LowPart == 0xFFFFFFFF && GetLastError() != NO_ERROR)
          -
          2897 li.QuadPart = -1;
          -
          2898 return li.QuadPart;
          -
          2899#else
          -
          2900 off64_t length = -1, orig = lseek64(m_h, 0, SEEK_CUR);
          -
          2901 if (orig >= 0) {
          -
          2902 length = lseek64(m_h, 0, SEEK_END);
          -
          2903 lseek64(m_h, orig, SEEK_SET);
          -
          2904 }
          -
          2905 return length;
          -
          2906#endif
          -
          2907 }
          +
          2878
          +
          +
          2879 virtual fsize_t size() const
          +
          2880 {
          +
          2881#ifdef _WIN32
          +
          2882 LARGE_INTEGER li;
          +
          2883 li.LowPart = GetFileSize(m_h, (LPDWORD)&li.HighPart);
          +
          2884 if (li.LowPart == 0xFFFFFFFF && GetLastError() != NO_ERROR)
          +
          2885 li.QuadPart = -1;
          +
          2886 return li.QuadPart;
          +
          2887#else
          +
          2888 off64_t length = -1, orig = lseek64(m_h, 0, SEEK_CUR);
          +
          2889 if (orig >= 0) {
          +
          2890 length = lseek64(m_h, 0, SEEK_END);
          +
          2891 lseek64(m_h, orig, SEEK_SET);
          +
          2892 }
          +
          2893 return length;
          +
          2894#endif
          +
          2895 }
          -
          2908
          -
          -
          2909 virtual void truncate()
          -
          2910 {
          -
          2911#ifdef _WIN32
          -
          2912 if (SetEndOfFile(m_h)) {
          -
          2913 m_state = state_t::ok;
          -
          2914 return;
          -
          2915 }
          -
          2916#else
          -
          2917 off64_t length = lseek64(m_h, 0, SEEK_CUR);
          -
          2918 if (length >= 0 && ftruncate64(m_h, length) >= 0) {
          -
          2919 m_state = state_t::ok;
          -
          2920 return;
          -
          2921 }
          -
          2922#endif
          -
          2923 m_state = state_t::fail;
          -
          2924 }
          +
          2896
          +
          +
          2897 virtual void truncate()
          +
          2898 {
          +
          2899#ifdef _WIN32
          +
          2900 if (SetEndOfFile(m_h)) {
          +
          2901 m_state = state_t::ok;
          +
          2902 return;
          +
          2903 }
          +
          2904#else
          +
          2905 off64_t length = lseek64(m_h, 0, SEEK_CUR);
          +
          2906 if (length >= 0 && ftruncate64(m_h, length) >= 0) {
          +
          2907 m_state = state_t::ok;
          +
          2908 return;
          +
          2909 }
          +
          2910#endif
          +
          2911 m_state = state_t::fail;
          +
          2912 }
          -
          2925
          -
          2926#ifdef _WIN32
          -
          2927 static inline time_point ft2tp(_In_ const FILETIME& ft)
          -
          2928 {
          -
          2929#if _HAS_CXX20
          -
          2930 uint64_t t = (static_cast<int64_t>(ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
          -
          2931#else
          -
          2932 uint64_t t = ((static_cast<int64_t>(ft.dwHighDateTime) << 32) | ft.dwLowDateTime) - 116444736000000000ll;
          -
          2933#endif
          -
          2934 return time_point(time_point::duration(t));
          -
          2935 }
          +
          2913
          +
          2914#ifdef _WIN32
          +
          2915 static inline time_point ft2tp(_In_ const FILETIME& ft)
          +
          2916 {
          +
          2917#if _HAS_CXX20
          +
          2918 uint64_t t = (static_cast<int64_t>(ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
          +
          2919#else
          +
          2920 uint64_t t = ((static_cast<int64_t>(ft.dwHighDateTime) << 32) | ft.dwLowDateTime) - 116444736000000000ll;
          +
          2921#endif
          +
          2922 return time_point(time_point::duration(t));
          +
          2923 }
          +
          2924
          +
          2925 static inline void tp2ft(_In_ time_point tp, _Out_ FILETIME& ft)
          +
          2926 {
          +
          2927#if _HAS_CXX20
          +
          2928 uint64_t t = tp.time_since_epoch().count();
          +
          2929#else
          +
          2930 uint64_t t = tp.time_since_epoch().count() + 116444736000000000ll;
          +
          2931#endif
          +
          2932 ft.dwHighDateTime = static_cast<DWORD>((t >> 32) & 0xffffffff);
          +
          2933 ft.dwLowDateTime = static_cast<DWORD>(t & 0xffffffff);
          +
          2934 }
          +
          2935#endif
          2936
          -
          2937 static inline void tp2ft(_In_ time_point tp, _Out_ FILETIME& ft)
          -
          2938 {
          -
          2939#if _HAS_CXX20
          -
          2940 uint64_t t = tp.time_since_epoch().count();
          -
          2941#else
          -
          2942 uint64_t t = tp.time_since_epoch().count() + 116444736000000000ll;
          +
          +
          2937 virtual time_point ctime() const
          +
          2938 {
          +
          2939#ifdef _WIN32
          +
          2940 FILETIME ft;
          +
          2941 if (GetFileTime(m_h, &ft, nullptr, nullptr))
          +
          2942 return ft2tp(ft);
          2943#endif
          -
          2944 ft.dwHighDateTime = static_cast<DWORD>((t >> 32) & 0xffffffff);
          -
          2945 ft.dwLowDateTime = static_cast<DWORD>(t & 0xffffffff);
          -
          2946 }
          -
          2947#endif
          -
          2948
          -
          -
          2949 virtual time_point ctime() const
          -
          2950 {
          -
          2951#ifdef _WIN32
          -
          2952 FILETIME ft;
          -
          2953 if (GetFileTime(m_h, &ft, nullptr, nullptr))
          -
          2954 return ft2tp(ft);
          -
          2955#endif
          -
          2956 return time_point::min();
          -
          2957 }
          +
          2944 return time_point::min();
          +
          2945 }
          -
          2958
          -
          -
          2959 virtual time_point atime() const
          -
          2960 {
          -
          2961#ifdef _WIN32
          -
          2962 FILETIME ft;
          -
          2963 if (GetFileTime(m_h, nullptr, &ft, nullptr))
          -
          2964 return ft2tp(ft);
          -
          2965#else
          -
          2966 struct stat buf;
          -
          2967 if (fstat(m_h, &buf) >= 0)
          -
          2968 return clock::from_time_t(buf.st_atime);
          -
          2969#endif
          -
          2970 return time_point::min();
          -
          2971 }
          +
          2946
          +
          +
          2947 virtual time_point atime() const
          +
          2948 {
          +
          2949#ifdef _WIN32
          +
          2950 FILETIME ft;
          +
          2951 if (GetFileTime(m_h, nullptr, &ft, nullptr))
          +
          2952 return ft2tp(ft);
          +
          2953#else
          +
          2954 struct stat buf;
          +
          2955 if (fstat(m_h, &buf) >= 0)
          +
          2956 return clock::from_time_t(buf.st_atime);
          +
          2957#endif
          +
          2958 return time_point::min();
          +
          2959 }
          -
          2972
          -
          -
          2973 virtual time_point mtime() const
          -
          2974 {
          -
          2975#ifdef _WIN32
          -
          2976 FILETIME ft;
          -
          2977 if (GetFileTime(m_h, nullptr, nullptr, &ft))
          -
          2978 return ft2tp(ft);
          -
          2979#else
          -
          2980 struct stat buf;
          -
          2981 if (fstat(m_h, &buf) >= 0)
          -
          2982 return clock::from_time_t(buf.st_mtime);
          -
          2983#endif
          -
          2984 return time_point::min();
          -
          2985 }
          +
          2960
          +
          +
          2961 virtual time_point mtime() const
          +
          2962 {
          +
          2963#ifdef _WIN32
          +
          2964 FILETIME ft;
          +
          2965 if (GetFileTime(m_h, nullptr, nullptr, &ft))
          +
          2966 return ft2tp(ft);
          +
          2967#else
          +
          2968 struct stat buf;
          +
          2969 if (fstat(m_h, &buf) >= 0)
          +
          2970 return clock::from_time_t(buf.st_mtime);
          +
          2971#endif
          +
          2972 return time_point::min();
          +
          2973 }
          -
          2986
          -
          -
          2987 virtual void set_ctime(time_point date)
          -
          2988 {
          -
          2989 _Assume_(m_h != invalid_handle);
          -
          2990#ifdef _WIN32
          -
          2991 FILETIME ft;
          -
          2992 tp2ft(date, ft);
          -
          2993 if (SetFileTime(m_h, &ft, nullptr, nullptr))
          -
          2994 return;
          -
          2995 throw std::system_error(GetLastError(), std::system_category(), "SetFileTime failed");
          -
          2996#else
          -
          2997 throw std::runtime_error("not supported");
          -
          2998#endif
          -
          2999 }
          +
          2974
          +
          +
          2975 virtual void set_ctime(time_point date)
          +
          2976 {
          +
          2977 _Assume_(m_h != invalid_handle);
          +
          2978#ifdef _WIN32
          +
          2979 FILETIME ft;
          +
          2980 tp2ft(date, ft);
          +
          2981 if (SetFileTime(m_h, &ft, nullptr, nullptr))
          +
          2982 return;
          +
          2983 throw std::system_error(GetLastError(), std::system_category(), "SetFileTime failed");
          +
          2984#else
          +
          2985 throw std::runtime_error("not supported");
          +
          2986#endif
          +
          2987 }
          -
          3000
          -
          -
          3001 virtual void set_atime(time_point date)
          -
          3002 {
          -
          3003 _Assume_(m_h != invalid_handle);
          -
          3004#ifdef _WIN32
          -
          3005 FILETIME ft;
          -
          3006 tp2ft(date, ft);
          -
          3007 if (SetFileTime(m_h, nullptr, &ft, nullptr))
          -
          3008 return;
          -
          3009 throw std::system_error(GetLastError(), std::system_category(), "SetFileTime failed");
          -
          3010#else
          -
          3011 struct timespec ts[2] = {
          -
          3012 { date.time_since_epoch().count(), 0 },
          -
          3013 { 0, UTIME_OMIT },
          -
          3014 };
          -
          3015 if (futimens(m_h, ts) >= 0)
          -
          3016 return;
          -
          3017 throw std::system_error(errno, std::system_category(), "futimens failed");
          -
          3018#endif
          -
          3019 }
          +
          2988
          +
          +
          2989 virtual void set_atime(time_point date)
          +
          2990 {
          +
          2991 _Assume_(m_h != invalid_handle);
          +
          2992#ifdef _WIN32
          +
          2993 FILETIME ft;
          +
          2994 tp2ft(date, ft);
          +
          2995 if (SetFileTime(m_h, nullptr, &ft, nullptr))
          +
          2996 return;
          +
          2997 throw std::system_error(GetLastError(), std::system_category(), "SetFileTime failed");
          +
          2998#else
          +
          2999 struct timespec ts[2] = {
          +
          3000 { date.time_since_epoch().count(), 0 },
          +
          3001 { 0, UTIME_OMIT },
          +
          3002 };
          +
          3003 if (futimens(m_h, ts) >= 0)
          +
          3004 return;
          +
          3005 throw std::system_error(errno, std::system_category(), "futimens failed");
          +
          3006#endif
          +
          3007 }
          -
          3020
          -
          -
          3021 virtual void set_mtime(time_point date)
          -
          3022 {
          -
          3023#ifdef _WIN32
          -
          3024 FILETIME ft;
          -
          3025 tp2ft(date, ft);
          -
          3026 if (SetFileTime(m_h, nullptr, nullptr, &ft))
          -
          3027 return;
          -
          3028 throw std::system_error(GetLastError(), std::system_category(), "SetFileTime failed");
          -
          3029#else
          -
          3030 struct timespec ts[2] = {
          -
          3031 { 0, UTIME_OMIT },
          -
          3032 { date.time_since_epoch().count(), 0 },
          -
          3033 };
          -
          3034 if (futimens(m_h, ts) >= 0)
          -
          3035 return;
          -
          3036 throw std::system_error(errno, std::system_category(), "futimens failed");
          -
          3037#endif
          -
          3038 }
          +
          3008
          +
          +
          3009 virtual void set_mtime(time_point date)
          +
          3010 {
          +
          3011#ifdef _WIN32
          +
          3012 FILETIME ft;
          +
          3013 tp2ft(date, ft);
          +
          3014 if (SetFileTime(m_h, nullptr, nullptr, &ft))
          +
          3015 return;
          +
          3016 throw std::system_error(GetLastError(), std::system_category(), "SetFileTime failed");
          +
          3017#else
          +
          3018 struct timespec ts[2] = {
          +
          3019 { 0, UTIME_OMIT },
          +
          3020 { date.time_since_epoch().count(), 0 },
          +
          3021 };
          +
          3022 if (futimens(m_h, ts) >= 0)
          +
          3023 return;
          +
          3024 throw std::system_error(errno, std::system_category(), "futimens failed");
          +
          3025#endif
          +
          3026 }
          -
          3039
          -
          -
          3045 static bool exists(_In_z_ const stdex::schar_t* filename)
          -
          3046 {
          -
          3047#ifdef _WIN32
          -
          3048 return GetFileAttributes(filename) != INVALID_FILE_ATTRIBUTES;
          -
          3049#else
          -
          3050 struct stat s;
          -
          3051 return stat(filename, &s) == 0;
          -
          3052#endif
          -
          3053 }
          +
          3027
          +
          +
          3033 static bool exists(_In_z_ const stdex::schar_t* filename)
          +
          3034 {
          +
          3035#ifdef _WIN32
          +
          3036 return GetFileAttributes(filename) != INVALID_FILE_ATTRIBUTES;
          +
          3037#else
          +
          3038 struct stat s;
          +
          3039 return stat(filename, &s) == 0;
          +
          3040#endif
          +
          3041 }
          -
          3054
          +
          3042
          +
          +
          3048 static inline bool exists(_In_ const stdex::sstring& filename)
          +
          3049 {
          +
          3050 return exists(filename.c_str());
          +
          3051 }
          +
          +
          3052
          -
          3060 static inline bool exists(_In_ const stdex::sstring& filename)
          +
          3060 static bool readonly(_In_z_ const stdex::schar_t* filename)
          3061 {
          -
          3062 return exists(filename.c_str());
          -
          3063 }
          +
          3062#ifdef _WIN32
          +
          3063 DWORD dwAttr = GetFileAttributes(filename);
          +
          3064 return dwAttr != INVALID_FILE_ATTRIBUTES && (dwAttr & FILE_ATTRIBUTE_READONLY) != 0;
          +
          3065#else
          +
          3066 struct stat s;
          +
          3067 return stat(filename, &s) == 0 && (s.st_mode & (S_IWUSR|S_IWGRP|S_IWOTH)) == 0;
          +
          3068#endif
          +
          3069 }
          -
          3064
          -
          -
          3072 static bool readonly(_In_z_ const stdex::schar_t* filename)
          -
          3073 {
          -
          3074#ifdef _WIN32
          -
          3075 DWORD dwAttr = GetFileAttributes(filename);
          -
          3076 return dwAttr != INVALID_FILE_ATTRIBUTES && (dwAttr & FILE_ATTRIBUTE_READONLY) != 0;
          -
          3077#else
          -
          3078 struct stat s;
          -
          3079 return stat(filename, &s) == 0 && (s.st_mode & (S_IWUSR|S_IWGRP|S_IWOTH)) == 0;
          -
          3080#endif
          +
          3070
          +
          +
          3078 static inline bool readonly(_In_ const stdex::sstring& filename)
          +
          3079 {
          +
          3080 return readonly(filename.c_str());
          3081 }
          -
          3082
          -
          -
          3090 static inline bool readonly(_In_ const stdex::sstring& filename)
          -
          3091 {
          -
          3092 return readonly(filename.c_str());
          -
          3093 }
          +
          3082 };
          -
          3094 };
          +
          3083#pragma warning(pop)
          +
          3084
          +
          +
          3088 class cached_file : public cache
          +
          3089 {
          +
          3090 public:
          +
          3091 cached_file(_In_opt_ sys_handle h = invalid_handle, _In_ state_t state = state_t::ok, _In_ size_t cache_size = default_cache_size) :
          +
          3092 cache(cache_size),
          +
          3093 m_source(h, state)
          +
          3094 {
          +
          3095 init(m_source);
          +
          3096 }
          +
          3097
          +
          +
          3105 cached_file(_In_z_ const schar_t* filename, _In_ int mode, _In_ size_t cache_size = default_cache_size) :
          +
          3106 cache(cache_size),
          +
          3107 m_source(filename, mode & mode_for_writing ? mode | mode_for_reading : mode)
          +
          3108 {
          +
          3109 init(m_source);
          +
          3110 }
          -
          3095#pragma warning(pop)
          -
          3096
          -
          -
          3100 class cached_file : public cache
          -
          3101 {
          -
          3102 public:
          -
          3103 cached_file(_In_opt_ sys_handle h = invalid_handle, _In_ state_t state = state_t::ok, _In_ size_t cache_size = default_cache_size) :
          -
          3104 cache(cache_size),
          -
          3105 m_source(h, state)
          -
          3106 {
          -
          3107 init(m_source);
          -
          3108 }
          -
          3109
          -
          -
          3117 cached_file(_In_z_ const schar_t* filename, _In_ int mode, _In_ size_t cache_size = default_cache_size) :
          -
          3118 cache(cache_size),
          -
          3119 m_source(filename, mode & mode_for_writing ? mode | mode_for_reading : mode)
          -
          3120 {
          -
          3121 init(m_source);
          -
          3122 }
          +
          3111
          +
          3119 inline cached_file(_In_ const stdex::sstring& filename, _In_ int mode, _In_ size_t cache_size = default_cache_size) : cached_file(filename.c_str(), mode, cache_size) {}
          +
          3120
          +
          3121 virtual ~cached_file()
          +
          3122 {
          +
          3123 done();
          +
          3124 }
          +
          3125
          +
          +
          3132 void open(_In_z_ const schar_t* filename, _In_ int mode)
          +
          3133 {
          +
          3134 invalidate_cache();
          +
          3135 if (!ok()) _Unlikely_{
          +
          3136 m_state = state_t::fail;
          +
          3137 return;
          +
          3138 }
          +
          3139 m_source.open(filename, mode & mode_for_writing ? mode | mode_for_reading : mode);
          +
          3140 if (m_source.ok()) {
          +
          3141 init();
          +
          3142 return;
          +
          3143 }
          +
          3144 m_state = state_t::fail;
          +
          3145 }
          -
          3123
          -
          3131 inline cached_file(_In_ const stdex::sstring& filename, _In_ int mode, _In_ size_t cache_size = default_cache_size) : cached_file(filename.c_str(), mode, cache_size) {}
          -
          3132
          -
          3133 virtual ~cached_file()
          -
          3134 {
          -
          3135 done();
          -
          3136 }
          -
          3137
          -
          -
          3144 void open(_In_z_ const schar_t* filename, _In_ int mode)
          -
          3145 {
          -
          3146 invalidate_cache();
          -
          3147 if (!ok()) _Unlikely_{
          -
          3148 m_state = state_t::fail;
          -
          3149 return;
          -
          3150 }
          -
          3151 m_source.open(filename, mode & mode_for_writing ? mode | mode_for_reading : mode);
          -
          3152 if (m_source.ok()) {
          -
          3153 init();
          -
          3154 return;
          -
          3155 }
          -
          3156 m_state = state_t::fail;
          -
          3157 }
          +
          3146
          +
          +
          3153 inline void open(_In_ const stdex::sstring& filename, _In_ int mode)
          +
          3154 {
          +
          3155 open(filename.c_str(), mode);
          +
          3156 }
          -
          3158
          -
          -
          3165 inline void open(_In_ const stdex::sstring& filename, _In_ int mode)
          -
          3166 {
          -
          3167 open(filename.c_str(), mode);
          -
          3168 }
          +
          3157
          +
          3161 inline operator bool() const noexcept { return m_source; }
          +
          3162
          +
          3163 protected:
          +
          3164 file m_source;
          +
          3165 };
          -
          3169
          -
          3170 protected:
          -
          3171 file m_source;
          -
          3172 };
          +
          3166
          +
          + +
          3171 {
          +
          3172 public:
          +
          3173 memory_file(_In_ state_t state = state_t::ok) :
          +
          3174 basic(state),
          +
          3175 m_data(nullptr),
          +
          3176 m_offset(0),
          +
          3177 m_size(0),
          +
          3178 m_reserved(0),
          +
          3179 m_manage(true)
          +
          3180 {
          +
          3181#if SET_FILE_OP_TIMES
          +
          3182 m_ctime = m_atime = m_mtime = time_point::now();
          +
          3183#endif
          +
          3184 }
          +
          3185
          +
          +
          3192 memory_file(_In_ size_t size, _In_ state_t state = state_t::ok) :
          +
          3193 basic(state),
          +
          3194 m_data(reinterpret_cast<uint8_t*>(malloc(size))),
          +
          3195 m_offset(0),
          +
          3196 m_size(0),
          + +
          3198 m_manage(true)
          +
          3199 {
          +
          3200 if (!m_data) {
          +
          3201 m_state = state_t::fail;
          +
          3202 throw std::bad_alloc();
          +
          3203 }
          +
          3204#if SET_FILE_OP_TIMES
          +
          3205 m_ctime = m_atime = m_mtime = time_point::now();
          +
          3206#endif
          +
          3207 }
          -
          3173
          -
          - -
          3178 {
          -
          3179 public:
          -
          3180 memory_file(_In_ state_t state = state_t::ok) :
          -
          3181 basic(state),
          -
          3182 m_data(nullptr),
          -
          3183 m_offset(0),
          -
          3184 m_size(0),
          -
          3185 m_reserved(0),
          -
          3186 m_manage(true)
          -
          3187 {
          -
          3188#if SET_FILE_OP_TIMES
          -
          3189 m_ctime = m_atime = m_mtime = time_point::now();
          -
          3190#endif
          -
          3191 }
          -
          3192
          -
          -
          3199 memory_file(_In_ size_t size, _In_ state_t state = state_t::ok) :
          -
          3200 basic(state),
          -
          3201 m_data(reinterpret_cast<uint8_t*>(malloc(size))),
          -
          3202 m_offset(0),
          -
          3203 m_size(0),
          - -
          3205 m_manage(true)
          -
          3206 {
          -
          3207 if (!m_data) {
          -
          3208 m_state = state_t::fail;
          -
          3209 throw std::bad_alloc();
          -
          3210 }
          -
          3211#if SET_FILE_OP_TIMES
          -
          3212 m_ctime = m_atime = m_mtime = time_point::now();
          -
          3213#endif
          -
          3214 }
          +
          3208
          +
          +
          3218 memory_file(_Inout_ void* data, _In_ size_t size, _In_ size_t reserved, _In_ bool manage = false, _In_ state_t state = state_t::ok) :
          +
          3219 basic(state),
          +
          3220 m_data(reinterpret_cast<uint8_t*>(data)),
          +
          3221 m_offset(0),
          +
          3222 m_size(size),
          +
          3223 m_reserved(reserved),
          +
          3224 m_manage(manage)
          +
          3225 {
          +
          3226 _Assume_(data || !size);
          +
          3227 _Assume_(reserved >= size);
          +
          3228#if SET_FILE_OP_TIMES
          +
          3229 m_ctime = m_atime = m_mtime = time_point::now();
          +
          3230#endif
          +
          3231 }
          -
          3215
          -
          -
          3225 memory_file(_Inout_ void* data, _In_ size_t size, _In_ size_t reserved, _In_ bool manage = false, _In_ state_t state = state_t::ok) :
          -
          3226 basic(state),
          -
          3227 m_data(reinterpret_cast<uint8_t*>(data)),
          -
          3228 m_offset(0),
          -
          3229 m_size(size),
          -
          3230 m_reserved(reserved),
          -
          3231 m_manage(manage)
          -
          3232 {
          -
          3233 _Assume_(data || !size);
          -
          3234 _Assume_(reserved >= size);
          -
          3235#if SET_FILE_OP_TIMES
          -
          3236 m_ctime = m_atime = m_mtime = time_point::now();
          -
          3237#endif
          -
          3238 }
          +
          3232
          +
          +
          3241 memory_file(_Inout_ void* data, _In_ size_t size, _In_ bool manage = false, _In_ state_t state = state_t::ok) :
          +
          3242 memory_file(data, size, size, manage, state)
          +
          3243 {}
          -
          3239
          -
          -
          3248 memory_file(_Inout_ void* data, _In_ size_t size, _In_ bool manage = false, _In_ state_t state = state_t::ok) :
          -
          3249 memory_file(data, size, size, manage, state)
          -
          3250 {}
          +
          3244
          +
          +
          3251 memory_file(_In_z_ const schar_t* filename, _In_ int mode) : memory_file()
          +
          3252 {
          +
          3253 load(filename, mode);
          +
          3254 }
          -
          3251
          -
          -
          3258 memory_file(_In_z_ const schar_t* filename, _In_ int mode) : memory_file()
          -
          3259 {
          -
          3260 load(filename, mode);
          -
          3261 }
          +
          3255
          +
          3262 inline memory_file(_In_ const stdex::sstring& filename, _In_ int mode) : memory_file(filename.c_str(), mode) {}
          +
          3263
          +
          +
          3269 memory_file(_In_ const memory_file& other) :
          +
          3270 basic_file(other),
          +
          3271 m_data(reinterpret_cast<uint8_t*>(malloc(other.m_size))),
          +
          3272 m_offset(other.m_offset),
          +
          3273 m_size(other.m_size),
          +
          3274 m_reserved(other.m_size),
          +
          3275 m_manage(true)
          +
          3276#if SET_FILE_OP_TIMES
          +
          3277 , m_ctime(other.m_ctime)
          +
          3278 , m_atime(other.m_atime)
          +
          3279 , m_mtime(other.m_mtime)
          +
          3280#endif
          +
          3281 {
          +
          3282 if (!m_data) {
          +
          3283 m_state = state_t::fail;
          +
          3284 throw std::bad_alloc();
          +
          3285 }
          +
          3286 memcpy(m_data, other.m_data, other.m_size);
          +
          3287 }
          -
          3262
          -
          3269 inline memory_file(_In_ const stdex::sstring& filename, _In_ int mode) : memory_file(filename.c_str(), mode) {}
          -
          3270
          -
          -
          3276 memory_file(_In_ const memory_file& other) :
          -
          3277 basic_file(other),
          -
          3278 m_data(reinterpret_cast<uint8_t*>(malloc(other.m_size))),
          -
          3279 m_offset(other.m_offset),
          -
          3280 m_size(other.m_size),
          -
          3281 m_reserved(other.m_size),
          -
          3282 m_manage(true)
          -
          3283#if SET_FILE_OP_TIMES
          -
          3284 , m_ctime(other.m_ctime)
          -
          3285 , m_atime(other.m_atime)
          -
          3286 , m_mtime(other.m_mtime)
          -
          3287#endif
          -
          3288 {
          -
          3289 if (!m_data) {
          -
          3290 m_state = state_t::fail;
          -
          3291 throw std::bad_alloc();
          -
          3292 }
          -
          3293 memcpy(m_data, other.m_data, other.m_size);
          -
          3294 }
          +
          3288
          +
          + +
          3295 {
          +
          3296 if (this != std::addressof(other)) {
          +
          3297 *static_cast<basic_file*>(this) = other;
          +
          3298 if (m_manage && m_data)
          +
          3299 free(m_data);
          +
          3300 m_data = reinterpret_cast<uint8_t*>(malloc(other.m_size));
          +
          3301 if (!m_data) {
          +
          3302 m_state = state_t::fail;
          +
          3303 throw std::bad_alloc();
          +
          3304 }
          +
          3305 memcpy(m_data, other.m_data, other.m_size);
          +
          3306 m_offset = other.m_offset;
          +
          3307 m_size = other.m_size;
          +
          3308 m_reserved = other.m_size;
          +
          3309 m_manage = true;
          +
          3310#if SET_FILE_OP_TIMES
          +
          3311 m_ctime = other.m_ctime;
          +
          3312 m_atime = other.m_atime;
          +
          3313 m_mtime = other.m_mtime;
          +
          3314#endif
          +
          3315 }
          +
          3316 return *this;
          +
          3317 }
          -
          3295
          -
          - -
          3302 {
          -
          3303 if (this != std::addressof(other)) {
          -
          3304 *static_cast<basic_file*>(this) = other;
          -
          3305 if (m_manage && m_data)
          -
          3306 free(m_data);
          -
          3307 m_data = reinterpret_cast<uint8_t*>(malloc(other.m_size));
          -
          3308 if (!m_data) {
          -
          3309 m_state = state_t::fail;
          -
          3310 throw std::bad_alloc();
          -
          3311 }
          -
          3312 memcpy(m_data, other.m_data, other.m_size);
          -
          3313 m_offset = other.m_offset;
          -
          3314 m_size = other.m_size;
          -
          3315 m_reserved = other.m_size;
          -
          3316 m_manage = true;
          -
          3317#if SET_FILE_OP_TIMES
          -
          3318 m_ctime = other.m_ctime;
          -
          3319 m_atime = other.m_atime;
          -
          3320 m_mtime = other.m_mtime;
          -
          3321#endif
          -
          3322 }
          -
          3323 return *this;
          -
          3324 }
          +
          3318
          +
          +
          3324 memory_file(_Inout_ memory_file&& other) noexcept :
          +
          3325 basic_file(std::move(other)),
          +
          3326 m_data(other.m_data),
          +
          3327 m_offset(other.m_offset),
          +
          3328 m_size(other.m_size),
          +
          3329 m_reserved(other.m_reserved),
          +
          3330 m_manage(other.m_manage)
          +
          3331#if SET_FILE_OP_TIMES
          +
          3332 , m_ctime(other.m_ctime)
          +
          3333 , m_atime(other.m_atime)
          +
          3334 , m_mtime(other.m_mtime)
          +
          3335#endif
          +
          3336 {
          +
          3337 other.m_state = state_t::ok;
          +
          3338 other.m_data = nullptr;
          +
          3339 other.m_offset = 0;
          +
          3340 other.m_size = 0;
          +
          3341 other.m_reserved = 0;
          +
          3342 other.m_manage = true;
          +
          3343#if SET_FILE_OP_TIMES
          +
          3344 other.m_ctime = other.m_atime = other.m_mtime = time_point::now();
          +
          3345#endif
          +
          3346 }
          -
          3325
          -
          -
          3331 memory_file(_Inout_ memory_file&& other) noexcept :
          -
          3332 basic_file(std::move(other)),
          -
          3333 m_data(other.m_data),
          -
          3334 m_offset(other.m_offset),
          -
          3335 m_size(other.m_size),
          -
          3336 m_reserved(other.m_reserved),
          -
          3337 m_manage(other.m_manage)
          -
          3338#if SET_FILE_OP_TIMES
          -
          3339 , m_ctime(other.m_ctime)
          -
          3340 , m_atime(other.m_atime)
          -
          3341 , m_mtime(other.m_mtime)
          -
          3342#endif
          -
          3343 {
          -
          3344 other.m_state = state_t::ok;
          -
          3345 other.m_data = nullptr;
          -
          3346 other.m_offset = 0;
          -
          3347 other.m_size = 0;
          -
          3348 other.m_reserved = 0;
          -
          3349 other.m_manage = true;
          -
          3350#if SET_FILE_OP_TIMES
          -
          3351 other.m_ctime = other.m_atime = other.m_mtime = time_point::now();
          -
          3352#endif
          -
          3353 }
          +
          3347
          +
          +
          3353 memory_file& operator=(_Inout_ memory_file&& other) noexcept
          +
          3354 {
          +
          3355 if (this != std::addressof(other)) {
          +
          3356 *static_cast<basic_file*>(this) = std::move(other);
          +
          3357 if (m_manage && m_data)
          +
          3358 free(m_data);
          +
          3359 m_data = other.m_data;
          +
          3360 other.m_data = nullptr;
          +
          3361 m_offset = other.m_offset;
          +
          3362 other.m_offset = 0;
          +
          3363 m_size = other.m_size;
          +
          3364 other.m_size = 0;
          +
          3365 m_reserved = other.m_reserved;
          +
          3366 other.m_reserved = 0;
          +
          3367 m_manage = other.m_manage;
          +
          3368 other.m_manage = true;
          +
          3369#if SET_FILE_OP_TIMES
          +
          3370 m_ctime = other.m_ctime;
          +
          3371 m_atime = other.m_atime;
          +
          3372 m_mtime = other.m_mtime;
          +
          3373 other.m_ctime = other.m_atime = other.m_mtime = time_point::now();
          +
          3374#endif
          +
          3375 }
          +
          3376 return *this;
          +
          3377 }
          -
          3354
          -
          -
          3360 memory_file& operator=(_Inout_ memory_file&& other) noexcept
          -
          3361 {
          -
          3362 if (this != std::addressof(other)) {
          -
          3363 *static_cast<basic_file*>(this) = std::move(other);
          -
          3364 if (m_manage && m_data)
          -
          3365 free(m_data);
          -
          3366 m_data = other.m_data;
          -
          3367 other.m_data = nullptr;
          -
          3368 m_offset = other.m_offset;
          -
          3369 other.m_offset = 0;
          -
          3370 m_size = other.m_size;
          -
          3371 other.m_size = 0;
          -
          3372 m_reserved = other.m_reserved;
          -
          3373 other.m_reserved = 0;
          -
          3374 m_manage = other.m_manage;
          -
          3375 other.m_manage = true;
          -
          3376#if SET_FILE_OP_TIMES
          -
          3377 m_ctime = other.m_ctime;
          -
          3378 m_atime = other.m_atime;
          -
          3379 m_mtime = other.m_mtime;
          -
          3380 other.m_ctime = other.m_atime = other.m_mtime = time_point::now();
          -
          3381#endif
          -
          3382 }
          -
          3383 return *this;
          -
          3384 }
          +
          3378
          +
          3379 virtual ~memory_file()
          +
          3380 {
          +
          3381 if (m_manage && m_data)
          +
          3382 free(m_data);
          +
          3383 }
          +
          3384
          +
          +
          3391 void reserve(_In_ size_t required, _In_ bool tight = false) noexcept
          +
          3392 {
          +
          3393 if (required <= m_reserved && (!tight || required >= m_reserved)) {
          +
          3394 m_state = state_t::ok;
          +
          3395 return;
          +
          3396 }
          +
          3397 if (!m_manage) {
          +
          3398 m_state = state_t::fail;
          +
          3399 return;
          +
          3400 }
          +
          3401 size_t reserved = tight ? required : ((required + required / 4 + (default_block_size - 1)) / default_block_size) * default_block_size;
          +
          3402 auto data = reinterpret_cast<uint8_t*>(realloc(m_data, reserved));
          +
          3403 if (!data && reserved) _Unlikely_ {
          +
          3404 m_state = state_t::fail;
          +
          3405 return;
          +
          3406 }
          +
          3407 m_data = data;
          +
          3408 if (reserved < m_size)
          +
          3409 m_size = reserved;
          +
          3410 m_reserved = reserved;
          +
          3411 m_state = state_t::ok;
          +
          3412 }
          -
          3385
          -
          3386 virtual ~memory_file()
          -
          3387 {
          -
          3388 if (m_manage && m_data)
          -
          3389 free(m_data);
          -
          3390 }
          -
          3391
          -
          -
          3398 void reserve(_In_ size_t required, _In_ bool tight = false) noexcept
          -
          3399 {
          -
          3400 if (required <= m_reserved && (!tight || required >= m_reserved)) {
          -
          3401 m_state = state_t::ok;
          -
          3402 return;
          -
          3403 }
          -
          3404 if (!m_manage) {
          -
          3405 m_state = state_t::fail;
          -
          3406 return;
          -
          3407 }
          -
          3408 size_t reserved = tight ? required : ((required + required / 4 + (default_block_size - 1)) / default_block_size) * default_block_size;
          -
          3409 auto data = reinterpret_cast<uint8_t*>(realloc(m_data, reserved));
          -
          3410 if (!data && reserved) _Unlikely_ {
          -
          3411 m_state = state_t::fail;
          -
          3412 return;
          -
          3413 }
          -
          3414 m_data = data;
          -
          3415 if (reserved < m_size)
          -
          3416 m_size = reserved;
          -
          3417 m_reserved = reserved;
          -
          3418 m_state = state_t::ok;
          -
          3419 }
          +
          3413
          +
          +
          3420 void load(_In_z_ const schar_t* filename, _In_ int mode)
          +
          3421 {
          +
          3422 file f(filename, (mode & ~hint_random_access) | mode_for_reading | hint_sequential_access);
          +
          3423 if (!f.ok()) {
          +
          3424 m_state = state_t::fail;
          +
          3425 return;
          +
          3426 }
          +
          3427 fsize_t size = f.size();
          +
          3428 if (size > SIZE_MAX) {
          +
          3429 m_state = state_t::fail;
          +
          3430 return;
          +
          3431 }
          +
          3432 reserve(static_cast<size_t>(size), true);
          +
          3433 if (!ok()) _Unlikely_ {
          +
          3434 return;
          +
          3435 }
          +
          3436 m_offset = m_size = 0;
          +
          3437 write_stream(f);
          +
          3438 if (ok())
          +
          3439 m_offset = 0;
          +
          3440#if SET_FILE_OP_TIMES
          +
          3441 m_ctime = f.ctime();
          +
          3442 m_atime = f.atime();
          +
          3443 m_mtime = f.mtime();
          +
          3444#endif
          +
          3445 }
          -
          3420
          -
          -
          3427 void load(_In_z_ const schar_t* filename, _In_ int mode)
          -
          3428 {
          -
          3429 file f(filename, (mode & ~hint_random_access) | mode_for_reading | hint_sequential_access);
          -
          3430 if (!f.ok()) {
          -
          3431 m_state = state_t::fail;
          -
          3432 return;
          -
          3433 }
          -
          3434 fsize_t size = f.size();
          -
          3435 if (size > SIZE_MAX) {
          -
          3436 m_state = state_t::fail;
          -
          3437 return;
          -
          3438 }
          -
          3439 reserve(static_cast<size_t>(size), true);
          -
          3440 if (!ok()) _Unlikely_ {
          -
          3441 return;
          -
          3442 }
          -
          3443 m_offset = m_size = 0;
          -
          3444 write_stream(f);
          -
          3445 if (ok())
          -
          3446 m_offset = 0;
          -
          3447#if SET_FILE_OP_TIMES
          -
          3448 m_ctime = f.ctime();
          -
          3449 m_atime = f.atime();
          -
          3450 m_mtime = f.mtime();
          -
          3451#endif
          -
          3452 }
          +
          3446
          +
          +
          3453 inline void load(_In_ const stdex::sstring& filename, _In_ int mode)
          +
          3454 {
          +
          3455 load(filename.c_str(), mode);
          +
          3456 }
          -
          3453
          -
          -
          3460 inline void load(_In_ const stdex::sstring& filename, _In_ int mode)
          -
          3461 {
          -
          3462 load(filename.c_str(), mode);
          -
          3463 }
          +
          3457
          +
          +
          3464 void save(_In_z_ const schar_t* filename, _In_ int mode)
          +
          3465 {
          +
          3466 file f(filename, (mode & ~hint_random_access) | mode_for_writing | hint_sequential_access);
          +
          3467 if (!f.ok()) {
          +
          3468 m_state = state_t::fail;
          +
          3469 return;
          +
          3470 }
          +
          3471 f.write(m_data, m_size);
          +
          3472 if (!f.ok()) {
          +
          3473 m_state = state_t::fail;
          +
          3474 return;
          +
          3475 }
          +
          3476 f.truncate();
          +
          3477#if SET_FILE_OP_TIMES
          +
          3478 f.set_ctime(m_ctime);
          +
          3479 f.set_atime(m_atime);
          +
          3480 f.set_mtime(m_mtime);
          +
          3481#endif
          +
          3482 }
          -
          3464
          -
          -
          3471 void save(_In_z_ const schar_t* filename, _In_ int mode)
          -
          3472 {
          -
          3473 file f(filename, (mode & ~hint_random_access) | mode_for_writing | hint_sequential_access);
          -
          3474 if (!f.ok()) {
          -
          3475 m_state = state_t::fail;
          -
          3476 return;
          -
          3477 }
          -
          3478 f.write(m_data, m_size);
          -
          3479 if (!f.ok()) {
          -
          3480 m_state = state_t::fail;
          -
          3481 return;
          -
          3482 }
          -
          3483 f.truncate();
          -
          3484#if SET_FILE_OP_TIMES
          -
          3485 f.set_ctime(m_ctime);
          -
          3486 f.set_atime(m_atime);
          -
          3487 f.set_mtime(m_mtime);
          -
          3488#endif
          -
          3489 }
          +
          3483
          +
          +
          3490 inline void save(_In_ const stdex::sstring& filename, _In_ int mode)
          +
          3491 {
          +
          3492 save(filename.c_str(), mode);
          +
          3493 }
          -
          3490
          -
          -
          3497 inline void save(_In_ const stdex::sstring& filename, _In_ int mode)
          -
          3498 {
          -
          3499 save(filename.c_str(), mode);
          -
          3500 }
          +
          3494
          +
          3498 inline const void* data() const { return m_data; }
          +
          3499
          +
          +
          3500 virtual _Success_(return != 0 || length == 0) size_t read(
          +
          3501 _Out_writes_bytes_to_opt_(length, return) void* data, _In_ size_t length)
          +
          3502 {
          +
          3503 _Assume_(data || !length);
          +
          3504#if SET_FILE_OP_TIMES
          +
          3505 m_atime = time_point::now();
          +
          3506#endif
          +
          3507 size_t available = m_size - m_offset;
          +
          3508 if (length <= available) {
          +
          3509 memcpy(data, m_data + m_offset, length);
          +
          3510 m_offset += length;
          +
          3511 m_state = state_t::ok;
          +
          3512 return length;
          +
          3513 }
          +
          3514 if (length && !available) {
          +
          3515 m_state = state_t::eof;
          +
          3516 return 0;
          +
          3517 }
          +
          3518 memcpy(data, m_data + m_offset, available);
          +
          3519 m_offset += available;
          +
          3520 m_state = state_t::ok;
          +
          3521 return available;
          +
          3522 }
          -
          3501
          -
          3505 inline const void* data() const { return m_data; }
          -
          3506
          -
          -
          3507 virtual _Success_(return != 0 || length == 0) size_t read(
          -
          3508 _Out_writes_bytes_to_opt_(length, return) void* data, _In_ size_t length)
          -
          3509 {
          -
          3510 _Assume_(data || !length);
          -
          3511#if SET_FILE_OP_TIMES
          -
          3512 m_atime = time_point::now();
          -
          3513#endif
          -
          3514 size_t available = m_size - m_offset;
          -
          3515 if (length <= available) {
          -
          3516 memcpy(data, m_data + m_offset, length);
          -
          3517 m_offset += length;
          -
          3518 m_state = state_t::ok;
          -
          3519 return length;
          -
          3520 }
          -
          3521 if (length && !available) {
          -
          3522 m_state = state_t::eof;
          -
          3523 return 0;
          -
          3524 }
          -
          3525 memcpy(data, m_data + m_offset, available);
          -
          3526 m_offset += available;
          -
          3527 m_state = state_t::ok;
          -
          3528 return available;
          -
          3529 }
          +
          3523
          +
          3538 template <class T>
          +
          +
          3539 inline memory_file& read_data(_Out_ T& data)
          +
          3540 {
          +
          3541#if SET_FILE_OP_TIMES
          +
          3542 m_atime = time_point::now();
          +
          3543#endif
          +
          3544 if (CHECK_STREAM_STATE && !ok()) _Unlikely_ {
          +
          3545 data = 0;
          +
          3546 return *this;
          +
          3547 }
          +
          3548 size_t end_offset = m_offset + sizeof(T);
          +
          3549 if (end_offset <= m_size) {
          +
          3550 data = LE2HE(*reinterpret_cast<T*>(m_data + m_offset));
          +
          3551 m_offset = end_offset;
          +
          3552#if !CHECK_STREAM_STATE
          +
          3553 m_state = state_t::ok;
          +
          3554#endif
          +
          3555 }
          +
          3556 else {
          +
          3557 data = 0;
          +
          3558 m_offset = m_size;
          +
          3559 m_state = state_t::eof;
          +
          3560 }
          +
          3561 return *this;
          +
          3562 }
          -
          3530
          -
          3545 template <class T>
          -
          -
          3546 inline memory_file& read_data(_Out_ T& data)
          -
          3547 {
          -
          3548#if SET_FILE_OP_TIMES
          -
          3549 m_atime = time_point::now();
          -
          3550#endif
          -
          3551 if (CHECK_STREAM_STATE && !ok()) _Unlikely_ {
          -
          3552 data = 0;
          -
          3553 return *this;
          -
          3554 }
          -
          3555 size_t end_offset = m_offset + sizeof(T);
          -
          3556 if (end_offset <= m_size) {
          -
          3557 data = LE2HE(*reinterpret_cast<T*>(m_data + m_offset));
          -
          3558 m_offset = end_offset;
          -
          3559#if !CHECK_STREAM_STATE
          -
          3560 m_state = state_t::ok;
          -
          3561#endif
          -
          3562 }
          -
          3563 else {
          -
          3564 data = 0;
          -
          3565 m_offset = m_size;
          -
          3566 m_state = state_t::eof;
          -
          3567 }
          -
          3568 return *this;
          -
          3569 }
          +
          3563
          +
          3578 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
          +
          +
          3579 memory_file& read_str(_Inout_ std::basic_string<_Elem, _Traits, _Ax>&data)
          +
          3580 {
          +
          3581#if SET_FILE_OP_TIMES
          +
          3582 m_atime = time_point::now();
          +
          3583#endif
          +
          3584 if (CHECK_STREAM_STATE && !ok()) _Unlikely_ {
          +
          3585 data.clear();
          +
          3586 return *this;
          +
          3587 }
          +
          3588 size_t end_offset = m_offset + sizeof(uint32_t);
          +
          3589 if (end_offset <= m_size) {
          +
          3590 uint32_t num_chars = LE2HE(*reinterpret_cast<uint32_t*>(m_data + m_offset));
          +
          3591 m_offset = end_offset;
          +
          3592 end_offset = stdex::add(m_offset, stdex::mul(num_chars, sizeof(_Elem)));
          +
          3593 _Elem* start = reinterpret_cast<_Elem*>(m_data + m_offset);
          +
          3594 if (end_offset <= m_size) {
          +
          3595 data.assign(start, start + num_chars);
          +
          3596 m_offset = end_offset;
          +
          3597#if !CHECK_STREAM_STATE
          +
          3598 m_state = state_t::ok;
          +
          3599#endif
          +
          3600 return *this;
          +
          3601 }
          +
          3602 if (end_offset <= m_size)
          +
          3603 data.assign(start, reinterpret_cast<_Elem*>(m_data + m_size));
          +
          3604 }
          +
          3605 m_offset = m_size;
          +
          3606 m_state = state_t::eof;
          +
          3607 return *this;
          +
          3608 }
          -
          3570
          -
          3585 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
          -
          -
          3586 memory_file& read_str(_Inout_ std::basic_string<_Elem, _Traits, _Ax>&data)
          -
          3587 {
          -
          3588#if SET_FILE_OP_TIMES
          -
          3589 m_atime = time_point::now();
          -
          3590#endif
          -
          3591 if (CHECK_STREAM_STATE && !ok()) _Unlikely_ {
          -
          3592 data.clear();
          -
          3593 return *this;
          -
          3594 }
          -
          3595 size_t end_offset = m_offset + sizeof(uint32_t);
          -
          3596 if (end_offset <= m_size) {
          -
          3597 uint32_t num_chars = LE2HE(*reinterpret_cast<uint32_t*>(m_data + m_offset));
          -
          3598 m_offset = end_offset;
          -
          3599 end_offset = stdex::add(m_offset, stdex::mul(num_chars, sizeof(_Elem)));
          -
          3600 _Elem* start = reinterpret_cast<_Elem*>(m_data + m_offset);
          -
          3601 if (end_offset <= m_size) {
          -
          3602 data.assign(start, start + num_chars);
          -
          3603 m_offset = end_offset;
          -
          3604#if !CHECK_STREAM_STATE
          -
          3605 m_state = state_t::ok;
          -
          3606#endif
          -
          3607 return *this;
          -
          3608 }
          -
          3609 if (end_offset <= m_size)
          -
          3610 data.assign(start, reinterpret_cast<_Elem*>(m_data + m_size));
          -
          3611 }
          -
          3612 m_offset = m_size;
          -
          3613 m_state = state_t::eof;
          -
          3614 return *this;
          -
          3615 }
          +
          3609
          +
          +
          3610 virtual _Success_(return != 0) size_t write(
          +
          3611 _In_reads_bytes_opt_(length) const void* data, _In_ size_t length)
          +
          3612 {
          +
          3613 _Assume_(data || !length);
          +
          3614#if SET_FILE_OP_TIMES
          +
          3615 m_atime = m_mtime = time_point::now();
          +
          3616#endif
          +
          3617 size_t end_offset = m_offset + length;
          +
          3618 if (end_offset > m_reserved) {
          +
          3619 reserve(end_offset);
          +
          3620 if (!ok()) _Unlikely_
          +
          3621 return 0;
          +
          3622 }
          +
          3623 memcpy(m_data + m_offset, data, length);
          +
          3624 m_offset = end_offset;
          +
          3625 if (m_offset > m_size)
          +
          3626 m_size = m_offset;
          +
          3627 m_state = state_t::ok;
          +
          3628 return length;
          +
          3629 }
          -
          3616
          -
          -
          3617 virtual _Success_(return != 0) size_t write(
          -
          3618 _In_reads_bytes_opt_(length) const void* data, _In_ size_t length)
          -
          3619 {
          -
          3620 _Assume_(data || !length);
          -
          3621#if SET_FILE_OP_TIMES
          -
          3622 m_atime = m_mtime = time_point::now();
          -
          3623#endif
          -
          3624 size_t end_offset = m_offset + length;
          -
          3625 if (end_offset > m_reserved) {
          -
          3626 reserve(end_offset);
          -
          3627 if (!ok()) _Unlikely_
          -
          3628 return 0;
          -
          3629 }
          -
          3630 memcpy(m_data + m_offset, data, length);
          -
          3631 m_offset = end_offset;
          -
          3632 if (m_offset > m_size)
          -
          3633 m_size = m_offset;
          -
          3634 m_state = state_t::ok;
          -
          3635 return length;
          -
          3636 }
          +
          3630
          +
          +
          3634 void write_byte(_In_ uint8_t byte, _In_ size_t amount = 1)
          +
          3635 {
          +
          3636#if SET_FILE_OP_TIMES
          +
          3637 m_atime = m_mtime = time_point::now();
          +
          3638#endif
          +
          3639 size_t end_offset = m_offset + amount;
          +
          3640 if (end_offset > m_reserved) {
          +
          3641 reserve(end_offset);
          +
          3642 if (!ok()) _Unlikely_
          +
          3643 return;
          +
          3644 }
          +
          3645 memset(m_data + m_offset, byte, amount);
          +
          3646 m_offset = end_offset;
          +
          3647 if (m_offset > m_size)
          +
          3648 m_size = m_offset;
          +
          3649 m_state = state_t::ok;
          +
          3650 }
          -
          3637
          -
          -
          3641 void write_byte(_In_ uint8_t byte, _In_ size_t amount = 1)
          -
          3642 {
          -
          3643#if SET_FILE_OP_TIMES
          -
          3644 m_atime = m_mtime = time_point::now();
          -
          3645#endif
          -
          3646 size_t end_offset = m_offset + amount;
          -
          3647 if (end_offset > m_reserved) {
          -
          3648 reserve(end_offset);
          -
          3649 if (!ok()) _Unlikely_
          -
          3650 return;
          -
          3651 }
          -
          3652 memset(m_data + m_offset, byte, amount);
          -
          3653 m_offset = end_offset;
          -
          3654 if (m_offset > m_size)
          -
          3655 m_size = m_offset;
          -
          3656 m_state = state_t::ok;
          -
          3657 }
          +
          3651
          +
          3666 template <class T>
          +
          +
          3667 inline memory_file& write_data(const T data)
          +
          3668 {
          +
          3669#if SET_FILE_OP_TIMES
          +
          3670 m_atime = m_mtime = time_point::now();
          +
          3671#endif
          +
          3672 if (CHECK_STREAM_STATE && !ok()) _Unlikely_
          +
          3673 return *this;
          +
          3674 size_t end_offset = m_offset + sizeof(T);
          +
          3675 if (end_offset > m_reserved) {
          +
          3676 reserve(end_offset);
          +
          3677 if (!ok()) _Unlikely_
          +
          3678 return *this;
          +
          3679 }
          +
          3680 (*reinterpret_cast<T*>(m_data + m_offset)) = HE2LE(data);
          +
          3681 m_offset = end_offset;
          +
          3682 if (m_offset > m_size)
          +
          3683 m_size = m_offset;
          +
          3684#if !CHECK_STREAM_STATE
          +
          3685 m_state = state_t::ok;
          +
          3686#endif
          +
          3687 return *this;
          +
          3688 }
          -
          3658
          -
          3673 template <class T>
          -
          -
          3674 inline memory_file& write_data(const T data)
          -
          3675 {
          -
          3676#if SET_FILE_OP_TIMES
          -
          3677 m_atime = m_mtime = time_point::now();
          -
          3678#endif
          -
          3679 if (CHECK_STREAM_STATE && !ok()) _Unlikely_
          -
          3680 return *this;
          -
          3681 size_t end_offset = m_offset + sizeof(T);
          -
          3682 if (end_offset > m_reserved) {
          -
          3683 reserve(end_offset);
          -
          3684 if (!ok()) _Unlikely_
          -
          3685 return *this;
          -
          3686 }
          -
          3687 (*reinterpret_cast<T*>(m_data + m_offset)) = HE2LE(data);
          -
          3688 m_offset = end_offset;
          -
          3689 if (m_offset > m_size)
          -
          3690 m_size = m_offset;
          -
          3691#if !CHECK_STREAM_STATE
          -
          3692 m_state = state_t::ok;
          -
          3693#endif
          -
          3694 return *this;
          -
          3695 }
          +
          3689
          +
          3704 template <class T>
          +
          +
          3705 inline memory_file& write_str(_In_z_ const T * data)
          +
          3706 {
          +
          3707#if SET_FILE_OP_TIMES
          +
          3708 m_atime = m_mtime = time_point::now();
          +
          3709#endif
          +
          3710 if (CHECK_STREAM_STATE && !ok()) _Unlikely_
          +
          3711 return *this;
          +
          3712 size_t num_chars = stdex::strlen(data);
          +
          3713 if (num_chars > UINT32_MAX)
          +
          3714 throw std::invalid_argument("string too long");
          +
          3715 size_t size_chars = num_chars * sizeof(T);
          +
          3716 size_t size = sizeof(uint32_t) + size_chars;
          +
          3717 size_t end_offset = m_offset + size;
          +
          3718 if (end_offset > m_reserved) {
          +
          3719 reserve(end_offset);
          +
          3720 if (!ok()) _Unlikely_
          +
          3721 return *this;
          +
          3722 }
          +
          3723 auto p = m_data + m_offset;
          +
          3724 *reinterpret_cast<uint32_t*>(p) = HE2LE((uint32_t)num_chars);
          +
          3725 memcpy(p + sizeof(uint32_t), data, size_chars);
          +
          3726 m_offset = end_offset;
          +
          3727 if (m_offset > m_size)
          +
          3728 m_size = m_offset;
          +
          3729#if !CHECK_STREAM_STATE
          +
          3730 m_state = state_t::ok;
          +
          3731#endif
          +
          3732 return *this;
          +
          3733 }
          -
          3696
          -
          3711 template <class T>
          -
          -
          3712 inline memory_file& write_str(_In_z_ const T * data)
          -
          3713 {
          -
          3714#if SET_FILE_OP_TIMES
          -
          3715 m_atime = m_mtime = time_point::now();
          -
          3716#endif
          -
          3717 if (CHECK_STREAM_STATE && !ok()) _Unlikely_
          -
          3718 return *this;
          -
          3719 size_t num_chars = stdex::strlen(data);
          -
          3720 if (num_chars > UINT32_MAX)
          -
          3721 throw std::invalid_argument("string too long");
          -
          3722 size_t size_chars = num_chars * sizeof(T);
          -
          3723 size_t size = sizeof(uint32_t) + size_chars;
          -
          3724 size_t end_offset = m_offset + size;
          -
          3725 if (end_offset > m_reserved) {
          -
          3726 reserve(end_offset);
          -
          3727 if (!ok()) _Unlikely_
          -
          3728 return *this;
          -
          3729 }
          -
          3730 auto p = m_data + m_offset;
          -
          3731 *reinterpret_cast<uint32_t*>(p) = HE2LE((uint32_t)num_chars);
          -
          3732 memcpy(p + sizeof(uint32_t), data, size_chars);
          -
          3733 m_offset = end_offset;
          -
          3734 if (m_offset > m_size)
          -
          3735 m_size = m_offset;
          -
          3736#if !CHECK_STREAM_STATE
          -
          3737 m_state = state_t::ok;
          -
          3738#endif
          -
          3739 return *this;
          -
          3740 }
          +
          3734
          +
          3749 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
          +
          +
          3750 inline memory_file& write_str(_In_ const std::basic_string<_Elem, _Traits, _Ax>& data)
          +
          3751 {
          +
          3752#if SET_FILE_OP_TIMES
          +
          3753 m_atime = m_mtime = time_point::now();
          +
          3754#endif
          +
          3755 if (CHECK_STREAM_STATE && !ok()) _Unlikely_
          +
          3756 return *this;
          +
          3757 size_t num_chars = data.size();
          +
          3758 if (num_chars > UINT32_MAX)
          +
          3759 throw std::invalid_argument("string too long");
          +
          3760 size_t size_chars = num_chars * sizeof(_Elem);
          +
          3761 size_t size = sizeof(uint32_t) + size_chars;
          +
          3762 size_t end_offset = m_offset + size;
          +
          3763 if (end_offset > m_reserved) {
          +
          3764 reserve(end_offset);
          +
          3765 if (!ok()) _Unlikely_
          +
          3766 return *this;
          +
          3767 }
          +
          3768 auto p = m_data + m_offset;
          +
          3769 *reinterpret_cast<uint32_t*>(p) = HE2LE((uint32_t)num_chars);
          +
          3770 memcpy(p + sizeof(uint32_t), data.data(), size_chars);
          +
          3771 m_offset = end_offset;
          +
          3772 if (m_offset > m_size)
          +
          3773 m_size = m_offset;
          +
          3774#if !CHECK_STREAM_STATE
          +
          3775 m_state = state_t::ok;
          +
          3776#endif
          +
          3777 return *this;
          +
          3778 }
          -
          3741
          -
          3756 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
          -
          -
          3757 inline memory_file& write_str(_In_ const std::basic_string<_Elem, _Traits, _Ax>& data)
          -
          3758 {
          -
          3759#if SET_FILE_OP_TIMES
          -
          3760 m_atime = m_mtime = time_point::now();
          -
          3761#endif
          -
          3762 if (CHECK_STREAM_STATE && !ok()) _Unlikely_
          -
          3763 return *this;
          -
          3764 size_t num_chars = data.size();
          -
          3765 if (num_chars > UINT32_MAX)
          -
          3766 throw std::invalid_argument("string too long");
          -
          3767 size_t size_chars = num_chars * sizeof(_Elem);
          -
          3768 size_t size = sizeof(uint32_t) + size_chars;
          -
          3769 size_t end_offset = m_offset + size;
          -
          3770 if (end_offset > m_reserved) {
          -
          3771 reserve(end_offset);
          -
          3772 if (!ok()) _Unlikely_
          -
          3773 return *this;
          -
          3774 }
          -
          3775 auto p = m_data + m_offset;
          -
          3776 *reinterpret_cast<uint32_t*>(p) = HE2LE((uint32_t)num_chars);
          -
          3777 memcpy(p + sizeof(uint32_t), data.data(), size_chars);
          -
          3778 m_offset = end_offset;
          -
          3779 if (m_offset > m_size)
          -
          3780 m_size = m_offset;
          -
          3781#if !CHECK_STREAM_STATE
          -
          3782 m_state = state_t::ok;
          -
          3783#endif
          -
          3784 return *this;
          -
          3785 }
          +
          3779
          +
          +
          3785 size_t write_stream(_Inout_ basic & stream, _In_ size_t amount = SIZE_MAX)
          +
          3786 {
          +
          3787#if SET_FILE_OP_TIMES
          +
          3788 m_atime = m_mtime = time_point::now();
          +
          3789#endif
          +
          3790 size_t num_read, dst_offset = m_offset, dst_size = m_offset;
          +
          3791 size_t num_copied = 0, to_write = amount;
          +
          3792 m_state = state_t::ok;
          +
          3793 if (amount != SIZE_MAX) {
          +
          3794 dst_size = stdex::add(dst_size, amount);
          +
          3795 reserve(dst_size);
          +
          3796 if (!ok()) _Unlikely_
          +
          3797 return 0;
          +
          3798 while (to_write) {
          +
          3799 num_read = stream.read(m_data + dst_offset, to_write);
          +
          3800 dst_size = dst_offset += num_read;
          +
          3801 num_copied += num_read;
          +
          3802 to_write -= num_read;
          +
          3803 if (!stream.ok()) {
          +
          3804 if (stream.state() != state_t::eof)
          +
          3805 m_state = state_t::fail;
          +
          3806 break;
          +
          3807 }
          +
          3808 };
          +
          3809 }
          +
          3810 else {
          +
          3811 size_t block_size;
          +
          3812 while (to_write) {
          +
          3813 block_size = std::min(to_write, default_block_size);
          +
          3814 dst_size = stdex::add(dst_size, block_size);
          +
          3815 reserve(dst_size);
          +
          3816 if (!ok()) _Unlikely_
          +
          3817 break;
          +
          3818 num_read = stream.read(m_data + dst_offset, block_size);
          +
          3819 dst_size = dst_offset += num_read;
          +
          3820 num_copied += num_read;
          +
          3821 to_write -= num_read;
          +
          3822 if (!stream.ok()) {
          +
          3823 if (stream.state() != state_t::eof)
          +
          3824 m_state = state_t::fail;
          +
          3825 break;
          +
          3826 }
          +
          3827 };
          +
          3828 }
          +
          3829 m_offset = dst_offset;
          +
          3830 if (m_offset > m_size)
          +
          3831 m_size = m_offset;
          +
          3832 return num_copied;
          +
          3833 }
          -
          3786
          -
          -
          3792 size_t write_stream(_Inout_ basic & stream, _In_ size_t amount = SIZE_MAX)
          -
          3793 {
          -
          3794#if SET_FILE_OP_TIMES
          -
          3795 m_atime = m_mtime = time_point::now();
          -
          3796#endif
          -
          3797 size_t num_read, dst_offset = m_offset, dst_size = m_offset;
          -
          3798 size_t num_copied = 0, to_write = amount;
          -
          3799 m_state = state_t::ok;
          -
          3800 if (amount != SIZE_MAX) {
          -
          3801 dst_size = stdex::add(dst_size, amount);
          -
          3802 reserve(dst_size);
          -
          3803 if (!ok()) _Unlikely_
          -
          3804 return 0;
          -
          3805 while (to_write) {
          -
          3806 num_read = stream.read(m_data + dst_offset, to_write);
          -
          3807 dst_size = dst_offset += num_read;
          -
          3808 num_copied += num_read;
          -
          3809 to_write -= num_read;
          -
          3810 if (!stream.ok()) {
          -
          3811 if (stream.state() != state_t::eof)
          -
          3812 m_state = state_t::fail;
          -
          3813 break;
          -
          3814 }
          -
          3815 };
          -
          3816 }
          -
          3817 else {
          -
          3818 size_t block_size;
          -
          3819 while (to_write) {
          -
          3820 block_size = std::min(to_write, default_block_size);
          -
          3821 dst_size = stdex::add(dst_size, block_size);
          -
          3822 reserve(dst_size);
          -
          3823 if (!ok()) _Unlikely_
          -
          3824 break;
          -
          3825 num_read = stream.read(m_data + dst_offset, block_size);
          -
          3826 dst_size = dst_offset += num_read;
          -
          3827 num_copied += num_read;
          -
          3828 to_write -= num_read;
          -
          3829 if (!stream.ok()) {
          -
          3830 if (stream.state() != state_t::eof)
          -
          3831 m_state = state_t::fail;
          -
          3832 break;
          -
          3833 }
          -
          3834 };
          -
          3835 }
          -
          3836 m_offset = dst_offset;
          -
          3837 if (m_offset > m_size)
          -
          3838 m_size = m_offset;
          -
          3839 return num_copied;
          -
          3840 }
          +
          3834
          +
          +
          3835 virtual void close()
          +
          3836 {
          +
          3837 if (m_manage && m_data)
          +
          3838 free(m_data);
          +
          3839 m_data = nullptr;
          +
          3840 m_manage = true;
          +
          3841 m_offset = 0;
          +
          3842 m_size = m_reserved = 0;
          +
          3843#if SET_FILE_OP_TIMES
          +
          3844 m_ctime = m_atime = m_mtime = time_point::min();
          +
          3845#endif
          +
          3846 m_state = state_t::ok;
          +
          3847 }
          -
          3841
          -
          -
          3842 virtual void close()
          -
          3843 {
          -
          3844 if (m_manage && m_data)
          -
          3845 free(m_data);
          -
          3846 m_data = nullptr;
          -
          3847 m_manage = true;
          -
          3848 m_offset = 0;
          -
          3849 m_size = m_reserved = 0;
          -
          3850#if SET_FILE_OP_TIMES
          -
          3851 m_ctime = m_atime = m_mtime = time_point::min();
          -
          3852#endif
          -
          3853 m_state = state_t::ok;
          -
          3854 }
          +
          3848
          +
          +
          3849 virtual fpos_t seek(_In_ foff_t offset, _In_ seek_t how = seek_t::beg)
          +
          3850 {
          +
          3851 fpos_t target;
          +
          3852 switch (how) {
          +
          3853 case seek_t::beg: target = offset; break;
          +
          3854 case seek_t::cur: target = static_cast<fpos_t>(m_offset) + offset; break;
          +
          3855 case seek_t::end: target = static_cast<fpos_t>(m_size) + offset; break;
          +
          3856 default: throw std::invalid_argument("unknown seek origin");
          +
          3857 }
          +
          3858 if (target <= SIZE_MAX) {
          +
          3859 m_state = state_t::ok;
          +
          3860 return m_offset = static_cast<size_t>(target);
          +
          3861 }
          +
          3862 m_state = state_t::fail;
          +
          3863 return fpos_max;
          +
          3864 }
          -
          3855
          -
          -
          3856 virtual fpos_t seek(_In_ foff_t offset, _In_ seek_t how = seek_t::beg)
          -
          3857 {
          -
          3858 fpos_t target;
          -
          3859 switch (how) {
          -
          3860 case seek_t::beg: target = offset; break;
          -
          3861 case seek_t::cur: target = static_cast<fpos_t>(m_offset) + offset; break;
          -
          3862 case seek_t::end: target = static_cast<fpos_t>(m_size) + offset; break;
          -
          3863 default: throw std::invalid_argument("unknown seek origin");
          -
          3864 }
          -
          3865 if (target <= SIZE_MAX) {
          -
          3866 m_state = state_t::ok;
          -
          3867 return m_offset = static_cast<size_t>(target);
          -
          3868 }
          -
          3869 m_state = state_t::fail;
          -
          3870 return fpos_max;
          -
          3871 }
          +
          3865
          +
          +
          3866 virtual fpos_t tell() const
          +
          3867 {
          +
          3868 return m_offset;
          +
          3869 }
          -
          3872
          -
          -
          3873 virtual fpos_t tell() const
          -
          3874 {
          -
          3875 return m_offset;
          -
          3876 }
          +
          3870
          +
          +
          3871 virtual fsize_t size() const
          +
          3872 {
          +
          3873 return m_size;
          +
          3874 }
          -
          3877
          -
          -
          3878 virtual fsize_t size() const
          -
          3879 {
          -
          3880 return m_size;
          -
          3881 }
          +
          3875
          +
          +
          3876 virtual void truncate()
          +
          3877 {
          +
          3878#if SET_FILE_OP_TIMES
          +
          3879 m_atime = m_mtime = time_point::now();
          +
          3880#endif
          +
          3881 m_size = m_offset;
          + +
          3883 }
          -
          3882
          -
          -
          3883 virtual void truncate()
          -
          3884 {
          +
          3884
          3885#if SET_FILE_OP_TIMES
          -
          3886 m_atime = m_mtime = time_point::now();
          -
          3887#endif
          -
          3888 m_size = m_offset;
          - -
          3890 }
          +
          3886 virtual time_point ctime() const
          +
          3887 {
          +
          3888 return m_ctime;
          +
          3889 }
          +
          3890
          +
          3891 virtual time_point atime() const
          +
          3892 {
          +
          3893 return m_atime;
          +
          3894 }
          +
          3895
          +
          3896 virtual time_point mtime() const
          +
          3897 {
          +
          3898 return m_mtime;
          +
          3899 }
          +
          3900
          +
          3901 virtual void set_ctime(time_point date)
          +
          3902 {
          +
          3903 m_ctime = date;
          +
          3904 }
          +
          3905
          +
          3906 virtual void set_atime(time_point date)
          +
          3907 {
          +
          3908 m_atime = date;
          +
          3909 }
          +
          3910
          +
          3911 virtual void set_mtime(time_point date)
          +
          3912 {
          +
          3913 m_mtime = date;
          +
          3914 }
          +
          3915#endif
          +
          3916
          +
          3917 protected:
          +
          3925 template <class T>
          +
          +
          3926 inline void set(_In_ fpos_t offset, _In_ const T data)
          +
          3927 {
          +
          3928#if SET_FILE_OP_TIMES
          +
          3929 m_atime = m_mtime = time_point::now();
          +
          3930#endif
          +
          3931 _Assume_(offset + sizeof(T) < m_size);
          +
          3932 (*reinterpret_cast<T*>(m_data + offset)) = HE2LE(data);
          +
          3933 }
          -
          3891
          -
          3892#if SET_FILE_OP_TIMES
          -
          3893 virtual time_point ctime() const
          -
          3894 {
          -
          3895 return m_ctime;
          -
          3896 }
          -
          3897
          -
          3898 virtual time_point atime() const
          -
          3899 {
          -
          3900 return m_atime;
          -
          3901 }
          -
          3902
          -
          3903 virtual time_point mtime() const
          -
          3904 {
          -
          3905 return m_mtime;
          -
          3906 }
          -
          3907
          -
          3908 virtual void set_ctime(time_point date)
          -
          3909 {
          -
          3910 m_ctime = date;
          -
          3911 }
          -
          3912
          -
          3913 virtual void set_atime(time_point date)
          -
          3914 {
          -
          3915 m_atime = date;
          -
          3916 }
          -
          3917
          -
          3918 virtual void set_mtime(time_point date)
          -
          3919 {
          -
          3920 m_mtime = date;
          -
          3921 }
          -
          3922#endif
          -
          3923
          -
          3924 protected:
          -
          3932 template <class T>
          -
          -
          3933 inline void set(_In_ fpos_t offset, _In_ const T data)
          -
          3934 {
          -
          3935#if SET_FILE_OP_TIMES
          -
          3936 m_atime = m_mtime = time_point::now();
          -
          3937#endif
          -
          3938 _Assume_(offset + sizeof(T) < m_size);
          -
          3939 (*reinterpret_cast<T*>(m_data + offset)) = HE2LE(data);
          -
          3940 }
          +
          3934
          +
          3935 public:
          +
          3936 inline void set(_In_ fpos_t offset, _In_ const int8_t data) { set<int8_t>(offset, data); }
          +
          3937 inline void set(_In_ fpos_t offset, _In_ const int16_t data) { set<int16_t>(offset, data); }
          +
          3938 inline void set(_In_ fpos_t offset, _In_ const int32_t data) { set<int32_t>(offset, data); }
          +
          3939 inline void set(_In_ fpos_t offset, _In_ const int64_t data) { set<int64_t>(offset, data); }
          +
          3940 inline void set(_In_ fpos_t offset, _In_ const uint8_t data) { set<uint8_t>(offset, data); }
          +
          3941 inline void set(_In_ fpos_t offset, _In_ const uint16_t data) { set<uint16_t>(offset, data); }
          +
          3942 inline void set(_In_ fpos_t offset, _In_ const uint32_t data) { set<uint32_t>(offset, data); }
          +
          3943 inline void set(_In_ fpos_t offset, _In_ const uint64_t data) { set<uint64_t>(offset, data); }
          +
          3944 inline void set(_In_ fpos_t offset, _In_ const float data) { set<float>(offset, data); }
          +
          3945 inline void set(_In_ fpos_t offset, _In_ const double data) { set<double>(offset, data); }
          +
          3946 inline void set(_In_ fpos_t offset, _In_ const char data) { set<char>(offset, data); }
          +
          3947#ifdef _NATIVE_WCHAR_T_DEFINED
          +
          3948 inline void set(_In_ fpos_t offset, _In_ const wchar_t data) { set<wchar_t>(offset, data); }
          +
          3949#endif
          +
          3950
          +
          3958 protected:
          +
          3959 template <class T>
          +
          +
          3960 inline void get(_In_ fpos_t offset, _Out_ T & data)
          +
          3961 {
          +
          3962 _Assume_(offset + sizeof(T) < m_size);
          +
          3963 data = LE2HE(*(T*)(m_data + offset));
          +
          3964#if SET_FILE_OP_TIMES
          +
          3965 m_atime = time_point::now();
          +
          3966#endif
          +
          3967 }
          -
          3941
          -
          3942 public:
          -
          3943 inline void set(_In_ fpos_t offset, _In_ const int8_t data) { set<int8_t>(offset, data); }
          -
          3944 inline void set(_In_ fpos_t offset, _In_ const int16_t data) { set<int16_t>(offset, data); }
          -
          3945 inline void set(_In_ fpos_t offset, _In_ const int32_t data) { set<int32_t>(offset, data); }
          -
          3946 inline void set(_In_ fpos_t offset, _In_ const int64_t data) { set<int64_t>(offset, data); }
          -
          3947 inline void set(_In_ fpos_t offset, _In_ const uint8_t data) { set<uint8_t>(offset, data); }
          -
          3948 inline void set(_In_ fpos_t offset, _In_ const uint16_t data) { set<uint16_t>(offset, data); }
          -
          3949 inline void set(_In_ fpos_t offset, _In_ const uint32_t data) { set<uint32_t>(offset, data); }
          -
          3950 inline void set(_In_ fpos_t offset, _In_ const uint64_t data) { set<uint64_t>(offset, data); }
          -
          3951 inline void set(_In_ fpos_t offset, _In_ const float data) { set<float>(offset, data); }
          -
          3952 inline void set(_In_ fpos_t offset, _In_ const double data) { set<double>(offset, data); }
          -
          3953 inline void set(_In_ fpos_t offset, _In_ const char data) { set<char>(offset, data); }
          -
          3954#ifdef _NATIVE_WCHAR_T_DEFINED
          -
          3955 inline void set(_In_ fpos_t offset, _In_ const wchar_t data) { set<wchar_t>(offset, data); }
          -
          3956#endif
          -
          3957
          -
          3965 protected:
          -
          3966 template <class T>
          -
          -
          3967 inline void get(_In_ fpos_t offset, _Out_ T & data)
          -
          3968 {
          -
          3969 _Assume_(offset + sizeof(T) < m_size);
          -
          3970 data = LE2HE(*(T*)(m_data + offset));
          -
          3971#if SET_FILE_OP_TIMES
          -
          3972 m_atime = time_point::now();
          -
          3973#endif
          -
          3974 }
          +
          3968
          +
          3969 public:
          +
          3970 inline void get(_In_ fpos_t offset, _Out_ int8_t & data) { get<int8_t>(offset, data); }
          +
          3971 inline void get(_In_ fpos_t offset, _Out_ int16_t & data) { get<int16_t>(offset, data); }
          +
          3972 inline void get(_In_ fpos_t offset, _Out_ int32_t & data) { get<int32_t>(offset, data); }
          +
          3973 inline void get(_In_ fpos_t offset, _Out_ int64_t & data) { get<int64_t>(offset, data); }
          +
          3974 inline void get(_In_ fpos_t offset, _Out_ uint8_t & data) { get<uint8_t>(offset, data); }
          +
          3975 inline void get(_In_ fpos_t offset, _Out_ uint16_t & data) { get<uint16_t>(offset, data); }
          +
          3976 inline void get(_In_ fpos_t offset, _Out_ uint32_t & data) { get<uint32_t>(offset, data); }
          +
          3977 inline void get(_In_ fpos_t offset, _Out_ uint64_t & data) { get<uint64_t>(offset, data); }
          +
          3978 inline void get(_In_ fpos_t offset, _Out_ float& data) { get<float>(offset, data); }
          +
          3979 inline void get(_In_ fpos_t offset, _Out_ double& data) { get<double>(offset, data); }
          +
          3980 inline void get(_In_ fpos_t offset, _Out_ char& data) { get<char>(offset, data); }
          +
          3981#ifdef _NATIVE_WCHAR_T_DEFINED
          +
          3982 inline void get(_In_ fpos_t offset, _Out_ wchar_t& data) { get<wchar_t>(offset, data); }
          +
          3983#endif
          +
          3984
          +
          3985 inline memory_file& operator <<(_In_ const int8_t data) { return write_data(data); }
          +
          3986 inline memory_file& operator >>(_Out_ int8_t & data) { return read_data(data); }
          +
          3987 inline memory_file& operator <<(_In_ const int16_t data) { return write_data(data); }
          +
          3988 inline memory_file& operator >>(_Out_ int16_t & data) { return read_data(data); }
          +
          3989 inline memory_file& operator <<(_In_ const int32_t data) { return write_data(data); }
          +
          3990 inline memory_file& operator >>(_Out_ int32_t & data) { return read_data(data); }
          +
          3991 inline memory_file& operator <<(_In_ const int64_t data) { return write_data(data); }
          +
          3992 inline memory_file& operator >>(_Out_ int64_t & data) { return read_data(data); }
          +
          3993 inline memory_file& operator <<(_In_ const uint8_t data) { return write_data(data); }
          +
          3994 inline memory_file& operator >>(_Out_ uint8_t & data) { return read_data(data); }
          +
          3995 inline memory_file& operator <<(_In_ const uint16_t data) { return write_data(data); }
          +
          3996 inline memory_file& operator >>(_Out_ uint16_t & data) { return read_data(data); }
          +
          3997 inline memory_file& operator <<(_In_ const uint32_t data) { return write_data(data); }
          +
          3998 inline memory_file& operator >>(_Out_ uint32_t & data) { return read_data(data); }
          +
          3999 inline memory_file& operator <<(_In_ const uint64_t data) { return write_data(data); }
          +
          4000 inline memory_file& operator >>(_Out_ uint64_t & data) { return read_data(data); }
          +
          4001 inline memory_file& operator <<(_In_ const float data) { return write_data(data); }
          +
          4002 inline memory_file& operator >>(_Out_ float& data) { return read_data(data); }
          +
          4003 inline memory_file& operator <<(_In_ const double data) { return write_data(data); }
          +
          4004 inline memory_file& operator >>(_Out_ double& data) { return read_data(data); }
          +
          4005 inline memory_file& operator <<(_In_ const char data) { return write_data(data); }
          +
          4006 inline memory_file& operator >>(_Out_ char& data) { return read_data(data); }
          +
          4007#ifdef _NATIVE_WCHAR_T_DEFINED
          +
          4008 inline memory_file& operator <<(_In_ const wchar_t data) { return write_data(data); }
          +
          4009 inline memory_file& operator >>(_Out_ wchar_t& data) { return read_data(data); }
          +
          4010#endif
          +
          4011 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
          +
          4012 inline memory_file& operator >>(_Out_ std::basic_string<_Elem, _Traits, _Ax>&data) { return read_str(data); }
          +
          4013 template <class T>
          +
          4014 inline memory_file& operator <<(_In_ const T * data) { return write_str(data); }
          +
          4015 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
          +
          4016 inline memory_file& operator <<(_In_ const std::basic_string<_Elem, _Traits, _Ax>& data) { return write_str(data); }
          +
          4017
          +
          4018 protected:
          +
          4019 uint8_t* m_data;
          + +
          4021 size_t m_offset;
          +
          4022 size_t m_size;
          +
          4023 size_t m_reserved;
          +
          4024#if SET_FILE_OP_TIMES
          +
          4025 time_point
          +
          4026 m_ctime,
          +
          4027 m_atime,
          +
          4028 m_mtime;
          +
          4029#endif
          +
          4030 };
          -
          3975
          -
          3976 public:
          -
          3977 inline void get(_In_ fpos_t offset, _Out_ int8_t & data) { get<int8_t>(offset, data); }
          -
          3978 inline void get(_In_ fpos_t offset, _Out_ int16_t & data) { get<int16_t>(offset, data); }
          -
          3979 inline void get(_In_ fpos_t offset, _Out_ int32_t & data) { get<int32_t>(offset, data); }
          -
          3980 inline void get(_In_ fpos_t offset, _Out_ int64_t & data) { get<int64_t>(offset, data); }
          -
          3981 inline void get(_In_ fpos_t offset, _Out_ uint8_t & data) { get<uint8_t>(offset, data); }
          -
          3982 inline void get(_In_ fpos_t offset, _Out_ uint16_t & data) { get<uint16_t>(offset, data); }
          -
          3983 inline void get(_In_ fpos_t offset, _Out_ uint32_t & data) { get<uint32_t>(offset, data); }
          -
          3984 inline void get(_In_ fpos_t offset, _Out_ uint64_t & data) { get<uint64_t>(offset, data); }
          -
          3985 inline void get(_In_ fpos_t offset, _Out_ float& data) { get<float>(offset, data); }
          -
          3986 inline void get(_In_ fpos_t offset, _Out_ double& data) { get<double>(offset, data); }
          -
          3987 inline void get(_In_ fpos_t offset, _Out_ char& data) { get<char>(offset, data); }
          -
          3988#ifdef _NATIVE_WCHAR_T_DEFINED
          -
          3989 inline void get(_In_ fpos_t offset, _Out_ wchar_t& data) { get<wchar_t>(offset, data); }
          -
          3990#endif
          -
          3991
          -
          3992 inline memory_file& operator <<(_In_ const int8_t data) { return write_data(data); }
          -
          3993 inline memory_file& operator >>(_Out_ int8_t & data) { return read_data(data); }
          -
          3994 inline memory_file& operator <<(_In_ const int16_t data) { return write_data(data); }
          -
          3995 inline memory_file& operator >>(_Out_ int16_t & data) { return read_data(data); }
          -
          3996 inline memory_file& operator <<(_In_ const int32_t data) { return write_data(data); }
          -
          3997 inline memory_file& operator >>(_Out_ int32_t & data) { return read_data(data); }
          -
          3998 inline memory_file& operator <<(_In_ const int64_t data) { return write_data(data); }
          -
          3999 inline memory_file& operator >>(_Out_ int64_t & data) { return read_data(data); }
          -
          4000 inline memory_file& operator <<(_In_ const uint8_t data) { return write_data(data); }
          -
          4001 inline memory_file& operator >>(_Out_ uint8_t & data) { return read_data(data); }
          -
          4002 inline memory_file& operator <<(_In_ const uint16_t data) { return write_data(data); }
          -
          4003 inline memory_file& operator >>(_Out_ uint16_t & data) { return read_data(data); }
          -
          4004 inline memory_file& operator <<(_In_ const uint32_t data) { return write_data(data); }
          -
          4005 inline memory_file& operator >>(_Out_ uint32_t & data) { return read_data(data); }
          -
          4006 inline memory_file& operator <<(_In_ const uint64_t data) { return write_data(data); }
          -
          4007 inline memory_file& operator >>(_Out_ uint64_t & data) { return read_data(data); }
          -
          4008 inline memory_file& operator <<(_In_ const float data) { return write_data(data); }
          -
          4009 inline memory_file& operator >>(_Out_ float& data) { return read_data(data); }
          -
          4010 inline memory_file& operator <<(_In_ const double data) { return write_data(data); }
          -
          4011 inline memory_file& operator >>(_Out_ double& data) { return read_data(data); }
          -
          4012 inline memory_file& operator <<(_In_ const char data) { return write_data(data); }
          -
          4013 inline memory_file& operator >>(_Out_ char& data) { return read_data(data); }
          -
          4014#ifdef _NATIVE_WCHAR_T_DEFINED
          -
          4015 inline memory_file& operator <<(_In_ const wchar_t data) { return write_data(data); }
          -
          4016 inline memory_file& operator >>(_Out_ wchar_t& data) { return read_data(data); }
          -
          4017#endif
          -
          4018 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
          -
          4019 inline memory_file& operator >>(_Out_ std::basic_string<_Elem, _Traits, _Ax>&data) { return read_str(data); }
          -
          4020 template <class T>
          -
          4021 inline memory_file& operator <<(_In_ const T * data) { return write_str(data); }
          -
          4022 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
          -
          4023 inline memory_file& operator <<(_In_ const std::basic_string<_Elem, _Traits, _Ax>& data) { return write_str(data); }
          -
          4024
          -
          4025 protected:
          -
          4026 uint8_t* m_data;
          - -
          4028 size_t m_offset;
          -
          4029 size_t m_size;
          -
          4030 size_t m_reserved;
          -
          4031#if SET_FILE_OP_TIMES
          -
          4032 time_point
          -
          4033 m_ctime,
          -
          4034 m_atime,
          -
          4035 m_mtime;
          -
          4036#endif
          -
          4037 };
          +
          4031
          +
          +
          4035 class fifo : public basic {
          +
          4036 public:
          +
          4037 fifo() :
          +
          4038 m_offset(0),
          +
          4039 m_size(0),
          +
          4040 m_head(nullptr),
          +
          4041 m_tail(nullptr)
          +
          4042 {}
          +
          4043
          +
          4044 virtual ~fifo()
          +
          4045 {
          +
          4046 while (m_head) {
          +
          4047 auto p = m_head;
          +
          4048 m_head = p->next;
          +
          4049 delete p;
          +
          4050 }
          +
          4051 }
          +
          4052
          +
          4053#pragma warning(suppress: 6101) // See [2] below
          +
          +
          4054 virtual _Success_(return != 0 || length == 0) size_t read(
          +
          4055 _Out_writes_bytes_to_opt_(length, return) void* data, _In_ size_t length)
          +
          4056 {
          +
          4057 _Assume_(data || !length);
          +
          4058 for (size_t to_read = length;;) {
          +
          4059 if (!m_head) _Unlikely_ {
          +
          4060 m_state = to_read < length || !length ? state_t::ok : state_t::eof;
          +
          4061 return length - to_read; // [2] Code analysis misses `length - to_read` bytes were written to data in previous loop iterations.
          +
          4062 }
          +
          4063 size_t remaining = m_head->size - m_offset;
          +
          4064 if (remaining > to_read) {
          +
          4065 memcpy(data, m_head->data + m_offset, to_read);
          +
          4066 m_offset += to_read;
          +
          4067 m_size -= to_read;
          +
          4068 m_state = state_t::ok;
          +
          4069 return length;
          +
          4070 }
          +
          4071 memcpy(data, m_head->data + m_offset, remaining);
          +
          4072 m_offset = 0;
          +
          4073 m_size -= remaining;
          +
          4074 reinterpret_cast<uint8_t*&>(data) += remaining;
          +
          4075 to_read -= remaining;
          +
          4076 auto p = m_head;
          +
          4077 m_head = p->next;
          +
          4078 delete p;
          +
          4079 }
          +
          4080 }
          -
          4038
          -
          -
          4042 class fifo : public basic {
          -
          4043 public:
          -
          4044 fifo() :
          -
          4045 m_offset(0),
          -
          4046 m_size(0),
          -
          4047 m_head(nullptr),
          -
          4048 m_tail(nullptr)
          -
          4049 {}
          -
          4050
          -
          4051 virtual ~fifo()
          -
          4052 {
          -
          4053 while (m_head) {
          -
          4054 auto p = m_head;
          -
          4055 m_head = p->next;
          -
          4056 delete p;
          -
          4057 }
          -
          4058 }
          -
          4059
          -
          4060#pragma warning(suppress: 6101) // See [2] below
          -
          -
          4061 virtual _Success_(return != 0 || length == 0) size_t read(
          -
          4062 _Out_writes_bytes_to_opt_(length, return) void* data, _In_ size_t length)
          -
          4063 {
          -
          4064 _Assume_(data || !length);
          -
          4065 for (size_t to_read = length;;) {
          -
          4066 if (!m_head) _Unlikely_ {
          -
          4067 m_state = to_read < length || !length ? state_t::ok : state_t::eof;
          -
          4068 return length - to_read; // [2] Code analysis misses `length - to_read` bytes were written to data in previous loop iterations.
          -
          4069 }
          -
          4070 size_t remaining = m_head->size - m_offset;
          -
          4071 if (remaining > to_read) {
          -
          4072 memcpy(data, m_head->data + m_offset, to_read);
          -
          4073 m_offset += to_read;
          -
          4074 m_size -= to_read;
          -
          4075 m_state = state_t::ok;
          -
          4076 return length;
          -
          4077 }
          -
          4078 memcpy(data, m_head->data + m_offset, remaining);
          -
          4079 m_offset = 0;
          -
          4080 m_size -= remaining;
          -
          4081 reinterpret_cast<uint8_t*&>(data) += remaining;
          -
          4082 to_read -= remaining;
          -
          4083 auto p = m_head;
          -
          4084 m_head = p->next;
          -
          4085 delete p;
          -
          4086 }
          -
          4087 }
          +
          4081
          +
          +
          4082 virtual _Success_(return != 0) size_t write(
          +
          4083 _In_reads_bytes_opt_(length) const void* data, _In_ size_t length)
          +
          4084 {
          +
          4085 _Assume_(data || !length);
          +
          4086 try {
          +
          4087 std::unique_ptr<node_t> n(reinterpret_cast<node_t*>(new uint8_t[sizeof(node_t) + length]));
          +
          4088 n->next = nullptr;
          +
          4089 n->size = length;
          +
          4090 memcpy(n->data, data, length);
          +
          4091 m_size += length;
          +
          4092 if (m_head)
          +
          4093 m_tail = m_tail->next = n.release();
          +
          4094 else
          +
          4095 m_head = m_tail = n.release();
          +
          4096 m_state = state_t::ok;
          +
          4097 return length;
          +
          4098 }
          +
          4099 catch (const std::bad_alloc&) {
          +
          4100 m_state = state_t::fail;
          +
          4101 return 0;
          +
          4102 }
          +
          4103 }
          -
          4088
          -
          -
          4089 virtual _Success_(return != 0) size_t write(
          -
          4090 _In_reads_bytes_opt_(length) const void* data, _In_ size_t length)
          -
          4091 {
          -
          4092 _Assume_(data || !length);
          -
          4093 try {
          -
          4094 std::unique_ptr<node_t> n(reinterpret_cast<node_t*>(new uint8_t[sizeof(node_t) + length]));
          -
          4095 n->next = nullptr;
          -
          4096 n->size = length;
          -
          4097 memcpy(n->data, data, length);
          -
          4098 m_size += length;
          -
          4099 if (m_head)
          -
          4100 m_tail = m_tail->next = n.release();
          -
          4101 else
          -
          4102 m_head = m_tail = n.release();
          -
          4103 m_state = state_t::ok;
          -
          4104 return length;
          -
          4105 }
          -
          4106 catch (const std::bad_alloc&) {
          -
          4107 m_state = state_t::fail;
          -
          4108 return 0;
          -
          4109 }
          -
          4110 }
          +
          4104
          +
          +
          4105 virtual void close()
          +
          4106 {
          +
          4107 m_size = m_offset = 0;
          +
          4108 while (m_head) {
          +
          4109 auto p = m_head;
          +
          4110 m_head = p->next;
          +
          4111 delete p;
          +
          4112 }
          +
          4113 m_state = state_t::ok;
          +
          4114 }
          -
          4111
          -
          -
          4112 virtual void close()
          -
          4113 {
          -
          4114 m_size = m_offset = 0;
          -
          4115 while (m_head) {
          -
          4116 auto p = m_head;
          -
          4117 m_head = p->next;
          -
          4118 delete p;
          -
          4119 }
          -
          4120 m_state = state_t::ok;
          -
          4121 }
          +
          4115
          +
          4119 inline size_t size() const { return m_size; };
          +
          4120
          +
          4121 protected:
          +
          4122 size_t m_offset, m_size;
          +
          +
          4123 struct node_t {
          +
          4124 node_t* next;
          +
          4125 size_t size;
          +
          4126#pragma warning(suppress:4200)
          +
          4127 uint8_t data[0];
          +
          4128 } *m_head, * m_tail;
          -
          4122
          -
          4126 inline size_t size() const { return m_size; };
          -
          4127
          -
          4128 protected:
          -
          4129 size_t m_offset, m_size;
          -
          -
          4130 struct node_t {
          -
          4131 node_t* next;
          -
          4132 size_t size;
          -
          4133#pragma warning(suppress:4200)
          -
          4134 uint8_t data[0];
          -
          4135 } *m_head, * m_tail;
          +
          4129 };
          -
          4136 };
          +
          4130
          +
          +
          4134 class diag_file : public basic_file {
          +
          4135 public:
          +
          4136 diag_file(_In_count_(num_files) basic_file* const* files, _In_ size_t num_files) :
          +
          4137 basic(num_files ? files[0]->state() : state_t::fail),
          +
          4138 m_files(files, files + num_files)
          +
          4139 {}
          +
          4140
          +
          +
          4141 virtual _Success_(return != 0 || length == 0) size_t read(
          +
          4142 _Out_writes_bytes_to_opt_(length, return) void* data, _In_ size_t length)
          +
          4143 {
          +
          4144 _Assume_(data || !length);
          +
          4145 if (m_files.empty()) {
          +
          4146 m_state = state_t::fail;
          +
          4147 return 0;
          +
          4148 }
          +
          4149 size_t result = m_files[0]->read(data, length);
          +
          4150 _Assume_(result <= length);
          +
          4151 m_state = m_files[0]->state();
          +
          4152 if (length > m_tmp.size())
          +
          4153 m_tmp.resize(length);
          +
          4154 for (size_t i = 1, n = m_files.size(); i < n; ++i) {
          +
          4155 if (m_files[i]->read(m_tmp.data(), length) != result ||
          +
          4156 memcmp(m_tmp.data(), data, result))
          +
          4157 throw std::runtime_error("read mismatch");
          +
          4158 if (m_files[i]->state() != m_state)
          +
          4159 throw std::runtime_error("state mismatch");
          +
          4160 }
          +
          4161 return result;
          +
          4162 }
          -
          4137
          -
          -
          4141 class diag_file : public basic_file {
          -
          4142 public:
          -
          4143 diag_file(_In_count_(num_files) basic_file* const* files, _In_ size_t num_files) :
          -
          4144 basic(num_files ? files[0]->state() : state_t::fail),
          -
          4145 m_files(files, files + num_files)
          -
          4146 {}
          -
          4147
          -
          -
          4148 virtual _Success_(return != 0 || length == 0) size_t read(
          -
          4149 _Out_writes_bytes_to_opt_(length, return) void* data, _In_ size_t length)
          -
          4150 {
          -
          4151 _Assume_(data || !length);
          -
          4152 if (m_files.empty()) {
          -
          4153 m_state = state_t::fail;
          -
          4154 return 0;
          -
          4155 }
          -
          4156 size_t result = m_files[0]->read(data, length);
          -
          4157 _Assume_(result <= length);
          -
          4158 m_state = m_files[0]->state();
          -
          4159 if (length > m_tmp.size())
          -
          4160 m_tmp.resize(length);
          -
          4161 for (size_t i = 1, n = m_files.size(); i < n; ++i) {
          -
          4162 if (m_files[i]->read(m_tmp.data(), length) != result ||
          -
          4163 memcmp(m_tmp.data(), data, result))
          -
          4164 throw std::runtime_error("read mismatch");
          -
          4165 if (m_files[i]->state() != m_state)
          -
          4166 throw std::runtime_error("state mismatch");
          -
          4167 }
          -
          4168 return result;
          -
          4169 }
          +
          4163
          +
          +
          4164 virtual _Success_(return != 0) size_t write(
          +
          4165 _In_reads_bytes_opt_(length) const void* data, _In_ size_t length)
          +
          4166 {
          +
          4167 if (m_files.empty()) {
          +
          4168 m_state = state_t::fail;
          +
          4169 return 0;
          +
          4170 }
          +
          4171 size_t result = m_files[0]->write(data, length);
          +
          4172 m_state = m_files[0]->state();
          +
          4173 for (size_t i = 1, n = m_files.size(); i < n; ++i) {
          +
          4174 if (m_files[i]->write(data, length) != result)
          +
          4175 throw std::runtime_error("write mismatch");
          +
          4176 if (m_files[i]->state() != m_state)
          +
          4177 throw std::runtime_error("state mismatch");
          +
          4178 }
          +
          4179 return result;
          +
          4180 }
          -
          4170
          -
          -
          4171 virtual _Success_(return != 0) size_t write(
          -
          4172 _In_reads_bytes_opt_(length) const void* data, _In_ size_t length)
          -
          4173 {
          -
          4174 if (m_files.empty()) {
          -
          4175 m_state = state_t::fail;
          -
          4176 return 0;
          -
          4177 }
          -
          4178 size_t result = m_files[0]->write(data, length);
          -
          4179 m_state = m_files[0]->state();
          -
          4180 for (size_t i = 1, n = m_files.size(); i < n; ++i) {
          -
          4181 if (m_files[i]->write(data, length) != result)
          -
          4182 throw std::runtime_error("write mismatch");
          -
          4183 if (m_files[i]->state() != m_state)
          -
          4184 throw std::runtime_error("state mismatch");
          -
          4185 }
          -
          4186 return result;
          -
          4187 }
          -
          -
          4188
          -
          -
          4189 virtual void flush()
          -
          4190 {
          -
          4191 if (m_files.empty()) {
          -
          4192 m_state = state_t::ok;
          -
          4193 return;
          +
          4181
          +
          +
          4182 virtual void flush()
          +
          4183 {
          +
          4184 if (m_files.empty()) {
          +
          4185 m_state = state_t::ok;
          +
          4186 return;
          +
          4187 }
          +
          4188 m_files[0]->flush();
          +
          4189 m_state = m_files[0]->state();
          +
          4190 for (size_t i = 1, n = m_files.size(); i < n; ++i) {
          +
          4191 m_files[i]->flush();
          +
          4192 if (m_files[i]->state() != m_state)
          +
          4193 throw std::runtime_error("state mismatch");
          4194 }
          -
          4195 m_files[0]->flush();
          -
          4196 m_state = m_files[0]->state();
          -
          4197 for (size_t i = 1, n = m_files.size(); i < n; ++i) {
          -
          4198 m_files[i]->flush();
          -
          4199 if (m_files[i]->state() != m_state)
          -
          4200 throw std::runtime_error("state mismatch");
          -
          4201 }
          -
          4202 }
          +
          4195 }
          -
          4203
          -
          -
          4204 virtual void close()
          -
          4205 {
          -
          4206 if (m_files.empty()) {
          -
          4207 m_state = state_t::ok;
          -
          4208 return;
          +
          4196
          +
          +
          4197 virtual void close()
          +
          4198 {
          +
          4199 if (m_files.empty()) {
          +
          4200 m_state = state_t::ok;
          +
          4201 return;
          +
          4202 }
          +
          4203 m_files[0]->close();
          +
          4204 m_state = m_files[0]->state();
          +
          4205 for (size_t i = 1, n = m_files.size(); i < n; ++i) {
          +
          4206 m_files[i]->close();
          +
          4207 if (m_files[i]->state() != m_state)
          +
          4208 throw std::runtime_error("state mismatch");
          4209 }
          -
          4210 m_files[0]->close();
          -
          4211 m_state = m_files[0]->state();
          -
          4212 for (size_t i = 1, n = m_files.size(); i < n; ++i) {
          -
          4213 m_files[i]->close();
          -
          4214 if (m_files[i]->state() != m_state)
          -
          4215 throw std::runtime_error("state mismatch");
          -
          4216 }
          -
          4217 m_tmp.clear();
          -
          4218 m_tmp.shrink_to_fit();
          -
          4219 }
          +
          4210 m_tmp.clear();
          +
          4211 m_tmp.shrink_to_fit();
          +
          4212 }
          -
          4220
          -
          -
          4221 virtual fpos_t seek(_In_ foff_t offset, _In_ seek_t how = seek_t::beg)
          -
          4222 {
          -
          4223 if (m_files.empty()) {
          -
          4224 m_state = state_t::fail;
          -
          4225 return fpos_max;
          -
          4226 }
          -
          4227 fpos_t result = m_files[0]->seek(offset, how);
          -
          4228 m_state = m_files[0]->state();
          -
          4229 for (size_t i = 1, n = m_files.size(); i < n; ++i) {
          -
          4230 if (m_files[i]->seek(offset, how) != result)
          -
          4231 throw std::runtime_error("seek mismatch");
          -
          4232 if (m_files[i]->state() != m_state)
          -
          4233 throw std::runtime_error("state mismatch");
          -
          4234 }
          -
          4235 return result;
          -
          4236 }
          +
          4213
          +
          +
          4214 virtual fpos_t seek(_In_ foff_t offset, _In_ seek_t how = seek_t::beg)
          +
          4215 {
          +
          4216 if (m_files.empty()) {
          +
          4217 m_state = state_t::fail;
          +
          4218 return fpos_max;
          +
          4219 }
          +
          4220 fpos_t result = m_files[0]->seek(offset, how);
          +
          4221 m_state = m_files[0]->state();
          +
          4222 for (size_t i = 1, n = m_files.size(); i < n; ++i) {
          +
          4223 if (m_files[i]->seek(offset, how) != result)
          +
          4224 throw std::runtime_error("seek mismatch");
          +
          4225 if (m_files[i]->state() != m_state)
          +
          4226 throw std::runtime_error("state mismatch");
          +
          4227 }
          +
          4228 return result;
          +
          4229 }
          -
          4237
          -
          -
          4238 virtual fpos_t tell() const
          -
          4239 {
          -
          4240 if (m_files.empty())
          -
          4241 return fpos_max;
          -
          4242 fpos_t result = m_files[0]->tell();
          -
          4243 for (size_t i = 1, n = m_files.size(); i < n; ++i) {
          -
          4244 if (m_files[i]->tell() != result)
          -
          4245 throw std::runtime_error("tell mismatch");
          -
          4246 }
          -
          4247 return result;
          -
          4248 }
          +
          4230
          +
          +
          4231 virtual fpos_t tell() const
          +
          4232 {
          +
          4233 if (m_files.empty())
          +
          4234 return fpos_max;
          +
          4235 fpos_t result = m_files[0]->tell();
          +
          4236 for (size_t i = 1, n = m_files.size(); i < n; ++i) {
          +
          4237 if (m_files[i]->tell() != result)
          +
          4238 throw std::runtime_error("tell mismatch");
          +
          4239 }
          +
          4240 return result;
          +
          4241 }
          -
          4249
          -
          -
          4250 virtual void lock(_In_ fpos_t offset, _In_ fsize_t length)
          -
          4251 {
          -
          4252 if (m_files.empty())
          -
          4253 m_state = state_t::fail;
          -
          4254 m_files[0]->lock(offset, length);
          -
          4255 m_state = m_files[0]->state();
          -
          4256 for (size_t i = 1, n = m_files.size(); i < n; ++i) {
          -
          4257 m_files[i]->lock(offset, length);
          -
          4258 if (m_files[i]->state() != m_state)
          -
          4259 throw std::runtime_error("state mismatch");
          -
          4260 }
          -
          4261 }
          +
          4242
          +
          +
          4243 virtual void lock(_In_ fpos_t offset, _In_ fsize_t length)
          +
          4244 {
          +
          4245 if (m_files.empty())
          +
          4246 m_state = state_t::fail;
          +
          4247 m_files[0]->lock(offset, length);
          +
          4248 m_state = m_files[0]->state();
          +
          4249 for (size_t i = 1, n = m_files.size(); i < n; ++i) {
          +
          4250 m_files[i]->lock(offset, length);
          +
          4251 if (m_files[i]->state() != m_state)
          +
          4252 throw std::runtime_error("state mismatch");
          +
          4253 }
          +
          4254 }
          -
          4262
          -
          -
          4263 virtual void unlock(_In_ fpos_t offset, _In_ fsize_t length)
          -
          4264 {
          -
          4265 if (m_files.empty())
          -
          4266 m_state = state_t::fail;
          -
          4267 m_files[0]->unlock(offset, length);
          -
          4268 m_state = m_files[0]->state();
          -
          4269 for (size_t i = 1, n = m_files.size(); i < n; ++i) {
          -
          4270 m_files[i]->unlock(offset, length);
          -
          4271 if (m_files[i]->state() != m_state)
          -
          4272 throw std::runtime_error("state mismatch");
          -
          4273 }
          -
          4274 }
          +
          4255
          +
          +
          4256 virtual void unlock(_In_ fpos_t offset, _In_ fsize_t length)
          +
          4257 {
          +
          4258 if (m_files.empty())
          +
          4259 m_state = state_t::fail;
          +
          4260 m_files[0]->unlock(offset, length);
          +
          4261 m_state = m_files[0]->state();
          +
          4262 for (size_t i = 1, n = m_files.size(); i < n; ++i) {
          +
          4263 m_files[i]->unlock(offset, length);
          +
          4264 if (m_files[i]->state() != m_state)
          +
          4265 throw std::runtime_error("state mismatch");
          +
          4266 }
          +
          4267 }
          -
          4275
          -
          -
          4276 virtual fsize_t size() const
          -
          4277 {
          -
          4278 if (m_files.empty())
          -
          4279 return fsize_max;
          -
          4280 fsize_t result = m_files[0]->size();
          -
          4281 for (size_t i = 1, n = m_files.size(); i < n; ++i) {
          -
          4282 if (m_files[i]->size() != result)
          -
          4283 throw std::runtime_error("size mismatch");
          -
          4284 }
          -
          4285 return result;
          -
          4286 }
          +
          4268
          +
          +
          4269 virtual fsize_t size() const
          +
          4270 {
          +
          4271 if (m_files.empty())
          +
          4272 return fsize_max;
          +
          4273 fsize_t result = m_files[0]->size();
          +
          4274 for (size_t i = 1, n = m_files.size(); i < n; ++i) {
          +
          4275 if (m_files[i]->size() != result)
          +
          4276 throw std::runtime_error("size mismatch");
          +
          4277 }
          +
          4278 return result;
          +
          4279 }
          -
          4287
          -
          -
          4288 virtual void truncate()
          -
          4289 {
          -
          4290 if (m_files.empty())
          -
          4291 m_state = state_t::fail;
          -
          4292 m_files[0]->truncate();
          -
          4293 m_state = m_files[0]->state();
          -
          4294 for (size_t i = 1, n = m_files.size(); i < n; ++i) {
          -
          4295 m_files[i]->truncate();
          -
          4296 if (m_files[i]->state() != m_state)
          -
          4297 throw std::runtime_error("state mismatch");
          -
          4298 }
          -
          4299 }
          +
          4280
          +
          +
          4281 virtual void truncate()
          +
          4282 {
          +
          4283 if (m_files.empty())
          +
          4284 m_state = state_t::fail;
          +
          4285 m_files[0]->truncate();
          +
          4286 m_state = m_files[0]->state();
          +
          4287 for (size_t i = 1, n = m_files.size(); i < n; ++i) {
          +
          4288 m_files[i]->truncate();
          +
          4289 if (m_files[i]->state() != m_state)
          +
          4290 throw std::runtime_error("state mismatch");
          +
          4291 }
          +
          4292 }
          -
          4300
          -
          4301 protected:
          -
          4302 std::vector<basic_file*> m_files;
          -
          4303 std::vector<uint8_t> m_tmp;
          -
          4304 };
          +
          4293
          +
          4294 protected:
          +
          4295 std::vector<basic_file*> m_files;
          +
          4296 std::vector<uint8_t> m_tmp;
          +
          4297 };
          -
          4305 }
          -
          4306}
          +
          4298 }
          +
          4299}
          Encoding converter context.
          Definition unicode.hpp:133
          -
          Provides read-ahead stream capability.
          Definition stream.hpp:1256
          -
          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:1270
          -
          Provides write-back stream capability.
          Definition stream.hpp:1323
          -
          virtual void flush()
          Persists volatile element data.
          Definition stream.hpp:1360
          -
          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:1336
          -
          Basic seekable stream operations.
          Definition stream.hpp:824
          -
          virtual void skip(fsize_t amount)
          Skips given amount of bytes of data on the stream.
          Definition stream.hpp:867
          -
          virtual time_point ctime() const
          Returns file creation time.
          Definition stream.hpp:914
          -
          virtual void lock(fpos_t offset, fsize_t length)
          Locks file section for exclusive access.
          Definition stream.hpp:883
          +
          Provides read-ahead stream capability.
          Definition stream.hpp:1244
          +
          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:1258
          +
          Provides write-back stream capability.
          Definition stream.hpp:1311
          +
          virtual void flush()
          Persists volatile element data.
          Definition stream.hpp:1348
          +
          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:1324
          +
          Basic seekable stream operations.
          Definition stream.hpp:812
          +
          virtual void skip(fsize_t amount)
          Skips given amount of bytes of data on the stream.
          Definition stream.hpp:855
          +
          virtual time_point ctime() const
          Returns file creation time.
          Definition stream.hpp:902
          +
          virtual void lock(fpos_t offset, fsize_t length)
          Locks file section for exclusive access.
          Definition stream.hpp:871
          virtual void truncate()=0
          Sets file size - truncates the remainder of file content from the current file position to the end of...
          virtual fsize_t size() const =0
          Returns file size Should the file size cannot be determined, the method returns fsize_max and it does...
          -
          charset_id read_charset(charset_id default_charset=charset_id::system)
          Attempts to detect textfile charset based on UTF-32, UTF-16 or UTF-8 BOM.
          Definition stream.hpp:987
          -
          fpos_t seekbeg(fpos_t offset)
          Seeks to absolute file position.
          Definition stream.hpp:851
          -
          virtual std::vector< uint8_t > read_remainder(size_t max_length=SIZE_MAX)
          Reads and returns remainder of the stream.
          Definition stream.hpp:826
          -
          virtual void set_mtime(time_point date)
          Sets file modification time.
          Definition stream.hpp:956
          -
          fpos_t seekcur(foff_t offset)
          Seeks to relative from current file position.
          Definition stream.hpp:858
          -
          virtual time_point atime() const
          Returns file access time.
          Definition stream.hpp:922
          -
          virtual void set_ctime(time_point date)
          Sets file create time.
          Definition stream.hpp:938
          -
          virtual void unlock(fpos_t offset, fsize_t length)
          Unlocks file section for exclusive access.
          Definition stream.hpp:893
          +
          charset_id read_charset(charset_id default_charset=charset_id::system)
          Attempts to detect textfile charset based on UTF-32, UTF-16 or UTF-8 BOM.
          Definition stream.hpp:975
          +
          fpos_t seekbeg(fpos_t offset)
          Seeks to absolute file position.
          Definition stream.hpp:839
          +
          virtual std::vector< uint8_t > read_remainder(size_t max_length=SIZE_MAX)
          Reads and returns remainder of the stream.
          Definition stream.hpp:814
          +
          virtual void set_mtime(time_point date)
          Sets file modification time.
          Definition stream.hpp:944
          +
          fpos_t seekcur(foff_t offset)
          Seeks to relative from current file position.
          Definition stream.hpp:846
          +
          virtual time_point atime() const
          Returns file access time.
          Definition stream.hpp:910
          +
          virtual void set_ctime(time_point date)
          Sets file create time.
          Definition stream.hpp:926
          +
          virtual void unlock(fpos_t offset, fsize_t length)
          Unlocks file section for exclusive access.
          Definition stream.hpp:881
          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:930
          -
          fpos_t seekend(foff_t offset)
          Seeks to relative from end file position.
          Definition stream.hpp:865
          -
          virtual void set_atime(time_point date)
          Sets file access time.
          Definition stream.hpp:947
          +
          virtual time_point mtime() const
          Returns file modification time.
          Definition stream.hpp:918
          +
          fpos_t seekend(foff_t offset)
          Seeks to relative from end file position.
          Definition stream.hpp:853
          +
          virtual void set_atime(time_point date)
          Sets file access time.
          Definition stream.hpp:935
          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:2202
          -
          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:2259
          -
          virtual void flush()
          Persists volatile element data.
          Definition stream.hpp:2317
          -
          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:2209
          -
          virtual void close()
          Closes the stream.
          Definition stream.hpp:2306
          +
          OS data stream (file, pipe, socket...)
          Definition stream.hpp:2190
          +
          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:2247
          +
          virtual void flush()
          Persists volatile element data.
          Definition stream.hpp:2305
          +
          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:2197
          +
          virtual void close()
          Closes the stream.
          Definition stream.hpp:2294
          ‍UTF-8 byte-order-mark
          Definition stream.hpp:79
          +
          size_t write_array(const T_from *str, charset_encoder< T_from, T_to > &encoder)
          Writes array of characters to the stream.
          Definition stream.hpp:402
          bool ok() const
          Returns true if the stream state is clean i.e. previous operation was succesful.
          Definition stream.hpp:175
          -
          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:637
          -
          size_t write_array(const std::basic_string< T_from, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)
          Writes array of characters to the stream.
          Definition stream.hpp:455
          +
          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:625
          +
          size_t readln(std::basic_string< _Elem, _Traits, _Ax > &str)
          Reads stream to the end-of-line or end-of-file.
          Definition stream.hpp:306
          state_t state() const
          Returns stream state after last operation.
          Definition stream.hpp:170
          -
          basic & read_str(std::basic_string< _Elem, _Traits, _Ax > &data)
          Reads length-prefixed string from the stream.
          Definition stream.hpp:477
          -
          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:623
          -
          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:650
          +
          basic & read_str(std::basic_string< _Elem, _Traits, _Ax > &data)
          Reads length-prefixed string from the stream.
          Definition stream.hpp:465
          +
          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:611
          +
          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:638
          virtual void flush()
          Persists volatile element data.
          Definition stream.hpp:126
          virtual void skip(fsize_t amount)
          Skips given amount of bytes of data on the stream.
          Definition stream.hpp:142
          virtual void close()
          Closes the stream.
          Definition stream.hpp:134
          +
          size_t readln(std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)
          Reads stream to the end-of-line or end-of-file.
          Definition stream.hpp:318
          +
          size_t readln_and_attach(std::basic_string< T_to, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)
          Reads stream to the end-of-line or end-of-file and append to str.
          Definition stream.hpp:355
          uint8_t read_byte()
          Reads one byte of data.
          Definition stream.hpp:210
          virtual std::vector< uint8_t > read_remainder(size_t max_length=SIZE_MAX)
          Reads and returns remainder of the stream.
          Definition stream.hpp:184
          -
          size_t write_sprintf(_Printf_format_string_params_(2) const char *format, locale_t locale,...)
          Writes formatted string to the stream.
          Definition stream.hpp:609
          -
          size_t readln(std::basic_string< char, _Traits, _Ax > &str)
          Reads stream to the end-of-line or end-of-file.
          Definition stream.hpp:306
          -
          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:346
          -
          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:382
          -
          basic & write_str(const T *data)
          Writes string to the stream length-prefixed.
          Definition stream.hpp:509
          +
          size_t write_sprintf(_Printf_format_string_params_(2) const char *format, locale_t locale,...)
          Writes formatted string to the stream.
          Definition stream.hpp:597
          +
          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:334
          +
          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:370
          +
          basic & write_str(const T *data)
          Writes string to the stream length-prefixed.
          Definition stream.hpp:497
          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:96
          -
          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:318
          -
          void write_charset(charset_id charset)
          Writes UTF8, UTF-16 or UTF-32 byte-order-mark.
          Definition stream.hpp:594
          -
          basic & write_str(const std::basic_string< _Elem, _Traits, _Ax > &data)
          Writes string to the stream length-prefixed.
          Definition stream.hpp:534
          +
          void write_charset(charset_id charset)
          Writes UTF8, UTF-16 or UTF-32 byte-order-mark.
          Definition stream.hpp:582
          +
          size_t write_array(const std::basic_string< T_from, _Traits, _Ax > &str, charset_encoder< T_from, T_to > &encoder)
          Writes array of characters to the stream.
          Definition stream.hpp:443
          +
          basic & write_str(const std::basic_string< _Elem, _Traits, _Ax > &data)
          Writes string to the stream length-prefixed.
          Definition stream.hpp:522
          basic & write_data(const T data)
          Writes one primitive data type.
          Definition stream.hpp:287
          -
          size_t write_array(const T_from *wstr, charset_encoder< T_from, T_to > &encoder)
          Writes array of characters to the stream.
          Definition stream.hpp:414
          -
          size_t readln_and_attach(std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)
          Reads stream to the end-of-line or end-of-file and append to str.
          Definition stream.hpp:367
          -
          fsize_t write_stream(basic &stream, fsize_t amount=fsize_max)
          Writes content of another stream.
          Definition stream.hpp:569
          +
          fsize_t write_stream(basic &stream, fsize_t amount=fsize_max)
          Writes content of another stream.
          Definition stream.hpp:557
          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:114
          -
          size_t write_array(_In_reads_or_z_opt_(num_chars) const T_from *wstr, size_t num_chars, charset_encoder< T_from, T_to > &encoder)
          Writes array of characters to the stream.
          Definition stream.hpp:435
          -
          size_t readln(std::basic_string< T_to, _Traits, _Ax > &wstr, charset_encoder< T_from, T_to > &encoder)
          Reads stream to the end-of-line or end-of-file.
          Definition stream.hpp:330
          -
          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:400
          +
          size_t write_array(_In_reads_or_z_opt_(num_chars) const T_from *str, size_t num_chars, charset_encoder< T_from, T_to > &encoder)
          Writes array of characters to the stream.
          Definition stream.hpp:423
          +
          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:388
          void write_byte(uint8_t byte, fsize_t amount=1)
          Writes a byte of data.
          Definition stream.hpp:221
          basic & read_data(T &data)
          Reads one primitive data type.
          Definition stream.hpp:259
          -
          Buffered read/write stream.
          Definition stream.hpp:1394
          -
          virtual void flush()
          Persists volatile element data.
          Definition stream.hpp:1503
          -
          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:1424
          -
          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:1460
          -
          Buffered OS data stream (file, pipe, socket...)
          Definition stream.hpp:2331
          -
          Cached file.
          Definition stream.hpp:1804
          -
          virtual time_point ctime() const
          Returns file creation time.
          Definition stream.hpp:2072
          -
          virtual void truncate()
          Sets file size - truncates the remainder of file content from the current file position to the end of...
          Definition stream.hpp:2051
          -
          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:1871
          -
          virtual time_point atime() const
          Returns file access time.
          Definition stream.hpp:2077
          -
          virtual void unlock(fpos_t offset, fsize_t length)
          Unlocks file section for exclusive access.
          Definition stream.hpp:2038
          -
          virtual time_point mtime() const
          Returns file modification time.
          Definition stream.hpp:2086
          -
          virtual void close()
          Closes the stream.
          Definition stream.hpp:1986
          -
          virtual void set_mtime(time_point date)
          Sets file modification time.
          Definition stream.hpp:2108
          -
          virtual void lock(fpos_t offset, fsize_t length)
          Locks file section for exclusive access.
          Definition stream.hpp:2032
          -
          virtual void flush()
          Persists volatile element data.
          Definition stream.hpp:1995
          -
          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:1933
          -
          virtual fsize_t size() const
          Returns file size Should the file size cannot be determined, the method returns fsize_max and it does...
          Definition stream.hpp:2044
          -
          virtual void set_ctime(time_point date)
          Sets file create time.
          Definition stream.hpp:2095
          -
          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:2027
          -
          virtual void set_atime(time_point date)
          Sets file access time.
          Definition stream.hpp:2100
          -
          virtual fpos_t seek(foff_t offset, seek_t how=seek_t::beg)
          Seeks to specified relative file position.
          Definition stream.hpp:2006
          -
          Cached file-system file.
          Definition stream.hpp:3101
          -
          cached_file(const stdex::sstring &filename, int mode, size_t cache_size=default_cache_size)
          Opens file.
          Definition stream.hpp:3131
          -
          void open(const stdex::sstring &filename, int mode)
          Opens file.
          Definition stream.hpp:3165
          -
          void open(const schar_t *filename, int mode)
          Opens file.
          Definition stream.hpp:3144
          -
          cached_file(const schar_t *filename, int mode, size_t cache_size=default_cache_size)
          Opens file.
          Definition stream.hpp:3117
          -
          Modifies data on the fly when reading from/writing to a source stream. Could also be used to modify r...
          Definition stream.hpp:1022
          -
          virtual void flush()
          Persists volatile element data.
          Definition stream.hpp:1073
          -
          virtual void close()
          Closes the stream.
          Definition stream.hpp:1067
          -
          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:1051
          -
          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:1059
          -
          Compares multiple files to perform the same.
          Definition stream.hpp:4141
          -
          virtual void truncate()
          Sets file size - truncates the remainder of file content from the current file position to the end of...
          Definition stream.hpp:4288
          -
          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:4171
          -
          virtual void close()
          Closes the stream.
          Definition stream.hpp:4204
          -
          virtual fsize_t size() const
          Returns file size Should the file size cannot be determined, the method returns fsize_max and it does...
          Definition stream.hpp:4276
          -
          virtual void lock(fpos_t offset, fsize_t length)
          Locks file section for exclusive access.
          Definition stream.hpp:4250
          -
          virtual void unlock(fpos_t offset, fsize_t length)
          Unlocks file section for exclusive access.
          Definition stream.hpp:4263
          -
          virtual fpos_t seek(foff_t offset, seek_t how=seek_t::beg)
          Seeks to specified relative file position.
          Definition stream.hpp:4221
          -
          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:4238
          -
          virtual void flush()
          Persists volatile element data.
          Definition stream.hpp:4189
          -
          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:4148
          -
          In-memory FIFO queue.
          Definition stream.hpp:4042
          -
          virtual void close()
          Closes the stream.
          Definition stream.hpp:4112
          -
          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:4089
          -
          size_t size() const
          Returns total size of pending data in the queue.
          Definition stream.hpp:4126
          -
          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:4061
          -
          Limits file reading/writing to a predefined window.
          Definition stream.hpp:1694
          -
          virtual void truncate()
          Sets file size - truncates the remainder of file content from the current file position to the end of...
          Definition stream.hpp:1787
          -
          virtual void flush()
          Persists volatile element data.
          Definition stream.hpp:1737
          -
          virtual void skip(fsize_t amount)
          Skips given amount of bytes of data on the stream.
          Definition stream.hpp:1750
          -
          virtual fpos_t seek(foff_t offset, seek_t how=seek_t::beg)
          Seeks to specified relative file position.
          Definition stream.hpp:1743
          -
          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:1717
          -
          virtual void lock(fpos_t offset, fsize_t length)
          Locks file section for exclusive access.
          Definition stream.hpp:1762
          -
          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:1703
          -
          virtual void unlock(fpos_t offset, fsize_t length)
          Unlocks file section for exclusive access.
          Definition stream.hpp:1772
          -
          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:1756
          -
          virtual void close()
          Closes the stream.
          Definition stream.hpp:1731
          -
          virtual fsize_t size() const
          Returns file size Should the file size cannot be determined, the method returns fsize_max and it does...
          Definition stream.hpp:1782
          -
          File-system file.
          Definition stream.hpp:2697
          -
          virtual fsize_t size() const
          Returns file size Should the file size cannot be determined, the method returns fsize_max and it does...
          Definition stream.hpp:2891
          -
          file(const stdex::sstring &filename, int mode)
          Opens file.
          Definition stream.hpp:2718
          -
          static bool readonly(const stdex::sstring &filename)
          Checks if file/folder/symlink is read-only.
          Definition stream.hpp:3090
          -
          virtual time_point mtime() const
          Returns file modification time.
          Definition stream.hpp:2973
          -
          virtual void unlock(fpos_t offset, fsize_t length)
          Unlocks file section for exclusive access.
          Definition stream.hpp:2866
          -
          file(const schar_t *filename, int mode)
          Opens file.
          Definition stream.hpp:2707
          -
          virtual void set_ctime(time_point date)
          Sets file create time.
          Definition stream.hpp:2987
          -
          static bool readonly(const stdex::schar_t *filename)
          Checks if file/folder/symlink is read-only.
          Definition stream.hpp:3072
          -
          static bool exists(const stdex::sstring &filename)
          Checks if file/folder/symlink likely exists.
          Definition stream.hpp:3060
          -
          virtual time_point atime() const
          Returns file access time.
          Definition stream.hpp:2959
          -
          void open(const schar_t *filename, int mode)
          Opens file.
          Definition stream.hpp:2726
          -
          virtual void set_mtime(time_point date)
          Sets file modification time.
          Definition stream.hpp:3021
          -
          virtual void set_atime(time_point date)
          Sets file access time.
          Definition stream.hpp:3001
          -
          virtual void lock(fpos_t offset, fsize_t length)
          Locks file section for exclusive access.
          Definition stream.hpp:2843
          -
          virtual void truncate()
          Sets file size - truncates the remainder of file content from the current file position to the end of...
          Definition stream.hpp:2909
          -
          virtual time_point ctime() const
          Returns file creation time.
          Definition stream.hpp:2949
          -
          void open(const stdex::sstring &filename, int mode)
          Opens file.
          Definition stream.hpp:2799
          -
          virtual fpos_t seek(foff_t offset, seek_t how=seek_t::beg)
          Seeks to specified relative file position.
          Definition stream.hpp:2804
          -
          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:2825
          -
          static bool exists(const stdex::schar_t *filename)
          Checks if file/folder/symlink likely exists.
          Definition stream.hpp:3045
          -
          Limits reading from/writing to stream to a predefined number of bytes.
          Definition stream.hpp:1551
          -
          fsize_t read_limit
          Number of bytes left that may be read from the stream.
          Definition stream.hpp:1603
          -
          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:1559
          -
          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:1580
          -
          fsize_t write_limit
          Number of bytes left, that can be written to the stream.
          Definition stream.hpp:1604
          -
          In-memory file.
          Definition stream.hpp:3178
          -
          memory_file & operator=(memory_file &&other) noexcept
          Moves content from another file.
          Definition stream.hpp:3360
          -
          virtual fsize_t size() const
          Returns file size Should the file size cannot be determined, the method returns fsize_max and it does...
          Definition stream.hpp:3878
          -
          memory_file(const schar_t *filename, int mode)
          Loads content from file-system file.
          Definition stream.hpp:3258
          -
          memory_file & write_str(const std::basic_string< _Elem, _Traits, _Ax > &data)
          Writes string to the stream length-prefixed.
          Definition stream.hpp:3757
          -
          memory_file(const memory_file &other)
          Copies content from another file.
          Definition stream.hpp:3276
          -
          size_t m_size
          file size
          Definition stream.hpp:4029
          -
          void get(fpos_t offset, T &data)
          Reads data from specified file location This does not move file pointer. It checks for data size Assu...
          Definition stream.hpp:3967
          -
          size_t write_stream(basic &stream, size_t amount=SIZE_MAX)
          Writes content of another stream.
          Definition stream.hpp:3792
          -
          uint8_t * m_data
          file data
          Definition stream.hpp:4026
          -
          memory_file & read_data(T &data)
          Reads one primitive data type.
          Definition stream.hpp:3546
          -
          virtual void close()
          Closes the stream.
          Definition stream.hpp:3842
          -
          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:3507
          -
          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:3873
          -
          size_t m_reserved
          reserved file size
          Definition stream.hpp:4030
          -
          memory_file(size_t size, state_t state=state_t::ok)
          Creates an empty file of reserved size.
          Definition stream.hpp:3199
          -
          void reserve(size_t required, bool tight=false) noexcept
          Reallocates memory.
          Definition stream.hpp:3398
          -
          memory_file(const stdex::sstring &filename, int mode)
          Loads content from file-system file.
          Definition stream.hpp:3269
          -
          memory_file & read_str(std::basic_string< _Elem, _Traits, _Ax > &data)
          Reads length-prefixed string from the stream.
          Definition stream.hpp:3586
          -
          memory_file(memory_file &&other) noexcept
          Moves content from another file.
          Definition stream.hpp:3331
          -
          void write_byte(uint8_t byte, size_t amount=1)
          Writes a byte of data.
          Definition stream.hpp:3641
          -
          memory_file & operator=(const memory_file &other)
          Copies content from another file.
          Definition stream.hpp:3301
          -
          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:3933
          -
          void load(const stdex::sstring &filename, int mode)
          Loads content from a file-system file.
          Definition stream.hpp:3460
          -
          size_t m_offset
          file pointer
          Definition stream.hpp:4028
          -
          void save(const schar_t *filename, int mode)
          Saves content to a file-system file.
          Definition stream.hpp:3471
          -
          void load(const schar_t *filename, int mode)
          Loads content from a file-system file.
          Definition stream.hpp:3427
          -
          virtual fpos_t seek(foff_t offset, seek_t how=seek_t::beg)
          Seeks to specified relative file position.
          Definition stream.hpp:3856
          -
          virtual void truncate()
          Sets file size - truncates the remainder of file content from the current file position to the end of...
          Definition stream.hpp:3883
          -
          memory_file & write_data(const T data)
          Writes one primitive data type.
          Definition stream.hpp:3674
          -
          memory_file & write_str(const T *data)
          Writes string to the stream length-prefixed.
          Definition stream.hpp:3712
          -
          void save(const stdex::sstring &filename, int mode)
          Saves content to a file-system file.
          Definition stream.hpp:3497
          -
          bool m_manage
          may reallocate m_data?
          Definition stream.hpp:4027
          -
          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:3248
          -
          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:3617
          -
          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:3225
          -
          const void * data() const
          Returns pointer to data.
          Definition stream.hpp:3505
          -
          Definition stream.hpp:1170
          +
          Buffered read/write stream.
          Definition stream.hpp:1382
          +
          virtual void flush()
          Persists volatile element data.
          Definition stream.hpp:1491
          +
          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:1412
          +
          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:1448
          +
          Buffered OS data stream (file, pipe, socket...)
          Definition stream.hpp:2319
          +
          Cached file.
          Definition stream.hpp:1792
          +
          virtual time_point ctime() const
          Returns file creation time.
          Definition stream.hpp:2060
          +
          virtual void truncate()
          Sets file size - truncates the remainder of file content from the current file position to the end of...
          Definition stream.hpp:2039
          +
          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:1859
          +
          virtual time_point atime() const
          Returns file access time.
          Definition stream.hpp:2065
          +
          virtual void unlock(fpos_t offset, fsize_t length)
          Unlocks file section for exclusive access.
          Definition stream.hpp:2026
          +
          virtual time_point mtime() const
          Returns file modification time.
          Definition stream.hpp:2074
          +
          virtual void close()
          Closes the stream.
          Definition stream.hpp:1974
          +
          virtual void set_mtime(time_point date)
          Sets file modification time.
          Definition stream.hpp:2096
          +
          virtual void lock(fpos_t offset, fsize_t length)
          Locks file section for exclusive access.
          Definition stream.hpp:2020
          +
          virtual void flush()
          Persists volatile element data.
          Definition stream.hpp:1983
          +
          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:1921
          +
          virtual fsize_t size() const
          Returns file size Should the file size cannot be determined, the method returns fsize_max and it does...
          Definition stream.hpp:2032
          +
          virtual void set_ctime(time_point date)
          Sets file create time.
          Definition stream.hpp:2083
          +
          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:2015
          +
          virtual void set_atime(time_point date)
          Sets file access time.
          Definition stream.hpp:2088
          +
          virtual fpos_t seek(foff_t offset, seek_t how=seek_t::beg)
          Seeks to specified relative file position.
          Definition stream.hpp:1994
          +
          Cached file-system file.
          Definition stream.hpp:3089
          +
          cached_file(const stdex::sstring &filename, int mode, size_t cache_size=default_cache_size)
          Opens file.
          Definition stream.hpp:3119
          +
          void open(const stdex::sstring &filename, int mode)
          Opens file.
          Definition stream.hpp:3153
          +
          void open(const schar_t *filename, int mode)
          Opens file.
          Definition stream.hpp:3132
          +
          cached_file(const schar_t *filename, int mode, size_t cache_size=default_cache_size)
          Opens file.
          Definition stream.hpp:3105
          +
          Modifies data on the fly when reading from/writing to a source stream. Could also be used to modify r...
          Definition stream.hpp:1010
          +
          virtual void flush()
          Persists volatile element data.
          Definition stream.hpp:1061
          +
          virtual void close()
          Closes the stream.
          Definition stream.hpp:1055
          +
          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:1039
          +
          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:1047
          +
          Compares multiple files to perform the same.
          Definition stream.hpp:4134
          +
          virtual void truncate()
          Sets file size - truncates the remainder of file content from the current file position to the end of...
          Definition stream.hpp:4281
          +
          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:4164
          +
          virtual void close()
          Closes the stream.
          Definition stream.hpp:4197
          +
          virtual fsize_t size() const
          Returns file size Should the file size cannot be determined, the method returns fsize_max and it does...
          Definition stream.hpp:4269
          +
          virtual void lock(fpos_t offset, fsize_t length)
          Locks file section for exclusive access.
          Definition stream.hpp:4243
          +
          virtual void unlock(fpos_t offset, fsize_t length)
          Unlocks file section for exclusive access.
          Definition stream.hpp:4256
          +
          virtual fpos_t seek(foff_t offset, seek_t how=seek_t::beg)
          Seeks to specified relative file position.
          Definition stream.hpp:4214
          +
          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:4231
          +
          virtual void flush()
          Persists volatile element data.
          Definition stream.hpp:4182
          +
          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:4141
          +
          In-memory FIFO queue.
          Definition stream.hpp:4035
          +
          virtual void close()
          Closes the stream.
          Definition stream.hpp:4105
          +
          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:4082
          +
          size_t size() const
          Returns total size of pending data in the queue.
          Definition stream.hpp:4119
          +
          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:4054
          +
          Limits file reading/writing to a predefined window.
          Definition stream.hpp:1682
          +
          virtual void truncate()
          Sets file size - truncates the remainder of file content from the current file position to the end of...
          Definition stream.hpp:1775
          +
          virtual void flush()
          Persists volatile element data.
          Definition stream.hpp:1725
          +
          virtual void skip(fsize_t amount)
          Skips given amount of bytes of data on the stream.
          Definition stream.hpp:1738
          +
          virtual fpos_t seek(foff_t offset, seek_t how=seek_t::beg)
          Seeks to specified relative file position.
          Definition stream.hpp:1731
          +
          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:1705
          +
          virtual void lock(fpos_t offset, fsize_t length)
          Locks file section for exclusive access.
          Definition stream.hpp:1750
          +
          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:1691
          +
          virtual void unlock(fpos_t offset, fsize_t length)
          Unlocks file section for exclusive access.
          Definition stream.hpp:1760
          +
          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:1744
          +
          virtual void close()
          Closes the stream.
          Definition stream.hpp:1719
          +
          virtual fsize_t size() const
          Returns file size Should the file size cannot be determined, the method returns fsize_max and it does...
          Definition stream.hpp:1770
          +
          File-system file.
          Definition stream.hpp:2685
          +
          virtual fsize_t size() const
          Returns file size Should the file size cannot be determined, the method returns fsize_max and it does...
          Definition stream.hpp:2879
          +
          file(const stdex::sstring &filename, int mode)
          Opens file.
          Definition stream.hpp:2706
          +
          static bool readonly(const stdex::sstring &filename)
          Checks if file/folder/symlink is read-only.
          Definition stream.hpp:3078
          +
          virtual time_point mtime() const
          Returns file modification time.
          Definition stream.hpp:2961
          +
          virtual void unlock(fpos_t offset, fsize_t length)
          Unlocks file section for exclusive access.
          Definition stream.hpp:2854
          +
          file(const schar_t *filename, int mode)
          Opens file.
          Definition stream.hpp:2695
          +
          virtual void set_ctime(time_point date)
          Sets file create time.
          Definition stream.hpp:2975
          +
          static bool readonly(const stdex::schar_t *filename)
          Checks if file/folder/symlink is read-only.
          Definition stream.hpp:3060
          +
          static bool exists(const stdex::sstring &filename)
          Checks if file/folder/symlink likely exists.
          Definition stream.hpp:3048
          +
          virtual time_point atime() const
          Returns file access time.
          Definition stream.hpp:2947
          +
          void open(const schar_t *filename, int mode)
          Opens file.
          Definition stream.hpp:2714
          +
          virtual void set_mtime(time_point date)
          Sets file modification time.
          Definition stream.hpp:3009
          +
          virtual void set_atime(time_point date)
          Sets file access time.
          Definition stream.hpp:2989
          +
          virtual void lock(fpos_t offset, fsize_t length)
          Locks file section for exclusive access.
          Definition stream.hpp:2831
          +
          virtual void truncate()
          Sets file size - truncates the remainder of file content from the current file position to the end of...
          Definition stream.hpp:2897
          +
          virtual time_point ctime() const
          Returns file creation time.
          Definition stream.hpp:2937
          +
          void open(const stdex::sstring &filename, int mode)
          Opens file.
          Definition stream.hpp:2787
          +
          virtual fpos_t seek(foff_t offset, seek_t how=seek_t::beg)
          Seeks to specified relative file position.
          Definition stream.hpp:2792
          +
          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:2813
          +
          static bool exists(const stdex::schar_t *filename)
          Checks if file/folder/symlink likely exists.
          Definition stream.hpp:3033
          +
          Limits reading from/writing to stream to a predefined number of bytes.
          Definition stream.hpp:1539
          +
          fsize_t read_limit
          Number of bytes left that may be read from the stream.
          Definition stream.hpp:1591
          +
          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:1547
          +
          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:1568
          +
          fsize_t write_limit
          Number of bytes left, that can be written to the stream.
          Definition stream.hpp:1592
          +
          In-memory file.
          Definition stream.hpp:3171
          +
          memory_file & operator=(memory_file &&other) noexcept
          Moves content from another file.
          Definition stream.hpp:3353
          +
          virtual fsize_t size() const
          Returns file size Should the file size cannot be determined, the method returns fsize_max and it does...
          Definition stream.hpp:3871
          +
          memory_file(const schar_t *filename, int mode)
          Loads content from file-system file.
          Definition stream.hpp:3251
          +
          memory_file & write_str(const std::basic_string< _Elem, _Traits, _Ax > &data)
          Writes string to the stream length-prefixed.
          Definition stream.hpp:3750
          +
          memory_file(const memory_file &other)
          Copies content from another file.
          Definition stream.hpp:3269
          +
          size_t m_size
          file size
          Definition stream.hpp:4022
          +
          void get(fpos_t offset, T &data)
          Reads data from specified file location This does not move file pointer. It checks for data size Assu...
          Definition stream.hpp:3960
          +
          size_t write_stream(basic &stream, size_t amount=SIZE_MAX)
          Writes content of another stream.
          Definition stream.hpp:3785
          +
          uint8_t * m_data
          file data
          Definition stream.hpp:4019
          +
          memory_file & read_data(T &data)
          Reads one primitive data type.
          Definition stream.hpp:3539
          +
          virtual void close()
          Closes the stream.
          Definition stream.hpp:3835
          +
          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:3500
          +
          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:3866
          +
          size_t m_reserved
          reserved file size
          Definition stream.hpp:4023
          +
          memory_file(size_t size, state_t state=state_t::ok)
          Creates an empty file of reserved size.
          Definition stream.hpp:3192
          +
          void reserve(size_t required, bool tight=false) noexcept
          Reallocates memory.
          Definition stream.hpp:3391
          +
          memory_file(const stdex::sstring &filename, int mode)
          Loads content from file-system file.
          Definition stream.hpp:3262
          +
          memory_file & read_str(std::basic_string< _Elem, _Traits, _Ax > &data)
          Reads length-prefixed string from the stream.
          Definition stream.hpp:3579
          +
          memory_file(memory_file &&other) noexcept
          Moves content from another file.
          Definition stream.hpp:3324
          +
          void write_byte(uint8_t byte, size_t amount=1)
          Writes a byte of data.
          Definition stream.hpp:3634
          +
          memory_file & operator=(const memory_file &other)
          Copies content from another file.
          Definition stream.hpp:3294
          +
          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:3926
          +
          void load(const stdex::sstring &filename, int mode)
          Loads content from a file-system file.
          Definition stream.hpp:3453
          +
          size_t m_offset
          file pointer
          Definition stream.hpp:4021
          +
          void save(const schar_t *filename, int mode)
          Saves content to a file-system file.
          Definition stream.hpp:3464
          +
          void load(const schar_t *filename, int mode)
          Loads content from a file-system file.
          Definition stream.hpp:3420
          +
          virtual fpos_t seek(foff_t offset, seek_t how=seek_t::beg)
          Seeks to specified relative file position.
          Definition stream.hpp:3849
          +
          virtual void truncate()
          Sets file size - truncates the remainder of file content from the current file position to the end of...
          Definition stream.hpp:3876
          +
          memory_file & write_data(const T data)
          Writes one primitive data type.
          Definition stream.hpp:3667
          +
          memory_file & write_str(const T *data)
          Writes string to the stream length-prefixed.
          Definition stream.hpp:3705
          +
          void save(const stdex::sstring &filename, int mode)
          Saves content to a file-system file.
          Definition stream.hpp:3490
          +
          bool m_manage
          may reallocate m_data?
          Definition stream.hpp:4020
          +
          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:3241
          +
          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:3610
          +
          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:3218
          +
          const void * data() const
          Returns pointer to data.
          Definition stream.hpp:3498
          +
          Definition stream.hpp:1158
          enum stdex::stream::replicator::worker::op_t op
          Operation to perform.
          -
          size_t num_written
          Number of bytes written.
          Definition stream.hpp:1219
          -
          size_t length
          Byte limit of data to write.
          Definition stream.hpp:1218
          -
          const void * data
          Data to write.
          Definition stream.hpp:1217
          -
          Replicates writing of the same data to multiple streams.
          Definition stream.hpp:1087
          -
          void push_back(basic *source)
          Adds stream on the list.
          Definition stream.hpp:1106
          -
          virtual void flush()
          Persists volatile element data.
          Definition stream.hpp:1163
          -
          void remove(basic *source)
          Removes stream from the list.
          Definition stream.hpp:1114
          -
          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:1131
          -
          virtual void close()
          Closes the stream.
          Definition stream.hpp:1158
          -
          Socket stream.
          Definition stream.hpp:2353
          -
          socket_t get() const noexcept
          Returns socket handle.
          Definition stream.hpp:2409
          -
          virtual void close()
          Closes the stream.
          Definition stream.hpp:2455
          -
          socket(int af, int type, int protocol)
          Creates a socket.
          Definition stream.hpp:2388
          -
          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:2411
          -
          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:2435
          -
          Limits reading from/writing to stream to a predefined window.
          Definition stream.hpp:1611
          -
          fpos_t write_offset
          Number of bytes to discard on write.
          Definition stream.hpp:1687
          -
          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:1648
          -
          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:1619
          -
          fpos_t read_offset
          Number of bytes to skip on read.
          Definition stream.hpp:1686
          +
          size_t num_written
          Number of bytes written.
          Definition stream.hpp:1207
          +
          size_t length
          Byte limit of data to write.
          Definition stream.hpp:1206
          +
          const void * data
          Data to write.
          Definition stream.hpp:1205
          +
          Replicates writing of the same data to multiple streams.
          Definition stream.hpp:1075
          +
          void push_back(basic *source)
          Adds stream on the list.
          Definition stream.hpp:1094
          +
          virtual void flush()
          Persists volatile element data.
          Definition stream.hpp:1151
          +
          void remove(basic *source)
          Removes stream from the list.
          Definition stream.hpp:1102
          +
          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:1119
          +
          virtual void close()
          Closes the stream.
          Definition stream.hpp:1146
          +
          Socket stream.
          Definition stream.hpp:2341
          +
          socket_t get() const noexcept
          Returns socket handle.
          Definition stream.hpp:2397
          +
          virtual void close()
          Closes the stream.
          Definition stream.hpp:2443
          +
          socket(int af, int type, int protocol)
          Creates a socket.
          Definition stream.hpp:2376
          +
          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:2399
          +
          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:2423
          +
          Limits reading from/writing to stream to a predefined window.
          Definition stream.hpp:1599
          +
          fpos_t write_offset
          Number of bytes to discard on write.
          Definition stream.hpp:1675
          +
          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:1636
          +
          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:1607
          +
          fpos_t read_offset
          Number of bytes to skip on read.
          Definition stream.hpp:1674
          Operating system object (file, pipe, anything with an OS handle etc.)
          Definition system.hpp:93
          virtual void close()
          Closes object.
          Definition system.hpp:134
          Numerical interval.
          Definition interval.hpp:18
          @@ -4330,12 +4322,12 @@ $(document).ready(function() { init_codefold(0); });
          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:1528
          -
          Definition stream.hpp:4130
          +
          Definition stream.hpp:1516
          +
          Definition stream.hpp:4123
          diff --git a/string_8hpp_source.html b/string_8hpp_source.html index 328c58f94..9dca79d42 100644 --- a/string_8hpp_source.html +++ b/string_8hpp_source.html @@ -246,1231 +246,1275 @@ $(document).ready(function() { init_codefold(0); });
          268 return i;
          269 }
          270
          -
          271 constexpr auto npos{ static_cast<size_t>(-1) };
          -
          272
          -
          281 template <class T>
          -
          282 inline size_t strchr(_In_z_ const T* str, _In_ T chr)
          -
          283 {
          -
          284 _Assume_(str);
          -
          285 for (size_t i = 0; str[i]; ++i)
          -
          286 if (str[i] == chr) return i;
          -
          287 return npos;
          -
          288 }
          -
          289
          -
          299 template <class T>
          -
          300 inline size_t strnchr(
          -
          301 _In_reads_or_z_opt_(count) const T* str,
          -
          302 _In_ size_t count,
          -
          303 _In_ T chr)
          -
          304 {
          -
          305 _Assume_(str || !count);
          -
          306 for (size_t i = 0; i < count && str[i]; ++i)
          -
          307 if (str[i] == chr) return i;
          -
          308 return npos;
          -
          309 }
          -
          310
          -
          320 template <class T>
          -
          321 inline size_t strrnchr(
          -
          322 _In_reads_or_z_opt_(count) const T* str,
          -
          323 _In_ size_t count,
          -
          324 _In_ T chr)
          -
          325 {
          -
          326 _Assume_(str || !count);
          -
          327 size_t z = npos;
          -
          328 for (size_t i = 0; i < count && str[i]; ++i)
          -
          329 if (str[i] == chr) z = i;
          -
          330 return z;
          -
          331 }
          -
          332
          -
          341 template <class T>
          -
          342 inline bool isblank(
          -
          343 _In_reads_or_z_opt_(count) const T* str,
          -
          344 _In_ size_t count)
          -
          345 {
          -
          346 _Assume_(str || !count);
          -
          347 for (size_t i = 0; i < count && str[i]; ++i)
          -
          348 if (!isspace(str[i]))
          -
          349 return false;
          -
          350 return true;
          -
          351 }
          -
          352
          -
          362 template <class T>
          -
          363 inline bool isblank(
          -
          364 _In_reads_or_z_opt_(count) const T* str,
          -
          365 _In_ size_t count,
          -
          366 _In_ const std::locale& locale)
          -
          367 {
          -
          368 _Assume_(str || !count);
          -
          369 const auto& ctype = std::use_facet<std::ctype<T>>(locale);
          -
          370 for (size_t i = 0; i < count && str[i]; ++i)
          -
          371 if (!ctype.is(ctype.space, str[i]))
          -
          372 return false;
          -
          373 return true;
          -
          374 }
          -
          375
          -
          385 template <class T>
          -
          386 inline size_t strnichr(
          -
          387 _In_reads_or_z_opt_(count) const T* str,
          -
          388 _In_ size_t count,
          -
          389 _In_ T chr)
          -
          390 {
          -
          391 _Assume_(str || !count);
          -
          392 chr = tolower(chr);
          -
          393 for (size_t i = 0; i < count && str[i]; ++i)
          -
          394 if (tolower(str[i]) == chr) return i;
          -
          395 return npos;
          -
          396 }
          -
          397
          -
          408 template <class T>
          -
          409 inline size_t strnichr(
          -
          410 _In_reads_or_z_opt_(count) const T* str,
          -
          411 _In_ size_t count,
          -
          412 _In_ T chr,
          -
          413 _In_ const std::locale& locale)
          -
          414 {
          -
          415 _Assume_(str || !count);
          -
          416 const auto& ctype = std::use_facet<std::ctype<T>>(locale);
          -
          417 chr = ctype.tolower(chr);
          -
          418 for (size_t i = 0; i < count && str[i]; ++i)
          -
          419 if (ctype.tolower(str[i]) == chr) return i;
          -
          420 return npos;
          -
          421 }
          -
          422
          -
          432 template <class T>
          -
          433 inline size_t strrnichr(
          -
          434 _In_reads_or_z_opt_(count) const T* str,
          -
          435 _In_ size_t count,
          -
          436 _In_ T chr)
          -
          437 {
          -
          438 _Assume_(str || !count);
          -
          439 chr = tolower(chr);
          -
          440 size_t z = npos;
          -
          441 for (size_t i = 0; i < count && str[i]; ++i)
          -
          442 if (tolower(str[i]) == chr) z = i;
          -
          443 return z;
          -
          444 }
          -
          445
          -
          456 template <class T>
          -
          457 inline size_t strrnichr(
          -
          458 _In_reads_or_z_opt_(count) const T* str,
          -
          459 _In_ size_t count,
          -
          460 _In_ T chr,
          -
          461 _In_ const std::locale& locale)
          -
          462 {
          -
          463 _Assume_(str || !count);
          -
          464 const auto& ctype = std::use_facet<std::ctype<T>>(locale);
          -
          465 chr = ctype.tolower(chr);
          -
          466 size_t z = npos;
          -
          467 for (size_t i = 0; i < count && str[i]; ++i)
          -
          468 if (ctype.tolower(str[i]) == chr) z = i;
          -
          469 return z;
          -
          470 }
          -
          471
          -
          480 template <class T1, class T2>
          -
          481 inline int strcmp(const T1* str1, const T2* str2)
          -
          482 {
          -
          483 _Assume_(str1 && str2);
          -
          484 T1 a; T2 b;
          -
          485 for (size_t i = 0; (a = str1[i]) | (b = str2[i]); ++i) {
          -
          486 if (a > b) return +1;
          -
          487 if (a < b) return -1;
          -
          488 }
          -
          489 return 0;
          -
          490 }
          -
          491
          -
          502 template <class T1, class T2>
          -
          503 inline int strncmp(
          -
          504 _In_reads_or_z_opt_(count1) const T1* str1, _In_ size_t count1,
          -
          505 _In_reads_or_z_opt_(count2) const T2* str2, _In_ size_t count2)
          -
          506 {
          -
          507 _Assume_(str1 || !count1);
          -
          508 _Assume_(str2 || !count2);
          -
          509 size_t i; T1 a; T2 b;
          -
          510 for (i = 0; i < count1 && i < count2 && ((a = str1[i]) | (b = str2[i])); ++i) {
          -
          511 if (a > b) return +1;
          -
          512 if (a < b) return -1;
          -
          513 }
          -
          514 if (i < count1 && str1[i]) return +1;
          -
          515 if (i < count2 && str2[i]) return -1;
          +
          278 template <class T, size_t SIZE>
          +
          279 inline size_t strnlen(_In_ const T (&str)[SIZE])
          +
          280 {
          +
          281 return strnlen(str, SIZE);
          +
          282 }
          +
          283
          +
          284 constexpr auto npos{ static_cast<size_t>(-1) };
          +
          285
          +
          294 template <class T>
          +
          295 inline size_t strchr(_In_z_ const T* str, _In_ T chr)
          +
          296 {
          +
          297 _Assume_(str);
          +
          298 for (size_t i = 0; str[i]; ++i)
          +
          299 if (str[i] == chr) return i;
          +
          300 return npos;
          +
          301 }
          +
          302
          +
          311 template <class T, class _Traits = std::char_traits<T>, class _Ax = std::allocator<T>>
          +
          312 inline size_t strrchr(_In_ const std::basic_string<T, _Traits, _Ax>& str, _In_ T chr)
          +
          313 {
          +
          314 return strrnchr(str.data(), str.size(), chr);
          +
          315 }
          +
          316
          +
          326 template <class T>
          +
          327 inline size_t strnchr(
          +
          328 _In_reads_or_z_opt_(count) const T* str,
          +
          329 _In_ size_t count,
          +
          330 _In_ T chr)
          +
          331 {
          +
          332 _Assume_(str || !count);
          +
          333 for (size_t i = 0; i < count && str[i]; ++i)
          +
          334 if (str[i] == chr) return i;
          +
          335 return npos;
          +
          336 }
          +
          337
          +
          347 template <class T>
          +
          348 inline size_t strrnchr(
          +
          349 _In_reads_or_z_opt_(count) const T* str,
          +
          350 _In_ size_t count,
          +
          351 _In_ T chr)
          +
          352 {
          +
          353 _Assume_(str || !count);
          +
          354 size_t z = npos;
          +
          355 for (size_t i = 0; i < count && str[i]; ++i)
          +
          356 if (str[i] == chr) z = i;
          +
          357 return z;
          +
          358 }
          +
          359
          +
          368 template <class T>
          +
          369 inline bool isblank(
          +
          370 _In_reads_or_z_opt_(count) const T* str,
          +
          371 _In_ size_t count)
          +
          372 {
          +
          373 _Assume_(str || !count);
          +
          374 for (size_t i = 0; i < count && str[i]; ++i)
          +
          375 if (!isspace(str[i]))
          +
          376 return false;
          +
          377 return true;
          +
          378 }
          +
          379
          +
          389 template <class T>
          +
          390 inline bool isblank(
          +
          391 _In_reads_or_z_opt_(count) const T* str,
          +
          392 _In_ size_t count,
          +
          393 _In_ const std::locale& locale)
          +
          394 {
          +
          395 _Assume_(str || !count);
          +
          396 const auto& ctype = std::use_facet<std::ctype<T>>(locale);
          +
          397 for (size_t i = 0; i < count && str[i]; ++i)
          +
          398 if (!ctype.is(ctype.space, str[i]))
          +
          399 return false;
          +
          400 return true;
          +
          401 }
          +
          402
          +
          412 template <class T>
          +
          413 inline size_t strnichr(
          +
          414 _In_reads_or_z_opt_(count) const T* str,
          +
          415 _In_ size_t count,
          +
          416 _In_ T chr)
          +
          417 {
          +
          418 _Assume_(str || !count);
          +
          419 chr = tolower(chr);
          +
          420 for (size_t i = 0; i < count && str[i]; ++i)
          +
          421 if (tolower(str[i]) == chr) return i;
          +
          422 return npos;
          +
          423 }
          +
          424
          +
          435 template <class T>
          +
          436 inline size_t strnichr(
          +
          437 _In_reads_or_z_opt_(count) const T* str,
          +
          438 _In_ size_t count,
          +
          439 _In_ T chr,
          +
          440 _In_ const std::locale& locale)
          +
          441 {
          +
          442 _Assume_(str || !count);
          +
          443 const auto& ctype = std::use_facet<std::ctype<T>>(locale);
          +
          444 chr = ctype.tolower(chr);
          +
          445 for (size_t i = 0; i < count && str[i]; ++i)
          +
          446 if (ctype.tolower(str[i]) == chr) return i;
          +
          447 return npos;
          +
          448 }
          +
          449
          +
          459 template <class T>
          +
          460 inline size_t strrnichr(
          +
          461 _In_reads_or_z_opt_(count) const T* str,
          +
          462 _In_ size_t count,
          +
          463 _In_ T chr)
          +
          464 {
          +
          465 _Assume_(str || !count);
          +
          466 chr = tolower(chr);
          +
          467 size_t z = npos;
          +
          468 for (size_t i = 0; i < count && str[i]; ++i)
          +
          469 if (tolower(str[i]) == chr) z = i;
          +
          470 return z;
          +
          471 }
          +
          472
          +
          483 template <class T>
          +
          484 inline size_t strrnichr(
          +
          485 _In_reads_or_z_opt_(count) const T* str,
          +
          486 _In_ size_t count,
          +
          487 _In_ T chr,
          +
          488 _In_ const std::locale& locale)
          +
          489 {
          +
          490 _Assume_(str || !count);
          +
          491 const auto& ctype = std::use_facet<std::ctype<T>>(locale);
          +
          492 chr = ctype.tolower(chr);
          +
          493 size_t z = npos;
          +
          494 for (size_t i = 0; i < count && str[i]; ++i)
          +
          495 if (ctype.tolower(str[i]) == chr) z = i;
          +
          496 return z;
          +
          497 }
          +
          498
          +
          507 template <class T1, class T2>
          +
          508 inline int strcmp(const T1* str1, const T2* str2)
          +
          509 {
          +
          510 _Assume_(str1 && str2);
          +
          511 T1 a; T2 b;
          +
          512 for (size_t i = 0; (a = str1[i]) | (b = str2[i]); ++i) {
          +
          513 if (a > b) return +1;
          +
          514 if (a < b) return -1;
          +
          515 }
          516 return 0;
          517 }
          518
          -
          528 template <class T1, class T2>
          -
          529 inline int strncmp(_In_reads_or_z_opt_(count) const T1* str1, _In_reads_or_z_opt_(count) const T2* str2, _In_ size_t count)
          -
          530 {
          -
          531 _Assume_((str1 && str2) || !count);
          -
          532 size_t i; T1 a; T2 b;
          -
          533 for (i = 0; i < count && ((a = str1[i]) | (b = str2[i])); ++i) {
          -
          534 if (a > b) return +1;
          -
          535 if (a < b) return -1;
          -
          536 }
          -
          537 if (i < count && str1[i]) return +1;
          -
          538 if (i < count && str2[i]) return -1;
          -
          539 return 0;
          -
          540 }
          -
          541
          -
          553 template <class T>
          -
          554 inline int strncoll(
          -
          555 _In_reads_or_z_opt_(count1) const T* str1, _In_ size_t count1,
          -
          556 _In_reads_or_z_opt_(count2) const T* str2, _In_ size_t count2,
          -
          557 _In_ const std::locale& locale)
          -
          558 {
          -
          559 _Assume_(str1 || !count1);
          -
          560 _Assume_(str2 || !count2);
          -
          561 auto& collate = std::use_facet<std::collate<T>>(locale);
          -
          562 return collate.compare(str1, str1 + count1, str2, str2 + count2);
          -
          563 }
          -
          564
          -
          573 template <class T1, class T2>
          -
          574 inline int stricmp(_In_z_ const T1* str1, _In_z_ const T2* str2)
          -
          575 {
          -
          576 _Assume_(str1);
          -
          577 _Assume_(str2);
          -
          578 size_t i; T1 a; T2 b;
          -
          579 for (i = 0; (a = tolower(str1[i])) | (b = tolower(str2[i])); i++) {
          -
          580 if (a > b) return +1;
          -
          581 if (a < b) return -1;
          -
          582 }
          -
          583 if (str1[i]) return +1;
          -
          584 if (str2[i]) return -1;
          -
          585 return 0;
          -
          586 }
          -
          587
          -
          597 template <class T1, class T2>
          -
          598 inline int stricmp(_In_z_ const T1* str1, _In_z_ const T2* str2, _In_ const std::locale& locale)
          -
          599 {
          -
          600 _Assume_(str1);
          -
          601 _Assume_(str2);
          -
          602 size_t i; T1 a; T2 b;
          -
          603 const auto& ctype1 = std::use_facet<std::ctype<T1>>(locale);
          -
          604 const auto& ctype2 = std::use_facet<std::ctype<T2>>(locale);
          -
          605 for (i = 0; (a = ctype1.tolower(str1[i])) | (b = ctype2.tolower(str2[i])); i++) {
          -
          606 if (a > b) return +1;
          -
          607 if (a < b) return -1;
          -
          608 }
          -
          609 if (str1[i]) return +1;
          -
          610 if (str2[i]) return -1;
          -
          611 return 0;
          -
          612 }
          -
          613
          -
          623 template <class T1, class T2>
          -
          624 inline int strnicmp(_In_reads_or_z_opt_(count) const T1* str1, _In_reads_or_z_opt_(count) const T2* str2, _In_ size_t count)
          -
          625 {
          -
          626 _Assume_(str1 || !count);
          -
          627 _Assume_(str2 || !count);
          -
          628 size_t i; T1 a; T2 b;
          -
          629 for (i = 0; i < count && ((a = tolower(str1[i])) | (b = tolower(str2[i]))); i++) {
          -
          630 if (a > b) return +1;
          -
          631 if (a < b) return -1;
          -
          632 }
          -
          633 if (i < count && str1[i]) return +1;
          -
          634 if (i < count && str2[i]) return -1;
          -
          635 return 0;
          -
          636 }
          -
          637
          -
          648 template <class T1, class T2>
          -
          649 inline int strnicmp(_In_reads_or_z_opt_(count) const T1* str1, _In_reads_or_z_opt_(count) const T2* str2, _In_ size_t count, _In_ const std::locale& locale)
          -
          650 {
          -
          651 _Assume_(str1 || !count);
          -
          652 _Assume_(str2 || !count);
          -
          653 size_t i; T1 a; T2 b;
          -
          654 const auto& ctype1 = std::use_facet<std::ctype<T1>>(locale);
          -
          655 const auto& ctype2 = std::use_facet<std::ctype<T2>>(locale);
          -
          656 for (i = 0; i < count && ((a = ctype1.tolower(str1[i])) | (b = ctype2.tolower(str2[i]))); i++) {
          -
          657 if (a > b) return +1;
          -
          658 if (a < b) return -1;
          -
          659 }
          -
          660 if (i < count && str1[i]) return +1;
          -
          661 if (i < count && str2[i]) return -1;
          -
          662 return 0;
          -
          663 }
          -
          664
          -
          675 template <class T1, class T2>
          -
          676 inline int strnicmp(
          -
          677 _In_reads_or_z_opt_(count1) const T1* str1, _In_ size_t count1,
          -
          678 _In_reads_or_z_opt_(count2) const T2* str2, _In_ size_t count2)
          -
          679 {
          -
          680 _Assume_(str1 || !count1);
          -
          681 _Assume_(str2 || !count2);
          -
          682 size_t i; T1 a; T2 b;
          -
          683 for (i = 0; i < count1 && i < count2 && ((a = tolower(str1[i])) | (b = tolower(str2[i]))); i++) {
          -
          684 if (a > b) return +1;
          -
          685 if (a < b) return -1;
          -
          686 }
          -
          687 if (i < count1 && str1[i]) return +1;
          -
          688 if (i < count2 && str2[i]) return -1;
          -
          689 return 0;
          -
          690 }
          -
          691
          -
          703 template <class T1, class T2>
          -
          704 inline int strnicmp(
          -
          705 _In_reads_or_z_opt_(count1) const T1* str1, _In_ size_t count1,
          -
          706 _In_reads_or_z_opt_(count2) const T2* str2, _In_ size_t count2,
          -
          707 _In_ const std::locale& locale)
          -
          708 {
          -
          709 _Assume_(str1 || !count1);
          -
          710 _Assume_(str2 || !count2);
          -
          711 size_t i; T1 a; T2 b;
          -
          712 const auto& ctype1 = std::use_facet<std::ctype<T1>>(locale);
          -
          713 const auto& ctype2 = std::use_facet<std::ctype<T2>>(locale);
          -
          714 for (i = 0; i < count1 && i < count2 && ((a = ctype1.tolower(str1[i])) | (b = ctype2.tolower(str2[i]))); i++) {
          -
          715 if (a > b) return +1;
          -
          716 if (a < b) return -1;
          -
          717 }
          -
          718 if (i < count1 && str1[i]) return +1;
          -
          719 if (i < count2 && str2[i]) return -1;
          -
          720 return 0;
          -
          721 }
          -
          722
          -
          731 template <class T1, class T2>
          -
          732 inline size_t strstr(
          -
          733 _In_z_ const T1* str,
          -
          734 _In_z_ const T2* sample)
          -
          735 {
          -
          736 _Assume_(str);
          -
          737 _Assume_(sample);
          -
          738 for (size_t offset = 0;; ++offset) {
          -
          739 for (size_t i = offset, j = 0;; ++i, ++j) {
          -
          740 if (!sample[j])
          -
          741 return offset;
          -
          742 if (!str[i])
          -
          743 return npos;
          -
          744 if (str[i] != sample[j])
          -
          745 break;
          -
          746 }
          +
          529 template <class T1, class T2>
          +
          530 inline int strncmp(
          +
          531 _In_reads_or_z_opt_(count1) const T1* str1, _In_ size_t count1,
          +
          532 _In_reads_or_z_opt_(count2) const T2* str2, _In_ size_t count2)
          +
          533 {
          +
          534 _Assume_(str1 || !count1);
          +
          535 _Assume_(str2 || !count2);
          +
          536 size_t i; T1 a; T2 b;
          +
          537 for (i = 0; i < count1 && i < count2 && ((a = str1[i]) | (b = str2[i])); ++i) {
          +
          538 if (a > b) return +1;
          +
          539 if (a < b) return -1;
          +
          540 }
          +
          541 if (i < count1 && str1[i]) return +1;
          +
          542 if (i < count2 && str2[i]) return -1;
          +
          543 return 0;
          +
          544 }
          +
          545
          +
          555 template <class T1, class T2>
          +
          556 inline int strncmp(_In_reads_or_z_opt_(count) const T1* str1, _In_reads_or_z_opt_(count) const T2* str2, _In_ size_t count)
          +
          557 {
          +
          558 _Assume_((str1 && str2) || !count);
          +
          559 size_t i; T1 a; T2 b;
          +
          560 for (i = 0; i < count && ((a = str1[i]) | (b = str2[i])); ++i) {
          +
          561 if (a > b) return +1;
          +
          562 if (a < b) return -1;
          +
          563 }
          +
          564 if (i < count && str1[i]) return +1;
          +
          565 if (i < count && str2[i]) return -1;
          +
          566 return 0;
          +
          567 }
          +
          568
          +
          580 template <class T>
          +
          581 inline int strncoll(
          +
          582 _In_reads_or_z_opt_(count1) const T* str1, _In_ size_t count1,
          +
          583 _In_reads_or_z_opt_(count2) const T* str2, _In_ size_t count2,
          +
          584 _In_ const std::locale& locale)
          +
          585 {
          +
          586 _Assume_(str1 || !count1);
          +
          587 _Assume_(str2 || !count2);
          +
          588 auto& collate = std::use_facet<std::collate<T>>(locale);
          +
          589 return collate.compare(str1, str1 + count1, str2, str2 + count2);
          +
          590 }
          +
          591
          +
          600 template <class T1, class T2>
          +
          601 inline int stricmp(_In_z_ const T1* str1, _In_z_ const T2* str2)
          +
          602 {
          +
          603 _Assume_(str1);
          +
          604 _Assume_(str2);
          +
          605 size_t i; T1 a; T2 b;
          +
          606 for (i = 0; (a = tolower(str1[i])) | (b = tolower(str2[i])); i++) {
          +
          607 if (a > b) return +1;
          +
          608 if (a < b) return -1;
          +
          609 }
          +
          610 if (str1[i]) return +1;
          +
          611 if (str2[i]) return -1;
          +
          612 return 0;
          +
          613 }
          +
          614
          +
          623 template <class T1, class _Traits1 = std::char_traits<T1>, class _Ax1 = std::allocator<T1>, class T2, class _Traits2 = std::char_traits<T2>, class _Ax2 = std::allocator<T2>>
          +
          624 inline int stricmp(
          +
          625 _In_ const std::basic_string<T1, _Traits1, _Ax1>& str1,
          +
          626 _In_ const std::basic_string<T2, _Traits2, _Ax2>& str2)
          +
          627 {
          +
          628 return strnicmp(str1.data(), str1.size(), str2.data(), str2.size());
          +
          629 }
          +
          630
          +
          640 template <class T1, class T2>
          +
          641 inline int stricmp(_In_z_ const T1* str1, _In_z_ const T2* str2, _In_ const std::locale& locale)
          +
          642 {
          +
          643 _Assume_(str1);
          +
          644 _Assume_(str2);
          +
          645 size_t i; T1 a; T2 b;
          +
          646 const auto& ctype1 = std::use_facet<std::ctype<T1>>(locale);
          +
          647 const auto& ctype2 = std::use_facet<std::ctype<T2>>(locale);
          +
          648 for (i = 0; (a = ctype1.tolower(str1[i])) | (b = ctype2.tolower(str2[i])); i++) {
          +
          649 if (a > b) return +1;
          +
          650 if (a < b) return -1;
          +
          651 }
          +
          652 if (str1[i]) return +1;
          +
          653 if (str2[i]) return -1;
          +
          654 return 0;
          +
          655 }
          +
          656
          +
          666 template <class T1, class _Traits1 = std::char_traits<T1>, class _Ax1 = std::allocator<T1>, class T2, class _Traits2 = std::char_traits<T2>, class _Ax2 = std::allocator<T2>>
          +
          667 inline int stricmp(
          +
          668 _In_ const std::basic_string<T1, _Traits1, _Ax1>& str1,
          +
          669 _In_ const std::basic_string<T2, _Traits2, _Ax2>& str2,
          +
          670 _In_ const std::locale& locale)
          +
          671 {
          +
          672 return strnicmp(str1.data(), str1.size(), str2.data(), str2.size(), locale);
          +
          673 }
          +
          674
          +
          684 template <class T1, class T2>
          +
          685 inline int strnicmp(_In_reads_or_z_opt_(count) const T1* str1, _In_reads_or_z_opt_(count) const T2* str2, _In_ size_t count)
          +
          686 {
          +
          687 _Assume_(str1 || !count);
          +
          688 _Assume_(str2 || !count);
          +
          689 size_t i; T1 a; T2 b;
          +
          690 for (i = 0; i < count && ((a = tolower(str1[i])) | (b = tolower(str2[i]))); i++) {
          +
          691 if (a > b) return +1;
          +
          692 if (a < b) return -1;
          +
          693 }
          +
          694 if (i < count && str1[i]) return +1;
          +
          695 if (i < count && str2[i]) return -1;
          +
          696 return 0;
          +
          697 }
          +
          698
          +
          709 template <class T1, class T2>
          +
          710 inline int strnicmp(_In_reads_or_z_opt_(count) const T1* str1, _In_reads_or_z_opt_(count) const T2* str2, _In_ size_t count, _In_ const std::locale& locale)
          +
          711 {
          +
          712 _Assume_(str1 || !count);
          +
          713 _Assume_(str2 || !count);
          +
          714 size_t i; T1 a; T2 b;
          +
          715 const auto& ctype1 = std::use_facet<std::ctype<T1>>(locale);
          +
          716 const auto& ctype2 = std::use_facet<std::ctype<T2>>(locale);
          +
          717 for (i = 0; i < count && ((a = ctype1.tolower(str1[i])) | (b = ctype2.tolower(str2[i]))); i++) {
          +
          718 if (a > b) return +1;
          +
          719 if (a < b) return -1;
          +
          720 }
          +
          721 if (i < count && str1[i]) return +1;
          +
          722 if (i < count && str2[i]) return -1;
          +
          723 return 0;
          +
          724 }
          +
          725
          +
          736 template <class T1, class T2>
          +
          737 inline int strnicmp(
          +
          738 _In_reads_or_z_opt_(count1) const T1* str1, _In_ size_t count1,
          +
          739 _In_reads_or_z_opt_(count2) const T2* str2, _In_ size_t count2)
          +
          740 {
          +
          741 _Assume_(str1 || !count1);
          +
          742 _Assume_(str2 || !count2);
          +
          743 size_t i; T1 a; T2 b;
          +
          744 for (i = 0; i < count1 && i < count2 && ((a = tolower(str1[i])) | (b = tolower(str2[i]))); i++) {
          +
          745 if (a > b) return +1;
          +
          746 if (a < b) return -1;
          747 }
          -
          748 }
          -
          749
          -
          759 template <class T1, class T2>
          -
          760 inline size_t strnstr(
          -
          761 _In_reads_or_z_opt_(count) const T1* str,
          -
          762 _In_ size_t count,
          -
          763 _In_z_ const T2* sample)
          -
          764 {
          -
          765 _Assume_(str || !count);
          -
          766 _Assume_(sample);
          -
          767 for (size_t offset = 0;; ++offset) {
          -
          768 for (size_t i = offset, j = 0;; ++i, ++j) {
          -
          769 if (!sample[j])
          -
          770 return offset;
          -
          771 if (i >= count || !str[i])
          -
          772 return npos;
          -
          773 if (str[i] != sample[j])
          -
          774 break;
          -
          775 }
          -
          776 }
          -
          777 }
          -
          778
          -
          787 template <class T1, class T2>
          -
          788 inline size_t stristr(
          -
          789 _In_z_ const T1* str,
          -
          790 _In_z_ const T2* sample)
          -
          791 {
          -
          792 _Assume_(str);
          -
          793 _Assume_(sample);
          -
          794 for (size_t offset = 0;; ++offset) {
          -
          795 for (size_t i = offset, j = 0;; ++i, ++j) {
          -
          796 if (!sample[j])
          -
          797 return offset;
          -
          798 if (!str[i])
          -
          799 return npos;
          -
          800 if (tolower(str[i]) != tolower(sample[j]))
          -
          801 break;
          -
          802 }
          -
          803 }
          -
          804 }
          -
          805
          -
          815 template <class T1, class T2>
          -
          816 inline size_t stristr(
          -
          817 _In_z_ const T1* str,
          -
          818 _In_z_ const T2* sample,
          -
          819 _In_ const std::locale& locale)
          -
          820 {
          -
          821 _Assume_(str);
          -
          822 _Assume_(sample);
          -
          823 const auto& ctype1 = std::use_facet<std::ctype<T1>>(locale);
          -
          824 const auto& ctype2 = std::use_facet<std::ctype<T2>>(locale);
          -
          825 for (size_t offset = 0;; ++offset) {
          -
          826 for (size_t i = offset, j = 0;; ++i, ++j) {
          -
          827 if (!sample[j])
          -
          828 return offset;
          -
          829 if (!str[i])
          -
          830 return npos;
          -
          831 if (ctype1.tolower(str[i]) != ctype2.tolower(sample[j]))
          -
          832 break;
          -
          833 }
          -
          834 }
          -
          835 }
          -
          836
          -
          846 template <class T1, class T2>
          -
          847 inline size_t strnistr(
          -
          848 _In_reads_or_z_opt_(count) const T1* str,
          -
          849 _In_ size_t count,
          -
          850 _In_z_ const T2* sample)
          -
          851 {
          -
          852 _Assume_(str || !count);
          -
          853 _Assume_(sample);
          -
          854 for (size_t offset = 0;; ++offset) {
          -
          855 for (size_t i = offset, j = 0;; ++i, ++j) {
          -
          856 if (!sample[j])
          -
          857 return offset;
          -
          858 if (i >= count || !str[i])
          -
          859 return npos;
          -
          860 if (tolower(str[i]) != tolower(sample[j]))
          -
          861 break;
          -
          862 }
          -
          863 }
          -
          864 }
          -
          865
          +
          748 if (i < count1 && str1[i]) return +1;
          +
          749 if (i < count2 && str2[i]) return -1;
          +
          750 return 0;
          +
          751 }
          +
          752
          +
          764 template <class T1, class T2>
          +
          765 inline int strnicmp(
          +
          766 _In_reads_or_z_opt_(count1) const T1* str1, _In_ size_t count1,
          +
          767 _In_reads_or_z_opt_(count2) const T2* str2, _In_ size_t count2,
          +
          768 _In_ const std::locale& locale)
          +
          769 {
          +
          770 _Assume_(str1 || !count1);
          +
          771 _Assume_(str2 || !count2);
          +
          772 size_t i; T1 a; T2 b;
          +
          773 const auto& ctype1 = std::use_facet<std::ctype<T1>>(locale);
          +
          774 const auto& ctype2 = std::use_facet<std::ctype<T2>>(locale);
          +
          775 for (i = 0; i < count1 && i < count2 && ((a = ctype1.tolower(str1[i])) | (b = ctype2.tolower(str2[i]))); i++) {
          +
          776 if (a > b) return +1;
          +
          777 if (a < b) return -1;
          +
          778 }
          +
          779 if (i < count1 && str1[i]) return +1;
          +
          780 if (i < count2 && str2[i]) return -1;
          +
          781 return 0;
          +
          782 }
          +
          783
          +
          792 template <class T1, class T2>
          +
          793 inline size_t strstr(
          +
          794 _In_z_ const T1* str,
          +
          795 _In_z_ const T2* sample)
          +
          796 {
          +
          797 _Assume_(str);
          +
          798 _Assume_(sample);
          +
          799 for (size_t offset = 0;; ++offset) {
          +
          800 for (size_t i = offset, j = 0;; ++i, ++j) {
          +
          801 if (!sample[j])
          +
          802 return offset;
          +
          803 if (!str[i])
          +
          804 return npos;
          +
          805 if (str[i] != sample[j])
          +
          806 break;
          +
          807 }
          +
          808 }
          +
          809 }
          +
          810
          +
          820 template <class T1, class T2>
          +
          821 inline size_t strnstr(
          +
          822 _In_reads_or_z_opt_(count) const T1* str,
          +
          823 _In_ size_t count,
          +
          824 _In_z_ const T2* sample)
          +
          825 {
          +
          826 _Assume_(str || !count);
          +
          827 _Assume_(sample);
          +
          828 for (size_t offset = 0;; ++offset) {
          +
          829 for (size_t i = offset, j = 0;; ++i, ++j) {
          +
          830 if (!sample[j])
          +
          831 return offset;
          +
          832 if (i >= count || !str[i])
          +
          833 return npos;
          +
          834 if (str[i] != sample[j])
          +
          835 break;
          +
          836 }
          +
          837 }
          +
          838 }
          +
          839
          +
          848 template <class T1, class T2>
          +
          849 inline size_t stristr(
          +
          850 _In_z_ const T1* str,
          +
          851 _In_z_ const T2* sample)
          +
          852 {
          +
          853 _Assume_(str);
          +
          854 _Assume_(sample);
          +
          855 for (size_t offset = 0;; ++offset) {
          +
          856 for (size_t i = offset, j = 0;; ++i, ++j) {
          +
          857 if (!sample[j])
          +
          858 return offset;
          +
          859 if (!str[i])
          +
          860 return npos;
          +
          861 if (tolower(str[i]) != tolower(sample[j]))
          +
          862 break;
          +
          863 }
          +
          864 }
          +
          865 }
          +
          866
          876 template <class T1, class T2>
          -
          877 inline size_t strnistr(
          -
          878 _In_reads_or_z_opt_(count) const T1* str,
          -
          879 _In_ size_t count,
          -
          880 _In_z_ const T2* sample,
          -
          881 _In_ const std::locale& locale)
          -
          882 {
          -
          883 _Assume_(str || !count);
          -
          884 _Assume_(sample);
          -
          885 const auto& ctype1 = std::use_facet<std::ctype<T1>>(locale);
          -
          886 const auto& ctype2 = std::use_facet<std::ctype<T2>>(locale);
          -
          887 for (size_t offset = 0;; ++offset) {
          -
          888 for (size_t i = offset, j = 0;; ++i, ++j) {
          -
          889 if (!sample[j])
          -
          890 return offset;
          -
          891 if (i >= count || !str[i])
          -
          892 return npos;
          -
          893 if (ctype1.tolower(str[i]) != ctype2.tolower(sample[j]))
          -
          894 break;
          -
          895 }
          -
          896 }
          -
          897 }
          -
          898
          +
          877 inline size_t stristr(
          +
          878 _In_z_ const T1* str,
          +
          879 _In_z_ const T2* sample,
          +
          880 _In_ const std::locale& locale)
          +
          881 {
          +
          882 _Assume_(str);
          +
          883 _Assume_(sample);
          +
          884 const auto& ctype1 = std::use_facet<std::ctype<T1>>(locale);
          +
          885 const auto& ctype2 = std::use_facet<std::ctype<T2>>(locale);
          +
          886 for (size_t offset = 0;; ++offset) {
          +
          887 for (size_t i = offset, j = 0;; ++i, ++j) {
          +
          888 if (!sample[j])
          +
          889 return offset;
          +
          890 if (!str[i])
          +
          891 return npos;
          +
          892 if (ctype1.tolower(str[i]) != ctype2.tolower(sample[j]))
          +
          893 break;
          +
          894 }
          +
          895 }
          +
          896 }
          +
          897
          907 template <class T1, class T2>
          -
          908 inline size_t strcpy(
          -
          909 _Out_writes_z_(_String_length_(src) + 1) T1* dst,
          -
          910 _In_z_ const T2* src)
          -
          911 {
          -
          912 _Assume_(dst && src);
          -
          913 for (size_t i = 0; ; ++i) {
          -
          914 if ((dst[i] = src[i]) == 0)
          -
          915 return i;
          -
          916 }
          -
          917 }
          -
          918
          -
          928 template <class T1, class T2>
          -
          929 inline size_t strncpy(
          -
          930 _Out_writes_(count) _Post_maybez_ T1* dst,
          -
          931 _In_reads_or_z_opt_(count) const T2* src, _In_ size_t count)
          -
          932 {
          -
          933 _Assume_(dst && src || !count);
          -
          934 for (size_t i = 0; ; ++i) {
          -
          935 if (i >= count)
          -
          936 return i;
          -
          937 if ((dst[i] = src[i]) == 0)
          -
          938 return i;
          -
          939 }
          -
          940 }
          -
          941
          -
          952 template <class T1, class T2>
          -
          953 inline size_t strncpy(
          -
          954 _Out_writes_(count_dst) _Post_maybez_ T1* dst, _In_ size_t count_dst,
          -
          955 _In_reads_or_z_opt_(count_src) const T2* src, _In_ size_t count_src)
          -
          956 {
          -
          957 _Assume_(dst || !count_dst);
          -
          958 _Assume_(src || !count_src);
          -
          959 for (size_t i = 0; ; ++i)
          -
          960 {
          -
          961 if (i >= count_dst)
          -
          962 return i;
          -
          963 if (i >= count_src) {
          -
          964 dst[i] = 0;
          -
          965 return i;
          -
          966 }
          -
          967 if ((dst[i] = src[i]) == 0)
          -
          968 return i;
          -
          969 }
          -
          970 }
          -
          971
          -
          980 template <class T1, class T2>
          -
          981 inline size_t strcat(
          -
          982 _In_z_ _Out_writes_z_(_String_length_(dst) + _String_length_(src) + 1) T1* dst,
          -
          983 _In_z_ const T2* src)
          -
          984 {
          -
          985 _Assume_(dst && src);
          -
          986 for (size_t i = 0, j = stdex::strlen<T1>(dst); ; ++i, ++j) {
          -
          987 if ((dst[j] = src[i]) == 0)
          -
          988 return j;
          -
          989 }
          -
          990 }
          -
          991
          -
          1001 template <class T1, class T2>
          -
          1002 inline size_t strncat(
          -
          1003 _Inout_z_ T1* dst,
          -
          1004 _In_reads_or_z_opt_(count) const T2* src, _In_ size_t count)
          -
          1005 {
          -
          1006 _Assume_(dst && src || !count);
          -
          1007 for (size_t i = 0, j = stdex::strlen<T1>(dst); ; ++i, ++j) {
          -
          1008 if (i >= count)
          -
          1009 return j;
          -
          1010 if ((dst[j] = src[i]) == 0)
          -
          1011 return j;
          -
          1012 }
          -
          1013 }
          -
          1014
          -
          1025 template <class T1, class T2>
          -
          1026 inline size_t strncat(
          -
          1027 _Out_writes_(count_dst) _Post_maybez_ T1* dst, _In_ size_t count_dst,
          -
          1028 _In_reads_or_z_opt_(count_src) const T2* src, _In_ size_t count_src)
          -
          1029 {
          -
          1030 _Assume_(dst || !count_dst);
          -
          1031 _Assume_(src || !count_src);
          -
          1032 for (size_t i = 0, j = stdex::strnlen<T1>(dst, count_dst); ; ++i, ++j)
          -
          1033 {
          -
          1034 if (j >= count_dst)
          -
          1035 return j;
          -
          1036 if (i >= count_src) {
          -
          1037 dst[j] = 0;
          -
          1038 return j;
          -
          1039 }
          -
          1040 if ((dst[j] = src[i]) == 0)
          -
          1041 return j;
          -
          1042 }
          -
          1043 }
          -
          1044
          -
          1055 template <class T>
          -
          1056 inline _Check_return_ _Ret_maybenull_z_ T* strdup(_In_opt_z_ const T* str)
          -
          1057 {
          -
          1058 if (!str) _Unlikely_
          -
          1059 return nullptr;
          -
          1060 size_t count = strlen(str) + 1;
          -
          1061 T* dst = new T[count];
          -
          1062 strncpy(dst, count, str, SIZE_MAX);
          -
          1063 return dst;
          -
          1064 }
          -
          1065
          -
          1077 template <class T>
          -
          1078 inline _Ret_z_ T* strndup(
          -
          1079 _In_reads_or_z_opt_(count) const T* str,
          -
          1080 _In_ size_t count)
          -
          1081 {
          -
          1082 T* dst = new T[count];
          -
          1083 strncpy(dst, count, str, SIZE_MAX);
          -
          1084 return dst;
          -
          1085 }
          -
          1086
          -
          1096 template <class T>
          -
          1097 inline size_t crlf2nl(_Out_writes_z_(strlen(src)) T* dst, _In_z_ const T* src)
          -
          1098 {
          -
          1099 _Assume_(dst);
          -
          1100 _Assume_(src);
          -
          1101 size_t i, j;
          -
          1102 for (i = j = 0; src[j];) {
          -
          1103 if (src[j] != '\r' || src[j + 1] != '\n')
          -
          1104 dst[i++] = src[j++];
          -
          1105 else {
          -
          1106 dst[i++] = '\n';
          -
          1107 j += 2;
          -
          1108 }
          -
          1109 }
          -
          1110 dst[i] = 0;
          -
          1111 return i;
          -
          1112 }
          -
          1113
          -
          1120 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
          -
          1121 inline void crlf2nl(_Inout_ std::basic_string<_Elem, _Traits, _Ax>& dst, _In_z_ const _Elem* src)
          -
          1122 {
          -
          1123 _Assume_(src);
          -
          1124 _Assume_(src != dst.c_str());
          -
          1125 dst.clear();
          -
          1126 dst.reserve(strlen(src));
          -
          1127 for (size_t j = 0; src[j];) {
          -
          1128 if (src[j] != '\r' || src[j + 1] != '\n')
          -
          1129 dst += src[j++];
          -
          1130 else {
          -
          1131 dst += '\n';
          -
          1132 j += 2;
          -
          1133 }
          -
          1134 }
          -
          1135 }
          -
          1136
          -
          1142 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
          -
          1143 inline void crlf2nl(_Inout_ std::basic_string<_Elem, _Traits, _Ax>& str)
          -
          1144 {
          -
          1145 size_t i, j, n;
          -
          1146 for (i = j = 0, n = str.size(); j < n;) {
          -
          1147 if (str[j] != '\r' || str[j + 1] != '\n')
          -
          1148 str[i++] = str[j++];
          -
          1149 else {
          -
          1150 str[i++] = '\n';
          -
          1151 j += 2;
          -
          1152 }
          -
          1153 }
          -
          1154 str.resize(i);
          -
          1155 }
          -
          1156
          -
          1158 template <class T, class T_bin>
          -
          1159 inline T_bin strtoint(
          -
          1160 _In_reads_or_z_opt_(count) const T* str, _In_ size_t count,
          -
          1161 _Out_opt_ size_t* end,
          -
          1162 _In_ int radix,
          -
          1163 _Out_ uint8_t& flags)
          -
          1164 {
          -
          1165 _Assume_(str || !count);
          -
          1166 _Assume_(radix == 0 || 2 <= radix && radix <= 36);
          -
          1167
          -
          1168 size_t i = 0;
          -
          1169 T_bin value = 0, digit,
          -
          1170 max_ui = (T_bin)-1,
          -
          1171 max_ui_pre1, max_ui_pre2;
          -
          1172
          -
          1173 flags = 0;
          +
          908 inline size_t strnistr(
          +
          909 _In_reads_or_z_opt_(count) const T1* str,
          +
          910 _In_ size_t count,
          +
          911 _In_z_ const T2* sample)
          +
          912 {
          +
          913 _Assume_(str || !count);
          +
          914 _Assume_(sample);
          +
          915 for (size_t offset = 0;; ++offset) {
          +
          916 for (size_t i = offset, j = 0;; ++i, ++j) {
          +
          917 if (!sample[j])
          +
          918 return offset;
          +
          919 if (i >= count || !str[i])
          +
          920 return npos;
          +
          921 if (tolower(str[i]) != tolower(sample[j]))
          +
          922 break;
          +
          923 }
          +
          924 }
          +
          925 }
          +
          926
          +
          937 template <class T1, class T2>
          +
          938 inline size_t strnistr(
          +
          939 _In_reads_or_z_opt_(count) const T1* str,
          +
          940 _In_ size_t count,
          +
          941 _In_z_ const T2* sample,
          +
          942 _In_ const std::locale& locale)
          +
          943 {
          +
          944 _Assume_(str || !count);
          +
          945 _Assume_(sample);
          +
          946 const auto& ctype1 = std::use_facet<std::ctype<T1>>(locale);
          +
          947 const auto& ctype2 = std::use_facet<std::ctype<T2>>(locale);
          +
          948 for (size_t offset = 0;; ++offset) {
          +
          949 for (size_t i = offset, j = 0;; ++i, ++j) {
          +
          950 if (!sample[j])
          +
          951 return offset;
          +
          952 if (i >= count || !str[i])
          +
          953 return npos;
          +
          954 if (ctype1.tolower(str[i]) != ctype2.tolower(sample[j]))
          +
          955 break;
          +
          956 }
          +
          957 }
          +
          958 }
          +
          959
          +
          968 template <class T1, class T2>
          +
          969 inline size_t strcpy(
          +
          970 _Out_writes_z_(_String_length_(src) + 1) T1* dst,
          +
          971 _In_z_ const T2* src)
          +
          972 {
          +
          973 _Assume_(dst && src);
          +
          974 for (size_t i = 0; ; ++i) {
          +
          975 if ((dst[i] = src[i]) == 0)
          +
          976 return i;
          +
          977 }
          +
          978 }
          +
          979
          +
          989 template <class T1, class T2>
          +
          990 inline size_t strncpy(
          +
          991 _Out_writes_(count) _Post_maybez_ T1* dst,
          +
          992 _In_reads_or_z_opt_(count) const T2* src, _In_ size_t count)
          +
          993 {
          +
          994 _Assume_(dst && src || !count);
          +
          995 for (size_t i = 0; ; ++i) {
          +
          996 if (i >= count)
          +
          997 return i;
          +
          998 if ((dst[i] = src[i]) == 0)
          +
          999 return i;
          +
          1000 }
          +
          1001 }
          +
          1002
          +
          1013 template <class T1, class T2>
          +
          1014 inline size_t strncpy(
          +
          1015 _Out_writes_(count_dst) _Post_maybez_ T1* dst, _In_ size_t count_dst,
          +
          1016 _In_reads_or_z_opt_(count_src) const T2* src, _In_ size_t count_src)
          +
          1017 {
          +
          1018 _Assume_(dst || !count_dst);
          +
          1019 _Assume_(src || !count_src);
          +
          1020 for (size_t i = 0; ; ++i)
          +
          1021 {
          +
          1022 if (i >= count_dst)
          +
          1023 return i;
          +
          1024 if (i >= count_src) {
          +
          1025 dst[i] = 0;
          +
          1026 return i;
          +
          1027 }
          +
          1028 if ((dst[i] = src[i]) == 0)
          +
          1029 return i;
          +
          1030 }
          +
          1031 }
          +
          1032
          +
          1041 template <class T1, class T2>
          +
          1042 inline size_t strcat(
          +
          1043 _In_z_ _Out_writes_z_(_String_length_(dst) + _String_length_(src) + 1) T1* dst,
          +
          1044 _In_z_ const T2* src)
          +
          1045 {
          +
          1046 _Assume_(dst && src);
          +
          1047 for (size_t i = 0, j = stdex::strlen<T1>(dst); ; ++i, ++j) {
          +
          1048 if ((dst[j] = src[i]) == 0)
          +
          1049 return j;
          +
          1050 }
          +
          1051 }
          +
          1052
          +
          1062 template <class T1, class T2>
          +
          1063 inline size_t strncat(
          +
          1064 _Inout_z_ T1* dst,
          +
          1065 _In_reads_or_z_opt_(count) const T2* src, _In_ size_t count)
          +
          1066 {
          +
          1067 _Assume_(dst && src || !count);
          +
          1068 for (size_t i = 0, j = stdex::strlen<T1>(dst); ; ++i, ++j) {
          +
          1069 if (i >= count)
          +
          1070 return j;
          +
          1071 if ((dst[j] = src[i]) == 0)
          +
          1072 return j;
          +
          1073 }
          +
          1074 }
          +
          1075
          +
          1086 template <class T1, class T2>
          +
          1087 inline size_t strncat(
          +
          1088 _Out_writes_(count_dst) _Post_maybez_ T1* dst, _In_ size_t count_dst,
          +
          1089 _In_reads_or_z_opt_(count_src) const T2* src, _In_ size_t count_src)
          +
          1090 {
          +
          1091 _Assume_(dst || !count_dst);
          +
          1092 _Assume_(src || !count_src);
          +
          1093 for (size_t i = 0, j = stdex::strnlen<T1>(dst, count_dst); ; ++i, ++j)
          +
          1094 {
          +
          1095 if (j >= count_dst)
          +
          1096 return j;
          +
          1097 if (i >= count_src) {
          +
          1098 dst[j] = 0;
          +
          1099 return j;
          +
          1100 }
          +
          1101 if ((dst[j] = src[i]) == 0)
          +
          1102 return j;
          +
          1103 }
          +
          1104 }
          +
          1105
          +
          1116 template <class T>
          +
          1117 inline _Check_return_ _Ret_maybenull_z_ T* strdup(_In_opt_z_ const T* str)
          +
          1118 {
          +
          1119 if (!str) _Unlikely_
          +
          1120 return nullptr;
          +
          1121 size_t count = strlen(str) + 1;
          +
          1122 T* dst = new T[count];
          +
          1123 strncpy(dst, count, str, SIZE_MAX);
          +
          1124 return dst;
          +
          1125 }
          +
          1126
          +
          1138 template <class T>
          +
          1139 inline _Ret_z_ T* strndup(
          +
          1140 _In_reads_or_z_opt_(count) const T* str,
          +
          1141 _In_ size_t count)
          +
          1142 {
          +
          1143 T* dst = new T[count];
          +
          1144 strncpy(dst, count, str, SIZE_MAX);
          +
          1145 return dst;
          +
          1146 }
          +
          1147
          +
          1157 template <class T>
          +
          1158 inline size_t crlf2nl(_Out_writes_z_(strlen(src)) T* dst, _In_z_ const T* src)
          +
          1159 {
          +
          1160 _Assume_(dst);
          +
          1161 _Assume_(src);
          +
          1162 size_t i, j;
          +
          1163 for (i = j = 0; src[j];) {
          +
          1164 if (src[j] != '\r' || src[j + 1] != '\n')
          +
          1165 dst[i++] = src[j++];
          +
          1166 else {
          +
          1167 dst[i++] = '\n';
          +
          1168 j += 2;
          +
          1169 }
          +
          1170 }
          +
          1171 dst[i] = 0;
          +
          1172 return i;
          +
          1173 }
          1174
          -
          1175 // Skip leading spaces.
          -
          1176 for (;; ++i) {
          -
          1177 if (i >= count || !str[i]) goto error;
          -
          1178 if (!isspace(str[i])) break;
          -
          1179 }
          -
          1180
          -
          1181 // Read the sign.
          -
          1182 if (str[i] == '+') {
          -
          1183 flags &= ~0x01;
          -
          1184 ++i;
          -
          1185 if (i >= count || !str[i]) goto error;
          -
          1186 }
          -
          1187 else if (str[i] == '-') {
          -
          1188 flags |= 0x01;
          -
          1189 ++i;
          -
          1190 if (i >= count || !str[i]) goto error;
          -
          1191 }
          -
          1192
          -
          1193 if (radix == 16) {
          -
          1194 // On hexadecimal, allow leading 0x.
          -
          1195 if (str[i] == '0' && i + 1 < count && (str[i + 1] == 'x' || str[i + 1] == 'X')) {
          -
          1196 i += 2;
          -
          1197 if (i >= count || !str[i]) goto error;
          -
          1198 }
          -
          1199 }
          -
          1200 else if (!radix) {
          -
          1201 // Autodetect radix.
          -
          1202 if (str[i] == '0') {
          -
          1203 ++i;
          -
          1204 if (i >= count || !str[i]) goto error;
          -
          1205 if (str[i] == 'x' || str[i] == 'X') {
          -
          1206 radix = 16;
          -
          1207 ++i;
          -
          1208 if (i >= count || !str[i]) goto error;
          -
          1209 }
          -
          1210 else
          -
          1211 radix = 8;
          -
          1212 }
          -
          1213 else
          -
          1214 radix = 10;
          -
          1215 }
          -
          1216
          -
          1217 // We have the radix.
          -
          1218 max_ui_pre1 = max_ui / (T_bin)radix;
          -
          1219 max_ui_pre2 = max_ui % (T_bin)radix;
          -
          1220 for (;;) {
          -
          1221 if ('0' <= str[i] && str[i] <= '9')
          -
          1222 digit = (T_bin)str[i] - '0';
          -
          1223 else if ('A' <= str[i] && str[i] <= 'Z')
          -
          1224 digit = (T_bin)str[i] - 'A' + '\x0a';
          -
          1225 else if ('a' <= str[i] && str[i] <= 'z')
          -
          1226 digit = (T_bin)str[i] - 'a' + '\x0a';
          -
          1227 else
          -
          1228 goto error;
          -
          1229 if (digit >= (T_bin)radix)
          -
          1230 goto error;
          -
          1231
          -
          1232 if (value < max_ui_pre1 || // Multiplication nor addition will not overflow.
          -
          1233 (value == max_ui_pre1 && digit <= max_ui_pre2)) // Small digits will not overflow.
          -
          1234 value = value * (T_bin)radix + digit;
          -
          1235 else {
          -
          1236 // Overflow!
          -
          1237 flags |= 0x02;
          -
          1238 }
          -
          1239
          -
          1240 ++i;
          -
          1241 if (i >= count || !str[i])
          -
          1242 goto error;
          -
          1243 }
          -
          1244
          -
          1245 error:
          -
          1246 if (end) *end = i;
          -
          1247 return value;
          -
          1248 }
          -
          1250
          -
          1261 template <class T, class T_bin>
          -
          1262 T_bin strtoint(
          -
          1263 _In_reads_or_z_opt_(count) const T* str, _In_ size_t count,
          -
          1264 _Out_opt_ size_t* end,
          -
          1265 _In_ int radix)
          -
          1266 {
          -
          1267 uint8_t flags;
          -
          1268 T_bin value;
          -
          1269
          -
          1270 switch (sizeof(T_bin)) {
          -
          1271 case 1:
          -
          1272 value = (T_bin)strtoint<T, uint8_t>(str, count, end, radix, flags);
          -
          1273 if ((flags & 0x01) && (value & 0x80)) {
          -
          1274 // Sign bit is 1 => overflow.
          -
          1275 flags |= 0x02;
          -
          1276 }
          -
          1277 return (flags & 0x02) ?
          -
          1278 (flags & 0x01) ? (T_bin)0x80 : (T_bin)0x7f :
          -
          1279 (flags & 0x01) ? -value : value;
          -
          1280
          -
          1281 case 2:
          -
          1282 value = (T_bin)strtoint<T, uint16_t>(str, count, end, radix, flags);
          -
          1283 if ((flags & 0x01) && (value & 0x8000)) {
          -
          1284 // Sign bit is 1 => overflow.
          -
          1285 flags |= 0x02;
          -
          1286 }
          -
          1287 return (flags & 0x02) ?
          -
          1288 (flags & 0x01) ? (T_bin)0x8000 : (T_bin)0x7fff :
          -
          1289 (flags & 0x01) ? -value : value;
          -
          1290
          -
          1291 case 4:
          -
          1292 value = (T_bin)strtoint<T, uint32_t>(str, count, end, radix, flags);
          -
          1293 if ((flags & 0x01) && (value & 0x80000000)) {
          -
          1294 // Sign bit is 1 => overflow.
          -
          1295 flags |= 0x02;
          -
          1296 }
          -
          1297 return (flags & 0x02) ?
          -
          1298 (flags & 0x01) ? (T_bin)0x80000000 : (T_bin)0x7fffffff :
          -
          1299 (flags & 0x01) ? -value : value;
          +
          1181 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
          +
          1182 inline void crlf2nl(_Inout_ std::basic_string<_Elem, _Traits, _Ax>& dst, _In_z_ const _Elem* src)
          +
          1183 {
          +
          1184 _Assume_(src);
          +
          1185 _Assume_(src != dst.c_str());
          +
          1186 dst.clear();
          +
          1187 dst.reserve(strlen(src));
          +
          1188 for (size_t j = 0; src[j];) {
          +
          1189 if (src[j] != '\r' || src[j + 1] != '\n')
          +
          1190 dst += src[j++];
          +
          1191 else {
          +
          1192 dst += '\n';
          +
          1193 j += 2;
          +
          1194 }
          +
          1195 }
          +
          1196 }
          +
          1197
          +
          1203 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
          +
          1204 inline void crlf2nl(_Inout_ std::basic_string<_Elem, _Traits, _Ax>& str)
          +
          1205 {
          +
          1206 size_t i, j, n;
          +
          1207 for (i = j = 0, n = str.size(); j < n;) {
          +
          1208 if (str[j] != '\r' || str[j + 1] != '\n')
          +
          1209 str[i++] = str[j++];
          +
          1210 else {
          +
          1211 str[i++] = '\n';
          +
          1212 j += 2;
          +
          1213 }
          +
          1214 }
          +
          1215 str.resize(i);
          +
          1216 }
          +
          1217
          +
          1219 template <class T, class T_bin>
          +
          1220 inline T_bin strtoint(
          +
          1221 _In_reads_or_z_opt_(count) const T* str, _In_ size_t count,
          +
          1222 _Out_opt_ size_t* end,
          +
          1223 _In_ int radix,
          +
          1224 _Out_ uint8_t& flags)
          +
          1225 {
          +
          1226 _Assume_(str || !count);
          +
          1227 _Assume_(radix == 0 || 2 <= radix && radix <= 36);
          +
          1228
          +
          1229 size_t i = 0;
          +
          1230 T_bin value = 0, digit,
          +
          1231 max_ui = (T_bin)-1,
          +
          1232 max_ui_pre1, max_ui_pre2;
          +
          1233
          +
          1234 flags = 0;
          +
          1235
          +
          1236 // Skip leading spaces.
          +
          1237 for (;; ++i) {
          +
          1238 if (i >= count || !str[i]) goto error;
          +
          1239 if (!isspace(str[i])) break;
          +
          1240 }
          +
          1241
          +
          1242 // Read the sign.
          +
          1243 if (str[i] == '+') {
          +
          1244 flags &= ~0x01;
          +
          1245 ++i;
          +
          1246 if (i >= count || !str[i]) goto error;
          +
          1247 }
          +
          1248 else if (str[i] == '-') {
          +
          1249 flags |= 0x01;
          +
          1250 ++i;
          +
          1251 if (i >= count || !str[i]) goto error;
          +
          1252 }
          +
          1253
          +
          1254 if (radix == 16) {
          +
          1255 // On hexadecimal, allow leading 0x.
          +
          1256 if (str[i] == '0' && i + 1 < count && (str[i + 1] == 'x' || str[i + 1] == 'X')) {
          +
          1257 i += 2;
          +
          1258 if (i >= count || !str[i]) goto error;
          +
          1259 }
          +
          1260 }
          +
          1261 else if (!radix) {
          +
          1262 // Autodetect radix.
          +
          1263 if (str[i] == '0') {
          +
          1264 ++i;
          +
          1265 if (i >= count || !str[i]) goto error;
          +
          1266 if (str[i] == 'x' || str[i] == 'X') {
          +
          1267 radix = 16;
          +
          1268 ++i;
          +
          1269 if (i >= count || !str[i]) goto error;
          +
          1270 }
          +
          1271 else
          +
          1272 radix = 8;
          +
          1273 }
          +
          1274 else
          +
          1275 radix = 10;
          +
          1276 }
          +
          1277
          +
          1278 // We have the radix.
          +
          1279 max_ui_pre1 = max_ui / (T_bin)radix;
          +
          1280 max_ui_pre2 = max_ui % (T_bin)radix;
          +
          1281 for (;;) {
          +
          1282 if ('0' <= str[i] && str[i] <= '9')
          +
          1283 digit = (T_bin)str[i] - '0';
          +
          1284 else if ('A' <= str[i] && str[i] <= 'Z')
          +
          1285 digit = (T_bin)str[i] - 'A' + '\x0a';
          +
          1286 else if ('a' <= str[i] && str[i] <= 'z')
          +
          1287 digit = (T_bin)str[i] - 'a' + '\x0a';
          +
          1288 else
          +
          1289 goto error;
          +
          1290 if (digit >= (T_bin)radix)
          +
          1291 goto error;
          +
          1292
          +
          1293 if (value < max_ui_pre1 || // Multiplication nor addition will not overflow.
          +
          1294 (value == max_ui_pre1 && digit <= max_ui_pre2)) // Small digits will not overflow.
          +
          1295 value = value * (T_bin)radix + digit;
          +
          1296 else {
          +
          1297 // Overflow!
          +
          1298 flags |= 0x02;
          +
          1299 }
          1300
          -
          1301 case 8:
          -
          1302 value = (T_bin)strtoint<T, uint64_t>(str, count, end, radix, flags);
          -
          1303 if ((flags & 0x01) && (value & 0x8000000000000000)) {
          -
          1304 // Sign bit is 1 => overflow.
          -
          1305 flags |= 0x02;
          -
          1306 }
          -
          1307 return (flags & 0x02) ?
          -
          1308 (flags & 0x01) ? (T_bin)0x8000000000000000 : (T_bin)0x7fffffffffffffff :
          -
          1309 (flags & 0x01) ? -value : value;
          -
          1310
          -
          1311 default:
          -
          1312 throw std::invalid_argument("Unsupported bit length");
          -
          1313 }
          -
          1314 }
          -
          1315
          -
          1326 template <class T, class T_bin>
          -
          1327 inline T_bin strtouint(
          -
          1328 _In_reads_or_z_opt_(count) const T* str,
          -
          1329 _In_ size_t count,
          -
          1330 _Out_opt_ size_t* end,
          -
          1331 _In_ int radix)
          -
          1332 {
          -
          1333 uint8_t flags;
          -
          1334 T_bin value;
          -
          1335
          -
          1336 switch (sizeof(T_bin)) {
          -
          1337 case 1: value = (T_bin)strtoint<T, uint8_t>(str, count, end, radix, flags); break;
          -
          1338 case 2: value = (T_bin)strtoint<T, uint16_t>(str, count, end, radix, flags); break;
          -
          1339 case 4: value = (T_bin)strtoint<T, uint32_t>(str, count, end, radix, flags); break;
          -
          1340 case 8: value = (T_bin)strtoint<T, uint64_t>(str, count, end, radix, flags); break;
          -
          1341 default: throw std::invalid_argument("Unsupported bit length");
          -
          1342 }
          -
          1343
          -
          1344 return (flags & 0x02) ?
          -
          1345 (flags & 0x01) ? (T_bin)0 : (T_bin)-1 :
          -
          1346 (flags & 0x01) ? ~value : value;
          -
          1347 }
          -
          1348
          -
          1359 template <class T>
          -
          1360 inline int32_t strto32(
          -
          1361 _In_reads_or_z_opt_(count) const T* str, _In_ size_t count,
          -
          1362 _Out_opt_ size_t* end,
          -
          1363 _In_ int radix)
          -
          1364 {
          -
          1365 return strtoint<T, int32_t>(str, count, end, radix);
          -
          1366 }
          -
          1367
          -
          1378 template <class T>
          -
          1379 inline int64_t strto64(
          -
          1380 _In_reads_or_z_opt_(count) const T* str, _In_ size_t count,
          -
          1381 _Out_opt_ size_t* end,
          -
          1382 _In_ int radix)
          -
          1383 {
          -
          1384 return strtoint<T, int64_t>(str, count, end, radix);
          -
          1385 }
          -
          1386
          -
          1398 template <class T>
          -
          1399 inline intptr_t strtoi(
          -
          1400 _In_reads_or_z_opt_(count) const T* str, _In_ size_t count,
          -
          1401 _Out_opt_ size_t* end,
          -
          1402 _In_ int radix)
          -
          1403 {
          -
          1404#if defined(_WIN64) || defined(__LP64__)
          -
          1405 return (intptr_t)strto64(str, count, end, radix);
          -
          1406#else
          -
          1407 return (intptr_t)strto32(str, count, end, radix);
          -
          1408#endif
          -
          1409 }
          -
          1410
          -
          1421 template <class T>
          -
          1422 inline uint32_t strtou32(
          -
          1423 _In_reads_or_z_opt_(count) const T* str, _In_ size_t count,
          -
          1424 _Out_opt_ size_t* end,
          -
          1425 _In_ int radix)
          -
          1426 {
          -
          1427 return strtouint<T, uint32_t>(str, count, end, radix);
          -
          1428 }
          -
          1429
          -
          1440 template <class T>
          -
          1441 inline uint64_t strtou64(
          -
          1442 _In_reads_or_z_opt_(count) const T* str, _In_ size_t count,
          -
          1443 _Out_opt_ size_t* end,
          -
          1444 _In_ int radix)
          -
          1445 {
          -
          1446 return strtouint<T, uint64_t>(str, count, end, radix);
          -
          1447 }
          -
          1448
          -
          1460 template <class T>
          -
          1461 inline size_t strtoui(
          -
          1462 _In_reads_or_z_opt_(count) const T* str, _In_ size_t count,
          -
          1463 _Out_opt_ size_t* end,
          -
          1464 _In_ int radix)
          -
          1465 {
          -
          1466#if defined(_WIN64) || defined(__LP64__)
          -
          1467 return (size_t)strtou64(str, count, end, radix);
          -
          1468#else
          -
          1469 return (size_t)strtou32(str, count, end, radix);
          -
          1470#endif
          -
          1471 }
          -
          1472
          -
          1474 inline int vsnprintf(_Out_z_cap_(capacity) char* str, _In_ size_t capacity, _In_z_ _Printf_format_string_params_(2) const char* format, _In_opt_ locale_t locale, _In_ va_list arg)
          -
          1475 {
          -
          1476 int r;
          -
          1477#ifdef _WIN32
          -
          1478 // Don't use _vsnprintf_s(). It terminates the string even if we want to print to the edge of the buffer.
          -
          1479#pragma warning(suppress: 4996)
          -
          1480 r = _vsnprintf_l(str, capacity, format, locale, arg);
          -
          1481#else
          -
          1482 r = ::vsnprintf(str, capacity, format, arg);
          -
          1483#endif
          -
          1484 if (r == -1 && strnlen(str, capacity) == capacity) {
          -
          1485 // Buffer overrun. Estimate buffer size for the next iteration.
          -
          1486 capacity += std::max<size_t>(capacity / 8, 0x80);
          -
          1487 if (capacity > INT_MAX)
          -
          1488 throw std::invalid_argument("string too big");
          -
          1489 return (int)capacity;
          -
          1490 }
          -
          1491 return r;
          -
          1492 }
          -
          1493
          -
          1494 inline int vsnprintf(_Out_z_cap_(capacity) wchar_t* str, _In_ size_t capacity, _In_z_ _Printf_format_string_params_(2) const wchar_t* format, _In_opt_ locale_t locale, _In_ va_list arg)
          -
          1495 {
          -
          1496 int r;
          -
          1497#ifdef _WIN32
          -
          1498 // Don't use _vsnwprintf_s(). It terminates the string even if we want to print to the edge of the buffer.
          -
          1499#pragma warning(suppress: 4996)
          -
          1500 r = _vsnwprintf_l(str, capacity, format, locale, arg);
          -
          1501#else
          -
          1502 r = vswprintf(str, capacity, format, arg);
          -
          1503#endif
          -
          1504 if (r == -1 && strnlen(str, capacity) == capacity) {
          -
          1505 // Buffer overrun. Estimate buffer size for the next iteration.
          -
          1506 capacity += std::max<size_t>(capacity / 8, 0x80);
          -
          1507 if (capacity > INT_MAX)
          -
          1508 throw std::invalid_argument("string too big");
          -
          1509 return (int)capacity;
          -
          1510 }
          -
          1511 return r;
          -
          1512 }
          -
          1514
          -
          1525 template<class _Elem, class _Traits, class _Ax>
          -
          1526 inline size_t vappendf(_Inout_ std::basic_string<_Elem, _Traits, _Ax>& str, _In_z_ _Printf_format_string_params_(2) const _Elem* format, _In_opt_ locale_t locale, _In_ va_list arg)
          -
          1527 {
          -
          1528 _Elem buf[1024 / sizeof(_Elem)];
          -
          1529
          -
          1530 // Try with stack buffer first.
          -
          1531 int count = vsnprintf(buf, _countof(buf) - 1, format, locale, arg);
          -
          1532 if (count >= 0) {
          -
          1533 // Copy from stack.
          -
          1534 str.append(buf, count);
          -
          1535 return count;
          -
          1536 }
          -
          1537 for (size_t capacity = 2 * 1024 / sizeof(_Elem);; capacity *= 2) {
          -
          1538 // Allocate on heap and retry.
          -
          1539 auto buf_dyn = std::make_unique<_Elem[]>(capacity);
          -
          1540 count = vsnprintf(buf_dyn.get(), capacity - 1, format, locale, arg);
          -
          1541 if (count >= 0) {
          -
          1542 str.append(buf_dyn.get(), count);
          -
          1543 return count;
          -
          1544 }
          -
          1545 }
          -
          1546 }
          -
          1547
          -
          1557 template<class _Elem, class _Traits, class _Ax>
          -
          1558 inline size_t appendf(_Inout_ std::basic_string<_Elem, _Traits, _Ax>& str, _In_z_ _Printf_format_string_params_(2) const _Elem* format, _In_opt_ locale_t locale, ...)
          -
          1559 {
          -
          1560 va_list arg;
          -
          1561 va_start(arg, locale);
          -
          1562 size_t n = vappendf(str, format, locale, arg);
          -
          1563 va_end(arg);
          -
          1564 return n;
          -
          1565 }
          -
          1566
          -
          1575 template<class _Elem, class _Traits, class _Ax>
          -
          1576 inline void vsprintf(_Inout_ std::basic_string<_Elem, _Traits, _Ax>& str, _In_z_ _Printf_format_string_params_(2) const _Elem* format, _In_opt_ locale_t locale, _In_ va_list arg)
          -
          1577 {
          -
          1578 str.clear();
          -
          1579 vappendf(str, format, locale, arg);
          -
          1580 }
          -
          1581
          -
          1589 template<class _Elem, class _Traits, class _Ax>
          -
          1590 inline void sprintf(_Inout_ std::basic_string<_Elem, _Traits, _Ax>& str, _In_z_ _Printf_format_string_params_(2) const _Elem* format, _In_opt_ locale_t locale, ...)
          -
          1591 {
          -
          1592 va_list arg;
          -
          1593 va_start(arg, locale);
          -
          1594 vsprintf(str, format, locale, arg);
          -
          1595 va_end(arg);
          -
          1596 }
          -
          1597
          -
          1607 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
          -
          1608 inline std::basic_string<_Elem, _Traits, _Ax> vsprintf(_In_z_ _Printf_format_string_params_(2) const _Elem* format, _In_opt_ locale_t locale, _In_ va_list arg)
          -
          1609 {
          -
          1610 std::basic_string<_Elem, _Traits, _Ax> str;
          -
          1611 vappendf(str, format, locale, arg);
          -
          1612 return str;
          -
          1613 }
          -
          1614
          -
          1623 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
          -
          1624 inline std::basic_string<_Elem, _Traits, _Ax> sprintf(_In_z_ _Printf_format_string_params_(2) const _Elem* format, _In_opt_ locale_t locale, ...)
          -
          1625 {
          -
          1626 va_list arg;
          -
          1627 va_start(arg, locale);
          -
          1628 auto str = vsprintf(format, locale, arg);
          -
          1629 va_end(arg);
          -
          1630 return str;
          -
          1631 }
          -
          1632
          -
          1634 inline size_t strftime(_Out_z_cap_(capacity) char* str, _In_ size_t capacity, _In_z_ _Printf_format_string_ const char* format, _In_ const struct tm* time, _In_opt_ locale_t locale)
          -
          1635 {
          -
          1636#ifdef _WIN32
          -
          1637 return _strftime_l(str, capacity, format, time, locale);
          -
          1638#else
          -
          1639 return strftime_l(str, capacity, format, time, locale);
          -
          1640#endif
          +
          1301 ++i;
          +
          1302 if (i >= count || !str[i])
          +
          1303 goto error;
          +
          1304 }
          +
          1305
          +
          1306 error:
          +
          1307 if (end) *end = i;
          +
          1308 return value;
          +
          1309 }
          +
          1311
          +
          1322 template <class T, class T_bin>
          +
          1323 T_bin strtoint(
          +
          1324 _In_reads_or_z_opt_(count) const T* str, _In_ size_t count,
          +
          1325 _Out_opt_ size_t* end,
          +
          1326 _In_ int radix)
          +
          1327 {
          +
          1328 uint8_t flags;
          +
          1329 T_bin value;
          +
          1330
          +
          1331 switch (sizeof(T_bin)) {
          +
          1332 case 1:
          +
          1333 value = (T_bin)strtoint<T, uint8_t>(str, count, end, radix, flags);
          +
          1334 if ((flags & 0x01) && (value & 0x80)) {
          +
          1335 // Sign bit is 1 => overflow.
          +
          1336 flags |= 0x02;
          +
          1337 }
          +
          1338 return (flags & 0x02) ?
          +
          1339 (flags & 0x01) ? (T_bin)0x80 : (T_bin)0x7f :
          +
          1340 (flags & 0x01) ? -value : value;
          +
          1341
          +
          1342 case 2:
          +
          1343 value = (T_bin)strtoint<T, uint16_t>(str, count, end, radix, flags);
          +
          1344 if ((flags & 0x01) && (value & 0x8000)) {
          +
          1345 // Sign bit is 1 => overflow.
          +
          1346 flags |= 0x02;
          +
          1347 }
          +
          1348 return (flags & 0x02) ?
          +
          1349 (flags & 0x01) ? (T_bin)0x8000 : (T_bin)0x7fff :
          +
          1350 (flags & 0x01) ? -value : value;
          +
          1351
          +
          1352 case 4:
          +
          1353 value = (T_bin)strtoint<T, uint32_t>(str, count, end, radix, flags);
          +
          1354 if ((flags & 0x01) && (value & 0x80000000)) {
          +
          1355 // Sign bit is 1 => overflow.
          +
          1356 flags |= 0x02;
          +
          1357 }
          +
          1358 return (flags & 0x02) ?
          +
          1359 (flags & 0x01) ? (T_bin)0x80000000 : (T_bin)0x7fffffff :
          +
          1360 (flags & 0x01) ? -value : value;
          +
          1361
          +
          1362 case 8:
          +
          1363 value = (T_bin)strtoint<T, uint64_t>(str, count, end, radix, flags);
          +
          1364 if ((flags & 0x01) && (value & 0x8000000000000000)) {
          +
          1365 // Sign bit is 1 => overflow.
          +
          1366 flags |= 0x02;
          +
          1367 }
          +
          1368 return (flags & 0x02) ?
          +
          1369 (flags & 0x01) ? (T_bin)0x8000000000000000 : (T_bin)0x7fffffffffffffff :
          +
          1370 (flags & 0x01) ? -value : value;
          +
          1371
          +
          1372 default:
          +
          1373 throw std::invalid_argument("Unsupported bit length");
          +
          1374 }
          +
          1375 }
          +
          1376
          +
          1387 template <class T, class T_bin>
          +
          1388 inline T_bin strtouint(
          +
          1389 _In_reads_or_z_opt_(count) const T* str,
          +
          1390 _In_ size_t count,
          +
          1391 _Out_opt_ size_t* end,
          +
          1392 _In_ int radix)
          +
          1393 {
          +
          1394 uint8_t flags;
          +
          1395 T_bin value;
          +
          1396
          +
          1397 switch (sizeof(T_bin)) {
          +
          1398 case 1: value = (T_bin)strtoint<T, uint8_t>(str, count, end, radix, flags); break;
          +
          1399 case 2: value = (T_bin)strtoint<T, uint16_t>(str, count, end, radix, flags); break;
          +
          1400 case 4: value = (T_bin)strtoint<T, uint32_t>(str, count, end, radix, flags); break;
          +
          1401 case 8: value = (T_bin)strtoint<T, uint64_t>(str, count, end, radix, flags); break;
          +
          1402 default: throw std::invalid_argument("Unsupported bit length");
          +
          1403 }
          +
          1404
          +
          1405 return (flags & 0x02) ?
          +
          1406 (flags & 0x01) ? (T_bin)0 : (T_bin)-1 :
          +
          1407 (flags & 0x01) ? ~value : value;
          +
          1408 }
          +
          1409
          +
          1420 template <class T>
          +
          1421 inline int32_t strto32(
          +
          1422 _In_reads_or_z_opt_(count) const T* str, _In_ size_t count,
          +
          1423 _Out_opt_ size_t* end,
          +
          1424 _In_ int radix)
          +
          1425 {
          +
          1426 return strtoint<T, int32_t>(str, count, end, radix);
          +
          1427 }
          +
          1428
          +
          1439 template <class T>
          +
          1440 inline int64_t strto64(
          +
          1441 _In_reads_or_z_opt_(count) const T* str, _In_ size_t count,
          +
          1442 _Out_opt_ size_t* end,
          +
          1443 _In_ int radix)
          +
          1444 {
          +
          1445 return strtoint<T, int64_t>(str, count, end, radix);
          +
          1446 }
          +
          1447
          +
          1459 template <class T>
          +
          1460 inline intptr_t strtoi(
          +
          1461 _In_reads_or_z_opt_(count) const T* str, _In_ size_t count,
          +
          1462 _Out_opt_ size_t* end,
          +
          1463 _In_ int radix)
          +
          1464 {
          +
          1465#if defined(_WIN64) || defined(__LP64__)
          +
          1466 return (intptr_t)strto64(str, count, end, radix);
          +
          1467#else
          +
          1468 return (intptr_t)strto32(str, count, end, radix);
          +
          1469#endif
          +
          1470 }
          +
          1471
          +
          1482 template <class T>
          +
          1483 inline uint32_t strtou32(
          +
          1484 _In_reads_or_z_opt_(count) const T* str, _In_ size_t count,
          +
          1485 _Out_opt_ size_t* end,
          +
          1486 _In_ int radix)
          +
          1487 {
          +
          1488 return strtouint<T, uint32_t>(str, count, end, radix);
          +
          1489 }
          +
          1490
          +
          1501 template <class T>
          +
          1502 inline uint64_t strtou64(
          +
          1503 _In_reads_or_z_opt_(count) const T* str, _In_ size_t count,
          +
          1504 _Out_opt_ size_t* end,
          +
          1505 _In_ int radix)
          +
          1506 {
          +
          1507 return strtouint<T, uint64_t>(str, count, end, radix);
          +
          1508 }
          +
          1509
          +
          1521 template <class T>
          +
          1522 inline size_t strtoui(
          +
          1523 _In_reads_or_z_opt_(count) const T* str, _In_ size_t count,
          +
          1524 _Out_opt_ size_t* end,
          +
          1525 _In_ int radix)
          +
          1526 {
          +
          1527#if defined(_WIN64) || defined(__LP64__)
          +
          1528 return (size_t)strtou64(str, count, end, radix);
          +
          1529#else
          +
          1530 return (size_t)strtou32(str, count, end, radix);
          +
          1531#endif
          +
          1532 }
          +
          1533
          +
          1535 inline int vsnprintf(_Out_z_cap_(capacity) char* str, _In_ size_t capacity, _In_z_ _Printf_format_string_params_(2) const char* format, _In_opt_ locale_t locale, _In_ va_list arg)
          +
          1536 {
          +
          1537 int r;
          +
          1538#ifdef _WIN32
          +
          1539 // Don't use _vsnprintf_s(). It terminates the string even if we want to print to the edge of the buffer.
          +
          1540#pragma warning(suppress: 4996)
          +
          1541 r = _vsnprintf_l(str, capacity, format, locale, arg);
          +
          1542#else
          +
          1543 r = ::vsnprintf(str, capacity, format, arg);
          +
          1544#endif
          +
          1545 if (r == -1 && strnlen(str, capacity) == capacity) {
          +
          1546 // Buffer overrun. Estimate buffer size for the next iteration.
          +
          1547 capacity += std::max<size_t>(capacity / 8, 0x80);
          +
          1548 if (capacity > INT_MAX)
          +
          1549 throw std::invalid_argument("string too big");
          +
          1550 return (int)capacity;
          +
          1551 }
          +
          1552 return r;
          +
          1553 }
          +
          1554
          +
          1555 inline int vsnprintf(_Out_z_cap_(capacity) wchar_t* str, _In_ size_t capacity, _In_z_ _Printf_format_string_params_(2) const wchar_t* format, _In_opt_ locale_t locale, _In_ va_list arg)
          +
          1556 {
          +
          1557 int r;
          +
          1558#ifdef _WIN32
          +
          1559 // Don't use _vsnwprintf_s(). It terminates the string even if we want to print to the edge of the buffer.
          +
          1560#pragma warning(suppress: 4996)
          +
          1561 r = _vsnwprintf_l(str, capacity, format, locale, arg);
          +
          1562#else
          +
          1563 r = vswprintf(str, capacity, format, arg);
          +
          1564#endif
          +
          1565 if (r == -1 && strnlen(str, capacity) == capacity) {
          +
          1566 // Buffer overrun. Estimate buffer size for the next iteration.
          +
          1567 capacity += std::max<size_t>(capacity / 8, 0x80);
          +
          1568 if (capacity > INT_MAX)
          +
          1569 throw std::invalid_argument("string too big");
          +
          1570 return (int)capacity;
          +
          1571 }
          +
          1572 return r;
          +
          1573 }
          +
          1575
          +
          1586 template<class _Elem, class _Traits, class _Ax>
          +
          1587 inline size_t vappendf(_Inout_ std::basic_string<_Elem, _Traits, _Ax>& str, _In_z_ _Printf_format_string_params_(2) const _Elem* format, _In_opt_ locale_t locale, _In_ va_list arg)
          +
          1588 {
          +
          1589 _Elem buf[1024 / sizeof(_Elem)];
          +
          1590
          +
          1591 // Try with stack buffer first.
          +
          1592 int count = vsnprintf(buf, _countof(buf) - 1, format, locale, arg);
          +
          1593 if (count >= 0) {
          +
          1594 // Copy from stack.
          +
          1595 str.append(buf, count);
          +
          1596 return count;
          +
          1597 }
          +
          1598 for (size_t capacity = 2 * 1024 / sizeof(_Elem);; capacity *= 2) {
          +
          1599 // Allocate on heap and retry.
          +
          1600 auto buf_dyn = std::make_unique<_Elem[]>(capacity);
          +
          1601 count = vsnprintf(buf_dyn.get(), capacity - 1, format, locale, arg);
          +
          1602 if (count >= 0) {
          +
          1603 str.append(buf_dyn.get(), count);
          +
          1604 return count;
          +
          1605 }
          +
          1606 }
          +
          1607 }
          +
          1608
          +
          1618 template<class _Elem, class _Traits, class _Ax>
          +
          1619 inline size_t appendf(_Inout_ std::basic_string<_Elem, _Traits, _Ax>& str, _In_z_ _Printf_format_string_params_(2) const _Elem* format, _In_opt_ locale_t locale, ...)
          +
          1620 {
          +
          1621 va_list arg;
          +
          1622 va_start(arg, locale);
          +
          1623 size_t n = vappendf(str, format, locale, arg);
          +
          1624 va_end(arg);
          +
          1625 return n;
          +
          1626 }
          +
          1627
          +
          1636 template<class _Elem, class _Traits, class _Ax>
          +
          1637 inline void vsprintf(_Inout_ std::basic_string<_Elem, _Traits, _Ax>& str, _In_z_ _Printf_format_string_params_(2) const _Elem* format, _In_opt_ locale_t locale, _In_ va_list arg)
          +
          1638 {
          +
          1639 str.clear();
          +
          1640 vappendf(str, format, locale, arg);
          1641 }
          1642
          -
          1643 inline size_t strftime(_Out_z_cap_(capacity) wchar_t* str, _In_ size_t capacity, _In_z_ _Printf_format_string_ const wchar_t* format, _In_ const struct tm* time, _In_opt_ locale_t locale)
          -
          1644 {
          -
          1645#ifdef _WIN32
          -
          1646 return _wcsftime_l(str, capacity, format, time, locale);
          -
          1647#else
          -
          1648 return wcsftime_l(str, capacity, format, time, locale);
          -
          1649#endif
          -
          1650 }
          -
          1652
          -
          1661 template<class _Elem, class _Traits, class _Ax>
          -
          1662 inline void strcatftime(_Inout_ std::basic_string<_Elem, _Traits, _Ax>& str, _In_z_ _Printf_format_string_ const _Elem* format, _In_ const struct tm* time, _In_opt_ locale_t locale)
          -
          1663 {
          -
          1664 _Elem buf[1024 / sizeof(_Elem)];
          -
          1665
          -
          1666 // Try with stack buffer first.
          -
          1667 size_t count = strftime(buf, _countof(buf), format, time, locale);
          -
          1668 if (count) {
          -
          1669 // Copy from stack.
          -
          1670 str.append(buf, count);
          -
          1671 }
          -
          1672 else {
          -
          1673 for (size_t capacity = 2 * 1024 / sizeof(_Elem);; capacity *= 2) {
          -
          1674 // Allocate on heap and retry.
          -
          1675 auto buf_dyn = std::make_unique<_Elem[]>(capacity);
          -
          1676 count = strftime(buf_dyn.get(), capacity, format, time, locale);
          -
          1677 if (count) {
          -
          1678 str.append(buf_dyn.get(), count);
          -
          1679 break;
          -
          1680 }
          -
          1681 }
          -
          1682 }
          -
          1683 }
          -
          1684
          -
          1693 template<class _Elem, class _Traits, class _Ax>
          -
          1694 inline void strftime(_Inout_ std::basic_string<_Elem, _Traits, _Ax>& str, _In_z_ _Printf_format_string_ const _Elem* format, _In_ const struct tm* time, _In_opt_ locale_t locale)
          -
          1695 {
          -
          1696 str.clear();
          -
          1697 strcatftime(str, format, time, locale);
          -
          1698 }
          -
          1699
          -
          1710 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
          -
          1711 inline std::basic_string<_Elem, _Traits, _Ax> strftime(_In_z_ _Printf_format_string_ const _Elem* format, _In_ const struct tm* time, _In_opt_ locale_t locale)
          -
          1712 {
          -
          1713 std::basic_string<_Elem, _Traits, _Ax> str;
          -
          1714 strcatftime(str, format, time, locale);
          -
          1715 return str;
          -
          1716 }
          -
          1717
          -
          1723 template<class T>
          -
          1724 inline void strlwr(_Inout_z_ T* str)
          -
          1725 {
          -
          1726 _Assume_(str);
          -
          1727 for (size_t i = 0; str[i]; ++i)
          -
          1728 str[i] = tolower(str[i]);
          -
          1729 }
          -
          1730
          -
          1737 template<class T>
          -
          1738 inline void strlwr(_Inout_z_ T* str, _In_ const std::locale& locale)
          -
          1739 {
          -
          1740 _Assume_(str);
          -
          1741 const auto& ctype = std::use_facet<std::ctype<T>>(locale);
          -
          1742 for (size_t i = 0; str[i]; ++i)
          -
          1743 str[i] = ctype.tolower(str[i]);
          +
          1650 template<class _Elem, class _Traits, class _Ax>
          +
          1651 inline void sprintf(_Inout_ std::basic_string<_Elem, _Traits, _Ax>& str, _In_z_ _Printf_format_string_params_(2) const _Elem* format, _In_opt_ locale_t locale, ...)
          +
          1652 {
          +
          1653 va_list arg;
          +
          1654 va_start(arg, locale);
          +
          1655 vsprintf(str, format, locale, arg);
          +
          1656 va_end(arg);
          +
          1657 }
          +
          1658
          +
          1668 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
          +
          1669 inline std::basic_string<_Elem, _Traits, _Ax> vsprintf(_In_z_ _Printf_format_string_params_(2) const _Elem* format, _In_opt_ locale_t locale, _In_ va_list arg)
          +
          1670 {
          +
          1671 std::basic_string<_Elem, _Traits, _Ax> str;
          +
          1672 vappendf(str, format, locale, arg);
          +
          1673 return str;
          +
          1674 }
          +
          1675
          +
          1684 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
          +
          1685 inline std::basic_string<_Elem, _Traits, _Ax> sprintf(_In_z_ _Printf_format_string_params_(2) const _Elem* format, _In_opt_ locale_t locale, ...)
          +
          1686 {
          +
          1687 va_list arg;
          +
          1688 va_start(arg, locale);
          +
          1689 auto str = vsprintf(format, locale, arg);
          +
          1690 va_end(arg);
          +
          1691 return str;
          +
          1692 }
          +
          1693
          +
          1695 inline size_t strftime(_Out_z_cap_(capacity) char* str, _In_ size_t capacity, _In_z_ _Printf_format_string_ const char* format, _In_ const struct tm* time, _In_opt_ locale_t locale)
          +
          1696 {
          +
          1697#ifdef _WIN32
          +
          1698 return _strftime_l(str, capacity, format, time, locale);
          +
          1699#else
          +
          1700 return strftime_l(str, capacity, format, time, locale);
          +
          1701#endif
          +
          1702 }
          +
          1703
          +
          1704 inline size_t strftime(_Out_z_cap_(capacity) wchar_t* str, _In_ size_t capacity, _In_z_ _Printf_format_string_ const wchar_t* format, _In_ const struct tm* time, _In_opt_ locale_t locale)
          +
          1705 {
          +
          1706#ifdef _WIN32
          +
          1707 return _wcsftime_l(str, capacity, format, time, locale);
          +
          1708#else
          +
          1709 return wcsftime_l(str, capacity, format, time, locale);
          +
          1710#endif
          +
          1711 }
          +
          1713
          +
          1722 template<class _Elem, class _Traits, class _Ax>
          +
          1723 inline void strcatftime(_Inout_ std::basic_string<_Elem, _Traits, _Ax>& str, _In_z_ _Printf_format_string_ const _Elem* format, _In_ const struct tm* time, _In_opt_ locale_t locale)
          +
          1724 {
          +
          1725 _Elem buf[1024 / sizeof(_Elem)];
          +
          1726
          +
          1727 // Try with stack buffer first.
          +
          1728 size_t count = strftime(buf, _countof(buf), format, time, locale);
          +
          1729 if (count) {
          +
          1730 // Copy from stack.
          +
          1731 str.append(buf, count);
          +
          1732 }
          +
          1733 else {
          +
          1734 for (size_t capacity = 2 * 1024 / sizeof(_Elem);; capacity *= 2) {
          +
          1735 // Allocate on heap and retry.
          +
          1736 auto buf_dyn = std::make_unique<_Elem[]>(capacity);
          +
          1737 count = strftime(buf_dyn.get(), capacity, format, time, locale);
          +
          1738 if (count) {
          +
          1739 str.append(buf_dyn.get(), count);
          +
          1740 break;
          +
          1741 }
          +
          1742 }
          +
          1743 }
          1744 }
          1745
          -
          1752 template<class T>
          -
          1753 inline void strlwr(_Inout_updates_z_(count) T* str, _In_ size_t count)
          -
          1754 {
          -
          1755 _Assume_(str || !count);
          -
          1756 for (size_t i = 0; i < count && str[i]; ++i)
          -
          1757 str[i] = tolower(str[i]);
          -
          1758 }
          -
          1759
          -
          1767 template<class T>
          -
          1768 inline void strlwr(_Inout_updates_z_(count) T* str, _In_ size_t count, _In_ const std::locale& locale)
          -
          1769 {
          -
          1770 _Assume_(str || !count);
          -
          1771 const auto& ctype = std::use_facet<std::ctype<T>>(locale);
          -
          1772 for (size_t i = 0; i < count && str[i]; ++i)
          -
          1773 str[i] = ctype.tolower(str[i]);
          -
          1774 }
          -
          1775
          -
          1781 template<class T>
          -
          1782 inline void strupr(_Inout_z_ T* str)
          -
          1783 {
          -
          1784 _Assume_(str);
          -
          1785 for (size_t i = 0; str[i]; ++i)
          -
          1786 str[i] = toupper(str[i]);
          -
          1787 }
          -
          1788
          -
          1795 template<class T>
          -
          1796 inline void strupr(_Inout_z_ T* str, _In_ const std::locale& locale)
          -
          1797 {
          -
          1798 _Assume_(str);
          -
          1799 const auto& ctype = std::use_facet<std::ctype<T>>(locale);
          -
          1800 for (size_t i = 0; str[i]; ++i)
          -
          1801 str[i] = ctype.toupper(str[i]);
          -
          1802 }
          -
          1803
          -
          1810 template<class T>
          -
          1811 inline void strupr(_Inout_updates_z_(count) T* str, _In_ size_t count)
          -
          1812 {
          -
          1813 _Assume_(str || !count);
          -
          1814 for (size_t i = 0; i < count && str[i]; ++i)
          -
          1815 str[i] = toupper(str[i]);
          -
          1816 }
          -
          1817
          -
          1825 template<class T>
          -
          1826 inline void strupr(_Inout_updates_z_(count) T* str, _In_ size_t count, _In_ const std::locale& locale)
          -
          1827 {
          -
          1828 _Assume_(str || !count);
          -
          1829 const auto& ctype = std::use_facet<std::ctype<T>>(locale);
          -
          1830 for (size_t i = 0; i < count && str[i]; ++i)
          -
          1831 str[i] = ctype.toupper(str[i]);
          -
          1832 }
          -
          1833
          -
          1839 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
          -
          1840 inline void strupr(_Inout_ std::basic_string<_Elem, _Traits, _Ax>& str)
          -
          1841 {
          -
          1842 for (size_t i = 0; i < str.size(); ++i)
          -
          1843 str[i] = toupper(str[i]);
          -
          1844 }
          -
          1845
          -
          1852 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
          -
          1853 inline void strupr(_Inout_ std::basic_string<_Elem, _Traits, _Ax>& str, _In_ const std::locale& locale)
          -
          1854 {
          -
          1855 const auto& ctype = std::use_facet<std::ctype<_Elem>>(locale);
          -
          1856 for (size_t i = 0; i < str.size(); ++i)
          -
          1857 str[i] = ctype.toupper(str[i]);
          -
          1858 }
          -
          1859
          +
          1754 template<class _Elem, class _Traits, class _Ax>
          +
          1755 inline void strftime(_Inout_ std::basic_string<_Elem, _Traits, _Ax>& str, _In_z_ _Printf_format_string_ const _Elem* format, _In_ const struct tm* time, _In_opt_ locale_t locale)
          +
          1756 {
          +
          1757 str.clear();
          +
          1758 strcatftime(str, format, time, locale);
          +
          1759 }
          +
          1760
          +
          1771 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
          +
          1772 inline std::basic_string<_Elem, _Traits, _Ax> strftime(_In_z_ _Printf_format_string_ const _Elem* format, _In_ const struct tm* time, _In_opt_ locale_t locale)
          +
          1773 {
          +
          1774 std::basic_string<_Elem, _Traits, _Ax> str;
          +
          1775 strcatftime(str, format, time, locale);
          +
          1776 return str;
          +
          1777 }
          +
          1778
          +
          1784 template<class T>
          +
          1785 inline void strlwr(_Inout_z_ T* str)
          +
          1786 {
          +
          1787 _Assume_(str);
          +
          1788 for (size_t i = 0; str[i]; ++i)
          +
          1789 str[i] = tolower(str[i]);
          +
          1790 }
          +
          1791
          +
          1798 template<class T>
          +
          1799 inline void strlwr(_Inout_z_ T* str, _In_ const std::locale& locale)
          +
          1800 {
          +
          1801 _Assume_(str);
          +
          1802 const auto& ctype = std::use_facet<std::ctype<T>>(locale);
          +
          1803 for (size_t i = 0; str[i]; ++i)
          +
          1804 str[i] = ctype.tolower(str[i]);
          +
          1805 }
          +
          1806
          +
          1813 template<class T>
          +
          1814 inline void strlwr(_Inout_updates_z_(count) T* str, _In_ size_t count)
          +
          1815 {
          +
          1816 _Assume_(str || !count);
          +
          1817 for (size_t i = 0; i < count && str[i]; ++i)
          +
          1818 str[i] = tolower(str[i]);
          +
          1819 }
          +
          1820
          +
          1826 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
          +
          1827 inline void strlwr(_Inout_ std::basic_string<_Elem, _Traits, _Ax>& str)
          +
          1828 {
          +
          1829 for (auto& c : str)
          +
          1830 c = tolower(c);
          +
          1831 }
          +
          1832
          +
          1840 template<class T>
          +
          1841 inline void strlwr(_Inout_updates_z_(count) T* str, _In_ size_t count, _In_ const std::locale& locale)
          +
          1842 {
          +
          1843 _Assume_(str || !count);
          +
          1844 const auto& ctype = std::use_facet<std::ctype<T>>(locale);
          +
          1845 for (size_t i = 0; i < count && str[i]; ++i)
          +
          1846 str[i] = ctype.tolower(str[i]);
          +
          1847 }
          +
          1848
          +
          1855 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
          +
          1856 inline void strlwr(_Inout_ std::basic_string<_Elem, _Traits, _Ax>& str, _In_ const std::locale& locale)
          +
          1857 {
          +
          1858 const auto& ctype = std::use_facet<std::ctype<_Elem>>(locale);
          +
          1859 for (auto& c : str)
          +
          1860 c = ctype.tolower(c);
          +
          1861 }
          +
          1862
          1868 template<class T>
          -
          1869 inline size_t ltrim(
          -
          1870 _Inout_z_count_(count) T* str, _In_ size_t count)
          -
          1871 {
          -
          1872 for (size_t i = 0;; ++i) {
          -
          1873 if (i >= count) {
          -
          1874 if (count) str[0] = 0;
          -
          1875 return 0;
          -
          1876 }
          -
          1877 if (!str[i]) {
          -
          1878 str[0] = 0;
          -
          1879 return 0;
          -
          1880 }
          -
          1881 if (!isspace(str[i])) {
          -
          1882 if (!i)
          -
          1883 return strnlen(str, count);
          -
          1884 size_t n = count != SIZE_MAX ? strncpy(str, str + i, count - i) : strcpy(str, str + i);
          -
          1885 str[n] = 0;
          -
          1886 return n;
          -
          1887 }
          -
          1888 }
          +
          1869 inline void strupr(_Inout_z_ T* str)
          +
          1870 {
          +
          1871 _Assume_(str);
          +
          1872 for (size_t i = 0; str[i]; ++i)
          +
          1873 str[i] = toupper(str[i]);
          +
          1874 }
          +
          1875
          +
          1882 template<class T>
          +
          1883 inline void strupr(_Inout_z_ T* str, _In_ const std::locale& locale)
          +
          1884 {
          +
          1885 _Assume_(str);
          +
          1886 const auto& ctype = std::use_facet<std::ctype<T>>(locale);
          +
          1887 for (size_t i = 0; str[i]; ++i)
          +
          1888 str[i] = ctype.toupper(str[i]);
          1889 }
          1890
          -
          1900 template<class T>
          -
          1901 inline size_t ltrim(
          -
          1902 _Inout_z_count_(count) T* str, _In_ size_t count,
          -
          1903 _In_ const std::locale& locale)
          -
          1904 {
          -
          1905 const auto& ctype = std::use_facet<std::ctype<T>>(locale);
          -
          1906 for (size_t i = 0;; ++i) {
          -
          1907 if (i >= count) {
          -
          1908 if (count) str[0] = 0;
          -
          1909 return 0;
          -
          1910 }
          -
          1911 if (!str[i]) {
          -
          1912 str[0] = 0;
          -
          1913 return 0;
          -
          1914 }
          -
          1915 if (!ctype.is(ctype.space, str[i])) {
          -
          1916 if (!i)
          -
          1917 return strnlen(str, count);
          -
          1918 size_t n = count != SIZE_MAX ? strncpy(str, str + i, count - i) : strcpy(str, str + i);
          -
          1919 str[n] = 0;
          -
          1920 return n;
          -
          1921 }
          -
          1922 }
          -
          1923 }
          -
          1924
          -
          1930 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
          -
          1931 inline void ltrim(_Inout_ std::basic_string<_Elem, _Traits, _Ax>& s)
          -
          1932 {
          -
          1933 s.erase(
          -
          1934 s.begin(),
          -
          1935 std::find_if(
          -
          1936 s.begin(),
          -
          1937 s.end(),
          -
          1938 [&](_In_ _Elem ch) { return !isspace(ch); }));
          -
          1939 }
          -
          1940
          -
          1947 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
          -
          1948 inline void ltrim(_Inout_ std::basic_string<_Elem, _Traits, _Ax>& s, _In_ const std::locale& locale)
          -
          1949 {
          -
          1950 const auto& ctype = std::use_facet<std::ctype<_Elem>>(locale);
          -
          1951 s.erase(
          -
          1952 s.begin(),
          -
          1953 std::find_if(
          -
          1954 s.begin(),
          -
          1955 s.end(),
          -
          1956 [&](_In_ _Elem ch) { return !ctype.is(ctype.space, ch); }));
          -
          1957 }
          -
          1958
          -
          1967 template<class T>
          -
          1968 inline size_t rtrim(
          -
          1969 _Inout_z_count_(count) T* str, _In_ size_t count)
          -
          1970 {
          -
          1971 for (size_t i = 0, j = 0;;) {
          -
          1972 if (i >= count || !str[i]) {
          -
          1973 if (j < count) str[j] = 0;
          -
          1974 return j;
          -
          1975 }
          -
          1976 if (!isspace(str[i]))
          -
          1977 j = ++i;
          -
          1978 else
          -
          1979 ++i;
          -
          1980 }
          -
          1981 }
          -
          1982
          -
          1992 template<class T>
          -
          1993 inline size_t rtrim(
          -
          1994 _Inout_z_count_(count) T* str, _In_ size_t count,
          -
          1995 _In_ const std::locale& locale)
          -
          1996 {
          -
          1997 const auto& ctype = std::use_facet<std::ctype<T>>(locale);
          -
          1998 for (size_t i = 0, j = 0;;) {
          -
          1999 if (i >= count || !str[i]) {
          -
          2000 if (j < count) str[j] = 0;
          -
          2001 return j;
          -
          2002 }
          -
          2003 if (!ctype.is(ctype.space, str[i]))
          -
          2004 j = ++i;
          -
          2005 else
          -
          2006 ++i;
          -
          2007 }
          -
          2008 }
          -
          2009
          -
          2015 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
          -
          2016 static inline void rtrim(_Inout_ std::basic_string<_Elem, _Traits, _Ax>& s)
          -
          2017 {
          -
          2018 s.erase(
          -
          2019 std::find_if(
          -
          2020 s.rbegin(),
          -
          2021 s.rend(),
          -
          2022 [&](_In_ _Elem ch) { return !isspace(ch); }).base(),
          -
          2023 s.end());
          -
          2024 }
          -
          2025
          -
          2032 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
          -
          2033 static inline void rtrim(_Inout_ std::basic_string<_Elem, _Traits, _Ax>& s, _In_ const std::locale& locale)
          -
          2034 {
          -
          2035 const auto& ctype = std::use_facet<std::ctype<_Elem>>(locale);
          -
          2036 s.erase(
          -
          2037 std::find_if(
          -
          2038 s.rbegin(),
          -
          2039 s.rend(),
          -
          2040 [&](_In_ _Elem ch) { return !ctype.is(ctype.space, ch); }).base(),
          -
          2041 s.end());
          -
          2042 }
          -
          2043
          -
          2052 template<class T>
          -
          2053 inline size_t trim(
          -
          2054 _Inout_z_count_(count) T* str, _In_ size_t count)
          -
          2055 {
          -
          2056 return ltrim(str, rtrim(str, count));
          -
          2057 }
          -
          2058
          -
          2068 template<class T>
          -
          2069 inline size_t trim(
          -
          2070 _Inout_z_count_(count) T* str, _In_ size_t count,
          -
          2071 _In_ const std::locale& locale)
          -
          2072 {
          -
          2073 return ltrim(str, rtrim(str, count, locale), locale);
          -
          2074 }
          -
          2075
          -
          2081 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
          -
          2082 static inline void trim(_Inout_ std::basic_string<_Elem, _Traits, _Ax>& s)
          +
          1897 template<class T>
          +
          1898 inline void strupr(_Inout_updates_z_(count) T* str, _In_ size_t count)
          +
          1899 {
          +
          1900 _Assume_(str || !count);
          +
          1901 for (size_t i = 0; i < count && str[i]; ++i)
          +
          1902 str[i] = toupper(str[i]);
          +
          1903 }
          +
          1904
          +
          1912 template<class T>
          +
          1913 inline void strupr(_Inout_updates_z_(count) T* str, _In_ size_t count, _In_ const std::locale& locale)
          +
          1914 {
          +
          1915 _Assume_(str || !count);
          +
          1916 const auto& ctype = std::use_facet<std::ctype<T>>(locale);
          +
          1917 for (size_t i = 0; i < count && str[i]; ++i)
          +
          1918 str[i] = ctype.toupper(str[i]);
          +
          1919 }
          +
          1920
          +
          1926 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
          +
          1927 inline void strupr(_Inout_ std::basic_string<_Elem, _Traits, _Ax>& str)
          +
          1928 {
          +
          1929 for (auto& c : str)
          +
          1930 c = toupper(c);
          +
          1931 }
          +
          1932
          +
          1939 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
          +
          1940 inline void strupr(_Inout_ std::basic_string<_Elem, _Traits, _Ax>& str, _In_ const std::locale& locale)
          +
          1941 {
          +
          1942 const auto& ctype = std::use_facet<std::ctype<_Elem>>(locale);
          +
          1943 for (auto& c : str)
          +
          1944 c = ctype.toupper(c);
          +
          1945 }
          +
          1946
          +
          1955 template<class T>
          +
          1956 inline size_t ltrim(
          +
          1957 _Inout_z_count_(count) T* str, _In_ size_t count)
          +
          1958 {
          +
          1959 for (size_t i = 0;; ++i) {
          +
          1960 if (i >= count) {
          +
          1961 if (count) str[0] = 0;
          +
          1962 return 0;
          +
          1963 }
          +
          1964 if (!str[i]) {
          +
          1965 str[0] = 0;
          +
          1966 return 0;
          +
          1967 }
          +
          1968 if (!isspace(str[i])) {
          +
          1969 if (!i)
          +
          1970 return strnlen(str, count);
          +
          1971 size_t n = count != SIZE_MAX ? strncpy(str, str + i, count - i) : strcpy(str, str + i);
          +
          1972 str[n] = 0;
          +
          1973 return n;
          +
          1974 }
          +
          1975 }
          +
          1976 }
          +
          1977
          +
          1987 template<class T>
          +
          1988 inline size_t ltrim(
          +
          1989 _Inout_z_count_(count) T* str, _In_ size_t count,
          +
          1990 _In_ const std::locale& locale)
          +
          1991 {
          +
          1992 const auto& ctype = std::use_facet<std::ctype<T>>(locale);
          +
          1993 for (size_t i = 0;; ++i) {
          +
          1994 if (i >= count) {
          +
          1995 if (count) str[0] = 0;
          +
          1996 return 0;
          +
          1997 }
          +
          1998 if (!str[i]) {
          +
          1999 str[0] = 0;
          +
          2000 return 0;
          +
          2001 }
          +
          2002 if (!ctype.is(ctype.space, str[i])) {
          +
          2003 if (!i)
          +
          2004 return strnlen(str, count);
          +
          2005 size_t n = count != SIZE_MAX ? strncpy(str, str + i, count - i) : strcpy(str, str + i);
          +
          2006 str[n] = 0;
          +
          2007 return n;
          +
          2008 }
          +
          2009 }
          +
          2010 }
          +
          2011
          +
          2017 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
          +
          2018 inline void ltrim(_Inout_ std::basic_string<_Elem, _Traits, _Ax>& s)
          +
          2019 {
          +
          2020 s.erase(
          +
          2021 s.begin(),
          +
          2022 std::find_if(
          +
          2023 s.begin(),
          +
          2024 s.end(),
          +
          2025 [&](_In_ _Elem ch) { return !isspace(ch); }));
          +
          2026 }
          +
          2027
          +
          2034 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
          +
          2035 inline void ltrim(_Inout_ std::basic_string<_Elem, _Traits, _Ax>& s, _In_ const std::locale& locale)
          +
          2036 {
          +
          2037 const auto& ctype = std::use_facet<std::ctype<_Elem>>(locale);
          +
          2038 s.erase(
          +
          2039 s.begin(),
          +
          2040 std::find_if(
          +
          2041 s.begin(),
          +
          2042 s.end(),
          +
          2043 [&](_In_ _Elem ch) { return !ctype.is(ctype.space, ch); }));
          +
          2044 }
          +
          2045
          +
          2054 template<class T>
          +
          2055 inline size_t rtrim(
          +
          2056 _Inout_z_count_(count) T* str, _In_ size_t count)
          +
          2057 {
          +
          2058 for (size_t i = 0, j = 0;;) {
          +
          2059 if (i >= count || !str[i]) {
          +
          2060 if (j < count) str[j] = 0;
          +
          2061 return j;
          +
          2062 }
          +
          2063 if (!isspace(str[i]))
          +
          2064 j = ++i;
          +
          2065 else
          +
          2066 ++i;
          +
          2067 }
          +
          2068 }
          +
          2069
          +
          2079 template<class T>
          +
          2080 inline size_t rtrim(
          +
          2081 _Inout_z_count_(count) T* str, _In_ size_t count,
          +
          2082 _In_ const std::locale& locale)
          2083 {
          -
          2084 auto nonspace = [&](_In_ _Elem ch) { return !isspace(ch); };
          -
          2085 s.erase(
          -
          2086 s.begin(),
          -
          2087 std::find_if(
          -
          2088 s.begin(),
          -
          2089 s.end(),
          -
          2090 nonspace));
          -
          2091 s.erase(
          -
          2092 std::find_if(
          -
          2093 s.rbegin(),
          -
          2094 s.rend(),
          -
          2095 nonspace).base(),
          -
          2096 s.end());
          -
          2097 }
          -
          2098
          -
          2105 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
          -
          2106 static inline void trim(_Inout_ std::basic_string<_Elem, _Traits, _Ax>& s, _In_ const std::locale& locale)
          -
          2107 {
          -
          2108 const auto& ctype = std::use_facet<std::ctype<_Elem>>(locale);
          -
          2109 auto nonspace = [&](_In_ _Elem ch) { return !ctype.is(ctype.space, ch); };
          -
          2110 s.erase(
          -
          2111 s.begin(),
          -
          2112 std::find_if(
          -
          2113 s.begin(),
          -
          2114 s.end(),
          -
          2115 nonspace));
          -
          2116 s.erase(
          -
          2117 std::find_if(
          -
          2118 s.rbegin(),
          -
          2119 s.rend(),
          -
          2120 nonspace).base(),
          -
          2121 s.end());
          -
          2122 }
          -
          2123}
          +
          2084 const auto& ctype = std::use_facet<std::ctype<T>>(locale);
          +
          2085 for (size_t i = 0, j = 0;;) {
          +
          2086 if (i >= count || !str[i]) {
          +
          2087 if (j < count) str[j] = 0;
          +
          2088 return j;
          +
          2089 }
          +
          2090 if (!ctype.is(ctype.space, str[i]))
          +
          2091 j = ++i;
          +
          2092 else
          +
          2093 ++i;
          +
          2094 }
          +
          2095 }
          +
          2096
          +
          2102 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
          +
          2103 static inline void rtrim(_Inout_ std::basic_string<_Elem, _Traits, _Ax>& s)
          +
          2104 {
          +
          2105 s.erase(
          +
          2106 std::find_if(
          +
          2107 s.rbegin(),
          +
          2108 s.rend(),
          +
          2109 [&](_In_ _Elem ch) { return !isspace(ch); }).base(),
          +
          2110 s.end());
          +
          2111 }
          +
          2112
          +
          2119 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
          +
          2120 static inline void rtrim(_Inout_ std::basic_string<_Elem, _Traits, _Ax>& s, _In_ const std::locale& locale)
          +
          2121 {
          +
          2122 const auto& ctype = std::use_facet<std::ctype<_Elem>>(locale);
          +
          2123 s.erase(
          +
          2124 std::find_if(
          +
          2125 s.rbegin(),
          +
          2126 s.rend(),
          +
          2127 [&](_In_ _Elem ch) { return !ctype.is(ctype.space, ch); }).base(),
          +
          2128 s.end());
          +
          2129 }
          +
          2130
          +
          2139 template<class T>
          +
          2140 inline size_t trim(
          +
          2141 _Inout_z_count_(count) T* str, _In_ size_t count)
          +
          2142 {
          +
          2143 return ltrim(str, rtrim(str, count));
          +
          2144 }
          +
          2145
          +
          2155 template<class T>
          +
          2156 inline size_t trim(
          +
          2157 _Inout_z_count_(count) T* str, _In_ size_t count,
          +
          2158 _In_ const std::locale& locale)
          +
          2159 {
          +
          2160 return ltrim(str, rtrim(str, count, locale), locale);
          +
          2161 }
          +
          2162
          +
          2168 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
          +
          2169 static inline void trim(_Inout_ std::basic_string<_Elem, _Traits, _Ax>& s)
          +
          2170 {
          +
          2171 auto nonspace = [&](_In_ _Elem ch) { return !isspace(ch); };
          +
          2172 s.erase(
          +
          2173 s.begin(),
          +
          2174 std::find_if(
          +
          2175 s.begin(),
          +
          2176 s.end(),
          +
          2177 nonspace));
          +
          2178 s.erase(
          +
          2179 std::find_if(
          +
          2180 s.rbegin(),
          +
          2181 s.rend(),
          +
          2182 nonspace).base(),
          +
          2183 s.end());
          +
          2184 }
          +
          2185
          +
          2192 template<class _Elem, class _Traits = std::char_traits<_Elem>, class _Ax = std::allocator<_Elem>>
          +
          2193 static inline void trim(_Inout_ std::basic_string<_Elem, _Traits, _Ax>& s, _In_ const std::locale& locale)
          +
          2194 {
          +
          2195 const auto& ctype = std::use_facet<std::ctype<_Elem>>(locale);
          +
          2196 auto nonspace = [&](_In_ _Elem ch) { return !ctype.is(ctype.space, ch); };
          +
          2197 s.erase(
          +
          2198 s.begin(),
          +
          2199 std::find_if(
          +
          2200 s.begin(),
          +
          2201 s.end(),
          +
          2202 nonspace));
          +
          2203 s.erase(
          +
          2204 std::find_if(
          +
          2205 s.rbegin(),
          +
          2206 s.rend(),
          +
          2207 nonspace).base(),
          +
          2208 s.end());
          +
          2209 }
          +
          2210}
          diff --git a/structstdex_1_1chrono_1_1aosn__date-members.html b/structstdex_1_1chrono_1_1aosn__date-members.html index 2571e8e3e..5b607f226 100644 --- a/structstdex_1_1chrono_1_1aosn__date-members.html +++ b/structstdex_1_1chrono_1_1aosn__date-members.html @@ -96,7 +96,7 @@ $(function() {
          diff --git a/structstdex_1_1chrono_1_1aosn__date.html b/structstdex_1_1chrono_1_1aosn__date.html index 275c293d5..2087c106c 100644 --- a/structstdex_1_1chrono_1_1aosn__date.html +++ b/structstdex_1_1chrono_1_1aosn__date.html @@ -152,7 +152,7 @@ static constexpr bool is_s
          diff --git a/structstdex_1_1chrono_1_1aosn__timestamp-members.html b/structstdex_1_1chrono_1_1aosn__timestamp-members.html index a08d1603a..6a5dc0c8e 100644 --- a/structstdex_1_1chrono_1_1aosn__timestamp-members.html +++ b/structstdex_1_1chrono_1_1aosn__timestamp-members.html @@ -110,7 +110,7 @@ $(function() {
          diff --git a/structstdex_1_1chrono_1_1aosn__timestamp.html b/structstdex_1_1chrono_1_1aosn__timestamp.html index c19dcbb0d..23fcb59ec 100644 --- a/structstdex_1_1chrono_1_1aosn__timestamp.html +++ b/structstdex_1_1chrono_1_1aosn__timestamp.html @@ -197,7 +197,7 @@ static constexpr rep one_w
          diff --git a/structstdex_1_1free__locale__delete-members.html b/structstdex_1_1free__locale__delete-members.html index 04b851ef2..55d6d0637 100644 --- a/structstdex_1_1free__locale__delete-members.html +++ b/structstdex_1_1free__locale__delete-members.html @@ -84,7 +84,7 @@ $(function() {
          diff --git a/structstdex_1_1free__locale__delete.html b/structstdex_1_1free__locale__delete.html index 4e167fb8c..7baf88d22 100644 --- a/structstdex_1_1free__locale__delete.html +++ b/structstdex_1_1free__locale__delete.html @@ -101,7 +101,7 @@ void operator() (local
          diff --git a/structstdex_1_1html_1_1element__traits-members.html b/structstdex_1_1html_1_1element__traits-members.html index 2b656b32b..8e3b0b95e 100644 --- a/structstdex_1_1html_1_1element__traits-members.html +++ b/structstdex_1_1html_1_1element__traits-members.html @@ -102,7 +102,7 @@ $(function() {
          diff --git a/structstdex_1_1html_1_1element__traits.html b/structstdex_1_1html_1_1element__traits.html index baa314cde..f37554a76 100644 --- a/structstdex_1_1html_1_1element__traits.html +++ b/structstdex_1_1html_1_1element__traits.html @@ -858,7 +858,7 @@ template<class T >
          diff --git a/structstdex_1_1html_1_1entity-members.html b/structstdex_1_1html_1_1entity-members.html index 9b8c18c5c..ae5ceebbd 100644 --- a/structstdex_1_1html_1_1entity-members.html +++ b/structstdex_1_1html_1_1entity-members.html @@ -85,7 +85,7 @@ $(function() {
          diff --git a/structstdex_1_1html_1_1entity.html b/structstdex_1_1html_1_1entity.html index 4898862ef..2a5fc2536 100644 --- a/structstdex_1_1html_1_1entity.html +++ b/structstdex_1_1html_1_1entity.html @@ -106,7 +106,7 @@ struct stdex::html::entity< _Elem, _Traits, _Alloc >

          HTML entity.

          diff --git a/structstdex_1_1html_1_1inserted__token-members.html b/structstdex_1_1html_1_1inserted__token-members.html index 2506b3981..a8f5f53eb 100644 --- a/structstdex_1_1html_1_1inserted__token-members.html +++ b/structstdex_1_1html_1_1inserted__token-members.html @@ -87,7 +87,7 @@ $(function() {
          diff --git a/structstdex_1_1html_1_1inserted__token.html b/structstdex_1_1html_1_1inserted__token.html index a8e542ae0..c775dc630 100644 --- a/structstdex_1_1html_1_1inserted__token.html +++ b/structstdex_1_1html_1_1inserted__token.html @@ -113,7 +113,7 @@ bool after_word diff --git a/structstdex_1_1interval-members.html b/structstdex_1_1interval-members.html index b607eb9d4..8a05cd041 100644 --- a/structstdex_1_1interval-members.html +++ b/structstdex_1_1interval-members.html @@ -103,7 +103,7 @@ $(function() {
          diff --git a/structstdex_1_1interval.html b/structstdex_1_1interval.html index 2431ba93c..3e6491c12 100644 --- a/structstdex_1_1interval.html +++ b/structstdex_1_1interval.html @@ -722,7 +722,7 @@ template<class T >
          diff --git a/structstdex_1_1mapping-members.html b/structstdex_1_1mapping-members.html index ffde0f7a9..896e2b7ea 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 b50926e83..e642ca17c 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 f10e338b3..30f03f635 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 83bae4653..5e13ec83e 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 88e1b81c0..92c0c2417 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 9550d60d9..f9c7f12c9 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_1html__attribute-members.html b/structstdex_1_1parser_1_1html__attribute-members.html index 22f558e8a..dd94ddf51 100644 --- a/structstdex_1_1parser_1_1html__attribute-members.html +++ b/structstdex_1_1parser_1_1html__attribute-members.html @@ -85,7 +85,7 @@ $(function() {
          diff --git a/structstdex_1_1parser_1_1html__attribute.html b/structstdex_1_1parser_1_1html__attribute.html index 6df88d480..4f1cb8302 100644 --- a/structstdex_1_1parser_1_1html__attribute.html +++ b/structstdex_1_1parser_1_1html__attribute.html @@ -105,7 +105,7 @@ Public Attributes
          diff --git a/structstdex_1_1parser_1_1http__factor__more-members.html b/structstdex_1_1parser_1_1http__factor__more-members.html index 6e0ea70b9..c222ab426 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 31aeb35e4..7aa22caa0 100644 --- a/structstdex_1_1parser_1_1http__factor__more.html +++ b/structstdex_1_1parser_1_1http__factor__more.html @@ -93,7 +93,7 @@ Public Member Functions
          diff --git a/structstdex_1_1stream_1_1buffer_1_1buffer__t-members.html b/structstdex_1_1stream_1_1buffer_1_1buffer__t-members.html index 01e1e757a..8b40a0b19 100644 --- a/structstdex_1_1stream_1_1buffer_1_1buffer__t-members.html +++ b/structstdex_1_1stream_1_1buffer_1_1buffer__t-members.html @@ -89,7 +89,7 @@ $(function() {
          diff --git a/structstdex_1_1stream_1_1buffer_1_1buffer__t.html b/structstdex_1_1stream_1_1buffer_1_1buffer__t.html index ed242d472..55ca4b6da 100644 --- a/structstdex_1_1stream_1_1buffer_1_1buffer__t.html +++ b/structstdex_1_1stream_1_1buffer_1_1buffer__t.html @@ -109,7 +109,7 @@ size_t capacity diff --git a/structstdex_1_1stream_1_1fifo_1_1node__t-members.html b/structstdex_1_1stream_1_1fifo_1_1node__t-members.html index 65f5ea6de..1cad52caa 100644 --- a/structstdex_1_1stream_1_1fifo_1_1node__t-members.html +++ b/structstdex_1_1stream_1_1fifo_1_1node__t-members.html @@ -86,7 +86,7 @@ $(function() {
          diff --git a/structstdex_1_1stream_1_1fifo_1_1node__t.html b/structstdex_1_1stream_1_1fifo_1_1node__t.html index 0798f64e3..673c3fc3f 100644 --- a/structstdex_1_1stream_1_1fifo_1_1node__t.html +++ b/structstdex_1_1stream_1_1fifo_1_1node__t.html @@ -99,7 +99,7 @@ uint8_t data [0]<
          diff --git a/structstdex_1_1sys__info__t-members.html b/structstdex_1_1sys__info__t-members.html index 03e3b1e3a..468d09081 100644 --- a/structstdex_1_1sys__info__t-members.html +++ b/structstdex_1_1sys__info__t-members.html @@ -89,7 +89,7 @@ $(function() {
          diff --git a/structstdex_1_1sys__info__t.html b/structstdex_1_1sys__info__t.html index e23fcaddd..2961b7d54 100644 --- a/structstdex_1_1sys__info__t.html +++ b/structstdex_1_1sys__info__t.html @@ -137,7 +137,7 @@ struct utsname m_utsn<
          diff --git a/structstdex_1_1wav_1_1cue-members.html b/structstdex_1_1wav_1_1cue-members.html index 801e397e9..1ed41ed59 100644 --- a/structstdex_1_1wav_1_1cue-members.html +++ b/structstdex_1_1wav_1_1cue-members.html @@ -89,7 +89,7 @@ $(function() {
          diff --git a/structstdex_1_1wav_1_1cue.html b/structstdex_1_1wav_1_1cue.html index 2dac94fc7..c3734e341 100644 --- a/structstdex_1_1wav_1_1cue.html +++ b/structstdex_1_1wav_1_1cue.html @@ -130,7 +130,7 @@ uint32_t block_offset
          diff --git a/structstdex_1_1wav_1_1cue__ex-members.html b/structstdex_1_1wav_1_1cue__ex-members.html index cc407c9a5..e673bf2a5 100644 --- a/structstdex_1_1wav_1_1cue__ex-members.html +++ b/structstdex_1_1wav_1_1cue__ex-members.html @@ -98,7 +98,7 @@ $(function() {
          diff --git a/structstdex_1_1wav_1_1cue__ex.html b/structstdex_1_1wav_1_1cue__ex.html index 9c1f9daba..336797782 100644 --- a/structstdex_1_1wav_1_1cue__ex.html +++ b/structstdex_1_1wav_1_1cue__ex.html @@ -167,7 +167,7 @@ uint32_t block_offset
          diff --git a/structstdex_1_1wav_1_1data-members.html b/structstdex_1_1wav_1_1data-members.html index 60facbad2..7605588ff 100644 --- a/structstdex_1_1wav_1_1data-members.html +++ b/structstdex_1_1wav_1_1data-members.html @@ -87,7 +87,7 @@ $(function() {
          diff --git a/structstdex_1_1wav_1_1data.html b/structstdex_1_1wav_1_1data.html index bee06ecd6..ae3a38dcb 100644 --- a/structstdex_1_1wav_1_1data.html +++ b/structstdex_1_1wav_1_1data.html @@ -118,7 +118,7 @@ Friends
          diff --git a/structstdex_1_1wav_1_1format-members.html b/structstdex_1_1wav_1_1format-members.html index 8473b40b5..6e9d6d134 100644 --- a/structstdex_1_1wav_1_1format-members.html +++ b/structstdex_1_1wav_1_1format-members.html @@ -94,7 +94,7 @@ $(function() {
          diff --git a/structstdex_1_1wav_1_1format.html b/structstdex_1_1wav_1_1format.html index 125b4f9d8..df398c5f6 100644 --- a/structstdex_1_1wav_1_1format.html +++ b/structstdex_1_1wav_1_1format.html @@ -209,7 +209,7 @@ Friends
          diff --git a/structstdex_1_1wav_1_1header-members.html b/structstdex_1_1wav_1_1header-members.html index 39300f99f..d41e20f76 100644 --- a/structstdex_1_1wav_1_1header-members.html +++ b/structstdex_1_1wav_1_1header-members.html @@ -87,7 +87,7 @@ $(function() {
          diff --git a/structstdex_1_1wav_1_1header.html b/structstdex_1_1wav_1_1header.html index 848adf3a3..12683690c 100644 --- a/structstdex_1_1wav_1_1header.html +++ b/structstdex_1_1wav_1_1header.html @@ -128,7 +128,7 @@ Friends
          diff --git a/structstdex_1_1wav_1_1label-members.html b/structstdex_1_1wav_1_1label-members.html index 346b9fdc0..a6be7de45 100644 --- a/structstdex_1_1wav_1_1label-members.html +++ b/structstdex_1_1wav_1_1label-members.html @@ -88,7 +88,7 @@ $(function() {
          diff --git a/structstdex_1_1wav_1_1label.html b/structstdex_1_1wav_1_1label.html index b5f4f0025..41ae608cb 100644 --- a/structstdex_1_1wav_1_1label.html +++ b/structstdex_1_1wav_1_1label.html @@ -122,7 +122,7 @@ Friends
          diff --git a/structstdex_1_1wav_1_1list-members.html b/structstdex_1_1wav_1_1list-members.html index a00302d67..935fffa7e 100644 --- a/structstdex_1_1wav_1_1list-members.html +++ b/structstdex_1_1wav_1_1list-members.html @@ -85,7 +85,7 @@ $(function() {
          diff --git a/structstdex_1_1wav_1_1list.html b/structstdex_1_1wav_1_1list.html index d1f7067ec..093c5f035 100644 --- a/structstdex_1_1wav_1_1list.html +++ b/structstdex_1_1wav_1_1list.html @@ -121,7 +121,7 @@ id_t type = 0 diff --git a/structstdex_1_1wav_1_1ltxt-members.html b/structstdex_1_1wav_1_1ltxt-members.html index ebf947df0..4954d8304 100644 --- a/structstdex_1_1wav_1_1ltxt-members.html +++ b/structstdex_1_1wav_1_1ltxt-members.html @@ -94,7 +94,7 @@ $(function() {
          diff --git a/structstdex_1_1wav_1_1ltxt.html b/structstdex_1_1wav_1_1ltxt.html index 51f65ac71..dd6c72145 100644 --- a/structstdex_1_1wav_1_1ltxt.html +++ b/structstdex_1_1wav_1_1ltxt.html @@ -146,7 +146,7 @@ Friends
          diff --git a/structstdex_1_1wav_1_1note-members.html b/structstdex_1_1wav_1_1note-members.html index 007b31a0c..e6303c2fc 100644 --- a/structstdex_1_1wav_1_1note-members.html +++ b/structstdex_1_1wav_1_1note-members.html @@ -88,7 +88,7 @@ $(function() {
          diff --git a/structstdex_1_1wav_1_1note.html b/structstdex_1_1wav_1_1note.html index 177f0e1c2..29a96b5d3 100644 --- a/structstdex_1_1wav_1_1note.html +++ b/structstdex_1_1wav_1_1note.html @@ -122,7 +122,7 @@ Friends
          diff --git a/structstdex_1_1wav_1_1silence-members.html b/structstdex_1_1wav_1_1silence-members.html index 633b9cef7..4df17d570 100644 --- a/structstdex_1_1wav_1_1silence-members.html +++ b/structstdex_1_1wav_1_1silence-members.html @@ -87,7 +87,7 @@ $(function() {
          diff --git a/structstdex_1_1wav_1_1silence.html b/structstdex_1_1wav_1_1silence.html index 61862fd8d..0c7949d66 100644 --- a/structstdex_1_1wav_1_1silence.html +++ b/structstdex_1_1wav_1_1silence.html @@ -118,7 +118,7 @@ Friends
          diff --git a/structstdex_1_1wav_1_1wave-members.html b/structstdex_1_1wav_1_1wave-members.html index 45622dc93..e4acc9411 100644 --- a/structstdex_1_1wav_1_1wave-members.html +++ b/structstdex_1_1wav_1_1wave-members.html @@ -85,7 +85,7 @@ $(function() {
          diff --git a/structstdex_1_1wav_1_1wave.html b/structstdex_1_1wav_1_1wave.html index d357e1219..ea6c2d561 100644 --- a/structstdex_1_1wav_1_1wave.html +++ b/structstdex_1_1wav_1_1wave.html @@ -121,7 +121,7 @@ id_t type = 0 diff --git a/sys__info_8hpp_source.html b/sys__info_8hpp_source.html index a528cb9f6..df482dd4a 100644 --- a/sys__info_8hpp_source.html +++ b/sys__info_8hpp_source.html @@ -285,7 +285,7 @@ $(document).ready(function() { init_codefold(0); });
          diff --git a/system_8hpp_source.html b/system_8hpp_source.html index c8d271dd5..823782d54 100644 --- a/system_8hpp_source.html +++ b/system_8hpp_source.html @@ -289,7 +289,7 @@ $(document).ready(function() { init_codefold(0); });
          diff --git a/unicode_8cpp_source.html b/unicode_8cpp_source.html index 01fc08d39..4bb8a1920 100644 --- a/unicode_8cpp_source.html +++ b/unicode_8cpp_source.html @@ -181,7 +181,7 @@ $(document).ready(function() { init_codefold(0); });
          diff --git a/unicode_8hpp_source.html b/unicode_8hpp_source.html index d580d2055..5c127f6f8 100644 --- a/unicode_8hpp_source.html +++ b/unicode_8hpp_source.html @@ -697,11 +697,94 @@ $(document).ready(function() { init_codefold(0); });
          798 {
          799 return wstr2str(src.c_str(), src.size(), charset);
          800 }
          -
          801}
          -
          802
          -
          803#ifndef _WIN32
          -
          804#pragma GCC diagnostic pop
          -
          805#endif
          +
          801
          +
          802#ifdef _WIN32
          +
          812 template <class _Traits = std::char_traits<wchar_t>, class _Alloc = std::allocator<wchar_t>>
          +
          813 inline size_t normalizecat(
          +
          814 _Inout_ std::basic_string<wchar_t, _Traits, _Alloc>& dst,
          +
          815 _In_reads_or_z_opt_(count_src) const wchar_t* src, _In_ size_t count_src)
          +
          816 {
          +
          817 count_src = stdex::strnlen(src, count_src);
          +
          818 size_t count_dst = dst.size();
          +
          819 dst.resize(count_dst + count_src);
          +
          820 _Assume_(count_src + 1 < INT_MAX);
          +
          821 int r = NormalizeString(NormalizationC, src, static_cast<int>(count_src), dst.data() + count_dst, static_cast<int>(count_src + 1));
          +
          822 if (r >= 0)
          +
          823 dst.resize(count_dst + r);
          +
          824 else
          +
          825 memcpy(dst.data() + count_dst, src, count_src * sizeof(wchar_t));
          +
          826 return dst.size();
          +
          827 }
          +
          828
          +
          837 template <size_t _Size, class _Traits = std::char_traits<wchar_t>, class _Alloc = std::allocator<wchar_t>>
          +
          838 inline size_t normalizecat(
          +
          839 _Inout_ std::basic_string<wchar_t, _Traits, _Alloc>& dst,
          +
          840 _In_ const wchar_t (&src)[_Size])
          +
          841 {
          +
          842 return normalizecat(dst, src, _Size);
          +
          843 }
          +
          844
          +
          853 template <class _Traits_dst = std::char_traits<wchar_t>, class _Alloc_dst = std::allocator<wchar_t>, class _Traits_src = std::char_traits<wchar_t>, class _Alloc_src = std::allocator<wchar_t>>
          +
          854 inline size_t normalizecat(
          +
          855 _Inout_ std::basic_string<wchar_t, _Traits_dst, _Alloc_dst>& dst,
          +
          856 _In_ const std::basic_string<wchar_t, _Traits_src, _Alloc_src>& src)
          +
          857 {
          +
          858 return normalizecat(dst, src.data(), src.size());
          +
          859 }
          +
          860
          +
          870 template <class _Traits = std::char_traits<wchar_t>, class _Alloc = std::allocator<wchar_t>>
          +
          871 inline size_t normalize(
          +
          872 _Inout_ std::basic_string<wchar_t, _Traits, _Alloc>& dst,
          +
          873 _In_reads_or_z_opt_(count_src) const wchar_t* src, _In_ size_t count_src)
          +
          874 {
          +
          875 dst.clear();
          +
          876 return normalizecat(dst, src, count_src);
          +
          877 }
          +
          878
          +
          887 template <size_t _Size, class _Traits = std::char_traits<wchar_t>, class _Alloc = std::allocator<wchar_t>>
          +
          888 inline size_t normalize(
          +
          889 _Inout_ std::basic_string<wchar_t, _Traits, _Alloc>& dst,
          +
          890 _In_ const wchar_t(&src)[_Size])
          +
          891 {
          +
          892 return normalize(dst, src, _Size);
          +
          893 }
          +
          894
          +
          903 template <class _Traits_dst = std::char_traits<wchar_t>, class _Alloc_dst = std::allocator<wchar_t>, class _Traits_src = std::char_traits<wchar_t>, class _Alloc_src = std::allocator<wchar_t>>
          +
          904 inline size_t normalize(
          +
          905 _Inout_ std::basic_string<wchar_t, _Traits_dst, _Alloc_dst>& dst,
          +
          906 _In_ const std::basic_string<wchar_t, _Traits_src, _Alloc_src>& src)
          +
          907 {
          +
          908 return normalize(dst, src.data(), src.size());
          +
          909 }
          +
          910
          +
          919 inline std::wstring normalize(_In_reads_or_z_opt_(count_src) const wchar_t* src, _In_ size_t count_src)
          +
          920 {
          +
          921 std::wstring dst;
          +
          922 normalizecat(dst, src, count_src);
          +
          923 return dst;
          +
          924 }
          +
          925
          +
          933 template <size_t _Size>
          +
          934 inline std::wstring normalize(_In_ const wchar_t(&src)[_Size])
          +
          935 {
          +
          936 std::wstring dst;
          +
          937 normalizecat(dst, src, _Size);
          +
          938 return dst;
          +
          939 }
          +
          940
          +
          948 template <class _Traits = std::char_traits<wchar_t>, class _Alloc = std::allocator<wchar_t>>
          +
          949 inline std::wstring normalize(_In_ const std::basic_string<wchar_t, _Traits, _Alloc>& src)
          +
          950 {
          +
          951 std::wstring dst;
          +
          952 normalizecat(dst, src.data(), src.size());
          +
          953 return dst;
          +
          954 }
          +
          955#endif
          +
          956}
          +
          957
          +
          958#ifndef _WIN32
          +
          959#pragma GCC diagnostic pop
          +
          960#endif
          Encoding converter context.
          Definition unicode.hpp:133
          void strcpy(std::basic_string< T_to, _Traits_to, _Alloc_to > &dst, const std::basic_string< T_from, _Traits_from, _Alloc_from > &src)
          Convert string.
          Definition unicode.hpp:370
          std::basic_string< T_to, _Traits_to, _Alloc_to > convert(const std::basic_string< T_from, _Traits_from, _Alloc_from > &src)
          Return converted string.
          Definition unicode.hpp:408
          @@ -715,7 +798,7 @@ $(document).ready(function() { init_codefold(0); });
          diff --git a/unionstdex_1_1md2__t-members.html b/unionstdex_1_1md2__t-members.html index dfc3a6ede..dc324b274 100644 --- a/unionstdex_1_1md2__t-members.html +++ b/unionstdex_1_1md2__t-members.html @@ -89,7 +89,7 @@ $(function() {
          diff --git a/unionstdex_1_1md2__t.html b/unionstdex_1_1md2__t.html index d65db66ba..fccbfabec 100644 --- a/unionstdex_1_1md2__t.html +++ b/unionstdex_1_1md2__t.html @@ -123,7 +123,7 @@ Friends
          diff --git a/unionstdex_1_1sha256__t-members.html b/unionstdex_1_1sha256__t-members.html index d98e9cfb1..1288e6d90 100644 --- a/unionstdex_1_1sha256__t-members.html +++ b/unionstdex_1_1sha256__t-members.html @@ -89,7 +89,7 @@ $(function() {
          diff --git a/unionstdex_1_1sha256__t.html b/unionstdex_1_1sha256__t.html index db06dccd7..7e071a1aa 100644 --- a/unionstdex_1_1sha256__t.html +++ b/unionstdex_1_1sha256__t.html @@ -123,7 +123,7 @@ Friends
          diff --git a/unionstdex_1_1sha__t-members.html b/unionstdex_1_1sha__t-members.html index ccdf80639..b95b0c988 100644 --- a/unionstdex_1_1sha__t-members.html +++ b/unionstdex_1_1sha__t-members.html @@ -89,7 +89,7 @@ $(function() {
          diff --git a/unionstdex_1_1sha__t.html b/unionstdex_1_1sha__t.html index e964ba015..afb5b3437 100644 --- a/unionstdex_1_1sha__t.html +++ b/unionstdex_1_1sha__t.html @@ -123,7 +123,7 @@ Friends
          diff --git a/uuid_8hpp_source.html b/uuid_8hpp_source.html index d0b0abe62..c37ec7d1b 100644 --- a/uuid_8hpp_source.html +++ b/uuid_8hpp_source.html @@ -145,7 +145,7 @@ $(document).ready(function() { init_codefold(0); });
          diff --git a/vector__queue_8hpp_source.html b/vector__queue_8hpp_source.html index b5ccfb210..b4cad9ae5 100644 --- a/vector__queue_8hpp_source.html +++ b/vector__queue_8hpp_source.html @@ -453,7 +453,7 @@ $(document).ready(function() { init_codefold(0); });
          diff --git a/watchdog_8cpp_source.html b/watchdog_8cpp_source.html index 1f9b5dd79..29805d1c3 100644 --- a/watchdog_8cpp_source.html +++ b/watchdog_8cpp_source.html @@ -118,7 +118,7 @@ $(document).ready(function() { init_codefold(0); });
          diff --git a/watchdog_8hpp_source.html b/watchdog_8hpp_source.html index 41189ffc8..8c812666a 100644 --- a/watchdog_8hpp_source.html +++ b/watchdog_8hpp_source.html @@ -176,7 +176,7 @@ $(document).ready(function() { init_codefold(0); });
          diff --git a/wav_8hpp_source.html b/wav_8hpp_source.html index ee478c7d0..6a1919820 100644 --- a/wav_8hpp_source.html +++ b/wav_8hpp_source.html @@ -717,15 +717,15 @@ $(document).ready(function() { init_codefold(0); });
          659}
          Helper class for read/write of records to/from memory.
          Definition idrec.hpp:278
          static constexpr T_ID id()
          Returns record id.
          Definition idrec.hpp:297
          -
          Basic seekable stream operations.
          Definition stream.hpp:824
          +
          Basic seekable stream operations.
          Definition stream.hpp:812
          ‍UTF-8 byte-order-mark
          Definition stream.hpp:79
          -
          Limits file reading/writing to a predefined window.
          Definition stream.hpp:1694
          -
          In-memory file.
          Definition stream.hpp:3178
          -
          virtual fsize_t size() const
          Returns file size Should the file size cannot be determined, the method returns fsize_max and it does...
          Definition stream.hpp:3878
          -
          size_t write_stream(basic &stream, size_t amount=SIZE_MAX)
          Writes content of another stream.
          Definition stream.hpp:3792
          -
          virtual fpos_t seek(foff_t offset, seek_t how=seek_t::beg)
          Seeks to specified relative file position.
          Definition stream.hpp:3856
          -
          virtual void truncate()
          Sets file size - truncates the remainder of file content from the current file position to the end of...
          Definition stream.hpp:3883
          -
          const void * data() const
          Returns pointer to data.
          Definition stream.hpp:3505
          +
          Limits file reading/writing to a predefined window.
          Definition stream.hpp:1682
          +
          In-memory file.
          Definition stream.hpp:3171
          +
          virtual fsize_t size() const
          Returns file size Should the file size cannot be determined, the method returns fsize_max and it does...
          Definition stream.hpp:3871
          +
          size_t write_stream(basic &stream, size_t amount=SIZE_MAX)
          Writes content of another stream.
          Definition stream.hpp:3785
          +
          virtual fpos_t seek(foff_t offset, seek_t how=seek_t::beg)
          Seeks to specified relative file position.
          Definition stream.hpp:3849
          +
          virtual void truncate()
          Sets file size - truncates the remainder of file content from the current file position to the end of...
          Definition stream.hpp:3876
          +
          const void * data() const
          Returns pointer to data.
          Definition stream.hpp:3498
          Extended cue.
          Definition wav.hpp:397
          uint32_t duration
          How many samples from the cue point the region or section spans.
          Definition wav.hpp:398
          std::string note
          Note text.
          Definition wav.hpp:406
          @@ -789,7 +789,7 @@ $(document).ready(function() { init_codefold(0); });
          diff --git a/windows_8h_source.html b/windows_8h_source.html index a28d4592b..33921bcf0 100644 --- a/windows_8h_source.html +++ b/windows_8h_source.html @@ -109,7 +109,7 @@ $(document).ready(function() { init_codefold(0); });