libhtmlpp 1.0.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
libhtmlpp::HtmlPage Class Reference

High level loader/saver for HTML documents (files and strings). More...

#include <html.h>

Public Member Functions

 HtmlPage ()
 
 ~HtmlPage ()
 
void loadFile (libhtmlpp::HtmlElement &html, const std::string &path)
 Loads an HTML file from disk into a given HtmlElement root.
 
void saveFile (libhtmlpp::HtmlElement &html, const std::string &path)
 Serializes an HtmlElement subtree and writes it to a file.
 
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 loadString (libhtmlpp::HtmlElement &html, const HtmlString *node)
 
bool isHtml5 ()
 

Detailed Description

High level loader/saver for HTML documents (files and strings).

Definition at line 430 of file html.h.

Constructor & Destructor Documentation

◆ HtmlPage()

libhtmlpp::HtmlPage::HtmlPage ( )

Definition at line 1888 of file html.cpp.

◆ ~HtmlPage()

libhtmlpp::HtmlPage::~HtmlPage ( )

Definition at line 1892 of file html.cpp.

Member Function Documentation

◆ isHtml5()

bool libhtmlpp::HtmlPage::isHtml5 ( )

Definition at line 1976 of file html.cpp.

◆ loadFile()

void libhtmlpp::HtmlPage::loadFile ( libhtmlpp::HtmlElement html,
const std::string &  path 
)

Loads an HTML file from disk into a given HtmlElement root.

Parameters
htmlOutput root element to populate.
pathFilesystem path to the HTML file.
Exceptions
HTMLExceptionif the file cannot be opened or parsed.

Definition at line 1901 of file html.cpp.

◆ loadString() [1/3]

void libhtmlpp::HtmlPage::loadString ( libhtmlpp::HtmlElement html,
const HtmlString node 
)

Definition at line 1936 of file html.cpp.

◆ loadString() [2/3]

void libhtmlpp::HtmlPage::loadString ( libhtmlpp::HtmlElement html,
const HtmlString node 
)

◆ loadString() [3/3]

void libhtmlpp::HtmlPage::loadString ( libhtmlpp::HtmlElement html,
const std::string &  src 
)

Parses an HTML source string and copies the result into html.

Parameters
htmlOutput root element to populate.
srcInput HTML source.
Exceptions
HTMLExceptionon malformed input.

Definition at line 1930 of file html.cpp.

◆ saveFile()

void libhtmlpp::HtmlPage::saveFile ( libhtmlpp::HtmlElement html,
const std::string &  path 
)

Serializes an HtmlElement subtree and writes it to a file.

Parameters
htmlElement to serialize.
pathDestination file path.
Exceptions
HTMLExceptionon I/O errors.

Definition at line 1957 of file html.cpp.


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