|
void | Close () |
|
| operator FILE * () |
|
|
static std::optional< FileHandle > | Open (const std::string &filename, const std::string &mode) |
| Open an RAII file handle if possible. More...
|
|
Definition at line 158 of file fileio_type.h.
◆ Open()
std::optional< FileHandle > FileHandle::Open |
( |
const std::string & |
filename, |
|
|
const std::string & |
mode |
|
) |
| |
|
static |
Open an RAII file handle if possible.
Simplified FileHandle::Open which ignores OTTD2FS.
The canonical RAII-way is for FileHandle to open the file and throw an exception on failure, but we don't want that.
- Parameters
-
filename | UTF-8 encoded filename to open. |
mode | Mode to open file. |
- Returns
- FileHandle, or std::nullopt on failure.
Required as settingsgen does not include all of the fileio system.
- Parameters
-
filename | UTF-8 encoded filename to open. |
mode | Mode to open file. |
- Returns
- FileHandle, or std::nullopt on failure.
Definition at line 1170 of file fileio.cpp.
References OTTD2FS().
Referenced by AppendFile(), ClientNetworkContentSocketHandler::BeforeDownload(), CompareFiles(), FioFOpenFileTar(), GetLanguageFileHeader(), GunzipFile(), DLSFile::LoadFile(), LoadFromHighScore(), main(), MakeBMPImage(), SettingsIniFile::OpenFile(), ReadFileToMem(), and SaveToHighScore().
The documentation for this class was generated from the following files: