6#include <Ultralight/CAPI/CAPI_DOMNode.h>
49 NodeList(
NodeList&& other) noexcept : handle_(other.handle_) { other.handle_ =
nullptr; }
60 ulDestroyDOMNodeList(handle_);
61 handle_ = other.handle_;
62 other.handle_ =
nullptr;
77 size_t length()
const {
return ulDOMNodeListGetLength(handle_); }
151 ULDOMNodeList
raw()
const {
return handle_; }
159 ULDOMNodeList handle = handle_;
165 explicit NodeList(ULDOMNodeList handle) : handle_(handle) {}
168 ULDOMNodeList handle_ =
nullptr;
A reference to an item in the DOM tree.
Definition Node.h:147
detail::NodeStorage detail_
Internal storage (not part of the API).
Definition Node.h:166
NodeList childNodes() const
Get the node's children of every kind in order (childNodes).
Definition NodeList.h:171
static Node Adopt(ULDOMNode handle)
Wrap a C handle you own, taking ownership of it.
Definition Node.h:520
A forward iterator over the list's nodes, so range-for works (for (dom::Node node : list)).
Definition NodeList.h:113
iterator(const NodeList *list, size_t index)
Definition NodeList.h:115
bool operator!=(const iterator &other) const
Definition NodeList.h:122
bool operator==(const iterator &other) const
Definition NodeList.h:123
Node operator*() const
Definition NodeList.h:117
iterator & operator++()
Definition NodeList.h:118
A fixed list of nodes of any kind (eg, the results of Node::childNodes()).
Definition NodeList.h:34
NodeList & operator=(const NodeList &)=delete
iterator begin() const
Definition NodeList.h:130
ULDOMNodeList raw() const
Get the C handle, for passing to the <Ultralight/CAPI/CAPI_DOMNode.h> functions.
Definition NodeList.h:151
size_t size() const
Get the number of nodes in the list (the same as length()).
Definition NodeList.h:84
NodeList()=default
Create an empty NodeList (length() is 0).
NodeList(const NodeList &)=delete
Node item(size_t index) const
Get the node at an index (item).
Definition NodeList.h:98
bool empty() const
Whether or not the list has no nodes (length() is 0).
Definition NodeList.h:89
iterator end() const
Definition NodeList.h:131
NodeList(ULDOMNodeList handle)
Definition NodeList.h:165
size_t length() const
Get the number of nodes in the list (length).
Definition NodeList.h:77
Node operator[](size_t index) const
Get the node at an index (the same as item()).
Definition NodeList.h:107
NodeList(NodeList &&other) noexcept
Move constructor (other becomes empty).
Definition NodeList.h:49
static NodeList Adopt(ULDOMNodeList handle)
Wrap a C handle you own, taking ownership of it.
Definition NodeList.h:143
~NodeList()
Destroy the list (nodes you got from it aren't affected).
Definition NodeList.h:70
ULDOMNodeList LeakRef()
Give up ownership of the C handle and return it.
Definition NodeList.h:158
NodeList & operator=(NodeList &&other) noexcept
Move assignment (destroys the current list and other becomes empty).
Definition NodeList.h:58
Direct C++ access to modify page elements and handle events.
Root namespace for every public Ultralight type, function, and enumeration.