* 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. */
| 65 | * @param show_dirs Whether to show directories. |
| 66 | */ |
| 67 | void 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. |
no test coverage detected