C# Class PathLib.Utils.PathUtils

General utilities and separator-agnostic replacements for System.IO.Path methods.
Afficher le fichier Open project: nemec/pathlib

Méthodes publiques

Méthode Description
ChangeExtension ( string path, string extension, string separator ) : string

Changes the extension of a file path.

GetDirectoryName ( string path, string separator ) : string

Returns the directory path of a file path.

GetExtension ( string path, string separator ) : string

Returns the extension of the given path.

GetFileName ( string path, string separator ) : string

Returns the name and extension parts of the given path.

GetFileNameWithoutExtension ( string path, string separator ) : string

Returns the name and of the given path, minus the extension.

GetPathRoot ( string path, string separator ) : string

Returns the root portion of the given path.

IsPathRooted ( string path, string separator ) : bool

Tests if the given path contains a root.

Private Methods

Méthode Description
Combine ( IEnumerable paths, string separator ) : IPurePath
Combine ( string path1, string path2, string separator ) : string
Glob ( string pattern, string haystack, bool fullMatch = false, bool caseInsensitive = false ) : bool
TrySafeCombine ( IPurePath @base, IPurePath toJoin, string separator, string &combined ) : bool

Removes all parent directory components. Disallows combining with absolute paths.

findExtension ( string path, string separator ) : int

Method Details

ChangeExtension() public static méthode

Changes the extension of a file path.
public static ChangeExtension ( string path, string extension, string separator ) : string
path string
extension string
separator string
Résultat string

GetDirectoryName() public static méthode

Returns the directory path of a file path.
public static GetDirectoryName ( string path, string separator ) : string
path string
separator string
Résultat string

GetExtension() public static méthode

Returns the extension of the given path.
public static GetExtension ( string path, string separator ) : string
path string
separator string
Résultat string

GetFileName() public static méthode

Returns the name and extension parts of the given path.
public static GetFileName ( string path, string separator ) : string
path string
separator string
Résultat string

GetFileNameWithoutExtension() public static méthode

Returns the name and of the given path, minus the extension.
public static GetFileNameWithoutExtension ( string path, string separator ) : string
path string
separator string
Résultat string

GetPathRoot() public static méthode

Returns the root portion of the given path.
public static GetPathRoot ( string path, string separator ) : string
path string
separator string
Résultat string

IsPathRooted() public static méthode

Tests if the given path contains a root.
public static IsPathRooted ( string path, string separator ) : bool
path string
separator string
Résultat bool