CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

TiXmlAttributeSet Class Reference

#include <tinyxml.h>

List of all members.

Public Member Functions

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

Private Member Functions

TiXmlAttributeSetoperator= (const TiXmlAttributeSet &)
 TiXmlAttributeSet (const TiXmlAttributeSet &)

Private Attributes

TiXmlAttribute sentinel

Detailed Description

Definition at line 907 of file tinyxml.h.


Constructor & Destructor Documentation

TiXmlAttributeSet::TiXmlAttributeSet ( )

Definition at line 1520 of file tinyxml.cc.

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

TiXmlAttributeSet::~TiXmlAttributeSet ( )

Definition at line 1527 of file tinyxml.cc.

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

{
        assert( sentinel.next == &sentinel );
        assert( sentinel.prev == &sentinel );
}
TiXmlAttributeSet::TiXmlAttributeSet ( const TiXmlAttributeSet ) [private]

Member Function Documentation

void TiXmlAttributeSet::Add ( TiXmlAttribute attribute)

Definition at line 1534 of file tinyxml.cc.

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

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

{
    #ifdef TIXML_USE_STL
        assert( !Find( TIXML_STRING( addMe->Name() ) ) );       // Shouldn't be multiply adding to the set.
        #else
        assert( !Find( addMe->Name() ) );       // Shouldn't be multiply adding to the set.
        #endif

        addMe->next = &sentinel;
        addMe->prev = sentinel.prev;

        sentinel.prev->next = addMe;
        sentinel.prev      = addMe;
}
TiXmlAttribute* TiXmlAttributeSet::Find ( const char *  _name) [inline]

Definition at line 922 of file tinyxml.h.

                                                  {
                return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttributeSet* >(this))->Find( _name ) );
        }
const TiXmlAttribute* TiXmlAttributeSet::Find ( const std::string &  _name) const
TiXmlAttribute* TiXmlAttributeSet::Find ( const std::string &  _name) [inline]

Definition at line 927 of file tinyxml.h.

                                                       {
                return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttributeSet* >(this))->Find( _name ) );
        }
const TiXmlAttribute * TiXmlAttributeSet::Find ( const char *  _name) const
TiXmlAttribute* TiXmlAttributeSet::First ( ) [inline]

Definition at line 917 of file tinyxml.h.

References TiXmlAttribute::next, and sentinel.

{ return ( sentinel.next == &sentinel ) ? 0 : sentinel.next; }
const TiXmlAttribute* TiXmlAttributeSet::First ( ) const [inline]
const TiXmlAttribute* TiXmlAttributeSet::Last ( ) const [inline]

Definition at line 918 of file tinyxml.h.

References TiXmlAttribute::prev, and sentinel.

Referenced by TiXmlElement::LastAttribute().

{ return ( sentinel.prev == &sentinel ) ? 0 : sentinel.prev; }
TiXmlAttribute* TiXmlAttributeSet::Last ( ) [inline]

Definition at line 919 of file tinyxml.h.

References TiXmlAttribute::prev, and sentinel.

{ return ( sentinel.prev == &sentinel ) ? 0 : sentinel.prev; }
TiXmlAttributeSet& TiXmlAttributeSet::operator= ( const TiXmlAttributeSet ) [private]
void TiXmlAttributeSet::Remove ( TiXmlAttribute attribute)

Definition at line 1549 of file tinyxml.cc.

References TiXmlAttribute::next, python::Node::node, TiXmlAttribute::prev, and sentinel.

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

{
        TiXmlAttribute* node;

        for( node = sentinel.next; node != &sentinel; node = node->next )
        {
                if ( node == removeMe )
                {
                        node->prev->next = node->next;
                        node->next->prev = node->prev;
                        node->next = 0;
                        node->prev = 0;
                        return;
                }
        }
        assert( 0 );            // we tried to remove a non-linked attribute.
}

Member Data Documentation

Definition at line 939 of file tinyxml.h.

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