ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

FilePluginProvider Class Reference

Abstract base class for Plugin factories which load binary code from files. More...

#include <plugins.h>

Inheritance diagram for FilePluginProvider:
Collaboration diagram for FilePluginProvider:

List of all members.

Public Member Functions

virtual PluginList getPlugins ()
 Return a list of Plugin objects loaded via createPlugin from disk.
bool isFilePluginProvider ()

Protected Member Functions

virtual PlugincreatePlugin (const Common::FSNode &node) const =0
 Create a Plugin instance from a loadable code module with the specified name.
virtual bool isPluginFilename (const Common::FSNode &node) const
 Check if the supplied file corresponds to a loadable plugin file in the current platform.
virtual void addCustomDirectories (Common::FSList &dirs) const
 Optionally add to the list of directories to be searched for plugins by getPlugins().

Detailed Description

Abstract base class for Plugin factories which load binary code from files.

Subclasses only have to implement the createPlugin() method, and optionally can overload the other protected methods to achieve custom behavior.

Definition at line 237 of file plugins.h.


Member Function Documentation

void FilePluginProvider::addCustomDirectories ( Common::FSList dirs  )  const [protected, virtual]

Optionally add to the list of directories to be searched for plugins by getPlugins().

Parameters:
dirs the reference to the list of directories to be used when searching for plugins.

Definition at line 210 of file plugins.cpp.

virtual Plugin* FilePluginProvider::createPlugin ( const Common::FSNode node  )  const [protected, pure virtual]

Create a Plugin instance from a loadable code module with the specified name.

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.

Parameters:
node the FSNode of the loadable code module
Returns:
a pointer to a Plugin instance, or 0 if an error occurred.

Implemented in SDLPluginProvider.

PluginList FilePluginProvider::getPlugins (  )  [virtual]

Return a list of Plugin objects loaded via createPlugin from disk.

For this, a list of directories is searched for plugin objects: The current dir and its "plugins" subdirectory (if present), a list of custom search dirs (see addCustomDirectories) and finally the directory specified via the "pluginspath" config variable (if any).

Returns:
a list of Plugin instances

Implements PluginProvider.

Definition at line 152 of file plugins.cpp.

bool FilePluginProvider::isFilePluginProvider (  )  [inline, virtual]
Returns:
whether or not object is a FilePluginProvider.

Reimplemented from PluginProvider.

Definition at line 253 of file plugins.h.

bool FilePluginProvider::isPluginFilename ( const Common::FSNode node  )  const [protected, virtual]

Check if the supplied file corresponds to a loadable plugin file in the current platform.

Usually, this will just check the file name.

Parameters:
node the FSNode of the file to check
Returns:
true if the filename corresponds to a plugin, false otherwise

Definition at line 192 of file plugins.cpp.


The documentation for this class was generated from the following files:


Generated on Sat Jul 20 2019 05:02:15 for ResidualVM by doxygen 1.7.1
curved edge   curved edge