![]() |
Qt 6.x
The Qt SDK
|
\inmodule QtCore\reentrant More...
#include <qcbormap.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 QPair< QCborValueConstRef, QCborValueRef > | value_type |
typedef QPair< QCborValueConstRef, QCborValueRef > | reference |
typedef QPair< QCborValueConstRef, QCborValueRef > | pointer |
Public Member Functions | |
constexpr | Iterator ()=default |
Constructs an uninitialized iterator. | |
constexpr | Iterator (const Iterator &)=default |
Constructs an iterator as a copy of other. | |
Iterator & | operator= (const Iterator &other) |
Makes this iterator a copy of other and returns a reference to this iterator. | |
value_type | operator* () const |
Returns a pair containing the current item's key and a modifiable reference to the current item's value. | |
value_type | operator[] (qsizetype j) const |
QCborValueRef * | operator-> () |
const QCborValueConstRef * | operator-> () const |
Returns a pointer to a modifiable reference to the current pair's value. | |
QCborValueConstRef | key () const |
Returns the current item's key. | |
QCborValueRef | value () const |
Returns a modifiable reference to the current item's value. | |
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 map as this iterator; otherwise returns false . | |
bool | operator!= (const ConstIterator &o) const |
Returns true if other points to a different entry in the map than this iterator; otherwise returns false . | |
bool | operator< (const ConstIterator &other) const |
Returns true if the entry in the map 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 map 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 map 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 map pointed to by this iterator occurs after or is the same entry as is pointed to by the other iterator. | |
Iterator & | operator++ () |
The prefix {++} operator, {++i}, advances the iterator to the next item in the map and returns this iterator. | |
Iterator | 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, {i++}, advances the iterator to the next item in the map and returns an iterator to the previously current item. | |
Iterator & | operator-- () |
The prefix {–} operator, {–i}, makes the preceding item current and returns this iterator. | |
Iterator | 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, {i–}, makes the preceding item current and returns an iterator pointing to the previously current item. | |
Iterator & | operator+= (qsizetype j) |
Advances the iterator by j items. | |
Iterator & | operator-= (qsizetype j) |
Makes the iterator go back by j items. | |
Iterator | operator+ (qsizetype j) const |
Returns an iterator to the item at j positions forward from this iterator. | |
Iterator | operator- (qsizetype j) const |
Returns an iterator to the item at j positions backward from this iterator. | |
qsizetype | operator- (Iterator j) const |
Returns the position of the item at iterator j relative to the item at this iterator. | |
Friends | |
class | ConstIterator |
class | QCborMap |
\inmodule QtCore
\reentrant
The QCborMap::Iterator class provides an STL-style non-const iterator for QCborMap.
QCborMap::Iterator allows you to iterate over a QCborMap and to modify the value (but not the key) stored under a particular key. If you want to iterate over a const QCborMap, you should use QCborMap::ConstIterator. It is generally good practice to use QCborMap::ConstIterator on a non-const QCborMap as well, unless you need to change the QCborMap through the iterator. Const iterators are slightly faster, and improve code readability.
You must initialize the iterator using a QCborMap function like QCborMap::begin(), QCborMap::end(), or QCborMap::find() before you can start iterating..
Multiple iterators can be used on the same object. Existing iterators will however become dangling once the object gets modified.
Definition at line 29 of file qcbormap.h.
Definition at line 36 of file qcbormap.h.
A synonym for {std::random_access_iterator_tag} indicating this iterator is a random-access iterator.
Definition at line 35 of file qcbormap.h.
Definition at line 39 of file qcbormap.h.
Definition at line 38 of file qcbormap.h.
Definition at line 37 of file qcbormap.h.
|
constexprdefault |
Constructs an uninitialized iterator.
Functions like key(), value(), and operator++() must not be called on an uninitialized iterator. Use operator=() to assign a value to it before using it.
|
constexprdefault |
Constructs an iterator as a copy of other.
|
inline |
Returns the current item's key.
There is no direct way of changing an item's key through an iterator, although it can be done by calling QCborMap::erase() followed by QCborMap::insert().
Definition at line 60 of file qcbormap.h.
References item.
|
inline |
Returns true
if other points to a different entry in the map than this iterator; otherwise returns false
.
Definition at line 70 of file qcbormap.h.
References o.
|
inline |
Definition at line 64 of file qcbormap.h.
References o.
|
inline |
Returns a pair containing the current item's key and a modifiable reference to the current item's value.
The second element of the pair 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.
Definition at line 51 of file qcbormap.h.
References item.
|
inline |
Returns an iterator to the item at j positions forward from this iterator.
If j is negative, the iterator goes backward.
Definition at line 81 of file qcbormap.h.
|
inline |
The prefix {++} operator,
{++i}, advances the iterator to the next item in the map and returns this iterator.
Calling this function on QCborMap::end() leads to undefined results.
Definition at line 75 of file qcbormap.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,
{i++}, advances the iterator to the next item in the map and returns an iterator to the previously current item.
Definition at line 76 of file qcbormap.h.
References item.
|
inline |
Advances the iterator by j items.
If j is negative, the iterator goes backward. Returns a reference to this iterator.
Definition at line 79 of file qcbormap.h.
|
inline |
Returns the position of the item at iterator j relative to the item at this iterator.
If the item at j is forward of this time, the returned value is negative.
Definition at line 83 of file qcbormap.h.
|
inline |
Returns an iterator to the item at j positions backward from this iterator.
If j is negative, the iterator goes forward.
Definition at line 82 of file qcbormap.h.
|
inline |
The prefix {–} operator,
{–i}, makes the preceding item current and returns this iterator.
Calling this function on QCborMap::begin() leads to undefined results.
Definition at line 77 of file qcbormap.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,
{i–}, makes the preceding item current and returns an iterator pointing to the previously current item.
Definition at line 78 of file qcbormap.h.
References item.
|
inline |
Makes the iterator go back by j items.
If j is negative, the iterator goes forward. Returns a reference to this iterator.
Definition at line 80 of file qcbormap.h.
|
inline |
Definition at line 53 of file qcbormap.h.
References item.
|
inline |
Returns a pointer to a modifiable reference to the current pair's value.
Definition at line 54 of file qcbormap.h.
References item.
|
inline |
Returns true
if the entry in the map pointed to by this iterator occurs before the entry pointed to by the other iterator.
Definition at line 71 of file qcbormap.h.
References item, other(), and Q_ASSERT.
|
inline |
Definition at line 65 of file qcbormap.h.
References item, other(), and Q_ASSERT.
|
inline |
Returns true
if the entry in the map pointed to by this iterator occurs before or is the same entry as is pointed to by the other iterator.
Definition at line 72 of file qcbormap.h.
References item, other(), and Q_ASSERT.
|
inline |
Definition at line 66 of file qcbormap.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 43 of file qcbormap.h.
|
inline |
Returns true
if other points to the same entry in the map as this iterator; otherwise returns false
.
Definition at line 69 of file qcbormap.h.
|
inline |
Definition at line 63 of file qcbormap.h.
|
inline |
Returns true
if the entry in the map pointed to by this iterator occurs after the entry pointed to by the other iterator.
Definition at line 73 of file qcbormap.h.
References item, other(), and Q_ASSERT.
|
inline |
Definition at line 67 of file qcbormap.h.
References item, other(), and Q_ASSERT.
|
inline |
Returns true
if the entry in the map pointed to by this iterator occurs after or is the same entry as is pointed to by the other iterator.
Definition at line 74 of file qcbormap.h.
References item, other(), and Q_ASSERT.
|
inline |
Definition at line 68 of file qcbormap.h.
References item, other(), and Q_ASSERT.
|
inline |
Definition at line 52 of file qcbormap.h.
References j.
|
inline |
Returns a modifiable reference to the current item's value.
You can change the value for a key by using value() 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.
Definition at line 61 of file qcbormap.h.
References item.
|
friend |
Definition at line 31 of file qcbormap.h.
|
friend |
Definition at line 32 of file qcbormap.h.