7zFolderOutStream.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. // 7zFolderOutStream.h
  2. #ifndef __7Z_FOLDEROUTSTREAM_H
  3. #define __7Z_FOLDEROUTSTREAM_H
  4. #include "7zIn.h"
  5. #include "../../IStream.h"
  6. #include "../IArchive.h"
  7. #include "../Common/OutStreamWithCRC.h"
  8. namespace NArchive {
  9. namespace N7z {
  10. class CFolderOutStream:
  11. public ISequentialOutStream,
  12. public CMyUnknownImp
  13. {
  14. public:
  15. MY_UNKNOWN_IMP
  16. CFolderOutStream();
  17. STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize);
  18. private:
  19. COutStreamWithCRC *_outStreamWithHashSpec;
  20. CMyComPtr<ISequentialOutStream> _outStreamWithHash;
  21. const CArchiveDatabaseEx *_archiveDatabase;
  22. const CBoolVector *_extractStatuses;
  23. UInt32 _startIndex;
  24. UInt32 _ref2Offset;
  25. int _currentIndex;
  26. // UInt64 _currentDataPos;
  27. CMyComPtr<IArchiveExtractCallback> _extractCallback;
  28. bool _testMode;
  29. bool _fileIsOpen;
  30. bool _checkCrc;
  31. UInt64 _filePos;
  32. HRESULT OpenFile();
  33. HRESULT WriteEmptyFiles();
  34. public:
  35. HRESULT Init(
  36. const CArchiveDatabaseEx *archiveDatabase,
  37. UInt32 ref2Offset,
  38. UInt32 startIndex,
  39. const CBoolVector *extractStatuses,
  40. IArchiveExtractCallback *extractCallback,
  41. bool testMode,
  42. bool checkCrc);
  43. HRESULT FlushCorrupted(Int32 resultEOperationResult);
  44. HRESULT WasWritingFinished();
  45. };
  46. }}
  47. #endif