diff Plugin/ViewerToolbox.cpp @ 292:aadbffcee805

remove calls to deprecated classes of JsonCpp
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 22 Dec 2020 09:03:24 +0100
parents ec1af1fdcaca
children e376158e2dbb
line wrap: on
line diff
--- a/Plugin/ViewerToolbox.cpp	Thu Dec 10 15:45:04 2020 +0100
+++ b/Plugin/ViewerToolbox.cpp	Tue Dec 22 09:03:24 2020 +0100
@@ -28,7 +28,6 @@
 // To gain access to ORTHANC_PLUGINS_VERSION_IS_ABOVE if Orthanc SDK <= 1.3.0
 #include "../Resources/Orthanc/Plugins/OrthancPluginCppWrapper.h"
 
-#include <json/reader.h>
 #include <stdexcept>
 #include <boost/lexical_cast.hpp>
 #include <sys/stat.h>
@@ -79,10 +78,7 @@
     {
       try
       {
-        const char* data = reinterpret_cast<const char*>(answer.data);
-        Json::Reader reader;
-        if (!reader.parse(data, data + answer.size, json, 
-                          false /* don't collect comments */))
+        if (!Orthanc::Toolbox::ReadJsonWithoutComments(json, answer.data, answer.size))
         {
           return false;
         }
@@ -227,8 +223,7 @@
       OrthancPluginFreeString(context, tmp);      
     }
 
-    Json::Reader reader;
-    if (reader.parse(s, configuration))
+    if (Orthanc::Toolbox::ReadJson(configuration, s))
     {
       return true;
     }