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

#include <IFile.h>

Inheritance diagram for XFILE::IFile:
ADDON::CVFSEntryIFileWrapper XFILE::CAPKFile XFILE::CCurlFile XFILE::CFileAndroidApp XFILE::CFileCDDA XFILE::CFileCache XFILE::CISO9660File XFILE::CImageFile XFILE::CMusicDatabaseFile XFILE::CNFSFile XFILE::COverrideFile XFILE::CPipeFile XFILE::CPosixFile XFILE::CSMBFile XFILE::CShoutcastFile XFILE::CTVOSFile XFILE::CUDFFile XFILE::CUPnPFile XFILE::CWin32File XFILE::CWinLibraryFile XFILE::CXbtFile XFILE::CZipFile

Classes

struct  ReadLineResult
 

Public Member Functions

 IFile ()
 
virtual ~IFile ()
 
virtual bool Open (const CURL &url)=0
 
virtual bool OpenForWrite (const CURL &url, bool bOverWrite=false)
 
virtual bool ReOpen (const CURL &url)
 
virtual bool Exists (const CURL &url)=0
 
virtual int Stat (const CURL &url, struct __stat64 *buffer)=0
 
virtual int Stat (struct __stat64 *buffer)
 
virtual ssize_t Read (void *bufPtr, size_t bufSize)=0
 
virtual ssize_t Write (const void *bufPtr, size_t bufSize)
 
virtual ReadLineResult ReadLine (char *buffer, std::size_t bufferSize)
 
virtual int64_t Seek (int64_t iFilePosition, int iWhence=SEEK_SET)=0
 
virtual void Close ()=0
 
virtual int64_t GetPosition ()=0
 
virtual int64_t GetLength ()=0
 
virtual void Flush ()
 
virtual int Truncate (int64_t size)
 
virtual int GetChunkSize ()
 
virtual double GetDownloadSpeed ()
 
virtual bool Delete (const CURL &url)
 
virtual bool Rename (const CURL &url, const CURL &urlnew)
 
virtual bool SetHidden (const CURL &url, bool hidden)
 
virtual int IoControl (EIoControl request, void *param)
 
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
 

Constructor & Destructor Documentation

◆ IFile()

IFile::IFile ( )
default

◆ ~IFile()

IFile::~IFile ( )
virtualdefault

Member Function Documentation

◆ Close()

◆ Delete()

◆ Exists()

◆ Flush()

virtual void XFILE::IFile::Flush ( )
inlinevirtual

◆ GetChunkSize()

◆ GetDownloadSpeed()

virtual double XFILE::IFile::GetDownloadSpeed ( )
inlinevirtual

Reimplemented in XFILE::CCurlFile.

◆ GetLength()

◆ GetPosition()

◆ GetProperty()

virtual const std::string XFILE::IFile::GetProperty ( XFILE::FileProperty type,
const std::string & name = "" ) const
inlinevirtual

Reimplemented in XFILE::CCurlFile, and XFILE::CFileCache.

◆ GetPropertyValues()

virtual const std::vector< std::string > XFILE::IFile::GetPropertyValues ( XFILE::FileProperty type,
const std::string & name = "" ) const
inlinevirtual

Reimplemented in XFILE::CCurlFile, and XFILE::CFileCache.

◆ IoControl()

◆ Open()

◆ OpenForWrite()

◆ Read()

virtual ssize_t XFILE::IFile::Read ( void * bufPtr,
size_t bufSize )
pure virtual

Attempt to read bufSize bytes from currently opened file into buffer bufPtr.

Parameters
bufPtrpointer to buffer
bufSizesize of the buffer
Returns
number of successfully read bytes if any bytes were read and stored in buffer, zero if no bytes are available to read (end of file was reached) or undetectable error occur, -1 in case of any explicit error

Implemented in ADDON::CVFSEntryIFileWrapper, XFILE::CAPKFile, XFILE::CCurlFile, XFILE::CFileAndroidApp, XFILE::CFileCache, XFILE::CFileCDDA, XFILE::CImageFile, XFILE::CISO9660File, XFILE::CMusicDatabaseFile, XFILE::CNFSFile, XFILE::COverrideFile, XFILE::CPipeFile, XFILE::CPosixFile, XFILE::CShoutcastFile, XFILE::CSMBFile, XFILE::CTVOSFile, XFILE::CUDFFile, XFILE::CUPnPFile, XFILE::CWin32File, XFILE::CWinLibraryFile, XFILE::CXbtFile, and XFILE::CZipFile.

