| 1828 | } |
| 1829 | |
| 1830 | XMLAttribute* 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 | |
| 1862 | void XMLElement::DeleteAttribute(const char* name) |
| 1863 | { |
nothing calls this directly
no test coverage detected