OpenCPN Partial API docs
Loading...
Searching...
No Matches
PluginHandler Class Reference

Public Member Functions

bool isPluginWritable (std::string name)
 Check if given plugin can be installed/updated. More...
 
const std::vector< PluginMetadatagetInstalled ()
 Return list of all installed plugins. More...
 
const std::vector< PluginMetadatagetAvailable ()
 Return list of available, not installed plugins. More...
 
const std::map< std::string, int > getCountByTarget ()
 Map of available plugin targets -> number of occurences. More...
 
std::string getMetadataPath ()
 Return path to metadata XML file. More...
 
void setMetadata (std::string path)
 Set path to metadata XML file. More...
 
bool installPlugin (PluginMetadata plugin)
 Download and install a new, not installed plugin. More...
 
bool installPlugin (PluginMetadata plugin, std::string path)
 Install a new, downloaded but not installed plugin tarball. More...
 
bool installPlugin (std::string path)
 Install a new, downloaded but not installed plugin tarball. More...
 
bool uninstall (const std::string plugin)
 Uninstall an installed plugin. More...
 
bool installPluginFromCache (PluginMetadata plugin)
 Install plugin tarball from local cache. More...
 
std::string getLastErrorMsg ()
 
CatalogDataGetCatalogData ()
 

Static Public Member Functions

static PluginHandlergetInstance ()
 
static void cleanup (const std::string &filelist, const std::string &plugname)
 Cleanup failed installation attempt using filelist for plugin. More...
 
static void cleanupFiles (const std::string &manifestFile, const std::string &plugname)
 
static std::string fileListPath (std::string name)
 Return path to installation manifest for given plugin. More...
 
static std::string versionPath (std::string name)
 Return path to file containing version for given plugin. More...
 
static bool isCompatible (const PluginMetadata &metadata, const char *os=PKG_TARGET, const char *os_version=PKG_TARGET_VERSION)
 Return true if given plugin is loadable on given os/version. More...
 

Public Attributes

EventVar evt_download_ok
 
EventVar evt_download_failed
 

Detailed Description

Definition at line 87 of file plugin_handler.h.

Constructor & Destructor Documentation

◆ PluginHandler()

PluginHandler::PluginHandler ( )
protected

Definition at line 284 of file plugin_handler.cpp.

Member Function Documentation

◆ cleanup()

void PluginHandler::cleanup ( const std::string &  filelist,
const std::string &  plugname 
)
static

Cleanup failed installation attempt using filelist for plugin.

Definition at line 868 of file plugin_handler.cpp.

◆ cleanupFiles()

void PluginHandler::cleanupFiles ( const std::string &  manifestFile,
const std::string &  plugname 
)
static

Definition at line 858 of file plugin_handler.cpp.

◆ fileListPath()

std::string PluginHandler::fileListPath ( std::string  name)
static

Return path to installation manifest for given plugin.

Definition at line 279 of file plugin_handler.cpp.

◆ getAvailable()

const std::vector< PluginMetadata > PluginHandler::getAvailable ( )

Return list of available, not installed plugins.

Definition at line 916 of file plugin_handler.cpp.

◆ GetCatalogData()

CatalogData * PluginHandler::GetCatalogData ( )
inline

Definition at line 146 of file plugin_handler.h.

◆ getCountByTarget()

const std::map< std::string, int > PluginHandler::getCountByTarget ( )

Map of available plugin targets -> number of occurences.

Definition at line 839 of file plugin_handler.cpp.

◆ getInstalled()

const std::vector< PluginMetadata > PluginHandler::getInstalled ( )

Return list of all installed plugins.

Definition at line 946 of file plugin_handler.cpp.

◆ getInstance()

PluginHandler * PluginHandler::getInstance ( )
static

Definition at line 772 of file plugin_handler.cpp.

◆ getLastErrorMsg()

std::string PluginHandler::getLastErrorMsg ( )
inline

Definition at line 144 of file plugin_handler.h.

◆ getMetadataPath()

std::string PluginHandler::getMetadataPath ( )

Return path to metadata XML file.

Definition at line 815 of file plugin_handler.cpp.

◆ installPlugin() [1/3]

bool PluginHandler::installPlugin ( PluginMetadata  plugin)

Download and install a new, not installed plugin.

Definition at line 990 of file plugin_handler.cpp.

◆ installPlugin() [2/3]

bool PluginHandler::installPlugin ( PluginMetadata  plugin,
std::string  path 
)

Install a new, downloaded but not installed plugin tarball.

Definition at line 973 of file plugin_handler.cpp.

◆ installPlugin() [3/3]

bool PluginHandler::installPlugin ( std::string  path)

Install a new, downloaded but not installed plugin tarball.

Definition at line 1009 of file plugin_handler.cpp.

◆ installPluginFromCache()

bool PluginHandler::installPluginFromCache ( PluginMetadata  plugin)

Install plugin tarball from local cache.

Definition at line 1102 of file plugin_handler.cpp.

◆ isCompatible()

bool PluginHandler::isCompatible ( const PluginMetadata metadata,
const char *  os = PKG_TARGET,
const char *  os_version = PKG_TARGET_VERSION 
)
static

Return true if given plugin is loadable on given os/version.

Definition at line 286 of file plugin_handler.cpp.

◆ isPluginWritable()

bool PluginHandler::isPluginWritable ( std::string  name)

Check if given plugin can be installed/updated.

Definition at line 780 of file plugin_handler.cpp.

◆ setMetadata()

void PluginHandler::setMetadata ( std::string  path)
inline

Set path to metadata XML file.

Definition at line 127 of file plugin_handler.h.

◆ uninstall()

bool PluginHandler::uninstall ( const std::string  plugin)

Uninstall an installed plugin.

Definition at line 1038 of file plugin_handler.cpp.

◆ versionPath()

std::string PluginHandler::versionPath ( std::string  name)
static

Return path to file containing version for given plugin.

Definition at line 316 of file plugin_handler.cpp.

Member Data Documentation

◆ evt_download_failed

EventVar PluginHandler::evt_download_failed

Definition at line 91 of file plugin_handler.h.

◆ evt_download_ok

EventVar PluginHandler::evt_download_ok

Definition at line 90 of file plugin_handler.h.


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