CopperSpice API  1.7.2
QXmlStreamAttributes Class Reference

The QXmlStreamAttributes class represents a vector of QXmlStreamAttribute. More...

Inheritance diagram for QXmlStreamAttributes:
QVector< QXmlStreamAttribute >

Public Methods

 QXmlStreamAttributes ()
 
void append (const QString &namespaceUri, const QString &name, const QString &value)
 
void append (const QString &qualifiedName, const QString &value)
 
bool hasAttribute (const QString &namespaceUri, const QString &name) const
 
bool hasAttribute (const QString &qualifiedName) const
 
QStringView value (const QString &namespaceUri, const QString &name) const
 
QStringView value (const QString &qualifiedName) const
 
- Public Methods inherited from QVector< QXmlStreamAttribute >
 QVector () = default
 
 QVector (const QVector< QXmlStreamAttribute > &other) = default
 
 QVector (Input_Iterator first, Input_Iterator last)
 
 QVector (QVector< QXmlStreamAttribute > &&other) = default
 
 QVector (size_type size)
 
 QVector (size_type size, const QXmlStreamAttribute &value)
 
 QVector (std::initializer_list< QXmlStreamAttribute > args)
 
 ~QVector () = default
 
void append (const QVector< QXmlStreamAttribute > &other)
 
void append (const QXmlStreamAttribute &value)
 
void append (Iter begin, Iter end)
 
void append (QXmlStreamAttribute &&value)
 
const_reference at (size_type i) const
 
reference back ()
 
const_reference back () const
 
iterator begin ()
 
const_iterator begin () const
 
size_type capacity () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
void clear ()
 
const_iterator constBegin () const
 
const QXmlStreamAttributeconstData () const
 
const_iterator constEnd () const
 
const_reference constFirst () const
 
const_reference constLast () const
 
bool contains (const QXmlStreamAttribute &value) const
 
size_type count () const
 
size_type count (const QXmlStreamAttribute &value) const
 
const_reverse_iterator crbegin () const
 
const_reverse_iterator crend () const
 
QXmlStreamAttributedata ()
 
const QXmlStreamAttributedata () const
 
bool empty () const
 
iterator end ()
 
const_iterator end () const
 
bool endsWith (const QXmlStreamAttribute &value) const
 
iterator erase (const_iterator begin, const_iterator end)
 
iterator erase (const_iterator pos)
 
QVector< QXmlStreamAttribute > & fill (const QXmlStreamAttribute &value, size_type newSize=-1)
 
reference first ()
 
const_reference first () const
 
reference front ()
 
const_reference front () const
 
size_type indexOf (const QXmlStreamAttribute &value, size_type from=0) const
 
iterator insert (iterator before, const QXmlStreamAttribute &value)
 
iterator insert (iterator before, size_type count, const QXmlStreamAttribute &value)
 
iterator insert (iterator pos, Iter begin, Iter end)
 
void insert (size_type pos, const QXmlStreamAttribute &value)
 
void insert (size_type pos, size_type count, const QXmlStreamAttribute &value)
 
bool isEmpty () const
 
reference last ()
 
const_reference last () const
 
size_type lastIndexOf (const QXmlStreamAttribute &value, size_type from=-1) const
 
size_type length () const
 
QVector< QXmlStreamAttributemid (size_type pos, size_type length=-1) const
 
void move (size_type from, size_type to)
 
bool operator!= (const QVector< QXmlStreamAttribute > &other) const
 
QVector< QXmlStreamAttributeoperator+ (const QVector< QXmlStreamAttribute > &other) const
 
QVector< QXmlStreamAttribute > & operator+= (const QVector< QXmlStreamAttribute > &other)
 
QVector< QXmlStreamAttribute > & operator+= (const QXmlStreamAttribute &value)
 
QVector< QXmlStreamAttribute > & operator<< (const QVector< QXmlStreamAttribute > &other)
 
QVector< QXmlStreamAttribute > & operator<< (const QXmlStreamAttribute &value)
 
QVector< QXmlStreamAttribute > & operator= (const QVector< QXmlStreamAttribute > &other) = default
 
QVector< QXmlStreamAttribute > & operator= (QVector< QXmlStreamAttribute > &&other) = default
 
bool operator== (const QVector< QXmlStreamAttribute > &other) const
 
reference operator[] (size_type i)
 
const_reference operator[] (size_type i) const
 
void pop_back ()
 
void pop_front ()
 
void prepend (const QXmlStreamAttribute &value)
 
void push_back (const QXmlStreamAttribute &value)
 
void push_back (QXmlStreamAttribute &&value)
 
void push_front (const QXmlStreamAttribute &value)
 
void push_front (QXmlStreamAttribute &&value)
 
reverse_iterator rbegin ()
 
const_reverse_iterator rbegin () const
 
void remove (size_type pos)
 
void remove (size_type pos, size_type count)
 
size_type removeAll (const QXmlStreamAttribute &value)
 
void removeAt (size_type pos)
 
