HTMLAttribute.h Source File

Main Page Namespace List Class Hierarchy Compound List File List Namespace Members Compound Members File Members Related Pages

# HTMLAttribute.h

Go to the documentation of this file.

    00001 /* -*-c++-*- */
    00002 /*
    00003  *  $Id: HTMLAttribute.h,v 1.3 2002/03/06 02:49:55 sbooth Exp $
    00004  *
    00005  *  Copyright (C) 1996 - 2002 Stephen F. Booth
    00006  *
    00007  *  This library is free software; you can redistribute it and/or
    00008  *  modify it under the terms of the GNU Lesser General Public
    00009  *  License as published by the Free Software Foundation; either
    00010  *  version 2.1 of the License, or (at your option) any later version.
    00011  *
    00012  *  This library is distributed in the hope that it will be useful,
    00013  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
    00014  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00015  *  Lesser General Public License for more details.
    00016  *
    00017  *  You should have received a copy of the GNU Lesser General Public
    00018  *  License along with this library; if not, write to the Free Software
    00019  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    00020  */
    00021
    00022 #ifndef _HTMLATTRIBUTE_H_
    00023 #define _HTMLATTRIBUTE_H_ 1
    00024
    00025 #ifdef __GNUG__
    00026 #  pragma interface
    00027 #endif
    00028
    00039 #include <string>
    00040 #include <iostream>
    00041
    00042 #include "cgicc/CgiDefs.h"
    00043 #include "cgicc/MStreamable.h"
    00044
    00045 CGICC_BEGIN_NAMESPACE
    00046
    00047 // ============================================================
    00048 // Class HTMLAttribute
    00049 // ============================================================
    00050
    00069 class CGICC_API HTMLAttribute : public MStreamable
    00070 {
    00071 public:
    00072
    00073   // ============================================================
    00074
    00077
    00083   HTMLAttribute();
    00084
    00091   HTMLAttribute(const STDNS string& name);
    00092
    00100   HTMLAttribute(const STDNS string& name,
    00101                 const STDNS string& value);
    00102
    00109   HTMLAttribute(const HTMLAttribute& attribute);
    00110
    00116   virtual ~HTMLAttribute();
    00118
    00119   // ============================================================
    00120
    00123
    00131   bool
    00132   operator== (const HTMLAttribute& att)                 const;
    00133
    00141   inline bool
    00142   operator!= (const HTMLAttribute& att)                 const
    00143     { return ! operator==(att); }
    00144
    00145 #ifdef WIN32
    00146   /* Dummy operator for MSVC++ */
    00147   inline bool
    00148   operator< (const HTMLAttribute& att) const
    00149   { return false; }
    00150 #endif
    00151
    00159   HTMLAttribute&
    00160   operator= (const HTMLAttribute& att);
    00162
    00163   // ============================================================
    00164
    00169
    00176   inline STDNS string
    00177   getName()                                             const
    00178     { return fName; }
    00179
    00186   inline STDNS string
    00187   getValue()                                            const
    00188     { return fValue; }
    00190
    00191   // ============================================================
    00192
    00197
    00204   inline void
    00205   setName(const STDNS string& name)
    00206     { fName = name; }
    00207
    00214   inline void
    00215   setValue(const STDNS string& value)
    00216     { fValue = value; }
    00218
    00225   virtual void
    00226   render(STDNS ostream& out)                            const;
    00227
    00228 private:
    00229   STDNS string fName;
    00230   STDNS string fValue;
    00231 };
    00232
    00233 CGICC_END_NAMESPACE
    00234
    00235 #endif /* ! _HTMLATTRIBUTE_H_ */