Mercurial > hg > orthanc
diff Core/Uuid.cpp @ 82:9eb40cad7935
fixes
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 24 Sep 2012 14:05:19 +0200 |
parents | c996319e90bc |
children | fd7b0a3e6260 |
line wrap: on
line diff
--- a/Core/Uuid.cpp Mon Sep 24 10:33:41 2012 +0200 +++ b/Core/Uuid.cpp Mon Sep 24 14:05:19 2012 +0200 @@ -31,6 +31,8 @@ #endif } +#include <boost/filesystem.hpp> + namespace Orthanc { namespace Toolbox @@ -80,5 +82,20 @@ return true; } + + + TemporaryFile::TemporaryFile() + { + // We use UUID to create unique path to temporary files + boost::filesystem::path tmp = boost::filesystem::temp_directory_path(); + tmp /= "Orthanc-" + Orthanc::Toolbox::GenerateUuid(); + path_ = tmp.string(); + } + + + TemporaryFile::~TemporaryFile() + { + boost::filesystem::remove(path_); + } } }