MCPcopy Create free account
hub / github.com/BehaviorTree/BehaviorTree.CPP / WriteTreeToXML

Function WriteTreeToXML

src/xml_parsing.cpp:1744–1757  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1742}
1743
1744std::string WriteTreeToXML(const Tree& tree, bool add_metadata, bool add_builtin_models)
1745{
1746 XMLDocument doc;
1747
1748 XMLElement* rootXML = doc.NewElement("root");
1749 rootXML->SetAttribute("BTCPP_format", 4);
1750 doc.InsertFirstChild(rootXML);
1751
1752 addTreeToXML(tree, doc, rootXML, add_metadata, add_builtin_models);
1753
1754 XMLPrinter printer;
1755 doc.Print(&printer);
1756 return std::string(printer.CStr(), size_t(printer.CStrSize() - 1));
1757}
1758
1759} // namespace BT

Callers 5

Groot2PublisherMethod · 0.85
FileLogger2Method · 0.85
SqliteLoggerMethod · 0.85
mainFunction · 0.85
mainFunction · 0.85

Calls 6

addTreeToXMLFunction · 0.85
stringFunction · 0.85
NewElementMethod · 0.80
SetAttributeMethod · 0.80
InsertFirstChildMethod · 0.80
PrintMethod · 0.80

Tested by

no test coverage detected