Public Member Functions | Private Attributes | List of all members
cras::TempLocale Class Reference

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

Detailed Description

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.

Constructor & Destructor Documentation

◆ TempLocale()

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.

Parameters
categoryThe LC_* category of the locale.
newLocaleThe new (temporary) locale.

◆ ~TempLocale()

cras::TempLocale::~TempLocale ( )

Member Data Documentation

◆ category

int cras::TempLocale::category
private

The category of the locale.

Definition at line 974 of file string_utils.hpp.

◆ oldLocale

const char* cras::TempLocale::oldLocale
private

The previous locale.

Definition at line 975 of file string_utils.hpp.


The documentation for this class was generated from the following file:


cras_cpp_common
Author(s): Martin Pecka
autogenerated on Tue Nov 26 2024 03:49:04