A fixed list of nodes of any kind (eg, the results of Node::childNodes()).
The list is a snapshot, where the web's childNodes is live. Later changes to the page never add, remove, or reorder its entries, and a node removed from the page stays in the list and stays valid. Call childNodes() again when you need the current children.
child.remove();
}
A reference to an item in the DOM tree.
Definition Node.h:147
NodeList childNodes() const
Get the node's children of every kind in order (childNodes).
Definition NodeList.h:171
@ Text
A text node.
Definition Node.h:70
A NodeList can be moved but not copied.
The list doesn't keep its page alive. Once the page goes away, the list keeps its length but its nodes fail safely (see dom::Element).
|
| | NodeList ()=default |
| | Create an empty NodeList (length() is 0).
|
| | NodeList (const NodeList &)=delete |
| NodeList & | operator= (const NodeList &)=delete |
| | NodeList (NodeList &&other) noexcept |
| | Move constructor (other becomes empty).
|
| NodeList & | operator= (NodeList &&other) noexcept |
| | Move assignment (destroys the current list and other becomes empty).
|
| | ~NodeList () |
| | Destroy the list (nodes you got from it aren't affected).
|
| size_t | length () const |
| | Get the number of nodes in the list (length).
|
| size_t | size () const |
| | Get the number of nodes in the list (the same as length()).
|
| bool | empty () const |
| | Whether or not the list has no nodes (length() is 0).
|
| Node | item (size_t index) const |
| | Get the node at an index (item).
|
| Node | operator[] (size_t index) const |
| | Get the node at an index (the same as item()).
|
| iterator | begin () const |
| iterator | end () const |
| ULDOMNodeList | raw () const |
| | Get the C handle, for passing to the <Ultralight/CAPI/CAPI_DOMNode.h> functions.
|
| ULDOMNodeList | LeakRef () |
| | Give up ownership of the C handle and return it.
|