-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstats.cpp
More file actions
34 lines (28 loc) · 1.1 KB
/
stats.cpp
File metadata and controls
34 lines (28 loc) · 1.1 KB
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
28
29
30
31
32
33
34
/* ************************************************************************ *
* Written by Alex de Kruijff 21 April 2009 *
* ************************************************************************ *
* This source was written with a tabstop every four characters *
* In vi type :set ts=4 *
* ************************************************************************ */
#include "filename.h"
#include "filegroup.h"
#include "sizegroup.h"
#include "holder.h"
#include "stats.h"
int Stats::visit(Holder &holder) {return 0; }
int Stats::visit(SizeGroup &sizegroup)
{
currentFileSize = sizegroup.getFileSize();
if (minFileSize > currentFileSize) minFileSize = currentFileSize;
if (maxFileSize < currentFileSize) maxFileSize = currentFileSize;
totalSize += sizegroup.getSize() * currentFileSize;
waisted += currentFileSize * sizegroup.getIdenticals();
files += sizegroup.getSize();
return 0;
}
int Stats::visit(FileGroup &filegroup)
{
filenames += filegroup.getSize();
return 1;
}
void Stats::visit(Filename &filename) {}