simdjson  3.11.0
Ridiculously Fast JSON
Array iteration

Methods to iterate over array elements. More...

Functions

simdjson_warn_unused simdjson_inline simdjson_result< bool > simdjson::SIMDJSON_IMPLEMENTATION::ondemand::value_iterator::start_array () noexcept
 Check for an opening [ and start an array iteration. More...
 
simdjson_warn_unused simdjson_inline simdjson_result< bool > simdjson::SIMDJSON_IMPLEMENTATION::ondemand::value_iterator::start_root_array () noexcept
 Check for an opening [ and start an array iteration while at the root. More...
 
simdjson_warn_unused simdjson_inline error_code simdjson::SIMDJSON_IMPLEMENTATION::ondemand::value_iterator::check_root_array () noexcept
 Checks whether an array could be started from the root. More...
 
simdjson_warn_unused simdjson_inline simdjson_result< bool > simdjson::SIMDJSON_IMPLEMENTATION::ondemand::value_iterator::started_array () noexcept
 Start an array iteration, after the user has already checked and moved past the [. More...
 
simdjson_warn_unused simdjson_inline simdjson_result< bool > simdjson::SIMDJSON_IMPLEMENTATION::ondemand::value_iterator::started_root_array () noexcept
 Start an array iteration from the root, after the user has already checked and moved past the [. More...
 
simdjson_warn_unused simdjson_inline simdjson_result< bool > simdjson::SIMDJSON_IMPLEMENTATION::ondemand::value_iterator::has_next_element () noexcept
 Moves to the next element in an array. More...
 
simdjson_warn_unused simdjson_inline value_iterator simdjson::SIMDJSON_IMPLEMENTATION::ondemand::value_iterator::child () const noexcept
 Get a child value iterator.
 

Detailed Description

Methods to iterate over array elements.

These methods generally assume the value is actually an object; the caller is responsible for keeping track of that fact.

Function Documentation

◆ check_root_array()

simdjson_warn_unused simdjson_inline error_code simdjson::SIMDJSON_IMPLEMENTATION::ondemand::value_iterator::check_root_array ( )
noexcept

Checks whether an array could be started from the root.

May be called by start_root_array.

Returns
SUCCESS if it is possible to safely start an array from the root (document level). @error INCORRECT_TYPE If there is no [. @error TAPE_ERROR if there is no matching ] at end of document

Definition at line 446 of file value_iterator-inl.h.

◆ has_next_element()

simdjson_warn_unused simdjson_inline simdjson_result< bool > simdjson::SIMDJSON_IMPLEMENTATION::ondemand::value_iterator::has_next_element ( )
noexcept

Moves to the next element in an array.

Looks for , and ]. If ] is found, the array is finished and the iterator advances past it. Otherwise, it advances to the next value.

Returns
Whether there is another element in the array. @error TAPE_ERROR If there is a comma missing between elements.

Definition at line 482 of file value_iterator-inl.h.

◆ start_array()

simdjson_warn_unused simdjson_inline simdjson_result< bool > simdjson::SIMDJSON_IMPLEMENTATION::ondemand::value_iterator::start_array ( )
noexcept

Check for an opening [ and start an array iteration.

Returns
Whether the array had any elements (returns false for empty). @error INCORRECT_TYPE If there is no [.

Definition at line 414 of file value_iterator-inl.h.

◆ start_root_array()

simdjson_warn_unused simdjson_inline simdjson_result< bool > simdjson::SIMDJSON_IMPLEMENTATION::ondemand::value_iterator::start_root_array ( )
noexcept

Check for an opening [ and start an array iteration while at the root.

Returns
Whether the array had any elements (returns false for empty). @error INCORRECT_TYPE If there is no [. @error TAPE_ERROR if there is no matching ] at end of document

Definition at line 419 of file value_iterator-inl.h.

◆ started_array()

simdjson_warn_unused simdjson_inline simdjson_result< bool > simdjson::SIMDJSON_IMPLEMENTATION::ondemand::value_iterator::started_array ( )
noexcept

Start an array iteration, after the user has already checked and moved past the [.

Does not move the iterator unless the array is empty ([]).

Returns
Whether the array had any elements (returns false for empty). @error INCOMPLETE_ARRAY_OR_OBJECT If there are no more tokens (implying the parent array or object is incomplete).

Definition at line 431 of file value_iterator-inl.h.

◆ started_root_array()

simdjson_warn_unused simdjson_inline simdjson_result< bool > simdjson::SIMDJSON_IMPLEMENTATION::ondemand::value_iterator::started_root_array ( )
noexcept

Start an array iteration from the root, after the user has already checked and moved past the [.

Does not move the iterator unless the array is empty ([]).

Returns
Whether the array had any elements (returns false for empty). @error INCOMPLETE_ARRAY_OR_OBJECT If there are no more tokens (implying the parent array or object is incomplete).

Definition at line 476 of file value_iterator-inl.h.