Rudiments
Static Public Member Functions | List of all members
environment Class Reference

#include <environment.h>

Static Public Member Functions

static const chargetValue (const char *variable)
 
static bool setValue (const char *variable, const char *value)
 
static bool remove (const char *variable)
 
static const char *constgetVariables ()
 
static bool clear ()
 
static void setMutex (threadmutex *mtx)
 

Detailed Description

The environment class provides static methods for accessing and manipulating environment variables.

Member Function Documentation

◆ clear()

static bool environment::clear ( )
static

Clears the environment of all name-value pairs. After calling this, variables() will return NULL.

◆ getValue()

static const char * environment::getValue ( const char * variable)
static

Returns the value of "variable".

◆ getVariables()

static const char *const * environment::getVariables ( )
static

Returns a NULL terminated list of all environment variables. Each entry in the list is of the form NAME=VALUE.

◆ remove()

static bool environment::remove ( const char * variable)
static

Removes "variable" from the environment.

◆ setMutex()

static void environment::setMutex ( threadmutex * mtx)
static

Allows you to supply a mutex if the class needs it. If your application is not multithreaded, then there is no need to supply a mutex.

◆ setValue()

static bool environment::setValue ( const char * variable,
const char * value )
static

Sets the value of "variable" to "value", overwriting any value that "variable" previously had. Returns true on success and false on failure.