Wrapper equipping a CVFSEntry with an IFile interface.
More...
#include <VFSEntry.h>
|
| 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.
|
|
| 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 |
|
Wrapper equipping a CVFSEntry with an IFile interface.
Needed as CVFSEntry implements several VFS interfaces with overlapping methods.
◆ CVFSEntryIFileWrapper()
ADDON::CVFSEntryIFileWrapper::CVFSEntryIFileWrapper |
( |
VFSEntryPtr | ptr | ) |
|
|
explicit |
The constructor initializes the reference to the wrapped CVFSEntry.
- Parameters
-
◆ ~CVFSEntryIFileWrapper()
ADDON::CVFSEntryIFileWrapper::~CVFSEntryIFileWrapper |
( |
| ) |
|
|
override |
◆ Close()
void ADDON::CVFSEntryIFileWrapper::Close |
( |
| ) |
|
|
overridevirtual |
◆ Delete()
bool ADDON::CVFSEntryIFileWrapper::Delete |
( |
const CURL & | url | ) |
|
|
overridevirtual |
Delete a file.
- Parameters
-
[in] | url | URL of file to delete. |
Reimplemented from XFILE::IFile.
◆ Exists()
bool ADDON::CVFSEntryIFileWrapper::Exists |
( |
const CURL & | url | ) |
|
|
overridevirtual |
Check for file existence.
- Parameters
-
Implements XFILE::IFile.
◆ GetChunkSize()
int ADDON::CVFSEntryIFileWrapper::GetChunkSize |
( |
| ) |
|
|
overridevirtual |
◆ GetLength()
int64_t ADDON::CVFSEntryIFileWrapper::GetLength |
( |
| ) |
|
|
overridevirtual |
◆ GetPosition()
int64_t ADDON::CVFSEntryIFileWrapper::GetPosition |
( |
| ) |
|
|
overridevirtual |
◆ IoControl()
Perform I/O controls for file.
Reimplemented from XFILE::IFile.
◆ Open()
bool ADDON::CVFSEntryIFileWrapper::Open |
( |
const CURL & | url | ) |
|
|
overridevirtual |
Open a file.
- Parameters
-
- 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] | url | URL to open. |
[in] | bOverWrite | If 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
-
| lpBuf | Buffer to read data into. |
[in] | uiBufSize | Number 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] | url | URL of file to rename. |
[in] | url2 | New 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] | iFilePosition | Position to seek to. |
[in] | whence | Origin 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] | url | URL of file. |
[out] | buffer | The 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] | size | Size 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] | lpBuf | Data to write. |
[in] | uiBufSize | Number of bytes to write. |
- Returns
- Number of bytes written.
Reimplemented from XFILE::IFile.
◆ m_addon
◆ 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: