xmlTiny::TiXmlAttributeSet Class Reference

#include <OBTtinyxml.h>

Collaboration diagram for xmlTiny::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)

Private Member Functions

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

Private Attributes

TiXmlAttribute sentinel


Detailed Description

Definition at line 909 of file tiny/tmp/OBTtinyxml.h.


Constructor & Destructor Documentation

xmlTiny::TiXmlAttributeSet::TiXmlAttributeSet (  ) 

Definition at line 1505 of file tiny/tmp/OBTtinyxml.cpp.

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

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

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]


Member Function Documentation

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().

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

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

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

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

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

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().

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

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

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

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

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

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]


Member Data Documentation

TiXmlAttribute xmlTiny::TiXmlAttributeSet::sentinel [private]

Definition at line 941 of file tiny/tmp/OBTtinyxml.h.

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


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