#include <system.hpp>
|
static edsp::expected< std::string, SystemEnvironmentError > | get_env (const edsp::string_view &variable_name) noexcept |
| Searches in the system environment for the value of the variable name. More...
|
|
static SystemEnvironmentError | set_env (const edsp::string_view &variable_name, const edsp::string_view &variable_value, bool overwrite=true) noexcept |
| Shall update or add a variable in the environment of the calling process. More...
|
|
static bool | exist (const edsp::string_view &variable_name) noexcept |
| Checks if a variable name is defined in the system environment. More...
|
|
◆ SystemEnvironmentError
The SystemEnvironmentError describes the possible error while reading/writting variables in the system environment.
Enumerator |
---|
NoError | No error
|
Empty | Variable name is empty
|
NotFound | Variable not found
|
InvalidArgument | Invalid argument
|
NoMemory | Out of memory
|
Unknown | Unknown error
|
◆ exist()
static bool edsp::core::system_env::exist |
( |
const edsp::string_view & |
variable_name | ) |
|
|
inlinestaticnoexcept |
Checks if a variable name is defined in the system environment.
- Parameters
-
variable_name | Variable name. |
- Returns
- true if the variable exist in the system environment.
◆ get_env()
static edsp::expected<std::string, SystemEnvironmentError> edsp::core::system_env::get_env |
( |
const edsp::string_view & |
variable_name | ) |
|
|
inlinestaticnoexcept |
Searches in the system environment for the value of the variable name.
- Parameters
-
variable_name | Variable name |
- Returns
- If it fails, the associated error. If not, the value of the variable.
◆ set_env()
static SystemEnvironmentError edsp::core::system_env::set_env |
( |
const edsp::string_view & |
variable_name, |
|
|
const edsp::string_view & |
variable_value, |
|
|
bool |
overwrite = true |
|
) |
| |
|
inlinestaticnoexcept |
Shall update or add a variable in the environment of the calling process.
- Parameters
-
variable_name | Variable name. |
variable_value | Variable value. |
overwrite | If true, overwrites the existing value. |
- Returns
- If it fails, the error associated with the operation.
The documentation for this struct was generated from the following file: