Index: src/ch/TLocalFilesystem.h =================================================================== diff -u -N -r886c32a98f09ae8dc24ceb6b27e5c8a75104954e -r4c09a2d7ab35a30114ff2b7c4db12bc413bf538c --- src/ch/TLocalFilesystem.h (.../TLocalFilesystem.h) (revision 886c32a98f09ae8dc24ceb6b27e5c8a75104954e) +++ src/ch/TLocalFilesystem.h (.../TLocalFilesystem.h) (revision 4c09a2d7ab35a30114ff2b7c4db12bc413bf538c) @@ -24,6 +24,8 @@ #define __TLOCALFILESYSTEM_H__ #include "../libchcore/TPath.h" +#include +#include class CFileInfo; typedef boost::shared_ptr CFileInfoPtr; @@ -36,6 +38,16 @@ class TLocalFilesystem { public: + enum EPathsRelation + { + eRelation_Network, // at least one of the paths is network one + eRelation_CDRom, // at least one of the paths relates to cd/dvd drive + eRelation_TwoPhysicalDisks, // paths lies on two separate physical disks + eRelation_SinglePhysicalDisk, // paths lies on the same physical disk + eRelation_Other // other type of relation + }; + +public: static void GetDriveData(const chcore::TSmartPath& spPath, int *piDrvNum, UINT *puiDrvType); static bool PathExist(chcore::TSmartPath strPath); // check for file or folder existence @@ -52,9 +64,16 @@ static TLocalFilesystemFind CreateFinderObject(const chcore::TSmartPath& pathDir, const chcore::TSmartPath& pathMask); static TLocalFilesystemFile CreateFileObject(); + EPathsRelation GetPathsRelation(const chcore::TSmartPath& pathFirst, const chcore::TSmartPath& pathSecond); + private: static chcore::TSmartPath PrependPathExtensionIfNeeded(const chcore::TSmartPath& pathInput); + DWORD GetPhysicalDiskNumber(wchar_t wchDrive); +private: + std::map m_mapDriveLetterToPhysicalDisk; // caches drive letter -> physical disk number + boost::shared_mutex m_lockDriveLetterToPhysicalDisk; + friend class TLocalFilesystemFind; friend class TLocalFilesystemFile; };