#include <SystemEnvironment.h>
Public Member Functions | |
DLLEXPORT int | set (const char *name, const char *value, bool overwrite=1) |
sets the given environment variable to the value passed, respecting the overwrite flag | |
DLLEXPORT class QoreString * | get (const char *name) |
returns the value of the environment variable as a new QoreString object, 0 if not present, caller owns the pointer returned | |
DLLEXPORT class QoreStringNode * | getAsStringNode (const char *name) |
returns the value of the environment variable as a new QoreStringNode object, 0 if not present, caller owns the reference count of the pointer returned | |
DLLEXPORT int | get (const char *name, class QoreString &str) |
appends the value of the given environment variable to a QoreString, returns 0 for OK, -1 for not found | |
DLLEXPORT int | unset (const char *name) |
unsets the given environment variable | |
DLLEXPORT bool | valueExists (const char *name) |
returns true if the environment variable exists and has a value, false if not |
some systems (HP-UX, for examplex) require a lock to access the environment in a multi-threaded environment. This class allows for multiple updates to be done within the scope of the lock
DLLEXPORT int AtomicEnvironmentSetter::get | ( | const char * | name, | |
class QoreString & | str | |||
) |
appends the value of the given environment variable to a QoreString, returns 0 for OK, -1 for not found
name | the name of the environment variable | |
str | a reference to a QoreString object where the value will be concatenated if the environment variable exists |
DLLEXPORT class QoreString* AtomicEnvironmentSetter::get | ( | const char * | name | ) |
returns the value of the environment variable as a new QoreString object, 0 if not present, caller owns the pointer returned
name | the name of the environment variable |
DLLEXPORT class QoreStringNode* AtomicEnvironmentSetter::getAsStringNode | ( | const char * | name | ) |
returns the value of the environment variable as a new QoreStringNode object, 0 if not present, caller owns the reference count of the pointer returned
name | the name of the environment variable |
DLLEXPORT int AtomicEnvironmentSetter::set | ( | const char * | name, | |
const char * | value, | |||
bool | overwrite = 1 | |||
) |
sets the given environment variable to the value passed, respecting the overwrite flag
name | the name of the environment variable to set | |
value | the value of the environment variable | |
overwrite | the overwrite flag |
DLLEXPORT int AtomicEnvironmentSetter::unset | ( | const char * | name | ) |
unsets the given environment variable
name | the name of the environment variable to unset |
DLLEXPORT bool AtomicEnvironmentSetter::valueExists | ( | const char * | name | ) |
returns true if the environment variable exists and has a value, false if not
name | the name of the environment variable to check |