#include <YEnvVar.h>
Public Member Functions | |
YEnvVar (const std::string &name=std::string()) | |
std::string | name () const |
bool | isSet () const |
std::string | value () const |
bool | isEqual (const std::string &str, bool caseSensitive=false) const |
bool | operator== (const std::string &str) const |
bool | contains (const std::string &str, bool caseSensitive=false) const |
Helper class to represent an environment variable and its value.
YEnvVar::YEnvVar | ( | const std::string & | name = std::string() | ) |
Constructor: Retrieve the environment variable 'name' and store the value (unless 'name' is empty).
bool YEnvVar::contains | ( | const std::string & | str, |
bool | caseSensitive = false ) const |
Return 'true' if the environment variable is set and the value contains 'str'.
bool YEnvVar::isEqual | ( | const std::string & | str, |
bool | caseSensitive = false ) const |
Return 'true' if the environment variable is set and the value is 'str'.
|
inline |
Return 'true' if the environment variable is set.
|
inline |
Return the name of the environment variable.
|
inline |
Case-insensitive comparison (shortcut for isEqual() ): Return 'true' if the environment variable is set and the value is 'str'.
|
inline |
Return the value of the environment variable.