![]() |
Kodi Documentation 18.0
Kodi is an open source media player and entertainment hub.
|
Virtual filesystem functions More...
Modules | |
Definitions, structures and enumerators | |
Virtual file Server definition values | |
class CDirEntry | |
Virtual file server directory entry | |
class CFile | |
Virtual file server control | |
Functions | |
bool | kodi::vfs::CreateDirectory (const std::string &path) |
Make a directory. More... | |
bool | kodi::vfs::DirectoryExists (const std::string &path) |
Verifying the Existence of a Directory. More... | |
bool | kodi::vfs::RemoveDirectory (const std::string &path) |
Removes a directory. More... | |
bool | kodi::vfs::GetDirectory (const std::string &path, const std::string &mask, std::vector< CDirEntry > &items) |
Lists a directory. More... | |
std::string | kodi::vfs::GetFileMD5 (const std::string &path) |
Retrieve MD5sum of a file. More... | |
std::string | kodi::vfs::GetCacheThumbName (const std::string &filename) |
Returns a thumb cache filename. More... | |
std::string | kodi::vfs::MakeLegalFileName (const std::string &filename) |
Make filename valid. More... | |
std::string | kodi::vfs::MakeLegalPath (const std::string &path) |
Make directory name valid. More... | |
std::string | kodi::vfs::TranslateSpecialProtocol (const std::string &source) |
Returns the translated path. More... | |
std::string | kodi::vfs::GetFileName (const std::string &path) |
Return the file name from given complate path string. More... | |
std::string | kodi::vfs::GetDirectoryName (const std::string &path) |
Return the directory name from given complate path string. More... | |
void | kodi::vfs::RemoveSlashAtEnd (std::string &path) |
Remove the slash on given path name. More... | |
unsigned int | 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. More... | |
bool | kodi::vfs::FileExists (const std::string &filename, bool usecache=false) |
Check if a file exists. More... | |
bool | kodi::vfs::StatFile (const std::string &filename, STAT_STRUCTURE &buffer) |
Get file status. More... | |
bool | kodi::vfs::DeleteFile (const std::string &filename) |
Deletes a file. More... | |
bool | kodi::vfs::RenameFile (const std::string &filename, const std::string &newFileName) |
Rename a file name. More... | |
bool | kodi::vfs::CopyFile (const std::string &filename, const std::string &destination) |
Copy a file from source to destination. More... | |
Virtual filesystem functions
It has the header #include <kodi/Filesystem.h> be included to enjoy it.
|
inline |
Copy a file from source to destination.
[in] | filename | The filename to copy. |
[in] | destination | The destination to copy file to |
|
inline |
Make a directory.
The kodi::vfs::CreateDirectory() function shall create a new directory with name path.
The newly created directory shall be an empty directory.
[in] | path | Path to the directory. |
Example:
|
inline |
Deletes a file.
[in] | filename | The filename to delete. |
Example:
|
inline |
Verifying the Existence of a Directory.
The kodi::vfs::DirectoryExists() method determines whether a specified folder exists.
[in] | path | Path to the directory. |
Example:
|
inline |
Check if a file exists.
[in] | filename | The filename to check. |
[in] | usecache | Check in file cache. |
Example:
|
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 |
Lists a directory.
Return the list of files and directories which have been found in the specified directory and which respect the given constraint.
It can handle the normal OS dependent paths and also the special virtual filesystem from Kodi what starts with special://.
[in] | path | The path in which the files and directories are located. |
[in] | mask | Mask to filter out requested files, e.g. "*.avi|*.mpg" to files with this ending. |
[out] | items | The returned list directory entries. |
Example:
|
inline |
Return the directory name from given complate path string.
[in] | path | The complete path include file and directory |
Example:
|
inline |
Retrieve MD5sum of a file.
[in] | path | path to the file to MD5sum |
Example:
|
inline |
Return the file name from given complate path string.
[in] | path | The complete path include file and directory |
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 |
Removes a directory.
The kodi::vfs::RemoveDirectory() function shall remove a directory whose name is given by path.
[in] | path | Path to the directory. |
Example:
|
inline |
Remove the slash on given path name.
[in,out] | path | The complete path |
Example:
|
inline |
Rename a file name.
[in] | filename | The filename to copy. |
[in] | newFileName | The new filename |
|
inline |
Get file status.
These function return information about a file. Execute (search) permission is required on all of the directories in path that lead to the file.
The call return a stat structure, which contains the on STAT_STRUCTURE defined values.
[in] | filename | The filename to read the status from. |
[out] | buffer | The file status is written into this buffer. |
Example:
|
inline |
Returns the translated path.
[in] | source | string or unicode - Path to format |
Example:
or