40#ifndef DRAIN_TREE_HTML
41#define DRAIN_TREE_HTML
46#include "ReferenceMap.h"
63typedef drain::UnorderedMultiTree<NodeHTML,false, NodeXML<>::path_t>
TreeHTML;
77 JAVASCRIPT_SCOPE=XML::JAVASCRIPT_SCOPE,
79 HEAD, BASE, LINK, META, TITLE,
80 BODY, A, BR, CAPTION, DIV, H1, H2, H3, HR, IMG, LI, OL, P, PRE, SPAN, TABLE, TR, TH, TD, UL};
90DRAIN_ENUM_DICT(Html::tag_t);
91DRAIN_ENUM_OSTREAM(Html::tag_t);
115 NodeHTML(
const Html::tag_t & t = Html::tag_t(0));
168 void handleType()
override final;
176std::ostream & operator<<(std::ostream &ostr,
const NodeHTML & node){
185 ostr <<
"<!DOCTYPE html>\n";
195const NodeXML<Html::tag_t>::xml_default_elem_map_t NodeXML<Html::tag_t>::xml_default_elems;
203void TreeHTML::initChild(
TreeHTML & child)
const {
204 UtilsXML::initChildWithDefaultType(*
this, child);
228TreeHTML & TreeHTML::operator()(
const Html::tag_t & type){
237const TreeHTML::key_t & TreeHTML::getKey(
const Html::tag_t & type){
238 return Enum<Html::tag_t>::dict.getKey(type,
false);
244const TreeHTML::key_t & TreeHTML::getKey(
const ClassXML & cls){
245 return cls.strPrefixed();
272template <> // for T (Tree class)
273template <> // for K (path elem arg)
274const TreeHTML & TreeHTML::operator[](const ClassXML & cls) const ;
276template <> // for T (Tree class)
277template <> // for K (path elem arg)
278bool TreeHTML::hasChild(const ClassXML & cls) const;
284TreeHTML & TreeHTML::operator=(std::initializer_list<std::pair<const char *,const Variable> > l){
292TreeHTML & TreeHTML::operator=(
const std::string & arg){
301TreeHTML & TreeHTML::operator=(
const T & arg){
314std::ostream & operator<<(std::ostream &ostr,
const TreeHTML & 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: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:416
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:281
static T & assign(T &dst, const T &src)
Assign another tree structure to another.
Definition UtilsXML.h:60
static TX & setType(TX &tree, const typename TX::node_data_t::xml_tag_t &type)
Definition UtilsXML.h:172
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:134
static N & xmlAssignNode(N &dst, const N &src)
Assign tree node (data) to another.
Definition XML.h:664
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 Enum.h:51