QtBase  v6.3.1
Public Member Functions | List of all members
QXmlStreamAttributes Class Reference

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

#include <qxmlstream.h>

Inheritance diagram for QXmlStreamAttributes:
Inheritance graph
[legend]
Collaboration diagram for QXmlStreamAttributes:
Collaboration graph
[legend]

Public Member Functions

 QXmlStreamAttributes ()
 
Q_CORE_EXPORT QStringView value (const QString &namespaceUri, const QString &name) const
 
Q_CORE_EXPORT QStringView value (const QString &namespaceUri, QLatin1String name) const
 
Q_CORE_EXPORT QStringView value (QLatin1String namespaceUri, QLatin1String name) const
 
Q_CORE_EXPORT QStringView value (const QString &qualifiedName) const
 
Q_CORE_EXPORT QStringView value (QLatin1String qualifiedName) const
 
Q_CORE_EXPORT void append (const QString &namespaceUri, const QString &name, const QString &value)
 
Q_CORE_EXPORT void append (const QString &qualifiedName, const QString &value)
 
bool hasAttribute (const QString &qualifiedName) const
 
bool hasAttribute (QLatin1String qualifiedName) const
 
bool hasAttribute (const QString &namespaceUri, const QString &name) const
 
- Public Member Functions inherited from QList< QXmlStreamAttribute >
 QList (DataPointer dd) noexcept
 
 QList ()=default
 
 QList (qsizetype size)
 
 QList (qsizetype size, parameter_type t)
 
 QList (std::initializer_list< QXmlStreamAttribute > args)
 
 QList (InputIterator i1, InputIterator i2)
 
 QList (const String &str)
 
QList< QXmlStreamAttribute > & operator= (std::initializer_list< QXmlStreamAttribute > args)
 
void swap (QList &other) noexcept
 
QTypeTraits::compare_eq_result_container< QList, Uoperator== (const QList &other) const
 
QTypeTraits::compare_eq_result_container< QList, Uoperator!= (const QList &other) const
 
QTypeTraits::compare_lt_result_container< QList, Uoperator< (const QList &other) const noexcept(noexcept(std::lexicographical_compare< typename QList< U >::const_iterator, typename QList::const_iterator >(std::declval< QList< U >>().begin(), std::declval< QList< U >>().end(), other.begin(), other.end())))
 
QTypeTraits::compare_lt_result_container< QList, Uoperator> (const QList &other) const noexcept(noexcept(other< std::declval< QList< U >>()))
 
QTypeTraits::compare_lt_result_container< QList, Uoperator<= (const QList &other) const noexcept(noexcept(other< std::declval< QList< U >>()))
 
QTypeTraits::compare_lt_result_container< QList, Uoperator>= (const QList &other) const noexcept(noexcept(std::declval< QList< U >>()< other))
 
qsizetype size () const noexcept
 
qsizetype count () const noexcept
 
qsizetype count (const AT &t) const noexcept
 
qsizetype length () const noexcept
 
bool isEmpty () const noexcept
 
void resize (qsizetype size)
 
void resize (qsizetype size, parameter_type c)
 
qsizetype capacity () const
 
void reserve (qsizetype size)
 
void squeeze ()
 
void detach ()
 
bool isDetached () const noexcept
 
bool isSharedWith (const QList< QXmlStreamAttribute > &other) const
 
pointer data ()
 
const_pointer data () const noexcept
 
const_pointer constData () const noexcept
 
void clear ()
 
const_reference at (qsizetype i) const noexcept
 
reference operator[] (qsizetype i)
 
const_reference operator[] (qsizetype i) const noexcept
 
void append (parameter_type t)
 
void append (const_iterator i1, const_iterator i2)
 
void append (rvalue_ref t)
 
void append (const QList< QXmlStreamAttribute > &l)
 
void append (QList< QXmlStreamAttribute > &&l)
 
void prepend (rvalue_ref t)
 
void prepend (parameter_type t)
 
reference emplaceBack (Args &&... args)
 
reference emplaceFront (Args &&... args)
 
iterator insert (qsizetype i, parameter_type t)
 
iterator insert (qsizetype i, qsizetype n, parameter_type t)
 
iterator insert (const_iterator before, parameter_type t)
 
iterator insert (const_iterator before, qsizetype n, parameter_type t)
 
iterator insert (const_iterator before, rvalue_ref t)
 
iterator insert (qsizetype i, rvalue_ref t)
 
iterator emplace (const_iterator before, Args &&... args)
 
iterator emplace (qsizetype i, Args &&... args)
 
