1 // DirItem.h 2 3 #ifndef __DIR_ITEM_H 4 #define __DIR_ITEM_H 5 6 #include "Common/MyString.h" 7 #include "Common/Types.h" 8 #include "../../Archive/IArchive.h" 9 10 struct CDirItem 11 { 12 UInt64 Size; 13 FILETIME CTime; 14 FILETIME ATime; 15 FILETIME MTime; 16 UString Name; 17 UInt32 Attrib; 18 int PhyParent; 19 int LogParent; 20 CDirItemCDirItem21 CDirItem(): PhyParent(-1), LogParent(-1) {} IsDirCDirItem22 bool IsDir() const { return (Attrib & FILE_ATTRIBUTE_DIRECTORY) != 0 ; } 23 }; 24 25 class CDirItems 26 { 27 UStringVector Prefixes; 28 CIntVector PhyParents; 29 CIntVector LogParents; 30 31 UString GetPrefixesPath(const CIntVector &parents, int index, const UString &name) const; 32 public: 33 CObjectVector<CDirItem> Items; 34 GetNumFolders()35 int GetNumFolders() const { return Prefixes.Size(); } 36 UString GetPhyPath(int index) const; 37 UString GetLogPath(int index) const; 38 39 int AddPrefix(int phyParent, int logParent, const UString &prefix); 40 void DeleteLastPrefix(); 41 42 void EnumerateDirectory(int phyParent, int logParent, const UString &phyPrefix, 43 UStringVector &errorPaths, CRecordVector<DWORD> &errorCodes); 44 45 void EnumerateDirItems2( 46 const UString &phyPrefix, 47 const UString &logPrefix, 48 const UStringVector &filePaths, 49 UStringVector &errorPaths, CRecordVector<DWORD> &errorCodes); 50 51 void ReserveDown(); 52 }; 53 54 struct CArcItem 55 { 56 UInt64 Size; 57 FILETIME MTime; 58 UString Name; 59 bool IsDir; 60 bool SizeDefined; 61 bool MTimeDefined; 62 bool Censored; 63 UInt32 IndexInServer; 64 int TimeType; 65 CArcItemCArcItem66 CArcItem(): IsDir(false), SizeDefined(false), MTimeDefined(false), Censored(false), TimeType(-1) {} 67 }; 68 69 #endif 70