TPWMDecompressor.hpp 831 B

123456789101112131415161718192021222324252627282930313233343536
  1. /* Copyright (C) Teemu Suutari */
  2. #ifndef TPWMDECOMPRESSOR_HPP
  3. #define TPWMDECOMPRESSOR_HPP
  4. #include "Decompressor.hpp"
  5. namespace ancient::internal
  6. {
  7. class TPWMDecompressor : public Decompressor
  8. {
  9. public:
  10. TPWMDecompressor(const Buffer &packedData,bool verify);
  11. virtual ~TPWMDecompressor();
  12. virtual const std::string &getName() const noexcept override final;
  13. virtual size_t getPackedSize() const noexcept override final;
  14. virtual size_t getRawSize() const noexcept override final;
  15. virtual void decompressImpl(Buffer &rawData,bool verify) override final;
  16. static bool detectHeader(uint32_t hdr) noexcept;
  17. static std::shared_ptr<Decompressor> create(const Buffer &packedData,bool exactSizeKnown,bool verify);
  18. private:
  19. const Buffer &_packedData;
  20. uint32_t _rawSize=0;
  21. size_t _decompressedPackedSize=0;
  22. };
  23. }
  24. #endif