diff src/win32/7zip/7z/CPP/7zip/Archive/7z/7zFolderInStream.h @ 1:f9f4f1b99eed

importing src directory
author Robert McIntyre <rlm@mit.edu>
date Sat, 03 Mar 2012 10:31:27 -0600
parents
children
line wrap: on
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/win32/7zip/7z/CPP/7zip/Archive/7z/7zFolderInStream.h	Sat Mar 03 10:31:27 2012 -0600
     1.3 @@ -0,0 +1,66 @@
     1.4 +// 7z/FolderInStream.h
     1.5 +
     1.6 +#ifndef __7Z_FOLDERINSTREAM_H
     1.7 +#define __7Z_FOLDERINSTREAM_H
     1.8 +
     1.9 +#include "7zItem.h"
    1.10 +#include "7zHeader.h"
    1.11 +
    1.12 +#include "../IArchive.h"
    1.13 +#include "../Common/InStreamWithCRC.h"
    1.14 +#include "../../IStream.h"
    1.15 +#include "../../ICoder.h"
    1.16 +
    1.17 +namespace NArchive {
    1.18 +namespace N7z {
    1.19 +
    1.20 +class CFolderInStream:
    1.21 +  public ISequentialInStream,
    1.22 +  public ICompressGetSubStreamSize,
    1.23 +  public CMyUnknownImp
    1.24 +{
    1.25 +public:
    1.26 +
    1.27 +  MY_UNKNOWN_IMP1(ICompressGetSubStreamSize)
    1.28 +
    1.29 +  CFolderInStream();
    1.30 +
    1.31 +  STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
    1.32 +
    1.33 +  STDMETHOD(GetSubStreamSize)(UInt64 subStream, UInt64 *value);
    1.34 +private:
    1.35 +  CSequentialInStreamWithCRC *_inStreamWithHashSpec;
    1.36 +  CMyComPtr<ISequentialInStream> _inStreamWithHash;
    1.37 +  CMyComPtr<IArchiveUpdateCallback> _updateCallback;
    1.38 +
    1.39 +  bool _currentSizeIsDefined;
    1.40 +  UInt64 _currentSize;
    1.41 +
    1.42 +  bool _fileIsOpen;
    1.43 +  UInt64 _filePos;
    1.44 +
    1.45 +  const UInt32 *_fileIndices;
    1.46 +  UInt32 _numFiles;
    1.47 +  UInt32 _fileIndex;
    1.48 +
    1.49 +  HRESULT OpenStream();
    1.50 +  HRESULT CloseStream();
    1.51 +  void AddDigest();
    1.52 +public:
    1.53 +  void Init(IArchiveUpdateCallback *updateCallback,
    1.54 +      const UInt32 *fileIndices, UInt32 numFiles);
    1.55 +  CRecordVector<bool> Processed;
    1.56 +  CRecordVector<UInt32> CRCs;
    1.57 +  CRecordVector<UInt64> Sizes;
    1.58 +  UInt64 GetFullSize() const
    1.59 +  {
    1.60 +    UInt64 size = 0;
    1.61 +    for (int i = 0; i < Sizes.Size(); i++)
    1.62 +      size += Sizes[i];
    1.63 +    return size;
    1.64 +  }
    1.65 +};
    1.66 +
    1.67 +}}
    1.68 +
    1.69 +#endif