|
libzypp
17.7.0
|
'Language[_Country]' codes. More...
#include <Locale.h>

Public Member Functions | |
| Locale () | |
| Default Ctor: noCode. More... | |
| Locale (IdString str_r) | |
| Ctor from string. More... | |
| Locale (const std::string &str_r) | |
| Ctor from string. More... | |
| Locale (const char *str_r) | |
| Ctor from string. More... | |
| Locale (LanguageCode language_r, CountryCode country_r=CountryCode()) | |
| Ctor taking LanguageCode and optional CountryCode. More... | |
| ~Locale () | |
| Dtor. More... | |
| LanguageCode | language () const |
| The language part. More... | |
| CountryCode | country () const |
| The county part. More... | |
| std::string | code () const |
| Return the locale code asString. More... | |
| std::string | name () const |
| Return the translated locale name. More... | |
| Locale | fallback () const |
| Return the fallback locale for this locale, if no fallback exists the empty Locale::noCode. More... | |
Public Member Functions inherited from zypp::IdStringType< Locale > | |
| IdString | idStr () const |
| bool | empty () const |
| unsigned | size () const |
| const char * | c_str () const |
| std::string | asString () const |
| IdType | id () const |
| operator bool () const | |
Evaluate in a boolean context ( ! empty() ). More... | |
| operator IdString () const | |
| Explicit conversion to IdString. More... | |
| operator std::string () const | |
| Explicit conversion to std::string. More... | |
| int | compare (const Locale &rhs) const |
| int | compare (const IdStringType &rhs) const |
| int | compare (const IdString &rhs) const |
| int | compare (const std::string &rhs) const |
| int | compare (const char *rhs) const |
Static Public Member Functions | |
| static Locale | bestMatch (const LocaleSet &avLocales_r, Locale requested_r=Locale()) |
| Return the best match for Locale requested_r within the available avLocales_r. More... | |
Static Public Member Functions inherited from zypp::IdStringType< Locale > | |
| static int | compare (const Locale &lhs, const Locale &rhs) |
| static int | compare (const Locale &lhs, const IdString &rhs) |
| static int | compare (const Locale &lhs, const std::string &rhs) |
| static int | compare (const Locale &lhs, const char *rhs) |
| static int | compare (const IdString &lhs, const Locale &rhs) |
| static int | compare (const IdString &lhs, const IdString &rhs) |
| static int | compare (const IdString &lhs, const std::string &rhs) |
| static int | compare (const IdString &lhs, const char *rhs) |
| static int | compare (const std::string &lhs, const Locale &rhs) |
| static int | compare (const std::string &lhs, const IdString &rhs) |
| static int | compare (const std::string &lhs, const std::string &rhs) |
| static int | compare (const std::string &lhs, const char *rhs) |
| static int | compare (const char *lhs, const Locale &rhs) |
| static int | compare (const char *lhs, const IdString &rhs) |
| static int | compare (const char *lhs, const std::string &rhs) |
| static int | compare (const char *lhs, const char *rhs) |
Static Public Attributes | |
Locale constants. | |
| static const Locale | noCode |
| Empty code. More... | |
| static const Locale | enCode |
| Last resort "en". More... | |
Private Attributes | |
| IdString | _str |
Friends | |
| class | IdStringType< Locale > |
'Language[_Country]' codes.
In fact the class will not prevent to use a non iso code. Just a warning will appear in the log. Construction from string consider everything up to the first '.' or '@'.
|
explicit |
|
explicit |
|
explicit |
| zypp::Locale::Locale | ( | LanguageCode | language_r, |
| CountryCode | country_r = CountryCode() |
||
| ) |
Ctor taking LanguageCode and optional CountryCode.
| LanguageCode zypp::Locale::language | ( | ) | const |
| CountryCode zypp::Locale::country | ( | ) | const |
|
inline |
| std::string zypp::Locale::name | ( | ) | const |
| Locale zypp::Locale::fallback | ( | ) | const |
Return the fallback locale for this locale, if no fallback exists the empty Locale::noCode.
The usual fallback sequence is "language_COUNTRY" -> "language" -> Locale::enCode ("en") ->Locale::noCode (""). Some exceptions like "pt_BR"->"en"->"" do exist.
|
static |
Return the best match for Locale requested_r within the available avLocales_r.
If requested_r is not specified ZConfig::textLocale is assumed.
If neither requested_r nor any of it's fallback locales are available in avLocales_r, Locale::noCode is returned.
|
friend |