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