The QCborArray::Iterator class provides an STL-style non-const iterator for QCborArray. More...
This class was introduced in Qt 5.12.
typedef | iterator_category |
Iterator(const Iterator &other) | |
Iterator() | |
Iterator & | operator=(const Iterator &other) |
bool | operator!=(const Iterator &other) const |
bool | operator!=(const ConstIterator &other) const |
QCborValueRef | operator*() const |
Iterator | operator+(qsizetype j) const |
Iterator & | operator++() |
Iterator | operator++(int) |
Iterator & | operator+=(qsizetype j) |
Iterator | operator-(qsizetype j) const |
qsizetype | operator-(Iterator other) const |
Iterator & | operator--() |
Iterator | operator--(int) |
Iterator & | operator-=(qsizetype j) |
QCborValueRef * | operator->() const |
bool | operator<(const Iterator &other) const |
bool | operator<(const ConstIterator &other) const |
bool | operator<=(const Iterator &other) const |
bool | operator<=(const ConstIterator &other) const |
bool | operator==(const Iterator &other) const |
bool | operator==(const ConstIterator &other) const |
bool | operator>(const Iterator &other) const |
bool | operator>(const ConstIterator &other) const |
bool | operator>=(const Iterator &other) const |
bool | operator>=(const ConstIterator &other) const |
QCborValueRef | operator[](qsizetype j) |
QCborArray::Iterator allows you to iterate over a QCborArray and to modify the array item associated with the iterator. If you want to iterate over a const QCborArray, use QCborArray::ConstIterator instead. It is generally a good practice to use QCborArray::ConstIterator on a non-const QCborArray as well, unless you need to change the QCborArray through the iterator. Const iterators are slightly faster and improve code readability.
Iterators are initialized by using a QCborArray function like QCborArray::begin(), QCborArray::end(), or QCborArray::insert(). Iteration is only possible after that.
Most QCborArray functions accept an integer index rather than an iterator. For that reason, iterators are rarely useful in connection with QCborArray. One place where STL-style iterators do make sense is as arguments to generic algorithms.
Multiple iterators can be used on the same array. However, be aware that any non-const function call performed on the QCborArray will render all existing iterators undefined.
See also QCborArray::ConstIterator.
A synonym for std::random_access_iterator_tag indicating this iterator is a random access iterator.
Returns true
if the entry in the array pointed to by this iterator occurs after or is the same entry as is pointed to by the other iterator.
Returns true
if the entry in the array pointed to by this iterator occurs after the entry pointed to by the other iterator.
Returns true
if the entry in the array pointed to by this iterator occurs before or is the same entry as is pointed to by the other iterator.
Returns true
if the entry in the array pointed to by this iterator occurs before the entry pointed to by the other iterator.
Returns true
if other points to a different entry in the array than this iterator; otherwise returns false
.
See also operator==().
Returns true
if other points to the same entry in the array as this iterator; otherwise returns false
.
See also operator!=().
Makes a copy of other.
Constructs an uninitialized iterator.
Functions like operator*() and operator++() should not be called on an uninitialized iterator. Use operator=() to assign a value to it before using it.
See also QCborArray::begin() and QCborArray::end().
Makes this iterator a copy of other and returns a reference to this iterator.
Returns a modifiable reference to the current item.
You can change the value of an item by using operator*() on the left side of an assignment.
The return value is of type QCborValueRef, a helper class for QCborArray and QCborMap. When you get an object of type QCborValueRef, you can use it as if it were a reference to a QCborValue. If you assign to it, the assignment will apply to the element in the QCborArray or QCborMap from which you got the reference.
Returns an iterator to the item at position j steps forward from this iterator. If j is negative, the iterator goes backward.
See also operator-() and operator+=().
The prefix ++ operator, ++it
, advances the iterator to the next item in the array and returns this iterator.
Calling this function on QCborArray::end() leads to undefined results.
See also operator--().
This is an overloaded function.
The postfix ++ operator, it++
, advances the iterator to the next item in the array and returns an iterator to the previously current item.
Advances the iterator by j positions. If j is negative, the iterator goes backward. Returns a reference to this iterator.
See also operator-=() and operator+().
Returns an iterator to the item at position j steps backward from this iterator. If j is negative, the iterator goes forward.
See also operator+() and operator-=().
Returns the offset of this iterator relative to other.
The prefix -- operator, --it
, makes the preceding item current and returns this iterator.
Calling this function on QCborArray::begin() leads to undefined results.
See also operator++().
This is an overloaded function.
The postfix -- operator, it--
, makes the preceding item current and returns an iterator to the previously current item.
Makes the iterator go back by j positions. If j is negative, the iterator goes forward. Returns a reference to this iterator.
See also operator+=() and operator-().
Returns a pointer to a modifiable reference to the current item.
Returns a modifiable reference to the item at a position j steps forward from the item pointed to by this iterator.
This function is provided to make QCborArray iterators behave like C++ pointers.
The return value is of type QCborValueRef, a helper class for QCborArray and QCborMap. When you get an object of type QCborValueRef, you can use it as if it were a reference to a QCborValue. If you assign to it, the assignment will apply to the element in the QCborArray or QCborMap from which you got the reference.
See also operator+().
© The Qt Company Ltd
Licensed under the GNU Free Documentation License, Version 1.3.
https://doc.qt.io/qt-5.15/qcborarray-iterator.html