Implements the File interface for files residing on a disk.
More...
#include <kanzi/core/platform/file/win32/read_only_disk_file.hpp>
Implements the File interface for files residing on a disk.
| kanzi::ReadOnlyDiskFile::ReadOnlyDiskFile |
( |
string_view |
filename | ) |
|
|
explicit |
Constructor.
- Parameters
-
| filename | The name (including path) of the disk file to handle. Throws runtime_error if file cannot be accessed. |
| virtual kanzi::ReadOnlyDiskFile::~ReadOnlyDiskFile |
( |
| ) |
|
|
virtual |
| kanzi::ReadOnlyDiskFile::ReadOnlyDiskFile |
( |
KzsResourceFile * |
resourceFile | ) |
|
|
explicitprotected |
Constructor.
- Parameters
-
| resourceFile | A pointer to an open resource file. |
| kanzi::ReadOnlyDiskFile::ReadOnlyDiskFile |
( |
string_view |
filename | ) |
|
|
explicit |
Constructor.
- Parameters
-
| filename | The name (including path) of the disk file to handle. Throws runtime_error if file cannot be accessed. |
| virtual kanzi::ReadOnlyDiskFile::~ReadOnlyDiskFile |
( |
| ) |
|
|
virtual |
Destructor.
Closes the file handle.
| kanzi::ReadOnlyDiskFile::ReadOnlyDiskFile |
( |
int |
fileDescriptor | ) |
|
|
explicitprotected |
Constructor.
- Parameters
-
| fileDescriptor | An open disk file descriptor. |
| kanzi::ReadOnlyDiskFile::ReadOnlyDiskFile |
( |
string_view |
filename | ) |
|
|
explicit |
Constructor.
- Parameters
-
| filename | The name (including path) of the disk file to handle. Throws runtime_error if file cannot be accessed. |
| kanzi::ReadOnlyDiskFile::ReadOnlyDiskFile |
( |
const char * |
filename | ) |
|
|
inlineexplicit |
Constructor.
- Parameters
-
| filename | The name (including path) of the disk file to handle. Throws runtime_error if file cannot be accessed. |
| virtual kanzi::ReadOnlyDiskFile::~ReadOnlyDiskFile |
( |
| ) |
|
|
virtual |
Destructor.
Closes the file handle and unmaps the file as needed.
| kanzi::ReadOnlyDiskFile::ReadOnlyDiskFile |
( |
HANDLE |
fileHandle | ) |
|
|
explicitprotected |
Constructor.
- Parameters
-
| fileHandle | An open disk file handle. |
Factory function.
Creates an object representing an open file handle to a disk file.
- Parameters
-
| filename | The name (including path) of the disk file to handle. |
- Returns
- Pointer to the object, or null when file cannot be accessed.
| virtual void kanzi::ReadOnlyDiskFile::read |
( |
char * |
buffer, |
|
|
uint64_t |
count |
|
) |
| |
|
virtual |
| virtual void kanzi::ReadOnlyDiskFile::write |
( |
const char * |
buffer, |
|
|
uint64_t |
count |
|
) |
| |
|
virtual |
| virtual uint64_t kanzi::ReadOnlyDiskFile::size |
( |
| ) |
const |
|
virtual |
| virtual uint64_t kanzi::ReadOnlyDiskFile::tell |
( |
| ) |
const |
|
virtual |
| virtual void kanzi::ReadOnlyDiskFile::seek |
( |
SeekPosition |
position, |
|
|
int64_t |
offset |
|
) |
| |
|
virtual |
Skips bytes in the underlying stream.
- Parameters
-
| offset | Number of bytes to skip. Must be non-negative. |
Implements kanzi::File.
| virtual const byte* kanzi::ReadOnlyDiskFile::map |
( |
| ) |
|
|
virtual |
- Note
- Some memory mapping operations on Android are limited to 32 bit.
Implements kanzi::File.
Factory function.
Creates an object representing an open file handle to a disk file.
- Parameters
-
| filename | The name (including path) of the disk file to handle. |
- Returns
- Pointer to the object, or null when file cannot be accessed.
| virtual void kanzi::ReadOnlyDiskFile::read |
( |
char * |
buffer, |
|
|
uint64_t |
count |
|
) |
| |
|
virtual |
| virtual void kanzi::ReadOnlyDiskFile::write |
( |
const char * |
buffer, |
|
|
uint64_t |
count |
|
) |
| |
|
virtual |
| virtual uint64_t kanzi::ReadOnlyDiskFile::size |
( |
| ) |
const |
|
virtual |
| virtual uint64_t kanzi::ReadOnlyDiskFile::tell |
( |
| ) |
const |
|
virtual |
| virtual void kanzi::ReadOnlyDiskFile::seek |
( |
SeekPosition |
position, |
|
|
int64_t |
offset |
|
) |
| |
|
virtual |
| virtual const byte* kanzi::ReadOnlyDiskFile::map |
( |
| ) |
|
|
virtual |
Creates a memory mapping of the disk file.
Does nothing if the disk file has already been memory mapped.
- Returns
- Pointer to the view of the memory map.
Implements kanzi::File.
Factory function.
Creates an object representing an open file handle to a disk file.
- Parameters
-
| filename | The name (including path) of the disk file to handle. |
- Returns
- Pointer to the object, or null when file cannot be accessed.
| virtual void kanzi::ReadOnlyDiskFile::read |
( |
char * |
buffer, |
|
|
uint64_t |
count |
|
) |
| |
|
virtual |
| virtual void kanzi::ReadOnlyDiskFile::write |
( |
const char * |
buffer, |
|
|
uint64_t |
count |
|
) |
| |
|
virtual |
| virtual uint64_t kanzi::ReadOnlyDiskFile::size |
( |
| ) |
const |
|
virtual |
| virtual uint64_t kanzi::ReadOnlyDiskFile::tell |
( |
| ) |
const |
|
virtual |
| virtual void kanzi::ReadOnlyDiskFile::seek |
( |
SeekPosition |
position, |
|
|
int64_t |
offset |
|
) |
| |
|
virtual |
| virtual const byte* kanzi::ReadOnlyDiskFile::map |
( |
| ) |
|
|
virtual |
Creates a memory mapping of the disk file.
Does nothing if the disk file has already been memory mapped.
- Returns
- Pointer to the view of the memory map.
Implements kanzi::File.
Opaque handle to the disk file.
| byte* kanzi::ReadOnlyDiskFile::m_map |
|
protected |
| int kanzi::ReadOnlyDiskFile::m_fileDescriptor |
|
protected |
Opaque handle to the disk file.
| void * kanzi::ReadOnlyDiskFile::m_mapView |
|
protected |
Pointer to the memory map of the disk file.
Pointer to the view of the memory map of the disk file.
| vector<char> kanzi::ReadOnlyDiskFile::m_data |
|
protected |
Buffer for reading file contents if memory-mapping is not supported.
| HANDLE kanzi::ReadOnlyDiskFile::m_fileHandle |
|
protected |
Opaque handle to the disk file.
| HANDLE kanzi::ReadOnlyDiskFile::m_mapHandle |
|
protected |
Opaque handle to the memory map of the disk file.
The documentation for this class was generated from the following file: