MCPcopy Create free account
hub / github.com/computationalpathologygroup/ASAP / saveGroup

Method saveGroup

annotation/XmlRepository.cpp:74–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72}
73
74void XmlRepository::saveGroup(const std::shared_ptr<AnnotationGroup>& group, pugi::xml_node* node) const
75{
76 pugi::xml_node nodeGroup = node->append_child("Group");
77 pugi::xml_attribute attributeName = nodeGroup.append_attribute("Name");
78 attributeName.set_value(group->getName().c_str());
79 pugi::xml_attribute attributeGroup = nodeGroup.append_attribute("PartOfGroup");
80 if (group->getGroup()) {
81 attributeGroup.set_value(group->getGroup()->getName().c_str());
82 }
83 else {
84 attributeGroup.set_value("None");
85 }
86 pugi::xml_attribute attributeColor = nodeGroup.append_attribute("Color");
87 attributeColor.set_value(group->getColor().c_str());
88
89 pugi::xml_node nodeAttributes = nodeGroup.append_child("Attributes");
90 std::map<std::string, std::string> attributes = group->getAttributes();
91 for (std::map<std::string, std::string>::const_iterator it = attributes.begin(); it != attributes.end(); ++it) {
92 pugi::xml_node nodeAttribute = nodeAttributes.append_child("Attribute");
93 pugi::xml_attribute attribute = nodeAttribute.append_attribute(it->first.c_str());
94 attribute.set_value(it->second.c_str());
95 }
96}
97
98bool XmlRepository::loadFromRepo()
99{

Callers

nothing calls this directly

Calls 4

getNameMethod · 0.80
getColorMethod · 0.80
getAttributesMethod · 0.80
getGroupMethod · 0.45

Tested by

no test coverage detected