Nebula
Loading...
Searching...
No Matches
htmlpagewriter.h
Go to the documentation of this file.
1#pragma once
2#ifndef HTTP_HTMLPAGEWRITER_H
3#define HTTP_HTMLPAGEWRITER_H
4//------------------------------------------------------------------------------
14#include "io/streamwriter.h"
16#include "io/xmlwriter.h"
17#include "util/array.h"
18#include "util/stack.h"
19
20//------------------------------------------------------------------------------
21namespace Http
22{
24{
26public:
30 virtual ~HtmlPageWriter();
32 void SetTitle(const Util::String& title);
34 void SetStyle(const Util::String& style);
36 virtual bool Open();
38 virtual void Close();
39
41 void AddAttr(const Util::String& name, const Util::String& value);
45 void End(HtmlElement::Code e);
47 void Element(HtmlElement::Code e, const Util::String& text);
49 void LineBreak();
51 void HorizontalRule();
53 void Text(const Util::String& t);
55 void Raw(const Util::String& r);
56
58 void TableRow2(const Util::String& col0, const Util::String& col1);
59
60private:
66};
67
68//------------------------------------------------------------------------------
71inline void
73{
74 this->title = t;
75}
76
77//------------------------------------------------------------------------------
80inline void
82{
83 this->style = s;
84}
85
86} // namespace Http
87//------------------------------------------------------------------------------
88#endif
89
Code
elements
Definition htmlelement.h:25
A stream writer which supports writing a HTML-formatted page into a stream.
Definition htmlpagewriter.h:24
Util::String title
Definition htmlpagewriter.h:61
virtual void Close()
end writing the stream
Definition htmlpagewriter.cc:74
void Raw(const Util::String &r)
add inline raw HTML
Definition htmlpagewriter.cc:176
Util::Array< Util::KeyValuePair< Util::String, Util::String > > attrs
Definition htmlpagewriter.h:64
void Begin(HtmlElement::Code e)
begin a generic element
Definition htmlpagewriter.cc:114
void End(HtmlElement::Code e)
end a generic element
Definition htmlpagewriter.cc:132
void LineBreak()
write a line break
Definition htmlpagewriter.cc:145
Ptr< IO::XmlWriter > xmlWriter
Definition htmlpagewriter.h:63
Util::Stack< HtmlElement::Code > elementStack
Definition htmlpagewriter.h:65
__DeclareClass(HtmlPageWriter)
void SetStyle(const Util::String &style)
set the styling of the page
Definition htmlpagewriter.h:81
virtual ~HtmlPageWriter()
destructor
Definition htmlpagewriter.cc:27
void AddAttr(const Util::String &name, const Util::String &value)
add an attribute for the next element
Definition htmlpagewriter.cc:101
void Element(HtmlElement::Code e, const Util::String &text)
shortcut for Begin()/Text()/End()
Definition htmlpagewriter.cc:185
HtmlPageWriter()
constructor
Definition htmlpagewriter.cc:19
void SetTitle(const Util::String &title)
set the title of the page
Definition htmlpagewriter.h:72
Util::String style
Definition htmlpagewriter.h:62
void HorizontalRule()
write a horizontal rule
Definition htmlpagewriter.cc:156
virtual bool Open()
begin writing the stream
Definition htmlpagewriter.cc:36
void TableRow2(const Util::String &col0, const Util::String &col1)
write a 2-element table row
Definition htmlpagewriter.cc:196
Stream writer classes provide a specialized write-interface for a stream.
Definition streamwriter.h:22
Nebula's smart pointer class which manages the life time of RefCounted objects.
Definition ptr.h:38
Nebula's dynamic array class.
Definition array.h:60
Nebula's stack class (a FILO container).
Definition stack.h:19
This file was generated with Nebula Trifid's idlc compiler tool.
Definition defaulthttprequesthandler.cc:15
Nebula's universal string class.
Definition string.h:50