mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 19:08:55 -04:00
set_environment_variable
This commit is contained in:
parent
e0d8d769c8
commit
03eb4ef3d3
@ -40,6 +40,17 @@ get_environment_variable(const string &var) {
|
|||||||
return get_ptr()->ns_get_environment_variable(var);
|
return get_ptr()->ns_get_environment_variable(var);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function: ExecutionEnvironment::set_environment_variable
|
||||||
|
// Access: Public, Static
|
||||||
|
// Description: Changes the definition of the indicated environment
|
||||||
|
// variable.
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
INLINE void ExecutionEnvironment::
|
||||||
|
set_environment_variable(const string &var, const string &value) {
|
||||||
|
return get_ptr()->ns_set_environment_variable(var, value);
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: ExecutionEnvironment::get_num_args
|
// Function: ExecutionEnvironment::get_num_args
|
||||||
// Access: Public, Static
|
// Access: Public, Static
|
||||||
|
@ -195,6 +195,19 @@ ns_get_environment_variable(const string &var) const {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function: ExecutionEnvironment::ns_set_environment_variable
|
||||||
|
// Access: Private
|
||||||
|
// Description: Changes the definition of the indicated environment
|
||||||
|
// variable. The nonstatic implementation.
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
void ExecutionEnvironment::
|
||||||
|
ns_set_environment_variable(const string &var, const string &value) {
|
||||||
|
_variables[var] = value;
|
||||||
|
string put = var + "=" + value;
|
||||||
|
putenv(put.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: ExecutionEnvironment::ns_get_num_args
|
// Function: ExecutionEnvironment::ns_get_num_args
|
||||||
// Access: Private
|
// Access: Private
|
||||||
|
@ -41,6 +41,7 @@ private:
|
|||||||
public:
|
public:
|
||||||
INLINE static bool has_environment_variable(const string &var);
|
INLINE static bool has_environment_variable(const string &var);
|
||||||
INLINE static string get_environment_variable(const string &var);
|
INLINE static string get_environment_variable(const string &var);
|
||||||
|
INLINE static void set_environment_variable(const string &var, const string &value);
|
||||||
|
|
||||||
static string expand_string(const string &str);
|
static string expand_string(const string &str);
|
||||||
|
|
||||||
@ -54,6 +55,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
bool ns_has_environment_variable(const string &var) const;
|
bool ns_has_environment_variable(const string &var) const;
|
||||||
string ns_get_environment_variable(const string &var) const;
|
string ns_get_environment_variable(const string &var) const;
|
||||||
|
void ns_set_environment_variable(const string &var, const string &value);
|
||||||
|
|
||||||
int ns_get_num_args() const;
|
int ns_get_num_args() const;
|
||||||
string ns_get_arg(int n) const;
|
string ns_get_arg(int n) const;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user