xbmc
Public Member Functions | Protected Attributes | List of all members
ADDON::CVFSEntryIFileWrapper Class Reference

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

#include <VFSEntry.h>

Inheritance diagram for ADDON::CVFSEntryIFileWrapper:
Inheritance graph
[legend]
Collaboration diagram for ADDON::CVFSEntryIFileWrapper:
Collaboration graph
[legend]

Public Member Functions

 CVFSEntryIFileWrapper (VFSEntryPtr ptr)
 The constructor initializes the reference to the wrapped CVFSEntry. More...
 
 ~CVFSEntryIFileWrapper () override
 Empty destructor.
 
bool Open (const CURL &url) override
 Open a file. More...
 
bool OpenForWrite (const CURL &url, bool bOverWrite) override
 Open a file for writing. More...
 
bool Exists (const CURL &url) override
 Check for file existence. More...
 
int Stat (const CURL &url, struct __stat64 *buffer) override
 Stat a file. More...
 
ssize_t Read (void *lpBuf, size_t uiBufSize) override
 Read data from file: More...
 
ssize_t Write (const void *lpBuf, size_t uiBufSize) override
 Write data to file. More...
 
int64_t Seek (int64_t iFilePosition, int whence=SEEK_SET) override
 Seek in file. More...
 
int Truncate (int64_t size) override
 Truncate a file. More...
 
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. More...
 
bool Rename (const CURL &url, const CURL &url2) override
 Rename a file. More...
 
- Public Member Functions inherited from XFILE::IFile
virtual bool ReOpen (const CURL &url)
 
virtual int Stat (struct __stat64 *buffer)
 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. More...
 
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

void * m_context
 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.

Member Function Documentation

◆ 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.

◆ 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.


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