|
ReXGlue SDK
|
#include <rex/platform/dynlib.h>
Public Member Functions | |
| DynamicLibrary (DynamicLibrary &&other) noexcept | |
| DynamicLibrary & | operator= (DynamicLibrary &&other) noexcept |
| bool | Load (const std::filesystem::path &path, SymbolResolution mode=SymbolResolution::kLazy) |
| bool | LoadNamed (std::string_view name, SymbolResolution mode=SymbolResolution::kLazy) |
| bool | Attach (const std::filesystem::path &path) |
| void | Close () |
| operator bool () const | |
| void * | GetRawSymbol (const char *name) const |
| template<typename T> | |
| T | GetSymbol (const char *name) const |
| const std::string & | GetLastError () const |
Additional Inherited Members | |
| Protected Member Functions inherited from rex::MoveOnly | |
| MoveOnly (MoveOnly &&)=default | |
| MoveOnly & | operator= (MoveOnly &&)=default |
| MoveOnly (const MoveOnly &)=delete | |
| MoveOnly & | operator= (const MoveOnly &)=delete |
Loads a shared library and resolves symbols from it. Move only.
| bool rex::platform::DynamicLibrary::Attach | ( | const std::filesystem::path & | path | ) |
Opens the library only when the process has it mapped. Closes any held library.
| path | Full path or file name of the library. |
| void rex::platform::DynamicLibrary::Close | ( | ) |
Closes the library. Safe when nothing is loaded.
|
inline |
Returns the OS error text of the last failed Load, empty after a success.
| void * rex::platform::DynamicLibrary::GetRawSymbol | ( | const char * | name | ) | const |
Returns the address of an exported symbol, or null when the library is not loaded or has no such symbol.
|
inline |
Typed form of GetRawSymbol.
| bool rex::platform::DynamicLibrary::Load | ( | const std::filesystem::path & | path, |
| SymbolResolution | mode = SymbolResolution::kLazy ) |
Loads the library at the path, closing any held library.
| mode | Symbol resolution mode. Informational on Windows. |
| bool rex::platform::DynamicLibrary::LoadNamed | ( | std::string_view | name, |
| SymbolResolution | mode = SymbolResolution::kLazy ) |
Loads a library target from the folder rexbase was loaded from, or else from the executable folder, adding the platform prefix and extension. Closes any held library.