1/**
2\mainpage %QuaZip - %Qt/C++ wrapper for Minizip
3
4\section overview Overview
5
6<a href="http://www.winimage.com/zLibDll/minizip.html">Minizip, or
7Gilles Vollant's ZIP/UNZIP package</a> is a simple C library
8for creating, appending and reading ZIP archives.
9
10<a href="http://qt.io/">%Qt</a> is a very powerful cross-platform C++
11library with a lot of useful modules and classes. With %Qt, you can
12create rich GUIs, perform networking activities, accessing databases
13and much much more. If Java is “write once, run everywhere”, %Qt
14is “write once, compile everywhere” which is not that bad either.
15
16One thing %Qt can't do out-of-the-box is write and read ZIP archives.
17Of course, you can do it with Minizip, but Minizip has its own
18interface which isn't exactly compatible with %Qt. Namely, in %Qt
19there is an abstract class called QIODevice, which
20is %Qt-speak for “input/output stream”. There are a lot of classes
21that accept QIODevice to write some useful things to it—you could
22serialize XML to a QIODevice, for example. Therefore, wouldn't it
23be useful if you could open a QIODevice that would write directly
24to a file in a ZIP archive? Or read from one? That's exactly where
25%QuaZip comes into the picture.
26
27Technically speaking, %QuaZip is a simple C++ wrapper around Minizip.
28Or you could call it an implementation of the Adapter pattern.  With
29%QuaZip, both ZIP files and files inside ZIP archives can be accessed
30with QIODevice API. You can even write ZIP files to a sequential devices
31like TCP sockets, although some limitations apply in this case.
32
33\section download Download QuaZip
34
35The latest downloads are available from the
36<a href="https://github.com/stachenov/quazip/releases">GitHub page</a>.
37Downloads are in source format. The documentation you're reading
38right now can be build with the “doxygen” tool if you have one
39installed. Just run it from the project directory and it will
40create the “doc” directory for you. If you don't have Doxygen
41installed, you can still read offline docs in the “quazip/doc42subdir and in the header files. Don't confuse those dirs:
43
44- “doc” in the project's root is where Doxygen \em output is.
45- “quazip/doc” is where Doxygen \em input is, the part of it that
46  doesn't belong to any particular header files.
47
48Older downloads are available from
49<a href="http://sourceforge.net/projects/quazip/">%QuaZip project's page at SourceForge.net</a>.
50
51\section platforms Platforms supported
52
53%QuaZip 1.1 was tested on:
54- %Qt 5.15.0 MinGW 8.1 x32
55- %Qt 5.12.9 MinGW 7.3 x32
56- %Qt 5.9.7 CentOS 7 x64
57- %Qt 4.8.7 CentOS 7 x64
58- %Qt 5.11.0 Astra Linux CE 1.6 x64
59
60It should work fine on any platform supported by %Qt 4.8.7 or later.
61In theory, even versions as old as %Qt 4.6.2 might work as well, but
62aren't guaranteed to.
63
64Preliminary %Qt 6 support is available as well, but not tested at all.
65
66\section whats-new What is new in this version of QuaZip?
67
68See the NEWS.txt file supplied with the distribution.
69
70\section Dependencies
71
72Just <a href="http://www.zlib.org/">zlib</a> and %Qt 4/5/6. Sometimes
73you can get away with using zlib library bundled into %Qt (see below).
74
75CMake-wise, you need \c ZLIB::ZLIB and one of the following:
76\li \c Qt5::Core
77\li \c Qt6::Core and \c Qt6::Core5Compat
78\li \c Qt4::QtCore
79
80To build and run tests, the appropriate Test and Network submodules are needed as well.
81
82Make sure that you have %Qt installed with all required headers and
83utilities (that is, including the 'dev' or 'devel' package on some Linux distros).
84
85\section building Building, testing and installing
86
87%QuaZip uses CMake since 1.0. If you used qmake to build it,
88you'll have to switch to CMake now, and it's a good thing because
89two build systems made everything confusing and inconsistent. CMake
90may be confusing, badly designed and lack good tutorials, but
91it's \em the build system at the time of the writing. Some Linux
92distros are shipped with incredibly outdated CMake versions,
93but the good news is, there are official self-contained binary
94distributions, so just grab the newest version, unpack it
95somewhere, set up PATH (or symlinks) and you're all set.
96CMake minimum version 3.15 is required to build %QuaZip 1.0.
97
98\note Instructions given in this section assume that you are
99using some UNIX dialect, but the build process should be very similar
100on MinGW x32 too. On other platforms it's essentially the
101same process, maybe with some CMake adjustments not specific to
102%QuaZip itself.
103
104To build the library, run:
105\verbatim
106$ cd /wherever/quazip/source/is/quazip-x.y.z
107$ cmake -S . -B wherever/you/want/your/build/to/be -D QUAZIP_QT_MAJOR_VERSION=4, 5 or 6
108$ cmake --build wherever/you/want/your/build/to/be
109\endverbatim
110
111\c QUAZIP_QT_MAJOR_VERSION is just one number, and it defaults to 5, so if building with %Qt 5, it is optional.
112
113On Windows, it may be required to use <tt>-G "MinGW Makefiles"</tt> or something like that to convince
114CMake that you really want to use, say, MinGW and not Visual Studio, for example.
115
116It can be a pain to install zlib on Windows, so there's a possible workaround using zlib bundled into Qt itself.
117Note that this zlib is Qt's internal implementation detail, so it's more like a dirty hack, but it can be convenient.
118To enable this feature, configure %QuaZip with
119\verbatim
120-D QUAZIP_USE_QT_ZLIB=ON
121\endverbatim
122This option defaults to OFF, and even when enabled, if it fails to find zlib that comes with Qt, it will fall back to looking for a stand-alone zlib.
123
124To install, run
125\verbatim
126$ cmake --build wherever/you/want/your/build/to/be --target install -D CMAKE_INSTALL_PREFIX=/wherever/you/want/to/install
127\endverbatim
128
129%QuaZip installs as CMake package QuaZip-QtX, where X is the major
130version of %Qt. For example, QuaZip-Qt5. Different major versions of
131%QuaZip have different binary names (libquazip1-qt5, for example),
132which allows to install them in parallel.
133
134To reconfigure (for another %Qt version or release/debug, or anything else), just nuke the whole build directory
135and repeat everything.
136
137By default, %QuaZip compiles as a DLL/SO, but respects the standard BUILD_SHARED_LIBS CMake option, adjusting
138its imports/exports accordingly.
139
140Binary compatibility is guaranteed between minor releases starting
141with version 1.0, thanks to the Pimpl idiom. That is, the next binary
142incompatible version will be 2.x in the worst case.
143
144\section test Testing
145
146The tests are not built by default. Set the QUAZIP_ENABLE_TESTS option
147to build them.
148
149To run the tests, execute:
150\verbatim
151$ cmake --build wherever/you/want/your/build/to/be --target check
152\endverbatim
153
154On some systems you may need to set PATH, LD_LIBRARY_PATH or
155SHLIB_PATH to get “qztest” to actually run and to use the version of %QuaZip you've just built,
156especially if you already have some version of %QuaZip installed somewhere.
157
158If everything went fine, the test suite should report a lot of PASS
159messages and the “All tests executed successfully” message.
160If something goes wrong, it will provide details and a
161warning that some tests failed.
162
163\section using Using
164
165See the \ref usage "Usage Page".
166
167\section contacts Authors and contacts
168
169This wrapper has been written by Sergei Tachenov.
170This is my first open source project, and it's pretty old, but it
171works and many people are happily using it, including myself.
172
173If you have anything to say to me about %QuaZip library, feel free to
174do so (read the \ref faq first, though). I can not promise,
175though, that I fix all the bugs you report in, add any features you
176want, or respond to your critics, or respond to your feedback at all.
177I may be busy, I may be tired of working on %QuaZip, I may be even
178dead already (you never know...).
179
180To report bugs or to post ideas about what should be done, use
181<a href="https://github.com/stachenov/quazip">GitHub</a>. It's an
182awesome site, where you can report bugs or register yourself an
183account, fork %QuaZip (don't hesitate to do so), create a new branch,
184make some changes and issue a
185<a href="https://help.github.com/articles/about-pull-requests/">pull
186request</a>, which is GitHub's way of offering patches. See CONTRIBUTING.md
187file for details.
188
189Do not use e-mail to report bugs, please. Reporting bugs and problems
190with GitHub has that advantage that
191it is visible to public, and I can always search for open tickets
192that were created long ago. It is highly unlikely that I will search
193my mail for that kind of stuff, so if a bug reported by mail isn't
194fixed immediately, it will likely be forgotten forever.
195
196Old bugs may still be available at
197<a href="https://sourceforge.net/projects/quazip/">SourceForge</a>
198for reference.
199
200Copyright (C) 2005-2021 Sergei Tachenov and contributors
201*/
202