34#include "core_api.hpp"
40
41
45 explicit Library(
void* handle, std::filesystem::path path) : _handle(handle), _path(std::move(path)) {}
48 Library(
const Library&) =
delete;
58 [[nodiscard]]
inline T get_function(
const char* name)
const {
59 return reinterpret_cast<T>(get_function_impl(_handle, name));
71 explicit operator
bool()
const {
return is_loaded(); }
75 std::filesystem::path _path;
79
80
81
82
84 return load_library_impl(std::move(path));
88
89
90
91 inline static bool free_library(
void* library) {
return free_library_impl(library); }
95 static KN_CORE_API
bool free_library_impl(
void* library);
96 static KN_CORE_API
void* get_function_impl(
void* library,
const char* name);
std::filesystem::path get_path() const
Definition os.hpp:66
void * get_os_handle() const
Definition os.hpp:63
bool is_loaded() const
Definition os.hpp:69
static bool free_library(void *library)
Definition os.hpp:91
static Library * load_library(std::filesystem::path path)
Definition os.hpp:83