15 DynamicLibrary() =
default;
18 DynamicLibrary(
const DynamicLibrary& other) =
delete;
19 DynamicLibrary& operator=(
const DynamicLibrary& other) =
delete;
21 DynamicLibrary(DynamicLibrary && other) =
delete;
22 DynamicLibrary& operator=(DynamicLibrary && other) =
delete;
34 [[nodiscard]]
bool load(
const std::filesystem::path& path);
48 void*
symbol(
const char* name)
const;
59 bool isLoaded()
const {
return m_handle !=
nullptr; }
62 void* m_handle =
nullptr;
void unload()
Unload the library if currently loaded; idempotent.
bool load(const std::filesystem::path &path)
Load the library at path, unloading any loaded before it.
void * symbol(const char *name) const
Resolve name to a symbol address.
static std::string platformName(const std::string &baseName)
Map a base name to its platform filename: "game" -> "game.dll" (Windows) or "libgame....