return ConstPlugin::Shared::createWithoutRef(plugin);
}
+inline ConstPluginSet::Shared findAllPluginsFromFile(const bt2c::CStringView path,
+ const bool failOnLoadError)
+{
+ const bt_plugin_set *pluginSet;
+
+ switch (bt_plugin_find_all_from_file(path, failOnLoadError, &pluginSet)) {
+ case BT_PLUGIN_FIND_ALL_FROM_FILE_STATUS_OK:
+ return ConstPluginSet::Shared::createWithoutRef(pluginSet);
+ case BT_PLUGIN_FIND_ALL_FROM_FILE_STATUS_NOT_FOUND:
+ return ConstPluginSet::Shared {};
+ case BT_PLUGIN_FIND_ALL_FROM_FILE_STATUS_MEMORY_ERROR:
+ throw MemoryError {};
+ case BT_PLUGIN_FIND_ALL_FROM_FILE_STATUS_ERROR:
+ throw Error {};
+ }
+
+ bt_common_abort();
+}
+
inline ConstPluginSet::Shared findAllPluginsFromDir(const bt2c::CStringView path,
const bool recurse, const bool failOnLoadError)
{