Reads current process environment variables.
More...
#include <Process.h>
Reads current process environment variables.
Example: Print all environment variables to stdout
for (
size_t idx = 0; idx < environment.
size(); ++idx)
{
(void)environment.
get(idx, name, value);
{
}
else
{
}
}
◆ contains()
bool SC::ProcessEnvironment::contains |
( |
StringView | variableName, |
|
|
size_t * | index = nullptr ) |
|
nodiscard |
Checks if an environment variable exists in current process.
- Parameters
-
variableName | Name of the variable to check |
index | Optional pointer to a variable that will receive the index of the variable (only if found) |
- Returns
- true if variableName has been found in list of the variable
◆ get()
Get the environment variable at given index, returning its name and value.
- Parameters
-
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 |
◆ size()
size_t SC::ProcessEnvironment::size |
( |
| ) |
const |
|
inlinenodiscard |
Returns the total number of environment variables for current process.
The documentation for this struct was generated from the following file: