#include <CeylanLocale.h>
Public Types | |
enum | TextOutputFormat { rawText, html } |
Defines what text output formats for TextDisplayable instances are available. More... | |
Public Member Functions | |
LocalizationSettings () | |
Constructs an instance to localization settings. | |
virtual | ~LocalizationSettings () throw () |
Virtual destructor. | |
virtual void | addSupportedLocale (LocaleCode code) |
Adds a new supported locale. | |
virtual void | addSupportedLocale (const std::string &localeName) |
Adds a new supported locale. | |
virtual bool | isSupported (LocaleCode code) |
Returns true iff the locale corresponding to specified code is supported. | |
virtual bool | isSupported (const std::string &localeName) |
Returns true iff the specified locale is supported. | |
virtual const std::list < LocaleCode > & | getSupportedLocales () const |
Returns the list of the codes of all supported locales. | |
virtual bool | hasCurrentLocale () const |
Returns true iff a current locale is set. | |
virtual LocaleCode | getCurrentLocaleCode () const |
Returns the code of the current locale in use. | |
virtual const std::string & | getCurrentLocaleName () const |
Returns the name of the current locale in use. | |
virtual void | setCurrentLocale (LocaleCode code) |
Sets the current locale from its code. | |
virtual void | setCurrentLocale (const std::string &localeName) |
Sets the current locale from its name. | |
virtual const std::string | toString (VerbosityLevels level=high) const |
Returns a user-friendly description of the state of this object. | |
Static Public Member Functions | |
static bool | IsAKnownLocale (const std::string &localeName) |
Returns true iff the specified locale name is a known locale. | |
static LocaleCode | GetLocaleCodeFromName (const std::string &localeName) |
Returns the locale code corresponding to the specified locale name. | |
static const std::string & | GetLocaleNameFromCode (LocaleCode code) |
Returns the locale name corresponding to the specified locale code. | |
static const std::string | ToString (std::list< TextDisplayable * > displayables, Ceylan::VerbosityLevels level=Ceylan::high) |
Returns a user-friendly description of this list of pointers to text displayable instances. | |
static TextOutputFormat | GetOutputFormat () |
Returns the current overall text format to be used by TextDisplayable instances. | |
static void | SetOutputFormat (TextOutputFormat newOutputFormat) |
Sets the current overall text format to be used by TextDisplayable instances. | |
Static Public Attributes | |
static const LocaleCode | EnglishLocale = 1 |
static const LocaleCode | FrenchLocale = 2 |
static const LocaleCode | GermanLocale = 3 |
Protected Attributes | |
std::list< LocaleCode > | _supportedLocales |
The list of supported locales. | |
LocaleCode | _currentLocale |
The current locale in use. | |
Static Protected Attributes | |
static TextOutputFormat | _OutputFormat = rawText |
The text format to be used currently by TextDisplayable instances. | |
Private Member Functions | |
LocalizationSettings (const LocalizationSettings &source) | |
Copy constructor made private to ensure that it will be never called. | |
LocalizationSettings & | operator= (const LocalizationSettings &source) |
Assignment operator made private to ensure that it will be never called. |
Definition at line 63 of file CeylanLocale.h.
enum Ceylan::TextDisplayable::TextOutputFormat [inherited] |
Defines what text output formats for TextDisplayable instances are available.
Definition at line 124 of file CeylanTextDisplayable.h.
LocalizationSettings::LocalizationSettings | ( | ) | [explicit] |
LocalizationSettings::~LocalizationSettings | ( | ) | throw () [virtual] |
Ceylan::LocalizationSettings::LocalizationSettings | ( | const LocalizationSettings & | source | ) | [private] |
Copy constructor made private to ensure that it will be never called.
The compiler should complain whenever this undefined operator is called, implicitly or not.
void LocalizationSettings::addSupportedLocale | ( | const std::string & | localeName | ) | [virtual] |
Adds a new supported locale.
LocalizationException | if the locale is not a known one. |
Definition at line 99 of file CeylanLocale.cc.
References addSupportedLocale(), GetLocaleCodeFromName(), and IsAKnownLocale().
void LocalizationSettings::addSupportedLocale | ( | LocaleCode | code | ) | [virtual] |
Adds a new supported locale.
LocalizationException | if the locale is not a known one. |
Definition at line 88 of file CeylanLocale.cc.
References _supportedLocales, and isSupported().
Referenced by addSupportedLocale().
LocaleCode LocalizationSettings::getCurrentLocaleCode | ( | ) | const [virtual] |
Returns the code of the current locale in use.
LocalizationException | if none is set. |
Definition at line 154 of file CeylanLocale.cc.
References _currentLocale.
Referenced by getCurrentLocaleName().
const std::string & LocalizationSettings::getCurrentLocaleName | ( | ) | const [virtual] |
Returns the name of the current locale in use.
LocalizationException | if none is set. |
Definition at line 167 of file CeylanLocale.cc.
References getCurrentLocaleCode(), and GetLocaleNameFromCode().
Referenced by toString().
LocaleCode LocalizationSettings::GetLocaleCodeFromName | ( | const std::string & | localeName | ) | [static] |
Returns the locale code corresponding to the specified locale name.
LocalizationException | if the locale name does not correspond to any known locale. |
Definition at line 240 of file CeylanLocale.cc.
References EnglishLocale, EnglishLocaleName, FrenchLocale, FrenchLocaleName, GermanLocale, and GermanLocaleName.
Referenced by addSupportedLocale(), isSupported(), and setCurrentLocale().
const std::string & LocalizationSettings::GetLocaleNameFromCode | ( | LocaleCode | code | ) | [static] |
Returns the locale name corresponding to the specified locale code.
LocalizationException | if the locale code does not correspond to any known locale. |
Definition at line 261 of file CeylanLocale.cc.
References EnglishLocale, EnglishLocaleName, FrenchLocale, FrenchLocaleName, GermanLocale, GermanLocaleName, and Ceylan::toString().
Referenced by getCurrentLocaleName(), and toString().
TextDisplayable::TextOutputFormat TextDisplayable::GetOutputFormat | ( | ) | [static, inherited] |
Returns the current overall text format to be used by TextDisplayable instances.
Definition at line 63 of file CeylanTextDisplayable.cc.
References Ceylan::TextDisplayable::_OutputFormat.
Referenced by Ceylan::formatStringList(), Ceylan::formatStringMap(), Ceylan::XML::XMLMarkup::toString(), Ceylan::Maths::Linear::Vector3::toString(), Ceylan::Maths::Linear::Vector2::toString(), Ceylan::Maths::Linear::Tripoint::toString(), Ceylan::Module::toString(), Ceylan::Maths::Linear::Matrix3::toString(), Ceylan::Maths::Linear::Matrix2::toString(), Ceylan::Maths::Linear::HomogeneousMatrix3::toString(), and Ceylan::Maths::Linear::Bipoint::toString().
const std::list< LocaleCode > & LocalizationSettings::getSupportedLocales | ( | ) | const [virtual] |
Returns the list of the codes of all supported locales.
Definition at line 136 of file CeylanLocale.cc.
References _supportedLocales.
bool LocalizationSettings::hasCurrentLocale | ( | ) | const [virtual] |
Returns true iff a current locale is set.
Definition at line 145 of file CeylanLocale.cc.
References _currentLocale.
Referenced by toString().
bool LocalizationSettings::IsAKnownLocale | ( | const std::string & | localeName | ) | [static] |
Returns true iff the specified locale name is a known locale.
Definition at line 225 of file CeylanLocale.cc.
References generalUtils::false, and generalUtils::true.
Referenced by addSupportedLocale(), and isSupported().
bool LocalizationSettings::isSupported | ( | const std::string & | localeName | ) | [virtual] |
Returns true iff the specified locale is supported.
Definition at line 123 of file CeylanLocale.cc.
References generalUtils::false, GetLocaleCodeFromName(), IsAKnownLocale(), and isSupported().
bool LocalizationSettings::isSupported | ( | LocaleCode | code | ) | [virtual] |
Returns true iff the locale corresponding to specified code is supported.
Definition at line 113 of file CeylanLocale.cc.
References _supportedLocales.
Referenced by addSupportedLocale(), isSupported(), and setCurrentLocale().
LocalizationSettings& Ceylan::LocalizationSettings::operator= | ( | const LocalizationSettings & | source | ) | [private] |
Assignment operator made private to ensure that it will be never called.
The compiler should complain whenever this undefined operator is called, implicitly or not.
void LocalizationSettings::setCurrentLocale | ( | const std::string & | localeName | ) | [virtual] |
Sets the current locale from its name.
LocalizationException | if the operation failed. |
Definition at line 190 of file CeylanLocale.cc.
References GetLocaleCodeFromName(), and setCurrentLocale().
void LocalizationSettings::setCurrentLocale | ( | LocaleCode | code | ) | [virtual] |
Sets the current locale from its code.
LocalizationException | if the operation failed. |
Definition at line 176 of file CeylanLocale.cc.
References _currentLocale, isSupported(), and Ceylan::toString().
Referenced by setCurrentLocale().
void TextDisplayable::SetOutputFormat | ( | TextOutputFormat | newOutputFormat | ) | [static, inherited] |
Sets the current overall text format to be used by TextDisplayable instances.
newOutputFormat | the new output format. |
Definition at line 72 of file CeylanTextDisplayable.cc.
References Ceylan::TextDisplayable::_OutputFormat.
Referenced by Ceylan::Log::LogHolder::LogHolder().
const std::string TextDisplayable::ToString | ( | std::list< TextDisplayable * > | displayables, | |
Ceylan::VerbosityLevels | level = Ceylan::high | |||
) | [static, inherited] |
Returns a user-friendly description of this list of pointers to text displayable instances.
displayables | a list of pointers to TextDisplayable instances/ | |
level | the requested verbosity level. |
Definition at line 45 of file CeylanTextDisplayable.cc.
References Ceylan::formatStringList().
const std::string LocalizationSettings::toString | ( | VerbosityLevels | level = high |
) | const [virtual] |
Returns a user-friendly description of the state of this object.
level | the requested verbosity level. |
Implements Ceylan::TextDisplayable.
Definition at line 199 of file CeylanLocale.cc.
References _supportedLocales, Ceylan::formatStringList(), getCurrentLocaleName(), GetLocaleNameFromCode(), and hasCurrentLocale().
The current locale in use.
Definition at line 244 of file CeylanLocale.h.
Referenced by getCurrentLocaleCode(), hasCurrentLocale(), and setCurrentLocale().
TextDisplayable::TextOutputFormat TextDisplayable::_OutputFormat = rawText [static, protected, inherited] |
The text format to be used currently by TextDisplayable instances.
Definition at line 158 of file CeylanTextDisplayable.h.
Referenced by Ceylan::TextDisplayable::GetOutputFormat(), and Ceylan::TextDisplayable::SetOutputFormat().
std::list<LocaleCode> Ceylan::LocalizationSettings::_supportedLocales [protected] |
The list of supported locales.
Definition at line 240 of file CeylanLocale.h.
Referenced by addSupportedLocale(), getSupportedLocales(), isSupported(), and toString().
const Ceylan::LocaleCode LocalizationSettings::EnglishLocale = 1 [static] |
Definition at line 229 of file CeylanLocale.h.
Referenced by GetLocaleCodeFromName(), and GetLocaleNameFromCode().
const Ceylan::LocaleCode LocalizationSettings::FrenchLocale = 2 [static] |
Definition at line 230 of file CeylanLocale.h.
Referenced by GetLocaleCodeFromName(), and GetLocaleNameFromCode().
const Ceylan::LocaleCode LocalizationSettings::GermanLocale = 3 [static] |
Definition at line 231 of file CeylanLocale.h.
Referenced by GetLocaleCodeFromName(), and GetLocaleNameFromCode().