bn::utf8_character class

Decodes a single UTF-8 character from a string.

See utf8_decode_char() function in https://github.com/devkitPro/libtonc/blob/master/src/tte/tte_main.c.

Constructors, destructors, conversion operators

utf8_character(const char* text_ptr) constexpr
Constructor.
utf8_character(const char& text_ref) constexpr
Constructor.

Public functions

auto data() const -> int constexpr
Returns the decoded UTF-8 character.
auto size() const -> int constexpr
Returns the size in bytes of the decoded UTF-8 character.

Function documentation

bn::utf8_character::utf8_character(const char* text_ptr) constexpr

Constructor.

Parameters
text_ptr Non null pointer to the string to decode.

bn::utf8_character::utf8_character(const char& text_ref) constexpr

Constructor.

Parameters
text_ref Reference to the string to decode.