Index: src/ch/TLocalFilesystem.cpp =================================================================== diff -u -r4c09a2d7ab35a30114ff2b7c4db12bc413bf538c -r117248f68a61e817de78e501c44ccb4ac7c97ec9 --- src/ch/TLocalFilesystem.cpp (.../TLocalFilesystem.cpp) (revision 4c09a2d7ab35a30114ff2b7c4db12bc413bf538c) +++ src/ch/TLocalFilesystem.cpp (.../TLocalFilesystem.cpp) (revision 117248f68a61e817de78e501c44ccb4ac7c97ec9) @@ -29,51 +29,27 @@ #include "FileSupport.h" #include -void TLocalFilesystem::GetDriveData(const chcore::TSmartPath& spPath, int* piDrvNum, UINT* puiDrvType) +UINT TLocalFilesystem::GetDriveData(const chcore::TSmartPath& spPath) { - chcore::TSmartPath pathDrive = spPath.GetDrive(); - + UINT uiDrvType = DRIVE_UNKNOWN; if(!spPath.IsNetworkPath()) { std::wstring wstrDrive = spPath.ToWString(); - if(wstrDrive.empty()) + if(!wstrDrive.empty()) { - if(piDrvNum) - *piDrvNum = -1; + chcore::TSmartPath pathDrive = spPath.GetDrive(); + pathDrive.AppendSeparatorIfDoesNotExist(); - if(puiDrvType) - *puiDrvType = DRIVE_UNKNOWN; + uiDrvType = GetDriveType(pathDrive.ToString()); + if(uiDrvType == DRIVE_NO_ROOT_DIR) + uiDrvType = DRIVE_UNKNOWN; } - else - { - // disk number - if(piDrvNum) - { - boost::to_upper(wstrDrive); - *piDrvNum = wstrDrive.at(0) - _T('A'); - } - - // disk type - if(puiDrvType) - { - pathDrive.AppendSeparatorIfDoesNotExist(); - - *puiDrvType = GetDriveType(pathDrive.ToString()); - if(*puiDrvType == DRIVE_NO_ROOT_DIR) - *puiDrvType = DRIVE_UNKNOWN; - } - } } else - { - // network path - if(piDrvNum) - *piDrvNum = -1; + uiDrvType = DRIVE_REMOTE; - if(puiDrvType) - *puiDrvType = DRIVE_REMOTE; - } + return uiDrvType; } bool TLocalFilesystem::PathExist(chcore::TSmartPath pathToCheck) @@ -219,13 +195,11 @@ THROW(_T("Invalid pointer"), 0, 0, 0); // get information about both paths - int iFirstDriveNumber = 0; UINT uiFirstDriveType = 0; - GetDriveData(pathFirst, &iFirstDriveNumber, &uiFirstDriveType); + uiFirstDriveType = GetDriveData(pathFirst); - int iSecondDriveNumber = 0; UINT uiSecondDriveType = 0; - GetDriveData(pathSecond, &iSecondDriveNumber, &uiSecondDriveType); + uiSecondDriveType = GetDriveData(pathSecond); // what kind of relation... EPathsRelation eRelation = eRelation_Other; Index: src/ch/TLocalFilesystem.h =================================================================== diff -u -r4c09a2d7ab35a30114ff2b7c4db12bc413bf538c -r117248f68a61e817de78e501c44ccb4ac7c97ec9 --- src/ch/TLocalFilesystem.h (.../TLocalFilesystem.h) (revision 4c09a2d7ab35a30114ff2b7c4db12bc413bf538c) +++ src/ch/TLocalFilesystem.h (.../TLocalFilesystem.h) (revision 117248f68a61e817de78e501c44ccb4ac7c97ec9) @@ -48,7 +48,6 @@ }; public: - static void GetDriveData(const chcore::TSmartPath& spPath, int *piDrvNum, UINT *puiDrvType); static bool PathExist(chcore::TSmartPath strPath); // check for file or folder existence static bool SetFileDirectoryTime(const chcore::TSmartPath& pathFileDir, const FILETIME& ftCreationTime, const FILETIME& ftLastAccessTime, const FILETIME& ftLastWriteTime); @@ -68,6 +67,7 @@ private: static chcore::TSmartPath PrependPathExtensionIfNeeded(const chcore::TSmartPath& pathInput); + static UINT GetDriveData(const chcore::TSmartPath& spPath); DWORD GetPhysicalDiskNumber(wchar_t wchDrive); private: