Helper class for temporarily setting locale in a RAII manner. More...
#include <string_utils.hpp>
Public Member Functions | |
TempLocale (int category, const char *newLocale) | |
By creating this object on stack, you change the locale to the given one until the object goes out of scope. More... | |
~TempLocale () | |
Private Attributes | |
int | category |
The category of the locale. More... | |
const char * | oldLocale |
The previous locale. More... | |
Helper class for temporarily setting locale in a RAII manner.
Just create this object on stack and it will change the configured locale. When the object goes out of scope, the previous locale will be set again.
Definition at line 962 of file string_utils.hpp.
cras::TempLocale::TempLocale | ( | int | category, |
const char * | newLocale | ||
) |
By creating this object on stack, you change the locale to the given one until the object goes out of scope.
category | The LC_* category of the locale. |
newLocale | The new (temporary) locale. |
cras::TempLocale::~TempLocale | ( | ) |
|
private |
The category of the locale.
Definition at line 974 of file string_utils.hpp.
|
private |
The previous locale.
Definition at line 975 of file string_utils.hpp.