mirror of
https://gitlab.com/suyu-emu/suyu.git
synced 2024-03-15 23:15:44 +00:00
common: dynamic_library: Add ctor for existing handle.
This commit is contained in:
parent
e9f35d3260
commit
32cf6beee3
|
@ -22,6 +22,8 @@ DynamicLibrary::DynamicLibrary(const char* filename) {
|
||||||
void(Open(filename));
|
void(Open(filename));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DynamicLibrary::DynamicLibrary(void* handle_) : handle{handle_} {}
|
||||||
|
|
||||||
DynamicLibrary::DynamicLibrary(DynamicLibrary&& rhs) noexcept
|
DynamicLibrary::DynamicLibrary(DynamicLibrary&& rhs) noexcept
|
||||||
: handle{std::exchange(rhs.handle, nullptr)} {}
|
: handle{std::exchange(rhs.handle, nullptr)} {}
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,9 @@ public:
|
||||||
/// Automatically loads the specified library. Call IsOpen() to check validity before use.
|
/// Automatically loads the specified library. Call IsOpen() to check validity before use.
|
||||||
explicit DynamicLibrary(const char* filename);
|
explicit DynamicLibrary(const char* filename);
|
||||||
|
|
||||||
|
/// Initializes the dynamic library with an already opened handle.
|
||||||
|
explicit DynamicLibrary(void* handle_);
|
||||||
|
|
||||||
/// Moves the library.
|
/// Moves the library.
|
||||||
DynamicLibrary(DynamicLibrary&&) noexcept;
|
DynamicLibrary(DynamicLibrary&&) noexcept;
|
||||||
DynamicLibrary& operator=(DynamicLibrary&&) noexcept;
|
DynamicLibrary& operator=(DynamicLibrary&&) noexcept;
|
||||||
|
|
Loading…
Reference in a new issue