Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

TiXmlAttributeSet Class Reference

#include <tinyxml.h>

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


Constructor & Destructor Documentation

TiXmlAttributeSet::TiXmlAttributeSet  ) 
 

Definition at line 1484 of file tinyxml.cpp.

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

01485 {
01486         sentinel.next = &sentinel;
01487         sentinel.prev = &sentinel;
01488 }

TiXmlAttributeSet::~TiXmlAttributeSet  ) 
 

Definition at line 1491 of file tinyxml.cpp.

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

01492 {
01493         assert( sentinel.next == &sentinel );
01494         assert( sentinel.prev == &sentinel );
01495 }

TiXmlAttributeSet::TiXmlAttributeSet const TiXmlAttributeSet  )  [private]
 


Member Function Documentation

void TiXmlAttributeSet::Add TiXmlAttribute attribute  ) 
 

Definition at line 1498 of file tinyxml.cpp.

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

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

01499 {
01500     #ifdef TIXML_USE_STL
01501         assert( !Find( TIXML_STRING( addMe->Name() ) ) );       // Shouldn't be multiply adding to the set.
01502         #else
01503         assert( !Find( addMe->Name() ) );       // Shouldn't be multiply adding to the set.
01504         #endif
01505 
01506         addMe->next = &sentinel;
01507         addMe->prev = sentinel.prev;
01508 
01509         sentinel.prev->next = addMe;
01510         sentinel.prev      = addMe;
01511 }

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

Definition at line 921 of file tinyxml.h.

00921                                                        {
00922                 return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttributeSet* >(this))->Find( _name ) );
00923         }

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

Definition at line 1533 of file tinyxml.cpp.

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

01534 {
01535         for( const TiXmlAttribute* node = sentinel.next; node != &sentinel; node = node->next )
01536         {
01537                 if ( node->name == name )
01538                         return node;
01539         }
01540         return 0;
01541 }

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

Definition at line 916 of file tinyxml.h.

00916                                                   {
00917                 return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttributeSet* >(this))->Find( _name ) );
00918         }

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

Definition at line 1557 of file tinyxml.cpp.

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

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

01558 {
01559         for( const TiXmlAttribute* node = sentinel.next; node != &sentinel; node = node->next )
01560         {
01561                 if ( strcmp( node->name.c_str(), name ) == 0 )
01562                         return node;
01563         }
01564         return 0;
01565 }

TiXmlAttribute* TiXmlAttributeSet::First void   )  [inline]
 

Definition at line 911 of file tinyxml.h.

References TiXmlNode::next.

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

const TiXmlAttribute* TiXmlAttributeSet::First void   )  const [inline]
 

Definition at line 910 of file tinyxml.h.

References TiXmlNode::next.

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

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

TiXmlAttribute* TiXmlAttributeSet::Last void   )  [inline]
 

Definition at line 913 of file tinyxml.h.

References TiXmlNode::prev.

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

const TiXmlAttribute* TiXmlAttributeSet::Last void   )  const [inline]
 

Definition at line 912 of file tinyxml.h.

References TiXmlNode::prev.

Referenced by TiXmlElement::LastAttribute().

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

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

void TiXmlAttributeSet::Remove TiXmlAttribute attribute  ) 
 

Definition at line 1513 of file tinyxml.cpp.

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

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

01514 {
01515         TiXmlAttribute* node;
01516 
01517         for( node = sentinel.next; node != &sentinel; node = node->next )
01518         {
01519                 if ( node == removeMe )
01520                 {
01521                         node->prev->next = node->next;
01522                         node->next->prev = node->prev;
01523                         node->next = 0;
01524                         node->prev = 0;
01525                         return;
01526                 }
01527         }
01528         assert( 0 );            // we tried to remove a non-linked attribute.
01529 }


Member Data Documentation

TiXmlAttribute TiXmlAttributeSet::sentinel [private]
 

Definition at line 933 of file tinyxml.h.

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


The documentation for this class was generated from the following files:
Generated on Mon Feb 15 11:10:23 2010 for loon by  doxygen 1.3.9.1