blob: 83731b38c8ece3ef2a0f6124b93693d3a495feb9 (
plain)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
// ProgressBox.h
#ifndef __PROGRESS_BOX_H
#define __PROGRESS_BOX_H
#include "../../../Common/MyString.h"
#include "../../../Common/MyTypes.h"
struct CPercentPrinterState
{
UInt64 Completed;
UInt64 Total;
UInt64 Files;
UInt64 FilesTotal;
AString Command;
UString FileName;
void ClearCurState();
bool IsEqualTo(const CPercentPrinterState &s) const
{
return
Completed == s.Completed
&& Total == s.Total
&& Files == s.Files
&& FilesTotal == s.FilesTotal
&& Command == s.Command
&& FileName == s.FileName;
}
CPercentPrinterState():
Completed(0),
Total((UInt64)(Int64)-1),
Files(0),
FilesTotal(0)
{}
};
class CProgressBox: public CPercentPrinterState
{
UInt32 _tickStep;
DWORD _prevTick;
DWORD _prevElapsedSec;
bool _wasPrinted;
UString _tempU;
UString _name1U;
UString _name2U;
CPercentPrinterState _printedState;
AString _title;
AString _timeStr;
AString _files;
AString _sizesStr;
AString _name1;
AString _name2;
AString _perc;
void ReduceString(const UString &src, AString &dest);
public:
DWORD StartTick;
bool UseBytesForPercents;
unsigned MaxLen;
CProgressBox(UInt32 tickStep = 200):
_tickStep(tickStep),
_prevTick(0),
StartTick(0),
UseBytesForPercents(true),
MaxLen(60)
{}
void Init(const AString &title);
void Print();
};
#endif
|