diff Core/RestApi/RestApiHierarchy.cpp @ 975:c550e99c452b

refactoring
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 30 Jun 2014 14:53:18 +0200
parents 83622b0f544c
children ce3106e5843f
line wrap: on
line diff
--- a/Core/RestApi/RestApiHierarchy.cpp	Mon Jun 30 14:44:05 2014 +0200
+++ b/Core/RestApi/RestApiHierarchy.cpp	Mon Jun 30 14:53:18 2014 +0200
@@ -32,6 +32,8 @@
 
 #include "RestApiHierarchy.h"
 
+#include "../OrthancException.h"
+
 #include <cassert>
 
 namespace Orthanc
@@ -163,7 +165,7 @@
   }
 
 
-  bool RestApiHierarchy::LookupHandler(RestApiPath::Components& components,
+  bool RestApiHierarchy::LookupHandler(HttpHandler::Arguments& components,
                                        const UriComponents& uri,
                                        ResourceCallback callback,
                                        size_t level,
@@ -198,7 +200,7 @@
     for (child = wildcardChildren_.begin();
          child != wildcardChildren_.end(); child++)
     {
-      RestApiPath::Components subComponents = components;
+      HttpHandler::Arguments subComponents = components;
       subComponents[child->first] = uri[level];
 
       if (child->second->LookupHandler(components, uri, callback, level + 1, call))
@@ -280,7 +282,7 @@
 
   bool RestApiHierarchy::GetCallback(Handlers& handlers,
                                      const UriComponents& uri,
-                                     const RestApiPath::Components& components,
+                                     const HttpHandler::Arguments& components,
                                      const UriComponents& trailing,
                                      void* call)
   {
@@ -298,7 +300,7 @@
 
   bool RestApiHierarchy::PostCallback(Handlers& handlers,
                                       const UriComponents& uri,
-                                      const RestApiPath::Components& components,
+                                      const HttpHandler::Arguments& components,
                                       const UriComponents& trailing,
                                       void* call)
   {
@@ -316,7 +318,7 @@
 
   bool RestApiHierarchy::PutCallback(Handlers& handlers,
                                      const UriComponents& uri,
-                                     const RestApiPath::Components& components,
+                                     const HttpHandler::Arguments& components,
                                      const UriComponents& trailing,
                                      void* call)
   {
@@ -334,7 +336,7 @@
 
   bool RestApiHierarchy::DeleteCallback(Handlers& handlers,
                                         const UriComponents& uri,
-                                        const RestApiPath::Components& components,
+                                        const HttpHandler::Arguments& components,
                                         const UriComponents& trailing,
                                         void* call)
   {
@@ -432,28 +434,28 @@
   bool RestApiHierarchy::Handle(RestApiGetCall& call,
                                 const UriComponents& uri)
   {
-    RestApiPath::Components components;
+    HttpHandler::Arguments components;
     return LookupHandler(components, uri, GetCallback, 0, &call);
   }    
 
   bool RestApiHierarchy::Handle(RestApiPutCall& call,
                                 const UriComponents& uri)
   {
-    RestApiPath::Components components;
+    HttpHandler::Arguments components;
     return LookupHandler(components, uri, PutCallback, 0, &call);
   }    
 
   bool RestApiHierarchy::Handle(RestApiPostCall& call,
                                 const UriComponents& uri)
   {
-    RestApiPath::Components components;
+    HttpHandler::Arguments components;
     return LookupHandler(components, uri, PostCallback, 0, &call);
   }    
 
   bool RestApiHierarchy::Handle(RestApiDeleteCall& call,
                                 const UriComponents& uri)
   {
-    RestApiPath::Components components;
+    HttpHandler::Arguments components;
     return LookupHandler(components, uri, DeleteCallback, 0, &call);
   }