11 #ifndef ZYPP_BASE_LOCALEGUARD_H
12 #define ZYPP_BASE_LOCALEGUARD_H
34 LocaleGuard(
int category_r,
const std::string & value_r =
"C" )
37 const char * ovalue = ::setlocale( category_r,
nullptr );
38 if ( ovalue && ovalue != value_r )
42 ::setlocale(
_category, value_r.c_str() );
66 #endif // ZYPP_BASE_LOCALEGUARD_H
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.
NON_COPYABLE(LocaleGuard)
std::string _value
saved category value
Temorarily change a locale category value.
int _category
saved category or -1 if no restore needed
void restore()
immediately restore the saved locale category value.