#include <SDXNode.h>

Public Member Functions | |
| Node (std::string name) | |
| Constructor. | |
| Node (Node &other) | |
| Copy contructor taking a reference to a node. | |
| Node (Node *other) | |
| Copy contructor taking a pointer to a node. | |
| Node * | addAttribute (Attribute *attribute) |
| Add attribute to node. | |
| Node * | addAttribute (std::string name, std::string value) |
| Convenience function that creates an attribute with the given name and value. | |
| const std::string | getName () |
| Get the name of this node. | |
| const std::vector< Attribute * > | getAttributes () |
| Get all attributes of this node. | |
| const std::vector< Attribute * > | getAttributes (std::string attributeName) |
| Get all attributes that are named attributeName. | |
| Attribute * | getAttribute (unsigned int index=0) |
| Get the nth attribute of this node. | |
| Attribute * | getAttribute (std::string attributeName) |
| Get the last attribute that is named attributeName. | |
| const std::vector< Attribute * > | getNamedAttributes () |
| Get all named attributes of this node. | |
| const std::vector< Attribute * > | getUnnamedAttributes () |
| Get all unnamed attributes of this node. | |
| template<class T > | |
| bool | getAttributeValue (T *value, int attributeIndex=0) |
| Get the value of the nth attribute of this node. | |
| template<class T > | |
| bool | getAttributeValue (T *value, std::string attributeName) |
| Get the value of the last attribute that is named attributeName. | |
| template<class T > | |
| bool | getNodeAttributeValue (T *value, std::string nodeName, int attributeIndex=0) |
| Get the value of the nth attribute of the last child node that is named attributeName. | |
| void | sendToContentHandler (ContentHandler *contentHandler, bool onlySendContents=false) |
| Send this node (recursively) to the given contentHandler. | |
Definition at line 16 of file SDXNode.h.
| SDX::Node::Node | ( | std::string | name | ) |
Constructor.
| name | The name of the node |
| Node::Node | ( | Node & | other | ) |
Copy contructor taking a reference to a node.
| other | The node of which this node should be a copy. |
Definition at line 15 of file SDXNode.cpp.
| Node::Node | ( | Node * | other | ) |
Copy contructor taking a pointer to a node.
| other | The node of which this node should be a copy. |
Definition at line 25 of file SDXNode.cpp.
| Node* SDX::Node::addAttribute | ( | std::string | name, | |
| std::string | value | |||
| ) |
Convenience function that creates an attribute with the given name and value.
This is equivalent to addAttribute(new Attribute(name, value)).
| name | The name of the attribute. | |
| value | The value of the attribute. |
Add attribute to node.
Remember that all child attributes of a node will be deallocated on destruction of the node unless NodeContainer::setDeallocateContentOnDestruct() has been called been used to prevent this.
| attribute | The attribute to add to the node. |
Definition at line 42 of file SDXNode.cpp.
| Attribute * Node::getAttribute | ( | std::string | attributeName | ) |
Get the last attribute that is named attributeName.
| attributeName | Name of the attribute to return. |
Definition at line 81 of file SDXNode.cpp.
| Attribute * Node::getAttribute | ( | unsigned int | index = 0 |
) |
Get the nth attribute of this node.
| index | Position of the attribute to return. |
Definition at line 73 of file SDXNode.cpp.
| const std::vector<Attribute*> SDX::Node::getAttributes | ( | std::string | attributeName | ) |
Get all attributes that are named attributeName.
| attributeName | Only attributes that are named like this are returned. |
| bool SDX::Node::getAttributeValue | ( | T * | value, | |
| std::string | attributeName | |||
| ) | [inline] |
Get the value of the last attribute that is named attributeName.
| value | The variable to write the value to. | |
| attributeName | Name of the attribute to get. |
| bool SDX::Node::getAttributeValue | ( | T * | value, | |
| int | attributeIndex = 0 | |||
| ) | [inline] |
Get the value of the nth attribute of this node.
| value | The variable to write the value to. | |
| attributeIndex | Position of the attribute to get. |
| bool SDX::Node::getNodeAttributeValue | ( | T * | value, | |
| std::string | nodeName, | |||
| int | attributeIndex = 0 | |||
| ) | [inline] |
Get the value of the nth attribute of the last child node that is named attributeName.
| value | The variable to write the value to. | |
| nodeName | Name of the child node of which to get the attribute. | |
| attributeIndex | Position of the attribute in the child node. |
| void Node::sendToContentHandler | ( | ContentHandler * | contentHandler, | |
| bool | onlySendContents = false | |||
| ) |
Send this node (recursively) to the given contentHandler.
| contentHandler | Content handler to send node to. | |
| onlySendContents | If set to true, contentHandler->startNode(<Name of this node>) and contentHandler->endNode() will not be called for this node (but they will be called for the child nodes). |
Definition at line 113 of file SDXNode.cpp.
1.5.8