MCPcopy Create free account
hub / github.com/bytedance/Fastbot_Android / toXML

Method toXML

native/desc/Element.cpp:213–226  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

211 }
212
213 std::string Element::toXML() const {
214 tinyxml2::XMLDocument doc;
215 tinyxml2::XMLDeclaration *xmlDeclarationNode = doc.NewDeclaration();
216 doc.InsertFirstChild(xmlDeclarationNode);
217
218 tinyxml2::XMLElement *root = doc.NewElement("node");
219 recursiveToXML(root, this);
220 doc.LinkEndChild(root);
221
222 tinyxml2::XMLPrinter printer;
223 doc.Print(&printer);
224 std::string xmlStr = std::string(printer.CStr());
225 return xmlStr;
226 }
227
228 void Element::fromXml(const tinyxml2::XMLDocument &nodeOfDoc, const ElementPtr &parentOfNode) {
229 const ::tinyxml2::XMLElement *node = nodeOfDoc.RootElement();

Callers

nothing calls this directly

Calls 4

NewDeclarationMethod · 0.80
InsertFirstChildMethod · 0.80
NewElementMethod · 0.80
PrintMethod · 0.80

Tested by

no test coverage detected