ScummVM API documentation
deflate.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef COMMON_ZLIB_H
23#define COMMON_ZLIB_H
24
25#include "common/scummsys.h"
26#include "common/types.h"
27
28namespace Common {
29
39class ReadStream;
40class SeekableReadStream;
41class WriteStream;
42
62bool inflateZlib(byte *dst, unsigned long *dstLen, const byte *src, unsigned long srcLen);
63static inline bool inflateZlib(byte *dst, unsigned long dstLen, const byte *src, unsigned long srcLen) {
64 return inflateZlib(dst, &dstLen, src, srcLen);
65}
66
89bool inflateZlibHeaderless(byte *dst, uint *dstLen, const byte *src, uint srcLen, const byte *dict = nullptr, uint dictLen = 0);
90static inline bool inflateZlibHeaderless(byte *dst, uint dstLen, const byte *src, uint srcLen, const byte *dict = nullptr, uint dictLen = 0) {
91 return inflateZlibHeaderless(dst, &dstLen, src, srcLen, dict, dictLen);
92}
93
111bool inflateZlibHeaderless(Common::WriteStream &dst, Common::ReadStream &src, const byte *dict = nullptr, uint dictLen = 0);
112
130bool inflateClickteam(byte *dst, uint *dstLen, const byte *src, uint srcLen);
131static inline bool inflateClickteam(byte *dst, uint dstLen, const byte *src, uint srcLen) {
132 return inflateClickteam(dst, &dstLen, src, srcLen);
133}
134
157 DisposeAfterUse::Flag disposeParent = DisposeAfterUse::YES, uint64 knownSize = 0);
158
171 DisposeAfterUse::Flag disposeParent = DisposeAfterUse::YES, uint64 knownSize = 0,
172 const byte *dict = nullptr, uint dictLen = 0);
173
189 DisposeAfterUse::Flag disposeParent = DisposeAfterUse::YES, uint64 knownSize = 0);
190
202
205} // End of namespace Common
206
207#endif
Definition: stream.h:385
Definition: stream.h:745
Definition: stream.h:77
SeekableReadStream * wrapClickteamReadStream(SeekableReadStream *toBeWrapped, DisposeAfterUse::Flag disposeParent=DisposeAfterUse::YES, uint64 knownSize=0)
SeekableReadStream * wrapCompressedReadStream(SeekableReadStream *toBeWrapped, DisposeAfterUse::Flag disposeParent=DisposeAfterUse::YES, uint64 knownSize=0)
SeekableReadStream * wrapDeflateReadStream(SeekableReadStream *toBeWrapped, DisposeAfterUse::Flag disposeParent=DisposeAfterUse::YES, uint64 knownSize=0, const byte *dict=nullptr, uint dictLen=0)
bool inflateClickteam(byte *dst, uint *dstLen, const byte *src, uint srcLen)
bool inflateZlibHeaderless(byte *dst, uint *dstLen, const byte *src, uint srcLen, const byte *dict=nullptr, uint dictLen=0)
bool inflateZlib(byte *dst, unsigned long *dstLen, const byte *src, unsigned long srcLen)
WriteStream * wrapCompressedWriteStream(WriteStream *toBeWrapped)
Definition: algorithm.h:29