public static string GetRelativePathOutputWindowsIfWindows(string sourcePath, string destinationPath) { var relativePath = StringlyTypedPathInternals.GetRelativePathUriToUri(sourcePath, destinationPath); // The Uri.MakeRelativeUri() method outputs the non-Windows directory separator. If the input source path was a Windows path, output a Windows path. var isWindowsPath = StringlyTypedPath.IsWindowsPathStrict(sourcePath); if (isWindowsPath) { var ensuredWindowsRelativePath = StringlyTypedPath.EnsureWindowsDirectorySeparator(relativePath); return(ensuredWindowsRelativePath); } return(relativePath); }
public static string AdjustRelativePathForFileSource(string sourceFilePath, string relativePath) { // The Uri.MakeRelativeUri() output requires special handling for file path sources since it always produces paths relative to the most derived directory path (which for a file path is the path of the directory containing the file). var directorySeparator = DirectorySeparator.NonWindows; // The Uri.MakeRelativeUri() method always produces paths using the non-Windows directory separator. var isWindowsPath = StringlyTypedPath.IsWindowsPathStrict(sourceFilePath); if (isWindowsPath) { directorySeparator = DirectorySeparator.Windows; } var prefix = $"{DirectoryName.ParentRelativeDirectoryName}{directorySeparator}"; var prefixedRelativePath = relativePath.Prefix(prefix); return(prefixedRelativePath); }
public ArgumentException GetPathNotRootIndicatedArgumentException(string path, string parameterName) { var output = StringlyTypedPath.GetPathNotRootIndicatedArgumentException(path, parameterName); return(output); }
public string GetPathNotRootIndicatedExceptionMessage(string path) { var output = StringlyTypedPath.GetPathNotRootIndicatedExceptionMessage(path); return(output); }
public string GetParentDirectoryPathForDirectoryPath(string directoryPath) { var output = StringlyTypedPath.GetParentDirectoryPathForDirectoryPath(directoryPath); return(output); }
public string GetDirectoryNameForFilePath(string filePath) { var output = StringlyTypedPath.GetDirectoryNameForFilePath(filePath); return(output); }
public string GetFileName(string filePath) { var output = StringlyTypedPath.GetFileName(filePath); return(output); }
public string[] GetAllPathParts(string path) { var output = StringlyTypedPath.GetAllPathParts(path); return(output); }
public string CombineUsingDirectorySeparator(string directorySeparator, params string[] pathSegments) { var output = StringlyTypedPath.CombineUsingDirectorySeparator(directorySeparator, pathSegments); return(output); }
public string CombineTwo(string directorySeparator, string pathSegment1, string pathSegment2) { var output = StringlyTypedPath.CombineTwo(directorySeparator, pathSegment1, pathSegment2); return(output); }
public bool TryDetectDirectorySeparator(string path, out string directorySeparator) { var output = StringlyTypedPath.TryDetectDirectorySeparator(path, out directorySeparator); return(output); }
public string CombineUnresolvedEnsured(string directorySeparator, string pathSegment1, string pathSegment2) { var output = StringlyTypedPath.CombineUnresolvedEnsured(directorySeparator, pathSegment1, pathSegment2); return(output); }
public string CombineDirectoryIndicated(string directoryIndicatedPathSegment1, string pathSegment2) { var output = StringlyTypedPath.CombineDirectoryIndicated(directoryIndicatedPathSegment1, pathSegment2); return(output); }
// Resolution. public string ResolvePath(string unresolvedPath) { var output = StringlyTypedPath.ResolvePath(unresolvedPath); return(output); }
public string GetRelativePathDirectoryToDirectory(string sourceDirectoryPath, string destinationDirectoryPath) { var output = StringlyTypedPath.GetRelativePathDirectoryToDirectory(sourceDirectoryPath, destinationDirectoryPath); return(output); }
public string GetDirectoryPath(string directoryPath, string directoryName) { var output = StringlyTypedPath.GetDirectoryPath(directoryPath, directoryName); return(output); }
public string[] GetPathSegments(string path, string directorySeparator) { var output = StringlyTypedPath.GetPathSegments(path, directorySeparator); return(output); }
public string Combine(string pathSegment1, string pathSegment2) { var output = StringlyTypedPath.Combine(pathSegment1, pathSegment2); return(output); }
public string GetFileNamePathSegment(params string[] pathSegments) { var output = StringlyTypedPath.GetFileNamePathSegment(pathSegments); return(output); }
public string CombineNonWindows(params string[] pathSegments) { var output = StringlyTypedPath.CombineNonWindows(pathSegments); return(output); }
public string GetFileExtension(string filePath) { var output = StringlyTypedPath.GetFileExtension(filePath); return(output); }
public string GetFilePathChecked(string directoryPath, string fileName, string directorySeparator) { var output = StringlyTypedPath.GetFilePathChecked(directoryPath, fileName, directorySeparator); return(output); }
public string GetDirectoryNameForDirectoryPathEnsured(string directoryPath) { var output = StringlyTypedPath.GetDirectoryNameForDirectoryPathEnsured(directoryPath); return(output); }
// Classification. public bool IsWindowsPathAssumeWindows(string path) { var output = StringlyTypedPath.IsWindowsPathAssumeWindows(path); return(output); }
public Exception GetPathIsDirectoryIndicatedException(string path) { var output = StringlyTypedPath.GetPathIsDirectoryIndicatedException(path); return(output); }
public string GetFilePath(string directoryPath, string fileName) { var output = StringlyTypedPath.GetFilePath(directoryPath, fileName); return(output); }
public Exception GetPathNotRootIndicatedException(string path) { var output = StringlyTypedPath.GetPathNotRootIndicatedException(path); return(output); }
public bool ExistsFilePath(string filePath) { var output = StringlyTypedPath.ExistsFilePath(filePath); return(output); }
public bool IsNonWindowsPathStrict(string path) { var output = StringlyTypedPath.IsNonWindowsPathStrict(path); return(output); }
public string GetDirectoryPathEnsured(string directoryPath, string directoryName, string directorySeparator) { var output = StringlyTypedPath.GetDirectoryPathEnsured(directoryPath, directoryName, directorySeparator); return(output); }