Class PathUtility
Helper utilities for normalizing and querying file-system paths.
Inherited Members
Namespace: Unity.SimulationPro
Assembly: Unity.SimulationPro.Capture.dll
Syntax
public static class PathUtility
Methods
CanonicalPath(string)
Ensures the path ends with a trailing forward slash.
Declaration
public static string CanonicalPath(string path)
Parameters
| Type | Name | Description |
|---|---|---|
| string | path | File system path or navigation path. |
Returns
| Type | Description |
|---|---|
| string | The path with a trailing |
FixPathSeparators(string)
Replaces all backslash characters in path with forward slashes.
Declaration
public static string FixPathSeparators(string path)
Parameters
| Type | Name | Description |
|---|---|---|
| string | path | File system path or navigation path. |
Returns
| Type | Description |
|---|---|
| string | The path with backslashes replaced by forward slashes. |
GetDirectoryName(string)
Returns the normalized directory component of the given path, with a trailing slash.
Declaration
public static string GetDirectoryName(string path)
Parameters
| Type | Name | Description |
|---|---|---|
| string | path | File system path or navigation path. |
Returns
| Type | Description |
|---|---|
| string | The directory portion of |
GetFileNameWithoutExtension(string)
Returns the file name without its extension, using normalized forward-slash separators.
Declaration
public static string GetFileNameWithoutExtension(string path)
Parameters
| Type | Name | Description |
|---|---|---|
| string | path | File system path or navigation path. |
Returns
| Type | Description |
|---|---|
| string | The file name without extension. |