#include <easyxml.hpp>
Public Member Functions | |
| XMLAttributesDefault () | |
| Default constructor. | |
| XMLAttributesDefault (const XMLAttributes &atts) | |
| virtual | ~XMLAttributesDefault () |
| virtual int | size () const |
| virtual const char * | getName (int i) const |
| virtual const char * | getValue (int i) const |
| virtual void | addAttribute (const char *name, const char *value) |
| virtual void | setName (int i, const char *name) |
| virtual void | setValue (int i, const char *value) |
| virtual void | setValue (const char *name, const char *value) |
Public Member Functions inherited from XMLAttributes | |
| XMLAttributes () | |
| Constructor. | |
| virtual | ~XMLAttributes () |
| Destructor. | |
| virtual int | findAttribute (const char *name) const |
| virtual bool | hasAttribute (const char *name) const |
| virtual const char * | getValue (const char *name) const |
Default mutable attributes implementation.
This class provides a default implementation of the XMLAttributes interface. The implementation is mutable, so that it is possible to modify the attribute list when necessary. This class is particularly useful for taking a snapshot of an attribute list during parsing.
| XMLAttributesDefault::XMLAttributesDefault | ( | const XMLAttributes & | atts) |
Copy constructor.
This constructor is especially useful for taking a static snapshot of an attribute list for later use.
| atts | The attribute list to copy. |
|
virtual |
Destructor.
|
virtual |
Add an attribute to an attribute list.
The name is required to be unique in the list; the value is not.
| name | The name of the attribute to add. |
| value | The value of the attribute to add. |
|
virtual |
Get the name of an attribute by index.
Implements XMLAttributes.
|
virtual |
Get the value of an attribute by index.
Implements XMLAttributes.
|
virtual |
Set an attribute name by index.
This method will not extend the list; the attribute must already exist.
| i | The index of the attribute (zero-based). |
| name | The new name. |
|
virtual |
Set an attribute value by index.
This method will not extend the list; the attribute must already exist.
| i | The index of the attribute (zero-based). |
| value | The new value. |
|
virtual |
Set an attribute value by name.
This method will not extend the list; the attribute must already exist.
| name | The name of the attribute that will have the new value. |
| value | The new value. |
|
virtual |
Count the attributes in the list.
Implements XMLAttributes.
1.8.4