21#ifndef PCM_TASK_MANAGER_H_
22#define PCM_TASK_MANAGER_H_
29#include <condition_variable>
33#include <nlohmann/json-schema.hpp>
79 const wxString& aRepositoryId,
const bool isUpdate );
135 int downloadFile(
const wxString& aFilePath,
const wxString& aUrl );
148 const wxString& aVersion,
149 const wxString& aRepositoryId,
150 const wxFileName& aFilePath,
151 const bool isUpdate );
161 bool extract(
const wxString& aFilePath,
const wxString& aPackageId,
bool isMultiThreaded );
170 const std::forward_list<wxRegEx>& aKeep = {} );
175 std::shared_ptr<PLUGIN_CONTENT_MANAGER>
m_pcm;
Helper class that handles package (un)installation.
void deletePackageDirectories(const wxString &aPackageId, const std::forward_list< wxRegEx > &aKeep={})
Delete all package files.
SYNC_QUEUE< PCM_TASK > m_install_queue
std::shared_ptr< PLUGIN_CONTENT_MANAGER > m_pcm
SYNC_QUEUE< PCM_TASK > m_download_queue
std::function< STATUS()> PCM_TASK
std::unordered_set< PCM_PACKAGE_TYPE > & GetChangedPackageTypes()
int downloadFile(const wxString &aFilePath, const wxString &aUrl)
Download URL to a file.
PCM_TASK_MANAGER::STATUS DownloadAndInstall(const PCM_PACKAGE &aPackage, const wxString &aVersion, const wxString &aRepositoryId, const bool isUpdate)
Enqueue package download and installation.
bool extract(const wxString &aFilePath, const wxString &aPackageId, bool isMultiThreaded)
Extract package archive.
void RunQueue(wxWindow *aParent)
Run queue of pending actions.
PCM_TASK_MANAGER(std::shared_ptr< PLUGIN_CONTENT_MANAGER > pcm)
std::mutex m_changed_package_types_guard
PCM_TASK_MANAGER::STATUS installDownloadedPackage(const PCM_PACKAGE &aPackage, const wxString &aVersion, const wxString &aRepositoryId, const wxFileName &aFilePath, const bool isUpdate)
Installs downloaded package archive.
std::unique_ptr< DIALOG_PCM_PROGRESS > m_reporter
PCM_TASK_MANAGER::STATUS Uninstall(const PCM_PACKAGE &aPackage)
Enqueue package uninstallation.
PCM_TASK_MANAGER::STATUS InstallFromFile(wxWindow *aParent, const wxString &aFilePath)
Installs package from an archive file on disk.
std::unordered_set< PCM_PACKAGE_TYPE > m_changed_package_types
Synchronized, locking queue.
Repository reference to a resource.