JsonCpp project page | Classes | Namespace | JsonCpp home page

Public Types | Public Member Functions | Friends | List of all members
Json::ValueIterator Class Reference

Iterator for object and array value. More...

`#include <json/value.h>`

Inheritance diagram for Json::ValueIterator:
Collaboration diagram for Json::ValueIterator:

## Public Types
using | value_type = Value
using | size_t = unsigned int
using | difference_type = int
using | reference = Value&
using | pointer = Value*
using | SelfType = ValueIterator
Public Types inherited from Json::ValueIteratorBase
using | iterator_category = std::bidirectional_iterator_tag
using | size_t = unsigned int
using | difference_type = int
using | SelfType = ValueIteratorBase

## Public Member Functions
| ValueIterator ()
| ValueIterator (const ValueConstIterator &other)
| ValueIterator (const ValueIterator &other)
SelfType & | operator= (const SelfType &other)
SelfType | operator++ (int)
SelfType | operator-- (int)
SelfType & | operator-- ()
SelfType & | operator++ ()
reference | operator* () const
pointer | operator-> () const
Public Member Functions inherited from Json::ValueIteratorBase
bool | operator== (const SelfType &other) const
bool | operator!= (const SelfType &other) const
difference_type | operator- (const SelfType &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, or -1 if it is not an arrayValue.
String | name () const
| Return the member name of the referenced Value, or "" if it is not an objectValue.
| __declspec (deprecated("Use `key = name();` instead.")) char const *memberName() const
| Return the member name of the referenced Value.
char const * | memberName (char const **end) const
| Return the member name of the referenced Value, or NULL if it is not an objectValue.
| ValueIteratorBase ()
| ValueIteratorBase (const Value::ObjectValues::iterator &current)

## Friends
class | Value

## Additional Inherited Members
Protected Member Functions inherited from Json::ValueIteratorBase
const Value & | deref () const
Value & | deref ()
void | increment ()
void | decrement ()
difference_type | computeDistance (const SelfType &other) const
bool | isEqual (const SelfType &other) const
void | copy (const SelfType &other)

## Detailed Description

Iterator for object and array value.

Definition at line 994 of file value.h.

## Member Typedef Documentation

## ◆ difference_type

using Json::ValueIterator::difference_type = int

Definition at line 1000 of file value.h.

## ◆ pointer

using Json::ValueIterator::pointer = Value*

Definition at line 1002 of file value.h.

## ◆ reference

using Json::ValueIterator::reference = Value&

Definition at line 1001 of file value.h.

## ◆ SelfType

using Json::ValueIterator::SelfType = ValueIterator

Definition at line 1003 of file value.h.

## ◆ size_t

using Json::ValueIterator::size_t = unsigned int

Definition at line 999 of file value.h.

## ◆ value_type

using Json::ValueIterator::value_type = Value

Definition at line 998 of file value.h.

## Constructor & Destructor Documentation

## ◆ ValueIterator() [1/3]

Json::ValueIterator::ValueIterator | ( |  | ) |
| default

References ValueIterator().

Referenced by operator=(), ValueIterator(), and ValueIterator().

Here is the caller graph for this function:

## ◆ ValueIterator() [2/3]

Json::ValueIterator::ValueIterator | ( | const ValueConstIterator & | other | ) |
| explicit

Definition at line 144 of file json_valueiterator.inl.

References Json::ValueIteratorBase::ValueIteratorBase().

## ◆ ValueIterator() [3/3]

Json::ValueIterator::ValueIterator | ( | const ValueIterator & | other | ) |
| default

References operator=(), and ValueIterator().

## Member Function Documentation

## ◆ operator*()

reference Json::ValueIterator::operator* | ( |  | ) | const
| inline

The return value of non-const iterators can be changed, so the these functions are not const because the returned references/pointers can be used to change state of the base class.

Definition at line 1044 of file value.h.

References Json::ValueIteratorBase::deref().

## ◆ operator++() [1/2]

SelfType & Json::ValueIterator::operator++ | ( |  | ) |
| inline

Definition at line 1034 of file value.h.

References Json::ValueIteratorBase::increment().

## ◆ operator++() [2/2]

SelfType Json::ValueIterator::operator++ | ( | int |  | ) |
| inline

Definition at line 1017 of file value.h.

## ◆ operator--() [1/2]

SelfType & Json::ValueIterator::operator-- | ( |  | ) |
| inline

Definition at line 1029 of file value.h.

References Json::ValueIteratorBase::decrement().

## ◆ operator--() [2/2]

SelfType Json::ValueIterator::operator-- | ( | int |  | ) |
| inline

Definition at line 1023 of file value.h.

## ◆ operator->()

pointer Json::ValueIterator::operator-> | ( |  | ) | const
| inline

Definition at line 1045 of file value.h.

References Json::ValueIteratorBase::deref().

## ◆ operator=()

ValueIterator & Json::ValueIterator::operator= | ( | const SelfType & | other | ) |

Definition at line 151 of file json_valueiterator.inl.

References Json::ValueIteratorBase::copy(), and ValueIterator().

Referenced by ValueIterator().

Here is the caller graph for this function:

## Friends And Related Symbol Documentation

## ◆ Value

friend class Value
| friend

Definition at line 995 of file value.h.

References Value.

Referenced by Value.

The documentation for this class was generated from the following files:

- include/json/value.h
- src/lib_json/json_valueiterator.inl