comparison 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
comparison
equal deleted inserted replaced
30:3abebab5d004 31:cfeda58d0c8e
22 #include "../TransferToolbox.h" 22 #include "../TransferToolbox.h"
23 #include "HttpQueriesRunner.h" 23 #include "HttpQueriesRunner.h"
24 24
25 #include <Logging.h> 25 #include <Logging.h>
26 #include <OrthancException.h> 26 #include <OrthancException.h>
27 27 #include <Toolbox.h>
28 #include <json/reader.h>
29 28
30 29
31 namespace OrthancPlugins 30 namespace OrthancPlugins
32 { 31 {
33 DetectTransferPlugin::DetectTransferPlugin(Result& result, 32 DetectTransferPlugin::DetectTransferPlugin(Result& result,
47 46
48 47
49 void DetectTransferPlugin::HandleAnswer(const void* answer, 48 void DetectTransferPlugin::HandleAnswer(const void* answer,
50 size_t size) 49 size_t size)
51 { 50 {
52 Json::Reader reader;
53 Json::Value value; 51 Json::Value value;
54 52
55 bool enabled = false; 53 bool enabled = false;
56 54
57 if (reader.parse(reinterpret_cast<const char*>(answer), 55 if (Orthanc::Toolbox::ReadJson(value, answer, size) &&
58 reinterpret_cast<const char*>(answer) + size, value) &&
59 value.type() == Json::arrayValue) 56 value.type() == Json::arrayValue)
60 { 57 {
61 // Loop over the plugins that are enabled on the remote peer 58 // Loop over the plugins that are enabled on the remote peer
62 for (Json::Value::ArrayIndex i = 0; i < value.size(); i++) 59 for (Json::Value::ArrayIndex i = 0; i < value.size(); i++)
63 { 60 {