Google
Web alhem.net

Cgi::HtmlDocument Class Reference

#include <HtmlDocument.h>

Inheritance diagram for Cgi::HtmlDocument:

Inheritance graph
Collaboration diagram for Cgi::HtmlDocument:

Collaboration graph
List of all members.

Public Member Functions

 HtmlDocument (doctype_t=DOCTYPE_HTML_401_TRANSITIONAL)
 ~HtmlDocument ()
std::string ToString () const
 Generate full tag including content and closing tag.
ElementCopy ()
doctype_t GetDoctype ()
 Get Document type from HtmlDocument.

Private Attributes

doctype_t m_doctype

Detailed Description

Definition at line 10 of file HtmlDocument.h.


Constructor & Destructor Documentation

Cgi::HtmlDocument::HtmlDocument ( doctype_t  = DOCTYPE_HTML_401_TRANSITIONAL  ) 

Definition at line 10 of file HtmlDocument.cpp.

Referenced by Copy().

00011 :ElementList("html")
00012 ,m_doctype(t)
00013 {
00014 }

Cgi::HtmlDocument::~HtmlDocument (  ) 

Definition at line 17 of file HtmlDocument.cpp.

00018 {
00019 }


Member Function Documentation

std::string Cgi::HtmlDocument::ToString (  )  const [virtual]

Generate full tag including content and closing tag.

Reimplemented from Cgi::ElementList.

Definition at line 22 of file HtmlDocument.cpp.

References Cgi::DOCTYPE_HTML_20, Cgi::DOCTYPE_HTML_32, Cgi::DOCTYPE_HTML_401_FRAMESET, Cgi::DOCTYPE_HTML_401_STRICT, Cgi::DOCTYPE_HTML_401_TRANSITIONAL, Cgi::DOCTYPE_XHTML_1_0_FRAMESET, Cgi::DOCTYPE_XHTML_1_0_STRICT, Cgi::DOCTYPE_XHTML_1_0_TRANSITIONAL, m_doctype, and Cgi::ElementList::ToString().

Referenced by main().

00023 {
00024         std::string r;
00025         switch (m_doctype)
00026         {
00027         case DOCTYPE_HTML_20:
00028                 r = "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML//EN\">";
00029                 break;
00030         case DOCTYPE_HTML_32:
00031                 r = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\">";
00032                 break;
00033         case DOCTYPE_HTML_401_TRANSITIONAL:
00034                 r = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">";
00035                 break;
00036         case DOCTYPE_HTML_401_STRICT:
00037                 r = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">";
00038                 break;
00039         case DOCTYPE_HTML_401_FRAMESET:
00040                 r = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Frameset//EN\" \"http://www.w3.org/TR/html4/frameset.dtd\">";
00041                 break;
00042         case DOCTYPE_XHTML_1_0_TRANSITIONAL:
00043                 r = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";
00044                 break;
00045         case DOCTYPE_XHTML_1_0_STRICT:
00046                 r = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">";
00047                 break;
00048         case DOCTYPE_XHTML_1_0_FRAMESET:
00049                 r = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Frameset//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\">";
00050                 break;
00051         }
00052         r += "\n";
00053         return r + ElementList::ToString();
00054 }

Element* Cgi::HtmlDocument::Copy (  )  [inline, virtual]

Implements Cgi::Element.

Definition at line 18 of file HtmlDocument.h.

References HtmlDocument().

00018 { return new HtmlDocument(*this); }

doctype_t Cgi::HtmlDocument::GetDoctype (  )  [inline, virtual]

Get Document type from HtmlDocument.

Reimplemented from Cgi::Element.

Definition at line 20 of file HtmlDocument.h.

References m_doctype.

00020 { return m_doctype; }


Member Data Documentation

doctype_t Cgi::HtmlDocument::m_doctype [private]

Definition at line 23 of file HtmlDocument.h.

Referenced by GetDoctype(), and ToString().


The documentation for this class was generated from the following files:
Generated for cgi++ by doxygen 1.3.7

Page, code, and content Copyright (C) 2004 by Anders Hedström