46 #include "ReferenceMap.h"
65 HEAD, BASE, LINK, META, TITLE,
66 BODY, A, BR, CAPTION, DIV, H1, H2, H3, HR, IMG, LI, OL, P, SPAN, TABLE, TR, TH, TD, UL};
94 void setType(
const elem_t &t);
119 std::ostream & docToStream(std::ostream &ostr,
const xml_tree_t & tree){
120 ostr <<
"<!DOCTYPE html>\n";
141 std::ostream & operator<<(std::ostream &ostr,
const NodeHTML & node){
148 std::ostream & operator<<(std::ostream &ostr,
const TreeHTML & tree){
157 bool NodeXML<BaseHTML::tag_t>::isSelfClosing()
const;
160 DRAIN_TYPENAME(NodeHTML);
161 DRAIN_TYPENAME(BaseHTML::tag_t);
167 TreeHTML & TreeHTML::addChild(
const TreeHTML::key_t & key);
174 TreeHTML & TreeHTML::operator()(
const BaseHTML::tag_t & type){
175 this->data.setType(type);
198 if (elem.hasChildren()){
199 return elem.getChildren().begin()->second;
203 return elem.addChild()(tagType);
222 template <
class T,
class ...TT>
225 appendElem(elem, tagType, arg);
226 return appendElem(elem, tagType, args...);
236 for (
const auto & title: columnTitles){
253 for (
const auto & entry: table.getChildren()){
255 for (
const auto & e: entry.second.getChildren()){
256 tr[e.first]->setType(drain::NodeHTML::TD);
281 if (elem.hasChildren()){
282 return elem.getChildren().rbegin()->second;
Definition: FileInfo.h:48
Definition: TreeHTML.h:78
NodeHTML(const elem_t &t=elem_t(0))
Default constructor.
Definition: TreeHTML.cpp:92
Definition: TreeXML.h:135
BaseHTML::tag_t elem_t
Tag type, CTEXT or COMMENT.
Definition: TreeXML.h:147
static std::ostream & toStream(std::ostream &ostr, const V &t, const std::string &defaultTag="", int indent=0)
"Forward definition" of Tree::toOstream
static std::ostream & toStream(std::ostream &ostr, const std::initializer_list< T > &x, const SprinterLayout &layout=defaultLayout)
New (experimental)
Definition: Sprinter.h:420
Definition: TreeHTML.h:183
static drain::TreeHTML & addChild(drain::TreeHTML &elem, drain::BaseHTML::tag_t tagType, const std::string &key)
Add element of given type. The path key is generated automatically, unless given.
Definition: TreeHTML.cpp:210
static drain::TreeHTML & initHtml(drain::TreeHTML &html, const std::string &key="")
Initialize a HTML object with "head" (including "title", "style") and "body" elements.
Definition: TreeHTML.cpp:185
static drain::TreeHTML & fillTableRow(drain::TreeHTML &table, drain::TreeHTML &tr, const T &value)
Creates a new table row (TD) using first row as a template.
Definition: TreeHTML.h:251
Definition: DataSelector.cpp:1277
NodeHTML::xml_tree_t TreeHTML
The HTML data structure.
Definition: TreeHTML.h:136
Definition: TreeHTML.h:56