HTMLAttributeList.h
Go to the documentation of this file.
1 /* -*-mode:c++; c-file-style: "gnu";-*- */
2 /*
3  * $Id: HTMLAttributeList.h,v 1.7 2007/07/02 18:48:18 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 _HTMLATTRIBUTELIST_H_
25 #define _HTMLATTRIBUTELIST_H_ 1
26 
27 #ifdef __GNUG__
28 # pragma interface
29 #endif
30 
37 #include <string>
38 #include <iostream>
39 #include <vector>
40 
41 #include "cgicc/CgiDefs.h"
42 #include "cgicc/MStreamable.h"
43 #include "cgicc/HTMLAttribute.h"
44 
45 namespace cgicc {
46 
47  // ============================================================
48  // Class HTMLAttributeList
49  // ============================================================
50 
51 #ifdef WIN32
52  template class CGICC_API std::vector<HTMLAttribute>;
53 #endif
54 
69  class CGICC_API HTMLAttributeList
70  {
71  public:
72 
73  // ============================================================
74 
77 
84 
91  HTMLAttributeList(const HTMLAttribute& head);
92 
100 
108 
109 
110  // ============================================================
111 
114 
122  operator= (const HTMLAttributeList &list);
124 
125 
126  // ============================================================
127 
132 
141  set(const std::string& name);
142 
152  set(const std::string& name,
153  const std::string& value);
155 
158 
165  void
166  render(std::ostream& out) const;
168 
169  private:
170  std::vector<HTMLAttribute> fAttributes;
171  };
172 
173  // ============================================================
174  // List manipulators
175  // ============================================================
176 
188  inline HTMLAttributeList
189  set(const std::string& name)
190  { return HTMLAttributeList(HTMLAttribute(name)); }
191 
204  inline HTMLAttributeList
205  set(const std::string& name,
206  const std::string& value)
207  { return HTMLAttributeList(HTMLAttribute(name, value)); }
208 
209 } // namespace cgicc
210 
211 #endif /* ! _HTMLATTRIBUTES_H_ */

GNU cgicc - A C++ class library for writing CGI applications
Copyright © 1996 - 2004 Stephen F. Booth
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front Cover Texts, and with no Back-Cover Texts.
Documentation generated Fri Jun 28 2013 08:36:33 for cgicc by doxygen 1.8.3.1