MCPcopy Create free account
hub / github.com/IENT/YUView / findChildValueWithAttributes

Method findChildValueWithAttributes

YUViewLib/src/common/YUViewDomElement.cpp:45–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43}
44
45std::pair<QString, QStringPairList>
46YUViewDomElement::findChildValueWithAttributes(const QString &tagName) const
47{
48 for (auto n = firstChild(); !n.isNull(); n = n.nextSibling())
49 {
50 if (n.isElement() && n.toElement().tagName() == tagName)
51 {
52 QStringPairList attributeList;
53 auto attributes = n.toElement().attributes();
54 for (int i = 0; i < attributes.length(); i++)
55 {
56 auto name = attributes.item(i).nodeName();
57 auto val = attributes.item(i).nodeValue();
58 attributeList.append(QStringPair(name, val));
59 }
60 auto text = n.toElement().text();
61 return {text, attributeList};
62 }
63 }
64 return {};
65}
66
67int YUViewDomElement::findChildValueInt(const QString &tagName, int defaultValue) const
68{

Callers 1

loadPlaylistMethod · 0.80

Calls 2

appendMethod · 0.80
textMethod · 0.80

Tested by

no test coverage detected