MCPcopy Create free account
hub / github.com/MyGUI/mygui / insert_child_after

Method insert_child_after

UnitTests/TestApp/pugixml.cpp:4875–4901  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4873 }
4874
4875 PUGI__FN xml_node xml_node::insert_child_after(xml_node_type type_, const xml_node& node)
4876 {
4877 if (!impl::allow_insert_child(this->type(), type_))
4878 return xml_node();
4879 if (!node._root || node._root->parent != _root)
4880 return xml_node();
4881
4882 xml_node n(impl::allocate_node(impl::get_allocator(_root), type_));
4883 if (!n)
4884 return xml_node();
4885
4886 n._root->parent = _root;
4887
4888 if (node._root->next_sibling)
4889 node._root->next_sibling->prev_sibling_c = n._root;
4890 else
4891 _root->first_child->prev_sibling_c = n._root;
4892
4893 n._root->next_sibling = node._root->next_sibling;
4894 n._root->prev_sibling_c = node._root;
4895 node._root->next_sibling = n._root;
4896
4897 if (type_ == node_declaration)
4898 n.set_name(PUGIXML_TEXT("xml"));
4899
4900 return n;
4901 }
4902
4903 PUGI__FN xml_node xml_node::append_child(const char_t* name_)
4904 {

Callers

nothing calls this directly

Calls 5

allow_insert_childFunction · 0.70
xml_nodeClass · 0.70
allocate_nodeFunction · 0.70
typeMethod · 0.45
set_nameMethod · 0.45

Tested by

no test coverage detected