OBT::TiXmlAttributeSet Class Reference

#include <OBTtinyxml.h>

Collaboration diagram for OBT::TiXmlAttributeSet:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 TiXmlAttributeSet ()
 ~TiXmlAttributeSet ()
void Add (TiXmlAttribute *attribute)
void Remove (TiXmlAttribute *attribute)
const TiXmlAttributeFirst () const
TiXmlAttributeFirst ()
const TiXmlAttributeLast () const
TiXmlAttributeLast ()
const TiXmlAttributeFind (const char *_name) const
TiXmlAttributeFind (const char *_name)
const TiXmlAttributeFind (const std::string &_name) const
TiXmlAttributeFind (const std::string &_name)
 TiXmlAttributeSet ()
 ~TiXmlAttributeSet ()
void Add (TiXmlAttribute *attribute)
void Remove (TiXmlAttribute *attribute)
const TiXmlAttributeFirst () const
TiXmlAttributeFirst ()
const TiXmlAttributeLast () const
TiXmlAttributeLast ()
const TiXmlAttributeFind (const char *_name) const
TiXmlAttributeFind (const char *_name)
const TiXmlAttributeFind (const std::string &_name) const
TiXmlAttributeFind (const std::string &_name)

Private Member Functions

 TiXmlAttributeSet (const TiXmlAttributeSet &)
void operator= (const TiXmlAttributeSet &)
 TiXmlAttributeSet (const TiXmlAttributeSet &)
void operator= (const TiXmlAttributeSet &)

Private Attributes

TiXmlAttribute sentinel


Detailed Description

Definition at line 911 of file OBTtinyxml.h.


Constructor & Destructor Documentation

OBT::TiXmlAttributeSet::TiXmlAttributeSet (  ) 

Definition at line 1504 of file OBTtinyxml.cpp.

References OBT::TiXmlAttribute::next, OBT::TiXmlAttribute::prev, and sentinel.

01505 {
01506         sentinel.next = &sentinel;
01507         sentinel.prev = &sentinel;
01508 }

OBT::TiXmlAttributeSet::~TiXmlAttributeSet (  ) 

Definition at line 1511 of file OBTtinyxml.cpp.

References OBT::TiXmlAttribute::next, OBT::TiXmlAttribute::prev, and sentinel.

01512 {
01513         assert( sentinel.next == &sentinel );
01514         assert( sentinel.prev == &sentinel );
01515 }

OBT::TiXmlAttributeSet::TiXmlAttributeSet ( const TiXmlAttributeSet  )  [private]

OBT::TiXmlAttributeSet::TiXmlAttributeSet (  ) 

OBT::TiXmlAttributeSet::~TiXmlAttributeSet (  ) 

OBT::TiXmlAttributeSet::TiXmlAttributeSet ( const TiXmlAttributeSet  )  [private]


Member Function Documentation

void OBT::TiXmlAttributeSet::Add ( TiXmlAttribute attribute  ) 

Definition at line 1518 of file OBTtinyxml.cpp.

References Find(), OBT::TiXmlAttribute::Name(), OBT::TiXmlAttribute::next, OBT::TiXmlAttribute::prev, sentinel, and TIXML_STRING.

Referenced by OBT::TiXmlElement::Parse(), and OBT::TiXmlElement::SetAttribute().

01519 {
01520     #ifdef TIXML_USE_STL
01521         assert( !Find( TIXML_STRING( addMe->Name() ) ) );       // Shouldn't be multiply adding to the set.
01522         #else
01523         assert( !Find( addMe->Name() ) );       // Shouldn't be multiply adding to the set.
01524         #endif
01525 
01526         addMe->next = &sentinel;
01527         addMe->prev = sentinel.prev;
01528 
01529         sentinel.prev->next = addMe;
01530         sentinel.prev      = addMe;
01531 }

void OBT::TiXmlAttributeSet::Remove ( TiXmlAttribute attribute  ) 

Definition at line 1533 of file OBTtinyxml.cpp.

References OBT::TiXmlAttribute::next, OBT::TiXmlAttribute::prev, and sentinel.

Referenced by OBT::TiXmlElement::ClearThis(), and OBT::TiXmlElement::RemoveAttribute().

01534 {
01535         TiXmlAttribute* node;
01536 
01537         for( node = sentinel.next; node != &sentinel; node = node->next )
01538         {
01539                 if ( node == removeMe )
01540                 {
01541                         node->prev->next = node->next;
01542                         node->next->prev = node->prev;
01543                         node->next = 0;
01544                         node->prev = 0;
01545                         return;
01546                 }
01547         }
01548         assert( 0 );            // we tried to remove a non-linked attribute.
01549 }

const TiXmlAttribute* OBT::TiXmlAttributeSet::First (  )  const [inline]

Definition at line 920 of file OBTtinyxml.h.

Referenced by OBT::TiXmlElement::Accept(), OBT::TiXmlElement::ClearThis(), OBT::TiXmlElement::CopyTo(), OBT::TiXmlElement::FirstAttribute(), and OBT::TiXmlElement::Print().

00920 { return ( sentinel.next == &sentinel ) ? 0 : sentinel.next; }

TiXmlAttribute* OBT::TiXmlAttributeSet::First (  )  [inline]

Definition at line 921 of file OBTtinyxml.h.

