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

Method Attribute

lib/mdflib/mdflib/src/ixmlnode.h:228–240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

226
227template <typename T>
228T IXmlNode::Attribute(const std::string& key, const T& def) const {
229 for (const auto &p : attribute_list_) {
230 if (Platform::stricmp(p.first.c_str(), key.c_str()) == 0) {
231 std::string v(p.second);
232 mdf::MdfHelper::Trim(v);
233 std::istringstream temp(v);
234 T out = {};
235 temp >> out;
236 return out;
237 }
238 }
239 return def;
240}
241
242template <>
243inline bool IXmlNode::Attribute(const std::string& key, const bool& def) const {

Callers 2

FromXmlMethod · 0.80
FetchETagFunction · 0.80

Calls 2

stricmpFunction · 0.85
strnicmpFunction · 0.85

Tested by

no test coverage detected