other-licenses/7zstub/src/7zip/IStream.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/other-licenses/7zstub/src/7zip/IStream.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,62 @@
     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 +// "23170F69-40C1-278A-0000-000300xx0000"
    1.13 +
    1.14 +#define STREAM_INTERFACE_SUB(i, b, x) \
    1.15 +DEFINE_GUID(IID_ ## i, \
    1.16 +0x23170F69, 0x40C1, 0x278A, 0x00, 0x00, 0x00, 0x03, 0x00, x, 0x00, 0x00); \
    1.17 +struct i: public b
    1.18 +
    1.19 +#define STREAM_INTERFACE(i, x) STREAM_INTERFACE_SUB(i, IUnknown, x)
    1.20 +
    1.21 +STREAM_INTERFACE(ISequentialInStream, 0x01)
    1.22 +{
    1.23 +  STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize) PURE;
    1.24 +  /*
    1.25 +  Out: if size != 0, return_value = S_OK and (*processedSize == 0),
    1.26 +    then there are no more bytes in stream.
    1.27 +  if (size > 0) && there are bytes in stream, 
    1.28 +  this function must read at least 1 byte.
    1.29 +  This function is allowed to read less than number of remaining bytes in stream.
    1.30 +  You must call Read function in loop, if you need exact amount of data
    1.31 +  */
    1.32 +};
    1.33 +
    1.34 +STREAM_INTERFACE(ISequentialOutStream, 0x02)
    1.35 +{
    1.36 +  STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize) PURE;
    1.37 +  /*
    1.38 +  if (size > 0) this function must write at least 1 byte.
    1.39 +  This function is allowed to write less than "size".
    1.40 +  You must call Write function in loop, if you need to write exact amount of data
    1.41 +  */
    1.42 +};
    1.43 +
    1.44 +STREAM_INTERFACE_SUB(IInStream, ISequentialInStream, 0x03)
    1.45 +{
    1.46 +  STDMETHOD(Seek)(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition) PURE;
    1.47 +};
    1.48 +
    1.49 +STREAM_INTERFACE_SUB(IOutStream, ISequentialOutStream, 0x04)
    1.50 +{
    1.51 +  STDMETHOD(Seek)(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition) PURE;
    1.52 +  STDMETHOD(SetSize)(Int64 newSize) PURE;
    1.53 +};
    1.54 +
    1.55 +STREAM_INTERFACE(IStreamGetSize, 0x06)
    1.56 +{
    1.57 +  STDMETHOD(GetSize)(UInt64 *size) PURE;
    1.58 +};
    1.59 +
    1.60 +STREAM_INTERFACE(IOutStreamFlush, 0x07)
    1.61 +{
    1.62 +  STDMETHOD(Flush)() PURE;
    1.63 +};
    1.64 +
    1.65 +#endif

mercurial