C# Класс ICSharpCode.SharpZipLib.Zip.ZipNameTransform

ZipNameTransform transforms names as per the Zip file naming convention.
The use of absolute names is supported although its use is not valid according to Zip naming conventions, and should not be used if maximum compatability is desired.
Наследование: INameTransform
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
IsValidName ( string name ) : bool

Test a name to see if it is a valid name for a zip entry.

Zip path names are actually in unix format, and should only contain relative paths if a path is present. This means that the path stored should not contain a drive or device letter, or a leading slash. All slashes should forward slashes '/'. An empty name is valid where the input comes from standard input. A null name is not considered valid.

IsValidName ( string name, bool relaxed ) : bool

Test a name to see if it is a valid name for a zip entry.

Zip path names are actually in Unix format, and should only contain relative paths. This means that any path stored should not contain a drive or device letter, or a leading slash. All slashes should forward slashes '/'. An empty name is valid for a file where the input comes from standard input. A null name is not considered valid.

TransformDirectory ( string name ) : string

Transform a windows directory name according to the Zip file naming conventions.

TransformFile ( string name ) : string

Transform a windows file name according to the Zip file naming conventions.

ZipNameTransform ( string trimPrefix ) : System

Initialize a new instance of

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

Метод Описание
MakeValidName ( string name, char replacement ) : string

Force a name to be valid by replacing invalid characters with a fixed value

ZipNameTransform ( ) : System

Static constructor.

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

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

Test a name to see if it is a valid name for a zip entry.
Zip path names are actually in unix format, and should only contain relative paths if a path is present. This means that the path stored should not contain a drive or device letter, or a leading slash. All slashes should forward slashes '/'. An empty name is valid where the input comes from standard input. A null name is not considered valid.
public static IsValidName ( string name ) : bool
name string The name to test.
Результат bool

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

Test a name to see if it is a valid name for a zip entry.
Zip path names are actually in Unix format, and should only contain relative paths. This means that any path stored should not contain a drive or device letter, or a leading slash. All slashes should forward slashes '/'. An empty name is valid for a file where the input comes from standard input. A null name is not considered valid.
public static IsValidName ( string name, bool relaxed ) : bool
name string The name to test.
relaxed bool If true checking is relaxed about windows file names and absolute paths.
Результат bool

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

Transform a windows directory name according to the Zip file naming conventions.
public TransformDirectory ( string name ) : string
name string The directory name to transform.
Результат string

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

Transform a windows file name according to the Zip file naming conventions.
public TransformFile ( string name ) : string
name string The file name to transform.
Результат string

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

Initialize a new instance of
public ZipNameTransform ( string trimPrefix ) : System
trimPrefix string The string to trim from the front of paths if found.
Результат System