4#ifndef _Stroika_Foundation_Streams_BinaryToText_h_
5#define _Stroika_Foundation_Streams_BinaryToText_h_ 1
7#include "Stroika/Foundation/StroikaPreComp.h"
22namespace Stroika::Foundation::Memory {
25namespace Stroika::Foundation::Streams {
26 using Characters::Character;
29namespace Stroika::Foundation::Streams::BinaryToText {
51 enum class [[deprecated (
"Since Stroika v3.0d25 - use Reader::New (src) or Convert (src) - a byte order mark, else UTF-8 - or "
53 eReadBOMAndIfNotPresentUseUTF8,
54 eReadBOMAndIfNotPresentUseCurrentLocale,
56 eDEFAULT = eReadBOMAndIfNotPresentUseUTF8
58 DISABLE_COMPILER_MSC_WARNING_START (4996)
59 DISABLE_COMPILER_GCC_WARNING_START ("GCC diagnostic ignored \"-Wdeprecated-declarations\"");
60 DISABLE_COMPILER_CLANG_WARNING_START ("clang diagnostic ignored \"-Wdeprecated-declarations\"");
61 using AutomaticCodeCvtFlags::eReadBOMAndIfNotPresentUseCurrentLocale;
62 using AutomaticCodeCvtFlags::eReadBOMAndIfNotPresentUseUTF8;
63 DISABLE_COMPILER_MSC_WARNING_END (4996)
64 DISABLE_COMPILER_GCC_WARNING_END ("GCC diagnostic ignored \"-Wdeprecated-declarations\"");
65 DISABLE_COMPILER_CLANG_WARNING_END ("clang diagnostic ignored \"-Wdeprecated-declarations\"");
123 using ReadAhead::eReadAheadAllowed;
124 using ReadAhead::eReadAheadNever;
145 Ptr New (
const InputStream::Ptr<byte>& src, optional<SeekableFlag> seekable = {}, ReadAhead readAhead = eReadAheadAllowed);
146 Ptr New (
const InputStream::Ptr<byte>& src,
const ByteOrderMarkOr& ifNoByteOrderMark, optional<SeekableFlag> seekable = {},
147 ReadAhead readAhead = eReadAheadAllowed);
148 Ptr New (
const InputStream::Ptr<byte>& src,
const Characters::CodeCvt<>& codeConverter, optional<SeekableFlag> seekable = {},
149 ReadAhead readAhead = eReadAheadAllowed);
150 Ptr New (
const InputStream::Ptr<Character>& src);
152 template <
typename... ARGS>
154 DISABLE_COMPILER_MSC_WARNING_START (4996)
155 DISABLE_COMPILER_GCC_WARNING_START ("GCC diagnostic ignored \"-Wdeprecated-declarations\"");
156 DISABLE_COMPILER_CLANG_WARNING_START ("clang diagnostic ignored \"-Wdeprecated-declarations\"");
157 [[deprecated ("Since Stroika v3.0d25 - use New (src, seekable, readAhead) - a
byte order mark, else UTF-8 - or New (src, "
158 "ByteOrderMarkOr{codeCvt}, ...)
")]] Ptr
159 New (const InputStream::Ptr<byte>& src, optional<AutomaticCodeCvtFlags> codeCvtFlags, optional<SeekableFlag> seekable = {},
160 ReadAhead readAhead = eReadAheadAllowed);
161 DISABLE_COMPILER_MSC_WARNING_END (4996)
162 DISABLE_COMPILER_GCC_WARNING_END ("GCC diagnostic ignored \
"-Wdeprecated-declarations\"");
163 DISABLE_COMPILER_CLANG_WARNING_END (
"clang diagnostic ignored \"-Wdeprecated-declarations\"");
180 Characters::String
Convert (
const Memory::BLOB& src);
181 Characters::String
Convert (
const Memory::BLOB& src,
const ByteOrderMarkOr& ifNoByteOrderMark);
182 Characters::String
Convert (
const Memory::BLOB& src,
const Characters::CodeCvt<>& codeConverter);
183 DISABLE_COMPILER_MSC_WARNING_START (4996)
184 DISABLE_COMPILER_GCC_WARNING_START ("GCC diagnostic ignored \"-Wdeprecated-declarations\"");
185 DISABLE_COMPILER_CLANG_WARNING_START ("clang diagnostic ignored \"-Wdeprecated-declarations\"");
186 [[deprecated ("Since Stroika v3.0d25 - use Convert (src) - a
byte order mark, else UTF-8 - or Convert (src, "
187 "ByteOrderMarkOr{codeCvt})
")]] Characters::String
188 Convert (const Memory::BLOB& src, optional<AutomaticCodeCvtFlags> codeCvtFlags);
189 DISABLE_COMPILER_MSC_WARNING_END (4996)
190 DISABLE_COMPILER_GCC_WARNING_END ("GCC diagnostic ignored \
"-Wdeprecated-declarations\"");
191 DISABLE_COMPILER_CLANG_WARNING_END (
"clang diagnostic ignored \"-Wdeprecated-declarations\"");
200#include "BinaryToText.inl"
Profile Convert(const VariantValue &v)
CodeCvt unifies byte <-> unicode conversions, vaguely inspired by (and wraps) std::codecvt,...
A Streams::Ptr<ELEMENT_TYPE> is a smart-pointer to a stream of elements of type T.
Iterable<T> is a base class for containers which easily produce an Iterator<T> to traverse them.
Decode by the text's byte order mark where it has one, and otherwise with fIfNone - as against a Code...