Getting and setting environment variables.
More...
#include <libppbase/base/Environment.h>
List of all members.
Static Public Member Functions |
static bool | exists (const char *var) |
| Checks if an environment variable exists.
|
static bool | exists (const String &var) |
| Checks if an environment variable exists.
|
static String | get (const char *var, const char *defval=NULL) |
| Gets an environment variable.
|
static String | get (const String &var, const char *defval=NULL) |
| Gets an environment variable.
|
static String | getBinaryFileName () |
| Gets the full name of the executed binary (including path).
|
static void | set (const char *var, const char *val) |
| Sets an environment variable.
|
static void | set (const String &var, const String &val) |
| Sets an environment variable.
|
Detailed Description
Getting and setting environment variables.
- Author:
- Christoph Schwarz
- Version:
- $Id: Environment.h 21 2010-09-05 04:18:17Z cschwarz1 $
Member Function Documentation
static bool base::Environment::exists |
( |
const char * |
var |
) |
[static] |
Checks if an environment variable exists.
- Parameters:
-
| var | the variable to check |
- Returns:
- true if the variable exists, false if not
static bool base::Environment::exists |
( |
const String & |
var |
) |
[static] |
Checks if an environment variable exists.
- Parameters:
-
| var | the variable to check |
- Returns:
- true if the variable exists, false if not
static String base::Environment::get |
( |
const String & |
var, |
|
|
const char * |
defval = NULL | |
|
) |
| | [static] |
Gets an environment variable.
- Parameters:
-
| var | the variable name |
| defval | the value to return if the variable does not exist (NULL => empty string) |
- Returns:
- the variable value
static String base::Environment::get |
( |
const char * |
var, |
|
|
const char * |
defval = NULL | |
|
) |
| | [static] |
Gets an environment variable.
- Parameters:
-
| var | the variable name |
| defval | the value to return if the variable does not exist (NULL => empty string) |
- Returns:
- the variable value
static String base::Environment::getBinaryFileName |
( |
|
) |
[static] |
Gets the full name of the executed binary (including path).
- Returns:
- the name in UTF-8 format
static void base::Environment::set |
( |
const char * |
var, |
|
|
const char * |
val | |
|
) |
| | [static] |
Sets an environment variable.
- Parameters:
-
| var | the variable name |
| val | the variable value |
static void base::Environment::set |
( |
const String & |
var, |
|
|
const String & |
val | |
|
) |
| | [static] |
Sets an environment variable.
- Parameters:
-
| var | the variable name |
| val | the variable value |
The documentation for this class was generated from the following file: