Member of fedem::dso::DSOLoader.

static void        prefix( std::string const& pre );   // set
static std::string prefix();                            // get

A process-wide string (static std::string filenamePrefix, initially empty). When non-empty, the directory-scanning loaders (loadAll, loadAllByEnvironment) only consider files whose name begins with it.

It has no effect on the single-file load.

Parameters / return

  • set: pre — the prefix, or "" to clear it.
  • get: the current prefix.

Example

DSOLoader::prefix( "lib" );
DSOLoader::prefix();                       // "lib"

DSOLoader::loadAll( ".so", "/usr/lib" );   // only /usr/lib/lib*.so, not every *.so

DSOLoader::prefix( "myapp-plugin-" );
DSOLoader::loadAll( ".so", pluginDir );    // myapp-plugin-*.so

Notes

  • The example driver testShape sets prefix("lib") because CMake MODULE targets get a lib prefix by default on Linux.
  • The match is a plain "starts with" on the file name (not the full path).
  • It is global state — set it once at start-up. There is no per-call override; if you need different prefixes for different directories, set / scan / reset in sequence.