OBT::TiXmlAttributeSet Class Reference

#include <OBTtinyxml.h>

Collaboration diagram for OBT::TiXmlAttributeSet:
[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)
 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)

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  ) 
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 }

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 char *  _name  )  const
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 char *  _name  )  const

Definition at line 1577 of file OBTtinyxml.cpp.

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

Referenced by Add(), OBT::TiXmlElement::Attribute(), OBT::TiXmlElement::Parse(), OBT::TiXmlElement::QueryDoubleAttribute(), OBT::TiXmlElement::QueryIntAttribute(), 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::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::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 921 of file OBTtinyxml.h.

References OBT::TiXmlAttribute::next.

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

const TiXmlAttribute* OBT::TiXmlAttributeSet::First (  )  const [inline]
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::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 923 of file OBTtinyxml.h.

References OBT::TiXmlAttribute::prev.

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

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

Definition at line 922 of file OBTtinyxml.h.

References OBT::TiXmlAttribute::prev.

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

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

void OBT::TiXmlAttributeSet::operator= ( const TiXmlAttributeSet  )  [private]
void OBT::TiXmlAttributeSet::operator= ( const TiXmlAttributeSet  )  [private]
void OBT::TiXmlAttributeSet::Remove ( TiXmlAttribute attribute  ) 
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 }


Member Data Documentation

Definition at line 943 of file OBTtinyxml.h.

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


Generated on 1 Jan 2010 for OBT by  doxygen 1.6.1