Beispiel #1
0
// Get a string representing the file path, optionally with a base
// section stripped off the front.
CString CTGitPath::GetDisplayString(const CTGitPath* pOptionalBasePath /* = NULL*/) const
{
	EnsureFwdslashPathSet();
	if(pOptionalBasePath != NULL)
	{
		// Find the length of the base-path without having to do an 'ensure' on it
		int baseLength = max(pOptionalBasePath->m_sBackslashPath.GetLength(), pOptionalBasePath->m_sFwdslashPath.GetLength());

		// Now, chop that baseLength of the front of the path
		return m_sFwdslashPath.Mid(baseLength).TrimLeft('/');
	}
	return m_sFwdslashPath;
}
Beispiel #2
0
bool CTSVNPath::IsUrl() const
{
    if (!m_bURLKnown)
    {
        EnsureFwdslashPathSet();
        if(m_sUTF8FwdslashPath.IsEmpty())
        {
            SetUTF8FwdslashPath(m_sFwdslashPath);
        }
        m_bIsURL = !!svn_path_is_url(m_sUTF8FwdslashPath);
        m_bURLKnown = true;
    }
    return m_bIsURL;
}
Beispiel #3
0
// Get a string representing the file path, optionally with a base
// section stripped off the front.
LPCTSTR CTSVNPath::GetDisplayString(const CTSVNPath* pOptionalBasePath /* = NULL*/) const
{
    EnsureFwdslashPathSet();
    if(pOptionalBasePath != NULL)
    {
        // Find the length of the base-path without having to do an 'ensure' on it
        int baseLength = max(pOptionalBasePath->m_sBackslashPath.GetLength(), pOptionalBasePath->m_sFwdslashPath.GetLength());

        // Now, chop that baseLength of the front of the path
        LPCTSTR result = m_sFwdslashPath;
        result += baseLength;
        while (*result == '/')
            ++result;

        return result;
    }
    return m_sFwdslashPath;
}
Beispiel #4
0
void CTGitPath::AppendRawString(const CString& sAppend)
{
	EnsureFwdslashPathSet();
	CString strCopy = m_sFwdslashPath += sAppend;
	SetFromUnknown(strCopy);
}