NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
tinyxml2::XMLAttribute Class Reference

#include <tinyxml2.h>

Collaboration diagram for tinyxml2::XMLAttribute:

Public Member Functions

const char * Name () const
 The name of the attribute. More...
 
const char * Value () const
 The value of the attribute. More...
 
int GetLineNum () const
 Gets the line number the attribute is in, if the document was parsed from a file. More...
 
const XMLAttributeNext () const
 The next attribute in the list. More...
 
int IntValue () const
 
int64_t Int64Value () const
 
uint64_t Unsigned64Value () 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 QueryInt64Value (int64_t *value) const
 See QueryIntValue. More...
 
XMLError QueryUnsigned64Value (uint64_t *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 (int64_t value)
 Set the attribute to value. More...
 
void SetAttribute (uint64_t 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)
 
char * ParseDeep (char *p, bool processEntities, int *curLineNumPtr)
 

Private Attributes

StrPair _name
 
StrPair _value
 
int _parseLineNum
 
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 1140 of file tinyxml2.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
BUF_SIZE 

Definition at line 1241 of file tinyxml2.h.

Constructor & Destructor Documentation

◆ XMLAttribute() [1/2]

tinyxml2::XMLAttribute::XMLAttribute ( )
inlineprivate

Definition at line 1243 of file tinyxml2.h.

◆ ~XMLAttribute()

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

Definition at line 1244 of file tinyxml2.h.

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

◆ 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 1187 of file tinyxml2.h.

◆ DoubleValue()

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

Query as a double. See IntValue()

Definition at line 1193 of file tinyxml2.h.

◆ FloatValue()

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

Query as a float. See IntValue()

Definition at line 1199 of file tinyxml2.h.

◆ GetLineNum()

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

Gets the line number the attribute is in, if the document was parsed from a file.

Definition at line 1151 of file tinyxml2.h.

◆ Int64Value()

int64_t tinyxml2::XMLAttribute::Int64Value ( ) const
inline

Definition at line 1168 of file tinyxml2.h.

◆ 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 1162 of file tinyxml2.h.

◆ Name()

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

The name of the attribute.

Definition at line 1400 of file tinyxml2.cpp.

References _name, and tinyxml2::StrPair::GetStr().

Referenced by tinyxml2::XMLElement::FindOrCreateAttribute(), tinyxml2::XMLElement::ParseAttributes(), and tinyxml2::XMLPrinter::VisitEnter().

Here is the call graph for this function:

◆ Next()

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

The next attribute in the list.

Definition at line 1154 of file tinyxml2.h.

Referenced by tinyxml2::XMLElement::ShallowClone(), tinyxml2::XMLElement::ShallowEqual(), and tinyxml2::XMLPrinter::VisitEnter().

◆ operator=()

void tinyxml2::XMLAttribute::operator= ( const XMLAttribute )
private

◆ ParseDeep()

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

Definition at line 1410 of file tinyxml2.cpp.

References _name, _value, tinyxml2::StrPair::ATTRIBUTE_VALUE, tinyxml2::StrPair::ATTRIBUTE_VALUE_LEAVE_ENTITIES, tinyxml2::StrPair::ParseName(), tinyxml2::StrPair::ParseText(), and tinyxml2::XMLUtil::SkipWhiteSpace().

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

Here is the call graph for this function:

◆ QueryBoolValue()

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

See QueryIntValue.

Definition at line 1480 of file tinyxml2.cpp.

References tinyxml2::XMLUtil::ToBool(), Value(), tinyxml2::XML_SUCCESS, and tinyxml2::XML_WRONG_ATTRIBUTE_TYPE.

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

Here is the call graph for this function:

◆ QueryDoubleValue()

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

See QueryIntValue.

Definition at line 1498 of file tinyxml2.cpp.

References tinyxml2::XMLUtil::ToDouble(), Value(), tinyxml2::XML_SUCCESS, and tinyxml2::XML_WRONG_ATTRIBUTE_TYPE.

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

Here is the call graph for this function:

◆ QueryFloatValue()

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

See QueryIntValue.

Definition at line 1489 of file tinyxml2.cpp.

References tinyxml2::XMLUtil::ToFloat(), Value(), tinyxml2::XML_SUCCESS, and tinyxml2::XML_WRONG_ATTRIBUTE_TYPE.

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

Here is the call graph for this function:

◆ QueryInt64Value()

XMLError tinyxml2::XMLAttribute::QueryInt64Value ( int64_t *  value) const

See QueryIntValue.

Definition at line 1462 of file tinyxml2.cpp.

References tinyxml2::XMLUtil::ToInt64(), Value(), tinyxml2::XML_SUCCESS, and tinyxml2::XML_WRONG_ATTRIBUTE_TYPE.

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

Here is the call graph for this function:

◆ 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_SUCCESS on success, and XML_WRONG_ATTRIBUTE_TYPE if the conversion is not successful.

Definition at line 1444 of file tinyxml2.cpp.

References tinyxml2::XMLUtil::ToInt(), Value(), tinyxml2::XML_SUCCESS, and tinyxml2::XML_WRONG_ATTRIBUTE_TYPE.

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

Here is the call graph for this function:

◆ QueryUnsigned64Value()

XMLError tinyxml2::XMLAttribute::QueryUnsigned64Value ( uint64_t *  value) const

See QueryIntValue.

Definition at line 1471 of file tinyxml2.cpp.

References tinyxml2::XMLUtil::ToUnsigned64(), Value(), tinyxml2::XML_SUCCESS, and tinyxml2::XML_WRONG_ATTRIBUTE_TYPE.

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

Here is the call graph for this function:

◆ QueryUnsignedValue()

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

See QueryIntValue.

Definition at line 1453 of file tinyxml2.cpp.

References tinyxml2::XMLUtil::ToUnsigned(), Value(), tinyxml2::XML_SUCCESS, and tinyxml2::XML_WRONG_ATTRIBUTE_TYPE.

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

Here is the call graph for this function:

◆ SetAttribute() [1/8]

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

Set the attribute to value.

Definition at line 1544 of file tinyxml2.cpp.

References _value, BUF_SIZE, tinyxml2::StrPair::SetStr(), and tinyxml2::XMLUtil::ToStr().

Here is the call graph for this function:

◆ SetAttribute() [2/8]

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

Set the attribute to a string value.

Definition at line 1507 of file tinyxml2.cpp.

References _value, and tinyxml2::StrPair::SetStr().

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

Here is the call graph for this function:

◆ SetAttribute() [3/8]

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

Set the attribute to value.

Definition at line 1551 of file tinyxml2.cpp.

References _value, BUF_SIZE, tinyxml2::StrPair::SetStr(), and tinyxml2::XMLUtil::ToStr().

Here is the call graph for this function:

◆ SetAttribute() [4/8]

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

Set the attribute to value.

Definition at line 1558 of file tinyxml2.cpp.

References _value, BUF_SIZE, tinyxml2::StrPair::SetStr(), and tinyxml2::XMLUtil::ToStr().

Here is the call graph for this function:

◆ SetAttribute() [5/8]

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

Set the attribute to value.

Definition at line 1513 of file tinyxml2.cpp.

References _value, BUF_SIZE, tinyxml2::StrPair::SetStr(), and tinyxml2::XMLUtil::ToStr().

Here is the call graph for this function:

◆ SetAttribute() [6/8]

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

Set the attribute to value.

Definition at line 1529 of file tinyxml2.cpp.

References _value, BUF_SIZE, tinyxml2::StrPair::SetStr(), and tinyxml2::XMLUtil::ToStr().

Here is the call graph for this function:

◆ SetAttribute() [7/8]

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

Set the attribute to value.

Definition at line 1536 of file tinyxml2.cpp.

References _value, BUF_SIZE, tinyxml2::StrPair::SetStr(), and tinyxml2::XMLUtil::ToStr().

Here is the call graph for this function:

◆ SetAttribute() [8/8]

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

Set the attribute to value.

Definition at line 1521 of file tinyxml2.cpp.

References _value, BUF_SIZE, tinyxml2::StrPair::SetStr(), and tinyxml2::XMLUtil::ToStr().

Here is the call graph for this function:

◆ SetName()

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

Definition at line 1438 of file tinyxml2.cpp.

References _name, and tinyxml2::StrPair::SetStr().

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

Here is the call graph for this function:

◆ Unsigned64Value()

uint64_t tinyxml2::XMLAttribute::Unsigned64Value ( ) const
inline

Definition at line 1174 of file tinyxml2.h.

◆ UnsignedValue()

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

Query as an unsigned integer. See IntValue()

Definition at line 1181 of file tinyxml2.h.

◆ Value()

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

The value of the attribute.

Definition at line 1405 of file tinyxml2.cpp.

References _value, and tinyxml2::StrPair::GetStr().

Referenced by tinyxml2::XMLElement::Attribute(), QueryBoolValue(), QueryDoubleValue(), QueryFloatValue(), QueryInt64Value(), QueryIntValue(), tinyxml2::XMLElement::QueryStringAttribute(), QueryUnsigned64Value(), QueryUnsignedValue(), tinyxml2::XMLElement::ShallowEqual(), and tinyxml2::XMLPrinter::VisitEnter().

Here is the call graph for this function:

Friends And Related Function Documentation

◆ XMLElement

friend class XMLElement
friend

Definition at line 1142 of file tinyxml2.h.

Member Data Documentation

◆ _memPool

MemPool* tinyxml2::XMLAttribute::_memPool
private

◆ _name

StrPair tinyxml2::XMLAttribute::_name
mutableprivate

Definition at line 1252 of file tinyxml2.h.

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

◆ _next

◆ _parseLineNum

int tinyxml2::XMLAttribute::_parseLineNum
private

Definition at line 1254 of file tinyxml2.h.

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

◆ _value

StrPair tinyxml2::XMLAttribute::_value
mutableprivate

Definition at line 1253 of file tinyxml2.h.

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


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