kodi
HTTPWebinterfaceHandler.h
1 /*
2  * Copyright (C) 2011-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 "addons/IAddon.h"
12 #include "network/httprequesthandler/HTTPFileHandler.h"
13 
14 #include <string>
15 
17 {
18 public:
19  CHTTPWebinterfaceHandler() = default;
20  ~CHTTPWebinterfaceHandler() override = default;
21 
22  IHTTPRequestHandler* Create(const HTTPRequest &request) const override { return new CHTTPWebinterfaceHandler(request); }
23  bool CanHandleRequest(const HTTPRequest &request) const override;
24 
25  static int ResolveUrl(const std::string &url, std::string &path);
26  static int ResolveUrl(const std::string &url, std::string &path, ADDON::AddonPtr &addon);
27  static bool ResolveAddon(const std::string &url, ADDON::AddonPtr &addon);
28  static bool ResolveAddon(const std::string &url, ADDON::AddonPtr &addon, std::string &addonPath);
29 
30 protected:
31  explicit CHTTPWebinterfaceHandler(const HTTPRequest &request);
32 };
Definition: IHTTPRequestHandler.h:66
bool CanHandleRequest(const HTTPRequest &request) const override
Checks if the HTTP request handler can handle the given request.
Definition: HTTPWebinterfaceHandler.cpp:34
Definition: HTTPFileHandler.h:16
Definition: HTTPWebinterfaceHandler.h:16
IHTTPRequestHandler * Create(const HTTPRequest &request) const override
Creates a new HTTP request handler for the given request.
Definition: HTTPWebinterfaceHandler.h:22
Definition: IHTTPRequestHandler.h:85