MCPcopy Create free account
hub / github.com/GarageGames/Torque2D / InsertAfterChild

Method InsertAfterChild

engine/source/persistence/tinyXML/tinyxml.cpp:247–277  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

245
246
247TiXmlNode* TiXmlNode::InsertAfterChild( TiXmlNode* afterThis, const TiXmlNode& addThis )
248{
249 if ( !afterThis || afterThis->parent != this ) {
250 return 0;
251 }
252 if ( addThis.Type() == TiXmlNode::TINYXML_DOCUMENT )
253 {
254 if ( GetDocument() )
255 GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN );
256 return 0;
257 }
258
259 TiXmlNode* node = addThis.Clone();
260 if ( !node )
261 return 0;
262 node->parent = this;
263
264 node->prev = afterThis;
265 node->next = afterThis->next;
266 if ( afterThis->next )
267 {
268 afterThis->next->prev = node;
269 }
270 else
271 {
272 assert( lastChild == afterThis );
273 lastChild = node;
274 }
275 afterThis->next = node;
276 return node;
277}
278
279
280TiXmlNode* TiXmlNode::ReplaceChild( TiXmlNode* replaceThis, const TiXmlNode& withThis )

Callers

nothing calls this directly

Calls 3

TypeMethod · 0.80
SetErrorMethod · 0.80
CloneMethod · 0.45

Tested by

no test coverage detected