aboutsummaryrefslogtreecommitdiff
path: root/base
diff options
context:
space:
mode:
authorMax Horn2008-09-30 16:34:38 +0000
committerMax Horn2008-09-30 16:34:38 +0000
commit73b833042e55959954d78b3e6aa2cc89c5b8848d (patch)
tree6084627a0c643a514186b2cbef439b971c322e22 /base
parent1d7de023d938078767a7c5b478769d5a4f308721 (diff)
downloadscummvm-rg350-73b833042e55959954d78b3e6aa2cc89c5b8848d.tar.gz
scummvm-rg350-73b833042e55959954d78b3e6aa2cc89c5b8848d.tar.bz2
scummvm-rg350-73b833042e55959954d78b3e6aa2cc89c5b8848d.zip
Modified FilePluginProvider to use FSNodes (instead of raw filenames / paths) in its API
svn-id: r34709
Diffstat (limited to 'base')
-rw-r--r--base/plugins.cpp8
-rw-r--r--base/plugins.h13
2 files changed, 12 insertions, 9 deletions
diff --git a/base/plugins.cpp b/base/plugins.cpp
index 7b372587a1..7af758754b 100644
--- a/base/plugins.cpp
+++ b/base/plugins.cpp
@@ -231,8 +231,8 @@ PluginList FilePluginProvider::getPlugins() {
}
for (Common::FSList::const_iterator i = files.begin(); i != files.end(); ++i) {
- if (isPluginFilename(i->getName())) {
- pl.push_back(createPlugin(i->getPath()));
+ if (isPluginFilename(*i)) {
+ pl.push_back(createPlugin(*i));
}
}
}
@@ -240,7 +240,9 @@ PluginList FilePluginProvider::getPlugins() {
return pl;
}
-bool FilePluginProvider::isPluginFilename(const Common::String &filename) const {
+bool FilePluginProvider::isPluginFilename(const Common::FilesystemNode &node) const {
+ Common::String filename = node.getName();
+
#ifdef PLUGIN_PREFIX
// Check the plugin prefix
if (!filename.hasPrefix(PLUGIN_PREFIX))
diff --git a/base/plugins.h b/base/plugins.h
index 90c4469e4d..10fbc7d5e0 100644
--- a/base/plugins.h
+++ b/base/plugins.h
@@ -32,6 +32,7 @@
namespace Common {
class FSList;
+ class FilesystemNode;
}
@@ -238,19 +239,19 @@ protected:
* Subclasses of FilePluginProvider have to at least overload this method.
* If the file is not found, or does not contain loadable code, 0 is returned instead.
*
- * @param filename the name of the loadable code module
+ * @param node the FSNode of the loadable code module
* @return a pointer to a Plugin instance, or 0 if an error occurred.
*/
- virtual Plugin *createPlugin(const Common::String &filename) const = 0;
+ virtual Plugin *createPlugin(const Common::FilesystemNode &node) const = 0;
/**
- * Check if the supplied filename corresponds to a loadable plugin file in
- * the current platform.
+ * Check if the supplied file corresponds to a loadable plugin file in
+ * the current platform. Usually, this will just check the file name.
*
- * @param filename the name of the file to check
+ * @param node the FSNode of the file to check
* @return true if the filename corresponds to a plugin, false otherwise
*/
- virtual bool isPluginFilename(const Common::String &filename) const;
+ virtual bool isPluginFilename(const Common::FilesystemNode &node) const;
/**
* Optionally add to the list of directories to be searched for