MCPcopy Create free account
hub / github.com/boostorg/json / load_file

Function load_file

bench/bench.cpp:220–234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

218using impl_list = std::vector<impl_ptr>;
219
220std::string
221load_file(char const* path)
222{
223 FILE* f = fopen(path, "rb");
224 fseek(f, 0, SEEK_END);
225 auto const size = ftell(f);
226 std::string s;
227 s.resize(size);
228 fseek(f, 0, SEEK_SET);
229 auto const nread =
230 fread(&s[0], 1, size, f);
231 s.resize(nread);
232 fclose(f);
233 return s;
234}
235
236struct sample
237{

Callers 1

mainFunction · 0.70

Calls 1

resizeMethod · 0.80

Tested by

no test coverage detected