Welcome to mirror list, hosted at ThFree Co, Russian Federation.

AgentProxy.h « Agent « UI « 7zip « CPP - github.com/kornelski/7z.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9402cfdd38501012b77fb4d79a886b3c66ca5b28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// AgentProxy.h

#ifndef __AGENT_PROXY_H
#define __AGENT_PROXY_H

#include "Common/String.h"

#include "../../Archive/IArchive.h"

class CProxyFile
{
public:
  UINT32 Index;
  UString Name;
};

class CProxyFolder: public CProxyFile
{
public:
  CProxyFolder *Parent;
  CObjectVector<CProxyFolder> Folders;
  CObjectVector<CProxyFile> Files;
  bool IsLeaf;

  CProxyFolder(): Parent(NULL) {};
  int FindDirSubItemIndex(const UString &name, int &insertPos) const;
  int FindDirSubItemIndex(const UString &name) const;
  CProxyFolder* AddDirSubItem(UINT32 index, 
      bool leaf, const UString &name);
  void AddFileSubItem(UINT32 index, const UString &name);
  void Clear();

  UString GetFullPathPrefix() const;
  UString GetItemName(UINT32 index) const;
  void AddRealIndices(CUIntVector &realIndices) const;
  void GetRealIndices(const UINT32 *indices, UINT32 numItems, 
      CUIntVector &realIndices) const;
};

class CProxyArchive
{
  HRESULT ReadObjects(IInArchive *inArchive, IProgress *progress);
public:
  UString DefaultName;
  // FILETIME DefaultTime;
  // UINT32 DefaultAttributes;
  CProxyFolder RootFolder;
  HRESULT Reload(IInArchive *archive, IProgress *progress);
  HRESULT Load(IInArchive *archive, 
      const UString &defaultName,
      // const FILETIME &defaultTime,
      // UINT32 defaultAttributes,
      IProgress *progress);
};

#endif