OpenTTD Source: src/fileio_type.h File Reference

OpenTTD Source 15.0-RC2

Data Structures | Enumerations | Variables
fileio_type.h File Reference

Types for Standard In/Out file operations. More...

`#include "core/enum_type.hpp"`
`#include "misc/autorelease.hpp"`

Go to the source code of this file.

## Data Structures
struct | FiosType
| Elements of a file system that are recognized. More...
class | FileHandle

## Enumerations
enum | AbstractFileType : uint8_t { FT_NONE , FT_SAVEGAME , FT_SCENARIO , FT_HEIGHTMAP , FT_TOWN_DATA , FT_INVALID = 7 }
| The different abstract types of files that the system knows about. More...
enum | DetailedFileType : uint8_t { DFT_OLD_GAME_FILE , DFT_GAME_FILE , DFT_HEIGHTMAP_BMP , DFT_HEIGHTMAP_PNG , DFT_TOWN_DATA_JSON , DFT_FIOS_DRIVE , DFT_FIOS_PARENT , DFT_FIOS_DIR , DFT_FIOS_DIRECT , DFT_END , DFT_INVALID = 255 }
| Kinds of files in each AbstractFileType. More...
enum | SaveLoadOperation : uint8_t { SLO_CHECK , SLO_LOAD , SLO_SAVE , SLO_INVALID }
| Operation performed on the file. More...
enum | Subdirectory : uint8_t { BASE_DIR , SAVE_DIR , AUTOSAVE_DIR , SCENARIO_DIR , HEIGHTMAP_DIR , OLD_GM_DIR , OLD_DATA_DIR , BASESET_DIR , NEWGRF_DIR , LANG_DIR , AI_DIR , AI_LIBRARY_DIR , GAME_DIR , GAME_LIBRARY_DIR , SCREENSHOT_DIR , SOCIAL_INTEGRATION_DIR , DOCS_DIR , NUM_SUBDIRS , NO_DIRECTORY }
| The different kinds of subdirectories OpenTTD uses. More...
enum | Searchpath : uint8_t { SP_FIRST_DIR , SP_WORKING_DIR = SP_FIRST_DIR , SP_PERSONAL_DIR , SP_SHARED_DIR , SP_BINARY_DIR , SP_INSTALLATION_DIR , SP_APPLICATION_BUNDLE_DIR , SP_AUTODOWNLOAD_DIR , SP_AUTODOWNLOAD_PERSONAL_DIR , SP_AUTODOWNLOAD_PERSONAL_DIR_XDG , NUM_SEARCHPATHS }
| Types of searchpaths OpenTTD might use. More...

## Variables
constexpr FiosType | FIOS_TYPE_DRIVE {FT_NONE, DFT_FIOS_DRIVE}
constexpr FiosType | FIOS_TYPE_PARENT {FT_NONE, DFT_FIOS_PARENT}
constexpr FiosType | FIOS_TYPE_DIR {FT_NONE, DFT_FIOS_DIR}
constexpr FiosType | FIOS_TYPE_DIRECT {FT_NONE, DFT_FIOS_DIRECT}
constexpr FiosType | FIOS_TYPE_FILE {FT_SAVEGAME, DFT_GAME_FILE}
constexpr FiosType | FIOS_TYPE_OLDFILE {FT_SAVEGAME, DFT_OLD_GAME_FILE}
constexpr FiosType | FIOS_TYPE_SCENARIO {FT_SCENARIO, DFT_GAME_FILE}
constexpr FiosType | FIOS_TYPE_OLD_SCENARIO {FT_SCENARIO, DFT_OLD_GAME_FILE}
constexpr FiosType | FIOS_TYPE_PNG {FT_HEIGHTMAP, DFT_HEIGHTMAP_PNG}
constexpr FiosType | FIOS_TYPE_BMP {FT_HEIGHTMAP, DFT_HEIGHTMAP_BMP}
constexpr FiosType | FIOS_TYPE_JSON {FT_TOWN_DATA, DFT_TOWN_DATA_JSON}
constexpr FiosType | FIOS_TYPE_INVALID {FT_INVALID, DFT_INVALID}

## Detailed Description

Types for Standard In/Out file operations.

Definition in file fileio_type.h.

## Enumeration Type Documentation

## ◆ AbstractFileType

enum AbstractFileType : uint8_t

The different abstract types of files that the system knows about.

Enumerator
FT_NONE | nothing to do
FT_SAVEGAME | old or new savegame
FT_SCENARIO | old or new scenario
FT_HEIGHTMAP | heightmap file
FT_TOWN_DATA | town data file
FT_INVALID | Invalid or unknown file type.

Definition at line 17 of file fileio_type.h.

## ◆ DetailedFileType

enum DetailedFileType : uint8_t

Kinds of files in each AbstractFileType.

Enumerator
DFT_OLD_GAME_FILE | Old save game or scenario file.
DFT_GAME_FILE | Save game or scenario file.
DFT_HEIGHTMAP_BMP | BMP file.
DFT_HEIGHTMAP_PNG | PNG file.
DFT_TOWN_DATA_JSON | JSON file.
DFT_FIOS_DRIVE | A drive (letter) entry.
DFT_FIOS_PARENT | A parent directory entry.
DFT_FIOS_DIR | A directory entry.
DFT_FIOS_DIRECT | Direct filename.
DFT_END | End of this enum. Supports a compile time size check against _fios_colours in fios_gui.cpp.
DFT_INVALID | Unknown or invalid file.

Definition at line 28 of file fileio_type.h.

## ◆ SaveLoadOperation

enum SaveLoadOperation : uint8_t

Operation performed on the file.

Enumerator
SLO_CHECK | Load file for checking and/or preview.
SLO_LOAD | File is being loaded.
SLO_SAVE | File is being saved.
SLO_INVALID | Unknown file operation.

Definition at line 52 of file fileio_type.h.

## ◆ Searchpath

enum Searchpath : uint8_t

Types of searchpaths OpenTTD might use.

Enumerator
SP_WORKING_DIR | Search in the working directory.
SP_PERSONAL_DIR | Search in the personal directory.
SP_SHARED_DIR | Search in the shared directory, like 'Shared Files' under Windows.
SP_BINARY_DIR | Search in the directory where the binary resides.
SP_INSTALLATION_DIR | Search in the installation directory.
SP_APPLICATION_BUNDLE_DIR | Search within the application bundle.
SP_AUTODOWNLOAD_DIR | Search within the autodownload directory.
SP_AUTODOWNLOAD_PERSONAL_DIR | Search within the autodownload directory located in the personal directory.
SP_AUTODOWNLOAD_PERSONAL_DIR_XDG | Search within the autodownload directory located in the personal directory (XDG variant)

Definition at line 113 of file fileio_type.h.

## ◆ Subdirectory

enum Subdirectory : uint8_t

The different kinds of subdirectories OpenTTD uses.

Enumerator
BASE_DIR | Base directory for all subdirectories.
SAVE_DIR | Base directory for all savegames.
AUTOSAVE_DIR | Subdirectory of save for autosaves.
SCENARIO_DIR | Base directory for all scenarios.
HEIGHTMAP_DIR | Subdirectory of scenario for heightmaps.
OLD_GM_DIR | Old subdirectory for the music.
OLD_DATA_DIR | Old subdirectory for the data.
BASESET_DIR | Subdirectory for all base data (base sets, intro game)
NEWGRF_DIR | Subdirectory for all NewGRFs.
LANG_DIR | Subdirectory for all translation files.
AI_DIR | Subdirectory for all AI files.
AI_LIBRARY_DIR | Subdirectory for all AI libraries.
GAME_DIR | Subdirectory for all game scripts.
GAME_LIBRARY_DIR | Subdirectory for all GS libraries.
SCREENSHOT_DIR | Subdirectory for all screenshots.
SOCIAL_INTEGRATION_DIR | Subdirectory for all social integration plugins.
DOCS_DIR | Subdirectory for documentation.
NUM_SUBDIRS | Number of subdirectories.
NO_DIRECTORY | A path without any base directory.

Definition at line 88 of file fileio_type.h.

## Variable Documentation

## ◆ FIOS_TYPE_BMP

constexpr FiosType FIOS_TYPE_BMP {FT_HEIGHTMAP, DFT_HEIGHTMAP_BMP}
| constexpr

Definition at line 80 of file fileio_type.h.

## ◆ FIOS_TYPE_DIR

constexpr FiosType FIOS_TYPE_DIR {FT_NONE, DFT_FIOS_DIR}
| constexpr

Definition at line 72 of file fileio_type.h.

## ◆ FIOS_TYPE_DIRECT

constexpr FiosType FIOS_TYPE_DIRECT {FT_NONE, DFT_FIOS_DIRECT}
| constexpr

Definition at line 73 of file fileio_type.h.

## ◆ FIOS_TYPE_DRIVE

constexpr FiosType FIOS_TYPE_DRIVE {FT_NONE, DFT_FIOS_DRIVE}
| constexpr

Definition at line 70 of file fileio_type.h.

## ◆ FIOS_TYPE_FILE

constexpr FiosType FIOS_TYPE_FILE {FT_SAVEGAME, DFT_GAME_FILE}
| constexpr

Definition at line 75 of file fileio_type.h.

## ◆ FIOS_TYPE_INVALID

constexpr FiosType FIOS_TYPE_INVALID {FT_INVALID, DFT_INVALID}
| constexpr

Definition at line 83 of file fileio_type.h.

## ◆ FIOS_TYPE_JSON

constexpr FiosType FIOS_TYPE_JSON {FT_TOWN_DATA, DFT_TOWN_DATA_JSON}
| constexpr

Definition at line 81 of file fileio_type.h.

## ◆ FIOS_TYPE_OLD_SCENARIO

constexpr FiosType FIOS_TYPE_OLD_SCENARIO {FT_SCENARIO, DFT_OLD_GAME_FILE}
| constexpr

Definition at line 78 of file fileio_type.h.

## ◆ FIOS_TYPE_OLDFILE

constexpr FiosType FIOS_TYPE_OLDFILE {FT_SAVEGAME, DFT_OLD_GAME_FILE}
| constexpr

Definition at line 76 of file fileio_type.h.

## ◆ FIOS_TYPE_PARENT

constexpr FiosType FIOS_TYPE_PARENT {FT_NONE, DFT_FIOS_PARENT}
| constexpr

Definition at line 71 of file fileio_type.h.

## ◆ FIOS_TYPE_PNG

constexpr FiosType FIOS_TYPE_PNG {FT_HEIGHTMAP, DFT_HEIGHTMAP_PNG}
| constexpr

Definition at line 79 of file fileio_type.h.

## ◆ FIOS_TYPE_SCENARIO

constexpr FiosType FIOS_TYPE_SCENARIO {FT_SCENARIO, DFT_GAME_FILE}
| constexpr

Definition at line 77 of file fileio_type.h.