11#ifndef ZYPP_BASE_ENV_H 
   12#define ZYPP_BASE_ENV_H 
   34      const char * v = ::getenv( var_r.
c_str() );
 
 
   63          if ( const char * orig = ::getenv( _var.c_str() ) )
 
   64            _val.reset( new std::string( orig ) );
 
 
   80          ::setenv( 
_var.c_str(), val_r, 1 );
 
   82          ::unsetenv( 
_var.c_str() );
 
 
   87      std::unique_ptr<std::string> 
_val;
 
 
 
Convenience char* constructible from std::string and char*, it maps (char*)0 to an empty string.
const char * c_str() const
Namespace intended to collect all environment variables we use.
TriBool getenvBool(const C_Str &var_r)
If the environment variable var_r is set to a legal true or false string return bool,...
TriBool strToTriBool(const C_Str &str)
Parse str into a bool if it's a legal true or false string; else indeterminate.
Easy-to use interface to the ZYPP dependency resolver.
boost::logic::tribool TriBool
3-state boolean logic (true, false and indeterminate).
ScopedSet(const ScopedSet &)=delete
ScopedSet & operator=(const ScopedSet &)=delete
void setval(const char *val_r)
ScopedSet(std::string var_r, const char *val_r)
Set var_r to val_r (unsets var_r if val_r is a nullptr).
ScopedSet()
Default ctor (NOOP).
ScopedSet & operator=(ScopedSet &&)=default
ScopedSet(ScopedSet &&)=default
std::unique_ptr< std::string > _val
~ScopedSet()
Restore the original setting.