MCPcopy Create free account
hub / github.com/FlagBrew/PKSM / scriptRead

Function scriptRead

3ds/source/gui/screen/ScriptScreen.cpp:117–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115 }
116
117 std::vector<u8> scriptRead(const std::string& path)
118 {
119 std::vector<u8> ret;
120 FILE* in = fopen(path.c_str(), "rb");
121 fseek(in, 0, SEEK_END);
122 if (!ferror(in))
123 {
124 size_t size = ftell(in);
125 fseek(in, 0, SEEK_SET);
126 ret = std::vector<u8>(size);
127 fread(ret.data(), 1, size, in);
128 }
129 else
130 {
131 Gui::error(i18n::localize("SCRIPTS_FAILED_OPEN"), errno);
132 }
133 fclose(in);
134
135 return ret;
136 }
137}
138
139ScriptScreen::ScriptScreen()

Callers 1

applyScriptMethod · 0.85

Calls 1

errorFunction · 0.85

Tested by

no test coverage detected