1 #ifndef SIMDJSON_DOM_ARRAY_H
2 #define SIMDJSON_DOM_ARRAY_H
4 #include "simdjson/common_defs.h"
5 #include "simdjson/error.h"
6 #include "simdjson/internal/tape_ref.h"
25 simdjson_inline
array() noexcept;
30 using difference_type = std::ptrdiff_t;
54 inline bool operator==(
const iterator& other)
const noexcept;
56 inline bool operator<(
const iterator& other)
const noexcept;
57 inline bool operator<=(
const iterator& other)
const noexcept;
58 inline bool operator>=(
const iterator& other)
const noexcept;
59 inline bool operator>(
const iterator& other)
const noexcept;
65 simdjson_inline
iterator(
const internal::tape_ref &tape) noexcept;
66 internal::tape_ref tape;
87 inline
size_t size() const noexcept;
136 simdjson_inline
array(const internal::tape_ref &tape) noexcept;
137 internal::tape_ref tape;
141 friend class
simdjson::internal::string_builder;
158 #if SIMDJSON_EXCEPTIONS
161 inline size_t size()
const noexcept(
false);
169 #if defined(__cpp_lib_ranges)
175 inline constexpr
bool enable_view<simdjson::dom::array> =
true;
176 #if SIMDJSON_EXCEPTIONS
178 inline constexpr
bool enable_view<simdjson::simdjson_result<simdjson::dom::array>> =
true;
bool operator!=(const iterator &other) const noexcept
Check if these values come from the same place in the JSON.
iterator & operator++() noexcept
Get the next value.
value_type operator*() const noexcept
Get the actual value.
size_t number_of_slots() const noexcept
Get the total number of slots used by this array on the tape.
iterator end() const noexcept
One past the last array element.
size_t size() const noexcept
Get the size of the array (number of immediate children).
simdjson_result< element > at(size_t index) const noexcept
Get the value at the given index.
simdjson_result< element > at_pointer(std::string_view json_pointer) const noexcept
Get the value associated with the given JSON pointer.
simdjson_inline array() noexcept
Create a new, invalid array.
iterator begin() const noexcept
Return the first array element.
We want to support argument-dependent lookup (ADL).
error_code
All possible errors returned by simdjson.
The result of a JSON navigation that may fail.
The result of a simdjson operation that could fail.