diff OrthancFramework/Sources/RestApi/RestApiHierarchy.cpp @ 4330:a01b1c9cbef4

moving generic type definitions from IHttpHandler to HttpToolbox
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 25 Nov 2020 14:39:10 +0100
parents 44b53a2c0a13
children 80fd140b12ba
line wrap: on
line diff
--- a/OrthancFramework/Sources/RestApi/RestApiHierarchy.cpp	Wed Nov 25 13:46:49 2020 +0100
+++ b/OrthancFramework/Sources/RestApi/RestApiHierarchy.cpp	Wed Nov 25 14:39:10 2020 +0100
@@ -210,10 +210,10 @@
   }
 
 
-  bool RestApiHierarchy::LookupResource(IHttpHandler::Arguments& components,
-                                       const UriComponents& uri,
-                                       IVisitor& visitor,
-                                       size_t level)
+  bool RestApiHierarchy::LookupResource(HttpToolbox::Arguments& components,
+                                        const UriComponents& uri,
+                                        IVisitor& visitor,
+                                        size_t level)
   {
     if (uri.size() != 0 &&
         level > uri.size())
@@ -224,8 +224,8 @@
     UriComponents trailing;
 
     // Look for an exact match on the resource of interest
-      if (uri.size() == 0 ||
-          level == uri.size())
+    if (uri.size() == 0 ||
+        level == uri.size())
     {
       if (!handlers_.IsEmpty() &&
           visitor.Visit(handlers_, uri, components, trailing))
@@ -251,7 +251,7 @@
       for (child = wildcardChildren_.begin();
            child != wildcardChildren_.end(); ++child)
       {
-        IHttpHandler::Arguments subComponents = components;
+        HttpToolbox::Arguments subComponents = components;
         subComponents[child->first] = uri[level];
 
         if (child->second->LookupResource(subComponents, uri, visitor, level + 1))
@@ -420,7 +420,7 @@
   bool RestApiHierarchy::LookupResource(const UriComponents& uri,
                                         IVisitor& visitor)
   {
-    IHttpHandler::Arguments components;
+    HttpToolbox::Arguments components;
     return LookupResource(components, uri, visitor, 0);
   }    
 
@@ -443,7 +443,7 @@
 
       virtual bool Visit(const RestApiHierarchy::Resource& resource,
                          const UriComponents& uri,
-                         const IHttpHandler::Arguments& components,
+                         const HttpToolbox::Arguments& components,
                          const UriComponents& trailing)
       {
         if (trailing.size() == 0)  // Ignore universal handlers
@@ -477,7 +477,7 @@
   void RestApiHierarchy::GetAcceptedMethods(std::set<HttpMethod>& methods,
                                             const UriComponents& uri)
   {
-    IHttpHandler::Arguments components;
+    HttpToolbox::Arguments components;
     AcceptedMethodsVisitor visitor(methods);
     if (LookupResource(components, uri, visitor, 0))
     {