xbmc
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
CURL Class Reference
Collaboration diagram for CURL:
Collaboration graph
[legend]

Public Member Functions

 CURL (std::string strURL)
 
bool operator== (const std::string &url) const
 
void Reset ()
 
void Parse (std::string strURL)
 
void SetFileName (std::string strFileName)
 
void SetHostName (std::string strHostName)
 
void SetUserName (std::string strUserName)
 
void SetDomain (std::string strDomain)
 
void SetPassword (std::string strPassword)
 
void SetProtocol (std::string strProtocol)
 
void SetOptions (std::string strOptions)
 
void SetProtocolOptions (std::string strOptions)
 
void SetPort (int port)
 
bool HasPort () const
 
int GetPort () const
 
const std::string & GetHostName () const
 
const std::string & GetDomain () const
 
const std::string & GetUserName () const
 
const std::string & GetPassWord () const
 
const std::string & GetFileName () const
 
const std::string & GetProtocol () const
 
std::string GetTranslatedProtocol () const
 
const std::string & GetFileType () const
 
const std::string & GetShareName () const
 
const std::string & GetOptions () const
 
const std::string & GetProtocolOptions () const
 
std::string GetFileNameWithoutPath () const
 
char GetDirectorySeparator () const
 
std::string Get () const
 
std::string GetWithoutOptions () const
 
std::string GetWithoutUserDetails (bool redact=false) const
 
std::string GetWithoutFilename () const
 
std::string GetRedacted () const
 
bool IsLocal () const
 
bool IsLocalHost () const
 
bool IsProtocol (const char *type) const
 Check whether a URL is a given URL scheme. Comparison is case-insensitive as per RFC1738. More...
 
bool IsFileType (const char *type) const
 Check whether a URL is a given filetype. Comparison is effectively case-insensitive as both the parameter and m_strFileType are lower-case. More...
 
void GetOptions (std::map< std::string, std::string > &options) const
 
bool HasOption (const std::string &key) const
 
bool GetOption (const std::string &key, std::string &value) const
 
std::string GetOption (const std::string &key) const
 
void SetOption (const std::string &key, const std::string &value)
 
void RemoveOption (const std::string &key)
 
void GetProtocolOptions (std::map< std::string, std::string > &options) const
 
bool HasProtocolOption (const std::string &key) const
 
bool GetProtocolOption (const std::string &key, std::string &value) const
 
std::string GetProtocolOption (const std::string &key) const
 
void SetProtocolOption (const std::string &key, const std::string &value)
 
void RemoveProtocolOption (const std::string &key)
 

Static Public Member Functions

static std::string GetRedacted (std::string path)
 
static bool IsFileOnly (const std::string &url)
 return true if there are no directories in the url.
 
static bool IsFullPath (const std::string &url)
 return true if the url includes the full path
 
static std::string Decode (std::string_view strURLData)
 
static std::string Encode (std::string_view strURLData)
 
static bool IsProtocolEqual (const std::string &protocol, const char *type)
 Check whether a URL protocol is a given URL scheme. Both parameters MUST be lower-case. Typically this would be called using the result of TranslateProtocol() which enforces this for protocol. More...
 

Protected Attributes

int m_iPort = 0
 
std::string m_strHostName
 
std::string m_strShareName
 
std::string m_strDomain
 
std::string m_strUserName
 
std::string m_strPassword
 
std::string m_strFileName
 
std::string m_strProtocol
 
std::string m_strFileType
 
std::string m_strOptions
 
std::string m_strProtocolOptions
 
CUrlOptions m_options
 
CUrlOptions m_protocolOptions
 

Member Function Documentation

◆ Encode()

std::string CURL::Encode ( std::string_view  strURLData)
static
Todo:
Update it to "-_.~" after Gotham according to RFC3986

◆ IsFileType()

bool CURL::IsFileType ( const char *  type) const
inline

Check whether a URL is a given filetype. Comparison is effectively case-insensitive as both the parameter and m_strFileType are lower-case.

Parameters
typea lower-case filetype, e.g. "mp3".
Returns
true if the url is of the given filetype, false otherwise.

◆ IsProtocol()

bool CURL::IsProtocol ( const char *  type) const
inline

Check whether a URL is a given URL scheme. Comparison is case-insensitive as per RFC1738.

Parameters
typea lower-case scheme name, e.g. "smb".
Returns
true if the url is of the given scheme, false otherwise.

◆ IsProtocolEqual()

bool CURL::IsProtocolEqual ( const std::string &  protocol,
const char *  type 
)
static

Check whether a URL protocol is a given URL scheme. Both parameters MUST be lower-case. Typically this would be called using the result of TranslateProtocol() which enforces this for protocol.

Parameters
protocola lower-case scheme name, e.g. "ftp"
typea lower-case scheme name, e.g. "smb".
Returns
true if the url is of the given scheme, false otherwise.

◆ Parse()

void CURL::Parse ( std::string  strURL)
Todo:
fix all Addon paths

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