Temporarily set/unset an environment variable.
More...
#include <Env.h>
|
| std::unique_ptr< std::string > | _val |
| |
Temporarily set/unset an environment variable.
Definition at line 28 of file Env.h.
| zypp::env::ScopedSet::ScopedSet |
( |
const ScopedSet & |
| ) |
|
|
delete |
| zypp::env::ScopedSet::ScopedSet |
( |
ScopedSet && |
| ) |
|
|
default |
| zypp::env::ScopedSet::ScopedSet |
( |
| ) |
|
|
inline |
Default ctor (NOOP).
Definition at line 38 of file Env.h.
| zypp::env::ScopedSet::ScopedSet |
( |
std::string |
var_r, |
|
|
const char * |
val_r |
|
) |
| |
|
inline |
Set var_r to val_r (unsets var_r if val_r is a nullptr).
Definition at line 42 of file Env.h.
| std::unique_ptr<std::string> zypp::env::ScopedSet::_val |
Initial value:{
if ( !_var.empty() )
{
if ( const char * orig = ::getenv( _var.c_str() ) )
_val.reset(
new std::string( orig ) );
setval( val_r );
}
}
{
if ( !_var.empty() )
}
private:
void setval( const char * val_r )
{
if ( val_r )
::setenv( _var.c_str(), val_r, 1 );
else
::unsetenv( _var.c_str() );
}
private:
std::string _var
Definition at line 44 of file Env.h.
The documentation for this class was generated from the following file: