iDocumentNode Struct Reference
[Utilities]
Representation of a node in a document.
More...
#include <iutil/document.h>
Inheritance diagram for iDocumentNode:

Public Member Functions | |
virtual csDocumentNodeType | GetType ()=0 |
Get the type of this node (one of CS_NODE_...). | |
virtual bool | Equals (iDocumentNode *other)=0 |
Compare this node with another node. | |
virtual const char * | GetValue ()=0 |
Get the value of this node. | |
virtual void | SetValue (const char *value)=0 |
Set the value of this node. | |
virtual void | SetValueAsInt (int value)=0 |
Set value to the string representation of an integer. | |
virtual void | SetValueAsFloat (float value)=0 |
Set value to the string representation of a float. | |
virtual csRef< iDocumentNode > | GetParent ()=0 |
Get the parent. | |
virtual csRef< iDocumentNodeIterator > | GetNodes ()=0 |
Get an iterator over all children. | |
virtual csRef< iDocumentNodeIterator > | GetNodes (const char *value)=0 |
Get an iterator over all children of the specified value. | |
virtual csRef< iDocumentNode > | GetNode (const char *value)=0 |
Get the first node of the given value. | |
virtual void | RemoveNode (const csRef< iDocumentNode > &child)=0 |
Remove a child. | |
virtual void | RemoveNodes ()=0 |
Remove all children. | |
virtual csRef< iDocumentNode > | CreateNodeBefore (csDocumentNodeType type, iDocumentNode *before=0)=0 |
Create a new node of the given type before the given node. | |
virtual const char * | GetContentsValue ()=0 |
Get the value of a node. | |
virtual int | GetContentsValueAsInt ()=0 |
Get the value of a node as an integer. | |
virtual float | GetContentsValueAsFloat ()=0 |
Get the value of a node as float. | |
virtual csRef< iDocumentAttributeIterator > | GetAttributes ()=0 |
Get an iterator over all attributes. | |
virtual csRef< iDocumentAttribute > | GetAttribute (const char *name)=0 |
Get an attribute by name. | |
virtual const char * | GetAttributeValue (const char *name)=0 |
Get an attribute value by name as a string. | |
virtual int | GetAttributeValueAsInt (const char *name)=0 |
Get an attribute value by name as an integer. | |
virtual float | GetAttributeValueAsFloat (const char *name)=0 |
Get an attribute value by name as a floating point value. | |
virtual bool | GetAttributeValueAsBool (const char *name, bool defaultvalue=false)=0 |
Get an attribute value by name as a bool. | |
virtual void | RemoveAttribute (const csRef< iDocumentAttribute > &attr)=0 |
Remove an attribute. | |
virtual void | RemoveAttributes ()=0 |
Remove all attributes. | |
virtual void | SetAttribute (const char *name, const char *value)=0 |
Change or add an attribute. | |
virtual void | SetAttributeAsInt (const char *name, int value)=0 |
Change or add an attribute to a string representation of an integer. | |
virtual void | SetAttributeAsFloat (const char *name, float value)=0 |
Change or add an attribute to a string representation of a float. |
Detailed Description
Representation of a node in a document.Main creators of instances implementing this interface:
Main ways to get pointers to this interface:- iDocument::GetRoot()
- iDocumentNode::GetNode()
- iDocumentNode::GetParent()
- iDocumentNodeIterator::Next()
Definition at line 169 of file document.h.
Member Function Documentation
|
Create a new node of the given type before the given node. If the given node is 0 then it will be added at the end. Returns the new node or 0 if the given type is not valid (CS_NODE_DOCUMENT is not allowed here for example). |
|
Compare this node with another node. You have to use this function to compare document nodes as equality on the iDocumentNode pointer itself doesn't work in all cases (iDocumentNode is just a wrapper of the real node in some implementations). |
|
Get an attribute by name.
|
|
Get an iterator over all attributes.
|
|
Get an attribute value by name as a string.
|
|
Get an attribute value by name as a bool. "yes", "true", and "1" all are returned as true. |
|
Get an attribute value by name as a floating point value.
|
|
Get an attribute value by name as an integer.
|
|
Get the value of a node. Scans all child nodes and looks for a node of type 'text', and returns the text of that node. WARNING! Make a copy of this text if you intend to use it later. The document parsing system does not guarantee anything about the lifetime of the returned string. |
|
Get the value of a node as float. Scans all child nodes and looks for a node of type 'text', converts the text of that node to a number and returns the represented floating point value. |
|
Get the value of a node as an integer. Scans all child nodes and looks for a node of type 'text', converts the text of that node to a number and returns the represented integer. |
|
Get the first node of the given value.
|
|
Get an iterator over all children of the specified value.
|
|
Get an iterator over all children.
|
|
Get the parent.
|
|
Get the type of this node (one of CS_NODE_...).
|
|
Get the value of this node. What this is depends on the type of the node:
|
|
Remove an attribute.
|
|
Remove all attributes.
|
|
Remove a child.
|
|
Remove all children.
|
|
Change or add an attribute.
|
|
Change or add an attribute to a string representation of a float.
|
|
Change or add an attribute to a string representation of an integer.
|
|
Set the value of this node. What this is depends on the type of the node:
|
|
Set value to the string representation of a float.
|
|
Set value to the string representation of an integer.
|
The documentation for this struct was generated from the following file:
- iutil/document.h
Generated for Crystal Space by doxygen 1.3.9.1