37 Impl(
const std::string & code_r )
41 if ( sep == std::string::npos ) {
44 t = code_r.substr( 0, sep );
48 if ( sep == std::string::npos ) {
112 static shared_ptr<Impl> _nullimpl(
new Impl );
121 return str <<
"Locale::Impl";
138 : _pimpl(
Impl::nullimpl() )
156 : _pimpl( new
Impl( code_r ) )
165 : _pimpl( new
Impl(
C_Str(code_r).c_str() ) )
175 : _pimpl( new
Impl( language_r, country_r ) )
192 {
return _pimpl->language(); }
200 {
return _pimpl->country(); }
208 {
return _pimpl->code(); }
216 {
return _pimpl->name(); }
224 {
return _pimpl->fallback(); }
231 if ( ! avLocales_r.empty() )
236 if ( avLocales_r.find(
check ) != avLocales_r.end() )
static const Locale noCode
No or empty code.
Impl(const std::string &code_r)
RW_pointer< Impl > _pimpl
Pointer to implementation.
static ZConfig & instance()
Singleton ctor.
std::map< std::string, std::string > OtherDefaultLanguage
const CountryCode & country() const
std::ostream & operator<<(std::ostream &str, const Locale::Impl &obj)
Access to the sat-pools string space.
std::string code() const
Return the language code.
const LanguageCode & language() const
Impl(const LanguageCode &language_r, const CountryCode &country_r)
std::string name() const
Return the language name; if not available the language code.
static shared_ptr< Impl > nullimpl()
Offer default Impl.
Locale fallback() const
Return a fallback locale for this locale, when giving up, returns empty Locale()
Convenience char* constructible from std::string and char*, it maps (char*)0 to an empty string...
std::tr1::unordered_set< Locale > LocaleSet
std::string asString(const Patch::SeverityFlag &obj)
std::string name() const
Return the name made of language and country name.
std::string code() const
Return the locale code.
std::string name() const
Return the country name; if not available the country code.
bool hasCode() const
*this != noCode.
bool hasCode() const
*this != noCode.
const CountryCode & country() const
const LanguageCode & language() const
bool check(const std::string &sequenceinfo_r, bool quick_r)
Check via sequence info.
std::string code() const
Return the country code.
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 OtherDefaultLanguage otherDefaultLanguage
Language codes (iso639_2/iso639_1).
Country codes (iso3166-1-alpha-2).