MCPcopy Create free account
hub / github.com/cemu-project/Cemu / FindOrCreateAttribute

Method FindOrCreateAttribute

src/util/tinyxml2/tinyxml2.cpp:1759–1784  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1757
1758
1759 XMLAttribute* XMLElement::FindOrCreateAttribute(const char* name)
1760 {
1761 XMLAttribute* last = 0;
1762 XMLAttribute* attrib = 0;
1763 for (attrib = _rootAttribute;
1764 attrib;
1765 last = attrib, attrib = attrib->_next) {
1766 if (XMLUtil::StringEqual(attrib->Name(), name)) {
1767 break;
1768 }
1769 }
1770 if (!attrib) {
1771 attrib = CreateAttribute();
1772 TIXMLASSERT(attrib);
1773 if (last) {
1774 TIXMLASSERT(last->_next == 0);
1775 last->_next = attrib;
1776 }
1777 else {
1778 TIXMLASSERT(_rootAttribute == 0);
1779 _rootAttribute = attrib;
1780 }
1781 attrib->SetName(name);
1782 }
1783 return attrib;
1784 }
1785
1786
1787 void XMLElement::DeleteAttribute(const char* name)

Callers

nothing calls this directly

Calls 3

StringEqualFunction · 0.85
NameMethod · 0.80
SetNameMethod · 0.80

Tested by

no test coverage detected