cocos2d-x  2.2.3-gd2.113-rev1ec524e
Loading...
Searching...
No Matches
XMLAttribute Class Reference

An attribute is a name-value pair. More...

#include <tinyxml2.h>

Public Member Functions

const char * Name () const
 The name of the attribute. More...
 
const char * Value () const
 The value of the attribute. More...
 
const XMLAttributeNext () const
 The next attribute in the list. More...
 
int IntValue () const
 IntAttribute interprets the attribute as an integer, and returns the value. More...
 
unsigned UnsignedValue () const
 Query as an unsigned integer. See IntAttribute() More...
 
bool BoolValue () const
 Query as a boolean. See IntAttribute() More...
 
double DoubleValue () const
 Query as a double. See IntAttribute() More...
 
float FloatValue () const
 Query as a float. See IntAttribute() More...
 
XMLError QueryIntValue (int *value) const
 QueryIntAttribute interprets the attribute as an integer, and returns the value in the provided paremeter. More...
 
XMLError QueryUnsignedValue (unsigned int *value) const
 See QueryIntAttribute. More...
 
XMLError QueryBoolValue (bool *value) const
 See QueryIntAttribute. More...
 
XMLError QueryDoubleValue (double *value) const
 See QueryIntAttribute. More...
 
XMLError QueryFloatValue (float *value) const
 See QueryIntAttribute. More...
 
void SetAttribute (const char *value)
 Set the attribute to a string value. More...
 
void SetAttribute (int value)
 Set the attribute to value. More...
 
void SetAttribute (unsigned value)
 Set the attribute to value. More...
 
void SetAttribute (bool value)
 Set the attribute to value. More...
 
void SetAttribute (double value)
 Set the attribute to value. More...
 
void SetAttribute (float value)
 Set the attribute to value. More...
 

Friends

class XMLElement
 

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 XMLNodes. You may only query the Next() attribute in a list.

Member Function Documentation

◆ BoolValue()

bool BoolValue ( ) const
inline

Query as a boolean. See IntAttribute()

◆ DoubleValue()

double DoubleValue ( ) const
inline

Query as a double. See IntAttribute()

◆ FloatValue()

float FloatValue ( ) const
inline

Query as a float. See IntAttribute()

◆ IntValue()

int IntValue ( ) const
inline

IntAttribute interprets the attribute as an integer, and returns the value.

If the value isn't an integer, 0 will be returned. There is no error checking; use QueryIntAttribute() if you need error checking.

◆ Name()

const char * Name ( ) const
inline

The name of the attribute.

◆ Next()

const XMLAttribute * Next ( ) const
inline

The next attribute in the list.

◆ QueryBoolValue()

XMLError QueryBoolValue ( bool *  value) const

See QueryIntAttribute.

◆ QueryDoubleValue()

XMLError QueryDoubleValue ( double *  value) const

See QueryIntAttribute.

◆ QueryFloatValue()

XMLError QueryFloatValue ( float *  value) const

See QueryIntAttribute.

◆ QueryIntValue()

XMLError QueryIntValue ( int *  value) const

QueryIntAttribute interprets the attribute as an integer, and returns the value in the provided paremeter.

The function will return XML_NO_ERROR on success, and XML_WRONG_ATTRIBUTE_TYPE if the conversion is not successful.

◆ QueryUnsignedValue()

XMLError QueryUnsignedValue ( unsigned int *  value) const

See QueryIntAttribute.

◆ SetAttribute() [1/6]

void SetAttribute ( bool  value)

Set the attribute to value.

◆ SetAttribute() [2/6]

void SetAttribute ( const char *  value)

Set the attribute to a string value.

◆ SetAttribute() [3/6]

void SetAttribute ( double  value)

Set the attribute to value.

◆ SetAttribute() [4/6]

void SetAttribute ( float  value)

Set the attribute to value.

◆ SetAttribute() [5/6]

void SetAttribute ( int  value)

Set the attribute to value.

◆ SetAttribute() [6/6]

void SetAttribute ( unsigned  value)

Set the attribute to value.

◆ UnsignedValue()

unsigned UnsignedValue ( ) const
inline

Query as an unsigned integer. See IntAttribute()

◆ Value()

const char * Value ( ) const
inline

The value of the attribute.

Friends And Related Function Documentation

◆ XMLElement

friend class XMLElement
friend

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