openMSX
ZlibInflate.hh
Go to the documentation of this file.
1#ifndef ZLIBINFLATE_HH
2#define ZLIBINFLATE_HH
3
4#include "MemBuffer.hh"
5
6#include <cstdint>
7#include <span>
8#include <string>
9#include <zlib.h>
10
11namespace openmsx {
12
14{
15public:
16 explicit ZlibInflate(std::span<const uint8_t> input);
17 ZlibInflate(const ZlibInflate&) = delete;
22
23 void skip(size_t num);
24 [[nodiscard]] uint8_t getByte();
25 [[nodiscard]] unsigned get16LE();
26 [[nodiscard]] unsigned get32LE();
27 [[nodiscard]] std::string getString(size_t len);
28 [[nodiscard]] std::string getCString();
29
30 [[nodiscard]] MemBuffer<uint8_t> inflate(size_t sizeHint = 65536);
31
32private:
33 z_stream s;
34 bool wasInit;
35};
36
37} // namespace openmsx
38
39#endif
This class manages the lifetime of a block of memory.
Definition MemBuffer.hh:32
ZlibInflate & operator=(const ZlibInflate &)=delete
std::string getString(size_t len)
ZlibInflate & operator=(ZlibInflate &&)=delete
MemBuffer< uint8_t > inflate(size_t sizeHint=65536)
std::string getCString()
ZlibInflate(const ZlibInflate &)=delete
void skip(size_t num)
ZlibInflate(ZlibInflate &&)=delete
This file implemented 3 utility functions:
Definition Autofire.cc:11