Layer for reading Theme Hospital files out of an .iso disk image.
More...
#include <iso_fs.h>
Layer for reading Theme Hospital files out of an .iso disk image.
An instance of this class can read files which contain an ISO 9660 file system (as described at http://alumnus.caltech.edu/~pje/iso9660.html and http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-119.pdf) which are typically called iso disk images. Once given a disk image, it searches for the Theme Hospital data files, and can then be used to read these data files.
◆ file_handle
◆ iso_filesystem()
| iso_filesystem::iso_filesystem |
( |
const char * |
path, |
|
|
char |
pathSeparator = '/' |
|
) |
| |
|
explicit |
Load an .iso disk image and search for Theme Hospital data files.
- Parameters
-
| path | Path to the .iso disk image to load |
| pathSeparator | The character to be used between components in file paths. Defaults to '/'. |
- Exceptions
-
| std::runtime_error | if the file could not be opened |
◆ ~iso_filesystem()
| iso_filesystem::~iso_filesystem |
( |
| ) |
|
|
default |
◆ find_file()
Find a file in the loaded .iso disk image.
If (and only if) the given file could not be found, then isHandleGood() will return false on the returned handle.
◆ get_error()
| std::string_view iso_filesystem::get_error |
( |
| ) |
const |
Get the reason for the most recent failure.
Can be called after get_file_data() return false.
◆ get_file_data()
| bool iso_filesystem::get_file_data |
( |
file_handle |
iFile, |
|
|
uint8_t * |
pBuffer |
|
) |
| |
Get the contents of a file in the loaded .iso disk image.
- Parameters
-
| iFile | A file handle returned by find_file() |
| pBuffer | The buffer to place the resulting data in |
- Returns
- true on success, false on failure - call getError() for reason
◆ get_file_size()
| uint32_t iso_filesystem::get_file_size |
( |
file_handle |
iFile | ) |
const |
Get the size (in bytes) of a file in the loaded .iso disk image.
- Parameters
-
◆ get_file_start()
| uint32_t iso_filesystem::get_file_start |
( |
file_handle |
iFile | ) |
const |
Get the byte offset of the start of the file in the loaded .iso.
- Parameters
-
◆ is_handle_good()
Test if a file handle from find_file() is good or is invalid.
◆ visit_directory_files()
Iterate all files of the .iso disk image within a given directory.
- Parameters
-
| sPath | The directory to iterate |
| fnCallback | The function to be called for each file. The first parameter to this function is pCallbackData. The second is the name of a file which is in sPath. |
| pCallbackData | Opaque value to be called to fnCallback. |
◆ min_sector_size
| constexpr size_t iso_filesystem::min_sector_size = 2048 |
|
staticconstexpr |
Sector sizes can vary, but they must be powers of two, and the minimum size is 2048.
The documentation for this class was generated from the following files:
- /home/runner/work/CorsixTH/CorsixTH/CorsixTH/Src/iso_fs.h
- /home/runner/work/CorsixTH/CorsixTH/CorsixTH/Src/iso_fs.cpp