1 // UpdateCallbackConsole.h
2 
3 #ifndef __UPDATE_CALLBACK_CONSOLE_H
4 #define __UPDATE_CALLBACK_CONSOLE_H
5 
6 #include "Common/StdOutStream.h"
7 
8 #include "../Common/Update.h"
9 
10 #include "PercentPrinter.h"
11 
12 class CUpdateCallbackConsole: public IUpdateCallbackUI2
13 {
14   CPercentPrinter m_PercentPrinter;
15   bool m_NeedBeClosed;
16   bool m_NeedNewLine;
17 
18   bool m_WarningsMode;
19 
20   CStdOutStream *OutStream;
21 public:
22   bool EnablePercents;
23   bool StdOutMode;
24 
25   #ifndef _NO_CRYPTO
26   bool PasswordIsDefined;
27   UString Password;
28   bool AskPassword;
29   #endif
30 
CUpdateCallbackConsole()31   CUpdateCallbackConsole():
32       m_PercentPrinter(1 << 16),
33       #ifndef _NO_CRYPTO
34       PasswordIsDefined(false),
35       AskPassword(false),
36       #endif
37       StdOutMode(false),
38       EnablePercents(true),
39       m_WarningsMode(false)
40       {}
41 
~CUpdateCallbackConsole()42   ~CUpdateCallbackConsole() { Finilize(); }
Init(CStdOutStream * outStream)43   void Init(CStdOutStream *outStream)
44   {
45     m_NeedBeClosed = false;
46     m_NeedNewLine = false;
47     FailedFiles.Clear();
48     FailedCodes.Clear();
49     OutStream = outStream;
50     m_PercentPrinter.OutStream = outStream;
51   }
52 
53   INTERFACE_IUpdateCallbackUI2(;)
54 
55   UStringVector FailedFiles;
56   CRecordVector<HRESULT> FailedCodes;
57 
58   UStringVector CantFindFiles;
59   CRecordVector<HRESULT> CantFindCodes;
60 };
61 
62 #endif
63