Strings » Code units module

Utilities for manipulating individual code units ('characters').

Modules

module is_ascii_code_point()
module is_ascii_hyphen()
module is_ascii_letter()
module is_ascii_lowercase()
module is_ascii_number()
module is_ascii_uppercase()
module is_ascii_whitespace()
module is_code_point()
module is_code_point_boundary()
module is_combining_mark()
module is_decimal_digit()
module is_hexadecimal_digit()
module is_hyphen()
module is_letter()
module is_lowercase()
module is_non_ascii_code_point()
module is_non_ascii_hyphen()
module is_non_ascii_letter()
module is_non_ascii_lowercase()
module is_non_ascii_number()
module is_non_ascii_uppercase()
module is_non_ascii_whitespace()
module is_not_code_point()
module is_not_hyphen()
module is_not_letter()
module is_not_lowercase()
module is_not_number()
module is_not_uppercase()
module is_not_whitespace()
module is_number()
module is_octal_digit()
module is_uppercase()
module is_whitespace()

Classes

template <typename Char = char>
struct muu::hex_char_pair
A pair of code units in a byte pair.
class muu::utf16_decoder
A state machine for decoding UTF-16 data.
class muu::utf8_decoder
A state machine for decoding UTF-8 data.

Functions

template <typename Char = char>
auto byte_to_hex(uint8_t byte, Char a = constants<Char>::letter_a) -> hex_char_pair<Char> constexpr noexcept
Converts a byte value to it's equivalent pair of code units in the range [0x0, 0xF].
template <typename Char = char>
auto byte_to_hex(std::byte byte, Char a = constants<Char>::letter_a) -> hex_char_pair<Char> constexpr noexcept
Converts a byte value to it's equivalent pair of code units in the range [0x0, 0xF].
template <typename Char = char>
auto dec_to_hex(unsigned val, Char a = constants<Char>::letter_a) -> Char constexpr noexcept
Converts an unsigned integer in the range [0x0, 0xF] to it's equivalent code units [0-9, a-f, A-F].
template <typename T>
auto hex_to_dec(T codepoint) -> unsigned constexpr noexcept
Converts a code units containing a hex value [0-9, a-f, A-F] to it's equivalent unsigned integer [0x0, 0xF].

Function documentation

#include <muu/chars.h>
template <typename Char = char>
hex_char_pair<Char> byte_to_hex(uint8_t byte, Char a = constants<Char>::letter_a) constexpr noexcept

Converts a byte value to it's equivalent pair of code units in the range [0x0, 0xF].

#include <muu/chars.h>
template <typename Char = char>
hex_char_pair<Char> byte_to_hex(std::byte byte, Char a = constants<Char>::letter_a) constexpr noexcept

Converts a byte value to it's equivalent pair of code units in the range [0x0, 0xF].

#include <muu/chars.h>
template <typename Char = char>
Char dec_to_hex(unsigned val, Char a = constants<Char>::letter_a) constexpr noexcept

Converts an unsigned integer in the range [0x0, 0xF] to it's equivalent code units [0-9, a-f, A-F].

#include <muu/chars.h>
template <typename T>
unsigned hex_to_dec(T codepoint) constexpr noexcept

Converts a code units containing a hex value [0-9, a-f, A-F] to it's equivalent unsigned integer [0x0, 0xF].