Provides local file-system path operations using platform-specific separator and comparison rules.
More...
|
| static string | NormalizePath (string path) |
| | Normalizes a local path by collapsing repeated separators and trimming trailing separators while preserving root paths.
|
| static string | Combine (string pathBase, string pathSuffix) |
| | Combines a base path and suffix into a single local path.
|
| static string | GetParentDir (string path) |
| | Gets the parent directory for the provided path.
|
| static string | GetFileName (string path) |
| | Gets the file or directory name segment from the provided path.
|
| static string | GetExtension (string path) |
| | Gets the file extension (including leading dot) from the provided path.
|
| static bool | PathsAreEqual (string? pathA, string? pathB) |
| | Determines whether two paths are equal after normalization.
|
| static bool | PathsAreEqualNormalized (string? pathA, string? pathB) |
| | Determines whether two already-normalized paths are equal.
|
| static bool | NamesAreEqual (string? nameA, string? nameB) |
| | Determines whether two file or directory names are equal under local rules.
|
| static IEnumerable< string > | EnumerateExtensions (string path) |
| | Enumerates all extension segments in a file name from left to right.
|
|
| static char | DirSeparator [get] |
| | Gets the primary directory separator for the current platform.
|
| static char | OtherSeparator [get] |
| | Gets the alternate directory separator for the current platform.
|
| static StringComparison | Comparison [get] |
| | Gets the string comparison mode used for path and name equality.
|
Provides local file-system path operations using platform-specific separator and comparison rules.
◆ Combine()
| string FileSurfer.Core.Models.LocalPathTools.Combine |
( |
string | pathBase, |
|
|
string | pathSuffix ) |
|
inlinestatic |
Combines a base path and suffix into a single local path.
- Parameters
-
| pathBase | Base path. |
| pathSuffix | Path suffix to append. |
- Returns
- Combined path with one separator between segments.
Implements FileSurfer.Core.Models.IPathTools.
◆ EnumerateExtensions()
| IEnumerable< string > FileSurfer.Core.Models.LocalPathTools.EnumerateExtensions |
( |
string | path | ) |
|
|
inlinestatic |
Enumerates all extension segments in a file name from left to right.
- Parameters
-
| path | Path whose file name extensions should be enumerated. |
- Returns
- Sequence of extension parts without the leading dot.
◆ GetExtension()
| string FileSurfer.Core.Models.LocalPathTools.GetExtension |
( |
string | path | ) |
|
|
inlinestatic |
Gets the file extension (including leading dot) from the provided path.
- Parameters
-
- Returns
- File extension when present; otherwise an empty string.
Implements FileSurfer.Core.Models.IPathTools.
◆ GetFileName()
| string FileSurfer.Core.Models.LocalPathTools.GetFileName |
( |
string | path | ) |
|
|
inlinestatic |
◆ GetParentDir()
| string FileSurfer.Core.Models.LocalPathTools.GetParentDir |
( |
string | path | ) |
|
|
inlinestatic |
Gets the parent directory for the provided path.
- Parameters
-
- Returns
- Parent directory path, or an empty string when no parent exists.
Implements FileSurfer.Core.Models.IPathTools.
◆ NamesAreEqual()
| bool FileSurfer.Core.Models.LocalPathTools.NamesAreEqual |
( |
string? | nameA, |
|
|
string? | nameB ) |
|
inlinestatic |
Determines whether two file or directory names are equal under local rules.
- Parameters
-
| nameA | First name. |
| nameB | Second name. |
- Returns
true when both names are non-null and equal; otherwise false.
Implements FileSurfer.Core.Models.IPathTools.
◆ NormalizePath()
| string FileSurfer.Core.Models.LocalPathTools.NormalizePath |
( |
string | path | ) |
|
|
inlinestatic |
Normalizes a local path by collapsing repeated separators and trimming trailing separators while preserving root paths.
- Parameters
-
- Returns
- Normalized path.
Implements FileSurfer.Core.Models.IPathTools.
◆ PathsAreEqual()
| bool FileSurfer.Core.Models.LocalPathTools.PathsAreEqual |
( |
string? | pathA, |
|
|
string? | pathB ) |
|
inlinestatic |
Determines whether two paths are equal after normalization.
- Parameters
-
| pathA | First path. |
| pathB | Second path. |
- Returns
true when both paths are non-null and equal under local rules; otherwise false.
Implements FileSurfer.Core.Models.IPathTools.
◆ PathsAreEqualNormalized()
| bool FileSurfer.Core.Models.LocalPathTools.PathsAreEqualNormalized |
( |
string? | pathA, |
|
|
string? | pathB ) |
|
inlinestatic |
Determines whether two already-normalized paths are equal.
- Parameters
-
| pathA | First normalized path. |
| pathB | Second normalized path. |
- Returns
true when both paths are non-null and equal under local rules; otherwise false.
◆ Instance
| readonly LocalPathTools FileSurfer.Core.Models.LocalPathTools.Instance = new() |
|
static |
◆ Comparison
| StringComparison FileSurfer.Core.Models.LocalPathTools.Comparison |
|
staticget |
Initial value:=
OperatingSystem.IsWindows() ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal
Gets the string comparison mode used for path and name equality.
◆ DirSeparator
| char FileSurfer.Core.Models.LocalPathTools.DirSeparator |
|
staticget |
◆ OtherSeparator
| char FileSurfer.Core.Models.LocalPathTools.OtherSeparator |
|
staticget |
Initial value:=
OperatingSystem.IsWindows() ? Path.AltDirectorySeparatorChar : Path.DirectorySeparatorChar
Gets the alternate directory separator for the current platform.
The documentation for this class was generated from the following file:
- /home/janecea/Documents/CODE/PROJECTS/FileSurfer/src/FileSurfer.Core/Models/LocalPathTools.cs