-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.cpp
More file actions
27 lines (23 loc) · 728 Bytes
/
Copy pathutils.cpp
File metadata and controls
27 lines (23 loc) · 728 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <iostream>
#include <vector>
#include <thread>
#include "constants.h"
#include "search_result.h"
void print_details(int threads, std::thread::id curr_thread, int file_sz) {
std::cout << kWatchThreadsMsg;
std::cout << "Processing " << file_sz << " files using " << threads << " threads\n";
std::cout << "Main thread ID: " << curr_thread << "\n\n";
return;
}
void print_output(std::vector<SearchResult>& results, bool& show_details) {
if (show_details)
std::cout << kWowMsg;
for (const auto& res : results) {
std::cout << res.filename << ": ";
for (int line : res.lines)
std::cout << line << " ";
std::cout << '\n';
}
if (results.empty()) std::cout << kOopsMsg;
return;
}