ReactOS  0.4.13-dev-227-g98638cc
tinyxml2::XMLAttribute Class Reference

#include <tinyxml2.h>

Collaboration diagram for tinyxml2::XMLAttribute:

Public Member Functions

const charName () const
 The name of the attribute. More...
 
const charValue () const
 The value of the attribute. More...
 
const XMLAttributeNext () const
 The next attribute in the list. More...
 
int IntValue () const
 
unsigned UnsignedValue () const
 Query as an unsigned integer. See IntValue() More...
 
bool BoolValue () const
 Query as a boolean. See IntValue() More...
 
double DoubleValue () const
 Query as a double. See IntValue() More...
 
float FloatValue () const
 Query as a float. See IntValue() More...
 
XMLError QueryIntValue (int *value) const
 
XMLError QueryUnsignedValue (unsigned int *value) const
 See QueryIntValue. More...
 
XMLError QueryBoolValue (bool *value) const
 See QueryIntValue. More...
 
XMLError QueryDoubleValue (double *value) const
 See QueryIntValue. More...
 
XMLError QueryFloatValue (float *value) const
 See QueryIntValue. 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...
 

Private Types

enum  { BUF_SIZE = 200 }
 

Private Member Functions

 XMLAttribute ()
 
virtual ~XMLAttribute ()
 
 XMLAttribute (const XMLAttribute &)
 
void operator= (const XMLAttribute &)
 
void SetName (const char *name)
 
charParseDeep (char *p, bool processEntities)
 

Private Attributes

StrPair _name
 
StrPair _value
 
XMLAttribute_next
 
MemPool_memPool
 

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.

Definition at line 1044 of file tinyxml2.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
BUF_SIZE 

Definition at line 1121 of file tinyxml2.h.

Constructor & Destructor Documentation

◆ XMLAttribute() [1/2]

tinyxml2::XMLAttribute::XMLAttribute ( )
inlineprivate

Definition at line 1123 of file tinyxml2.h.

1123 : _next( 0 ), _memPool( 0 ) {}
XMLAttribute * _next
Definition: tinyxml2.h:1134

◆ ~XMLAttribute()

virtual tinyxml2::XMLAttribute::~XMLAttribute ( )
inlineprivatevirtual

Definition at line 1124 of file tinyxml2.h.

1124 {}

◆ XMLAttribute() [2/2]

tinyxml2::XMLAttribute::XMLAttribute ( const XMLAttribute )
private

Member Function Documentation

◆ BoolValue()

bool tinyxml2::XMLAttribute::BoolValue ( ) const
inline

Query as a boolean. See IntValue()

Definition at line 1075 of file tinyxml2.h.

1075  {
1076  bool b=false;
1077  QueryBoolValue( &b );
1078  return b;
1079  }
#define b
Definition: ke_i.h:79
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
XMLError QueryBoolValue(bool *value) const
See QueryIntValue.
Definition: tinyxml2.cpp:1304

◆ DoubleValue()

double tinyxml2::XMLAttribute::DoubleValue ( ) const
inline

Query as a double. See IntValue()

Definition at line 1081 of file tinyxml2.h.

1081  {
1082  double d=0;
1083  QueryDoubleValue( &d );
1084  return d;
1085  }
XMLError QueryDoubleValue(double *value) const
See QueryIntValue.
Definition: tinyxml2.cpp:1322
#define d
Definition: ke_i.h:81

◆ FloatValue()

float tinyxml2::XMLAttribute::FloatValue ( ) const
inline

Query as a float. See IntValue()

Definition at line 1087 of file tinyxml2.h.

1087  {
1088  float f=0;
1089  QueryFloatValue( &f );
1090  return f;
1091  }
XMLError QueryFloatValue(float *value) const
See QueryIntValue.
Definition: tinyxml2.cpp:1313
GLfloat f
Definition: glext.h:7540
#define f
Definition: ke_i.h:83

◆ IntValue()

int tinyxml2::XMLAttribute::IntValue ( ) const
inline

IntValue 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 QueryIntValue() if you need error checking.

Definition at line 1063 of file tinyxml2.h.

1063  {
1064  int i=0;
1065  QueryIntValue( &i );
1066  return i;
1067  }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
XMLError QueryIntValue(int *value) const
Definition: tinyxml2.cpp:1286

◆ Name()

const char * tinyxml2::XMLAttribute::Name ( ) const

The name of the attribute.

Definition at line 1242 of file tinyxml2.cpp.

1243 {
1244  return _name.GetStr();
1245 }
const char * GetStr()
Definition: tinyxml2.cpp:260

◆ Next()

const XMLAttribute* tinyxml2::XMLAttribute::Next ( ) const
inline

The next attribute in the list.

Definition at line 1055 of file tinyxml2.h.

