diff Framework/Common/ResultFileValue.h @ 246:483af3f35a4b

turning ResultFileValue into a base class, and implement its primitives for PostgreSQL
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 14 Apr 2021 08:42:31 +0200
parents 9d00e5e073e8
children e57a5313ffe5
line wrap: on
line diff
--- a/Framework/Common/ResultFileValue.h	Tue Apr 13 18:50:44 2021 +0200
+++ b/Framework/Common/ResultFileValue.h	Wed Apr 14 08:42:31 2021 +0200
@@ -27,36 +27,19 @@
 
 namespace OrthancDatabases
 {
+  /**
+   * This class is not used for MySQL, as MySQL uses BLOB columns to
+   * store files.
+   **/
   class ResultFileValue : public IValue
   {
-  private:
-    std::string  content_;
-
   public:
-    ResultFileValue()
-    {
-    }
-
-    std::string& GetContent()
-    {
-      return content_;
-    }
-
-    const std::string& GetContent() const
-    {
-      return content_;
-    }
-
-    const void* GetBuffer() const
-    {
-      return (content_.empty() ? NULL : content_.c_str());
-    }
-
-    size_t GetSize() const
-    {
-      return content_.size();
-    }
-
+    virtual void ReadWhole(std::string& target) const = 0;
+    
+    virtual void ReadRange(std::string& target,
+                           uint64_t start,
+                           size_t length) const = 0;
+    
     virtual ValueType GetType() const ORTHANC_OVERRIDE
     {
       return ValueType_ResultFile;