Public Member Functions | |
XMLAttributes (void) | |
XMLAttributes constructor. | |
virtual | ~XMLAttributes (void) |
XMLAttributes Destructor. | |
void | add (const String &attrName, const String &attrValue) |
Adds an attribute to the attribute block. If the attribute value already exists, it is replaced with the new value. | |
void | remove (const String &attrName) |
Removes an attribute from the attribute block. | |
bool | exists (const String &attrName) const |
Return whether the named attribute exists within the attribute block. | |
size_t | getCount (void) const |
Return the number of attributes in the attribute block. | |
const String & | getName (size_t index) const |
Return the name of an attribute based upon its index within the attribute block. | |
const String & | getValue (size_t index) const |
Return the value string of an attribute based upon its index within the attribute block. | |
const String & | getValue (const String &attrName) const |
Return the value string for attribute attrName. | |
const String & | getValueAsString (const String &attrName, const String &def="") const |
Return the value of attribute attrName as a string. | |
bool | getValueAsBool (const String &attrName, bool def=false) const |
Return the value of attribute attrName as a boolean value. | |
int | getValueAsInteger (const String &attrName, int def=0) const |
Return the value of attribute attrName as a integer value. | |
float | getValueAsFloat (const String &attrName, float def=0.0f) const |
Return the value of attribute attrName as a floating point value. | |
Protected Types | |
typedef std::map< String, String > | AttributeMap |
Protected Attributes | |
AttributeMap | d_attrs |
|
Adds an attribute to the attribute block. If the attribute value already exists, it is replaced with the new value.
|
|
Return whether the named attribute exists within the attribute block.
|
|
Return the number of attributes in the attribute block.
|
|
Return the name of an attribute based upon its index within the attribute block.
|
|
Return the value string for attribute attrName.
|
|
Return the value string of an attribute based upon its index within the attribute block.
|
|
Return the value of attribute attrName as a boolean value.
|
|
Return the value of attribute attrName as a floating point value.
|
|
Return the value of attribute attrName as a integer value.
|
|
Return the value of attribute attrName as a string.
|
|
Removes an attribute from the attribute block.
|