40#ifndef DRAIN_TREE_HTML
41#define DRAIN_TREE_HTML
46#include "ReferenceMap.h"
78 SCOPE_CURLY=XML::SCOPE_CURLY,
80 HEAD, BASE, LINK, META, TITLE,
81 BODY, A, BR, CAPTION, DIV, H1, H2, H3, HR, IMG, LI, OL, P, PRE, SPAN, TABLE, TR, TH, TD, UL};
88DRAIN_TYPENAME(Html::tag_t);
89DRAIN_ENUM_DICT(Html::tag_t);
90DRAIN_ENUM_OSTREAM(Html::tag_t)
114 NodeHTML(
const Html::tag_t & t = Html::tag_t(0));
148 void handleType()
override final;
155DRAIN_XML_EASY_TYPE(TreeHTML)
158std::ostream & operator<<(std::ostream &ostr,
const NodeHTML & node){
165 ostr <<
"<!DOCTYPE html>\n";
171const NodeXML<Html::tag_t>::xml_default_elem_map_t NodeXML<Html::tag_t>::xml_default_elems;
179void TreeHTML::initChild(TreeHTML & child)
const {
184DRAIN_GETKEY_ENUM(TreeHTML, Html::tag_t)
191const TreeHTML::key_t & TreeHTML::getKey(
const ClassXML & cls){
192 return cls.strPrefixed();
198TreeHTML & TreeHTML::operator=(std::initializer_list<std::pair<const char *,const Variable> > l){
206TreeHTML & TreeHTML::operator=(
const std::string & arg){
215TreeHTML & TreeHTML::operator=(
const T & arg){
221std::ostream &
operator<<(std::ostream &ostr,
const TreeHTML & tree){
222 return NodeHTML::docToStream(ostr, tree);
Definition TreeHTML.h:106
virtual bool isSingular() const override final
Tell if this element should always be a single tag, not separate opening and closing tags.
Definition TreeHTML.cpp:192
virtual bool isExplicit() const override final
Tell if this element should always have separate opening and closing tags even when empty,...
Definition TreeHTML.cpp:213
static std::ostream & docTypeToStream(std::ostream &ostr)
Write the XML definition beginning any XML document.
Definition TreeXML.h:358
virtual std::ostream & nodeToStream(std::ostream &ostr, tag_display_mode mode=EMPTY_TAG) const override
Dumps info. Future option: outputs leading and ending tag.
Definition TreeXML.h:412
void appendElem(const elem_t &elem)
Main method for adding elements.
Definition Path.h:279
static T & assign(T &dst, const T &src)
Assign another tree structure to another.
Definition UtilsXML.h:108
static TX & assignString(TX &tree, const std::string &s)
When assigning a string, create new element unless the element itself is of type CTEXT.
Definition UtilsXML.h:183
static bool initChildWithDefaultType(const T &tree, T &child)
Definition UtilsXML.h:91
static N & xmlAssignNode(N &dst, const N &src)
Assign tree node (data) to another.
Definition XML.h:887
std::ostream & operator<<(std::ostream &ostr, const PlainData< DT > &d)
Definition Data.h:631
A container for a static dictionary of enumeration values.
Definition Enum.h:51