userver: formats::json::Iterator< Traits, Direction > Class Template Reference
Loading...
Searching...
No Matches
formats::json::Iterator< Traits, Direction > Class Template Referencefinal

#include <userver/formats/json/iterator.hpp>

Detailed Description

template<typename Traits, common::IteratorDirection Direction = common::IteratorDirection::kForward>
class formats::json::Iterator< Traits, Direction >

Iterator for formats::json::Value

Definition at line 18 of file iterator.hpp.

Public Types

using iterator_category = std::forward_iterator_tag
 
using difference_type = std::ptrdiff_t
 
using value_type = typename Traits::ValueType
 
using reference = typename Traits::Reference
 
using pointer = typename Traits::Pointer
 
using ContainerType = typename Traits::ContainerType
 

Public Member Functions

 Iterator (ContainerType container, int pos)
 
 Iterator (const Iterator &other)
 
 Iterator (Iterator &&other) noexcept
 
Iteratoroperator= (const Iterator &other)
 
Iteratoroperator= (Iterator &&other) noexcept
 
Iterator operator++ (int)
 
Iteratoroperator++ ()
 
reference operator* () const
 
pointer operator-> () const
 
bool operator== (const Iterator &other) const
 
bool operator!= (const Iterator &other) const
 
template<typename T = void>
std::string GetName () const
 Returns name of the referenced field.
 
size_t GetIndex () const
 Returns index of the referenced field.
 

Member Typedef Documentation

◆ ContainerType

template<typename Traits , common::IteratorDirection Direction = common::IteratorDirection::kForward>
using formats::json::Iterator< Traits, Direction >::ContainerType = typename Traits::ContainerType

Definition at line 26 of file iterator.hpp.

◆ difference_type

template<typename Traits , common::IteratorDirection Direction = common::IteratorDirection::kForward>
using formats::json::Iterator< Traits, Direction >::difference_type = std::ptrdiff_t

Definition at line 21 of file iterator.hpp.

◆ iterator_category

template<typename Traits , common::IteratorDirection Direction = common::IteratorDirection::kForward>
using formats::json::Iterator< Traits, Direction >::iterator_category = std::forward_iterator_tag

Definition at line 20 of file iterator.hpp.

◆ pointer

template<typename Traits , common::IteratorDirection Direction = common::IteratorDirection::kForward>
using formats::json::Iterator< Traits, Direction >::pointer = typename Traits::Pointer

Definition at line 24 of file iterator.hpp.

◆ reference

template<typename Traits , common::IteratorDirection Direction = common::IteratorDirection::kForward>
using formats::json::Iterator< Traits, Direction >::reference = typename Traits::Reference

Definition at line 23 of file iterator.hpp.

◆ value_type

template<typename Traits , common::IteratorDirection Direction = common::IteratorDirection::kForward>
using formats::json::Iterator< Traits, Direction >::value_type = typename Traits::ValueType

Definition at line 22 of file iterator.hpp.

Member Function Documentation

◆ GetIndex()

template<typename Traits , common::IteratorDirection Direction = common::IteratorDirection::kForward>
size_t formats::json::Iterator< Traits, Direction >::GetIndex ( ) const

Returns index of the referenced field.

Exceptions
`TypeMismatchException`if iterated value is not an array

◆ GetName()

template<typename Traits , common::IteratorDirection Direction = common::IteratorDirection::kForward>
template<typename T = void>
std::string formats::json::Iterator< Traits, Direction >::GetName ( ) const
inline

Returns name of the referenced field.

Exceptions
`TypeMismatchException`if iterated value is not an object

Definition at line 48 of file iterator.hpp.


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