A plugin finder that search for plugins in some special directories defined by compile time macros. More...
#include <DefaultFinder.h>
Public Member Functions | |
void | addPluginsDir (const std::string &path) |
It adds a new base location where the finder will search for installed plugins. More... | |
DefaultFinder () | |
Constructor. More... | |
void | getDefaultDirs (std::vector< std::string > &dirs) const |
It returns the default plugins directories. More... | |
void | getPlugins (boost::ptr_vector< PluginInfo > &plugins) |
This method searches for installed plugins and output the plugins information in the PluginInfo vector. More... | |
const std::vector< std::string > & | getPluginsDir () const |
It returns the list of plugins base directories. More... | |
~DefaultFinder () | |
Destructor. More... | |
Private Attributes | |
std::vector< std::string > | m_pluginsDir |
The base list of directories to search for plugins. More... | |
A plugin finder that search for plugins in some special directories defined by compile time macros.
This finder will look recursively for plugins in the specified folders.
Definition at line 48 of file DefaultFinder.h.
te::plugin::DefaultFinder::DefaultFinder | ( | ) |
Constructor.
te::plugin::DefaultFinder::~DefaultFinder | ( | ) |
Destructor.
void te::plugin::DefaultFinder::addPluginsDir | ( | const std::string & | path | ) |
It adds a new base location where the finder will search for installed plugins.
path | A new location to search for plugins. It can be an absolute or relative path. |
Exception | If you inform an invalid path it will throw an exception. |
void te::plugin::DefaultFinder::getDefaultDirs | ( | std::vector< std::string > & | dirs | ) | const |
It returns the default plugins directories.
This method will generate directory paths in the following order:
dirs | The default plugin directories (the absolute path) or an empty string if none is found. |
|
virtual |
This method searches for installed plugins and output the plugins information in the PluginInfo vector.
This method performs a recursive search on the base directories extracting all plugins information available on these directories. Actually it looks for XML files with a pre-defined name (TE_DEFAULT_PLUGIN_FILE_NAME) and it will try to get all information available for each plugin.
plugins | A vector to output all information about found plugins. The caller will take the ownership of the pointers in the output vector. |
Implements te::plugin::AbstractFinder.
const std::vector<std::string>& te::plugin::DefaultFinder::getPluginsDir | ( | ) | const |
It returns the list of plugins base directories.
|
private |
The base list of directories to search for plugins.
Definition at line 114 of file DefaultFinder.h.