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

Method BuildFileList

src/fios.cpp:67–95  ·  view source on GitHub ↗

* Construct a file list with the given kind of files, for the stated purpose. * @param abstract_filetype Kind of files to collect. * @param fop Purpose of the collection, either #SLO_LOAD or #SLO_SAVE. * @param show_dirs Whether to show directories. */

Source from the content-addressed store, hash-verified

65 * @param show_dirs Whether to show directories.
66 */
67void FileList::BuildFileList(AbstractFileType abstract_filetype, SaveLoadOperation fop, bool show_dirs)
68{
69 this->clear();
70
71 assert(fop == SLO_LOAD || fop == SLO_SAVE);
72 switch (abstract_filetype) {
73 case FT_NONE:
74 break;
75
76 case FT_SAVEGAME:
77 FiosGetSavegameList(fop, show_dirs, *this);
78 break;
79
80 case FT_SCENARIO:
81 FiosGetScenarioList(fop, show_dirs, *this);
82 break;
83
84 case FT_HEIGHTMAP:
85 FiosGetHeightmapList(fop, show_dirs, *this);
86 break;
87
88 case FT_TOWN_DATA:
89 FiosGetTownDataList(fop, show_dirs, *this);
90 break;
91
92 default:
93 NOT_REACHED();
94 }
95}
96
97/**
98 * Find file information of a file by its name from the file list.

Callers 2

OnInvalidateDataMethod · 0.80
ValidateFileListMethod · 0.80

Calls 6

FiosGetSavegameListFunction · 0.85
FiosGetScenarioListFunction · 0.85
FiosGetHeightmapListFunction · 0.85
FiosGetTownDataListFunction · 0.85
NOT_REACHEDFunction · 0.85
clearMethod · 0.45

Tested by

no test coverage detected