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

Method InsertAfterChild

cpp/tinyxml/tinyxml.cpp:260–289  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

258
259
260TiXmlNode* TiXmlNode::InsertAfterChild( TiXmlNode* afterThis, const TiXmlNode& addThis )
261{
262 if ( !afterThis || afterThis->parent != this ) {
263 return 0;
264 }
265 if ( addThis.Type() == TiXmlNode::DOCUMENT )
266 {
267 if ( GetDocument() ) GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN );
268 return 0;
269 }
270
271 TiXmlNode* node = addThis.Clone();
272 if ( !node )
273 return 0;
274 node->parent = this;
275
276 node->prev = afterThis;
277 node->next = afterThis->next;
278 if ( afterThis->next )
279 {
280 afterThis->next->prev = node;
281 }
282 else
283 {
284 assert( lastChild == afterThis );
285 lastChild = node;
286 }
287 afterThis->next = node;
288 return node;
289}
290
291
292TiXmlNode* 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