antioch-0.4.0
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Friends
tinyxml2::XMLDeclaration Class Reference

#include <tinyxml2.h>

Inheritance diagram for tinyxml2::XMLDeclaration:
tinyxml2::XMLNode

Public Member Functions

virtual XMLDeclarationToDeclaration ()
 Safely cast to a Declaration, or null. More...
 
virtual const XMLDeclarationToDeclaration () const
 
virtual bool Accept (XMLVisitor *visitor) const
 
char * ParseDeep (char *, StrPair *endTag)
 
virtual XMLNodeShallowClone (XMLDocument *document) const
 
virtual bool ShallowEqual (const XMLNode *compare) const
 
const XMLDocumentGetDocument () const
 Get the XMLDocument that owns this XMLNode. More...
 
XMLDocumentGetDocument ()
 Get the XMLDocument that owns this XMLNode. More...
 
virtual XMLElementToElement ()
 Safely cast to an Element, or null. More...
 
virtual const XMLElementToElement () const
 
virtual XMLTextToText ()
 Safely cast to Text, or null. More...
 
virtual const XMLTextToText () const
 
virtual XMLCommentToComment ()
 Safely cast to a Comment, or null. More...
 
virtual const XMLCommentToComment () const
 
virtual XMLDocumentToDocument ()
 Safely cast to a Document, or null. More...
 
virtual const XMLDocumentToDocument () const
 
virtual XMLUnknownToUnknown ()
 Safely cast to an Unknown, or null. More...
 
virtual const XMLUnknownToUnknown () const
 
const char * Value () const
 
void SetValue (const char *val, bool staticMem=false)
 
const XMLNodeParent () const
 Get the parent of this node on the DOM. More...
 
XMLNodeParent ()
 
bool NoChildren () const
 Returns true if this node has no children. More...
 
const XMLNodeFirstChild () const
 Get the first child node, or null if none exists. More...
 
XMLNodeFirstChild ()
 
const XMLElementFirstChildElement (const char *value=0) const
 
XMLElementFirstChildElement (const char *_value=0)
 
const XMLNodeLastChild () const
 Get the last child node, or null if none exists. More...
 
XMLNodeLastChild ()
 
const XMLElementLastChildElement (const char *value=0) const
 
XMLElementLastChildElement (const char *_value=0)
 
const XMLNodePreviousSibling () const
 Get the previous (left) sibling node of this node. More...
 
XMLNodePreviousSibling ()
 
const XMLElementPreviousSiblingElement (const char *value=0) const
 Get the previous (left) sibling element of this node, with an opitionally supplied name. More...
 
XMLElementPreviousSiblingElement (const char *_value=0)
 
const XMLNodeNextSibling () const
 Get the next (right) sibling node of this node. More...
 
XMLNodeNextSibling ()
 
const XMLElementNextSiblingElement (const char *value=0) const
 Get the next (right) sibling element of this node, with an opitionally supplied name. More...
 
XMLElementNextSiblingElement (const char *_value=0)
 
XMLNodeInsertEndChild (XMLNode *addThis)
 
XMLNodeLinkEndChild (XMLNode *addThis)
 
XMLNodeInsertFirstChild (XMLNode *addThis)
 
XMLNodeInsertAfterChild (XMLNode *afterThis, XMLNode *addThis)
 
void DeleteChildren ()
 
void DeleteChild (XMLNode *node)
 

Protected Member Functions

 XMLDeclaration (XMLDocument *doc)
 
virtual ~XMLDeclaration ()
 
 XMLDeclaration (const XMLDeclaration &)
 
XMLDeclarationoperator= (const XMLDeclaration &)
 

Protected Attributes

XMLDocumentdocument
 
XMLNodeparent
 
StrPair value
 
XMLNodefirstChild
 
XMLNodelastChild
 
XMLNodeprev
 
XMLNodenext
 

Friends

class XMLDocument
 

Detailed Description

In correct XML the declaration is the first entry in the file.

        <?xml version="1.0" standalone="yes"?>

TinyXML2 will happily read or write files without a declaration, however.

The text of the declaration isn't interpreted. It is parsed and written as a string.

