MCPcopy Create free account
hub / github.com/cinder/Cinder / insert_node

Method insert_node

include/rapidxml/rapidxml.hpp:1119–1135  ·  view source on GitHub ↗

Inserts a new child node at specified place inside the node. All children after and including the specified node are moved one position back. \param where Place where to insert the child, or 0 to insert at the back. \param child Node to insert.

Source from the content-addressed store, hash-verified

1117 //! \param where Place where to insert the child, or 0 to insert at the back.
1118 //! \param child Node to insert.
1119 void insert_node(xml_node<Ch> *where, xml_node<Ch> *child)
1120 {
1121 assert(!where || where->parent() == this);
1122 assert(child && !child->parent() && child->type() != node_document);
1123 if (where == m_first_node)
1124 prepend_node(child);
1125 else if (where == 0)
1126 append_node(child);
1127 else
1128 {
1129 child->m_prev_sibling = where->m_prev_sibling;
1130 child->m_next_sibling = where;
1131 where->m_prev_sibling->m_next_sibling = child;
1132 where->m_prev_sibling = child;
1133 child->m_parent = this;
1134 }
1135 }
1136
1137 //! Removes first child node.
1138 //! If node has no children, behaviour is undefined.

Callers

nothing calls this directly

Calls 3

assertFunction · 0.85
parentMethod · 0.80
typeMethod · 0.45

Tested by

no test coverage detected