Index: src/libchcore/TPath.cpp =================================================================== diff -u -N -re8f31b0f922b402878356e130c866c4f3682a7f5 -rf866db90e4b058a4f2e13cc6cf076d1e0bf2d956 --- src/libchcore/TPath.cpp (.../TPath.cpp) (revision e8f31b0f922b402878356e130c866c4f3682a7f5) +++ src/libchcore/TPath.cpp (.../TPath.cpp) (revision f866db90e4b058a4f2e13cc6cf076d1e0bf2d956) @@ -448,6 +448,11 @@ return (m_strPath.GetLength() == 2 && m_strPath.GetAt(1) == _T(':')); } + bool TSmartPath::IsDriveWithRootDir() const + { + return (m_strPath.GetLength() == 3 && m_strPath.GetAt(1) == _T(':') && m_strPath.GetAt(2) == _T('\\')); + } + // ============================================================================ /// TSmartPath::HasDrive /// @date 2010/10/16 @@ -500,6 +505,14 @@ return L'\0'; } + TSmartPath TSmartPath::GetDriveLetterAsPath() const + { + if(m_strPath.GetLength() >= 2 && m_strPath.GetAt(1) == _T(':')) + return PathFromWString(m_strPath.Left(1)); // c for c:\windows\test.cpp + + return TSmartPath(); + } + // ============================================================================ /// TSmartPath::IsServerName /// @date 2011/04/05 @@ -849,6 +862,11 @@ m_strPath.Delete(0, 1); } + void TSmartPath::StripPath(const wchar_t* pszToStrip) + { + m_strPath.Replace(pszToStrip, L""); + } + // ============================================================================ /// TSmartPath::IsEmpty /// @date 2010/10/07