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

Method isModuleAllowed

src/builtin/module_file_access.cpp:113–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111 }
112
113 bool ModuleFileAccess::isModuleAllowed ( const string & mod, const string & fileName ) const {
114 if(failed() || !moduleAllowed) return FileAccess::isModuleAllowed(mod,fileName);
115 vec4f args[2];
116 args[0] = cast<const char *>::from(mod.c_str());
117 args[1] = cast<const char *>::from(fileName.c_str());
118 auto res = context->evalWithCatch(moduleAllowed, args, nullptr);
119 auto exc = context->getException(); exc;
120 DAS_ASSERTF(!exc, "exception failed in `module_allowed`: %s", exc);
121 return cast<bool>::to(res);
122 }
123
124 ModuleInfo ModuleFileAccess::getModuleInfo ( const string & req, const string & from ) const {
125 if (failed()) return FileAccess::getModuleInfo(req, from);

Callers 2

addRequirementsFunction · 0.45
getPrerequisitsFunction · 0.45

Calls 5

isModuleAllowedFunction · 0.85
toFunction · 0.85
evalWithCatchMethod · 0.80
failedFunction · 0.50
c_strMethod · 0.45

Tested by

no test coverage detected