TiXmlAttribute

class TiXmlAttribute

Bases: TiXmlBase

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.

Inheritance diagram

Inheritance diagram of TiXmlAttribute

double DoubleValue(void) const

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

int IntValue(void) const

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

char const *Name(void) const

///< Return the name of this attribute.

std::string const &NameTStr(void) const

Get the tinyxml string representation

TiXmlAttribute const *Next(void) const
TiXmlAttribute *Next(void)

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

TiXmlAttribute const *Previous(void) const
TiXmlAttribute *Previous(void)

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

void Print(FILE *cfile, int depth, std::string *str) const

/depth/

int QueryDoubleValue(double *_value) const

/// QueryDoubleValue examines the value string. See QueryIntValue().

int 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 SetDocument(TiXmlDocument *doc)

[internal use] Set the document pointer so the attribute can report errors.

void SetDoubleValue(double _value)

///< Set the value from a double.

void SetIntValue(int _value)

///< Set the value from an integer.

void SetName(char const *_name)
void SetName(std::string const &_name)

///< Set the name of this attribute.

/// STL std::string form.

void SetValue(char const *_value)
void SetValue(std::string const &_value)

///< Set the value.

/// STL std::string form.

char const *Value(void) const

///< Return the value of this attribute.

std::string const &ValueStr(void) const

///< Return the value of this attribute.

TiXmlAttribute(void)
TiXmlAttribute(std::string const &_name, std::string const &_value)
TiXmlAttribute(char const *_name, char const *_value)

/// Construct an empty attribute.

/// std::string constructor.

/// Construct an attribute with a name and value.