Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

Core::Locale Class Reference

#include <Locale.h>

Inheritance diagram for Core::Locale:

Inheritance graph
[legend]
Collaboration diagram for Core::Locale:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual StringclassName (void) const
 Answer receiver class name.
virtual CharacterdecimalPoint (void)
virtual Stringencoding (void)

Static Public Member Functions

static Localecurrent (void)

Protected Member Functions

 Locale (locale_t cLocale)

Protected Attributes

locale_t locale_def

Static Protected Attributes

static Locale_current = nil

Constructor & Destructor Documentation

Core::Locale::Locale locale_t  cLocale  )  [protected]
 

Definition at line 35 of file Locale.cc.

References locale_def.

Referenced by current().

00036 {
00037     locale_def = cLocale;
00038 }


Member Function Documentation

String * Core::Locale::className void   )  const [virtual]
 

Answer receiver class name.

Because there isn't any standard way to obtain class name this method comes to place.

Every class should rewrite this method but many didn't (yet).

Reimplemented from Core::Object.

Definition at line 53 of file Locale.cc.

00054 {
00055     return new String("Locale");
00056 }

Locale * Core::Locale::current void   )  [static]
 

Definition at line 41 of file Locale.cc.

References _current, Locale(), and nil.

Referenced by Core::EncodedStreamFactory::EncodedStreamFactory(), and Core::Number::fromStringRadix().

00042 {
00043     if (_current == nil) {
00044         /* In case the requested locale doesn't exist, setlocale
00045          * (and newlocale respectively) returns NULL.
00046          */
00047         _current = new Locale(newlocale(LC_ALL_MASK, setlocale(LC_ALL, ""), NULL));
00048     }
00049     return _current;
00050 }

Character * Core::Locale::decimalPoint void   )  [virtual]
 

Definition at line 59 of file Locale.cc.

References locale_def, and Core::Character::value().

00060 {
00061     if (locale_def == NULL) return Character::value('.');
00062     return Character::value(nl_langinfo_l(DECIMAL_POINT, locale_def)[0]);
00063 }

String * Core::Locale::encoding void   )  [virtual]
 

Definition at line 65 of file Locale.cc.

References locale_def.

00066 {
00067     if (locale_def == NULL) return new String("ISO-8859-1");
00068     return new String(nl_langinfo_l(CODESET, locale_def));
00069 }


Member Data Documentation

Locale * Core::Locale::_current = nil [static, protected]
 

Definition at line 33 of file Locale.cc.

Referenced by current().

locale_t Core::Locale::locale_def [protected]
 

Definition at line 40 of file Locale.h.

Referenced by decimalPoint(), encoding(), and Locale().


The documentation for this class was generated from the following files:
Generated on Mon Nov 27 09:51:42 2006 for Smalltalk like C++ Class Library by  doxygen 1.4.2