◆ ReadLine()

IFile::ReadLineResult IFile::ReadLine ( char * buffer,
std::size_t bufferSize )
virtual

Reads a line from a file into buffer. Reads at most bufferLength - 1 bytes from the file. buffer is unchanged in case the returned result code is FAILURE. The read line can contain '\0' characters

Parameters
bufferThe buffer into which the line is wrote
bufferSizeThe size of buffer
Returns
See ReadLineResult

Reimplemented in XFILE::CCurlFile.

◆ Rename()

◆ ReOpen()

virtual bool XFILE::IFile::ReOpen ( const CURL & url)
inlinevirtual

Reimplemented in XFILE::CCurlFile.

◆ Seek()

◆ SetHidden()

virtual bool XFILE::IFile::SetHidden ( const CURL & url,
bool hidden )
inlinevirtual

◆ Stat() [1/2]

virtual int XFILE::IFile::Stat ( const CURL & url,
struct __stat64 * buffer )
pure virtual

Fills struct __stat64 with information about file specified by url. For st_mode function will set correctly _S_IFDIR (directory) flag and may set _S_IREAD (read permission), _S_IWRITE (write permission) flags if such information is available. Function may set st_size (file size), st_atime, st_mtime, st_ctime (access, modification, creation times). Any other flags and members of __stat64 that didn't updated with actual file information will be set to zero (st_nlink can be set ether to 1 or zero).

Parameters
urlspecifies requested file
bufferpointer to __stat64 buffer to receive information about file
Returns
zero of success, -1 otherwise.

Implemented in ADDON::CVFSEntryIFileWrapper, XFILE::CAPKFile, XFILE::CCurlFile, XFILE::CFileAndroidApp, XFILE::CFileCache, XFILE::CFileCDDA, XFILE::CImageFile, XFILE::CISO9660File, XFILE::CMultiPathFile, XFILE::CMusicDatabaseFile, XFILE::CNFSFile, XFILE::COverrideFile, XFILE::CPipeFile, XFILE::CPluginFile, XFILE::CPosixFile, XFILE::CShoutcastFile, XFILE::CSMBFile, XFILE::CTVOSFile, XFILE::CUDFFile, XFILE::CUPnPFile, XFILE::CWin32File, XFILE::CWin32SMBFile, XFILE::CWinLibraryFile, XFILE::CXbtFile, and XFILE::CZipFile.

◆ Stat() [2/2]

int IFile::Stat ( struct __stat64 * buffer)
virtual

Fills struct __stat64 with information about currently open file For st_mode function will set correctly _S_IFDIR (directory) flag and may set _S_IREAD (read permission), _S_IWRITE (write permission) flags if such information is available. Function may set st_size (file size), st_atime, st_mtime, st_ctime (access, modification, creation times). Any other flags and members of __stat64 that didn't updated with actual file information will be set to zero (st_nlink can be set ether to 1 or zero).

Parameters
bufferpointer to __stat64 buffer to receive information about file
Returns
zero of success, -1 otherwise.

Reimplemented in XFILE::CAPKFile, XFILE::CNFSFile, XFILE::COverrideFile, XFILE::CPipeFile, XFILE::CPluginFile, XFILE::CPosixFile, XFILE::CSMBFile, XFILE::CTVOSFile, XFILE::CWin32File, XFILE::CWinLibraryFile, XFILE::CXbtFile, and XFILE::CZipFile.

◆ Truncate()

virtual int XFILE::IFile::Truncate ( int64_t size)
inlinevirtual

◆ Write()

virtual ssize_t XFILE::IFile::Write ( const void * bufPtr,
size_t bufSize )
inlinevirtual

Attempt to write bufSize bytes from buffer bufPtr into currently opened file.

Parameters
bufPtrpointer to buffer
bufSizesize of the buffer
Returns
number of successfully written bytes if any bytes were written, zero if no bytes were written and no detectable error occur, -1 in case of any explicit error

Reimplemented in ADDON::CVFSEntryIFileWrapper, XFILE::CCurlFile, XFILE::CNFSFile, XFILE::COverrideFile, XFILE::CPipeFile, XFILE::CPosixFile, XFILE::CSMBFile, XFILE::CTVOSFile, XFILE::CWin32File, and XFILE::CWinLibraryFile.


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