# HG changeset patch # User Sebastien Jodogne # Date 1608625113 -3600 # Node ID 05dc12df49db80999525bd75a29b085fa0235c33 # Parent ef2f56c0311c5dc5bd6c764e28ba1b768a285a61 remove calls to deprecated classes of JsonCpp diff -r ef2f56c0311c -r 05dc12df49db OrthancStone/Sources/Loaders/SeriesThumbnailsLoader.cpp --- a/OrthancStone/Sources/Loaders/SeriesThumbnailsLoader.cpp Tue Dec 22 09:16:42 2020 +0100 +++ b/OrthancStone/Sources/Loaders/SeriesThumbnailsLoader.cpp Tue Dec 22 09:18:33 2020 +0100 @@ -433,8 +433,7 @@ const std::map& headers) ORTHANC_OVERRIDE { Json::Value json; - Json::Reader reader; - if (!reader.parse(body, json) || + if (!Orthanc::Toolbox::ReadJson(json, body) || json.type() != Json::arrayValue) { throw Orthanc::OrthancException(Orthanc::ErrorCode_NetworkProtocol); diff -r ef2f56c0311c -r 05dc12df49db OrthancStone/Sources/Oracle/HttpCommand.cpp --- a/OrthancStone/Sources/Oracle/HttpCommand.cpp Tue Dec 22 09:16:42 2020 +0100 +++ b/OrthancStone/Sources/Oracle/HttpCommand.cpp Tue Dec 22 09:18:33 2020 +0100 @@ -24,21 +24,14 @@ #include #include +#include -#ifdef _MSC_VER -// 'Json::Reader': Use CharReader and CharReaderBuilder instead -#pragma warning(disable:4996) -#endif - -#include -#include namespace OrthancStone { void HttpCommand::SuccessMessage::ParseJsonBody(Json::Value& target) const { - Json::Reader reader; - if (!reader.parse(answer_, target)) + if (!Orthanc::Toolbox::ReadJson(target, answer_)) { throw Orthanc::OrthancException(Orthanc::ErrorCode_BadFileFormat); } @@ -55,8 +48,7 @@ void HttpCommand::SetBody(const Json::Value& json) { - Json::FastWriter writer; - body_ = writer.write(json); + Orthanc::Toolbox::WriteFastJson(body_, json); }