ICoder.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. // ICoder.h
  2. #ifndef __ICODER_H
  3. #define __ICODER_H
  4. #include "IStream.h"
  5. #define CODER_INTERFACE(i, x) DECL_INTERFACE(i, 4, x)
  6. CODER_INTERFACE(ICompressProgressInfo, 0x04)
  7. {
  8. STDMETHOD(SetRatioInfo)(const UInt64 *inSize, const UInt64 *outSize) PURE;
  9. };
  10. CODER_INTERFACE(ICompressCoder, 0x05)
  11. {
  12. STDMETHOD(Code)(ISequentialInStream *inStream,
  13. ISequentialOutStream *outStream,
  14. const UInt64 *inSize,
  15. const UInt64 *outSize,
  16. ICompressProgressInfo *progress) PURE;
  17. };
  18. CODER_INTERFACE(ICompressCoder2, 0x18)
  19. {
  20. STDMETHOD(Code)(ISequentialInStream **inStreams,
  21. const UInt64 **inSizes,
  22. UInt32 numInStreams,
  23. ISequentialOutStream **outStreams,
  24. const UInt64 **outSizes,
  25. UInt32 numOutStreams,
  26. ICompressProgressInfo *progress) PURE;
  27. };
  28. namespace NCoderPropID
  29. {
  30. enum EEnum
  31. {
  32. kDictionarySize = 0x400,
  33. kUsedMemorySize,
  34. kOrder,
  35. kPosStateBits = 0x440,
  36. kLitContextBits,
  37. kLitPosBits,
  38. kNumFastBytes = 0x450,
  39. kMatchFinder,
  40. kMatchFinderCycles,
  41. kNumPasses = 0x460,
  42. kAlgorithm = 0x470,
  43. kMultiThread = 0x480,
  44. kNumThreads,
  45. kEndMarker = 0x490
  46. };
  47. }
  48. CODER_INTERFACE(ICompressSetCoderProperties, 0x20)
  49. {
  50. STDMETHOD(SetCoderProperties)(const PROPID *propIDs,
  51. const PROPVARIANT *properties, UInt32 numProperties) PURE;
  52. };
  53. /*
  54. CODER_INTERFACE(ICompressSetCoderProperties, 0x21)
  55. {
  56. STDMETHOD(SetDecoderProperties)(ISequentialInStream *inStream) PURE;
  57. };
  58. */
  59. CODER_INTERFACE(ICompressSetDecoderProperties2, 0x22)
  60. {
  61. STDMETHOD(SetDecoderProperties2)(const Byte *data, UInt32 size) PURE;
  62. };
  63. CODER_INTERFACE(ICompressWriteCoderProperties, 0x23)
  64. {
  65. STDMETHOD(WriteCoderProperties)(ISequentialOutStream *outStreams) PURE;
  66. };
  67. CODER_INTERFACE(ICompressGetInStreamProcessedSize, 0x24)
  68. {
  69. STDMETHOD(GetInStreamProcessedSize)(UInt64 *value) PURE;
  70. };
  71. CODER_INTERFACE(ICompressSetCoderMt, 0x25)
  72. {
  73. STDMETHOD(SetNumberOfThreads)(UInt32 numThreads) PURE;
  74. };
  75. CODER_INTERFACE(ICompressGetSubStreamSize, 0x30)
  76. {
  77. STDMETHOD(GetSubStreamSize)(UInt64 subStream, UInt64 *value) PURE;
  78. };
  79. CODER_INTERFACE(ICompressSetInStream, 0x31)
  80. {
  81. STDMETHOD(SetInStream)(ISequentialInStream *inStream) PURE;
  82. STDMETHOD(ReleaseInStream)() PURE;
  83. };
  84. CODER_INTERFACE(ICompressSetOutStream, 0x32)
  85. {
  86. STDMETHOD(SetOutStream)(ISequentialOutStream *outStream) PURE;
  87. STDMETHOD(ReleaseOutStream)() PURE;
  88. };
  89. CODER_INTERFACE(ICompressSetInStreamSize, 0x33)
  90. {
  91. STDMETHOD(SetInStreamSize)(const UInt64 *inSize) PURE;
  92. };
  93. CODER_INTERFACE(ICompressSetOutStreamSize, 0x34)
  94. {
  95. STDMETHOD(SetOutStreamSize)(const UInt64 *outSize) PURE;
  96. };
  97. CODER_INTERFACE(ICompressFilter, 0x40)
  98. {
  99. STDMETHOD(Init)() PURE;
  100. STDMETHOD_(UInt32, Filter)(Byte *data, UInt32 size) PURE;
  101. // Filter return outSize (UInt32)
  102. // if (outSize <= size): Filter have converted outSize bytes
  103. // if (outSize > size): Filter have not converted anything.
  104. // and it needs at least outSize bytes to convert one block
  105. // (it's for crypto block algorithms).
  106. };
  107. CODER_INTERFACE(ICompressCodecsInfo, 0x60)
  108. {
  109. STDMETHOD(GetNumberOfMethods)(UInt32 *numMethods) PURE;
  110. STDMETHOD(GetProperty)(UInt32 index, PROPID propID, PROPVARIANT *value) PURE;
  111. STDMETHOD(CreateDecoder)(UInt32 index, const GUID *iid, void **coder) PURE;
  112. STDMETHOD(CreateEncoder)(UInt32 index, const GUID *iid, void **coder) PURE;
  113. };
  114. CODER_INTERFACE(ISetCompressCodecsInfo, 0x61)
  115. {
  116. STDMETHOD(SetCompressCodecsInfo)(ICompressCodecsInfo *compressCodecsInfo) PURE;
  117. };
  118. CODER_INTERFACE(ICryptoProperties, 0x80)
  119. {
  120. STDMETHOD(SetKey)(const Byte *data, UInt32 size) PURE;
  121. STDMETHOD(SetInitVector)(const Byte *data, UInt32 size) PURE;
  122. };
  123. /*
  124. CODER_INTERFACE(ICryptoResetSalt, 0x88)
  125. {
  126. STDMETHOD(ResetSalt)() PURE;
  127. };
  128. */
  129. CODER_INTERFACE(ICryptoResetInitVector, 0x8C)
  130. {
  131. STDMETHOD(ResetInitVector)() PURE;
  132. };
  133. CODER_INTERFACE(ICryptoSetPassword, 0x90)
  134. {
  135. STDMETHOD(CryptoSetPassword)(const Byte *data, UInt32 size) PURE;
  136. };
  137. CODER_INTERFACE(ICryptoSetCRC, 0xA0)
  138. {
  139. STDMETHOD(CryptoSetCRC)(UInt32 crc) PURE;
  140. };
  141. //////////////////////
  142. // It's for DLL file
  143. namespace NMethodPropID
  144. {
  145. enum EEnum
  146. {
  147. kID,
  148. kName,
  149. kDecoder,
  150. kEncoder,
  151. kInStreams,
  152. kOutStreams,
  153. kDescription,
  154. kDecoderIsAssigned,
  155. kEncoderIsAssigned
  156. };
  157. }
  158. #endif