MCPcopy Create free account
hub / github.com/chigraph/chigraph / read_all

Function read_all

libchigraph/src/GraphModule.cpp:44–58  ·  view source on GitHub ↗

read a whole stream to a string

Source from the content-addressed store, hash-verified

42
43// read a whole stream to a string
44std::string read_all(std::istream& i, Result& res) {
45 std::string one;
46 std::string ret;
47 try {
48 while (std::getline(i, one).good()) {
49 ret += one;
50 ret += "\n";
51 }
52 } catch (std::exception& e) {
53 res.addEntry("EUKN", "Failed to read from output stream", {{"Error Message", e.what()}});
54 return "";
55 }
56 ret += one;
57 return ret;
58}
59
60// Compile C code to a llvm::Module
61std::unique_ptr<llvm::Module> compileCCode(const char* execPath, boost::string_view code,

Callers 1

compileCCodeFunction · 0.70

Calls 1

addEntryMethod · 0.80

Tested by

no test coverage detected