MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / getModuleInfo

Method getModuleInfo

src/builtin/module_file_access.cpp:124–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122 }
123
124 ModuleInfo ModuleFileAccess::getModuleInfo ( const string & req, const string & from ) const {
125 if (failed()) return FileAccess::getModuleInfo(req, from);
126 vec4f args[2];
127 args[0] = cast<const char *>::from(req.c_str());
128 args[1] = cast<const char *>::from(from.c_str());
129 struct {
130 char * modName;
131 char * modFileName;
132 char * modImportName;
133 } res;
134 memset(&res, 0, sizeof(res));
135 context->evalWithCatch(modGet, args, &res);
136 auto exc = context->getException(); exc;
137 DAS_ASSERTF(!exc, "exception failed in `module_get`: %s", exc);
138 ModuleInfo info;
139 info.moduleName = res.modName ? res.modName : "";
140 info.fileName = res.modFileName ? res.modFileName : "";
141 info.importName = res.modImportName ? res.modImportName : "";
142 return info;
143 }
144
145 string ModuleFileAccess::getDynModulesFolder() const {
146 if(failed() || !dynModulesFolderGet) return FileAccess::getDynModulesFolder();

Callers

nothing calls this directly

Calls 3

evalWithCatchMethod · 0.80
failedFunction · 0.50
c_strMethod · 0.45

Tested by

no test coverage detected