#include <easyxml.hpp>
Public Member Functions | |
XMLAttributes () | |
Constructor. | |
virtual | ~XMLAttributes () |
Destructor. | |
virtual int | size () const =0 |
virtual const char * | getName (int i) const =0 |
virtual const char * | getValue (int i) const =0 |
virtual int | findAttribute (const char *name) const |
virtual bool | hasAttribute (const char *name) const |
virtual const char * | getValue (const char *name) const |
Interface for XML attributes.
This interface is used to provide a list of attributes to the application. The interface is a pure abstract class so that different implementations can be substituted for the sake of efficiency.
|
virtual |
Look up the index of an attribute by name.
Attribute names must be unique. This method will return an index that can be used with the getValue(const char *) method if the attribute is found.
name | The name of the attribute. |
|
pure virtual |
Get the name of an attribute by index.
The index must be less than the size of the list and greater than or equal to zero.
i | The index of the attribute (zero-based). |
Implemented in XMLAttributesDefault, and ExpatAtts.
|
pure virtual |
Get the string value of an attribute by index.
The index must be less than the size of the list and greater than or equal to zero.
i | The index of the attribute (zero-based). |
Implemented in XMLAttributesDefault, and ExpatAtts.
|
virtual |
Look up the value of an attribute by name.
This method provides a convenient short-cut to invoking findAttribute and getValue(const char *).
name | The name of the attribute to look up. |
|
virtual |
Test whether an attribute is present.
name | The name of the attribute. |
|
pure virtual |
Get the number of attributes present.
Implemented in XMLAttributesDefault, and ExpatAtts.