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.
Definition at line 42 of file DefaultFinder.cpp.
References getDefaultDirs(), and m_pluginsDir.
te::plugin::DefaultFinder::~DefaultFinder | ( | ) |
Destructor.
Definition at line 47 of file DefaultFinder.cpp.
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. |
Definition at line 88 of file DefaultFinder.cpp.
References TE_TR.
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. |
Definition at line 51 of file DefaultFinder.cpp.
References te::common::FindInTerraLibPath(), and TE_DEFAULT_PLUGINS_DIR.
Referenced by DefaultFinder().
|
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. |
Exception | This method may throw an exception with something goes wrong during the search. |
Implements te::plugin::AbstractFinder.
Definition at line 108 of file DefaultFinder.cpp.
References te::plugin::GetInstalledPlugin(), TE_DEFAULT_PLUGIN_EXTENSION, and TE_TR.
Referenced by te::plugin::PluginManager::loadAll().
const std::vector< std::string > & te::plugin::DefaultFinder::getPluginsDir | ( | ) | const |
It returns the list of plugins base directories.
Definition at line 103 of file DefaultFinder.cpp.
|
private |
The base list of directories to search for plugins.
Definition at line 114 of file DefaultFinder.h.
Referenced by DefaultFinder().