MCPcopy Create free account
hub / github.com/BYVoid/OpenCC / ReadFile

Function ReadFile

plugins/jieba/deps/cppjieba/test/benchmark.cpp:32–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30typedef std::chrono::steady_clock BenchmarkClock;
31
32std::string ReadFile(const std::string& path) {
33 std::ifstream ifs(path.c_str(), std::ifstream::in | std::ifstream::binary);
34 if (!ifs.is_open()) {
35 return std::string();
36 }
37 return std::string((std::istreambuf_iterator<char>(ifs)),
38 std::istreambuf_iterator<char>());
39}
40
41std::vector<std::string> LoadDictWords(const std::string& path, size_t limit) {
42 std::ifstream ifs(path.c_str());

Callers 1

mainFunction · 0.70

Calls 1

is_openMethod · 0.45

Tested by

no test coverage detected