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

Function CountCharFileCoroImpl

demo_example/ReadFiles.cpp:125–132  ·  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

123// The *Impl is not the key point for this example, code readers
124// could ignore this.
125Lazy<uint64_t> CountCharFileCoroImpl(const FileName &File, char c) {
126 uint64_t Ret = 0;
127 std::ifstream infile(File);
128 std::string line;
129 while (std::getline(infile, line))
130 Ret += std::count(line.begin(), line.end(), c);
131 co_return Ret;
132}
133
134Lazy<uint64_t> CountCharInFilesCoro(const std::vector<FileName> &Files,
135 char c) {

Callers 1

CountCharInFilesCoroFunction · 0.85

Calls 2

beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected