C# Class POLLaunch.DataBackup.ZipFileArchiver

ファイルを表示 Open project: polserver/poltools Class Usage Examples

Public Methods

Method Description
Create ( string zipFileName, ArrayList fileSpecs, System.Windows.Forms.ToolStripProgressBar &ProgressBar ) : void

Create archives based on specifications passed and internal state

Execute ( string newZipFilename, System.Windows.Forms.ToolStripProgressBar &ProgressBar ) : void

Handle Filenames and execute Creation of the Zip unless none was passed.

ProcessFile ( object sender, ScanEventArgs args ) : void

Callback for adding a new file.

ZipFileArchiver ( ) : System

Base constructor - initializes all fields to default values

Private Methods

Method Description
BuildFileList ( ) : bool

Build the fileSpecs_ List of files to add to the archive.

GetBuffer ( ) : byte[]
GetCompressionRatio ( long packedSize, long unpackedSize ) : int

Calculate compression ratio as a percentage Doesnt allow for expansion (ratio > 100) as the resulting strings can get huge easily

InterpretExternalAttributes ( int operatingSystem, int attributes ) : string

Interpret attributes in conjunction with operatingSystem

IsNumeric ( string rhs ) : bool

Determine if string is numeric [0-9]+

MakeExternalAttributes ( FileInfo info ) : int

Make external attributes suitable for a ZipEntry

WildcardToRegex ( string wildcard ) : string

Convert a wildcard expression to a regular expression

Method Details

Create() public method

Create archives based on specifications passed and internal state
public Create ( string zipFileName, ArrayList fileSpecs, System.Windows.Forms.ToolStripProgressBar &ProgressBar ) : void
zipFileName string
fileSpecs System.Collections.ArrayList
ProgressBar System.Windows.Forms.ToolStripProgressBar
return void

Execute() public method

Handle Filenames and execute Creation of the Zip unless none was passed.
public Execute ( string newZipFilename, System.Windows.Forms.ToolStripProgressBar &ProgressBar ) : void
newZipFilename string
ProgressBar System.Windows.Forms.ToolStripProgressBar
return void

ProcessFile() public method

Callback for adding a new file.
public ProcessFile ( object sender, ScanEventArgs args ) : void
sender object The scanner calling this delegate.
args ICSharpCode.SharpZipLib.Core.ScanEventArgs The event arguments.
return void

ZipFileArchiver() public method

Base constructor - initializes all fields to default values
public ZipFileArchiver ( ) : System
return System