MCPcopy Create free account
hub / github.com/callstackincubator/polygen / loadModule

Method loadModule

packages/polygen/cpp/ReactNativePolygen/Loader.cpp:15–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13LoaderError::LoaderError(const std::string& what): std::runtime_error(what) {}
14
15std::shared_ptr<Module> Loader::loadModule(std::span<uint8_t> moduleData) const {
16 if (ModuleMetadataView::isMetadata(moduleData)) {
17 auto metadata = ModuleMetadataView::fromBuffer(moduleData);
18
19 return this->loadModuleByName(metadata->getName(), metadata->checksum);
20 }
21 else {
22 return this->loadModuleFromContents(moduleData);
23 }
24}
25
26std::shared_ptr<Module> Loader::loadModuleByName(const std::string& name, const std::string& checksum) const {
27 auto* foundModule = registry_.getModule(name);

Callers

nothing calls this directly

Calls 3

loadModuleByNameMethod · 0.95
getNameMethod · 0.45

Tested by

no test coverage detected