ff7tk  1.2.0.13
Work with Final Fantasy 7 game data
GZIPPS.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 <GZIP>
7 #include <ff7tkutils_export.h>
8 
9 #define GZIPPS_HEADER_SIZE 8
10 
11 class FF7TKUTILS_EXPORT GZIPPS
12 {
13 public:
14  inline static QByteArray decompress(const QByteArray &data)
15  {
16  return decompress(data.constData(), data.size());
17  }
18  inline static QByteArray compress(const QByteArray &ungzip, const QByteArray &header, int level = -1)
19  {
20  return compress(ungzip.constData(), ungzip.size(), header, level);
21  }
22  inline static QByteArray compress(const QByteArray &ungzip, quint32 header, int level = -1)
23  {
24  return compress(ungzip.constData(), ungzip.size(), header, level);
25  }
26  static QByteArray decompress(const char *data, int size);
27  static QByteArray compress(const char *ungzip, int size, const QByteArray &header, int level = -1);
28  inline static QByteArray compress(const char *ungzip, int size, quint32 header, int level = -1)
29  {
30  return compress(ungzip, size, QByteArray((char *)&header, 4), level);
31  }
32 };
GZIPPS::compress
static QByteArray compress(const QByteArray &ungzip, quint32 header, int level=-1)
Definition: GZIPPS.h:22
GZIPPS::compress
static QByteArray compress(const char *ungzip, int size, quint32 header, int level=-1)
Definition: GZIPPS.h:28
GZIPPS::compress
static QByteArray compress(const QByteArray &ungzip, const QByteArray &header, int level=-1)
Definition: GZIPPS.h:18
GZIPPS
Definition: GZIPPS.h:11
GZIPPS::decompress
static QByteArray decompress(const QByteArray &data)
Definition: GZIPPS.h:14