plugify 1.0.0.0
Loading...
Searching...
No Matches
plugify_provider.hpp
1#pragma once
2
3#include <memory>
4#include <plugify/assembly.hpp>
5#include <plugify/path.hpp>
6#include <plugify/reference_wrapper.hpp>
7#include <plugify_export.h>
8#include <string_view>
9#include <unordered_map>
10
11namespace plugify {
12 class PlugifyProvider;
13 class ModuleRef;
14 class PluginRef;
15 enum class Severity : uint8_t;
16
21 using ModuleOpt = std::optional<ModuleRef>;
22
27 using PluginOpt = std::optional<PluginRef>;
28
33 class PLUGIFY_API IPlugifyProvider : public Ref<PlugifyProvider> {
34 using Ref::Ref;
35 public:
41 void Log(std::string_view msg, Severity severity) const;
42
47 std::filesystem::path_view GetBaseDir() const noexcept;
48
61 bool IsPreferOwnSymbols() const noexcept;
62
75 bool IsPluginLoaded(std::string_view name, std::optional<int32_t> requiredVersion = {}, bool minimum = false) const noexcept;
76
89 bool IsModuleLoaded(std::string_view name, std::optional<int32_t> requiredVersion = {}, bool minimum = false) const noexcept;
90
101 PluginOpt FindPlugin(std::string_view name) const noexcept;
102
113 ModuleOpt FindModule(std::string_view name) const noexcept;
114 };
115 static_assert(is_ref_v<IPlugifyProvider>);
116} // namespace plugify
Interface class for the PlugifyProvider, which is provided to the user and implemented in the core....
bool IsModuleLoaded(std::string_view name, std::optional< int32_t > requiredVersion={}, bool minimum=false) const noexcept
Checks if a language module with the specified name is loaded.
PluginOpt FindPlugin(std::string_view name) const noexcept
Finds a plugin by its name.
ModuleOpt FindModule(std::string_view name) const noexcept
Finds a language module by its name.
std::filesystem::path_view GetBaseDir() const noexcept
Get the base directory of the Plugify system.
void Log(std::string_view msg, Severity severity) const
Log a message with a specified severity level.
A lightweight reference wrapper for objects of type T.