MCPcopy Create free account
hub / github.com/appdevforall/CodeOnTheGo / read_file

Function read_file

subprojects/llama.cpp/common/arg.cpp:63–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61};
62
63static std::string read_file(const std::string & fname) {
64 std::ifstream file(fname);
65 if (!file) {
66 throw std::runtime_error(string_format("error: failed to open file '%s'\n", fname.c_str()));
67 }
68 std::string content((std::istreambuf_iterator<char>(file)), std::istreambuf_iterator<char>());
69 file.close();
70 return content;
71}
72
73static const std::vector<common_arg> & get_common_arg_defs() {
74 static const std::vector<common_arg> options = [] {

Callers 1

Calls 2

string_formatFunction · 0.70
closeMethod · 0.65

Tested by

no test coverage detected