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

TiXmlAttribute Class Reference
[Basic XML support]

#include <tinyxml.h>

Inheritance diagram for TiXmlAttribute:

Inheritance graph
[legend]
Collaboration diagram for TiXmlAttribute:

Collaboration graph
[legend]
List of all members.

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.


Public Member Functions

 TiXmlAttribute ()
 TiXmlAttribute (const char *_name, const char *_value)
const char * Name () const
const char * Value () const
const int IntValue () const
const double DoubleValue () const
int QueryIntValue (int *value) const
int QueryDoubleValue (double *value) const
void SetName (const char *_name)
void SetValue (const char *_value)
void SetIntValue (int value)
void SetDoubleValue (double value)
TiXmlAttributeNext () const
TiXmlAttributePrevious () const
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)


Constructor & Destructor Documentation

TiXmlAttribute::TiXmlAttribute  )  [inline]
 

Construct an empty attribute.

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

Construct an attribute with a name and value.


Member Function Documentation

const double TiXmlAttribute::DoubleValue  )  const
 

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

const int TiXmlAttribute::IntValue  )  const
 

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

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

Return the name of this attribute.

TiXmlAttribute * TiXmlAttribute::Next  )  const
 

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

TiXmlAttribute * TiXmlAttribute::Previous  )  const
 

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

int TiXmlAttribute::QueryDoubleValue double *  value  )  const
 

QueryDoubleValue examines the value string. See QueryIntValue().

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.

void TiXmlAttribute::SetDoubleValue double  value  ) 
 

Set the value from a double.

void TiXmlAttribute::SetIntValue int  value  ) 
 

Set the value from an integer.

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

Set the name of this attribute.

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

Set the value.

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

Return the value of this attribute.


Generated on Wed Feb 9 11:31:36 2005 for OpenGUI by  doxygen 1.4.0