Class TempLocale

Class Documentation

class TempLocale

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.

Public 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.

Parameters:
  • category – The LC_* category of the locale.

  • newLocale – The new (temporary) locale.

~TempLocale()