MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / importModule

Method importModule

src/Base/Type.cpp:107–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105}
106
107void Type::importModule(std::string_view typeName)
108{
109 // cut out the module name
110 const std::string mod = getModuleName(typeName);
111
112 // ignore base modules
113 if (mod == "App" || mod == "Gui" || mod == "Base") {
114 return;
115 }
116
117 // remember already loaded modules
118 if (loadModuleSet.contains(mod)) {
119 return;
120 }
121
122 // lets load the module
123 Interpreter().loadModule(mod.c_str());
124#ifdef FC_LOGLOADMODULE
125 Console().log("Act: Module %s loaded through class %s \n", mod.c_str(), typeName);
126#endif
127 loadModuleSet.insert(mod);
128}
129
130std::string Type::getModuleName(std::string_view className)
131{

Callers

nothing calls this directly

Calls 5

loadModuleMethod · 0.80
containsMethod · 0.45
c_strMethod · 0.45
logMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected