OpenTTD
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:
FileList

Public Member Functions

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
FiosItemAppend ()
 Construct a new entry in the file list.
uint Length () const
 Get the number of files in the list.
const FiosItemBegin () const
 Get a pointer to the first file information.
const FiosItemEnd () const
 Get a pointer behind the last file information.
const FiosItemGet (uint index) const
 Get a pointer to the indicated file information.
FiosItemGet (uint index)
 Get a pointer to the indicated file information.
const FiosItemoperator[] (uint index) const
FiosItemoperator[] (uint index)
 Get a reference to the indicated file information.
void Clear ()
 Remove all items from the list.
void Compact ()
 Compact the list down to the smallest block size boundary.
void BuildFileList (AbstractFileType abstract_filetype, SaveLoadOperation fop)
 Construct a file list with the given kind of files, for the stated purpose.
const FiosItemFindItem (const char *file)
 Find file information of a file by its name from the file list.

Data Fields

bool file_list_valid
 If set, the file list is valid.
- Data Fields inherited from FileList
SmallVector< FiosItem, 32 > files
 The list of files.

Detailed Description

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

Definition at line 49 of file console_cmds.cpp.

Member Function Documentation

void ConsoleFileList::InvalidateFileList ( )
inline

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

Definition at line 57 of file console_cmds.cpp.

References FileList::Clear(), and file_list_valid.

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
Alwaysreload the file storage cache.

Definition at line 67 of file console_cmds.cpp.

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


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