void replace (qsizetype i, parameter_type t)
 
void replace (qsizetype i, rvalue_ref t)
 
void remove (qsizetype i, qsizetype n=1)
 
void removeFirst () noexcept
 
void removeLast () noexcept
 
value_type takeFirst ()
 
value_type takeLast ()
 
QList< QXmlStreamAttribute > & fill (parameter_type t, qsizetype size=-1)
 
void removeAt (qsizetype i)
 
qsizetype removeAll (const AT &t)
 
bool removeOne (const AT &t)
 
qsizetype removeIf (Predicate pred)
 
QXmlStreamAttribute takeAt (qsizetype i)
 
void move (qsizetype from, qsizetype to)
 
iterator begin ()
 
const_iterator begin () const noexcept
 
iterator end ()
 
const_iterator end () const noexcept
 
const_iterator cbegin () const noexcept
 
const_iterator cend () const noexcept
 
const_iterator constBegin () const noexcept
 
const_iterator constEnd () const noexcept
 
reverse_iterator rbegin ()
 
const_reverse_iterator rbegin () const noexcept
 
reverse_iterator rend ()
 
const_reverse_iterator rend () const noexcept
 
const_reverse_iterator crbegin () const noexcept
 
const_reverse_iterator crend () const noexcept
 
iterator erase (const_iterator begin, const_iterator end)
 
iterator erase (const_iterator pos)
 
QXmlStreamAttributefirst ()
 
const QXmlStreamAttributefirst () const noexcept
 
QList< QXmlStreamAttributefirst (qsizetype n) const
 
const QXmlStreamAttributeconstFirst () const noexcept
 
QXmlStreamAttributelast ()
 
const QXmlStreamAttributelast () const noexcept
 
QList< QXmlStreamAttributelast (qsizetype n) const
 
const QXmlStreamAttributeconstLast () const noexcept
 
bool startsWith (parameter_type t) const
 
bool endsWith (parameter_type t) const
 
QList< QXmlStreamAttributemid (qsizetype pos, qsizetype len=-1) const
 
QList< QXmlStreamAttributesliced (qsizetype pos) const
 
QList< QXmlStreamAttributesliced (qsizetype pos, qsizetype n) const
 
QXmlStreamAttribute value (qsizetype i) const
 
QXmlStreamAttribute value (qsizetype i, parameter_type defaultValue) const
 
void swapItemsAt (qsizetype i, qsizetype j)
 
void push_back (parameter_type t)
 
void push_back (rvalue_ref t)
 
void push_front (rvalue_ref t)
 
void push_front (parameter_type t)
 
void pop_back () noexcept
 
void pop_front () noexcept
 
reference emplace_back (Args &&... args)
 
bool empty () const noexcept
 
reference front ()
 
const_reference front () const noexcept
 
reference back ()
 
const_reference back () const noexcept
 
void shrink_to_fit ()
 
QList< QXmlStreamAttribute > & operator+= (const QList< QXmlStreamAttribute > &l)
 
QList< QXmlStreamAttribute > & operator+= (QList< QXmlStreamAttribute > &&l)
 
QList< QXmlStreamAttribute > & operator+= (parameter_type t)
 
QList< QXmlStreamAttribute > & operator+= (rvalue_ref t)
 
QList< QXmlStreamAttributeoperator+ (const QList< QXmlStreamAttribute > &l) const
 
QList< QXmlStreamAttributeoperator+ (QList< QXmlStreamAttribute > &&l) const
 
QList< QXmlStreamAttribute > & operator<< (parameter_type t)
 
QList< QXmlStreamAttribute > & operator<< (const QList< QXmlStreamAttribute > &l)
 
QList< QXmlStreamAttribute > & operator<< (QList< QXmlStreamAttribute > &&l)
 
QList< QXmlStreamAttribute > & operator<< (rvalue_ref t)
 
QList< QXmlStreamAttributetoList () const noexcept
 
QList< QXmlStreamAttributetoVector () const noexcept
 
- Public Member Functions inherited from QListSpecialMethodsBase< T >
template<typename AT = T>
qsizetype indexOf (const AT &t, qsizetype from=0) const noexcept
 
template<typename AT = T>
qsizetype lastIndexOf (const AT &t, qsizetype from=-1) const noexcept
 
template<typename AT = T>
bool contains (const AT &t) const noexcept
 

Additional Inherited Members

- Public Types inherited from QList< QXmlStreamAttribute >
using Type = QXmlStreamAttribute
 
