C# 클래스 ICSharpCode.SharpZipLib.Zip.ZipFile

상속: IEnumerable, IDisposable
파일 보기 프로젝트 열기: fanfeilong/exceltk 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
KeysRequired KeysRequiredEventHandler

Private Properties

프로퍼티 타입 설명
AddEntry void
AddUpdate void
CheckClassicPassword void
CheckUpdating void
CopyBytes void
CopyDescriptorBytes void
CopyDescriptorBytesDirect void
CopyEntry void
CopyEntryDataDirect void
CopyEntryDirect void
CreateAndInitDecryptionStream Stream
CreateAndInitEncryptionStream Stream
DisposeInternal void
FindExistingUpdate int
FindExistingUpdate int
GetBuffer byte[]
GetDescriptorSize int
GetOutputStream Stream
GetTransformedDirectoryName string
GetTransformedFileName string
LocateBlockWithSignature long
LocateEntry long
ModifyEntry void
OnKeysRequired void
PostUpdateCleanup void
ReadEntries void
ReadLEUint uint
ReadLEUlong ulong
ReadLEUshort ushort
Reopen void
Reopen void
RunUpdates void
TestLocalHeader long
UpdateCommentOnly void
UpdateComparer int
WriteCentralDirectoryHeader int
WriteEncryptionHeader void
WriteLEInt void
WriteLEShort void
WriteLEUint void
WriteLEUlong void
WriteLEUshort void
WriteLeLong void
WriteLocalEntryHeader void
ZipFile System
this ZipEntry

공개 메소드들

메소드 설명
AbortUpdate ( ) : void

Abort updating leaving the archive unchanged.

Add ( IStaticDataSource dataSource, string entryName ) : void

Add a file entry with data.

Add ( IStaticDataSource dataSource, string entryName, CompressionMethod compressionMethod ) : void

Add a file entry with data.

Add ( IStaticDataSource dataSource, string entryName, CompressionMethod compressionMethod, bool useUnicodeText ) : void

Add a file entry with data.

Add ( ZipEntry entry ) : void

Add a ZipEntry that contains no data.

This can be used to add directories, volume labels, or empty file entries.

Add ( string fileName ) : void

Add a file to the archive.

Add ( string fileName, CompressionMethod compressionMethod ) : void

Add a new entry to the archive.

Add ( string fileName, CompressionMethod compressionMethod, bool useUnicodeText ) : void

Add a new entry to the archive.

Add ( string fileName, string entryName ) : void

Add a file to the archive.

AddDirectory ( string directoryName ) : void

Add a directory entry to the archive.

BeginUpdate ( ) : void

Begin updating this ZipFile archive.

BeginUpdate ( IArchiveStorage archiveStorage ) : void

Begin updating to this ZipFile archive.

BeginUpdate ( IArchiveStorage archiveStorage, IDynamicDataSource dataSource ) : void

Begin updating this ZipFile archive.

Close ( ) : void

Closes the ZipFile. If the stream is owned then this also closes the underlying input stream. Once closed, no further instance methods should be called.

CommitUpdate ( ) : void

Commit current updates, updating this archive.

Create ( Stream outStream ) : ZipFile

Create a new ZipFile whose data will be stored on a stream.

Create ( string fileName ) : ZipFile

Create a new ZipFile whose data will be stored in a file.

Delete ( string fileName ) : bool

Delete an entry by name

Delete ( ZipEntry entry ) : void

Delete a ZipEntry from the archive.

Dispose ( ) : void
FindEntry ( string name, bool ignoreCase ) : int

Return the index of the entry with a matching name

GetEntry ( string name ) : ZipEntry

Searches for a zip entry in this archive with the given name. String comparisons are case insensitive

GetEnumerator ( ) : IEnumerator

Gets an enumerator for the Zip entries in this Zip file.

GetInputStream ( ZipEntry entry ) : Stream

Gets an input stream for reading the given zip entry data in an uncompressed form. Normally the ZipEntry should be an entry returned by GetEntry().

GetInputStream ( long entryIndex ) : Stream

Creates an input stream reading a zip entry

SetComment ( string comment ) : void

Set the file comment to be recorded when the current update is commited.

