From 73b833042e55959954d78b3e6aa2cc89c5b8848d Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 30 Sep 2008 16:34:38 +0000 Subject: Modified FilePluginProvider to use FSNodes (instead of raw filenames / paths) in its API svn-id: r34709 --- backends/plugins/dc/dc-provider.cpp | 8 +++++--- backends/plugins/dc/dc-provider.h | 4 ++-- backends/plugins/posix/posix-provider.cpp | 5 +++-- backends/plugins/posix/posix-provider.h | 2 +- backends/plugins/sdl/sdl-provider.cpp | 5 +++-- backends/plugins/sdl/sdl-provider.h | 2 +- backends/plugins/win32/win32-provider.cpp | 8 +++++--- backends/plugins/win32/win32-provider.h | 4 ++-- 8 files changed, 22 insertions(+), 16 deletions(-) (limited to 'backends/plugins') diff --git a/backends/plugins/dc/dc-provider.cpp b/backends/plugins/dc/dc-provider.cpp index 9b150c8db4..742683d7fb 100644 --- a/backends/plugins/dc/dc-provider.cpp +++ b/backends/plugins/dc/dc-provider.cpp @@ -27,6 +27,7 @@ #include "backends/plugins/dc/dc-provider.h" #include "backends/plugins/dynamic-plugin.h" +#include "common/fs.h" #include "dcloader.h" @@ -83,12 +84,13 @@ public: }; -Plugin* DCPluginProvider::createPlugin(const Common::String &filename) const { - return new DCPlugin(filename); +Plugin* DCPluginProvider::createPlugin(const Common::FilesystemNode &node) const { + return new DCPlugin(node.getPath()); } -bool DCPluginProvider::isPluginFilename(const Common::String &filename) const { +bool DCPluginProvider::isPluginFilename(const Common::FilesystemNode &node) const { // Check the plugin suffix + Common::String filename = node.getName(); if (!filename.hasSuffix(".PLG")) return false; diff --git a/backends/plugins/dc/dc-provider.h b/backends/plugins/dc/dc-provider.h index f413061828..7a204698b8 100644 --- a/backends/plugins/dc/dc-provider.h +++ b/backends/plugins/dc/dc-provider.h @@ -32,9 +32,9 @@ class DCPluginProvider : public FilePluginProvider { protected: - Plugin* createPlugin(const Common::String &filename) const; + Plugin* createPlugin(const Common::FilesystemNode &node) const; - bool isPluginFilename(const Common::String &filename) const; + bool isPluginFilename(const Common::FilesystemNode &node) const; virtual void addCustomDirectories(Common::StringList &dirs) const { dirs.push_back("/"); diff --git a/backends/plugins/posix/posix-provider.cpp b/backends/plugins/posix/posix-provider.cpp index 39847e53bf..ec67e5768a 100644 --- a/backends/plugins/posix/posix-provider.cpp +++ b/backends/plugins/posix/posix-provider.cpp @@ -27,6 +27,7 @@ #include "backends/plugins/posix/posix-provider.h" #include "backends/plugins/dynamic-plugin.h" +#include "common/fs.h" #include <dlfcn.h> @@ -78,8 +79,8 @@ public: }; -Plugin* POSIXPluginProvider::createPlugin(const Common::String &filename) const { - return new POSIXPlugin(filename); +Plugin* POSIXPluginProvider::createPlugin(const Common::FilesystemNode &node) const { + return new POSIXPlugin(node.getPath()); } diff --git a/backends/plugins/posix/posix-provider.h b/backends/plugins/posix/posix-provider.h index 40c16b3e11..6cdc0f44d4 100644 --- a/backends/plugins/posix/posix-provider.h +++ b/backends/plugins/posix/posix-provider.h @@ -32,7 +32,7 @@ class POSIXPluginProvider : public FilePluginProvider { protected: - Plugin* createPlugin(const Common::String &filename) const; + Plugin* createPlugin(const Common::FilesystemNode &node) const; }; #endif // defined(DYNAMIC_MODULES) && defined(UNIX) diff --git a/backends/plugins/sdl/sdl-provider.cpp b/backends/plugins/sdl/sdl-provider.cpp index 6df1dec680..221292e2dd 100644 --- a/backends/plugins/sdl/sdl-provider.cpp +++ b/backends/plugins/sdl/sdl-provider.cpp @@ -27,6 +27,7 @@ #include "backends/plugins/sdl/sdl-provider.h" #include "backends/plugins/dynamic-plugin.h" +#include "common/fs.h" #include "SDL.h" #include "SDL_loadso.h" @@ -78,8 +79,8 @@ public: }; -Plugin* SDLPluginProvider::createPlugin(const Common::String &filename) const { - return new SDLPlugin(filename); +Plugin* SDLPluginProvider::createPlugin(const Common::FilesystemNode &node) const { + return new SDLPlugin(node.getPath()); } diff --git a/backends/plugins/sdl/sdl-provider.h b/backends/plugins/sdl/sdl-provider.h index a9ec657e33..27fb446146 100644 --- a/backends/plugins/sdl/sdl-provider.h +++ b/backends/plugins/sdl/sdl-provider.h @@ -32,7 +32,7 @@ class SDLPluginProvider : public FilePluginProvider { protected: - Plugin* createPlugin(const Common::String &filename) const; + Plugin* createPlugin(const Common::FilesystemNode &node) const; }; #endif // defined(DYNAMIC_MODULES) && defined(UNIX) diff --git a/backends/plugins/win32/win32-provider.cpp b/backends/plugins/win32/win32-provider.cpp index b8fdd3d802..0309d306af 100644 --- a/backends/plugins/win32/win32-provider.cpp +++ b/backends/plugins/win32/win32-provider.cpp @@ -27,6 +27,7 @@ #include "backends/plugins/win32/win32-provider.h" #include "backends/plugins/dynamic-plugin.h" +#include "common/fs.h" #include <windows.h> @@ -96,12 +97,13 @@ public: }; -Plugin* Win32PluginProvider::createPlugin(const Common::String &filename) const { - return new Win32Plugin(filename); +Plugin* Win32PluginProvider::createPlugin(const Common::FilesystemNode &node) const { + return new Win32Plugin(node.getPath()); } -bool Win32PluginProvider::isPluginFilename(const Common::String &filename) const { +bool Win32PluginProvider::isPluginFilename(const Common::FilesystemNode &node) const { // Check the plugin suffix + Common::String filename = node.getName(); if (!filename.hasSuffix(".dll")) return false; diff --git a/backends/plugins/win32/win32-provider.h b/backends/plugins/win32/win32-provider.h index 4ddc8b7500..1a14c15c14 100644 --- a/backends/plugins/win32/win32-provider.h +++ b/backends/plugins/win32/win32-provider.h @@ -32,9 +32,9 @@ class Win32PluginProvider : public FilePluginProvider { protected: - Plugin* createPlugin(const Common::String &filename) const; + Plugin* createPlugin(const Common::FilesystemNode &node) const; - bool isPluginFilename(const Common::String &filename) const; + bool isPluginFilename(const Common::FilesystemNode &node) const; virtual void addCustomDirectories(Common::StringList &dirs) const {} }; -- cgit v1.2.3