Logo Search packages:      
Sourcecode: rarian version File versions

TiXmlNode * TiXmlNode::InsertAfterChild ( TiXmlNode afterThis,
const TiXmlNode addThis 
) [inherited]

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.

Definition at line 250 of file tinyxml.cpp.

References TiXmlNode::Clone(), TiXmlNode::next, TiXmlNode::parent, and TiXmlNode::prev.

{
      if ( !afterThis || afterThis->parent != this )
            return 0;

      TiXmlNode* node = addThis.Clone();
      if ( !node )
            return 0;
      node->parent = this;

      node->prev = afterThis;
      node->next = afterThis->next;
      if ( afterThis->next )
      {
            afterThis->next->prev = node;
      }
      else
      {
            assert( lastChild == afterThis );
            lastChild = node;
      }
      afterThis->next = node;
      return node;
}


Generated by  Doxygen 1.6.0   Back to index