diff Plugins/Engine/OrthancPluginDatabase.cpp @ 3089:fb8ee0786b1e db-changes

new extension for database plugin SDK: setResourcesContent
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 05 Jan 2019 11:39:31 +0100
parents c829758b9ca0
children 476cba12c2b0
line wrap: on
line diff
--- a/Plugins/Engine/OrthancPluginDatabase.cpp	Fri Jan 04 17:48:34 2019 +0100
+++ b/Plugins/Engine/OrthancPluginDatabase.cpp	Sat Jan 05 11:39:31 2019 +0100
@@ -1281,4 +1281,29 @@
       ForwardAnswers(result);
     }
   }
+
+
+  void OrthancPluginDatabase::SetResourcesContent(const Orthanc::ResourcesContent& content)
+  {
+    if (extensions_.setResourcesContent == NULL)
+    {
+      ISetResourcesContent::Apply(*this, content);
+    }
+    else
+    {
+      std::vector<OrthancPluginResourcesContentTags> identifierTags;
+      std::vector<OrthancPluginResourcesContentTags> mainDicomTags;
+      std::vector<OrthancPluginResourcesContentMetadata> metadata;
+      content.EncodeForPlugins(identifierTags, mainDicomTags, metadata);
+
+      CheckSuccess(extensions_.setResourcesContent(
+                     payload_,
+                     identifierTags.size(),
+                     (identifierTags.empty() ? NULL : &identifierTags[0]),
+                     mainDicomTags.size(),
+                     (mainDicomTags.empty() ? NULL : &mainDicomTags[0]),
+                     metadata.size(),
+                     (metadata.empty() ? NULL : &metadata[0])));
+    }
+  }
 }