#include <OBTtinyxml.h>
Public Member Functions | |
TiXmlAttributeSet () | |
~TiXmlAttributeSet () | |
void | Add (TiXmlAttribute *attribute) |
void | Remove (TiXmlAttribute *attribute) |
const TiXmlAttribute * | First () const |
TiXmlAttribute * | First () |
const TiXmlAttribute * | Last () const |
TiXmlAttribute * | Last () |
const TiXmlAttribute * | Find (const char *_name) const |
TiXmlAttribute * | Find (const char *_name) |
const TiXmlAttribute * | Find (const std::string &_name) const |
TiXmlAttribute * | Find (const std::string &_name) |
Private Member Functions | |
TiXmlAttributeSet (const TiXmlAttributeSet &) | |
void | operator= (const TiXmlAttributeSet &) |
Private Attributes | |
TiXmlAttribute | sentinel |
Definition at line 909 of file tiny/tmp/OBTtinyxml.h.
xmlTiny::TiXmlAttributeSet::TiXmlAttributeSet | ( | ) |
Definition at line 1505 of file tiny/tmp/OBTtinyxml.cpp.
References xmlTiny::TiXmlAttribute::next, xmlTiny::TiXmlAttribute::prev, and sentinel.
xmlTiny::TiXmlAttributeSet::~TiXmlAttributeSet | ( | ) |
Definition at line 1512 of file tiny/tmp/OBTtinyxml.cpp.
References xmlTiny::TiXmlAttribute::next, xmlTiny::TiXmlAttribute::prev, and sentinel.
01513 { 01514 assert( sentinel.next == &sentinel ); 01515 assert( sentinel.prev == &sentinel ); 01516 }
xmlTiny::TiXmlAttributeSet::TiXmlAttributeSet | ( | const TiXmlAttributeSet & | ) | [private] |
void xmlTiny::TiXmlAttributeSet::Add | ( | TiXmlAttribute * | attribute | ) |
Definition at line 1519 of file tiny/tmp/OBTtinyxml.cpp.
References Find(), xmlTiny::TiXmlAttribute::Name(), xmlTiny::TiXmlAttribute::next, xmlTiny::TiXmlAttribute::prev, sentinel, and TIXML_STRING.
Referenced by xmlTiny::TiXmlElement::Parse(), and xmlTiny::TiXmlElement::SetAttribute().
01520 { 01521 #ifdef TIXML_USE_STL 01522 assert( !Find( TIXML_STRING( addMe->Name() ) ) ); // Shouldn't be multiply adding to the set. 01523 #else 01524 assert( !Find( addMe->Name() ) ); // Shouldn't be multiply adding to the set. 01525 #endif 01526 01527 addMe->next = &sentinel; 01528 addMe->prev = sentinel.prev; 01529 01530 sentinel.prev->next = addMe; 01531 sentinel.prev = addMe; 01532 }
void xmlTiny::TiXmlAttributeSet::Remove | ( | TiXmlAttribute * | attribute | ) |
Definition at line 1534 of file tiny/tmp/OBTtinyxml.cpp.
References xmlTiny::TiXmlAttribute::next, xmlTiny::TiXmlAttribute::prev, and sentinel.
Referenced by xmlTiny::TiXmlElement::ClearThis(), and xmlTiny::TiXmlElement::RemoveAttribute().
01535 { 01536 TiXmlAttribute* node; 01537 01538 for( node = sentinel.next; node != &sentinel; node = node->next ) 01539 { 01540 if ( node == removeMe ) 01541 { 01542 node->prev->next = node->next; 01543 node->next->prev = node->prev; 01544 node->next = 0; 01545 node->prev = 0; 01546 return; 01547 } 01548 } 01549 assert( 0 ); // we tried to remove a non-linked attribute. 01550 }
const TiXmlAttribute* xmlTiny::TiXmlAttributeSet::First | ( | ) | const [inline] |
Definition at line 918 of file tiny/tmp/OBTtinyxml.h.
References xmlTiny::TiXmlAttribute::next, and sentinel.
Referenced by xmlTiny::TiXmlElement::Accept(), xmlTiny::TiXmlElement::ClearThis(), xmlTiny::TiXmlElement::CopyTo(), xmlTiny::TiXmlElement::FirstAttribute(), and xmlTiny::TiXmlElement::Print().
TiXmlAttribute* xmlTiny::TiXmlAttributeSet::First | ( | ) | [inline] |
Definition at line 919 of file tiny/tmp/OBTtinyxml.h.
References xmlTiny::TiXmlAttribute::next, and sentinel.
const TiXmlAttribute* xmlTiny::TiXmlAttributeSet::Last | ( | ) | const [inline] |
Definition at line 920 of file tiny/tmp/OBTtinyxml.h.
References xmlTiny::TiXmlAttribute::prev, and sentinel.
Referenced by xmlTiny::TiXmlElement::LastAttribute().
TiXmlAttribute* xmlTiny::TiXmlAttributeSet::Last | ( | ) | [inline] |
Definition at line 921 of file tiny/tmp/OBTtinyxml.h.
References xmlTiny::TiXmlAttribute::prev, and sentinel.
const TiXmlAttribute * xmlTiny::TiXmlAttributeSet::Find | ( | const char * | _name | ) | const |
Definition at line 1578 of file tiny/tmp/OBTtinyxml.cpp.
References xmlTiny::TiXmlAttribute::name, xmlTiny::TiXmlAttribute::next, and sentinel.
Referenced by Add(), xmlTiny::TiXmlElement::Attribute(), xmlTiny::TiXmlElement::Parse(), xmlTiny::TiXmlElement::QueryDoubleAttribute(), xmlTiny::TiXmlElement::QueryIntAttribute(), xmlTiny::TiXmlElement::QueryValueAttribute(), xmlTiny::TiXmlElement::RemoveAttribute(), and xmlTiny::TiXmlElement::SetAttribute().
01579 { 01580 for( const TiXmlAttribute* node = sentinel.next; node != &sentinel; node = node->next ) 01581 { 01582 if ( strcmp( node->name.c_str(), name ) == 0 ) 01583 return node; 01584 } 01585 return 0; 01586 }
TiXmlAttribute* xmlTiny::TiXmlAttributeSet::Find | ( | const char * | _name | ) | [inline] |
Definition at line 924 of file tiny/tmp/OBTtinyxml.h.
00924 { 00925 return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttributeSet* >(this))->Find( _name ) ); 00926 }
const TiXmlAttribute* xmlTiny::TiXmlAttributeSet::Find | ( | const std::string & | _name | ) | const |
TiXmlAttribute* xmlTiny::TiXmlAttributeSet::Find | ( | const std::string & | _name | ) | [inline] |
Definition at line 929 of file tiny/tmp/OBTtinyxml.h.
00929 { 00930 return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttributeSet* >(this))->Find( _name ) ); 00931 }
void xmlTiny::TiXmlAttributeSet::operator= | ( | const TiXmlAttributeSet & | ) | [private] |
Definition at line 941 of file tiny/tmp/OBTtinyxml.h.
Referenced by Add(), Find(), First(), Last(), Remove(), TiXmlAttributeSet(), and ~TiXmlAttributeSet().