Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
XFILE::CVirtualDirectory Class Reference

Get access to shares and it's directories. More...

#include <VirtualDirectory.h>

Inheritance diagram for XFILE::CVirtualDirectory:
XFILE::IDirectory

Public Member Functions

 CVirtualDirectory (void)
 
 ~CVirtualDirectory (void) override
 
bool GetDirectory (const CURL &url, CFileItemList &items) override
 Retrieve the shares or the content of a directory.
 
void CancelDirectory () override
 Cancel the current directory fetch (if possible).
 
bool GetDirectory (const CURL &url, CFileItemList &items, bool bUseFileDirectories, bool keepImpl)
 
void SetSources (const VECSOURCES &vecSources)
 Add shares to the virtual directory.
 
unsigned int GetNumberOfSources ()
 
bool IsSource (const std::string &strPath, VECSOURCES *sources=NULL, std::string *name=NULL) const
 Is the share strPath in the virtual directory.
 
bool IsInSource (const std::string &strPath) const
 Is the share path in the virtual directory.
 
const CMediaSourceoperator[] (const int index) const
 
CMediaSourceoperator[] (const int index)
 
void GetSources (VECSOURCES &sources) const
 
void AllowNonLocalSources (bool allow)
 
std::shared_ptr< IDirectoryGetDirImpl ()
 
void ReleaseDirImpl ()
 
- Public Member Functions inherited from XFILE::IDirectory
 IDirectory ()
 
virtual ~IDirectory (void)
 
virtual float GetProgress () const
 Retrieve the progress of 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.
 

Protected Member Functions

void CacheThumbs (CFileItemList &items)
 
- 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.
 
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

VECSOURCES m_vecSources
 
bool m_allowNonLocalSources
 
std::shared_ptr< IDirectorym_pDir
 
- 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
 

Additional Inherited Members

- Static Public Member Functions inherited from XFILE::IDirectory
static void RegisterProfileManager (const CProfileManager &profileManager)
 
static void UnregisterProfileManager ()
 
- Static Protected Attributes inherited from XFILE::IDirectory
static const CProfileManagerm_profileManager = nullptr
 

Detailed Description

Get access to shares and it's directories.

Constructor & Destructor Documentation

◆ CVirtualDirectory()

XFILE::CVirtualDirectory::CVirtualDirectory ( void )

◆ ~CVirtualDirectory()

XFILE::CVirtualDirectory::~CVirtualDirectory ( void )
overridedefault

Member Function Documentation

◆ AllowNonLocalSources()

void XFILE::CVirtualDirectory::AllowNonLocalSources ( bool allow)
inline

◆ CacheThumbs()

void XFILE::CVirtualDirectory::CacheThumbs ( CFileItemList & items)
protected

◆ CancelDirectory()

void XFILE::CVirtualDirectory::CancelDirectory ( )
overridevirtual

Cancel the current directory fetch (if possible).

See also
GetDirectory

Reimplemented from XFILE::IDirectory.

◆ GetDirectory() [1/2]

bool XFILE::CVirtualDirectory::GetDirectory ( const CURL & url,
CFileItemList & items )
overridevirtual

Retrieve the shares or the content of a directory.

Parameters
strPathSpecifies the path of the directory to retrieve or pass an empty string to get the shares.
itemsContent of the directory.
Returns
Returns true, if directory access is successful.
Note
If strPath is an empty string, the share items have thumbnails and icons set, else the thumbnails and icons have to be set manually.

Implements XFILE::IDirectory.

◆ GetDirectory() [2/2]

bool XFILE::CVirtualDirectory::GetDirectory ( const CURL & url,
CFileItemList & items,
bool bUseFileDirectories,
bool keepImpl )

◆ GetDirImpl()

std::shared_ptr< IDirectory > XFILE::CVirtualDirectory::GetDirImpl ( )
inline

◆ GetNumberOfSources()

unsigned int XFILE::CVirtualDirectory::GetNumberOfSources ( )
inline

◆ GetSources()

void XFILE::CVirtualDirectory::GetSources ( VECSOURCES & sources) const

◆ IsInSource()

bool XFILE::CVirtualDirectory::IsInSource ( const std::string & path) const

Is the share path in the virtual directory.

Parameters
pathShare to test
Returns
Returns true, if share is in the virtual directory.
Note
The parameter path CAN be a share with directory. Eg. "iso9660://dir" will return the same as "iso9660://".
Todo
May need to handle other special cases that GetMatchingSource() fails on

◆ IsSource()

bool XFILE::CVirtualDirectory::IsSource ( const std::string & strPath,
VECSOURCES * sources = NULL,
std::string * name = NULL ) const

Is the share strPath in the virtual directory.

Parameters
strPathShare to test
Returns
Returns true, if share is in the virtual directory.
Note
The parameter strPath can not be a share with directory. Eg. "iso9660://dir" will return false. It must be "iso9660://".

◆ operator[]() [1/2]

CMediaSource & XFILE::CVirtualDirectory::operator[] ( const int index)
inline

◆ operator[]() [2/2]

const CMediaSource & XFILE::CVirtualDirectory::operator[] ( const int index) const
inline

◆ ReleaseDirImpl()

void XFILE::CVirtualDirectory::ReleaseDirImpl ( )
inline

◆ SetSources()

void XFILE::CVirtualDirectory::SetSources ( const VECSOURCES & vecSources)

Add shares to the virtual directory.

Parameters
VECSOURCESShares to add
See also
CMediaSource, VECSOURCES

Member Data Documentation

◆ m_allowNonLocalSources

bool XFILE::CVirtualDirectory::m_allowNonLocalSources
protected

◆ m_pDir

std::shared_ptr<IDirectory> XFILE::CVirtualDirectory::m_pDir
protected

◆ m_vecSources

VECSOURCES XFILE::CVirtualDirectory::m_vecSources
protected

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