libhtmlpp 1.0.0
Loading...
Searching...
No Matches
Classes | Enumerations | Functions | Variables
libhtmlpp Namespace Reference

Core namespace for the libhtmlpp HTML parsing and printing library. More...

Classes

class  CommentElement
 Leaf node representing an HTML comment (). More...
 
class  CSSDeclaration
 
class  CSSProperty
 
class  CSSRule
 
class  CSSStyleSheet
 
class  DocElements
 
class  Element
 Abstract base class for all nodes in the HTML tree. More...
 
class  HtmlElement
 
class  HTMLException
 
class  HtmlPage
 High level loader/saver for HTML documents (files and strings). More...
 
class  HtmlString
 
class  HtmlTable
 
class  ScriptElement
 Element representing a <script> tag and its text content. More...
 
class  SvgElement
 Element representing an embedded <svg> tag and its attributes/content. More...
 
class  TextArea
 Element representing an embedded <textarea> tag and its attributes/content. More...
 
class  TextElement
 Leaf node representing plain text content of an HTML document. More...
 

Enumerations

enum  ElementType {
  TextEl =0 , HtmlEl =1 , CommentEl =2 , ScriptEL =3 ,
  SvgEL =4 , TextAreaEL =5
}
 

Functions

void _copy (libhtmlpp::Element *dest, const libhtmlpp::Element *src)
 
void print (const Element &element, HtmlString &output, bool formated=false)
 Serializes an element (and its subtree) into an HtmlString.
 
void HtmlDecode (const std::string &input, HtmlString &output)
 Decodes special HTML characters in a string and appends to an HtmlString.
 
void HtmlDecode (const std::string &input, std::string &output)
 Decodes special HTML characters in a string and appends to an std::string.
 
void HtmlEncode (const std::string &input, std::string &output)
 Encodes special HTML characters in a string and writes into std::string.
 
void reverse (char s[])
 
bool isdigit (const char src)
 
bool isalpha (const char src)
 

Variables

const char * HtmlSigns [][2]
 
const std::array< std::string_view, 100 > ContainerTypes
 

Detailed Description

Core namespace for the libhtmlpp HTML parsing and printing library.

Enumeration Type Documentation

◆ ElementType

Enumerator
TextEl 
HtmlEl 
CommentEl 
ScriptEL 
SvgEL 
TextAreaEL 

Definition at line 64 of file html.h.

Function Documentation

◆ _copy()

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

Definition at line 1056 of file html.cpp.

◆ HtmlDecode() [1/2]

void libhtmlpp::HtmlDecode ( const std::string &  input,
HtmlString output 
)

Decodes special HTML characters in a string and appends to an HtmlString.

Parameters
inputPlain input string.
outputDestination HtmlString that receives encoded characters.

Definition at line 706 of file html.cpp.

◆ HtmlDecode() [2/2]

void libhtmlpp::HtmlDecode ( const std::string &  input,
std::string &  output 
)

Decodes special HTML characters in a string and appends to an std::string.

Parameters
inputPlain input string.
outputDestination HtmlString that receives encoded characters.

Definition at line 689 of file html.cpp.

◆ HtmlEncode()

void libhtmlpp::HtmlEncode ( const std::string &  input,
std::string &  output 
)

Encodes special HTML characters in a string and writes into std::string.

Parameters
inputPlain input string.
outputReceives encoded HTML string.

Definition at line 672 of file html.cpp.

◆ isalpha()

bool libhtmlpp::isalpha ( const char  src)
inline

Definition at line 55 of file utils.h.

◆ isdigit()

bool libhtmlpp::isdigit ( const char  src)
inline

Definition at line 46 of file utils.h.

◆ print()

void libhtmlpp::print ( const Element element,
HtmlString output,
bool  formated = false 
)

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

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

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

Definition at line 2067 of file html.cpp.

◆ reverse()

void libhtmlpp::reverse ( char  s[])
inline

Definition at line 35 of file utils.h.

Variable Documentation

◆ ContainerTypes

const std::array<std::string_view,100> libhtmlpp::ContainerTypes

Definition at line 62 of file html.cpp.

◆ HtmlSigns

const char* libhtmlpp::HtmlSigns[][2]
Initial value:
={
{"\"","&quot;"},
{"&","&amp;"},
{"<","&lt;"},
{">","&gt;"},
{"'","&apos;"},
{"+","&plus;"},
{nullptr,nullptr}
}

Definition at line 31 of file encode.h.