Representation of an application shared library.
More...
#include <tsApplicationSharedLibrary.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.
|
|
Representation of an application shared library.
◆ ApplicationSharedLibrary()
Constructor.
- Parameters
-
[in] | filename | Shared library file name. Directory and suffix are optional. If filename contains a directory, the specified file is used directly, with and without suffix (.so, .dll). If filename is just a name without directory, search the file in a list of directories as defined in GetSearchPath(). In each directory, a file with prefix is searched. Then, if not found, without prefix. Finally, when everything failed, filename is searched with the default system lookup mechanism. |
[in] | prefix | Prefix to add to filename if the file is not found. |
[in] | library_path | Name of an environment variable, an optional list of directories to search, similar to LD_LIBRARY_PATH . |
[in] | flags | Shared library options. |
[in,out] | report | Where to report errors. |
- See also
- GetSearchPath()
◆ moduleName()
UString ts::ApplicationSharedLibrary::moduleName |
( |
| ) |
const |
The module name is derived from the file name without the prefix.
- Returns
- The module name.
◆ prefix()
UString ts::ApplicationSharedLibrary::prefix |
( |
| ) |
const |
|
inline |
Get the prefix.
- Returns
- The file name prefix.
◆ GetSearchPath()
static void ts::ApplicationSharedLibrary::GetSearchPath |
( |
UStringList & |
directories, |
|
|
const UString & |
library_path = UString() |
|
) |
| |
|
static |
Get the list of directories where to search application shared libraries or plugins.
The ordered list of directories is:
- All directories in library_path environment variable (if the name is not empty).
- Directory of the current executable.
- Directories ../lib64/tsduck and ../lib64 from current executable (64-bit UNIX only).
- Directories ../lib/tsduck and ../lib from current executable (UNIX only).
- All directories in Path% environment variable (Windows only).
- Parameters
-
[out] | directories | List of directories in search order. |
[in] | library_path | Name of an environment variable, an optional list of directories to search, similar to LD_LIBRARY_PATH . |
◆ GetPluginList()
Get a list of plugins.
- Parameters
-
[out] | files | List of shared library files. |
[in] | prefix | Prefix for plugin names. |
[in] | library_path | Name of an environment variable, an optional list of directories to search, similar to LD_LIBRARY_PATH . |
◆ isLoaded()
bool ts::SharedLibrary::isLoaded |
( |
| ) |
const |
|
inlineinherited |
Check if the library was successfully loaded.
- Returns
- True if the library was successfully loaded.
◆ errorMessage()
const UString & ts::SharedLibrary::errorMessage |
( |
| ) |
const |
|
inlineinherited |
Return a message describing the constructor error.
Useful when isLoaded() == false.
- Returns
- An error message.
◆ fileName()
const fs::path & ts::SharedLibrary::fileName |
( |
| ) |
const |
|
inlineinherited |
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 |
|
inherited |
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 | ) |
|
|
protectedinherited |
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: