changeset 70:f869ea124433

merge
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 07 Aug 2015 21:24:03 +0200
parents fe8dab5c051f (diff) 29cb0e084121 (current diff)
children 9bb7caee0509
files CMakeLists.txt Orthanc/Core/Toolbox.cpp Orthanc/Resources/ThirdParty/minizip/NOTES Orthanc/Resources/ThirdParty/minizip/crypt.h Orthanc/Resources/ThirdParty/minizip/ioapi.c Orthanc/Resources/ThirdParty/minizip/ioapi.h Orthanc/Resources/ThirdParty/minizip/zip.c Orthanc/Resources/ThirdParty/minizip/zip.h
diffstat 5 files changed, 67 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/CMakeLists.txt	Tue Aug 04 15:03:14 2015 +0200
+++ b/CMakeLists.txt	Fri Aug 07 21:24:03 2015 +0200
@@ -36,6 +36,7 @@
 set(USE_SYSTEM_LIBPNG ON CACHE BOOL "Use the system version of libpng")
 set(USE_SYSTEM_ZLIB ON CACHE BOOL "Use the system version of zlib")
 set(USE_SYSTEM_SQLITE ON CACHE BOOL "Use the system version of SQLite")
+set(USE_SYSTEM_ORTHANC_SDK ON CACHE BOOL "Use the system version of the Orthanc plugin SDK")
 
 # Distribution-specific settings
 set(USE_GTEST_DEBIAN_SOURCE_PACKAGE OFF CACHE BOOL "Use the sources of Google Test shipped with libgtest-dev (Debian only)")
@@ -63,7 +64,7 @@
 
 
 # Check that the Orthanc SDK headers are available or download them
-if (STATIC_BUILD)
+if (STATIC_BUILD OR NOT USE_SYSTEM_ORTHANC_SDK)
   include_directories(${ORTHANC_ROOT}/Sdk-0.9.1)
 else ()
   CHECK_INCLUDE_FILE_CXX(orthanc/OrthancCPlugin.h HAVE_ORTHANC_H)
--- a/Orthanc/Core/Enumerations.cpp	Tue Aug 04 15:03:14 2015 +0200
+++ b/Orthanc/Core/Enumerations.cpp	Fri Aug 07 21:24:03 2015 +0200
@@ -36,6 +36,8 @@
 #include "OrthancException.h"
 #include "Toolbox.h"
 
+#include <string.h>
+
 namespace Orthanc
 {
   const char* EnumerationToString(HttpMethod method)
@@ -368,6 +370,28 @@
   }
 
 
+  const char* EnumerationToString(LogLevel level)
+  {
+    switch (level)
+    {
+      case LogLevel_Error:
+        return "ERROR";
+
+      case LogLevel_Warning:
+        return "WARNING";
+
+      case LogLevel_Info:
+        return "INFO";
+
+      case LogLevel_Trace:
+        return "TRACE";
+
+      default:
+        throw OrthancException(ErrorCode_ParameterOutOfRange);
+    }
+  }
+
+
   Encoding StringToEncoding(const char* encoding)
   {
     std::string s(encoding);
@@ -493,6 +517,31 @@
   }
 
 
+  LogLevel StringToLogLevel(const char *level)
+  {
+    if (strcmp(level, "ERROR") == 0)
+    {
+      return LogLevel_Error;
+    }
+    else if (strcmp(level, "WARNING") == 0)
+    {
+      return LogLevel_Warning;
+    }
+    else if (strcmp(level, "INFO") == 0)
+    {
+      return LogLevel_Info;
+    }
+    else if (strcmp(level, "TRACE") == 0)
+    {
+      return LogLevel_Trace;
+    }
+    else 
+    {
+      throw OrthancException(ErrorCode_InternalError);
+    }
+  }
+
+
   unsigned int GetBytesPerPixel(PixelFormat format)
   {
     switch (format)
--- a/Orthanc/Core/Enumerations.h	Tue Aug 04 15:03:14 2015 +0200
+++ b/Orthanc/Core/Enumerations.h	Fri Aug 07 21:24:03 2015 +0200
@@ -76,6 +76,14 @@
     ErrorCode_Plugin
   };
 
+  enum LogLevel
+  {
+    LogLevel_Error,
+    LogLevel_Warning,
+    LogLevel_Info,
+    LogLevel_Trace
+  };
+
 
   /**
    * {summary}{The memory layout of the pixels (resp. voxels) of a 2D (resp. 3D) image.}
@@ -330,12 +338,16 @@
 
   const char* EnumerationToString(PhotometricInterpretation photometric);
 
+  const char* EnumerationToString(LogLevel level);
+
   Encoding StringToEncoding(const char* encoding);
 
   ResourceType StringToResourceType(const char* type);
 
   ImageFormat StringToImageFormat(const char* format);
 
+  LogLevel StringToLogLevel(const char* format);
+
   unsigned int GetBytesPerPixel(PixelFormat format);
 
   bool GetDicomEncoding(Encoding& encoding,
--- a/Orthanc/Core/Toolbox.cpp	Tue Aug 04 15:03:14 2015 +0200
+++ b/Orthanc/Core/Toolbox.cpp	Fri Aug 07 21:24:03 2015 +0200
@@ -437,7 +437,7 @@
     {
       return static_cast<uint64_t>(boost::filesystem::file_size(path));
     }
-    catch (boost::filesystem::filesystem_error)
+    catch (boost::filesystem::filesystem_error&)
     {
       throw OrthancException(ErrorCode_InexistentFile);
     }
--- a/Orthanc/Resources/CMake/JsonCppConfiguration.cmake	Tue Aug 04 15:03:14 2015 +0200
+++ b/Orthanc/Resources/CMake/JsonCppConfiguration.cmake	Fri Aug 07 21:24:03 2015 +0200
@@ -1,8 +1,8 @@
 if (STATIC_BUILD OR NOT USE_SYSTEM_JSONCPP)
-  set(JSONCPP_SOURCES_DIR ${CMAKE_BINARY_DIR}/jsoncpp-src-0.6.0-rc2)
+  set(JSONCPP_SOURCES_DIR ${CMAKE_BINARY_DIR}/jsoncpp-0.10.5)
   DownloadPackage(
-    "363e2f4cbd3aeb63bf4e571f377400fb"
-    "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/jsoncpp-src-0.6.0-rc2.tar.gz"
+    "db146bac5a126ded9bd728ab7b61ed6b"
+    "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/jsoncpp-0.10.5.tar.gz"
     "${JSONCPP_SOURCES_DIR}")
 
   set(JSONCPP_SOURCES