Use pugixml for parse local name of directory and element informations

This commit is contained in:
joshua
2020-01-04 23:33:35 +01:00
parent eb903a12b0
commit 3492540d53
4 changed files with 59 additions and 14 deletions

View File

@@ -154,6 +154,21 @@ void DiagramContext::fromXml(const QDomElement &e, const QString &tag_name) {
}
}
/**
* @brief DiagramContext::fromXml
* Read this context properties from the @dom_element, looking for tags named @tag_name
* @param dom_element : dom element to parse
* @param tag_name : tag name to find, by default "property"
*/
void DiagramContext::fromXml(const pugi::xml_node &dom_element, const QString &tag_name)
{
for(auto node = dom_element.child(tag_name.toStdString().c_str()) ; node ; node = node.next_sibling(tag_name.toStdString().c_str()))
{
addValue(node.attribute("name").as_string(), QVariant(node.text().as_string()));
m_content_show.insert(node.attribute("name").as_string(), node.attribute("show").empty()? 1 : node.attribute("show").as_int());
}
}
/**
Export this context properties to \a settings by creating an array named \a
array_name.