| 1067 | } |
| 1068 | |
| 1069 | bool DataTree::SaveToFileXML(const std::string& filename) { |
| 1070 | TiXmlDocument doc; |
| 1071 | auto * decl = new TiXmlDeclaration("1.0", "", ""); |
| 1072 | doc.LinkEndChild(decl); |
| 1073 | |
| 1074 | string rootName = rootNode()->getName(); |
| 1075 | |
| 1076 | auto *element = new TiXmlElement(rootName.empty() ? "root" : rootName.c_str()); |
| 1077 | |
| 1078 | doc.LinkEndChild(element); |
| 1079 | |
| 1080 | nodeToXML(rootNode(), element); |
| 1081 | |
| 1082 | doc.SaveFile(filename.c_str()); |
| 1083 | |
| 1084 | return true; |
| 1085 | } |
| 1086 | |
| 1087 | |
| 1088 |
no test coverage detected