diff Framework/HttpQueries/DetectTransferPlugin.cpp @ 31:cfeda58d0c8e

remove calls to deprecated classes of JsonCpp
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 22 Dec 2020 08:31:22 +0100
parents 3abebab5d004
children 44a0430d7899
line wrap: on
line diff
--- a/Framework/HttpQueries/DetectTransferPlugin.cpp	Fri Nov 06 18:06:55 2020 +0100
+++ b/Framework/HttpQueries/DetectTransferPlugin.cpp	Tue Dec 22 08:31:22 2020 +0100
@@ -24,8 +24,7 @@
 
 #include <Logging.h>
 #include <OrthancException.h>
-
-#include <json/reader.h>
+#include <Toolbox.h>
 
 
 namespace OrthancPlugins
@@ -49,13 +48,11 @@
   void DetectTransferPlugin::HandleAnswer(const void* answer,
                                           size_t size)
   {
-    Json::Reader reader;
     Json::Value value;
 
     bool enabled = false;
 
-    if (reader.parse(reinterpret_cast<const char*>(answer), 
-                     reinterpret_cast<const char*>(answer) + size, value) &&
+    if (Orthanc::Toolbox::ReadJson(value, answer, size) &&
         value.type() == Json::arrayValue)
     {
       // Loop over the plugins that are enabled on the remote peer