changeset 5266:a856daf71745 db-protobuf

integration mainline->db-protobuf
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 12 Apr 2023 17:56:13 +0200
parents afe92108f463 (current diff) 0e8dfba67ac9 (diff)
children cdeb7f027c1b
files OrthancServer/CMakeLists.txt
diffstat 9 files changed, 268 insertions(+), 60 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancFramework/Sources/Toolbox.cpp	Wed Apr 12 11:54:29 2023 +0200
+++ b/OrthancFramework/Sources/Toolbox.cpp	Wed Apr 12 17:56:13 2023 +0200
@@ -146,9 +146,13 @@
 }
 
 
-#if defined(ORTHANC_STATIC_ICU) && (ORTHANC_ENABLE_ICU == 1)
+#if defined(ORTHANC_STATIC_ICU)
+
+#  if (ORTHANC_STATIC_ICU == 1) && (ORTHANC_ENABLE_ICU == 1)
+#    include <OrthancFrameworkResources.h>
+#  endif
+
 #  if (ORTHANC_STATIC_ICU == 1 && ORTHANC_ENABLE_LOCALE == 1)
-#    include <OrthancFrameworkResources.h>
 #    include <unicode/udata.h>
 #    include <unicode/uloc.h>
 #    include "Compression/GzipCompressor.h"
--- a/OrthancServer/CMakeLists.txt	Wed Apr 12 11:54:29 2023 +0200
+++ b/OrthancServer/CMakeLists.txt	Wed Apr 12 17:56:13 2023 +0200
@@ -337,8 +337,6 @@
 # headers might get broken!
 
 if (MSVC)
-  add_definitions(-DORTHANC_USE_PRECOMPILED_HEADERS=1)
-
   set(TMP
     ${ORTHANC_CORE_SOURCES_INTERNAL}
     ${ORTHANC_DICOM_SOURCES_INTERNAL}
@@ -378,6 +376,13 @@
   ${AUTOGENERATED_SOURCES}
   )
 
+if (MSVC)
+  set_target_properties(
+    CoreLibrary
+    PROPERTIES COMPILE_DEFINITIONS "ORTHANC_USE_PRECOMPILED_HEADERS=1"
+    )
+endif()
+
 add_dependencies(CoreLibrary AutogeneratedTarget)
 
 if (LIBICU_LIBRARIES)
@@ -419,6 +424,13 @@
   ${ORTHANC_SERVER_SOURCES}
   )
 
+if (MSVC)
+  set_target_properties(
+    ServerLibrary
+    PROPERTIES COMPILE_DEFINITIONS "ORTHANC_USE_PRECOMPILED_HEADERS=1"
+    )
+endif()
+
 # Ensure autogenerated code is built before building ServerLibrary
 add_dependencies(ServerLibrary CoreLibrary OrthancDatabaseProtobuf)
 
@@ -457,6 +469,13 @@
   ${BOOST_EXTENDED_SOURCES}
   )
 
