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

Wrapper equipping a CVFSEntry with an IFile interface. More...

#include <VFSEntry.h>

Inheritance diagram for ADDON::CVFSEntryIFileWrapper:
XFILE::IFile

Public Member Functions

 CVFSEntryIFileWrapper (VFSEntryPtr ptr)
 The constructor initializes the reference to the wrapped CVFSEntry.
 
 ~CVFSEntryIFileWrapper () override
 Empty destructor.
 
bool Open (const CURL &url) override
 Open a file.
 
bool OpenForWrite (const CURL &url, bool bOverWrite) override
 Open a file for writing.
 
bool Exists (const CURL &url) override
 Check for file existence.
 
int Stat (const CURL &url, struct __stat64 *buffer) override
 Stat a file.
 
ssize_t Read (void *lpBuf, size_t uiBufSize) override
 Read data from file:
 
ssize_t Write (const void *lpBuf, size_t uiBufSize) override
 Write data to file.
 
int64_t Seek (int64_t iFilePosition, int whence=SEEK_SET) override
 Seek in file.
 
int Truncate (int64_t size) override
 Truncate a file.
 
void Close () override
 Close file.
 
int64_t GetPosition () override
 Obtain current file position.
 
int64_t GetLength () override
 Obtain file size.
 
int GetChunkSize () override
 Obtain chunksize of file.
 
int IoControl (XFILE::EIoControl request, void *param) override
 Perform I/O controls for file.
 
bool Delete (const CURL &url) override
 Delete a file.
 
bool Rename (const CURL &url, const CURL &url2) override
 Rename a file.
 
- Public Member Functions inherited from XFILE::IFile
 IFile ()
 
virtual ~IFile ()
 
virtual bool ReOpen (const CURL &url)
 
virtual int Stat (struct __stat64 *buffer)
 
virtual bool ReadString (char *szLine, int iLineLength)
 
virtual void Flush ()
 
virtual double GetDownloadSpeed ()
 
virtual bool SetHidden (const CURL &url, bool hidden)
 
virtual const std::string GetProperty (XFILE::FileProperty type, const std::string &name="") const
 
virtual const std::vector< std::string > GetPropertyValues (XFILE::FileProperty type, const std::string &name="") const
 

Protected Attributes

voidm_context = nullptr
 Opaque add-on specific context for opened file.
 
VFSEntryPtr m_addon
 Pointer to wrapped CVFSEntry.
 

Detailed Description

Wrapper equipping a CVFSEntry with an IFile interface.

Needed as CVFSEntry implements several VFS interfaces with overlapping methods.

Constructor & Destructor Documentation

◆ CVFSEntryIFileWrapper()

ADDON::CVFSEntryIFileWrapper::CVFSEntryIFileWrapper ( VFSEntryPtr ptr)
explicit

The constructor initializes the reference to the wrapped CVFSEntry.

Parameters
ptrThe CVFSEntry to wrap.

◆ ~CVFSEntryIFileWrapper()

ADDON::CVFSEntryIFileWrapper::~CVFSEntryIFileWrapper ( )
override

Empty destructor.

Member Function Documentation

◆ Close()

void ADDON::CVFSEntryIFileWrapper::Close ( )
overridevirtual

Close file.

Implements XFILE::IFile.

◆ Delete()

bool ADDON::CVFSEntryIFileWrapper::Delete ( const CURL & url)
overridevirtual

Delete a file.

Parameters
[in]urlURL of file to delete.

Reimplemented from XFILE::IFile.

◆ Exists()

bool ADDON::CVFSEntryIFileWrapper::Exists ( const CURL & url)
overridevirtual

Check for file existence.

Parameters
[in]urlURL of file.

Implements XFILE::IFile.

◆ GetChunkSize()

int ADDON::CVFSEntryIFileWrapper::GetChunkSize ( )
overridevirtual

Obtain chunksize of file.

Reimplemented from XFILE::IFile.

◆ GetLength()

int64_t ADDON::CVFSEntryIFileWrapper::GetLength ( )
overridevirtual

Obtain file size.

Implements XFILE::IFile.

◆ GetPosition()

int64_t ADDON::CVFSEntryIFileWrapper::GetPosition ( )
overridevirtual

Obtain current file position.

Implements XFILE::IFile.

◆ IoControl()

int ADDON::CVFSEntryIFileWrapper::IoControl ( XFILE::EIoControl request,
void * param )
overridevirtual

Perform I/O controls for file.

Reimplemented from XFILE::IFile.

◆ Open()

bool ADDON::CVFSEntryIFileWrapper::Open ( const CURL & url)
overridevirtual

Open a file.

Parameters
[in]urlURL to open.
Returns
True if file was opened, false otherwise.

Implements XFILE::IFile.

◆ OpenForWrite()

bool ADDON::CVFSEntryIFileWrapper::OpenForWrite ( const CURL & url,
bool bOverWrite )
overridevirtual

Open a file for writing.

Parameters
[in]urlURL to open.
[in]bOverWriteIf true, overwrite an existing file.
Returns
True if file was opened, false otherwise.

Reimplemented from XFILE::IFile.

◆ Read()

ssize_t ADDON::CVFSEntryIFileWrapper::Read ( void * lpBuf,
size_t uiBufSize )
overridevirtual

Read data from file:

Parameters
lpBufBuffer to read data into.
[in]uiBufSizeNumber of bytes to read.
Returns
Number of bytes read.

Implements XFILE::IFile.

◆ Rename()

bool ADDON::CVFSEntryIFileWrapper::Rename ( const CURL & url,
const CURL & url2 )
overridevirtual

Rename a file.

Parameters
[in]urlURL of file to rename.
[in]url2New URL of file.

Reimplemented from XFILE::IFile.

◆ Seek()

int64_t ADDON::CVFSEntryIFileWrapper::Seek ( int64_t iFilePosition,
int whence = SEEK_SET )
overridevirtual

Seek in file.

Parameters
[in]iFilePositionPosition to seek to.
[in]whenceOrigin for position.
Returns
New file position.

Implements XFILE::IFile.

◆ Stat()

int ADDON::CVFSEntryIFileWrapper::Stat ( const CURL & url,
struct __stat64 * buffer )
overridevirtual

Stat a file.

Parameters
[in]urlURL of file.
[out]bufferThe stat info.

Returns 0 on success, non-zero otherwise (see fstat() return values).

Implements XFILE::IFile.

◆ Truncate()

int ADDON::CVFSEntryIFileWrapper::Truncate ( int64_t size)
overridevirtual

Truncate a file.

Parameters
[in]sizeSize of new file.

Reimplemented from XFILE::IFile.

◆ Write()

ssize_t ADDON::CVFSEntryIFileWrapper::Write ( const void * lpBuf,
size_t uiBufSize )
overridevirtual

Write data to file.

Parameters
[in]lpBufData to write.
[in]uiBufSizeNumber of bytes to write.
Returns
Number of bytes written.

Reimplemented from XFILE::IFile.

Member Data Documentation

◆ m_addon

VFSEntryPtr ADDON::CVFSEntryIFileWrapper::m_addon
protected

Pointer to wrapped CVFSEntry.

◆ m_context

void* ADDON::CVFSEntryIFileWrapper::m_context = nullptr
protected

Opaque add-on specific context for opened file.


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