00921 { return ( sentinel.next == &sentinel ) ? 0 : sentinel.next; }

const TiXmlAttribute* OBT::TiXmlAttributeSet::Last (  )  const [inline]

Definition at line 922 of file OBTtinyxml.h.

Referenced by OBT::TiXmlElement::LastAttribute().

00922 { return ( sentinel.prev == &sentinel ) ? 0 : sentinel.prev; }

TiXmlAttribute* OBT::TiXmlAttributeSet::Last (  )  [inline]

Definition at line 923 of file OBTtinyxml.h.

00923 { return ( sentinel.prev == &sentinel ) ? 0 : sentinel.prev; }

const TiXmlAttribute * OBT::TiXmlAttributeSet::Find ( const char *  _name  )  const

Definition at line 1577 of file OBTtinyxml.cpp.

References OBT::TiXmlAttribute::next, and sentinel.

Referenced by Add(), OBT::TiXmlElement::Attribute(), OBT::TiXmlElement::Parse(), OBT::TiXmlElement::QueryDoubleAttribute(), OBT::TiXmlElement::QueryIntAttribute(), OBT::TiXmlElement::QueryValueAttribute(), OBT::TiXmlElement::RemoveAttribute(), and OBT::TiXmlElement::SetAttribute().

01578 {
01579         for( const TiXmlAttribute* node = sentinel.next; node != &sentinel; node = node->next )
01580         {
01581                 if ( strcmp( node->name.c_str(), name ) == 0 )
01582                         return node;
01583         }
01584         return 0;
01585 }

TiXmlAttribute* OBT::TiXmlAttributeSet::Find ( const char *  _name  )  [inline]

Definition at line 926 of file OBTtinyxml.h.

00926                                                   {
00927                 return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttributeSet* >(this))->Find( _name ) );
00928         }

const TiXmlAttribute * OBT::TiXmlAttributeSet::Find ( const std::string &  _name  )  const

Definition at line 1553 of file OBTtinyxml.cpp.

References OBT::TiXmlAttribute::next, and sentinel.

01554 {
01555         for( const TiXmlAttribute* node = sentinel.next; node != &sentinel; node = node->next )
01556         {
01557                 if ( node->name == name )
01558                         return node;
01559         }
01560         return 0;
01561 }

TiXmlAttribute* OBT::TiXmlAttributeSet::Find ( const std::string &  _name  )  [inline]

Definition at line 931 of file OBTtinyxml.h.

00931                                                        {
00932                 return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttributeSet* >(this))->Find( _name ) );
00933         }

void OBT::TiXmlAttributeSet::operator= ( const TiXmlAttributeSet  )  [private]

void OBT::TiXmlAttributeSet::Add ( TiXmlAttribute attribute  ) 

void OBT::TiXmlAttributeSet::Remove ( TiXmlAttribute attribute  ) 

const TiXmlAttribute* OBT::TiXmlAttributeSet::First (  )  const [inline]

Definition at line 919 of file tiny/OBTtinyxml.h.

References OBT::TiXmlAttribute::next, and sentinel.

00919 { return ( sentinel.next == &sentinel ) ? 0 : sentinel.next; }

TiXmlAttribute* OBT::TiXmlAttributeSet::First (  )  [inline]

Definition at line 920 of file tiny/OBTtinyxml.h.

References OBT::TiXmlAttribute::next, and sentinel.

00920 { return ( sentinel.next == &sentinel ) ? 0 : sentinel.next; }

const TiXmlAttribute* OBT::TiXmlAttributeSet::Last (  )  const [inline]

Definition at line 921 of file tiny/OBTtinyxml.h.

References OBT::TiXmlAttribute::prev, and sentinel.

00921 { return ( sentinel.prev == &sentinel ) ? 0 : sentinel.prev; }

TiXmlAttribute* OBT::TiXmlAttributeSet::Last (  )  [inline]

Definition at line 922 of file tiny/OBTtinyxml.h.

References OBT::TiXmlAttribute::prev, and sentinel.

00922 { return ( sentinel.prev == &sentinel ) ? 0 : sentinel.prev; }

const TiXmlAttribute* OBT::TiXmlAttributeSet::Find ( const char *  _name  )  const

TiXmlAttribute* OBT::TiXmlAttributeSet::Find ( const char *  _name  )  [inline]

Definition at line 925 of file tiny/OBTtinyxml.h.

00925                                                   {
00926                 return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttributeSet* >(this))->Find( _name ) );
00927         }

const TiXmlAttribute* OBT::TiXmlAttributeSet::Find ( const std::string &  _name  )  const

TiXmlAttribute* OBT::TiXmlAttributeSet::Find ( const std::string &  _name  )  [inline]

Definition at line 930 of file tiny/OBTtinyxml.h.

00930                                                        {
00931                 return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttributeSet* >(this))->Find( _name ) );
00932         }

void OBT::TiXmlAttributeSet::operator= ( const TiXmlAttributeSet  )  [private]


Member Data Documentation

TiXmlAttribute OBT::TiXmlAttributeSet::sentinel [private]

Definition at line 943 of file OBTtinyxml.h.

Referenced by Add(), Find(), First(), Last(), Remove(), TiXmlAttributeSet(), and ~TiXmlAttributeSet().


Generated on Wed Oct 1 11:34:20 2008 for OBT by  doxygen 1.5.3