Mercurial > hg > orthanc
comparison Core/FileStorage/FileStorage.cpp @ 803:4689e400e0fa
directory to store the results of the unit tests
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 07 May 2014 09:29:11 +0200 |
parents | 2d0a347e8cfc |
children | a811bdf8b8eb |
comparison
equal
deleted
inserted
replaced
802:82b07ab959f4 | 803:4689e400e0fa |
---|---|
76 return path; | 76 return path; |
77 } | 77 } |
78 | 78 |
79 FileStorage::FileStorage(std::string root) | 79 FileStorage::FileStorage(std::string root) |
80 { | 80 { |
81 namespace fs = boost::filesystem; | |
82 | |
83 //root_ = boost::filesystem::absolute(root).string(); | 81 //root_ = boost::filesystem::absolute(root).string(); |
84 root_ = root; | 82 root_ = root; |
85 | 83 |
86 if (fs::exists(root)) | 84 Toolbox::CreateDirectory(root); |
87 { | |
88 if (!fs::is_directory(root)) | |
89 { | |
90 throw OrthancException("The file storage root directory is a file"); | |
91 } | |
92 } | |
93 else | |
94 { | |
95 if (!fs::create_directories(root)) | |
96 { | |
97 throw OrthancException("Unable to create the file storage root directory"); | |
98 } | |
99 } | |
100 } | 85 } |
101 | 86 |
102 std::string FileStorage::CreateFileWithoutCompression(const void* content, size_t size) | 87 std::string FileStorage::CreateFileWithoutCompression(const void* content, size_t size) |
103 { | 88 { |
104 std::string uuid; | 89 std::string uuid; |