CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
GetEnvironmentVariable.h
Go to the documentation of this file.
1 #ifndef Utilities_GetEnvironmentVariable_h
2 #define Utilities_GetEnvironmentVariable_h
3 
4 #include <cstdlib>
5 #include <string>
6 
7 namespace edm {
8  inline std::string getEnvironmentVariable(std::string const& name, std::string const& defaultValue = std::string()) {
9  char* p = std::getenv(name.c_str());
10  return (p ? std::string(p) : defaultValue);
11  }
12 } // namespace edm
13 #endif
std::string getEnvironmentVariable(std::string const &name, std::string const &defaultValue=std::string())