Kodi Documentation  18.0
Kodi is an open source media player and entertainment hub.
XFILE::CPluginDirectory Class Reference

#include <PluginDirectory.h>

Inheritance diagram for XFILE::CPluginDirectory:
XFILE::IDirectory

Public Member Functions

 CPluginDirectory ()
 
 ~CPluginDirectory (void) override
 
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
 IDirectory ()
 
virtual ~IDirectory (void)
 
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 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 &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 ()
 

Additional Inherited Members

- 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 Attributes inherited from XFILE::IDirectory
std::string m_strFileMask
 Holds the file mask specified by SetMask() More...
 
int m_flags
 Directory flags - see DIR_FLAG. More...
 
CVariant m_requirements
 
- Static Protected Attributes inherited from XFILE::IDirectory
static const CProfileManagerm_profileManager = nullptr
 

Constructor & Destructor Documentation

§ CPluginDirectory()

CPluginDirectory::CPluginDirectory ( )

§ ~CPluginDirectory()

CPluginDirectory::~CPluginDirectory ( void  )
override

Member Function Documentation

§ AddItem()

bool CPluginDirectory::AddItem ( int  handle,
const CFileItem item,
int  totalItems 
)
static

§ AddItems()

bool CPluginDirectory::AddItems ( int  handle,
const CFileItemList items,
int  totalItems 
)
static

§ AddSortMethod()

void CPluginDirectory::AddSortMethod ( int  handle,
SORT_METHOD  sortMethod,
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.

§ EndOfDirectory()

void CPluginDirectory::EndOfDirectory ( int  handle,
bool  success,
bool  replaceListing,
bool  cacheToDisc 
)
static

§ 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.

§ GetPluginResult()

bool CPluginDirectory::GetPluginResult ( const std::string &  strPath,
CFileItem resultItem,
bool  resume 
)
static

§ 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.

§ GetSetting()

std::string CPluginDirectory::GetSetting ( int  handle,
const std::string &  key 
)
static

§ 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.

§ RunScriptWithParams()

bool CPluginDirectory::RunScriptWithParams ( const std::string &  strPath,
bool  resume 
)
static

§ SetContent()

void CPluginDirectory::SetContent ( int  handle,
const std::string &  strContent 
)
static

§ SetLabel2()

static void XFILE::CPluginDirectory::SetLabel2 ( int  handle,
const std::string &  ident 
)
static

§ SetProperty()

void CPluginDirectory::SetProperty ( int  handle,
const std::string &  strProperty,
const std::string &  strValue 
)
static

§ SetResolvedUrl()

void CPluginDirectory::SetResolvedUrl ( int  handle,
bool  success,
const CFileItem resultItem 
)
static

§ SetSetting()

void CPluginDirectory::SetSetting ( int  handle,
const std::string &  key,
const std::string &  value 
)
static

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