1 #ifndef SIMDJSON_GENERIC_ONDEMAND_FIELD_H
3 #ifndef SIMDJSON_CONDITIONAL_INCLUDE
4 #define SIMDJSON_GENERIC_ONDEMAND_FIELD_H
5 #include "simdjson/generic/ondemand/base.h"
6 #include "simdjson/generic/implementation_simdjson_result_base.h"
7 #include "simdjson/generic/ondemand/raw_json_string.h"
8 #include "simdjson/generic/ondemand/value.h"
12 namespace SIMDJSON_IMPLEMENTATION {
22 class field :
public std::pair<raw_json_string, value> {
29 simdjson_inline
field() noexcept;
48 template <
typename string_type>
49 simdjson_inline simdjson_warn_unused
error_code unescaped_key(string_type& receiver,
bool allow_replacement =
false) noexcept;
71 simdjson_inline std::string_view
escaped_key()
const noexcept;
75 simdjson_inline ondemand::value &
value() & noexcept;
79 simdjson_inline ondemand::value
value() && noexcept;
103 template<
typename string_type>
104 simdjson_inline
error_code unescaped_key(string_type &receiver,
bool allow_replacement =
false) noexcept;
A JSON field (key/value pair) in an object.
simdjson_inline std::string_view key_raw_json_token() const noexcept
Get the unprocessed key as a string_view.
simdjson_inline simdjson_warn_unused simdjson_result< std::string_view > unescaped_key(bool allow_replacement=false) noexcept
Get the key as a string_view (for higher speed, consider raw_key).
simdjson_inline raw_json_string key() const noexcept
Get the key as a raw_json_string.
simdjson_inline std::string_view escaped_key() const noexcept
Get the key as a string_view.
simdjson_inline field() noexcept
Create a new invalid field.
simdjson_inline ondemand::value & value() &noexcept
Get the field value.
A string escaped per JSON rules, terminated with quote (").
An ephemeral JSON value returned during iteration.
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.
The result of a simdjson operation that could fail.
simdjson_inline error_code error() const noexcept
The error.
simdjson_inline T & value() &noexcept(false)
Get the result value.