plugify  1.0.0.0
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 
11 namespace plugify {
12  class PlugifyProvider;
13  class PlugifyProvider;
14  enum class Severity : uint8_t;
15 
20  class PLUGIFY_API IPlugifyProvider : public Ref<PlugifyProvider> {
21  using Ref::Ref;
22  public:
28  void Log(std::string_view msg, Severity severity) const;
29 
34  std::filesystem::path_view GetBaseDir() const noexcept;
35 
48  bool IsPreferOwnSymbols() const noexcept;
49 
62  bool IsPluginLoaded(std::string_view name, std::optional<int32_t> requiredVersion = {}, bool minimum = false) const noexcept;
63 
76  bool IsModuleLoaded(std::string_view name, std::optional<int32_t> requiredVersion = {}, bool minimum = false) const noexcept;
77  };
78  static_assert(is_ref_v<IPlugifyProvider>);
79 } // 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.
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.