SCIRun  5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Environment.h
Go to the documentation of this file.
1 /*
2  For more information, please see: http://software.sci.utah.edu
3 
4  The MIT License
5 
6  Copyright (c) 2011 Scientific Computing and Imaging Institute,
7  University of Utah.
8 
9 
10  Permission is hereby granted, free of charge, to any person obtaining a
11  copy of this software and associated documentation files (the "Software"),
12  to deal in the Software without restriction, including without limitation
13  the rights to use, copy, modify, merge, publish, distribute, sublicense,
14  and/or sell copies of the Software, and to permit persons to whom the
15  Software is furnished to do so, subject to the following conditions:
16 
17  The above copyright notice and this permission notice shall be included
18  in all copies or substantial portions of the Software.
19 
20  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26  DEALINGS IN THE SOFTWARE.
27 */
28 
29 ///
30 ///@file Environment.h
31 ///@brief Interface to setting environemnt variables and parsing .rc files
32 ///
33 ///@author
34 /// McKay Davis
35 /// Scientific Computing and Imaging Institute
36 /// University of Utah
37 ///@date January 2004
38 ///
39 
40 #ifndef Core_Util_Environment_h
41 #define Core_Util_Environment_h 1
42 
43 #include <string>
44 #include <map>
45 
47 
48 namespace SCIRun {
49 
50  SCISHARE void create_environment_defaults(std::map<std::string, std::string>& envMap);
51  SCISHARE void create_sci_environment(char **env, char *execname);
52  SCISHARE void find_and_parse_rcfile(const std::string &rcfile);
53  SCISHARE bool parse_rcfile(const char* file);
55  SCISHARE bool update_rcfile(const std::string& key, const std::string& value);
56 
57  // Use the following functions to get/put environment variables.
58  SCISHARE void sci_putenv( const std::string & key, const std::string & val );
59  // Returns NULL if 'key' not found.
60  SCISHARE const char *sci_getenv( const std::string & key );
61 
62  // sci_getenv_p
63  // will return a bool representing the value of environment variable 'key'
64  // returns FALSE if and only if:
65  // the variable does not exist,
66  // or is empty,
67  // or is equal (Case insensitive) to 'false', 'no', 'off', or '0'
68  // returns TRUE:
69  // otherwise.
70  SCISHARE bool sci_getenv_p( const std::string & key );
71 
72  SCISHARE std::map<std::string,std::string>& get_sci_environment();
73 
74  SCISHARE bool replace_environment_variables(std::string& str);
75  SCISHARE std::string get_example_nets_dir(const std::string& objdir);
76 
77 } // end namespace SCIRun
78 
79 #endif // #ifndef Core_Util_Environment_h
SCISHARE void copy_and_parse_scirunrc()
SCISHARE bool sci_getenv_p(const std::string &key)
SCISHARE std::map< std::string, std::string > & get_sci_environment()
#define SCISHARE
Definition: share.h:39
SCISHARE bool parse_rcfile(const char *file)
SCISHARE void create_environment_defaults(std::map< std::string, std::string > &envMap)
Definition: Environment_Defaults.cc:36
SCISHARE void find_and_parse_rcfile(const std::string &rcfile)
SCISHARE void sci_putenv(const std::string &key, const std::string &val)
SCISHARE const char * sci_getenv(const std::string &key)
SCISHARE bool replace_environment_variables(std::string &str)
SCISHARE void create_sci_environment(char **env, char *execname)
SCISHARE bool update_rcfile(const std::string &key, const std::string &value)
SCISHARE std::string get_example_nets_dir(const std::string &objdir)
tuple file
Definition: eab.py:7