JSON for Modern C++  2.0.0
Public Types | Public Member Functions | List of all members
nlohmann::basic_json::iterator Class Reference

a mutable random access iterator for the basic_json class More...

#include <json.hpp>

Public Types

using base_iterator = const_iterator
 
using pointer = typename basic_json::pointer
 
using reference = typename basic_json::reference
 
- Public Types inherited from nlohmann::basic_json::const_iterator
using difference_type = typename basic_json::difference_type
 a type to represent differences between iterators More...
 
using iterator_category = std::bidirectional_iterator_tag
 the category of the iterator More...
 
using pointer = typename basic_json::const_pointer
 defines a pointer to the type iterated over (value_type) More...
 
using reference = typename basic_json::const_reference
 defines a reference to the type iterated over (value_type) More...
 
using value_type = typename basic_json::value_type
 the type of the values when the iterator is dereferenced More...
 

Public Member Functions

 iterator ()=default
 default constructor More...
 
 iterator (pointer object) noexcept
 constructor for a given JSON instance More...
 
 iterator (const iterator &other) noexcept
 copy constructor More...
 
reference operator* ()
 return a reference to the value pointed to by the iterator More...
 
iterator operator+ (difference_type i)
 add to iterator More...
 
iterator operator++ (int)
 post-increment (it++) More...
 
iteratoroperator++ ()
 pre-increment (++it) More...
 
iteratoroperator+= (difference_type i)
 add to iterator More...
 
iterator operator- (difference_type i)
 subtract from iterator More...
 
difference_type operator- (const iterator &other) const
 return difference More...
 
iterator operator-- (int)
 post-decrement (it–) More...
 
iteratoroperator-- ()
 pre-decrement (–it) More...
 
iteratoroperator-= (difference_type i)
 subtract from iterator More...
 
pointer operator-> ()
 dereference the iterator More...
 
iteratoroperator= (iterator other) noexcept( std::is_nothrow_move_constructible< pointer >::value and std::is_nothrow_move_assignable< pointer >::value and std::is_nothrow_move_constructible< internal_iterator >::value and std::is_nothrow_move_assignable< internal_iterator >::value )
 copy assignment More...
 
reference operator[] (difference_type n) const
 access to successor More...
 
reference value () const
 return the value of an iterator More...
 
- Public Member Functions inherited from nlohmann::basic_json::const_iterator
 const_iterator ()=default
 default constructor More...
 
 const_iterator (pointer object) noexcept
 constructor for a given JSON instance More...
 
 const_iterator (const iterator &other) noexcept
 copy constructor given a nonconst iterator More...
 
 const_iterator (const const_iterator &other) noexcept
 copy constructor More...
 
object_t::key_type key () const
 return the key of an object iterator More...
 
bool operator!= (const const_iterator &other) const
 comparison: not equal More...
 
reference operator* () const
 return a reference to the value pointed to by the iterator More...
 
const_iterator operator+ (difference_type i)
 add to iterator More...
 
const_iterator operator++ (int)
 post-increment (it++) More...
 
const_iteratoroperator++ ()
 pre-increment (++it) More...
 
const_iteratoroperator+= (difference_type i)
 add to iterator More...
 
const_iterator operator- (difference_type i)
 subtract from iterator More...
 
difference_type operator- (const const_iterator &other) const
 return difference More...
 
const_iterator operator-- (int)
 post-decrement (it–) More...
 
const_iteratoroperator-- ()
 pre-decrement (–it) More...
 
const_iteratoroperator-= (difference_type i)
 subtract from iterator More...
 
pointer operator-> () const
 dereference the iterator More...
 
bool operator< (const const_iterator &other) const
 comparison: smaller More...
 
bool operator<= (const const_iterator &other) const
 comparison: less than or equal More...
 
const_iteratoroperator= (const_iterator other) noexcept( std::is_nothrow_move_constructible< pointer >::value and std::is_nothrow_move_assignable< pointer >::value and std::is_nothrow_move_constructible< internal_iterator >::value and std::is_nothrow_move_assignable< internal_iterator >::value )
 copy assignment More...
 
bool operator== (const const_iterator &other) const
 comparison: equal More...
 
bool operator> (const const_iterator &other) const
 comparison: greater than More...
 
bool operator>= (const const_iterator &other) const
 comparison: greater than or equal More...
 
reference operator[] (difference_type n) const
 access to successor More...
 
reference value () const
 return the value of an iterator More...
 

Detailed Description

template<template< typename U, typename V, typename...Args > class ObjectType = std::map, template< typename U, typename...Args > class ArrayType = std::vector, class StringType = std::string, class BooleanType = bool, class NumberIntegerType = int64_t, class NumberUnsignedType = uint64_t, class NumberFloatType = double, template< typename U > class AllocatorType = std::allocator>
class nlohmann::basic_json::iterator

Requirements
The class satisfies the following concept requirements:
  • RandomAccessIterator: The iterator that can be moved to point (forward and backward) to any element in constant time.
  • OutputIterator: It is possible to write to the pointed-to element.
Since
version 1.0.0

Definition at line 6813 of file json.hpp.