-
Notifications
You must be signed in to change notification settings - Fork 1
Environment
Mario Bielert edited this page Mar 19, 2018
·
9 revisions
There are some functions, which allows the access to some runtime environment settings.
These functions are used to determine the name and the prefix of the plugin.
This function returns the name of the plugin.
Returns:
- string - the name of the plugin
Attention:
You shall not modify the return value of this function.
This function returns the prefix used for environment variables. It uses the plugin name.
Returns:
- string - the plugin prefix
There are two functions, which gives access to environment variables.
std::string environment_variable::get(std::string name, std::string default = "", bool global = false)
This function is a nice wrapper around the C library function getenv()
.
Arguments:
- name - the name of the variable
- default - the default value, if the variable wasn't set in the environment
- global - if this is true, than the name will be used as given for the variable lookup, otherwise the name will be passed through
environment_variable::name()
Returns:
- string - the content of the environment variable or
default
The function returns the prefixed environment variable name of the given variable.
Arguments:
- name - the name of the variable
Returns:
- string - the prefixed variable name