misc/libphysfs/lzma/CPP/7zip/Archive/7z/7zUpdate.h
changeset 13881 99b265e0d1d0
parent 13880 5f819b90d479
child 13882 b172a5d40eee
equal deleted inserted replaced
13880:5f819b90d479 13881:99b265e0d1d0
     1 // 7zUpdate.h
       
     2 
       
     3 #ifndef __7Z_UPDATE_H
       
     4 #define __7Z_UPDATE_H
       
     5 
       
     6 #include "7zIn.h"
       
     7 #include "7zOut.h"
       
     8 #include "7zCompressionMode.h"
       
     9 
       
    10 #include "../IArchive.h"
       
    11 
       
    12 namespace NArchive {
       
    13 namespace N7z {
       
    14 
       
    15 struct CUpdateItem
       
    16 {
       
    17   bool NewData;
       
    18   bool NewProperties;
       
    19   int IndexInArchive;
       
    20   int IndexInClient;
       
    21   
       
    22   UInt32 Attributes;
       
    23   FILETIME CreationTime;
       
    24   FILETIME LastWriteTime;
       
    25   FILETIME LastAccessTime;
       
    26 
       
    27   UInt64 Size;
       
    28   UString Name;
       
    29   
       
    30   bool IsAnti;
       
    31   bool IsDirectory;
       
    32 
       
    33   bool IsCreationTimeDefined;
       
    34   bool IsLastWriteTimeDefined;
       
    35   bool IsLastAccessTimeDefined;
       
    36   bool AttributesAreDefined;
       
    37 
       
    38   bool HasStream() const 
       
    39     { return !IsDirectory && !IsAnti && Size != 0; }
       
    40   CUpdateItem():  
       
    41       IsAnti(false), 
       
    42       AttributesAreDefined(false), 
       
    43       IsCreationTimeDefined(false), 
       
    44       IsLastWriteTimeDefined(false), 
       
    45       IsLastAccessTimeDefined(false)
       
    46       {}
       
    47   void SetDirectoryStatusFromAttributes()
       
    48     { IsDirectory = ((Attributes & FILE_ATTRIBUTE_DIRECTORY) != 0); };
       
    49 
       
    50   int GetExtensionPos() const;
       
    51   UString GetExtension() const;
       
    52 };
       
    53 
       
    54 struct CUpdateOptions
       
    55 {
       
    56   const CCompressionMethodMode *Method;
       
    57   const CCompressionMethodMode *HeaderMethod;
       
    58   bool UseFilters;
       
    59   bool MaxFilter;
       
    60 
       
    61   CHeaderOptions HeaderOptions;
       
    62 
       
    63   UInt64 NumSolidFiles;
       
    64   UInt64 NumSolidBytes;
       
    65   bool SolidExtension;
       
    66   bool RemoveSfxBlock;
       
    67   bool VolumeMode;
       
    68 };
       
    69 
       
    70 HRESULT Update(
       
    71     DECL_EXTERNAL_CODECS_LOC_VARS
       
    72     IInStream *inStream,
       
    73     const CArchiveDatabaseEx *database,
       
    74     const CObjectVector<CUpdateItem> &updateItems,
       
    75     ISequentialOutStream *seqOutStream,
       
    76     IArchiveUpdateCallback *updateCallback,
       
    77     const CUpdateOptions &options);
       
    78 }}
       
    79 
       
    80 #endif