1#ifndef SIMDJSON_DOM_ARRAY_H
2#define SIMDJSON_DOM_ARRAY_H
6#include "simdjson/dom/base.h"
7#include "simdjson/internal/tape_ref.h"
18 simdjson_inline
array()
noexcept;
23 using difference_type = std::ptrdiff_t;
26 using iterator_category = std::forward_iterator_tag;
61 simdjson_inline
iterator(
const internal::tape_ref &tape)
noexcept;
62 internal::tape_ref tape{};
173 internal::tape_ref tape{};
177 friend class simdjson::internal::string_builder;
185struct simdjson_result<dom::array> :
public internal::simdjson_result_base<dom::array> {
192 inline void process_json_path_of_child_elements(std::vector<dom::element>::iterator& current, std::vector<dom::element>::iterator& end,
const std::string_view& path_suffix, std::vector<dom::element>& accumulator)
const noexcept;
196 inline std::vector<dom::element>& get_values(std::vector<dom::element>& out)
const noexcept;
198#if SIMDJSON_EXCEPTIONS
201 inline size_t size()
const noexcept(
false);
209#if SIMDJSON_SUPPORTS_RANGES
213inline constexpr bool enable_view<simdjson::dom::array> =
true;
214#if SIMDJSON_EXCEPTIONS
216inline 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.
reference operator*() const noexcept
Get the actual value.
std::vector< element > & get_values(std::vector< element > &out) const noexcept
Gets the values of items in an array element This function has linear-time complexity: the values are...
simdjson_result< std::vector< element > > at_path_with_wildcard(std::string_view json_path) const noexcept
Adds support for JSONPath expression with wildcards '*'.
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.
simdjson_result< element > at_path(std::string_view json_path) const noexcept
Get the value associated with the given JSONPath expression.
iterator begin() const noexcept
Return the first array element.
void process_json_path_of_child_elements(std::vector< element >::iterator ¤t, std::vector< element >::iterator &end, const std::string_view &path_suffix, std::vector< element > &accumulator) const noexcept
Recursive function which processes the JSON path of each child element.
The top level simdjson namespace, containing everything the library provides.
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.