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

ZipNameTransform transforms names as per the Zip file naming convention. More...

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

Public Member Functions

 ZipNameTransform ()
 Initialize a new instance of ZipNameTransform
 ZipNameTransform (string trimPrefix)
 Initialize a new instance of ZipNameTransform
string TransformDirectory (string name)
 Transform a windows directory name according to the Zip file naming conventions.
string TransformFile (string name)
 Transform a windows file name according to the Zip file naming conventions.

Static Public Member Functions

static bool IsValidName (string name, bool relaxed)
 Test a name to see if it is a valid name for a zip entry.
static bool IsValidName (string name)
 Test a name to see if it is a valid name for a zip entry.

Properties

string TrimPrefix [get, set]
 Get/set the path prefix to be trimmed from paths if present.

Static Private Member Functions

static ZipNameTransform ()
 Static constructor.
static string MakeValidName (string name, char replacement)
 Force a name to be valid by replacing invalid characters with a fixed value.

Private Attributes

string trimPrefix_

Static Private Attributes

static readonly char[] InvalidEntryChars
static readonly char[] InvalidEntryCharsRelaxed

Detailed Description

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.

Constructor & Destructor Documentation

◆ ZipNameTransform() [1/3]

ICSharpCode.SharpZipLib.Zip.ZipNameTransform.ZipNameTransform ( )

Initialize a new instance of ZipNameTransform

◆ ZipNameTransform() [2/3]

ICSharpCode.SharpZipLib.Zip.ZipNameTransform.ZipNameTransform ( string trimPrefix)

Initialize a new instance of ZipNameTransform

Parameters
trimPrefixThe string to trim from the front of paths if found.

◆ ZipNameTransform() [3/3]

ICSharpCode.SharpZipLib.Zip.ZipNameTransform.ZipNameTransform ( )
staticprivate

Static constructor.

Member Function Documentation

◆ IsValidName() [1/2]

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

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

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

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() [2/2]

bool ICSharpCode.SharpZipLib.Zip.ZipNameTransform.IsValidName ( string name,
bool relaxed )
static

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

Parameters
nameThe name to test.
relaxedIf true checking is relaxed about windows file names and absolute paths.
Returns
Returns true if the name is a valid zip name; false otherwise.

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.

Here is the caller graph for this function:

◆ MakeValidName()

string ICSharpCode.SharpZipLib.Zip.ZipNameTransform.MakeValidName ( string name,
char replacement )
staticprivate

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

Parameters
nameThe name to force valid
replacementThe replacement character to use.
Returns
Returns a valid name
Here is the caller graph for this function:

◆ TransformDirectory()

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

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

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.ZipNameTransform.TransformFile ( string name)

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

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

◆ InvalidEntryChars

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

◆ InvalidEntryCharsRelaxed

readonly char [] ICSharpCode.SharpZipLib.Zip.ZipNameTransform.InvalidEntryCharsRelaxed
staticprivate

◆ trimPrefix_

string ICSharpCode.SharpZipLib.Zip.ZipNameTransform.trimPrefix_
private

Property Documentation

◆ TrimPrefix

string ICSharpCode.SharpZipLib.Zip.ZipNameTransform.TrimPrefix
getset

Get/set the path prefix to be trimmed from paths if present.

The prefix is trimmed before any conversion from a windows path is done.


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