C# Class ICSharpCode.SharpZipLib.Zip.WindowsNameTransform

WindowsNameTransform transforms ZipFile names to windows compatible ones.
Inheritance: INameTransform
Show file Open project: icsharpcode/SharpZipLib Class Usage Examples

Public Methods

Method Description
IsValidName ( string name ) : bool

Test a name to see if it is a valid name for a windows filename as extracted from a Zip archive.

The filename isnt a true windows path in some fundamental ways like no absolute paths, no rooted paths etc.

MakeValidName ( string name, char replacement ) : string

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

TransformDirectory ( string name ) : string

Transform a Zip directory name to a windows directory name.

TransformFile ( string name ) : string

Transform a Zip format file name to a windows style one.

WindowsNameTransform ( string baseDirectory ) : System

Initialises a new instance of WindowsNameTransform

Private Methods

Method Description
WindowsNameTransform ( ) : System

Initialise static class information.

Method Details

IsValidName() public static method

Test a name to see if it is a valid name for a windows filename as extracted from a Zip archive.
The filename isnt a true windows path in some fundamental ways like no absolute paths, no rooted paths etc.
public static IsValidName ( string name ) : bool
name string The name to test.
return bool

MakeValidName() public static method

Force a name to be valid by replacing invalid characters with a fixed value
public static MakeValidName ( string name, char replacement ) : string
name string The name to make valid
replacement char The replacement character to use for any invalid characters.
return string

TransformDirectory() public method

Transform a Zip directory name to a windows directory name.
public TransformDirectory ( string name ) : string
name string The directory name to transform.
return string

TransformFile() public method

Transform a Zip format file name to a windows style one.
public TransformFile ( string name ) : string
name string The file name to transform.
return string

WindowsNameTransform() public method

Initialises a new instance of WindowsNameTransform
public WindowsNameTransform ( string baseDirectory ) : System
baseDirectory string
return System