TestArchive ( bool testData ) : bool

Test an archive for integrity/validity

Testing will terminate on the first error found.

TestArchive ( bool testData, TestStrategy strategy, ZipTestResultHandler resultHandler ) : bool

Test an archive for integrity/validity

ZipFile ( FileStream file ) : System

Opens a Zip file reading the given FileStream.

ZipFile ( Stream stream ) : System

Opens a Zip file reading the given Stream.

ZipFile ( string name ) : System

Opens a Zip file with the given name for reading.

보호된 메소드들

메소드 설명
Dispose ( bool disposing ) : void

Releases the unmanaged resources used by the this instance and optionally releases the managed resources.

비공개 메소드들

메소드 설명
AddEntry ( ZipFile workFile, ZipUpdate update ) : void
AddUpdate ( ZipUpdate update ) : void
CheckClassicPassword ( CryptoStream classicCryptoStream, ZipEntry entry ) : void
CheckUpdating ( ) : void
CopyBytes ( ZipUpdate update, Stream destination, Stream source, long bytesToCopy, bool updateCrc ) : void
CopyDescriptorBytes ( ZipUpdate update, Stream dest, Stream source ) : void
CopyDescriptorBytesDirect ( ZipUpdate update, Stream stream, long &destinationPosition, long sourcePosition ) : void
CopyEntry ( ZipFile workFile, ZipUpdate update ) : void
CopyEntryDataDirect ( ZipUpdate update, Stream stream, bool updateCrc, long &destinationPosition, long &sourcePosition ) : void
CopyEntryDirect ( ZipFile workFile, ZipUpdate update, long &destinationPosition ) : void
CreateAndInitDecryptionStream ( Stream baseStream, ZipEntry entry ) : Stream
CreateAndInitEncryptionStream ( Stream baseStream, ZipEntry entry ) : Stream
DisposeInternal ( bool disposing ) : void
FindExistingUpdate ( ZipEntry entry ) : int
FindExistingUpdate ( string fileName ) : int
GetBuffer ( ) : byte[]

Get a raw memory buffer.

GetDescriptorSize ( ZipUpdate update ) : int

Get the size of the source descriptor for a ZipUpdate.

GetOutputStream ( ZipEntry entry ) : Stream

Get an output stream for the specified ZipEntry

GetTransformedDirectoryName ( string name ) : string
GetTransformedFileName ( string name ) : string
LocateBlockWithSignature ( int signature, long endLocation, int minimumBlockSize, int maximumVariableData ) : long
LocateEntry ( ZipEntry entry ) : long

Locate the data for a given entry.

ModifyEntry ( ZipFile workFile, ZipUpdate update ) : void
OnKeysRequired ( string fileName ) : void

Handles getting of encryption keys when required.

PostUpdateCleanup ( ) : void
ReadEntries ( ) : void

Search for and read the central directory of a zip file filling the entries array.

ReadLEUint ( ) : uint

Read a uint in little endian byte order.

ReadLEUlong ( ) : ulong
ReadLEUshort ( ) : ushort

Read an unsigned short in little endian byte order.

Reopen ( ) : void
Reopen ( Stream source ) : void
RunUpdates ( ) : void
TestLocalHeader ( ZipEntry entry, HeaderTest tests ) : long

Test a local header against that provided from the central directory

UpdateCommentOnly ( ) : void
UpdateComparer ( ZipUpdate zx, ZipUpdate zy ) : int

Compares two objects and returns a value indicating whether one is less than, equal to or greater than the other.

WriteCentralDirectoryHeader ( ZipEntry entry ) : int
WriteEncryptionHeader ( Stream stream, long crcValue ) : void
WriteLEInt ( int value ) : void

Write an int in little endian byte order.

WriteLEShort ( int value ) : void
WriteLEUint ( uint value ) : void

Write an unsigned int in little endian byte order.

WriteLEUlong ( ulong value ) : void
WriteLEUshort ( ushort value ) : void

Write an unsigned short in little endian byte order.

WriteLeLong ( long value ) : void

Write a long in little endian byte order.

WriteLocalEntryHeader ( ZipUpdate update ) : void
ZipFile ( ) : System

