File: ZstdDecompressor.h

package info (click to toggle)
minetestmapper 20241111-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 300 kB
  • sloc: cpp: 2,635; python: 143; sh: 68; ansic: 30; makefile: 9
file content (21 lines) | stat: -rw-r--r-- 376 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#pragma once

#include <exception>
#include "types.h"

class ZstdDecompressor
{
public:
	class DecompressError : std::exception {};

	ZstdDecompressor();
	~ZstdDecompressor();
	void setData(const u8 *data, size_t size, size_t seekPos);
	size_t seekPos() const;
	ustring decompress();

private:
	void *m_stream; // ZSTD_DStream
	const u8 *m_data;
	size_t m_seekPos, m_size;
};