1 #ifndef SIMDJSON_DOM_OBJECT_H
2 #define SIMDJSON_DOM_OBJECT_H
4 #include "simdjson/common_defs.h"
5 #include "simdjson/error.h"
6 #include "simdjson/internal/tape_ref.h"
25 simdjson_inline
object() noexcept;
30 using difference_type = std::ptrdiff_t;
56 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;
60 inline bool operator>=(
const iterator& other)
const noexcept;
61 inline bool operator>(
const iterator& other)
const noexcept;
65 inline std::string_view
key()
const noexcept;
75 inline bool key_equals(std::string_view o)
const noexcept;
85 inline const char *
key_c_str()
const noexcept;
95 simdjson_inline
iterator(
const internal::tape_ref &tape) noexcept;
97 internal::tape_ref tape;
119 inline
size_t size() const noexcept;
209 simdjson_inline
object(const internal::tape_ref &tape) noexcept;
211 internal::tape_ref tape;
216 friend class
simdjson::internal::string_builder;
238 struct simdjson_result<dom::object> :
public internal::simdjson_result_base<dom::object> {
250 #if SIMDJSON_EXCEPTIONS
253 inline size_t size()
const noexcept(
false);
259 #if defined(__cpp_lib_ranges)
265 inline constexpr
bool enable_view<simdjson::dom::object> =
true;
266 #if SIMDJSON_EXCEPTIONS
268 inline constexpr
bool enable_view<simdjson::simdjson_result<simdjson::dom::object>> =
true;
Key/value pair in an object.
std::string_view key
key in the key-value pair
element value
value in the key-value pair
bool operator!=(const iterator &other) const noexcept
Check if these values come from the same place in the JSON.
element value() const noexcept
Get the value of this key/value pair.
bool key_equals(std::string_view o) const noexcept
Returns true if the key in this key/value pair is equal to the provided string_view.
const char * key_c_str() const noexcept
Get the key of this key/value pair.
uint32_t key_length() const noexcept
Get the length (in bytes) of the key in this key/value pair.
const value_type operator*() const noexcept
Get the actual key/value pair.
bool key_equals_case_insensitive(std::string_view o) const noexcept
Returns true if the key in this key/value pair is equal to the provided string_view in a case-insensi...
std::string_view key() const noexcept
Get the key of this key/value pair.
iterator & operator++() noexcept
Get the next key/value pair.
simdjson_result< element > at_key(std::string_view key) const noexcept
Get the value associated with the given key.
iterator end() const noexcept
One past the last key/value pair.
size_t size() const noexcept
Get the size of the object (number of keys).
simdjson_result< element > at_key_case_insensitive(std::string_view key) const noexcept
Get the value associated with the given key in a case-insensitive manner.
simdjson_result< element > at_pointer(std::string_view json_pointer) const noexcept
Get the value associated with the given JSON pointer.
simdjson_inline object() noexcept
Create a new, invalid object.
iterator begin() const noexcept
Return the first key/value pair.
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.