Encoding Schemeļƒ

The encoding_scheme template turns any encoding into a byte-based encoding capable of reading and writing those bytes into and out of byte-value_type ranges. It prevents duplicating effort to read encodings as little endian or big endian, allowing composition for any desired encoding to interface with e.g. a UTF-16 Big Endian blob of data coming over a network or shared pipe.

Aliasesļƒ

template<typename _Byte>
using ztd::text::basic_utf16_le = encoding_scheme<utf16_t, endian::little, _Byte>ļƒ

A UTF-16 encoding, in Little Endian format, with inputs as a sequence of bytes.

Template Parameters:

_Byte ā€“ The byte type to use. Typically, this is std::byte or uchar.

using ztd::text::utf16_le_t = basic_utf16_le<::std::byte>ļƒ

A UTF-16 encoding, in Little Endian format, with inputs as a sequence of bytes.

template<typename _Byte>
using ztd::text::basic_utf16_be = encoding_scheme<utf16_t, endian::big, _Byte>ļƒ

A UTF-16 encoding, in Big Endian format, with inputs as a sequence of bytes.

Template Parameters:

_Byte ā€“ The byte type to use. Typically, this is std::byte or unsigned char.

using ztd::text::utf16_be_t = basic_utf16_be<::std::byte>ļƒ

A UTF-16 encoding, in Big Endian format, with inputs as a sequence of bytes.

template<typename _Byte>
using ztd::text::basic_utf16_ne = encoding_scheme<utf16_t, endian::native, _Byte>ļƒ

A UTF-16 encoding, in Native Endian format, with inputs as a sequence of bytes.

Template Parameters:

_Byte ā€“ The byte type to use. Typically, this is std::byte or unsigned char.

using ztd::text::utf16_ne_t = basic_utf16_ne<::std::byte>ļƒ

A UTF-16 encoding, in Native Endian format, with inputs as a sequence of bytes.

template<typename _Byte>
using ztd::text::basic_utf32_le = encoding_scheme<utf32_t, endian::little, _Byte>ļƒ

A UTF-32 encoding, in Little Endian format, with inputs as a sequence of bytes.

Template Parameters:

_Byte ā€“ The byte type to use. Typically, this is std::byte or unsigned char .

using ztd::text::utf32_le_t = basic_utf32_le<::std::byte>ļƒ

A UTF-32 encoding, in Little Endian format, with inputs as a sequence of bytes.

template<typename _Byte>
using ztd::text::basic_utf32_be = encoding_scheme<utf32_t, endian::big, _Byte>ļƒ

A UTF-32 encoding, in Big Endian format, with inputs as a sequence of bytes.

Template Parameters:

_Byte ā€“ The byte type to use. Typically, this is std::byte or unsigned char .

using ztd::text::utf32_be_t = basic_utf32_be<::std::byte>ļƒ

A UTF-32 encoding, in Big Endian format, with inputs as a sequence of bytes.

template<typename _Byte>
using ztd::text::basic_utf32_ne = encoding_scheme<utf32_t, endian::native, _Byte>ļƒ

A UTF-32 encoding, in Native Endian format, with inputs as a sequence of bytes.

Template Parameters:

_Byte ā€“ The byte type to use. Typically, this is std::byte or unsigned char .

using ztd::text::utf32_ne_t = basic_utf32_ne<::std::byte>ļƒ

A UTF-32 encoding, in Big Endian format, with inputs as a sequence of bytes.

Base Templateļƒ

template<typename _Encoding, endian _Endian = endian::native, typename _Byte = ::std::byte>
class encoding_scheme : public __txt_detail::__is_unicode_encoding_es<encoding_scheme<_Encoding, endian::native, ::std::byte>, unwrap_remove_cvref_t<_Encoding>>, private ebco<_Encoding>ļƒ
#include <basic_encoding_scheme.hpp>

Decomposes the provided Encoding type into a specific endianness (big, little, or native) to allow for a single encoding type to be viewed in different ways.

Remark

For example, this can be used to construct a Big Endian UTF-16 by using encoding_scheme<ztd::text::utf16_t, ztd::endian::big>. It can be made interopable with unsigned char buffers rather than std::byte buffers by doing: ztd::text::encoding_scheme<ztd::text::utf32_t, ztd::endian::native, unsigned char>.

Template Parameters:
  • _Encoding ā€“ The encoding type.

  • _Endian ā€“ The endianess to use. Defaults to ztd::endian::native.

  • _Byte ā€“ The byte type to use. Defaults to std::byte.