Reads current process environment variables. More...
#include <Process.h>
Public Member Functions | |
ProcessEnvironment (const ProcessEnvironment &)=delete | |
ProcessEnvironment (ProcessEnvironment &&)=delete | |
ProcessEnvironment & | operator= (const ProcessEnvironment &)=delete |
ProcessEnvironment & | operator= (ProcessEnvironment &&)=delete |
size_t | size () const |
Returns the total number of environment variables for current process. More... | |
bool | get (size_t index, StringView &name, StringView &value) const |
Get the environmnent variable at given index, returning its name and value. More... | |
bool | contains (StringView variableName, size_t *index=nullptr) |
Checks if an environment variable exists in current process. More... | |
Reads current process environment variables.
Example: Print all environment variables to stdout
bool SC::ProcessEnvironment::contains | ( | StringView | variableName, |
size_t * | index = nullptr |
||
) |
Checks if an environment variable exists in current process.
variableName | Name of the variable to check |
index | Optional pointer to a variable that will receive the index of the variable (only if found) |
bool SC::ProcessEnvironment::get | ( | size_t | index, |
StringView & | name, | ||
StringView & | value | ||
) | const |
Get the environmnent variable at given index, returning its name and value.
index | The index of the variable to retrieve (must be less than ProcessEnvironment::size()) |
name | The parsed name of the environment variable at requested index |
value | The parsed value of the environment variable at requested index |
|
inline |
Returns the total number of environment variables for current process.