libyui

/data/gitorious.org/libyui/libyui-master/src/YEnvVar.h

00001 /**************************************************************************
00002 Copyright (C) 2000 - 2010 Novell, Inc.
00003 All Rights Reserved.
00004 
00005 This program is free software; you can redistribute it and/or modify
00006 it under the terms of the GNU General Public License as published by
00007 the Free Software Foundation; either version 2 of the License, or
00008 (at your option) any later version.
00009 
00010 This program is distributed in the hope that it will be useful,
00011 but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 GNU General Public License for more details.
00014 
00015 You should have received a copy of the GNU General Public License along
00016 with this program; if not, write to the Free Software Foundation, Inc.,
00017 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00018 
00019 **************************************************************************/
00020 
00021 /*---------------------------------------------------------------------\
00022 |                                                                      |
00023 |                      __   __    ____ _____ ____                      |
00024 |                      \ \ / /_ _/ ___|_   _|___ \                     |
00025 |                       \ V / _` \___ \ | |   __) |                    |
00026 |                        | | (_| |___) || |  / __/                     |
00027 |                        |_|\__,_|____/ |_| |_____|                    |
00028 |                                                                      |
00029 |                               core system                            |
00030 |                                                        (C) SuSE GmbH |
00031 \----------------------------------------------------------------------/
00032 
00033   File:         YEnvVar.h
00034 
00035   Author:       Stefan Hundhammer <sh@suse.de>
00036 
00037 /-*/
00038 
00039 #ifndef YEnvVar_h
00040 #define YEnvVar_h
00041 
00042 #include <string>
00043 #include <iosfwd>
00044 
00045 using std::string;
00046 
00047 
00051 class YEnvVar
00052 {
00053 public:
00059     YEnvVar( const string & name = string() );
00060 
00064     string name() const { return _name; }
00065 
00069     bool isSet() const { return _isSet; }
00070 
00074     string value() const { return _value; }
00075 
00080     bool isEqual( const string & str, bool caseSensitive = false ) const;
00081 
00087     bool operator==( const string & str ) const
00088         { return isEqual( str ); }
00089     
00094     bool contains( const string & str, bool caseSensitive = false ) const;
00095 
00096     
00097 private:
00098 
00099     string _name;
00100     string _value;
00101     bool   _isSet;
00102 };
00103 
00104 
00108 std::ostream & operator<<( std::ostream & stream, const YEnvVar env );
00109 
00110 
00114 string tolower( const string & str );
00115 
00116 
00117 #endif // YEnvVar_h
 All Classes Functions Variables Enumerations Friends