ddc
|
#include <tinyxml.h>
Public Types | |
enum | NodeType { DOCUMENT, ELEMENT, COMMENT, UNKNOWN, TEXT, DECLARATION, TYPECOUNT } |
Public Member Functions | |
virtual | ~TiXmlNode () |
const char * | Value () const |
void | SetValue (const char *_value) |
void | Clear () |
Delete all the children of this node. Does not affect 'this'. More... | |
TiXmlNode * | Parent () const |
One step up the DOM. More... | |
TiXmlNode * | FirstChild () const |
The first child of this node. Will be null if there are no children. More... | |
TiXmlNode * | FirstChild (const char *value) const |
The first child of this node with the matching 'value'. Will be null if none found. More... | |
TiXmlNode * | LastChild () const |
TiXmlNode * | LastChild (const char *value) const |
The last child of this node. Will be null if there are no children. More... | |
TiXmlNode * | IterateChildren (TiXmlNode *previous) const |
The last child of this node matching 'value'. Will be null if there are no children. More... | |
TiXmlNode * | IterateChildren (const char *value, TiXmlNode *previous) const |
This flavor of IterateChildren searches for children with a particular 'value'. More... | |
TiXmlNode * | InsertEndChild (const TiXmlNode &addThis) |
TiXmlNode * | LinkEndChild (TiXmlNode *addThis) |
TiXmlNode * | InsertBeforeChild (TiXmlNode *beforeThis, const TiXmlNode &addThis) |
TiXmlNode * | InsertAfterChild (TiXmlNode *afterThis, const TiXmlNode &addThis) |
TiXmlNode * | ReplaceChild (TiXmlNode *replaceThis, const TiXmlNode &withThis) |
bool | RemoveChild (TiXmlNode *removeThis) |
Delete a child of this node. More... | |
TiXmlNode * | PreviousSibling () const |
Navigate to a sibling node. More... | |
TiXmlNode * | PreviousSibling (const char *) const |
Navigate to a sibling node. More... | |
TiXmlNode * | NextSibling () const |
Navigate to a sibling node. More... | |
TiXmlNode * | NextSibling (const char *) const |
Navigate to a sibling node with the given 'value'. More... | |
TiXmlElement * | NextSiblingElement () const |
TiXmlElement * | NextSiblingElement (const char *) const |
TiXmlElement * | FirstChildElement () const |
Convenience function to get through elements. More... | |
TiXmlElement * | FirstChildElement (const char *value) const |
Convenience function to get through elements. More... | |
virtual int | Type () const |
TiXmlDocument * | GetDocument () const |
bool | NoChildren () const |
Returns true if this node has no children. More... | |
TiXmlDocument * | ToDocument () const |
Cast to a more defined type. Will return null not of the requested type. More... | |
TiXmlElement * | ToElement () const |
Cast to a more defined type. Will return null not of the requested type. More... | |
TiXmlComment * | ToComment () const |
Cast to a more defined type. Will return null not of the requested type. More... | |
TiXmlUnknown * | ToUnknown () const |
Cast to a more defined type. Will return null not of the requested type. More... | |
TiXmlText * | ToText () const |
Cast to a more defined type. Will return null not of the requested type. More... | |
TiXmlDeclaration * | ToDeclaration () const |
Cast to a more defined type. Will return null not of the requested type. More... | |
virtual TiXmlNode * | Clone () const =0 |
Public Member Functions inherited from TiXmlBase | |
TiXmlBase () | |
virtual | ~TiXmlBase () |
virtual void | Print (FILE *cfile, int depth) const =0 |
int | Row () const |
int | Column () const |
See Row() More... | |
void | SetUserData (void *user) |
void * | GetUserData () |
virtual const char * | Parse (const char *p, TiXmlParsingData *data, TiXmlEncoding encoding)=0 |
Protected Member Functions | |
TiXmlNode (NodeType _type) | |
void | CopyTo (TiXmlNode *target) const |
TiXmlNode * | Identify (const char *start, TiXmlEncoding encoding) |
const TiXmlString & | SValue () const |
Protected Member Functions inherited from TiXmlBase | |
virtual void | StreamOut (TiXmlOutStream *) const =0 |
Protected Attributes | |
TiXmlNode * | parent |
NodeType | type |
TiXmlNode * | firstChild |
TiXmlNode * | lastChild |
TiXmlString | value |
TiXmlNode * | prev |
TiXmlNode * | next |
Protected Attributes inherited from TiXmlBase | |
TiXmlCursor | location |
void * | userData |
Field containing a generic user pointer. More... | |
Private Member Functions | |
TiXmlNode (const TiXmlNode &) | |
void | operator= (const TiXmlNode &base) |
Friends | |
class | TiXmlDocument |
class | TiXmlElement |
TiXmlOutStream & | operator<< (TiXmlOutStream &out, const TiXmlNode &base) |
Additional Inherited Members | |
Static Public Member Functions inherited from TiXmlBase | |
static void | SetCondenseWhiteSpace (bool condense) |
static bool | IsWhiteSpaceCondensed () |
Return the current white space setting. More... | |
Static Public Attributes inherited from TiXmlBase | |
static const int | utf8ByteTable [256] |
Protected Types inherited from TiXmlBase | |
enum | { TIXML_NO_ERROR = 0, TIXML_ERROR, TIXML_ERROR_OPENING_FILE, TIXML_ERROR_OUT_OF_MEMORY, TIXML_ERROR_PARSING_ELEMENT, TIXML_ERROR_FAILED_TO_READ_ELEMENT_NAME, TIXML_ERROR_READING_ELEMENT_VALUE, TIXML_ERROR_READING_ATTRIBUTES, TIXML_ERROR_PARSING_EMPTY, TIXML_ERROR_READING_END_TAG, TIXML_ERROR_PARSING_UNKNOWN, TIXML_ERROR_PARSING_COMMENT, TIXML_ERROR_PARSING_DECLARATION, TIXML_ERROR_DOCUMENT_EMPTY, TIXML_ERROR_EMBEDDED_NULL, TIXML_ERROR_STRING_COUNT } |
Static Protected Member Functions inherited from TiXmlBase | |
static const char * | SkipWhiteSpace (const char *, TiXmlEncoding encoding) |
static bool | IsWhiteSpace (char c) |
static const char * | ReadName (const char *p, TiXmlString *name, TiXmlEncoding encoding) |
static const char * | ReadText (const char *in, TiXmlString *text, bool ignoreWhiteSpace, const char *endTag, bool ignoreCase, TiXmlEncoding encoding) |
static const char * | GetEntity (const char *in, char *value, int *length, TiXmlEncoding encoding) |
static const char * | GetChar (const char *p, char *_value, int *length, TiXmlEncoding encoding) |
static void | PutString (const TiXmlString &str, TiXmlOutStream *out) |
static void | PutString (const TiXmlString &str, TiXmlString *out) |
static bool | StringEqual (const char *p, const char *endTag, bool ignoreCase, TiXmlEncoding encoding) |
static int | IsAlpha (unsigned char anyByte, TiXmlEncoding encoding) |
static int | IsAlphaNum (unsigned char anyByte, TiXmlEncoding encoding) |
static int | ToLower (int v, TiXmlEncoding encoding) |
static void | ConvertUTF32ToUTF8 (unsigned long input, char *output, int *length) |
Static Protected Attributes inherited from TiXmlBase | |
static const char * | errorString [TIXML_ERROR_STRING_COUNT] |
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 |
|
virtual |
References firstChild, and next.
|
protected |
References firstChild, lastChild, next, parent, prev, and type.
Referenced by TiXmlDeclaration::TiXmlDeclaration(), TiXmlDocument::TiXmlDocument(), TiXmlElement::TiXmlElement(), ToDeclaration(), and TiXmlText::~TiXmlText().
|
private |
|
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(), GetCWBFormattedStringRecursive(), GetTextFromXMLRecursive(), CConcXml::ReadMorphXmlFileIntoGraTable(), and ReadXmlField().
|
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 TiXmlBase::StringToBuffer::buffer, TiXmlCursor::Clear(), and value.
Referenced by CopyTo(), TiXmlAttribute::SetDoubleValue(), TiXmlAttribute::SetIntValue(), TiXmlText::TiXmlText(), 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(), TiXmlDocument::LoadFile(), TiXmlComment::operator=(), TiXmlDeclaration::operator=(), and TiXmlDocument::operator=().
|
inline |
The first child of this node. Will be null if there are no children.
References firstChild, and value.
Referenced by TiXmlHandle::Child(), TiXmlHandle::FirstChild(), FirstChildElement(), GetCWBFormattedStringRecursive(), GetTextFromXMLRecursive(), IterateChildren(), LastChild(), TiXmlDocument::Print(), CConcXml::ReadMorphXmlFileIntoGraTable(), 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.
|
inline |
References FirstChild(), InsertAfterChild(), InsertBeforeChild(), InsertEndChild(), IterateChildren(), lastChild, LinkEndChild(), RemoveChild(), and ReplaceChild().
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.
Referenced by LastChild().
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().
Referenced by LastChild().
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. @sa InsertEndChild
References firstChild, lastChild, next, parent, and prev.
Referenced by TiXmlElement::CopyTo(), TiXmlDocument::CopyTo(), InsertEndChild(), LastChild(), 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.
Referenced by LastChild().
Add a new node related to this. Adds a child after the specified child. Returns a pointer to the new object or NULL if an error occured.
References Clone(), lastChild, next, parent, and prev.
Referenced by LastChild().
Replace a child of this node. Returns a pointer to the new object or NULL if an error occured.
References Clone(), firstChild, lastChild, next, parent, and prev.
Referenced by LastChild().
bool TiXmlNode::RemoveChild | ( | TiXmlNode * | removeThis | ) |
Delete a child of this node.
References firstChild, lastChild, next, parent, and prev.
Referenced by LastChild().
|
inline |
Navigate to a sibling node.
References NextSibling(), and prev.
TiXmlNode * TiXmlNode::PreviousSibling | ( | const char * | _value | ) | const |
Navigate to a sibling node.
References prev, SValue(), and TIXML_STRING.
|
inline |
Navigate to a sibling node.
References FirstChildElement(), next, and NextSiblingElement().
Referenced by TiXmlHandle::Child(), TiXmlElement::CopyTo(), TiXmlDocument::CopyTo(), FirstChildElement(), GetCWBFormattedStringRecursive(), GetTextFromXMLRecursive(), IterateChildren(), NextSiblingElement(), PreviousSibling(), TiXmlElement::Print(), TiXmlDocument::Print(), ReadXmlField(), TiXmlElement::StreamOut(), and TiXmlDocument::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(), NextSibling(), 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(), TiXmlHandle::FirstChildElement(), NextSibling(), and CConcXml::ReadMorphXmlFileIntoGraTable().
TiXmlElement * TiXmlNode::FirstChildElement | ( | const char * | value | ) | const |
Convenience function to get through elements.
References FirstChild(), NextSibling(), and ToElement().
|
inlinevirtual |
Query the type (as an enumerated value, above) of this node. The possible types are: DOCUMENT, ELEMENT, COMMENT, UNKNOWN, TEXT, and DECLARATION.
References GetDocument(), and 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(), TiXmlAttribute::Parse(), TiXmlElement::Parse(), TiXmlComment::Parse(), TiXmlText::Parse(), TiXmlDeclaration::Parse(), TiXmlUnknown::Parse(), TiXmlElement::ReadValue(), TiXmlElement::SetAttribute(), and Type().
|
inline |
Returns true if this node has no children.
References firstChild.
|
inline |
Cast to a more defined type. Will return null not of the requested type.
References DOCUMENT, and type.
Referenced by GetDocument().
|
inline |
Cast to a more defined type. Will return null not of the requested type.
Referenced by FirstChildElement(), GetCWBFormattedStringRecursive(), CBiblIndex::GetTextAreaElements(), NextSiblingElement(), TiXmlBase::ReadText(), and TiXmlDocument::StreamOut().
|
inline |
|
inline |
|
inline |
Cast to a more defined type. Will return null not of the requested type.
Referenced by TiXmlElement::Print().
|
inline |
Cast to a more defined type. Will return null not of the requested type.
References TiXmlElement::Clone(), TiXmlElement::CopyTo(), DECLARATION, Identify(), TIXML_STRING, TiXmlNode(), and type.
Referenced by TiXmlDocument::Parse().
|
pure virtual |
Create an exact duplicate of this node and return it. The memory must be deleted by the caller.
Implemented in TiXmlDocument, TiXmlUnknown, TiXmlDeclaration, TiXmlText, TiXmlComment, and TiXmlElement.
Referenced by TiXmlElement::CopyTo(), TiXmlDocument::CopyTo(), InsertAfterChild(), InsertBeforeChild(), InsertEndChild(), and ReplaceChild().
|
protected |
References TiXmlString::c_str(), SetValue(), TiXmlBase::userData, and value.
Referenced by TiXmlElement::CopyTo(), TiXmlComment::CopyTo(), TiXmlText::CopyTo(), TiXmlDeclaration::CopyTo(), TiXmlUnknown::CopyTo(), and TiXmlDocument::CopyTo().
|
protected |
References GetDocument(), TiXmlBase::IsAlpha(), TiXmlBase::IsWhiteSpace(), parent, TiXmlDocument::SetError(), TiXmlBase::SkipWhiteSpace(), TiXmlBase::StringEqual(), TIXML_DEFAULT_ENCODING, TIXML_ENCODING_UNKNOWN, TiXmlBase::TIXML_ERROR_EMBEDDED_NULL, TiXmlBase::TIXML_ERROR_OUT_OF_MEMORY, TIXML_LOG, TIXML_STRING, and TiXmlBase::TiXmlElement.
Referenced by TiXmlDocument::Parse(), TiXmlBase::ReadText(), TiXmlElement::ReadValue(), and ToDeclaration().
|
inlineprotected |
References value.
Referenced by FirstChild(), LastChild(), NextSibling(), and PreviousSibling().
|
private |
|
friend |
|
friend |
|
friend |
Referenced by operator<<().
|
protected |
Referenced by GetDocument(), Identify(), InsertAfterChild(), InsertBeforeChild(), IterateChildren(), LinkEndChild(), Parent(), RemoveChild(), ReplaceChild(), and TiXmlNode().
|
protected |
Referenced by TiXmlNode(), ToComment(), ToDeclaration(), ToDocument(), ToElement(), ToText(), ToUnknown(), and Type().
|
protected |
|
protected |
Referenced by Clear(), InsertAfterChild(), LastChild(), LinkEndChild(), TiXmlElement::Print(), RemoveChild(), ReplaceChild(), TiXmlElement::TiXmlElement(), and TiXmlNode().
|
protected |
Referenced by TiXmlText::Blank(), CopyTo(), TiXmlAttribute::DoubleValue(), FirstChild(), TiXmlAttribute::IntValue(), TiXmlDocument::LoadFile(), TiXmlAttribute::Next(), TiXmlAttribute::Parse(), TiXmlElement::Parse(), TiXmlComment::Parse(), TiXmlText::Parse(), TiXmlUnknown::Parse(), TiXmlAttribute::Previous(), TiXmlAttribute::Print(), TiXmlElement::Print(), TiXmlComment::Print(), TiXmlText::Print(), TiXmlUnknown::Print(), TiXmlAttribute::QueryDoubleValue(), TiXmlAttribute::QueryIntValue(), TiXmlDocument::SaveFile(), SetValue(), TiXmlAttribute::StreamOut(), TiXmlElement::StreamOut(), TiXmlComment::StreamOut(), TiXmlText::StreamOut(), TiXmlUnknown::StreamOut(), SValue(), TiXmlDocument::TiXmlDocument(), TiXmlElement::TiXmlElement(), and Value().
|
protected |
|
protected |
Referenced by Clear(), FirstChild(), InsertAfterChild(), InsertBeforeChild(), LinkEndChild(), TiXmlAttribute::Next(), NextSibling(), RemoveChild(), ReplaceChild(), TiXmlNode(), and ~TiXmlNode().