3#include "../core/string.hpp"
18 void *getRawSymbol(
const zpath &symbolName)
noexcept;
41 bool load(const
zpath &fileName,
bool autoExtension = true) noexcept;
85 return reinterpret_cast<T *
>(getRawSymbol(symbolName));
110 template <
typename T>
112 return std::function<T>(
reinterpret_cast<T *
>(getRawSymbol(symbolName)));
A class for loading dynamic libraries.
Definition library.hpp:16
bool unload() noexcept
Unload the dynamic library.
bool good() noexcept
Get whether the library has been loaded.
library() noexcept
Default empty constructor.
bool load(const zpath &fileName, bool autoExtension=true) noexcept
Load a dynamic library with the given file name.
bool bad() noexcept
Get whether the library has not been loaded.
std::function< T > function(const zpath &symbolName) noexcept
Get a pointer to the function with the given name.
Definition library.hpp:111
T * symbol(const zpath &symbolName) noexcept
Get a pointer to the symbol with the given name.
Definition library.hpp:84