MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / readFile

Function readFile

examples/interrupt.cc:30–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28using namespace wasmtime;
29
30std::string readFile(const char *name) {
31 std::ifstream watFile;
32 watFile.open(name);
33 std::stringstream strStream;
34 strStream << watFile.rdbuf();
35 return strStream.str();
36}
37
38int main() {
39 // Enable interruptible code via `Config` and then create an interrupt

Callers 1

mainFunction · 0.70

Calls 2

strMethod · 0.80
openMethod · 0.45

Tested by

no test coverage detected