bool CTGitPath::IsAncestorOf(const CTGitPath& possibleDescendant) const { possibleDescendant.EnsureBackslashPathSet(); EnsureBackslashPathSet(); bool bPathStringsEqual = ArePathStringsEqual(m_sBackslashPath, possibleDescendant.m_sBackslashPath.Left(m_sBackslashPath.GetLength())); if (m_sBackslashPath.GetLength() >= possibleDescendant.GetWinPathString().GetLength()) { return bPathStringsEqual; } return (bPathStringsEqual && ((possibleDescendant.m_sBackslashPath[m_sBackslashPath.GetLength()] == '\\')|| (m_sBackslashPath.GetLength()==3 && m_sBackslashPath[1]==':'))); }
bool CTGitPath::IsEquivalentToWithoutCase(const CTGitPath& rhs) const { // Try and find a slash direction which avoids having to convert // both filenames if(!m_sBackslashPath.IsEmpty()) { // *We've* got a \ path - make sure that the RHS also has a \ path rhs.EnsureBackslashPathSet(); return ArePathStringsEqual(m_sBackslashPath, rhs.m_sBackslashPath); } else { // Assume we've got a fwdslash path and make sure that the RHS has one rhs.EnsureFwdslashPathSet(); return ArePathStringsEqual(m_sFwdslashPath, rhs.m_sFwdslashPath); } }
int CTGitPath::Compare(const CTGitPath& left, const CTGitPath& right) { left.EnsureBackslashPathSet(); right.EnsureBackslashPathSet(); return left.m_sBackslashPath.CompareNoCase(right.m_sBackslashPath); }