simdjson 4.6.4
Ridiculously Fast JSON
Loading...
Searching...
No Matches
simdjson::SIMDJSON_IMPLEMENTATION::ondemand::array_iterator Class Reference

A forward-only JSON array. More...

#include <array_iterator.h>

Public Types

using iterator_category = std::input_iterator_tag
 
using value_type = simdjson_result< value >
 
using difference_type = std::ptrdiff_t
 
using pointer = void
 
using reference = value_type
 

Public Member Functions

simdjson_inline array_iterator () noexcept=default
 Create a new, invalid array iterator.
 
simdjson_inline simdjson_result< valueoperator* () 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 bool operator!= (const array_iterator &) const noexcept
 Check if there are more elements in the JSON array.
 
simdjson_inline array_iteratoroperator++ () noexcept
 Move to the next element.
 
simdjson_warn_unused simdjson_inline bool at_end () const noexcept
 Check if the array is at the end.
 

Detailed Description

A forward-only JSON array.

This is an input_iterator, meaning:

  • It is forward-only
  • * must be called at most once per element.
  • ++ must be called exactly once in between each * (*, ++, *, ++, * ...)

Definition at line 24 of file array_iterator.h.

Member Typedef Documentation

◆ difference_type

using simdjson::SIMDJSON_IMPLEMENTATION::ondemand::array_iterator::difference_type = std::ptrdiff_t

Definition at line 28 of file array_iterator.h.

◆ iterator_category

using simdjson::SIMDJSON_IMPLEMENTATION::ondemand::array_iterator::iterator_category = std::input_iterator_tag

Definition at line 26 of file array_iterator.h.

◆ pointer

using simdjson::SIMDJSON_IMPLEMENTATION::ondemand::array_iterator::pointer = void

Definition at line 29 of file array_iterator.h.

◆ reference

◆ value_type

Member Function Documentation

◆ at_end()

simdjson_inline bool simdjson::SIMDJSON_IMPLEMENTATION::ondemand::array_iterator::at_end ( ) const
noexcept

Check if the array is at the end.

Definition at line 46 of file array_iterator-inl.h.

◆ operator!=()

simdjson_inline bool simdjson::SIMDJSON_IMPLEMENTATION::ondemand::array_iterator::operator!= ( const array_iterator ) const
noexcept

Check if there are more elements in the JSON array.

Part of the std::iterator interface.

Returns
true if there are more elements in the JSON array.

Definition at line 30 of file array_iterator-inl.h.

◆ operator*()

simdjson_inline simdjson_result< value > simdjson::SIMDJSON_IMPLEMENTATION::ondemand::array_iterator::operator* ( )
noexcept

Get the current element.

Part of the std::iterator interface.

Definition at line 19 of file array_iterator-inl.h.

◆ operator++()

simdjson_inline array_iterator & simdjson::SIMDJSON_IMPLEMENTATION::ondemand::array_iterator::operator++ ( )
noexcept

Move to the next element.

Part of the std::iterator interface.

Definition at line 33 of file array_iterator-inl.h.

◆ operator==()

simdjson_inline bool simdjson::SIMDJSON_IMPLEMENTATION::ondemand::array_iterator::operator== ( const array_iterator other) const
noexcept

Check if we are at the end of the JSON.

Part of the std::iterator interface.

Returns
true if there are no more elements in the JSON array.

Definition at line 27 of file array_iterator-inl.h.


The documentation for this class was generated from the following files: