xbmc
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
XFILE::CPluginDirectory Class Reference
Inheritance diagram for XFILE::CPluginDirectory:
Inheritance graph
[legend]
Collaboration diagram for XFILE::CPluginDirectory:
Collaboration graph
[legend]

Public Member Functions

bool GetDirectory (const CURL &url, CFileItemList &items) override
 Get the items of the directory strPath. More...
 
bool AllowAll () const override
 Whether to allow all files/folders to be listed. More...
 
bool Exists (const CURL &url) override
 Check for directory existence. More...
 
float GetProgress () const override
 Retrieve the progress of the current directory fetch (if possible). More...
 
void CancelDirectory () override
 Cancel the current directory fetch (if possible). More...
 
- Public Member Functions inherited from XFILE::IDirectory
virtual bool Create (const CURL &url)
 Create the directory. More...
 
virtual bool Remove (const CURL &url)
 Removes the directory. More...
 
virtual bool RemoveRecursive (const CURL &url)
 Recursively removes the directory. More...
 
virtual bool IsAllowed (const CURL &url) const
 Whether this file should be listed. More...
 
virtual DIR_CACHE_TYPE GetCacheType (const CURL &url) const
 How this directory should be cached. More...
 
void SetMask (const std::string &strMask)
 Set a mask of extensions for the files in the directory. More...
 
void SetFlags (int flags)
 Set the flags for this directory handler. More...
 
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. More...
 

Static Public Member Functions

static bool RunScriptWithParams (const std::string &strPath, bool resume)
 
static bool GetResolvedPluginResult (CFileItem &resultItem)
 Get a reproducible CFileItem by trying to recursively resolve the plugin paths up to a maximum allowed limit. If no plugin paths exist it will be ignored. More...
 
static bool GetPluginResult (const std::string &strPath, CFileItem &resultItem, bool resume)
 
static bool IsMediaLibraryScanningAllowed (const std::string &content, const std::string &strPath)
 Check whether a plugin supports media library scanning. More...
 
static bool CheckExists (const std::string &content, const std::string &strPath)
 Check whether a plugin url exists by calling the plugin and checking result. Applies only to plugins that support media library scanning. More...
 
static bool AddItem (int handle, const CFileItem *item, int totalItems)
 
static bool AddItems (int handle, const CFileItemList *items, int totalItems)
 
static void EndOfDirectory (int handle, bool success, bool replaceListing, bool cacheToDisc)
 
static void AddSortMethod (int handle, SORT_METHOD sortMethod, const std::string &labelMask, const std::string &label2Mask)
 
static std::string GetSetting (int handle, const std::string &key)
 
static void SetSetting (int handle, const std::string &key, const std::string &value)
 
static void SetContent (int handle, const std::string &strContent)
 
static void SetProperty (int handle, const std::string &strProperty, const std::string &strValue)
 
static void SetResolvedUrl (int handle, bool success, const CFileItem *resultItem)
 
static void SetLabel2 (int handle, const std::string &ident)
 
- Static Public Member Functions inherited from XFILE::IDirectory
static void RegisterProfileManager (const CProfileManager &profileManager)
 
static void UnregisterProfileManager ()
 

Protected Member Functions

bool IsSuccessful () const override
 
bool IsCancelled () const override
 
- Protected Member Functions inherited from XFILE::IDirectory
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. More...
 
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. More...
 
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. More...
 
- Protected Member Functions inherited from CRunningScriptsHandler< CPluginDirectory >
bool RunScript (CPluginDirectory *script, const ADDON::AddonPtr &addon, const std::string &path, bool resume)
 
- Protected Member Functions inherited from CScriptRunner
ADDON::AddonPtr GetAddon () const
 
bool StartScript (const ADDON::AddonPtr &addon, const std::string &path)
 
bool RunScript (const ADDON::AddonPtr &addon, const std::string &path, int handle, bool resume)
 
void SetDone ()
 

Additional Inherited Members

