#pragma once #include "IDownloader.h" #include "IModuleDatabase.h" #include "JSONSerialization.h" #include "ModuleUpdate.h" #include #include #include #include #include #include class ModuleManager { public: ModuleManager(const std::string& appBaseDir, IModuleDatabase& db, IDownloader& downloader) : m_appBaseDir(appBaseDir) , m_db(db) , m_downloader(downloader) {} public: void applyUpdate(const std::string& moduleId, const ModuleUpdate& update); private: void applyUpdate(Module& module, const ModuleUpdate& update); boost::filesystem::path retrieveUpdate(const std::string& updateUrl); std::set extractUpdate(const boost::filesystem::path& archivePath, const std::string& targetPath); private: std::string m_appBaseDir; IModuleDatabase & m_db; IDownloader& m_downloader; };