#include <icy/sharedlibrary.h>Loads a shared library at runtime and resolves exported symbols.
| Return | Name | Description |
|---|---|---|
bool | open inline | Opens a shared library. The filename is in utf-8. Returns true on success and false on error. Call [SharedLibrary::error()](#error-7) to get the error message. |
void | close inline | Closes the shared library. |
bool | sym inline | Retrieves a data pointer from a dynamic library. It is legal for a symbol to map to nullptr. Returns 0 on success and -1 if the symbol was not found. |
void | setError inline | Reads the last libuv dynamic-linker error, stores it in _error, and throws a std::runtime_error with the combined prefix and error message. |
std::string | error const inline | Returns the last error message recorded by setError(). Empty if no error has occurred. |
inline
inline bool open(const std::string & path)Opens a shared library. The filename is in utf-8. Returns true on success and false on error. Call [SharedLibrary::error()](#error-7) to get the error message.
inline
inline void close()Closes the shared library.
inline
inline bool sym(const char * name, void ** ptr)Retrieves a data pointer from a dynamic library. It is legal for a symbol to map to nullptr. Returns 0 on success and -1 if the symbol was not found.
inline
inline void setError(const std::string & prefix)Reads the last libuv dynamic-linker error, stores it in _error, and throws a std::runtime_error with the combined prefix and error message.
prefix Human-readable context string prepended to the error detail.std::runtime_error always.const inline
inline std::string error() constReturns the last error message recorded by setError(). Empty if no error has occurred.
Last error string.
uv_lib_t _libstd::string _error