libzypp: zypp::env::ScopedSet Class Reference

libzypp 17.38.15

zypp::env::ScopedSet Class Reference
RAII solutions

Temporarily set/unset an environment variable. More...

`#include <zypp-core/base/Env.h>`

Inheritance diagram for zypp::env::ScopedSet:

## Public Member Functions
| ScopedSet (const ScopedSet &)=delete
ScopedSet & | operator= (const ScopedSet &)=delete
| ScopedSet (ScopedSet &&)=default
ScopedSet & | operator= (ScopedSet &&)=default
| ScopedSet ()
| Default ctor (NOOP).
| 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 ()
| Restore the original setting.

## Private Member Functions
void | setval (const char *val_r)

## Private Attributes
std::string | _var
std::unique_ptr< std::string > | _val

## Detailed Description

Temporarily set/unset an environment variable.

Definition at line 44 of file Env.h.

## Constructor & Destructor Documentation

## ◆ ScopedSet() [1/4]

zypp::env::ScopedSet::ScopedSet | ( | const ScopedSet & |  | ) |
| delete

## ◆ ScopedSet() [2/4]

zypp::env::ScopedSet::ScopedSet | ( | ScopedSet && |  | ) |
| default

## ◆ ScopedSet() [3/4]

zypp::env::ScopedSet::ScopedSet | ( |  | ) |
| inline

Default ctor (NOOP).

Definition at line 54 of file Env.h.

## ◆ ScopedSet() [4/4]

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 58 of file Env.h.

## ◆ ~ScopedSet()

zypp::env::ScopedSet::~ScopedSet | ( |  | ) |
| inline

Restore the original setting.

Definition at line 70 of file Env.h.

## Member Function Documentation

## ◆ operator=() [1/2]

ScopedSet & zypp::env::ScopedSet::operator= | ( | const ScopedSet & |  | ) |
| delete

## ◆ operator=() [2/2]

ScopedSet & zypp::env::ScopedSet::operator= | ( | ScopedSet && |  | ) |
| default

## ◆ setval()

void zypp::env::ScopedSet::setval | ( | const char * | val_r | ) |
| inlineprivate

Definition at line 77 of file Env.h.

## Member Data Documentation

## ◆ _var

std::string zypp::env::ScopedSet::_var
| private

Definition at line 86 of file Env.h.

## ◆ _val

std::unique_ptr<std::string> zypp::env::ScopedSet::_val
| private

Definition at line 87 of file Env.h.

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

- zypp-core/base/Env.h