Class PathValidator
Static class containing path validation methods.
Namespace: Evergine.Common.IO
Assembly: Evergine.Common.dll
Syntax
public static class PathValidator
Methods
EnsureCorrectFileSystemName(string)
Ensures the correct file system name.
Declaration
public static void EnsureCorrectFileSystemName(string filename)
Parameters
| Type | Name | Description |
|---|---|---|
| string | filename | The filename. |
Remarks
Throws an exception if filename is not a correct file system path.
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |
|
| ArgumentException |
|
EnsureCorrectFileSystemPath(string)
Ensures the correct file system path.
Declaration
public static void EnsureCorrectFileSystemPath(string path)
Parameters
| Type | Name | Description |
|---|---|---|
| string | path | The path to the file or directory. |
Remarks
Throws an exception if path is not a correct file system path.
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |
|
| ArgumentException |
|
IsSubpath(string, string)
Return whether one path is a subpath of another.
Declaration
public static bool IsSubpath(string basePath, string subPath)
Parameters
| Type | Name | Description |
|---|---|---|
| string | basePath | The path that is potentially the parent. |
| string | subPath | The path that is potentially the subdirectory. |
Returns
| Type | Description |
|---|---|
| bool | Whether subPath is a subpath of basePath. |