1 // OpenCallbackConsole.h
2 
3 #ifndef __OPEN_CALLBACK_CONSOLE_H
4 #define __OPEN_CALLBACK_CONSOLE_H
5 
6 #include "../../../Common/StdOutStream.h"
7 
8 #include "../Common/ArchiveOpenCallback.h"
9 
10 #include "PercentPrinter.h"
11 
12 class COpenCallbackConsole: public IOpenCallbackUI
13 {
14 protected:
15   CPercentPrinter _percent;
16 
17   CStdOutStream *_so;
18   CStdOutStream *_se;
19 
20   bool _totalFilesDefined;
21   bool _totalBytesDefined;
22   // UInt64 _totalFiles;
23   // UInt64 _totalBytes;
24 
25   bool NeedPercents() const { return _percent._so != NULL; }
26 
27 public:
28 
29   bool MultiArcMode;
30 
31   void ClosePercents()
32   {
33     if (NeedPercents())
34       _percent.ClosePrint(true);
35   }
36 
37   COpenCallbackConsole():
38       _totalFilesDefined(false),
39       _totalBytesDefined(false),
40       MultiArcMode(false)
41 
42       #ifndef _NO_CRYPTO
43       , PasswordIsDefined(false)
44       // , PasswordWasAsked(false)
45       #endif
46 
47       {}
48 
49   void Init(CStdOutStream *outStream, CStdOutStream *errorStream, CStdOutStream *percentStream)
50   {
51     _so = outStream;
52     _se = errorStream;
53     _percent._so = percentStream;
54   }
55 
56   INTERFACE_IOpenCallbackUI(;)
57 
58   #ifndef _NO_CRYPTO
59   bool PasswordIsDefined;
60   // bool PasswordWasAsked;
61   UString Password;
62   #endif
63 };
64 
65 #endif
66