StringPathExtensions Class

Summary

Extensions for string for handling paths.
Assembly
Cake.Issues.dll
Namespace
Cake.Issues
Base Types
  • Object
graph BT Type-->Base0["Object"] Type["StringPathExtensions"] class Type type-node

Syntax

public static class StringPathExtensions

Methods

Name Value Summary
IsFullPath(string) bool
Checks if a string containing a path is a full path.
static
IsInRepository(string, IRepositorySettings) bool
Checks if a file is part of the repository.
static
IsSubpathOf(string, string) bool
Checks if a path is a sub path of another path. The comparison is case-insensitive, handles / and \ slashes as folder separators and only matches if the base dir folder name is matched exactly (c:\foobar\file.txt is not a sub path of c:\foo).
static
IsValidPath(string) bool
Checks if a string containing a path is a valid path string.
static
IsValidRepositoryFilePath(string, IRepositorySettings) ValueTuple<bool, string>
Validates if a file path is a valid path below RepositoryRoot.
static
MakeFilePathRelativeToRepositoryRoot(string, IRepositorySettings) string
Make path relative to repository root.
static
NormalizePath(string) string
Normalize path string. All / are changed to \.
static
RemoveLeadingDirectorySeparator(string) string
Remove the leading directory separator from a file path.
static
WithEnding(string, string) string
Returns value with the minimal concatenation of ending (starting from end) that results in satisfying .EndsWith(ending).
static
GitHub