| 1878 | |
| 1879 | |
| 1880 | XMLAttribute* XMLElement::FindOrCreateAttribute( const char* name ) |
| 1881 | { |
| 1882 | XMLAttribute* last = 0; |
| 1883 | XMLAttribute* attrib = 0; |
| 1884 | for( attrib = _rootAttribute; |
| 1885 | attrib; |
| 1886 | last = attrib, attrib = attrib->_next ) { |
| 1887 | if ( XMLUtil::StringEqual( attrib->Name(), name ) ) { |
| 1888 | break; |
| 1889 | } |
| 1890 | } |
| 1891 | if ( !attrib ) { |
| 1892 | attrib = CreateAttribute(); |
| 1893 | TIXMLASSERT( attrib ); |
| 1894 | if ( last ) { |
| 1895 | TIXMLASSERT( last->_next == 0 ); |
| 1896 | last->_next = attrib; |
| 1897 | } |
| 1898 | else { |
| 1899 | TIXMLASSERT( _rootAttribute == 0 ); |
| 1900 | _rootAttribute = attrib; |
| 1901 | } |
| 1902 | attrib->SetName( name ); |
| 1903 | } |
| 1904 | return attrib; |
| 1905 | } |
| 1906 | |
| 1907 | |
| 1908 | void XMLElement::DeleteAttribute( const char* name ) |
nothing calls this directly
no test coverage detected