void removeFirst ()
 
void removeLast ()
 
bool removeOne (const QXmlStreamAttribute &value)
 
reverse_iterator rend ()
 
const_reverse_iterator rend () const
 
void replace (size_type i, const QXmlStreamAttribute &value)
 
void reserve (size_type size)
 
void resize (size_type size)
 
size_type size () const
 
void squeeze ()
 
bool startsWith (const QXmlStreamAttribute &value) const
 
void swap (QVector< QXmlStreamAttribute > &other)
 
QXmlStreamAttribute takeAt (size_type i)
 
QXmlStreamAttribute takeFirst ()
 
QXmlStreamAttribute takeLast ()
 
QList< QXmlStreamAttributetoList () const
 
std::vector< QXmlStreamAttributetoStdVector () const
 
QXmlStreamAttribute value (size_type i) const
 
QXmlStreamAttribute value (size_type i, const QXmlStreamAttribute &defaultValue) const
 

Additional Inherited Members

- Public Typedefs inherited from QVector< QXmlStreamAttribute >
using allocator_type = typename std::vector< QXmlStreamAttribute >::allocator_type
 
using const_iterator = typename std::vector< QXmlStreamAttribute >::const_iterator
 
using const_pointer = typename std::vector< QXmlStreamAttribute >::const_pointer
 
using const_reference = typename std::vector< QXmlStreamAttribute >::const_reference
 
using const_reverse_iterator = typename std::vector< QXmlStreamAttribute >::const_reverse_iterator
 
using difference_type = typename std::vector< QXmlStreamAttribute >::difference_type
 
using iterator = typename std::vector< QXmlStreamAttribute >::iterator
 
using Java_Iterator = QVectorIterator< QXmlStreamAttribute >
 
using Java_MutableIterator = QMutableVectorIterator< QXmlStreamAttribute >
 
using pointer = typename std::vector< QXmlStreamAttribute >::pointer
 
using reference = typename std::vector< QXmlStreamAttribute >::reference
 
using reverse_iterator = typename std::vector< QXmlStreamAttribute >::reverse_iterator
 
using size_type = typename std::vector< QXmlStreamAttribute >::difference_type
 
using value_type = typename std::vector< QXmlStreamAttribute >::value_type
 
- Static Public Methods inherited from QVector< QXmlStreamAttribute >
static QVector< QXmlStreamAttributefromList (const QList< QXmlStreamAttribute > &list)
 
static QVector< QXmlStreamAttributefromStdVector (const std::vector< QXmlStreamAttribute > &vector)
 

Detailed Description

The QXmlStreamAttributes class represents a vector of QXmlStreamAttribute.

Attributes are returned by a QXmlStreamReader in attributes() when the reader reports a start element. The class can also be used with a QXmlStreamWriter as an argument to writeAttributes().

The convenience function value() loops over the vector and returns an attribute value for a given namespaceUri and an attribute's name.

New attributes can be added with append().

See also
QVector::append()

Constructor & Destructor Documentation

QXmlStreamAttributes::QXmlStreamAttributes ( )
inline

Constructs a new object.

Method Documentation

void QXmlStreamAttributes::append ( const QString namespaceUri,
const QString name,
const QString value 
)

Appends a new attribute with name in the namespace described with namespaceUri, and value value. The namespaceUri can be empty.

void QXmlStreamAttributes::append ( const QString qualifiedName,
const QString value 
)

Appends a new attribute with qualified name qualifiedName and value value.

bool QXmlStreamAttributes::hasAttribute ( const QString namespaceUri,
const QString name 
) const
inline

Returns true if this QXmlStreamAttributes has an attribute whose namespace URI and name correspond to namespaceUri and name, otherwise returns false.

bool QXmlStreamAttributes::hasAttribute ( const QString qualifiedName) const
inline

Returns true if this QXmlStreamAttributes has an attribute whose qualified name is qualifiedName, otherwise returns false.

This method is not namespace aware. For example, if QXmlStreamAttributes contains an attribute whose lexical name is "xlink:href" and you call this method with an argument of href the return value will be false. In order to process namespaces use the overload of hasAttribute() which supports a namespace URI and a local name.

Returns true if this QXmlStreamAttributes has an attribute whose namespace URI and name correspond to namespaceUri and name, otherwise returns false.

QStringView QXmlStreamAttributes::value ( const QString namespaceUri,
const QString name 
) const

Returns the value of the attribute name in the namespace described with namespaceUri, or an empty string reference if the attribute is not defined. The namespaceUri can be empty.

QStringView QXmlStreamAttributes::value ( const QString qualifiedName) const

Returns the value of the attribute with qualified name qualifiedName , or an empty string reference if the attribute is not defined. A qualified name is the raw name of an attribute in the XML data. It consists of the namespace prefix, followed by colon, followed by the attribute's local name. Since the namespace prefix is not unique (the same prefix can point to different namespaces and different prefixes can point to the same namespace), you should not use qualified names, but a resolved namespaceUri and the attribute's local name.