FileSurfer 2.1.2
Cross-platform file manager with support for Git and SFTP
Loading...
Searching...
No Matches
FileSurfer.Core.Models.RemoteUnixPathTools Class Reference

Provides Unix-style path operations for remote paths using forward slash separators. More...

Inheritance diagram for FileSurfer.Core.Models.RemoteUnixPathTools:
Collaboration diagram for FileSurfer.Core.Models.RemoteUnixPathTools:

Static Public Member Functions

static string NormalizePath (string path)
 Normalizes a path by ensuring a leading separator, collapsing repeated separators, and trimming trailing separators except for the root path.
static string Combine (string pathBase, string pathSuffix)
 Combines a base path and suffix into a single Unix-style path.
static bool PathsAreEqual (string? pathA, string? pathB)
 Determines whether two paths are equal after normalization using ordinal comparison.
static bool NamesAreEqual (string? nameA, string? nameB)
 Determines whether two names are equal using ordinal comparison.
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 Public Attributes

static readonly RemoteUnixPathTools Instance = new()
 Gets the singleton instance of RemoteUnixPathTools.
const char DirSeparator = '/'
 Directory separator used by this path tool.
const string RootDir = "/"
 Root directory path.

Detailed Description

Provides Unix-style path operations for remote paths using forward slash separators.

Member Function Documentation

◆ Combine()

string FileSurfer.Core.Models.RemoteUnixPathTools.Combine ( string pathBase,
string pathSuffix )
inlinestatic

Combines a base path and suffix into a single Unix-style path.

Parameters
pathBaseBase path.
pathSuffixSuffix path to append.
Returns
Combined path with one directory separator between segments.

Implements FileSurfer.Core.Models.IPathTools.

◆ GetExtension()

string FileSurfer.Core.Models.RemoteUnixPathTools.GetExtension ( string path)
inlinestatic

Gets the file extension (including leading dot) from the provided path.

Parameters
pathPath to inspect.
Returns
File extension when present after the last separator; otherwise an empty string.

Implements FileSurfer.Core.Models.IPathTools.

◆ GetFileName()

string FileSurfer.Core.Models.RemoteUnixPathTools.GetFileName ( string path)
inlinestatic

Gets the file or directory name segment from the provided path.

Parameters
pathPath to inspect.
Returns
Final segment name, or an empty string for empty input.

Implements FileSurfer.Core.Models.IPathTools.

◆ GetParentDir()

string FileSurfer.Core.Models.RemoteUnixPathTools.GetParentDir ( string path)
inlinestatic

Gets the parent directory for the provided path.

Parameters
pathPath to inspect.
Returns
Parent directory path, RootDir, or an empty string for empty input.

Implements FileSurfer.Core.Models.IPathTools.

◆ NamesAreEqual()

bool FileSurfer.Core.Models.RemoteUnixPathTools.NamesAreEqual ( string? nameA,
string? nameB )
inlinestatic

Determines whether two names are equal using ordinal comparison.

Parameters
nameAFirst name.
nameBSecond name.
Returns
true when both names are non-null and equal; otherwise false.

Implements FileSurfer.Core.Models.IPathTools.

◆ NormalizePath()

string FileSurfer.Core.Models.RemoteUnixPathTools.NormalizePath ( string path)
inlinestatic

Normalizes a path by ensuring a leading separator, collapsing repeated separators, and trimming trailing separators except for the root path.

Parameters
pathPath to normalize.
Returns
Normalized Unix-style path.

Implements FileSurfer.Core.Models.IPathTools.

◆ PathsAreEqual()

bool FileSurfer.Core.Models.RemoteUnixPathTools.PathsAreEqual ( string? pathA,
string? pathB )
inlinestatic

Determines whether two paths are equal after normalization using ordinal comparison.

Parameters
pathAFirst path.
pathBSecond path.
Returns
true when both paths are non-null and represent the same normalized path; otherwise false.

Implements FileSurfer.Core.Models.IPathTools.

Member Data Documentation

◆ DirSeparator

const char FileSurfer.Core.Models.RemoteUnixPathTools.DirSeparator = '/'
static

Directory separator used by this path tool.

◆ Instance

readonly RemoteUnixPathTools FileSurfer.Core.Models.RemoteUnixPathTools.Instance = new()
static

Gets the singleton instance of RemoteUnixPathTools.

◆ RootDir

const string FileSurfer.Core.Models.RemoteUnixPathTools.RootDir = "/"
static

Root directory path.


The documentation for this class was generated from the following file: