Fingerprint_Card
Loading...
Searching...
No Matches
ICSharpCode.SharpZipLib.Zip.FastZip Class Reference

FastZip provides facilities for creating and extracting zip files. More...

Collaboration diagram for ICSharpCode.SharpZipLib.Zip.FastZip:

Public Types

enum  Overwrite { Prompt , Never , Always }
 Defines the desired handling when overwriting files during extraction. More...

Public Member Functions

 FastZip ()
 Initialise a default instance of FastZip.
 FastZip (FastZipEvents events)
 Initialise a new instance of FastZip
delegate bool ConfirmOverwriteDelegate (string fileName)
 Delegate called when confirming overwriting of files.
void CreateZip (string zipFileName, string sourceDirectory, bool recurse, string fileFilter, string directoryFilter)
 Create a zip file.
void CreateZip (string zipFileName, string sourceDirectory, bool recurse, string fileFilter)
 Create a zip file/archive.
void CreateZip (Stream outputStream, string sourceDirectory, bool recurse, string fileFilter, string directoryFilter)
 Create a zip archive sending output to the outputStream passed.
void ExtractZip (string zipFileName, string targetDirectory, string fileFilter)
 Extract the contents of a zip file.
void ExtractZip (string zipFileName, string targetDirectory, Overwrite overwrite, ConfirmOverwriteDelegate confirmDelegate, string fileFilter, string directoryFilter, bool restoreDateTime)
 Extract the contents of a zip file.
void ExtractZip (Stream inputStream, string targetDirectory, Overwrite overwrite, ConfirmOverwriteDelegate confirmDelegate, string fileFilter, string directoryFilter, bool restoreDateTime, bool isStreamOwner)
 Extract the contents of a zip file held in a stream.

Properties

bool CreateEmptyDirectories [get, set]
 Get/set a value indicating wether empty directories should be created.
string Password [get, set]
 Get / set the password value.
INameTransform NameTransform [get, set]
 Get or set the INameTransform active when creating Zip files.
IEntryFactory EntryFactory [get, set]
 Get or set the IEntryFactory active when creating Zip files.
UseZip64 UseZip64 [get, set]
 Gets or sets the setting for Zip64 handling when writing.
bool RestoreDateTimeOnExtract [get, set]
 Get/set a value indicating wether file dates and times should be restored when extracting files from an archive.
bool RestoreAttributesOnExtract [get, set]
 Get/set a value indicating wether file attributes should be restored during extract operations.

Private Member Functions

void ProcessDirectory (object sender, DirectoryEventArgs e)
void ProcessFile (object sender, ScanEventArgs e)
void AddFileContents (string name, Stream stream)
void ExtractFileEntry (ZipEntry entry, string targetName)
void ExtractEntry (ZipEntry entry)

Static Private Member Functions

static int MakeExternalAttributes (FileInfo info)
static bool NameIsValid (string name)

Private Attributes

bool continueRunning_
byte[] buffer_
ZipOutputStream outputStream_
ZipFile zipFile_
string sourceDirectory_
NameFilter fileFilter_
NameFilter directoryFilter_
Overwrite overwrite_
ConfirmOverwriteDelegate confirmDelegate_
bool restoreDateTimeOnExtract_
bool restoreAttributesOnExtract_
bool createEmptyDirectories_
FastZipEvents events_
IEntryFactory entryFactory_ = new ZipEntryFactory()
INameTransform extractNameTransform_
UseZip64 useZip64_ =UseZip64.Dynamic
string password_

Detailed Description

FastZip provides facilities for creating and extracting zip files.

Member Enumeration Documentation

◆ Overwrite

Defines the desired handling when overwriting files during extraction.

Enumerator
Prompt 

Prompt the user to confirm overwriting.

Never 

Never overwrite files.

Always 

Always overwrite files.

Constructor & Destructor Documentation

◆ FastZip() [1/2]

ICSharpCode.SharpZipLib.Zip.FastZip.FastZip ( )

Initialise a default instance of FastZip.

◆ FastZip() [2/2]

ICSharpCode.SharpZipLib.Zip.FastZip.FastZip ( FastZipEvents events)

Initialise a new instance of FastZip

Parameters
eventsThe events to use during operations.

Member Function Documentation

◆ AddFileContents()

void ICSharpCode.SharpZipLib.Zip.FastZip.AddFileContents ( string name,
Stream stream )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ConfirmOverwriteDelegate()

