A RAII wrapper for Gumbo.
More...
|
| Html (const char *buffer) noexcept |
| Constructs an Html from a non-owning null-terminated string. More...
|
|
| Html (const char *buffer, std::size_t size) noexcept |
| Constructs an Html from a non-owning pointer. More...
|
|
| ~Html () noexcept |
|
| Html (Html &&) noexcept=default |
|
Html & | operator= (Html &&) noexcept=default |
|
const GumboNode * | root () const noexcept |
| Returns a non-owning pointer to the root node of the HTML document. More...
|
|
A RAII wrapper for Gumbo.
All HTML is expected to be UTF-8 encoded. Gumbo will parse anything you throw at it. When given invalid or incomplete HTML it will even fix it for you.
- Example:
Html page(
"<html><body>This is a string containing html</body></html>");
const GumboNode *
root = page.root();
assert(html_root.matches(
root));
const GumboNode * root() const noexcept
Returns a non-owning pointer to the root node of the HTML document.
Html(const char *buffer) noexcept
Constructs an Html from a non-owning null-terminated string.
@ HTML
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/html
Definition at line 46 of file Html.h.
◆ Html() [1/3]
hext::Html::Html |
( |
const char * |
buffer | ) |
|
|
explicitnoexcept |
Constructs an Html from a non-owning null-terminated string.
- Warning
- The buffer must stay alive until the destruction of this instance.
- Parameters
-
buffer | A null-terminated string containing HTML. |
◆ Html() [2/3]
hext::Html::Html |
( |
const char * |
buffer, |
|
|
std::size_t |
size |
|
) |
| |
|
noexcept |
Constructs an Html from a non-owning pointer.
- Warning
- The buffer must stay alive until the destruction of this instance.
- Parameters
-
buffer | A string containing HTML. |
size | The length of the given buffer. |
◆ ~Html()
◆ Html() [3/3]
hext::Html::Html |
( |
Html && |
| ) |
|
|
defaultnoexcept |
◆ operator=()
◆ root()
const GumboNode* hext::Html::root |
( |
| ) |
const |
|
noexcept |
Returns a non-owning pointer to the root node of the HTML document.
- Warning
- The pointer may not be used after the destruction of this instance.
The documentation for this class was generated from the following file: