• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
AddSpace()15   void AddSpace()
16   {
17     _s.Add_Space_if_NotEmpty();
18   }
19 
AddSpacesBeforeName()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 
CHashCallbackConsole()45   CHashCallbackConsole():
46       PrintNameInPercents(true),
47       PrintHeaders(false)
48       // , PrintSize(true),
49       // , PrintNewLine(true)
50     {}
51 
~CHashCallbackConsole()52   virtual ~CHashCallbackConsole() {}
53 
54   INTERFACE_IHashCallbackUI(;)
55 };
56 
57 void PrintHashStat(CStdOutStream &so, const CHashBundle &hb);
58 
59 #endif
60