diff Core/Uuid.cpp @ 2140:aa4b8895cd23

reorganization
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 09 Nov 2016 16:12:47 +0100
parents b1291df2f780
children a260a8ad83f1
line wrap: on
line diff
--- a/Core/Uuid.cpp	Wed Nov 09 15:25:09 2016 +0100
+++ b/Core/Uuid.cpp	Wed Nov 09 16:12:47 2016 +0100
@@ -117,46 +117,48 @@
 
       return IsUuid(str.substr(0, 36));
     }
+  }
 
 
-    static std::string CreateTemporaryPath(const char* extension)
-    {
+  static std::string CreateTemporaryPath(const char* extension)
+  {
 #if BOOST_HAS_FILESYSTEM_V3 == 1
-      boost::filesystem::path tmpDir = boost::filesystem::temp_directory_path();
+    boost::filesystem::path tmpDir = boost::filesystem::temp_directory_path();
 #elif defined(__linux__)
-      boost::filesystem::path tmpDir("/tmp");
+    boost::filesystem::path tmpDir("/tmp");
 #else
 #error Support your platform here
 #endif
 
-      // We use UUID to create unique path to temporary files
-      std::string filename = "Orthanc-" + Orthanc::Toolbox::GenerateUuid();
+    // We use UUID to create unique path to temporary files
+    std::string filename = "Orthanc-" + Orthanc::Toolbox::GenerateUuid();
 
-      if (extension != NULL)
-      {
-        filename.append(extension);
-      }
+    if (extension != NULL)
+    {
+      filename.append(extension);
+    }
 
-      tmpDir /= filename;
-      return tmpDir.string();
-    }
+    tmpDir /= filename;
+    return tmpDir.string();
+  }
 
 
-    TemporaryFile::TemporaryFile() : 
-      path_(CreateTemporaryPath(NULL))
-    {
-    }
+#if ORTHANC_SANDBOXED == 0
+  TemporaryFile::TemporaryFile() : 
+    path_(CreateTemporaryPath(NULL))
+  {
+  }
 
 
-    TemporaryFile::TemporaryFile(const char* extension) :
-      path_(CreateTemporaryPath(extension))
-    {
-    }
+  TemporaryFile::TemporaryFile(const char* extension) :
+    path_(CreateTemporaryPath(extension))
+  {
+  }
 
 
-    TemporaryFile::~TemporaryFile()
-    {
-      boost::filesystem::remove(path_);
-    }  
-  }
+  TemporaryFile::~TemporaryFile()
+  {
+    boost::filesystem::remove(path_);
+  }  
+#endif
 }