Initialises a default ZipFile instance with no entries and no file storage.

this ( int index ) : ZipEntry

메소드 상세

AbortUpdate() 공개 메소드

Abort updating leaving the archive unchanged.
public AbortUpdate ( ) : void
리턴 void

Add() 공개 메소드

Add a file entry with data.
public Add ( IStaticDataSource dataSource, string entryName ) : void
dataSource IStaticDataSource The source of the data for this entry.
entryName string The name to give to the entry.
리턴 void

Add() 공개 메소드

Add a file entry with data.
public Add ( IStaticDataSource dataSource, string entryName, CompressionMethod compressionMethod ) : void
dataSource IStaticDataSource The source of the data for this entry.
entryName string The name to give to the entry.
compressionMethod CompressionMethod The compression method to use.
리턴 void

Add() 공개 메소드

Add a file entry with data.
public Add ( IStaticDataSource dataSource, string entryName, CompressionMethod compressionMethod, bool useUnicodeText ) : void
dataSource IStaticDataSource The source of the data for this entry.
entryName string The name to give to the entry.
compressionMethod CompressionMethod The compression method to use.
useUnicodeText bool Ensure Unicode text is used for name and comments for this entry.
리턴 void

Add() 공개 메소드

Add a ZipEntry that contains no data.
This can be used to add directories, volume labels, or empty file entries.
public Add ( ZipEntry entry ) : void
entry ZipEntry The entry to add.
리턴 void

Add() 공개 메소드

Add a file to the archive.
Argument supplied is null.
public Add ( string fileName ) : void
fileName string The name of the file to add.
리턴 void

Add() 공개 메소드

Add a new entry to the archive.
ZipFile has been closed. The compression method is not supported.
public Add ( string fileName, CompressionMethod compressionMethod ) : void
fileName string The name of the file to add.
compressionMethod CompressionMethod The compression method to use.
리턴 void

Add() 공개 메소드

Add a new entry to the archive.
Argument supplied is null. ZipFile has been closed. Compression method is not supported.
public Add ( string fileName, CompressionMethod compressionMethod, bool useUnicodeText ) : void
fileName string The name of the file to add.
compressionMethod CompressionMethod The compression method to use.
useUnicodeText bool Ensure Unicode text is used for name and comment for this entry.
리턴 void

Add() 공개 메소드

Add a file to the archive.
Argument supplied is null.
public Add ( string fileName, string entryName ) : void
fileName string The name of the file to add.
entryName string The name to use for the on the Zip file created.
리턴 void

AddDirectory() 공개 메소드

Add a directory entry to the archive.
public AddDirectory ( string directoryName ) : void
directoryName string The directory to add.
리턴 void

BeginUpdate() 공개 메소드

Begin updating this ZipFile archive.
public BeginUpdate ( ) : void
리턴 void

BeginUpdate() 공개 메소드

Begin updating to this ZipFile archive.
public BeginUpdate ( IArchiveStorage archiveStorage ) : void
archiveStorage IArchiveStorage The storage to use during the update.
리턴 void

BeginUpdate() 공개 메소드

Begin updating this ZipFile archive.
ZipFile has been closed. One of the arguments provided is null ZipFile has been closed.
public BeginUpdate ( IArchiveStorage archiveStorage, IDynamicDataSource dataSource ) : void
archiveStorage IArchiveStorage The archive storage for use during the update.
dataSource IDynamicDataSource The data source to utilise during updating.
리턴 void

Close() 공개 메소드

Closes the ZipFile. If the stream is owned then this also closes the underlying input stream. Once closed, no further instance methods should be called.
/// An i/o error occurs. ///
public Close ( ) : void
리턴 void

CommitUpdate() 공개 메소드

Commit current updates, updating this archive.
ZipFile has been closed.
public CommitUpdate ( ) : void
리턴 void

Create() 공개 정적인 메소드

Create a new ZipFile whose data will be stored on a stream.
is null doesnt support writing.
public static Create ( Stream outStream ) : ZipFile
outStream Stream The stream providing data storage.
리턴 ZipFile

Create() 공개 정적인 메소드

