ZipNameTransform transforms names as per the Zip file naming convention.
More...
|
| 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.
|
|
| string | TrimPrefix [get, set] |
| | Get/set the path prefix to be trimmed from paths if present.
|
|
| 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.
|
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.
◆ ZipNameTransform() [1/3]
| ICSharpCode.SharpZipLib.Zip.ZipNameTransform.ZipNameTransform |
( |
| ) |
|
◆ ZipNameTransform() [2/3]
| ICSharpCode.SharpZipLib.Zip.ZipNameTransform.ZipNameTransform |
( |
string | trimPrefix | ) |
|
Initialize a new instance of ZipNameTransform
- Parameters
-
| trimPrefix | The string to trim from the front of paths if found. |
◆ ZipNameTransform() [3/3]
| ICSharpCode.SharpZipLib.Zip.ZipNameTransform.ZipNameTransform |
( |
| ) |
|
|
staticprivate |
◆ 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
-
- 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
-
| name | The name to test. |
| relaxed | If 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.
◆ 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
-
| name | The name to force valid |
| replacement | The replacement character to use. |
- Returns
- Returns a valid name
◆ TransformDirectory()
| string ICSharpCode.SharpZipLib.Zip.ZipNameTransform.TransformDirectory |
( |
string | name | ) |
|
◆ TransformFile()
| string ICSharpCode.SharpZipLib.Zip.ZipNameTransform.TransformFile |
( |
string | name | ) |
|
◆ 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 |
◆ 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: