| 495 | } |
| 496 | |
| 497 | Result 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 | |
| 518 | Result Context::nodeTypeFromModule(const fs::path& moduleName, boost::string_view typeName, |
| 519 | const nlohmann::json& data, |
no test coverage detected