openMSX
file
ZlibInflate.hh
Go to the documentation of this file.
1
#ifndef ZLIBINFLATE_HH
2
#define ZLIBINFLATE_HH
3
4
#include "
MemBuffer.hh
"
5
#include <cstdint>
6
#include <span>
7
#include <string>
8
#include <zlib.h>
9
10
namespace
openmsx
{
11
12
class
ZlibInflate
13
{
14
public
:
15
ZlibInflate
(std::span<const uint8_t> input);
16
~ZlibInflate
();
17
18
void
skip
(
size_t
num);
19
[[nodiscard]] uint8_t
getByte
();
20
[[nodiscard]]
unsigned
get16LE
();
21
[[nodiscard]]
unsigned
get32LE
();
22
[[nodiscard]] std::string
getString
(
size_t
len);
23
[[nodiscard]] std::string
getCString
();
24
25
[[nodiscard]]
size_t
inflate
(
MemBuffer<uint8_t>
& output,
size_t
sizeHint = 65536);
26
27
private
:
28
z_stream s;
29
bool
wasInit;
30
};
31
32
}
// namespace openmsx
33
34
#endif
MemBuffer.hh
openmsx::MemBuffer
This class manages the lifetime of a block of memory.
Definition
MemBuffer.hh:29
openmsx::ZlibInflate
Definition
ZlibInflate.hh:13
openmsx::ZlibInflate::getString
std::string getString(size_t len)
Definition
ZlibInflate.cc:64
openmsx::ZlibInflate::getCString
std::string getCString()
Definition
ZlibInflate.cc:72
openmsx::ZlibInflate::get32LE
unsigned get32LE()
Definition
ZlibInflate.cc:55
openmsx::ZlibInflate::~ZlibInflate
~ZlibInflate()
Definition
ZlibInflate.cc:26
openmsx::ZlibInflate::skip
void skip(size_t num)
Definition
ZlibInflate.cc:33
openmsx::ZlibInflate::getByte
uint8_t getByte()
Definition
ZlibInflate.cc:38
openmsx::ZlibInflate::get16LE
unsigned get16LE()
Definition
ZlibInflate.cc:48
openmsx::ZlibInflate::inflate
size_t inflate(MemBuffer< uint8_t > &output, size_t sizeHint=65536)
Definition
ZlibInflate.cc:81
openmsx
This file implemented 3 utility functions:
Definition
Autofire.cc:9
Generated on Thu Mar 28 2024 21:13:12 for openMSX by
1.9.8