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

Method to_string

smallthinker/tools/run/run.cpp:359–371  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

357 }
358
359 std::string to_string() {
360 fseek(file, 0, SEEK_END);
361 const size_t size = ftell(file);
362 fseek(file, 0, SEEK_SET);
363 std::string out;
364 out.resize(size);
365 const size_t read_size = fread(&out[0], 1, size, file);
366 if (read_size != size) {
367 printe("Error reading file: %s", strerror(errno));
368 }
369
370 return out;
371 }
372
373 ~File() {
374 if (fd >= 0) {

Callers 1

read_chat_template_fileFunction · 0.45

Calls 2

printeFunction · 0.85
resizeMethod · 0.45

Tested by

no test coverage detected