1055  {
1056  return _next;
1057  }
XMLAttribute * _next
Definition: tinyxml2.h:1134

◆ operator=()

◆ ParseDeep()

char * tinyxml2::XMLAttribute::ParseDeep ( char p,
bool  processEntities 
)
private

Definition at line 1252 of file tinyxml2.cpp.

1253 {
1254  // Parse using the name rules: bug fix, was using ParseText before
1255  p = _name.ParseName( p );
1256  if ( !p || !*p ) {
1257  return 0;
1258  }
1259 
1260  // Skip white space before =
1262  if ( *p != '=' ) {
1263  return 0;
1264  }
1265 
1266  ++p; // move up to opening quote
1268  if ( *p != '\"' && *p != '\'' ) {
1269  return 0;
1270  }
1271 
1272  char endTag[2] = { *p, 0 };
1273  ++p; // move past opening quote
1274 
1276  return p;
1277 }
static const char * SkipWhiteSpace(const char *p)
Definition: tinyxml2.h:519
char * ParseName(char *in)
Definition: tinyxml2.cpp:211
char * ParseText(char *in, const char *endTag, int strFlags)
Definition: tinyxml2.cpp:191
GLfloat GLfloat p
Definition: glext.h:8902

◆ QueryBoolValue()

XMLError tinyxml2::XMLAttribute::QueryBoolValue ( bool value) const

See QueryIntValue.

Definition at line 1304 of file tinyxml2.cpp.

1305 {
1306  if ( XMLUtil::ToBool( Value(), value )) {
1307  return XML_NO_ERROR;
1308  }
1309  return XML_WRONG_ATTRIBUTE_TYPE;
1310 }
static bool ToBool(const char *str, bool *value)
Definition: tinyxml2.cpp:575
const char * Value() const
The value of the attribute.
Definition: tinyxml2.cpp:1247

◆ QueryDoubleValue()

XMLError tinyxml2::XMLAttribute::QueryDoubleValue ( double value) const

See QueryIntValue.

Definition at line 1322 of file tinyxml2.cpp.

1323 {
1324  if ( XMLUtil::ToDouble( Value(), value )) {
1325  return XML_NO_ERROR;
1326  }
1327  return XML_WRONG_ATTRIBUTE_TYPE;
1328 }
static bool ToDouble(const char *str, double *value)
Definition: tinyxml2.cpp:602
const char * Value() const
The value of the attribute.
Definition: tinyxml2.cpp:1247

◆ QueryFloatValue()

XMLError tinyxml2::XMLAttribute::QueryFloatValue ( float *  value) const

See QueryIntValue.

Definition at line 1313 of file tinyxml2.cpp.

1314 {
1315  if ( XMLUtil::ToFloat( Value(), value )) {
1316  return XML_NO_ERROR;
1317  }
1318  return XML_WRONG_ATTRIBUTE_TYPE;
1319 }
static bool ToFloat(const char *str, float *value)
Definition: tinyxml2.cpp:594
const char * Value() const
The value of the attribute.
Definition: tinyxml2.cpp:1247

◆ QueryIntValue()

XMLError tinyxml2::XMLAttribute::QueryIntValue ( int value) const

QueryIntValue interprets the attribute as an integer, and returns the value in the provided parameter. The function will return XML_NO_ERROR on success, and XML_WRONG_ATTRIBUTE_TYPE if the conversion is not successful.

Definition at line 1286 of file tinyxml2.cpp.

1287 {
1288  if ( XMLUtil::ToInt( Value(), value )) {
1289  return XML_NO_ERROR;
1290  }
1291  return XML_WRONG_ATTRIBUTE_TYPE;
1292 }
static bool ToInt(const char *str, int *value)
Definition: tinyxml2.cpp:559
const char * Value() const
The value of the attribute.
Definition: tinyxml2.cpp:1247

◆ QueryUnsignedValue()

XMLError tinyxml2::XMLAttribute::QueryUnsignedValue ( unsigned int value) const

See QueryIntValue.

Definition at line 1295 of file tinyxml2.cpp.

1296 {
1297  if ( XMLUtil::ToUnsigned( Value(), value )) {
1298  return XML_NO_ERROR;
1299  }
1300  return XML_WRONG_ATTRIBUTE_TYPE;
1301 }
static bool ToUnsigned(const char *str, unsigned *value)
Definition: tinyxml2.cpp:567
const char * Value() const
The value of the attribute.
Definition: tinyxml2.cpp:1247

◆ SetAttribute() [1/6]

void tinyxml2::XMLAttribute::SetAttribute ( const char value)

Set the attribute to a string value.

Definition at line 1331 of file tinyxml2.cpp.

1332 {
1333  _value.SetStr( v );
1334 }
void SetStr(const char *str, int flags=0)
Definition: tinyxml2.cpp:178
const GLdouble * v
Definition: gl.h:2040

