2008-08-31 12:50:05 +02:00
|
|
|
/* $Id$ */
|
|
|
|
|
2009-08-21 22:21:05 +02:00
|
|
|
/*
|
|
|
|
* This file is part of OpenTTD.
|
|
|
|
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
|
|
|
|
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2008-08-31 12:50:05 +02:00
|
|
|
/** @file fileio_type.h Types for Standard In/Out file operations */
|
|
|
|
|
|
|
|
#ifndef FILEIO_TYPE_H
|
|
|
|
#define FILEIO_TYPE_H
|
|
|
|
|
|
|
|
#include "core/enum_type.hpp"
|
|
|
|
|
2016-09-04 14:46:07 +02:00
|
|
|
/** The different abstract types of files that the system knows about. */
|
|
|
|
enum AbstractFileType {
|
|
|
|
FT_NONE, ///< nothing to do
|
|
|
|
FT_SAVEGAME, ///< old or new savegame
|
|
|
|
FT_SCENARIO, ///< old or new scenario
|
|
|
|
FT_HEIGHTMAP, ///< heightmap file
|
2016-09-04 14:47:39 +02:00
|
|
|
|
|
|
|
FT_INVALID = 7, ///< Invalid or unknown file type.
|
2016-09-04 14:46:07 +02:00
|
|
|
};
|
|
|
|
|
2016-09-04 14:56:23 +02:00
|
|
|
/** Operation performed on the file. */
|
|
|
|
enum FileOperation {
|
|
|
|
FOP_LOAD, ///< File is being loaded.
|
|
|
|
FOP_SAVE, ///< File is being saved.
|
|
|
|
};
|
|
|
|
|
2016-09-04 14:47:07 +02:00
|
|
|
/** Elements of a file system that are recognized. */
|
|
|
|
enum FiosType {
|
|
|
|
FIOS_TYPE_DRIVE,
|
|
|
|
FIOS_TYPE_PARENT,
|
|
|
|
FIOS_TYPE_DIR,
|
|
|
|
FIOS_TYPE_FILE,
|
|
|
|
FIOS_TYPE_OLDFILE,
|
|
|
|
FIOS_TYPE_SCENARIO,
|
|
|
|
FIOS_TYPE_OLD_SCENARIO,
|
|
|
|
FIOS_TYPE_DIRECT,
|
|
|
|
FIOS_TYPE_PNG,
|
|
|
|
FIOS_TYPE_BMP,
|
|
|
|
FIOS_TYPE_INVALID = 255,
|
|
|
|
};
|
|
|
|
|
2008-08-31 12:50:05 +02:00
|
|
|
/**
|
|
|
|
* The different kinds of subdirectories OpenTTD uses
|
|
|
|
*/
|
|
|
|
enum Subdirectory {
|
|
|
|
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
|
2011-11-14 22:34:27 +01:00
|
|
|
OLD_GM_DIR, ///< Old subdirectory for the music
|
|
|
|
OLD_DATA_DIR, ///< Old subdirectory for the data.
|
2011-08-24 15:33:49 +02:00
|
|
|
BASESET_DIR, ///< Subdirectory for all base data (base sets, intro game)
|
|
|
|
NEWGRF_DIR, ///< Subdirectory for all NewGRFs
|
2008-08-31 12:50:05 +02:00
|
|
|
LANG_DIR, ///< Subdirectory for all translation files
|
2012-01-01 18:22:32 +01:00
|
|
|
AI_DIR, ///< Subdirectory for all %AI files
|
|
|
|
AI_LIBRARY_DIR,///< Subdirectory for all %AI libraries
|
2011-12-19 21:54:37 +01:00
|
|
|
GAME_DIR, ///< Subdirectory for all game scripts
|
2011-12-19 21:56:59 +01:00
|
|
|
GAME_LIBRARY_DIR, ///< Subdirectory for all GS libraries
|
2012-12-09 17:52:43 +01:00
|
|
|
SCREENSHOT_DIR, ///< Subdirectory for all screenshots
|
2008-08-31 12:50:05 +02:00
|
|
|
NUM_SUBDIRS, ///< Number of subdirectories
|
|
|
|
NO_DIRECTORY, ///< A path without any base directory
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Types of searchpaths OpenTTD might use
|
|
|
|
*/
|
|
|
|
enum Searchpath {
|
|
|
|
SP_FIRST_DIR,
|
|
|
|
SP_WORKING_DIR = SP_FIRST_DIR, ///< Search in the working directory
|
2013-11-13 20:32:37 +01:00
|
|
|
#if defined(WITH_XDG_BASEDIR) && defined(WITH_PERSONAL_DIR)
|
|
|
|
SP_PERSONAL_DIR_XDG, ///< Search in the personal directory from the XDG specification
|
|
|
|
#endif
|
2008-08-31 12:50:05 +02:00
|
|
|
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
|
2009-01-17 17:53:32 +01:00
|
|
|
SP_AUTODOWNLOAD_DIR, ///< Search within the autodownload directory
|
2008-08-31 12:50:05 +02:00
|
|
|
NUM_SEARCHPATHS
|
|
|
|
};
|
|
|
|
|
2010-03-23 23:25:43 +01:00
|
|
|
DECLARE_POSTFIX_INCREMENT(Searchpath)
|
2008-08-31 12:50:05 +02:00
|
|
|
|
|
|
|
#endif /* FILEIO_TYPE_H */
|