libhtmlpp 1.0.0
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
libhtmlpp::HtmlElement Class Reference

#include <html.h>

Inheritance diagram for libhtmlpp::HtmlElement:
[legend]

Classes

struct  Attributes
 

Public Member Functions

 HtmlElement ()
 
 HtmlElement (const std::string &tag)
 
 HtmlElement (const HtmlElement &hel)
 
 HtmlElement (const HtmlElement *hel)
 
 ~HtmlElement ()
 
HtmlElementoperator= (const HtmlElement &hel)
 
HtmlElementoperator= (const HtmlElement *hel)
 
bool operator== (const HtmlElement *hel)
 
bool operator== (const HtmlElement &hel)
 
void setAttribute (const std::string &name, const std::string &value)
 
void setIntAttribute (const std::string &name, int value)
 
const std::string getAtributte (const std::string &name) const
 
int getIntAtributte (const std::string &name) const
 
void insertChild (const Element *el)
 
void insertChild (const Element &el)
 
void appendChild (const Element *el)
 
void appendChild (const Element &el)
 
void setTagname (const std::string &name)
 
const std::string getTagname () const
 
HtmlElementgetElementbyID (const std::string &id) const
 
HtmlElementgetElementbyTag (const std::string &tag) const
 
ElementfirstChild () const
 
const AttributesfirstAttribute () const
 
int getType () const
 
void remove (Element *el)
 
- Public Member Functions inherited from libhtmlpp::Element
virtual ~Element ()
 
 Element (const Element &el)
 
void insertAfter (Element *el)
 
void insertBefore (Element *el)
 
Elementoperator= (const Element &hel)
 
Elementoperator= (const Element *hel)
 
ElementnextElement () const
 
ElementprevElement () const
 

Static Public Member Functions

static size_t parseElement (const std::vector< char > &in, std::unique_ptr< libhtmlpp::Element > &el, size_t start, bool &termination)
 

Protected Member Functions

void _serialelize (const std::vector< char > &in)
 Extracts tag name and attributes from a token vector into an HtmlElement.
 
- Protected Member Functions inherited from libhtmlpp::Element
 Element ()
 

Protected Attributes

std::unique_ptr< Element_childElement =nullptr
 
- Protected Attributes inherited from libhtmlpp::Element
std::unique_ptr< Element_nextElement
 
Element_prevElement
 

Friends

class HtmlString
 
class HtmlTable
 
void print (const Element &element, HtmlString &output, bool formated)
 Serializes an element (and its subtree) into an HtmlString.
 
void _copy (libhtmlpp::Element *dest, const libhtmlpp::Element *src)
 

Detailed Description

Definition at line 108 of file html.h.

Constructor & Destructor Documentation

◆ HtmlElement() [1/4]

libhtmlpp::HtmlElement::HtmlElement ( )

Definition at line 718 of file html.cpp.

◆ HtmlElement() [2/4]

libhtmlpp::HtmlElement::HtmlElement ( const std::string &  tag)

Definition at line 713 of file html.cpp.

◆ HtmlElement() [3/4]

libhtmlpp::HtmlElement::HtmlElement ( const HtmlElement hel)

Definition at line 724 of file html.cpp.

◆ HtmlElement() [4/4]

libhtmlpp::HtmlElement::HtmlElement ( const HtmlElement hel)

Definition at line 728 of file html.cpp.

◆ ~HtmlElement()

libhtmlpp::HtmlElement::~HtmlElement ( )

Definition at line 732 of file html.cpp.

Member Function Documentation

◆ _serialelize()

void libhtmlpp::HtmlElement::_serialelize ( const std::vector< char > &  in)
protected

Extracts tag name and attributes from a token vector into an HtmlElement.

Parameters
inToken buffer containing a single open tag.
outDestination HtmlElement to populate.
Exceptions
HTMLExceptionif no tag could be determined.

Definition at line 903 of file html.cpp.

◆ appendChild() [1/2]

void libhtmlpp::HtmlElement::appendChild ( const Element el)

Definition at line 825 of file html.cpp.

◆ appendChild() [2/2]

void libhtmlpp::HtmlElement::appendChild ( const Element el)

Definition at line 783 of file html.cpp.

◆ firstAttribute()

const libhtmlpp::HtmlElement::Attributes * libhtmlpp::HtmlElement::firstAttribute ( ) const

