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

Function readFile

examples/externref.cc:8–14  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6using namespace wasmtime;
7
8std::string readFile(const char *name) {
9 std::ifstream watFile;
10 watFile.open(name);
11 std::stringstream strStream;
12 strStream << watFile.rdbuf();
13 return strStream.str();
14}
15
16int main() {
17 std::cout << "Initializing...\n";

Callers 1

mainFunction · 0.70

Calls 2

strMethod · 0.80
openMethod · 0.45

Tested by

no test coverage detected