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

Function recursive_copy_skip

Tools/EditorFramework/pugixml.cpp:3649–3698  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3647}
3648
3649PUGI__FN void recursive_copy_skip(xml_node& dest, const xml_node& source, const xml_node& skip)
3650{
3651 assert(dest.type() == source.type());
3652
3653 switch (source.type())
3654 {
3655 case node_element:
3656 {
3657 dest.set_name(source.name());
3658
3659 for (xml_attribute a = source.first_attribute(); a; a = a.next_attribute())
3660 dest.append_attribute(a.name()).set_value(a.value());
3661
3662 for (xml_node c = source.first_child(); c; c = c.next_sibling())
3663 {
3664 if (c == skip)
3665 continue;
3666
3667 xml_node cc = dest.append_child(c.type());
3668 assert(cc);
3669
3670 recursive_copy_skip(cc, c, skip);
3671 }
3672
3673 break;
3674 }
3675
3676 case node_pcdata:
3677 case node_cdata:
3678 case node_comment:
3679 case node_doctype: dest.set_value(source.value()); break;
3680
3681 case node_pi:
3682 dest.set_name(source.name());
3683 dest.set_value(source.value());
3684 break;
3685
3686 case node_declaration:
3687 {
3688 dest.set_name(source.name());
3689
3690 for (xml_attribute a = source.first_attribute(); a; a = a.next_attribute())
3691 dest.append_attribute(a.name()).set_value(a.value());
3692
3693 break;
3694 }
3695
3696 default: assert(!"Invalid node type");
3697 }
3698}
3699
3700inline bool is_text_node(xml_node_struct* node)
3701{

Callers 4

append_copyMethod · 0.70
prepend_copyMethod · 0.70
insert_copy_afterMethod · 0.70
insert_copy_beforeMethod · 0.70

Calls 11

typeMethod · 0.45
set_nameMethod · 0.45
nameMethod · 0.45
first_attributeMethod · 0.45
next_attributeMethod · 0.45
set_valueMethod · 0.45
append_attributeMethod · 0.45
valueMethod · 0.45
first_childMethod · 0.45
next_siblingMethod · 0.45
append_childMethod · 0.45

Tested by

no test coverage detected