csPluginLoader Class Reference (Crystal Space 2.0 Public API Reference)

| ## Public API Reference

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions
csPluginLoader Class Reference

This utility class helps to load plugins based on request, config file, and commandline. More...

`#include <csutil/plugldr.h>`

List of all members.

## Public Member Functions
void | AddCommandLinePlugins (iCommandLineParser *commandLine)
| Add plugins from command line.
void | AddConfigurationPlugins (iConfigFile *config, const char *prefix)
| Add plugins from configuration.
| csPluginLoader (iObjectRegistry *object_reg)
| Initialize.
bool | LoadPlugins ()
| Load the plugins.
bool | ReplaceRequestedPlugin (const char *pluginName, const char *tagName)
| Replace a tag that was requested earlier with the given plugin, or add the plugin and tag.
void | RequestPlugin (const char *pluginName, const char *tagName)
| A shortcut for requesting to load a plugin (before LoadPlugins()).
virtual | ~csPluginLoader ()
| Deinitialize.

## Detailed Description

This utility class helps to load plugins based on request, config file, and commandline.

Definition at line 41 of file plugldr.h.

## Constructor & Destructor Documentation

csPluginLoader::csPluginLoader | ( | iObjectRegistry * | object_reg | ) |

Initialize.

virtual csPluginLoader::~csPluginLoader | ( |  | ) | `[virtual]`

Deinitialize.

## Member Function Documentation

void csPluginLoader::AddCommandLinePlugins | ( | iCommandLineParser * | commandLine | ) |

Add plugins from command line.

Handles the `-video`, `-canvas` and `-plugin` command line parameters. Previously requested plugins with the tags for these parameters are replaced.

void csPluginLoader::AddConfigurationPlugins | ( | iConfigFile * | config,
|  | const char * | prefix
| ) |  |

Add plugins from configuration.

prefix is the prefix of the configuration keys to scan. The tag name is the key name (minus the prefix), the plugin ID is the associated value. Previously requested plugins with the same tag are replaced.

bool csPluginLoader::LoadPlugins | ( |  | ) |

Load the plugins.

bool csPluginLoader::ReplaceRequestedPlugin | ( | const char * | pluginName,
|  | const char * | tagName
| ) |  |

Replace a tag that was requested earlier with the given plugin, or add the plugin and tag.

Parameters:

  pluginName | Plugin ID of the plugin to load for the tag.
  tagName | Tag to change the plugin of.

Returns:
  `true` if a plugin was requested for tagName and replaced with pluginName; `false` if a new request was added.

void csPluginLoader::RequestPlugin | ( | const char * | pluginName,
|  | const char * | tagName
| ) |  |

A shortcut for requesting to load a plugin (before LoadPlugins()).

If you want this class to register the plugin as a default for some interface then you should use the interface name as the tag name (e.g. 'iGraphics3D').

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

- csutil/plugldr.h