Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void printReverseResults(map<string, long long int>& sizeMap, map<string, int>& fileCountMap) {
- vector <string> typeVector;
- vector <long long int> sizeVector;
- vector <int> amountVector;
- int fileTypeCount = 0;
- int fileCount = 0;
- long long int fileSizeCount = 0;
- for (auto a = fileCountMap.begin(); a != fileCountMap.end(); a++) {
- typeVector.push_back(a->first);
- amountVector.push_back(a->second);
- }
- for (auto b = sizeMap.begin(); b != sizeMap.end(); b++) {
- sizeVector.push_back(b->second);
- }
- cout << right << setw(40) << "Ext" << right << setw(2) << ":" << right << setw(10) << "#" << right << setw(2) << ":" << right << setw(20) << "Total" << endl;
- cout << setfill('-') << right << setw(40) << "---" << right << setw(2) << ":" << right << setw(10) << "---" << right << setw(2) << ":" << right << setw(20) << "-----" << endl;
- for (unsigned c = typeVector.size() - 1; c != -1; c--) {
- fileTypeCount++;
- fileCount += amountVector[c];
- fileSizeCount += sizeVector[c];
- cout << setfill(' ') << right << setw(40) << typeVector[c] << right << setw(2) << ":" << right << setw(10) << amountVector[c] << right << setw(2) << ":" << right << setw(20) << sizeVector[c] << endl;
- }
- cout << setfill('-') << right << setw(40) << "---" << right << setw(2) << ":" << right << setw(10) << "---" << right << setw(2) << ":" << right << setw(20) << "-----" << endl;
- cout << setfill(' ') << right << setw(40) << fileTypeCount << right << setw(2) << ":" << right << setw(10) << fileCount << right << setw(2) << ":" << right << setw(20) << fileSizeCount << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement