Index: src/ch/FileInfo.cpp =================================================================== diff -u -N -r3f33c90e9e49ccf7b52b604e849ba8be5be1dba7 -r591f291e22d2ece89acb266c8aa0b05c257a407c --- src/ch/FileInfo.cpp (.../FileInfo.cpp) (revision 3f33c90e9e49ccf7b52b604e849ba8be5be1dba7) +++ src/ch/FileInfo.cpp (.../FileInfo.cpp) (revision 591f291e22d2ece89acb266c8aa0b05c257a407c) @@ -100,7 +100,7 @@ // add data to members chcore::TSmartPath pathNew(pathFile); - pathNew.DeleteLastComponent(); + pathNew.DeleteFileName(); Create(&wfd, pathNew, stSrcIndex); return true; @@ -119,93 +119,6 @@ } } -chcore::TSmartPath CFileInfo::GetFileDrive() const -{ - BOOST_ASSERT(m_pBasePaths); - if(!m_pBasePaths) - THROW(_T("Invalid pointer"), 0, 0, 0); - - chcore::TSmartPath pathCombined = (m_stSrcIndex != std::numeric_limits::max()) ? m_pBasePaths->GetAt(m_stSrcIndex) + m_pathFile : m_pathFile; - - TCHAR szDrive[_MAX_DRIVE]; - _tsplitpath(pathCombined.ToString(), szDrive, NULL, NULL, NULL); - return chcore::PathFromString(szDrive); -} - -chcore::TSmartPath CFileInfo::GetFileDir() const -{ - BOOST_ASSERT(m_pBasePaths); - if(!m_pBasePaths) - THROW(_T("Invalid pointer"), 0, 0, 0); - - chcore::TSmartPath pathCombined = (m_stSrcIndex != std::numeric_limits::max()) ? m_pBasePaths->GetAt(m_stSrcIndex) + m_pathFile : m_pathFile; - - TCHAR szDir[_MAX_DIR]; - _tsplitpath(pathCombined.ToString(), NULL, szDir, NULL, NULL); - return chcore::PathFromString(szDir); -} - -chcore::TSmartPath CFileInfo::GetFileTitle() const -{ - BOOST_ASSERT(m_pBasePaths); - if(!m_pBasePaths) - THROW(_T("Invalid pointer"), 0, 0, 0); - - chcore::TSmartPath pathCombined = (m_stSrcIndex != std::numeric_limits::max()) ? m_pBasePaths->GetAt(m_stSrcIndex) + m_pathFile : m_pathFile; - TCHAR szName[_MAX_FNAME]; - _tsplitpath(pathCombined.ToString(), NULL, NULL, szName, NULL); - return chcore::PathFromString(szName); -} - -chcore::TSmartPath CFileInfo::GetFileExt() const -{ - ASSERT(m_pBasePaths); - BOOST_ASSERT(m_pBasePaths); - if(!m_pBasePaths) - THROW(_T("Invalid pointer"), 0, 0, 0); - - chcore::TSmartPath pathCombined = (m_stSrcIndex != std::numeric_limits::max()) ? m_pBasePaths->GetAt(m_stSrcIndex) + m_pathFile : m_pathFile; - TCHAR szExt[_MAX_EXT]; - _tsplitpath(pathCombined.ToString(), NULL, NULL, NULL, szExt); - return chcore::PathFromString(szExt); -} - -chcore::TSmartPath CFileInfo::GetFileRoot() const -{ - ASSERT(m_pBasePaths); - BOOST_ASSERT(m_pBasePaths); - if(!m_pBasePaths) - THROW(_T("Invalid pointer"), 0, 0, 0); - - chcore::TSmartPath pathCombined = (m_stSrcIndex != std::numeric_limits::max()) ? m_pBasePaths->GetAt(m_stSrcIndex) + m_pathFile : m_pathFile; - - TCHAR szDrive[_MAX_DRIVE]; - TCHAR szDir[_MAX_DIR]; - _tsplitpath(pathCombined.ToString(), szDrive, szDir, NULL, NULL); - return chcore::PathFromString(szDrive) + chcore::PathFromString(szDir); -} - -chcore::TSmartPath CFileInfo::GetFileName() const -{ - BOOST_ASSERT(m_pBasePaths); - if(!m_pBasePaths) - THROW(_T("Invalid pointer"), 0, 0, 0); - - chcore::TSmartPath pathCombined; - if(m_pBasePaths && m_stSrcIndex != std::numeric_limits::max()) - pathCombined = m_pBasePaths->GetAt(m_stSrcIndex) + m_pathFile; - else - { - ASSERT(m_stSrcIndex == std::numeric_limits::max()); - pathCombined = m_pathFile; - } - - TCHAR szName[_MAX_FNAME]; - TCHAR szExt[_MAX_EXT]; - _tsplitpath(pathCombined.ToString(), NULL, NULL, szName, szExt); - return chcore::PathFromString(szName) + chcore::PathFromString(szExt); -} - bool CFileInfo::operator==(const CFileInfo& rInfo) { return (rInfo.m_dwAttributes == m_dwAttributes && rInfo.m_ftCreation.dwHighDateTime == m_ftCreation.dwHighDateTime && rInfo.m_ftCreation.dwLowDateTime == m_ftCreation.dwLowDateTime