System.Zip.TZipFile.Add
Delphi
procedure Add(const FileName: string; const ArchiveFileName: string = '';
Compression: TZipCompression = zcDeflate); overload;
procedure Add(Data: TBytes; const ArchiveFileName: string; Compression: TZipCompression = zcDeflate); overload;
procedure Add(Data: TStream; const ArchiveFileName: string; Compression: TZipCompression = zcDeflate;
AExternalAttributes: TFileAttributes = []); overload;
procedure Add(Data: TStream; LocalHeader: TZipHeader; CentralHeader: PZipHeader = nil); overload;
C++
void __fastcall Add(const System::UnicodeString FileName, const System::UnicodeString ArchiveFileName = System::UnicodeString(), TZipCompression Compression = (TZipCompression)(0x8))/* overload */;
void __fastcall Add(System::DynamicArray<System::Byte> Data, const System::UnicodeString ArchiveFileName, TZipCompression Compression = (TZipCompression)(0x8))/* overload */;
void __fastcall Add(System::Classes::TStream* Data, const System::UnicodeString ArchiveFileName, TZipCompression Compression = (TZipCompression)(0x8), System::Ioutils::TFileAttributes AExternalAttributes = System::Ioutils::TFileAttributes() )/* overload */;
void __fastcall Add(System::Classes::TStream* Data, const TZipHeader &LocalHeader, PZipHeader CentralHeader = (PZipHeader)(0x0))/* overload */;
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
procedure function |
public | System.Zip.pas System.Zip.hpp |
System.Zip | TZipFile |
Description
Adds a memory file to the .zip file.
There are four overloads of this function, depending on the data that is added to the archive. Data can be added to the archive using the absolute path of a file, a TStream, or an array of bytes.
FileName
represents the name of the file to be added.
ArchiveFileName
is the full path of the file in the archive. If the parameter is not specified, the default value isExtractFileName(FileName)
.
Compression
indicates the compression mode; the default value iszcDeflate
.
AExternalAttributes
represents the external attributes of the file.
LocalHeader
is the local header data.
CentralHeader
is a Pointer to an optional central header. If no central header is provided, the local header information is used.
To track the progress of the operation, use OnProgress.