diff options
Diffstat (limited to 'CPP/7zip/UI/Console/HashCon.h')
-rw-r--r-- | CPP/7zip/UI/Console/HashCon.h | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/CPP/7zip/UI/Console/HashCon.h b/CPP/7zip/UI/Console/HashCon.h new file mode 100644 index 0000000..f926d4d --- /dev/null +++ b/CPP/7zip/UI/Console/HashCon.h | |||
@@ -0,0 +1,59 @@ | |||
1 | // HashCon.h | ||
2 | |||
3 | #ifndef __HASH_CON_H | ||
4 | #define __HASH_CON_H | ||
5 | |||
6 | #include "../Common/HashCalc.h" | ||
7 | |||
8 | #include "UpdateCallbackConsole.h" | ||
9 | |||
10 | class CHashCallbackConsole: public IHashCallbackUI, public CCallbackConsoleBase | ||
11 | { | ||
12 | UString _fileName; | ||
13 | AString _s; | ||
14 | |||
15 | void AddSpace() | ||
16 | { | ||
17 | _s.Add_Space_if_NotEmpty(); | ||
18 | } | ||
19 | |||
20 | void AddSpacesBeforeName() | ||
21 | { | ||
22 | if (!_s.IsEmpty()) | ||
23 | { | ||
24 | _s.Add_Space(); | ||
25 | _s.Add_Space(); | ||
26 | } | ||
27 | } | ||
28 | |||
29 | void PrintSeparatorLine(const CObjectVector<CHasherState> &hashers); | ||
30 | void PrintResultLine(UInt64 fileSize, | ||
31 | const CObjectVector<CHasherState> &hashers, unsigned digestIndex, bool showHash, const AString &path); | ||
32 | void PrintProperty(const char *name, UInt64 value); | ||
33 | |||
34 | public: | ||
35 | bool PrintNameInPercents; | ||
36 | |||
37 | bool PrintHeaders; | ||
38 | |||
39 | // bool PrintSize; | ||
40 | // bool PrintNewLine; // set it too (false), if you need only hash for single file without LF char. | ||
41 | AString PrintFields; | ||
42 | |||
43 | AString GetFields() const; | ||
44 | |||
45 | CHashCallbackConsole(): | ||
46 | PrintNameInPercents(true), | ||
47 | PrintHeaders(false) | ||
48 | // , PrintSize(true), | ||
49 | // , PrintNewLine(true) | ||
50 | {} | ||
51 | |||
52 | virtual ~CHashCallbackConsole() {} | ||
53 | |||
54 | INTERFACE_IHashCallbackUI(;) | ||
55 | }; | ||
56 | |||
57 | void PrintHashStat(CStdOutStream &so, const CHashBundle &hb); | ||
58 | |||
59 | #endif | ||