#include <hikogui/i18n/iso_639.hpp>
|
|
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.
|
|
| 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:
- ISO 639-1 (2002)
- ISO 639-2 (1998)
- ISO 639-3 (2007)
- ISO 639-5 (2008)
This class compresses this 2 or 3 character language code inside 15 bits.
◆ iso_639() [1/2]
Construct empty language.
◆ iso_639() [2/2]
| v1::iso_639::iso_639 |
( |
std::string_view | str | ) |
|
|
inlineconstexpr |
Construct a language from the 2 or 3 letter code.
◆ code()
|
|
inlinenodiscardconstexprnoexcept |
Get the 2 or 3 letter ISO-639 code.
◆ empty()
| bool v1::iso_639::empty |
( |
| ) |
const |
|
inlinenodiscardconstexprnoexcept |
Check if the language is empty.
◆ hash()
| size_t v1::iso_639::hash |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
Get the hash value for this language code.
◆ operator bool()
| v1::iso_639::operator bool |
( |
| ) |
const |
|
inlineexplicitconstexprnoexcept |
Check if the language is used.
◆ size()
|
|
inlinenodiscardconstexprnoexcept |
Get the number of character.
- Returns
- 2 or 3 for a code, or 0 if empty.
◆ get
| friend char get |
( |
iso_639 const & | rhs | ) |
|
|
friend |
Get the letter at a specific position.
- Template Parameters
-
- Parameters
-
| rhs | The language code read from. |
- Returns
- The character at index, a-z, 0-5 or nul.
◆ matches
| friend bool matches |
( |
iso_639 const & | lhs, |
|
|
iso_639 const & | rhs ) |
|
friend |
Check if rhs matches with lhs.
- Parameters
-
| lhs | The language or wild-card. |
| rhs | The language. |
- Returns
- True when lhs is a wild-card or when lhs and rhs are equal.
◆ operator<=>
| friend auto operator<=> |
( |
iso_639 const & | lhs, |
|
|
iso_639 const & | rhs ) |
|
friend |
Compare two language codes.
◆ operator==
| friend bool operator== |
( |
iso_639 const & | lhs, |
|
|
iso_639 const & | rhs ) |
|
friend |
Compare two language codes.
◆ set
| friend bool set |
( |
iso_639 & | rhs, |
|
|
char | c ) |
|
friend |
Set the letter at a specific position.
- Template Parameters
-
- Parameters
-
| rhs | The language code to change. |
| c | The character to set. a-z, A-Z, 0-5 or nul. |
The documentation for this class was generated from the following file: