summaryrefslogtreecommitdiff
path: root/src/fileio.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-08-31 08:38:30 +0000
committerrubidium <rubidium@openttd.org>2008-08-31 08:38:30 +0000
commit1afa473d0f26f56750d899ceaacfcbfbae7d21e0 (patch)
treedefa07ef71e4c84470e000c2117cedd50e808214 /src/fileio.h
parentbb92a7ab08fdd51f2b6902b7cd2b8d4b1427ff39 (diff)
downloadopenttd-1afa473d0f26f56750d899ceaacfcbfbae7d21e0.tar.xz
(svn r14196) -Codechange: make the searching for files with a specific extension extendable.
Diffstat (limited to 'src/fileio.h')
-rw-r--r--src/fileio.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/fileio.h b/src/fileio.h
index 6d4aed2b4..7c8a80221 100644
--- a/src/fileio.h
+++ b/src/fileio.h
@@ -96,4 +96,20 @@ bool FileExists(const char *filename);
extern char *_personal_dir; ///< custom directory for personal settings, saves, newgrf, etc.
+/** Helper for scanning for files with a given name */
+class FileScanner
+{
+public:
+ uint Scan(const char *extension, Subdirectory sd, bool tars = true);
+
+ /**
+ * Add a file with the given filename.
+ * @param filename the full path to the file to read
+ * @param basepath_length amount of characters to chop of before to get a
+ * filename relative to the search path.
+ * @return true if the file is added.
+ */
+ virtual bool AddFile(const char *filename, size_t basepath_length) = 0;
+};
+
#endif /* FILEIO_H */