14#ifndef EXECUTIONENVIRONMENT_H
15#define EXECUTIONENVIRONMENT_H
29class EXPCL_DTOOL_DTOOLUTIL ExecutionEnvironment {
31 ExecutionEnvironment();
44 INLINE
static std::string
get_arg(
size_t n);
64 bool ns_has_environment_variable(
const std::string &var)
const;
65 std::string ns_get_environment_variable(
const std::string &var)
const;
66 void ns_set_environment_variable(
const std::string &var,
const std::string &value);
67 void ns_shadow_environment_variable(
const std::string &var,
const std::string &value);
68 void ns_clear_shadow(
const std::string &var);
70 size_t ns_get_num_args()
const;
71 std::string ns_get_arg(
size_t n)
const;
73 std::string ns_get_binary_name()
const;
74 std::string ns_get_dtool_name()
const;
76 static ExecutionEnvironment *get_ptr();
78 void read_environment_variables();
82 typedef std::map<std::string, std::string> EnvironmentVariables;
83 EnvironmentVariables _variables;
85 typedef vector_string CommandArguments;
86 CommandArguments _args;
88 std::string _binary_name;
89 std::string _dtool_name;
91 static ExecutionEnvironment *_global_ptr;
static void clear_shadow(const std::string &var)
Removes a value set by a previous call to shadow_environment_variable(), and lets the actual value of...
get_dtool_name
Returns the name of the libdtool DLL that is used in this program, if it can be determined.
static std::string expand_string(const std::string &str)
Reads the string, looking for environment variable names marked by a $.
set_environment_variable
Changes the definition of the indicated environment variable.
get_num_args
Returns the number of command-line arguments available, not counting arg 0, the binary name.
static void shadow_environment_variable(const std::string &var, const std::string &value)
Changes the apparent definition of the indicated environment variable by masking it within this class...
has_environment_variable
Returns true if the indicated environment variable is defined.
get_environment_variable
Returns the definition of the indicated environment variable, or the empty string if the variable is ...
get_binary_name
Returns the name of the binary executable that started this program, if it can be determined.
set_dtool_name
Do not use.
get_cwd
Returns the name of the current working directory.
get_arg
Returns the nth command-line argument.
set_binary_name
Do not use.
The name of a file, such as a texture file or an Egg file.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.