ff7tk  1.2.0.13
Work with Final Fantasy 7 game data
GZIP.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2012 - 2021 Arzel Jérôme <myst6re@gmail.com>
2 // SPDX-License-Identifier: LGPL-3.0-or-later
3 
4 #pragma once
5 
6 #include <QtCore>
7 #include <ff7tkutils_export.h>
8 
9 class FF7TKUTILS_EXPORT GZIP
10 {
11 public:
12  enum Strategy {
17  StrategyFixed
18  };
19 
20  static QByteArray decompress(const QByteArray &data, int decSize, Strategy strategy = StrategyDefault);
21  static QByteArray compress(const QByteArray &ungzip, int level = -1, Strategy strategy = StrategyDefault);
22  static QByteArray decompress(const char *data, int size, int decSize, Strategy strategy = StrategyDefault);
23  static QByteArray compress(const char *ungzip, int size, int level = -1, Strategy strategy = StrategyDefault);
24  static QByteArray decompress(const QString &path, int decSize, Strategy strategy = StrategyDefault);
25  static QByteArray decompressNoHeader(const char *data, int size);
26  static QByteArray compressNoHeader(const char *data, int size, int level = -1);
27  static ulong crc(const char *data, int size);
28 private:
29  static char strategyToChar(Strategy strategy);
30  static QString gzMode(const char *mode, int level = -1, Strategy strategy = StrategyDefault);
31 };
GZIP::StrategyHuffmanOnly
@ StrategyHuffmanOnly
Definition: GZIP.h:15
GZIP::StrategyFiltered
@ StrategyFiltered
Definition: GZIP.h:14
GZIP::StrategyRle
@ StrategyRle
Definition: GZIP.h:16
GZIP
Definition: GZIP.h:9
GZIP::StrategyDefault
@ StrategyDefault
Definition: GZIP.h:13
GZIP::Strategy
Strategy
Definition: GZIP.h:12