40#ifndef DRAIN_TREE_HTML
41#define DRAIN_TREE_HTML
46#include "ReferenceMap.h"
63typedef drain::UnorderedMultiTree<NodeHTML,false, NodeXML<>::path_t>
TreeHTML;
78 HEAD, BASE, LINK, META, TITLE,
79 BODY, A, BR, CAPTION, DIV, H1, H2, H3, HR, IMG, LI, OL, P, PRE, SPAN, TABLE, TR, TH, TD, UL};
89DRAIN_ENUM_DICT(Html::tag_t);
113 NodeHTML(
const Html::tag_t & t = Html::tag_t(0));
166 void handleType()
override final;
174std::ostream & operator<<(std::ostream &ostr,
const NodeHTML & node){
183 ostr <<
"<!DOCTYPE html>\n";
193const NodeXML<Html::tag_t>::xml_default_elem_map_t NodeXML<Html::tag_t>::xml_default_elems;
201void TreeHTML::initChild(
TreeHTML & child)
const {
202 UtilsXML::initChildWithDefaultType(*
this, child);
224bool TreeHTML::hasChild(
const Html::tag_t & type)
const {
225 return TreeHTML::hasChild(EnumDict<Html::tag_t>::dict.getKey(type,
false));
233TreeHTML & TreeHTML::operator()(
const Html::tag_t & type){
241TreeHTML & TreeHTML::operator[](
const Html::tag_t & type);
245const TreeHTML & TreeHTML::operator[](
const Html::tag_t & type)
const;
251TreeHTML & TreeHTML::operator[](
const ClassXML & cls);
256const TreeHTML & TreeHTML::operator[](
const ClassXML & cls)
const ;
261bool TreeHTML::hasChild(
const ClassXML & cls)
const;
267TreeHTML & TreeHTML::operator=(std::initializer_list<std::pair<const char *,const Variable> > l){
275TreeHTML & TreeHTML::operator=(
const std::string & arg){
284TreeHTML & TreeHTML::operator=(
const T & arg){
297std::ostream & operator<<(std::ostream &ostr,
const TreeHTML & tree){
Definition TreeHTML.h:104
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:188
virtual bool isExplicit() const override final
Tell if this element should always have separate opening and closing tags even when empty,...
Definition TreeHTML.cpp:209
static std::ostream & docTypeToStream(std::ostream &ostr)
Write the XML definition beginning any XML document.
Definition TreeXML.h:751
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:414
static std::ostream & docToStream(std::ostream &ostr, const V &tree)
Definition TreeXML.h:733
void appendElem(const elem_t &elem)
Main method for adding elements.
Definition Path.h:246
static T & assign(T &dst, const T &src)
Assign another tree structure to another.
Definition UtilsXML.h:57
static TX & setType(TX &tree, const typename TX::node_data_t::xml_tag_t &type)
Definition UtilsXML.h:169
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:131
static N & xmlAssignNode(N &dst, const N &src)
Assign tree node (data) to another.
Definition XML.h:623
Definition DataSelector.cpp:1277
drain::UnorderedMultiTree< NodeHTML, false, NodeXML<>::path_t > TreeHTML
The HTML data structure.
Definition TreeHTML.h:63
DRAIN_TYPENAME(void)
Add a specialization for each type of those you want to support.
A container for a static dictionary of enumeration values.
Definition EnumUtils.h:52