libdom
|
#include <assert.h>
#include <stdlib.h>
#include <dom/core/node.h>
#include <dom/core/document.h>
#include <dom/core/nodelist.h>
#include <dom/core/string.h>
#include "core/document.h"
#include "core/node.h"
#include "core/nodelist.h"
#include "utils/utils.h"
Classes | |
struct | dom_nodelist |
Functions | |
dom_exception | _dom_nodelist_create (dom_document *doc, nodelist_type type, dom_node_internal *root, dom_string *tagname, dom_string *namespace, dom_string *localname, dom_nodelist **list) |
void | dom_nodelist_ref (dom_nodelist *list) |
void | dom_nodelist_unref (dom_nodelist *list) |
dom_exception | dom_nodelist_get_length (dom_nodelist *list, uint32_t *length) |
dom_exception | _dom_nodelist_item (dom_nodelist *list, uint32_t index, dom_node **node) |
bool | _dom_nodelist_match (dom_nodelist *list, nodelist_type type, dom_node_internal *root, dom_string *tagname, dom_string *namespace, dom_string *localname) |
bool | _dom_nodelist_equal (dom_nodelist *l1, dom_nodelist *l2) |
dom_exception _dom_nodelist_create | ( | dom_document * | doc, |
nodelist_type | type, | ||
dom_node_internal * | root, | ||
dom_string * | tagname, | ||
dom_string * | namespace, | ||
dom_string * | localname, | ||
dom_nodelist ** | list ) |
Create a nodelist
doc | Owning document |
type | The type of the NodeList |
root | Root node of subtree that list applies to |
tagname | Name of nodes in list (or NULL) |
namespace | Namespace part of nodes in list (or NULL) |
localname | Local part of nodes in list (or NULL) |
list | Pointer to location to receive list |
::root must be a node owned by ::doc
The returned list will already be referenced, so the client need not do so explicitly. The client must unref the list once finished with it.
bool _dom_nodelist_equal | ( | dom_nodelist * | l1, |
dom_nodelist * | l2 ) |
Test whether the two NodeList are equal
l1 | One list |
l2 | The other list \reutrn true for equal, false otherwise. |
dom_exception _dom_nodelist_item | ( | dom_nodelist * | list, |
uint32_t | index, | ||
dom_node ** | node ) |
Retrieve an item from a node list
list | The list to retrieve the item from |
index | The list index to retrieve |
node | Pointer to location to receive item |
::index is a zero-based index into list. ::index lies in the range [0, length-1]
The returned node will have had its reference count increased. The client should unref the node once it has finished with it.
NOTE: If node contains a node pointer already, it will NOT be unreffed. Managing the lifetime of that is up to the caller.
bool _dom_nodelist_match | ( | dom_nodelist * | list, |
nodelist_type | type, | ||
dom_node_internal * | root, | ||
dom_string * | tagname, | ||
dom_string * | namespace, | ||
dom_string * | localname ) |
Match a nodelist instance against a set of nodelist creation parameters
list | List to match |
type | The type of the NodeList |
root | Root node of subtree that list applies to |
tagname | Name of nodes in list (or NULL) |
namespace | Namespace part of nodes in list (or NULL) |
localname | Local part of nodes in list (or NULL) |
dom_exception dom_nodelist_get_length | ( | dom_nodelist * | list, |
uint32_t * | length ) |
Retrieve the length of a node list
list | List to retrieve length of |
length | Pointer to location to receive length |
void dom_nodelist_ref | ( | dom_nodelist * | list | ) |
Claim a reference on a DOM node list
list | The list to claim a reference on |
void dom_nodelist_unref | ( | dom_nodelist * | list | ) |
Release a reference on a DOM node list
list | The list to release the reference from |
If the reference count reaches zero, any memory claimed by the list will be released