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.
◆ 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
◆ Close()
Close a file.
- Parameters
-
[in] | context | The context of the file |
- Returns
- True on success, false on failure
◆ 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
◆ 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
◆ 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
◆ 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
◆ GetChunkSize()
Get chunk size of a file.
- Parameters
-
[in] | context | The context of the file |
- Returns
- Chunk size
◆ IoControlGetSeekPossible()
To check seek possible on current stream by file.
- Returns
- true if seek possible, false if not
◆ IoControlGetCacheStatus()
To check a running stream on file for state of his cache.
- Parameters
-
[in] | status | Information about current cache status |
- Returns
- true if successfull done, false otherwise
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 | unsigned int | SetMaxRate | GetMaxRate |
Average read rate from source file | unsigned int | SetCurrentRate | GetCurrentRate |
Cache low speed condition detected | bool | SetLowspeed | GetLowspeed |
◆ IoControlSetCacheRate()
Unsigned int with speed limit for caching in bytes per second.
- Parameters
-
[in] | rate | Cache rate size to use |
- Returns
- true if successfull 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 successfull done, false otherwise