27 #include "../core/filesystem/FileSystem.h" 28 #include "../core/translator/Translator.h" 29 #include "../core/utils/Platform.h" 35 #include <boost/filesystem.hpp> 36 #include <boost/format.hpp> 73 boost::filesystem::path
p(plgDir);
79 #ifdef TE_PLUGINS_INSTALL_PATH 81 boost::filesystem::path
p(TE_PLUGINS_INSTALL_PATH);
92 throw Exception((boost::format(
TE_TR(
"Default plugin directory is invalid: %1%.")) % path).str());
96 std::string s(p.string());
115 for(std::size_t i = 0; i < ndirs; ++i)
122 for(boost::filesystem::directory_iterator it(path), itEnd; it != itEnd; ++it)
static bool isDirectory(const std::string &path)
Checks if a given path in UTF-8 is a directory.
Base exception class for plugin module.
const std::vector< std::string > & getPluginsDir() const
It returns the list of plugins base directories.
#define TE_TR(message)
It marks a string in order to get translated.
~DefaultFinder()
Destructor.
void getDefaultDirs(std::vector< std::string > &dirs) const
It returns the default plugins directories.
void addPluginsDir(const std::string &path)
It adds a new base location where the finder will search for installed plugins.
static std::string extension(const std::string &path)
Retrives the extension of a given file path in UTF-8.
DefaultFinder()
Constructor.
std::vector< std::string > m_pluginsDir
The base list of directories to search for plugins.
#define TE_DEFAULT_PLUGIN_EXTENSION
The default extension for plugins description files.
static std::string systemCompletePath(const std::string &path)
Composes an absolute path for the given path in UTF-8.
TECOREEXPORT std::string FindInTerraLibPath(const std::string &path)
Returns the path relative to a directory or file in the context of TerraLib.
#define TE_DEFAULT_PLUGINS_DIR
The default look up plugin dir.
static bool isRegularFile(const std::string &path)
Checks if a given path in UTF-8 is a regular file.
void getPlugins(boost::ptr_vector< PluginInfo > &plugins)
This method searches for installed plugins and output the plugins information in the PluginInfo vecto...
TEPLUGINEXPORT PluginInfo * GetInstalledPlugin(const std::string &pluginFilePath)
It returns information about a given plugin provided its plugin configuration file name or dir...