/// <summary> /// Compares this object to another for purposes of ordering. /// </summary> /// <param name="other">Other File artifact to compare against.</param> /// <param name="comparer">Path comparer to compare file paths</param> /// <param name="pathOnly">If false, also compare rewrite count and file existence</param> /// <returns>0 if the objects are equal, postitive or negative number depending on which object comes first.</returns> public int CompareTo(FileArtifactWithAttributes other, PathTable.ExpandedAbsolutePathComparer comparer, bool pathOnly) { var pathCompare = comparer.Compare(Path, other.Path); return(pathCompare != 0 || pathOnly ? pathCompare : (((int)m_rewriteCountAndFileExistence) - ((int)other.m_rewriteCountAndFileExistence))); }
/// <summary> /// Creates an instance of <see cref="ExpandedPathFileArtifactComparer"/> /// </summary> public ExpandedPathFileArtifactComparer(PathTable.ExpandedAbsolutePathComparer pathComparer, bool pathOnly) { m_pathComparer = pathComparer; m_pathOnly = pathOnly; }