diff Applications/Dicomizer.cpp @ 213:2a4e1f7de5ab

remove calls to deprecated classes of JsonCpp
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 22 Dec 2020 09:28:30 +0100
parents a1c265cb2174
children 1e864138f0da
line wrap: on
line diff
--- a/Applications/Dicomizer.cpp	Tue Dec 22 09:19:43 2020 +0100
+++ b/Applications/Dicomizer.cpp	Tue Dec 22 09:28:30 2020 +0100
@@ -37,6 +37,7 @@
 #include <DicomParsing/FromDcmtkBridge.h>
 #include <Logging.h>
 #include <OrthancException.h>
+#include <Toolbox.h>
 #include <SystemToolbox.h>
 
 #include "ApplicationToolbox.h"
@@ -293,8 +294,7 @@
     std::string content;
     Orthanc::SystemToolbox::ReadFile(content, path);
 
-    Json::Reader reader;
-    if (!reader.parse(content, json, false))
+    if (!Orthanc::Toolbox::ReadJsonWithoutComments(json, content))
     {
       LOG(ERROR) << "Cannot parse the JSON file in: " << path;
       throw Orthanc::OrthancException(Orthanc::ErrorCode_BadFileFormat);
@@ -468,8 +468,7 @@
     Orthanc::EmbeddedResources::GetFileResource(brightfield, Orthanc::EmbeddedResources::BRIGHTFIELD_OPTICAL_PATH);
 
     Json::Value json;
-    Json::Reader reader;
-    if (!reader.parse(brightfield, json, false))
+    if (!Orthanc::Toolbox::ReadJsonWithoutComments(json, brightfield))
     {
       throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError);
     }