122 void setAttribute(
const std::string &name,
const std::string &value);
126 const std::string
getAtributte(
const std::string &name)
const;
147 const std::string
getKey()
const;
152 std::vector<char> _Key;
153 std::vector<char> _Value;
154 std::unique_ptr<Attributes> _nextAttr;
166 static size_t parseElement(
const std::vector<char> &in,std::unique_ptr<libhtmlpp::Element> &el,
size_t start,
bool &termination);
174 std::vector<char> _TagName;
177 std::unique_ptr<Attributes> _firstAttr;
200 void setText(
const std::string &txt);
204 static size_t parseElement(
const std::vector<char> &in,std::unique_ptr<libhtmlpp::Element> &el,
size_t start,
bool &termination);
230 static size_t parseElement(
const std::vector<char> &in,std::unique_ptr<libhtmlpp::Element> &el,
size_t start,
bool &termination);
260 static size_t parseElement(
const std::vector<char> &in,std::unique_ptr<libhtmlpp::Element> &el,
size_t start,
bool &termination);
283 const std::vector<char>
getSvg();
284 void setSvg(
const std::string &svg);
293 static size_t parseElement(
const std::vector<char> &in,std::unique_ptr<libhtmlpp::Element> &el,
size_t start,
bool &termination);
317 const std::vector<char>
getText();
318 void setText(
const std::string &text);
327 static size_t parseElement(
const std::vector<char> &in,std::unique_ptr<libhtmlpp::Element> &el,
size_t start,
bool &termination);
359 void append(
const std::string &src);
364 void insert(
size_t pos,
char src);
386 const std::vector<char>&
data()
const;
387 const std::string
str()
const;
388 const char *
c_str()
const;
398 std::unique_ptr<Element> _rootEl;
401 std::vector<char> _Data;
417 void HtmlDecode(
const std::string &input,std::string &output);
425 void HtmlEncode(
const std::string &input,std::string &output);
456 Column(
const std::string &data);
460 std::unique_ptr<Column> _nextColumn;
482 std::unique_ptr<Column> _firstColumn;
484 std::unique_ptr<Row> _nextRow;
498 std::unique_ptr<Row> _firstRow;
Abstract base class for all nodes in the HTML tree.
virtual void remove(Element *el)
void insertAfter(Element *el)
void insertBefore(Element *el)
Element & operator=(const Element &hel)
std::unique_ptr< Element > _nextElement
virtual int getType() const =0
friend void print(const Element &element, HtmlString &output, bool formated)
Serializes an element (and its subtree) into an HtmlString.
Element * prevElement() const
friend void _copy(libhtmlpp::Element *dest, const libhtmlpp::Element *src)
Element * nextElement() const
const Attributes * firstAttribute() const
HtmlElement * getElementbyTag(const std::string &tag) const
const std::string getAtributte(const std::string &name) const
void _serialelize(const std::vector< char > &in)
Extracts tag name and attributes from a token vector into an HtmlElement.
static size_t parseElement(const std::vector< char > &in, std::unique_ptr< libhtmlpp::Element > &el, size_t start, bool &termination)
void appendChild(const Element *el)
int getIntAtributte(const std::string &name) const
void setTagname(const std::string &name)
void setAttribute(const std::string &name, const std::string &value)
friend void print(const Element &element, HtmlString &output, bool formated)
Serializes an element (and its subtree) into an HtmlString.
bool operator==(const HtmlElement *hel)
friend void _copy(libhtmlpp::Element *dest, const libhtmlpp::Element *src)
void insertChild(const Element *el)
Element * firstChild() const
const std::string getTagname() const
HtmlElement * getElementbyID(const std::string &id) const
HtmlElement & operator=(const HtmlElement &hel)
std::unique_ptr< Element > _childElement
void setIntAttribute(const std::string &name, int value)
High level loader/saver for HTML documents (files and strings).
void loadString(libhtmlpp::HtmlElement &html, const std::string &src)
Parses an HTML source string and copies the result into html.
void loadString(libhtmlpp::HtmlElement &html, const HtmlString *node)
void saveFile(libhtmlpp::HtmlElement &html, const std::string &path)
Serializes an HtmlElement subtree and writes it to a file.
void loadFile(libhtmlpp::HtmlElement &html, const std::string &path)
Loads an HTML file from disk into a given HtmlElement root.
const std::vector< char > & data() const
friend void HtmlEncode(const std::string &input, HtmlString *output)
void append(const std::string &src)
HtmlString & operator<<(const char *src)
HtmlString & operator+=(const std::string &src)
char operator[](size_t pos) const
void push_back(const char src)
void insert(size_t pos, char src)
const char * c_str() const
libhtmlpp::Element & parse()
Parses the current buffer into a DOM-like tree and returns the root element.
HtmlString & operator=(const std::string &src)
const std::string str() const
Row & operator<<(Column &&col)
Column & operator[](size_t pos)
void delColumn(size_t pos)
Row & operator[](size_t pos)
Row & operator<<(const Row &row)
void deleteRow(size_t pos)
void parse(HtmlElement *element)
void insert(HtmlElement *element)
void setHeader(int count,...)
Element representing a <script> tag and its text content.
void setScript(const std::string &txt)
static size_t parseElement(const std::vector< char > &in, std::unique_ptr< libhtmlpp::Element > &el, size_t start, bool &termination)
ScriptElement & operator=(const Element &hel)
void insertChild(const Element &el)=delete
std::unique_ptr< Element > _childElement
void appendChild(const Element &el)=delete
std::vector< char > _Script
void appendChild(const Element *el)=delete
void insertChild(const Element *el)=delete
const std::string getScript()
friend void print(const Element &element, HtmlString &output, bool formated)
Serializes an element (and its subtree) into an HtmlString.
friend void _copy(libhtmlpp::Element *dest, const libhtmlpp::Element *src)
Element representing an embedded <svg> tag and its attributes/content.
void appendChild(const Element &el)=delete
void insertChild(const Element *el)=delete
SvgElement & operator=(const Element &hel)
static size_t parseElement(const std::vector< char > &in, std::unique_ptr< libhtmlpp::Element > &el, size_t start, bool &termination)
std::unique_ptr< Element > _childElement
const std::vector< char > getSvg()
void insertChild(const Element &el)=delete
friend void print(const Element &element, HtmlString &output, bool formated)
Serializes an element (and its subtree) into an HtmlString.
friend void _copy(libhtmlpp::Element *dest, const libhtmlpp::Element *src)
void appendChild(const Element *el)=delete
void setSvg(const std::string &svg)
Element representing an embedded <textarea> tag and its attributes/content.
std::unique_ptr< Element > _childElement
void appendChild(const Element &el)=delete
void insertChild(const Element &el)=delete
void appendChild(const Element *el)=delete
void insertChild(const Element *el)=delete
std::vector< char > _Text
friend void print(const Element &element, HtmlString &output, bool formated)
Serializes an element (and its subtree) into an HtmlString.
TextArea & operator=(const Element &hel)
const std::vector< char > getText()
friend void _copy(libhtmlpp::Element *dest, const libhtmlpp::Element *src)
static size_t parseElement(const std::vector< char > &in, std::unique_ptr< libhtmlpp::Element > &el, size_t start, bool &termination)
void setText(const std::string &text)
Leaf node representing plain text content of an HTML document.
TextElement & operator=(const Element &hel)
std::vector< char > _Text
void setText(const std::string &txt)
friend void print(const Element &element, HtmlString &output, bool formated)
Serializes an element (and its subtree) into an HtmlString.
friend void _copy(libhtmlpp::Element *dest, const libhtmlpp::Element *src)
static size_t parseElement(const std::vector< char > &in, std::unique_ptr< libhtmlpp::Element > &el, size_t start, bool &termination)
const std::string getText()
std::ostream & operator<<(std::ostream &os, const libhtmlpp::HtmlString &p)
Streams an HtmlString to an output stream using its underlying string.
Core namespace for the libhtmlpp HTML parsing and printing library.
void print(const Element &element, HtmlString &output, bool formated=false)
Serializes an element (and its subtree) into an HtmlString.
void HtmlEncode(const std::string &input, std::string &output)
Encodes special HTML characters in a string and writes into std::string.
void HtmlDecode(const std::string &input, HtmlString &output)
Decodes special HTML characters in a string and appends to an HtmlString.
const std::string getValue() const
friend void print(const Element &element, HtmlString &output, bool formated)
Serializes an element (and its subtree) into an HtmlString.
Attributes * nextAttribute() const
friend void _copy(libhtmlpp::Element *dest, const libhtmlpp::Element *src)
const std::string getKey() const