General access functions
This functions which are intended for getting folders, editing storage locations and file system queries.
◆ Stat()
Stat a file.
- Parameters
-
[in] | url | The URL of the file |
[in] | buffer | The buffer to store results in |
- Returns
- -1 on error, 0 otherwise
The following table contains values that can be set with class VFSUrl :
◆ Exists()
Check for file existence.
- Parameters
-
[in] | url | The URL of the file |
- Returns
- True if file exists, false otherwise
◆ ClearOutIdle()
virtual void ClearOutIdle |
( |
| ) |
|
|
inlinevirtual |
Clear out any idle connections.
◆ DisconnectAll()
virtual void DisconnectAll |
( |
| ) |
|
|
inlinevirtual |
Disconnect all connections.
◆ Delete()
Delete a file.
- Parameters
-
[in] | url | The URL of the file |
- Returns
- True if deletion was successful, false otherwise
◆ Rename()
Rename a file.
- Parameters
-
[in] | url | The URL of the source file |
[in] | url2 | The URL of the destination file |
- Returns
- True if deletion was successful, false otherwise
◆ DirectoryExists()
Check for directory existence.
- Parameters
-
[in] | url | The URL of the file |
- Returns
- True if directory exists, false otherwise
◆ RemoveDirectory()
Remove a directory.
- Parameters
-
[in] | url | The URL of the directory |
- Returns
- True if removal was successful, false otherwise
◆ CreateDirectory()
Create a directory.
- Parameters
-
[in] | url | The URL of the file |
- Returns
- True if creation was successful, false otherwise
◆ GetDirectory()
List a directory.
- Parameters
-
[in] | url | The URL of the directory |
[out] | entries | The entries in the directory, see kodi::vfs::CDirEntry about his content |
[in] | callbacks | A callback structure |
- Returns
- Context for the directory listing
Callbacks:
This functions becomes available during call of GetDirectory() from Kodi.
If GetDirectory() returns false becomes the parts from here used on next call of the function.
Example:
#include <kodi/addon-instance/VFS.h>
...
std::vector<kodi::vfs::CDirEntry>& items,
CVFSCallbacks callbacks)
{
std::string neededString;
callbacks.GetKeyboardInput("Test", neededString, true);
if (neededString.empty())
return false;
...
return true;
}
bool ATTRIBUTE_HIDDEN GetDirectory(const std::string &path, const std::string &mask, std::vector< kodi::vfs::CDirEntry > &items)
Lists a directory.
Definition: Filesystem.h:888
Available callback functions
Function: | Description |
CVFSCallbacks::GetKeyboardInput | Require keyboard input. Becomes called if GetDirectory() returns false and GetDirectory() becomes after entry called again.
- Parameters
-
[in] | heading | The heading of the keyboard dialog |
[out] | input | The resulting string. Returns string after second call! |
[in] | hiddenInput | To show input only as "*" on dialog |
- Returns
- True if input was received, false otherwise
|
CVFSCallbacks::SetErrorDialog | Display an error dialog. - Parameters
-
[in] | heading | The heading of the error dialog |
[in] | line1 | The first line of the error dialog |
[in] | line2 | [opt] The second line of the error dialog |
[in] | line3 | [opt] The third line of the error dialog |
|
CVFSCallbacks::RequireAuthentication | Prompt the user for authentication of a URL. - Parameters
-
|
◆ ContainsFiles()
Check if file should be presented as a directory (multiple streams)
- Parameters
-
[in] | url | The URL of the file |
[out] | entries | The entries in the directory, see kodi::vfs::CDirEntry about his content |
[out] | rootPath | Path to root directory if multiple entries |
- Returns
- Context for the directory listing