misc/libphysfs/lzma/CPP/7zip/Archive/7z/7zHandler.h
changeset 13904 99b265e0d1d0
parent 13903 5f819b90d479
child 13905 b172a5d40eee
equal deleted inserted replaced
13903:5f819b90d479 13904:99b265e0d1d0
     1 // 7z/Handler.h
       
     2 
       
     3 #ifndef __7Z_HANDLER_H
       
     4 #define __7Z_HANDLER_H
       
     5 
       
     6 #include "../../ICoder.h"
       
     7 #include "../IArchive.h"
       
     8 #include "7zIn.h"
       
     9 
       
    10 #include "7zCompressionMode.h"
       
    11 
       
    12 #include "../../Common/CreateCoder.h"
       
    13 
       
    14 #ifndef EXTRACT_ONLY
       
    15 #include "../Common/HandlerOut.h"
       
    16 #endif
       
    17 
       
    18 namespace NArchive {
       
    19 namespace N7z {
       
    20 
       
    21 #ifdef _7Z_VOL
       
    22 struct CRef
       
    23 {
       
    24   int VolumeIndex;
       
    25   int ItemIndex;
       
    26 };
       
    27 
       
    28 struct CVolume
       
    29 {
       
    30   int StartRef2Index;
       
    31   CMyComPtr<IInStream> Stream;
       
    32   CArchiveDatabaseEx Database;
       
    33 };
       
    34 #endif
       
    35 
       
    36 #ifndef __7Z_SET_PROPERTIES
       
    37 
       
    38 #ifdef EXTRACT_ONLY
       
    39 #ifdef COMPRESS_MT
       
    40 #define __7Z_SET_PROPERTIES
       
    41 #endif
       
    42 #else 
       
    43 #define __7Z_SET_PROPERTIES
       
    44 #endif
       
    45 
       
    46 #endif
       
    47 
       
    48 
       
    49 class CHandler: 
       
    50   #ifndef EXTRACT_ONLY
       
    51   public NArchive::COutHandler,
       
    52   #endif
       
    53   public IInArchive,
       
    54   #ifdef _7Z_VOL
       
    55   public IInArchiveGetStream,
       
    56   #endif
       
    57   #ifdef __7Z_SET_PROPERTIES
       
    58   public ISetProperties, 
       
    59   #endif
       
    60   #ifndef EXTRACT_ONLY
       
    61   public IOutArchive, 
       
    62   #endif
       
    63   PUBLIC_ISetCompressCodecsInfo
       
    64   public CMyUnknownImp
       
    65 {
       
    66 public:
       
    67   MY_QUERYINTERFACE_BEGIN2(IInArchive)
       
    68   #ifdef _7Z_VOL
       
    69   MY_QUERYINTERFACE_ENTRY(IInArchiveGetStream)
       
    70   #endif
       
    71   #ifdef __7Z_SET_PROPERTIES
       
    72   MY_QUERYINTERFACE_ENTRY(ISetProperties)
       
    73   #endif
       
    74   #ifndef EXTRACT_ONLY
       
    75   MY_QUERYINTERFACE_ENTRY(IOutArchive)
       
    76   #endif
       
    77   QUERY_ENTRY_ISetCompressCodecsInfo
       
    78   MY_QUERYINTERFACE_END
       
    79   MY_ADDREF_RELEASE
       
    80 
       
    81   INTERFACE_IInArchive(;)
       
    82 
       
    83   #ifdef _7Z_VOL
       
    84   STDMETHOD(GetStream)(UInt32 index, ISequentialInStream **stream);  
       
    85   #endif
       
    86 
       
    87   #ifdef __7Z_SET_PROPERTIES
       
    88   STDMETHOD(SetProperties)(const wchar_t **names, const PROPVARIANT *values, Int32 numProperties);
       
    89   #endif
       
    90 
       
    91   #ifndef EXTRACT_ONLY
       
    92   INTERFACE_IOutArchive(;)
       
    93   #endif
       
    94 
       
    95   DECL_ISetCompressCodecsInfo
       
    96 
       
    97   CHandler();
       
    98 
       
    99 private:
       
   100   #ifdef _7Z_VOL
       
   101   CObjectVector<CVolume> _volumes;
       
   102   CObjectVector<CRef> _refs;
       
   103   #else
       
   104   CMyComPtr<IInStream> _inStream;
       
   105   NArchive::N7z::CArchiveDatabaseEx _database;
       
   106   #endif
       
   107 
       
   108   #ifdef EXTRACT_ONLY
       
   109   
       
   110   #ifdef COMPRESS_MT
       
   111   UInt32 _numThreads;
       
   112   #endif
       
   113 
       
   114   UInt32 _crcSize;
       
   115 
       
   116   #else
       
   117   
       
   118   CRecordVector<CBind> _binds;
       
   119 
       
   120   HRESULT SetPassword(CCompressionMethodMode &methodMode, IArchiveUpdateCallback *updateCallback);
       
   121 
       
   122   HRESULT SetCompressionMethod(CCompressionMethodMode &method,
       
   123       CObjectVector<COneMethodInfo> &methodsInfo
       
   124       #ifdef COMPRESS_MT
       
   125       , UInt32 numThreads
       
   126       #endif
       
   127       );
       
   128 
       
   129   HRESULT SetCompressionMethod(
       
   130       CCompressionMethodMode &method,
       
   131       CCompressionMethodMode &headerMethod);
       
   132 
       
   133   #endif
       
   134 
       
   135   bool IsEncrypted(UInt32 index2) const;
       
   136   #ifndef _SFX
       
   137 
       
   138   CRecordVector<UInt64> _fileInfoPopIDs;
       
   139   void FillPopIDs();
       
   140 
       
   141   #endif
       
   142 };
       
   143 
       
   144 }}
       
   145 
       
   146 #endif