MCPcopy Create free account
hub / github.com/DFHack/dfhack / addPlugin

Method addPlugin

library/PluginManager.cpp:903–919  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

901}
902
903bool 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
921std::vector<string> PluginManager::listPlugins()
922{

Callers

nothing calls this directly

Calls 4

getPluginPathFunction · 0.85
printerrFunction · 0.50
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected