#include <tinyxml.h>
The parent class for everything in the Document Object Model. (Except for attributes). Nodes have siblings, a parent, and children. A node can be in a document, or stand on its own. The type of a TiXmlNode can be queried, and it can be cast to its more defined type.
enum TiXmlNode::NodeType |
TiXmlNode::~TiXmlNode | ( | ) | [virtual] |
References firstChild, and next.
TiXmlNode::TiXmlNode | ( | NodeType | _type | ) | [protected] |
TiXmlNode::TiXmlNode | ( | const TiXmlNode & | ) | [private] |
const char* TiXmlNode::Value | ( | ) | const [inline] |
The meaning of 'value' changes for the specific type of TiXmlNode.
Document: filename of the xml file Element: name of the element Comment: the comment text Unknown: the tag contents Text: the text string
The subclasses will wrap this function.
References TiXmlString::c_str(), and value.
Referenced by TiXmlElement::Clone(), CRusCorpXmlFile::CreateGraTable(), GetCWBFormattedStringRecursive(), GetTextFromXMLRecursive(), CConcXml::ReadMorphXmlFileIntoGraTable(), and ReadXmlField().
void TiXmlNode::SetValue | ( | const char * | _value | ) | [inline] |
Changes the value of the node. Defined as:
Document: filename of the xml file Element: name of the element Comment: the comment text Unknown: the tag contents Text: the text string
References value.
Referenced by CopyTo(), and TiXmlText::TiXmlText().
void TiXmlNode::Clear | ( | ) |
Delete all the children of this node. Does not affect 'this'.
References firstChild, lastChild, and next.
Referenced by TiXmlElement::ClearThis(), CRusCorpXmlFile::CreateGraTable(), TiXmlDocument::LoadFile(), TiXmlDeclaration::operator=(), TiXmlComment::operator=(), and TiXmlDocument::operator=().
TiXmlNode* TiXmlNode::FirstChild | ( | ) | const [inline] |
The first child of this node. Will be null if there are no children.
References firstChild.
Referenced by TiXmlHandle::Child(), TiXmlHandle::FirstChild(), FirstChildElement(), GetCWBFormattedStringRecursive(), GetTextFromXMLRecursive(), IterateChildren(), TiXmlDocument::Print(), ReadXmlField(), and TiXmlDocument::StreamOut().
TiXmlNode * TiXmlNode::FirstChild | ( | const char * | value | ) | const |
The first child of this node with the matching 'value'. Will be null if none found.
References firstChild, next, SValue(), and TIXML_STRING.
TiXmlNode * TiXmlNode::LastChild | ( | const char * | value | ) | const |
The last child of this node. Will be null if there are no children.
References lastChild, prev, SValue(), and TIXML_STRING.
The last child of this node matching 'value'. Will be null if there are no children.
An alternate way to walk the children of a node. One way to iterate over nodes is:
for( child = parent->FirstChild(); child; child = child->NextSibling() )
IterateChildren does the same thing with the syntax:
child = 0; while( child = parent->IterateChildren( child ) )
IterateChildren takes the previous child as input and finds the next one. If the previous child is null, it returns the first. IterateChildren will return null when done.
References FirstChild(), NextSibling(), and parent.
This flavor of IterateChildren searches for children with a particular 'value'.
References FirstChild(), NextSibling(), and parent.
Add a new node related to this. Adds a child past the LastChild. Returns a pointer to the new object or NULL if an error occured.
References Clone(), and LinkEndChild().
Add a new node related to this. Adds a child past the LastChild.
NOTE: the node to be added is passed by pointer, and will be henceforth owned (and deleted) by tinyXml. This method is efficient and avoids an extra copy, but should be used with care as it uses a different memory model than the other insert functions.
References firstChild, lastChild, next, parent, and prev.
Referenced by TiXmlDocument::CopyTo(), TiXmlElement::CopyTo(), InsertEndChild(), TiXmlDocument::Parse(), and TiXmlElement::ReadValue().
Add a new node related to this. Adds a child before the specified child. Returns a pointer to the new object or NULL if an error occured.
References Clone(), firstChild, next, parent, and prev.
bool TiXmlNode::RemoveChild | ( | TiXmlNode * | removeThis | ) |
Delete a child of this node.
References firstChild, lastChild, next, parent, and prev.
TiXmlNode* TiXmlNode::PreviousSibling | ( | ) | const [inline] |
Navigate to a sibling node.
References prev.
TiXmlNode * TiXmlNode::PreviousSibling | ( | const char * | _value | ) | const |
Navigate to a sibling node.
References prev, SValue(), and TIXML_STRING.
TiXmlNode* TiXmlNode::NextSibling | ( | ) | const [inline] |
Navigate to a sibling node.
References next.
Referenced by TiXmlHandle::Child(), TiXmlDocument::CopyTo(), TiXmlElement::CopyTo(), FirstChildElement(), GetCWBFormattedStringRecursive(), GetTextFromXMLRecursive(), IterateChildren(), NextSiblingElement(), TiXmlDocument::Print(), TiXmlElement::Print(), ReadXmlField(), TiXmlDocument::StreamOut(), and TiXmlElement::StreamOut().
TiXmlNode * TiXmlNode::NextSibling | ( | const char * | _value | ) | const |
Navigate to a sibling node with the given 'value'.
References next, SValue(), and TIXML_STRING.
TiXmlElement * TiXmlNode::NextSiblingElement | ( | ) | const |
Convenience function to get through elements. Calls NextSibling and ToElement. Will skip all non-Element nodes. Returns 0 if there is not another element.
References NextSibling(), and ToElement().
Referenced by TiXmlHandle::ChildElement(), CRusCorpXmlFile::CreateGraTable(), CRusCorpXmlFile::PrintDisambiguatedXmlNodes(), and CConcXml::ReadMorphXmlFileIntoGraTable().
TiXmlElement * TiXmlNode::NextSiblingElement | ( | const char * | _value | ) | const |
Convenience function to get through elements. Calls NextSibling and ToElement. Will skip all non-Element nodes. Returns 0 if there is not another element.
References NextSibling(), and ToElement().
TiXmlElement * TiXmlNode::FirstChildElement | ( | ) | const |
Convenience function to get through elements.
References FirstChild(), NextSibling(), and ToElement().
Referenced by TiXmlHandle::ChildElement(), CRusCorpXmlFile::CreateGraTable(), TiXmlHandle::FirstChildElement(), CRusCorpXmlFile::PrintDisambiguatedXmlNodes(), CConcXml::ReadMorphXmlFileIntoGraTable(), and TiXmlDocument::RootElement().
TiXmlElement * TiXmlNode::FirstChildElement | ( | const char * | value | ) | const |
Convenience function to get through elements.
References FirstChild(), NextSibling(), and ToElement().
virtual int TiXmlNode::Type | ( | ) | const [inline, virtual] |
Query the type (as an enumerated value, above) of this node. The possible types are: DOCUMENT, ELEMENT, COMMENT, UNKNOWN, TEXT, and DECLARATION.
References type.
Referenced by GetCWBFormattedStringRecursive(), and GetTextFromXMLRecursive().
TiXmlDocument * TiXmlNode::GetDocument | ( | ) | const |
Return a pointer to the Document this node lives in. Returns null if not in a document.
References parent, and ToDocument().
Referenced by Identify(), TiXmlDeclaration::Parse(), TiXmlComment::Parse(), TiXmlUnknown::Parse(), TiXmlElement::Parse(), TiXmlElement::ReadValue(), and TiXmlElement::SetAttribute().
bool TiXmlNode::NoChildren | ( | ) | const [inline] |
Returns true if this node has no children.
References firstChild.
TiXmlDocument* TiXmlNode::ToDocument | ( | ) | const [inline] |
Cast to a more defined type. Will return null not of the requested type.
References DOCUMENT, and type.
Referenced by GetDocument().
TiXmlElement* TiXmlNode::ToElement | ( | ) | const [inline] |
Cast to a more defined type. Will return null not of the requested type.
Referenced by TiXmlHandle::Element(), FirstChildElement(), GetCWBFormattedStringRecursive(), CConcXml::GetTextAreaElements(), NextSiblingElement(), and TiXmlDocument::StreamOut().
TiXmlComment* TiXmlNode::ToComment | ( | ) | const [inline] |
TiXmlUnknown* TiXmlNode::ToUnknown | ( | ) | const [inline] |
Cast to a more defined type. Will return null not of the requested type.
Referenced by TiXmlHandle::Unknown().
TiXmlText* TiXmlNode::ToText | ( | ) | const [inline] |
Cast to a more defined type. Will return null not of the requested type.
Referenced by TiXmlElement::Print(), and TiXmlHandle::Text().
TiXmlDeclaration* TiXmlNode::ToDeclaration | ( | ) | const [inline] |
Cast to a more defined type. Will return null not of the requested type.
References DECLARATION, and type.
Referenced by TiXmlDocument::Parse().
virtual TiXmlNode* TiXmlNode::Clone | ( | ) | const [pure virtual] |
Create an exact duplicate of this node and return it. The memory must be deleted by the caller.
Implemented in TiXmlElement, TiXmlComment, TiXmlText, TiXmlDeclaration, TiXmlUnknown, and TiXmlDocument.
Referenced by TiXmlDocument::CopyTo(), TiXmlElement::CopyTo(), InsertAfterChild(), InsertBeforeChild(), InsertEndChild(), and ReplaceChild().
void TiXmlNode::CopyTo | ( | TiXmlNode * | target | ) | const [protected] |
References TiXmlString::c_str(), SetValue(), TiXmlBase::userData, and value.
TiXmlNode * TiXmlNode::Identify | ( | const char * | start, | |
TiXmlEncoding | encoding | |||
) | [protected] |
References GetDocument(), TiXmlBase::IsAlpha(), parent, TiXmlDocument::SetError(), TiXmlBase::SkipWhiteSpace(), TiXmlBase::StringEqual(), TIXML_ENCODING_UNKNOWN, TiXmlBase::TIXML_ERROR_OUT_OF_MEMORY, TIXML_LOG, and TiXmlElement.
Referenced by TiXmlDocument::Parse(), and TiXmlElement::ReadValue().
const TiXmlString& TiXmlNode::SValue | ( | ) | const [inline, protected] |
References value.
Referenced by FirstChild(), LastChild(), NextSibling(), and PreviousSibling().
void TiXmlNode::operator= | ( | const TiXmlNode & | base | ) | [private] |
friend class TiXmlDocument [friend] |
Reimplemented from TiXmlBase.
friend class TiXmlElement [friend] |
TiXmlOutStream& operator<< | ( | TiXmlOutStream & | out, | |
const TiXmlNode & | base | |||
) | [friend] |
TiXmlNode* TiXmlNode::parent [protected] |
Referenced by GetDocument(), Identify(), InsertAfterChild(), InsertBeforeChild(), IterateChildren(), LinkEndChild(), Parent(), RemoveChild(), ReplaceChild(), and TiXmlNode().
NodeType TiXmlNode::type [protected] |
Referenced by TiXmlNode(), ToComment(), ToDeclaration(), ToDocument(), ToElement(), ToText(), ToUnknown(), and Type().
TiXmlNode* TiXmlNode::firstChild [protected] |
TiXmlNode* TiXmlNode::lastChild [protected] |
Referenced by Clear(), InsertAfterChild(), LastChild(), LinkEndChild(), TiXmlElement::Print(), RemoveChild(), ReplaceChild(), TiXmlElement::TiXmlElement(), and TiXmlNode().
TiXmlString TiXmlNode::value [protected] |
Referenced by TiXmlText::Blank(), CopyTo(), TiXmlDocument::LoadFile(), TiXmlText::Parse(), TiXmlComment::Parse(), TiXmlUnknown::Parse(), TiXmlElement::Parse(), TiXmlUnknown::Print(), TiXmlText::Print(), TiXmlComment::Print(), TiXmlElement::Print(), TiXmlDocument::SaveFile(), SetValue(), TiXmlUnknown::StreamOut(), TiXmlText::StreamOut(), TiXmlComment::StreamOut(), TiXmlElement::StreamOut(), SValue(), TiXmlDocument::TiXmlDocument(), TiXmlElement::TiXmlElement(), and Value().
TiXmlNode* TiXmlNode::prev [protected] |
Referenced by InsertAfterChild(), InsertBeforeChild(), LastChild(), LinkEndChild(), PreviousSibling(), RemoveChild(), ReplaceChild(), and TiXmlNode().
TiXmlNode* TiXmlNode::next [protected] |
Referenced by Clear(), FirstChild(), InsertAfterChild(), InsertBeforeChild(), LinkEndChild(), NextSibling(), RemoveChild(), ReplaceChild(), TiXmlNode(), and ~TiXmlNode().