Class TDiffMaker (unit DIFFMAKE)

Inherits from

TComponent

Suppose that you must send to smb. a 5mb file via e-mail (or other way) each two or three days. Suppose that only 8% of this file is changed and 92% of its contents remains the same. First time you send whole 5MB file. But after that you don't need to send all 5MB. You should use program which will "find" these 8%,"cut" them from the file and send only this small portion. And later on receiving side combine received 8% with old version of the file. TDiffMaker component compresses file taking into account previous file version. Data integrity is checked with CRC32 algorithm. For example we use TDiffMaker for compressing database dumps. Also TDiffMaker can be used for creating installation packages when newer version of program wasn't changed too much from older version. Now compressed with diffmaker files can be compressed with ordinary compression program (RAR,PKZIP,etc.).

Constructors


constructor Create(AOwner:TComponent);

-------------------------------------------------


Functions

procedure Compress;

Call this method to create delta file (OutFile) from new version of file (InFile) using information in old version of file (UseFile).

procedure Extract;

Call this method to apply delta file (InFile) to old file (UseFile) and create new file (OutFile) @see DiffStreamCompress, DiffStreamExtract

-------------------------------------------------


procedure InternalProcess(ACompress:boolean);

-------------------------------------------------

procedure SetCompLevel(V:Integer);

-------------------------------------------------

Properties

property CompLevel : Integer

This property specifies compression level.

property InFile : String

Input file name.

property OutFile : String

Output file name.

property UseFile : String

Use file name.

Events

Variables

FCompLevel : Integer;


FInFile : String;


FOutFile : String;


FUseFile : String;



Constructors


constructor Create(AOwner:TComponent);

-------------------------------------------------


Functions


procedure Compress;

Call this method to create delta file (OutFile) from new version of file (InFile) using information in old version of file (UseFile). @see DiffStreamCompress, DiffStreamExtract

-------------------------------------------------


procedure Extract;

Call this method to apply delta file (InFile) to old file (UseFile) and create new file (OutFile) @see DiffStreamCompress, DiffStreamExtract

-------------------------------------------------


procedure InternalProcess(ACompress:boolean);

-------------------------------------------------


procedure SetCompLevel(V:Integer);

-------------------------------------------------


Properties


property CompLevel : Integer

This property specifies compression level. Compression level can be from 10 (quickest compression, minimal compression ration) to 1000 (slowest compression, maximal compression ratio). Default value is 25.


property InFile : String

Input file name. When compressing input file is new version of file. When extracting input file is delta file.


property OutFile : String

Output file name. When compressing output file is delta file which will be created. When extracting output file is new version of file (old file plus applied delta) which will be created.


property UseFile : String

Use file name. This file will be used for compression/extraction. Specify old file version here.


Events


Variables


FCompLevel : Integer;


FInFile : String;


FOutFile : String;


FUseFile : String;