Holds the environment variables that can be passed to a process.
More...
#include <platform/Process.h>
|
| Environment () |
|
| Environment (const Environment &other) |
|
| Environment (Environment &&other) noexcept |
|
Environment & | operator= (const Environment &other) |
|
Environment & | operator= (Environment &&other) noexcept |
|
void | clear () |
| Removes all environment variables. More...
|
|
bool | empty () const |
|
void | insert (const std::string &var, const std::string &value) |
| inserts or replaces the environment variable var with the given value. More...
|
|
void | insert (const std::string &string) |
| Inserts or replaces the environment variable. More...
|
|
void | insertList (const std::string &string) |
| Inserts all variables from the given string which has the format. More...
|
|
void | insert (const Environment &env) |
| inserts all variables from the given environment, while replacing existing variables. More...
|
|
void | remove (const std::string &var) |
| removes the environment variable More...
|
|
const std::string & | value (const std::string &var, const std::string &defaultValue=std::string()) const |
| returns the value of the environment variable var, or the default value, if it does not exist. More...
|
|
std::vector< std::string > | envp () |
| Generates and returns an vector of strings, conventionally of the form key=value, which can be used to call low-level system functions such as execXe(). More...
|
|
const std::map< std::string, std::string > & | variables () const |
|
Holds the environment variables that can be passed to a process.
The environment of the calling process can be obtained using systemEnvironment().
◆ Environment() [1/3]
◆ Environment() [2/3]
◆ Environment() [3/3]
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ clear()
Removes all environment variables.
◆ empty()
◆ insert() [1/3]
void insert |
( |
const std::string & |
var, |
|
|
const std::string & |
value |
|
) |
| |
inserts or replaces the environment variable var with the given value.
◆ insert() [2/3]
void insert |
( |
const std::string & |
string | ) |
|
Inserts or replaces the environment variable.
The variable and the value are given in the format:
variable=value
◆ insertList()
void insertList |
( |
const std::string & |
string | ) |
|
Inserts all variables from the given string which has the format.
variable1=value1;variable2=value2;variable3=value3
◆ insert() [3/3]
inserts all variables from the given environment, while replacing existing variables.
◆ remove()
void remove |
( |
const std::string & |
var | ) |
|
removes the environment variable
◆ value()
const std::string& value |
( |
const std::string & |
var, |
|
|
const std::string & |
defaultValue = std::string() |
|
) |
| const |
returns the value of the environment variable var, or the default value, if it does not exist.
◆ envp()
std::vector<std::string> envp |
( |
| ) |
|
Generates and returns an vector of strings, conventionally of the form key=value, which can be used to call low-level system functions such as execXe().
◆ variables()
const std::map<std::string,std::string>& variables |
( |
| ) |
const |
|
inline |
◆ systemEnvironment()
The documentation for this class was generated from the following file: