mirror of
https://github.com/simdjson/simdjson
synced 2026-06-08 17:27:07 +00:00
3.13.0
This commit is contained in:
+162
-11
@@ -1,4 +1,4 @@
|
||||
/* auto-generated on 2025-03-27 15:01:10 -0400. Do not edit! */
|
||||
/* auto-generated on 2025-06-04 00:22:10 -0400. Do not edit! */
|
||||
/* including simdjson.cpp: */
|
||||
/* begin file simdjson.cpp */
|
||||
#define SIMDJSON_SRC_SIMDJSON_CPP
|
||||
@@ -373,7 +373,7 @@ double from_chars(const char *first, const char* end) noexcept;
|
||||
}
|
||||
|
||||
#ifndef SIMDJSON_EXCEPTIONS
|
||||
#if __cpp_exceptions
|
||||
#if defined(__cpp_exceptions) || defined(_CPPUNWIND)
|
||||
#define SIMDJSON_EXCEPTIONS 1
|
||||
#else
|
||||
#define SIMDJSON_EXCEPTIONS 0
|
||||
@@ -576,12 +576,14 @@ double from_chars(const char *first, const char* end) noexcept;
|
||||
// even if we do not have C++17 support.
|
||||
#ifdef __cpp_lib_string_view
|
||||
#define SIMDJSON_HAS_STRING_VIEW
|
||||
#include <string_view>
|
||||
#endif
|
||||
|
||||
// Some systems have string_view even if we do not have C++17 support,
|
||||
// and even if __cpp_lib_string_view is undefined, it is the case
|
||||
// with Apple clang version 11.
|
||||
// We must handle it. *This is important.*
|
||||
#ifndef _MSC_VER
|
||||
#ifndef SIMDJSON_HAS_STRING_VIEW
|
||||
#if defined __has_include
|
||||
// do not combine the next #if with the previous one (unsafe)
|
||||
@@ -597,6 +599,7 @@ double from_chars(const char *first, const char* end) noexcept;
|
||||
#endif // __has_include (<string_view>)
|
||||
#endif // defined __has_include
|
||||
#endif // def SIMDJSON_HAS_STRING_VIEW
|
||||
#endif // def _MSC_VER
|
||||
// end of complicated but important routine to try to detect string_view.
|
||||
|
||||
//
|
||||
@@ -2607,6 +2610,7 @@ struct simdjson_result_base : protected std::pair<T, error_code> {
|
||||
* @throw simdjson_error if there was an error.
|
||||
*/
|
||||
simdjson_inline operator T&&() && noexcept(false);
|
||||
|
||||
#endif // SIMDJSON_EXCEPTIONS
|
||||
|
||||
/**
|
||||
@@ -2663,7 +2667,17 @@ struct simdjson_result : public internal::simdjson_result_base<T> {
|
||||
* @param value The variable to assign the value to. May not be set if there is an error.
|
||||
*/
|
||||
simdjson_warn_unused simdjson_inline error_code get(T &value) && noexcept;
|
||||
|
||||
//
|
||||
/**
|
||||
* Copy the value to a provided std::string, only enabled for std::string_view.
|
||||
*
|
||||
* @param value The variable to assign the value to. May not be set if there is an error.
|
||||
*/
|
||||
simdjson_warn_unused simdjson_inline error_code get(std::string &value) && noexcept
|
||||
#if SIMDJSON_SUPPORTS_DESERIALIZATION
|
||||
requires (!std::is_same_v<T, std::string>)
|
||||
#endif // SIMDJSON_SUPPORTS_DESERIALIZATION
|
||||
;
|
||||
/**
|
||||
* The error.
|
||||
*/
|
||||
@@ -4663,6 +4677,23 @@ simdjson_warn_unused simdjson_inline error_code simdjson_result<T>::get(T &value
|
||||
return std::forward<internal::simdjson_result_base<T>>(*this).get(value);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
simdjson_warn_unused simdjson_inline error_code
|
||||
simdjson_result<T>::get(std::string &value) && noexcept
|
||||
#if SIMDJSON_SUPPORTS_DESERIALIZATION
|
||||
requires (!std::is_same_v<T, std::string>)
|
||||
#endif // SIMDJSON_SUPPORTS_DESERIALIZATION
|
||||
{
|
||||
// SFINAE : n'active que pour T = std::string_view
|
||||
static_assert(std::is_same<T, std::string_view>::value, "simdjson_result<T>::get(std::string&) n'est disponible que pour T = std::string_view");
|
||||
std::string_view v;
|
||||
error_code error = std::forward<simdjson_result<T>>(*this).get(v);
|
||||
if (!error) {
|
||||
value.assign(v.data(), v.size());
|
||||
}
|
||||
return error;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
simdjson_inline error_code simdjson_result<T>::error() const noexcept {
|
||||
return internal::simdjson_result_base<T>::error();
|
||||
@@ -9726,7 +9757,16 @@ simdjson_inline error_code parse_number(const uint8_t *const src, W &writer) {
|
||||
if (i > uint64_t(INT64_MAX)) {
|
||||
WRITE_UNSIGNED(i, src, writer);
|
||||
} else {
|
||||
WRITE_INTEGER(negative ? (~i+1) : i, src, writer);
|
||||
#if SIMDJSON_MINUS_ZERO_AS_FLOAT
|
||||
if(i == 0 && negative) {
|
||||
// We have to write -0.0 instead of 0
|
||||
WRITE_DOUBLE(-0.0, src, writer);
|
||||
} else {
|
||||
WRITE_INTEGER(negative ? (~i+1) : i, src, writer);
|
||||
}
|
||||
#else
|
||||
WRITE_INTEGER(negative ? (~i+1) : i, src, writer);
|
||||
#endif
|
||||
}
|
||||
if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return INVALID_NUMBER(src); }
|
||||
return SUCCESS;
|
||||
@@ -10187,6 +10227,12 @@ simdjson_unused simdjson_inline simdjson_result<number_type> get_number_type(con
|
||||
if (simdjson_unlikely(digit_count == 19 && memcmp(src, smaller_big_integer, 19) > 0)) {
|
||||
return number_type::big_integer;
|
||||
}
|
||||
#if SIMDJSON_MINUS_ZERO_AS_FLOAT
|
||||
if(digit_count == 1 && src[0] == '0') {
|
||||
// We have to write -0.0 instead of 0
|
||||
return number_type::floating_point_number;
|
||||
}
|
||||
#endif
|
||||
return number_type::signed_integer;
|
||||
}
|
||||
// Let us check if we have a big integer (>=2**64).
|
||||
@@ -16086,7 +16132,16 @@ simdjson_inline error_code parse_number(const uint8_t *const src, W &writer) {
|
||||
if (i > uint64_t(INT64_MAX)) {
|
||||
WRITE_UNSIGNED(i, src, writer);
|
||||
} else {
|
||||
WRITE_INTEGER(negative ? (~i+1) : i, src, writer);
|
||||
#if SIMDJSON_MINUS_ZERO_AS_FLOAT
|
||||
if(i == 0 && negative) {
|
||||
// We have to write -0.0 instead of 0
|
||||
WRITE_DOUBLE(-0.0, src, writer);
|
||||
} else {
|
||||
WRITE_INTEGER(negative ? (~i+1) : i, src, writer);
|
||||
}
|
||||
#else
|
||||
WRITE_INTEGER(negative ? (~i+1) : i, src, writer);
|
||||
#endif
|
||||
}
|
||||
if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return INVALID_NUMBER(src); }
|
||||
return SUCCESS;
|
||||
@@ -16547,6 +16602,12 @@ simdjson_unused simdjson_inline simdjson_result<number_type> get_number_type(con
|
||||
if (simdjson_unlikely(digit_count == 19 && memcmp(src, smaller_big_integer, 19) > 0)) {
|
||||
return number_type::big_integer;
|
||||
}
|
||||
#if SIMDJSON_MINUS_ZERO_AS_FLOAT
|
||||
if(digit_count == 1 && src[0] == '0') {
|
||||
// We have to write -0.0 instead of 0
|
||||
return number_type::floating_point_number;
|
||||
}
|
||||
#endif
|
||||
return number_type::signed_integer;
|
||||
}
|
||||
// Let us check if we have a big integer (>=2**64).
|
||||
@@ -22310,7 +22371,16 @@ simdjson_inline error_code parse_number(const uint8_t *const src, W &writer) {
|
||||
if (i > uint64_t(INT64_MAX)) {
|
||||
WRITE_UNSIGNED(i, src, writer);
|
||||
} else {
|
||||
WRITE_INTEGER(negative ? (~i+1) : i, src, writer);
|
||||
#if SIMDJSON_MINUS_ZERO_AS_FLOAT
|
||||
if(i == 0 && negative) {
|
||||
// We have to write -0.0 instead of 0
|
||||
WRITE_DOUBLE(-0.0, src, writer);
|
||||
} else {
|
||||
WRITE_INTEGER(negative ? (~i+1) : i, src, writer);
|
||||
}
|
||||
#else
|
||||
WRITE_INTEGER(negative ? (~i+1) : i, src, writer);
|
||||
#endif
|
||||
}
|
||||
if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return INVALID_NUMBER(src); }
|
||||
return SUCCESS;
|
||||
@@ -22771,6 +22841,12 @@ simdjson_unused simdjson_inline simdjson_result<number_type> get_number_type(con
|
||||
if (simdjson_unlikely(digit_count == 19 && memcmp(src, smaller_big_integer, 19) > 0)) {
|
||||
return number_type::big_integer;
|
||||
}
|
||||
#if SIMDJSON_MINUS_ZERO_AS_FLOAT
|
||||
if(digit_count == 1 && src[0] == '0') {
|
||||
// We have to write -0.0 instead of 0
|
||||
return number_type::floating_point_number;
|
||||
}
|
||||
#endif
|
||||
return number_type::signed_integer;
|
||||
}
|
||||
// Let us check if we have a big integer (>=2**64).
|
||||
@@ -28690,7 +28766,16 @@ simdjson_inline error_code parse_number(const uint8_t *const src, W &writer) {
|
||||
if (i > uint64_t(INT64_MAX)) {
|
||||
WRITE_UNSIGNED(i, src, writer);
|
||||
} else {
|
||||
WRITE_INTEGER(negative ? (~i+1) : i, src, writer);
|
||||
#if SIMDJSON_MINUS_ZERO_AS_FLOAT
|
||||
if(i == 0 && negative) {
|
||||
// We have to write -0.0 instead of 0
|
||||
WRITE_DOUBLE(-0.0, src, writer);
|
||||
} else {
|
||||
WRITE_INTEGER(negative ? (~i+1) : i, src, writer);
|
||||
}
|
||||
#else
|
||||
WRITE_INTEGER(negative ? (~i+1) : i, src, writer);
|
||||
#endif
|
||||
}
|
||||
if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return INVALID_NUMBER(src); }
|
||||
return SUCCESS;
|
||||
@@ -29151,6 +29236,12 @@ simdjson_unused simdjson_inline simdjson_result<number_type> get_number_type(con
|
||||
if (simdjson_unlikely(digit_count == 19 && memcmp(src, smaller_big_integer, 19) > 0)) {
|
||||
return number_type::big_integer;
|
||||
}
|
||||
#if SIMDJSON_MINUS_ZERO_AS_FLOAT
|
||||
if(digit_count == 1 && src[0] == '0') {
|
||||
// We have to write -0.0 instead of 0
|
||||
return number_type::floating_point_number;
|
||||
}
|
||||
#endif
|
||||
return number_type::signed_integer;
|
||||
}
|
||||
// Let us check if we have a big integer (>=2**64).
|
||||
@@ -35432,7 +35523,16 @@ simdjson_inline error_code parse_number(const uint8_t *const src, W &writer) {
|
||||
if (i > uint64_t(INT64_MAX)) {
|
||||
WRITE_UNSIGNED(i, src, writer);
|
||||
} else {
|
||||
WRITE_INTEGER(negative ? (~i+1) : i, src, writer);
|
||||
#if SIMDJSON_MINUS_ZERO_AS_FLOAT
|
||||
if(i == 0 && negative) {
|
||||
// We have to write -0.0 instead of 0
|
||||
WRITE_DOUBLE(-0.0, src, writer);
|
||||
} else {
|
||||
WRITE_INTEGER(negative ? (~i+1) : i, src, writer);
|
||||
}
|
||||
#else
|
||||
WRITE_INTEGER(negative ? (~i+1) : i, src, writer);
|
||||
#endif
|
||||
}
|
||||
if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return INVALID_NUMBER(src); }
|
||||
return SUCCESS;
|
||||
@@ -35893,6 +35993,12 @@ simdjson_unused simdjson_inline simdjson_result<number_type> get_number_type(con
|
||||
if (simdjson_unlikely(digit_count == 19 && memcmp(src, smaller_big_integer, 19) > 0)) {
|
||||
return number_type::big_integer;
|
||||
}
|
||||
#if SIMDJSON_MINUS_ZERO_AS_FLOAT
|
||||
if(digit_count == 1 && src[0] == '0') {
|
||||
// We have to write -0.0 instead of 0
|
||||
return number_type::floating_point_number;
|
||||
}
|
||||
#endif
|
||||
return number_type::signed_integer;
|
||||
}
|
||||
// Let us check if we have a big integer (>=2**64).
|
||||
@@ -41998,7 +42104,16 @@ simdjson_inline error_code parse_number(const uint8_t *const src, W &writer) {
|
||||
if (i > uint64_t(INT64_MAX)) {
|
||||
WRITE_UNSIGNED(i, src, writer);
|
||||
} else {
|
||||
WRITE_INTEGER(negative ? (~i+1) : i, src, writer);
|
||||
#if SIMDJSON_MINUS_ZERO_AS_FLOAT
|
||||
if(i == 0 && negative) {
|
||||
// We have to write -0.0 instead of 0
|
||||
WRITE_DOUBLE(-0.0, src, writer);
|
||||
} else {
|
||||
WRITE_INTEGER(negative ? (~i+1) : i, src, writer);
|
||||
}
|
||||
#else
|
||||
WRITE_INTEGER(negative ? (~i+1) : i, src, writer);
|
||||
#endif
|
||||
}
|
||||
if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return INVALID_NUMBER(src); }
|
||||
return SUCCESS;
|
||||
@@ -42459,6 +42574,12 @@ simdjson_unused simdjson_inline simdjson_result<number_type> get_number_type(con
|
||||
if (simdjson_unlikely(digit_count == 19 && memcmp(src, smaller_big_integer, 19) > 0)) {
|
||||
return number_type::big_integer;
|
||||
}
|
||||
#if SIMDJSON_MINUS_ZERO_AS_FLOAT
|
||||
if(digit_count == 1 && src[0] == '0') {
|
||||
// We have to write -0.0 instead of 0
|
||||
return number_type::floating_point_number;
|
||||
}
|
||||
#endif
|
||||
return number_type::signed_integer;
|
||||
}
|
||||
// Let us check if we have a big integer (>=2**64).
|
||||
@@ -48009,7 +48130,16 @@ simdjson_inline error_code parse_number(const uint8_t *const src, W &writer) {
|
||||
if (i > uint64_t(INT64_MAX)) {
|
||||
WRITE_UNSIGNED(i, src, writer);
|
||||
} else {
|
||||
WRITE_INTEGER(negative ? (~i+1) : i, src, writer);
|
||||
#if SIMDJSON_MINUS_ZERO_AS_FLOAT
|
||||
if(i == 0 && negative) {
|
||||
// We have to write -0.0 instead of 0
|
||||
WRITE_DOUBLE(-0.0, src, writer);
|
||||
} else {
|
||||
WRITE_INTEGER(negative ? (~i+1) : i, src, writer);
|
||||
}
|
||||
#else
|
||||
WRITE_INTEGER(negative ? (~i+1) : i, src, writer);
|
||||
#endif
|
||||
}
|
||||
if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return INVALID_NUMBER(src); }
|
||||
return SUCCESS;
|
||||
@@ -48470,6 +48600,12 @@ simdjson_unused simdjson_inline simdjson_result<number_type> get_number_type(con
|
||||
if (simdjson_unlikely(digit_count == 19 && memcmp(src, smaller_big_integer, 19) > 0)) {
|
||||
return number_type::big_integer;
|
||||
}
|
||||
#if SIMDJSON_MINUS_ZERO_AS_FLOAT
|
||||
if(digit_count == 1 && src[0] == '0') {
|
||||
// We have to write -0.0 instead of 0
|
||||
return number_type::floating_point_number;
|
||||
}
|
||||
#endif
|
||||
return number_type::signed_integer;
|
||||
}
|
||||
// Let us check if we have a big integer (>=2**64).
|
||||
@@ -53619,7 +53755,16 @@ simdjson_inline error_code parse_number(const uint8_t *const src, W &writer) {
|
||||
if (i > uint64_t(INT64_MAX)) {
|
||||
WRITE_UNSIGNED(i, src, writer);
|
||||
} else {
|
||||
WRITE_INTEGER(negative ? (~i+1) : i, src, writer);
|
||||
#if SIMDJSON_MINUS_ZERO_AS_FLOAT
|
||||
if(i == 0 && negative) {
|
||||
// We have to write -0.0 instead of 0
|
||||
WRITE_DOUBLE(-0.0, src, writer);
|
||||
} else {
|
||||
WRITE_INTEGER(negative ? (~i+1) : i, src, writer);
|
||||
}
|
||||
#else
|
||||
WRITE_INTEGER(negative ? (~i+1) : i, src, writer);
|
||||
#endif
|
||||
}
|
||||
if (jsoncharutils::is_not_structural_or_whitespace(*p)) { return INVALID_NUMBER(src); }
|
||||
return SUCCESS;
|
||||
@@ -54080,6 +54225,12 @@ simdjson_unused simdjson_inline simdjson_result<number_type> get_number_type(con
|
||||
if (simdjson_unlikely(digit_count == 19 && memcmp(src, smaller_big_integer, 19) > 0)) {
|
||||
return number_type::big_integer;
|
||||
}
|
||||
#if SIMDJSON_MINUS_ZERO_AS_FLOAT
|
||||
if(digit_count == 1 && src[0] == '0') {
|
||||
// We have to write -0.0 instead of 0
|
||||
return number_type::floating_point_number;
|
||||
}
|
||||
#endif
|
||||
return number_type::signed_integer;
|
||||
}
|
||||
// Let us check if we have a big integer (>=2**64).
|
||||
|
||||
Reference in New Issue
Block a user