Environment variables representation.
More...
#include <userver/engine/subprocess/environment_variables.hpp>
|
using | Map = EnvironmentVariablesUpdate::Map |
|
using | const_iterator = Map::const_iterator |
|
|
| EnvironmentVariables (Map vars) |
| Constructs an instance from pairs: key, value taken from the map.
|
|
| EnvironmentVariables (const EnvironmentVariables &)=default |
| Constructs copy of the instance.
|
|
EnvironmentVariables & | UpdateWith (EnvironmentVariablesUpdate update) |
| Updates variable.
|
|
const std::string & | GetValue (const std::string &variable_name) const |
| Returns the value of the variable.
|
|
const std::string * | GetValueOptional (const std::string &variable_name) const |
|
void | SetValue (std::string variable_name, std::string value) |
| Sets the value of the variable.
|
|
std::string & | operator[] (const std::string &variable_name) |
| Returns the reference to the value.
|
|
auto | empty () const |
| Checks whether the container is empty.
|
|
auto | size () const |
| Returns the number of elements.
|
|
auto | begin () const |
| Returns a const iterator to the beginning.
|
|
auto | end () const |
| Returns a const iterator to the ending.
|
|
Environment variables representation.
Wrapper to save environment variables and pass them to ProcessStarter::Exec. Changing an instance does not change current environment variables of the process.
Definition at line 44 of file environment_variables.hpp.
◆ const_iterator
using engine::subprocess::EnvironmentVariables::const_iterator = Map::const_iterator |
◆ Map
using engine::subprocess::EnvironmentVariables::Map = EnvironmentVariablesUpdate::Map |
◆ begin()
auto engine::subprocess::EnvironmentVariables::begin |
( |
| ) |
const |
|
inline |
◆ empty()
auto engine::subprocess::EnvironmentVariables::empty |
( |
| ) |
const |
|
inline |
◆ end()
auto engine::subprocess::EnvironmentVariables::end |
( |
| ) |
const |
|
inline |
◆ GetValue()
const std::string & engine::subprocess::EnvironmentVariables::GetValue |
( |
const std::string & |
variable_name | ) |
const |
Returns the value of the variable.
- Warning
- Throws std::runtime_error if there is no variable.
◆ GetValueOptional()
const std::string * engine::subprocess::EnvironmentVariables::GetValueOptional |
( |
const std::string & |
variable_name | ) |
const |
Returns the pointer to the value of the variable or nullptr if there is no variable.
◆ size()
auto engine::subprocess::EnvironmentVariables::size |
( |
| ) |
const |
|
inline |
◆ UpdateWith()
Updates variable.
- Note
- If variable does not exist then it is added.
The documentation for this class was generated from the following file: