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

Function load_file

bench/bench-conv.cpp:126–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

124using file_list = std::vector<file_item>;
125
126std::string
127load_file(char const* path)
128{
129 FILE* f = fopen(path, "rb");
130 fseek(f, 0, SEEK_END);
131 auto const size = ftell(f);
132 std::string s;
133 s.resize(size);
134 fseek(f, 0, SEEK_SET);
135 auto const nread = fread(&s[0], 1, size, f);
136 s.resize(nread);
137 fclose(f);
138 return s;
139}
140
141#if defined(BOOST_DESCRIBE_CXX14)
142using supported_files = mpl::mp_list<

Callers 1

mainFunction · 0.70

Calls 1

resizeMethod · 0.80

Tested by

no test coverage detected