static public string ApplyFolderEquality(string path, FolderPathEquality folderEquality) { if (path == null) { throw new ArgumentNullException(); } if (folderEquality == FolderPathEquality.RespectAmbiguity) { path = PathUtils.TrimEndSeparator(path); } return(path); }
static public bool Equals(string first, string second, PathCaseComparison caseComparison, FolderPathEquality folderEquality) { if (first == null && second == null) { return(true); } if (first == null ^ second == null) { return(false); } return(string.Equals(ApplyFolderEquality(PathUtils.Normalize(first), folderEquality), ApplyFolderEquality(PathUtils.Normalize(second), folderEquality), GetStringComparison(caseComparison))); }
static public int Compare(string first, string second, PathCaseComparison caseComparison, FolderPathEquality folderEquality) { if (first == null && second == null) { return(0); } if (first == null) { return(-1); } if (second == null) { return(1); } return(string.Compare(ApplyFolderEquality(PathUtils.Normalize(first), folderEquality), ApplyFolderEquality(PathUtils.Normalize(second), folderEquality), GetStringComparison(caseComparison))); }
public PathComparer(PathCaseComparison caseComparison, FolderPathEquality folderEquality) { CaseComparison = caseComparison; FolderEquality = folderEquality; }