// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) // This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Export.hpp #pragma once #ifndef NAZARA_CORE_PLUGINLOADER_HPP #define NAZARA_CORE_PLUGINLOADER_HPP #include #include #include #include #include #include namespace Nz { class PluginInterface; class NAZARA_CORE_API PluginLoader { public: PluginLoader(); PluginLoader(const PluginLoader&) = delete; PluginLoader(PluginLoader&&) = delete; ~PluginLoader() = default; void AddSearchDirectory(const std::filesystem::path& directoryPath); template [[nodiscard]] Plugin Load(bool activate = true); #ifndef NAZARA_PLUGINS_STATIC GenericPlugin Load(const std::filesystem::path& pluginPath, bool activate = true); #endif void RemoveSearchDirectory(const std::filesystem::path& directoryPath); PluginLoader& operator=(const PluginLoader&) = delete; PluginLoader& operator=(PluginLoader&&) = delete; private: using PluginLoadCallback = PluginInterface* (*)(); std::vector m_directories; }; } #include #endif // NAZARA_CORE_PLUGINLOADER_HPP