libyui
 
Loading...
Searching...
No Matches
YEnvVar Class Reference

#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
 

Detailed Description

Helper class to represent an environment variable and its value.

Constructor & Destructor Documentation

◆ YEnvVar()

YEnvVar::YEnvVar ( const std::string & name = std::string())

Constructor: Retrieve the environment variable 'name' and store the value (unless 'name' is empty).

Member Function Documentation

◆ contains()

bool YEnvVar::contains ( const std::string & str,
bool caseSensitive = false ) const

Return 'true' if the environment variable is set and the value contains 'str'.

◆ isEqual()

bool YEnvVar::isEqual ( const std::string & str,
bool caseSensitive = false ) const

Return 'true' if the environment variable is set and the value is 'str'.

◆ isSet()

bool YEnvVar::isSet ( ) const
inline

Return 'true' if the environment variable is set.

◆ name()

std::string YEnvVar::name ( ) const
inline

Return the name of the environment variable.

◆ operator==()

bool YEnvVar::operator== ( const std::string & str) const
inline

Case-insensitive comparison (shortcut for isEqual() ): Return 'true' if the environment variable is set and the value is 'str'.

◆ value()

std::string YEnvVar::value ( ) const
inline

Return the value of the environment variable.


The documentation for this class was generated from the following files: