Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Hydra Core Library Reference Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

rwsf::Locale

Group:  General

Local Index

Members

Header File

#include <rwsf/core/Locale.h>

Description

rwsf::Locale is an abstract base class. It defines an interface that formats the conversion of strings to and from dates and times. It formats dates (including day and month names), times, currency, and numbers (including digit grouping).

Note that because it is an abstract base class, there is no way to actually enforce these goals -- the description here is merely the model of how a class derived from rwsf::Locale should act.

There are three ways to use an rwsf::Locale object:

The library provides rwsf::LocaleSnapshot, a subclass and implementation of rwsf::Locale. This subclass allows more than one locale to be active at a time, and also supports conversion from strings to other types.

Enumeration

enum 
CurrSymbol { NONE, LOCAL, INTL };

Public Member Functions

virtual std::string
asString(long) const = 0;
virtual std::string
asString(unsigned long) const = 0;
virtual std::string
asString(double, int = 6,
     bool = 0) const = 0;
virtual std::string 
asString(const struct tm*, char, const rwsf::TimeZone& = rwsf::TimeZone::
local()) const = 0;
std::string
asString(const struct tm*, const char*, 
     const rwsf::TimeZone& = rwsf::TimeZone::
local()) const;
virtual std::string 
moneyAsString(double, CurrSymbol = LOCAL) const = 0; virtual std::string
moneyAsString(double, Locale::CurrSymbol = LOCAL) const = 0;
virtual int
monthIndex(const std::string&) const = 0;
virtual bool
stringToDate(const std::string&, struct tm*) const = 0;
virtual bool 
stringToMoney(const std::string&, double*,
CurrSymbol=LOCAL) const = 0;
virtual bool
stringToNum(const std::string&, double* fp) const = 0;
virtual bool
stringToNum(const std::string&, long* ip) const = 0;
virtual bool 
stringToNum (const std::string&, unsigned long*) const = 0;

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 bool
stringToTime(const std::string&, struct tm*) const = 0;
virtual int
monthIndex(const std::string&) const = 0;
virtual int
weekdayIndex(const std::string&) const = 0;

Static Public Member Functions

static const Locale*
defaultLocale();
static const Locale*
global(const Locale* loc);
static const Locale&
global();
static void 
releaseCache();


Previous fileTop of DocumentContentsIndex pageNext file

©2004-2007 Copyright Quovadx, Inc. All Rights Reserved.
Quovadx and Rogue Wave are registered trademarks and HydraSDO is a trademark of Quovadx, 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.