James Kuszmaul | b13e13f | 2023-11-22 20:44:04 -0800 | [diff] [blame^] | 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
| 2 | From: Tyler Veness <calcmogul@gmail.com> |
| 3 | Date: Thu, 7 Sep 2023 22:02:27 -0700 |
| 4 | Subject: [PATCH 2/4] Make serializer public |
| 5 | |
| 6 | --- |
| 7 | include/nlohmann/detail/output/serializer.hpp | 4 +++- |
| 8 | include/nlohmann/json.hpp | 3 +-- |
| 9 | 2 files changed, 4 insertions(+), 3 deletions(-) |
| 10 | |
| 11 | diff --git a/include/nlohmann/detail/output/serializer.hpp b/include/nlohmann/detail/output/serializer.hpp |
| 12 | index 500fc55ec5e5895ead2b372a6fe79ae941d88d83..7674d134a4d9f230aa4e432294c19dac8dd366b1 100644 |
| 13 | --- a/include/nlohmann/detail/output/serializer.hpp |
| 14 | +++ b/include/nlohmann/detail/output/serializer.hpp |
| 15 | @@ -373,7 +373,7 @@ class serializer |
| 16 | } |
| 17 | } |
| 18 | |
| 19 | - JSON_PRIVATE_UNLESS_TESTED: |
| 20 | + public: |
| 21 | /*! |
| 22 | @brief dump escaped string |
| 23 | |
| 24 | @@ -696,6 +696,7 @@ class serializer |
| 25 | return false; |
| 26 | } |
| 27 | |
| 28 | + public: |
| 29 | /*! |
| 30 | @brief dump an integer |
| 31 | |
| 32 | @@ -876,6 +877,7 @@ class serializer |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | + private: |
| 37 | /*! |
| 38 | @brief check whether a string is UTF-8 encoded |
| 39 | |
| 40 | diff --git a/include/nlohmann/json.hpp b/include/nlohmann/json.hpp |
| 41 | index 18a7c875774527a2e08c5ab72e5564aa50381608..c462cade8a7167a00697f6f940be35c5609a283c 100644 |
| 42 | --- a/include/nlohmann/json.hpp |
| 43 | +++ b/include/nlohmann/json.hpp |
| 44 | @@ -153,10 +153,9 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec |
| 45 | using binary_reader = ::nlohmann::detail::binary_reader<basic_json, InputType>; |
| 46 | template<typename CharType> using binary_writer = ::nlohmann::detail::binary_writer<basic_json, CharType>; |
| 47 | |
| 48 | - JSON_PRIVATE_UNLESS_TESTED: |
| 49 | + public: |
| 50 | using serializer = ::nlohmann::detail::serializer<basic_json>; |
| 51 | |
| 52 | - public: |
| 53 | using value_t = detail::value_t; |
| 54 | /// JSON Pointer, see @ref nlohmann::json_pointer |
| 55 | using json_pointer = ::nlohmann::json_pointer<StringType>; |