Cockatrice
2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
Toggle main menu visibility
Loading...
Searching...
No Matches
zip.h
Go to the documentation of this file.
1
/****************************************************************************
2
** Filename: zip.h
3
** Last updated [dd/mm/yyyy]: 27/03/2011
4
**
5
** pkzip 2.0 file compression.
6
**
7
** Some of the code has been inspired by other open source projects,
8
** (mainly Info-Zip and Gilles Vollant's minizip).
9
** Compression and decompression actually uses the zlib library.
10
**
11
** Copyright (C) 2007-2012 Angius Fabrizio. All rights reserved.
12
**
13
** This file is part of the OSDaB project (http://osdab.42cows.org/).
14
**
15
** This file may be distributed and/or modified under the terms of the
16
** GNU General Public License version 2 as published by the Free Software
17
** Foundation and appearing in the file LICENSE.GPL included in the
18
** packaging of this file.
19
**
20
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
21
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
22
**
23
** See the file LICENSE.GPL that came with this software distribution or
24
** visit http://www.gnu.org/copyleft/gpl.html for GPL licensing information.
25
**
26
**********************************************************************/
27
28
#ifndef OSDAB_ZIP__H
29
#define OSDAB_ZIP__H
30
31
#include "
zipglobal.h
"
32
33
#include <QtCore/QMap>
34
#include <QtCore/QtGlobal>
35
36
#include <zlib/zlib.h>
37
38
class
QIODevice;
39
class
QFile;
40
class
QDir;
41
class
QStringList;
42
class
QString;
43
44
OSDAB_BEGIN_NAMESPACE
(
Zip
)
45
46
class
ZipPrivate
;
47
48
class
OSDAB_ZIP_EXPORT
Zip
49
{
50
public
:
51
enum
ErrorCode
52
{
53
Ok
,
54
ZlibInit
,
55
ZlibError
,
56
FileExists
,
57
OpenFailed
,
58
NoOpenArchive
,
59
FileNotFound
,
60
ReadFailed
,
61
WriteFailed
,
62
SeekFailed
,
63
InternalError
64
};
65
66
enum
CompressionLevel
67
{
68
Store
,
69
Deflate1
= 1,
Deflate2
,
Deflate3
,
Deflate4
,
70
Deflate5
,
Deflate6
,
Deflate7
,
Deflate8
,
Deflate9
,
71
AutoCPU
,
AutoMIME
,
AutoFull
72
};
73
74
enum
CompressionOption
75
{
78
RelativePaths
= 0x0001,
80
AbsolutePaths
= 0x0002,
83
IgnorePaths
= 0x0004,
87
IgnoreRoot
= 0x0008,
91
SkipBadFiles
= 0x0020,
97
CheckForDuplicates
= 0x0040
98
};
99
Q_DECLARE_FLAGS(CompressionOptions, CompressionOption)
100
101
Zip
();
102
virtual
~Zip
();
103
104
bool
isOpen()
const
;
105
106
void
setPassword(
const
QString& pwd);
107
void
clearPassword();
108
QString password()
const
;
109
110
ErrorCode createArchive(
const
QString& file,
bool
overwrite =
true
);
111
ErrorCode createArchive(QIODevice* device);
112
113
QString archiveComment()
const
;
114
void
setArchiveComment(
const
QString& comment);
115
116
ErrorCode addDirectoryContents(
const
QString& path,
117
CompressionLevel level = AutoFull);
118
ErrorCode addDirectoryContents(
const
QString& path,
const
QString& root,
119
CompressionLevel level = AutoFull);
120
121
ErrorCode addDirectory(
const
QString& path,
122
CompressionLevel level = AutoFull);
123
ErrorCode addDirectory(
const
QString& path,
const
QString& root,
124
CompressionLevel level = AutoFull);
125
ErrorCode addDirectory(
const
QString& path,
const
QString& root,
126
CompressionOptions options, CompressionLevel level = AutoFull,
127
int
* addedFiles = 0);
128
129
ErrorCode addFile(
const
QString& path,
130
CompressionLevel level = AutoFull);
131
ErrorCode addFile(
const
QString& path,
const
QString& root,
132
CompressionLevel level = AutoFull);
133
ErrorCode addFile(
const
QString& path,
const
QString& root,
134
CompressionOptions options,
135
CompressionLevel level = AutoFull);
136
137
ErrorCode addFiles(
const
QStringList& paths,
138
CompressionLevel level = AutoFull);
139
ErrorCode addFiles(
const
QStringList& paths,
const
QString& root,
140
CompressionLevel level = AutoFull);
141
ErrorCode addFiles(
const
QStringList& paths,
const
QString& root,
142
CompressionOptions options,
143
CompressionLevel level = AutoFull,
144
int
* addedFiles = 0);
145
146
ErrorCode closeArchive();
147
148
QString formatError(ErrorCode c)
const
;
149
150
private
:
151
ZipPrivate
*
d
;
152
};
153
154
Q_DECLARE_OPERATORS_FOR_FLAGS(Zip::CompressionOptions)
155
156
OSDAB_END_NAMESPACE
157
158
#endif
// OSDAB_ZIP__H
ZipPrivate
Definition
zip_p.h:60
Zip
Zip file compression.
Definition
zip.h:49
Zip::d
ZipPrivate * d
Definition
zip.h:151
Zip::CompressionOption
CompressionOption
Definition
zip.h:75
Zip::IgnorePaths
@ IgnorePaths
Definition
zip.h:83
Zip::CheckForDuplicates
@ CheckForDuplicates
Definition
zip.h:97
Zip::IgnoreRoot
@ IgnoreRoot
Definition
zip.h:87
Zip::RelativePaths
@ RelativePaths
Definition
zip.h:78
Zip::AbsolutePaths
@ AbsolutePaths
Definition
zip.h:80
Zip::SkipBadFiles
@ SkipBadFiles
Definition
zip.h:91
Zip::ErrorCode
ErrorCode
Definition
zip.h:52
Zip::WriteFailed
@ WriteFailed
Definition
zip.h:61
Zip::Ok
@ Ok
Definition
zip.h:53
Zip::FileNotFound
@ FileNotFound
Definition
zip.h:59
Zip::OpenFailed
@ OpenFailed
Definition
zip.h:57
Zip::ZlibError
@ ZlibError
Definition
zip.h:55
Zip::NoOpenArchive
@ NoOpenArchive
Definition
zip.h:58
Zip::FileExists
@ FileExists
Definition
zip.h:56
Zip::ZlibInit
@ ZlibInit
Definition
zip.h:54
Zip::SeekFailed
@ SeekFailed
Definition
zip.h:62
Zip::ReadFailed
@ ReadFailed
Definition
zip.h:60
Zip::InternalError
@ InternalError
Definition
zip.h:63
Zip::Zip
Zip()
Definition
zip.cpp:1332
Zip::CompressionLevel
CompressionLevel
Definition
zip.h:67
Zip::Deflate3
@ Deflate3
Definition
zip.h:69
Zip::AutoMIME
@ AutoMIME
Definition
zip.h:71
Zip::Deflate7
@ Deflate7
Definition
zip.h:70
Zip::Deflate9
@ Deflate9
Definition
zip.h:70
Zip::Deflate6
@ Deflate6
Definition
zip.h:70
Zip::Deflate8
@ Deflate8
Definition
zip.h:70
Zip::Store
@ Store
Definition
zip.h:68
Zip::Deflate2
@ Deflate2
Definition
zip.h:69
Zip::Deflate5
@ Deflate5
Definition
zip.h:70
Zip::Deflate1
@ Deflate1
Definition
zip.h:69
Zip::AutoCPU
@ AutoCPU
Definition
zip.h:71
Zip::AutoFull
@ AutoFull
Definition
zip.h:71
Zip::Deflate4
@ Deflate4
Definition
zip.h:69
zipglobal.h
OSDAB_ZIP_EXPORT
#define OSDAB_ZIP_EXPORT
Definition
zipglobal.h:42
OSDAB_END_NAMESPACE
#define OSDAB_END_NAMESPACE
Definition
zipglobal.h:60
OSDAB_BEGIN_NAMESPACE
#define OSDAB_BEGIN_NAMESPACE(ModuleName)
Definition
zipglobal.h:54
oracle
src
zip
zip.h
Generated by
1.18.0