|
libzypp
9.1.2
|
#include <Locale.h>
Classes | |
| struct | Impl |
| Locale implementation. More... | |
Public Member Functions | |
| Locale () | |
| Default ctor. | |
| Locale (IdString code_r) | |
| Ctor taking a string. | |
| Locale (const std::string &code_r) | |
| Locale (const char *code_r) | |
| Locale (const LanguageCode &language_r, const CountryCode &country_r=CountryCode()) | |
| Ctor taking LanguageCode and optional CountryCode. | |
| ~Locale () | |
| Dtor. | |
| const LanguageCode & | language () const |
| const CountryCode & | country () const |
| std::string | code () const |
| Return the locale code. | |
| std::string | name () const |
| Return the name made of language and country name. | |
| Locale | fallback () const |
| Return a fallback locale for this locale, when giving up, returns empty Locale() | |
Static Public Member Functions | |
| static Locale | bestMatch (const LocaleSet &avLocales_r, const Locale &requested_r=Locale()) |
Return the best match for Locale requested_r within the available avLocales_r. | |
Static Public Attributes | |
Locale constants. | |
| static const Locale | noCode |
| No or empty code. | |
Private Attributes | |
| RW_pointer< Impl > | _pimpl |
| Pointer to implementation. | |
Friends | |
| std::ostream & | operator<< (std::ostream &str, const Locale &obj) |
Related Functions | |
(Note that these are not member functions.) | |
| std::ostream & | operator<< (std::ostream &str, const Locale &obj) |
| template<> | |
| bool | operator() (const zypp::Locale &lhs, const zypp::Locale &rhs) const |
| bool | operator== (const Locale &lhs, const Locale &rhs) |
| Comparison based on string value. | |
| bool | operator== (const std::string &lhs, const Locale &rhs) |
| bool | operator== (const Locale &lhs, const std::string &rhs) |
| bool | operator!= (const Locale &lhs, const Locale &rhs) |
| bool | operator!= (const std::string &lhs, const Locale &rhs) |
| bool | operator!= (const Locale &lhs, const std::string &rhs) |
Default ctor.
Definition at line 137 of file Locale.cc.
Referenced by zypp::Locale::Impl::fallback().
| zypp::Locale::Locale | ( | IdString | code_r | ) | [explicit] |
| zypp::Locale::Locale | ( | const std::string & | code_r | ) | [explicit] |
| zypp::Locale::Locale | ( | const char * | code_r | ) | [explicit] |
| zypp::Locale::Locale | ( | const LanguageCode & | language_r, |
| const CountryCode & | country_r = CountryCode() |
||
| ) |
Ctor taking LanguageCode and optional CountryCode.
| const LanguageCode & zypp::Locale::language | ( | ) | const |
Definition at line 191 of file Locale.cc.
References _pimpl, and zypp::Locale::Impl::language().
| const CountryCode & zypp::Locale::country | ( | ) | const |
Definition at line 199 of file Locale.cc.
References _pimpl, and zypp::Locale::Impl::country().
| std::string zypp::Locale::code | ( | ) | const |
Return the locale code.
Definition at line 207 of file Locale.cc.
References _pimpl, and zypp::Locale::Impl::code().
Referenced by zypp::sat::detail::PoolImpl::addRequestedLocale(), zypp::repo::susetags::Downloader::download(), zypp::sat::detail::PoolImpl::eraseRequestedLocale(), zypp::RepoInfo::getLicense(), operator()(), operator<<(), and operator==().
| std::string zypp::Locale::name | ( | ) | const |
Return the name made of language and country name.
Definition at line 215 of file Locale.cc.
References _pimpl, and zypp::Locale::Impl::name().
| Locale zypp::Locale::fallback | ( | ) | const |
Return a fallback locale for this locale, when giving up, returns empty Locale()
Definition at line 223 of file Locale.cc.
References _pimpl, and zypp::Locale::Impl::fallback().
Referenced by zypp::sat::detail::_locale_hack(), zypp::repo::susetags::Downloader::download(), zypp::sat::Solvable::lookupStrAttribute(), and zypp::sat::detail::PoolImpl::setTextLocale().
| Locale zypp::Locale::bestMatch | ( | const LocaleSet & | avLocales_r, |
| const Locale & | requested_r = Locale() |
||
| ) | [static] |
Return the best match for Locale requested_r within the available avLocales_r.
If requested_r is nor specified or equals Locale::noCode, ZConfig::textLocale is assumed.
If neither requested_r nor any of it's fallback locales are available, Locale::noCode is returned.
Definition at line 229 of file Locale.cc.
References zypp::applydeltarpm::check(), zypp::ZConfig::instance(), and noCode.
Referenced by zypp::RepoInfo::getLicense().
| std::ostream& operator<< | ( | std::ostream & | str, |
| const Locale & | obj | ||
| ) | [friend] |
| std::ostream & operator<< | ( | std::ostream & | str, |
| const Locale & | obj | ||
| ) | [related] |
| bool operator== | ( | const std::string & | lhs, |
| const Locale & | rhs | ||
| ) | [related] |
| bool operator== | ( | const Locale & | lhs, |
| const std::string & | rhs | ||
| ) | [related] |
| bool operator!= | ( | const std::string & | lhs, |
| const Locale & | rhs | ||
| ) | [related] |
| bool operator!= | ( | const Locale & | lhs, |
| const std::string & | rhs | ||
| ) | [related] |
| bool operator() | ( | const zypp::Locale & | lhs, |
| const zypp::Locale & | rhs | ||
| ) | const [related] |
const Locale zypp::Locale::noCode [static] |
No or empty code.
Definition at line 71 of file Locale.h.
Referenced by zypp::sat::detail::_locale_hack(), bestMatch(), zypp::repo::susetags::Downloader::download(), zypp::RepoInfo::getLicense(), zypp::sat::Solvable::lookupStrAttribute(), and zypp::sat::detail::PoolImpl::setTextLocale().
RW_pointer<Impl> zypp::Locale::_pimpl [private] |
Pointer to implementation.
Definition at line 103 of file Locale.h.
Referenced by code(), country(), fallback(), language(), and name().
1.7.6.1