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

Method loadFromVFS

components/lua/luastate.cpp:421–428  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

419 }
420
421 sol::function LuaState::loadFromVFS(const VFS::Path::Normalized& path)
422 {
423 std::string fileContent(std::istreambuf_iterator<char>(*mVFS->get(path)), {});
424 sol::load_result res = mSol.load(fileContent, path.value(), sol::load_mode::text);
425 if (!res.valid())
426 throw std::runtime_error(std::string("Lua error: ") += res.get<sol::error>().what());
427 return res;
428 }
429
430 sol::function LuaState::loadInternalLib(std::string_view libName)
431 {

Callers

nothing calls this directly

Calls 5

getMethod · 0.45
loadMethod · 0.45
valueMethod · 0.45
validMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected