diff Core/RestApi/RestApi.cpp @ 659:443cced10836

code cleaning
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 04 Nov 2013 14:41:46 +0100
parents 08eca5d86aad
children 2d0a347e8cfc
line wrap: on
line diff
--- a/Core/RestApi/RestApi.cpp	Mon Nov 04 12:08:07 2013 +0100
+++ b/Core/RestApi/RestApi.cpp	Mon Nov 04 14:41:46 2013 +0100
@@ -51,7 +51,7 @@
     result.clear();
 
     for (HttpHandler::Arguments::const_iterator 
-           it = getArguments_->begin(); it != getArguments_->end(); ++it)
+           it = getArguments_.begin(); it != getArguments_.end(); ++it)
     {
       result[it->first] = it->second;
     }
@@ -200,15 +200,7 @@
         {
           //LOG(INFO) << "REST GET call on: " << Toolbox::FlattenUri(uri);
           ok = true;
-          GetCall call;
-          call.output_ = &restOutput;
-          call.context_ = this;
-          call.httpHeaders_ = &headers;
-          call.uriComponents_ = &components;
-          call.trailing_ = &trailing;
-          call.fullUri_ = &uri;
-          
-          call.getArguments_ = &getArguments;
+          GetCall call(restOutput, *this, headers, components, trailing, uri, getArguments);
           it->second(call);
         }
       }
@@ -222,15 +214,7 @@
         {
           //LOG(INFO) << "REST PUT call on: " << Toolbox::FlattenUri(uri);
           ok = true;
-          PutCall call;
-          call.output_ = &restOutput;
-          call.context_ = this;
-          call.httpHeaders_ = &headers;
-          call.uriComponents_ = &components;
-          call.trailing_ = &trailing;
-          call.fullUri_ = &uri;
-           
-          call.data_ = &postData;
+          PutCall call(restOutput, *this, headers, components, trailing, uri, postData);
           it->second(call);
         }
       }
@@ -244,15 +228,7 @@
         {
           //LOG(INFO) << "REST POST call on: " << Toolbox::FlattenUri(uri);
           ok = true;
-          PostCall call;
-          call.output_ = &restOutput;
-          call.context_ = this;
-          call.httpHeaders_ = &headers;
-          call.uriComponents_ = &components;
-          call.trailing_ = &trailing;
-          call.fullUri_ = &uri;
-           
-          call.data_ = &postData;
+          PostCall call(restOutput, *this, headers, components, trailing, uri, postData);
           it->second(call);
         }
       }
@@ -266,13 +242,7 @@
         {
           //LOG(INFO) << "REST DELETE call on: " << Toolbox::FlattenUri(uri);
           ok = true;
-          DeleteCall call;
-          call.output_ = &restOutput;
-          call.context_ = this;
-          call.httpHeaders_ = &headers;
-          call.uriComponents_ = &components;
-          call.trailing_ = &trailing;
-          call.fullUri_ = &uri;
+          DeleteCall call(restOutput, *this, headers, components, trailing, uri);
           it->second(call);
         }
       }