30 #define YUILogComponent "ui"
40 if ( ! _name.empty() )
42 const char * val = getenv( _name.c_str() );
60 return strcmp( _value.c_str(), str.c_str() ) == 0;
62 return strcasecmp( _value.c_str(), str.c_str() ) == 0;
73 return _value.find( str ) != std::string::npos;
77 return tolower( _value ).find( tolower( str ) ) != std::string::npos;
82 std::string tolower(
const std::string & str )
85 lowStr.reserve( str.size() );
87 for ( std::string::const_iterator it = str.begin();
91 lowStr += ::tolower( *it );
99 operator<<( std::ostream & stream,
const YEnvVar env )
101 if ( env.
name().empty() )
103 stream <<
"<unnamed environment variable>";
108 stream <<
"$" << env.
name() <<
"=\"" << env.
value() <<
"\"";
110 stream <<
"$" << env.
name() <<
": <not set>";
YEnvVar(const std::string &name=std::string())
std::string value() const
bool isEqual(const std::string &str, bool caseSensitive=false) const
bool contains(const std::string &str, bool caseSensitive=false) const