MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / read_file

Function read_file

examples/server/httplib.h:2229–2236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2227}
2228
2229inline void read_file(const std::string &path, std::string &out) {
2230 std::ifstream fs(path, std::ios_base::binary);
2231 fs.seekg(0, std::ios_base::end);
2232 auto size = fs.tellg();
2233 fs.seekg(0);
2234 out.resize(static_cast<size_t>(size));
2235 fs.read(&out[0], static_cast<std::streamsize>(size));
2236}
2237
2238inline std::string file_extension(const std::string &path) {
2239 std::smatch m;

Callers 1

handle_file_requestMethod · 0.70

Calls 2

resizeMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected