libzypp 17.31.23
zypp::LocaleGuard Class Reference

Temorarily change a locale category value. More...

#include <base/LocaleGuard.h>

Public Member Functions

 LocaleGuard (int category_r, const std::string &value_r="C")
 Ctor saving the current locale category value.
 
 ~LocaleGuard ()
 Dtor asserts the saved locale category value is restored.
 
void restore ()
 immediately restore the saved locale category value.
 

Private Member Functions

 NON_COPYABLE (LocaleGuard)
 
 NON_MOVABLE (LocaleGuard)
 

Private Attributes

int _category
 saved category or -1 if no restore needed
 
std::string _value
 saved category value
 

Detailed Description

Temorarily change a locale category value.

Definition at line 27 of file LocaleGuard.h.

Constructor & Destructor Documentation

◆ LocaleGuard()

zypp::LocaleGuard::LocaleGuard ( int  category_r,
const std::string &  value_r = "C" 
)
inline

Ctor saving the current locale category value.

Definition at line 34 of file LocaleGuard.h.

◆ ~LocaleGuard()

zypp::LocaleGuard::~LocaleGuard ( )
inline

Dtor asserts the saved locale category value is restored.

Definition at line 47 of file LocaleGuard.h.

Member Function Documentation

◆ NON_COPYABLE()

zypp::LocaleGuard::NON_COPYABLE ( LocaleGuard  )
private

◆ NON_MOVABLE()

zypp::LocaleGuard::NON_MOVABLE ( LocaleGuard  )
private

◆ restore()

void zypp::LocaleGuard::restore ( )
inline

immediately restore the saved locale category value.

Definition at line 51 of file LocaleGuard.h.

Member Data Documentation

◆ _category

int zypp::LocaleGuard::_category
private

saved category or -1 if no restore needed

Definition at line 61 of file LocaleGuard.h.

◆ _value

std::string zypp::LocaleGuard::_value
private

saved category value

Definition at line 62 of file LocaleGuard.h.


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