- Protected Types inherited from CRunningScriptsHandler< CPluginDirectory >
using HandleType = int
 
- Static Protected Member Functions inherited from CRunningScriptsHandler< CPluginDirectory >
static HandleType GetNewScriptHandle (CPluginDirectory *script)
 
static void ReuseScriptHandle (HandleType handle, CPluginDirectory *script)
 
static void RemoveScriptHandle (HandleType handle)
 
static CPluginDirectory * GetScriptFromHandle (HandleType handle)
 
static CCriticalSection & GetScriptsLock ()
 
- Static Protected Member Functions inherited from CScriptRunner
static int ExecuteScript (const ADDON::AddonPtr &addon, const std::string &path, bool resume)
 
static int ExecuteScript (const ADDON::AddonPtr &addon, const std::string &path, int handle, bool resume)
 
- Protected Attributes inherited from XFILE::IDirectory
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 inherited from XFILE::IDirectory
static const CProfileManagerm_profileManager = nullptr
 

Member Function Documentation

◆ AddSortMethod()

void CPluginDirectory::AddSortMethod ( int  handle,
SORT_METHOD  sortMethod,
const std::string &  labelMask,
const std::string &  label2Mask 
)
static
Todo:
Add all sort methods and fix which labels go on the right or left

◆ AllowAll()

bool XFILE::CPluginDirectory::AllowAll ( ) const
inlineoverridevirtual

Whether to allow all files/folders to be listed.

Returns
Returns true if all files/folder should be listed.

Reimplemented from XFILE::IDirectory.

◆ CancelDirectory()

void CPluginDirectory::CancelDirectory ( )
overridevirtual

Cancel the current directory fetch (if possible).

See also
GetDirectory

Reimplemented from XFILE::IDirectory.

◆ CheckExists()

bool CPluginDirectory::CheckExists ( const std::string &  content,
const std::string &  strPath 
)
static

Check whether a plugin url exists by calling the plugin and checking result. Applies only to plugins that support media library scanning.

Parameters
contentcontent type - movies, tvshows, musicvideos.
strPathfull plugin url.
Returns
true if the plugin supports scanning and specified url exists, false otherwise.

◆ Exists()

bool XFILE::CPluginDirectory::Exists ( const CURL url)
inlineoverridevirtual

Check for directory existence.

Parameters
urlDirectory to check.
Returns
Returns true, if directory exists
See also
CDirectoryFactory

Reimplemented from XFILE::IDirectory.

◆ GetDirectory()

bool CPluginDirectory::GetDirectory ( const CURL url,
CFileItemList items 
)
overridevirtual

Get the items of the directory strPath.

Parameters
urlDirectory to read.
itemsRetrieves the directory entries.
Returns
Returns true, if successful.
See also
CDirectoryFactory

Implements XFILE::IDirectory.

◆ GetProgress()

float CPluginDirectory::GetProgress ( ) const
overridevirtual

Retrieve the progress of the current directory fetch (if possible).

Returns
the progress as a float in the range 0..100.
See also
GetDirectory, CancelDirectory

Reimplemented from XFILE::IDirectory.

◆ GetResolvedPluginResult()

bool CPluginDirectory::GetResolvedPluginResult ( CFileItem resultItem)
static

Get a reproducible CFileItem by trying to recursively resolve the plugin paths up to a maximum allowed limit. If no plugin paths exist it will be ignored.

Parameters
resultItemthe CFileItem with plugin paths to be resolved.
Returns
false if the plugin path cannot be resolved, true otherwise.

◆ IsMediaLibraryScanningAllowed()

bool CPluginDirectory::IsMediaLibraryScanningAllowed ( const std::string &  content,
const std::string &  strPath 
)
static

Check whether a plugin supports media library scanning.

Parameters
contentcontent type - movies, tvshows, musicvideos.
strPathfull plugin url.
Returns
true if scanning at specified url is allowed, false otherwise.

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