Tools.h++ Class Reference

Table Of Contents
Two implementations of RWLocale are provided with the library:
Class RWLocaleSnapshot encapsulates the Standard C library locale facility, with two
additional advantages: more than one locale can be active at the same time; and it
supports conversions from strings to other types.
There is also an internal class that mimics RWLocaleSnapshot("C"). If your compiler
does not have built-in support for locales, one is constructed automatically at program
startup to be used as the default value of RWLocale::global(). If your compiler does
support locales, RWLocale::global() returns a const reference to an instance of
RWLocaleSnapshot("C").
Persistence
None
Enumeration
enum
CurrSymbol { NONE, LOCAL, INTL };
Controls whether no currency symbol, the local currency symbol, or the international
currency symbol should be used to format currency.
Public Member Functions
virtual RWCString
asString(long) const = 0;
virtual RWCString
asString(unsigned long) const = 0;
Converts the number to a string (e.g., "3,456").
virtual RWCString
asString(double f, int precision = 6,
RWBoolean showpoint = 0) const = 0;
Converts the double f to a string. The variable precision is the number of digits to place
after the decimal separator. If showpoint is TRUE, the decimal separator will appear
regardless of the precision.
virtual RWCString
asString(const struct tm* tmbuf,char format,
const RWZone& zone) const = 0;
Converts components of the struct tm object to a string, according to the format
character. The meanings assigned to the format character are identical to those used in the
Standard C Library function strftime(). The members of struct tm are assumed to be set