C# 클래스 ICSharpCode.SharpZipLib.Samples.SZ.SharpZipArchiver

A command line archiver using the SharpZipLib compression library
파일 보기 프로젝트 열기: icsharpcode/SharpZipLib 1 사용 예제들

공개 메소드들

메소드 설명
CookZipEntryName ( string name, string stripPrefix, bool relativePath ) : string

'Cook' a name making it acceptable as a zip entry name.

Main ( string args ) : void

Entry point for program, creates archiver and runs it

비공개 메소드들

메소드 설명
Add ( ArrayList fileSpecs ) : void
AddFile ( string fileName ) : void

Add file to archive

AddFileSeekableOutput ( string file, string entryPath ) : void

Add a file were the output is seekable

AddFolder ( string folderName ) : void

Add an entry for a folder or directory

CompressFolder ( string basePath, bool recursiveSearch, string searchPattern ) : int

Compress contents of folder

CookZipEntryName ( string name ) : string

Make string into something acceptable as an entry name

Create ( ArrayList fileSpecifications ) : void

Create archives based on specifications passed and internal state

DecompressFile ( string fileName, string targetDir ) : bool

Decompress a file

Delete ( ArrayList fileSpecs ) : void

Delete entries from an archive

Execute ( string args ) : void

Parse command line arguments and 'execute' them.

Extract ( ArrayList fileSpecifications ) : void

Extract archives based on user input Allows simple wildcards to specify multiple archives

ExtractDirectory ( ZipInputStream inputStream, ZipEntry theEntry, string targetDir ) : void
ExtractFile ( ZipInputStream inputStream, ZipEntry theEntry, string targetDir ) : bool
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 based on the operating system they are from.

IsNumeric ( string rhs ) : bool

Determine if string is numeric [0-9]+

List ( ArrayList fileSpecifications ) : void

Execute List operation Currently only Zip files are supported

ListZip ( string fileName ) : void

List zip file contents using stream

ListZipViaZipFile ( string fileName ) : void

List zip file contents using ZipFile class

SetArgs ( string args ) : bool

Parse command line arguments. This is fairly flexible without using any custom classes. Arguments and options can appear in any order and are case insensitive. Arguments for options are indicated with an '=' as in -demo=argument, sometimes the '=' can be omitted as well secretly. Grouping of single character options is supported. The actual arguments and their handling is however a grab bag of ad-hoc things and its a bit messy. Could be a bit more rigorous about how things are done. Up side is almost anything is/can be allowed

ShowEnvironment ( ) : void

Show encoding/locale information

ShowHelp ( ) : void

Show help on possible options and arguments

ShowVersion ( ) : void

Display version information

Test ( ArrayList fileSpecs ) : void

메소드 상세

CookZipEntryName() 공개 정적인 메소드

'Cook' a name making it acceptable as a zip entry name.
public static CookZipEntryName ( string name, string stripPrefix, bool relativePath ) : string
name string name to cook
stripPrefix string String to remove from front of name if present
relativePath bool Make names relative if true or absolute if false
리턴 string

Main() 공개 정적인 메소드

Entry point for program, creates archiver and runs it
public static Main ( string args ) : void
args string /// Command line argument to process ///
리턴 void