OpenTTD Source: ConsoleFileList Class Reference

OpenTTD Source 15.0-RC2

Public Member Functions | Data Fields
ConsoleFileList Class Reference

File list storage for the console, for caching the last 'ls' command. More...

Inheritance diagram for ConsoleFileList:

## Public Member Functions
| ConsoleFileList (AbstractFileType abstract_filetype, bool show_dirs)
void | InvalidateFileList ()
| Declare the file storage cache as being invalid, also clears all stored files.
void | ValidateFileList (bool force_reload=false)
| (Re-)validate the file storage cache.
Public Member Functions inherited from FileList
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.

## Data Fields
AbstractFileType | abstract_filetype
| The abstract file type to list.
bool | show_dirs
| Whether to show directories in the file list.
bool | file_list_valid = false
| If set, the file list is valid.

## Detailed Description

File list storage for the console, for caching the last 'ls' command.

Definition at line 93 of file console_cmds.cpp.

## Constructor & Destructor Documentation

## ◆ ConsoleFileList()

ConsoleFileList::ConsoleFileList | ( | AbstractFileType | abstract_filetype,
|  | bool | show_dirs
| ) |  |
| inline

Definition at line 95 of file console_cmds.cpp.

## Member Function Documentation

## ◆ InvalidateFileList()

void ConsoleFileList::InvalidateFileList | ( |  | ) |
| inline

Declare the file storage cache as being invalid, also clears all stored files.

Definition at line 100 of file console_cmds.cpp.

References file_list_valid.

## ◆ ValidateFileList()

void ConsoleFileList::ValidateFileList | ( | bool | force_reload = `false` | ) |
| inline

(Re-)validate the file storage cache.

Only makes a change if the storage was invalid, or if force_reload.

Parameters

  force_reload | Always reload the file storage cache.

Definition at line 110 of file console_cmds.cpp.

References FileList::BuildFileList(), file_list_valid, and SLO_LOAD.

## Field Documentation

## ◆ abstract_filetype

AbstractFileType ConsoleFileList::abstract_filetype

The abstract file type to list.

Definition at line 118 of file console_cmds.cpp.

## ◆ file_list_valid

bool ConsoleFileList::file_list_valid = false

If set, the file list is valid.

Definition at line 120 of file console_cmds.cpp.

Referenced by InvalidateFileList(), and ValidateFileList().

## ◆ show_dirs

bool ConsoleFileList::show_dirs

Whether to show directories in the file list.

Definition at line 119 of file console_cmds.cpp.

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

- src/console_cmds.cpp