AttributeList Class Reference

#include <Pt/Xml/StartElement.h>

An attribute list of an XML element.

Inherits NonCopyable.

Public Types

typedef const AttributeConstIterator
 Attribute list const iterator.
 
typedef AttributeIterator
 Attribute list iterator.
 

Public Member Functions

 AttributeList (NamespaceContext &nsctx)
 Construct with namespace context.
 
Attributeappend (const QName &name, const Namespace &ns)
 Appends a new element to the end of the list. More...
 
Iterator begin ()
 An iterator to the begin of the sequence.
 
ConstIterator begin () const
 An iterator to the begin of the sequence.
 
void clear ()
 Clears all content.
 
bool empty () const
 Returns true if the list is empty.
 
Iterator end ()
 An iterator to the end of the sequence.
 
ConstIterator end () const
 An iterator to the end of the sequence.
 
Iterator find (const String &localName)
 Finds an attribute by name. More...
 
Iterator find (const Char *localName)
 Finds an attribute by name. More...
 
Iterator find (const String &nsUri, const String &localName)
 Finds an attribute by name. More...
 
Iterator find (const Char *nsUri, const Char *localName)
 Finds an attribute by name. More...
 
ConstIterator find (const String &localName) const
 Finds an attribute by name. More...
 
ConstIterator find (const Char *localName) const
 Finds an attribute by name. More...
 
ConstIterator find (const String &nsUri, const String &localName) const
 Finds an attribute by name. More...
 
ConstIterator find (const Char *nsUri, const Char *localName) const
 Finds an attribute by name. More...
 
const Pt::Stringget (const String &localName) const
 Gets the value of an attribute. More...
 
const Pt::Stringget (const Char *localName) const
 Gets the value of an attribute. More...
 
const Pt::Stringget (const String &nsUri, const String &localName) const
 Gets the value of an attribute. More...
 
const Pt::Stringget (const Char *nsUri, const Char *localName) const
 Gets the value of an attribute. More...
 
bool has (const String &localName) const
 Checks if an attribute is present.
 
bool has (const Char *localName) const
 Checks if an attribute is present.
 
bool has (const String &nsUri, const String &localName) const
 Checks if an attribute is present.
 
bool has (const Char *nsUri, const Char *localName) const
 Checks if an attribute is present.
 
NamespaceContext & namespaceContext ()
 Returns the namespace context for the attributes.
 
std::size_t size () const
 Returns the size of the list.
 

Member Function Documentation

Attribute& append ( const QName name,
const Namespace ns 
)

A new attribute is added to the end of the list with the name name in the namespace ns

const Pt::String& get ( const String localName) const

The value of the attribute with the local name localName is returned. If no attribute by that name is present, an exception of type XmlError is thrown.

const Pt::String& get ( const Char localName) const

The value of the attribute with the local name localName is returned. If no attribute by that name is present, an exception of type XmlError is thrown.

const Pt::String& get ( const String nsUri,
const String localName 
) const

The value of the attribute with the namespace nsUri and the local name localName is returned. If no attribute by that name is present, an exception of type XmlError is thrown.

const Pt::String& get ( const Char nsUri,
const Char localName 
) const

The value of the attribute with the namespace nsUri and the local name localName is returned. If no attribute by that name is present, an exception of type XmlError is thrown.

Iterator find ( const String localName)

An iterator to the the attribute with the local name localName is returned. If no attribute by that name is present, an iterator to the end of the sequence is returned.

Iterator find ( const Char localName)

An iterator to the the attribute with the local name localName is returned. If no attribute by that name is present, an iterator to the end of the sequence is returned.

Iterator find ( const String nsUri,
const String localName 
)

An iterator to the the attribute with the the namespace nsUri and the local name localName is returned. If no attribute by that name is present, an iterator to the end of the sequence is returned.

Iterator find ( const Char nsUri,
const Char localName 
)

An iterator to the the attribute with the the namespace nsUri and the local name localName is returned. If no attribute by that name is present, an iterator to the end of the sequence is returned.

ConstIterator find ( const String localName) const

An iterator to the the attribute with the local name localName is returned. If no attribute by that name is present, an iterator to the end of the sequence is returned.

ConstIterator find ( const Char localName) const

An iterator to the the attribute with the local name localName is returned. If no attribute by that name is present, an iterator to the end of the sequence is returned.

ConstIterator find ( const String nsUri,
const String localName 
) const

An iterator to the the attribute with the the namespace nsUri and the local name localName is returned. If no attribute by that name is present, an iterator to the end of the sequence is returned.

ConstIterator find ( const Char nsUri,
const Char localName 
) const

An iterator to the the attribute with the the namespace nsUri and the local name localName is returned. If no attribute by that name is present, an iterator to the end of the sequence is returned.