muu::utf16_decoder class

A state machine for decoding UTF-16 data.

Public functions

void clear_error() constexpr noexcept
Clears the error state.
auto error() const -> bool constexpr noexcept
Returns true if the decoder has entered an error state.
auto has_value() const -> bool constexpr noexcept
Returns true if the decoder has a decoded a full UTF-32 codepoint.
auto needs_more_input() const -> bool constexpr noexcept
Returns true if the decoder needs more input before it can yield a UTF-32 codepoint.
void operator()(uint16_t code_unit) constexpr noexcept
Appends a UTF-16 code unit to the stream being decoded.
void operator()(char16_t code_unit) constexpr noexcept
Appends a UTF-16 code unit to the stream being decoded.
auto value() const -> char32_t constexpr noexcept
Returns the currently-decoded UTF-32 codepoint.