plugify 1.0.0.0
Loading...
Searching...
No Matches
plugify_provider.hpp
1#pragma once
2
3#include <memory>
4#include <string_view>
5#include <unordered_map>
6
7#include "assembly.hpp"
8#include "handle.hpp"
9#include "version.hpp"
10#include "path.hpp"
11
12#include <plugify_export.h>
13
14namespace plugify {
15 class PlugifyProvider;
16 class ModuleHandle;
17 class PluginHandle;
18 enum class Severity;
19
24 class PLUGIFY_API IPlugifyProvider : public Handle<PlugifyProvider> {
25 using Handle::Handle;
26 public:
32 void Log(std::string_view msg, Severity severity) const;
33
38 std::filesystem::path_view GetBaseDir() const noexcept;
39
52 bool IsPreferOwnSymbols() const noexcept;
53
66 bool IsPluginLoaded(std::string_view name, std::optional<plg::version> requiredVersion = {}, bool minimum = false) const noexcept;
67
80 bool IsModuleLoaded(std::string_view name, std::optional<plg::version> requiredVersion = {}, bool minimum = false) const noexcept;
81
92 PluginHandle FindPlugin(std::string_view name) const noexcept;
93
104 ModuleHandle FindModule(std::string_view name) const noexcept;
105 };
106} // namespace plugify
A generic handle class that manages a pointer to an object of type T.
Definition handle.hpp:18
Wrapper handle for the PlugifyProvider, which is provided to the user and implemented in the core.
bool IsModuleLoaded(std::string_view name, std::optional< plg::version > requiredVersion={}, bool minimum=false) const noexcept
Checks if a language module with the specified name is loaded.
PluginHandle FindPlugin(std::string_view name) const noexcept
Finds a plugin by its name.
std::filesystem::path_view GetBaseDir() const noexcept
Get the base directory of the Plugify system.
ModuleHandle FindModule(std::string_view name) const noexcept
Finds a language module by its name.
void Log(std::string_view msg, Severity severity) const
Log a message with a specified severity level.
Handle wrapper to access language module's information.
Definition module.hpp:39
Handle wrapper to access plugin's information.
Definition plugin.hpp:46