Fennel: Locale Class Reference (original) (raw)
#include <[Locale.h](Locale%5F8h-source.html)>
| Public Member Functions | |
|---|---|
| Locale (const std::string &language) | |
| Locale (const std::string &language, const std::string &country) | |
| Locale (const std::string &language, const std::string &country, const std::string &variant) | |
| virtual | ~Locale () |
| bool | operator== (const Locale &rhs) const |
| bool | operator!= (const Locale &rhs) const |
| bool | operator< (const Locale &rhs) const |
| const std::string & | getLanguage () const |
| const std::string & | getCountry () const |
| const std::string & | getVariant () const |
| std::string | getDisplayName () const |
| bool | hasParentLocale () const |
| Locale | getParentLocale () const |
| Static Public Member Functions | |
| static const Locale & | getDefault () |
| static void | setDefault (const Locale &locale) |
| Private Attributes | |
| std::string | _lang |
| std::string | _country |
| std::string | _variant |
| Static Private Attributes | |
| static Locale | DEFAULT |
Detailed Description
Definition at line 40 of file Locale.h.
Constructor & Destructor Documentation
| Locale::Locale | ( | const std::string & | language | ) | [explicit] |
|---|
| Locale::Locale | ( | const std::string & | language, |
|---|---|---|---|
| const std::string & | country | ||
| ) | [explicit] |
| Locale::Locale | ( | const std::string & | language, |
|---|---|---|---|
| const std::string & | country, | ||
| const std::string & | variant | ||
| ) | [explicit] |
| Locale::~Locale | ( | | ) | [virtual] | | ---------------- | - | | - | ----------- |
Member Function Documentation
| bool Locale::operator== | ( | const Locale & | rhs | ) | const |
|---|
| bool Locale::operator!= | ( | const Locale & | rhs | ) | const |
|---|
| bool Locale::operator< | ( | const Locale & | rhs | ) | const |
|---|
Definition at line 89 of file Locale.cpp.
References getCountry(), getLanguage(), and getVariant().
00090 {
00091 int langCmp = this->getLanguage().compare(rhs.getLanguage());
00092 if (langCmp < 0) {
00093 return true;
00094 }
00095 if (langCmp > 0) {
00096 return false;
00097 }
00098
00099
00100 int countryCmp = this->getCountry().compare(rhs.getCountry());
00101 if (countryCmp < 0) {
00102 return true;
00103 }
00104 if (countryCmp > 0) {
00105 return false;
00106 }
00107
00108
00109 int variantCmp = this->getVariant().compare(rhs.getVariant());
00110 if (variantCmp < 0) {
00111 return true;
00112 }
00113 return false;
00114 }
| const string & Locale::getLanguage | ( | | ) | const | | ---------------------------------- | - | | - | ----- |
| const string & Locale::getCountry | ( | | ) | const | | --------------------------------- | - | | - | ----- |
| const string & Locale::getVariant | ( | | ) | const | | --------------------------------- | - | | - | ----- |
| string Locale::getDisplayName | ( | | ) | const | | ----------------------------- | - | | - | ----- |
| bool Locale::hasParentLocale | ( | | ) | const | | ---------------------------- | - | | - | ----- |
| Locale Locale::getParentLocale | ( | | ) | const | | -------------------------------------------------- | - | | - | ----- |
| const Locale & Locale::getDefault | ( | | ) | [static] | | ----------------------------------------------------- | - | | - | ---------- |
| void Locale::setDefault | ( | const Locale & | locale | ) | [static] |
|---|
Member Data Documentation
The documentation for this class was generated from the following files:
- /home/pub/open/dev/fennel/common/Locale.h
- /home/pub/open/dev/fennel/common/Locale.cpp
