OpenTTD Source
1.11.0-beta2
|
List of file information. More...
#include <fios.h>
Public Member Functions | |
FiosItem * | Append () |
Construct a new entry in the file list. More... | |
size_t | Length () const |
Get the number of files in the list. More... | |
const FiosItem * | Begin () const |
Get a pointer to the first file information. More... | |
const FiosItem * | End () const |
Get a pointer behind the last file information. More... | |
const FiosItem * | Get (size_t index) const |
Get a pointer to the indicated file information. More... | |
FiosItem * | Get (size_t index) |
Get a pointer to the indicated file information. More... | |
const FiosItem & | operator[] (size_t index) const |
FiosItem & | operator[] (size_t index) |
Get a reference to the indicated file information. More... | |
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. More... | |
const FiosItem * | FindItem (const char *file) |
Find file information of a file by its name from the file list. More... | |
Data Fields | |
std::vector< FiosItem > | files |
The list of files. | |
|
inline |
|
inline |
Get a pointer to the first file information.
Definition at line 138 of file fios.h.
References files.
Referenced by End(), FindItem(), and SortSaveGameList().
void FileList::BuildFileList | ( | AbstractFileType | abstract_filetype, |
SaveLoadOperation | fop | ||
) |
Construct a file list with the given kind of files, for the stated purpose.
abstract_filetype | Kind of files to collect. |
fop | Purpose of the collection, either SLO_LOAD or SLO_SAVE. |
Definition at line 76 of file fios.cpp.
References Clear(), FiosGetHeightmapList(), FiosGetSavegameList(), FiosGetScenarioList(), FT_HEIGHTMAP, FT_NONE, FT_SAVEGAME, FT_SCENARIO, SLO_LOAD, and SLO_SAVE.
Referenced by ConsoleFileList::ValidateFileList().
|
inline |
Get a pointer behind the last file information.
Definition at line 147 of file fios.h.
References Begin(), and Length().
Referenced by FindItem(), and SortSaveGameList().
const FiosItem * FileList::FindItem | ( | const char * | file | ) |
Find file information of a file by its name from the file list.
file | The filename to return information about. Can be the actual name or a numbered entry into the filename list. |
nullptr
if the file is not available. Definition at line 108 of file fios.cpp.
References Begin(), End(), Get(), IsInsideMM(), and Length().
|
inline |
|
inline |
Get a pointer to the indicated file information.
File information must exist.
Definition at line 156 of file fios.h.
References files.
Referenced by FindItem().
|
inline |
Get the number of files in the list.
Definition at line 129 of file fios.h.
References files.
Referenced by End(), and FindItem().
|
inline |