Environment variables representation.
More...
#include <string>
#include <unordered_map>
#include <userver/rcu/rcu.hpp>
Go to the source code of this file.
|
namespace | engine |
| Asynchronous engine primitives.
|
|
Environment variables representation.
Definition in file environment_variables.hpp.
◆ Overwrite
Overwrite modes.
Enumerator |
---|
kAllowed | Overwrites or creates the environment variable.
|
kForbidden | Creates new environment variable, else throws std::runtime_error
|
kIgnored | Does not overwrite the environment variable if the variable exists
|
Definition at line 102 of file environment_variables.hpp.
◆ GetCurrentEnvironmentVariablesPtr()
rcu::ReadablePtr< EnvironmentVariables > engine::subprocess::GetCurrentEnvironmentVariablesPtr |
( |
| ) |
|
Returns thread-safe read only pointer to the environment variables of the current process.
◆ SetEnvironmentVariable()
void engine::subprocess::SetEnvironmentVariable |
( |
const std::string & |
variable_name, |
|
|
const std::string & |
value, |
|
|
Overwrite |
overwrite = Overwrite::kForbidden |
|
) |
| |
Sets the environment variable with the specified overwrite type.
- Warning
- Not thread-safe.
◆ UnsetEnvironmentVariable()
void engine::subprocess::UnsetEnvironmentVariable |
( |
const std::string & |
variable_name | ) |
|
Unsets the environment variable.
- Warning
- Not thread-safe.
◆ UpdateCurrentEnvironmentVariables()
void engine::subprocess::UpdateCurrentEnvironmentVariables |
( |
| ) |
|
Fetches current environment variables for getting via GetCurrentEnvironmentVariables or GetCurrentEnvironmentVariablesPtr.