Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Essential Tools Module Reference Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

RWAnsiLocale

Module:  Essential Tools Module   Group:  Internationalization Classes


RWAnsiLocaleRWLocale

Local Index

Members

Synopsis

Description

RWAnsiLocale implements the RWLocale interface. It encapsulates the C++ Standard Library locale, std::locale and adds functionality for date and time conversions. The C++ Standard Library locale provides localized representations of dates, numbers, and currencies. RWAnsiLocale offers a simple interface to std::locale so you can avoid working directly with std::locale facets. Additionally, RWAnsiLocale provides flexible conversions of strings to dates and times. While the C++ Standard Library locale accepts dates and times only in formats defined by the Standard C Library function strftime(), RWAnsiLocale accepts multiple date and time formats.

There are three ways to use an RWAnsiLocale object:

For a description of the static members of the RWLocale interface that operate on objects of type RWAnsiLocale, see the RWLocale class description.


NOTE -- For both RWAnsiLocale and std::locale, the default global locale is the locale defined in the Standard C Library file <locale.h>.

Persistence

None

Example

Program output (actual output will depend on the time the example is run, and on the platform):

Enumerations

enum RWDateOrder {do_dmy, do_mdy, do_ydm, do_ymd };
enum CurrSymbol { NONE, LOCAL, INTL };
enum part   { none, space. symbol, sign, };

Public Typedefs

typedef std::money_base::pattern pattern;

Public Constructors

RWAnsiLocale(const char* localeName = 0);
RWAnsiLocale(const std::locale& loc)
RWAnsiLocale(const RWAnsiLocale& loc)

Public Destructor

virtual ~RWAnsiLocale();

Public Member Functions

virtual RWCString
asString(long) const;
virtual RWCString
asString(unsigned long) const;
virtual RWCString
asString(double f, int precision = 6,
         bool showpoint = false) const;
virtual RWCString 
asString(long double val, int precision = 10, 
         bool showpoint = 0) const;
virtual RWCString
asString(const struct tm* tmbuf,char format, 
         const RWZone& zone=RWZone::local()) const;
virtual RWCString
asString(const struct tm* tmbuf,const char* format, 
         const RWZone& zone=RWZone::local()) const;
virtual RWCString 
currency_symbol() const
virtual char 
decimal_point() const

NOTE -- If you are using the C locale, you must omit commas as thousands separators. Because the default locale is likely to be C for many English-speaking programmers, numbers with commas separating the thousands may be rejected. This is true even in a locale where English is the dominant language.
virtual char 
frac_digits() const
virtual RWCString 
grouping() const
RWAnsiLocale
imbue(std::ios& stream);
virtual RWCString 
int_curr_symbol() const
virtual char 
int_frac_digits() const
virtual pattern 
int_neg_format() const
virtual pattern 
int_pos_format() const
virtual RWCString 
locale_name() const
virtual char 
mon_decimal_point() const
virtual RWCString
moneyAsString(long double value,
              RWAnsiLocale::CurrSymbol=LOCAL) const;
virtual RWCString 
mon_grouping() const
virtual int
monthIndex(const RWCString&) const = 0;
virtual RWCString 
mon_thousands_sep() const
virtual char 
n_cs_precedes() const
virtual char 
n_sep_by_space() const
virtual char 
n_sign_posn() const
virtual RWCString 
negative_sign() const
virtual pattern 
neg_format() const
virtual pattern 
pos_format() const
virtual char 
p_cs_precedes() const
virtual char 
p_sep_by_space() const
virtual char 
p_sign_posn() const
virtual RWCString 
positive_sign() const
virtual std::locale*
std()
virtual bool
stringToDate(const RWCString&, struct tm*) const;
virtual bool
stringToMoney(const RWCString&, double*,
              RWAnsiLocale::CurrSymbol=LOCAL) const;
virtual bool
stringToNum(const RWCString&, double* fp) const;
virtual bool
stringToNum(const RWCString&, long* ip) const;
virtual bool 
stringToNum (const RWCString&, unsigned long*) const;
virtual bool
stringToTime(const RWCString&,struct tm*) const;
virtual char 
thousands_sep() const
virtual int
weekdayIndex(const RWCString&) const = 0;


Previous fileTop of DocumentContentsIndex pageNext file

© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.