diff options
Diffstat (limited to 'CPP/7zip/Common/InOutTempBuffer.h')
-rwxr-xr-x | CPP/7zip/Common/InOutTempBuffer.h | 33 |
1 files changed, 13 insertions, 20 deletions
diff --git a/CPP/7zip/Common/InOutTempBuffer.h b/CPP/7zip/Common/InOutTempBuffer.h index e1e0e971..073f95ac 100755 --- a/CPP/7zip/Common/InOutTempBuffer.h +++ b/CPP/7zip/Common/InOutTempBuffer.h @@ -1,11 +1,11 @@ -// Util/InOutTempBuffer.h +// InOutTempBuffer.h #ifndef __IN_OUT_TEMP_BUFFER_H #define __IN_OUT_TEMP_BUFFER_H -#include "../../Windows/FileIO.h" -#include "../../Windows/FileDir.h" #include "../../Common/MyCom.h" +#include "../../Windows/FileDir.h" +#include "../../Windows/FileIO.h" #include "../IStream.h" @@ -13,14 +13,12 @@ class CInOutTempBuffer { NWindows::NFile::NDirectory::CTempFile _tempFile; NWindows::NFile::NIO::COutFile _outFile; - NWindows::NFile::NIO::CInFile _inFile; - Byte *_buffer; - UInt32 _bufferPosition; - UInt32 _currentPositionInBuffer; - CSysString _tmpFileName; - bool _tmpFileCreated; - - UInt64 _fileSize; + Byte *_buf; + UInt32 _bufPos; + CSysString _tempFileName; + bool _tempFileCreated; + UInt64 _size; + UInt32 _crc; bool WriteToFile(const void *data, UInt32 size); public: @@ -30,23 +28,18 @@ public: void InitWriting(); bool Write(const void *data, UInt32 size); - UInt64 GetDataSize() const { return _fileSize; } - bool FlushWrite(); - bool InitReading(); + HRESULT WriteToStream(ISequentialOutStream *stream); + UInt64 GetDataSize() const { return _size; } }; class CSequentialOutTempBufferImp: public ISequentialOutStream, public CMyUnknownImp { - CInOutTempBuffer *_buffer; + CInOutTempBuffer *_buf; public: - // CSequentialOutStreamImp(): _size(0) {} - // UInt32 _size; - void Init(CInOutTempBuffer *buffer) { _buffer = buffer; } - // UInt32 GetSize() const { return _size; } - + void Init(CInOutTempBuffer *buffer) { _buf = buffer; } MY_UNKNOWN_IMP STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize); |