diff OrthancServer/Sources/OrthancInitialization.cpp @ 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
line wrap: on
line diff
--- a/OrthancServer/Sources/OrthancInitialization.cpp	Thu Jan 28 16:59:40 2021 +0100
+++ b/OrthancServer/Sources/OrthancInitialization.cpp	Thu Jan 28 19:03:19 2021 +0100
@@ -359,7 +359,7 @@
       virtual void Create(const std::string& uuid,
                           const void* content, 
                           size_t size,
-                          FileContentType type)
+                          FileContentType type) ORTHANC_OVERRIDE
       {
         if (type != FileContentType_Dicom)
         {
@@ -367,13 +367,12 @@
         }
       }
 
-      virtual void Read(std::string& content,
-                        const std::string& uuid,
-                        FileContentType type)
+      virtual IMemoryBuffer* Read(const std::string& uuid,
+                                  FileContentType type) ORTHANC_OVERRIDE
       {
         if (type != FileContentType_Dicom)
         {
-          storage_.Read(content, uuid, type);
+          return storage_.Read(uuid, type);
         }
         else
         {
@@ -382,7 +381,7 @@
       }
 
       virtual void Remove(const std::string& uuid,
-                          FileContentType type) 
+                          FileContentType type) ORTHANC_OVERRIDE
       {
         if (type != FileContentType_Dicom)
         {