UPnPsdk 0.1
Universal Plug and Play +, Software Development Kit
 
Loading...
Searching...
No Matches
node.cpp File Reference
#include <ixml/ixmlparser.hpp>
#include <cassert>
#include <cstring>
+ Include dependency graph for node.cpp:

Go to the source code of this file.

Functions

void ixmlNode_init (IXML_Node *nodeptr)
 Intializes a node.
 
void ixmlCDATASection_init (IXML_CDATASection *nodeptr)
 Initializes a CDATASection node.
 
void ixmlCDATASection_free (IXML_CDATASection *nodeptr)
 Frees a CDATASection node.
 
static void ixmlNode_freeSingleNode (IXML_Node *nodeptr)
 Frees a node content.
 
void ixmlNode_free (IXML_Node *nodeptr)
 Frees a Node and all Nodes in its subtree.
 
const DOMString ixmlNode_getNodeName (IXML_Node *nodeptr)
 Returns the name of the Node, depending on what type of Node it is, in a read-only string.
 
const DOMString ixmlNode_getLocalName (IXML_Node *nodeptr)
 Retrieves the local name of a Node, if present.
 
static int ixmlNode_setNamespaceURI (IXML_Node *nodeptr, const char *namespaceURI)
 Sets the namespace URI of the node.
 
static int ixmlNode_setPrefix (IXML_Node *nodeptr, const char *prefix)
 Set the prefix of the node.
 
static int ixmlNode_setLocalName (IXML_Node *nodeptr, const char *localName)
 Set the localName of the node.
 
const DOMString ixmlNode_getNamespaceURI (IXML_Node *nodeptr)
 Retrieves the namespace URI for a Node as a DOMString.
 
const DOMString ixmlNode_getPrefix (IXML_Node *nodeptr)
 Retrieves the namespace prefix, if present.
 
const DOMString ixmlNode_getNodeValue (IXML_Node *nodeptr)
 Returns the value of the Node as a string.
 
int ixmlNode_setNodeValue (IXML_Node *nodeptr, const char *newNodeValue)
 Assigns a new value to a Node.
 
unsigned short ixmlNode_getNodeType (IXML_Node *nodeptr)
 Retrieves the type of a Node. Note that not all possible return values are actually implemented.
 
IXML_NodeixmlNode_getParentNode (IXML_Node *nodeptr)
 Retrieves the parent Node for a Node.
 
IXML_NodeixmlNode_getFirstChild (IXML_Node *nodeptr)
 Retrieves the first child Node of a Node.
 
IXML_NodeixmlNode_getLastChild (IXML_Node *nodeptr)
 Retrieves the last child Node of a Node.
 
IXML_NodeixmlNode_getPreviousSibling (IXML_Node *nodeptr)
 Retrieves the sibling Node immediately preceding this Node.
 
IXML_NodeixmlNode_getNextSibling (IXML_Node *nodeptr)
 Retrieves the sibling Node immediately following this Node.
 
IXML_DocumentixmlNode_getOwnerDocument (IXML_Node *nodeptr)
 Retrieves the document object associated with this Node.
 
static int ixmlNode_isAncestor (IXML_Node *ancestorNode, IXML_Node *toFind)
 Check if ancestorNode is ancestor of toFind.
 
static int ixmlNode_isParent (IXML_Node *nodeptr, IXML_Node *toFind)
 Check whether toFind is a children of nodeptr.
 
static int ixmlNode_allowChildren (IXML_Node *nodeptr, IXML_Node *newChild)
 Check to see whether nodeptr allows children of type newChild.
 
int ixmlNode_compare (IXML_Node *srcNode, IXML_Node *destNode)
 Compare two nodes to see whether they are the same node. Parent, sibling and children node are ignored.
 
int ixmlNode_insertBefore (IXML_Node *nodeptr, IXML_Node *newChild, IXML_Node *refChild)
 Inserts a new child Node before the existing child Node.
 
int ixmlNode_replaceChild (IXML_Node *nodeptr, IXML_Node *newChild, IXML_Node *oldChild, IXML_Node **returnNode)
 Replaces an existing child Node with a new child Node in the list of children of a Node.
 
int ixmlNode_removeChild (IXML_Node *nodeptr, IXML_Node *oldChild, IXML_Node **returnNode)
 Removes a child from the list of children of a Node.
 
int ixmlNode_appendChild (IXML_Node *nodeptr, IXML_Node *newChild)
 Appends a child Node to the list of children of a Node.
 
static IXML_NodeixmlNode_cloneTextNode (IXML_Node *nodeptr)
 Returns a clone of nodeptr.
 
static IXML_CDATASectionixmlNode_cloneCDATASect (IXML_CDATASection *nodeptr)
 Return a clone of CDATASection node.
 
static IXML_ElementixmlNode_cloneElement (IXML_Element *nodeptr)
 Returns a clone of element node.
 
static IXML_DocumentixmlNode_newDoc (void)
 Returns a new document node.
 
static IXML_AttrixmlNode_cloneAttr (IXML_Attr *nodeptr)
 Returns a clone of an attribute node.
 
static IXML_AttrixmlNode_cloneAttrDirect (IXML_Attr *nodeptr)
 Return a clone of attribute node, with specified field set to 1.
 
static void ixmlNode_setSiblingNodesParent (IXML_Node *nodeptr)
 Sets siblings nodes parent to be the same as this node's.
 
static IXML_NodeixmlNode_cloneNodeTreeRecursive (IXML_Node *nodeptr, int deep)
 Recursive function that clones a node tree of nodeptr.
 
static IXML_NodeixmlNode_cloneNodeTree (IXML_Node *nodeptr, int deep)
 Function that clones a node tree of nodeptr.
 
IXML_NodeixmlNode_cloneNode (IXML_Node *nodeptr, int deep)
 Clones a Node.
 
IXML_NodeListixmlNode_getChildNodes (IXML_Node *nodeptr)
 Retrieves the list of children of a Node in a NodeList structure.
 
IXML_NamedNodeMapixmlNode_getAttributes (IXML_Node *nodeptr)
 Retrieves the attributes of a Node, if it is an Element node, in a NamedNodeMap structure.
 
int ixmlNode_hasChildNodes (IXML_Node *nodeptr)
 Queries whether or not a Node has children.
 
int ixmlNode_hasAttributes (IXML_Node *nodeptr)
 Queries whether this Node has attributes.
 
static void ixmlNode_getElementsByTagNameRecursive (IXML_Node *n, const char *tagname, IXML_NodeList **list)
 Recursively traverse the whole tree, search for element with the given tagname.
 
void ixmlNode_getElementsByTagName (IXML_Node *n, const char *tagname, IXML_NodeList **list)
 Returns a nodeList of all descendant Elements with a given tagName, in the order in which they are encountered in a traversal of this element tree.
 
static void ixmlNode_getElementsByTagNameNSRecursive (IXML_Node *n, const char *namespaceURI, const char *localName, IXML_NodeList **list)
 ixmlNode_getElementsByTagNameNSRecursive
 
void ixmlNode_getElementsByTagNameNS (IXML_Node *n, const char *namespaceURI, const char *localName, IXML_NodeList **list)
 Returns a nodeList of all the descendant Elements with a given local name and namespace URI in the order in which they are encountered in a preorder traversal of this Elememt tree.
 
int ixmlNode_setNodeName (IXML_Node *node, const DOMString qualifiedName)
 
int ixmlNode_setNodeProperties (IXML_Node *destNode, IXML_Node *src)
 

Function Documentation

◆ ixmlNode_init()

void ixmlNode_init ( IXML_Node nodeptr)

Intializes a node.

Parameters
[in]nodeptrThe Node to iniatialize.

Definition at line 43 of file node.cpp.

+ Here is the caller graph for this function:

◆ ixmlNode_freeSingleNode()

static void ixmlNode_freeSingleNode ( IXML_Node nodeptr)
static

Frees a node content.

Parameters
[in]nodeptrThe node to free.

Definition at line 62 of file node.cpp.

+ Here is the caller graph for this function:

◆ ixmlNode_setNamespaceURI()

static int ixmlNode_setNamespaceURI ( IXML_Node nodeptr,
const char *  namespaceURI 
)
static

Sets the namespace URI of the node.

Parameters
[in]nodeptrThe Node on which to operate.
[in]namespaceURIThe name space string to set.

Definition at line 198 of file node.cpp.

+ Here is the caller graph for this function:

◆ ixmlNode_setPrefix()

static int ixmlNode_setPrefix ( IXML_Node nodeptr,
const char *  prefix 
)
static

Set the prefix of the node.

Parameters
[in]nodeptrThe Node on which to operate.
[in]prefixThe prefix string to set.

Definition at line 225 of file node.cpp.

+ Here is the caller graph for this function:

◆ ixmlNode_setLocalName()

static int ixmlNode_setLocalName ( IXML_Node nodeptr,
const char *  localName 
)
static

Set the localName of the node.

Returns
IXML_SUCCESS or failure.
Parameters
[in]nodeptrThe pointer to the node.
[in]localNameThe local name to set.

Definition at line 254 of file node.cpp.

+ Here is the caller graph for this function:

◆ ixmlNode_isAncestor()

static int ixmlNode_isAncestor ( IXML_Node ancestorNode,
IXML_Node toFind 
)
static

Check if ancestorNode is ancestor of toFind.

Returns
1 or 0.
Parameters
[in]ancestorNodeThe candidate to ancestor Node.
[in]toFindThe Node to check for an ancestor.

Definition at line 396 of file node.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ixmlNode_isParent()

static int ixmlNode_isParent ( IXML_Node nodeptr,
IXML_Node toFind 
)
static

Check whether toFind is a children of nodeptr.

Returns
1 or 0.
Parameters
[in]nodeptrThe candidate to parent Node.
[in]toFindThe Node to check for his parent.

Definition at line 422 of file node.cpp.

+ Here is the caller graph for this function:

◆ ixmlNode_allowChildren()

static int ixmlNode_allowChildren ( IXML_Node nodeptr,
IXML_Node newChild 
)
static

Check to see whether nodeptr allows children of type newChild.

Returns
  • 1, if nodeptr can have newChild as children.
  • 0, if nodeptr cannot have newChild as children.
Parameters
[in]nodeptrThe Node to check.
[in]newChildThe child Node to check.

Definition at line 444 of file node.cpp.

+ Here is the caller graph for this function:

◆ ixmlNode_compare()

int ixmlNode_compare ( IXML_Node srcNode,
IXML_Node destNode 
)

Compare two nodes to see whether they are the same node. Parent, sibling and children node are ignored.

Returns
  • 1, the two nodes are the same.
  • 0, the two nodes are not the same.
Parameters
[in]srcNodeThe first Node.
[in]destNodeThe second Node.

Definition at line 490 of file node.cpp.

+ Here is the caller graph for this function:

◆ ixmlNode_cloneTextNode()

static IXML_Node * ixmlNode_cloneTextNode ( IXML_Node nodeptr)
static

Returns a clone of nodeptr.

Returns
A cloned node of nodeptr.
Parameters
[in]nodeptrThe Node to clone.

Definition at line 661 of file node.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ixmlNode_cloneCDATASect()

static IXML_CDATASection * ixmlNode_cloneCDATASect ( IXML_CDATASection nodeptr)
static

Return a clone of CDATASection node.

Returns
A clone of CDATASection node.
Parameters
[in]nodeptrThe Node to clone.

Definition at line 695 of file node.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ixmlNode_cloneElement()

static IXML_Element * ixmlNode_cloneElement ( IXML_Element nodeptr)
static

Returns a clone of element node.

Returns
A clone of element node.
Parameters
[in]nodeptrThe Node to clone.

Definition at line 730 of file node.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ixmlNode_newDoc()

static IXML_Document * ixmlNode_newDoc ( void  )
static

Returns a new document node.

Currently, the IXML_Document struct is just a node, so this function just mallocs the IXML_Document, sets the node type and name.

Returns
A new document node.

Definition at line 797 of file node.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ixmlNode_cloneAttr()

