(svn r23217) -Codechange: introduce the concept of scanning only in a limited set of sub directories

This commit is contained in:
rubidium
2011-11-14 21:30:37 +00:00
parent 160294ff22
commit 6d991b3b10
7 changed files with 60 additions and 16 deletions

View File

@@ -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>