![]() |
Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
|
#include <CurlFile.h>
Classes | |
class | CReadState |
Public Types | |
enum class | ProxyType { HTTP = 0 , SOCKS4 , SOCKS4A , SOCKS5 , SOCKS5_REMOTE , HTTPS } |
Public Member Functions | |
CCurlFile () | |
~CCurlFile () override | |
bool | Open (const CURL &url) override |
bool | OpenForWrite (const CURL &url, bool bOverWrite=false) override |
bool | ReOpen (const CURL &url) override |
bool | Exists (const CURL &url) override |
int64_t | Seek (int64_t iFilePosition, int iWhence=SEEK_SET) override |
int64_t | GetPosition () override |
int64_t | GetLength () override |
int | Stat (const CURL &url, struct __stat64 *buffer) override |
Fills struct __stat64 with information about file specified by url. | |
void | Close () override |
ReadLineResult | ReadLine (char *buffer, std::size_t bufferSize) override |
ssize_t | Read (void *lpBuf, size_t uiBufSize) override |
ssize_t | Write (const void *lpBuf, size_t uiBufSize) override |
const std::string | GetProperty (XFILE::FileProperty type, const std::string &name="") const override |
const std::vector< std::string > | GetPropertyValues (XFILE::FileProperty type, const std::string &name="") const override |
int | IoControl (IOControl request, void *param) override |
double | GetDownloadSpeed () override |
bool | Post (const std::string &strURL, const std::string &strPostData, std::string &strHTML) |
bool | Get (const std::string &strURL, std::string &strHTML) |
bool | ReadData (std::string &strHTML) |
bool | Download (const std::string &strURL, const std::string &strFileName, unsigned int *pdwSize=NULL) |
bool | IsInternet () |
void | Cancel () |
void | Reset () |
void | SetUserAgent (const std::string &sUserAgent) |
void | SetProxy (const std::string &type, const std::string &host, uint16_t port, const std::string &user, const std::string &password) |
void | SetCustomRequest (const std::string &request) |
void | SetAcceptEncoding (const std::string &encoding) |
void | SetAcceptCharset (const std::string &charset) |
void | SetTimeout (int connecttimeout) |
void | SetLowSpeedTime (int lowspeedtime) |
void | SetPostData (const std::string &postdata) |
void | SetReferer (const std::string &referer) |
void | SetCookie (const std::string &cookie) |
void | SetMimeType (const std::string &mimetype) |
void | SetRequestHeader (const std::string &header, const std::string &value) |
void | SetRequestHeader (const std::string &header, long value) |
void | ClearRequestHeaders () |
void | SetBufferSize (unsigned int size) |
const CHttpHeader & | GetHttpHeader () const |
const std::string & | GetURL () const |
std::string | GetRedirectURL () |
![]() | |
IFile () | |
virtual | ~IFile () |
virtual int | Stat (struct __stat64 *buffer) |
virtual void | Flush () |
virtual int | Truncate (int64_t size) |
virtual int | GetChunkSize () |
virtual bool | Delete (const CURL &url) |
virtual bool | Rename (const CURL &url, const CURL &urlnew) |
virtual bool | SetHidden (const CURL &url, bool hidden) |
Static Public Member Functions | |
static bool | GetHttpHeader (const CURL &url, CHttpHeader &headers) |
static bool | GetMimeType (const CURL &url, std::string &content, const std::string &useragent="") |
static bool | GetContentType (const CURL &url, std::string &content, const std::string &useragent="") |
static bool | GetCookies (const CURL &url, std::string &cookies) |
Protected Types | |
typedef std::map< std::string, std::string > | MAPHTTPHEADERS |
Protected Member Functions | |
void | ParseAndCorrectUrl (CURL &url) |
void | SetCommonOptions (CReadState *state, bool failOnError=true) |
void | SetRequestHeaders (CReadState *state) |
void | SetCorrectHeaders (CReadState *state) |
bool | Service (const std::string &strURL, std::string &strHTML) |
std::string | GetInfoString (int infoType) |
|
protected |
|
strong |
CCurlFile::CCurlFile | ( | ) |
|
override |
void CCurlFile::Cancel | ( | ) |
void CCurlFile::ClearRequestHeaders | ( | ) |
|
overridevirtual |
Implements XFILE::IFile.
bool CCurlFile::Download | ( | const std::string & | strURL, |
const std::string & | strFileName, | ||
unsigned int * | pdwSize = NULL ) |
Implements XFILE::IFile.
bool CCurlFile::Get | ( | const std::string & | strURL, |
std::string & | strHTML ) |
|
static |
|
overridevirtual |
Reimplemented from XFILE::IFile.
|
inline |
|
static |
|
protected |
|
overridevirtual |
Implements XFILE::IFile.
|
static |
|
overridevirtual |
Implements XFILE::IFile.
|
overridevirtual |
Reimplemented from XFILE::IFile.
|
overridevirtual |
Reimplemented from XFILE::IFile.
std::string CCurlFile::GetRedirectURL | ( | ) |
|
inline |
Reimplemented from XFILE::IFile.
bool CCurlFile::IsInternet | ( | ) |
Implements XFILE::IFile.
Reimplemented from XFILE::IFile.
bool CCurlFile::Post | ( | const std::string & | strURL, |
const std::string & | strPostData, | ||
std::string & | strHTML ) |
Attempt to read bufSize bytes from currently opened file into buffer bufPtr.
bufPtr | pointer to buffer |
bufSize | size of the buffer |
Implements XFILE::IFile.
bool CCurlFile::ReadData | ( | std::string & | strHTML | ) |
|
inlineoverridevirtual |
Reads a line from a file into buffer
. Reads at most bufferLength
- 1 bytes from the file. buffer
is unchanged in case the returned result code is FAILURE. The read line can contain '\0' characters
buffer | The buffer into which the line is wrote |
bufferSize | The size of buffer |
Reimplemented from XFILE::IFile.
Reimplemented from XFILE::IFile.
void CCurlFile::Reset | ( | ) |
Implements XFILE::IFile.
|
protected |
|
inline |
|
inline |
|
protected |
|
inline |
|
protected |
|
inline |
|
inline |
|
inline |
void CCurlFile::SetProxy | ( | const std::string & | type, |
const std::string & | host, | ||
uint16_t | port, | ||
const std::string & | user, | ||
const std::string & | password ) |
|
inline |
void CCurlFile::SetRequestHeader | ( | const std::string & | header, |
const std::string & | value ) |
void CCurlFile::SetRequestHeader | ( | const std::string & | header, |
long | value ) |
|
protected |
|
inline |
Fills struct __stat64 with information about file specified by url.
For st_mode function will set correctly _S_IFDIR (directory) flag and may set _S_IREAD (read permission), _S_IWRITE (write permission) flags if such information is available. Function may set st_size (file size), st_atime, st_mtime, st_ctime (access, modification, creation times). Any other flags and members of __stat64 that didn't updated with actual file information will be set to zero (st_nlink can be set ether to 1 or zero).
[in] | url | specifies requested file. Ends with a directory separator for directories. |
[out] | buffer | pointer to __stat64 buffer to receive information about file |
Implements XFILE::IFile.
Attempt to write bufSize bytes from buffer bufPtr into currently opened file.
bufPtr | pointer to buffer |
bufSize | size of the buffer |
Reimplemented from XFILE::IFile.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |