TiXmlAttribute Class Reference

#include <tinyxml.h>

Inheritance diagram for TiXmlAttribute:

Inheritance graph
[legend]
Collaboration diagram for TiXmlAttribute:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 TiXmlAttribute ()
 Construct an empty attribute.
 TiXmlAttribute (const char *_name, const char *_value)
 Construct an attribute with a name and value.
const char * Name () const
 Return the name of this attribute.
const char * Value () const
 Return the value of this attribute.
int IntValue () const
 Return the value of this attribute, converted to an integer.
double DoubleValue () const
 Return the value of this attribute, converted to a double.
const TIXML_STRING & NameTStr () const
int QueryIntValue (int *_value) const
int QueryDoubleValue (double *_value) const
 QueryDoubleValue examines the value string. See QueryIntValue().
void SetName (const char *_name)
 Set the name of this attribute.
void SetValue (const char *_value)
 Set the value.
void SetIntValue (int _value)
 Set the value from an integer.
void SetDoubleValue (double _value)
 Set the value from a double.
const TiXmlAttributeNext () const
 Get the next sibling attribute in the DOM. Returns null at end.
TiXmlAttributeNext ()
const TiXmlAttributePrevious () const
 Get the previous sibling attribute in the DOM. Returns null at beginning.
TiXmlAttributePrevious ()
bool operator== (const TiXmlAttribute &rhs) const
bool operator< (const TiXmlAttribute &rhs) const
bool operator> (const TiXmlAttribute &rhs) const
virtual const char * Parse (const char *p, TiXmlParsingData *data, TiXmlEncoding encoding)
virtual void Print (FILE *cfile, int depth) const
virtual void StreamOut (TIXML_OSTREAM *out) const
void SetDocument (TiXmlDocument *doc)

Private Member Functions

 TiXmlAttribute (const TiXmlAttribute &)
void operator= (const TiXmlAttribute &base)

Private Attributes

TiXmlDocumentdocument
TIXML_STRING name
TIXML_STRING value
TiXmlAttributeprev
TiXmlAttributenext

Friends

class TiXmlAttributeSet


Detailed Description

An attribute is a name-value pair. Elements have an arbitrary number of attributes, each with a unique name.

Note:
The attributes are not TiXmlNodes, since they are not part of the tinyXML document object model. There are other suggested ways to look at this problem.

Definition at line 693 of file tinyxml.h.


Constructor & Destructor Documentation

TiXmlAttribute::TiXmlAttribute (  )  [inline]

Construct an empty attribute.

Definition at line 699 of file tinyxml.h.

References document, next, and prev.

TiXmlAttribute::TiXmlAttribute ( const char *  _name,
const char *  _value 
) [inline]

Construct an attribute with a name and value.

Definition at line 717 of file tinyxml.h.

References document, name, next, prev, and value.

TiXmlAttribute::TiXmlAttribute ( const TiXmlAttribute  )  [private]


Member Function Documentation

const char* TiXmlAttribute::Name (  )  const [inline]

Return the name of this attribute.

Definition at line 725 of file tinyxml.h.

References name.

Referenced by TiXmlAttributeSet::Add(), TiXmlElement::CopyTo(), and Lugre::LuaXML_ParseNode().

const char* TiXmlAttribute::Value (  )  const [inline]

Return the value of this attribute.

Definition at line 726 of file tinyxml.h.

References value.

Referenced by TiXmlElement::Attribute(), TiXmlElement::CopyTo(), Lugre::LuaXML_ParseNode(), TiXmlDeclaration::Parse(), and TiXmlElement::Parse().

int TiXmlAttribute::IntValue (  )  const

Return the value of this attribute, converted to an integer.

Definition at line 1333 of file tinyxml.cpp.

References value.

double TiXmlAttribute::DoubleValue (  )  const

Return the value of this attribute, converted to a double.

Definition at line 1338 of file tinyxml.cpp.

References value.

const TIXML_STRING& TiXmlAttribute::NameTStr (  )  const [inline]

Definition at line 731 of file tinyxml.h.

References name.

Referenced by TiXmlElement::Parse().

int TiXmlAttribute::QueryIntValue ( int *  _value  )  const

QueryIntValue examines the value string. It is an alternative to the IntValue() method with richer error checking. If the value is an integer, it is stored in 'value' and the call returns TIXML_SUCCESS. If it is not an integer, it returns TIXML_WRONG_TYPE.

