37GroupXmlWriter::GroupXmlWriter()
49 "generateContext",
"true",
"false", group->contextGenerationEnabled(),
false);
51 if (!group->getDescription().isEmpty())
58 for (QString proxy : group->getProxies())
63 auto c = group->getConfigurations();
67 for (
auto it =
c.begin(); it !=
c.end(); it++)
80 for (
int i = 0; i < rootNode->getChildren().count(); i++)
82 WriteNode(rootNode->getChildren().at(i), root);
87 std::string contents = builder.
print(
true);
90 ARMARX_INFO_S <<
"Writing new group definition to " << path.toUtf8().data();
99 if (!f.open(QFile::WriteOnly | QFile::Text))
112 switch (node->getNodeType())
115 WriteFolderNode(node, parentXmlNode);
119 WriteStateNode(node, parentXmlNode);
123 throw std::runtime_error(
"Unknown node type");
130 RapidXmlWriterNode xmlNode = parentXmlNode.
append_node(
"Folder");
133 for (
int i = 0; i < node->getChildren().count(); i++)
135 WriteNode(node->getChildren().at(i), xmlNode);
142 RapidXmlWriterNode xmlNode = parentXmlNode.
append_node(
"State");
145 "visibility",
"public",
"private", node->isPublic(),
false);
static void WriteFileContents(QString path, QString contents)
static void WriteXml(StatechartGroupPtr group, QString path, bool indent=true)
RapidXmlWriterNode & append_data_node(const std::string &value)
RapidXmlWriterNode append_node(const std::string &name)
RapidXmlWriterNode & append_string_node(const std::string &name, const std::string &value)
RapidXmlWriterNode & append_optional_bool_attribute(const std::string &name, const std::string &trueValue, const std::string &falseValue, bool value, bool defaultValue)
RapidXmlWriterNode & append_attribute(const std::string &name, const std::string &value)
std::string print(bool indent)
RapidXmlWriterNode createRootNode(const std::string &name)
static bool writeFileContentsIfChanged(const std::string &path, const std::string &contents)
This file offers overloads of toIce() and fromIce() functions for STL container types.
std::shared_ptr< StatechartGroup > StatechartGroupPtr
std::shared_ptr< StateTreeNode > StateTreeNodePtr