You.i Engine
YiLocale.h
Go to the documentation of this file.
1 // © You i Labs Inc. 2000-2020. All rights reserved.
2 #ifndef _YI_LOCALE_H_
3 #define _YI_LOCALE_H_
4 
5 #include "utility/YiString.h"
6 
20 class CYILocale
21 {
22 public:
26  enum class LocaleStringFormat
27  {
28  Concatenated,
29  Raw
30  };
31 
35  CYILocale();
36 
44  CYILocale(const CYIString &rLanguageCode, const CYIString &rCountryCode);
45 
52  CYILocale(const CYIString &rLanguageCode, const CYIString &rCountryCode, const CYIString &rRawLocaleString);
53 
57  virtual ~CYILocale();
58 
62  static const CYILocale &GetLocale();
63 
67  static void SetLocale(const CYILocale &rLocale);
68 
72  static const CYIString &CountryCodeAlpha3ToAlpha2(const CYIString &country);
73 
79  const CYIString &GetLanguageCode() const;
80 
86  const CYIString &GetCountryCode() const;
87 
96 
97 protected:
101 
102 private:
103  static CYILocale s_Locale;
104 };
105 
108 #endif // _YI_LOCALE_H_
static const CYIString & CountryCodeAlpha3ToAlpha2(const CYIString &country)
Container class for Unicode strings. Conceptually, a CYIString object is a sequence of Unicode charac...
Definition: YiString.h:36
CYIString ToString(LocaleStringFormat format=LocaleStringFormat::Concatenated) const
const CYIString & GetCountryCode() const
static const CYILocale & GetLocale()
virtual ~CYILocale()
CYIString m_CountryCode
Definition: YiLocale.h:99
LocaleStringFormat
Definition: YiLocale.h:26
const CYIString & GetLanguageCode() const
CYIString m_RawLocaleString
Definition: YiLocale.h:100
A class representing a locale.
Definition: YiLocale.h:20
CYIString m_LanguageCode
Definition: YiLocale.h:98
static void SetLocale(const CYILocale &rLocale)