10#include <userver/formats/common/iterator_direction.hpp>
12USERVER_NAMESPACE_BEGIN
14namespace formats::
json {
20 using iterator_category = std::forward_iterator_tag;
21 using difference_type = std::ptrdiff_t;
22 using value_type =
typename Traits::ValueType;
23 using reference =
typename Traits::Reference;
24 using pointer =
typename Traits::Pointer;
26 using ContainerType =
typename Traits::ContainerType;
28 Iterator(ContainerType container,
int pos);
30 Iterator(
const Iterator& other);
31 Iterator(Iterator&& other)
noexcept;
32 Iterator& operator=(
const Iterator& other);
33 Iterator& operator=(Iterator&& other)
noexcept;
37 Iterator operator++(
int);
38 Iterator& operator++();
39 reference operator*()
const;
40 pointer operator->()
const;
42 bool operator==(
const Iterator& other)
const;
43 bool operator!=(
const Iterator& other)
const;
47 template <
typename T =
void>
48 std::string GetName()
const {
51 "Reverse iterator should be used only on arrays or null, "
52 "they do not have GetName()"
62 std::string GetNameImpl()
const;
63 Iterator(ContainerType&& container,
int type,
int pos)
noexcept;
65 void UpdateValue()
const;
68 ContainerType container_;
74 mutable std::optional<value_type> current_;