1#ifndef SIMDJSON_GENERIC_ONDEMAND_ARRAY_ITERATOR_H
3#ifndef SIMDJSON_CONDITIONAL_INCLUDE
4#define SIMDJSON_GENERIC_ONDEMAND_ARRAY_ITERATOR_H
6#include "simdjson/generic/implementation_simdjson_result_base.h"
7#include "simdjson/generic/ondemand/base.h"
8#include "simdjson/generic/ondemand/value_iterator.h"
13namespace SIMDJSON_IMPLEMENTATION {
26 using iterator_category = std::input_iterator_tag;
28 using difference_type = std::ptrdiff_t;
35#if SIMDJSON_DEVELOPMENT_CHECKS
62 simdjson_inline
bool operator==(const
array_iterator &) const noexcept;
70 simdjson_inline
bool operator!=(const
array_iterator &) const noexcept;
81 simdjson_warn_unused simdjson_inline
bool at_end() const noexcept;
84#if SIMDJSON_DEVELOPMENT_CHECKS
85 bool has_been_referenced{
false};
86 array* parent{
nullptr};
88 simdjson_inline
array_iterator(
const value_iterator &_iter, array* _parent)
noexcept;
90 value_iterator iter{};
92 simdjson_inline
array_iterator(
const value_iterator &iter)
noexcept;
106struct simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::array_iterator> :
public SIMDJSON_IMPLEMENTATION::implementation_simdjson_result_base<SIMDJSON_IMPLEMENTATION::ondemand::array_iterator> {
107 using iterator_category = std::input_iterator_tag;
108 using value_type = simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::value>;
109 using difference_type = std::ptrdiff_t;
110 using pointer = void;
111 using reference = value_type;
113 simdjson_inline simdjson_result(SIMDJSON_IMPLEMENTATION::ondemand::array_iterator &&value)
noexcept;
115 simdjson_inline simdjson_result() noexcept = default;
121 simdjson_inline simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::value> operator*() noexcept;
122 simdjson_inline
bool operator==(const simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::array_iterator> &) const noexcept;
123 simdjson_inline
bool operator!=(const simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::array_iterator> &) const noexcept;
124 simdjson_inline simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::array_iterator> &operator++() noexcept;
126 simdjson_warn_unused simdjson_inline
bool at_end() const noexcept;
A forward-only JSON array.
simdjson_inline simdjson_result< value > operator*() noexcept
Get the current element.
simdjson_inline array_iterator() noexcept=default
Create a new, invalid array iterator.
simdjson_warn_unused simdjson_inline bool at_end() const noexcept
Check if the array is at the end.
A forward-only JSON array.
The top level simdjson namespace, containing everything the library provides.
error_code
All possible errors returned by simdjson.
The result of a simdjson operation that could fail.
simdjson_inline error_code error() const noexcept
The error.