00001 // Filename: executionEnvironment.I 00002 // Created by: drose (15May00) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 00020 //////////////////////////////////////////////////////////////////// 00021 // Function: ExecutionEnvironment::has_environment_variable 00022 // Access: Public, Static 00023 // Description: Returns true if the indicated environment variable 00024 // is defined. 00025 //////////////////////////////////////////////////////////////////// 00026 INLINE bool ExecutionEnvironment:: 00027 has_environment_variable(const string &var) { 00028 return get_ptr()->ns_has_environment_variable(var); 00029 } 00030 00031 //////////////////////////////////////////////////////////////////// 00032 // Function: ExecutionEnvironment::get_environment_variable 00033 // Access: Public, Static 00034 // Description: Returns the definition of the indicated environment 00035 // variable, or the empty string if the variable is 00036 // undefined. 00037 //////////////////////////////////////////////////////////////////// 00038 INLINE string ExecutionEnvironment:: 00039 get_environment_variable(const string &var) { 00040 return get_ptr()->ns_get_environment_variable(var); 00041 } 00042 00043 //////////////////////////////////////////////////////////////////// 00044 // Function: ExecutionEnvironment::set_environment_variable 00045 // Access: Public, Static 00046 // Description: Changes the definition of the indicated environment 00047 // variable. 00048 //////////////////////////////////////////////////////////////////// 00049 INLINE void ExecutionEnvironment:: 00050 set_environment_variable(const string &var, const string &value) { 00051 get_ptr()->ns_set_environment_variable(var, value); 00052 } 00053 00054 //////////////////////////////////////////////////////////////////// 00055 // Function: ExecutionEnvironment::get_num_args 00056 // Access: Public, Static 00057 // Description: Returns the number of command-line arguments 00058 // available, not counting arg 0, the binary name. 00059 //////////////////////////////////////////////////////////////////// 00060 INLINE int ExecutionEnvironment:: 00061 get_num_args() { 00062 return get_ptr()->ns_get_num_args(); 00063 } 00064 00065 //////////////////////////////////////////////////////////////////// 00066 // Function: ExecutionEnvironment::get_arg 00067 // Access: Public, Static 00068 // Description: Returns the nth command-line argument. The index n 00069 // must be in the range [0 .. get_num_args()). The 00070 // first parameter, n == 0, is the first actual 00071 // parameter, not the binary name. 00072 //////////////////////////////////////////////////////////////////// 00073 INLINE string ExecutionEnvironment:: 00074 get_arg(int n) { 00075 return get_ptr()->ns_get_arg(n); 00076 } 00077 00078 //////////////////////////////////////////////////////////////////// 00079 // Function: ExecutionEnvironment::get_binary_name 00080 // Access: Public, Static 00081 // Description: Returns the name of the binary executable that 00082 // started this program, if it can be determined. 00083 //////////////////////////////////////////////////////////////////// 00084 INLINE string ExecutionEnvironment:: 00085 get_binary_name() { 00086 return get_ptr()->ns_get_binary_name(); 00087 }