2 namespace SIMDJSON_IMPLEMENTATION {
13 simdjson_inline simdjson_result<field> object_iterator::operator*() noexcept {
15 if (error) { iter.abandon();
return error; }
16 auto result = field::start(iter);
19 if (result.error()) { iter.abandon(); }
22 simdjson_inline
bool object_iterator::operator==(
const object_iterator &other)
const noexcept {
23 return !(*
this != other);
25 simdjson_inline
bool object_iterator::operator!=(
const object_iterator &)
const noexcept {
26 return iter.is_open();
29 SIMDJSON_PUSH_DISABLE_WARNINGS
30 SIMDJSON_DISABLE_STRICT_OVERFLOW_WARNING
31 simdjson_inline object_iterator &object_iterator::operator++() noexcept {
34 if (!iter.is_open()) {
return *
this; }
37 if ((error = iter.skip_child() )) {
return *
this; }
39 simdjson_unused
bool has_value;
40 if ((error = iter.has_next_field().get(has_value) )) {
return *
this; };
43 SIMDJSON_POP_DISABLE_WARNINGS
92 simdjson_inline simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::object_iterator>::simdjson_result(
93 SIMDJSON_IMPLEMENTATION::ondemand::object_iterator &&value
95 : implementation_simdjson_result_base<SIMDJSON_IMPLEMENTATION::ondemand::object_iterator>(std::forward<SIMDJSON_IMPLEMENTATION::ondemand::object_iterator>(value))
97 first.iter.assert_is_valid();
99 simdjson_inline simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::object_iterator>::simdjson_result(
error_code error) noexcept
100 : implementation_simdjson_result_base<SIMDJSON_IMPLEMENTATION::ondemand::object_iterator>({}, error)
104 simdjson_inline simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::field> simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::object_iterator>::operator*() noexcept {
109 simdjson_inline
bool simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::object_iterator>::operator==(
const simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::object_iterator> &other)
const noexcept {
110 if (!first.iter.is_valid()) {
return !error(); }
111 return first == other.first;
114 simdjson_inline
bool simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::object_iterator>::operator!=(
const simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::object_iterator> &other)
const noexcept {
115 if (!first.iter.is_valid()) {
return error(); }
116 return first != other.first;
119 simdjson_inline simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::object_iterator> &simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::object_iterator>::operator++() noexcept {
simdjson_inline object_iterator() noexcept=default
Create a new invalid object_iterator.
We want to support argument-dependent lookup (ADL).
error_code
All possible errors returned by simdjson.
simdjson_inline error_code error() const noexcept
The error.