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