Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
|
Other globally available functions
Used to perform typical operations with it.
More...
Functions | |
std::string ATTR_DLL_LOCAL | kodi::vfs::GetFileMD5 (const std::string &path) |
Retrieve MD5sum of a file. | |
std::string ATTR_DLL_LOCAL | kodi::vfs::GetCacheThumbName (const std::string &filename) |
Returns a thumb cache filename. | |
std::string ATTR_DLL_LOCAL | kodi::vfs::MakeLegalFileName (const std::string &filename) |
Make filename valid. | |
std::string ATTR_DLL_LOCAL | kodi::vfs::MakeLegalPath (const std::string &path) |
Make directory name valid. | |
std::string ATTR_DLL_LOCAL | kodi::vfs::TranslateSpecialProtocol (const std::string &source) |
Returns the translated path. | |
bool ATTR_DLL_LOCAL | kodi::vfs::GetDiskSpace (const std::string &path, uint64_t &capacity, uint64_t &free, uint64_t &available) |
Retrieves information about the amount of space that is available on a disk volume. | |
std::string ATTR_DLL_LOCAL | kodi::vfs::GetFileName (const std::string &path) |
Return the file name from given complete path string. | |
std::string ATTR_DLL_LOCAL | kodi::vfs::GetDirectoryName (const std::string &path) |
Return the directory name from given complete path string. | |
void ATTR_DLL_LOCAL | kodi::vfs::RemoveSlashAtEnd (std::string &path) |
Remove the slash on given path name. | |
unsigned int ATTR_DLL_LOCAL | kodi::vfs::GetChunkSize (unsigned int chunk, unsigned int minimum) |
Return a size aligned to the chunk size at least as large as the chunk size. | |
bool ATTR_DLL_LOCAL | kodi::vfs::IsInternetStream (const std::string &path, bool strictCheck=false) |
Checks the given path contains a known internet protocol. | |
bool ATTR_DLL_LOCAL | kodi::vfs::IsOnLAN (const std::string &path) |
Checks whether the specified path refers to a local network. | |
bool ATTR_DLL_LOCAL | kodi::vfs::IsRemote (const std::string &path) |
Checks specified path for external network. | |
bool ATTR_DLL_LOCAL | kodi::vfs::IsLocal (const std::string &path) |
Checks whether the given path refers to the own system. | |
bool ATTR_DLL_LOCAL | kodi::vfs::IsURL (const std::string &path) |
Checks specified path is a regular URL, e.g. "someprotocol://path/to/file". | |
bool ATTR_DLL_LOCAL | kodi::vfs::GetHttpHeader (const std::string &url, HttpHeader &header) |
To get HTTP header information. | |
bool ATTR_DLL_LOCAL | kodi::vfs::GetMimeType (const std::string &url, std::string &mimeType, const std::string &useragent="") |
Get file mime type. | |
bool ATTR_DLL_LOCAL | kodi::vfs::GetContentType (const std::string &url, std::string &content, const std::string &useragent="") |
Get file content-type. | |
bool ATTR_DLL_LOCAL | kodi::vfs::GetCookies (const std::string &url, std::string &cookies) |
Get cookies stored by CURL in RFC 2109 format. | |
Other globally available functions
Used to perform typical operations with it.
|
inline |
Returns a thumb cache filename.
[in] | filename | Path to file |
Example:
|
inline |
Return a size aligned to the chunk size at least as large as the chunk size.
[in] | chunk | The chunk size |
[in] | minimum | The minimum size (or maybe the minimum number of chunks?) |
|
inline |
Get file content-type.
[in] | url | URL source of the data |
[out] | content | The returned type |
[in] | useragent | to be used when retrieving the MimeType [opt] |
Example:
|
inline |
Get cookies stored by CURL in RFC 2109 format.
[in] | url | URL source of the data |
[out] | cookies | The text list of available cookies |
Example:
|
inline |
Return the directory name from given complete path string.
[in] | path | The complete path include file and directory |
Example:
|
inline |
Retrieves information about the amount of space that is available on a disk volume.
Path can be also with Kodi's special protocol.
[in] | path | Path for where to check |
[out] | capacity | The total number of bytes in the file system |
[out] | free | The total number of free bytes in the file system |
[out] | available | The total number of free bytes available to a non-privileged process |
Example:
|
inline |
Retrieve MD5sum of a file.
[in] | path | Path to the file to MD5sum |
Example:
|
inline |
Return the file name from given complete path string.
[in] | path | The complete path include file and directory |
Example:
|
inline |
To get HTTP header information.
[in] | url | URL source of the data |
[out] | header | The class HttpHeader |
The following table contains values that can be get with class HttpHeader :
Description | Type | Get call |
---|---|---|
Get the value associated with this parameter of these HTTP headers | std::string | GetValue |
Get the values as list associated with this parameter of these HTTP headers | std::vector<std::string> | GetValues |
Get the full header string associated with these HTTP headers | std::string | GetHeader |
Get the mime type associated with these HTTP headers | std::string | GetMimeType |
Get the charset associated with these HTTP headers | std::string | GetCharset |
The protocol line associated with these HTTP headers | std::string | GetProtoLine |
Example:
|
inline |
Get file mime type.
[in] | url | URL source of the data |
[out] | mimeType | the mime type of the URL |
[in] | useragent | to be used when retrieving the MimeType [opt] |
Example:
|
inline |
Checks the given path contains a known internet protocol.
About following protocols are the path checked:
Protocol | Return true condition | Protocol | Return true condition |
---|---|---|---|
dav | strictCheck = true | rtmps | always |
davs | strictCheck = true | rtmpt | always |
ftp | strictCheck = true | rtmpte | always |
ftps | strictCheck = true | rtp | always |
http | always | rtsp | always |
https | always | sdp | always |
mms | always | sftp | strictCheck = true |
mmsh | always | stack | always |
mmst | always | tcp | always |
rtmp | always | udp | always |
rtmpe | always |
[in] | path | To checked path/URL |
[in] | strictCheck | [opt] If True the set of protocols used will be extended to include ftp, ftps, dav, davs and sftp. |
Example:
|
inline |
Checks whether the given path refers to the own system.
[in] | path | To checked path |
|
inline |
Checks whether the specified path refers to a local network.
In difference to IsHostOnLAN() include this more deeper checks where also handle Kodi's special protocol and stacks.
[in] | path | To checked path |
Example:
|
inline |
Checks specified path for external network.
[in] | path | To checked path |
Example:
|
inline |
Checks specified path is a regular URL, e.g. "someprotocol://path/to/file".
Example:
|
inline |
Make filename valid.
Function to replace not valid characters with '_'. It can be also compared with original before in a own loop until it is equal (no invalid characters).
[in] | filename | Filename to check and fix |
Example:
|
inline |
Make directory name valid.
Function to replace not valid characters with '_'. It can be also compared with original before in a own loop until it is equal (no invalid characters).
[in] | path | Directory name to check and fix |
Example:
|
inline |
Remove the slash on given path name.
[in,out] | path | The complete path |
Example:
|
inline |
Returns the translated path.
[in] | source | String or unicode - Path to format |
Example:
or