1baa3858d3f5d128a5c8466b700098109edcad5f2repo sync// ICoder.h 2baa3858d3f5d128a5c8466b700098109edcad5f2repo sync 3baa3858d3f5d128a5c8466b700098109edcad5f2repo syncusing System; 4baa3858d3f5d128a5c8466b700098109edcad5f2repo sync 5baa3858d3f5d128a5c8466b700098109edcad5f2repo syncnamespace SevenZip 6baa3858d3f5d128a5c8466b700098109edcad5f2repo sync{ 7baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// <summary> 8baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// The exception that is thrown when an error in input stream occurs during decoding. 9baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// </summary> 10baa3858d3f5d128a5c8466b700098109edcad5f2repo sync class DataErrorException : ApplicationException 11baa3858d3f5d128a5c8466b700098109edcad5f2repo sync { 12baa3858d3f5d128a5c8466b700098109edcad5f2repo sync public DataErrorException(): base("Data Error") { } 13baa3858d3f5d128a5c8466b700098109edcad5f2repo sync } 14baa3858d3f5d128a5c8466b700098109edcad5f2repo sync 15baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// <summary> 16baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// The exception that is thrown when the value of an argument is outside the allowable range. 17baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// </summary> 18baa3858d3f5d128a5c8466b700098109edcad5f2repo sync class InvalidParamException : ApplicationException 19baa3858d3f5d128a5c8466b700098109edcad5f2repo sync { 20baa3858d3f5d128a5c8466b700098109edcad5f2repo sync public InvalidParamException(): base("Invalid Parameter") { } 21baa3858d3f5d128a5c8466b700098109edcad5f2repo sync } 22baa3858d3f5d128a5c8466b700098109edcad5f2repo sync 23baa3858d3f5d128a5c8466b700098109edcad5f2repo sync public interface ICodeProgress 24baa3858d3f5d128a5c8466b700098109edcad5f2repo sync { 25baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// <summary> 26baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// Callback progress. 27baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// </summary> 28baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// <param name="inSize"> 29baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// input size. -1 if unknown. 30baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// </param> 31baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// <param name="outSize"> 32baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// output size. -1 if unknown. 33baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// </param> 34baa3858d3f5d128a5c8466b700098109edcad5f2repo sync void SetProgress(Int64 inSize, Int64 outSize); 35baa3858d3f5d128a5c8466b700098109edcad5f2repo sync }; 36baa3858d3f5d128a5c8466b700098109edcad5f2repo sync 37baa3858d3f5d128a5c8466b700098109edcad5f2repo sync public interface ICoder 38baa3858d3f5d128a5c8466b700098109edcad5f2repo sync { 39baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// <summary> 40baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// Codes streams. 41baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// </summary> 42baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// <param name="inStream"> 43baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// input Stream. 44baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// </param> 45baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// <param name="outStream"> 46baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// output Stream. 47baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// </param> 48baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// <param name="inSize"> 49baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// input Size. -1 if unknown. 50baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// </param> 51baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// <param name="outSize"> 52baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// output Size. -1 if unknown. 53baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// </param> 54baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// <param name="progress"> 55baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// callback progress reference. 56baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// </param> 57baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// <exception cref="SevenZip.DataErrorException"> 58baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// if input stream is not valid 59baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// </exception> 60baa3858d3f5d128a5c8466b700098109edcad5f2repo sync void Code(System.IO.Stream inStream, System.IO.Stream outStream, 61baa3858d3f5d128a5c8466b700098109edcad5f2repo sync Int64 inSize, Int64 outSize, ICodeProgress progress); 62baa3858d3f5d128a5c8466b700098109edcad5f2repo sync }; 63baa3858d3f5d128a5c8466b700098109edcad5f2repo sync 64baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /* 65baa3858d3f5d128a5c8466b700098109edcad5f2repo sync public interface ICoder2 66baa3858d3f5d128a5c8466b700098109edcad5f2repo sync { 67baa3858d3f5d128a5c8466b700098109edcad5f2repo sync void Code(ISequentialInStream []inStreams, 68baa3858d3f5d128a5c8466b700098109edcad5f2repo sync const UInt64 []inSizes, 69baa3858d3f5d128a5c8466b700098109edcad5f2repo sync ISequentialOutStream []outStreams, 70baa3858d3f5d128a5c8466b700098109edcad5f2repo sync UInt64 []outSizes, 71baa3858d3f5d128a5c8466b700098109edcad5f2repo sync ICodeProgress progress); 72baa3858d3f5d128a5c8466b700098109edcad5f2repo sync }; 73baa3858d3f5d128a5c8466b700098109edcad5f2repo sync */ 74baa3858d3f5d128a5c8466b700098109edcad5f2repo sync 75baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// <summary> 76baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// Provides the fields that represent properties idenitifiers for compressing. 77baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// </summary> 78baa3858d3f5d128a5c8466b700098109edcad5f2repo sync public enum CoderPropID 79baa3858d3f5d128a5c8466b700098109edcad5f2repo sync { 80baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// <summary> 81baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// Specifies default property. 82baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// </summary> 83baa3858d3f5d128a5c8466b700098109edcad5f2repo sync DefaultProp = 0, 84baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// <summary> 85baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// Specifies size of dictionary. 86baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// </summary> 87baa3858d3f5d128a5c8466b700098109edcad5f2repo sync DictionarySize, 88baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// <summary> 89baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// Specifies size of memory for PPM*. 90baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// </summary> 91baa3858d3f5d128a5c8466b700098109edcad5f2repo sync UsedMemorySize, 92baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// <summary> 93baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// Specifies order for PPM methods. 94baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// </summary> 95baa3858d3f5d128a5c8466b700098109edcad5f2repo sync Order, 96baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// <summary> 97baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// Specifies Block Size. 98baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// </summary> 99baa3858d3f5d128a5c8466b700098109edcad5f2repo sync BlockSize, 100baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// <summary> 101baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// Specifies number of postion state bits for LZMA (0 <= x <= 4). 102baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// </summary> 103baa3858d3f5d128a5c8466b700098109edcad5f2repo sync PosStateBits, 104baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// <summary> 105baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// Specifies number of literal context bits for LZMA (0 <= x <= 8). 106baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// </summary> 107baa3858d3f5d128a5c8466b700098109edcad5f2repo sync LitContextBits, 108baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// <summary> 109baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// Specifies number of literal position bits for LZMA (0 <= x <= 4). 110baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// </summary> 111baa3858d3f5d128a5c8466b700098109edcad5f2repo sync LitPosBits, 112baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// <summary> 113baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// Specifies number of fast bytes for LZ*. 114baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// </summary> 115baa3858d3f5d128a5c8466b700098109edcad5f2repo sync NumFastBytes, 116baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// <summary> 117baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// Specifies match finder. LZMA: "BT2", "BT4" or "BT4B". 118baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// </summary> 119baa3858d3f5d128a5c8466b700098109edcad5f2repo sync MatchFinder, 120baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// <summary> 121baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// Specifies the number of match finder cyckes. 122baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// </summary> 123baa3858d3f5d128a5c8466b700098109edcad5f2repo sync MatchFinderCycles, 124baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// <summary> 125baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// Specifies number of passes. 126baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// </summary> 127baa3858d3f5d128a5c8466b700098109edcad5f2repo sync NumPasses, 128baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// <summary> 129baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// Specifies number of algorithm. 130baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// </summary> 131baa3858d3f5d128a5c8466b700098109edcad5f2repo sync Algorithm, 132baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// <summary> 133baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// Specifies the number of threads. 134baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// </summary> 135baa3858d3f5d128a5c8466b700098109edcad5f2repo sync NumThreads, 136baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// <summary> 137baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// Specifies mode with end marker. 138baa3858d3f5d128a5c8466b700098109edcad5f2repo sync /// </summary> 139baa3858d3f5d128a5c8466b700098109edcad5f2repo sync EndMarker 140baa3858d3f5d128a5c8466b700098109edcad5f2repo sync }; 141baa3858d3f5d128a5c8466b700098109edcad5f2repo sync 142baa3858d3f5d128a5c8466b700098109edcad5f2repo sync 143baa3858d3f5d128a5c8466b700098109edcad5f2repo sync public interface ISetCoderProperties 144baa3858d3f5d128a5c8466b700098109edcad5f2repo sync { 145baa3858d3f5d128a5c8466b700098109edcad5f2repo sync void SetCoderProperties(CoderPropID[] propIDs, object[] properties); 146baa3858d3f5d128a5c8466b700098109edcad5f2repo sync }; 147baa3858d3f5d128a5c8466b700098109edcad5f2repo sync 148baa3858d3f5d128a5c8466b700098109edcad5f2repo sync public interface IWriteCoderProperties 149baa3858d3f5d128a5c8466b700098109edcad5f2repo sync { 150baa3858d3f5d128a5c8466b700098109edcad5f2repo sync void WriteCoderProperties(System.IO.Stream outStream); 151baa3858d3f5d128a5c8466b700098109edcad5f2repo sync } 152baa3858d3f5d128a5c8466b700098109edcad5f2repo sync 153baa3858d3f5d128a5c8466b700098109edcad5f2repo sync public interface ISetDecoderProperties 154baa3858d3f5d128a5c8466b700098109edcad5f2repo sync { 155baa3858d3f5d128a5c8466b700098109edcad5f2repo sync void SetDecoderProperties(byte[] properties); 156baa3858d3f5d128a5c8466b700098109edcad5f2repo sync } 157baa3858d3f5d128a5c8466b700098109edcad5f2repo sync} 158