1 #ifndef RAPIDXML_ALGAUDIO_HPP
2 #define RAPIDXML_ALGAUDIO_HPP
21 #include "rapidxml/rapidxml.hpp"
33 auto doc = target_doc;
34 if(!doc) std::cout <<
"WARNING: cloning an XML subtree to a destination with no parent document, crash likely!" << std::endl;
36 dest->remove_all_attributes();
37 dest->remove_all_nodes();
38 dest->type(source->type());
41 dest->name(doc->allocate_string(source->name()), source->name_size());
42 dest->value(doc->allocate_string(source->value()), source->value_size());
45 for (
xml_node<Ch> *child = source->first_node(); child; child = child->next_sibling()){
46 auto newnode = doc->allocate_node(child->type());
48 dest->append_node(newnode);
50 for (xml_attribute<Ch> *attr = source->first_attribute(); attr; attr = attr->next_attribute())
51 dest->append_attribute(doc->allocate_attribute(doc->allocate_string(attr->name()), doc->allocate_string(attr->value()), attr->name_size(), attr->value_size()));
56 #endif // RAPIDXML_ALGAUDIO_HPP
void clone_node_copying(const xml_node< Ch > *source, xml_node< Ch > *dest, xml_document<> *target_doc)
Definition: rapidxml_algaudio.hpp:30
Definition: Module.hpp:37
Definition: Module.hpp:35