MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / LoadSourceCode

Method LoadSourceCode

src/lua/LuaHandle.cpp:191–204  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

189
190
191std::string LuaHandle::LoadSourceCode(const std::string& sourceFile,
192 const std::string& sourceModes) {
193 std::string modes = sourceModes;
194 if (devMode) {
195 modes = std::string(BZVFS_LUA_USER) + modes;
196 }
197 std::string code;
198 if (!bzVFS.readFile(sourceFile, modes, code)) {
199 LuaLog(0, "FAILED to load '%s' with '%s'\n",
200 sourceFile.c_str(), modes.c_str());
201 return "";
202 }
203 return code;
204}
205
206
207bool LuaHandle::ExecSourceCode(const std::string& code, const std::string& label) {

Callers

nothing calls this directly

Calls 3

LuaLogFunction · 0.85
c_strMethod · 0.80
readFileMethod · 0.45

Tested by

no test coverage detected