| 1601 | |
| 1602 | |
| 1603 | XMLAttribute* XMLElement::FindOrCreateAttribute( const char* name ) |
| 1604 | { |
| 1605 | XMLAttribute* last = 0; |
| 1606 | XMLAttribute* attrib = 0; |
| 1607 | for( attrib = _rootAttribute; |
| 1608 | attrib; |
| 1609 | last = attrib, attrib = attrib->_next ) { |
| 1610 | if ( XMLUtil::StringEqual( attrib->Name(), name ) ) { |
| 1611 | break; |
| 1612 | } |
| 1613 | } |
| 1614 | if ( !attrib ) { |
| 1615 | TIXMLASSERT( sizeof( XMLAttribute ) == _document->_attributePool.ItemSize() ); |
| 1616 | attrib = new (_document->_attributePool.Alloc() ) XMLAttribute(); |
| 1617 | attrib->_memPool = &_document->_attributePool; |
| 1618 | if ( last ) { |
| 1619 | last->_next = attrib; |
| 1620 | } |
| 1621 | else { |
| 1622 | _rootAttribute = attrib; |
| 1623 | } |
| 1624 | attrib->SetName( name ); |
| 1625 | attrib->_memPool->SetTracked(); // always created and linked. |
| 1626 | } |
| 1627 | return attrib; |
| 1628 | } |
| 1629 | |
| 1630 | |
| 1631 | void XMLElement::DeleteAttribute( const char* name ) |
nothing calls this directly
no test coverage detected