xrpld
Loading...
Searching...
No Matches
json::ValueConstIterator Class Reference

const iterator for object and array value. More...

#include <json_value.h>

Inheritance diagram for json::ValueConstIterator:
Collaboration diagram for json::ValueConstIterator:

Public Types

using size_t = unsigned int
using difference_type = int
using reference = Value const&
using pointer = Value const*
using SelfType = ValueConstIterator

Public Member Functions

 ValueConstIterator ()=default
 ValueConstIterator (ValueConstIterator const &other)=default
SelfTypeoperator= (SelfType const &other)
SelfType operator++ (int)
SelfType operator-- (int)
SelfTypeoperator-- ()
SelfTypeoperator++ ()
reference operator* () const
bool operator== (SelfType const &other) const
bool operator!= (SelfType const &other) const
Value key () const
 Return either the index or the member name of the referenced value as a Value.
UInt index () const
 Return the index of the referenced Value. -1 if it is not an ValueType::Array.
char const * memberName () const
 Return the member name of the referenced Value.

Protected Member Functions

Valuederef () const
void increment ()
void decrement ()
difference_type computeDistance (SelfType const &other) const
bool isEqual (SelfType const &other) const
void copy (SelfType const &other)

Private Member Functions

 ValueConstIterator (Value::ObjectValues::iterator const &current)

Private Attributes

Value::ObjectValues::iterator current_
bool isNull_

Friends

class Value

Detailed Description

const iterator for object and array value.

Definition at line 557 of file json_value.h.

Member Typedef Documentation

◆ size_t

using json::ValueConstIterator::size_t = unsigned int

Definition at line 562 of file json_value.h.

◆ difference_type

Definition at line 563 of file json_value.h.

◆ reference

Definition at line 564 of file json_value.h.

◆ pointer

Definition at line 565 of file json_value.h.

◆ SelfType

Constructor & Destructor Documentation

◆ ValueConstIterator() [1/3]

json::ValueConstIterator::ValueConstIterator ( )
default

◆ ValueConstIterator() [2/3]

json::ValueConstIterator::ValueConstIterator ( ValueConstIterator const & other)
default

◆ ValueConstIterator() [3/3]

json::ValueConstIterator::ValueConstIterator ( Value::ObjectValues::iterator const & current)
explicitprivate

Definition at line 129 of file json_valueiterator.cpp.

Member Function Documentation

◆ operator=()

ValueConstIterator & json::ValueConstIterator::operator= ( SelfType const & other)

Definition at line 135 of file json_valueiterator.cpp.

◆ operator++() [1/2]

SelfType json::ValueConstIterator::operator++ ( int )

Definition at line 581 of file json_value.h.

◆ operator--() [1/2]

SelfType json::ValueConstIterator::operator-- ( int )

Definition at line 589 of file json_value.h.

◆ operator--() [2/2]

SelfType & json::ValueConstIterator::operator-- ( )

Definition at line 597 of file json_value.h.

◆ operator++() [2/2]

SelfType & json::ValueConstIterator::operator++ ( )

Definition at line 604 of file json_value.h.

◆ operator*()

reference json::ValueConstIterator::operator* ( ) const

Definition at line 611 of file json_value.h.

◆ operator==()

bool json::ValueIteratorBase::operator== ( SelfType const & other) const
inherited

Definition at line 504 of file json_value.h.

◆ operator!=()

bool json::ValueIteratorBase::operator!= ( SelfType const & other) const
inherited

Definition at line 510 of file json_value.h.

◆ key()

Value json::ValueIteratorBase::key ( ) const
nodiscardinherited

Return either the index or the member name of the referenced value as a Value.

Definition at line 88 of file json_valueiterator.cpp.

◆ index()

UInt json::ValueIteratorBase::index ( ) const
nodiscardinherited

Return the index of the referenced Value. -1 if it is not an ValueType::Array.

Definition at line 104 of file json_valueiterator.cpp.

◆ memberName()

char const * json::ValueIteratorBase::memberName ( ) const
nodiscardinherited

Return the member name of the referenced Value.

"" if it is not an ValueType::Object.

Definition at line 115 of file json_valueiterator.cpp.

◆ deref()

Value & json::ValueIteratorBase::deref ( ) const
nodiscardprotectedinherited

Definition at line 26 of file json_valueiterator.cpp.

◆ increment()

void json::ValueIteratorBase::increment ( )
protectedinherited

Definition at line 32 of file json_valueiterator.cpp.

◆ decrement()

void json::ValueIteratorBase::decrement ( )
protectedinherited

Definition at line 38 of file json_valueiterator.cpp.

◆ computeDistance()

ValueIteratorBase::difference_type json::ValueIteratorBase::computeDistance ( SelfType const & other) const
nodiscardprotectedinherited

Definition at line 44 of file json_valueiterator.cpp.

◆ isEqual()

bool json::ValueIteratorBase::isEqual ( SelfType const & other) const
nodiscardprotectedinherited

Definition at line 71 of file json_valueiterator.cpp.

◆ copy()

void json::ValueIteratorBase::copy ( SelfType const & other)
protectedinherited

Definition at line 82 of file json_valueiterator.cpp.

◆ Value

friend class Value
friend

Definition at line 559 of file json_value.h.

Member Data Documentation

◆ current_

Value::ObjectValues::iterator json::ValueIteratorBase::current_
privateinherited

Definition at line 549 of file json_value.h.

◆ isNull_

bool json::ValueIteratorBase::isNull_
privateinherited

Definition at line 551 of file json_value.h.