mirror of
https://gitea.home.endeavr.de/Marcel/Tarstats-pp.git
synced 2025-12-10 00:39:01 +01:00
this added json output to stdout, to file and global json stats to file. tarstats is feature complete.
This commit is contained in:
53
main.cpp
53
main.cpp
@@ -128,11 +128,24 @@ int main(int argc, char** argv) {
|
||||
}
|
||||
gzclose(gzIn);
|
||||
global_sizeofallfiles += std::filesystem::file_size(archiveName);
|
||||
tar::consolestats(typecount, std::filesystem::file_size(archiveName),
|
||||
sizeof_allitems);
|
||||
if (toFile) {
|
||||
tar::txtfilestats(typecount, std::filesystem::file_size(archiveName),
|
||||
sizeof_allitems, archiveName);
|
||||
|
||||
if(toJSON){
|
||||
if(!toFile) {
|
||||
tar::jsonconsolestats(typecount, std::filesystem::file_size(archiveName),
|
||||
sizeof_allitems, archiveName, "gzarchive");
|
||||
}
|
||||
if(toFile) {
|
||||
tar::jsonfilestats(typecount, std::filesystem::file_size(archiveName),
|
||||
sizeof_allitems, archiveName, "gzarchive");
|
||||
}
|
||||
}
|
||||
if(!toJSON) {
|
||||
if(toFile)
|
||||
tar::txtfilestats(typecount, std::filesystem::file_size(archiveName),
|
||||
sizeof_allitems, archiveName);
|
||||
if(!toFile)
|
||||
tar::consolestats(typecount, std::filesystem::file_size(archiveName),
|
||||
sizeof_allitems);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -177,16 +190,32 @@ int main(int argc, char** argv) {
|
||||
file.close();
|
||||
global_sizeofallfiles += std::filesystem::file_size(archiveName);
|
||||
|
||||
std::cout << toJSON << '\n';
|
||||
tar::consolestats(typecount, std::filesystem::file_size(archiveName),
|
||||
sizeof_allitems);
|
||||
if (toFile) {
|
||||
tar::txtfilestats(typecount, std::filesystem::file_size(archiveName),
|
||||
sizeof_allitems, archiveName);
|
||||
if(toJSON){
|
||||
if(!toFile) {
|
||||
tar::jsonconsolestats(typecount, std::filesystem::file_size(archiveName),
|
||||
sizeof_allitems, archiveName, "archive");
|
||||
}
|
||||
if(toFile) {
|
||||
tar::jsonfilestats(typecount, std::filesystem::file_size(archiveName),
|
||||
sizeof_allitems, archiveName, "archive");
|
||||
}
|
||||
}
|
||||
if(!toJSON) {
|
||||
if(toFile)
|
||||
tar::txtfilestats(typecount, std::filesystem::file_size(archiveName),
|
||||
sizeof_allitems, archiveName);
|
||||
if(!toFile)
|
||||
tar::consolestats(typecount, std::filesystem::file_size(archiveName),
|
||||
sizeof_allitems);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
tar::consoleglobalstats(globaltypecount, global_sizeofallfiles, global_sizeofallitems, archiveFilename);
|
||||
if(toFile && toJSON)
|
||||
tar::jsonglobalfile(globaltypecount, global_sizeofallfiles,
|
||||
global_sizeofallitems, archiveFilename.size());
|
||||
|
||||
tar::consoleglobalstats(globaltypecount, global_sizeofallfiles,
|
||||
global_sizeofallitems, archiveFilename.size());
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user