MCPcopy Create free account
hub / github.com/CoolProp/CoolProp / read_file

Function read_file

dev/json_migration_bench/parse_bench.cpp:16–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14#include <nlohmann/json.hpp>
15
16static std::string read_file(const char* path) {
17 std::ifstream f(path, std::ios::binary);
18 if (!f) {
19 std::fprintf(stderr, "cannot open %s\n", path);
20 std::exit(1);
21 }
22 std::ostringstream ss;
23 ss << f.rdbuf();
24 return ss.str();
25}
26
27template <typename F>
28static void run(const char* name, int iters, F&& fn) {

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected