Kodi Documentation  18.0
Kodi is an open source media player and entertainment hub.
VFS.h File Reference
#include "../AddonBase.h"
#include "../Filesystem.h"
#include "filesystem/IFileTypes.h"
#include "PlatformDefs.h"

Classes

struct  VFSURL
 
struct  VFSGetDirectoryCallbacks
 
struct  AddonProps_VFSEntry
 
struct  AddonToKodiFuncTable_VFSEntry
 
struct  KodiToAddonFuncTable_VFSEntry
 
struct  AddonInstance_VFSEntry
 
class  kodi::addon::CInstanceVFS
 

Namespaces

 kodi
 
 kodi::addon
 

Typedefs

typedef struct VFSGetDirectoryCallbacks VFSGetDirectoryCallbacks
 
typedef struct AddonProps_VFSEntry AddonProps_VFSEntry
 
typedef struct AddonToKodiFuncTable_VFSEntry AddonToKodiFuncTable_VFSEntry
 
typedef struct KodiToAddonFuncTable_VFSEntry KodiToAddonFuncTable_VFSEntry
 
typedef struct AddonInstance_VFSEntry AddonInstance_VFSEntry
 

Functions

kodi::addon::CInstanceVFS IAddonInstance kodi::addon::GetKeyboardInput (const std::string &heading, std::string &input, bool hiddenInput=false)
 Require keyboard input. More...
 
 CInstanceVFS (KODI_HANDLE instance)
 
 ~CInstanceVFS () override=default
 
virtual voidOpen (const VFSURL &url)
 Open a file for input. More...
 
virtual voidOpenForWrite (const VFSURL &url, bool overWrite)
 Open a file for output. More...
 
virtual ssize_t Read (void *context, void *buffer, size_t uiBufSize)
 Read from a file. More...
 
virtual ssize_t Write (void *context, const void *buffer, size_t uiBufSize)
 Write to a file. More...
 
virtual int64_t Seek (void *context, int64_t position, int whence)
 Seek in a file. More...
 
virtual int Truncate (void *context, int64_t size)
 Truncate a file. More...
 
virtual int64_t GetLength (void *context)
 Get total size of a file. More...
 
virtual int64_t GetPosition (void *context)
 Get current position in a file. More...
 
virtual int GetChunkSize (void *context)
 Get chunk size of a file. More...
 
virtual int IoControl (void *context, XFILE::EIoControl request, void *param)
 Perform an IO-control on the file. More...
 
virtual bool Close (void *context)
 Close a file. More...
 
virtual int Stat (const VFSURL &url, struct __stat64 *buffer)
 Stat a file. More...
 
virtual bool Exists (const VFSURL &url)
 Check for file existence. More...
 
virtual void ClearOutIdle ()
 Clear out any idle connections. More...
 
virtual void DisconnectAll ()
 Disconnect all connections. More...
 
virtual bool Delete (const VFSURL &url)
 Delete a file. More...
 
virtual bool Rename (const VFSURL &url, const VFSURL &url2)
 Rename a file. More...
 
virtual bool DirectoryExists (const VFSURL &url)
 Check for directory existence. More...
 
virtual bool RemoveDirectory (const VFSURL &url)
 Remove a directory. More...
 
virtual bool CreateDirectory (const VFSURL &url)
 Create a directory. More...
 
void kodi::addon::SetErrorDialog (const std::string &heading, const std::string &line1, const std::string &line2="", const std::string &line3="")
 Display an error dialog. More...
 
void kodi::addon::RequireAuthentication (const std::string &url)
 Prompt the user for authentication of a URL. More...
 
 kodi::addon::CVFSCallbacks (const VFSGetDirectoryCallbacks *cb)
 

Typedef Documentation

§ AddonInstance_VFSEntry

§ AddonProps_VFSEntry

§ AddonToKodiFuncTable_VFSEntry

§ KodiToAddonFuncTable_VFSEntry

§ VFSGetDirectoryCallbacks

Function Documentation

§ CInstanceVFS()

GetKeyboardInput::CInstanceVFS ( KODI_HANDLE  instance)
explicit

§ ClearOutIdle()

virtual void GetKeyboardInput::ClearOutIdle ( )
virtual

Clear out any idle connections.

§ Close()

virtual bool GetKeyboardInput::Close ( void context)
virtual

Close a file.

Parameters
[in]contextThe context of the file
Returns
True on success, false on failure

§ CreateDirectory()

virtual bool GetKeyboardInput::CreateDirectory ( const VFSURL url)
virtual

