Back to home page

EIC code displayed by LXR

 
 

    


Warning, /include/Geant4/tools/get_env is written in an unsupported language. File is not indexed.

0001 // Copyright (C) 2010, Guy Barrand. All rights reserved.
0002 // See the file tools.license for terms.
0003 
0004 #ifndef tools_get_env
0005 #define tools_get_env
0006 
0007 #include <cstdlib>
0008 
0009 namespace tools {
0010 
0011 inline bool is_env(const std::string& a_string){
0012   const char* env = ::getenv(a_string.c_str());
0013   return (env?true:false);
0014 }
0015 
0016 inline bool get_env(const std::string& a_string,std::string& a_value){
0017   const char* env = ::getenv(a_string.c_str());
0018   if(env) {
0019     a_value = std::string(env?env:"");
0020     return true;
0021   } else {
0022     a_value.clear();
0023     return false;
0024   }
0025 }
0026 
0027 }
0028 
0029 #endif