diff Plugins/Engine/OrthancPlugins.cpp @ 3397:9019279dbfd7

new plugin c++ wrapper: MultipartRestCallback
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 07 Jun 2019 11:26:34 +0200
parents 4981405e6c5c
children 4e8205871967
line wrap: on
line diff
--- a/Plugins/Engine/OrthancPlugins.cpp	Thu Jun 06 21:35:05 2019 +0200
+++ b/Plugins/Engine/OrthancPlugins.cpp	Fri Jun 07 11:26:34 2019 +0200
@@ -4142,6 +4142,16 @@
       assert(handler_ != NULL);
 
       // TODO => multipart parsing
+
+      OrthancPluginErrorCode error = 
+        parameters_.addPart(handler_, "content-type", 0 /* headers */, NULL, NULL,
+                            data, size);
+
+      if (error != OrthancPluginErrorCode_Success)
+      {
+        errorDictionary_.LogError(error, true);
+        throw OrthancException(static_cast<ErrorCode>(error));
+      }
     }
 
     virtual void Execute(HttpOutput& output)
@@ -4195,7 +4205,8 @@
 
         std::string contentType = "TODO";   // TODO
 
-        OrthancPluginMultipartRestHandler* handler = (*it)->GetParameters().factory(
+        OrthancPluginMultipartRestHandler* handler = (*it)->GetParameters().createHandler(
+          (*it)->GetParameters().factory,
           convertedMethod, matcher.GetFlatUri().c_str(), contentType.c_str(),
           matcher.GetGroupsCount(), matcher.GetGroups(), headers.size(),
           headers.empty() ? NULL : &headersKeys[0],