| 901 | } |
| 902 | |
| 903 | bool PluginManager::addPlugin(string name) |
| 904 | { |
| 905 | if (all_plugins.find(name) != all_plugins.end()) |
| 906 | { |
| 907 | Core::printerr("Plugin already exists: {}\n", name); |
| 908 | return false; |
| 909 | } |
| 910 | std::filesystem::path path = getPluginPath(name); |
| 911 | if (!Filesystem::isfile(path)) |
| 912 | { |
| 913 | Core::printerr("Plugin does not exist: {}\n", name); |
| 914 | return false; |
| 915 | } |
| 916 | Plugin * p = new Plugin(core, path, name, this); |
| 917 | all_plugins[name] = p; |
| 918 | return true; |
| 919 | } |
| 920 | |
| 921 | std::vector<string> PluginManager::listPlugins() |
| 922 | { |
nothing calls this directly
no test coverage detected