1// UpdateAction.h
2
3#ifndef __UPDATE_ACTION_H
4#define __UPDATE_ACTION_H
5
6namespace NUpdateArchive {
7
8  namespace NPairState
9  {
10    const int kNumValues = 7;
11    enum EEnum
12    {
13      kNotMasked = 0,
14      kOnlyInArchive,
15      kOnlyOnDisk,
16      kNewInArchive,
17      kOldInArchive,
18      kSameFiles,
19      kUnknowNewerFiles
20    };
21  }
22
23  namespace NPairAction
24  {
25    enum EEnum
26    {
27      kIgnore = 0,
28      kCopy,
29      kCompress,
30      kCompressAsAnti
31    };
32  }
33
34  struct CActionSet
35  {
36    NPairAction::EEnum StateActions[NPairState::kNumValues];
37    bool NeedScanning() const
38    {
39      int i;
40      for (i = 0; i < NPairState::kNumValues; i++)
41        if (StateActions[i] == NPairAction::kCompress)
42          return true;
43      for (i = 1; i < NPairState::kNumValues; i++)
44        if (StateActions[i] != NPairAction::kIgnore)
45          return true;
46      return false;
47    }
48  };
49
50  extern const CActionSet kAddActionSet;
51  extern const CActionSet kUpdateActionSet;
52  extern const CActionSet kFreshActionSet;
53  extern const CActionSet kSynchronizeActionSet;
54  extern const CActionSet kDeleteActionSet;
55}
56
57#endif
58