Esempio n. 1
0
bool CTSVNPath::IsAncestorOf(const CTSVNPath& 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]==':')));
}
Esempio n. 2
0
// Test if both paths refer to the same item
// Ignores case and slash direction
bool CTSVNPath::IsEquivalentToWithoutCase(const CTSVNPath& 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);
    }
}
Esempio n. 3
0
int CTSVNPath::Compare(const CTSVNPath& left, const CTSVNPath& right)
{
    left.EnsureBackslashPathSet();
    right.EnsureBackslashPathSet();
    return CStringUtils::FastCompareNoCase (left.m_sBackslashPath, right.m_sBackslashPath);
}