46 #include "ReferenceMap.h"
66 HEAD, BASE, LINK, META, TITLE,
67 BODY, A, BR, CAPTION, DIV, H1, H2, H3, HR, IMG, LI, OL, P, SPAN, TABLE, TR, TH, TD, UL};
89 NodeHTML(
const tag_t & t = tag_t(0));
126 std::ostream & docToStream(std::ostream &ostr,
const xml_tree_t & tree){
127 ostr <<
"<!DOCTYPE html>\n";
139 void handleType(
const tag_t &t)
override final;
153 TreeHTML & TreeHTML::operator=(std::initializer_list<std::pair<const char *,const Variable> > l){
160 TreeHTML & TreeHTML::operator=(
const T & arg){
166 std::ostream & operator<<(std::ostream &ostr,
const NodeHTML & node){
184 bool NodeXML<BaseHTML::tag_t>::isSelfClosing()
const;
187 DRAIN_TYPENAME(NodeHTML);
188 DRAIN_TYPENAME(BaseHTML::tag_t);
195 TreeHTML & TreeHTML::addChild(
const TreeHTML::key_t & key){
200 const NodeXML<BaseHTML::tag_t>::xml_default_elem_map_t NodeXML<BaseHTML::tag_t>::xml_default_elems;
206 TreeHTML & TreeHTML::operator()(
const BaseHTML::tag_t & type){
230 if (elem.hasChildren()){
231 return elem.getChildren().begin()->second;
235 return elem.addChild()(tagType);
258 template <
class T,
class ...TT>
261 appendElem(elem, tagType, arg);
262 return appendElem(elem, tagType, args...);
272 for (
const auto & title: columnTitles){
289 for (
const auto & entry: table.getChildren()){
291 for (
const auto & e: entry.second.getChildren()){
292 tr[e.first]->setType(drain::NodeHTML::TD);
317 if (elem.hasChildren()){
318 return elem.getChildren().rbegin()->second;
Definition: FileInfo.h:48
Definition: TreeHTML.h:80
NodeHTML(const tag_t &t=tag_t(0))
Default constructor.
Definition: TreeHTML.cpp:165
virtual void handleType(const tag_t &t) override final
Internal function called after setType()
Definition: TreeHTML.cpp:180
Definition: TreeXML.h:341
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:215
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:287
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:262
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:287
static X & xmlAssignNode(X &dst, const X &src)
Assign another tree structure to another.
Definition: XML.h:497
static TX & xmlSetType(TX &tree, const typename TX::node_data_t::xml_tag_t &type)
Definition: XML.h:559
static T & xmlAddChild(T &tree, const std::string &key)
Definition: XML.h:573
static TX & xmlAssign(TX &dst, const TX &src)
Assign another tree structure to another.
Definition: XML.h:458
Definition: DataSelector.cpp:1277
NodeHTML::xml_tree_t TreeHTML
The HTML data structure.
Definition: TreeHTML.h:148
Definition: TreeHTML.h:56