summaryrefslogtreecommitdiff
path: root/site/custom.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-01-09 13:58:38 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2021-01-09 13:58:38 +0000
commit62d506c24aaf543f84c82e2850a05b1387e4990d (patch)
tree3d356dcef6cb64baf648119c6b61aa9afd4e450b /site/custom.cpp
parentExclude api.h from tidy checks (diff)
downloadmirrorsearch-62d506c24aaf543f84c82e2850a05b1387e4990d.tar.bz2
mirrorsearch-62d506c24aaf543f84c82e2850a05b1387e4990d.tar.xz
mirrorsearch-62d506c24aaf543f84c82e2850a05b1387e4990d.zip
Clang format
Diffstat (limited to 'site/custom.cpp')
-rw-r--r--site/custom.cpp39
1 files changed, 19 insertions, 20 deletions
diff --git a/site/custom.cpp b/site/custom.cpp
index 5d955a2..00dcb6a 100644
--- a/site/custom.cpp
+++ b/site/custom.cpp
@@ -7,27 +7,27 @@ namespace MirrorSearch {
// Route name: download
// path: /download/{filename}
class download : public IceSpider::IRouteHandler {
- public:
- download(const IceSpider::Core * core) :
- IceSpider::IRouteHandler(IceSpider::HttpMethod::GET, "/download/{filename}"),
- prx0(core->getProxy<MirrorSearch::Search>()),
- _pi_filename(1)
- {
+ public:
+ download(const IceSpider::Core * core) :
+ IceSpider::IRouteHandler(IceSpider::HttpMethod::GET, "/download/{filename}"),
+ prx0(core->getProxy<MirrorSearch::Search>()), _pi_filename(1)
+ {
+ }
+
+ void
+ execute(IceSpider::IHttpRequest * request) const
+ {
+ auto _p_filename(request->getURLParam<::std::string>(_pi_filename));
+ auto _responseModel = prx0->feelingLucky(_p_filename, request->getContext());
+ if (_responseModel) {
+ request->responseRedirect(*_responseModel, "Mirror found"s);
}
+ request->response(404, "No mirror found");
+ }
- void execute(IceSpider::IHttpRequest * request) const
- {
- auto _p_filename(request->getURLParam<::std::string>(_pi_filename));
- auto _responseModel = prx0->feelingLucky(_p_filename, request->getContext());
- if (_responseModel) {
- request->responseRedirect(*_responseModel, "Mirror found"s);
- }
- request->response(404, "No mirror found");
- }
-
- private:
- const MirrorSearch::SearchPrxPtr prx0;
- const unsigned int _pi_filename;
+ private:
+ const MirrorSearch::SearchPrxPtr prx0;
+ const unsigned int _pi_filename;
};
} // namespace MirrorSearch
@@ -36,4 +36,3 @@ namespace MirrorSearch {
FACTORY(MirrorSearch::download, IceSpider::RouteHandlerFactory);
// End generated code.
-