Struct qt_core::QXmlStreamAttributes
source · #[repr(C)]pub struct QXmlStreamAttributes { /* private fields */ }
Expand description
The QXmlStreamAttributes class represents a vector of QXmlStreamAttribute.
C++ class: QXmlStreamAttributes
.
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().
Implementations§
source§impl QXmlStreamAttributes
impl QXmlStreamAttributes
sourcepub unsafe fn append_3a(
&self,
namespace_uri: impl CastInto<Ref<QString>>,
name: impl CastInto<Ref<QString>>,
value: impl CastInto<Ref<QString>>
)
pub unsafe fn append_3a( &self, namespace_uri: impl CastInto<Ref<QString>>, name: impl CastInto<Ref<QString>>, value: impl CastInto<Ref<QString>> )
Appends a new attribute with name in the namespace described with namespaceUri, and value value. The namespaceUri can be empty.
Calls C++ function: 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.
sourcepub unsafe fn append_2a(
&self,
qualified_name: impl CastInto<Ref<QString>>,
value: impl CastInto<Ref<QString>>
)
pub unsafe fn append_2a( &self, qualified_name: impl CastInto<Ref<QString>>, value: impl CastInto<Ref<QString>> )
This is an overloaded function.
Calls C++ function: void QXmlStreamAttributes::append(const QString& qualifiedName, const QString& value)
.
This is an overloaded function.
Appends a new attribute with qualified name qualifiedName and value value.
sourcepub unsafe fn copy_from(
&self,
other: impl CastInto<Ref<QXmlStreamAttributes>>
) -> Ref<QXmlStreamAttributes>
pub unsafe fn copy_from( &self, other: impl CastInto<Ref<QXmlStreamAttributes>> ) -> Ref<QXmlStreamAttributes>
The QXmlStreamAttributes class represents a vector of QXmlStreamAttribute.
Calls C++ function: QXmlStreamAttributes& QXmlStreamAttributes::operator=(const QXmlStreamAttributes& other)
.
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().
sourcepub unsafe fn has_attribute_q_string(
&self,
qualified_name: impl CastInto<Ref<QString>>
) -> bool
pub unsafe fn has_attribute_q_string( &self, qualified_name: impl CastInto<Ref<QString>> ) -> bool
Returns true
if this QXmlStreamAttributes has an attribute whose qualified name is qualifiedName; otherwise returns false
.
Calls C++ function: bool QXmlStreamAttributes::hasAttribute(const QString& qualifiedName) const
.
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.
This function was introduced in Qt 4.5.
sourcepub unsafe fn has_attribute_q_latin1_string(
&self,
qualified_name: impl CastInto<Ref<QLatin1String>>
) -> bool
pub unsafe fn has_attribute_q_latin1_string( &self, qualified_name: impl CastInto<Ref<QLatin1String>> ) -> bool
This is an overloaded function.
Calls C++ function: bool QXmlStreamAttributes::hasAttribute(QLatin1String qualifiedName) const
.
This is an overloaded function.
This function was introduced in Qt 4.5.
sourcepub unsafe fn has_attribute_2_q_string(
&self,
namespace_uri: impl CastInto<Ref<QString>>,
name: impl CastInto<Ref<QString>>
) -> bool
pub unsafe fn has_attribute_2_q_string( &self, namespace_uri: impl CastInto<Ref<QString>>, name: impl CastInto<Ref<QString>> ) -> bool
This is an overloaded function.
Calls C++ function: bool QXmlStreamAttributes::hasAttribute(const QString& namespaceUri, const QString& name) const
.
This is an overloaded function.
Returns true
if this QXmlStreamAttributes has an attribute whose namespace URI and name correspond to namespaceUri and name; otherwise returns false
.
This function was introduced in Qt 4.5.
sourcepub unsafe fn new() -> CppBox<QXmlStreamAttributes>
pub unsafe fn new() -> CppBox<QXmlStreamAttributes>
A constructor for QXmlStreamAttributes.
Calls C++ function: [constructor] void QXmlStreamAttributes::QXmlStreamAttributes()
.
A constructor for QXmlStreamAttributes.
sourcepub unsafe fn new_copy(
other: impl CastInto<Ref<QXmlStreamAttributes>>
) -> CppBox<QXmlStreamAttributes>
pub unsafe fn new_copy( other: impl CastInto<Ref<QXmlStreamAttributes>> ) -> CppBox<QXmlStreamAttributes>
The QXmlStreamAttributes class represents a vector of QXmlStreamAttribute.
Calls C++ function: [constructor] void QXmlStreamAttributes::QXmlStreamAttributes(const QXmlStreamAttributes& other)
.
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().
sourcepub unsafe fn value_2_q_string(
&self,
namespace_uri: impl CastInto<Ref<QString>>,
name: impl CastInto<Ref<QString>>
) -> CppBox<QStringRef>
pub unsafe fn value_2_q_string( &self, namespace_uri: impl CastInto<Ref<QString>>, name: impl CastInto<Ref<QString>> ) -> CppBox<QStringRef>
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.
Calls C++ function: QStringRef 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.
sourcepub unsafe fn value_q_string_q_latin1_string(
&self,
namespace_uri: impl CastInto<Ref<QString>>,
name: impl CastInto<Ref<QLatin1String>>
) -> CppBox<QStringRef>
pub unsafe fn value_q_string_q_latin1_string( &self, namespace_uri: impl CastInto<Ref<QString>>, name: impl CastInto<Ref<QLatin1String>> ) -> CppBox<QStringRef>
This is an overloaded function.
Calls C++ function: QStringRef QXmlStreamAttributes::value(const QString& namespaceUri, QLatin1String name) const
.
This is an overloaded function.
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.
sourcepub unsafe fn value_2_q_latin1_string(
&self,
namespace_uri: impl CastInto<Ref<QLatin1String>>,
name: impl CastInto<Ref<QLatin1String>>
) -> CppBox<QStringRef>
pub unsafe fn value_2_q_latin1_string( &self, namespace_uri: impl CastInto<Ref<QLatin1String>>, name: impl CastInto<Ref<QLatin1String>> ) -> CppBox<QStringRef>
This is an overloaded function.
Calls C++ function: QStringRef QXmlStreamAttributes::value(QLatin1String namespaceUri, QLatin1String name) const
.
This is an overloaded function.
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.
sourcepub unsafe fn value_q_string(
&self,
qualified_name: impl CastInto<Ref<QString>>
) -> CppBox<QStringRef>
pub unsafe fn value_q_string( &self, qualified_name: impl CastInto<Ref<QString>> ) -> CppBox<QStringRef>
This is an overloaded function.
Calls C++ function: QStringRef QXmlStreamAttributes::value(const QString& qualifiedName) const
.
This is an overloaded function.
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.
sourcepub unsafe fn value_q_latin1_string(
&self,
qualified_name: impl CastInto<Ref<QLatin1String>>
) -> CppBox<QStringRef>
pub unsafe fn value_q_latin1_string( &self, qualified_name: impl CastInto<Ref<QLatin1String>> ) -> CppBox<QStringRef>
This is an overloaded function.
Calls C++ function: QStringRef QXmlStreamAttributes::value(QLatin1String qualifiedName) const
.
This is an overloaded function.
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.
Methods from Deref<Target = QVectorOfQXmlStreamAttribute>§
sourcepub unsafe fn add_assign_q_vector_of_q_xml_stream_attribute(
&self,
l: impl CastInto<Ref<QVectorOfQXmlStreamAttribute>>
) -> Ref<QVectorOfQXmlStreamAttribute>
pub unsafe fn add_assign_q_vector_of_q_xml_stream_attribute( &self, l: impl CastInto<Ref<QVectorOfQXmlStreamAttribute>> ) -> Ref<QVectorOfQXmlStreamAttribute>
Appends the items of the other vector to this vector and returns a reference to this vector.
Calls C++ function: QVector<QXmlStreamAttribute>& QVector<QXmlStreamAttribute>::operator+=(const QVector<QXmlStreamAttribute>& l)
.
sourcepub unsafe fn add_assign_q_xml_stream_attribute(
&self,
t: impl CastInto<Ref<QXmlStreamAttribute>>
) -> Ref<QVectorOfQXmlStreamAttribute>
pub unsafe fn add_assign_q_xml_stream_attribute( &self, t: impl CastInto<Ref<QXmlStreamAttribute>> ) -> Ref<QVectorOfQXmlStreamAttribute>
This is an overloaded function.
Calls C++ function: QVector<QXmlStreamAttribute>& QVector<QXmlStreamAttribute>::operator+=(const QXmlStreamAttribute& t)
.
sourcepub unsafe fn append_q_xml_stream_attribute(
&self,
t: impl CastInto<Ref<QXmlStreamAttribute>>
)
pub unsafe fn append_q_xml_stream_attribute( &self, t: impl CastInto<Ref<QXmlStreamAttribute>> )
Inserts value at the end of the vector.
Calls C++ function: void QVector<QXmlStreamAttribute>::append(const QXmlStreamAttribute& t)
.
Inserts value at the end of the vector.
Example:
QVector<QString> vector; vector.append(“one”); vector.append(“two”); QString three = “three”; vector.append(three); // vector: [“one”, “two”, “three”] // three: “three”
This is the same as calling resize(size() + 1) and assigning value to the new last element in the vector.
This operation is relatively fast, because QVector typically allocates more memory than necessary, so it can grow without reallocating the entire vector each time.
See also operator<<(), prepend(), and insert().
sourcepub unsafe fn append_q_vector_of_q_xml_stream_attribute(
&self,
l: impl CastInto<Ref<QVectorOfQXmlStreamAttribute>>
)
pub unsafe fn append_q_vector_of_q_xml_stream_attribute( &self, l: impl CastInto<Ref<QVectorOfQXmlStreamAttribute>> )
This is an overloaded function.
Calls C++ function: void QVector<QXmlStreamAttribute>::append(const QVector<QXmlStreamAttribute>& l)
.
This is an overloaded function.
Appends the items of the value vector to this vector.
This function was introduced in Qt 5.5.
See also operator<<() and operator+=().
sourcepub unsafe fn at(&self, i: c_int) -> Ref<QXmlStreamAttribute>
pub unsafe fn at(&self, i: c_int) -> Ref<QXmlStreamAttribute>
Returns the item at index position i in the vector.
Calls C++ function: const QXmlStreamAttribute& QVector<QXmlStreamAttribute>::at(int i) const
.
Returns the item at index position i in the vector.
i must be a valid index position in the vector (i.e., 0 <= i < size()).
See also value() and operator[]().
sourcepub unsafe fn back_mut(&self) -> Ref<QXmlStreamAttribute>
pub unsafe fn back_mut(&self) -> Ref<QXmlStreamAttribute>
sourcepub unsafe fn back(&self) -> Ref<QXmlStreamAttribute>
pub unsafe fn back(&self) -> Ref<QXmlStreamAttribute>
This is an overloaded function.
Calls C++ function: const QXmlStreamAttribute& QVector<QXmlStreamAttribute>::back() const
.
This is an overloaded function.
sourcepub unsafe fn capacity(&self) -> c_int
pub unsafe fn capacity(&self) -> c_int
Returns the maximum number of items that can be stored in the vector without forcing a reallocation.
Calls C++ function: int QVector<QXmlStreamAttribute>::capacity() const
.
Returns the maximum number of items that can be stored in the vector without forcing a reallocation.
The sole purpose of this function is to provide a means of fine tuning QVector's memory usage. In general, you will rarely ever need to call this function. If you want to know how many items are in the vector, call size().
sourcepub unsafe fn clear(&self)
pub unsafe fn clear(&self)
Removes all the elements from the vector.
Calls C++ function: void QVector<QXmlStreamAttribute>::clear()
.
Removes all the elements from the vector.
Note: Until Qt 5.6, this also released the memory used by the vector. From Qt 5.7, the capacity is preserved. To shed all capacity, swap with a default-constructed vector:
QVector<T> v ...; QVector<T>().swap(v); Q_ASSERT(v.capacity() == 0);
or call squeeze().
See also squeeze().
sourcepub unsafe fn const_data(&self) -> Ptr<QXmlStreamAttribute>
pub unsafe fn const_data(&self) -> Ptr<QXmlStreamAttribute>
Returns a const pointer to the data stored in the vector. The pointer can be used to access the items in the vector. The pointer remains valid as long as the vector isn't reallocated.
Calls C++ function: const QXmlStreamAttribute* QVector<QXmlStreamAttribute>::constData() const
.
Returns a const pointer to the data stored in the vector. The pointer can be used to access the items in the vector. The pointer remains valid as long as the vector isn’t reallocated.
This function is mostly useful to pass a vector to a function that accepts a plain C++ array.
See also data() and operator[]().
sourcepub unsafe fn const_first(&self) -> Ref<QXmlStreamAttribute>
pub unsafe fn const_first(&self) -> Ref<QXmlStreamAttribute>
Returns a const reference to the first item in the vector. This function assumes that the vector isn't empty.
Calls C++ function: const QXmlStreamAttribute& QVector<QXmlStreamAttribute>::constFirst() const
.
sourcepub unsafe fn const_last(&self) -> Ref<QXmlStreamAttribute>
pub unsafe fn const_last(&self) -> Ref<QXmlStreamAttribute>
Returns a const reference to the last item in the vector. This function assumes that the vector isn't empty.
Calls C++ function: const QXmlStreamAttribute& QVector<QXmlStreamAttribute>::constLast() const
.
Returns a const reference to the last item in the vector. This function assumes that the vector isn’t empty.
This function was introduced in Qt 5.6.
See also constFirst(), isEmpty(), and last().
sourcepub unsafe fn contains(
&self,
t: impl CastInto<Ref<QXmlStreamAttribute>>
) -> bool
pub unsafe fn contains( &self, t: impl CastInto<Ref<QXmlStreamAttribute>> ) -> bool
Returns true
if the vector contains an occurrence of value; otherwise returns false
.
Calls C++ function: bool QVector<QXmlStreamAttribute>::contains(const QXmlStreamAttribute& t) const
.
sourcepub unsafe fn copy_from(
&self,
v: impl CastInto<Ref<QVectorOfQXmlStreamAttribute>>
) -> Ref<QVectorOfQXmlStreamAttribute>
pub unsafe fn copy_from( &self, v: impl CastInto<Ref<QVectorOfQXmlStreamAttribute>> ) -> Ref<QVectorOfQXmlStreamAttribute>
Assigns other to this vector and returns a reference to this vector.
Calls C++ function: QVector<QXmlStreamAttribute>& QVector<QXmlStreamAttribute>::operator=(const QVector<QXmlStreamAttribute>& v)
.
Assigns other to this vector and returns a reference to this vector.
sourcepub unsafe fn count_1a(
&self,
t: impl CastInto<Ref<QXmlStreamAttribute>>
) -> c_int
pub unsafe fn count_1a( &self, t: impl CastInto<Ref<QXmlStreamAttribute>> ) -> c_int
Returns the number of occurrences of value in the vector.
Calls C++ function: int QVector<QXmlStreamAttribute>::count(const QXmlStreamAttribute& t) const
.
sourcepub unsafe fn count_0a(&self) -> c_int
pub unsafe fn count_0a(&self) -> c_int
This is an overloaded function.
Calls C++ function: int QVector<QXmlStreamAttribute>::count() const
.
This is an overloaded function.
Same as size().
sourcepub unsafe fn data_mut(&self) -> Ptr<QXmlStreamAttribute>
pub unsafe fn data_mut(&self) -> Ptr<QXmlStreamAttribute>
Returns a pointer to the data stored in the vector. The pointer can be used to access and modify the items in the vector.
Calls C++ function: QXmlStreamAttribute* QVector<QXmlStreamAttribute>::data()
.
Returns a pointer to the data stored in the vector. The pointer can be used to access and modify the items in the vector.
Example:
QVector<int> vector(10); int data = vector.data(); for (int i = 0; i < 10; ++i) data[i] = 2 i;
The pointer remains valid as long as the vector isn't reallocated.
This function is mostly useful to pass a vector to a function that accepts a plain C++ array.
See also constData() and operator[]().
sourcepub unsafe fn data(&self) -> Ptr<QXmlStreamAttribute>
pub unsafe fn data(&self) -> Ptr<QXmlStreamAttribute>
This is an overloaded function.
Calls C++ function: const QXmlStreamAttribute* QVector<QXmlStreamAttribute>::data() const
.
This is an overloaded function.
sourcepub unsafe fn empty(&self) -> bool
pub unsafe fn empty(&self) -> bool
This function is provided for STL compatibility. It is equivalent to isEmpty(), returning true
if the vector is empty; otherwise returns false
.
Calls C++ function: bool QVector<QXmlStreamAttribute>::empty() const
.
This function is provided for STL compatibility. It is equivalent to isEmpty(), returning true
if the vector is empty; otherwise returns false
.
sourcepub unsafe fn ends_with(
&self,
t: impl CastInto<Ref<QXmlStreamAttribute>>
) -> bool
pub unsafe fn ends_with( &self, t: impl CastInto<Ref<QXmlStreamAttribute>> ) -> bool
Returns true
if this vector is not empty and its last item is equal to value; otherwise returns false
.
Calls C++ function: bool QVector<QXmlStreamAttribute>::endsWith(const QXmlStreamAttribute& t) const
.
sourcepub unsafe fn fill_2a(
&self,
t: impl CastInto<Ref<QXmlStreamAttribute>>,
size: c_int
) -> Ref<QVectorOfQXmlStreamAttribute>
pub unsafe fn fill_2a( &self, t: impl CastInto<Ref<QXmlStreamAttribute>>, size: c_int ) -> Ref<QVectorOfQXmlStreamAttribute>
Assigns value to all items in the vector. If size is different from -1 (the default), the vector is resized to size size beforehand.
Calls C++ function: QVector<QXmlStreamAttribute>& QVector<QXmlStreamAttribute>::fill(const QXmlStreamAttribute& t, int size = …)
.
Assigns value to all items in the vector. If size is different from -1 (the default), the vector is resized to size size beforehand.
Example:
QVector<QString> vector(3); vector.fill(“Yes”); // vector: [“Yes”, “Yes”, “Yes”]
vector.fill(“oh”, 5); // vector: [“oh”, “oh”, “oh”, “oh”, “oh”]
See also resize().
sourcepub unsafe fn fill_1a(
&self,
t: impl CastInto<Ref<QXmlStreamAttribute>>
) -> Ref<QVectorOfQXmlStreamAttribute>
pub unsafe fn fill_1a( &self, t: impl CastInto<Ref<QXmlStreamAttribute>> ) -> Ref<QVectorOfQXmlStreamAttribute>
Assigns value to all items in the vector. If size is different from -1 (the default), the vector is resized to size size beforehand.
Calls C++ function: QVector<QXmlStreamAttribute>& QVector<QXmlStreamAttribute>::fill(const QXmlStreamAttribute& t)
.
Assigns value to all items in the vector. If size is different from -1 (the default), the vector is resized to size size beforehand.
Example:
QVector<QString> vector(3); vector.fill(“Yes”); // vector: [“Yes”, “Yes”, “Yes”]
vector.fill(“oh”, 5); // vector: [“oh”, “oh”, “oh”, “oh”, “oh”]
See also resize().
sourcepub unsafe fn first_mut(&self) -> Ref<QXmlStreamAttribute>
pub unsafe fn first_mut(&self) -> Ref<QXmlStreamAttribute>
Returns a reference to the first item in the vector. This function assumes that the vector isn't empty.
Calls C++ function: QXmlStreamAttribute& QVector<QXmlStreamAttribute>::first()
.
Returns a reference to the first item in the vector. This function assumes that the vector isn’t empty.
See also last(), isEmpty(), and constFirst().
sourcepub unsafe fn first(&self) -> Ref<QXmlStreamAttribute>
pub unsafe fn first(&self) -> Ref<QXmlStreamAttribute>
This is an overloaded function.
Calls C++ function: const QXmlStreamAttribute& QVector<QXmlStreamAttribute>::first() const
.
This is an overloaded function.
sourcepub unsafe fn front_mut(&self) -> Ref<QXmlStreamAttribute>
pub unsafe fn front_mut(&self) -> Ref<QXmlStreamAttribute>
sourcepub unsafe fn front(&self) -> Ref<QXmlStreamAttribute>
pub unsafe fn front(&self) -> Ref<QXmlStreamAttribute>
This is an overloaded function.
Calls C++ function: const QXmlStreamAttribute& QVector<QXmlStreamAttribute>::front() const
.
This is an overloaded function.
sourcepub unsafe fn index_mut(&self, i: c_int) -> Ref<QXmlStreamAttribute>
pub unsafe fn index_mut(&self, i: c_int) -> Ref<QXmlStreamAttribute>
Returns the item at index position i as a modifiable reference.
Calls C++ function: QXmlStreamAttribute& QVector<QXmlStreamAttribute>::operator[](int i)
.
sourcepub unsafe fn index(&self, i: c_int) -> Ref<QXmlStreamAttribute>
pub unsafe fn index(&self, i: c_int) -> Ref<QXmlStreamAttribute>
This is an overloaded function.
Calls C++ function: const QXmlStreamAttribute& QVector<QXmlStreamAttribute>::operator[](int i) const
.
This is an overloaded function.
Same as at(i).
sourcepub unsafe fn index_of_2a(
&self,
t: impl CastInto<Ref<QXmlStreamAttribute>>,
from: c_int
) -> c_int
pub unsafe fn index_of_2a( &self, t: impl CastInto<Ref<QXmlStreamAttribute>>, from: c_int ) -> c_int
Returns the index position of the first occurrence of value in the vector, searching forward from index position from. Returns -1 if no item matched.
Calls C++ function: int QVector<QXmlStreamAttribute>::indexOf(const QXmlStreamAttribute& t, int from = …) const
.
Returns the index position of the first occurrence of value in the vector, searching forward from index position from. Returns -1 if no item matched.
Example:
QVector<QString> vector; vector << “A” << “B” << “C” << “B” << “A”; vector.indexOf(“B”); // returns 1 vector.indexOf(“B”, 1); // returns 1 vector.indexOf(“B”, 2); // returns 3 vector.indexOf(“X”); // returns -1
This function requires the value type to have an implementation of operator==()
.
See also lastIndexOf() and contains().
sourcepub unsafe fn index_of_1a(
&self,
t: impl CastInto<Ref<QXmlStreamAttribute>>
) -> c_int
pub unsafe fn index_of_1a( &self, t: impl CastInto<Ref<QXmlStreamAttribute>> ) -> c_int
Returns the index position of the first occurrence of value in the vector, searching forward from index position from. Returns -1 if no item matched.
Calls C++ function: int QVector<QXmlStreamAttribute>::indexOf(const QXmlStreamAttribute& t) const
.
Returns the index position of the first occurrence of value in the vector, searching forward from index position from. Returns -1 if no item matched.
Example:
QVector<QString> vector; vector << “A” << “B” << “C” << “B” << “A”; vector.indexOf(“B”); // returns 1 vector.indexOf(“B”, 1); // returns 1 vector.indexOf(“B”, 2); // returns 3 vector.indexOf(“X”); // returns -1
This function requires the value type to have an implementation of operator==()
.
See also lastIndexOf() and contains().
sourcepub unsafe fn insert_2a(
&self,
i: c_int,
t: impl CastInto<Ref<QXmlStreamAttribute>>
)
pub unsafe fn insert_2a( &self, i: c_int, t: impl CastInto<Ref<QXmlStreamAttribute>> )
Inserts value at index position i in the vector. If i is 0, the value is prepended to the vector. If i is size(), the value is appended to the vector.
Calls C++ function: void QVector<QXmlStreamAttribute>::insert(int i, const QXmlStreamAttribute& t)
.
Inserts value at index position i in the vector. If i is 0, the value is prepended to the vector. If i is size(), the value is appended to the vector.
Example:
QVector<QString> vector; vector << “alpha” << “beta” << “delta”; vector.insert(2, “gamma”); // vector: [“alpha”, “beta”, “gamma”, “delta”]
For large vectors, this operation can be slow (linear time), because it requires moving all the items at indexes i and above by one position further in memory. If you want a container class that provides a fast insert() function, use QLinkedList instead.
sourcepub unsafe fn insert_3a(
&self,
i: c_int,
n: c_int,
t: impl CastInto<Ref<QXmlStreamAttribute>>
)
pub unsafe fn insert_3a( &self, i: c_int, n: c_int, t: impl CastInto<Ref<QXmlStreamAttribute>> )
This is an overloaded function.
Calls C++ function: void QVector<QXmlStreamAttribute>::insert(int i, int n, const QXmlStreamAttribute& t)
.
This is an overloaded function.
Inserts count copies of value at index position i in the vector.
Example:
QVector<double> vector; vector << 2.718 << 1.442 << 0.4342; vector.insert(1, 3, 9.9); // vector: [2.718, 9.9, 9.9, 9.9, 1.442, 0.4342]
sourcepub unsafe fn is_detached(&self) -> bool
pub unsafe fn is_detached(&self) -> bool
Calls C++ function: bool QVector<QXmlStreamAttribute>::isDetached() const
.
sourcepub unsafe fn is_empty(&self) -> bool
pub unsafe fn is_empty(&self) -> bool
Returns true
if the vector has size 0; otherwise returns false
.
Calls C++ function: bool QVector<QXmlStreamAttribute>::isEmpty() const
.
Calls C++ function: bool QVector<QXmlStreamAttribute>::isSharedWith(const QVector<QXmlStreamAttribute>& other) const
.
sourcepub unsafe fn last_mut(&self) -> Ref<QXmlStreamAttribute>
pub unsafe fn last_mut(&self) -> Ref<QXmlStreamAttribute>
Returns a reference to the last item in the vector. This function assumes that the vector isn't empty.
Calls C++ function: QXmlStreamAttribute& QVector<QXmlStreamAttribute>::last()
.
sourcepub unsafe fn last(&self) -> Ref<QXmlStreamAttribute>
pub unsafe fn last(&self) -> Ref<QXmlStreamAttribute>
This is an overloaded function.
Calls C++ function: const QXmlStreamAttribute& QVector<QXmlStreamAttribute>::last() const
.
This is an overloaded function.
sourcepub unsafe fn last_index_of_2a(
&self,
t: impl CastInto<Ref<QXmlStreamAttribute>>,
from: c_int
) -> c_int
pub unsafe fn last_index_of_2a( &self, t: impl CastInto<Ref<QXmlStreamAttribute>>, from: c_int ) -> c_int
Returns the index position of the last occurrence of the value value in the vector, searching backward from index position from. If from is -1 (the default), the search starts at the last item. Returns -1 if no item matched.
Calls C++ function: int QVector<QXmlStreamAttribute>::lastIndexOf(const QXmlStreamAttribute& t, int from = …) const
.
Returns the index position of the last occurrence of the value value in the vector, searching backward from index position from. If from is -1 (the default), the search starts at the last item. Returns -1 if no item matched.
Example:
QList<QString> vector; vector << “A” << “B” << “C” << “B” << “A”; vector.lastIndexOf(“B”); // returns 3 vector.lastIndexOf(“B”, 3); // returns 3 vector.lastIndexOf(“B”, 2); // returns 1 vector.lastIndexOf(“X”); // returns -1
This function requires the value type to have an implementation of operator==()
.
See also indexOf().
sourcepub unsafe fn last_index_of_1a(
&self,
t: impl CastInto<Ref<QXmlStreamAttribute>>
) -> c_int
pub unsafe fn last_index_of_1a( &self, t: impl CastInto<Ref<QXmlStreamAttribute>> ) -> c_int
Returns the index position of the last occurrence of the value value in the vector, searching backward from index position from. If from is -1 (the default), the search starts at the last item. Returns -1 if no item matched.
Calls C++ function: int QVector<QXmlStreamAttribute>::lastIndexOf(const QXmlStreamAttribute& t) const
.
Returns the index position of the last occurrence of the value value in the vector, searching backward from index position from. If from is -1 (the default), the search starts at the last item. Returns -1 if no item matched.
Example:
QList<QString> vector; vector << “A” << “B” << “C” << “B” << “A”; vector.lastIndexOf(“B”); // returns 3 vector.lastIndexOf(“B”, 3); // returns 3 vector.lastIndexOf(“B”, 2); // returns 1 vector.lastIndexOf(“X”); // returns -1
This function requires the value type to have an implementation of operator==()
.
See also indexOf().
sourcepub unsafe fn length(&self) -> c_int
pub unsafe fn length(&self) -> c_int
Calls C++ function: int QVector<QXmlStreamAttribute>::length() const
.
sourcepub unsafe fn mid_2a(
&self,
pos: c_int,
len: c_int
) -> CppBox<QVectorOfQXmlStreamAttribute>
pub unsafe fn mid_2a( &self, pos: c_int, len: c_int ) -> CppBox<QVectorOfQXmlStreamAttribute>
Returns a sub-vector which contains elements from this vector, starting at position pos. If length is -1 (the default), all elements after pos are included; otherwise length elements (or all remaining elements if there are less than length elements) are included.
Calls C++ function: QVector<QXmlStreamAttribute> QVector<QXmlStreamAttribute>::mid(int pos, int len = …) const
.
Returns a sub-vector which contains elements from this vector, starting at position pos. If length is -1 (the default), all elements after pos are included; otherwise length elements (or all remaining elements if there are less than length elements) are included.
sourcepub unsafe fn mid_1a(&self, pos: c_int) -> CppBox<QVectorOfQXmlStreamAttribute>
pub unsafe fn mid_1a(&self, pos: c_int) -> CppBox<QVectorOfQXmlStreamAttribute>
Returns a sub-vector which contains elements from this vector, starting at position pos. If length is -1 (the default), all elements after pos are included; otherwise length elements (or all remaining elements if there are less than length elements) are included.
Calls C++ function: QVector<QXmlStreamAttribute> QVector<QXmlStreamAttribute>::mid(int pos) const
.
Returns a sub-vector which contains elements from this vector, starting at position pos. If length is -1 (the default), all elements after pos are included; otherwise length elements (or all remaining elements if there are less than length elements) are included.
sourcepub unsafe fn move_(&self, from: c_int, to: c_int)
pub unsafe fn move_(&self, from: c_int, to: c_int)
Moves the item at index position from to index position to.
Calls C++ function: void QVector<QXmlStreamAttribute>::move(int from, int to)
.
Moves the item at index position from to index position to.
Provided for compatibility with QList.
This function was introduced in Qt 5.6.
See also QList::move().
sourcepub unsafe fn pop_back(&self)
pub unsafe fn pop_back(&self)
This function is provided for STL compatibility. It is equivalent to removeLast().
Calls C++ function: void QVector<QXmlStreamAttribute>::pop_back()
.
This function is provided for STL compatibility. It is equivalent to removeLast().
sourcepub unsafe fn pop_front(&self)
pub unsafe fn pop_front(&self)
This function is provided for STL compatibility. It is equivalent to removeFirst().
Calls C++ function: void QVector<QXmlStreamAttribute>::pop_front()
.
This function is provided for STL compatibility. It is equivalent to removeFirst().
sourcepub unsafe fn prepend(&self, t: impl CastInto<Ref<QXmlStreamAttribute>>)
pub unsafe fn prepend(&self, t: impl CastInto<Ref<QXmlStreamAttribute>>)
Inserts value at the beginning of the vector.
Calls C++ function: void QVector<QXmlStreamAttribute>::prepend(const QXmlStreamAttribute& t)
.
Inserts value at the beginning of the vector.
Example:
QVector<QString> vector; vector.prepend(“one”); vector.prepend(“two”); vector.prepend(“three”); // vector: [“three”, “two”, “one”]
This is the same as vector.insert(0, value).
For large vectors, this operation can be slow (linear time), because it requires moving all the items in the vector by one position further in memory. If you want a container class that provides a fast prepend() function, use QList or QLinkedList instead.
sourcepub unsafe fn push_back(&self, t: impl CastInto<Ref<QXmlStreamAttribute>>)
pub unsafe fn push_back(&self, t: impl CastInto<Ref<QXmlStreamAttribute>>)
This function is provided for STL compatibility. It is equivalent to append(value).
Calls C++ function: void QVector<QXmlStreamAttribute>::push_back(const QXmlStreamAttribute& t)
.
This function is provided for STL compatibility. It is equivalent to append(value).
sourcepub unsafe fn push_front(&self, t: impl CastInto<Ref<QXmlStreamAttribute>>)
pub unsafe fn push_front(&self, t: impl CastInto<Ref<QXmlStreamAttribute>>)
This function is provided for STL compatibility. It is equivalent to prepend(value).
Calls C++ function: void QVector<QXmlStreamAttribute>::push_front(const QXmlStreamAttribute& t)
.
This function is provided for STL compatibility. It is equivalent to prepend(value).
sourcepub unsafe fn remove_1a(&self, i: c_int)
pub unsafe fn remove_1a(&self, i: c_int)
This is an overloaded function.
Calls C++ function: void QVector<QXmlStreamAttribute>::remove(int i)
.
sourcepub unsafe fn remove_2a(&self, i: c_int, n: c_int)
pub unsafe fn remove_2a(&self, i: c_int, n: c_int)
This is an overloaded function.
Calls C++ function: void QVector<QXmlStreamAttribute>::remove(int i, int n)
.
sourcepub unsafe fn remove_all(
&self,
t: impl CastInto<Ref<QXmlStreamAttribute>>
) -> c_int
pub unsafe fn remove_all( &self, t: impl CastInto<Ref<QXmlStreamAttribute>> ) -> c_int
Removes all elements that compare equal to t from the vector. Returns the number of elements removed, if any.
Calls C++ function: int QVector<QXmlStreamAttribute>::removeAll(const QXmlStreamAttribute& t)
.
Removes all elements that compare equal to t from the vector. Returns the number of elements removed, if any.
Provided for compatibility with QList.
This function was introduced in Qt 5.4.
See also removeOne() and QList::removeAll().
sourcepub unsafe fn remove_at(&self, i: c_int)
pub unsafe fn remove_at(&self, i: c_int)
Removes the element at index position i. Equivalent to
Calls C++ function: void QVector<QXmlStreamAttribute>::removeAt(int i)
.
Removes the element at index position i. Equivalent to
remove(i);
Provided for compatibility with QList.
This function was introduced in Qt 5.2.
See also remove() and QList::removeAt().
sourcepub unsafe fn remove_first(&self)
pub unsafe fn remove_first(&self)
Removes the first item in the vector. Calling this function is equivalent to calling remove(0). The vector must not be empty. If the vector can be empty, call isEmpty() before calling this function.
Calls C++ function: void QVector<QXmlStreamAttribute>::removeFirst()
.
sourcepub unsafe fn remove_last(&self)
pub unsafe fn remove_last(&self)
Removes the last item in the vector. Calling this function is equivalent to calling remove(size() - 1). The vector must not be empty. If the vector can be empty, call isEmpty() before calling this function.
Calls C++ function: void QVector<QXmlStreamAttribute>::removeLast()
.
Removes the last item in the vector. Calling this function is equivalent to calling remove(size() - 1). The vector must not be empty. If the vector can be empty, call isEmpty() before calling this function.
This function was introduced in Qt 5.1.
See also remove(), takeLast(), removeFirst(), and isEmpty().
sourcepub unsafe fn remove_one(
&self,
t: impl CastInto<Ref<QXmlStreamAttribute>>
) -> bool
pub unsafe fn remove_one( &self, t: impl CastInto<Ref<QXmlStreamAttribute>> ) -> bool
Removes the first element that compares equal to t from the vector. Returns whether an element was, in fact, removed.
Calls C++ function: bool QVector<QXmlStreamAttribute>::removeOne(const QXmlStreamAttribute& t)
.
Removes the first element that compares equal to t from the vector. Returns whether an element was, in fact, removed.
Provided for compatibility with QList.
This function was introduced in Qt 5.4.
See also removeAll() and QList::removeOne().
sourcepub unsafe fn replace(
&self,
i: c_int,
t: impl CastInto<Ref<QXmlStreamAttribute>>
)
pub unsafe fn replace( &self, i: c_int, t: impl CastInto<Ref<QXmlStreamAttribute>> )
Replaces the item at index position i with value.
Calls C++ function: void QVector<QXmlStreamAttribute>::replace(int i, const QXmlStreamAttribute& t)
.
Replaces the item at index position i with value.
i must be a valid index position in the vector (i.e., 0 <= i < size()).
See also operator[]() and remove().
sourcepub unsafe fn reserve(&self, size: c_int)
pub unsafe fn reserve(&self, size: c_int)
Attempts to allocate memory for at least size elements. If you know in advance how large the vector will be, you should call this function to prevent reallocations and memory fragmentation.
Calls C++ function: void QVector<QXmlStreamAttribute>::reserve(int size)
.
Attempts to allocate memory for at least size elements. If you know in advance how large the vector will be, you should call this function to prevent reallocations and memory fragmentation.
If size is an underestimate, the worst that will happen is that the QVector will be a bit slower. If size is an overestimate, you may have used more memory than the normal QVector growth strategy would have allocated—or you may have used less.
An alternative to reserve() is calling resize(). Whether or not that is faster than reserve() depends on the element type, because resize() default-constructs all elements, and requires assignment to existing entries rather than calling append(), which copy- or move-constructs. For simple types, like int
or double
, resize() is typically faster, but for anything more complex, you should prefer reserve().
Warning: If the size passed to resize() was underestimated, you run out of allocated space and into undefined behavior. This problem does not exist with reserve(), because it treats the size as just a hint.
sourcepub unsafe fn resize(&self, size: c_int)
pub unsafe fn resize(&self, size: c_int)
Sets the size of the vector to size. If size is greater than the current size, elements are added to the end; the new elements are initialized with a default-constructed value. If size is less than the current size, elements are removed from the end.
Calls C++ function: void QVector<QXmlStreamAttribute>::resize(int size)
.
Sets the size of the vector to size. If size is greater than the current size, elements are added to the end; the new elements are initialized with a default-constructed value. If size is less than the current size, elements are removed from the end.
Since Qt 5.6, resize() doesn't shrink the capacity anymore. To shed excess capacity, use squeeze().
See also size().
sourcepub unsafe fn set_sharable(&self, sharable: bool)
pub unsafe fn set_sharable(&self, sharable: bool)
Calls C++ function: void QVector<QXmlStreamAttribute>::setSharable(bool sharable)
.
sourcepub unsafe fn shrink_to_fit(&self)
Available on cpp_lib_version="5.11.3"
or cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn shrink_to_fit(&self)
cpp_lib_version="5.11.3"
or cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.sourcepub unsafe fn size(&self) -> c_int
pub unsafe fn size(&self) -> c_int
Returns the number of items in the vector.
Calls C++ function: int QVector<QXmlStreamAttribute>::size() const
.
sourcepub unsafe fn squeeze(&self)
pub unsafe fn squeeze(&self)
Releases any memory not required to store the items.
Calls C++ function: void QVector<QXmlStreamAttribute>::squeeze()
.
sourcepub unsafe fn starts_with(
&self,
t: impl CastInto<Ref<QXmlStreamAttribute>>
) -> bool
pub unsafe fn starts_with( &self, t: impl CastInto<Ref<QXmlStreamAttribute>> ) -> bool
Returns true
if this vector is not empty and its first item is equal to value; otherwise returns false
.
Calls C++ function: bool QVector<QXmlStreamAttribute>::startsWith(const QXmlStreamAttribute& t) const
.
sourcepub unsafe fn swap(
&self,
other: impl CastInto<Ref<QVectorOfQXmlStreamAttribute>>
)
pub unsafe fn swap( &self, other: impl CastInto<Ref<QVectorOfQXmlStreamAttribute>> )
Swaps vector other with this vector. This operation is very fast and never fails.
Calls C++ function: void QVector<QXmlStreamAttribute>::swap(QVector<QXmlStreamAttribute>& other)
.
Swaps vector other with this vector. This operation is very fast and never fails.
This function was introduced in Qt 4.8.
sourcepub unsafe fn swap_items_at(&self, i: c_int, j: c_int)
Available on cpp_lib_version="5.14.0"
only.
pub unsafe fn swap_items_at(&self, i: c_int, j: c_int)
cpp_lib_version="5.14.0"
only.Exchange the item at index position i with the item at index position j. This function assumes that both i and j are at least 0 but less than size(). To avoid failure, test that both i and j are at least 0 and less than size().
Calls C++ function: void QVector<QXmlStreamAttribute>::swapItemsAt(int i, int j)
.
sourcepub unsafe fn take_at(&self, i: c_int) -> CppBox<QXmlStreamAttribute>
pub unsafe fn take_at(&self, i: c_int) -> CppBox<QXmlStreamAttribute>
Removes the element at index position i and returns it.
Calls C++ function: QXmlStreamAttribute QVector<QXmlStreamAttribute>::takeAt(int i)
.
Removes the element at index position i and returns it.
Equivalent to
T t = at(i); remove(i); return t;
Provided for compatibility with QList.
This function was introduced in Qt 5.2.
See also takeFirst(), takeLast(), and QList::takeAt().
sourcepub unsafe fn take_first(&self) -> CppBox<QXmlStreamAttribute>
pub unsafe fn take_first(&self) -> CppBox<QXmlStreamAttribute>
Removes the first item in the vector and returns it. This function assumes the vector is not empty. To avoid failure, call isEmpty() before calling this function.
Calls C++ function: QXmlStreamAttribute QVector<QXmlStreamAttribute>::takeFirst()
.
Removes the first item in the vector and returns it. This function assumes the vector is not empty. To avoid failure, call isEmpty() before calling this function.
This function was introduced in Qt 5.1.
See also takeLast() and removeFirst().
sourcepub unsafe fn take_last(&self) -> CppBox<QXmlStreamAttribute>
pub unsafe fn take_last(&self) -> CppBox<QXmlStreamAttribute>
Removes the last item in the list and returns it. This function assumes the vector is not empty. To avoid failure, call isEmpty() before calling this function.
Calls C++ function: QXmlStreamAttribute QVector<QXmlStreamAttribute>::takeLast()
.
Removes the last item in the list and returns it. This function assumes the vector is not empty. To avoid failure, call isEmpty() before calling this function.
If you don't use the return value, removeLast() is more efficient.
This function was introduced in Qt 5.1.
See also takeFirst() and removeLast().
sourcepub unsafe fn value_1a(&self, i: c_int) -> CppBox<QXmlStreamAttribute>
pub unsafe fn value_1a(&self, i: c_int) -> CppBox<QXmlStreamAttribute>
Returns the value at index position i in the vector.
Calls C++ function: QXmlStreamAttribute QVector<QXmlStreamAttribute>::value(int i) const
.
Returns the value at index position i in the vector.
If the index i is out of bounds, the function returns a default-constructed value. If you are certain that i is within bounds, you can use at() instead, which is slightly faster.
See also at() and operator[]().
sourcepub unsafe fn value_2a(
&self,
i: c_int,
default_value: impl CastInto<Ref<QXmlStreamAttribute>>
) -> CppBox<QXmlStreamAttribute>
pub unsafe fn value_2a( &self, i: c_int, default_value: impl CastInto<Ref<QXmlStreamAttribute>> ) -> CppBox<QXmlStreamAttribute>
This is an overloaded function.
Calls C++ function: QXmlStreamAttribute QVector<QXmlStreamAttribute>::value(int i, const QXmlStreamAttribute& defaultValue) const
.
This is an overloaded function.
If the index i is out of bounds, the function returns defaultValue.
Trait Implementations§
source§impl CppDeletable for QXmlStreamAttributes
impl CppDeletable for QXmlStreamAttributes
source§unsafe fn delete(&self)
unsafe fn delete(&self)
The QXmlStreamAttributes class represents a vector of QXmlStreamAttribute.
Calls C++ function: [destructor] void QXmlStreamAttributes::~QXmlStreamAttributes()
.
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().
source§impl Deref for QXmlStreamAttributes
impl Deref for QXmlStreamAttributes
source§fn deref(&self) -> &QVectorOfQXmlStreamAttribute
fn deref(&self) -> &QVectorOfQXmlStreamAttribute
Calls C++ function: QVector<QXmlStreamAttribute>* static_cast<QVector<QXmlStreamAttribute>*>(QXmlStreamAttributes* ptr)
.
§type Target = QVectorOfQXmlStreamAttribute
type Target = QVectorOfQXmlStreamAttribute
source§impl StaticDowncast<QXmlStreamAttributes> for QVectorOfQXmlStreamAttribute
impl StaticDowncast<QXmlStreamAttributes> for QVectorOfQXmlStreamAttribute
source§unsafe fn static_downcast(
ptr: Ptr<QVectorOfQXmlStreamAttribute>
) -> Ptr<QXmlStreamAttributes>
unsafe fn static_downcast( ptr: Ptr<QVectorOfQXmlStreamAttribute> ) -> Ptr<QXmlStreamAttributes>
Calls C++ function: QXmlStreamAttributes* static_cast<QXmlStreamAttributes*>(QVector<QXmlStreamAttribute>* ptr)
.
source§impl StaticUpcast<QVectorOfQXmlStreamAttribute> for QXmlStreamAttributes
impl StaticUpcast<QVectorOfQXmlStreamAttribute> for QXmlStreamAttributes
source§unsafe fn static_upcast(
ptr: Ptr<QXmlStreamAttributes>
) -> Ptr<QVectorOfQXmlStreamAttribute>
unsafe fn static_upcast( ptr: Ptr<QXmlStreamAttributes> ) -> Ptr<QVectorOfQXmlStreamAttribute>
Calls C++ function: QVector<QXmlStreamAttribute>* static_cast<QVector<QXmlStreamAttribute>*>(QXmlStreamAttributes* ptr)
.