Mercurial > hg > orthanc
comparison OrthancFramework/Sources/FileStorage/FilesystemStorage.h @ 4484:64f06e7d5fc7
new abstraction IMemoryBuffer to avoid unnecessary copies of std::string buffers
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 28 Jan 2021 19:03:19 +0100 |
parents | d9473bd5ed43 |
children | fa2311f94d9f |
comparison
equal
deleted
inserted
replaced
4483:a926f8995d0b | 4484:64f06e7d5fc7 |
---|---|
58 #if ORTHANC_BUILDING_FRAMEWORK_LIBRARY == 1 | 58 #if ORTHANC_BUILDING_FRAMEWORK_LIBRARY == 1 |
59 // Alias for binary compatibility with Orthanc Framework 1.7.2 => don't use it anymore | 59 // Alias for binary compatibility with Orthanc Framework 1.7.2 => don't use it anymore |
60 explicit FilesystemStorage(std::string root); | 60 explicit FilesystemStorage(std::string root); |
61 #endif | 61 #endif |
62 | 62 |
63 #if ORTHANC_BUILDING_FRAMEWORK_LIBRARY == 1 | |
64 // Binary compatibility with Orthanc Framework <= 1.8.2 | |
65 void Read(std::string& content, | |
66 const std::string& uuid, | |
67 FileContentType type); | |
68 #endif | |
69 | |
63 public: | 70 public: |
64 explicit FilesystemStorage(const std::string& root); | 71 explicit FilesystemStorage(const std::string& root); |
65 | 72 |
66 FilesystemStorage(const std::string& root, | 73 FilesystemStorage(const std::string& root, |
67 bool fsyncOnWrite); | 74 bool fsyncOnWrite); |
69 virtual void Create(const std::string& uuid, | 76 virtual void Create(const std::string& uuid, |
70 const void* content, | 77 const void* content, |
71 size_t size, | 78 size_t size, |
72 FileContentType type) ORTHANC_OVERRIDE; | 79 FileContentType type) ORTHANC_OVERRIDE; |
73 | 80 |
74 virtual void Read(std::string& content, | 81 virtual IMemoryBuffer* Read(const std::string& uuid, |
75 const std::string& uuid, | 82 FileContentType type) ORTHANC_OVERRIDE; |
76 FileContentType type) ORTHANC_OVERRIDE; | |
77 | 83 |
78 virtual void Remove(const std::string& uuid, | 84 virtual void Remove(const std::string& uuid, |
79 FileContentType type) ORTHANC_OVERRIDE; | 85 FileContentType type) ORTHANC_OVERRIDE; |
80 | 86 |
81 void ListAllFiles(std::set<std::string>& result) const; | 87 void ListAllFiles(std::set<std::string>& result) const; |