A collection of helper methods for manipulating paths.
More...
A collection of helper methods for manipulating paths.
◆ Combine()
static string Combine |
( |
string |
basePath, |
|
|
params string[] |
paths |
|
) |
| |
|
inlinestatic |
Combines multiple path parts into one.
- Parameters
-
basePath | A base path. |
paths | A path segments added to base path. |
- Returns
- A combined path.
◆ GetExtension()
static string GetExtension |
( |
string |
path | ) |
|
|
inlinestatic |
Gets the extension of a file for given path.
- Parameters
-
- Returns
- An extension.
◆ GetFileName()
static string GetFileName |
( |
string |
path | ) |
|
|
inlinestatic |
Gets file name for given path.
- Parameters
-
- Returns
- A file name.
◆ GetFileNameWithoutExtension()
static string GetFileNameWithoutExtension |
( |
string |
path | ) |
|
|
inlinestatic |
Gets file name without extension for given path.
- Parameters
-
- Returns
- A file name without extension.
◆ GetFolderName()
static string GetFolderName |
( |
string |
path | ) |
|
|
inlinestatic |
Gets the folder name.
Given path must point to the folder.
- Parameters
-
- Returns
- A folder name.
◆ GetParentPath()
static string GetParentPath |
( |
string |
path | ) |
|
|
inlinestatic |
Returns parent path name for the given path.
- Parameters
-
path | A path for which parent will be returned. |
- Returns
- A parent path.
◆ IsAbsolute()
static bool IsAbsolute |
( |
string |
path | ) |
|
|
inlinestatic |
Checks whether a path is absolute.
- Parameters
-
- Returns
- True if path is absolute, false otherwise.
◆ IsFileNameValid()
static bool IsFileNameValid |
( |
string |
fileName | ) |
|
|
inlinestatic |
Determines wheter file name is valid.
- Parameters
-
fileName | A file name to check. |
- Returns
- True if file name is valid, false otherwise.
◆ IsFolder()
static bool IsFolder |
( |
string |
path | ) |
|
|
inlinestatic |
Checks whether a path points to a folder.
- Parameters
-
- Returns
- True if path is a folder, false otherwise.
◆ IsFolderNameValid()
static bool IsFolderNameValid |
( |
string |
folderName | ) |
|
|
inlinestatic |
Determines wheter folder name is valid.
- Parameters
-
folderName | A folder name to check. |
- Returns
- True if folder name is valid, false otherwise.
◆ IsPathValid()
static bool IsPathValid |
( |
string |
path | ) |
|
|
inlinestatic |
Determines wheter path is valid.
- Parameters
-
- Returns
- True if path is valid, false otherwise.
◆ AlternativeSeparator
const char AlternativeSeparator = '\\' |
|
static |
The alternative character used for separating path parts.
◆ ExtensionChar
const char ExtensionChar = '.' |
|
static |
The character used for separating file name and extension.
◆ InvalidFileNameChars
IReadOnlyCollection<char> InvalidFileNameChars |
|
static |
The collection of invalid file name characters.
◆ InvalidFolderNameChars
IReadOnlyCollection<char> InvalidFolderNameChars => InvalidPathChars.Concat(new[] { Separator }).ToArray() |
|
static |
The collection of invalid folder name characters.
◆ InvalidNames
readonly IReadOnlyCollection<string> InvalidNames |
|
static |
Initial value:= new[]
{
"CON",
"PRN",
"AUX",
"CLOCK$",
"NUL",
"COM1",
"COM2",
"COM3",
"COM4",
"COM5",
"COM6",
"COM7",
"COM8",
"COM9",
"LPT1",
"LPT2",
"LPT3",
"LPT4",
"LPT5",
"LPT6",
"LPT7",
"LPT8",
"LPT9"
}
The collection of invalid file and folder names.
◆ InvalidPathChars
IReadOnlyCollection<char> InvalidPathChars |
|
static |
The collection of invalid path characters.
◆ Separator
const char Separator = '/' |
|
static |
◆ SeparatorString
readonly string SeparatorString = Separator.ToString() |
|
static |
The string used for separating path parts.
- See also
- Separator
The documentation for this class was generated from the following file: