| 1836 | |
| 1837 | |
| 1838 | XMLAttribute* XMLElement::FindOrCreateAttribute( const char* name ) |
| 1839 | { |
| 1840 | XMLAttribute* last = 0; |
| 1841 | XMLAttribute* attrib = 0; |
| 1842 | for( attrib = _rootAttribute; |
| 1843 | attrib; |
| 1844 | last = attrib, attrib = attrib->_next ) { |
| 1845 | if ( XMLUtil::StringEqual( attrib->Name(), name ) ) { |
| 1846 | break; |
| 1847 | } |
| 1848 | } |
| 1849 | if ( !attrib ) { |
| 1850 | attrib = CreateAttribute(); |
| 1851 | TIXMLASSERT( attrib ); |
| 1852 | if ( last ) { |
| 1853 | TIXMLASSERT( last->_next == 0 ); |
| 1854 | last->_next = attrib; |
| 1855 | } |
| 1856 | else { |
| 1857 | TIXMLASSERT( _rootAttribute == 0 ); |
| 1858 | _rootAttribute = attrib; |
| 1859 | } |
| 1860 | attrib->SetName( name ); |
| 1861 | } |
| 1862 | return attrib; |
| 1863 | } |
| 1864 | |
| 1865 | |
| 1866 | void XMLElement::DeleteAttribute( const char* name ) |
nothing calls this directly
no test coverage detected