|
|
constexpr | grapheme (grapheme const &) noexcept=default |
| |
|
constexpr | grapheme (grapheme &&) noexcept=default |
| |
|
constexpr grapheme & | operator= (grapheme const &) noexcept=default |
| |
|
constexpr grapheme & | operator= (grapheme &&) noexcept=default |
| |
| constexpr | grapheme (char32_t code_point) noexcept |
| | Encode a single code-point.
|
| |
| constexpr grapheme & | operator= (char32_t code_point) noexcept |
| | Encode a single code-point.
|
| |
| constexpr | grapheme (char code_point) noexcept |
| | Encode a single code-point.
|
| |
| constexpr grapheme & | operator= (char code_point) noexcept |
| | Encode a single code-point.
|
| |
| | grapheme (std::u32string_view code_points) noexcept |
| | Encode a grapheme from a list of code-points.
|
| |
| grapheme & | operator= (std::u32string_view code_points) noexcept |
| | Encode a grapheme from a list of code-points.
|
| |
| constexpr void | clear () noexcept |
| | Clear the grapheme.
|
| |
| constexpr bool | empty () const noexcept |
| | Check if the grapheme is empty.
|
| |
| constexpr | operator bool () const noexcept |
| | Check if the grapheme holds any code-points.
|
| |
| bool | valid () const noexcept |
| | Check if the grapheme is valid.
|
| |
| constexpr std::size_t | size () const noexcept |
| | Return the number of code-points encoded in the grapheme.
|
| |
| constexpr bool | overlong () const noexcept |
| | Check if the grapheme was initialized with more than 4 combining characters.
|
| |
| constexpr char32_t | operator[] (size_t i) const noexcept |
| | Get the code-point at the given index.
|
| |
| constexpr std::u32string | composed () const noexcept |
| | Get a list of code-point normalized to NFC.
|
| |
| std::u32string | decomposed () const noexcept |
| | Get a list of code-point normalized to NFD.
|
| |
|
| template<size_t I> |
| constexpr char32_t | get (grapheme const &rhs) noexcept |
| | Get the code-point at the given index.
|
| |
| constexpr bool | operator== (grapheme const &a, grapheme const &b) noexcept=default |
| | Compare equivalence of two graphemes.
|
| |
| constexpr std::strong_ordering | operator<=> (grapheme const &a, grapheme const &b) noexcept=default |
| | Compare two graphemes lexicographically.
|
| |
|
constexpr bool | operator== (grapheme const &lhs, char32_t const &rhs) noexcept |
| |
|
constexpr std::strong_ordering | operator<=> (grapheme const &lhs, char32_t const &rhs) noexcept |
| |
|
constexpr bool | operator== (grapheme const &lhs, char const &rhs) noexcept |
| |
|
constexpr std::strong_ordering | operator<=> (grapheme const &lhs, char const &rhs) noexcept |
| |
|
std::string | to_string (grapheme const &rhs) noexcept |
| |
|
std::u32string | to_u32string (grapheme const &rhs) noexcept |
| |
A grapheme, what a user thinks a character is.
This class will hold:
- empty/eof (no code points encoded at all, the value 0)
- U+0000 (value 1)
- 1 starter code-point, followed by 0-4 combining characters.
A grapheme should not include typographical ligatures such as 'fi' as the font should handle creating ligatures.
If a grapheme is initialized with more than 4 combining characters the extra combining characters are dropped and can be detected by calling overlong().
This class is trivial and constant-destructible so that it can be used as a character class in std::basic_string and used as a non-type template parameter.