plugify  1.0.0.0
plugify.hpp
1 #pragma once
2 
3 #include <cstdint>
4 #include <filesystem>
5 #include <memory>
6 #include <plugify/config.hpp>
7 #include <plugify/version.hpp>
8 #include <plugify_export.h>
9 #include <span>
10 
11 namespace plugify {
12  class ILogger;
13  class IPlugifyProvider;
14  class IPluginManager;
15  class IPackageManager;
16  enum class Severity : uint8_t;
17 
25  class IPlugify {
26  public:
27  virtual ~IPlugify() = default;
28 
34  virtual bool Initialize(const std::filesystem::path& rootDir = {}) = 0;
35 
39  virtual void Terminate() = 0;
40 
45  virtual bool IsInitialized() const = 0;
46 
52  virtual void SetLogger(std::shared_ptr<ILogger> logger) = 0;
53 
59  virtual void Log(std::string_view msg, Severity severity) = 0;
60 
70  virtual bool AddRepository(std::string_view repository) = 0;
71 
76  virtual std::weak_ptr<IPlugifyProvider> GetProvider() const = 0;
77 
82  virtual std::weak_ptr<IPluginManager> GetPluginManager() const = 0;
83 
88  virtual std::weak_ptr<IPackageManager> GetPackageManager() const = 0;
89 
94  virtual const Config& GetConfig() const = 0;
95 
100  virtual Version GetVersion() const = 0;
101  };
102 
107  PLUGIFY_API std::shared_ptr<IPlugify> MakePlugify();
108 } // namespace plugify
Interface for the Plugify system.
Definition: plugify.hpp:25
virtual bool AddRepository(std::string_view repository)=0
Add a repository to the config.
virtual void SetLogger(std::shared_ptr< ILogger > logger)=0
Set the logger for the Plugify system.
virtual std::weak_ptr< IPlugifyProvider > GetProvider() const =0
Get a weak pointer to the Plugify provider.
virtual void Log(std::string_view msg, Severity severity)=0
Log a message with the specified severity level.
virtual bool IsInitialized() const =0
Check if the Plugify system is initialized.
virtual void Terminate()=0
Terminate the Plugify system.
virtual std::weak_ptr< IPluginManager > GetPluginManager() const =0
Get a weak pointer to the Plugin Manager.
virtual Version GetVersion() const =0
Get the version information of the Plugify system.
virtual const Config & GetConfig() const =0
Get the configuration of the Plugify system.
virtual std::weak_ptr< IPackageManager > GetPackageManager() const =0
Get a weak pointer to the Package Manager.
virtual bool Initialize(const std::filesystem::path &rootDir={})=0
Initialize the Plugify system.
Represents a version number with major, minor, patch, and tweak components.
Definition: version.hpp:10
Represents configuration settings for a program.
Definition: config.hpp:14