A specialized but useful call. Note that for success it returns 0, which is the opposite of almost all other TinyXml calls.

Definition at line 1297 of file tinyxml.cpp.

References TIXML_SUCCESS, TIXML_WRONG_TYPE, and value.

Referenced by TiXmlElement::QueryIntAttribute().

int TiXmlAttribute::QueryDoubleValue ( double *  _value  )  const

QueryDoubleValue examines the value string. See QueryIntValue().

Definition at line 1304 of file tinyxml.cpp.

References TIXML_SUCCESS, TIXML_WRONG_TYPE, and value.

Referenced by TiXmlElement::QueryDoubleAttribute().

void TiXmlAttribute::SetName ( const char *  _name  )  [inline]

Set the name of this attribute.

Definition at line 746 of file tinyxml.h.

References name.

void TiXmlAttribute::SetValue ( const char *  _value  )  [inline]

Set the value.

Definition at line 747 of file tinyxml.h.

References value.

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

void TiXmlAttribute::SetIntValue ( int  _value  ) 

Set the value from an integer.

Definition at line 1311 of file tinyxml.cpp.

References SetValue().

void TiXmlAttribute::SetDoubleValue ( double  _value  ) 

Set the value from a double.

Definition at line 1322 of file tinyxml.cpp.

References SetValue().

const TiXmlAttribute * TiXmlAttribute::Next (  )  const

Get the next sibling attribute in the DOM. Returns null at end.

Definition at line 1229 of file tinyxml.cpp.

References name, next, and value.

Referenced by TiXmlElement::CopyTo(), Lugre::LuaXML_ParseNode(), TiXmlElement::Print(), and TiXmlElement::StreamOut().

TiXmlAttribute * TiXmlAttribute::Next (  ) 

Definition at line 1238 of file tinyxml.cpp.

References name, next, and value.

const TiXmlAttribute * TiXmlAttribute::Previous (  )  const

Get the previous sibling attribute in the DOM. Returns null at beginning.

Definition at line 1247 of file tinyxml.cpp.

References name, prev, and value.

TiXmlAttribute * TiXmlAttribute::Previous (  ) 

Definition at line 1256 of file tinyxml.cpp.

References name, prev, and value.

bool TiXmlAttribute::operator== ( const TiXmlAttribute rhs  )  const [inline]

Definition at line 766 of file tinyxml.h.

References name.

bool TiXmlAttribute::operator< ( const TiXmlAttribute rhs  )  const [inline]

Definition at line 767 of file tinyxml.h.

References name.

bool TiXmlAttribute::operator> ( const TiXmlAttribute rhs  )  const [inline]

Definition at line 768 of file tinyxml.h.

References name.

const char * TiXmlAttribute::Parse ( const char *  p,
TiXmlParsingData data,
TiXmlEncoding  encoding 
) [virtual]

void TiXmlAttribute::Print ( FILE *  cfile,
int  depth 
) const [virtual]

All TinyXml classes can print themselves to a filestream. This is a formatted print, and will insert tabs and newlines.

(For an unformatted stream, use the << operator.)

Implements TiXmlBase.

Definition at line 1265 of file tinyxml.cpp.

References TiXmlBase::PutString(), TIXML_STRING, and value.

void TiXmlAttribute::StreamOut ( TIXML_OSTREAM *  out  )  const [virtual]

Implements TiXmlBase.

Definition at line 1279 of file tinyxml.cpp.

References TiXmlBase::PutString(), and value.

Referenced by TiXmlElement::StreamOut().

void TiXmlAttribute::SetDocument ( TiXmlDocument doc  )  [inline]

Definition at line 781 of file tinyxml.h.

References document.

Referenced by TiXmlElement::Parse().

void TiXmlAttribute::operator= ( const TiXmlAttribute base  )  [private]


Friends And Related Function Documentation

friend class TiXmlAttributeSet [friend]

Definition at line 695 of file tinyxml.h.


Member Data Documentation

Definition at line 787 of file tinyxml.h.

Referenced by SetDocument(), and TiXmlAttribute().

TIXML_STRING TiXmlAttribute::name [private]

TIXML_STRING TiXmlAttribute::value [private]


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

Generated on Tue May 22 06:00:31 2012 for cpp by  doxygen 1.5.6