static IXML_Attr * ixmlNode_cloneAttr ( IXML_Attr nodeptr)
static

Returns a clone of an attribute node.

Returns
A clone of an attribute node.
Parameters
[in]nodeptrThe Node to clone.

Definition at line 822 of file node.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ixmlNode_cloneAttrDirect()

static IXML_Attr * ixmlNode_cloneAttrDirect ( IXML_Attr nodeptr)
static

Return a clone of attribute node, with specified field set to 1.

Returns
A clone of attribute node, with specified field set to 1.
Parameters
[in]nodeptrThe Node to clone.

Definition at line 883 of file node.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ixmlNode_setSiblingNodesParent()

static void ixmlNode_setSiblingNodesParent ( IXML_Node nodeptr)
static

Sets siblings nodes parent to be the same as this node's.

Parameters
[in]nodeptrThe node to operate on.

Definition at line 901 of file node.cpp.

+ Here is the caller graph for this function:

◆ ixmlNode_cloneNodeTreeRecursive()

static IXML_Node * ixmlNode_cloneNodeTreeRecursive ( IXML_Node nodeptr,
int  deep 
)
static

Recursive function that clones a node tree of nodeptr.

Returns
The cloned node/tree.
Parameters
[in]nodeptrNode tree to clone.
[in]deep1 if you want to clone the tree.

Definition at line 918 of file node.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ixmlNode_cloneNodeTree()

static IXML_Node * ixmlNode_cloneNodeTree ( IXML_Node nodeptr,
int  deep 
)
static

Function that clones a node tree of nodeptr.

Returns
The cloned node/tree.
Parameters
[in]nodeptrNode tree to clone.
[in]deep1 if you want to clone the tree.

Definition at line 1012 of file node.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ixmlNode_getElementsByTagNameRecursive()

static void ixmlNode_getElementsByTagNameRecursive ( IXML_Node n,
const char *  tagname,
IXML_NodeList **  list 
)
static

Recursively traverse the whole tree, search for element with the given tagname.

Parameters
[in]nThe Node tree.
[in]tagnameThe tag name to match.
[out]listThe output NodeList.

Definition at line 1188 of file node.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ixmlNode_getElementsByTagName()

void ixmlNode_getElementsByTagName ( IXML_Node n,
const char *  tagname,
IXML_NodeList **  list 
)

Returns a nodeList of all descendant Elements with a given tagName, in the order in which they are encountered in a traversal of this element tree.

Parameters
[in]nThe Node tree.
[in]tagnameThe tag name to match.
[out]listThe output NodeList.

Definition at line 1211 of file node.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ixmlNode_getElementsByTagNameNSRecursive()

static void ixmlNode_getElementsByTagNameNSRecursive ( IXML_Node n,
const char *  namespaceURI,
const char *  localName,
IXML_NodeList **  list 
)
static

ixmlNode_getElementsByTagNameNSRecursive

Parameters
[in]n.
[in]namespaceURI.
[in]localName.
[out]list.

Definition at line 1230 of file node.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ixmlNode_getElementsByTagNameNS()

void ixmlNode_getElementsByTagNameNS ( IXML_Node n,
const char *  namespaceURI,
const char *  localName,
IXML_NodeList **  list 
)

Returns a nodeList of all the descendant Elements with a given local name and namespace URI in the order in which they are encountered in a preorder traversal of this Elememt tree.

Parameters
[in]nThe Element tree.
[in]namespaceURIThe name space to match.
[in]localNameThe local name to match.
[out]listThe output NodeList.

Definition at line 1261 of file node.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ixmlNode_setNodeName()

int ixmlNode_setNodeName ( IXML_Node node,
const DOMString  qualifiedName 
)
Returns
Parameters
[in]nodeThe Node.
[in]qualifiedName.

Definition at line 1284 of file node.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ixmlNode_setNodeProperties()

int ixmlNode_setNodeProperties ( IXML_Node destNode,
IXML_Node src 
)
Returns
Parameters
[in]destNode.
[in]src.

Definition at line 1310 of file node.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function: