Files
allwpilib/upstream_utils/json_patches/0002-Make-serializer-public.patch
2026-01-02 08:51:16 -08:00

56 lines
1.8 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Tyler Veness <calcmogul@gmail.com>
Date: Thu, 7 Sep 2023 22:02:27 -0700
Subject: [PATCH 2/5] Make serializer public
---
include/nlohmann/detail/output/serializer.hpp | 4 +++-
include/nlohmann/json.hpp | 3 +--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/include/nlohmann/detail/output/serializer.hpp b/include/nlohmann/detail/output/serializer.hpp
index 3137f3c3602c8aefa4a1e4947e1f17e836e91eb6..3a8e6c18f64035670886089c924bd322acc673a8 100644
--- a/include/nlohmann/detail/output/serializer.hpp
+++ b/include/nlohmann/detail/output/serializer.hpp
@@ -373,7 +373,7 @@ class serializer
}
}
- JSON_PRIVATE_UNLESS_TESTED:
+ public:
/*!
@brief dump escaped string
@@ -696,6 +696,7 @@ class serializer
return false;
}
+ public:
/*!
@brief dump an integer
@@ -876,6 +877,7 @@ class serializer
}
}
+ private:
/*!
@brief check whether a string is UTF-8 encoded
diff --git a/include/nlohmann/json.hpp b/include/nlohmann/json.hpp
index ed51cd544748c4b8ebabbd5bf32fd0bb1ef89738..491351330ba7a5994a750027c5766ae769e0b164 100644
--- a/include/nlohmann/json.hpp
+++ b/include/nlohmann/json.hpp
@@ -158,10 +158,9 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
using binary_reader = ::nlohmann::detail::binary_reader<basic_json, InputType>;
template<typename CharType> using binary_writer = ::nlohmann::detail::binary_writer<basic_json, CharType>;
- JSON_PRIVATE_UNLESS_TESTED:
+ public:
using serializer = ::nlohmann::detail::serializer<basic_json>;
- public:
using value_t = detail::value_t;
/// JSON Pointer, see @ref nlohmann::json_pointer
using json_pointer = ::nlohmann::json_pointer<StringType>;