ff7tk 0.80.25
Work with Final Fantasy 7 game data
GZIP.h
Go to the documentation of this file.
1/****************************************************************************/
2// copyright 2012 - 2021 Jérôme Arzel <myst6re@gmail.com> //
3// //
4// This file is part of FF7tk //
5// //
6// FF7tk is free software: you can redistribute it and/or modify //
7// it under the terms of the GNU General Public License as published by //
8// the Free Software Foundation, either version 3 of the License, or //
9// (at your option) any later version. //
10// //
11// FF7tk is distributed in the hope that it will be useful, //
12// but WITHOUT ANY WARRANTY; without even the implied warranty of //
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
14// GNU General Public License for more details. //
15/****************************************************************************/
16#pragma once
17
18#include <QtCore>
19#include "ff7tkutils_export.h"
20
21class FF7TKUTILS_EXPORT GZIP
22{
23public:
24 enum Strategy {
29 StrategyFixed
30 };
31
32 static QByteArray decompress(const QByteArray &data, int decSize, Strategy strategy = StrategyDefault);
33 static QByteArray compress(const QByteArray &ungzip, int level = -1, Strategy strategy = StrategyDefault);
34 static QByteArray decompress(const char *data, int size, int decSize, Strategy strategy = StrategyDefault);
35 static QByteArray compress(const char *ungzip, int size, int level = -1, Strategy strategy = StrategyDefault);
36 static QByteArray decompress(const QString &path, int decSize, Strategy strategy = StrategyDefault);
37 static QByteArray decompressNoHeader(const char *data, int size);
38 static QByteArray compressNoHeader(const char *data, int size, int level = -1);
39 static ulong crc(const char *data, int size);
40private:
41 static char strategyToChar(Strategy strategy);
42 static QString gzMode(const char *mode, int level = -1, Strategy strategy = StrategyDefault);
43};
Definition: GZIP.h:22
Strategy
Definition: GZIP.h:24
@ StrategyDefault
Definition: GZIP.h:25
@ StrategyHuffmanOnly
Definition: GZIP.h:27
@ StrategyFiltered
Definition: GZIP.h:26
@ StrategyRle
Definition: GZIP.h:28