Debian Codegraph @

src/attic/Lzh/PMDecompressor.hpp

raw
1 /* Copyright (C) Teemu Suutari */
2
3 #ifndef PMDECOMPRESSOR_HPP
4 #define PMDECOMPRESSOR_HPP
5
6 #include "Decompressor.hpp"
7
8 namespace ancient::internal
9 {
10
11 class PMDecompressor : public Decompressor
12 {
13 public:
14 PMDecompressor(const Buffer &packedData,uint32_t version);
15 virtual ~PMDecompressor();
16
17 virtual size_t getRawSize() const noexcept override final;
18 virtual size_t getPackedSize() const noexcept override final;
19
20 virtual const std::string &getName() const noexcept override final;
21
22 virtual void decompressImpl(Buffer &rawData,bool verify) override final;
23
24 private:
25 static uint8_t decodeMTF(uint8_t value,uint8_t map[]);
26 static void updateMTF(uint8_t value,uint8_t map[]);
27 static void createMTFMap(uint8_t map[]);
28
29 void decompressImplPM1(Buffer &rawData,bool verify);
30 void decompressImplPM2(Buffer &rawData,bool verify);
31
32 const Buffer &_packedData;
33
34 uint32_t _version;
35 };
36
37 }
38
39 #endif