MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / MakeUnitGroup

Function MakeUnitGroup

lib/mdflib/mdflib/src/md4block.cpp:75–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73}
74
75void MakeUnitGroup(const mdf::IXmlNode &pd,
76 mdf::detail::BlockPropertyList &dest) {
77 mdf::IXmlNode::ChildList list;
78 pd.GetChildList(list);
79
80 std::string name;
81 std::ostringstream desc;
82
83 for (const auto &c : list) {
84 if (c->IsTagName("SHORT_NAME")) {
85 name = c->Value<std::string>();
86 } else if (c->IsTagName("UNIT-REFS")) {
87 mdf::IXmlNode::ChildList ref_list;
88 c->GetChildList(ref_list);
89 for (const auto &ref : ref_list) {
90 const auto id = ref->Attribute<std::string>("ID-REF");
91 if (desc.str().empty()) {
92 desc << id;
93 } else {
94 desc << ", " << id;
95 }
96 }
97 }
98 }
99 dest.emplace_back("Unit Group", name, desc.str());
100}
101
102void MakeUnitGroupList(const mdf::IXmlNode &root,
103 mdf::detail::BlockPropertyList &dest) {

Callers 1

MakeUnitGroupListFunction · 0.85

Calls 3

IsTagNameMethod · 0.80
emptyMethod · 0.80
GetChildListMethod · 0.45

Tested by

no test coverage detected