Members of fedem::dso::DSOLoader.
loadAll
static void loadAll( std::string const& extension ); // (1) cwd
static void loadAll( std::string const& extension, std::string const& folder ); // (2)
static void loadAll( std::string const& extension,
std::vector<std::string> const& list ); // (3)
Scans a directory non-recursively, and for each regular file or symlink whose name:
- ends with
extension(e.g.".so"), and - starts with the current
prefix(), if one is set,
calls load on it.
- Scans the current working directory.
- Scans
folder. - Scans each directory in
list.
Files that fail to load are collected. After attempting all of them, if any failed, loadAll throws fedem::exception::FileNotFound naming the failures. A directory that does not exist is skipped silently.
loadAllByEnvironment
static void loadAllByEnvironment( std::string const& extension ); // (1)
static void loadAllByEnvironment( std::string const& extension,
std::string const& env ); // (2)
Reads the environment variable, splits it on the platform path separator (:, or ; on Cygwin), and runs loadAll( extension, dir ) for each entry.
- Uses the platform's library-path variable —
LD_LIBRARY_PATH(Linux),LIBPATH(AIX),SHLIB(HP-UX),PATH(Cygwin). - Uses the variable named by
env.
An unset or empty variable is a no-op.
Parameters
| Name | Description |
|---|---|
extension | Suffix to match, dot included — ".so", ".ffs". |
folder / list | Directory or directories to scan. |
env | Name of the environment variable to read for directories. |
Examples
DSOLoader::prefix( "lib" );
DSOLoader::loadAll( ".so", "/opt/app/plugins" ); // /opt/app/plugins/lib*.so
DSOLoader::loadAll( ".so", { "/opt/app/plugins", "./plugins" } );
DSOLoader::loadAllByEnvironment( ".so", "APP_PLUGIN_PATH" ); // $APP_PLUGIN_PATH dirs
DSOLoader::loadAllByEnvironment( ".ffs" ); // $LD_LIBRARY_PATH dirs
Notes
- The partial-failure throw lets a host load "as many plugins as possible" and then report the gaps: catch the exception, log
e.missingFilename(), carry on. - Set a
prefixto avoid pulling unrelated.sos out of a shared directory like/usr/lib. - Non-recursive by design — point it at a directory that contains only plugins.

