| 1329 | |
| 1330 | |
| 1331 | XMLAttribute* XMLElement::FindOrCreateAttribute( const char* name ) { |
| 1332 | XMLAttribute* last = 0; |
| 1333 | XMLAttribute* attrib = 0; |
| 1334 | for( attrib = _rootAttribute; |
| 1335 | attrib; |
| 1336 | last = attrib, attrib = attrib->_next ) { |
| 1337 | if ( XMLUtil::StringEqual( attrib->Name(), name ) ) { |
| 1338 | break; |
| 1339 | } |
| 1340 | } |
| 1341 | if ( !attrib ) { |
| 1342 | TIXMLASSERT( sizeof( XMLAttribute ) == _document->_attributePool.ItemSize() ); |
| 1343 | attrib = new (_document->_attributePool.Alloc() ) XMLAttribute(); |
| 1344 | attrib->_memPool = &_document->_attributePool; |
| 1345 | if ( last ) { |
| 1346 | last->_next = attrib; |
| 1347 | } else { |
| 1348 | _rootAttribute = attrib; |
| 1349 | } |
| 1350 | attrib->SetName( name ); |
| 1351 | attrib->_memPool->SetTracked(); // always created and linked. |
| 1352 | } |
| 1353 | return attrib; |
| 1354 | } |
| 1355 | |
| 1356 | |
| 1357 | void XMLElement::DeleteAttribute( const char* name ) { |
nothing calls this directly
no test coverage detected