diff Core/Images/IImageWriter.h @ 2170:baf8dd89b4e0

improved support for sandboxed environments
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 23 Nov 2016 11:45:02 +0100
parents bfeacb51af20
children a3a65de1840f
line wrap: on
line diff
--- a/Core/Images/IImageWriter.h	Tue Nov 22 15:03:14 2016 +0100
+++ b/Core/Images/IImageWriter.h	Wed Nov 23 11:45:02 2016 +0100
@@ -36,6 +36,10 @@
 
 #include <boost/noncopyable.hpp>
 
+#if !defined(ORTHANC_SANDBOXED)
+#  error The macro ORTHANC_SANDBOXED must be defined
+#endif
+
 namespace Orthanc
 {
   class IImageWriter : public boost::noncopyable
@@ -48,12 +52,14 @@
                                        PixelFormat format,
                                        const void* buffer) = 0;
 
+#if ORTHANC_SANDBOXED == 0
     virtual void WriteToFileInternal(const std::string& path,
                                      unsigned int width,
                                      unsigned int height,
                                      unsigned int pitch,
                                      PixelFormat format,
                                      const void* buffer);
+#endif
 
   public:
     virtual ~IImageWriter()
@@ -67,11 +73,13 @@
                             accessor.GetPitch(), accessor.GetFormat(), accessor.GetConstBuffer());
     }
 
+#if ORTHANC_SANDBOXED == 0
     virtual void WriteToFile(const std::string& path,
                              const ImageAccessor& accessor)
     {
       WriteToFileInternal(path, accessor.GetWidth(), accessor.GetHeight(),
                           accessor.GetPitch(), accessor.GetFormat(), accessor.GetConstBuffer());
     }
+#endif
   };
 }