HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Static Public Member Functions | Static Public Attributes
v1::base_n< Alphabet, CharsPerBlock, BytesPerBlock > Class Template Reference

Static Public Member Functions

template<typename T >
static constexpr T int_from_char (char c) noexcept
 
template<typename T >
static constexpr char char_from_int (T x) noexcept
 
template<typename ItIn , typename ItOut >
static constexpr void encode (ItIn ptr, ItIn last, ItOut output)
 Encode bytes into a string.
 
template<typename ItIn >
static std::string encode (ItIn first, ItIn last) noexcept
 Encode bytes into a string.
 
static constexpr std::string encode (std::span< std::byte const > bytes) noexcept
 Encode bytes into a string.
 
template<typename ItIn , typename ItOut >
static constexpr ItIn decode (ItIn ptr, ItIn last, ItOut output)
 Decodes a UTF-8 string into bytes.
 
static bstring decode (std::string_view str)
 

Static Public Attributes

static constexpr detail::base_n_alphabet alphabet = Alphabet
 
static constexpr char padding_char = alphabet.padding_char
 
static constexpr long long radix = alphabet.radix
 
static constexpr long long bytes_per_block = BytesPerBlock
 
static constexpr long long chars_per_block = CharsPerBlock
 

Member Function Documentation

◆ decode()

template<detail::base_n_alphabet Alphabet, int CharsPerBlock, int BytesPerBlock>
template<typename ItIn , typename ItOut >
static constexpr ItIn v1::base_n< Alphabet, CharsPerBlock, BytesPerBlock >::decode ( ItIn ptr,
ItIn last,
ItOut output )
inlinestaticconstexpr

Decodes a UTF-8 string into bytes.

Parameters
ptrAn iterator inside a UTF-8 string to the start of a base-n encoded data.
lastAn iterator beyond the encoded data.
outputAn output iterator to a std::byte buffer.
Returns
An iterator pointing on the first invalid character or last.

◆ encode() [1/3]

template<detail::base_n_alphabet Alphabet, int CharsPerBlock, int BytesPerBlock>
template<typename ItIn >
static std::string v1::base_n< Alphabet, CharsPerBlock, BytesPerBlock >::encode ( ItIn first,
ItIn last )
inlinestaticnoexcept

Encode bytes into a string.

Parameters
firstAn iterator pointing to the first byte to encode.
lastAn iterator pointing to one beyond the last byte to encode.
Returns
The data encoded as a string.

◆ encode() [2/3]

template<detail::base_n_alphabet Alphabet, int CharsPerBlock, int BytesPerBlock>
template<typename ItIn , typename ItOut >
static constexpr void v1::base_n< Alphabet, CharsPerBlock, BytesPerBlock >::encode ( ItIn ptr,
ItIn last,
ItOut output )
inlinestaticconstexpr

Encode bytes into a string.

Parameters
ptrPointer
lastBeyond the last byte.
output

◆ encode() [3/3]

template<detail::base_n_alphabet Alphabet, int CharsPerBlock, int BytesPerBlock>
static constexpr std::string v1::base_n< Alphabet, CharsPerBlock, BytesPerBlock >::encode ( std::span< std::byte const > bytes)
inlinestaticconstexprnoexcept

Encode bytes into a string.

Parameters
bytesA span of bytes to encode.
Returns
The data encoded as a string.

The documentation for this class was generated from the following file: