Class TCabinetWriter (unit Cabinet) |
Inherits from
TCabinetInterface
TCabinetWriter class -- for compressing files into a new cabinet file
DoFileStatus
DoFolderStatus
DoCabinetStatus
DoGetNextCabinet
DoFilePlaced
DoGetTempFile
DoGetOpenInfo
The virtual equivalents of their respective event handlers
(OnFileStatus etc.). These implement the minimal functionality required
for creating cabinets in the file system. In order to work with
non-file-system data, such as memory-mapped files or custom streams,
they must be overridden, or the event handlers assigned, to provide
the additional functionality
Open
Create a cabinet file for compression. CabinetFileName specifies the
file name. DiskName specifies the initial disk name (may be empty).
MaximumCabSize specifies the maximum size of the cabinet.
FolderThreshold specifies the folder threshold, which seems to be the
size, in bytes, of each logical cabinet folder. SetId specifies an
application-specific identifier that is stored in the cabinet
Close
Close the cabinet
AddFile
Add a file to the opened cabinet. SourceFileName specifies the name of
the file to add. DestFileName specifies the name as it is stored in the
cabinet. Specify afoExecuteOnExtract for Options if the file should be
executed upon extraction. Compression specifies the compression
parameters; use the MakeNoCompression, MakeMsZipCompression and
MakeLzxCompression helper functions to construct a value
FlushCabinet
Flush the cabinet. If GetNextCabinet is set to True, the
OnGetNextCabinet event is called to request further cabinet
information
FlushFolder
Flush the current folder and reset the compression state data
Properties:
Context
The FCI context
FailOnIncompressible
Fail compression if a file is found to be incompressible (compressed
size exceeds uncompressed size)
Events:
OnFileStatus
OnFolderStatus
OnCabinetStatus
OnGetNextCabinet
OnFilePlacedEvent
OnGetOpenInfo
OnGetTempFile
constructor Create (AOwner : TComponent);
procedure AddFile (const SourceFileName, DestFileName : string;
const Options : TAddFileOptions;
const Compression : TCompressionParameters);
procedure Close;
destructor Destroy;
procedure FlushCabinet (GetNextCabinet : Boolean);
procedure FlushFolder;
procedure Open (const CabinetFileName, DiskName : string;
MaximumCabSize, FolderThreshold, SetId : Longint);
procedure DoCabinetStatus (PreEstimatedSize, ActualSize : Longint;
var WantedSize : Longint);
procedure DoFilePlaced (var CabParameters : TCCAB;
const FileName : string; FileLength : Longint; Continuation : Boolean;
var AbortProcessing : Boolean);
procedure DoFileStatus (CompressedSize, UncompressedSize : Longint;
var ResultCode : Integer);
TCabinetWriter
procedure DoFolderStatus (SizeCopied, TotalSize : Longint;
var ResultCode : Integer);
procedure DoGetNextCabinet (var CabParameters : TCCAB;
var NewCabFileName : string; PreviousCabEstimatedSize : Longint;
var AbortCreation : Boolean);
procedure DoGetOpenInfo (const FileName : string; var Date, Time,
Attributes : Smallint; var FileHandle, ResultCode : Longint);
procedure DoGetTempFile (var TempFileName : string;
var Success : Boolean);
property FailOnIncompressible : Boolean
property FileHandler :
property FileSupport : Boolean
property Context : HFCI
event OnCabinetStatus : TCabinetStatusEvent
event OnFilePlacedEvent : TFilePlacedEvent
event OnFileStatus : TFileStatusEvent
event OnFolderStatus : TFolderStatusEvent
event OnGetNextCabinet : TGetNextCabinetEvent
event OnGetOpenInfo : TGetOpenInfoEvent
event OnGetTempFile : TGetTempFileEvent
FContext : HFCI;
FFailOnIncompressible : Boolean;
FFileSupport : Boolean;
FOnCabinetStatus : TCabinetStatusEvent;
FOnFilePlacedEvent : TFilePlacedEvent;
FOnFileStatus : TFileStatusEvent;
FOnFolderStatus : TFolderStatusEvent;
FOnGetNextCabinet : TGetNextCabinetEvent;
FOnGetOpenInfo : TGetOpenInfoEvent;
FOnGetTempFile : TGetTempFileEvent;
constructor Create (AOwner : TComponent);
procedure AddFile (const SourceFileName, DestFileName : string;
const Options : TAddFileOptions;
const Compression : TCompressionParameters);
procedure Close;
destructor Destroy;
procedure FlushCabinet (GetNextCabinet : Boolean);
procedure FlushFolder;
procedure Open (const CabinetFileName, DiskName : string;
MaximumCabSize, FolderThreshold, SetId : Longint);
procedure DoCabinetStatus (PreEstimatedSize, ActualSize : Longint;
var WantedSize : Longint);
procedure DoFilePlaced (var CabParameters : TCCAB;
const FileName : string; FileLength : Longint; Continuation : Boolean;
var AbortProcessing : Boolean);
procedure DoFileStatus (CompressedSize, UncompressedSize : Longint;
var ResultCode : Integer);
TCabinetWriter
procedure DoFolderStatus (SizeCopied, TotalSize : Longint;
var ResultCode : Integer);
procedure DoGetNextCabinet (var CabParameters : TCCAB;
var NewCabFileName : string; PreviousCabEstimatedSize : Longint;
var AbortCreation : Boolean);
procedure DoGetOpenInfo (const FileName : string; var Date, Time,
Attributes : Smallint; var FileHandle, ResultCode : Longint);
procedure DoGetTempFile (var TempFileName : string;
var Success : Boolean);
property FailOnIncompressible : Boolean
property FileHandler :
property FileSupport : Boolean
property Context : HFCI
event OnCabinetStatus : TCabinetStatusEvent
event OnFilePlacedEvent : TFilePlacedEvent
event OnFileStatus : TFileStatusEvent
event OnFolderStatus : TFolderStatusEvent
event OnGetNextCabinet : TGetNextCabinetEvent
event OnGetOpenInfo : TGetOpenInfoEvent
event OnGetTempFile : TGetTempFileEvent
FContext : HFCI;
FFailOnIncompressible : Boolean;
FFileSupport : Boolean;
FOnCabinetStatus : TCabinetStatusEvent;
FOnFilePlacedEvent : TFilePlacedEvent;
FOnFileStatus : TFileStatusEvent;
FOnFolderStatus : TFolderStatusEvent;
FOnGetNextCabinet : TGetNextCabinetEvent;
FOnGetOpenInfo : TGetOpenInfoEvent;
FOnGetTempFile : TGetTempFileEvent;