using value_type = QXmlStreamAttribute
 
using pointer = QXmlStreamAttribute *
 
using const_pointer = const QXmlStreamAttribute *
 
using reference = QXmlStreamAttribute &
 
using const_reference = const QXmlStreamAttribute &
 
using size_type = qsizetype
 
using difference_type = qptrdiff
 
using parameter_type = typename DataPointer::parameter_type
 
using rvalue_ref = typename std::conditional< DataPointer::pass_parameter_by_value, DisableRValueRefs, QXmlStreamAttribute && >::type
 
using Iterator = iterator
 
using ConstIterator = const_iterator
 
using reverse_iterator = std::reverse_iterator< iterator >
 
using const_reverse_iterator = std::reverse_iterator< const_iterator >
 
- Static Public Member Functions inherited from QList< QXmlStreamAttribute >
static QList< QXmlStreamAttributefromList (const QList< QXmlStreamAttribute > &list) noexcept
 
static QList< QXmlStreamAttributefromVector (const QList< QXmlStreamAttribute > &vector) noexcept
 
static QList< QXmlStreamAttributefromReadOnlyData (const QXmlStreamAttribute(&t)[N]) noexcept
 
- Protected Types inherited from QListSpecialMethodsBase< T >
using Self = QList< T >
 
- Protected Member Functions inherited from QListSpecialMethods< QXmlStreamAttribute >
 ~QListSpecialMethods ()=default
 
- Protected Member Functions inherited from QListSpecialMethodsBase< T >
 ~QListSpecialMethodsBase ()=default
 
Selfself ()
 
const Selfself () const
 

Detailed Description

The QXmlStreamAttributes class represents a vector of QXmlStreamAttribute.

\inmodule QtCore

Since
4.3 \reentrant

Attributes are returned by a QXmlStreamReader in \l{QXmlStreamReader::attributes()} {attributes()} when the reader reports a \l {QXmlStreamReader::StartElement}{start element}. The class can also be used with a QXmlStreamWriter as an argument to \l {QXmlStreamWriter::writeAttributes()}{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().

Definition at line 110 of file qxmlstream.h.

Constructor & Destructor Documentation

◆ QXmlStreamAttributes()

QXmlStreamAttributes::QXmlStreamAttributes ( )
inline

A constructor for QXmlStreamAttributes.

Definition at line 113 of file qxmlstream.h.

Member Function Documentation

◆ append() [1/2]

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.

Definition at line 2655 of file qxmlstream.cpp.

Here is the caller graph for this function:

◆ append() [2/2]

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

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Appends a new attribute with qualified name qualifiedName and value value.

Definition at line 2664 of file qxmlstream.cpp.

Here is the call graph for this function:

◆ hasAttribute() [1/3]

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

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Since
4.5

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

Definition at line 132 of file qxmlstream.h.

Here is the call graph for this function:

◆ hasAttribute() [2/3]

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

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

Note that this is not namespace aware. For instance, if this QXmlStreamAttributes contains an attribute whose lexical name is "xlink:href" this doesn't tell that an attribute named href in the XLink namespace is present, since the xlink prefix can be bound to any namespace. Use the overload that takes a namespace URI and a local name as parameter, for namespace aware code.

Definition at line 122 of file qxmlstream.h.

Here is the call graph for this function:

◆ hasAttribute() [3/3]

bool QXmlStreamAttributes::hasAttribute ( QLatin1String  qualifiedName) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Since
4.5

Definition at line 127 of file qxmlstream.h.

Here is the call graph for this function:

◆ value() [1/5]

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.

Definition at line 2572 of file qxmlstream.cpp.

Here is the caller graph for this function:

◆ value() [2/5]

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

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. 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.

Definition at line 2586 of file qxmlstream.cpp.

Here is the caller graph for this function:

◆ value() [3/5]

QStringView QXmlStreamAttributes::value ( const QString qualifiedName) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

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 shouldn't use qualified names, but a resolved namespaceUri and the attribute's local name.

Definition at line 2621 of file qxmlstream.cpp.

Here is the caller graph for this function:

◆ value() [4/5]

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

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. 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.

Definition at line 2600 of file qxmlstream.cpp.

Here is the caller graph for this function:

◆ value() [5/5]

QStringView QXmlStreamAttributes::value ( QLatin1String  qualifiedName) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

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 shouldn't use qualified names, but a resolved namespaceUri and the attribute's local name.

Definition at line 2642 of file qxmlstream.cpp.

Here is the caller graph for this function:

The documentation for this class was generated from the following files: