File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 1
1
#include " ..\header\stats.h"
2
+ #include " ..\lib\ProgressBar\ProgressBar.h"
2
3
3
4
using namespace std ;
4
5
namespace fs = filesystem;
@@ -119,9 +120,14 @@ string determineLanguageForHeader(const fs::path& headerFilePath) {
119
120
120
121
void LanguageByType (fs::path& directory){
121
122
unordered_map<string, LanguageStats> stats;
122
- size_t totalChars = 0 ;
123
-
123
+ size_t totalChars = 0 , allfile=0 , thefile=0 ;
124
+
125
+ for (const auto & entry : fs::recursive_directory_iterator (directory))allfile++;
126
+ ProgressBar pb (0 , int (allfile), ' =' );
127
+
124
128
for (const auto & entry : fs::recursive_directory_iterator (directory)) {
129
+ pb.setCurrentValue (++thefile);
130
+ pb.display ();
125
131
if (entry.is_regular_file ()) {
126
132
string extension = entry.path ().extension ().string ();
127
133
string filename = entry.path ().filename ().string ();
@@ -150,6 +156,8 @@ void LanguageByType(fs::path& directory){
150
156
}
151
157
}
152
158
159
+ std::cout << std::endl;
160
+
153
161
cout << setw (15 ) << " Language"
154
162
<< setw (15 ) << " File Count"
155
163
<< setw (20 ) << " Total Characters"
You can’t perform that action at this time.
0 commit comments