56#ifndef PLUGIN_HANDLER_H__
57#define PLUGIN_HANDLER_H__
66#include <wx/cmdline.h>
70#include "catalog_parser.h"
71#include "observable_evtvar.h"
73bool isRegularFile(
const char* path);
78 std::string name()
const {
return _name; }
79 std::string version()
const {
return _version; }
96 static void cleanup(
const std::string& filelist,
const std::string& plugname);
97 static void cleanupFiles(
const std::string& manifestFile,
98 const std::string& plugname);
108 const char* os = PKG_TARGET,
109 const char* os_version = PKG_TARGET_VERSION);
139 bool uninstall(
const std::string plugin);
144 std::string getLastErrorMsg() {
return last_error_msg; }
146 CatalogData* GetCatalogData() {
return &catalogData; }
152 std::string metadataPath;
153 std::vector<PluginMetadata> installed;
155 std::string last_error_msg;
156 bool explodeTarball(
struct archive* src,
struct archive* dest,
157 std::string& filelist,
158 const std::string& metadata_path);
159 bool extractTarball(
const std::string path, std::string& filelist,
160 const std::string metadata_path =
"");
161 bool archive_check(
int r,
const char* msg,
struct archive* a);
Generic event handling between between two parties like MVC Model and Controller using a shared Event...
const std::vector< PluginMetadata > getInstalled()
Return list of all installed plugins.
void setMetadata(std::string path)
Set path to metadata XML file.
static void cleanup(const std::string &filelist, const std::string &plugname)
Cleanup failed installation attempt using filelist for plugin.
bool installPluginFromCache(PluginMetadata plugin)
Install plugin tarball from local cache.
const std::map< std::string, int > getCountByTarget()
Map of available plugin targets -> number of occurences.
bool isPluginWritable(std::string name)
Check if given plugin can be installed/updated.
static std::string fileListPath(std::string name)
Return path to installation manifest for given plugin.
static std::string versionPath(std::string name)
Return path to file containing version for given plugin.
bool uninstall(const std::string plugin)
Uninstall an installed plugin.
bool installPlugin(PluginMetadata plugin)
Download and install a new, not installed plugin.
std::string getMetadataPath()
Return path to metadata XML file.
const std::vector< PluginMetadata > getAvailable()
Return list of available, not installed plugins.
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.
Datatypes and a single method to parse ocpn-plugins.xml XML data.