MCPcopy Create free account
hub / github.com/DFHack/dfhack / LinkEndChild

Method LinkEndChild

depends/tinyxml/tinyxml.cpp:186–211  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184
185
186TiXmlNode* TiXmlNode::LinkEndChild( TiXmlNode* node )
187{
188 assert( node->parent == 0 || node->parent == this );
189 assert( node->GetDocument() == 0 || node->GetDocument() == this->GetDocument() );
190
191 if ( node->Type() == TiXmlNode::TINYXML_DOCUMENT )
192 {
193 delete node;
194 if ( GetDocument() )
195 GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN );
196 return 0;
197 }
198
199 node->parent = this;
200
201 node->prev = lastChild;
202 node->next = 0;
203
204 if ( lastChild )
205 lastChild->next = node;
206 else
207 firstChild = node; // it was an empty list.
208
209 lastChild = node;
210 return node;
211}
212
213
214TiXmlNode* TiXmlNode::InsertEndChild( const TiXmlNode& addThis )

Callers 1

CopyToMethod · 0.80

Calls 3

GetDocumentMethod · 0.95
TypeMethod · 0.80
SetErrorMethod · 0.80

Tested by

no test coverage detected