mirror of
https://gitea.home.endeavr.de/Marcel/Tarstats-pp.git
synced 2025-12-10 00:39:01 +01:00
this put console output into its own function
This commit is contained in:
10
tarfunc.cpp
10
tarfunc.cpp
@@ -7,6 +7,8 @@
|
||||
#include "tarconst.h"
|
||||
#include <string>
|
||||
#include <cmath>
|
||||
#include <iostream>
|
||||
#include <map>
|
||||
|
||||
// checks if a valid modern tar file - ustar
|
||||
bool tar::validTar(std::istream &file) {
|
||||
@@ -57,4 +59,12 @@ std::string tar::getitemtype(char &n) {
|
||||
default:
|
||||
return tarconstant::typeOther;
|
||||
}
|
||||
}
|
||||
|
||||
void tar::consolestats (std::map<std::string, uintmax_t> &typecount, uintmax_t tarfilesize, uintmax_t sizeofall) {
|
||||
std::cout << "Archive size: " << tarfilesize << " Bytes"<< '\n';
|
||||
std::cout << "Size of all items: " << sizeofall << " Bytes" << '\n' << '\n';
|
||||
for (auto &i : typecount) {
|
||||
std::cout << i.first <<": " << i.second << '\n';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user