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

Function readFile

examples/memory.cc:10–16  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8using namespace wasmtime;
9
10std::string readFile(const char *name) {
11 std::ifstream watFile;
12 watFile.open(name);
13 std::stringstream strStream;
14 strStream << watFile.rdbuf();
15 return strStream.str();
16}
17
18int main() {
19 // Create our `store` context and then compile a module and create an

Callers 1

mainFunction · 0.70

Calls 2

strMethod · 0.80
openMethod · 0.45

Tested by

no test coverage detected