Mercurial > vba-clojure
comparison src/win32/7zip/7z/CPP/7zip/Common/InOutTempBuffer.h @ 1:f9f4f1b99eed
importing src directory
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sat, 03 Mar 2012 10:31:27 -0600 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
0:8ced16adf2e1 | 1:f9f4f1b99eed |
---|---|
1 // Util/InOutTempBuffer.h | |
2 | |
3 #ifndef __IN_OUT_TEMP_BUFFER_H | |
4 #define __IN_OUT_TEMP_BUFFER_H | |
5 | |
6 #include "../../Windows/FileIO.h" | |
7 #include "../../Windows/FileDir.h" | |
8 #include "../../Common/MyCom.h" | |
9 | |
10 #include "../IStream.h" | |
11 | |
12 class CInOutTempBuffer | |
13 { | |
14 NWindows::NFile::NDirectory::CTempFile _tempFile; | |
15 NWindows::NFile::NIO::COutFile _outFile; | |
16 NWindows::NFile::NIO::CInFile _inFile; | |
17 Byte *_buffer; | |
18 UInt32 _bufferPosition; | |
19 UInt32 _currentPositionInBuffer; | |
20 CSysString _tmpFileName; | |
21 bool _tmpFileCreated; | |
22 | |
23 UInt64 _fileSize; | |
24 | |
25 bool WriteToFile(const void *data, UInt32 size); | |
26 public: | |
27 CInOutTempBuffer(); | |
28 ~CInOutTempBuffer(); | |
29 void Create(); | |
30 | |
31 void InitWriting(); | |
32 bool Write(const void *data, UInt32 size); | |
33 UInt64 GetDataSize() const { return _fileSize; } | |
34 bool FlushWrite(); | |
35 bool InitReading(); | |
36 HRESULT WriteToStream(ISequentialOutStream *stream); | |
37 }; | |
38 | |
39 class CSequentialOutTempBufferImp: | |
40 public ISequentialOutStream, | |
41 public CMyUnknownImp | |
42 { | |
43 CInOutTempBuffer *_buffer; | |
44 public: | |
45 // CSequentialOutStreamImp(): _size(0) {} | |
46 // UInt32 _size; | |
47 void Init(CInOutTempBuffer *buffer) { _buffer = buffer; } | |
48 // UInt32 GetSize() const { return _size; } | |
49 | |
50 MY_UNKNOWN_IMP | |
51 | |
52 STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize); | |
53 }; | |
54 | |
55 #endif |