MCPcopy Create free account
hub / github.com/SnowyMouse/chimera / read_script_file

Function read_script_file

src/chimera/lua/lua_script.cpp:29–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27 std::vector<std::unique_ptr<LuaScript>> scripts;
28
29 static std::string read_script_file(fs::path script_path) noexcept {
30 std::ifstream file(script_path, std::ios::binary);
31 if(file.is_open()) {
32 std::stringstream file_content;
33 file_content << file.rdbuf();
34 file.close();
35 return file_content.str();
36 }
37 return std::string();
38 }
39
40 static void load_lua_script(const char *script_name, const char *lua_script_data, size_t lua_script_data_size, bool sandbox, bool global) noexcept {
41 // Create a new state for this script

Callers 2

load_map_scriptFunction · 0.85
load_global_scriptsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected