File: CabBlockInStream.h

package info (click to toggle)
p7zip 16.02%2Bdfsg-6
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 14,144 kB
  • sloc: cpp: 167,145; ansic: 14,992; python: 1,911; asm: 1,688; sh: 1,132; makefile: 701
file content (43 lines) | stat: -rw-r--r-- 837 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// CabBlockInStream.h

#ifndef __CAB_BLOCK_IN_STREAM_H
#define __CAB_BLOCK_IN_STREAM_H

#include "../../../Common/MyCom.h"
#include "../../IStream.h"

namespace NArchive {
namespace NCab {

class CCabBlockInStream:
  public ISequentialInStream,
  public CMyUnknownImp
{
  Byte *_buf;
  UInt32 _size;
  UInt32 _pos;

public:
  UInt32 ReservedSize; // < 256
  bool MsZip;

  MY_UNKNOWN_IMP

  CCabBlockInStream(): _buf(0), ReservedSize(0), MsZip(false) {}
  ~CCabBlockInStream();
  
  bool Create();
  
  void InitForNewBlock() { _size = 0; _pos = 0; }
  
  HRESULT PreRead(ISequentialInStream *stream, UInt32 &packSize, UInt32 &unpackSize);

  UInt32 GetPackSizeAvail() const { return _size - _pos; }
  const Byte *GetData() const { return _buf + _pos; }

  STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
};

}}

#endif