2020-05-08 22:10:49 +02:00
|
|
|
#pragma once
|
2012-09-18 10:43:34 +02:00
|
|
|
|
2022-02-08 23:39:03 +01:00
|
|
|
#include <exception>
|
2014-04-19 08:13:34 +02:00
|
|
|
#include "types.h"
|
2012-09-18 10:43:34 +02:00
|
|
|
|
|
|
|
class ZlibDecompressor
|
|
|
|
{
|
|
|
|
public:
|
2022-02-08 23:39:03 +01:00
|
|
|
class DecompressError : std::exception {};
|
2012-09-18 10:43:34 +02:00
|
|
|
|
2022-02-08 23:39:03 +01:00
|
|
|
ZlibDecompressor(const u8 *data, size_t size);
|
2012-09-18 10:43:34 +02:00
|
|
|
~ZlibDecompressor();
|
2022-02-08 23:39:03 +01:00
|
|
|
void setSeekPos(size_t seekPos);
|
|
|
|
size_t seekPos() const;
|
2014-04-19 08:13:34 +02:00
|
|
|
ustring decompress();
|
2012-09-18 10:43:34 +02:00
|
|
|
|
|
|
|
private:
|
2022-02-08 23:39:03 +01:00
|
|
|
const u8 *m_data;
|
|
|
|
size_t m_seekPos;
|
|
|
|
size_t m_size;
|
2020-05-08 22:10:49 +02:00
|
|
|
};
|