◆ SetAttribute() [2/6]

void tinyxml2::XMLAttribute::SetAttribute ( int  value)

Set the attribute to value.

Definition at line 1337 of file tinyxml2.cpp.

1338 {
1339  char buf[BUF_SIZE];
1341  _value.SetStr( buf );
1342 }
static void ToStr(int v, char *buffer, int bufferSize)
Definition: tinyxml2.cpp:526
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
void SetStr(const char *str, int flags=0)
Definition: tinyxml2.cpp:178
const GLdouble * v
Definition: gl.h:2040

◆ SetAttribute() [3/6]

void tinyxml2::XMLAttribute::SetAttribute ( unsigned  value)

Set the attribute to value.

Definition at line 1345 of file tinyxml2.cpp.

1346 {
1347  char buf[BUF_SIZE];
1349  _value.SetStr( buf );
1350 }
static void ToStr(int v, char *buffer, int bufferSize)
Definition: tinyxml2.cpp:526
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
void SetStr(const char *str, int flags=0)
Definition: tinyxml2.cpp:178
const GLdouble * v
Definition: gl.h:2040

◆ SetAttribute() [4/6]

void tinyxml2::XMLAttribute::SetAttribute ( bool  value)

Set the attribute to value.

Definition at line 1353 of file tinyxml2.cpp.

1354 {
1355  char buf[BUF_SIZE];
1357  _value.SetStr( buf );
1358 }
static void ToStr(int v, char *buffer, int bufferSize)
Definition: tinyxml2.cpp:526
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
void SetStr(const char *str, int flags=0)
Definition: tinyxml2.cpp:178
const GLdouble * v
Definition: gl.h:2040

◆ SetAttribute() [5/6]

void tinyxml2::XMLAttribute::SetAttribute ( double  value)

Set the attribute to value.

Definition at line 1360 of file tinyxml2.cpp.

1361 {
1362  char buf[BUF_SIZE];
1364  _value.SetStr( buf );
1365 }
static void ToStr(int v, char *buffer, int bufferSize)
Definition: tinyxml2.cpp:526
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
void SetStr(const char *str, int flags=0)
Definition: tinyxml2.cpp:178
const GLdouble * v
Definition: gl.h:2040

◆ SetAttribute() [6/6]

void tinyxml2::XMLAttribute::SetAttribute ( float  value)

Set the attribute to value.

Definition at line 1367 of file tinyxml2.cpp.

1368 {
1369  char buf[BUF_SIZE];
1371  _value.SetStr( buf );
1372 }
static void ToStr(int v, char *buffer, int bufferSize)
Definition: tinyxml2.cpp:526
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
void SetStr(const char *str, int flags=0)
Definition: tinyxml2.cpp:178
const GLdouble * v
Definition: gl.h:2040

◆ SetName()

void tinyxml2::XMLAttribute::SetName ( const char name)
private

Definition at line 1280 of file tinyxml2.cpp.

1281 {
1282  _name.SetStr( n );
1283 }
GLdouble n
Definition: glext.h:7729
void SetStr(const char *str, int flags=0)
Definition: tinyxml2.cpp:178

Referenced by tinyxml2::XMLElement::FindOrCreateAttribute().

◆ UnsignedValue()

unsigned tinyxml2::XMLAttribute::UnsignedValue ( ) const
inline

Query as an unsigned integer. See IntValue()

Definition at line 1069 of file tinyxml2.h.

1069  {
1070  unsigned i=0;
1071  QueryUnsignedValue( &i );
1072  return i;
1073  }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
XMLError QueryUnsignedValue(unsigned int *value) const
See QueryIntValue.
Definition: tinyxml2.cpp:1295

◆ Value()

const char * tinyxml2::XMLAttribute::Value ( ) const

The value of the attribute.

Definition at line 1247 of file tinyxml2.cpp.

1248 {
1249  return _value.GetStr();
1250 }
const char * GetStr()
Definition: tinyxml2.cpp:260

Referenced by QueryBoolValue(), QueryDoubleValue(), QueryFloatValue(), QueryIntValue(), and QueryUnsignedValue().

Friends And Related Function Documentation

◆ XMLElement

friend class XMLElement
friend

Definition at line 1046 of file tinyxml2.h.

Member Data Documentation

◆ _memPool

MemPool* tinyxml2::XMLAttribute::_memPool
private

◆ _name

StrPair tinyxml2::XMLAttribute::_name
mutableprivate

Definition at line 1132 of file tinyxml2.h.

Referenced by Name(), ParseDeep(), and SetName().

◆ _next

◆ _value

StrPair tinyxml2::XMLAttribute::_value
mutableprivate

Definition at line 1133 of file tinyxml2.h.

Referenced by ParseDeep(), SetAttribute(), and Value().


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