ExtractCallbackConsole.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // ExtractCallbackConsole.h
  2. #ifndef __EXTRACTCALLBACKCONSOLE_H
  3. #define __EXTRACTCALLBACKCONSOLE_H
  4. #include "Common/MyString.h"
  5. #include "Common/StdOutStream.h"
  6. #include "../../Common/FileStreams.h"
  7. #include "../../IPassword.h"
  8. #include "../../Archive/IArchive.h"
  9. #include "../Common/ArchiveExtractCallback.h"
  10. class CExtractCallbackConsole:
  11. public IExtractCallbackUI,
  12. public ICryptoGetTextPassword,
  13. public CMyUnknownImp
  14. {
  15. public:
  16. MY_UNKNOWN_IMP2(IFolderArchiveExtractCallback, ICryptoGetTextPassword)
  17. STDMETHOD(SetTotal)(UInt64 total);
  18. STDMETHOD(SetCompleted)(const UInt64 *completeValue);
  19. // IFolderArchiveExtractCallback
  20. STDMETHOD(AskOverwrite)(
  21. const wchar_t *existName, const FILETIME *existTime, const UInt64 *existSize,
  22. const wchar_t *newName, const FILETIME *newTime, const UInt64 *newSize,
  23. Int32 *answer);
  24. STDMETHOD (PrepareOperation)(const wchar_t *name, bool isFolder, Int32 askExtractMode, const UInt64 *position);
  25. STDMETHOD(MessageError)(const wchar_t *message);
  26. STDMETHOD(SetOperationResult)(Int32 operationResult, bool encrypted);
  27. // ICryptoGetTextPassword
  28. STDMETHOD(CryptoGetTextPassword)(BSTR *password);
  29. HRESULT BeforeOpen(const wchar_t *name);
  30. HRESULT OpenResult(const wchar_t *name, HRESULT result, bool encrypted);
  31. HRESULT ThereAreNoFiles();
  32. HRESULT ExtractResult(HRESULT result);
  33. HRESULT SetPassword(const UString &password);
  34. public:
  35. bool PasswordIsDefined;
  36. UString Password;
  37. UInt64 NumArchives;
  38. UInt64 NumArchiveErrors;
  39. UInt64 NumFileErrors;
  40. UInt64 NumFileErrorsInCurrentArchive;
  41. CStdOutStream *OutStream;
  42. void Init()
  43. {
  44. NumArchives = 0;
  45. NumArchiveErrors = 0;
  46. NumFileErrors = 0;
  47. NumFileErrorsInCurrentArchive = 0;
  48. }
  49. };
  50. #endif