diff Plugin/ViewerPrefetchPolicy.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 aee499712ac4
children e376158e2dbb
line wrap: on
line diff
--- a/Plugin/ViewerPrefetchPolicy.cpp	Thu Dec 10 15:45:04 2020 +0100
+++ b/Plugin/ViewerPrefetchPolicy.cpp	Tue Dec 22 09:03:24 2020 +0100
@@ -24,9 +24,7 @@
 #include "ViewerToolbox.h"
 #include "Cache/CacheScheduler.h"
 
-#include <json/value.h>
-#include <json/reader.h>
-
+#include <Toolbox.h>
 
 
 static const Json::Value::ArrayIndex PREFETCH_FORWARD = 10;
@@ -41,8 +39,7 @@
                                          const std::string& content)
   {
     Json::Value json;
-    Json::Reader reader;
-    if (!reader.parse(content, json) ||
+    if (!Orthanc::Toolbox::ReadJson(json, content) ||
         !json.isMember("Slices"))
     {
       return;
@@ -93,8 +90,7 @@
     }
     
     Json::Value series;
-    Json::Reader reader;
-    if (!reader.parse(tmp, series) ||
+    if (!Orthanc::Toolbox::ReadJson(series, tmp) ||
         !series.isMember("Slices"))
     {
       return;