From fff14999631a05f00c191f1f92dd9369d7fab579 Mon Sep 17 00:00:00 2001 From: chenguoping Date: Tue, 2 Jun 2020 15:43:57 +0800 Subject: [PATCH 1/4] add comment about PR#1006 --- include/nlohmann/detail/output/output_adapters.hpp | 3 ++- single_include/nlohmann/json.hpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/nlohmann/detail/output/output_adapters.hpp b/include/nlohmann/detail/output/output_adapters.hpp index 71ca65b92d..937af6974c 100644 --- a/include/nlohmann/detail/output/output_adapters.hpp +++ b/include/nlohmann/detail/output/output_adapters.hpp @@ -97,7 +97,8 @@ class output_string_adapter : public output_adapter_protocol private: StringType& str; }; - +/// dump to alternative string type, as defined in basic_json template +/// see https://github.com/nlohmann/json/pull/1006 template> class output_adapter { diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 7a1aacb550..553284beb8 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -12208,7 +12208,8 @@ class output_string_adapter : public output_adapter_protocol private: StringType& str; }; - +/// dump to alternative string type, as defined in basic_json template +/// see https://github.com/nlohmann/json/pull/1006 template> class output_adapter { From eca4b8785c94b977b532715e59c4ef387fcb10ac Mon Sep 17 00:00:00 2001 From: chenguoping Date: Tue, 2 Jun 2020 15:44:26 +0800 Subject: [PATCH 2/4] fix test case in PR#1006 --- test/src/unit-alt-string.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/src/unit-alt-string.cpp b/test/src/unit-alt-string.cpp index 52a8e4420e..c8317b4d17 100644 --- a/test/src/unit-alt-string.cpp +++ b/test/src/unit-alt-string.cpp @@ -225,9 +225,9 @@ TEST_CASE("alternative string type") { alt_json doc; - doc["list"] = { 1, 0, 2 }; + doc["object"] = { {"currency", "USD"}, {"value", 42.99} }; alt_string dump = doc.dump(); - CHECK(dump == R"({"list":[1,0,2]})"); + CHECK(dump == R"({"object":{"currency":"USD","value":42.99}})"); } } From 0f67c5849f03926fd96542fcee6145263f98ea25 Mon Sep 17 00:00:00 2001 From: chenguoping Date: Fri, 5 Jun 2020 10:09:15 +0800 Subject: [PATCH 3/4] undo: remove comment --- include/nlohmann/detail/output/output_adapters.hpp | 2 -- single_include/nlohmann/json.hpp | 2 -- 2 files changed, 4 deletions(-) diff --git a/include/nlohmann/detail/output/output_adapters.hpp b/include/nlohmann/detail/output/output_adapters.hpp index 937af6974c..77fe7cc6da 100644 --- a/include/nlohmann/detail/output/output_adapters.hpp +++ b/include/nlohmann/detail/output/output_adapters.hpp @@ -97,8 +97,6 @@ class output_string_adapter : public output_adapter_protocol private: StringType& str; }; -/// dump to alternative string type, as defined in basic_json template -/// see https://github.com/nlohmann/json/pull/1006 template> class output_adapter { diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 553284beb8..b8b1ba46c6 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -12208,8 +12208,6 @@ class output_string_adapter : public output_adapter_protocol private: StringType& str; }; -/// dump to alternative string type, as defined in basic_json template -/// see https://github.com/nlohmann/json/pull/1006 template> class output_adapter { From ad2b4ff23bf47d4cddb71802d1c1bd17a99a3990 Mon Sep 17 00:00:00 2001 From: chenguoping Date: Fri, 5 Jun 2020 14:23:00 +0800 Subject: [PATCH 4/4] recover original blank line --- include/nlohmann/detail/output/output_adapters.hpp | 1 + single_include/nlohmann/json.hpp | 1 + 2 files changed, 2 insertions(+) diff --git a/include/nlohmann/detail/output/output_adapters.hpp b/include/nlohmann/detail/output/output_adapters.hpp index 77fe7cc6da..71ca65b92d 100644 --- a/include/nlohmann/detail/output/output_adapters.hpp +++ b/include/nlohmann/detail/output/output_adapters.hpp @@ -97,6 +97,7 @@ class output_string_adapter : public output_adapter_protocol private: StringType& str; }; + template> class output_adapter { diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index b8b1ba46c6..7a1aacb550 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -12208,6 +12208,7 @@ class output_string_adapter : public output_adapter_protocol private: StringType& str; }; + template> class output_adapter {