Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
|
Interface to the directory on a file system. More...
#include <IDirectory.h>
Public Member Functions | |
IDirectory () | |
virtual | ~IDirectory (void) |
virtual bool | GetDirectory (const CURL &url, CFileItemList &items)=0 |
Get the items of the directory strPath. | |
virtual float | GetProgress () const |
Retrieve the progress of the current directory fetch (if possible). | |
virtual void | CancelDirectory () |
Cancel the current directory fetch (if possible). | |
virtual bool | Create (const CURL &url) |
Create the directory. | |
virtual bool | Exists (const CURL &url) |
Check for directory existence. | |
virtual bool | Remove (const CURL &url) |
Removes the directory. | |
virtual bool | RemoveRecursive (const CURL &url) |
Recursively removes the directory. | |
virtual bool | IsAllowed (const CURL &url) const |
Whether this file should be listed. | |
virtual bool | AllowAll () const |
Whether to allow all files/folders to be listed. | |
virtual DIR_CACHE_TYPE | GetCacheType (const CURL &url) const |
How this directory should be cached. | |
void | SetMask (const std::string &strMask) |
Set a mask of extensions for the files in the directory. | |
void | SetFlags (int flags) |
Set the flags for this directory handler. | |
bool | ProcessRequirements () |
Process additional requirements before the directory fetch is performed. Some directory fetches may require authentication, keyboard input etc. The IDirectory subclass should call GetKeyboardInput, SetErrorDialog or RequireAuthentication and then return false from the GetDirectory method. CDirectory will then prompt for input from the user, before re-calling the GetDirectory method. | |
virtual bool | Resolve (CFileItem &item) const |
Resolves a given item to a playable item. | |
Static Public Member Functions | |
static void | RegisterProfileManager (const CProfileManager &profileManager) |
static void | UnregisterProfileManager () |
Protected Member Functions | |
bool | GetKeyboardInput (const CVariant &heading, std::string &input, bool hiddenInput=false) |
Prompt the user for some keyboard input Call this method from the GetDirectory method to retrieve additional input from the user. If this function returns false then no input has been received, and the GetDirectory call should return false. | |
void | SetErrorDialog (const CVariant &heading, const CVariant &line1, const CVariant &line2=0, const CVariant &line3=0) |
Show an error dialog on failure of GetDirectory call Call this method from the GetDirectory method to set an error message to be shown to the user. | |
void | RequireAuthentication (const CURL &url) |
Prompt the user for authentication of a URL. Call this method from the GetDirectory method when authentication is required from the user, before returning false from the GetDirectory call. The user will be prompted for authentication, and GetDirectory will be re-called. | |
Protected Attributes | |
std::string | m_strFileMask |
Holds the file mask specified by SetMask() | |
int | m_flags |
Directory flags - see DIR_FLAG. | |
CVariant | m_requirements |
Static Protected Attributes | |
static const CProfileManager * | m_profileManager = nullptr |
Interface to the directory on a file system.
This Interface is retrieved from CDirectoryFactory and can be used to access the directories on a filesystem.
IDirectory::IDirectory | ( | ) |
|
virtualdefault |
|
inlinevirtual |
Whether to allow all files/folders to be listed.
Reimplemented in XFILE::CAddonsDirectory, XFILE::CAndroidAppDirectory, XFILE::CEventsDirectory, XFILE::CLibraryDirectory, XFILE::CMusicDatabaseDirectory, XFILE::CMusicFileDirectory, XFILE::CMusicSearchDirectory, XFILE::CPlaylistDirectory, XFILE::CPlaylistFileDirectory, XFILE::CPluginDirectory, XFILE::CPVRDirectory, XFILE::CRSSDirectory, XFILE::CSmartPlaylistDirectory, XFILE::CSourcesDirectory, XFILE::CStackDirectory, XFILE::CUPnPDirectory, and XFILE::CVideoDatabaseDirectory.
|
inlinevirtual |
Cancel the current directory fetch (if possible).
Reimplemented in XFILE::CPluginDirectory, and XFILE::CVirtualDirectory.
Create the directory.
url | Directory to create. |
Reimplemented in ADDON::CVFSEntryIDirectoryWrapper, ADDON::CVFSEntryIFileDirectoryWrapper, XFILE::CAddonsDirectory, XFILE::CDAVDirectory, XFILE::CEventsDirectory, XFILE::CNFSDirectory, XFILE::COverrideDirectory, XFILE::CPosixDirectory, XFILE::CSMBDirectory, XFILE::CTVOSDirectory, XFILE::CWin32Directory, XFILE::CWin32SMBDirectory, and XFILE::CWinLibraryDirectory.
Check for directory existence.
url | Directory to check. |
Reimplemented in ADDON::CVFSEntryIDirectoryWrapper, ADDON::CVFSEntryIFileDirectoryWrapper, XFILE::CAddonsDirectory, XFILE::CAndroidAppDirectory, XFILE::CAPKDirectory, XFILE::CAudioBookFileDirectory, XFILE::CDAVDirectory, XFILE::CEventsDirectory, XFILE::CFavouritesDirectory, XFILE::CFTPDirectory, XFILE::CHTTPDirectory, XFILE::CISO9660Directory, XFILE::CLibraryDirectory, XFILE::CMultiPathDirectory, XFILE::CMusicDatabaseDirectory, XFILE::CMusicFileDirectory, XFILE::CMusicSearchDirectory, XFILE::CNFSDirectory, XFILE::COverrideDirectory, XFILE::CPluginDirectory, XFILE::CPosixDirectory, XFILE::CPVRDirectory, XFILE::CRSSDirectory, XFILE::CSMBDirectory, XFILE::CSourcesDirectory, XFILE::CTVOSDirectory, XFILE::CUDFDirectory, XFILE::CVideoDatabaseDirectory, XFILE::CWin32Directory, XFILE::CWin32SMBDirectory, and XFILE::CWinLibraryDirectory.
|
inlinevirtual |
How this directory should be cached.
url | Directory at hand. |
Reimplemented in XFILE::CAndroidAppDirectory, XFILE::CAPKDirectory, XFILE::CDAVDirectory, XFILE::CHTTPDirectory, XFILE::CNFSDirectory, XFILE::CPVRDirectory, XFILE::CRSSDirectory, XFILE::CSMBDirectory, XFILE::CWinLibraryDirectory, XFILE::CXbtDirectory, XFILE::CZeroconfDirectory, and XFILE::CZipDirectory.
|
pure virtual |
Get the items of the directory strPath.
url | Directory to read. |
items | Retrieves the directory entries. |
Implemented in ADDON::CVFSEntryIDirectoryWrapper, ADDON::CVFSEntryIFileDirectoryWrapper, XFILE::CAddonsDirectory, XFILE::CAndroidAppDirectory, XFILE::CAPKDirectory, XFILE::CAudioBookFileDirectory, XFILE::CBlurayDirectory, XFILE::CCDDADirectory, XFILE::CDAVDirectory, XFILE::CDVDDirectory, XFILE::CEventsDirectory, XFILE::CFavouritesDirectory, XFILE::CFTPDirectory, XFILE::CHTTPDirectory, XFILE::CISO9660Directory, XFILE::CLibraryDirectory, XFILE::CMultiPathDirectory, XFILE::CMusicDatabaseDirectory, XFILE::CMusicFileDirectory, XFILE::CMusicSearchDirectory, XFILE::CNFSDirectory, XFILE::CPlaylistDirectory, XFILE::CPlaylistFileDirectory, XFILE::CPluginDirectory, XFILE::CPosixDirectory, XFILE::CPVRDirectory, XFILE::CResourceDirectory, XFILE::CRSSDirectory, XFILE::CSmartPlaylistDirectory, XFILE::CSMBDirectory, XFILE::CSourcesDirectory, XFILE::CSpecialProtocolDirectory, XFILE::CStackDirectory, XFILE::CTVOSDirectory, XFILE::CUDFDirectory, XFILE::CUPnPDirectory, XFILE::CVideoDatabaseDirectory, XFILE::CVirtualDirectory, XFILE::CWin32Directory, XFILE::CWin32SMBDirectory, XFILE::CWinLibraryDirectory, XFILE::CXbtDirectory, XFILE::CZeroconfDirectory, and XFILE::CZipDirectory.
|
protected |
Prompt the user for some keyboard input Call this method from the GetDirectory method to retrieve additional input from the user. If this function returns false then no input has been received, and the GetDirectory call should return false.
heading | an integer or string heading for the keyboard dialog |
input | [out] the returned input (if available). |
|
inlinevirtual |
Retrieve the progress of the current directory fetch (if possible).
Reimplemented in XFILE::CPluginDirectory.
Whether this file should be listed.
Test if file have an allowed extension, as specified with SetMask()
url | File to test. |
strFile | File to test |
Reimplemented in XFILE::CAudioBookFileDirectory.
bool IDirectory::ProcessRequirements | ( | ) |
Process additional requirements before the directory fetch is performed. Some directory fetches may require authentication, keyboard input etc. The IDirectory subclass should call GetKeyboardInput, SetErrorDialog or RequireAuthentication and then return false from the GetDirectory method. CDirectory will then prompt for input from the user, before re-calling the GetDirectory method.
|
static |
Removes the directory.
url | Directory to remove. |
Reimplemented in ADDON::CVFSEntryIDirectoryWrapper, ADDON::CVFSEntryIFileDirectoryWrapper, XFILE::CDAVDirectory, XFILE::CMultiPathDirectory, XFILE::CNFSDirectory, XFILE::COverrideDirectory, XFILE::CPlaylistFileDirectory, XFILE::CPosixDirectory, XFILE::CSmartPlaylistDirectory, XFILE::CSMBDirectory, XFILE::CTVOSDirectory, XFILE::CWin32Directory, XFILE::CWin32SMBDirectory, and XFILE::CWinLibraryDirectory.
Recursively removes the directory.
url | Directory to remove. |
Reimplemented in XFILE::CPosixDirectory, and XFILE::CWin32Directory.
Prompt the user for authentication of a URL. Call this method from the GetDirectory method when authentication is required from the user, before returning false from the GetDirectory call. The user will be prompted for authentication, and GetDirectory will be re-called.
url | the URL to authenticate. |
Resolves a given item to a playable item.
item | The item being manipulated (which the path points to a vfs protocol implementation) |
Reimplemented in XFILE::CDVDDirectory, XFILE::CISO9660Directory, XFILE::CPluginDirectory, and XFILE::CUPnPDirectory.
|
protected |
Show an error dialog on failure of GetDirectory call Call this method from the GetDirectory method to set an error message to be shown to the user.
heading | an integer or string heading for the error dialog. |
line1 | the first line to be displayed (integer or string). |
line2 | the first line to be displayed (integer or string). |
line3 | the first line to be displayed (integer or string). |
Set the flags for this directory handler.
flags | - |
void IDirectory::SetMask | ( | const std::string & | strMask | ) |
Set a mask of extensions for the files in the directory.
strMask | Mask of file extensions that are allowed. |
The mask has to look like the following:
.m4a|.flac|.aac|
So only *.m4a, *.flac, *.aac files will be retrieved with GetDirectory().
|
static |
|
protected |
Directory flags - see DIR_FLAG.
|
staticprotected |
|
protected |
|
protected |
Holds the file mask specified by SetMask()