HTMLAttributeList.h Source File

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

# HTMLAttributeList.h

Go to the documentation of this file.

    00001 /* -*-c++-*- */
    00002 /*
    00003  *  $Id: HTMLAttributeList.h,v 1.2 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 _HTMLATTRIBUTELIST_H_
    00023 #define _HTMLATTRIBUTELIST_H_ 1
    00024
    00025 #ifdef __GNUG__
    00026 #  pragma interface
    00027 #endif
    00028
    00035 #include <string>
    00036 #include <iostream>
    00037 #include <vector>
    00038
    00039 #include "cgicc/CgiDefs.h"
    00040 #include "cgicc/MStreamable.h"
    00041 #include "cgicc/HTMLAttribute.h"
    00042
    00043 CGICC_BEGIN_NAMESPACE
    00044
    00045 // ============================================================
    00046 // Class HTMLAttributeList
    00047 // ============================================================
    00048
    00049 #ifdef WIN32
    00050   template class CGICC_API STDNS vector<HTMLAttribute>;
    00051 #endif
    00052
    00067 class CGICC_API HTMLAttributeList
    00068 {
    00069 public:
    00070
    00071   // ============================================================
    00072
    00075
    00081   HTMLAttributeList();
    00082
    00089   HTMLAttributeList(const HTMLAttribute& head);
    00090
    00097   HTMLAttributeList(const HTMLAttributeList& list);
    00098
    00104   ~HTMLAttributeList();
    00106
    00107
    00108   // ============================================================
    00109
    00112
    00119   HTMLAttributeList&
    00120   operator= (const HTMLAttributeList &list);
    00122
    00123
    00124   // ============================================================
    00125
    00130
    00138   HTMLAttributeList&
    00139   set(const STDNS string& name);
    00140
    00149   HTMLAttributeList&
    00150   set(const STDNS string& name,
    00151       const STDNS string& value);
    00153
    00156
    00163   void
    00164   render(STDNS ostream& out)                            const;
    00166
    00167 private:
    00168   STDNS vector<HTMLAttribute> fAttributes;
    00169 };
    00170
    00171 // ============================================================
    00172 // List manipulators
    00173 // ============================================================
    00174
    00186 inline HTMLAttributeList
    00187 set(const STDNS string& name)
    00188 { return HTMLAttributeList(HTMLAttribute(name)); }
    00189
    00202 inline HTMLAttributeList
    00203 set(const STDNS string& name,
    00204     const STDNS string& value)
    00205 { return HTMLAttributeList(HTMLAttribute(name, value)); }
    00206
    00207 CGICC_END_NAMESPACE
    00208
    00209 #endif /* ! _HTMLATTRIBUTES_H_ */