diff Plugins/Engine/PluginsManager.cpp @ 896:c4053ac5db04 plugins

better plugni api
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 17 Jun 2014 09:57:02 +0200
parents 690aeb4cb899
children bafc9d592632
line wrap: on
line diff
--- a/Plugins/Engine/PluginsManager.cpp	Mon Jun 16 17:47:58 2014 +0200
+++ b/Plugins/Engine/PluginsManager.cpp	Tue Jun 17 09:57:02 2014 +0200
@@ -147,50 +147,20 @@
   }
 
   void PluginsManager::RegisterRestCallback(const OrthancPluginContext* context,
-                                            const char* path, 
-                                            OrthancRestCallback callback)
+                                            const char* pathRegularExpression, 
+                                            OrthancPluginRestCallback callback)
   {
     // TODO
-    LOG(INFO) << "Plugin has registered a REST callback on: " << path;
+    LOG(INFO) << "Plugin has registered a REST callback on: " << pathRegularExpression;
 
     PluginsManager* manager = reinterpret_cast<PluginsManager*>(context->pimpl);
     manager->restCallbacks_.push_back(callback);
 
-
-    const char* pp = "/hello/world";
-
-    UriComponents components;
-    Toolbox::SplitUriComponents(components, pp);
-
-    OrthancRestUrl url;
-    url.path = pp;
-
-    std::vector<const char*> c(components.size());
-    for (unsigned int i = 0; i < components.size(); i++)
-    {
-      c[i] = components[i].c_str();
-    }
-
-    if (components.size() == 0)
-    {
-      url.components = NULL;
-      url.componentsSize = 0;
-    }
-    else
-    {
-      url.components = &c[0];
-      url.componentsSize = components.size();
-    }
-
-    // TODO
-    url.parameters = NULL;
-    url.parametersSize = 0;
-
-    callback(NULL, OrthancHttpMethod_Get, &url, NULL, 0);
+    callback(NULL, OrthancPluginHttpMethod_Get, "/hello/world", NULL, 0);
   }
 
 
-  static void AnswerBuffer(OrthancRestOutput* output,
+  static void AnswerBuffer(OrthancPluginRestOutput* output,
                            const char* answer,
                            uint32_t answerSize,
                            const char* mimeType)
@@ -311,5 +281,4 @@
       }
     }
   }
-
 }