libfly
6.2.2
C++20 utility library for Linux, macOS, and Windows
|
#include <json_reverse_iterator.hpp>
Public Types | |
using | value_type = typename JsonIterator::value_type |
using | difference_type = typename JsonIterator::difference_type |
using | reference = typename JsonIterator::reference |
using | const_reference = const reference |
using | pointer = typename JsonIterator::pointer |
Public Member Functions | |
JsonReverseIterator () noexcept | |
JsonReverseIterator (const JsonIterator &it) noexcept | |
JsonReverseIterator (const reverse_iterator &it) noexcept | |
reference | operator* () const |
pointer | operator-> () const |
reference | operator[] (difference_type offset) const |
JsonReverseIterator | operator++ (int) |
JsonReverseIterator & | operator++ () |
JsonReverseIterator | operator-- (int) |
JsonReverseIterator & | operator-- () |
JsonReverseIterator & | operator+= (difference_type offset) |
JsonReverseIterator & | operator-= (difference_type offset) |
JsonReverseIterator | operator+ (difference_type offset) const |
JsonReverseIterator | operator- (difference_type offset) const |
difference_type | operator- (const JsonReverseIterator &other) const |
const json_object_type::key_type & | key () const |
reference | value () const |
Class to provide reverse iterator access to a Json instance. Primarily serves as a wrapper around std::reverse_iterator<JsonIterator>.
This class is afforded the same undefined behavior protections as JsonIterator.
using fly::detail::JsonReverseIterator< JsonIterator >::value_type = typename JsonIterator::value_type |
Aliases for canonical STL reverse iterator member types.
|
noexcept |
Default constructor. Initializes the iterator to an empty value.
|
explicitnoexcept |
Constructor to initialize the reverse iterator with an existing forward iterator.
it | The forward iterator to intialize with. |
|
explicitnoexcept |
Constructor to initialize the reverse iterator with an existing reverse iterator.
it | The reverse iterator to intialize with. |
const json_object_type::key_type & fly::detail::JsonReverseIterator< JsonIterator >::key |
Retrieve a reference to the key of the Json instance pointed to by this iterator. Only valid for Json object types.
JsonIteratorException | If the Json instance is not an object. |
NullJsonException | If the iterator is empty or past-the-end. |
auto fly::detail::JsonReverseIterator< JsonIterator >::operator* |
Retrieve a reference to the Json instance pointed to by this iterator.
NullJsonException | If the iterator is empty or past-the-end. |
auto fly::detail::JsonReverseIterator< JsonIterator >::operator+ | ( | difference_type | offset | ) | const |
Addition operator. Retrieve an iterator pointed at the Json instance some offset earlier or later in the sequence. Invalid for Json object types.
offset | The offset to retrieve. |
JsonIteratorException | If the Json instance is an object. |
NullJsonException | If the iterator is empty. |
OutOfRangeJsonException | If the iterator at the offset escapes the Json instance's valid range. |
auto fly::detail::JsonReverseIterator< JsonIterator >::operator++ |
Pre-increment operator. Sets the instance pointed to by this iterator to the next instance in the sequence.
NullJsonException | If the iterator is empty. |
OutOfRangeJsonException | If the next iterator escapes the Json instance's valid range. |
auto fly::detail::JsonReverseIterator< JsonIterator >::operator++ | ( | int | dummy | ) |
Post-increment operator. Sets the instance pointed to by this iterator to the next instance in the sequence.
NullJsonException | If the iterator is empty. |
OutOfRangeJsonException | If the next iterator escapes the Json instance's valid range. |
auto fly::detail::JsonReverseIterator< JsonIterator >::operator+= | ( | difference_type | offset | ) |
Addition operator. Sets the Json instance pointed to by this iterator to some offset earlier or later in the sequence. Invalid for Json object types.
offset | The offset by which to increment the iterator. |
JsonIteratorException | If the Json instance is an object. |
NullJsonException | If the iterator is empty. |
OutOfRangeJsonException | If the iterator at the offset escapes the Json instance's valid range. |
auto fly::detail::JsonReverseIterator< JsonIterator >::operator- | ( | const JsonReverseIterator< JsonIterator > & | other | ) | const |
Difference operator. Compute the distance between this iterator and another. Invalid for Json object types.
other | The iterator instance to compare. |
JsonIteratorException | If the Json instance is an object. |
NullJsonException | If either iterator is empty. |
auto fly::detail::JsonReverseIterator< JsonIterator >::operator- | ( | difference_type | offset | ) | const |
Subtraction operator. Retrieve an iterator pointed at the Json instance some offset earlier or later in the sequence. Invalid for Json object types.
offset | The offset to retrieve. |
JsonIteratorException | If the Json instance is an object. |
NullJsonException | If the iterator is empty. |
OutOfRangeJsonException | If the iterator at the offset escapes the Json instance's valid range. |
auto fly::detail::JsonReverseIterator< JsonIterator >::operator-- |
Pre-decrement operator. Sets the instance pointed to by this iterator to the previous instance in the sequence.
NullJsonException | If the iterator is empty. |
OutOfRangeJsonException | If the previous iterator escapes the Json instance's valid range. |
auto fly::detail::JsonReverseIterator< JsonIterator >::operator-- | ( | int | dummy | ) |
Post-decrement operator. Sets the instance pointed to by this iterator to the previous instance in the sequence.
NullJsonException | If the iterator is empty. |
OutOfRangeJsonException | If the previous iterator escapes the Json instance's valid range. |
auto fly::detail::JsonReverseIterator< JsonIterator >::operator-= | ( | difference_type | offset | ) |
Subtraction operator. Sets the Json instance pointed to by this iterator to some offset earlier or later in the sequence. Invalid for Json object types.
offset | The offset by which to decrement the iterator. |
JsonIteratorException | If the Json instance is an object. |
NullJsonException | If the iterator is empty. |
OutOfRangeJsonException | If the iterator at the offset escapes the Json instance's valid range. |
auto fly::detail::JsonReverseIterator< JsonIterator >::operator-> |
Retrieve a pointer to the Json instance pointed to by this iterator.
NullJsonException | If the iterator is empty or past-the-end. |
auto fly::detail::JsonReverseIterator< JsonIterator >::operator[] | ( | difference_type | offset | ) | const |
Retrieve a reference to the Json instance at some offset earlier or later than the instance pointed to by this iterator. Invoking operator[0] is equivalent to invoking operator*. Invalid for Json object types.
offset | The offset to retrieve. |
JsonIteratorException | If the Json instance is an object. |
NullJsonException | If the iterator at the offset is empty or past-the-end. |
OutOfRangeJsonException | If the iterator at the offset escapes the Json instance's valid range. |
auto fly::detail::JsonReverseIterator< JsonIterator >::value |
Retrieve a reference to the Json instance pointed to by this iterator.
NullJsonException | If the iterator is empty or past-the-end. |