1- /* auto-generated on 2025-11-03 11:03:21 -0500. version 4.2.1 Do not edit! */
1+ /* auto-generated on 2025-11-11 14:17:08 -0500. version 4.2.2 Do not edit! */
22/* including simdjson.h: */
33/* begin file simdjson.h */
44#ifndef SIMDJSON_H
@@ -2513,7 +2513,7 @@ namespace std {
25132513#define SIMDJSON_SIMDJSON_VERSION_H
25142514
25152515/** The version of simdjson being used (major.minor.revision) */
2516- #define SIMDJSON_VERSION "4.2.1 "
2516+ #define SIMDJSON_VERSION "4.2.2 "
25172517
25182518namespace simdjson {
25192519enum {
@@ -2528,7 +2528,7 @@ enum {
25282528 /**
25292529 * The revision (major.minor.REVISION) of simdjson being used.
25302530 */
2531- SIMDJSON_VERSION_REVISION = 1
2531+ SIMDJSON_VERSION_REVISION = 2
25322532};
25332533} // namespace simdjson
25342534
@@ -2815,6 +2815,8 @@ struct simdjson_result_base : protected std::pair<T, error_code> {
28152815 */
28162816 simdjson_inline T&& value_unsafe() && noexcept;
28172817
2818+ using value_type = T;
2819+ using error_type = error_code;
28182820}; // struct simdjson_result_base
28192821
28202822} // namespace internal
@@ -2926,6 +2928,8 @@ struct simdjson_result : public internal::simdjson_result_base<T> {
29262928 */
29272929 simdjson_inline T&& value_unsafe() && noexcept;
29282930
2931+ using value_type = T;
2932+ using error_type = error_code;
29292933}; // struct simdjson_result
29302934
29312935#if SIMDJSON_EXCEPTIONS
@@ -4165,6 +4169,19 @@ struct padded_string final {
41654169 **/
41664170 inline static simdjson_result<padded_string> load(std::string_view path) noexcept;
41674171
4172+ #if defined(_WIN32) && SIMDJSON_CPLUSPLUS17
4173+ /**
4174+ * This function accepts a wide string path (UTF-16) and converts it to
4175+ * UTF-8 before loading the file. This allows windows users to work
4176+ * with unicode file paths without manually converting the paths everytime.
4177+ *
4178+ * @return IO_ERROR on error, including conversion failures.
4179+ *
4180+ * @param path the path to the file as a wide string.
4181+ **/
4182+ inline static simdjson_result<padded_string> load(std::wstring_view path) noexcept;
4183+ #endif
4184+
41684185private:
41694186 padded_string &operator=(const padded_string &o) = delete;
41704187 padded_string(const padded_string &o) = delete;
@@ -4476,6 +4493,7 @@ inline padded_string_view pad_with_reserve(std::string& s) noexcept {
44764493/* end file simdjson/padded_string_view-inl.h */
44774494
44784495#include <climits>
4496+ #include <cwchar>
44794497
44804498namespace simdjson {
44814499namespace internal {
@@ -4653,6 +4671,62 @@ inline simdjson_result<padded_string> padded_string::load(std::string_view filen
46534671 return s;
46544672}
46554673
4674+ #if defined(_WIN32) && SIMDJSON_CPLUSPLUS17
4675+ inline simdjson_result<padded_string> padded_string::load(std::wstring_view filename) noexcept {
4676+ // Open the file using the wide characters
4677+ SIMDJSON_PUSH_DISABLE_WARNINGS
4678+ SIMDJSON_DISABLE_DEPRECATED_WARNING // Disable CRT_SECURE warning on MSVC: manually verified this is safe
4679+ std::FILE *fp = _wfopen(filename.data(), L"rb");
4680+ SIMDJSON_POP_DISABLE_WARNINGS
4681+
4682+ if (fp == nullptr) {
4683+ return IO_ERROR;
4684+ }
4685+
4686+ // Get the file size
4687+ int ret;
4688+ #if SIMDJSON_VISUAL_STUDIO && !SIMDJSON_IS_32BITS
4689+ ret = _fseeki64(fp, 0, SEEK_END);
4690+ #else
4691+ ret = std::fseek(fp, 0, SEEK_END);
4692+ #endif // _WIN64
4693+ if(ret < 0) {
4694+ std::fclose(fp);
4695+ return IO_ERROR;
4696+ }
4697+ #if SIMDJSON_VISUAL_STUDIO && !SIMDJSON_IS_32BITS
4698+ __int64 llen = _ftelli64(fp);
4699+ if(llen == -1L) {
4700+ std::fclose(fp);
4701+ return IO_ERROR;
4702+ }
4703+ #else
4704+ long llen = std::ftell(fp);
4705+ if((llen < 0) || (llen == LONG_MAX)) {
4706+ std::fclose(fp);
4707+ return IO_ERROR;
4708+ }
4709+ #endif
4710+
4711+ // Allocate the padded_string
4712+ size_t len = static_cast<size_t>(llen);
4713+ padded_string s(len);
4714+ if (s.data() == nullptr) {
4715+ std::fclose(fp);
4716+ return MEMALLOC;
4717+ }
4718+
4719+ // Read the padded_string
4720+ std::rewind(fp);
4721+ size_t bytes_read = std::fread(s.data(), 1, len, fp);
4722+ if (std::fclose(fp) != 0 || bytes_read != len) {
4723+ return IO_ERROR;
4724+ }
4725+
4726+ return s;
4727+ }
4728+ #endif
4729+
46564730} // namespace simdjson
46574731
46584732inline simdjson::padded_string operator ""_padded(const char *str, size_t len) {
@@ -12996,6 +13070,9 @@ struct implementation_simdjson_result_base {
1299613070 */
1299713071 simdjson_inline T&& value_unsafe() && noexcept;
1299813072
13073+ using value_type = T;
13074+ using error_type = error_code;
13075+
1299913076protected:
1300013077 /** users should never directly access first and second. **/
1300113078 T first{}; /** Users should never directly access 'first'. **/
@@ -15191,6 +15268,9 @@ struct implementation_simdjson_result_base {
1519115268 */
1519215269 simdjson_inline T&& value_unsafe() && noexcept;
1519315270
15271+ using value_type = T;
15272+ using error_type = error_code;
15273+
1519415274protected:
1519515275 /** users should never directly access first and second. **/
1519615276 T first{}; /** Users should never directly access 'first'. **/
@@ -17885,6 +17965,9 @@ struct implementation_simdjson_result_base {
1788517965 */
1788617966 simdjson_inline T&& value_unsafe() && noexcept;
1788717967
17968+ using value_type = T;
17969+ using error_type = error_code;
17970+
1788817971protected:
1788917972 /** users should never directly access first and second. **/
1789017973 T first{}; /** Users should never directly access 'first'. **/
@@ -20579,6 +20662,9 @@ struct implementation_simdjson_result_base {
2057920662 */
2058020663 simdjson_inline T&& value_unsafe() && noexcept;
2058120664
20665+ using value_type = T;
20666+ using error_type = error_code;
20667+
2058220668protected:
2058320669 /** users should never directly access first and second. **/
2058420670 T first{}; /** Users should never directly access 'first'. **/
@@ -23388,6 +23474,9 @@ struct implementation_simdjson_result_base {
2338823474 */
2338923475 simdjson_inline T&& value_unsafe() && noexcept;
2339023476
23477+ using value_type = T;
23478+ using error_type = error_code;
23479+
2339123480protected:
2339223481 /** users should never directly access first and second. **/
2339323482 T first{}; /** Users should never directly access 'first'. **/
@@ -26513,6 +26602,9 @@ struct implementation_simdjson_result_base {
2651326602 */
2651426603 simdjson_inline T&& value_unsafe() && noexcept;
2651526604
26605+ using value_type = T;
26606+ using error_type = error_code;
26607+
2651626608protected:
2651726609 /** users should never directly access first and second. **/
2651826610 T first{}; /** Users should never directly access 'first'. **/
@@ -29115,6 +29207,9 @@ struct implementation_simdjson_result_base {
2911529207 */
2911629208 simdjson_inline T&& value_unsafe() && noexcept;
2911729209
29210+ using value_type = T;
29211+ using error_type = error_code;
29212+
2911829213protected:
2911929214 /** users should never directly access first and second. **/
2912029215 T first{}; /** Users should never directly access 'first'. **/
@@ -31730,6 +31825,9 @@ struct implementation_simdjson_result_base {
3173031825 */
3173131826 simdjson_inline T&& value_unsafe() && noexcept;
3173231827
31828+ using value_type = T;
31829+ using error_type = error_code;
31830+
3173331831protected:
3173431832 /** users should never directly access first and second. **/
3173531833 T first{}; /** Users should never directly access 'first'. **/
@@ -46859,7 +46957,7 @@ template <std::ranges::range R>
4685946957simdjson_inline void string_builder::append(const R &range) noexcept {
4686046958 auto it = std::ranges::begin(range);
4686146959 auto end = std::ranges::end(range);
46862- if constexpr (concepts::is_pair<typename R::value_type >) {
46960+ if constexpr (concepts::is_pair<std::ranges::range_value_t<R> >) {
4686346961 start_object();
4686446962
4686546963 if (it == end) {
@@ -61324,7 +61422,7 @@ template <std::ranges::range R>
6132461422simdjson_inline void string_builder::append(const R &range) noexcept {
6132561423 auto it = std::ranges::begin(range);
6132661424 auto end = std::ranges::end(range);
61327- if constexpr (concepts::is_pair<typename R::value_type >) {
61425+ if constexpr (concepts::is_pair<std::ranges::range_value_t<R> >) {
6132861426 start_object();
6132961427
6133061428 if (it == end) {
@@ -76288,7 +76386,7 @@ template <std::ranges::range R>
7628876386simdjson_inline void string_builder::append(const R &range) noexcept {
7628976387 auto it = std::ranges::begin(range);
7629076388 auto end = std::ranges::end(range);
76291- if constexpr (concepts::is_pair<typename R::value_type >) {
76389+ if constexpr (concepts::is_pair<std::ranges::range_value_t<R> >) {
7629276390 start_object();
7629376391
7629476392 if (it == end) {
@@ -91252,7 +91350,7 @@ template <std::ranges::range R>
9125291350simdjson_inline void string_builder::append(const R &range) noexcept {
9125391351 auto it = std::ranges::begin(range);
9125491352 auto end = std::ranges::end(range);
91255- if constexpr (concepts::is_pair<typename R::value_type >) {
91353+ if constexpr (concepts::is_pair<std::ranges::range_value_t<R> >) {
9125691354 start_object();
9125791355
9125891356 if (it == end) {
@@ -106331,7 +106429,7 @@ template <std::ranges::range R>
106331106429simdjson_inline void string_builder::append(const R &range) noexcept {
106332106430 auto it = std::ranges::begin(range);
106333106431 auto end = std::ranges::end(range);
106334- if constexpr (concepts::is_pair<typename R::value_type >) {
106432+ if constexpr (concepts::is_pair<std::ranges::range_value_t<R> >) {
106335106433 start_object();
106336106434
106337106435 if (it == end) {
@@ -121726,7 +121824,7 @@ template <std::ranges::range R>
121726121824simdjson_inline void string_builder::append(const R &range) noexcept {
121727121825 auto it = std::ranges::begin(range);
121728121826 auto end = std::ranges::end(range);
121729- if constexpr (concepts::is_pair<typename R::value_type >) {
121827+ if constexpr (concepts::is_pair<std::ranges::range_value_t<R> >) {
121730121828 start_object();
121731121829
121732121830 if (it == end) {
@@ -136598,7 +136696,7 @@ template <std::ranges::range R>
136598136696simdjson_inline void string_builder::append(const R &range) noexcept {
136599136697 auto it = std::ranges::begin(range);
136600136698 auto end = std::ranges::end(range);
136601- if constexpr (concepts::is_pair<typename R::value_type >) {
136699+ if constexpr (concepts::is_pair<std::ranges::range_value_t<R> >) {
136602136700 start_object();
136603136701
136604136702 if (it == end) {
@@ -151483,7 +151581,7 @@ template <std::ranges::range R>
151483151581simdjson_inline void string_builder::append(const R &range) noexcept {
151484151582 auto it = std::ranges::begin(range);
151485151583 auto end = std::ranges::end(range);
151486- if constexpr (concepts::is_pair<typename R::value_type >) {
151584+ if constexpr (concepts::is_pair<std::ranges::range_value_t<R> >) {
151487151585 start_object();
151488151586
151489151587 if (it == end) {
0 commit comments