| 1910 | |
| 1911 | |
| 1912 | XMLAttribute* XMLElement::FindOrCreateAttribute( const char* name ) |
| 1913 | { |
| 1914 | XMLAttribute* last = 0; |
| 1915 | XMLAttribute* attrib = 0; |
| 1916 | for( attrib = _rootAttribute; |
| 1917 | attrib; |
| 1918 | last = attrib, attrib = attrib->_next ) { |
| 1919 | if ( XMLUtil::StringEqual( attrib->Name(), name ) ) { |
| 1920 | break; |
| 1921 | } |
| 1922 | } |
| 1923 | if ( !attrib ) { |
| 1924 | attrib = CreateAttribute(); |
| 1925 | TIXMLASSERT( attrib ); |
| 1926 | if ( last ) { |
| 1927 | TIXMLASSERT( last->_next == 0 ); |
| 1928 | last->_next = attrib; |
| 1929 | } |
| 1930 | else { |
| 1931 | TIXMLASSERT( _rootAttribute == 0 ); |
| 1932 | _rootAttribute = attrib; |
| 1933 | } |
| 1934 | attrib->SetName( name ); |
| 1935 | } |
| 1936 | return attrib; |
| 1937 | } |
| 1938 | |
| 1939 | |
| 1940 | void XMLElement::DeleteAttribute( const char* name ) |
nothing calls this directly
no test coverage detected