PixelLightAPI
.
|
Abstract XML node. More...
#include <XmlNode.h>
Public Types | |
enum | ENodeType { Document, Element, Comment, Unknown, Text, Declaration, NumOfTypes } |
The supported types of XML nodes. (All the unsupported types are picked up by 'Unknown'.) More... | |
Public Member Functions | |
virtual PLCORE_API | ~XmlNode () |
Destructor. | |
String | GetValue () const |
The meaning of 'value' changes for the specific type of 'XmlNode'. | |
void | SetValue (const String &sValue) |
Changes the value of the node. | |
PLCORE_API void | Clear () |
Delete all the children of this node. | |
XmlNode * | GetParent () |
One step up the DOM. | |
const XmlNode * | GetParent () const |
XmlNode * | GetFirstChild () |
Returns the first child of this node. | |
const XmlNode * | GetFirstChild () const |
PLCORE_API XmlNode * | GetFirstChild (const String &sValue) |
Returns the first child of this node with the matching 'value'. | |
PLCORE_API const XmlNode * | GetFirstChild (const String &sValue) const |
XmlNode * | GetLastChild () |
Returns the last child of this node. | |
const XmlNode * | GetLastChild () const |
PLCORE_API XmlNode * | GetLastChild (const String &sValue) |
Returns the last child of this node with the matching 'value'. | |
PLCORE_API const XmlNode * | GetLastChild (const String &sValue) const |
XmlNode * | IterateChildren (XmlNode *pPrevious) |
An alternate way to walk the children of a node. | |
const XmlNode * | IterateChildren (const XmlNode *pPrevious) const |
XmlNode * | IterateChildren (const String &sValue, XmlNode *pPrevious) |
This flavor of 'IterateChildren()' searches for children with a particular 'value'. | |
const XmlNode * | IterateChildren (const String &sValue, const XmlNode *pPrevious) const |
PLCORE_API XmlNode * | InsertEndChild (const XmlNode &cAddThis) |
Add a new node related to this (adds a child past the last child) | |
PLCORE_API XmlNode * | LinkEndChild (XmlNode &cAddThis) |
Add a new node related to this (adds a child past the last child) | |
PLCORE_API XmlNode * | InsertBeforeChild (XmlNode &cBeforeThis, const XmlNode &cAddThis) |
Add a new node related to this (adds a child before the specified child) | |
PLCORE_API XmlNode * | InsertAfterChild (XmlNode &cAfterThis, const XmlNode &cAddThis) |
Add a new node related to this (adds a child after the specified child) | |
PLCORE_API XmlNode * | ReplaceChild (XmlNode &cReplaceThis, const XmlNode &cWithThis) |
Replace a child of this node. | |
PLCORE_API bool | RemoveChild (XmlNode &cRemoveThis) |
Delete a child of this node. | |
XmlNode * | GetPreviousSibling () |
Navigate to a sibling node. | |
const XmlNode * | GetPreviousSibling () const |
PLCORE_API XmlNode * | GetPreviousSibling (const String &sValue) |
Navigate to a sibling node with the given 'value'. | |
PLCORE_API const XmlNode * | GetPreviousSibling (const String &sValue) const |
XmlNode * | GetNextSibling () |
Navigate to a sibling node. | |
const XmlNode * | GetNextSibling () const |
PLCORE_API XmlNode * | GetNextSibling (const String &sValue) |
Navigate to a sibling node with the given 'value'. | |
PLCORE_API const XmlNode * | GetNextSibling (const String &sValue) const |
XmlElement * | GetNextSiblingElement () |
Convenience function to get through elements. | |
PLCORE_API const XmlElement * | GetNextSiblingElement () const |
PLCORE_API XmlElement * | GetNextSiblingElement (const String &sValue) |
Convenience function to get through elements. | |
PLCORE_API const XmlElement * | GetNextSiblingElement (const String &sValue) const |
XmlElement * | GetFirstChildElement () |
Convenience function to get through elements. | |
PLCORE_API const XmlElement * | GetFirstChildElement () const |
XmlElement * | GetFirstChildElement (const String &sValue) |
Convenience function to get through elements. | |
PLCORE_API const XmlElement * | GetFirstChildElement (const String &sValue) const |
ENodeType | GetType () const |
Query the type (as an enumerated value, above) of this node. | |
XmlDocument * | GetDocument () |
Return a pointer to the document this node lives in. | |
PLCORE_API const XmlDocument * | GetDocument () const |
bool | NoChildren () const |
Returns true if this node has no children. | |
XmlDocument * | ToDocument () |
Cast functions, will return a null pointer if the given node is not from the requested type. | |
const XmlDocument * | ToDocument () const |
XmlElement * | ToElement () |
const XmlElement * | ToElement () const |
XmlComment * | ToComment () |
const XmlComment * | ToComment () const |
XmlUnknown * | ToUnknown () |
const XmlUnknown * | ToUnknown () const |
XmlText * | ToText () |
const XmlText * | ToText () const |
XmlDeclaration * | ToDeclaration () |
const XmlDeclaration * | ToDeclaration () const |
virtual XmlNode * | Clone () const =0 |
Create an exact duplicate of this node and return it. | |
Protected Member Functions | |
XmlNode (ENodeType nType) | |
Constructor. | |
XmlNode * | Identify (const char *pszData, EEncoding nEncoding) |
Figure out what is at *pszData, and parse it. | |
Protected Attributes | |
XmlNode * | m_pParent |
ENodeType | m_nType |
XmlNode * | m_pFirstChild |
XmlNode * | m_pLastChild |
String | m_sValue |
XmlNode * | m_pPreviousSibling |
XmlNode * | m_pNextSibling |
Abstract XML node.
virtual PLCORE_API PLCore::XmlNode::~XmlNode | ( | ) | [virtual] |
Destructor.
PLCore::XmlNode::XmlNode | ( | ENodeType | nType | ) | [protected] |
[in] | nType | Type of the node |
String PLCore::XmlNode::GetValue | ( | ) | const [inline] |
The meaning of 'value' changes for the specific type of 'XmlNode'.
* Document: Filename of the XML file * Element: Name of the element * Comment: The comment text * Unknown: The tag contents * Text: The text string *
void PLCore::XmlNode::SetValue | ( | const String & | sValue | ) | [inline] |
PLCORE_API void PLCore::XmlNode::Clear | ( | ) |
Delete all the children of this node.
XmlNode * PLCore::XmlNode::GetParent | ( | ) | [inline] |
One step up the DOM.
const XmlNode * PLCore::XmlNode::GetParent | ( | ) | const [inline] |
XmlNode * PLCore::XmlNode::GetFirstChild | ( | ) | [inline] |
Returns the first child of this node.
const XmlNode * PLCore::XmlNode::GetFirstChild | ( | ) | const [inline] |
PLCORE_API XmlNode* PLCore::XmlNode::GetFirstChild | ( | const String & | sValue | ) |
Returns the first child of this node with the matching 'value'.
[in] | sValue | Value to look for |
PLCORE_API const XmlNode* PLCore::XmlNode::GetFirstChild | ( | const String & | sValue | ) | const |
XmlNode * PLCore::XmlNode::GetLastChild | ( | ) | [inline] |
Returns the last child of this node.
const XmlNode * PLCore::XmlNode::GetLastChild | ( | ) | const [inline] |
PLCORE_API XmlNode* PLCore::XmlNode::GetLastChild | ( | const String & | sValue | ) |
Returns the last child of this node with the matching 'value'.
[in] | sValue | Value to look for |
PLCORE_API const XmlNode* PLCore::XmlNode::GetLastChild | ( | const String & | sValue | ) | const |
XmlNode * PLCore::XmlNode::IterateChildren | ( | XmlNode * | pPrevious | ) | [inline] |
An alternate way to walk the children of a node.
[in] | pPrevious | Previous node, if a null pointer the first child node is returned |
* for (XmlNode *pChild=pParent->GetFirstChild(); pChild; pChild=Child->GetNextSibling()) *
'IterateChildren()' does the same thing with the syntax:
* XmlNode *pChild = pParent->IterateChildren(pChild); * while (pChild) *
'IterateChildren()' takes the previous child as input and finds the next one. If the previous child is a null pointer, it returns the first. 'IterateChildren()' will return a null pointer when done.
const XmlNode * PLCore::XmlNode::IterateChildren | ( | const XmlNode * | pPrevious | ) | const [inline] |
XmlNode * PLCore::XmlNode::IterateChildren | ( | const String & | sValue, |
XmlNode * | pPrevious | ||
) | [inline] |
This flavor of 'IterateChildren()' searches for children with a particular 'value'.
[in] | sValue | Value to look for |
[in] | pPrevious | Previous node, if a null pointer the first child node is returned |
const XmlNode * PLCore::XmlNode::IterateChildren | ( | const String & | sValue, |
const XmlNode * | pPrevious | ||
) | const [inline] |
PLCORE_API XmlNode* PLCore::XmlNode::InsertEndChild | ( | const XmlNode & | cAddThis | ) |
Add a new node related to this (adds a child past the last child)
[in] | cAddThis | Node to insert |
PLCORE_API XmlNode* PLCore::XmlNode::LinkEndChild | ( | XmlNode & | cAddThis | ) |
Add a new node related to this (adds a child past the last child)
[in] | cAddThis | Node to add |
PLCORE_API XmlNode* PLCore::XmlNode::InsertBeforeChild | ( | XmlNode & | cBeforeThis, |
const XmlNode & | cAddThis | ||
) |
Add a new node related to this (adds a child before the specified child)
[in] | cBeforeThis | Node before this insertion |
[in] | cAddThis | Node to insert |
PLCORE_API XmlNode* PLCore::XmlNode::InsertAfterChild | ( | XmlNode & | cAfterThis, |
const XmlNode & | cAddThis | ||
) |
Add a new node related to this (adds a child after the specified child)
[in] | cAfterThis | Node after this insertion |
[in] | cAddThis | Node to insert |
PLCORE_API XmlNode* PLCore::XmlNode::ReplaceChild | ( | XmlNode & | cReplaceThis, |
const XmlNode & | cWithThis | ||
) |
Replace a child of this node.
[in] | cReplaceThis | Node which should be replaced (on success, destroyed automatically) |
[in] | cWithThis | New node replacing the old |
PLCORE_API bool PLCore::XmlNode::RemoveChild | ( | XmlNode & | cRemoveThis | ) |
Delete a child of this node.
[in] | cRemoveThis | Node to remove (on success, destroyed automatically) |
XmlNode * PLCore::XmlNode::GetPreviousSibling | ( | ) | [inline] |
Navigate to a sibling node.
const XmlNode * PLCore::XmlNode::GetPreviousSibling | ( | ) | const [inline] |
PLCORE_API XmlNode* PLCore::XmlNode::GetPreviousSibling | ( | const String & | sValue | ) |
Navigate to a sibling node with the given 'value'.
[in] | sValue | Value to look for |
PLCORE_API const XmlNode* PLCore::XmlNode::GetPreviousSibling | ( | const String & | sValue | ) | const |
XmlNode * PLCore::XmlNode::GetNextSibling | ( | ) | [inline] |
Navigate to a sibling node.
const XmlNode * PLCore::XmlNode::GetNextSibling | ( | ) | const [inline] |
PLCORE_API XmlNode* PLCore::XmlNode::GetNextSibling | ( | const String & | sValue | ) |
Navigate to a sibling node with the given 'value'.
[in] | sValue | Value to look for |
PLCORE_API const XmlNode* PLCore::XmlNode::GetNextSibling | ( | const String & | sValue | ) | const |
XmlElement * PLCore::XmlNode::GetNextSiblingElement | ( | ) | [inline] |
Convenience function to get through elements.
PLCORE_API const XmlElement* PLCore::XmlNode::GetNextSiblingElement | ( | ) | const |
PLCORE_API XmlElement* PLCore::XmlNode::GetNextSiblingElement | ( | const String & | sValue | ) |
Convenience function to get through elements.
[in] | sValue | Value to look for |
PLCORE_API const XmlElement* PLCore::XmlNode::GetNextSiblingElement | ( | const String & | sValue | ) | const |
XmlElement * PLCore::XmlNode::GetFirstChildElement | ( | ) | [inline] |
Convenience function to get through elements.
PLCORE_API const XmlElement* PLCore::XmlNode::GetFirstChildElement | ( | ) | const |
XmlElement * PLCore::XmlNode::GetFirstChildElement | ( | const String & | sValue | ) | [inline] |
Convenience function to get through elements.
[in] | sValue | Value to look for |
PLCORE_API const XmlElement* PLCore::XmlNode::GetFirstChildElement | ( | const String & | sValue | ) | const |
XmlNode::ENodeType PLCore::XmlNode::GetType | ( | ) | const [inline] |
Query the type (as an enumerated value, above) of this node.
XmlDocument * PLCore::XmlNode::GetDocument | ( | ) | [inline] |
Return a pointer to the document this node lives in.
PLCORE_API const XmlDocument* PLCore::XmlNode::GetDocument | ( | ) | const |
bool PLCore::XmlNode::NoChildren | ( | ) | const [inline] |
Returns true if this node has no children.
XmlDocument * PLCore::XmlNode::ToDocument | ( | ) | [inline] |
Cast functions, will return a null pointer if the given node is not from the requested type.
Cast functions.
const XmlDocument * PLCore::XmlNode::ToDocument | ( | ) | const [inline] |
XmlElement * PLCore::XmlNode::ToElement | ( | ) | [inline] |
const XmlElement * PLCore::XmlNode::ToElement | ( | ) | const [inline] |
XmlComment * PLCore::XmlNode::ToComment | ( | ) | [inline] |
const XmlComment * PLCore::XmlNode::ToComment | ( | ) | const [inline] |
XmlUnknown * PLCore::XmlNode::ToUnknown | ( | ) | [inline] |
const XmlUnknown * PLCore::XmlNode::ToUnknown | ( | ) | const [inline] |
XmlText * PLCore::XmlNode::ToText | ( | ) | [inline] |
const XmlText * PLCore::XmlNode::ToText | ( | ) | const [inline] |
XmlDeclaration * PLCore::XmlNode::ToDeclaration | ( | ) | [inline] |
const XmlDeclaration * PLCore::XmlNode::ToDeclaration | ( | ) | const [inline] |
virtual XmlNode* PLCore::XmlNode::Clone | ( | ) | const [pure virtual] |
Create an exact duplicate of this node and return it.
Implemented in PLCore::XmlElement, PLCore::XmlDocument, PLCore::XmlDeclaration, PLCore::XmlText, PLCore::XmlComment, and PLCore::XmlUnknown.
XmlNode* PLCore::XmlNode::Identify | ( | const char * | pszData, |
EEncoding | nEncoding | ||
) | [protected] |
Figure out what is at *pszData, and parse it.
[in] | pszData | Start position |
[in] | nEncoding | Encoding |
XmlNode* PLCore::XmlNode::m_pParent [protected] |
Parent node, can be a null pointer
ENodeType PLCore::XmlNode::m_nType [protected] |
Type of the node
XmlNode* PLCore::XmlNode::m_pFirstChild [protected] |
First child, can be a null pointer
XmlNode* PLCore::XmlNode::m_pLastChild [protected] |
Last child, can be a null pointer
String PLCore::XmlNode::m_sValue [protected] |
Value
XmlNode* PLCore::XmlNode::m_pPreviousSibling [protected] |
Previous sibling, can be a null pointer
XmlNode* PLCore::XmlNode::m_pNextSibling [protected] |
Previous sibling, can be a null pointer
|