Stroika Library 3.0d25
 
Loading...
Searching...
No Matches
BinaryToText.h File Reference
#include "Stroika/Foundation/StroikaPreComp.h"
#include <optional>
#include "Stroika/Foundation/Characters/CodeCvt.h"
#include "Stroika/Foundation/Characters/UTFConvert.h"
#include "Stroika/Foundation/Execution/Synchronized.h"
#include "Stroika/Foundation/Streams/InputStream.h"
#include "BinaryToText.inl"

Go to the source code of this file.

Classes

struct  Stroika::Foundation::Streams::BinaryToText::ByteOrderMarkOr
 Decode by the text's byte order mark where it has one, and otherwise with fIfNone - as against a CodeCvt alone, which decodes with exactly that, byte order mark or not. More...
 

Namespaces

namespace  Stroika::Foundation
 
namespace  Stroika::Foundation::Streams::BinaryToText::Reader
 BinaryToText::Reader::Ptr is an InputStream::Ptr<Character>, usually constructed wrapping some binary object or binary stream.
 

Typedefs

using Stroika::Foundation::Streams::BinaryToText::Reader::Ptr = InputStream::Ptr< Character >
 BinaryToText::Readers produce text in the form of an InputStream of 'Character' objects (so you might get the text with ReadAll()).
 

Enumerations

enum class  Stroika::Foundation::Streams::BinaryToText::AutomaticCodeCvtFlags
 
enum class  Stroika::Foundation::Streams::BinaryToText::Reader::ReadAhead
 

Functions

Ptr Stroika::Foundation::Streams::BinaryToText::Reader::New (const InputStream::Ptr< byte > &src, optional< SeekableFlag > seekable={}, ReadAhead readAhead=eReadAheadAllowed)
 Create an InputStream::Ptr<Character> from the arguments (usually binary source) - which can be used to Read out the text as a string.
 
Ptr Stroika::Foundation::Streams::BinaryToText::Reader::New (const InputStream::Ptr< byte > &src, const ByteOrderMarkOr &ifNoByteOrderMark, optional< SeekableFlag > seekable={}, ReadAhead readAhead=eReadAheadAllowed)
 ... by its byte order mark, else with ifNoByteOrderMark.fIfNone
 
Ptr Stroika::Foundation::Streams::BinaryToText::Reader::New (const InputStream::Ptr< byte > &src, const Characters::CodeCvt<> &codeConverter, optional< SeekableFlag > seekable={}, ReadAhead readAhead=eReadAheadAllowed)
 ... with exactly codeConverter
 
Ptr Stroika::Foundation::Streams::BinaryToText::Reader::New (const InputStream::Ptr< Character > &src)
 ... text already
 
Ptr Stroika::Foundation::Streams::BinaryToText::Reader::New (const Traversal::Iterable< Character > &src)
 ... text already
 
template<typename... ARGS>
Ptr Stroika::Foundation::Streams::BinaryToText::Reader::New (Execution::InternallySynchronized internallySynchronized, ARGS... args)
 ... internally synchronized
 
Characters::String Stroika::Foundation::Streams::BinaryToText::Convert (const Memory::BLOB &src)
 convert BLOB to a String - decoded as Reader::New decodes: by its byte order mark, else as UTF-8 (or with ifNoByteOrderMark's), or with exactly codeConverter
 
Characters::String Stroika::Foundation::Streams::BinaryToText::Convert (const Memory::BLOB &src, const ByteOrderMarkOr &ifNoByteOrderMark)
 convert BLOB to a String
 
Characters::String Stroika::Foundation::Streams::BinaryToText::Convert (const Memory::BLOB &src, const Characters::CodeCvt<> &codeConverter)
 convert BLOB to a String
 

Detailed Description

Note
Code-Status: Beta

Definition in file BinaryToText.h.

Enumeration Type Documentation

◆ AutomaticCodeCvtFlags

How text was decoded with no CodeCvt named -

See also
ByteOrderMarkOr, and Reader::New (src) for the byte order mark, else UTF-8.

Definition at line 51 of file BinaryToText.h.

Function Documentation

◆ Convert()

String Stroika::Foundation::Streams::BinaryToText::Convert ( const Memory::BLOB &  src)

convert BLOB to a String - decoded as Reader::New decodes: by its byte order mark, else as UTF-8 (or with ifNoByteOrderMark's), or with exactly codeConverter

Note
shorthand for BinaryToText::Reader::New (src, ...).ReadAll ())
could have done with stream, but the API names suggest side-effect free, and that wouldn't be, since it seeks the src input stream.

Definition at line 536 of file BinaryToText.cpp.