delegate bool ICSharpCode.SharpZipLib.Zip.FastZip.ConfirmOverwriteDelegate ( string fileName)

Delegate called when confirming overwriting of files.

Here is the caller graph for this function:

◆ CreateZip() [1/3]

void ICSharpCode.SharpZipLib.Zip.FastZip.CreateZip ( Stream outputStream,
string sourceDirectory,
bool recurse,
string fileFilter,
string directoryFilter )

Create a zip archive sending output to the outputStream passed.

Parameters
outputStreamThe stream to write archive data to.
sourceDirectoryThe directory to source files from.
recurseTrue to recurse directories, false for no recursion.
fileFilterThe file filter to apply.
directoryFilterThe directory filter to apply.

The outputStream is closed after creation.

Here is the call graph for this function:

◆ CreateZip() [2/3]

void ICSharpCode.SharpZipLib.Zip.FastZip.CreateZip ( string zipFileName,
string sourceDirectory,
bool recurse,
string fileFilter )

Create a zip file/archive.

Parameters
zipFileNameThe name of the zip file to create.
sourceDirectoryThe directory to obtain files and directories from.
recurseTrue to recurse directories, false for no recursion.
fileFilterThe file filter to apply.
Here is the call graph for this function:

◆ CreateZip() [3/3]

void ICSharpCode.SharpZipLib.Zip.FastZip.CreateZip ( string zipFileName,
string sourceDirectory,
bool recurse,
string fileFilter,
string directoryFilter )

Create a zip file.

Parameters
zipFileNameThe name of the zip file to create.
sourceDirectoryThe directory to source files from.
recurseTrue to recurse directories, false for no recursion.
fileFilterThe file filter to apply.
directoryFilterThe directory filter to apply.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ExtractEntry()

void ICSharpCode.SharpZipLib.Zip.FastZip.ExtractEntry ( ZipEntry entry)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ExtractFileEntry()

void ICSharpCode.SharpZipLib.Zip.FastZip.ExtractFileEntry ( ZipEntry entry,
string targetName )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ExtractZip() [1/3]

void ICSharpCode.SharpZipLib.Zip.FastZip.ExtractZip ( Stream inputStream,
string targetDirectory,
Overwrite overwrite,
ConfirmOverwriteDelegate confirmDelegate,
string fileFilter,
string directoryFilter,
bool restoreDateTime,
bool isStreamOwner )

Extract the contents of a zip file held in a stream.

Parameters
inputStreamThe seekable input stream containing the zip to extract from.
targetDirectoryThe directory to save extracted information in.
overwriteThe style of overwriting to apply.
confirmDelegateA delegate to invoke when confirming overwriting.
fileFilterA filter to apply to files.
directoryFilterA filter to apply to directories.
restoreDateTimeFlag indicating whether to restore the date and time for extracted files.
isStreamOwnerFlag indicating whether the inputStream will be closed by this method.
Here is the call graph for this function:

◆ ExtractZip() [2/3]

void ICSharpCode.SharpZipLib.Zip.FastZip.ExtractZip ( string zipFileName,
string targetDirectory,
Overwrite overwrite,
ConfirmOverwriteDelegate confirmDelegate,
string fileFilter,
string directoryFilter,
bool restoreDateTime )

Extract the contents of a zip file.

Parameters
zipFileNameThe zip file to extract from.
targetDirectoryThe directory to save extracted information in.
overwriteThe style of overwriting to apply.
confirmDelegateA delegate to invoke when confirming overwriting.
fileFilterA filter to apply to files.
directoryFilterA filter to apply to directories.
restoreDateTimeFlag indicating whether to restore the date and time for extracted files.
Here is the call graph for this function:

◆ ExtractZip() [3/3]

void ICSharpCode.SharpZipLib.Zip.FastZip.ExtractZip ( string zipFileName,
string targetDirectory,
string fileFilter )

Extract the contents of a zip file.

Parameters
zipFileNameThe zip file to extract from.
targetDirectoryThe directory to save extracted information in.
fileFilterA filter to apply to files.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MakeExternalAttributes()

int ICSharpCode.SharpZipLib.Zip.FastZip.MakeExternalAttributes ( FileInfo info)
staticprivate

◆ NameIsValid()

