Kodi Documentation  18.0
Kodi is an open source media player and entertainment hub.
CURL Class Reference

#include <URL.h>

Public Member Functions

 CURL (const std::string &strURL)
 
 CURL ()=default
 
virtual ~CURL (void)
 
bool operator== (const std::string &url) const
 
void Reset ()
 
void Parse (const std::string &strURL)
 
void SetFileName (const std::string &strFileName)
 
void SetHostName (const std::string &strHostName)
 
void SetUserName (const std::string &strUserName)
 
void SetDomain (const std::string &strDomain)
 
void SetPassword (const std::string &strPassword)
 
void SetProtocol (const std::string &strProtocol)
 
void SetOptions (const std::string &strOptions)
 
void SetProtocolOptions (const 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
 
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
 
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 (const std::string &path)
 
static bool IsFileOnly (const std::string &url)
 return true if there are no directories in the url. More...
 
static bool IsFullPath (const std::string &url)
 return true if the url includes the full path More...
 
static std::string Decode (const std::string &strURLData)
 
static std::string Encode (const std::string &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
 

Constructor & Destructor Documentation

§ CURL() [1/2]

CURL::CURL ( const std::string &  strURL)
inlineexplicit

§ CURL() [2/2]

CURL::CURL ( )
default

§ ~CURL()

CURL::~CURL ( void  )
virtualdefault

Member Function Documentation

§ Decode()

std::string CURL::Decode ( const std::string &  strURLData)
static

§ Encode()

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

§ Get()

std::string CURL::Get ( ) const

§ GetDirectorySeparator()

char CURL::GetDirectorySeparator ( ) const

§ GetDomain()

const std::string& CURL::GetDomain ( ) const
inline

§ GetFileName()

const std::string& CURL::GetFileName ( ) const
inline

§ GetFileNameWithoutPath()

const std::string CURL::GetFileNameWithoutPath ( ) const

§ GetFileType()

const std::string& CURL::GetFileType ( ) const
inline

§ GetHostName()

const std::string& CURL::GetHostName ( ) const
inline

§ GetOption() [1/2]

bool CURL::GetOption ( const std::string &  key,
std::string &  value 
) const

§ GetOption() [2/2]

std::string CURL::GetOption ( const std::string &  key) const

§ GetOptions() [1/2]

const std::string& CURL::GetOptions ( ) const
inline

§ GetOptions() [2/2]

void CURL::GetOptions ( std::map< std::string, std::string > &  options) const

§ GetPassWord()

const std::string& CURL::GetPassWord ( ) const
inline

§ GetPort()

int CURL::GetPort ( ) const
inline

§ GetProtocol()

const std::string& CURL::GetProtocol ( ) const
inline

§ GetProtocolOption() [1/2]

bool CURL::GetProtocolOption ( const std::string &  key,
std::string &  value 
) const

§ GetProtocolOption() [2/2]

std::string CURL::GetProtocolOption ( const std::string &  key) const

§ GetProtocolOptions() [1/2]

const std::string& CURL::GetProtocolOptions ( ) const
inline

§ GetProtocolOptions() [2/2]

void CURL::GetProtocolOptions ( std::map< std::string, std::string > &  options) const

§ GetRedacted() [1/2]

std::string CURL::GetRedacted ( ) const

§ GetRedacted() [2/2]

std::string CURL::GetRedacted ( const std::string &  path)
static

§ GetShareName()

const std::string& CURL::GetShareName ( ) const
inline

§ GetTranslatedProtocol()

const std::string CURL::GetTranslatedProtocol ( ) const

§ GetUserName()

const std::string& CURL::GetUserName ( ) const
inline

§ GetWithoutFilename()

std::string CURL::GetWithoutFilename ( ) const

§ GetWithoutOptions()

std::string CURL::GetWithoutOptions ( ) const

§ GetWithoutUserDetails()

std::string CURL::GetWithoutUserDetails ( bool  redact = false) const

§ HasOption()

bool CURL::HasOption ( const std::string &  key) const

§ HasPort()

bool CURL::HasPort ( ) const
inline

§ HasProtocolOption()

bool CURL::HasProtocolOption ( const std::string &  key) const

§ IsFileOnly()

bool CURL::IsFileOnly ( const std::string &  url)
static

return true if there are no directories in the url.

§ 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.

§ IsFullPath()

bool CURL::IsFullPath ( const std::string &  url)
static

return true if the url includes the full path

§ IsLocal()

bool CURL::IsLocal ( ) const

§ IsLocalHost()

bool CURL::IsLocalHost ( ) const

§ 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.

§ operator==()

bool CURL::operator== ( const std::string &  url) const
inline

§ Parse()

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

§ RemoveOption()

void CURL::RemoveOption ( const std::string &  key)

§ RemoveProtocolOption()

void CURL::RemoveProtocolOption ( const std::string &  key)

§ Reset()

void CURL::Reset ( void  )

§ SetDomain()

void CURL::SetDomain ( const std::string &  strDomain)
inline

§ SetFileName()

void CURL::SetFileName ( const std::string &  strFileName)

§ SetHostName()

void CURL::SetHostName ( const std::string &  strHostName)
inline

§ SetOption()

void CURL::SetOption ( const std::string &  key,
const std::string &  value 
)

§ SetOptions()

void CURL::SetOptions ( const std::string &  strOptions)

§ SetPassword()

void CURL::SetPassword ( const std::string &  strPassword)
inline

§ SetPort()

void CURL::SetPort ( int  port)
inline

§ SetProtocol()

void CURL::SetProtocol ( const std::string &  strProtocol)

§ SetProtocolOption()

void CURL::SetProtocolOption ( const std::string &  key,
const std::string &  value 
)

§ SetProtocolOptions()

void CURL::SetProtocolOptions ( const std::string &  strOptions)

§ SetUserName()

void CURL::SetUserName ( const std::string &  strUserName)
inline

Member Data Documentation

§ m_iPort

int CURL::m_iPort = 0
protected

§ m_options

CUrlOptions CURL::m_options
protected

§ m_protocolOptions

CUrlOptions CURL::m_protocolOptions
protected

§ m_strDomain

std::string CURL::m_strDomain
protected

§ m_strFileName

std::string CURL::m_strFileName
protected

§ m_strFileType

std::string CURL::m_strFileType
protected

§ m_strHostName

std::string CURL::m_strHostName
protected

§ m_strOptions

std::string CURL::m_strOptions
protected

§ m_strPassword

std::string CURL::m_strPassword
protected

§ m_strProtocol

std::string CURL::m_strProtocol
protected

§ m_strProtocolOptions

std::string CURL::m_strProtocolOptions
protected

§ m_strShareName

std::string CURL::m_strShareName
protected

§ m_strUserName

std::string CURL::m_strUserName
protected

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