kodi
HTTPImageHandler.h
1 /*
2  * Copyright (C) 2012-2018 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
11 #include "network/httprequesthandler/HTTPFileHandler.h"
12 
13 #include <string>
14 
16 {
17 public:
18  CHTTPImageHandler() = default;
19  ~CHTTPImageHandler() override = default;
20 
21  IHTTPRequestHandler* Create(const HTTPRequest &request) const override { return new CHTTPImageHandler(request); }
22  bool CanHandleRequest(const HTTPRequest &request) const override;
23 
24  int GetPriority() const override { return 5; }
25  int GetMaximumAgeForCaching() const override { return 60 * 60 * 24 * 7; }
26 
27 protected:
28  explicit CHTTPImageHandler(const HTTPRequest &request);
29 };
Definition: IHTTPRequestHandler.h:66
int GetPriority() const override
Returns the priority of the HTTP request handler.
Definition: HTTPImageHandler.h:24
bool CanHandleRequest(const HTTPRequest &request) const override
Checks if the HTTP request handler can handle the given request.
Definition: HTTPImageHandler.cpp:48
Definition: HTTPFileHandler.h:16
IHTTPRequestHandler * Create(const HTTPRequest &request) const override
Creates a new HTTP request handler for the given request.
Definition: HTTPImageHandler.h:21
int GetMaximumAgeForCaching() const override
Returns the maximum age (in seconds) for which the response can be cached.
Definition: HTTPImageHandler.h:25
Definition: HTTPImageHandler.h:15
Definition: IHTTPRequestHandler.h:85