2 namespace SIMDJSON_IMPLEMENTATION {
10 if (iter.error()) { iter.abandon();
return iter.error(); }
11 return value(iter.child());
14 return !(*
this != other);
17 return iter.is_open();
23 if (( error = iter.error() )) {
return *
this; }
24 if (( error = iter.skip_child() )) {
return *
this; }
25 if (( error = iter.has_next_element().error() )) {
return *
this; }
35 simdjson_inline simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::array_iterator>::simdjson_result(
36 SIMDJSON_IMPLEMENTATION::ondemand::array_iterator &&value
38 : SIMDJSON_IMPLEMENTATION::implementation_simdjson_result_base<SIMDJSON_IMPLEMENTATION::ondemand::array_iterator>(std::forward<SIMDJSON_IMPLEMENTATION::ondemand::array_iterator>(value))
40 first.iter.assert_is_valid();
42 simdjson_inline simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::array_iterator>::simdjson_result(
error_code error) noexcept
43 : SIMDJSON_IMPLEMENTATION::implementation_simdjson_result_base<SIMDJSON_IMPLEMENTATION::ondemand::array_iterator>({}, error)
47 simdjson_inline simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::value> simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::array_iterator>::operator*() noexcept {
51 simdjson_inline
bool simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::array_iterator>::operator==(
const simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::array_iterator> &other)
const noexcept {
52 if (!first.iter.is_valid()) {
return !error(); }
53 return first == other.first;
55 simdjson_inline
bool simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::array_iterator>::operator!=(
const simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::array_iterator> &other)
const noexcept {
56 if (!first.iter.is_valid()) {
return error(); }
57 return first != other.first;
59 simdjson_inline simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::array_iterator> &simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::array_iterator>::operator++() noexcept {
A forward-only JSON array.
simdjson_inline simdjson_result< value > operator*() noexcept
Get the current element.
simdjson_inline bool operator==(const array_iterator &) const noexcept
Check if we are at the end of the JSON.
simdjson_inline array_iterator & operator++() noexcept
Move to the next element.
simdjson_inline array_iterator() noexcept=default
Create a new, invalid array iterator.
simdjson_inline bool operator!=(const array_iterator &) const noexcept
Check if there are more elements in the JSON array.
An ephemeral JSON value returned during iteration.
We want to support argument-dependent lookup (ADL).
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.