MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / ReplaceChild

Method ReplaceChild

ogsr_engine/xrCore/XML_Parser/tinyxml.cpp:270–295  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

268}
269
270TiXmlNode* TiXmlNode::ReplaceChild(TiXmlNode* replaceThis, const TiXmlNode& withThis)
271{
272 if (replaceThis->parent != this)
273 return 0;
274
275 TiXmlNode* node = withThis.Clone();
276 if (!node)
277 return 0;
278
279 node->next = replaceThis->next;
280 node->prev = replaceThis->prev;
281
282 if (replaceThis->next)
283 replaceThis->next->prev = node;
284 else
285 lastChild = node;
286
287 if (replaceThis->prev)
288 replaceThis->prev->next = node;
289 else
290 firstChild = node;
291
292 xr_delete(replaceThis);
293 node->parent = this;
294 return node;
295}
296
297bool TiXmlNode::RemoveChild(TiXmlNode* removeThis)
298{

Callers

nothing calls this directly

Calls 2

xr_deleteFunction · 0.85
CloneMethod · 0.80

Tested by

no test coverage detected