MCPcopy Create free account
hub / github.com/alibaba/async_simple / CountCharInFileImpl

Function CountCharInFileImpl

demo_example/ReadFiles.cpp:39–46  ·  view source on GitHub ↗

The *Impl is not the key point for this example, code readers could ignore this.

Source from the content-addressed store, hash-verified

37// The *Impl is not the key point for this example, code readers
38// could ignore this.
39uint64_t CountCharInFileImpl(const FileName &File, char c) {
40 uint64_t Ret = 0;
41 std::ifstream infile(File);
42 std::string line;
43 while (std::getline(infile, line))
44 Ret += std::count(line.begin(), line.end(), c);
45 return Ret;
46}
47
48uint64_t CountCharInFiles(const std::vector<FileName> &Files, char c) {
49 uint64_t ReadSize = 0;

Callers 1

CountCharInFilesFunction · 0.85

Calls 2

beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected