Mercurial > hg > orthanc-stone
comparison 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 |
comparison
equal
deleted
inserted
replaced
1736:77038e2bd074 | 1737:ef2f56c0311c |
---|---|
31 #include <Images/Image.h> | 31 #include <Images/Image.h> |
32 #include <Images/ImageProcessing.h> | 32 #include <Images/ImageProcessing.h> |
33 #include <Images/JpegReader.h> | 33 #include <Images/JpegReader.h> |
34 #include <Images/JpegWriter.h> | 34 #include <Images/JpegWriter.h> |
35 #include <OrthancException.h> | 35 #include <OrthancException.h> |
36 #include <Toolbox.h> | |
36 | 37 |
37 #include <boost/algorithm/string/predicate.hpp> | 38 #include <boost/algorithm/string/predicate.hpp> |
38 | 39 |
39 #if ORTHANC_ENABLE_DCMTK == 1 | 40 #if ORTHANC_ENABLE_DCMTK == 1 |
40 # include <DicomParsing/ParsedDicomFile.h> | 41 # include <DicomParsing/ParsedDicomFile.h> |
208 } | 209 } |
209 | 210 |
210 virtual void HandleSuccess(const std::string& body, | 211 virtual void HandleSuccess(const std::string& body, |
211 const std::map<std::string, std::string>& headers) ORTHANC_OVERRIDE | 212 const std::map<std::string, std::string>& headers) ORTHANC_OVERRIDE |
212 { | 213 { |
213 Json::Reader reader; | |
214 Json::Value value; | 214 Json::Value value; |
215 | 215 |
216 if (!reader.parse(body, value) || | 216 if (!Orthanc::Toolbox::ReadJson(value, body) || |
217 value.type() != Json::arrayValue) | 217 value.type() != Json::arrayValue) |
218 { | 218 { |
219 throw Orthanc::OrthancException(Orthanc::ErrorCode_NetworkProtocol); | 219 throw Orthanc::OrthancException(Orthanc::ErrorCode_NetworkProtocol); |
220 } | 220 } |
221 else | 221 else |
387 const std::map<std::string, std::string>& headers) ORTHANC_OVERRIDE | 387 const std::map<std::string, std::string>& headers) ORTHANC_OVERRIDE |
388 { | 388 { |
389 static const char* const INSTANCES = "Instances"; | 389 static const char* const INSTANCES = "Instances"; |
390 | 390 |
391 Json::Value json; | 391 Json::Value json; |
392 Json::Reader reader; | 392 if (!Orthanc::Toolbox::ReadJson(json, body) || |
393 if (!reader.parse(body, json) || | |
394 json.type() != Json::objectValue) | 393 json.type() != Json::objectValue) |
395 { | 394 { |
396 throw Orthanc::OrthancException(Orthanc::ErrorCode_NetworkProtocol); | 395 throw Orthanc::OrthancException(Orthanc::ErrorCode_NetworkProtocol); |
397 } | 396 } |
398 | 397 |