MCPcopy Create free account
hub / github.com/chigraph/chigraph / typeFromModule

Method typeFromModule

libchigraph/src/Context.cpp:497–516  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

495}
496
497Result Context::typeFromModule(const fs::path& module, boost::string_view name,
498 DataType* toFill) noexcept {
499 assert(toFill != nullptr);
500
501 Result res;
502
503 ChiModule* mod = moduleByFullName(module);
504 if (mod == nullptr) {
505 res.addEntry("E36", "Could not find module", {{"module", module.generic_string()}});
506 return res;
507 }
508
509 *toFill = mod->typeFromName(name);
510 if (!toFill->valid()) {
511 res.addEntry("E37", "Could not find type in module",
512 {{"type", name.to_string()}, {"module", module.generic_string()}});
513 }
514
515 return res;
516}
517
518Result Context::nodeTypeFromModule(const fs::path& moduleName, boost::string_view typeName,
519 const nlohmann::json& data,

Callers 9

ContextTests.cppFile · 0.80
nodeTypeFromNameMethod · 0.80
LangModuleMethod · 0.80
compileFunctionFunction · 0.80
jsonToGraphFunctionFunction · 0.80
jsonToGraphStructFunction · 0.80

Calls 4

addEntryMethod · 0.80
to_stringMethod · 0.80
typeFromNameMethod · 0.45
validMethod · 0.45

Tested by

no test coverage detected