MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / FioFindDirectory

Function FioFindDirectory

src/fileio.cpp:171–181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169}
170
171std::string FioFindDirectory(Subdirectory subdir)
172{
173 /* Find and return the first valid directory */
174 for (Searchpath sp : _valid_searchpaths) {
175 std::string ret = FioGetDirectory(sp, subdir);
176 if (FileExists(ret)) return ret;
177 }
178
179 /* Could not find the directory, fall back to a base path */
180 return _personal_dir;
181}
182
183static std::optional<FileHandle> FioFOpenFileSp(std::string_view filename, std::string_view mode, Searchpath sp, Subdirectory subdir, size_t *filesize)
184{

Callers 7

SaveLoadWindowMethod · 0.85
FiosGetSavegameListFunction · 0.85
FiosGetScenarioListFunction · 0.85
FiosGetHeightmapListFunction · 0.85
FiosGetTownDataListFunction · 0.85
FiosGetScreenshotDirFunction · 0.85
FiosNumberedSaveNameMethod · 0.85

Calls 2

FioGetDirectoryFunction · 0.85
FileExistsFunction · 0.85

Tested by

no test coverage detected