Shared library handling (.so on Linux, .dylib on macOS, .dll on Windows).
More...
#include <tsSharedLibrary.h>
|
void | load (const fs::path &filename) |
| Try to load an alternate file if the shared library is not yet loaded.
|
|
void | unload () |
| Force unload, even if permanent.
|
|
Shared library handling (.so on Linux, .dylib on macOS, .dll on Windows).
◆ SharedLibrary()
Constructor: Load a shared library.
- Parameters
-
[in] | filename | Shared library file name. |
[in] | flags | Shared library options. |
[in,out] | report | Where to report errors. |
- See also
- SharedLibraryFlags
◆ ~SharedLibrary()
virtual ts::SharedLibrary::~SharedLibrary |
( |
| ) |
|
|
virtual |
Destructor.
Unload the shared library if permanent was false.
◆ isLoaded()
bool ts::SharedLibrary::isLoaded |
( |
| ) |
const |
|
inline |
Check if the library was successfully loaded.
- Returns
- True if the library was successfully loaded.
◆ errorMessage()
const UString & ts::SharedLibrary::errorMessage |
( |
| ) |
const |
|
inline |
Return a message describing the constructor error.
Useful when isLoaded() == false.
- Returns
- An error message.
◆ fileName()
const fs::path & ts::SharedLibrary::fileName |
( |
| ) |
const |
|
inline |
Return actual file name of shared library.
- Returns
- The actual file name of shared library.
◆ getSymbol()
void * ts::SharedLibrary::getSymbol |
( |
const std::string & |
name | ) |
const |
Get the value of an exported symbol inside the shared library.
- Parameters
-
[in] | name | Symbol name, using 8-bit characters, not Unicode. |
- Returns
- The symbol value or 0 on error. When the symbol is an address, the returned value is a virtual memory address inside the current process.
◆ load()
void ts::SharedLibrary::load |
( |
const fs::path & |
filename | ) |
|
|
protected |
Try to load an alternate file if the shared library is not yet loaded.
- Parameters
-
[in] | filename | Shared library file name. |
The documentation for this class was generated from the following file: