Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Lzx86Converter.h « Compress « 7zip « CPP - github.com/kornelski/7z.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1e531d1a2e252cfd535928c93dc5c787eeed7fb2 (plain)
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
44
45
// Lzx86Converter.h

#ifndef __LZX_86_CONVERTER_H
#define __LZX_86_CONVERTER_H

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

#include "../IStream.h"

namespace NCompress {
namespace NLzx {

const unsigned kUncompressedBlockSize = (unsigned)1 << 15;

class Cx86ConvertOutStream:
  public ISequentialOutStream,
  public CMyUnknownImp
{
  ISequentialOutStream *_stream;
  UInt32 _processedSize;
  UInt32 _pos;
  UInt32 _translationSize;
  bool _translationMode;
  Byte _buf[kUncompressedBlockSize];

  void MakeTranslation();
public:
  void SetStream(ISequentialOutStream *outStream) { _stream = outStream; }
  void Init(bool translationMode, UInt32 translationSize)
  {
    _translationMode = translationMode;
    _translationSize = translationSize;
    _processedSize = 0;
    _pos = 0;
  }
  HRESULT Flush();

  MY_UNKNOWN_IMP

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

}}

#endif