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