MCPcopy Create free account
hub / github.com/bulletphysics/bullet3 / FindOrCreateAttribute

Method FindOrCreateAttribute

examples/ThirdPartyLibs/tinyxml2/tinyxml2.cpp:1830–1860  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1828}
1829
1830XMLAttribute* XMLElement::FindOrCreateAttribute(const char* name)
1831{
1832 XMLAttribute* last = 0;
1833 XMLAttribute* attrib = 0;
1834 for (attrib = _rootAttribute;
1835 attrib;
1836 last = attrib, attrib = attrib->_next)
1837 {
1838 if (XMLUtil::StringEqual(attrib->Name(), name))
1839 {
1840 break;
1841 }
1842 }
1843 if (!attrib)
1844 {
1845 attrib = CreateAttribute();
1846 TIXMLASSERT(attrib);
1847 if (last)
1848 {
1849 TIXMLASSERT(last->_next == 0);
1850 last->_next = attrib;
1851 }
1852 else
1853 {
1854 TIXMLASSERT(_rootAttribute == 0);
1855 _rootAttribute = attrib;
1856 }
1857 attrib->SetName(name);
1858 }
1859 return attrib;
1860}
1861
1862void XMLElement::DeleteAttribute(const char* name)
1863{

Callers

nothing calls this directly

Calls 3

StringEqualFunction · 0.85
NameMethod · 0.80
SetNameMethod · 0.80

Tested by

no test coverage detected