Locale.h++
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 #ifndef __ccxx_Locale_hxx
00024 #define __ccxx_Locale_hxx
00025
00026 #include <commonc++/String.h++>
00027
00028 namespace ccxx {
00029
00035 class COMMONCPP_API Locale
00036 {
00037 public:
00038
00042 Locale(String language, String country = String::null,
00043 String variant = String::null);
00044
00046 ~Locale();
00047
00049 bool isValid() const throw();
00050
00052 String getEncoding() const;
00053
00055 String getAMAffix() const;
00056
00058 String getPMAffix() const;
00059
00064 String getWeekDayName(int day) const;
00065
00070 String getAbbreviatedWeekDayName(int day) const;
00071
00076 String getMonthName(int month) const;
00077
00082 String getAbbreviatedMonthName(int month) const;
00083
00085 String getRadixCharacter() const;
00086
00088 String getThousandsSeparator() const;
00089
00091 String getCurrencySymbol() const;
00092
00094 inline String getLanguage() const
00095 { return(_language); }
00096
00098 inline String getCountry() const
00099 { return(_country); }
00100
00102 inline String getVariant() const
00103 { return(_variant); }
00104
00106 inline String toString() const
00107 { return(_id); }
00108
00110 static String getCurrentEncoding();
00111
00113 static const Locale getCurrent();
00114
00116 static bool setCurrent(const Locale &locale);
00117
00119 static const Locale CANADA;
00121 static const Locale CANADA_FRENCH;
00123 static const Locale CHINA;
00125 static const Locale CHINESE;
00127 static const Locale ENGLISH;
00129 static const Locale FRANCE;
00131 static const Locale FRENCH;
00133 static const Locale GERMANY;
00135 static const Locale GERMAN;
00137 static const Locale ITALY;
00139 static const Locale ITALIAN;
00141 static const Locale JAPAN;
00143 static const Locale JAPANESE;
00145 static const Locale KOREA;
00147 static const Locale KOREAN;
00149 static const Locale SPANISH;
00151 static const Locale SIMPLIFIED_CHINESE;
00153 static const Locale TRADITIONAL_CHINESE;
00155 static const Locale TAIWAN;
00157 static const Locale UNITED_KINGDOM;
00159 static const Locale UNITED_STATES;
00160
00161 private:
00162
00163 #ifdef CCXX_OS_WINDOWS
00164 Locale(LCID locale);
00165 #endif
00166
00167 String _language;
00168 String _country;
00169 String _variant;
00170 String _id;
00171 #ifdef CCXX_OS_WINDOWS
00172 LCID _locale;
00173 #else
00174 void *_locale;
00175 #endif
00176 };
00177
00178 };
00179
00180 #endif // __ccxx_Locale_hxx