Definition at line 701 of file tinyxml2.h.

Constructor & Destructor Documentation

XMLDeclaration::XMLDeclaration ( XMLDocument doc)
inlineprotected

Definition at line 986 of file tinyxml2_imp.h.

986  : XMLNode( doc )
987 {
988 }
XMLNode(XMLDocument *)
Definition: tinyxml2_imp.h:599
XMLDeclaration::~XMLDeclaration ( )
inlineprotectedvirtual

Definition at line 992 of file tinyxml2_imp.h.

993 {
994  //printf( "~XMLDeclaration\n" );
995 }
tinyxml2::XMLDeclaration::XMLDeclaration ( const XMLDeclaration )
protected

Member Function Documentation

bool XMLDeclaration::Accept ( XMLVisitor visitor) const
inlinevirtual

Accept a hierarchical visit of the nodes in the TinyXML DOM. Every node in the XML tree will be conditionally visited and the host will be called back via the TiXmlVisitor interface.

This is essentially a SAX interface for TinyXML. (Note however it doesn't re-parse the XML for the callbacks, so the performance of TinyXML is unchanged by using this interface versus any other.)

The interface has been based on ideas from:

Which are both good references for "visiting".

An example of using Accept():

    TiXmlPrinter printer;
    tinyxmlDoc.Accept( &printer );
    const char* xmlcstr = printer.CStr();

Implements tinyxml2::XMLNode.

Definition at line 1031 of file tinyxml2_imp.h.

References tinyxml2::XMLVisitor::Visit().

1032 {
1033  return visitor->Visit( *this );
1034 }
virtual bool Visit(const XMLDeclaration &)
Visit a declaration.
Definition: tinyxml2.h:362
void XMLNode::DeleteChild ( XMLNode node)
inlineinherited

Delete a child of this node.

Definition at line 661 of file tinyxml2_imp.h.

References DELETE_NODE, tinyxml2::XMLNode::parent, and TIXMLASSERT.

Referenced by tinyxml2::XMLDocument::DeleteNode().

662 {
663  TIXMLASSERT( node->parent == this );
664  DELETE_NODE( node );
665 }
#define DELETE_NODE(node)
Definition: tinyxml2_imp.h:56
#define TIXMLASSERT(x)
Definition: tinyxml2.h:68
XMLNode * parent
Definition: tinyxml2.h:608
void XMLNode::DeleteChildren ( )
inlineinherited

Delete all the children of this node.

Definition at line 629 of file tinyxml2_imp.h.

References DELETE_NODE, tinyxml2::XMLNode::firstChild, tinyxml2::XMLNode::lastChild, and tinyxml2::XMLNode::Unlink().

Referenced by tinyxml2::XMLDocument::LoadFile(), tinyxml2::XMLDocument::Parse(), tinyxml2::XMLDocument::~XMLDocument(), and tinyxml2::XMLNode::~XMLNode().

630 {
631  while( firstChild ) {
632  XMLNode* node = firstChild;
633  Unlink( node );
634 
635  DELETE_NODE( node );
636  }
637  firstChild = lastChild = 0;
638 }
#define DELETE_NODE(node)
Definition: tinyxml2_imp.h:56
void Unlink(XMLNode *child)
Definition: tinyxml2_imp.h:642
XMLNode * firstChild
Definition: tinyxml2.h:611
XMLNode * lastChild
Definition: tinyxml2.h:612
const XMLNode* tinyxml2::XMLNode::FirstChild ( ) const
inlineinherited
XMLNode* tinyxml2::XMLNode::FirstChild ( )
inlineinherited

Definition at line 497 of file tinyxml2.h.

References tinyxml2::XMLNode::firstChild.

497 { return firstChild; }
XMLNode * firstChild
Definition: tinyxml2.h:611
const XMLElement * XMLNode::FirstChildElement ( const char *  value = 0) const
inlineinherited

Get the first child element, or optionally the first child element with the specified name.

Definition at line 740 of file tinyxml2_imp.h.

References tinyxml2::XMLNode::firstChild, tinyxml2::XMLElement::Name(), tinyxml2::XMLNode::next, tinyxml2::XMLUtil::StringEqual(), tinyxml2::XMLElement::ToElement(), and tinyxml2::XMLNode::value.

Referenced by Antioch::XMLParser< NumericType >::efficiencies(), tinyxml2::XMLHandle::FirstChildElement(), tinyxml2::XMLConstHandle::FirstChildElement(), Antioch::XMLParser< NumericType >::get_parameter(), Antioch::XMLParser< NumericType >::products_orders(), Antioch::XMLParser< NumericType >::products_pairs(), Antioch::XMLParser< NumericType >::reactants_orders(), Antioch::XMLParser< NumericType >::reactants_pairs(), Antioch::XMLParser< NumericType >::reaction_kinetics_model(), Antioch::XMLParser< NumericType >::read_thermodynamic_data_root(), tinyxml2::XMLDocument::RootElement(), Antioch::XMLParser< NumericType >::verify_Kooij_in_place_of_Arrhenius(), and Antioch::XMLParser< NumericType >::where_is_k0().

741 {
742  for( XMLNode* node=firstChild; node; node=node->next ) {
743  XMLElement* element = node->ToElement();
744  if ( element ) {
745  if ( !value || XMLUtil::StringEqual( element->Name(), value ) ) {
746  return element;
747  }
748  }
749  }
750  return 0;
751 }
XMLNode * firstChild
Definition: tinyxml2.h:611
static bool StringEqual(const char *p, const char *q, int nChar=INT_MAX)
Definition: tinyxml2.h:384
const char * Name() const
Get the name of an element (which is the Value() of the node.)
Definition: tinyxml2.h:861
XMLNode * next
Definition: tinyxml2.h:615
virtual XMLElement * ToElement()
Safely cast to an Element, or null.
Definition: tinyxml2.h:865
XMLElement* tinyxml2::XMLNode::FirstChildElement ( const char *  _value = 0)
inlineinherited

Definition at line 502 of file tinyxml2.h.

References tinyxml2::XMLNode::FirstChildElement().

Referenced by tinyxml2::XMLNode::FirstChildElement().

502 { return const_cast<XMLElement*>(const_cast<const XMLNode*>(this)->FirstChildElement( _value )); }
friend class XMLElement
Definition: tinyxml2.h:451
const XMLElement * FirstChildElement(const char *value=0) const
Definition: tinyxml2_imp.h:740
XMLNode(XMLDocument *)
Definition: tinyxml2_imp.h:599
const XMLDocument* tinyxml2::XMLNode::GetDocument ( ) const
inlineinherited

Get the XMLDocument that owns this XMLNode.

Definition at line 455 of file tinyxml2.h.

References tinyxml2::XMLNode::document.

455 { return document; }
XMLDocument * document
Definition: tinyxml2.h:607
XMLDocument* tinyxml2::XMLNode::GetDocument ( )
inlineinherited

Get the XMLDocument that owns this XMLNode.

Definition at line 457 of file tinyxml2.h.

References tinyxml2::XMLNode::document.

457 { return document; }
XMLDocument * document
Definition: tinyxml2.h:607
XMLNode * XMLNode::InsertAfterChild ( XMLNode afterThis,
XMLNode addThis 
)
inlineinherited

Add a node after the specified child node.

Definition at line 718 of file tinyxml2_imp.h.

References tinyxml2::XMLNode::InsertEndChild(), tinyxml2::XMLNode::next, tinyxml2::XMLNode::parent, tinyxml2::XMLNode::prev, and TIXMLASSERT.

719 {
720  TIXMLASSERT( afterThis->parent == this );
721  if ( afterThis->parent != this )
722  return 0;
723 
724  if ( afterThis->next == 0 ) {
725  // The last node or the only node.
726  return InsertEndChild( addThis );
727  }
728  addThis->prev = afterThis;
729  addThis->next = afterThis->next;
730  afterThis->next->prev = addThis;
731  afterThis->next = addThis;
732  addThis->parent = this;
733  return addThis;
734 }
#define TIXMLASSERT(x)
Definition: tinyxml2.h:68
XMLNode * parent
Definition: tinyxml2.h:608
XMLNode * InsertEndChild(XMLNode *addThis)
Definition: tinyxml2_imp.h:669
XMLNode * next
Definition: tinyxml2.h:615
XMLNode * prev
Definition: tinyxml2.h:614
XMLNode * XMLNode::InsertEndChild ( XMLNode addThis)
inlineinherited

Add a child node as the last (right) child.

Definition at line 669 of file tinyxml2_imp.h.

References tinyxml2::XMLNode::firstChild, tinyxml2::XMLNode::lastChild, tinyxml2::XMLNode::next, tinyxml2::XMLNode::parent, tinyxml2::XMLNode::prev, and TIXMLASSERT.

Referenced by tinyxml2::XMLNode::InsertAfterChild(), tinyxml2::XMLNode::LinkEndChild(), and tinyxml2::XMLNode::ParseDeep().

670 {
671  if ( lastChild ) {
673  TIXMLASSERT( lastChild->next == 0 );
674  lastChild->next = addThis;
675  addThis->prev = lastChild;
676  lastChild = addThis;
677 
678  addThis->next = 0;
679  }
680  else {
681  TIXMLASSERT( firstChild == 0 );
682  firstChild = lastChild = addThis;
683 
684  addThis->prev = 0;
685  addThis->next = 0;
686  }
687  addThis->parent = this;
688  return addThis;
689 }
#define TIXMLASSERT(x)
Definition: tinyxml2.h:68
XMLNode * firstChild
Definition: tinyxml2.h:611
XMLNode * parent
Definition: tinyxml2.h:608
XMLNode * next
Definition: tinyxml2.h:615
XMLNode * lastChild
Definition: tinyxml2.h:612
XMLNode * prev
Definition: tinyxml2.h:614
XMLNode * XMLNode::InsertFirstChild ( XMLNode addThis)
inlineinherited

Add a child node as the first (left) child.

Definition at line 693 of file tinyxml2_imp.h.

References tinyxml2::XMLNode::firstChild, tinyxml2::XMLNode::lastChild, tinyxml2::XMLNode::next, tinyxml2::XMLNode::parent, tinyxml2::XMLNode::prev, and TIXMLASSERT.

694 {
695  if ( firstChild ) {
697  TIXMLASSERT( firstChild->prev == 0 );
698 
699  firstChild->prev = addThis;
700  addThis->next = firstChild;
701  firstChild = addThis;
702 
703  addThis->prev = 0;
704  }
705  else {
706  TIXMLASSERT( lastChild == 0 );
707  firstChild = lastChild = addThis;
708 
709  addThis->prev = 0;
710  addThis->next = 0;
711  }
712  addThis->parent = this;
713  return addThis;
714 }
#define TIXMLASSERT(x)
Definition: tinyxml2.h:68
XMLNode * firstChild
Definition: tinyxml2.h:611
XMLNode * parent
Definition: tinyxml2.h:608
XMLNode * next
Definition: tinyxml2.h:615
XMLNode * lastChild
Definition: tinyxml2.h:612
XMLNode * prev
Definition: tinyxml2.h:614
const XMLNode* tinyxml2::XMLNode::LastChild ( ) const
inlineinherited

Get the last child node, or null if none exists.

Definition at line 505 of file tinyxml2.h.

References tinyxml2::XMLNode::lastChild.

Referenced by tinyxml2::XMLHandle::LastChild(), and tinyxml2::XMLConstHandle::LastChild().

505 { return lastChild; }
XMLNode * lastChild
Definition: tinyxml2.h:612
XMLNode* tinyxml2::XMLNode::LastChild ( )
inlineinherited

Definition at line 506 of file tinyxml2.h.

References tinyxml2::XMLNode::LastChild().

Referenced by tinyxml2::XMLNode::LastChild().

506 { return const_cast<XMLNode*>(const_cast<const XMLNode*>(this)->LastChild() ); }
const XMLNode * LastChild() const
Get the last child node, or null if none exists.
Definition: tinyxml2.h:505
XMLNode(XMLDocument *)
Definition: tinyxml2_imp.h:599
const XMLElement * XMLNode::LastChildElement ( const char *  value = 0) const
inlineinherited

Get the last child element or optionally the last child element with the specified name.

Definition at line 755 of file tinyxml2_imp.h.

References tinyxml2::XMLNode::lastChild, tinyxml2::XMLElement::Name(), tinyxml2::XMLNode::prev, tinyxml2::XMLUtil::StringEqual(), tinyxml2::XMLElement::ToElement(), and tinyxml2::XMLNode::value.

Referenced by tinyxml2::XMLHandle::LastChildElement(), and tinyxml2::XMLConstHandle::LastChildElement().

756 {
757  for( XMLNode* node=lastChild; node; node=node->prev ) {
758  XMLElement* element = node->ToElement();
759  if ( element ) {
760  if ( !value || XMLUtil::StringEqual( element->Name(), value ) ) {
761  return element;
762  }
763  }
764  }
765  return 0;
766 }
static bool StringEqual(const char *p, const char *q, int nChar=INT_MAX)
Definition: tinyxml2.h:384
const char * Name() const
Get the name of an element (which is the Value() of the node.)
Definition: tinyxml2.h:861
XMLNode * lastChild
Definition: tinyxml2.h:612
virtual XMLElement * ToElement()
Safely cast to an Element, or null.
Definition: tinyxml2.h:865
XMLNode * prev
Definition: tinyxml2.h:614
XMLElement* tinyxml2::XMLNode::LastChildElement ( const char *  _value = 0)
inlineinherited

Definition at line 512 of file tinyxml2.h.

References tinyxml2::XMLNode::LastChildElement().

Referenced by tinyxml2::XMLNode::LastChildElement().

512 { return const_cast<XMLElement*>(const_cast<const XMLNode*>(this)->LastChildElement(_value) ); }
const XMLElement * LastChildElement(const char *value=0) const
Definition: tinyxml2_imp.h:755
friend class XMLElement
Definition: tinyxml2.h:451
XMLNode(XMLDocument *)
Definition: tinyxml2_imp.h:599
XMLNode* tinyxml2::XMLNode::LinkEndChild ( XMLNode addThis)
inlineinherited

Definition at line 535 of file tinyxml2.h.

References tinyxml2::XMLNode::InsertEndChild().

535 { return InsertEndChild( addThis ); }
XMLNode * InsertEndChild(XMLNode *addThis)
Definition: tinyxml2_imp.h:669
const XMLNode* tinyxml2::XMLNode::NextSibling ( ) const
inlineinherited

Get the next (right) sibling node of this node.

Definition at line 523 of file tinyxml2.h.

References tinyxml2::XMLNode::next.

Referenced by tinyxml2::XMLElement::Accept(), tinyxml2::XMLDocument::Accept(), tinyxml2::XMLHandle::NextSibling(), and tinyxml2::XMLConstHandle::NextSibling().

523 { return next; }
XMLNode * next
Definition: tinyxml2.h:615
XMLNode* tinyxml2::XMLNode::NextSibling ( )
inlineinherited

Definition at line 524 of file tinyxml2.h.

References tinyxml2::XMLNode::next.

524 { return next; }
XMLNode * next
Definition: tinyxml2.h:615
const XMLElement * XMLNode::NextSiblingElement ( const char *  value = 0) const
inlineinherited

Get the next (right) sibling element of this node, with an opitionally supplied name.

Definition at line 770 of file tinyxml2_imp.h.

References tinyxml2::XMLNode::next, tinyxml2::XMLUtil::StringEqual(), and tinyxml2::XMLElement::ToElement().

Referenced by Antioch::XMLParser< NumericType >::find_element_with_attribute(), tinyxml2::XMLHandle::NextSiblingElement(), tinyxml2::XMLConstHandle::NextSiblingElement(), Antioch::XMLParser< NumericType >::read_thermodynamic_data_root(), and Antioch::XMLParser< NumericType >::where_is_k0().

771 {
772  for( XMLNode* element=this->next; element; element = element->next ) {
773  if ( element->ToElement()
774  && (!value || XMLUtil::StringEqual( value, element->Value() )))
775  {
776  return element->ToElement();
777  }
778  }
779  return 0;
780 }
static bool StringEqual(const char *p, const char *q, int nChar=INT_MAX)
Definition: tinyxml2.h:384
XMLNode * next
Definition: tinyxml2.h:615
XMLElement* tinyxml2::XMLNode::NextSiblingElement ( const char *  _value = 0)
inlineinherited

Definition at line 528 of file tinyxml2.h.

References tinyxml2::XMLNode::NextSiblingElement().

Referenced by tinyxml2::XMLNode::NextSiblingElement().

528 { return const_cast<XMLElement*>(const_cast<const XMLNode*>(this)->NextSiblingElement( _value ) ); }
friend class XMLElement
Definition: tinyxml2.h:451
const XMLElement * NextSiblingElement(const char *value=0) const
Get the next (right) sibling element of this node, with an opitionally supplied name.
Definition: tinyxml2_imp.h:770
XMLNode(XMLDocument *)
Definition: tinyxml2_imp.h:599
bool tinyxml2::XMLNode::NoChildren ( ) const
inlineinherited

Returns true if this node has no children.

Definition at line 493 of file tinyxml2.h.

References tinyxml2::XMLNode::firstChild.

493 { return !firstChild; }
XMLNode * firstChild
Definition: tinyxml2.h:611
XMLDeclaration& tinyxml2::XMLDeclaration::operator= ( const XMLDeclaration )
protected
const XMLNode* tinyxml2::XMLNode::Parent ( ) const
inlineinherited

Get the parent of this node on the DOM.

Definition at line 489 of file tinyxml2.h.

References tinyxml2::XMLNode::parent.

489 { return parent; }
XMLNode * parent
Definition: tinyxml2.h:608
XMLNode* tinyxml2::XMLNode::Parent ( )
inlineinherited

Definition at line 490 of file tinyxml2.h.

References tinyxml2::XMLNode::parent.

490 { return parent; }
XMLNode * parent
Definition: tinyxml2.h:608
char * XMLDeclaration::ParseDeep ( char *  p,
StrPair endTag 
)
inlinevirtual

Reimplemented from tinyxml2::XMLNode.

Definition at line 999 of file tinyxml2_imp.h.

References tinyxml2::XMLNode::document, tinyxml2::StrPair::NEEDS_NEWLINE_NORMALIZATION, tinyxml2::StrPair::ParseText(), tinyxml2::XMLDocument::SetError(), tinyxml2::XMLNode::value, and tinyxml2::XML_ERROR_PARSING_DECLARATION.

1000 {
1001  // Declaration parses as text.
1002  const char* start = p;
1004  if ( p == 0 ) {
1006  }
1007  return p;
1008 }
char * ParseText(char *in, const char *endTag, int strFlags)
Definition: tinyxml2_imp.h:120
XMLDocument * document
Definition: tinyxml2.h:607
void SetError(int error, const char *str1, const char *str2)
const XMLNode* tinyxml2::XMLNode::PreviousSibling ( ) const
inlineinherited

Get the previous (left) sibling node of this node.

Definition at line 515 of file tinyxml2.h.

References tinyxml2::XMLNode::prev.

Referenced by tinyxml2::XMLHandle::PreviousSibling(), and tinyxml2::XMLConstHandle::PreviousSibling().

515 { return prev; }
XMLNode * prev
Definition: tinyxml2.h:614
XMLNode* tinyxml2::XMLNode::PreviousSibling ( )
inlineinherited

Definition at line 516 of file tinyxml2.h.

References tinyxml2::XMLNode::prev.

516 { return prev; }
XMLNode * prev
Definition: tinyxml2.h:614
const XMLElement * XMLNode::PreviousSiblingElement ( const char *  value = 0) const
inlineinherited

Get the previous (left) sibling element of this node, with an opitionally supplied name.

Definition at line 784 of file tinyxml2_imp.h.

References tinyxml2::XMLNode::prev, tinyxml2::XMLUtil::StringEqual(), and tinyxml2::XMLElement::ToElement().

Referenced by tinyxml2::XMLHandle::PreviousSiblingElement(), and tinyxml2::XMLConstHandle::PreviousSiblingElement().

785 {
786  for( XMLNode* element=this->prev; element; element = element->prev ) {
787  if ( element->ToElement()
788  && (!value || XMLUtil::StringEqual( value, element->Value() )))
789  {
790  return element->ToElement();
791  }
792  }
793  return 0;
794 }
static bool StringEqual(const char *p, const char *q, int nChar=INT_MAX)
Definition: tinyxml2.h:384
XMLNode * prev
Definition: tinyxml2.h:614
XMLElement* tinyxml2::XMLNode::PreviousSiblingElement ( const char *  _value = 0)
inlineinherited

Definition at line 520 of file tinyxml2.h.

References tinyxml2::XMLNode::PreviousSiblingElement().

Referenced by tinyxml2::XMLNode::PreviousSiblingElement().

520 { return const_cast<XMLElement*>(const_cast<const XMLNode*>(this)->PreviousSiblingElement( _value ) ); }
const XMLElement * PreviousSiblingElement(const char *value=0) const
Get the previous (left) sibling element of this node, with an opitionally supplied name...
Definition: tinyxml2_imp.h:784
friend class XMLElement
Definition: tinyxml2.h:451
XMLNode(XMLDocument *)
Definition: tinyxml2_imp.h:599
void XMLNode::SetValue ( const char *  val,
bool  staticMem = false 
)
inlineinherited

Set the Value of an XML node.

See also
Value()

Definition at line 619 of file tinyxml2_imp.h.

References tinyxml2::StrPair::SetInternedStr(), tinyxml2::StrPair::SetStr(), and tinyxml2::XMLNode::value.

Referenced by tinyxml2::XMLDocument::NewComment(), tinyxml2::XMLDocument::NewDeclaration(), tinyxml2::XMLDocument::NewText(), tinyxml2::XMLDocument::NewUnknown(), and tinyxml2::XMLElement::SetName().

620 {
621  if ( staticMem )
622  value.SetInternedStr( str );
623  else
624  value.SetStr( str );
625 }
void SetStr(const char *str, int flags=0)
Definition: tinyxml2_imp.h:108
void SetInternedStr(const char *str)
Definition: tinyxml2.h:145
XMLNode * XMLDeclaration::ShallowClone ( XMLDocument document) const
inlinevirtual

Make a copy of this node, but not its children. You may pass in a Document pointer that will be the owner of the new Node. If the 'document' is null, then the node returned will be allocated from the current Document. (this->GetDocument())

Note: if called on a XMLDocument, this will return null.

Implements tinyxml2::XMLNode.

Definition at line 1012 of file tinyxml2_imp.h.

References tinyxml2::XMLNode::document, tinyxml2::XMLDocument::NewDeclaration(), and tinyxml2::XMLNode::Value().

1013 {
1014  if ( !doc ) {
1015  doc = document;
1016  }
1017  XMLDeclaration* dec = doc->NewDeclaration( Value() ); // fixme: this will always allocate memory. Intern?
1018  return dec;
1019 }
XMLDocument * document
Definition: tinyxml2.h:607
const char * Value() const
Definition: tinyxml2.h:482
bool XMLDeclaration::ShallowEqual ( const XMLNode compare) const
inlinevirtual

Test if 2 nodes are the same, but don't test children. The 2 nodes do not need to be in the same Document.

Note: if called on a XMLDocument, this will return false.

Implements tinyxml2::XMLNode.

Definition at line 1023 of file tinyxml2_imp.h.

References tinyxml2::XMLUtil::StringEqual(), tinyxml2::XMLNode::ToDeclaration(), and tinyxml2::XMLNode::Value().

1024 {
1025  return ( compare->ToDeclaration() && XMLUtil::StringEqual( compare->ToDeclaration()->Value(), Value() ));
1026 }
static bool StringEqual(const char *p, const char *q, int nChar=INT_MAX)
Definition: tinyxml2.h:384
virtual XMLDeclaration * ToDeclaration()
Safely cast to a Declaration, or null.
Definition: tinyxml2.h:463
const char * Value() const
Definition: tinyxml2.h:482
virtual XMLComment* tinyxml2::XMLNode::ToComment ( )
inlinevirtualinherited

Safely cast to a Comment, or null.

Reimplemented in tinyxml2::XMLComment.

Definition at line 461 of file tinyxml2.h.

Referenced by tinyxml2::XMLComment::ShallowEqual().

virtual const XMLComment* tinyxml2::XMLNode::ToComment ( ) const
inlinevirtualinherited

Reimplemented in tinyxml2::XMLComment.

Definition at line 468 of file tinyxml2.h.

468 { return 0; }
virtual XMLDeclaration* tinyxml2::XMLDeclaration::ToDeclaration ( )
inlinevirtual

Safely cast to a Declaration, or null.

Reimplemented from tinyxml2::XMLNode.

Definition at line 705 of file tinyxml2.h.

705 { return this; }
virtual const XMLDeclaration* tinyxml2::XMLDeclaration::ToDeclaration ( ) const
inlinevirtual

Reimplemented from tinyxml2::XMLNode.

Definition at line 706 of file tinyxml2.h.

706 { return this; }
virtual XMLDocument* tinyxml2::XMLNode::ToDocument ( )
inlinevirtualinherited

Safely cast to a Document, or null.

Reimplemented in tinyxml2::XMLDocument.

Definition at line 462 of file tinyxml2.h.

virtual const XMLDocument* tinyxml2::XMLNode::ToDocument ( ) const
inlinevirtualinherited

Reimplemented in tinyxml2::XMLDocument.

Definition at line 469 of file tinyxml2.h.

469 { return 0; }
virtual XMLElement* tinyxml2::XMLNode::ToElement ( )
inlinevirtualinherited

Safely cast to an Element, or null.

Reimplemented in tinyxml2::XMLElement.

Definition at line 459 of file tinyxml2.h.

Referenced by tinyxml2::XMLNode::ParseDeep(), tinyxml2::XMLElement::ShallowEqual(), tinyxml2::XMLHandle::ToElement(), and tinyxml2::XMLConstHandle::ToElement().

virtual const XMLElement* tinyxml2::XMLNode::ToElement ( ) const
inlinevirtualinherited

Reimplemented in tinyxml2::XMLElement.

Definition at line 466 of file tinyxml2.h.

466 { return 0; }
virtual XMLText* tinyxml2::XMLNode::ToText ( )
inlinevirtualinherited
virtual const XMLText* tinyxml2::XMLNode::ToText ( ) const
inlinevirtualinherited

Reimplemented in tinyxml2::XMLText.

Definition at line 467 of file tinyxml2.h.

467 { return 0; }
virtual XMLUnknown* tinyxml2::XMLNode::ToUnknown ( )
inlinevirtualinherited

Safely cast to an Unknown, or null.

Reimplemented in tinyxml2::XMLUnknown.

Definition at line 464 of file tinyxml2.h.

Referenced by tinyxml2::XMLUnknown::ShallowEqual(), tinyxml2::XMLHandle::ToUnknown(), and tinyxml2::XMLConstHandle::ToUnknown().

virtual const XMLUnknown* tinyxml2::XMLNode::ToUnknown ( ) const
inlinevirtualinherited

Reimplemented in tinyxml2::XMLUnknown.

Definition at line 471 of file tinyxml2.h.

471 { return 0; }
const char* tinyxml2::XMLNode::Value ( ) const
inlineinherited

Friends And Related Function Documentation

friend class XMLDocument
friend

Definition at line 703 of file tinyxml2.h.

Member Data Documentation

XMLDocument* tinyxml2::XMLNode::document
protectedinherited
XMLNode* tinyxml2::XMLNode::firstChild
protectedinherited
XMLNode* tinyxml2::XMLNode::lastChild
protectedinherited
XMLNode* tinyxml2::XMLNode::next
protectedinherited
XMLNode* tinyxml2::XMLNode::parent
protectedinherited
XMLNode* tinyxml2::XMLNode::prev
protectedinherited
StrPair tinyxml2::XMLNode::value
mutableprotectedinherited

The documentation for this class was generated from the following files:

Generated on Thu Jul 7 2016 11:09:52 for antioch-0.4.0 by  doxygen 1.8.8