bool ICSharpCode.SharpZipLib.Zip.FastZip.NameIsValid ( string name)
staticprivate

◆ ProcessDirectory()

void ICSharpCode.SharpZipLib.Zip.FastZip.ProcessDirectory ( object sender,
DirectoryEventArgs e )
private
Here is the caller graph for this function:

◆ ProcessFile()

void ICSharpCode.SharpZipLib.Zip.FastZip.ProcessFile ( object sender,
ScanEventArgs e )
private
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ buffer_

byte [] ICSharpCode.SharpZipLib.Zip.FastZip.buffer_
private

◆ confirmDelegate_

ConfirmOverwriteDelegate ICSharpCode.SharpZipLib.Zip.FastZip.confirmDelegate_
private

◆ continueRunning_

bool ICSharpCode.SharpZipLib.Zip.FastZip.continueRunning_
private

◆ createEmptyDirectories_

bool ICSharpCode.SharpZipLib.Zip.FastZip.createEmptyDirectories_
private

◆ directoryFilter_

NameFilter ICSharpCode.SharpZipLib.Zip.FastZip.directoryFilter_
private

◆ entryFactory_

IEntryFactory ICSharpCode.SharpZipLib.Zip.FastZip.entryFactory_ = new ZipEntryFactory()
private

◆ events_

FastZipEvents ICSharpCode.SharpZipLib.Zip.FastZip.events_
private

◆ extractNameTransform_

INameTransform ICSharpCode.SharpZipLib.Zip.FastZip.extractNameTransform_
private

◆ fileFilter_

NameFilter ICSharpCode.SharpZipLib.Zip.FastZip.fileFilter_
private

◆ outputStream_

ZipOutputStream ICSharpCode.SharpZipLib.Zip.FastZip.outputStream_
private

◆ overwrite_

Overwrite ICSharpCode.SharpZipLib.Zip.FastZip.overwrite_
private

◆ password_

string ICSharpCode.SharpZipLib.Zip.FastZip.password_
private

◆ restoreAttributesOnExtract_

bool ICSharpCode.SharpZipLib.Zip.FastZip.restoreAttributesOnExtract_
private

◆ restoreDateTimeOnExtract_

bool ICSharpCode.SharpZipLib.Zip.FastZip.restoreDateTimeOnExtract_
private

◆ sourceDirectory_

string ICSharpCode.SharpZipLib.Zip.FastZip.sourceDirectory_
private

◆ useZip64_

UseZip64 ICSharpCode.SharpZipLib.Zip.FastZip.useZip64_ =UseZip64.Dynamic
private

◆ zipFile_

ZipFile ICSharpCode.SharpZipLib.Zip.FastZip.zipFile_
private

Property Documentation

◆ CreateEmptyDirectories

bool ICSharpCode.SharpZipLib.Zip.FastZip.CreateEmptyDirectories
getset

Get/set a value indicating wether empty directories should be created.

◆ EntryFactory

IEntryFactory ICSharpCode.SharpZipLib.Zip.FastZip.EntryFactory
getset

Get or set the IEntryFactory active when creating Zip files.

◆ NameTransform

INameTransform ICSharpCode.SharpZipLib.Zip.FastZip.NameTransform
getset

Get or set the INameTransform active when creating Zip files.

See also
EntryFactory

◆ Password

string ICSharpCode.SharpZipLib.Zip.FastZip.Password
getset

Get / set the password value.

◆ RestoreAttributesOnExtract

bool ICSharpCode.SharpZipLib.Zip.FastZip.RestoreAttributesOnExtract
getset

Get/set a value indicating wether file attributes should be restored during extract operations.

◆ RestoreDateTimeOnExtract

bool ICSharpCode.SharpZipLib.Zip.FastZip.RestoreDateTimeOnExtract
getset

Get/set a value indicating wether file dates and times should be restored when extracting files from an archive.

The default value is false.

◆ UseZip64

UseZip64 ICSharpCode.SharpZipLib.Zip.FastZip.UseZip64
getset

Gets or sets the setting for Zip64 handling when writing.

The default value is dynamic which is not backwards compatible with old programs and can cause problems with XP's built in compression which cant read Zip64 archives. However it does avoid the situation were a large file is added and cannot be completed correctly. NOTE: Setting the size for entries before they are added is the best solution! By default the EntryFactory used by FastZip will set fhe file size.


The documentation for this class was generated from the following file: