2009-03-15 22:41:57 +00:00
|
|
|
/* $Id$ */
|
|
|
|
|
2009-08-21 20:21:05 +00: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/>.
|
|
|
|
*/
|
|
|
|
|
2009-03-15 22:41:57 +00:00
|
|
|
/** @file script_scanner.hpp Declarations of the class for the script scanner. */
|
|
|
|
|
|
|
|
#ifndef SCRIPT_SCANNER_HPP
|
|
|
|
#define SCRIPT_SCANNER_HPP
|
|
|
|
|
2011-08-25 10:37:28 +00:00
|
|
|
#include "../fileio_func.h"
|
2009-03-15 22:41:57 +00:00
|
|
|
|
2011-05-01 19:51:52 +00:00
|
|
|
/** Scanner to help finding scripts. */
|
2011-08-25 10:37:28 +00:00
|
|
|
class ScriptScanner : public FileScanner {
|
2009-03-15 22:41:57 +00:00
|
|
|
public:
|
|
|
|
ScriptScanner();
|
|
|
|
~ScriptScanner();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the engine of the main squirrel handler (it indexes all available scripts).
|
|
|
|
*/
|
|
|
|
class Squirrel *GetEngine() { return this->engine; }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the current main script the ScanDir is currently tracking.
|
|
|
|
*/
|
|
|
|
const char *GetMainScript() { return this->main_script; }
|
|
|
|
|
2011-09-08 09:48:52 +00:00
|
|
|
/**
|
|
|
|
* Get the current tar file the ScanDir is currently tracking.
|
|
|
|
*/
|
|
|
|
const char *GetTarFile() { return this->tar_file; }
|
|
|
|
|
|
|
|
/* virtual */ bool AddFile(const char *filename, size_t basepath_length, const char *tar_filename);
|
2009-03-15 22:41:57 +00:00
|
|
|
|
|
|
|
protected:
|
2011-05-01 19:51:52 +00:00
|
|
|
class Squirrel *engine; ///< The engine we're scanning with.
|
2011-08-25 10:37:28 +00:00
|
|
|
char *main_script; ///< The name of the current main script.
|
2011-09-08 09:48:52 +00:00
|
|
|
char *tar_file; ///< The filename of the tar for the main script.
|
2009-03-15 22:41:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* SCRIPT_SCANNER_HPP */
|