diff OrthancStone/Sources/Loaders/SeriesThumbnailsLoader.cpp @ 1737:ef2f56c0311c

remove calls to deprecated classes of JsonCpp
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 22 Dec 2020 09:16:42 +0100
parents f62f685e0eb2
children 05dc12df49db
line wrap: on
line diff
--- a/OrthancStone/Sources/Loaders/SeriesThumbnailsLoader.cpp	Tue Dec 22 09:06:33 2020 +0100
+++ b/OrthancStone/Sources/Loaders/SeriesThumbnailsLoader.cpp	Tue Dec 22 09:16:42 2020 +0100
@@ -33,6 +33,7 @@
 #include <Images/JpegReader.h>
 #include <Images/JpegWriter.h>
 #include <OrthancException.h>
+#include <Toolbox.h>
 
 #include <boost/algorithm/string/predicate.hpp>
 
@@ -210,10 +211,9 @@
     virtual void HandleSuccess(const std::string& body,
                                const std::map<std::string, std::string>& headers) ORTHANC_OVERRIDE
     {
-      Json::Reader reader;
       Json::Value value;
 
-      if (!reader.parse(body, value) ||
+      if (!Orthanc::Toolbox::ReadJson(value, body) ||
           value.type() != Json::arrayValue)
       {
         throw Orthanc::OrthancException(Orthanc::ErrorCode_NetworkProtocol);
@@ -389,8 +389,7 @@
       static const char* const INSTANCES = "Instances";
       
       Json::Value json;
-      Json::Reader reader;
-      if (!reader.parse(body, json) ||
+      if (!Orthanc::Toolbox::ReadJson(json, body) ||
           json.type() != Json::objectValue)
       {
         throw Orthanc::OrthancException(Orthanc::ErrorCode_NetworkProtocol);