+if (MSVC)
+  set_target_properties(
+    UnitTests
+    PROPERTIES COMPILE_DEFINITIONS "ORTHANC_USE_PRECOMPILED_HEADERS=1"
+    )
+endif()
+
 target_link_libraries(UnitTests
   ServerLibrary
   CoreLibrary
@@ -472,65 +491,35 @@
 if (ENABLE_PLUGINS AND
     (BUILD_SERVE_FOLDERS OR BUILD_MODALITY_WORKLISTS OR BUILD_HOUSEKEEPER OR
       BUILD_DELAYED_DELETION))
-  set(PLUGINS_FRAMEWORK_SOURCES
+  set(PLUGINS_DEPENDENCIES_SOURCES
     ${BOOST_SOURCES}
     ${JSONCPP_SOURCES}
     ${LIBICONV_SOURCES}
     ${LIBICU_SOURCES}
+    ${PUGIXML_SOURCES}
+    ${UUID_SOURCES}
+    ${ZLIB_SOURCES}
+    
+    ${CMAKE_SOURCE_DIR}/../OrthancFramework/Resources/ThirdParty/base64/base64.cpp
+    ${CMAKE_SOURCE_DIR}/../OrthancFramework/Resources/ThirdParty/md5/md5.c
     Plugins/Samples/Common/OrthancPluginCppWrapper.cpp
     )
 
   if (BUILD_DELAYED_DELETION)
-    list(APPEND PLUGINS_FRAMEWORK_SOURCES
-      ${CMAKE_SOURCE_DIR}/../OrthancFramework/Resources/ThirdParty/base64/base64.cpp
-      ${CMAKE_SOURCE_DIR}/../OrthancFramework/Resources/ThirdParty/md5/md5.c
-      ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/ChunkedBuffer.cpp
-      ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/Compression/DeflateBaseCompressor.cpp
-      ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/Compression/GzipCompressor.cpp
-      ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/Compression/HierarchicalZipWriter.cpp
-      ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/Compression/IBufferCompressor.cpp
-      ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/Compression/ZipReader.cpp
-      ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/Compression/ZipWriter.cpp
-      ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/Compression/ZlibCompressor.cpp
-      ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/DicomFormat/DicomTag.cpp
-      ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/Enumerations.cpp
-      ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/FileStorage/FilesystemStorage.cpp
-      ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/Logging.cpp
-      ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/MultiThreading/SharedMessageQueue.cpp
-      ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/OrthancException.cpp
-      ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/SQLite/Connection.cpp
-      ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/SQLite/FunctionContext.cpp
-      ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/SQLite/Statement.cpp
-      ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/SQLite/StatementId.cpp
-      ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/SQLite/StatementReference.cpp
-      ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/SQLite/Transaction.cpp
-      ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/StringMemoryBuffer.cpp
-      ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/SystemToolbox.cpp
-      ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/Toolbox.cpp
+    list(APPEND PLUGINS_DEPENDENCIES_SOURCES
       ${DCMTK_SOURCES}
-      ${PUGIXML_SOURCES}
-      ${UUID_SOURCES}
-      ${ZLIB_SOURCES}
       ${SQLITE_SOURCES}
       )
   endif()
   
-  add_library(PluginsFramework STATIC
-    ${PLUGINS_FRAMEWORK_SOURCES}
-    )
-
-  # Remove the dependency upon ICU in plugins, as this greatly
-  # increase the size of the resulting binaries, since they must
-  # embed the ICU dictionary.
-  set_target_properties(
-    PluginsFramework
-    PROPERTIES COMPILE_DEFINITIONS "ORTHANC_ENABLE_ICU=0"
+  add_library(PluginsDependencies STATIC
+    ${PLUGINS_DEPENDENCIES_SOURCES}
     )
 
   # Add the "-fPIC" option as this static library must be embedded
   # inside shared libraries (important on UNIX)
   set_target_properties(
-    PluginsFramework
+    PluginsDependencies
     PROPERTIES POSITION_INDEPENDENT_CODE ON
     )
 endif()
@@ -567,7 +556,7 @@
     ${SERVE_FOLDERS_RESOURCES}
     )
 
-  target_link_libraries(ServeFolders PluginsFramework)
+  target_link_libraries(ServeFolders PluginsDependencies)
 
   set_target_properties(
     ServeFolders PROPERTIES 
@@ -615,7 +604,7 @@
     ${MODALITY_WORKLISTS_RESOURCES}
     )
 
-  target_link_libraries(ModalityWorklists PluginsFramework)
+  target_link_libraries(ModalityWorklists PluginsDependencies)
 
   set_target_properties(
     ModalityWorklists PROPERTIES 
@@ -667,13 +656,16 @@
     PROPERTIES COMPILE_DEFINITIONS "ORTHANC_PLUGIN_NAME=\"connectivity-checks\";ORTHANC_PLUGIN_VERSION=\"${ORTHANC_VERSION}\""
     )
   
+  # The "OrthancFrameworkDependencies.cpp" file is used to bypass the
+  # precompiled headers if compiling with Visual Studio
   add_library(ConnectivityChecks SHARED 
     ${AUTOGENERATED_DIR}/ConnectivityChecksResources.cpp
     ${CMAKE_SOURCE_DIR}/Plugins/Samples/ConnectivityChecks/Plugin.cpp
+    ${CMAKE_SOURCE_DIR}/Plugins/Samples/ConnectivityChecks/OrthancFrameworkDependencies.cpp
     ${CONNECTIVITY_CHECKS_RESOURCES}
     )
   
-  target_link_libraries(ConnectivityChecks PluginsFramework)
+  target_link_libraries(ConnectivityChecks PluginsDependencies)
   
   set_target_properties(
     ConnectivityChecks PROPERTIES
@@ -714,15 +706,17 @@
     ${CMAKE_SOURCE_DIR}/Plugins/Samples/DelayedDeletion/Plugin.cpp
     PROPERTIES COMPILE_DEFINITIONS "ORTHANC_PLUGIN_NAME=\"delayed-deletion\";ORTHANC_PLUGIN_VERSION=\"${ORTHANC_VERSION}\""
     )
-  
+
+  # The "OrthancFrameworkDependencies.cpp" file is used to bypass the
+  # precompiled headers if compiling with Visual Studio
   add_library(DelayedDeletion SHARED 
-    ${CMAKE_SOURCE_DIR}/Plugins/Engine/PluginsEnumerations.cpp
     ${CMAKE_SOURCE_DIR}/Plugins/Samples/DelayedDeletion/PendingDeletionsDatabase.cpp
     ${CMAKE_SOURCE_DIR}/Plugins/Samples/DelayedDeletion/Plugin.cpp
+    ${CMAKE_SOURCE_DIR}/Plugins/Samples/DelayedDeletion/OrthancFrameworkDependencies.cpp
     ${DELAYED_DELETION_RESOURCES}
     )
   
-  target_link_libraries(DelayedDeletion PluginsFramework ${DCMTK_LIBRARIES})
+  target_link_libraries(DelayedDeletion PluginsDependencies ${DCMTK_LIBRARIES})
   
   set_target_properties(
     DelayedDeletion PROPERTIES
@@ -769,9 +763,7 @@
     ${HOUSEKEEPER_RESOURCES}
     )
   
-  target_link_libraries(Housekeeper 
-    PluginsFramework
-    )
+  target_link_libraries(Housekeeper PluginsDependencies)
   
   set_target_properties(
     Housekeeper PROPERTIES 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/OrthancServer/Plugins/Samples/ConnectivityChecks/OrthancFrameworkDependencies.cpp	Wed Apr 12 17:56:13 2023 +0200
@@ -0,0 +1,36 @@
+/**
+ * Orthanc - A Lightweight, RESTful DICOM Store
+ * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
+ * Department, University Hospital of Liege, Belgium
+ * Copyright (C) 2017-2023 Osimis S.A., Belgium
+ * Copyright (C) 2021-2023 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+
+/**
+ * Remove the dependency upon ICU in plugins, as this greatly increase
+ * the size of the resulting binaries, since they must embed the ICU
+ * dictionary.
+ **/
+
+#define ORTHANC_ENABLE_ICU 0
+
+#include "../../../../OrthancFramework/Sources/ChunkedBuffer.cpp"
+#include "../../../../OrthancFramework/Sources/Enumerations.cpp"
+#include "../../../../OrthancFramework/Sources/Logging.cpp"
+#include "../../../../OrthancFramework/Sources/OrthancException.cpp"
+#include "../../../../OrthancFramework/Sources/SystemToolbox.cpp"
+#include "../../../../OrthancFramework/Sources/Toolbox.cpp"
--- a/OrthancServer/Plugins/Samples/DelayedDeletion/LargeDeleteJob.cpp	Wed Apr 12 11:54:29 2023 +0200
+++ b/OrthancServer/Plugins/Samples/DelayedDeletion/LargeDeleteJob.cpp	Wed Apr 12 17:56:13 2023 +0200
@@ -1,3 +1,25 @@
+/**
+ * Orthanc - A Lightweight, RESTful DICOM Store
+ * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
+ * Department, University Hospital of Liege, Belgium
+ * Copyright (C) 2017-2023 Osimis S.A., Belgium
+ * Copyright (C) 2021-2023 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+
 #include "LargeDeleteJob.h"
 
 #include "../../../../OrthancFramework/Sources/Logging.h"
--- a/OrthancServer/Plugins/Samples/DelayedDeletion/LargeDeleteJob.h	Wed Apr 12 11:54:29 2023 +0200
+++ b/OrthancServer/Plugins/Samples/DelayedDeletion/LargeDeleteJob.h	Wed Apr 12 17:56:13 2023 +0200
@@ -1,3 +1,25 @@
+/**
+ * Orthanc - A Lightweight, RESTful DICOM Store
+ * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
+ * Department, University Hospital of Liege, Belgium
+ * Copyright (C) 2017-2023 Osimis S.A., Belgium
+ * Copyright (C) 2021-2023 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+
 #pragma once
 
 #include "../Common/OrthancPluginCppWrapper.h"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/OrthancServer/Plugins/Samples/DelayedDeletion/OrthancFrameworkDependencies.cpp	Wed Apr 12 17:56:13 2023 +0200
@@ -0,0 +1,48 @@
+/**
+ * Orthanc - A Lightweight, RESTful DICOM Store
+ * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
+ * Department, University Hospital of Liege, Belgium
+ * Copyright (C) 2017-2023 Osimis S.A., Belgium
+ * Copyright (C) 2021-2023 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+
+/**
+ * Remove the dependency upon ICU in plugins, as this greatly increase
+ * the size of the resulting binaries, since they must embed the ICU
+ * dictionary.
+ **/
+
+#define ORTHANC_ENABLE_ICU 0
+
+#include "../../../../OrthancFramework/Sources/ChunkedBuffer.cpp"
+#include "../../../../OrthancFramework/Sources/Compression/DeflateBaseCompressor.cpp"
+#include "../../../../OrthancFramework/Sources/Compression/GzipCompressor.cpp"
+#include "../../../../OrthancFramework/Sources/DicomFormat/DicomTag.cpp"
+#include "../../../../OrthancFramework/Sources/Enumerations.cpp"
+#include "../../../../OrthancFramework/Sources/FileStorage/FilesystemStorage.cpp"
+#include "../../../../OrthancFramework/Sources/Logging.cpp"
+#include "../../../../OrthancFramework/Sources/MultiThreading/SharedMessageQueue.cpp"
+#include "../../../../OrthancFramework/Sources/OrthancException.cpp"
+#include "../../../../OrthancFramework/Sources/SQLite/Connection.cpp"
+#include "../../../../OrthancFramework/Sources/SQLite/FunctionContext.cpp"
+#include "../../../../OrthancFramework/Sources/SQLite/Statement.cpp"
+#include "../../../../OrthancFramework/Sources/SQLite/StatementId.cpp"
+#include "../../../../OrthancFramework/Sources/SQLite/StatementReference.cpp"
+#include "../../../../OrthancFramework/Sources/SQLite/Transaction.cpp"
+#include "../../../../OrthancFramework/Sources/StringMemoryBuffer.cpp"
+#include "../../../../OrthancFramework/Sources/SystemToolbox.cpp"
+#include "../../../../OrthancFramework/Sources/Toolbox.cpp"
--- a/OrthancServer/Plugins/Samples/DelayedDeletion/PendingDeletionsDatabase.cpp	Wed Apr 12 11:54:29 2023 +0200
+++ b/OrthancServer/Plugins/Samples/DelayedDeletion/PendingDeletionsDatabase.cpp	Wed Apr 12 17:56:13 2023 +0200
@@ -1,3 +1,25 @@
+/**
+ * Orthanc - A Lightweight, RESTful DICOM Store
+ * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
+ * Department, University Hospital of Liege, Belgium
+ * Copyright (C) 2017-2023 Osimis S.A., Belgium
+ * Copyright (C) 2021-2023 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+
 #include "PendingDeletionsDatabase.h"
 
 #include "../../../../OrthancFramework/Sources/SQLite/Statement.h"
--- a/OrthancServer/Plugins/Samples/DelayedDeletion/PendingDeletionsDatabase.h	Wed Apr 12 11:54:29 2023 +0200
+++ b/OrthancServer/Plugins/Samples/DelayedDeletion/PendingDeletionsDatabase.h	Wed Apr 12 17:56:13 2023 +0200
@@ -1,3 +1,25 @@
+/**
+ * Orthanc - A Lightweight, RESTful DICOM Store
+ * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
+ * Department, University Hospital of Liege, Belgium
+ * Copyright (C) 2017-2023 Osimis S.A., Belgium
+ * Copyright (C) 2021-2023 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+
 #pragma once
 
 
--- a/OrthancServer/Plugins/Samples/DelayedDeletion/Plugin.cpp	Wed Apr 12 11:54:29 2023 +0200
+++ b/OrthancServer/Plugins/Samples/DelayedDeletion/Plugin.cpp	Wed Apr 12 17:56:13 2023 +0200
@@ -1,10 +1,31 @@
+/**
+ * Orthanc - A Lightweight, RESTful DICOM Store
+ * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
+ * Department, University Hospital of Liege, Belgium
+ * Copyright (C) 2017-2023 Osimis S.A., Belgium
+ * Copyright (C) 2021-2023 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+
 #include "PendingDeletionsDatabase.h"
 
 #include "../../../../OrthancFramework/Sources/FileStorage/FilesystemStorage.h"
 #include "../../../../OrthancFramework/Sources/Logging.h"
 #include "../../../../OrthancFramework/Sources/MultiThreading/SharedMessageQueue.h"
-#include "../../../../OrthancServer/Plugins/Engine/PluginsEnumerations.h"
-#include "../../../../OrthancServer/Plugins/Samples/Common/OrthancPluginCppWrapper.h"
+#include "../Common/OrthancPluginCppWrapper.h"
 
 #include <boost/thread.hpp>
 
@@ -45,6 +66,25 @@
 static unsigned int                                 throttleDelayMs_ = 0;
 
 
+static Orthanc::FileContentType Convert(OrthancPluginContentType type)
+{
+  switch (type)
+  {
+    case OrthancPluginContentType_Dicom:
+      return Orthanc::FileContentType_Dicom;
+
+    case OrthancPluginContentType_DicomAsJson:
+      return Orthanc::FileContentType_DicomAsJson;
+
+    case OrthancPluginContentType_DicomUntilPixelData:
+      return Orthanc::FileContentType_DicomUntilPixelData;
+
+    default:
+      return Orthanc::FileContentType_Unknown;
+  }
+}
+
+
 static OrthancPluginErrorCode StorageCreate(const char* uuid,
                                             const void* content,
                                             int64_t size,
@@ -52,7 +92,7 @@
 {
   try
   {
-    storage_->Create(uuid, content, size, Orthanc::Plugins::Convert(type));
+    storage_->Create(uuid, content, size, Convert(type));
     return OrthancPluginErrorCode_Success;
   }
   catch (Orthanc::OrthancException& e)
@@ -72,7 +112,7 @@
 {
   try
   {
-    std::unique_ptr<Orthanc::IMemoryBuffer> buffer(storage_->Read(uuid, Orthanc::Plugins::Convert(type)));
+    std::unique_ptr<Orthanc::IMemoryBuffer> buffer(storage_->Read(uuid, Convert(type)));
 
     // copy from a buffer allocated on plugin's heap into a buffer allocated on core's heap
     if (OrthancPluginCreateMemoryBuffer64(OrthancPlugins::GetGlobalContext(), target, buffer->GetSize()) != OrthancPluginErrorCode_Success)
@@ -103,7 +143,7 @@
 {
   try
   {
-    std::unique_ptr<Orthanc::IMemoryBuffer> buffer(storage_->ReadRange(uuid, Orthanc::Plugins::Convert(type), rangeStart, rangeStart + target->size));
+    std::unique_ptr<Orthanc::IMemoryBuffer> buffer(storage_->ReadRange(uuid, Convert(type), rangeStart, rangeStart + target->size));
 
     assert(buffer->GetSize() == target->size);
 
@@ -130,7 +170,7 @@
   try
   {
     LOG(INFO) << "DelayedDeletion - Scheduling delayed deletion of " << uuid;
-    db_->Enqueue(uuid, Orthanc::Plugins::Convert(type));
+    db_->Enqueue(uuid, Convert(type));
     
     return OrthancPluginErrorCode_Success;
   }