carb::PluginLoadingDesc

Defined in carb/Framework.h

struct PluginLoadingDesc

Describes parameters for finding plugins on disk. Multiple search paths, matching wildcards, and exclusion wildcards can be specified. Used primarily by Framework::loadPlugins.

Call PluginLoadingDesc::getDefault() to instantiate this object, as it will correctly set defaults.

Public Members

const char *const *searchPaths

List of folders in which to search for plugins.

This may contain relative or absolute paths. All relative paths will be resolved relative to carb::filesystem::IFileSystem::getAppDirectoryPath(), not the current working directory. Absolute paths in the list will be searched directly. If search paths configuration is invalid (e.g. search paths count is zero), the fallback values are taken from the default plugin desc.

Defaults to the directory containing the process’s executable.

size_t searchPathCount

Number of entries in searchPaths. Defaults to 1.

bool searchRecursive

Is search recursive in search folders. Default to false.

const char *const *loadedFileWildcards

List of Filename wildcards to select loaded files. * and ? can be used, e.g. “carb.*.pl?gin”.

Defaults to “*.plugin”. This can lead to unnecessary plugins being loaded.

size_t loadedFileWildcardCount

Number of entries in loadedFileWildcards. Defaults to 1.

const char *const *reloadableFileWildcards

List of filename wildcards to mark loaded files as reloadable. Framework will treat them specially to allow overwriting source plugins and will monitor them for changes.

Defaults to nullptr.

size_t reloadableFileWildcardCount

Number of entries in reloadableFileWildcards. Defaults to 0.

bool unloadPlugins

If true, load and store the plugins interface information, then immediately unload the plugin until needed. When one of plugin’s interfaces is acquired, the library will be loaded again.

Defaults to false.

const char *const *excludedFileWildcards

List of filename wildcards to select excluded files. * and ? can be used.

Defaults to nullptr.

size_t excludedFileWildcardCount

Number of entries in excludedFileWildcards. Defaults to 0.

Public Static Functions

static inline PluginLoadingDesc getDefault()

Returns a PluginLoadDesc with sensible defaults.