Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef LocaleH
00033 #define LocaleH
00034
00035 #include <zeusbase/System/ZObject.h>
00036 #include <zeusbase/System/Stack.hpp>
00037
00038 BEGIN_NAMESPACE_Zeus
00039
00040
00044
00045 zeusbase_class TLocale : public TZObject
00046 {
00047 public:
00048 TLocale();
00049 TLocale(const IString& rLanguage);
00050 TLocale(const IString& rLanguage, const IString& rCountry);
00051 TLocale(const IString& rLanguage, const IString& rCountry, const IString& rVariant);
00052 TLocale(TString strLanguage, TString strCountry = L"", TString strVariant = L"");
00053 TLocale(const TLocale& rLocale);
00054
00055 virtual ~TLocale();
00056
00057 TString getCountry() const;
00058 TString getLanguage() const;
00059 TString getVariant() const;
00060
00061 TString toString() const;
00062
00063
00064 static const TLocale& getDefault();
00065 static void setDefault(const TLocale& rLocale);
00066 static Retval activateTemporaryLocale(const TLocale& rLocale);
00067 static void deactivateTemporaryLocale();
00068
00069
00070 TLocale& operator=(const TLocale& rLocale);
00071 bool operator==(const TLocale& rLocale) const;
00072
00073 protected:
00074
00075 private:
00076
00077
00078 #ifndef _MSC_VER
00079
00080 static TStack<TLocale> m_lstBackup;
00081 #endif
00082
00084 static TLocale m_DefaultLocale;
00085
00087 TString m_strLanguage;
00089 TString m_strCountry;
00091 TString m_strVariant;
00092
00093 void initObject_internal(const IString& rLanguage, const IString& rCountry, const IString& rVariant);
00094 static Retval activateLocale_internal(const TLocale* pLocale);
00095
00097
00098 #ifdef _MSC_VER
00099 public:
00100 #endif
00101
00102
00103 };
00104
00105
00107
00108 #if defined(_MSC_VER)
00109 struct TypeLocaleMSCBugFix
00110 {
00112 static TStack<TLocale> m_lstBackup;
00113 };
00114 #endif
00115
00116
00117
00118
00121
00122 inline TString TLocale::getCountry() const
00123 {
00124 return m_strCountry;
00125 }
00126
00127
00130
00131 inline TString TLocale::getLanguage() const
00132 {
00133 return m_strLanguage;
00134 }
00135
00136
00139
00140 inline TString TLocale::getVariant() const
00141 {
00142 return m_strVariant;
00143 }
00144
00145 END_NAMESPACE_Zeus
00146
00147 #endif