![]() |
simdjson 4.6.4
Ridiculously Fast JSON
|
Public Member Functions | |
| simdjson_inline simdjson_result< SIMDJSON_IMPLEMENTATION::ondemand::array > | get_array () noexcept |
| simdjson_inline simdjson_result< SIMDJSON_IMPLEMENTATION::ondemand::object > | get_object () noexcept |
| simdjson_inline simdjson_result< uint64_t > | get_uint64 () noexcept |
| simdjson_inline simdjson_result< uint64_t > | get_uint64_in_string () noexcept |
| simdjson_inline simdjson_result< int64_t > | get_int64 () noexcept |
| simdjson_inline simdjson_result< int64_t > | get_int64_in_string () noexcept |
| simdjson_inline simdjson_result< uint32_t > | get_uint32 () noexcept |
| simdjson_inline simdjson_result< int32_t > | get_int32 () noexcept |
| simdjson_inline simdjson_result< double > | get_double () noexcept |
| simdjson_inline simdjson_result< double > | get_double_in_string () noexcept |
| simdjson_inline simdjson_result< std::string_view > | get_string (bool allow_replacement=false) noexcept |
| template<typename string_type > | |
| simdjson_warn_unused simdjson_inline error_code | get_string (string_type &receiver, bool allow_replacement=false) noexcept |
| simdjson_inline simdjson_result< std::string_view > | get_wobbly_string () noexcept |
| simdjson_inline simdjson_result< SIMDJSON_IMPLEMENTATION::ondemand::raw_json_string > | get_raw_json_string () noexcept |
| simdjson_inline simdjson_result< bool > | get_bool () noexcept |
| simdjson_inline simdjson_result< bool > | is_null () noexcept |
| template<typename T > | |
| simdjson_inline simdjson_result< T > | get () noexcept |
| template<typename T > | |
| simdjson_inline error_code | get (T &out) noexcept |
| template<class T > | |
| simdjson_inline | operator T () noexcept(false) |
| simdjson_inline | operator SIMDJSON_IMPLEMENTATION::ondemand::array () noexcept(false) |
| simdjson_inline | operator SIMDJSON_IMPLEMENTATION::ondemand::object () noexcept(false) |
| simdjson_inline | operator uint64_t () noexcept(false) |
| simdjson_inline | operator int64_t () noexcept(false) |
| simdjson_inline | operator double () noexcept(false) |
| simdjson_inline | operator std::string_view () noexcept(false) |
| simdjson_inline | operator SIMDJSON_IMPLEMENTATION::ondemand::raw_json_string () noexcept(false) |
| simdjson_inline | operator bool () noexcept(false) |
| simdjson_inline simdjson_result< size_t > | count_elements () &noexcept |
| simdjson_inline simdjson_result< size_t > | count_fields () &noexcept |
| simdjson_inline simdjson_result< SIMDJSON_IMPLEMENTATION::ondemand::value > | at (size_t index) noexcept |
| simdjson_inline simdjson_result< SIMDJSON_IMPLEMENTATION::ondemand::array_iterator > | begin () &noexcept |
| simdjson_inline simdjson_result< SIMDJSON_IMPLEMENTATION::ondemand::array_iterator > | end () &noexcept |
| simdjson_inline simdjson_result< SIMDJSON_IMPLEMENTATION::ondemand::value > | find_field (std::string_view key) noexcept |
| Look up a field by name on an object (order-sensitive). | |
| simdjson_inline simdjson_result< SIMDJSON_IMPLEMENTATION::ondemand::value > | find_field (const char *key) noexcept |
| simdjson_inline simdjson_result< SIMDJSON_IMPLEMENTATION::ondemand::value > | find_field_unordered (std::string_view key) noexcept |
| Look up a field by name on an object, without regard to key order. | |
| simdjson_inline simdjson_result< SIMDJSON_IMPLEMENTATION::ondemand::value > | find_field_unordered (const char *key) noexcept |
| simdjson_inline simdjson_result< SIMDJSON_IMPLEMENTATION::ondemand::value > | operator[] (std::string_view key) noexcept |
| simdjson_inline simdjson_result< SIMDJSON_IMPLEMENTATION::ondemand::value > | operator[] (const char *key) noexcept |
| simdjson_result< SIMDJSON_IMPLEMENTATION::ondemand::value > | operator[] (int) noexcept=delete |
| simdjson_inline simdjson_result< SIMDJSON_IMPLEMENTATION::ondemand::json_type > | type () noexcept |
| Get the type of this JSON value. | |
| simdjson_inline simdjson_result< bool > | is_scalar () noexcept |
| simdjson_inline simdjson_result< bool > | is_string () noexcept |
| simdjson_inline simdjson_result< bool > | is_negative () noexcept |
| simdjson_inline simdjson_result< bool > | is_integer () noexcept |
| simdjson_inline simdjson_result< SIMDJSON_IMPLEMENTATION::number_type > | get_number_type () noexcept |
| simdjson_inline simdjson_result< SIMDJSON_IMPLEMENTATION::ondemand::number > | get_number () noexcept |
| simdjson_inline simdjson_result< std::string_view > | raw_json_token () noexcept |
| std::string_view value::raw_json_token() const noexcept | |
| simdjson_inline simdjson_result< std::string_view > | raw_json () noexcept |
| simdjson_inline simdjson_result< const char * > | current_location () noexcept |
| simdjson_result<const char *> current_location() noexcept | |
| simdjson_inline simdjson_result< int32_t > | current_depth () const noexcept |
| int32_t current_depth() const noexcept | |
| simdjson_inline simdjson_result< SIMDJSON_IMPLEMENTATION::ondemand::value > | at_pointer (std::string_view json_pointer) noexcept |
| simdjson_inline simdjson_result< SIMDJSON_IMPLEMENTATION::ondemand::value > | at_path (std::string_view json_path) noexcept |
| template<typename Func > | |
| simdjson_inline error_code | for_each_at_path_with_wildcard (std::string_view json_path, Func &&callback) noexcept |
| template<typename string_type > | |
| simdjson_inline error_code | get_string (string_type &receiver, bool allow_replacement) noexcept |
| template<> | |
| simdjson_inline error_code | get (SIMDJSON_IMPLEMENTATION::ondemand::value &out) noexcept |
| template<> | |
| simdjson_inline simdjson_result< SIMDJSON_IMPLEMENTATION::ondemand::value > | get () noexcept |
| template<typename Func > | |
| error_code | for_each_at_path_with_wildcard (std::string_view json_path, Func &&callback) noexcept |
| template<> | |
| simdjson_inline error_code | get (SIMDJSON_IMPLEMENTATION::ondemand::value &out) noexcept |
| template<> | |
| simdjson_inline simdjson_result< SIMDJSON_IMPLEMENTATION::ondemand::value > | get () noexcept |
Public Member Functions inherited from simdjson::SIMDJSON_IMPLEMENTATION::implementation_simdjson_result_base< SIMDJSON_IMPLEMENTATION::ondemand::value > | |
| simdjson_inline | implementation_simdjson_result_base () noexcept=default |
| Create a new empty result with error = UNINITIALIZED. | |
| simdjson_inline | implementation_simdjson_result_base (error_code error) noexcept |
| Create a new error result. | |
| simdjson_inline | implementation_simdjson_result_base (SIMDJSON_IMPLEMENTATION::ondemand::value &&value) noexcept |
| Create a new successful result. | |
| simdjson_inline | implementation_simdjson_result_base (SIMDJSON_IMPLEMENTATION::ondemand::value &&value, error_code error) noexcept |
| Create a new result with both things (use if you don't want to branch when creating the result). | |
| simdjson_inline void | tie (SIMDJSON_IMPLEMENTATION::ondemand::value &value, error_code &error) &&noexcept |
| Move the value and the error to the provided variables. | |
| simdjson_warn_unused simdjson_inline error_code | get (SIMDJSON_IMPLEMENTATION::ondemand::value &value) &&noexcept |
| Move the value to the provided variable. | |
| simdjson_warn_unused simdjson_inline error_code | error () const noexcept |
| The error. | |
| simdjson_warn_unused simdjson_inline bool | has_value () const noexcept |
| Whether there is a value. | |
| simdjson_inline SIMDJSON_IMPLEMENTATION::ondemand::value & | operator* () &noexcept(false) |
| Get the result value. | |
| simdjson_inline SIMDJSON_IMPLEMENTATION::ondemand::value && | operator* () &&noexcept(false) |
| simdjson_inline SIMDJSON_IMPLEMENTATION::ondemand::value * | operator-> () noexcept(false) |
| Arrow operator to access members of the contained value. | |
| simdjson_inline const SIMDJSON_IMPLEMENTATION::ondemand::value * | operator-> () const noexcept(false) |
| simdjson_inline SIMDJSON_IMPLEMENTATION::ondemand::value & | value () &noexcept(false) |
| simdjson_inline SIMDJSON_IMPLEMENTATION::ondemand::value && | value () &&noexcept(false) |
| Take the result value (move it). | |
| simdjson_inline SIMDJSON_IMPLEMENTATION::ondemand::value && | take_value () &&noexcept(false) |
| Take the result value (move it). | |
| simdjson_inline | operator SIMDJSON_IMPLEMENTATION::ondemand::value && () &&noexcept(false) |
| Cast to the value (will throw on error). | |
| simdjson_inline const SIMDJSON_IMPLEMENTATION::ondemand::value & | value_unsafe () const &noexcept |
| Get the result value. | |
| simdjson_inline SIMDJSON_IMPLEMENTATION::ondemand::value & | value_unsafe () &noexcept |
| Get the result value. | |
| simdjson_inline SIMDJSON_IMPLEMENTATION::ondemand::value && | value_unsafe () &&noexcept |
| Take the result value (move it). | |
Additional Inherited Members | |
Public Types inherited from simdjson::SIMDJSON_IMPLEMENTATION::implementation_simdjson_result_base< SIMDJSON_IMPLEMENTATION::ondemand::value > | |
| using | value_type = SIMDJSON_IMPLEMENTATION::ondemand::value |
| using | error_type = error_code |
Protected Attributes inherited from simdjson::SIMDJSON_IMPLEMENTATION::implementation_simdjson_result_base< SIMDJSON_IMPLEMENTATION::ondemand::value > | |
| SIMDJSON_IMPLEMENTATION::ondemand::value | first |
| users should never directly access first and second. | |
| error_code | second |
| Users should never directly access 'first'. | |
|
noexcept |
Definition at line 364 of file value-inl.h.
|
noexcept |
Definition at line 586 of file value-inl.h.
|
noexcept |
Definition at line 578 of file value-inl.h.
|
noexcept |
Definition at line 368 of file value-inl.h.
|
noexcept |
Definition at line 356 of file value-inl.h.
|
noexcept |
Definition at line 360 of file value-inl.h.
|
noexcept |
int32_t current_depth() const noexcept
int32_t current_depth() const noexcept
Definition at line 573 of file value-inl.h.
|
noexcept |
simdjson_result<const char *> current_location() noexcept
simdjson_result<const char *> current_location() noexcept
Definition at line 568 of file value-inl.h.
|
noexcept |
Definition at line 372 of file value-inl.h.
|
noexcept |
Definition at line 381 of file value-inl.h.
|
noexcept |
Look up a field by name on an object (order-sensitive).
By order-sensitive, we mean that fields must be accessed in the order they appear in the JSON text (although you can skip fields). See find_field_unordered() and operator[] for an order-insensitive version.
The following code reads z, then y, then x, and thus will not retrieve x or y if fed the JSON { "x": 1, "y": 2, "z": 3 }:
Raw Keys: The lookup will be done against the raw key, and will not unescape keys. e.g. object["a"] will match { "a": 1 }, but will not match { "\u0061": 1 }.
| key | The key to look up. |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 377 of file value-inl.h.
|
noexcept |
Definition at line 390 of file value-inl.h.
|
noexcept |
Look up a field by name on an object, without regard to key order.
Performance Notes: This is a bit less performant than find_field(), though its effect varies and often appears negligible. It starts out normally, starting out at the last field; but if the field is not found, it scans from the beginning of the object to see if it missed it. That missing case has a non-cache-friendly bump and lots of extra scanning, especially if the object in question is large. The fact that the extra code is there also bumps the executable size.
We default operator[] on find_field_unordered() for convenience. It is the default because it would be highly surprising (and hard to debug) if the default behavior failed to look up a field just because it was in the wrong order–and many APIs assume this. Therefore, you must be explicit if you want to treat objects as out of order.
Use find_field() if you are sure fields will be in order (or are willing to treat it as if the field as not there when they are not in order).
| key | The key to look up. |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 386 of file value-inl.h.
|
inlinenoexcept |
Definition at line 600 of file value-inl.h.
|
noexcept |
Definition at line 485 of file value-inl.h.
|
noexcept |
Definition at line 476 of file value-inl.h.
|
noexcept |
Definition at line 470 of file value-inl.h.
|
noexcept |
Definition at line 480 of file value-inl.h.
|
noexcept |
Definition at line 404 of file value-inl.h.
|
noexcept |
Definition at line 461 of file value-inl.h.
|
noexcept |
Definition at line 436 of file value-inl.h.
|
noexcept |
Definition at line 440 of file value-inl.h.
|
noexcept |
Definition at line 432 of file value-inl.h.
|
noexcept |
Definition at line 420 of file value-inl.h.
|
noexcept |
Definition at line 424 of file value-inl.h.
|
noexcept |
Definition at line 514 of file value-inl.h.
|
noexcept |
Definition at line 510 of file value-inl.h.
|
noexcept |
Definition at line 408 of file value-inl.h.
|
noexcept |
Definition at line 457 of file value-inl.h.
|
noexcept |
Definition at line 444 of file value-inl.h.
|
noexcept |
Definition at line 449 of file value-inl.h.
|
noexcept |
Definition at line 428 of file value-inl.h.
|
noexcept |
Definition at line 412 of file value-inl.h.
|
noexcept |
Definition at line 416 of file value-inl.h.
|
noexcept |
Definition at line 453 of file value-inl.h.
|
noexcept |
Definition at line 506 of file value-inl.h.
|
noexcept |
Definition at line 502 of file value-inl.h.
|
noexcept |
Definition at line 465 of file value-inl.h.
|
noexcept |
Definition at line 494 of file value-inl.h.
|
noexcept |
Definition at line 498 of file value-inl.h.
| simdjson_inline simdjson::simdjson_result< SIMDJSON_IMPLEMENTATION::ondemand::value >::operator bool | ( | ) |
Definition at line 552 of file value-inl.h.
| simdjson_inline simdjson::simdjson_result< SIMDJSON_IMPLEMENTATION::ondemand::value >::operator double | ( | ) |
Definition at line 540 of file value-inl.h.
| simdjson_inline simdjson::simdjson_result< SIMDJSON_IMPLEMENTATION::ondemand::value >::operator int64_t | ( | ) |
Definition at line 536 of file value-inl.h.
| simdjson_inline simdjson::simdjson_result< SIMDJSON_IMPLEMENTATION::ondemand::value >::operator SIMDJSON_IMPLEMENTATION::ondemand::array | ( | ) |
Definition at line 524 of file value-inl.h.
| simdjson_inline simdjson::simdjson_result< SIMDJSON_IMPLEMENTATION::ondemand::value >::operator SIMDJSON_IMPLEMENTATION::ondemand::object | ( | ) |
Definition at line 528 of file value-inl.h.
| simdjson_inline simdjson::simdjson_result< SIMDJSON_IMPLEMENTATION::ondemand::value >::operator SIMDJSON_IMPLEMENTATION::ondemand::raw_json_string | ( | ) |
Definition at line 548 of file value-inl.h.
| simdjson_inline simdjson::simdjson_result< SIMDJSON_IMPLEMENTATION::ondemand::value >::operator std::string_view | ( | ) |
Definition at line 544 of file value-inl.h.
|
explicit |
Definition at line 520 of file value-inl.h.
| simdjson_inline simdjson::simdjson_result< SIMDJSON_IMPLEMENTATION::ondemand::value >::operator uint64_t | ( | ) |
Definition at line 532 of file value-inl.h.
|
noexcept |
Definition at line 399 of file value-inl.h.
|
noexcept |
Definition at line 395 of file value-inl.h.
|
noexcept |
Definition at line 563 of file value-inl.h.
|
noexcept |
std::string_view value::raw_json_token() const noexcept
std::string_view value::raw_json_token() const noexcept
Definition at line 558 of file value-inl.h.
|
noexcept |
Get the type of this JSON value.
It does not validate or consume the value. E.g., you must still call "is_null()" to check that a value is null even if "type()" returns json_type::null.
Given a valid JSON document, the answer can be one of simdjson::ondemand::json_type::object, simdjson::ondemand::json_type::array, simdjson::ondemand::json_type::string, simdjson::ondemand::json_type::number, simdjson::ondemand::json_type::boolean, simdjson::ondemand::json_type::null.
Starting with simdjson 4.0, this function will return simdjson::ondemand::json_type::unknown given a bad token. This allows you to identify a case such as {"key": NaN} and identify the NaN value. The simdjson::ondemand::json_type::unknown value should only happen with non-valid JSON.
NOTE: If you're only expecting a value to be one type (a typical case), it's generally better to just call .get_double, .get_string, etc. and check for INCORRECT_TYPE (or just let it throw an exception).
Definition at line 490 of file value-inl.h.