From 414c397000935162df4641dbe0c056b39d32205e Mon Sep 17 00:00:00 2001 From: rubidium Date: Thu, 8 Sep 2011 09:48:52 +0000 Subject: (svn r22904) -Codechange: add tar filename to file scanning --- src/script/script_scanner.cpp | 2 +- src/script/script_scanner.hpp | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'src/script') diff --git a/src/script/script_scanner.cpp b/src/script/script_scanner.cpp index 72f1c3b2a..75f4ba074 100644 --- a/src/script/script_scanner.cpp +++ b/src/script/script_scanner.cpp @@ -17,7 +17,7 @@ #include "../script/squirrel.hpp" #include "script_scanner.hpp" -bool ScriptScanner::AddFile(const char *filename, size_t basepath_length) +bool ScriptScanner::AddFile(const char *filename, size_t basepath_length, const char *tar_filename) { free(this->main_script); this->main_script = strdup(filename); diff --git a/src/script/script_scanner.hpp b/src/script/script_scanner.hpp index 2fba6ef5a..f50d05747 100644 --- a/src/script/script_scanner.hpp +++ b/src/script/script_scanner.hpp @@ -30,11 +30,17 @@ public: */ const char *GetMainScript() { return this->main_script; } - /* virtual */ bool AddFile(const char *filename, size_t basepath_length); + /** + * 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); protected: class Squirrel *engine; ///< The engine we're scanning with. char *main_script; ///< The name of the current main script. + char *tar_file; ///< The filename of the tar for the main script. }; #endif /* SCRIPT_SCANNER_HPP */ -- cgit v1.2.3-70-g09d2