ScummVM API documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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 
28 namespace Common {
29 
39 class SeekableReadStream;
40 class WriteStream;
41 
61 bool inflateZlib(byte *dst, unsigned long *dstLen, const byte *src, unsigned long srcLen);
62 static inline bool inflateZlib(byte *dst, unsigned long dstLen, const byte *src, unsigned long srcLen) {
63  return inflateZlib(dst, &dstLen, src, srcLen);
64 }
65 
88 bool inflateZlibHeaderless(byte *dst, uint *dstLen, const byte *src, uint srcLen, const byte *dict = nullptr, uint dictLen = 0);
89 static inline bool inflateZlibHeaderless(byte *dst, uint dstLen, const byte *src, uint srcLen, const byte *dict = nullptr, uint dictLen = 0) {
90  return inflateZlibHeaderless(dst, &dstLen, src, srcLen, dict, dictLen);
91 }
92 
110 bool inflateClickteam(byte *dst, uint *dstLen, const byte *src, uint srcLen);
111 static inline bool inflateClickteam(byte *dst, uint dstLen, const byte *src, uint srcLen) {
112  return inflateClickteam(dst, &dstLen, src, srcLen);
113 }
114 
136 SeekableReadStream *wrapCompressedReadStream(SeekableReadStream *toBeWrapped,
137  DisposeAfterUse::Flag disposeParent = DisposeAfterUse::YES, uint64 knownSize = 0);
138 
150 SeekableReadStream *wrapDeflateReadStream(SeekableReadStream *toBeWrapped,
151  DisposeAfterUse::Flag disposeParent = DisposeAfterUse::YES, uint64 knownSize = 0,
152  const byte *dict = nullptr, uint dictLen = 0);
153 
168 SeekableReadStream *wrapClickteamReadStream(SeekableReadStream *toBeWrapped,
169  DisposeAfterUse::Flag disposeParent = DisposeAfterUse::YES, uint64 knownSize = 0);
170 
181 WriteStream *wrapCompressedWriteStream(WriteStream *toBeWrapped);
182 
185 } // End of namespace Common
186 
187 #endif
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)
WriteStream * wrapCompressedWriteStream(WriteStream *toBeWrapped)
bool inflateClickteam(byte *dst, uint *dstLen, const byte *src, uint srcLen)
Definition: algorithm.h:29
bool inflateZlibHeaderless(byte *dst, uint *dstLen, const byte *src, uint srcLen, const byte *dict=nullptr, uint dictLen=0)
SeekableReadStream * wrapClickteamReadStream(SeekableReadStream *toBeWrapped, DisposeAfterUse::Flag disposeParent=DisposeAfterUse::YES, uint64 knownSize=0)
bool inflateZlib(byte *dst, unsigned long *dstLen, const byte *src, unsigned long srcLen)