![]() |
Qt 6.x
The Qt SDK
|
\inmodule QtCore More...
#include <qcborarray.h>
Public Types | |
typedef std::random_access_iterator_tag | iterator_category |
A synonym for {std::random_access_iterator_tag} indicating this iterator is a random access iterator. | |
typedef qsizetype | difference_type |
typedef const QCborValue | value_type |
typedef const QCborValueRef | reference |
typedef const QCborValueRef * | pointer |
Public Member Functions | |
constexpr | ConstIterator ()=default |
Constructs an uninitialized iterator. | |
constexpr | ConstIterator (const ConstIterator &)=default |
Constructs a copy of other. | |
ConstIterator & | operator= (const ConstIterator &other) |
Makes this iterator a copy of other and returns a reference to this iterator. | |
QCborValueConstRef | operator* () const |
Returns the current item. | |
const QCborValueConstRef * | operator-> () const |
Returns a pointer to the current item. | |
QCborValueConstRef | operator[] (qsizetype j) const |
Returns the item at a position j steps forward from the item pointed to by this iterator. | |
bool | operator== (const Iterator &o) const |
bool | operator!= (const Iterator &o) const |
bool | operator< (const Iterator &other) const |
bool | operator<= (const Iterator &other) const |
bool | operator> (const Iterator &other) const |
bool | operator>= (const Iterator &other) const |
bool | operator== (const ConstIterator &o) const |
Returns true if other points to the same entry in the array as this iterator; otherwise returns false . | |
bool | operator!= (const ConstIterator &o) const |
Returns true if o points to a different entry in the array than this iterator; otherwise returns false . | |
bool | operator< (const ConstIterator &other) const |
Returns true if the entry in the array pointed to by this iterator occurs before the entry pointed to by the other iterator. | |
bool | operator<= (const ConstIterator &other) const |
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. | |
bool | operator> (const ConstIterator &other) const |
Returns true if the entry in the array pointed to by this iterator occurs after the entry pointed to by the other iterator. | |
bool | operator>= (const ConstIterator &other) const |
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. | |
ConstIterator & | operator++ () |
The prefix {++} operator, {++it}, advances the iterator to the next item in the array and returns this iterator. | |
ConstIterator | operator++ (int) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.The postfix {++} operator, {it++}, advances the iterator to the next item in the array and returns an iterator to the previously current item. | |
ConstIterator & | operator-- () |
The prefix {–} operator, {–it}, makes the preceding item current and returns this iterator. | |
ConstIterator | operator-- (int) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.The postfix {–} operator, {it–}, makes the preceding item current and returns an iterator to the previously current item. | |
ConstIterator & | operator+= (qsizetype j) |
Advances the iterator by j positions. | |
ConstIterator & | operator-= (qsizetype j) |
Makes the iterator go back by j positions. | |
ConstIterator | operator+ (qsizetype j) const |
Returns an iterator to the item at a position j steps forward from this iterator. | |
ConstIterator | operator- (qsizetype j) const |
Returns an iterator to the item at a position j steps backward from this iterator. | |
qsizetype | operator- (ConstIterator j) const |
Returns the offset of this iterator relative to other. | |
Friends | |
class | Iterator |
class | QCborArray |
\inmodule QtCore
The QCborArray::ConstIterator class provides an STL-style const iterator for QCborArray.
QCborArray::ConstIterator allows you to iterate over a QCborArray. If you want to modify the QCborArray as you iterate over it, use QCborArray::Iterator instead. It is generally good practice to use QCborArray::ConstIterator, even on a non-const QCborArray, when you don't need to change the QCborArray through the iterator. Const iterators are slightly faster and improves code readability.
Iterators are initialized by using a QCborArray function like QCborArray::begin() or QCborArray::end(). 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 \l{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.
Definition at line 73 of file qcborarray.h.
Definition at line 80 of file qcborarray.h.
A synonym for {std::random_access_iterator_tag} indicating this iterator is a random access iterator.
Definition at line 79 of file qcborarray.h.
Definition at line 83 of file qcborarray.h.
Definition at line 82 of file qcborarray.h.
Definition at line 81 of file qcborarray.h.
|
constexprdefault |
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.
|
constexprdefault |
Constructs a copy of other.
|
inline |
Returns true
if o points to a different entry in the array than this iterator; otherwise returns false
.
Definition at line 106 of file qcborarray.h.
References o.
|
inline |
Definition at line 100 of file qcborarray.h.
References o.
|
inline |
|
inline |
Returns an iterator to the item at a position j steps forward from this iterator.
If j is negative, the iterator goes backward.
Definition at line 117 of file qcborarray.h.
|
inline |
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.
Definition at line 111 of file qcborarray.h.
References item.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.The postfix {++} operator,
{it++}, advances the iterator to the next item in the array and returns an iterator to the previously current item.
Definition at line 112 of file qcborarray.h.
References item.
|
inline |
Advances the iterator by j positions.
If j is negative, the iterator goes backward. Returns a reference to this iterator.
Definition at line 115 of file qcborarray.h.
|
inline |
Returns the offset of this iterator relative to other.
Definition at line 119 of file qcborarray.h.
|
inline |
Returns an iterator to the item at a position j steps backward from this iterator.
If j is negative, the iterator goes forward.
Definition at line 118 of file qcborarray.h.
|
inline |
The prefix {–} operator,
{–it}, makes the preceding item current and returns this iterator.
Calling this function on QCborArray::begin() leads to undefined results.
Definition at line 113 of file qcborarray.h.
References item.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.The postfix {–} operator,
{it–}, makes the preceding item current and returns an iterator to the previously current item.
Definition at line 114 of file qcborarray.h.
References item.
|
inline |
Makes the iterator go back by j positions.
If j is negative, the iterator goes forward. Returns a reference to this iterator.
Definition at line 116 of file qcborarray.h.
|
inline |
|
inline |
Returns true
if the entry in the array pointed to by this iterator occurs before the entry pointed to by the other iterator.
Definition at line 107 of file qcborarray.h.
References item, other(), and Q_ASSERT.
|
inline |
Definition at line 101 of file qcborarray.h.
References item, other(), and Q_ASSERT.
|
inline |
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.
Definition at line 108 of file qcborarray.h.
References item, other(), and Q_ASSERT.
|
inline |
Definition at line 102 of file qcborarray.h.
References item, other(), and Q_ASSERT.
|
inline |
Makes this iterator a copy of other and returns a reference to this iterator.
Definition at line 87 of file qcborarray.h.
|
inline |
Returns true
if other points to the same entry in the array as this iterator; otherwise returns false
.
Definition at line 105 of file qcborarray.h.
|
inline |
Definition at line 99 of file qcborarray.h.
|
inline |
Returns true
if the entry in the array pointed to by this iterator occurs after the entry pointed to by the other iterator.
Definition at line 109 of file qcborarray.h.
References item, other(), and Q_ASSERT.
|
inline |
Definition at line 103 of file qcborarray.h.
References item, other(), and Q_ASSERT.
|
inline |
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.
Definition at line 110 of file qcborarray.h.
References item, other(), and Q_ASSERT.
|
inline |
Definition at line 104 of file qcborarray.h.
References item, other(), and Q_ASSERT.
|
inline |
Returns 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.
Definition at line 97 of file qcborarray.h.
|
friend |
Definition at line 75 of file qcborarray.h.
|
friend |
Definition at line 76 of file qcborarray.h.