Create a new ZipFile whose data will be stored in a file.
is null
public static Create ( string fileName ) : ZipFile
fileName string The name of the archive to create.
리턴 ZipFile

Delete() 공개 메소드

Delete an entry by name
public Delete ( string fileName ) : bool
fileName string The filename to delete
리턴 bool

Delete() 공개 메소드

Delete a ZipEntry from the archive.
public Delete ( ZipEntry entry ) : void
entry ZipEntry The entry to delete.
리턴 void

Dispose() 공개 메소드

public Dispose ( ) : void
리턴 void

Dispose() 보호된 메소드

Releases the unmanaged resources used by the this instance and optionally releases the managed resources.
protected Dispose ( bool disposing ) : void
disposing bool true to release both managed and unmanaged resources; /// false to release only unmanaged resources.
리턴 void

FindEntry() 공개 메소드

Return the index of the entry with a matching name
/// The Zip file has been closed. ///
public FindEntry ( string name, bool ignoreCase ) : int
name string Entry name to find
ignoreCase bool If true the comparison is case insensitive
리턴 int

GetEntry() 공개 메소드

Searches for a zip entry in this archive with the given name. String comparisons are case insensitive
/// The Zip file has been closed. ///
public GetEntry ( string name ) : ZipEntry
name string /// The name to find. May contain directory components separated by slashes ('/'). ///
리턴 ZipEntry

GetEnumerator() 공개 메소드

Gets an enumerator for the Zip entries in this Zip file.
/// The Zip file has been closed. ///
public GetEnumerator ( ) : IEnumerator
리턴 IEnumerator

GetInputStream() 공개 메소드

Gets an input stream for reading the given zip entry data in an uncompressed form. Normally the ZipEntry should be an entry returned by GetEntry().
/// The ZipFile has already been closed /// /// The compression method for the entry is unknown /// /// The entry is not found in the ZipFile ///
public GetInputStream ( ZipEntry entry ) : Stream
entry ZipEntry The to obtain a data for
리턴 Stream

GetInputStream() 공개 메소드

Creates an input stream reading a zip entry
/// The ZipFile has already been closed /// /// The compression method for the entry is unknown /// /// The entry is not found in the ZipFile ///
public GetInputStream ( long entryIndex ) : Stream
entryIndex long The index of the entry to obtain an input stream for.
리턴 Stream

SetComment() 공개 메소드

Set the file comment to be recorded when the current update is commited.
ZipFile has been closed.
public SetComment ( string comment ) : void
comment string The comment to record.
리턴 void

TestArchive() 공개 메소드

Test an archive for integrity/validity
Testing will terminate on the first error found.
public TestArchive ( bool testData ) : bool
testData bool Perform low level data Crc check
리턴 bool

TestArchive() 공개 메소드

Test an archive for integrity/validity
The object has already been closed.
public TestArchive ( bool testData, TestStrategy strategy, ZipTestResultHandler resultHandler ) : bool
testData bool Perform low level data Crc check
strategy TestStrategy The to apply.
resultHandler ZipTestResultHandler The handler to call during testing.
리턴 bool

ZipFile() 공개 메소드

Opens a Zip file reading the given FileStream.
The supplied argument is null. /// An i/o error occurs. /// /// The file doesn't contain a valid zip archive. ///
public ZipFile ( FileStream file ) : System
file System.IO.FileStream The to read archive data from.
리턴 System

ZipFile() 공개 메소드

Opens a Zip file reading the given Stream.
/// An i/o error occurs /// /// The stream doesn't contain a valid zip archive.
/// /// The stream doesnt support seeking. /// /// The stream argument is null. ///
public ZipFile ( Stream stream ) : System
stream Stream The to read archive data from.
리턴 System

ZipFile() 공개 메소드

Opens a Zip file with the given name for reading.
The argument supplied is null. /// An i/o error occurs /// /// The file doesn't contain a valid zip archive. ///
public ZipFile ( string name ) : System
name string The name of the file to open.
리턴 System

프로퍼티 상세

KeysRequired 공개적으로 프로퍼티

Event handler for handling encryption keys.
public KeysRequiredEventHandler KeysRequired
리턴 KeysRequiredEventHandler