comparison 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
comparison
equal deleted inserted replaced
212:f1ea48f92d66 213:2a4e1f7de5ab
35 35
36 #include <Compatibility.h> // For std::unique_ptr 36 #include <Compatibility.h> // For std::unique_ptr
37 #include <DicomParsing/FromDcmtkBridge.h> 37 #include <DicomParsing/FromDcmtkBridge.h>
38 #include <Logging.h> 38 #include <Logging.h>
39 #include <OrthancException.h> 39 #include <OrthancException.h>
40 #include <Toolbox.h>
40 #include <SystemToolbox.h> 41 #include <SystemToolbox.h>
41 42
42 #include "ApplicationToolbox.h" 43 #include "ApplicationToolbox.h"
43 44
44 #include <EmbeddedResources.h> 45 #include <EmbeddedResources.h>
291 else 292 else
292 { 293 {
293 std::string content; 294 std::string content;
294 Orthanc::SystemToolbox::ReadFile(content, path); 295 Orthanc::SystemToolbox::ReadFile(content, path);
295 296
296 Json::Reader reader; 297 if (!Orthanc::Toolbox::ReadJsonWithoutComments(json, content))
297 if (!reader.parse(content, json, false))
298 { 298 {
299 LOG(ERROR) << "Cannot parse the JSON file in: " << path; 299 LOG(ERROR) << "Cannot parse the JSON file in: " << path;
300 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadFileFormat); 300 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadFileFormat);
301 } 301 }
302 } 302 }
466 466
467 std::string brightfield; 467 std::string brightfield;
468 Orthanc::EmbeddedResources::GetFileResource(brightfield, Orthanc::EmbeddedResources::BRIGHTFIELD_OPTICAL_PATH); 468 Orthanc::EmbeddedResources::GetFileResource(brightfield, Orthanc::EmbeddedResources::BRIGHTFIELD_OPTICAL_PATH);
469 469
470 Json::Value json; 470 Json::Value json;
471 Json::Reader reader; 471 if (!Orthanc::Toolbox::ReadJsonWithoutComments(json, brightfield))
472 if (!reader.parse(brightfield, json, false))
473 { 472 {
474 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError); 473 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError);
475 } 474 }
476 475
477 std::unique_ptr<DcmElement> element(Orthanc::FromDcmtkBridge::FromJson( 476 std::unique_ptr<DcmElement> element(Orthanc::FromDcmtkBridge::FromJson(