userver: formats::yaml::Iterator< iter_traits > Class Template Reference
Loading...
Searching...
No Matches
formats::yaml::Iterator< iter_traits > Class Template Referencefinal

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

Detailed Description

template<typename iter_traits>
class formats::yaml::Iterator< iter_traits >

Iterator for formats::yaml::Value

Definition at line 19 of file iterator.hpp.

Public Types

using iterator_category = std::forward_iterator_tag
 
using difference_type = std::ptrdiff_t
 
using value_type = typename iter_traits::value_type
 
using reference = typename iter_traits::reference
 
using pointer = typename iter_traits::pointer
 

Public Member Functions

 Iterator (const typename iter_traits::native_iter &iter, int index, const formats::yaml::Path &path)
 
 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
 
std::string GetName () const
 Returns name of the referenced field.
 
uint32_t GetIndex () const
 Returns index of the referenced field.
 
Type GetIteratorType () const
 Returns whether iterator is over array or over object.
 

Member Typedef Documentation

◆ difference_type

template<typename iter_traits >
using formats::yaml::Iterator< iter_traits >::difference_type = std::ptrdiff_t

Definition at line 22 of file iterator.hpp.

◆ iterator_category

template<typename iter_traits >
using formats::yaml::Iterator< iter_traits >::iterator_category = std::forward_iterator_tag

Definition at line 21 of file iterator.hpp.

◆ pointer

template<typename iter_traits >
using formats::yaml::Iterator< iter_traits >::pointer = typename iter_traits::pointer

Definition at line 25 of file iterator.hpp.

◆ reference

template<typename iter_traits >
using formats::yaml::Iterator< iter_traits >::reference = typename iter_traits::reference

Definition at line 24 of file iterator.hpp.

◆ value_type

template<typename iter_traits >
using formats::yaml::Iterator< iter_traits >::value_type = typename iter_traits::value_type

Definition at line 23 of file iterator.hpp.

Member Function Documentation

◆ GetIndex()

Returns index of the referenced field.

Exceptions
`TypeMismatchException`if iterated value is not an array

◆ GetName()

template<typename iter_traits >
std::string formats::yaml::Iterator< iter_traits >::GetName ( ) const

Returns name of the referenced field.

Exceptions
`TypeMismatchException`if iterated value is not an object

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