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

Wrapper equpping a CVFSEntry with an IFileDirectory interface. More...

#include <VFSEntry.h>

Inheritance diagram for ADDON::CVFSEntryIFileDirectoryWrapper:
XFILE::IFileDirectory ADDON::CVFSEntryIDirectoryWrapper XFILE::IDirectory XFILE::IDirectory

Public Member Functions

 CVFSEntryIFileDirectoryWrapper (VFSEntryPtr ptr)
 The constructor initializes the reference to the wrapped CVFSEntry.
 
 ~CVFSEntryIFileDirectoryWrapper () override=default
 Empty destructor.
 
bool ContainsFiles (const CURL &url) override
 Check if the given file should be treated as a directory.
 
bool GetDirectory (const CURL &url, CFileItemList &items) override
 Return directory listing.
 
bool Exists (const CURL &url) override
 Check if directory exists.
 
bool Remove (const CURL &url) override
 Delete directory.
 
bool Create (const CURL &url) override
 Create directory.
 
- Public Member Functions inherited from XFILE::IFileDirectory
 ~IFileDirectory () override=default
 
- 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 void CancelDirectory ()
 Cancel the current directory fetch (if possible).
 
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.
 
- Public Member Functions inherited from ADDON::CVFSEntryIDirectoryWrapper
 CVFSEntryIDirectoryWrapper (VFSEntryPtr ptr)
 The constructor initializes the reference to the wrapped CVFSEntry.
 
 ~CVFSEntryIDirectoryWrapper () override=default
 Empty destructor.
 
bool GetKeyboardInput2 (const char *heading, char **input, bool hidden_input)
 Get keyboard input.
 
void SetErrorDialog2 (const char *heading, const char *line1, const char *line2, const char *line3)
 Show an error dialog.
 
void RequireAuthentication2 (const CURL &url)
 Require authentication.
 

Public Attributes

CFileItemList m_items
 Internal list of items, used for cache purposes.
 

Additional Inherited Members

- Static Public Member Functions inherited from XFILE::IDirectory
static void RegisterProfileManager (const CProfileManager &profileManager)
 
static void UnregisterProfileManager ()
 
- Static Public Member Functions inherited from ADDON::CVFSEntryIDirectoryWrapper
static bool DoGetKeyboardInput (void *context, const char *heading, char **input, bool hidden_input)
 Static helper for doing a keyboard callback.
 
static void DoSetErrorDialog (void *ctx, const char *heading, const char *line1, const char *line2, const char *line3)
 Static helper for displaying an error dialog.
 
static void DoRequireAuthentication (void *ctx, const char *url)
 Static helper for requiring authentication.
 
- 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 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
 
- Protected Attributes inherited from ADDON::CVFSEntryIDirectoryWrapper
VFSEntryPtr m_addon
 Pointer to wrapper CVFSEntry.
 
- Static Protected Attributes inherited from XFILE::IDirectory
static const CProfileManagerm_profileManager = nullptr
 

Detailed Description

Wrapper equpping a CVFSEntry with an IFileDirectory interface.

Needed as CVFSEntry implements several VFS interfaces with overlapping methods.

Constructor & Destructor Documentation

◆ CVFSEntryIFileDirectoryWrapper()

ADDON::CVFSEntryIFileDirectoryWrapper::CVFSEntryIFileDirectoryWrapper ( VFSEntryPtr ptr)
inlineexplicit

The constructor initializes the reference to the wrapped CVFSEntry.

Parameters
ptrThe CVFSEntry to wrap.

◆ ~CVFSEntryIFileDirectoryWrapper()

ADDON::CVFSEntryIFileDirectoryWrapper::~CVFSEntryIFileDirectoryWrapper ( )
overridedefault

Empty destructor.

Member Function Documentation

◆ ContainsFiles()

bool ADDON::CVFSEntryIFileDirectoryWrapper::ContainsFiles ( const CURL & url)
inlineoverridevirtual

Check if the given file should be treated as a directory.

Parameters
[in]urlURL for file to probe.

Implements XFILE::IFileDirectory.

◆ Create()

bool ADDON::CVFSEntryIFileDirectoryWrapper::Create ( const CURL & url)
inlineoverridevirtual

Create directory.

Parameters
[in]urlURL to delete.

Reimplemented from XFILE::IDirectory.

◆ Exists()

bool ADDON::CVFSEntryIFileDirectoryWrapper::Exists ( const CURL & url)
inlineoverridevirtual

Check if directory exists.

Parameters
[in]urlURL to check.

Reimplemented from XFILE::IDirectory.

◆ GetDirectory()

bool ADDON::CVFSEntryIFileDirectoryWrapper::GetDirectory ( const CURL & url,
CFileItemList & items )
inlineoverridevirtual

Return directory listing.

Parameters
[in]urlURL to file to list.
itemsList of items in file.
Returns
True if listing succeeded, false otherwise.

Implements XFILE::IDirectory.

◆ Remove()

bool ADDON::CVFSEntryIFileDirectoryWrapper::Remove ( const CURL & url)
inlineoverridevirtual

Delete directory.

Parameters
[in]urlURL to delete.

Reimplemented from XFILE::IDirectory.

Member Data Documentation

◆ m_items

CFileItemList ADDON::CVFSEntryIFileDirectoryWrapper::m_items

Internal list of items, used for cache purposes.


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