LocaleWrap Class Reference

List of all members.

Public Member Functions

 LocaleWrap (int category, const char *locale_string)
 See the C function setlocale() for an explanation of the arguments.

Protected Attributes

std::string m_old_locale

Detailed Description

The locale might be set to something strange, ala European. that interprets '.' as ',' and vice versa. That terribly breaks VTP's usage of printf/sscanf/atof to encode and parse numbers.

This handy class encapsulates overriding the locale. Use it like this for 'standard' numbers:

Example:
        LocaleWrap normal_numbers(LC_NUMERIC, "C");
The locale will be restored when the LocaleWrap object goes out of scope.


Generated on Tue Apr 22 10:10:59 2008 for vtdata library by  doxygen 1.4.5