Fingerprint_Card
Loading...
Searching...
No Matches
ICSharpCode.SharpZipLib.Zip.WindowsNameTransform Class Reference

WindowsNameTransform transforms ZipFile names to windows compatible ones. More...

Inheritance diagram for ICSharpCode.SharpZipLib.Zip.WindowsNameTransform:
Collaboration diagram for ICSharpCode.SharpZipLib.Zip.WindowsNameTransform:

Public Member Functions

 WindowsNameTransform (string baseDirectory)
 Initialises a new instance of WindowsNameTransform
 WindowsNameTransform ()
 Initialise a default instance of WindowsNameTransform
string TransformDirectory (string name)
 Transform a Zip directory name to a windows directory name.
string TransformFile (string name)
 Transform a Zip format file name to a windows style one.

Static Public Member Functions

static bool IsValidName (string name)
 Test a name to see if it is a valid name for a windows filename as extracted from a Zip archive.
static string MakeValidName (string name, char replacement)
 Force a name to be valid by replacing invalid characters with a fixed value.

Properties

string BaseDirectory [get, set]
 Gets or sets a value containing the target directory to prefix values with.
bool TrimIncomingPaths [get, set]
 Gets or sets a value indicating wether paths on incoming values should be removed.
char Replacement [get, set]
 Gets or set the character to replace invalid characters during transformations.

Static Private Member Functions

static WindowsNameTransform ()
 Initialise static class information.

Private Attributes

string _baseDirectory
bool _trimIncomingPaths
char _replacementChar = '_'

Static Private Attributes

const int MaxPath = 260
 The maximum windows path name permitted.
static readonly char[] InvalidEntryChars

Detailed Description

WindowsNameTransform transforms ZipFile names to windows compatible ones.

Constructor & Destructor Documentation

◆ WindowsNameTransform() [1/3]

ICSharpCode.SharpZipLib.Zip.WindowsNameTransform.WindowsNameTransform ( string baseDirectory)

Initialises a new instance of WindowsNameTransform

Parameters
baseDirectory

◆ WindowsNameTransform() [2/3]

ICSharpCode.SharpZipLib.Zip.WindowsNameTransform.WindowsNameTransform ( )

Initialise a default instance of WindowsNameTransform

◆ WindowsNameTransform() [3/3]

ICSharpCode.SharpZipLib.Zip.WindowsNameTransform.WindowsNameTransform ( )
staticprivate

Initialise static class information.

Member Function Documentation

◆ IsValidName()

bool ICSharpCode.SharpZipLib.Zip.WindowsNameTransform.IsValidName ( string name)
static

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

Parameters
nameThe name to test.
Returns
Returns true if the name is a valid zip name; false otherwise.

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

Here is the call graph for this function:

◆ MakeValidName()

string ICSharpCode.SharpZipLib.Zip.WindowsNameTransform.MakeValidName ( string name,
char replacement )
static

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

Parameters
nameThe name to make valid
replacementThe replacement character to use for any invalid characters.
Returns
Returns a valid name
Here is the call graph for this function:
Here is the caller graph for this function:

◆ TransformDirectory()

string ICSharpCode.SharpZipLib.Zip.WindowsNameTransform.TransformDirectory ( string name)

Transform a Zip directory name to a windows directory name.

Parameters
nameThe directory name to transform.
Returns
The transformed name.

Implements ICSharpCode.SharpZipLib.Core.INameTransform.

Here is the call graph for this function:

◆ TransformFile()

string ICSharpCode.SharpZipLib.Zip.WindowsNameTransform.TransformFile ( string name)

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

Parameters
nameThe file name to transform.
Returns
The transformed name.

Implements ICSharpCode.SharpZipLib.Core.INameTransform.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ _baseDirectory

string ICSharpCode.SharpZipLib.Zip.WindowsNameTransform._baseDirectory
private

◆ _replacementChar

char ICSharpCode.SharpZipLib.Zip.WindowsNameTransform._replacementChar = '_'
private

◆ _trimIncomingPaths

bool ICSharpCode.SharpZipLib.Zip.WindowsNameTransform._trimIncomingPaths
private

◆ InvalidEntryChars

readonly char [] ICSharpCode.SharpZipLib.Zip.WindowsNameTransform.InvalidEntryChars
staticprivate

◆ MaxPath

const int ICSharpCode.SharpZipLib.Zip.WindowsNameTransform.MaxPath = 260
staticprivate

The maximum windows path name permitted.

This may not valid for all windows systems - CE?, etc but I cant find the equivalent in the CLR.

Property Documentation

◆ BaseDirectory

string ICSharpCode.SharpZipLib.Zip.WindowsNameTransform.BaseDirectory
getset

Gets or sets a value containing the target directory to prefix values with.

◆ Replacement

char ICSharpCode.SharpZipLib.Zip.WindowsNameTransform.Replacement
getset

Gets or set the character to replace invalid characters during transformations.

◆ TrimIncomingPaths

bool ICSharpCode.SharpZipLib.Zip.WindowsNameTransform.TrimIncomingPaths
getset

Gets or sets a value indicating wether paths on incoming values should be removed.


The documentation for this class was generated from the following file: