diff OrthancServer/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp @ 4397:3aeb5171fbd4

new function Toolbox::ReadJsonWithoutComments()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 22 Dec 2020 08:59:23 +0100
parents d07a65100a95
children d9473bd5ed43
line wrap: on
line diff
--- a/OrthancServer/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp	Tue Dec 22 08:16:08 2020 +0100
+++ b/OrthancServer/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp	Tue Dec 22 08:59:23 2020 +0100
@@ -316,12 +316,7 @@
   bool ReadJson(Json::Value& target,
                 const std::string& source)
   {
-#if JSONCPP_USE_DEPRECATED == 1
-    Json::Reader reader;
-    return reader.parse(source, target);
-#else
-    return ReadJson(target, source.c_str(), source.size());
-#endif
+    return ReadJson(target, source.empty() ? NULL : source.c_str(), source.size());
   }