QtBase
v6.3.1
|
The QXmlStreamAttributes class represents a vector of QXmlStreamAttribute. More...
#include <qxmlstream.h>
The QXmlStreamAttributes class represents a vector of QXmlStreamAttribute.
\inmodule QtCore
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.
|
inline |
A constructor for QXmlStreamAttributes.
Definition at line 113 of file qxmlstream.h.
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.
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.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
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.
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.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 127 of file qxmlstream.h.
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.
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.
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.
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.
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.