Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
CHTTPWebinterfaceHandler Class Reference

#include <HTTPWebinterfaceHandler.h>

Inheritance diagram for CHTTPWebinterfaceHandler:
CHTTPFileHandler IHTTPRequestHandler

Public Member Functions

 CHTTPWebinterfaceHandler ()=default
 
 ~CHTTPWebinterfaceHandler () override=default
 
IHTTPRequestHandlerCreate (const HTTPRequest &request) const override
 Creates a new HTTP request handler for the given request.
 
bool CanHandleRequest (const HTTPRequest &request) const override
 Checks if the HTTP request handler can handle the given request.
 
- Public Member Functions inherited from CHTTPFileHandler
 ~CHTTPFileHandler () override=default
 
MHD_RESULT HandleRequest () override
 Handles the HTTP request.
 
bool CanHandleRanges () const override
 Whether the HTTP response could also be provided in ranges.
 
bool CanBeCached () const override
 Whether the HTTP response can be cached.
 
bool GetLastModifiedDate (CDateTime &lastModified) const override
 Returns the last modification date of the response data.
 
std::string GetRedirectUrl () const override
 Returns the URL to which the request should be redirected.
 
std::string GetResponseFile () const override
 Returns the path to the file that should be returned as the response.
 
- Public Member Functions inherited from IHTTPRequestHandler
virtual ~IHTTPRequestHandler ()=default
 
virtual int GetPriority () const
 Returns the priority of the HTTP request handler.
 
virtual int GetMaximumAgeForCaching () const
 Returns the maximum age (in seconds) for which the response can be cached.
 
virtual HttpResponseRanges GetResponseData () const
 Returns the ranges with raw data belonging to the response.
 
const HTTPRequestGetRequest () const
 Returns the HTTP request handled by the HTTP request handler.
 
bool IsRequestRanged () const
 Returns true if the HTTP request is ranged, otherwise false.
 
void SetRequestRanged (bool ranged)
 Sets whether the HTTP request contains ranges or not.
 
void SetResponseStatus (int status)
 Sets the response status of the HTTP response.
 
bool HasResponseHeader (const std::string &field) const
 Checks if the given HTTP header field is part of the response details.
 
bool AddResponseHeader (const std::string &field, const std::string &value, bool allowMultiple=false)
 Adds the given HTTP header field and value to the response details.
 
const HTTPResponseDetailsGetResponseDetails () const
 Returns the HTTP response header details.
 
void AddPostField (const std::string &key, const std::string &value)
 Adds the given key-value pair extracted from the HTTP POST data.
 
bool AddPostData (const char *data, size_t size)
 Adds the given raw HTTP POST data.
 

Static Public Member Functions

static int ResolveUrl (const std::string &url, std::string &path)
 
static int ResolveUrl (const std::string &url, std::string &path, ADDON::AddonPtr &addon)
 
static bool ResolveAddon (const std::string &url, ADDON::AddonPtr &addon)
 
static bool ResolveAddon (const std::string &url, ADDON::AddonPtr &addon, std::string &addonPath)
 

Protected Member Functions

 CHTTPWebinterfaceHandler (const HTTPRequest &request)
 
- Protected Member Functions inherited from CHTTPFileHandler
 CHTTPFileHandler ()
 
 CHTTPFileHandler (const HTTPRequest &request)
 
void SetFile (const std::string &file, int responseStatus)
 
void SetCanHandleRanges (bool canHandleRanges)
 
void SetCanBeCached (bool canBeCached)
 
void SetLastModifiedDate (const struct __stat64 *buffer)
 
- Protected Member Functions inherited from IHTTPRequestHandler
 IHTTPRequestHandler ()
 
 IHTTPRequestHandler (const HTTPRequest &request)
 
virtual bool appendPostData (const char *data, size_t size)
 
bool GetRequestedRanges (uint64_t totalLength)
 
bool GetHostnameAndPort (std::string &hostname, uint16_t &port)
 

Additional Inherited Members

- Protected Attributes inherited from IHTTPRequestHandler
HTTPRequest m_request
 
HTTPResponseDetails m_response
 
std::map< std::string, std::string > m_postFields
 

Constructor & Destructor Documentation

◆ CHTTPWebinterfaceHandler() [1/2]

CHTTPWebinterfaceHandler::CHTTPWebinterfaceHandler ( )
default

◆ ~CHTTPWebinterfaceHandler()

CHTTPWebinterfaceHandler::~CHTTPWebinterfaceHandler ( )
overridedefault

◆ CHTTPWebinterfaceHandler() [2/2]

CHTTPWebinterfaceHandler::CHTTPWebinterfaceHandler ( const HTTPRequest & request)
explicitprotected

Member Function Documentation

◆ CanHandleRequest()

bool CHTTPWebinterfaceHandler::CanHandleRequest ( const HTTPRequest & request) const
overridevirtual

Checks if the HTTP request handler can handle the given request.

Parameters
requestHTTP request to be handled
Returns
True if the given HTTP request can be handled otherwise false.

Implements IHTTPRequestHandler.

◆ Create()

IHTTPRequestHandler * CHTTPWebinterfaceHandler::Create ( const HTTPRequest & request) const
inlineoverridevirtual

Creates a new HTTP request handler for the given request.

This call is responsible for doing some preparation work like - depending on the supported features - determining whether the requested entity supports ranges, whether it can be cached and what it's last modified date is.

Parameters
requestHTTP request to be handled

Implements IHTTPRequestHandler.

◆ ResolveAddon() [1/2]

bool CHTTPWebinterfaceHandler::ResolveAddon ( const std::string & url,
ADDON::AddonPtr & addon )
static

◆ ResolveAddon() [2/2]

bool CHTTPWebinterfaceHandler::ResolveAddon ( const std::string & url,
ADDON::AddonPtr & addon,
std::string & addonPath )
static

◆ ResolveUrl() [1/2]

int CHTTPWebinterfaceHandler::ResolveUrl ( const std::string & url,
std::string & path )
static

◆ ResolveUrl() [2/2]

int CHTTPWebinterfaceHandler::ResolveUrl ( const std::string & url,
std::string & path,
ADDON::AddonPtr & addon )
static

The documentation for this class was generated from the following files: