C# Класс SS.Ynote.Classic.Extensibility.Packages.ZipStorer

Unique class for compression/decompression file. Represents a Zip file.
Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
AddFile ( Compression _method, string _pathname, string _filenameInZip, string _comment ) : void

Add full contents of a file into the Zip storage

Close ( ) : void

Updates central directory (if pertinent) and close the Zip storage

This is a required step, unless automatic dispose is used

Create ( string _filename, string _comment ) : ZipStorer

Method to create a new storage file

Dispose ( ) : void

Closes the Zip file stream

ExtractFile ( ZipFileEntry _zfe, string _filename ) : bool

Copy the contents of a stored file into a physical file

Unique compression methods are Store and Deflate

Open ( string _filename, FileAccess _access ) : ZipStorer

Method to open an existing storage file

ReadCentralDir ( ) : IEnumerable

Read all the file records in the central directory

RemoveEntries ( ZipStorer &_zip, List _zfes ) : bool

Removes one of many files in storage. It creates a new Zip file.

This method only works for storage of type FileStream

Приватные методы

Метод Описание
AddStream ( Compression _method, string _filenameInZip, Stream _source, System.DateTime _modTime, string _comment ) : void

Add full contents of a stream into the Zip storage

Create ( Stream _stream, string _comment ) : ZipStorer

Method to create a new zip storage in a stream

DateTimeToDosTime ( System.DateTime _dt ) : uint
DosTimeToDateTime ( uint _dt ) : System.DateTime
ExtractFile ( ZipFileEntry _zfe, Stream _stream ) : bool

Copy the contents of a stored file into an opened stream

Unique compression methods are Store and Deflate

GetFileOffset ( uint _headerOffset ) : uint
NormalizedFilename ( string _filename ) : string
Open ( Stream _stream, FileAccess _access ) : ZipStorer

Method to open an existing storage from stream

ReadFileInfo ( ) : bool
Store ( ZipFileEntry &_zfe, Stream _source ) : void
UpdateCrcAndSizes ( ZipFileEntry &_zfe ) : void
WriteCentralDirRecord ( ZipFileEntry _zfe ) : void
WriteEndRecord ( uint _size, uint _offset ) : void
WriteLocalHeader ( ZipFileEntry &_zfe ) : void
ZipStorer ( ) : System

Описание методов

AddFile() публичный Метод

Add full contents of a file into the Zip storage
public AddFile ( Compression _method, string _pathname, string _filenameInZip, string _comment ) : void
_method Compression Compression method
_pathname string Full path of file to add to Zip storage
_filenameInZip string Filename and path as desired in Zip directory
_comment string Comment for stored file
Результат void

Close() публичный Метод

Updates central directory (if pertinent) and close the Zip storage
This is a required step, unless automatic dispose is used
public Close ( ) : void
Результат void

Create() публичный статический Метод

Method to create a new storage file
public static Create ( string _filename, string _comment ) : ZipStorer
_filename string Full path of Zip file to create
_comment string General comment for Zip file
Результат ZipStorer

Dispose() публичный Метод

Closes the Zip file stream
public Dispose ( ) : void
Результат void

ExtractFile() публичный Метод

Copy the contents of a stored file into a physical file
Unique compression methods are Store and Deflate
public ExtractFile ( ZipFileEntry _zfe, string _filename ) : bool
_zfe ZipFileEntry Entry information of file to extract
_filename string Name of file to store uncompressed data
Результат bool

Open() публичный статический Метод

Method to open an existing storage file
public static Open ( string _filename, FileAccess _access ) : ZipStorer
_filename string Full path of Zip file to open
_access FileAccess File access mode as used in FileStream constructor
Результат ZipStorer

ReadCentralDir() публичный Метод

Read all the file records in the central directory
public ReadCentralDir ( ) : IEnumerable
Результат IEnumerable

RemoveEntries() публичный статический Метод

Removes one of many files in storage. It creates a new Zip file.
This method only works for storage of type FileStream
public static RemoveEntries ( ZipStorer &_zip, List _zfes ) : bool
_zip ZipStorer Reference to the current Zip object
_zfes List List of Entries to remove from storage
Результат bool