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

Function readFile

examples/anyref.cc:18–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16using namespace wasmtime;
17
18std::string readFile(const char *name) {
19 std::ifstream watFile;
20 watFile.open(name);
21 std::stringstream strStream;
22 strStream << watFile.rdbuf();
23 return strStream.str();
24}
25
26int main() {
27 std::cout << "Initializing...\n";

Callers 1

mainFunction · 0.70

Calls 2

strMethod · 0.80
openMethod · 0.45

Tested by

no test coverage detected