Chameleon

Chameleon Svn Source Tree

Root/branches/xZenu/src/util/doxygen/src/htmlattrib.h

Source at commit 1322 created 9 years 5 months ago.
By meklort, Add doxygen to utils folder
1/******************************************************************************
2 *
3 * $Id: htmlattrib.h,v 1.2 2001/01/01 10:15:18 root Exp $
4 *
5 * Copyright (C) 1997-2011 by Dimitri van Heesch.
6 *
7 * Permission to use, copy, modify, and distribute this software and its
8 * documentation under the terms of the GNU General Public License is hereby
9 * granted. No representations are made about the suitability of this software
10 * for any purpose. It is provided "as is" without express or implied warranty.
11 * See the GNU General Public License for more details.
12 *
13 */
14
15#ifndef _HTMLATTRIB_H
16#define _HTMLATTRIB_H
17
18/*! A Html option. A name, value pair */
19struct HtmlAttrib
20{
21 QCString name;
22 QCString value;
23};
24
25/*! @brief A list of Html attributes.
26 *
27 * The Html attributes are deeply copied into the list.
28 */
29class HtmlAttribList : public QList<HtmlAttrib>
30{
31 public:
32 HtmlAttribList() : QList<HtmlAttrib>() { setAutoDelete(TRUE); }
33 ~HtmlAttribList() { clear(); }
34 HtmlAttribList(const HtmlAttribList &l) : QList<HtmlAttrib>()
35 { operator=(l); }
36 HtmlAttribList &operator=(const HtmlAttribList &l)
37 { clear(); QList<HtmlAttrib>::operator=(l); return *this; }
38 QCString toString() const
39 {
40 HtmlAttribList *that = (HtmlAttribList *)this;
41 QCString result;
42 HtmlAttrib *attr=that->first();
43 while (attr)
44 {
45 result+=" "+attr->name+"=\""+attr->value+"\"";
46 attr=that->next();
47 }
48 return result;
49 }
50 private:
51 QCollection::Item newItem( QCollection::Item d )
52 { return (QCollection::Item)new HtmlAttrib(*(HtmlAttrib *)d); }
53 void deleteItem(QCollection::Item d)
54 { delete (HtmlAttrib *)d; }
55};
56
57/*! @brief Html attribute list iterator */
58class HtmlAttribListIterator : public QListIterator<HtmlAttrib>
59{
60 public:
61 HtmlAttribListIterator(const HtmlAttribList &l) : QListIterator<HtmlAttrib>(l) {}
62};
63
64#endif
65
66

Archive Download this file

Revision: 1322