|
#include <CXmlAttributes.h>

Public Member Functions | |
| CXmlAttributes (CXmlElement *parent) | |
| Constructor. | |
| CXmlAttributes & | operator= (const CXmlAttributes &src) |
| Assign operator. | |
| bool | hasAttribute (std::string attr) const |
| Searches for named attribute. | |
| CXmlValue | getAttribute (std::string attr, const char *defaultValue="") const |
| Returns an attribute value. | |
| void | setAttribute (std::string attr, CXmlValue value, const char *defaultValue="") |
| Sets attribute value for given attribute. | |
Protected Member Functions | |
| CXmlAttribute * | getAttributeNode (std::string attr) |
| Returns an attribute node. | |
| const CXmlAttribute * | getAttributeNode (std::string attr) const |
| Returns an attribute node (const version). | |
Protected Attributes | |
| CXmlElement * | m_parent |
| The parent XML element. | |
Friends | |
| class | CXmlNode |
| class | CXmlElement |
The CXmlAttributes class is map for node attributes.
| sptk::CXmlAttributes::CXmlAttributes | ( | CXmlElement * | parent | ) | [inline] |
Constructor.
The XML attributes object uses the shared strings table (SST) for attribute names
| parent | CXmlElement*, the parent XML element |
| CXmlValue sptk::CXmlAttributes::getAttribute | ( | std::string | attr, | |
| const char * | defaultValue = "" | |||
| ) | const |
Returns an attribute value.
If the attribute is not found, empty string is returned. HTML tags can have empty attributes, for those you should use has_attribute() method.
| attr | std::string, name of attribute | |
| defaultValue | const char *, a default value. If attribute doesn't exist then default value is returned. |
Referenced by sptk::CXmlElement::getAttribute().
| const CXmlAttribute* sptk::CXmlAttributes::getAttributeNode | ( | std::string | attr | ) | const [protected] |
Returns an attribute node (const version).
If the attribute is not found, empty string is returned. HTML tags can have empty attributes, for those you should use has_attribute() method.
| attr | std::string, name of attribute |
| CXmlAttribute* sptk::CXmlAttributes::getAttributeNode | ( | std::string | attr | ) | [protected] |
Returns an attribute node.
If the attribute is not found, empty string is returned. HTML tags can have empty attributes, for those you should use has_attribute() method.
| attr | std::string, name of attribute |
| bool sptk::CXmlAttributes::hasAttribute | ( | std::string | attr | ) | const |
Searches for named attribute.
Returns true, if given attribute is found.
| attr | std::string, name of attribute to search |
Referenced by sptk::CXmlElement::hasAttribute().
| CXmlAttributes& sptk::CXmlAttributes::operator= | ( | const CXmlAttributes & | src | ) |
Assign operator.
Makes copy of an attribute set to another.
| src | as copy source |
| void sptk::CXmlAttributes::setAttribute | ( | std::string | attr, | |
| CXmlValue | value, | |||
| const char * | defaultValue = "" | |||
| ) |
Sets attribute value for given attribute.
| attr | std::string, name of attribute | |
| value | CXmlValue, an attribute value. See CXmlValue class description for data convertions. | |
| defaultValue | const char *, a default value. If attribute value is matching default value than attribute isn't stored (or removed if it existed). |
Referenced by sptk::CXmlElement::setAttribute().