Generic string parser node class
This is an abstract class for any type of node that is used within the string parser. General warning: This class contains code regarding references that is very tricky. Please do not touch this code unless you exactly know what you are doing. Incorrect handling of references may cause PHP to crash with a segmentation fault! You have been warned.
Located in /stringparser.class.php (line 838)
Class | Description |
---|---|
StringParser_Node_Root | String parser root node class |
StringParser_Node_Text | String parser text node class |
StringParser_BBCode_Node_Paragraph | BBCode String parser paragraph node class |
StringParser_BBCode_Node_Element | BBCode String parser element node class |
Occured at
This defines the position in the parsed text where this node occurred at. If -1, this value was not possible to be determined.
The children of this node.
It contains an array of references to all the children nodes of this node.
The node ID
This ID uniquely identifies this node. This is needed when searching for a specific node in the children array. Please note that this is only an internal variable and should never be used - not even in subclasses and especially not in external data structures. This ID has nothing to do with any type of ID in HTML oder XML.
The parent of this node.
It is either null (root node) or a reference to the parent object.
The type of this node.
There are three standard node types: root node, text node and unknown node. All node types are integer constants. Any node type of a subclass must be at least 32 to allow future developements.
Destroy a node
Constructor
Currently, the constructor only allocates a new ID for the node and assigns it.
Append a node to the children
This function appends a node to the children array(). It automatically sets the StrinParser_Node::_parent property of the node that is to be appended.
Append text to last text child
Dump nodes
This dumps a tree of nodes
Checks equality of this node and another node
Search for nodes with a certain criterium and return the count
Similar to getNodesByCriterium
Search for nodes with a certain criterium
This may be used to implement getElementsByTagName etc.
Insert a node after another node
Insert a node before another node
Determines whether a criterium matches this node
Prepend a node
Remove a child node
This function removes a child from the children array. A parameter tells the function whether to destroy the child afterwards or not. If the specified node is not a child of this node, the function will return false.
Dump this node to a string
Find a child node
This function searches for a node in the own children and returns the index of the node or false if the node is not a child of this node.
Documentation generated on Mon, 10 Dec 2007 13:29:39 +0100 by phpDocumentor 1.4.0