Definition at line 2435 of file html.cpp.

◆ firstChild()

libhtmlpp::Element * libhtmlpp::HtmlElement::firstChild ( ) const

Definition at line 2419 of file html.cpp.

◆ getAtributte()

const std::string libhtmlpp::HtmlElement::getAtributte ( const std::string &  name) const

Definition at line 2487 of file html.cpp.

◆ getElementbyID()

libhtmlpp::HtmlElement * libhtmlpp::HtmlElement::getElementbyID ( const std::string &  id) const

Definition at line 2365 of file html.cpp.

◆ getElementbyTag()

libhtmlpp::HtmlElement * libhtmlpp::HtmlElement::getElementbyTag ( const std::string &  tag) const

Definition at line 2392 of file html.cpp.

◆ getIntAtributte()

int libhtmlpp::HtmlElement::getIntAtributte ( const std::string &  name) const

Definition at line 2501 of file html.cpp.

◆ getTagname()

const std::string libhtmlpp::HtmlElement::getTagname ( ) const

Definition at line 744 of file html.cpp.

◆ getType()

int libhtmlpp::HtmlElement::getType ( ) const
virtual

Implements libhtmlpp::Element.

Reimplemented in libhtmlpp::ScriptElement, libhtmlpp::SvgElement, and libhtmlpp::TextArea.

Definition at line 2517 of file html.cpp.

◆ insertChild() [1/2]

void libhtmlpp::HtmlElement::insertChild ( const Element el)

Definition at line 779 of file html.cpp.

◆ insertChild() [2/2]

void libhtmlpp::HtmlElement::insertChild ( const Element el)

Definition at line 750 of file html.cpp.

◆ operator=() [1/2]

libhtmlpp::HtmlElement & libhtmlpp::HtmlElement::operator= ( const HtmlElement hel)

Definition at line 848 of file html.cpp.

◆ operator=() [2/2]

libhtmlpp::HtmlElement & libhtmlpp::HtmlElement::operator= ( const HtmlElement hel)

Definition at line 853 of file html.cpp.

◆ operator==() [1/2]

bool libhtmlpp::HtmlElement::operator== ( const HtmlElement hel)

Definition at line 840 of file html.cpp.

◆ operator==() [2/2]

bool libhtmlpp::HtmlElement::operator== ( const HtmlElement hel)

Definition at line 830 of file html.cpp.

◆ parseElement()

size_t libhtmlpp::HtmlElement::parseElement ( const std::vector< char > &  in,
std::unique_ptr< libhtmlpp::Element > &  el,
size_t  start,
bool &  termination 
)
static

Definition at line 1013 of file html.cpp.

◆ remove()

void libhtmlpp::HtmlElement::remove ( libhtmlpp::Element el)
virtual

Reimplemented from libhtmlpp::Element.

Definition at line 858 of file html.cpp.

◆ setAttribute()

void libhtmlpp::HtmlElement::setAttribute ( const std::string &  name,
const std::string &  value 
)

Definition at line 2439 of file html.cpp.

◆ setIntAttribute()

void libhtmlpp::HtmlElement::setIntAttribute ( const std::string &  name,
int  value 
)

Definition at line 2481 of file html.cpp.

◆ setTagname()

void libhtmlpp::HtmlElement::setTagname ( const std::string &  name)

Definition at line 739 of file html.cpp.

Friends And Related Symbol Documentation

◆ _copy

void _copy ( libhtmlpp::Element dest,
const libhtmlpp::Element src 
)
friend

Definition at line 1056 of file html.cpp.

◆ HtmlString

friend class HtmlString
friend

Definition at line 180 of file html.h.

◆ HtmlTable

friend class HtmlTable
friend

Definition at line 181 of file html.h.

◆ print

void print ( const Element element,
HtmlString output,
bool  formated 
)
friend

Serializes an element (and its subtree) into an HtmlString.

Parameters
elementRoot element to print.
outputOutput buffer to append serialized HTML to.
formatedIf true, pretty-prints the output with line breaks/indentation.

Member Data Documentation

◆ _childElement

std::unique_ptr<Element> libhtmlpp::HtmlElement::_childElement =nullptr
protected

Definition at line 169 of file html.h.


The documentation for this class was generated from the following files: