comparison OrthancServer/main.cpp @ 1124:790ff7a5b3bf

IStorageArea abstraction
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 05 Sep 2014 16:28:34 +0200
parents da56a7916e8a
children f4e65808ea58
comparison
equal deleted inserted replaced
1123:6c5a77637b23 1124:790ff7a5b3bf
35 35
36 #include <fstream> 36 #include <fstream>
37 #include <glog/logging.h> 37 #include <glog/logging.h>
38 #include <boost/algorithm/string/predicate.hpp> 38 #include <boost/algorithm/string/predicate.hpp>
39 39
40 #include "../Core/FileStorage/FilesystemStorage.h"
40 #include "../Core/HttpServer/EmbeddedResourceHttpHandler.h" 41 #include "../Core/HttpServer/EmbeddedResourceHttpHandler.h"
41 #include "../Core/HttpServer/FilesystemHttpHandler.h" 42 #include "../Core/HttpServer/FilesystemHttpHandler.h"
42 #include "../Core/Lua/LuaFunctionCall.h" 43 #include "../Core/Lua/LuaFunctionCall.h"
43 #include "../Core/DicomFormat/DicomArray.h" 44 #include "../Core/DicomFormat/DicomArray.h"
44 #include "DicomProtocol/DicomServer.h" 45 #include "DicomProtocol/DicomServer.h"
318 { 319 {
319 std::string storageDirectoryStr = Configuration::GetGlobalStringParameter("StorageDirectory", "OrthancStorage"); 320 std::string storageDirectoryStr = Configuration::GetGlobalStringParameter("StorageDirectory", "OrthancStorage");
320 boost::filesystem::path storageDirectory = Configuration::InterpretStringParameterAsPath(storageDirectoryStr); 321 boost::filesystem::path storageDirectory = Configuration::InterpretStringParameterAsPath(storageDirectoryStr);
321 boost::filesystem::path indexDirectory = Configuration::InterpretStringParameterAsPath( 322 boost::filesystem::path indexDirectory = Configuration::InterpretStringParameterAsPath(
322 Configuration::GetGlobalStringParameter("IndexDirectory", storageDirectoryStr)); 323 Configuration::GetGlobalStringParameter("IndexDirectory", storageDirectoryStr));
323 ServerContext context(storageDirectory, indexDirectory); 324
325 FilesystemStorage storage(storageDirectory.string());
326 ServerContext context(storage, indexDirectory);
324 327
325 LOG(WARNING) << "Storage directory: " << storageDirectory; 328 LOG(WARNING) << "Storage directory: " << storageDirectory;
326 LOG(WARNING) << "Index directory: " << indexDirectory; 329 LOG(WARNING) << "Index directory: " << indexDirectory;
327 330
328 context.SetCompressionEnabled(Configuration::GetGlobalBoolParameter("StorageCompression", false)); 331 context.SetCompressionEnabled(Configuration::GetGlobalBoolParameter("StorageCompression", false));