summaryrefslogtreecommitdiff
path: root/src/fileio_func.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-11-14 21:30:37 +0000
committerrubidium <rubidium@openttd.org>2011-11-14 21:30:37 +0000
commit6d991b3b10bad798f7e2afce1bc806dbdc3ced4b (patch)
tree49c462606a07d3243d66abb82b7467204753b705 /src/fileio_func.h
parent160294ff22a2b30fc75be1977117eac6910bdd82 (diff)
downloadopenttd-6d991b3b10bad798f7e2afce1bc806dbdc3ced4b.tar.xz
(svn r23217) -Codechange: introduce the concept of scanning only in a limited set of sub directories
Diffstat (limited to 'src/fileio_func.h')
-rw-r--r--src/fileio_func.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/fileio_func.h b/src/fileio_func.h
index e4d8cff77..ddc86f692 100644
--- a/src/fileio_func.h
+++ b/src/fileio_func.h
@@ -12,6 +12,7 @@
#ifndef FILEIO_FUNC_H
#define FILEIO_FUNC_H
+#include "core/enum_type.hpp"
#include "fileio_type.h"
void FioSeekTo(size_t pos, int mode);
@@ -92,12 +93,24 @@ public:
class TarScanner : FileScanner {
uint DoScan(Subdirectory sd);
public:
+ /** The mode of tar scanning. */
+ enum Mode {
+ NONE = 0, ///< Scan nothing.
+ BASESET = 1 << 0, ///< Scan for base sets.
+ NEWGRF = 1 << 1, ///< Scan for non-base sets.
+ AI = 1 << 2, ///< Scan for AIs and its libraries.
+ SCENARIO = 1 << 3, ///< Scan for scenarios and heightmaps.
+ ALL = BASESET | NEWGRF | AI | SCENARIO ///< Scan for everything.
+ };
+
/* virtual */ bool AddFile(const char *filename, size_t basepath_length, const char *tar_filename = NULL);
/** Do the scan for Tars. */
- static uint DoScan();
+ static uint DoScan(TarScanner::Mode mode);
};
+DECLARE_ENUM_AS_BIT_SET(TarScanner::Mode)
+
/* Implementation of opendir/readdir/closedir for Windows */
#if defined(WIN32)
#include <windows.h>