cpp-ElementTree
Python ElementTree-alike XML API for C++
|
Represents a mapping of an Element's attribute names to their values. More...
#include <element.hpp>
Public Member Functions | |
AttrIterator | begin () const |
Produce an AttrIterator pointing to the first attribute. | |
AttrIterator | end () const |
Produce an AttrIterator pointing past the last attribute. | |
string | get (const QName &qname, const string &default_="") const |
Return an attribute's value, or some default. More... | |
bool | has (const QName &qname) const |
Return true if the Element has the named attribute. | |
vector< QName > | keys () const |
Return the QNames of all attributes present on the Element. | |
bool | remove (const QName &qname) |
Remove an attribute if it exists, returning true if deletion occured. | |
void | set (const QName &qname, const string &s) |
Add or replace attribute's value. More... | |
void | set (kv_list attribs) |
C++0x: set multiple attribute values in a single call. More... | |
size_t | size () const |
Return the number of attributes the element has. | |
Represents a mapping of an Element's attribute names to their values.
string etree::AttrMap::get | ( | const QName & | qname, |
const string & | default_ = "" |
||
) | const |
void etree::AttrMap::set | ( | const QName & | qname, |
const string & | s | ||
) |
void etree::AttrMap::set | ( | kv_list | attribs | ) |
C++0x: set multiple attribute values in a single call.
attribs | std::initializer_list of (QName, value) pairs. |