![]() |
Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
#include <elm/xom/ParentNode.h>
Inheritance diagram for ParentNode:Public Member Functions | |
| virtual void | appendChild (Node *child) |
| virtual int | indexOf (Node *child) |
| virtual void | insertChild (Node *child, int position) |
| virtual Node * | removeChild (int position) |
| virtual Node * | removeChild (Node *child) |
| virtual void | replaceChild (Node *old_child, Node *new_child) |
| virtual void | setBaseURI (String URI)=0 |
| virtual Node * | getChild (int index) |
| virtual int | getChildCount (void) |
Public Member Functions inherited from Node | |
| virtual | ~Node (void) |
| void * | getNode (void) const |
| kind_t | kind (void) const |
| virtual Node * | copy (void)=0 |
| void | detach (void) |
| bool | equals (const Node *node) const |
| virtual String | getBaseURI (void) |
| virtual Document * | getDocument (void) |
| virtual ParentNode * | getParent (void) |
| virtual String | getValue (void)=0 |
| virtual Nodes * | query (const String &xpath) |
| virtual Nodes * | query (const String &xpath, XPathContext *context) |
| virtual String | toXML (void)=0 |
| int | line (void) const |
Protected Member Functions | |
| ParentNode (void *node) | |
| void | internSetBaseURI (String URI) |
Protected Member Functions inherited from Node | |
| Node (void *_node) | |
| void | setNode (void *_node) |
| Node * | make (void *node) |
| Node * | get (void *node) |
| Node * | internCopy (void) |
| Node * | internGetChild (int index) |
| int | internGetChildCount (void) |
| String | internGetValue (void) |
| String | internToXML (void) |
Additional Inherited Members | |
Public Types inherited from Node | |
| enum | kind_t { NONE = 0 , ELEMENT , DOCUMENT , TEXT , COMMENT , ATTRIBUTE , PROCESSING_INSTRUCTION , DOCTYPE , NAMESPACE } |
| typedef enum elm::xom::Node::kind_t | kind_t |
Static Protected Member Functions inherited from Node | |
| static void | freeNode (void *node) |
Protected Attributes inherited from Node | |
| void * | node |
This class provides to the node facilities for containing children.
|
inlineprotected |
Build a node from a reader.
| node | Node built by the reader. |
Appends a node to the children of this node.
| child | node to append to this node |
Reimplemented in Element.
References Node::freeNode(), Node::getNode(), Node::node, and Node::setNode().
Referenced by Element::appendChild(), and XSLTransform::toDocument().
|
virtual |
Get the child node at the given position.
| position | Position of the looked child. |
Implements Node.
References Node::make(), and Node::node.
Referenced by XOMElementSerializer::beginObject(), XOMUnserializer::flush(), ParentNode::removeChild(), Serializer::write(), Serializer::writeEndTag(), and Serializer::writeStartTag().
|
virtual |
Get the count of children of the current node.
Implements Node.
References Node::node.
Referenced by XOMElementSerializer::beginObject(), XOMUnserializer::flush(), Serializer::write(), Serializer::writeEndTag(), and Serializer::writeStartTag().
|
virtual |
Returns the position of a node within the children of this node. This is a number between 0 and one less than the number of children of this node. It returns -1 if child does not have this node as a parent.
| child | the node whose position is desired |
References Node::getNode(), and Node::node.
Inserts a child node at the specified position. The child node previously at that position (if any) and all subsequent child nodes are moved up by one. That is, when inserting a node at 2, the old node at 2 is moved to 3, the old child at 3 is moved to 4, and so forth. Inserting at position 0 makes the child the first child of this node. Inserting at the position getChildCount() makes the child the last child of the node.
| position | where to insert the child |
| child | the node to insert |
| IllegalAddException | if this node cannot have a child of the argument's type. |
| MultipleParentException | if child already has a parent |
Reimplemented in Element.
References Node::getNode(), and Node::node.
Referenced by Element::insertChild().
|
virtual |
Removes the child of this node at the specified position. Indexes begin at 0 and count up to one less than the number of children in this node.
| position | index of the node to remove |
| the | node which was removed |
References ParentNode::getChild().
Referenced by XOMElementSerializer::beginObject().
Removes the specified child of this node.
| child | child node to remove. |
References Node::getNode().
Replaces an existing child with a new child node. If oldChild is not a child of this node, then a NoSuchChildException is thrown.
| oldChild | the node removed from the tree |
| newChild | the node inserted into the tree |
| MultipleParentException | if newChild already has a parent. |
| IllegalAddException | if this node cannot have children of the type of newChild. |
Reimplemented in Document.
References Node::getNode().