MCPcopy Create free account
hub / github.com/USCiLab/cereal / insert_node

Method insert_node

include/cereal/external/rapidxml/rapidxml.hpp:1132–1148  ·  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

1130 //! \param where Place where to insert the child, or 0 to insert at the back.
1131 //! \param child Node to insert.
1132 void insert_node(xml_node<Ch> *where, xml_node<Ch> *child)
1133 {
1134 assert(!where || where->parent() == this);
1135 assert(child && !child->parent() && child->type() != node_document);
1136 if (where == m_first_node)
1137 prepend_node(child);
1138 else if (where == 0)
1139 append_node(child);
1140 else
1141 {
1142 child->m_prev_sibling = where->m_prev_sibling;
1143 child->m_next_sibling = where;
1144 where->m_prev_sibling->m_next_sibling = child;
1145 where->m_prev_sibling = child;
1146 child->m_parent = this;
1147 }
1148 }
1149
1150 //! Removes first child node.
1151 //! If node has no children, behaviour is undefined.

Callers

nothing calls this directly

Calls 2

parentMethod · 0.80
typeMethod · 0.80

Tested by

no test coverage detected