44 YEnvVar(
const std::string &
name = std::string() );
49 std::string
name()
const {
return _name; }
54 bool isSet()
const {
return _isSet; }
59 std::string
value()
const {
return _value; }
65 bool isEqual(
const std::string & str,
bool caseSensitive =
false )
const;
79 bool contains(
const std::string & str,
bool caseSensitive =
false )
const;
93 std::ostream & operator<<( std::ostream & stream,
const YEnvVar env );
99 std::string tolower(
const std::string & str );
bool isEqual(const std::string &str, bool caseSensitive=false) const
Return 'true' if the environment variable is set and the value is 'str'.
bool isSet() const
Return 'true' if the environment variable is set.
std::string value() const
Return the value of the environment variable.
bool operator==(const std::string &str) const
Case-insensitive comparison (shortcut for isEqual() ): Return 'true' if the environment variable is s...
YEnvVar(const std::string &name=std::string())
Constructor: Retrieve the environment variable 'name' and store the value (unless 'name' is empty)...
Helper class to represent an environment variable and its value.
bool contains(const std::string &str, bool caseSensitive=false) const
Return 'true' if the environment variable is set and the value contains 'str'.
std::string name() const
Return the name of the environment variable.