The *Impl is not the key point for this example, code readers could ignore this.
| 88 | // The *Impl is not the key point for this example, code readers |
| 89 | // could ignore this. |
| 90 | Future<uint64_t> CountCharInFileAsyncImpl(const FileName &File, char c) { |
| 91 | uint64_t Ret = 0; |
| 92 | std::ifstream infile(File); |
| 93 | std::string line; |
| 94 | while (std::getline(infile, line)) |
| 95 | Ret += std::count(line.begin(), line.end(), c); |
| 96 | return makeReadyFuture(std::move(Ret)); |
| 97 | } |
| 98 | |
| 99 | Future<uint64_t> CountCharInFilesAsync(const std::vector<FileName> &Files, |
| 100 | char c) { |
no test coverage detected