aGrUM  0.16.0
TiXmlAttributeSet Class Reference

#include <tinyxml.h>

+ Collaboration diagram for TiXmlAttributeSet:

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)
 

Detailed Description

Definition at line 1046 of file tinyxml.h.

Constructor & Destructor Documentation

◆ TiXmlAttributeSet() [1/2]

TiXmlAttributeSet::TiXmlAttributeSet ( )

Definition at line 1417 of file tinyxml.cpp.

1417  {
1418  sentinel.next = &sentinel;
1419  sentinel.prev = &sentinel;
1420 }
TiXmlAttribute sentinel
Definition: tinyxml.h:1088
TiXmlAttribute * prev
Definition: tinyxml.h:1030
TiXmlAttribute * next
Definition: tinyxml.h:1031

◆ ~TiXmlAttributeSet()

TiXmlAttributeSet::~TiXmlAttributeSet ( )

Definition at line 1422 of file tinyxml.cpp.

1422  {
1423  assert(sentinel.next == &sentinel);
1424  assert(sentinel.prev == &sentinel);
1425 }
TiXmlAttribute sentinel
Definition: tinyxml.h:1088
TiXmlAttribute * prev
Definition: tinyxml.h:1030
TiXmlAttribute * next
Definition: tinyxml.h:1031

◆ TiXmlAttributeSet() [2/2]

TiXmlAttributeSet::TiXmlAttributeSet ( const TiXmlAttributeSet )
private

Member Function Documentation

◆ Add()

void TiXmlAttributeSet::Add ( TiXmlAttribute attribute)

Definition at line 1427 of file tinyxml.cpp.

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

Referenced by TiXmlElement::SetAttribute().

1427  {
1428 #ifdef TIXML_USE_STL
1429  assert(!Find(
1430  TIXML_STRING(addMe->Name()))); // Shouldn't be multiply adding to the set.
1431 #else
1432  assert(!Find(addMe->Name())); // Shouldn't be multiply adding to the set.
1433 #endif
1434 
1435  addMe->next = &sentinel;
1436  addMe->prev = sentinel.prev;
1437 
1438  sentinel.prev->next = addMe;
1439  sentinel.prev = addMe;
1440 }
TiXmlAttribute sentinel
Definition: tinyxml.h:1088
TiXmlAttribute * prev
Definition: tinyxml.h:1030
TiXmlAttribute * next
Definition: tinyxml.h:1031
const TiXmlAttribute * Find(const char *_name) const
Definition: tinyxml.cpp:1482
#define TIXML_STRING
Definition: tinyxml.h:60
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Find() [1/4]

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

Definition at line 1482 of file tinyxml.cpp.

References TiXmlAttribute::next.

Referenced by TiXmlElement::Attribute(), TiXmlElement::QueryDoubleAttribute(), TiXmlElement::QueryIntAttribute(), and TiXmlElement::SetAttribute().

1482  {
1483  for (const TiXmlAttribute* node = sentinel.next; node != &sentinel;
1484  node = node->next) {
1485  if (strcmp(node->name.c_str(), name) == 0) return node;
1486  }
1487 
1488  return 0;
1489 }
TiXmlAttribute sentinel
Definition: tinyxml.h:1088
An attribute is a name-value pair.
Definition: tinyxml.h:915
TiXmlAttribute * next
Definition: tinyxml.h:1031
+ Here is the caller graph for this function:

◆ Find() [2/4]

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

Definition at line 1068 of file tinyxml.h.

1068  {
1069  return const_cast< TiXmlAttribute* >(
1070  (const_cast< const TiXmlAttributeSet* >(this))->Find(_name));
1071  }
An attribute is a name-value pair.
Definition: tinyxml.h:915

◆ Find() [3/4]

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

Definition at line 1459 of file tinyxml.cpp.

References TiXmlAttribute::next.

1459  {
1460  for (const TiXmlAttribute* node = sentinel.next; node != &sentinel;
1461  node = node->next) {
1462  if (node->name == name) return node;
1463  }
1464 
1465  return 0;
1466 }
TiXmlAttribute sentinel
Definition: tinyxml.h:1088
An attribute is a name-value pair.
Definition: tinyxml.h:915
TiXmlAttribute * next
Definition: tinyxml.h:1031

◆ Find() [4/4]

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

Definition at line 1074 of file tinyxml.h.

1074  {
1075  return const_cast< TiXmlAttribute* >(
1076  (const_cast< const TiXmlAttributeSet* >(this))->Find(_name));
1077  }
An attribute is a name-value pair.
Definition: tinyxml.h:915

◆ First() [1/2]

const TiXmlAttribute* TiXmlAttributeSet::First ( ) const
inline

Definition at line 1054 of file tinyxml.h.

References TiXmlAttribute::next.

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

1054  {
1055  return (sentinel.next == &sentinel) ? 0 : sentinel.next;
1056  }
TiXmlAttribute sentinel
Definition: tinyxml.h:1088
TiXmlAttribute * next
Definition: tinyxml.h:1031
+ Here is the caller graph for this function:

◆ First() [2/2]

TiXmlAttribute* TiXmlAttributeSet::First ( )
inline

Definition at line 1057 of file tinyxml.h.

References TiXmlAttribute::next.

1057  {
1058  return (sentinel.next == &sentinel) ? 0 : sentinel.next;
1059  }
TiXmlAttribute sentinel
Definition: tinyxml.h:1088
TiXmlAttribute * next
Definition: tinyxml.h:1031

◆ Last() [1/2]

const TiXmlAttribute* TiXmlAttributeSet::Last ( ) const
inline

Definition at line 1060 of file tinyxml.h.

References TiXmlAttribute::prev.

1060  {
1061  return (sentinel.prev == &sentinel) ? 0 : sentinel.prev;
1062  }
TiXmlAttribute sentinel
Definition: tinyxml.h:1088
TiXmlAttribute * prev
Definition: tinyxml.h:1030

◆ Last() [2/2]

TiXmlAttribute* TiXmlAttributeSet::Last ( )
inline

Definition at line 1063 of file tinyxml.h.

References TiXmlAttribute::prev.

1063  {
1064  return (sentinel.prev == &sentinel) ? 0 : sentinel.prev;
1065  }
TiXmlAttribute sentinel
Definition: tinyxml.h:1088
TiXmlAttribute * prev
Definition: tinyxml.h:1030

◆ operator=()

void TiXmlAttributeSet::operator= ( const TiXmlAttributeSet )
private

Referenced by TiXmlAttribute::SetDocument().

+ Here is the caller graph for this function:

◆ Remove()

void TiXmlAttributeSet::Remove ( TiXmlAttribute attribute)

Definition at line 1442 of file tinyxml.cpp.

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

Referenced by TiXmlElement::ClearThis().

1442  {
1443  TiXmlAttribute* node;
1444 
1445  for (node = sentinel.next; node != &sentinel; node = node->next) {
1446  if (node == removeMe) {
1447  node->prev->next = node->next;
1448  node->next->prev = node->prev;
1449  node->next = 0;
1450  node->prev = 0;
1451  return;
1452  }
1453  }
1454 
1455  assert(0); // we tried to remove a non-linked attribute.
1456 }
TiXmlAttribute sentinel
Definition: tinyxml.h:1088
An attribute is a name-value pair.
Definition: tinyxml.h:915
TiXmlAttribute * prev
Definition: tinyxml.h:1030
TiXmlAttribute * next
Definition: tinyxml.h:1031
+ Here is the caller graph for this function:

Member Data Documentation

◆ sentinel

TiXmlAttribute TiXmlAttributeSet::sentinel
private

Definition at line 1088 of file tinyxml.h.


The documentation for this class was generated from the following files: