Home | History | Annotate | Download | only in Common
      1 // UpdateProduce.h
      2 
      3 #ifndef __UPDATE_PRODUCE_H
      4 #define __UPDATE_PRODUCE_H
      5 
      6 #include "UpdatePair.h"
      7 
      8 struct CUpdatePair2
      9 {
     10   bool NewData;
     11   bool NewProps;
     12   bool UseArcProps; // if (UseArcProps && NewProps), we want to change only some properties.
     13   bool IsAnti; // if (!IsAnti) we use other ways to detect Anti status
     14 
     15   int DirIndex;
     16   int ArcIndex;
     17   int NewNameIndex;
     18 
     19   bool IsMainRenameItem;
     20 
     21   void SetAs_NoChangeArcItem(int arcIndex)
     22   {
     23     NewData = NewProps = false;
     24     UseArcProps = true;
     25     IsAnti = false;
     26     ArcIndex = arcIndex;
     27   }
     28 
     29   bool ExistOnDisk() const { return DirIndex != -1; }
     30   bool ExistInArchive() const { return ArcIndex != -1; }
     31 
     32   CUpdatePair2():
     33       NewData(false),
     34       NewProps(false),
     35       UseArcProps(false),
     36       IsAnti(false),
     37       DirIndex(-1),
     38       ArcIndex(-1),
     39       NewNameIndex(-1),
     40       IsMainRenameItem(false)
     41       {}
     42 };
     43 
     44 struct IUpdateProduceCallback
     45 {
     46   virtual HRESULT ShowDeleteFile(unsigned arcIndex) = 0;
     47 };
     48 
     49 void UpdateProduce(
     50     const CRecordVector<CUpdatePair> &updatePairs,
     51     const NUpdateArchive::CActionSet &actionSet,
     52     CRecordVector<CUpdatePair2> &operationChain,
     53     IUpdateProduceCallback *callback);
     54 
     55 #endif
     56