ff7tk 0.80.25
Work with Final Fantasy 7 game data
GZIPPS.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 "GZIP.h"
19#include "ff7tkutils_export.h"
20#define GZIPPS_HEADER_SIZE 8
21
22class FF7TKUTILS_EXPORT GZIPPS
23{
24public:
25 inline static QByteArray decompress(const QByteArray &data)
26 {
27 return decompress(data.constData(), data.size());
28 }
29 inline static QByteArray compress(const QByteArray &ungzip, const QByteArray &header, int level = -1)
30 {
31 return compress(ungzip.constData(), ungzip.size(), header, level);
32 }
33 inline static QByteArray compress(const QByteArray &ungzip, quint32 header, int level = -1)
34 {
35 return compress(ungzip.constData(), ungzip.size(), header, level);
36 }
37 static QByteArray decompress(const char *data, int size);
38 static QByteArray compress(const char *ungzip, int size, const QByteArray &header, int level = -1);
39 inline static QByteArray compress(const char *ungzip, int size, quint32 header, int level = -1)
40 {
41 return compress(ungzip, size, QByteArray((char *)&header, 4), level);
42 }
43};
Definition: GZIPPS.h:23
static QByteArray compress(const QByteArray &ungzip, const QByteArray &header, int level=-1)
Definition: GZIPPS.h:29
static QByteArray decompress(const QByteArray &data)
Definition: GZIPPS.h:25
static QByteArray compress(const QByteArray &ungzip, quint32 header, int level=-1)
Definition: GZIPPS.h:33
static QByteArray compress(const char *ungzip, int size, quint32 header, int level=-1)
Definition: GZIPPS.h:39