#include "strings_type.h"
#include <sys/types.h>
#include <dirent.h>
Go to the source code of this file.
Data Structures | |
struct | FiosItem |
struct | SmallFiosItem |
Enumerations | |
enum | { CONFIG_SLOT = 0, SOUND_SLOT = 1, FIRST_GRF_SLOT = 2, LAST_GRF_SLOT = 63, MAX_FILE_SLOTS = 64 } |
enum | SaveLoadDialogMode { SLD_LOAD_GAME, SLD_LOAD_SCENARIO, SLD_SAVE_GAME, SLD_SAVE_SCENARIO, SLD_LOAD_HEIGHTMAP, SLD_NEW_GAME } |
enum | FileType { FT_NONE, FT_SAVEGAME, FT_SCENARIO, FT_HEIGHTMAP } |
enum | FiosType { FIOS_TYPE_DRIVE = 0, FIOS_TYPE_PARENT = 1, FIOS_TYPE_DIR = 2, FIOS_TYPE_FILE = 3, FIOS_TYPE_OLDFILE = 4, FIOS_TYPE_SCENARIO = 5, FIOS_TYPE_OLD_SCENARIO = 6, FIOS_TYPE_DIRECT = 7, FIOS_TYPE_PNG = 8, FIOS_TYPE_BMP = 9, FIOS_TYPE_INVALID = 255 } |
Functions | |
void | ShowSaveLoadDialog (SaveLoadDialogMode mode) |
FiosItem * | FiosGetSavegameList (int mode) |
Get a list of savegames. | |
FiosItem * | FiosGetScenarioList (int mode) |
Get a list of scenarios. | |
FiosItem * | FiosGetHeightmapList (int mode) |
void | FiosFreeSavegameList () |
Free the list of savegames. | |
char * | FiosBrowseTo (const FiosItem *item) |
StringID | FiosGetDescText (const char **path, uint32 *total_free) |
Get descriptive texts. | |
bool | FiosDelete (const char *name) |
void | FiosMakeSavegameName (char *buf, const char *name, size_t size) |
FiosItem * | FiosAlloc () |
Allocate a new FiosItem. | |
byte | FiosGetSavegameListCallback (int mode, const char *file, const char *ext, char *title) |
Callback for FiosGetFileList. | |
int CDECL | compare_FiosItems (const void *a, const void *b) |
Compare two FiosItem's. | |
static DIR * | ttd_opendir (const char *path) |
A wrapper around opendir() which will convert the string from OPENTTD encoding to that of the filesystem. | |
Variables | |
FiosItem * | _fios_list |
defined in misc_gui.cpp | |
int | _fios_num |
defined in fios.cpp, read_only version of _fios_count | |
SmallFiosItem | _file_to_saveload |
SaveLoadDialogMode | _saveload_mode |
defined in misc_gui.cpp |
Definition in file fios.h.
anonymous enum |
enum FileType |
int CDECL compare_FiosItems | ( | const void * | a, | |
const void * | b | |||
) |
Compare two FiosItem's.
Used with qsort when sorting the file list.
a | A pointer to the first FiosItem to compare. | |
b | A pointer to the second FiosItem to compare. |
Definition at line 67 of file fios.cpp.
Referenced by FiosGetFileList().
FiosItem* FiosAlloc | ( | ) |
Allocate a new FiosItem.
Definition at line 52 of file fios.cpp.
References ReallocT().
Referenced by FiosGetFileList().
StringID FiosGetDescText | ( | const char ** | path, | |
uint32 * | total_free | |||
) |
FiosItem* FiosGetSavegameList | ( | int | mode | ) |
Get a list of savegames.
mode | Save/load mode. |
Definition at line 342 of file fios.cpp.
References FiosGetFileList(), FiosGetSavegameListCallback(), and SAVE_DIR.
byte FiosGetSavegameListCallback | ( | int | mode, | |
const char * | file, | |||
const char * | ext, | |||
char * | title | |||
) |
Callback for FiosGetFileList.
It tells if a file is a savegame or not.
mode | Save/load mode. | |
file | Name of the file to check. | |
ext | A pointer to the extension identifier inside file | |
title | Buffer if a callback wants to lookup the title of the file; NULL to skip the lookup |
Definition at line 316 of file fios.cpp.
Referenced by FiosGetSavegameList().
FiosItem* FiosGetScenarioList | ( | int | mode | ) |
Get a list of scenarios.
mode | Save/load mode. |
Definition at line 390 of file fios.cpp.
References FiosGetFileList(), FiosGetScenarioListCallback(), and SCENARIO_DIR.
static DIR* ttd_opendir | ( | const char * | path | ) | [inline, static] |
A wrapper around opendir() which will convert the string from OPENTTD encoding to that of the filesystem.
For all purposes this function behaves the same as the original opendir function
path | string to open directory of |
Definition at line 149 of file fios.h.
References OTTD2FS().
Referenced by FiosGetFileList(), and GetLanguageList().