![]() |
simdjson 4.6.4
Ridiculously Fast JSON
|
A JSON field (key/value pair) in an object. More...
#include <field.h>
Public Member Functions | |
| simdjson_inline | field () noexcept |
| Create a new invalid field. | |
| 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). | |
| template<typename string_type > | |
| simdjson_inline simdjson_warn_unused error_code | unescaped_key (string_type &receiver, 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 | key_raw_json_token () const noexcept |
| Get the unprocessed key as a string_view. | |
| simdjson_inline std::string_view | escaped_key () const noexcept |
| Get the key as a string_view. | |
| simdjson_inline ondemand::value & | value () &noexcept |
| Get the field value. | |
| simdjson_inline ondemand::value | value () &&noexcept |
Protected Member Functions | |
| simdjson_inline | field (raw_json_string key, ondemand::value &&value) noexcept |
Static Protected Member Functions | |
| static simdjson_inline simdjson_result< field > | start (value_iterator &parent_iter) noexcept |
| static simdjson_inline simdjson_result< field > | start (const value_iterator &parent_iter, raw_json_string key) noexcept |
A JSON field (key/value pair) in an object.
Returned from object iteration.
Extends from std::pair<raw_json_string, value> so you can use C++ algorithms that rely on pairs.
|
noexcept |
Create a new invalid field.
Exists so you can declare a variable and later assign to it before use.
Definition at line 16 of file field-inl.h.
|
protectednoexcept |
Definition at line 18 of file field-inl.h.
|
noexcept |
Get the key as a string_view.
This does not include the quotes and the string is unprocessed key so it may contain escape characters (e.g., \uXXXX or
). It does not count as a consumption of the content: you can safely call it repeatedly. Use unescaped_key() to get the unescaped key.
Definition at line 60 of file field-inl.h.
|
noexcept |
Get the key as a raw_json_string.
Can be used for direct comparison with an unescaped C string: e.g., key() == "test". This does not count as consumption of the content: you can safely call it repeatedly. See escaped_key() for a similar function which returns a more convenient std::string_view result.
Definition at line 49 of file field-inl.h.
|
noexcept |
Get the unprocessed key as a string_view.
This includes the quotes and may include some spaces after the last quote. This does not count as consumption of the content: you can safely call it repeatedly. See escaped_key().
Definition at line 55 of file field-inl.h.
|
staticprotectednoexcept |
Definition at line 30 of file field-inl.h.
|
staticprotectednoexcept |
Definition at line 23 of file field-inl.h.
|
noexcept |
Get the key as a string_view (for higher speed, consider raw_key).
We deliberately use a more cumbersome name (unescaped_key) to force users to think twice about using it.
This consumes the key: once you have called unescaped_key(), you cannot call it again nor can you call key().
Definition at line 34 of file field-inl.h.
|
noexcept |
Get the key as a string_view (for higher speed, consider raw_key).
We deliberately use a more cumbersome name (unescaped_key) to force users to think twice about using it. The content is stored in the receiver.
This consumes the key: once you have called unescaped_key(), you cannot call it again nor can you call key().
Definition at line 42 of file field-inl.h.
|
noexcept |
Definition at line 71 of file field-inl.h.
|
noexcept |
Get the field value.
Definition at line 67 of file field-inl.h.