#include <envUtil.h>
Public Member Functions | |
envUtil () | |
default constructor | |
envUtil (const char *envName, const char *defaultValue="") | |
envUtil (const std::string &defaultValue) | |
constructor from the default value only | |
envUtil (const char *envName, const std::string &defaultValue) | |
const std::string & | getEnv (const char *envName, const char *defaultValue="") |
acts as the constructor with the same signature | |
const std::string & | getEnv () const |
return the value | |
const std::string & | name () const |
operator const char * () const | |
cast in char * (for old interface and c-like interface) | |
envUtil & | operator= (const std::string &s) |
assignement operator (change the value...) | |
void | setEnv (const std::string &nval) |
void | setEnv () |
Protected Attributes | |
std::string | env_ |
std::string | envName_ |
envUtil::envUtil | ( | const char * | envName, |
const char * | defaultValue = "" |
||
) |
envUtil::envUtil | ( | const char * | envName, |
const std::string & | defaultValue | ||
) |
envUtil::envUtil | ( | const std::string & | defaultValue | ) | [inline] |
const std::string& envUtil::getEnv | ( | ) | const [inline] |
return the value
Definition at line 49 of file envUtil.h.
References env_.
Referenced by operator<<().
{ return env_;}
const std::string & envUtil::getEnv | ( | const char * | envName, |
const char * | defaultValue = "" |
||
) |
const std::string& envUtil::name | ( | void | ) | const [inline] |
envUtil::operator const char * | ( | ) | const [inline] |
envUtil& envUtil::operator= | ( | const std::string & | s | ) | [inline] |
void envUtil::setEnv | ( | const std::string & | nval | ) |
void envUtil::setEnv | ( | ) |
Definition at line 20 of file envUtil.cc.
References env_, envName_, and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by operator>>(), and setEnv().
{ if (envName_.empty()) return; std::string * mess = new std::string(envName_); *mess += "="; *mess += env_; ::putenv((char*)((*mess).c_str())); }
std::string envUtil::env_ [protected] |
Definition at line 65 of file envUtil.h.
Referenced by envUtil(), getEnv(), operator const char *(), operator=(), and setEnv().