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 TarScanner::AddFile(), AppendFile(), ClientNetworkContentSocketHandler::BeforeDownload(), CompareFiles(), ExtractTar(), FioFOpenFileTar(), GetLanguageFileHeader(), GunzipFile(), DLSFile::LoadFile(), LoadFromHighScore(), main(), MakeBMPImage(), MakePCXImage(), MakePNGImage(), SettingsIniFile::OpenFile(), ReadFileToMem(), and SaveToHighScore().