#include <executionEnvironment.h>
Static Public Member Functions | |
bool | has_environment_variable (const string &var) |
Returns true if the indicated environment variable is defined. | |
string | get_environment_variable (const string &var) |
Returns the definition of the indicated environment variable, or the empty string if the variable is undefined. | |
void | set_environment_variable (const string &var, const string &value) |
Changes the definition of the indicated environment variable. | |
string | expand_string (const string &str) |
Reads the string, looking for environment variable names marked by a $. | |
int | get_num_args () |
Returns the number of command-line arguments available, not counting arg 0, the binary name. | |
string | get_arg (int n) |
Returns the nth command-line argument. | |
string | get_binary_name () |
Returns the name of the binary executable that started this program, if it can be determined. | |
Filename | get_cwd () |
Returns the name of the current working directory. | |
Private Types | |
typedef map< string, string > | EnvironmentVariables |
typedef vector_string | CommandArguments |
Private Member Functions | |
ExecutionEnvironment () | |
You shouldn't need to construct one of these; there's only one and it constructs itself. | |
bool | ns_has_environment_variable (const string &var) const |
Returns true if the indicated environment variable is defined. | |
string | ns_get_environment_variable (const string &var) const |
Returns the definition of the indicated environment variable, or the empty string if the variable is undefined. | |
void | ns_set_environment_variable (const string &var, const string &value) |
Changes the definition of the indicated environment variable. | |
int | ns_get_num_args () const |
Returns the number of command-line arguments available, not counting arg 0, the binary name. | |
string | ns_get_arg (int n) const |
Returns the nth command-line argument. | |
string | ns_get_binary_name () const |
Returns the name of the binary executable that started this program, if it can be determined. | |
void | read_environment_variables () |
Fills up the internal table of existing environment variables, if we are in PREREAD_ENVIRONMENT mode. | |
void | read_args () |
Reads all the command-line arguments and the name of the binary file, if possible. | |
Static Private Member Functions | |
ExecutionEnvironment * | get_ptr () |
Returns a static pointer that may be used to access the global ExecutionEnvironment object. | |
Private Attributes | |
EnvironmentVariables | _variables |
CommandArguments | _args |
string | _binary_name |
Static Private Attributes | |
ExecutionEnvironment * | _global_ptr = NULL |
This is encapsulated to support accessing these things during static init time, which seems to be risky at best.
Definition at line 47 of file executionEnvironment.h.
|
Definition at line 84 of file executionEnvironment.h. |
|
Definition at line 81 of file executionEnvironment.h. |
|
You shouldn't need to construct one of these; there's only one and it constructs itself.
Definition at line 71 of file executionEnvironment.cxx. References size_t. |
|
Reads the string, looking for environment variable names marked by a $. Expands all such variable names. A repeated dollar sign ($$) is mapped to a single dollar sign. Returns the expanded string. Definition at line 95 of file executionEnvironment.cxx. References size_t. |
|
Returns the nth command-line argument. The index n must be in the range [0 .. get_num_args()). The first parameter, n == 0, is the first actual parameter, not the binary name. Definition at line 100 of file executionEnvironment.I. |
|
Returns the name of the binary executable that started this program, if it can be determined.
Definition at line 115 of file executionEnvironment.I. |
|
Returns the name of the current working directory.
Definition at line 152 of file executionEnvironment.cxx. |
|
Returns the definition of the indicated environment variable, or the empty string if the variable is undefined.
Definition at line 51 of file executionEnvironment.I. Referenced by Config::ConfigTable::ReadConfigFile(). |
|
Returns the number of command-line arguments available, not counting arg 0, the binary name.
Definition at line 81 of file executionEnvironment.I. References get_ptr(), INLINE, and ns_get_binary_name(). |
|
Returns a static pointer that may be used to access the global ExecutionEnvironment object.
Definition at line 316 of file executionEnvironment.cxx. Referenced by get_num_args(), has_environment_variable(), and set_environment_variable(). |
|
Returns true if the indicated environment variable is defined.
Definition at line 34 of file executionEnvironment.I. References get_ptr(), INLINE, and ns_get_environment_variable(). Referenced by Config::ConfigTable::Defined(), and Config::ConfigTable::ReadConfigFile(). |
|
Returns the nth command-line argument. The index n must be in the range [0 .. get_num_args()). The first parameter, n == 0, is the first actual parameter, not the binary name. The nonstatic implementation. Definition at line 280 of file executionEnvironment.cxx. Referenced by set_environment_variable(). |
|
Returns the name of the binary executable that started this program, if it can be determined. The nonstatic implementation. Definition at line 298 of file executionEnvironment.cxx. Referenced by get_num_args(). |
|
Returns the definition of the indicated environment variable, or the empty string if the variable is undefined. The nonstatic implementation. Definition at line 208 of file executionEnvironment.cxx. Referenced by has_environment_variable(). |
|
Returns the number of command-line arguments available, not counting arg 0, the binary name. The nonstatic implementation. Definition at line 259 of file executionEnvironment.cxx. References _global_ptr, and NULL. Referenced by ns_set_environment_variable(). |
|
Returns true if the indicated environment variable is defined. The nonstatic implementation. Definition at line 187 of file executionEnvironment.cxx. |
|
Changes the definition of the indicated environment variable. The nonstatic implementation. Definition at line 236 of file executionEnvironment.cxx. References _args, and ns_get_num_args(). |
|
Reads all the command-line arguments and the name of the binary file, if possible.
Definition at line 391 of file executionEnvironment.cxx. |
|
Fills up the internal table of existing environment variables, if we are in PREREAD_ENVIRONMENT mode. Otherwise, does nothing. Definition at line 337 of file executionEnvironment.cxx. References _args. |
|
Changes the definition of the indicated environment variable.
Definition at line 66 of file executionEnvironment.I. References get_ptr(), INLINE, and ns_get_arg(). |
|
Definition at line 85 of file executionEnvironment.h. Referenced by ns_set_environment_variable(), and read_environment_variables(). |
|
Definition at line 87 of file executionEnvironment.h. |
|
Definition at line 57 of file executionEnvironment.cxx. Referenced by ns_get_num_args(). |
|
Definition at line 82 of file executionEnvironment.h. |