| 1450 | |
| 1451 | |
| 1452 | XMLAttribute* XMLElement::FindOrCreateAttribute( const char* name ) |
| 1453 | { |
| 1454 | XMLAttribute* last = 0; |
| 1455 | XMLAttribute* attrib = 0; |
| 1456 | for( attrib = _rootAttribute; |
| 1457 | attrib; |
| 1458 | last = attrib, attrib = attrib->_next ) { |
| 1459 | if ( XMLUtil::StringEqual( attrib->Name(), name ) ) { |
| 1460 | break; |
| 1461 | } |
| 1462 | } |
| 1463 | if ( !attrib ) { |
| 1464 | TIXMLASSERT( sizeof( XMLAttribute ) == _document->_attributePool.ItemSize() ); |
| 1465 | attrib = new (_document->_attributePool.Alloc() ) XMLAttribute(); |
| 1466 | attrib->_memPool = &_document->_attributePool; |
| 1467 | if ( last ) { |
| 1468 | last->_next = attrib; |
| 1469 | } |
| 1470 | else { |
| 1471 | _rootAttribute = attrib; |
| 1472 | } |
| 1473 | attrib->SetName( name ); |
| 1474 | attrib->_memPool->SetTracked(); // always created and linked. |
| 1475 | } |
| 1476 | return attrib; |
| 1477 | } |
| 1478 | |
| 1479 | |
| 1480 | void XMLElement::DeleteAttribute( const char* name ) |
nothing calls this directly
no test coverage detected