Method ToPath
ToPath(DirectoryInfo, PathOptions)
Gets the absolute directory path represented by the DirectoryInfo using the specified options.
Declaration
public static IAbsoluteDirectoryPath ToPath(this DirectoryInfo dirInfo, PathOptions options = PathOptions.NoUnfriendlyNames)
Parameters
| Type | Name | Description |
|---|---|---|
| DirectoryInfo | dirInfo | |
| PathOptions | options |
Returns
| Type | Description |
|---|---|
| IAbsoluteDirectoryPath |
Remarks
This method disallows unfriendly names by default, but any silent path modifications performed by DirectoryInfo (i.e. trimming of trailing spaces and dots) will remain intact.
The FullName property is used to get the absolute path that is parsed.
ToPath(FileInfo, PathOptions)
Gets the absolute file path represented by the FileInfo using the specified options.
Declaration
public static IAbsoluteFilePath ToPath(this FileInfo fileInfo, PathOptions options = PathOptions.NoUnfriendlyNames)
Parameters
| Type | Name | Description |
|---|---|---|
| FileInfo | fileInfo | |
| PathOptions | options |
Returns
| Type | Description |
|---|---|
| IAbsoluteFilePath |
Remarks
This method disallows unfriendly names by default, but any silent path modifications performed by FileInfo (i.e. trimming of trailing spaces and dots) will remain intact.
The FullName property is used to get the absolute path that is parsed.
ToPath(FileSystemInfo, PathOptions)
Gets the absolute path represented by the FileSystemInfo using the specified options. The returned instance is either an IAbsoluteFilePath or IAbsoluteDirectoryPath depending on the runtime type of info.
Declaration
public static IAbsolutePath ToPath(this FileSystemInfo info, PathOptions options = PathOptions.NoUnfriendlyNames)
Parameters
| Type | Name | Description |
|---|---|---|
| FileSystemInfo | info | |
| PathOptions | options |
Returns
| Type | Description |
|---|---|
| IAbsolutePath |
Remarks
This method disallows unfriendly names by default, but any silent path modifications performed by FileSystemInfo (i.e. trimming of trailing spaces and dots) will remain intact.
The FullName property is used to get the absolute path that is parsed.
Exceptions
| Type | Condition |
|---|---|
| ArgumentException |
|