Fennel: /home/pub/open/dev/fennel/common/Locale.h Source File (original) (raw)

00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023 #ifndef Fennel_Locale_Included 00024 #define Fennel_Locale_Included 00025 00026 #include 00027 #include 00028 00029 FENNEL_BEGIN_NAMESPACE 00030 00031 00032 00033 00034 00035 00036 00037 00038 00039 00040 class FENNEL_COMMON_EXPORT Locale 00041 { 00042 public: 00043 explicit Locale(const std::string &language); 00044 explicit Locale(const std::string &language, const std::string &country); 00045 explicit Locale( 00046 const std::string &language,const std::string &country, 00047 const std::string &variant); 00048 virtual ~Locale(); 00049 00050 bool operator==(const Locale &rhs) const; 00051 bool operator!=(const Locale &rhs) const; 00052 bool operator<(const Locale &rhs) const; 00053 00054 const std::string &getLanguage() const; 00055 const std::string &getCountry() const; 00056 const std::string &getVariant() const; 00057 00058
00059
00060 std::string getDisplayName() const; 00061 00062 bool hasParentLocale() const; 00063 Locale getParentLocale() const; 00064 00065 static const Locale &getDefault(); 00066 static void setDefault(const Locale &locale); 00067 00068 00069 00070 private: 00071 std::string _lang; 00072 std::string _country; 00073 std::string _variant; 00074 00075 static Locale DEFAULT; 00076 }; 00077 00078 00079 std::ostream &operator<<(std::ostream &str, const Locale &loc); 00080 00081 FENNEL_END_NAMESPACE 00082 00083 #endif // not Fennel_Locale_Included 00084 00085