diff options
author | Karsten Heimrich <karsten.heimrich@theqtcompany.com> | 2015-06-09 16:04:24 +0200 |
---|---|---|
committer | Karsten Heimrich <karsten.heimrich@theqtcompany.com> | 2015-06-10 08:15:38 +0000 |
commit | 4677d362982a38c6e2aabb667e33aaa7f921f018 (patch) | |
tree | fe3b676288f05a87cdbb53a170e815427e3d9380 /src/libs/7zip/win/CPP/7zip/Common/StreamObjects.h | |
parent | 22ec6aa53e44069c03c7baf94881949c7a4facff (diff) |
Update source tree with version 9.38.beta of LZMA SDK.
- Remove unused files.
- Split in .pri files.
- Add HEADERS section.
- Adjust lib7z_facade.
Change-Id: I31e7bafbfe1a9346364bd58c391601955f98ad3a
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Diffstat (limited to 'src/libs/7zip/win/CPP/7zip/Common/StreamObjects.h')
-rw-r--r-- | src/libs/7zip/win/CPP/7zip/Common/StreamObjects.h | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/src/libs/7zip/win/CPP/7zip/Common/StreamObjects.h b/src/libs/7zip/win/CPP/7zip/Common/StreamObjects.h index 5c8b5e51b..d0c86b566 100644 --- a/src/libs/7zip/win/CPP/7zip/Common/StreamObjects.h +++ b/src/libs/7zip/win/CPP/7zip/Common/StreamObjects.h @@ -3,8 +3,10 @@ #ifndef __STREAM_OBJECTS_H #define __STREAM_OBJECTS_H -#include "../../Common/Buffer.h" +#include "../../Common/MyBuffer.h" #include "../../Common/MyCom.h" +#include "../../Common/MyVector.h" + #include "../IStream.h" struct CReferenceBuf: @@ -31,13 +33,16 @@ public: _pos = 0; _ref = ref; } - void Init(CReferenceBuf *ref) { Init(ref->Buf, ref->Buf.GetCapacity(), ref); } + void Init(CReferenceBuf *ref) { Init(ref->Buf, ref->Buf.Size(), ref); } - MY_UNKNOWN_IMP1(IInStream) + MY_UNKNOWN_IMP2(ISequentialInStream, IInStream) STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize); STDMETHOD(Seek)(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition); }; +// void Create_BufInStream_WithReference(const void *data, size_t size, ISequentialInStream **stream); +void Create_BufInStream_WithNewBuf(const void *data, size_t size, ISequentialInStream **stream); + class CByteDynBuffer { size_t _capacity; @@ -46,11 +51,11 @@ public: CByteDynBuffer(): _capacity(0), _buf(0) {}; // there is no copy constructor. So don't copy this object. ~CByteDynBuffer() { Free(); } - void Free(); - size_t GetCapacity() const { return _capacity; } - operator Byte*() { return _buf; }; + void Free() throw(); + size_t GetCapacity() const { return _capacity; } + operator Byte*() const { return _buf; }; operator const Byte*() const { return _buf; }; - bool EnsureCapacity(size_t capacity); + bool EnsureCapacity(size_t capacity) throw(); }; class CDynBufSeqOutStream: @@ -68,7 +73,7 @@ public: Byte *GetBufPtrForWriting(size_t addSize); void UpdateSize(size_t addSize) { _size += addSize; } - MY_UNKNOWN_IMP + MY_UNKNOWN_IMP1(ISequentialOutStream) STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize); }; @@ -88,7 +93,7 @@ public: } size_t GetPos() const { return _pos; } - MY_UNKNOWN_IMP + MY_UNKNOWN_IMP1(ISequentialOutStream) STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize); }; @@ -103,7 +108,7 @@ public: void Init() { _size = 0; } UInt64 GetSize() const { return _size; } - MY_UNKNOWN_IMP + MY_UNKNOWN_IMP1(ISequentialOutStream) STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize); }; @@ -123,9 +128,9 @@ protected: public: CCachedInStream(): _tags(0), _data(0) {} virtual ~CCachedInStream() { Free(); } // the destructor must be virtual (release calls it) !!! - void Free(); - bool Alloc(unsigned blockSizeLog, unsigned numBlocksLog); - void Init(UInt64 size); + void Free() throw(); + bool Alloc(unsigned blockSizeLog, unsigned numBlocksLog) throw(); + void Init(UInt64 size) throw(); MY_UNKNOWN_IMP2(ISequentialInStream, IInStream) STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize); |