Mercurial > vba-linux
diff src/win32/7zip/7z/CPP/7zip/IStream.h @ 1:f9f4f1b99eed
importing src directory
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sat, 03 Mar 2012 10:31:27 -0600 |
parents | |
children |
line wrap: on
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/win32/7zip/7z/CPP/7zip/IStream.h Sat Mar 03 10:31:27 2012 -0600 1.3 @@ -0,0 +1,58 @@ 1.4 +// IStream.h 1.5 + 1.6 +#ifndef __ISTREAM_H 1.7 +#define __ISTREAM_H 1.8 + 1.9 +#include "../Common/MyUnknown.h" 1.10 +#include "../Common/Types.h" 1.11 + 1.12 +#include "IDecl.h" 1.13 + 1.14 +#define STREAM_INTERFACE_SUB(i, base, x) DECL_INTERFACE_SUB(i, base, 3, x) 1.15 +#define STREAM_INTERFACE(i, x) STREAM_INTERFACE_SUB(i, IUnknown, x) 1.16 + 1.17 +STREAM_INTERFACE(ISequentialInStream, 0x01) 1.18 +{ 1.19 + STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize) PURE; 1.20 + /* 1.21 + Out: if size != 0, return_value = S_OK and (*processedSize == 0), 1.22 + then there are no more bytes in stream. 1.23 + if (size > 0) && there are bytes in stream, 1.24 + this function must read at least 1 byte. 1.25 + This function is allowed to read less than number of remaining bytes in stream. 1.26 + You must call Read function in loop, if you need exact amount of data 1.27 + */ 1.28 +}; 1.29 + 1.30 +STREAM_INTERFACE(ISequentialOutStream, 0x02) 1.31 +{ 1.32 + STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize) PURE; 1.33 + /* 1.34 + if (size > 0) this function must write at least 1 byte. 1.35 + This function is allowed to write less than "size". 1.36 + You must call Write function in loop, if you need to write exact amount of data 1.37 + */ 1.38 +}; 1.39 + 1.40 +STREAM_INTERFACE_SUB(IInStream, ISequentialInStream, 0x03) 1.41 +{ 1.42 + STDMETHOD(Seek)(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition) PURE; 1.43 +}; 1.44 + 1.45 +STREAM_INTERFACE_SUB(IOutStream, ISequentialOutStream, 0x04) 1.46 +{ 1.47 + STDMETHOD(Seek)(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition) PURE; 1.48 + STDMETHOD(SetSize)(Int64 newSize) PURE; 1.49 +}; 1.50 + 1.51 +STREAM_INTERFACE(IStreamGetSize, 0x06) 1.52 +{ 1.53 + STDMETHOD(GetSize)(UInt64 *size) PURE; 1.54 +}; 1.55 + 1.56 +STREAM_INTERFACE(IOutStreamFlush, 0x07) 1.57 +{ 1.58 + STDMETHOD(Flush)() PURE; 1.59 +}; 1.60 + 1.61 +#endif