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

Method InsertAfterChild

ogsr_engine/xrCore/XML_Parser/tinyxml.cpp:237–268  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

235}
236
237TiXmlNode* TiXmlNode::InsertAfterChild(TiXmlNode* afterThis, const TiXmlNode& addThis)
238{
239 if (!afterThis || afterThis->parent != this)
240 {
241 return 0;
242 }
243 if (addThis.Type() == TiXmlNode::DOCUMENT)
244 {
245 if (GetDocument())
246 GetDocument()->SetError(TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN);
247 return 0;
248 }
249
250 TiXmlNode* node = addThis.Clone();
251 if (!node)
252 return 0;
253 node->parent = this;
254
255 node->prev = afterThis;
256 node->next = afterThis->next;
257 if (afterThis->next)
258 {
259 afterThis->next->prev = node;
260 }
261 else
262 {
263 assert(lastChild == afterThis);
264 lastChild = node;
265 }
266 afterThis->next = node;
267 return node;
268}
269
270TiXmlNode* TiXmlNode::ReplaceChild(TiXmlNode* replaceThis, const TiXmlNode& withThis)
271{

Callers

nothing calls this directly

Calls 3

SetErrorMethod · 0.80
CloneMethod · 0.80
TypeMethod · 0.45

Tested by

no test coverage detected