|
|
constexpr | language_tag (language_tag const &) noexcept=default |
|
constexpr | language_tag (language_tag &&) noexcept=default |
|
constexpr language_tag & | operator= (language_tag const &) noexcept=default |
|
constexpr language_tag & | operator= (language_tag &&) noexcept=default |
|
constexpr | language_tag (iso_639 const &language, iso_15924 const &script={}, iso_3166 const ®ion={}) noexcept |
|
constexpr | language_tag (iso_639 const &language, iso_3166 const ®ion) noexcept |
| | language_tag (std::string_view str) |
| | Parse a language tag.
|
| bool | empty () const noexcept |
| | Check if the language tag is empty.
|
| | operator bool () const noexcept |
| | Check if the language tag is used.
|
| generator< language_tag > | variants () const noexcept |
| | Get variants of the language_tag.
|
| generator< language_tag > | canonical_variants () const noexcept |
| | Get variants of the language_tag.
|
| std::vector< language_tag > | all_variants () const noexcept |
| | Creates variants of a language tag, including those by expanding the normal variants.
|
| language_tag | expand () const noexcept |
| | Expand the language tag to include script and language.
|
| language_tag | shrink () const noexcept |
| | Get a tag with only the language.
|
| iso_15924 | default_script () const noexcept |
| | Get the default-script for this language.
|
| bool | left_to_right () const noexcept |
| | The language direction for this language-tag.
|
|
std::string | to_string () const noexcept |
The IETF BCP 47 language tag.
This class stores the language tag in 64 bits; in its individual components of the: ISO-639 language (16 bit), ISO-15924 script (16 bit) and ISO-3166 region (16 bit). In the future another 16 bits can be used to store the variants and extensions.
| v1::language_tag::language_tag |
( |
std::string_view | str | ) |
|
Parse a language tag.
This will construct a language tag with the language, script and region set as complete as possible. It does this by expanding the language tags using default script, region and grandfathering tables.
This function will ignore upper/lower case of the sub-tags, and allow for both underscores '_' and dashes '-' to separate the sub-tags.
- Parameters
-
| str | The language tag to parse |
- Exceptions
-