| 1382 | |
| 1383 | |
| 1384 | XMLAttribute* XMLElement::FindOrCreateAttribute( const char* name ) |
| 1385 | { |
| 1386 | XMLAttribute* last = 0; |
| 1387 | XMLAttribute* attrib = 0; |
| 1388 | for( attrib = _rootAttribute; |
| 1389 | attrib; |
| 1390 | last = attrib, attrib = attrib->_next ) { |
| 1391 | if ( XMLUtil::StringEqual( attrib->Name(), name ) ) { |
| 1392 | break; |
| 1393 | } |
| 1394 | } |
| 1395 | if ( !attrib ) { |
| 1396 | attrib = new (_document->_attributePool.Alloc() ) XMLAttribute(); |
| 1397 | attrib->_memPool = &_document->_attributePool; |
| 1398 | if ( last ) { |
| 1399 | last->_next = attrib; |
| 1400 | } |
| 1401 | else { |
| 1402 | _rootAttribute = attrib; |
| 1403 | } |
| 1404 | attrib->SetName( name ); |
| 1405 | attrib->_memPool->SetTracked(); // always created and linked. |
| 1406 | } |
| 1407 | return attrib; |
| 1408 | } |
| 1409 | |
| 1410 | |
| 1411 | void XMLElement::DeleteAttribute( const char* name ) |
nothing calls this directly
no test coverage detected