OpenTTD Source: FileList Class Reference

OpenTTD Source 15.0-RC2

Public Member Functions
FileList Class Reference

List of file information. More...

`#include <fios.h>`

Inheritance diagram for FileList:

## Public Member Functions
void | BuildFileList (AbstractFileType abstract_filetype, SaveLoadOperation fop, bool show_dirs)
| Construct a file list with the given kind of files, for the stated purpose.
const FiosItem * | FindItem (std::string_view file)
| Find file information of a file by its name from the file list.

## Detailed Description

List of file information.

Definition at line 87 of file fios.h.

## Member Function Documentation

## ◆ BuildFileList()

void FileList::BuildFileList | ( | AbstractFileType | abstract_filetype,
|  | SaveLoadOperation | fop,
|  | bool | show_dirs
| ) |  |

Construct a file list with the given kind of files, for the stated purpose.

Parameters

  abstract_filetype | Kind of files to collect.
  fop | Purpose of the collection, either SLO_LOAD or SLO_SAVE.
  show_dirs | Whether to show directories.

Definition at line 67 of file fios.cpp.

References FiosGetHeightmapList(), FiosGetSavegameList(), FiosGetScenarioList(), FiosGetTownDataList(), FT_HEIGHTMAP, FT_NONE, FT_SAVEGAME, FT_SCENARIO, FT_TOWN_DATA, SLO_LOAD, and SLO_SAVE.

Referenced by SaveLoadWindow::OnInvalidateData(), and ConsoleFileList::ValidateFileList().

## ◆ FindItem()

const FiosItem * FileList::FindItem | ( | std::string_view | file | ) |

Find file information of a file by its name from the file list.

Parameters

  file | The filename to return information about. Can be the actual name or a numbered entry into the filename list.

Returns
  The information on the file, or `nullptr` if the file is not available.

Definition at line 103 of file fios.cpp.

References EncodedString::GetDecodedString(), IsInsideMM(), and StringConsumer::TryReadIntegerBase().

The documentation for this class was generated from the following files:

- src/fios.h
- src/fios.cpp