simdjson 5.0.1
Ridiculously Fast JSON
Loading...
Searching...
No Matches
value.h
1#ifndef SIMDJSON_GENERIC_ONDEMAND_VALUE_H
2
3#ifndef SIMDJSON_CONDITIONAL_INCLUDE
4#define SIMDJSON_GENERIC_ONDEMAND_VALUE_H
5#include "simdjson/generic/ondemand/base.h"
6#include "simdjson/generic/implementation_simdjson_result_base.h"
7#include "simdjson/generic/ondemand/value_iterator.h"
8#include "simdjson/generic/ondemand/deserialize.h"
9#include <vector>
10#endif // SIMDJSON_CONDITIONAL_INCLUDE
11
12#include <type_traits>
13
14namespace simdjson {
15
16namespace SIMDJSON_IMPLEMENTATION {
17namespace ondemand {
22class value {
23public:
29 simdjson_inline value() noexcept = default;
30
46 template <typename T>
47 simdjson_inline simdjson_result<T> get()
48#if SIMDJSON_SUPPORTS_CONCEPTS
49 noexcept(nothrow_gettable<T, value>)
50#else
51 noexcept
52#endif
53 {
54 static_assert(std::is_default_constructible<T>::value, "The specified type is not default constructible.");
55 T out{};
56 SIMDJSON_TRY(get<T>(out));
57 return out;
58 }
59
60
72 template <typename T>
73 simdjson_warn_unused simdjson_inline error_code get(T &out)
74#if SIMDJSON_SUPPORTS_CONCEPTS
75 noexcept(nothrow_gettable<T, value>)
76#else
77 noexcept
78#endif
79 {
80 #if SIMDJSON_SUPPORTS_CONCEPTS
81 if constexpr (custom_deserializable<T, value>) {
82 return deserialize(*this, out);
83 } else if constexpr (concepts::optional_type<T>) {
84 using value_type = typename std::remove_cvref_t<T>::value_type;
85
86 // Check if the value is null
87 bool is_null_value;
88 SIMDJSON_TRY( is_null().get(is_null_value) );
89 if (is_null_value) {
90 out.reset(); // Set to nullopt
91 return SUCCESS;
92 }
93
94 if (!out) {
95 out.emplace();
96 }
97 return get<value_type>(out.value());
98 } else {
99 static_assert(!sizeof(T), "The get<T> method with type T is not implemented by the simdjson library. "
100 "And you do not seem to have added support for it. Indeed, we have that "
101 "simdjson::custom_deserializable<T> is false and the type T is not a default type "
102 "such as ondemand::object, ondemand::array, raw_json_string, std::string_view, uint64_t, "
103 "int64_t, uint32_t, int32_t, uint16_t, int16_t, uint8_t, int8_t, double, float, or bool.");
104 static_cast<void>(out); // to get rid of unused errors
105 return UNINITIALIZED;
106 }
107#else // SIMDJSON_SUPPORTS_CONCEPTS
108 // Unless the simdjson library or the user provides an inline implementation, calling this method should
109 // immediately fail.
110 static_assert(!sizeof(T), "The get method with given type is not implemented by the simdjson library. "
111 "The supported types are ondemand::object, ondemand::array, raw_json_string, std::string_view, uint64_t, "
112 "int64_t, uint32_t, int32_t, uint16_t, int16_t, uint8_t, int8_t, double, float, and bool. We recommend you use get_double(), get_float(), "
113 "get_bool(), get_uint64(), get_int64(), get_uint32(), get_int32(), get_uint16(), get_int16(), get_uint8(), get_int8(), "
114 " get_object(), get_array(), get_raw_json_string(), or get_string() instead of the get template."
115 " You may also add support for custom types, see our documentation.");
116 static_cast<void>(out); // to get rid of unused errors
117 return UNINITIALIZED;
118#endif
119 }
120
127 simdjson_inline simdjson_result<array> get_array() noexcept;
128
135 simdjson_inline simdjson_result<object> get_object() noexcept;
136
143 simdjson_inline simdjson_result<uint64_t> get_uint64() noexcept;
144
151 simdjson_inline simdjson_result<uint64_t> get_uint64_in_string() noexcept;
152
159 simdjson_inline simdjson_result<int64_t> get_int64() noexcept;
160
167 simdjson_inline simdjson_result<int64_t> get_int64_in_string() noexcept;
168
178 simdjson_inline simdjson_result<uint32_t> get_uint32() noexcept;
179
189 simdjson_inline simdjson_result<int32_t> get_int32() noexcept;
190
200 simdjson_inline simdjson_result<uint16_t> get_uint16() noexcept;
201
211 simdjson_inline simdjson_result<int16_t> get_int16() noexcept;
212
222 simdjson_inline simdjson_result<uint8_t> get_uint8() noexcept;
223
233 simdjson_inline simdjson_result<int8_t> get_int8() noexcept;
234
241 simdjson_inline simdjson_result<double> get_double() noexcept;
242
249 simdjson_inline simdjson_result<double> get_double_in_string() noexcept;
250
262 simdjson_inline simdjson_result<float> get_float() noexcept;
263
271 simdjson_inline simdjson_result<float> get_float_in_string() noexcept;
272
273#if SIMDJSON_SUPPORTS_FLOAT32_T
283 simdjson_inline simdjson_result<std::float32_t> get_float32() noexcept;
284#endif // SIMDJSON_SUPPORTS_FLOAT32_T
285
286#if SIMDJSON_SUPPORTS_FLOAT64_T
295 simdjson_inline simdjson_result<std::float64_t> get_float64() noexcept;
296#endif // SIMDJSON_SUPPORTS_FLOAT64_T
297
323 simdjson_inline simdjson_result<std::string_view> get_string(bool allow_replacement = false) noexcept;
324
325#if SIMDJSON_SUPPORTS_CHAR8_T
342 simdjson_inline simdjson_result<std::u8string_view> get_u8string(bool allow_replacement = false) noexcept;
343#endif // SIMDJSON_SUPPORTS_CHAR8_T
344
358 template <typename string_type>
359 simdjson_warn_unused simdjson_inline error_code get_string(string_type& receiver, bool allow_replacement = false) noexcept;
360
374 simdjson_inline simdjson_result<std::string_view> get_wobbly_string() noexcept;
383 simdjson_inline simdjson_result<raw_json_string> get_raw_json_string() noexcept;
384
391 simdjson_inline simdjson_result<bool> get_bool() noexcept;
392
401 simdjson_inline simdjson_result<bool> is_null() noexcept;
402
403#if SIMDJSON_EXCEPTIONS
413 template <class T>
414 explicit simdjson_inline operator T() noexcept(false);
421 simdjson_inline operator array() noexcept(false);
428 simdjson_inline operator object() noexcept(false);
435 simdjson_inline operator uint64_t() noexcept(false);
442 simdjson_inline operator int64_t() noexcept(false);
449 simdjson_inline operator double() noexcept(false);
461 simdjson_inline operator std::string_view() noexcept(false);
470 simdjson_inline operator raw_json_string() noexcept(false);
477 simdjson_inline operator bool() noexcept(false);
478#endif
479
487 simdjson_inline simdjson_result<array_iterator> begin() & noexcept;
493 simdjson_inline simdjson_result<array_iterator> end() & noexcept;
508 simdjson_inline simdjson_result<size_t> count_elements() & noexcept;
526 simdjson_inline simdjson_result<size_t> count_fields() & noexcept;
534 simdjson_inline simdjson_result<value> at(size_t index) noexcept;
559 simdjson_inline simdjson_result<value> find_field(std::string_view key) noexcept;
561 simdjson_inline simdjson_result<value> find_field(const char *key) noexcept;
562
586 simdjson_inline simdjson_result<value> find_field_unordered(std::string_view key) noexcept;
588 simdjson_inline simdjson_result<value> find_field_unordered(const char *key) noexcept;
590 simdjson_inline simdjson_result<value> operator[](std::string_view key) noexcept;
592 simdjson_inline simdjson_result<value> operator[](const char *key) noexcept;
593 simdjson_result<value> operator[](int) noexcept = delete;
594
608 simdjson_inline simdjson_result<json_type> type() noexcept;
609
617 simdjson_inline simdjson_result<bool> is_scalar() noexcept;
624 simdjson_inline simdjson_result<bool> is_string() noexcept;
625
631 simdjson_inline bool is_negative() noexcept;
645 simdjson_inline simdjson_result<bool> is_integer() noexcept;
670 simdjson_inline simdjson_result<number_type> get_number_type() noexcept;
671
704 simdjson_warn_unused simdjson_inline simdjson_result<number> get_number() noexcept;
705
731 simdjson_inline std::string_view raw_json_token() noexcept;
732
741 simdjson_inline simdjson_result<std::string_view> raw_json() noexcept;
742
746 simdjson_inline simdjson_result<const char *> current_location() noexcept;
747
757 simdjson_inline int32_t current_depth() const noexcept;
758
801 simdjson_inline simdjson_result<value> at_pointer(std::string_view json_pointer) noexcept;
802
814 simdjson_inline simdjson_result<value> at_path(std::string_view at_path) noexcept;
815
825#if SIMDJSON_SUPPORTS_CONCEPTS
826 template <typename Func>
827 requires std::invocable<Func, value>
828#else
829 template <typename Func>
830#endif
831 simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept;
832
833protected:
837 simdjson_inline value(const value_iterator &iter) noexcept;
838
842 simdjson_inline void skip() noexcept;
843
849 static simdjson_inline value start(const value_iterator &iter) noexcept;
850
854 static simdjson_inline value resume(const value_iterator &iter) noexcept;
855
859 simdjson_inline simdjson_result<object> start_or_resume_object() noexcept;
860
861 // simdjson_inline void log_value(const char *type) const noexcept;
862 // simdjson_inline void log_error(const char *message) const noexcept;
863
864 value_iterator iter{};
865
866 friend class document;
867 friend class array_iterator;
868 friend class field;
869 friend class object;
870 friend struct simdjson_result<value>;
871 friend struct simdjson_result<field>;
872 friend class field;
873};
874
875} // namespace ondemand
876} // namespace SIMDJSON_IMPLEMENTATION
877} // namespace simdjson
878
879namespace simdjson {
880
881template<>
882struct simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::value> : public SIMDJSON_IMPLEMENTATION::implementation_simdjson_result_base<SIMDJSON_IMPLEMENTATION::ondemand::value> {
883public:
884 simdjson_inline simdjson_result(SIMDJSON_IMPLEMENTATION::ondemand::value &&value) noexcept;
885 simdjson_inline simdjson_result(error_code error) noexcept;
886 simdjson_inline simdjson_result() noexcept = default;
887
888 simdjson_inline simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::array> get_array() noexcept;
889 simdjson_inline simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::object> get_object() noexcept;
890
891 simdjson_inline simdjson_result<uint64_t> get_uint64() noexcept;
892 simdjson_inline simdjson_result<uint64_t> get_uint64_in_string() noexcept;
893 simdjson_inline simdjson_result<int64_t> get_int64() noexcept;
894 simdjson_inline simdjson_result<int64_t> get_int64_in_string() noexcept;
895 simdjson_inline simdjson_result<uint32_t> get_uint32() noexcept;
896 simdjson_inline simdjson_result<int32_t> get_int32() noexcept;
897 simdjson_inline simdjson_result<uint16_t> get_uint16() noexcept;
898 simdjson_inline simdjson_result<int16_t> get_int16() noexcept;
899 simdjson_inline simdjson_result<uint8_t> get_uint8() noexcept;
900 simdjson_inline simdjson_result<int8_t> get_int8() noexcept;
901 simdjson_inline simdjson_result<double> get_double() noexcept;
902 simdjson_inline simdjson_result<double> get_double_in_string() noexcept;
903 simdjson_inline simdjson_result<float> get_float() noexcept;
904 simdjson_inline simdjson_result<float> get_float_in_string() noexcept;
905#if SIMDJSON_SUPPORTS_FLOAT32_T
906 simdjson_inline simdjson_result<std::float32_t> get_float32() noexcept;
907#endif // SIMDJSON_SUPPORTS_FLOAT32_T
908#if SIMDJSON_SUPPORTS_FLOAT64_T
909 simdjson_inline simdjson_result<std::float64_t> get_float64() noexcept;
910#endif // SIMDJSON_SUPPORTS_FLOAT64_T
911 simdjson_inline simdjson_result<std::string_view> get_string(bool allow_replacement = false) noexcept;
912#if SIMDJSON_SUPPORTS_CHAR8_T
913 simdjson_inline simdjson_result<std::u8string_view> get_u8string(bool allow_replacement = false) noexcept;
914#endif // SIMDJSON_SUPPORTS_CHAR8_T
915 template <typename string_type>
916 simdjson_warn_unused simdjson_inline error_code get_string(string_type& receiver, bool allow_replacement = false) noexcept;
917 simdjson_inline simdjson_result<std::string_view> get_wobbly_string() noexcept;
918 simdjson_inline simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::raw_json_string> get_raw_json_string() noexcept;
919 simdjson_inline simdjson_result<bool> get_bool() noexcept;
920 simdjson_inline simdjson_result<bool> is_null() noexcept;
921
922 template<typename T> simdjson_inline simdjson_result<T> get()
923#if SIMDJSON_SUPPORTS_CONCEPTS
924 noexcept(nothrow_gettable<T, SIMDJSON_IMPLEMENTATION::ondemand::value>);
925#else
926 noexcept;
927#endif
928
929 template<typename T> simdjson_inline error_code get(T &out)
930#if SIMDJSON_SUPPORTS_CONCEPTS
931 noexcept(nothrow_gettable<T, SIMDJSON_IMPLEMENTATION::ondemand::value>);
932#else
933 noexcept;
934#endif
935
936#if SIMDJSON_EXCEPTIONS
937 template <class T>
938 explicit simdjson_inline operator T() noexcept(false);
939 simdjson_inline operator SIMDJSON_IMPLEMENTATION::ondemand::array() noexcept(false);
940 simdjson_inline operator SIMDJSON_IMPLEMENTATION::ondemand::object() noexcept(false);
941 simdjson_inline operator uint64_t() noexcept(false);
942 simdjson_inline operator int64_t() noexcept(false);
943 simdjson_inline operator double() noexcept(false);
944 simdjson_inline operator std::string_view() noexcept(false);
945 simdjson_inline operator SIMDJSON_IMPLEMENTATION::ondemand::raw_json_string() noexcept(false);
946 simdjson_inline operator bool() noexcept(false);
947#endif
948 simdjson_inline simdjson_result<size_t> count_elements() & noexcept;
949 simdjson_inline simdjson_result<size_t> count_fields() & noexcept;
950 simdjson_inline simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::value> at(size_t index) noexcept;
953
976 simdjson_inline simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::value> find_field(std::string_view key) noexcept;
978 simdjson_inline simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::value> find_field(const char *key) noexcept;
979
1000 simdjson_inline simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::value> find_field_unordered(std::string_view key) noexcept;
1002 simdjson_inline simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::value> find_field_unordered(const char *key) noexcept;
1004 simdjson_inline simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::value> operator[](std::string_view key) noexcept;
1006 simdjson_inline simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::value> operator[](const char *key) noexcept;
1007 simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::value> operator[](int) noexcept = delete;
1008
1032 simdjson_inline simdjson_result<bool> is_scalar() noexcept;
1033 simdjson_inline simdjson_result<bool> is_string() noexcept;
1034 simdjson_inline simdjson_result<bool> is_negative() noexcept;
1035 simdjson_inline simdjson_result<bool> is_integer() noexcept;
1036 simdjson_inline simdjson_result<SIMDJSON_IMPLEMENTATION::number_type> get_number_type() noexcept;
1037 simdjson_inline simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::number> get_number() noexcept;
1038
1040 simdjson_inline simdjson_result<std::string_view> raw_json_token() noexcept;
1041 simdjson_inline simdjson_result<std::string_view> raw_json() noexcept;
1042
1044 simdjson_inline simdjson_result<const char *> current_location() noexcept;
1046 simdjson_inline simdjson_result<int32_t> current_depth() const noexcept;
1047 simdjson_inline simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::value> at_pointer(std::string_view json_pointer) noexcept;
1048 simdjson_inline simdjson_result<SIMDJSON_IMPLEMENTATION::ondemand::value> at_path(std::string_view json_path) noexcept;
1049#if SIMDJSON_SUPPORTS_CONCEPTS
1050 template <typename Func>
1051 requires std::invocable<Func, SIMDJSON_IMPLEMENTATION::ondemand::value>
1052#else
1053 template <typename Func>
1054#endif
1055 simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func&& callback) noexcept;
1056};
1057
1058// Forward-declare explicit specializations so MSVC /permissive- sees them before
1059// any template instantiation that would resolve element.get(val) to the primary.
1060template<> simdjson_inline error_code
1065
1066} // namespace simdjson
1067
1068#endif // SIMDJSON_GENERIC_ONDEMAND_VALUE_H
A JSON field (key/value pair) in an object.
Definition field.h:22
A forward-only JSON object field iterator.
Definition object.h:130
A string escaped per JSON rules, terminated with quote (").
An ephemeral JSON value returned during iteration.
Definition value.h:22
static simdjson_inline value start(const value_iterator &iter) noexcept
Start a value at the current position.
Definition value-inl.h:60
simdjson_inline simdjson_result< bool > is_null() noexcept
Checks if this JSON value is null.
Definition value-inl.h:160
simdjson_inline simdjson_result< const char * > current_location() noexcept
Returns the current location in the document if in bounds.
Definition value-inl.h:354
simdjson_inline simdjson_result< float > get_float_in_string() noexcept
Cast this JSON value (inside string) to a float (binary32).
Definition value-inl.h:110
simdjson_inline simdjson_result< value > find_field(std::string_view key) noexcept
Look up a field by name on an object (order-sensitive).
Definition value-inl.h:276
simdjson_inline simdjson_result< T > get() noexcept
Get this value as the given type.
Definition value.h:47
simdjson_inline bool is_negative() noexcept
Checks whether the value is a negative number.
Definition value-inl.h:316
simdjson_inline simdjson_result< float > get_float() noexcept
Cast this JSON value to a float (binary32).
Definition value-inl.h:107
simdjson_inline simdjson_result< number_type > get_number_type() noexcept
Determine the number type (integer or floating-point number) as quickly as possible.
Definition value-inl.h:323
simdjson_inline simdjson_result< array > get_array() noexcept
Cast this JSON value to an array.
Definition value-inl.h:67
simdjson_inline std::string_view raw_json_token() noexcept
Get the raw JSON for this token.
Definition value-inl.h:330
simdjson_inline simdjson_result< object > get_object() noexcept
Cast this JSON value to an object.
Definition value-inl.h:70
simdjson_inline simdjson_result< uint8_t > get_uint8() noexcept
Cast this JSON value to an 8-bit unsigned integer.
Definition value-inl.h:137
simdjson_inline simdjson_result< size_t > count_elements() &noexcept
This method scans the array and counts the number of elements.
Definition value-inl.h:254
simdjson_inline simdjson_result< int64_t > get_int64_in_string() noexcept
Cast this JSON value (inside string) to a signed integer.
Definition value-inl.h:122
simdjson_inline simdjson_result< size_t > count_fields() &noexcept
This method scans the object and counts the number of key-value pairs.
Definition value-inl.h:264
simdjson_inline simdjson_result< bool > is_integer() noexcept
Checks whether the value is an integer number.
Definition value-inl.h:320
simdjson_inline simdjson_result< int8_t > get_int8() noexcept
Cast this JSON value to an 8-bit signed integer.
Definition value-inl.h:140
simdjson_inline simdjson_result< array_iterator > end() &noexcept
Sentinel representing the end of the array.
Definition value-inl.h:251
simdjson_inline simdjson_result< value > at_path(std::string_view at_path) noexcept
Get the value associated with the given JSONPath expression.
Definition value-inl.h:400
simdjson_inline simdjson_result< object > start_or_resume_object() noexcept
Get the object, starting or resuming it as necessary.
Definition value-inl.h:73
simdjson_inline simdjson_result< array_iterator > begin() &noexcept
Begin array iteration.
Definition value-inl.h:248
simdjson_inline simdjson_result< uint64_t > get_uint64_in_string() noexcept
Cast this JSON value (inside string) to a unsigned integer.
Definition value-inl.h:116
simdjson_inline int32_t current_depth() const noexcept
Returns the current depth in the document if in bounds.
Definition value-inl.h:358
simdjson_inline simdjson_result< int16_t > get_int16() noexcept
Cast this JSON value to a 16-bit signed integer.
Definition value-inl.h:134
simdjson_inline simdjson_result< bool > is_scalar() noexcept
Checks whether the value is a scalar (string, number, null, Boolean).
Definition value-inl.h:301
simdjson_inline operator std::string_view() noexcept(false)
Cast this JSON value to a string.
Definition value-inl.h:237
simdjson_inline simdjson_result< std::string_view > raw_json() noexcept
Get a string_view pointing at this value in the JSON document.
Definition value-inl.h:334
static simdjson_inline value resume(const value_iterator &iter) noexcept
Resume a value.
Definition value-inl.h:63
simdjson_inline simdjson_result< double > get_double() noexcept
Cast this JSON value to a double.
Definition value-inl.h:101
simdjson_inline simdjson_result< std::string_view > get_string(bool allow_replacement=false) noexcept
Cast this JSON value to a string.
Definition value-inl.h:84
simdjson_inline simdjson_result< bool > get_bool() noexcept
Cast this JSON value to a bool.
Definition value-inl.h:157
simdjson_warn_unused simdjson_inline simdjson_result< number > get_number() noexcept
Attempt to parse an ondemand::number.
Definition value-inl.h:326
simdjson_inline simdjson_result< value > at_pointer(std::string_view json_pointer) noexcept
Get the value associated with the given JSON pointer.
Definition value-inl.h:382
simdjson_inline simdjson_result< std::string_view > get_wobbly_string() noexcept
Cast this JSON value to a "wobbly" string.
Definition value-inl.h:98
simdjson_inline simdjson_result< int64_t > get_int64() noexcept
Cast this JSON value to a signed integer.
Definition value-inl.h:119
simdjson_inline value() noexcept=default
Create a new invalid value.
simdjson_inline error_code for_each_at_path_with_wildcard(std::string_view json_path, Func &&callback) noexcept
Call the provided callback for each value matching the given JSONPath expression with wildcard suppor...
simdjson_warn_unused simdjson_inline error_code get(T &out) noexcept
Get this value as the given type.
Definition value.h:73
simdjson_inline simdjson_result< json_type > type() noexcept
Get the type of this JSON value.
Definition value-inl.h:297
simdjson_inline simdjson_result< double > get_double_in_string() noexcept
Cast this JSON value (inside string) to a double.
Definition value-inl.h:104
simdjson_inline simdjson_result< raw_json_string > get_raw_json_string() noexcept
Cast this JSON value to a raw_json_string.
Definition value-inl.h:81
simdjson_inline simdjson_result< value > find_field_unordered(std::string_view key) noexcept
Look up a field by name on an object, without regard to key order.
Definition value-inl.h:283
simdjson_inline simdjson_result< value > at(size_t index) noexcept
Get the value at the given index in the array.
Definition value-inl.h:271
simdjson_inline simdjson_result< uint16_t > get_uint16() noexcept
Cast this JSON value to a 16-bit unsigned integer.
Definition value-inl.h:131
simdjson_inline simdjson_result< uint64_t > get_uint64() noexcept
Cast this JSON value to an unsigned integer.
Definition value-inl.h:113
simdjson_inline void skip() noexcept
Skip this value, allowing iteration to continue.
simdjson_inline simdjson_result< int32_t > get_int32() noexcept
Cast this JSON value to a 32-bit signed integer.
Definition value-inl.h:128
simdjson_inline simdjson_result< uint32_t > get_uint32() noexcept
Cast this JSON value to a 32-bit unsigned integer.
Definition value-inl.h:125
simdjson_inline simdjson_result< bool > is_string() noexcept
Checks whether the value is a string.
Definition value-inl.h:308
The top level simdjson namespace, containing everything the library provides.
Definition base.h:8
error_code
All possible errors returned by simdjson.
Definition error.h:19
@ SUCCESS
No error.
Definition error.h:20
@ UNINITIALIZED
unknown error, or uninitialized document
Definition error.h:32
A type representing a JSON number.
Definition json_type.h:33
The result of a simdjson operation that could fail.
Definition error.h:281
simdjson_inline error_code error() const noexcept
The error.
Definition error-inl.h:168
simdjson_warn_unused simdjson_inline error_code get(T &value) &&noexcept
Move the value to the provided variable.
Definition error-inl.h:163