diff OrthancServer/Plugins/Engine/OrthancPluginDatabase.cpp @ 4627:f7d5372b59b3 db-changes

handling revisions of attachments
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 20 Apr 2021 15:11:59 +0200
parents 95ffe3b6ef7c
children f0038043fb97 7053502fbf97
line wrap: on
line diff
--- a/OrthancServer/Plugins/Engine/OrthancPluginDatabase.cpp	Mon Apr 19 10:28:43 2021 +0200
+++ b/OrthancServer/Plugins/Engine/OrthancPluginDatabase.cpp	Tue Apr 20 15:11:59 2021 +0200
@@ -651,8 +651,10 @@
     
 
     virtual void AddAttachment(int64_t id,
-                               const FileInfo& attachment) ORTHANC_OVERRIDE
+                               const FileInfo& attachment,
+                               int64_t revision) ORTHANC_OVERRIDE
     {
+      // "revision" is not used, as it was added in Orthanc 1.9.2
       OrthancPluginAttachment tmp;
       tmp.uuid = attachment.GetUuid().c_str();
       tmp.contentType = static_cast<int32_t>(attachment.GetContentType());
@@ -1104,6 +1106,7 @@
 
     
     virtual bool LookupAttachment(FileInfo& attachment,
+                                  int64_t& revision,
                                   int64_t id,
                                   FileContentType contentType) ORTHANC_OVERRIDE
     {
@@ -1111,6 +1114,8 @@
 
       CheckSuccess(that_.backend_.lookupAttachment
                    (that_.GetContext(), that_.payload_, id, static_cast<int32_t>(contentType)));
+      
+      revision = 0;  // Dummy value, as revisions were added in Orthanc 1.9.2
 
       if (type_ == _OrthancPluginDatabaseAnswerType_None)
       {