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

Method FromXml

lib/mdflib/mdflib/src/mdstring.cpp:94–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92
93
94void MdString::FromXml(const IXmlNode& node) {
95 const auto attr_list = node.GetAttributeList();
96 for (const auto& [key, value] : attr_list) {
97 if (key == "ci" && !value.empty()) {
98 try {
99 ci_ = std::stoll(value);
100 } catch (const std::exception&) {
101 ci_ = 0;
102 }
103 } else if (key == "xml:lang") {
104 lang_ = value;
105 } else if (key == "offset") {
106 try {
107 offset_ = stoull(value);
108 } catch (const std::exception& ) {
109 offset_.reset();
110 }
111 } else {
112 AddCustomAttribute(key, value);
113 }
114 }
115 text_ = node.Value<std::string>();
116}
117} // namespace mdf

Callers

nothing calls this directly

Calls 3

GetAttributeListMethod · 0.80
emptyMethod · 0.80
resetMethod · 0.45

Tested by

no test coverage detected