Tools.h++ Class Reference

Table Of Contents
information.
Class RWLocaleSnapshot has a set of public data members initialized by its constructor with
information extracted from its execution environment.
Persistence
None
Example
Try this program with the environmental variable LANG set to various locales:
#include <rw/rwdate.h>
#include <rw/locale.h>
#include <iostream.h>
main(){
RWLocaleSnapshot *userLocale = new RWLocaleSnapshot("");
RWLocale::global(userLocale);
// Print a number using the global locale:
cout << RWLocale::global().asString(1234567.6543) << endl;
// Now get and print a date:
cout << "enter a date: " << flush;
RWDate date;
cin >> date;
if (date.isValid())
cout << date << endl;
else
cout << "bad date" << endl;
delete userLocale;
return 0;
}
Enumerations
enum
RWDateOrder { DMY, MDY, YDM, YMD };
Public Constructor
RWLocaleSnapshot(const char* localeName = 0);
Constructs an RWLocale object by extracting formats from the global locale
environment. It uses the Standard C Library function setlocale() to set the named locale,
and then restores the previous global locale after formats have been extracted. If