File editing functions.
More...
|
virtual kodi::addon::VFSFileHandle | kodi::addon::CInstanceVFS::Open (const kodi::addon::VFSUrl &url) |
| Open a file for input.
|
|
virtual kodi::addon::VFSFileHandle | kodi::addon::CInstanceVFS::OpenForWrite (const kodi::addon::VFSUrl &url, bool overWrite) |
| Open a file for output.
|
|
virtual bool | kodi::addon::CInstanceVFS::Close (kodi::addon::VFSFileHandle context) |
| Close a file.
|
|
virtual ssize_t | kodi::addon::CInstanceVFS::Read (kodi::addon::VFSFileHandle context, uint8_t *buffer, size_t uiBufSize) |
| Read from a file.
|
|
virtual ssize_t | kodi::addon::CInstanceVFS::Write (kodi::addon::VFSFileHandle context, const uint8_t *buffer, size_t uiBufSize) |
| Write to a file.
|
|
virtual int64_t | kodi::addon::CInstanceVFS::Seek (kodi::addon::VFSFileHandle context, int64_t position, int whence) |
| Seek in a file.
|
|
virtual int | kodi::addon::CInstanceVFS::Truncate (kodi::addon::VFSFileHandle context, int64_t size) |
| Truncate a file.
|
|
virtual int64_t | kodi::addon::CInstanceVFS::GetLength (kodi::addon::VFSFileHandle context) |
| Get total size of a file.
|
|
virtual int64_t | kodi::addon::CInstanceVFS::GetPosition (kodi::addon::VFSFileHandle context) |
| Get current position in a file.
|
|
virtual int | kodi::addon::CInstanceVFS::GetChunkSize (kodi::addon::VFSFileHandle context) |
| Get chunk size of a file.
|
|
virtual bool | kodi::addon::CInstanceVFS::IoControlGetSeekPossible (kodi::addon::VFSFileHandle context) |
| To check seek possible on current stream by file.
|
|
virtual bool | kodi::addon::CInstanceVFS::IoControlGetCacheStatus (kodi::addon::VFSFileHandle context, kodi::vfs::CacheStatus &status) |
| To check a running stream on file for state of his cache.
|
|
virtual bool | kodi::addon::CInstanceVFS::IoControlSetCacheRate (kodi::addon::VFSFileHandle context, uint32_t rate) |
| Unsigned int with speed limit for caching in bytes per second.
|
|
virtual bool | kodi::addon::CInstanceVFS::IoControlSetRetry (kodi::addon::VFSFileHandle context, bool retry) |
| Enable/disable retry within the protocol handler (if supported).
|
|
File editing functions.
This value represents the addon-side handlers and to be able to identify his own parts in the event of further access.
◆ Close()
Close a file.
- Parameters
-
[in] | context | The context of the file |
- Returns
- True on success, false on failure
◆ GetChunkSize()
Get chunk size of a file.
- Parameters
-
[in] | context | The context of the file |
- Returns
- Chunk size
◆ GetLength()
Get total size of a file.
- Parameters
-
[in] | context | The context of the file |
- Returns
- Total file size
◆ GetPosition()
Get current position in a file.
- Parameters
-
[in] | context | The context of the file |
- Returns
- Current position
◆ IoControlGetCacheStatus()
To check a running stream on file for state of his cache.
- Parameters
-
[in] | status | Information about current cache status |
- Returns
- true if successfully done, false otherwise
@ingroup cpp_kodi_vfs_Defs_CacheStatus
The following table contains values that can be set with class CacheStatus :
Name | Type | Set call | Get call |
Number of bytes cached | uint64_t | SetForward | GetForward |
Maximum number of bytes per second | uint32_t | SetMaxRate | GetMaxRate |
Average read rate from source file | uint32_t | SetCurrentRate | GetCurrentRate |
Cache low speed rate detected | uint32_t | SetLowRate | GetLowRate |
◆ IoControlGetSeekPossible()
To check seek possible on current stream by file.
- Returns
- true if seek possible, false if not
◆ IoControlSetCacheRate()
Unsigned int with speed limit for caching in bytes per second.
- Parameters
-
[in] | rate | Cache rate size to use |
- Returns
- true if successfully done, false otherwise
◆ IoControlSetRetry()
Enable/disable retry within the protocol handler (if supported).
- Parameters
-
[in] | retry | To set the retry, true for use, false for not |
- Returns
- true if successfully done, false otherwise
◆ Open()
Open a file for input.
- Parameters
-
[in] | url | The URL of the file |
- Returns
- Context for the opened file
The following table contains values that can be set with class VFSUrl :
◆ OpenForWrite()
Open a file for output.
- Parameters
-
[in] | url | The URL of the file |
[in] | overWrite | Whether or not to overwrite an existing file |
- Returns
- Context for the opened file
◆ Read()
Read from a file.
- Parameters
-
[in] | context | The context of the file |
[out] | buffer | The buffer to read data into |
[in] | uiBufSize | Number of bytes to read |
- Returns
- Number of bytes read
◆ Seek()
Seek in a file.
- Parameters
-
[in] | context | The context of the file |
[in] | position | The position to seek to |
[in] | whence | Position in file 'position' is relative to (SEEK_CUR, SEEK_SET, SEEK_END):
Value | int | Description |
SEEK_SET | 0 | position is relative to the beginning of the file. This is probably what you had in mind anyway, and is the most commonly used value for whence. |
SEEK_CUR | 1 | position is relative to the current file pointer position. So, in effect, you can say, "Move to my current position plus 30 bytes," or, "move to my current position minus 20 bytes." |
SEEK_END | 2 | position is relative to the end of the file. Just like SEEK_SET except from the other end of the file. Be sure to use negative values for offset if you want to back up from the end of the file, instead of going past the end into oblivion. |
|
- Returns
- Offset in file after seek
◆ Truncate()
Truncate a file.
- Parameters
-
[in] | context | The context of the file |
[in] | size | The size to truncate the file to |
- Returns
- 0 on success, -1 on error
◆ Write()
Write to a file.
- Parameters
-
[in] | context | The context of the file |
[in] | buffer | The buffer to read data from |
[in] | uiBufSize | Number of bytes to write |
- Returns
- Number of bytes written