HTMLElementList.h
Go to the documentation of this file.
1/* -*-mode:c++; c-file-style: "gnu";-*- */
2/*
3 * $Id: HTMLElementList.h,v 1.9 2014/04/23 20:55:06 sebdiaz Exp $
4 *
5 * Copyright (C) 1996 - 2004 Stephen F. Booth <sbooth@gnu.org>
6 * 2007 Sebastien DIAZ <sebastien.diaz@gmail.com>
7 * Part of the GNU cgicc library, http://www.gnu.org/software/cgicc
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 3 of the License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
22 */
23
24#ifndef _HTMLELEMENTLIST_H_
25#define _HTMLELEMENTLIST_H_ 1
26
27#ifdef __GNUG__
28# pragma interface
29#endif
30
37#include <string>
38#include <vector>
39
40#include "CgiDefs.h"
41#include "MStreamable.h"
42#include "HTMLAttribute.h"
43#include "HTMLElement.h"
44
45 namespace cgicc {
46
47 // ============================================================
48 // Class HTMLElementList
49 // ============================================================
50
51#ifdef WIN32
52 template class CGICC_API std::vector<HTMLElement*>;
53#endif
54
67 class CGICC_API HTMLElementList
68 {
69 public:
70
71 // ============================================================
72
75
81 HTMLElementList();
82
89 HTMLElementList(const HTMLElement& head);
90
97 HTMLElementList(const HTMLElementList& list);
98
104 ~HTMLElementList();
106
107 // ============================================================
108
111
119 HTMLElementList&
120 operator= (const HTMLElementList& list);
122
123 // ============================================================
124
129
136 HTMLElementList&
137 add(const HTMLElement& element);
138
145 HTMLElementList&
146 add(HTMLElement *element);
148
151
157 void
158 render(std::ostream& out) const;
160
161 private:
162 std::vector<HTMLElement*> fElements;
163 // elements must be stored as pointers, otherwise polymorphism doesn't work
164 };
165
166} // namespace cgicc
167
168#endif /* ! _HTMLELEMENTLIST_H_ */
CgiDefs.h
Platform and operating system specific macro definitions.
HTMLAttribute.h
Class dealing with HTML element attributes.
HTMLElement.h
Class dealing with HTML elements.
MStreamable.h
Abstract base class for all streamable objects.
cgicc::HTMLElementList
An expandable list of HTMLElement objects.
Definition: HTMLElementList.h:68
cgicc::HTMLElementList::add
HTMLElementList & add(HTMLElement *element)
Add an HTMLElement to the list.
cgicc::HTMLElementList::HTMLElementList
HTMLElementList(const HTMLElementList &list)
Copy constructor.
cgicc::HTMLElementList::~HTMLElementList
~HTMLElementList()
Destructor.
cgicc::HTMLElementList::HTMLElementList
HTMLElementList()
Create an empty HTMLElementList.
cgicc::HTMLElementList::add
HTMLElementList & add(const HTMLElement &element)
Add an HTMLElement to the list.
cgicc::HTMLElementList::render
void render(std::ostream &out) const
Render this HTMLElementList.
cgicc::HTMLElementList::HTMLElementList
HTMLElementList(const HTMLElement &head)
Create a new HTMLElementList, specifying the first element.
cgicc::HTMLElement
Class representing an HTML element.
Definition: HTMLElement.h:61
cgicc
The namespace containing the cgicc library.
Definition: Cgicc.h:52