Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
|
#include <CurlFile.h>
Classes | |
class | CReadState |
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 |
void | Close () override |
bool | ReadString (char *szLine, int iLineLength) 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 (EIoControl 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 |
std::string | GetURL (void) |
std::string | GetRedirectURL () |
Public Member Functions inherited from XFILE::IFile | |
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 |
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 | ( | ) |
std::string CCurlFile::GetURL | ( | void | ) |
|
overridevirtual |
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 | ) |
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).
url | specifies requested file |
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 |