Localization helper. More...
#include <Qtx.h>
Public Member Functions | |
| Localizer () | |
| Constructor. Forces "C" locale to be set. | |
| ~Localizer () | |
| Destructor. Reverts back to the initial locale. | |
Private Attributes | |
| QString | myCurLocale |
This helper class can be used to solve the localization problems, usually related to the textual files reading/writing, namely when floating point values are read / written with API functions. The problem relates to such locale specific settings as decimal point separator, thousands separator, etc.
To use the Localizer class, just create a local variable in the beginning of the code where you need to read / write data from textual file(s). The constructor of the class forces setting "C" locale temporariy. The destructor switches back to the initial locale.
Qtx::Localizer loc; readSomething(); writeSomething();
| Qtx.Localizer::Localizer | ( | ) |
References Qtx.Localizer.myCurLocale.
| Qtx.Localizer::~Localizer | ( | ) |
QString Qtx.Localizer.myCurLocale [private] |