Shared library handling (.so on Linux, .dylib on macOS, .dll on Windows). More...
Public Member Functions | |
SharedLibrary (const UString &filename, SharedLibraryFlags flags=SharedLibraryFlags::NONE, Report &report=(*(static_cast< ts::Report * >(ts::NullReport::Instance())))) | |
Constructor: Load a shared library. More... | |
virtual | ~SharedLibrary () |
Destructor. More... | |
const UString & | errorMessage () const |
Return a message describing the constructor error. More... | |
const UString & | fileName () const |
Return actual file name of shared library. More... | |
void * | getSymbol (const std::string &name) const |
Get the value of an exported symbol inside the shared library. More... | |
bool | isLoaded () const |
Check if the library was successfully loaded. More... | |
Protected Member Functions | |
void | load (const UString &filename) |
Try to load an alternate file if the shared library is not yet loaded. More... | |
void | unload () |
Force unload, even if permanent. | |
Shared library handling (.so on Linux, .dylib on macOS, .dll on Windows).
|
explicit |
Constructor: Load a shared library.
[in] | filename | Shared library file name. |
[in] | flags | Shared library options. |
[in,out] | report | Where to report errors. |
|
virtual |
Destructor.
Unload the shared library if permanent was false.
|
inline |
Check if the library was successfully loaded.
|
inline |
Return a message describing the constructor error.
Useful when isLoaded() == false.
|
inline |
Return actual file name of shared library.
void* ts::SharedLibrary::getSymbol | ( | const std::string & | name | ) | const |
Get the value of an exported symbol inside the shared library.
[in] | name | Symbol name, using 8-bit characters, not Unicode. |
|
protected |
Try to load an alternate file if the shared library is not yet loaded.
[in] | filename | Shared library file name. |