comparison Common/BaseStoragePlugin.cpp @ 77:80792bb9600e

new HybridMode
author Alain Mazy <am@osimis.io>
date Fri, 14 Oct 2022 10:36:02 +0200
parents 16e419fe80c5
children
comparison
equal deleted inserted replaced
75:ac596874d997 77:80792bb9600e
18 18
19 19
20 #include "BaseStoragePlugin.h" 20 #include "BaseStoragePlugin.h"
21 #include <boost/filesystem/fstream.hpp> 21 #include <boost/filesystem/fstream.hpp>
22 22
23 std::string BaseStoragePlugin::GetOrthancFileSystemPath(const std::string& uuid, const std::string& fileSystemRootPath) 23 boost::filesystem::path BaseStoragePlugin::GetOrthancFileSystemPath(const std::string& uuid, const std::string& fileSystemRootPath)
24 { 24 {
25 boost::filesystem::path path = fileSystemRootPath; 25 boost::filesystem::path path = fileSystemRootPath;
26 26
27 path /= std::string(&uuid[0], &uuid[2]); 27 path /= std::string(&uuid[0], &uuid[2]);
28 path /= std::string(&uuid[2], &uuid[4]); 28 path /= std::string(&uuid[2], &uuid[4]);
29 path /= uuid; 29 path /= uuid;
30 30
31 path.make_preferred(); 31 path.make_preferred();
32 32
33 return path.string(); 33 return path;
34 } 34 }
35 35
36 36
37 std::string BaseStoragePlugin::GetPath(const char* uuid, OrthancPluginContentType type, bool encryptionEnabled, bool useAlternateExtension) 37 std::string BaseStoragePlugin::GetPath(const char* uuid, OrthancPluginContentType type, bool encryptionEnabled, bool useAlternateExtension)
38 { 38 {
39 if (enableLegacyStorageStructure_) 39 if (enableLegacyStorageStructure_)
40 { 40 {
41 return GetOrthancFileSystemPath(uuid, rootPath_); 41 return GetOrthancFileSystemPath(uuid, rootPath_).string();
42 } 42 }
43 else 43 else
44 { 44 {
45 boost::filesystem::path path = rootPath_; 45 boost::filesystem::path path = rootPath_;
46 std::string filename = std::string(uuid); 46 std::string filename = std::string(uuid);