MCPcopy Create free account
hub / github.com/OpenZWave/open-zwave / ReplaceChild

Method ReplaceChild

cpp/tinyxml/tinyxml.cpp:292–317  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

290
291
292TiXmlNode* TiXmlNode::ReplaceChild( TiXmlNode* replaceThis, const TiXmlNode& withThis )
293{
294 if ( replaceThis->parent != this )
295 return 0;
296
297 TiXmlNode* node = withThis.Clone();
298 if ( !node )
299 return 0;
300
301 node->next = replaceThis->next;
302 node->prev = replaceThis->prev;
303
304 if ( replaceThis->next )
305 replaceThis->next->prev = node;
306 else
307 lastChild = node;
308
309 if ( replaceThis->prev )
310 replaceThis->prev->next = node;
311 else
312 firstChild = node;
313
314 delete replaceThis;
315 node->parent = this;
316 return node;
317}
318
319
320bool TiXmlNode::RemoveChild( TiXmlNode* removeThis )

Callers

nothing calls this directly

Calls 1

CloneMethod · 0.45

Tested by

no test coverage detected