Create a directory.

Parameters
[in]urlThe URL of the file
Returns
True if creation was successful, false otherwise

§ Delete()

virtual bool GetKeyboardInput::Delete ( const VFSURL url)
virtual

Delete a file.

Parameters
[in]urlThe URL of the file
Returns
True if deletion was successful, false otherwise

§ DirectoryExists()

virtual bool GetKeyboardInput::DirectoryExists ( const VFSURL url)
virtual

Check for directory existence.

Parameters
[in]urlThe URL of the file
Returns
True if directory exists, false otherwise

§ DisconnectAll()

virtual void GetKeyboardInput::DisconnectAll ( )
virtual

Disconnect all connections.

§ Exists()

virtual bool GetKeyboardInput::Exists ( const VFSURL url)
virtual

Check for file existence.

Parameters
[in]urlThe URL of the file
Returns
True if file exists, false otherwise

§ GetChunkSize()

virtual int GetKeyboardInput::GetChunkSize ( void context)
virtual

Get chunk size of a file.

Parameters
[in]contextThe context of the file
Returns
Chunk size

§ GetLength()

virtual int64_t GetKeyboardInput::GetLength ( void context)
virtual

Get total size of a file.

Parameters
[in]contextThe context of the file
Returns
Total file size

§ GetPosition()

virtual int64_t GetKeyboardInput::GetPosition ( void context)
virtual

Get current position in a file.

Parameters
[in]contextThe context of the file
Returns
Current position

§ IoControl()

virtual int GetKeyboardInput::IoControl ( void context,
XFILE::EIoControl  request,
void param 
)
virtual

Perform an IO-control on the file.

Parameters
[in]contextThe context of the file
[in]requestThe requested IO-control
[in]paramParameter attached to the IO-control
Returns
-1 on error, >= 0 on success

§ Open()

virtual void* GetKeyboardInput::Open ( const VFSURL url)
virtual

Open a file for input.

Parameters
[in]urlThe URL of the file
Returns
Context for the opened file

§ OpenForWrite()

virtual void* GetKeyboardInput::OpenForWrite ( const VFSURL url,
bool  overWrite 
)
virtual

Open a file for output.

Parameters
[in]urlThe URL of the file
[in]overWriteWhether or not to overwrite an existing file
Returns
Context for the opened file

§ Read()

virtual ssize_t GetKeyboardInput::Read ( void context,
void buffer,
size_t  uiBufSize 
)
virtual

Read from a file.

Parameters
[in]contextThe context of the file
[out]bufferThe buffer to read data into
[in]uiBufSizeNumber of bytes to read
Returns
Number of bytes read

§ RemoveDirectory()

virtual bool GetKeyboardInput::RemoveDirectory ( const VFSURL url)
virtual

Remove a directory.

Parameters
[in]urlThe URL of the directory
Returns
True if removal was successful, false otherwise

§ Rename()

virtual bool GetKeyboardInput::Rename ( const VFSURL url,
const VFSURL url2 
)
virtual

Rename a file.

Parameters
[in]urlThe URL of the source file
[in]url2The URL of the destination file
Returns
True if deletion was successful, false otherwise

§ Seek()

virtual int64_t GetKeyboardInput::Seek ( void context,
int64_t  position,
int  whence 
)
virtual

Seek in a file.

Parameters
[in]contextThe context of the file
[in]positionThe position to seek to
[in]whencePosition in file 'position' is relative to (SEEK_CUR, SEEK_SET, SEEK_END)
Returns
Offset in file after seek

§ Stat()

virtual int GetKeyboardInput::Stat ( const VFSURL url,
struct __stat64 buffer 
)
virtual

Stat a file.

Parameters
[in]urlThe URL of the file
[in]bufferThe buffer to store results in
Returns
-1 on error, 0 otherwise

§ Truncate()

virtual int GetKeyboardInput::Truncate ( void context,
int64_t  size 
)
virtual

Truncate a file.

Parameters
[in]contextThe context of the file
[in]sizeThe size to truncate the file to
Returns
0 on success, -1 on error

§ Write()

virtual ssize_t GetKeyboardInput::Write ( void context,
const void buffer,
size_t  uiBufSize 
)
virtual

Write to a file.

Parameters
[in]contextThe context of the file
[in]bufferThe buffer to read data from
[in]uiBufSizeNumber of bytes to write
Returns
Number of bytes written

§ ~CInstanceVFS()

GetKeyboardInput::~CInstanceVFS ( )
overridedefault