diff OrthancServer/Plugins/Engine/PluginsJob.cpp @ 4392:3af1d763763a

confining Json::Reader and Json::*Writer into Toolbox
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 21 Dec 2020 18:09:47 +0100
parents 05b8fd21089c
children d9473bd5ed43
line wrap: on
line diff
--- a/OrthancServer/Plugins/Engine/PluginsJob.cpp	Mon Dec 21 08:47:29 2020 +0100
+++ b/OrthancServer/Plugins/Engine/PluginsJob.cpp	Mon Dec 21 18:09:47 2020 +0100
@@ -41,8 +41,8 @@
 
 #include "../../../OrthancFramework/Sources/Logging.h"
 #include "../../../OrthancFramework/Sources/OrthancException.h"
+#include "../../../OrthancFramework/Sources/Toolbox.h"
 
-#include <json/reader.h>
 #include <cassert>
 
 namespace Orthanc
@@ -143,9 +143,7 @@
     }
     else
     {
-      Json::Reader reader;
-      
-      if (!reader.parse(content, value) ||
+      if (!Toolbox::ReadJson(value, content) ||
           value.type() != Json::objectValue)
       {
         throw OrthancException(ErrorCode_Plugin,
@@ -164,9 +162,7 @@
     }
     else
     {
-      Json::Reader reader;
-      
-      if (!reader.parse(serialized, value) ||
+      if (!Toolbox::ReadJson(value, serialized) ||
           value.type() != Json::objectValue)
       {
         throw OrthancException(ErrorCode_Plugin,