comparison OrthancServer/main.cpp @ 201:bee20e978835

refactoring of delete
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 27 Nov 2012 17:36:19 +0100
parents 8e673a65564d
children 96b7918a6a18
comparison
equal deleted inserted replaced
200:9c58b2b03cf0 201:bee20e978835
215 if (!isInitialized) 215 if (!isInitialized)
216 { 216 {
217 OrthancInitialize(); 217 OrthancInitialize();
218 } 218 }
219 219
220 std::string storageDirectory = GetGlobalStringParameter("StorageDirectory", "OrthancStorage"); 220 boost::filesystem::path storageDirectory = GetGlobalStringParameter("StorageDirectory", "OrthancStorage");
221 ServerIndex index(storageDirectory); 221 FileStorage storage(storageDirectory.string());
222 MyDicomStoreFactory storeScp(index, storageDirectory); 222 ServerIndex index(storage, storageDirectory.string());
223 MyDicomStoreFactory storeScp(index, storageDirectory.string());
223 224
224 { 225 {
225 // DICOM server 226 // DICOM server
226 DicomServer dicomServer; 227 DicomServer dicomServer;
227 dicomServer.SetCalledApplicationEntityTitleCheck(GetGlobalBoolParameter("DicomCheckCalledAet", false)); 228 dicomServer.SetCalledApplicationEntityTitleCheck(GetGlobalBoolParameter("DicomCheckCalledAet", false));
255 httpServer.RegisterHandler(new EmbeddedResourceHttpHandler("/app", EmbeddedResources::ORTHANC_EXPLORER)); 256 httpServer.RegisterHandler(new EmbeddedResourceHttpHandler("/app", EmbeddedResources::ORTHANC_EXPLORER));
256 #else 257 #else
257 httpServer.RegisterHandler(new FilesystemHttpHandler("/app", ORTHANC_PATH "/OrthancExplorer")); 258 httpServer.RegisterHandler(new FilesystemHttpHandler("/app", ORTHANC_PATH "/OrthancExplorer"));
258 #endif 259 #endif
259 260
260 httpServer.RegisterHandler(new OrthancRestApi(index, storageDirectory)); 261 httpServer.RegisterHandler(new OrthancRestApi(index, storageDirectory.string()));
261 262
262 // GO !!! 263 // GO !!!
263 httpServer.Start(); 264 httpServer.Start();
264 dicomServer.Start(); 265 dicomServer.Start();
265 266