comparison Core/RestApi/RestApiGetCall.h @ 1441:f3672356c121

refactoring: IHttpHandler and HttpToolbox
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 01 Jul 2015 10:38:39 +0200
parents 6e7e5ed91c2d
children 3232f1c995a5
comparison
equal deleted inserted replaced
1440:3567503c00a7 1441:f3672356c121
37 namespace Orthanc 37 namespace Orthanc
38 { 38 {
39 class RestApiGetCall : public RestApiCall 39 class RestApiGetCall : public RestApiCall
40 { 40 {
41 private: 41 private:
42 const HttpHandler::Arguments& getArguments_; 42 const IHttpHandler::Arguments& getArguments_;
43 43
44 public: 44 public:
45 typedef void (*Handler) (RestApiGetCall& call); 45 typedef void (*Handler) (RestApiGetCall& call);
46 46
47 RestApiGetCall(RestApiOutput& output, 47 RestApiGetCall(RestApiOutput& output,
48 RestApi& context, 48 RestApi& context,
49 const HttpHandler::Arguments& httpHeaders, 49 const IHttpHandler::Arguments& httpHeaders,
50 const HttpHandler::Arguments& uriComponents, 50 const IHttpHandler::Arguments& uriComponents,
51 const UriComponents& trailing, 51 const UriComponents& trailing,
52 const UriComponents& fullUri, 52 const UriComponents& fullUri,
53 const HttpHandler::Arguments& getArguments) : 53 const IHttpHandler::Arguments& getArguments) :
54 RestApiCall(output, context, httpHeaders, uriComponents, trailing, fullUri), 54 RestApiCall(output, context, httpHeaders, uriComponents, trailing, fullUri),
55 getArguments_(getArguments) 55 getArguments_(getArguments)
56 { 56 {
57 } 57 }
58 58
59 std::string GetArgument(const std::string& name, 59 std::string GetArgument(const std::string& name,
60 const std::string& defaultValue) const 60 const std::string& defaultValue) const
61 { 61 {
62 return HttpHandler::GetArgument(getArguments_, name, defaultValue); 62 return HttpToolbox::GetArgument(getArguments_, name, defaultValue);
63 } 63 }
64 64
65 bool HasArgument(const std::string& name) const 65 bool HasArgument(const std::string& name) const
66 { 66 {
67 return getArguments_.find(name) != getArguments_.end(); 67 return getArguments_.find(name) != getArguments_.end();