cgicc: HTMLAttribute.h Source File

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

# HTMLAttribute.h

Go to the documentation of this file.

    00001 /* -*-mode:c++; c-file-style: "gnu";-*- */
    00002 /*
    00003  *  $Id: HTMLAttribute.h,v 1.8 2007/07/02 18:48:18 sebdiaz Exp $
    00004  *
    00005  *  Copyright (C) 1996 - 2004 Stephen F. Booth <sbooth@gnu.org>
    00006  *                       2007 Sebastien DIAZ <sebastien.diaz@gmail.com>
    00007  *  Part of the GNU cgicc library, http://www.gnu.org/software/cgicc
    00008  *
    00009  *  This library is free software; you can redistribute it and/or
    00010  *  modify it under the terms of the GNU Lesser General Public
    00011  *  License as published by the Free Software Foundation; either
    00012  *  version 3 of the License, or (at your option) any later version.
    00013  *
    00014  *  This library is distributed in the hope that it will be useful,
    00015  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
    00016  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00017  *  Lesser General Public License for more details.
    00018  *
    00019  *  You should have received a copy of the GNU Lesser General Public
    00020  *  License along with this library; if not, write to the Free Software
    00021  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
    00022  */
    00023
    00024 #ifndef _HTMLATTRIBUTE_H_
    00025 #define _HTMLATTRIBUTE_H_ 1
    00026
    00027 #ifdef __GNUG__
    00028 #  pragma interface
    00029 #endif
    00030
    00041 #include <string>
    00042 #include <iostream>
    00043
    00044 #include "cgicc/CgiDefs.h"
    00045 #include "cgicc/MStreamable.h"
    00046
    00047 namespace cgicc {
    00048
    00049   // ============================================================
    00050   // Class HTMLAttribute
    00051   // ============================================================
    00052
    00071   class CGICC_API HTMLAttribute : public MStreamable
    00072   {
    00073   public:
    00074
    00075     // ============================================================
    00076
    00079
    00085     HTMLAttribute();
    00086
    00093     HTMLAttribute(const std::string& name);
    00094
    00102     HTMLAttribute(const std::string& name,
    00103                   const std::string& value);
    00104
    00111     HTMLAttribute(const HTMLAttribute& attribute);
    00112
    00118     virtual ~HTMLAttribute();
    00120
    00121     // ============================================================
    00122
    00125
    00133     bool
    00134     operator== (const HTMLAttribute& att)               const;
    00135
    00143     inline bool
    00144     operator!= (const HTMLAttribute& att)               const
    00145     { return ! operator==(att); }
    00146
    00147 #ifdef WIN32
    00148     /* Dummy operator for MSVC++ */
    00149     inline bool
    00150     operator< (const HTMLAttribute& att) const
    00151     { return false; }
    00152 #endif
    00153
    00161     HTMLAttribute&
    00162     operator= (const HTMLAttribute& att);
    00164
    00165     // ============================================================
    00166
    00171
    00178     inline std::string
    00179     getName()                                           const
    00180     { return fName; }
    00181
    00188     inline std::string
    00189     getValue()                                          const
    00190     { return fValue; }
    00192
    00193     // ============================================================
    00194
    00199
    00206     inline void
    00207     setName(const std::string& name)
    00208     { fName = name; }
    00209
    00216     inline void
    00217     setValue(const std::string& value)
    00218     { fValue = value; }
    00220
    00227     virtual void
    00228     render(std::ostream& out)                           const;
    00229
    00230   private:
    00231     std::string fName;
    00232     std::string fValue;
    00233   };
    00234
    00235 } // namespace cgicc
    00236
    00237 #endif /* ! _HTMLATTRIBUTE_H_ */