QJsonObject::iterator Class
The QJsonObject::iterator class is an STL-style non-const iterator for QJsonObject. More…
| Header | #include <QJsonObject> |
|---|---|
| CMake | target_link_libraries(app PRIVATE Nt::Core) |
| Module | Nt Core C++ Classes |
| Nested in | QJsonObject |
List of all members, including inherited members
Public Types
| typedef | iterator_category |
| typedef | difference_type |
| typedef | value_type |
| typedef | reference |
| typedef | pointer |
Public Functions
| iterator() | |
| iterator(QJsonObject *object, qsizetype index) | |
| QString | key() const |
| QAnyStringView | keyView() const |
| QJsonValueRef | value() const |
| QJsonValueRef | operator*() const |
| QJsonRefArrow<QJsonValueRef> | operator->() const |
| QJsonValueRef | operator[](qsizetype j) 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 iterator &other) const |
| bool | operator>=(const iterator &other) const |
| bool | operator==(const const_iterator &other) const |
| bool | operator!=(const const_iterator &other) const |
| bool | operator<(const const_iterator &other) const |
| bool | operator<=(const const_iterator &other) const |
| bool | operator>(const const_iterator &other) const |
| bool | operator>=(const const_iterator &other) const |
| iterator & | operator++() |
| iterator | operator++(int) |
| iterator & | operator--() |
| iterator | operator--(int) |
| iterator & | operator+=(qsizetype j) |
| iterator & | operator-=(qsizetype j) |
| iterator | operator+(qsizetype j) const |
| iterator | operator-(qsizetype j) const |
| qsizetype | operator-(const iterator &other) const |
Detailed Description
A random access iterator over the entries of an object, in the sorted order of their keys. key() returns the key and the dereferenced value is a QJsonValueRef.
See also QJsonObject::const_iterator.
Member Type Documentation
typedef QJsonObject::iterator::difference_type
Alias for qsizetype.
typedef QJsonObject::iterator::iterator_category
Marks the iterator as a random access iterator.
typedef QJsonObject::iterator::pointer
The type operator->() returns.
typedef QJsonObject::iterator::reference
Alias for QJsonValueRef.
typedef QJsonObject::iterator::value_type
Alias for QJsonValue.
Member Function Documentation
QJsonObject::iterator::iterator()
Creates an iterator that refers to no object.
QJsonObject::iterator::iterator(QJsonObject *object, qsizetype index)
Creates an iterator that refers to entry index of object.
QString QJsonObject::iterator::key() const
Returns the key of the current entry.
QAnyStringView QJsonObject::iterator::keyView() const
Returns a view of the key of the current entry, without copying it. The view is valid until a key is inserted into the object or removed from it.
This function was introduced in 6.10.
See also key().
bool QJsonObject::iterator::operator!=(const iterator &other) const
Returns true if other refers to another entry.
bool QJsonObject::iterator::operator!=(const const_iterator &other) const
This is an overloaded function.
QJsonValueRef QJsonObject::iterator::operator*() const
Returns a reference to the value of the current entry.
iterator QJsonObject::iterator::operator+(qsizetype j) const
Returns an iterator j entries after this one.
iterator & QJsonObject::iterator::operator++()
Advances the iterator to the next entry and returns it.
iterator QJsonObject::iterator::operator++(int)
This is an overloaded function.
Advances the iterator and returns its previous position.
iterator & QJsonObject::iterator::operator+=(qsizetype j)
Advances the iterator by j entries and returns it.
iterator QJsonObject::iterator::operator-(qsizetype j) const
This is an overloaded function.
Returns an iterator j entries before this one.
qsizetype QJsonObject::iterator::operator-(const iterator &other) const
This is an overloaded function.
Returns the number of entries between other and this iterator.
iterator & QJsonObject::iterator::operator--()
Moves the iterator to the previous entry and returns it.
iterator QJsonObject::iterator::operator--(int)
This is an overloaded function.
Moves the iterator back and returns its previous position.
iterator & QJsonObject::iterator::operator-=(qsizetype j)
Moves the iterator back by j entries and returns it.
QJsonRefArrow<QJsonValueRef> QJsonObject::iterator::operator->() const
Returns a pointer-like helper for the value of the current entry.
bool QJsonObject::iterator::operator<(const iterator &other) const
Returns true if this iterator is before other.
bool QJsonObject::iterator::operator<(const const_iterator &other) const
This is an overloaded function.
bool QJsonObject::iterator::operator<=(const iterator &other) const
Returns true if this iterator is before or at the same position as other.
bool QJsonObject::iterator::operator<=(const const_iterator &other) const
This is an overloaded function.
bool QJsonObject::iterator::operator==(const iterator &other) const
Returns true if other refers to the same entry.
bool QJsonObject::iterator::operator==(const const_iterator &other) const
This is an overloaded function.
bool QJsonObject::iterator::operator>(const iterator &other) const
Returns true if this iterator is after other.
bool QJsonObject::iterator::operator>(const const_iterator &other) const
This is an overloaded function.
bool QJsonObject::iterator::operator>=(const iterator &other) const
Returns true if this iterator is after or at the same position as other.
bool QJsonObject::iterator::operator>=(const const_iterator &other) const
This is an overloaded function.
QJsonValueRef QJsonObject::iterator::operator[](qsizetype j) const
Returns a reference to the value of the entry j positions after the current one.
QJsonValueRef QJsonObject::iterator::value() const
Returns a reference to the value of the current entry.