HikoGUI
A low latency retained GUI
|
#include <hikogui/i18n/iso_639.hpp>
Public Member Functions | |
constexpr | iso_639 (iso_639 const &) noexcept=default |
constexpr | iso_639 (iso_639 &&) noexcept=default |
constexpr iso_639 & | operator= (iso_639 const &) noexcept=default |
constexpr iso_639 & | operator= (iso_639 &&) noexcept=default |
constexpr | iso_639 () noexcept |
Construct empty language. | |
constexpr | iso_639 (std::string_view str) |
Construct a language from the 2 or 3 letter code. | |
constexpr | iso_639 (std::in_place_t, uint16_t v) noexcept |
constexpr uint16_t const & | intrinsic () const noexcept |
constexpr uint16_t & | intrinsic () noexcept |
constexpr std::size_t | size () const noexcept |
Get the number of character. | |
constexpr bool | empty () const noexcept |
Check if the language is empty. | |
constexpr | operator bool () const noexcept |
Check if the language is used. | |
size_t | hash () const noexcept |
Get the hash value for this language code. | |
constexpr std::string | code () const noexcept |
Get the 2 or 3 letter ISO-639 code. | |
Friends | |
template<std::size_t I> | |
constexpr friend bool | set (iso_639 &rhs, char c) noexcept |
Set the letter at a specific position. | |
template<std::size_t I> | |
constexpr friend char | get (iso_639 const &rhs) noexcept |
Get the letter at a specific position. | |
constexpr friend std::string | to_string (iso_639 const &rhs) noexcept |
constexpr friend bool | operator== (iso_639 const &lhs, iso_639 const &rhs) noexcept=default |
Compare two language codes. | |
constexpr friend auto | operator<=> (iso_639 const &lhs, iso_639 const &rhs) noexcept=default |
Compare two language codes. | |
constexpr friend bool | matches (iso_639 const &lhs, iso_639 const &rhs) noexcept |
Check if rhs matches with lhs. | |
ISO-639 language code.
A 2 or 3 lower case language code selected from the following iso standards:
This class compresses this 2 or 3 character language code inside 15 bits.
|
inlineconstexprnoexcept |
Construct empty language.
|
inlineconstexpr |
Construct a language from the 2 or 3 letter code.
|
inlineconstexprnoexcept |
Get the 2 or 3 letter ISO-639 code.
|
inlinenoexcept |
Get the hash value for this language code.
|
inlineexplicitconstexprnoexcept |
Check if the language is used.
|
inlineconstexprnoexcept |
Get the number of character.
|
friend |
Get the letter at a specific position.
I | index |
rhs | The language code read from. |
Check if rhs matches with lhs.
lhs | The language or wild-card. |
rhs | The language. |
Compare two language codes.
Compare two language codes.
Set the letter at a specific position.
I | index |
rhs | The language code to change. |
c | The character to set. a-z, A-Z, 0-5 or nul. |