JsonCpp project page Classes Namespace JsonCpp home page

Json::ValueIterator Class Reference

Iterator for object and array value. More...

#include <json/value.h>

Inherits Json::ValueIteratorBase.

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)
 
SelfTypeoperator= (const SelfType &other)
 
SelfType operator++ (int)
 
SelfType operator-- (int)
 
SelfTypeoperator-- ()
 
SelfTypeoperator++ ()
 
reference operator* ()
 
pointer operator-> ()
 
- 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. More...
 
UInt index () const
 Return the index of the referenced Value, or -1 if it is not an arrayValue. More...
 
String name () const
 Return the member name of the referenced Value, or "" if it is not an objectValue. More...
 
 __declspec (deprecated("Use `key = name();` instead.")) char const *memberName() const
 Return the member name of the referenced Value. More...
 
char const * memberName (char const **end) const
 Return the member name of the referenced Value, or NULL if it is not an objectValue. More...
 
 ValueIteratorBase ()
 
 ValueIteratorBase (const Value::ObjectValues::iterator &current)
 

Friends

class Value
 

Additional Inherited Members

- Protected Member Functions inherited from Json::ValueIteratorBase
const Valuederef () const
 
Valuederef ()
 
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.

Member Typedef Documentation

◆ difference_type

◆ pointer

◆ reference

◆ SelfType

◆ size_t

using Json::ValueIterator::size_t = unsigned int

◆ value_type

Constructor & Destructor Documentation

◆ ValueIterator() [1/3]

Json::ValueIterator::ValueIterator ( )
default

◆ ValueIterator() [2/3]

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

◆ ValueIterator() [3/3]

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

Member Function Documentation

◆ operator*()

reference Json::ValueIterator::operator* ( )
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.

◆ operator++() [1/2]

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

◆ operator++() [2/2]

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

◆ operator--() [1/2]

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

◆ operator--() [2/2]

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

◆ operator->()

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

◆ operator=()

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

Friends And Related Function Documentation

◆ Value

friend class Value
friend

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