Imported Upstream version 9.20
[platform/upstream/7zip.git] / CPP / 7zip / UI / Agent / AgentProxy.h
1 // AgentProxy.h\r
2 \r
3 #ifndef __AGENT_PROXY_H\r
4 #define __AGENT_PROXY_H\r
5 \r
6 #include "Common/MyString.h"\r
7 \r
8 #include "../Common/OpenArchive.h"\r
9 \r
10 struct CProxyFile\r
11 {\r
12   UInt32 Index;\r
13   UString Name;\r
14 };\r
15 \r
16 struct CProxyFolder: public CProxyFile\r
17 {\r
18   CProxyFolder *Parent;\r
19   CObjectVector<CProxyFolder> Folders;\r
20   CObjectVector<CProxyFile> Files;\r
21   bool IsLeaf;\r
22 \r
23   bool CrcIsDefined;\r
24   UInt64 Size;\r
25   UInt64 PackSize;\r
26   UInt32 Crc;\r
27   UInt32 NumSubFolders;\r
28   UInt32 NumSubFiles;\r
29 \r
30   CProxyFolder(): Parent(NULL) {};\r
31   int FindDirSubItemIndex(const UString &name, int &insertPos) const;\r
32   int FindDirSubItemIndex(const UString &name) const;\r
33   CProxyFolder* AddDirSubItem(UInt32 index, bool leaf, const UString &name);\r
34   void AddFileSubItem(UInt32 index, const UString &name);\r
35   void Clear();\r
36 \r
37   void GetPathParts(UStringVector &pathParts) const;\r
38   UString GetFullPathPrefix() const;\r
39   UString GetItemName(UInt32 index) const;\r
40   void AddRealIndices(CUIntVector &realIndices) const;\r
41   void GetRealIndices(const UInt32 *indices, UInt32 numItems, CUIntVector &realIndices) const;\r
42   void CalculateSizes(IInArchive *archive);\r
43 };\r
44 \r
45 struct CProxyArchive\r
46 {\r
47   CProxyFolder RootFolder;\r
48   bool ThereIsPathProp;\r
49 \r
50   HRESULT Load(const CArc &arc, IProgress *progress);\r
51 };\r
52 \r
53 #endif\r