MCPcopy Create free account
hub / github.com/OpenMW/openmw / loadInternalLib

Method loadInternalLib

components/lua/luastate.cpp:430–439  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

428 }
429
430 sol::function LuaState::loadInternalLib(std::string_view libName)
431 {
432 const auto path = packageNameToPath(libName, mLibSearchPaths);
433 std::ifstream stream(path);
434 std::string fileContent(std::istreambuf_iterator<char>(stream), {});
435 sol::load_result res = mSol.load(fileContent, Files::pathToUnicodeString(path), sol::load_mode::text);
436 if (!res.valid())
437 throw std::runtime_error("Lua error: " + res.get<std::string>());
438 return res;
439 }
440
441 std::string getLuaVersion()
442 {

Callers 1

loadContentConstructorFunction · 0.80

Calls 3

packageNameToPathFunction · 0.85
loadMethod · 0.45
validMethod · 0.45

Tested by

no test coverage detected