From 392b0b511134ee8e3a05d5ce413f59b407261f87 Mon Sep 17 00:00:00 2001 From: Mark Watkins Date: Mon, 16 Sep 2013 14:30:38 +1000 Subject: [PATCH] Separated QuaZip and QExtSerialPort, Oximetry work Using official source which has been placed in 3rdparty folder Oximetry button temporarily autostarts import.. Still a Work in progress. --- 3rdparty/qextserialport | 1 + 3rdparty/qtxmlrpc/client/client.pri | 14 + .../qtxmlrpc/client/src/clientprotocol.cpp | 251 ++ 3rdparty/qtxmlrpc/client/src/clientprotocol.h | 63 + 3rdparty/qtxmlrpc/client/src/httpclient.cpp | 208 ++ 3rdparty/qtxmlrpc/client/src/httpclient.h | 66 + 3rdparty/qtxmlrpc/client/src/httpsclient.cpp | 78 + 3rdparty/qtxmlrpc/client/src/httpsclient.h | 51 + 3rdparty/qtxmlrpc/client/src/xmlrpcclient.cpp | 24 + 3rdparty/qtxmlrpc/client/src/xmlrpcclient.h | 28 + 3rdparty/qtxmlrpc/client/src/xmlrpcconv.cpp | 333 ++ 3rdparty/qtxmlrpc/client/src/xmlrpcconv.h | 21 + 3rdparty/qtxmlrpc/server/server.pri | 4 + 3rdparty/qtxmlrpc/server/src/protocol.cpp | 391 ++ 3rdparty/qtxmlrpc/server/src/protocol.h | 120 + 3rdparty/qtxmlrpc/server/src/qhttpheader.cpp | 273 ++ 3rdparty/qtxmlrpc/server/src/qhttpheader_p.h | 112 + 3rdparty/qtxmlrpc/server/src/xmlrpcserver.cpp | 1077 ++++++ 3rdparty/qtxmlrpc/server/src/xmlrpcserver.h | 226 ++ 3rdparty/qtxmlrpc/xmlrpctest/client.cpp | 24 + 3rdparty/qtxmlrpc/xmlrpctest/client.h | 26 + 3rdparty/qtxmlrpc/xmlrpctest/client.py | 13 + 3rdparty/qtxmlrpc/xmlrpctest/main.cpp | 30 + 3rdparty/qtxmlrpc/xmlrpctest/server.cpp | 19 + 3rdparty/qtxmlrpc/xmlrpctest/server.h | 18 + 3rdparty/qtxmlrpc/xmlrpctest/xmlrpctest.pro | 6 + 3rdparty/quazip-0.5.1/CMakeLists.txt | 28 + 3rdparty/quazip-0.5.1/COPYING | 458 +++ 3rdparty/quazip-0.5.1/Doxyfile | 1722 +++++++++ 3rdparty/quazip-0.5.1/FindQuaZip.cmake | 40 + 3rdparty/quazip-0.5.1/NEWS.txt | 111 + 3rdparty/quazip-0.5.1/README.txt | 66 + .../doc/html/JlCompress_8h_source.html | 97 + 3rdparty/quazip-0.5.1/doc/html/annotated.html | 65 + 3rdparty/quazip-0.5.1/doc/html/bc_s.png | Bin 0 -> 705 bytes .../doc/html/classJlCompress-members.html | 58 + .../doc/html/classJlCompress.html | 376 ++ .../doc/html/classQuaAdler32-members.html | 56 + .../doc/html/classQuaAdler32.html | 161 + .../doc/html/classQuaAdler32__coll__graph.map | 3 + .../doc/html/classQuaAdler32__coll__graph.md5 | 1 + .../doc/html/classQuaAdler32__coll__graph.png | Bin 0 -> 1406 bytes .../html/classQuaAdler32__inherit__graph.map | 3 + .../html/classQuaAdler32__inherit__graph.md5 | 1 + .../html/classQuaAdler32__inherit__graph.png | Bin 0 -> 1406 bytes .../doc/html/classQuaChecksum32-members.html | 55 + .../doc/html/classQuaChecksum32.html | 164 + .../classQuaChecksum32__inherit__graph.map | 4 + .../classQuaChecksum32__inherit__graph.md5 | 1 + .../classQuaChecksum32__inherit__graph.png | Bin 0 -> 3229 bytes .../doc/html/classQuaCrc32-members.html | 56 + .../quazip-0.5.1/doc/html/classQuaCrc32.html | 161 + .../doc/html/classQuaCrc32__coll__graph.map | 3 + .../doc/html/classQuaCrc32__coll__graph.md5 | 1 + .../doc/html/classQuaCrc32__coll__graph.png | Bin 0 -> 1372 bytes .../html/classQuaCrc32__inherit__graph.map | 3 + .../html/classQuaCrc32__inherit__graph.md5 | 1 + .../html/classQuaCrc32__inherit__graph.png | Bin 0 -> 1372 bytes .../doc/html/classQuaGzipFile-members.html | 64 + .../doc/html/classQuaGzipFile.html | 292 ++ .../doc/html/classQuaZIODevice-members.html | 60 + .../doc/html/classQuaZIODevice.html | 209 ++ .../doc/html/classQuaZip-members.html | 99 + .../quazip-0.5.1/doc/html/classQuaZip.html | 953 +++++ .../doc/html/classQuaZipDir-members.html | 81 + .../quazip-0.5.1/doc/html/classQuaZipDir.html | 527 +++ .../doc/html/classQuaZipFile-members.html | 83 + .../doc/html/classQuaZipFile.html | 932 +++++ .../html/classQuaZipFilePrivate-members.html | 52 + .../doc/html/classQuaZipFilePrivate.html | 75 + .../classQuaZipFilePrivate__coll__graph.map | 5 + .../classQuaZipFilePrivate__coll__graph.md5 | 1 + .../classQuaZipFilePrivate__coll__graph.png | Bin 0 -> 5666 bytes .../doc/html/classQuaZipFile__coll__graph.map | 5 + .../doc/html/classQuaZipFile__coll__graph.md5 | 1 + .../doc/html/classQuaZipFile__coll__graph.png | Bin 0 -> 5247 bytes .../doc/html/classQuaZipPrivate-members.html | 54 + .../doc/html/classQuaZipPrivate.html | 75 + .../html/classQuaZipPrivate__coll__graph.map | 3 + .../html/classQuaZipPrivate__coll__graph.md5 | 1 + .../html/classQuaZipPrivate__coll__graph.png | Bin 0 -> 2074 bytes .../doc/html/classQuaZip__coll__graph.map | 3 + .../doc/html/classQuaZip__coll__graph.md5 | 1 + .../doc/html/classQuaZip__coll__graph.png | Bin 0 -> 2086 bytes 3rdparty/quazip-0.5.1/doc/html/classes.html | 55 + 3rdparty/quazip-0.5.1/doc/html/closed.png | Bin 0 -> 126 bytes .../dir_6b1d21316abab84c9bd8ed600604809a.html | 82 + ...r_6b1d21316abab84c9bd8ed600604809a_dep.map | 3 + ...r_6b1d21316abab84c9bd8ed600604809a_dep.md5 | 1 + ...r_6b1d21316abab84c9bd8ed600604809a_dep.png | Bin 0 -> 425 bytes 3rdparty/quazip-0.5.1/doc/html/dirs.html | 46 + 3rdparty/quazip-0.5.1/doc/html/doxygen.css | 835 +++++ 3rdparty/quazip-0.5.1/doc/html/doxygen.png | Bin 0 -> 3942 bytes 3rdparty/quazip-0.5.1/doc/html/faq.html | 47 + 3rdparty/quazip-0.5.1/doc/html/files.html | 62 + 3rdparty/quazip-0.5.1/doc/html/functions.html | 579 +++ .../quazip-0.5.1/doc/html/functions_enum.html | 66 + .../quazip-0.5.1/doc/html/functions_eval.html | 84 + .../quazip-0.5.1/doc/html/functions_func.html | 473 +++ .../quazip-0.5.1/doc/html/functions_vars.html | 117 + .../quazip-0.5.1/doc/html/graph_legend.html | 107 + .../quazip-0.5.1/doc/html/graph_legend.md5 | 1 + .../quazip-0.5.1/doc/html/graph_legend.png | Bin 0 -> 12219 bytes 3rdparty/quazip-0.5.1/doc/html/hierarchy.html | 69 + 3rdparty/quazip-0.5.1/doc/html/index.html | 124 + .../quazip-0.5.1/doc/html/inherit_graph_0.map | 3 + .../quazip-0.5.1/doc/html/inherit_graph_0.md5 | 1 + .../quazip-0.5.1/doc/html/inherit_graph_0.png | Bin 0 -> 438 bytes .../quazip-0.5.1/doc/html/inherit_graph_1.map | 5 + .../quazip-0.5.1/doc/html/inherit_graph_1.md5 | 1 + .../quazip-0.5.1/doc/html/inherit_graph_1.png | Bin 0 -> 2239 bytes .../doc/html/inherit_graph_10.map | 3 + .../doc/html/inherit_graph_10.md5 | 1 + .../doc/html/inherit_graph_10.png | Bin 0 -> 518 bytes .../quazip-0.5.1/doc/html/inherit_graph_2.map | 3 + .../quazip-0.5.1/doc/html/inherit_graph_2.md5 | 1 + .../quazip-0.5.1/doc/html/inherit_graph_2.png | Bin 0 -> 496 bytes .../quazip-0.5.1/doc/html/inherit_graph_3.map | 3 + .../quazip-0.5.1/doc/html/inherit_graph_3.md5 | 1 + .../quazip-0.5.1/doc/html/inherit_graph_3.png | Bin 0 -> 504 bytes .../quazip-0.5.1/doc/html/inherit_graph_4.map | 3 + .../quazip-0.5.1/doc/html/inherit_graph_4.md5 | 1 + .../quazip-0.5.1/doc/html/inherit_graph_4.png | Bin 0 -> 415 bytes .../quazip-0.5.1/doc/html/inherit_graph_5.map | 3 + .../quazip-0.5.1/doc/html/inherit_graph_5.md5 | 1 + .../quazip-0.5.1/doc/html/inherit_graph_5.png | Bin 0 -> 458 bytes .../quazip-0.5.1/doc/html/inherit_graph_6.map | 3 + .../quazip-0.5.1/doc/html/inherit_graph_6.md5 | 1 + .../quazip-0.5.1/doc/html/inherit_graph_6.png | Bin 0 -> 459 bytes .../quazip-0.5.1/doc/html/inherit_graph_7.map | 3 + .../quazip-0.5.1/doc/html/inherit_graph_7.md5 | 1 + .../quazip-0.5.1/doc/html/inherit_graph_7.png | Bin 0 -> 500 bytes .../quazip-0.5.1/doc/html/inherit_graph_8.map | 3 + .../quazip-0.5.1/doc/html/inherit_graph_8.md5 | 1 + .../quazip-0.5.1/doc/html/inherit_graph_8.png | Bin 0 -> 554 bytes .../quazip-0.5.1/doc/html/inherit_graph_9.map | 3 + .../quazip-0.5.1/doc/html/inherit_graph_9.md5 | 1 + .../quazip-0.5.1/doc/html/inherit_graph_9.png | Bin 0 -> 520 bytes 3rdparty/quazip-0.5.1/doc/html/inherits.html | 98 + 3rdparty/quazip-0.5.1/doc/html/jquery.js | 54 + 3rdparty/quazip-0.5.1/doc/html/nav_f.png | Bin 0 -> 159 bytes 3rdparty/quazip-0.5.1/doc/html/nav_h.png | Bin 0 -> 97 bytes 3rdparty/quazip-0.5.1/doc/html/open.png | Bin 0 -> 118 bytes 3rdparty/quazip-0.5.1/doc/html/pages.html | 49 + .../doc/html/quaadler32_8h_source.html | 79 + .../doc/html/quachecksum32_8h_source.html | 78 + .../doc/html/quacrc32_8h_source.html | 76 + .../doc/html/quagzipfile_8h_source.html | 97 + .../doc/html/quaziodevice_8h_source.html | 86 + .../doc/html/quazip_8h_source.html | 192 + .../doc/html/quazip__global_8h_source.html | 78 + .../doc/html/quazipdir_8h_source.html | 123 + .../doc/html/quazipfile_8h_source.html | 164 + .../doc/html/quazipfileinfo_8h_source.html | 107 + .../doc/html/quazipnewinfo_8h_source.html | 113 + .../html/structQuaZipFileInfo-members.html | 66 + .../doc/html/structQuaZipFileInfo.html | 139 + .../doc/html/structQuaZipNewInfo-members.html | 64 + .../doc/html/structQuaZipNewInfo.html | 319 ++ 3rdparty/quazip-0.5.1/doc/html/tab_a.png | Bin 0 -> 140 bytes 3rdparty/quazip-0.5.1/doc/html/tab_b.png | Bin 0 -> 178 bytes 3rdparty/quazip-0.5.1/doc/html/tab_h.png | Bin 0 -> 192 bytes 3rdparty/quazip-0.5.1/doc/html/tab_s.png | Bin 0 -> 189 bytes 3rdparty/quazip-0.5.1/doc/html/tabs.css | 59 + 3rdparty/quazip-0.5.1/doc/html/usage.html | 61 + 3rdparty/quazip-0.5.1/doc/latex/Makefile | 39 + 3rdparty/quazip-0.5.1/doc/latex/annotated.tex | 16 + .../doc/latex/classJlCompress.tex | 239 ++ .../doc/latex/classQuaAdler32.tex | 108 + .../latex/classQuaAdler32__coll__graph.eps | 263 ++ .../latex/classQuaAdler32__coll__graph.md5 | 1 + .../latex/classQuaAdler32__inherit__graph.eps | 263 ++ .../latex/classQuaAdler32__inherit__graph.md5 | 1 + .../doc/latex/classQuaChecksum32.tex | 113 + .../classQuaChecksum32__inherit__graph.eps | 309 ++ .../classQuaChecksum32__inherit__graph.md5 | 1 + .../quazip-0.5.1/doc/latex/classQuaCrc32.tex | 108 + .../doc/latex/classQuaCrc32__coll__graph.eps | 263 ++ .../doc/latex/classQuaCrc32__coll__graph.md5 | 1 + .../latex/classQuaCrc32__inherit__graph.eps | 263 ++ .../latex/classQuaCrc32__inherit__graph.md5 | 1 + .../doc/latex/classQuaGzipFile.tex | 177 + .../doc/latex/classQuaZIODevice.tex | 136 + .../quazip-0.5.1/doc/latex/classQuaZip.tex | 762 ++++ .../quazip-0.5.1/doc/latex/classQuaZipDir.tex | 346 ++ .../doc/latex/classQuaZipFile.tex | 668 ++++ .../doc/latex/classQuaZipFilePrivate.tex | 31 + .../classQuaZipFilePrivate__coll__graph.eps | 414 +++ .../classQuaZipFilePrivate__coll__graph.md5 | 1 + .../latex/classQuaZipFile__coll__graph.eps | 414 +++ .../latex/classQuaZipFile__coll__graph.md5 | 1 + .../doc/latex/classQuaZipPrivate.tex | 31 + .../latex/classQuaZipPrivate__coll__graph.eps | 291 ++ .../latex/classQuaZipPrivate__coll__graph.md5 | 1 + .../doc/latex/classQuaZip__coll__graph.eps | 291 ++ .../doc/latex/classQuaZip__coll__graph.md5 | 1 + .../dir_6b1d21316abab84c9bd8ed600604809a.tex | 59 + ...r_6b1d21316abab84c9bd8ed600604809a_dep.eps | 222 ++ ...r_6b1d21316abab84c9bd8ed600604809a_dep.md5 | 1 + 3rdparty/quazip-0.5.1/doc/latex/dirs.tex | 4 + 3rdparty/quazip-0.5.1/doc/latex/doxygen.sty | 416 +++ 3rdparty/quazip-0.5.1/doc/latex/faq.tex | 9 + 3rdparty/quazip-0.5.1/doc/latex/hierarchy.tex | 18 + 3rdparty/quazip-0.5.1/doc/latex/index.tex | 88 + 3rdparty/quazip-0.5.1/doc/latex/refman.tex | 71 + .../doc/latex/structQuaZipFileInfo.tex | 90 + .../doc/latex/structQuaZipNewInfo.tex | 205 ++ 3rdparty/quazip-0.5.1/doc/latex/usage.tex | 22 + 3rdparty/quazip-0.5.1/includes.pri | 10 + 3rdparty/quazip-0.5.1/quazip.pri | 3 + 3rdparty/quazip-0.5.1/quazip.pro | 2 + 3rdparty/quazip-0.5.1/quazip.sln | 26 + 3rdparty/quazip-0.5.1/quazip/CMakeLists.txt | 26 + .../quazip-0.5.1/quazip}/JlCompress.cpp | 148 +- 3rdparty/quazip-0.5.1/quazip/JlCompress.h | 114 + .../quazip-0.5.1/quazip}/crypt.h | 270 +- .../quazip/debian/libquazip0.symbols | 163 + 3rdparty/quazip-0.5.1/quazip/doc/faq.dox | 32 + 3rdparty/quazip-0.5.1/quazip/doc/index.dox | 179 + 3rdparty/quazip-0.5.1/quazip/doc/usage.dox | 77 + .../quazip-0.5.1/quazip}/ioapi.h | 155 +- .../quazip-0.5.1/quazip}/qioapi.cpp | 288 +- .../quazip-0.5.1/quazip}/quaadler32.cpp | 0 .../quazip-0.5.1/quazip}/quaadler32.h | 0 .../quazip-0.5.1/quazip}/quachecksum32.h | 0 .../quazip-0.5.1/quazip}/quacrc32.cpp | 0 .../quazip-0.5.1/quazip}/quacrc32.h | 0 3rdparty/quazip-0.5.1/quazip/quagzipfile.cpp | 148 + 3rdparty/quazip-0.5.1/quazip/quagzipfile.h | 84 + 3rdparty/quazip-0.5.1/quazip/quaziodevice.cpp | 296 ++ 3rdparty/quazip-0.5.1/quazip/quaziodevice.h | 74 + .../quazip-0.5.1/quazip}/quazip.cpp | 1073 +++--- .../quazip-0.5.1/quazip}/quazip.h | 825 ++--- 3rdparty/quazip-0.5.1/quazip/quazip.pri | 28 + 3rdparty/quazip-0.5.1/quazip/quazip.pro | 77 + 3rdparty/quazip-0.5.1/quazip/quazip.sln | 20 + 3rdparty/quazip-0.5.1/quazip/quazip.vcproj | 314 ++ 3rdparty/quazip-0.5.1/quazip/quazip.vcxproj | 121 + .../quazip/quazip.vcxproj.filters | 117 + .../quazip-0.5.1/quazip}/quazip_global.h | 2 - 3rdparty/quazip-0.5.1/quazip/quazipdir.cpp | 518 +++ 3rdparty/quazip-0.5.1/quazip/quazipdir.h | 171 + .../quazip-0.5.1/quazip}/quazipfile.cpp | 928 ++--- .../quazip-0.5.1/quazip}/quazipfile.h | 884 ++--- .../quazip-0.5.1/quazip/quazipfileinfo.cpp | 26 + .../quazip-0.5.1/quazip}/quazipfileinfo.h | 139 +- .../quazip-0.5.1/quazip}/quazipnewinfo.cpp | 140 +- .../quazip-0.5.1/quazip}/quazipnewinfo.h | 223 +- 3rdparty/quazip-0.5.1/quazip/run_moc.bat | 3 + .../quazip-0.5.1/quazip}/unzip.c | 3206 ++++++++--------- .../quazip-0.5.1/quazip}/unzip.h | 713 ++-- .../quazip-0.5.1/quazip}/zip.c | 2562 ++++++------- .../quazip-0.5.1/quazip}/zip.h | 492 ++- 3rdparty/quazip-0.5.1/qztest/qztest.cpp | 164 + 3rdparty/quazip-0.5.1/qztest/qztest.h | 15 + 3rdparty/quazip-0.5.1/qztest/qztest.pro | 41 + 3rdparty/quazip-0.5.1/qztest/qztest.sln | 26 + 3rdparty/quazip-0.5.1/qztest/qztest.vcproj | 293 ++ 3rdparty/quazip-0.5.1/qztest/qztest.vcxproj | 126 + .../qztest/qztest.vcxproj.filters | 94 + 3rdparty/quazip-0.5.1/qztest/run_moc.bat | 7 + .../quazip-0.5.1/qztest/testjlcompress.cpp | 236 ++ 3rdparty/quazip-0.5.1/qztest/testjlcompress.h | 23 + .../quazip-0.5.1/qztest/testquachecksum32.cpp | 14 + .../quazip-0.5.1/qztest/testquachecksum32.h | 12 + .../quazip-0.5.1/qztest/testquagzipfile.cpp | 43 + .../quazip-0.5.1/qztest/testquagzipfile.h | 13 + .../quazip-0.5.1/qztest/testquaziodevice.cpp | 57 + .../quazip-0.5.1/qztest/testquaziodevice.h | 13 + 3rdparty/quazip-0.5.1/qztest/testquazip.cpp | 125 + 3rdparty/quazip-0.5.1/qztest/testquazip.h | 15 + .../quazip-0.5.1/qztest/testquazipdir.cpp | 154 + 3rdparty/quazip-0.5.1/qztest/testquazipdir.h | 15 + .../quazip-0.5.1/qztest/testquazipfile.cpp | 214 ++ 3rdparty/quazip-0.5.1/qztest/testquazipfile.h | 21 + SleepyHeadQT.pro | 106 +- UpdaterWindow.cpp | 4 +- mainwindow.cpp | 24 +- oximetry.cpp | 158 +- oximetry.h | 20 +- qextserialport/posix_qextserialport.cpp | 959 ----- qextserialport/qextserialenumerator.h | 199 - qextserialport/qextserialenumerator_osx.cpp | 288 -- qextserialport/qextserialenumerator_unix.cpp | 75 - qextserialport/qextserialenumerator_win.cpp | 206 -- qextserialport/qextserialport.cpp | 254 -- qextserialport/qextserialport.h | 333 -- qextserialport/qextserialport_global.h | 17 - qextserialport/qwineventnotifier_p.h | 94 - qextserialport/win_qextserialport.cpp | 868 ----- quazip/JlCompress.h | 32 - quazip/zconf.h | 429 --- quazip/zlib.h | 1613 --------- 293 files changed, 33065 insertions(+), 11418 deletions(-) create mode 160000 3rdparty/qextserialport create mode 100644 3rdparty/qtxmlrpc/client/client.pri create mode 100644 3rdparty/qtxmlrpc/client/src/clientprotocol.cpp create mode 100644 3rdparty/qtxmlrpc/client/src/clientprotocol.h create mode 100644 3rdparty/qtxmlrpc/client/src/httpclient.cpp create mode 100644 3rdparty/qtxmlrpc/client/src/httpclient.h create mode 100644 3rdparty/qtxmlrpc/client/src/httpsclient.cpp create mode 100644 3rdparty/qtxmlrpc/client/src/httpsclient.h create mode 100644 3rdparty/qtxmlrpc/client/src/xmlrpcclient.cpp create mode 100644 3rdparty/qtxmlrpc/client/src/xmlrpcclient.h create mode 100644 3rdparty/qtxmlrpc/client/src/xmlrpcconv.cpp create mode 100644 3rdparty/qtxmlrpc/client/src/xmlrpcconv.h create mode 100644 3rdparty/qtxmlrpc/server/server.pri create mode 100644 3rdparty/qtxmlrpc/server/src/protocol.cpp create mode 100644 3rdparty/qtxmlrpc/server/src/protocol.h create mode 100644 3rdparty/qtxmlrpc/server/src/qhttpheader.cpp create mode 100644 3rdparty/qtxmlrpc/server/src/qhttpheader_p.h create mode 100644 3rdparty/qtxmlrpc/server/src/xmlrpcserver.cpp create mode 100644 3rdparty/qtxmlrpc/server/src/xmlrpcserver.h create mode 100644 3rdparty/qtxmlrpc/xmlrpctest/client.cpp create mode 100644 3rdparty/qtxmlrpc/xmlrpctest/client.h create mode 100644 3rdparty/qtxmlrpc/xmlrpctest/client.py create mode 100644 3rdparty/qtxmlrpc/xmlrpctest/main.cpp create mode 100644 3rdparty/qtxmlrpc/xmlrpctest/server.cpp create mode 100644 3rdparty/qtxmlrpc/xmlrpctest/server.h create mode 100644 3rdparty/qtxmlrpc/xmlrpctest/xmlrpctest.pro create mode 100644 3rdparty/quazip-0.5.1/CMakeLists.txt create mode 100644 3rdparty/quazip-0.5.1/COPYING create mode 100644 3rdparty/quazip-0.5.1/Doxyfile create mode 100644 3rdparty/quazip-0.5.1/FindQuaZip.cmake create mode 100644 3rdparty/quazip-0.5.1/NEWS.txt create mode 100644 3rdparty/quazip-0.5.1/README.txt create mode 100644 3rdparty/quazip-0.5.1/doc/html/JlCompress_8h_source.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/annotated.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/bc_s.png create mode 100644 3rdparty/quazip-0.5.1/doc/html/classJlCompress-members.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/classJlCompress.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/classQuaAdler32-members.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/classQuaAdler32.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/classQuaAdler32__coll__graph.map create mode 100644 3rdparty/quazip-0.5.1/doc/html/classQuaAdler32__coll__graph.md5 create mode 100644 3rdparty/quazip-0.5.1/doc/html/classQuaAdler32__coll__graph.png create mode 100644 3rdparty/quazip-0.5.1/doc/html/classQuaAdler32__inherit__graph.map create mode 100644 3rdparty/quazip-0.5.1/doc/html/classQuaAdler32__inherit__graph.md5 create mode 100644 3rdparty/quazip-0.5.1/doc/html/classQuaAdler32__inherit__graph.png create mode 100644 3rdparty/quazip-0.5.1/doc/html/classQuaChecksum32-members.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/classQuaChecksum32.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/classQuaChecksum32__inherit__graph.map create mode 100644 3rdparty/quazip-0.5.1/doc/html/classQuaChecksum32__inherit__graph.md5 create mode 100644 3rdparty/quazip-0.5.1/doc/html/classQuaChecksum32__inherit__graph.png create mode 100644 3rdparty/quazip-0.5.1/doc/html/classQuaCrc32-members.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/classQuaCrc32.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/classQuaCrc32__coll__graph.map create mode 100644 3rdparty/quazip-0.5.1/doc/html/classQuaCrc32__coll__graph.md5 create mode 100644 3rdparty/quazip-0.5.1/doc/html/classQuaCrc32__coll__graph.png create mode 100644 3rdparty/quazip-0.5.1/doc/html/classQuaCrc32__inherit__graph.map create mode 100644 3rdparty/quazip-0.5.1/doc/html/classQuaCrc32__inherit__graph.md5 create mode 100644 3rdparty/quazip-0.5.1/doc/html/classQuaCrc32__inherit__graph.png create mode 100644 3rdparty/quazip-0.5.1/doc/html/classQuaGzipFile-members.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/classQuaGzipFile.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/classQuaZIODevice-members.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/classQuaZIODevice.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/classQuaZip-members.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/classQuaZip.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/classQuaZipDir-members.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/classQuaZipDir.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/classQuaZipFile-members.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/classQuaZipFile.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/classQuaZipFilePrivate-members.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/classQuaZipFilePrivate.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/classQuaZipFilePrivate__coll__graph.map create mode 100644 3rdparty/quazip-0.5.1/doc/html/classQuaZipFilePrivate__coll__graph.md5 create mode 100644 3rdparty/quazip-0.5.1/doc/html/classQuaZipFilePrivate__coll__graph.png create mode 100644 3rdparty/quazip-0.5.1/doc/html/classQuaZipFile__coll__graph.map create mode 100644 3rdparty/quazip-0.5.1/doc/html/classQuaZipFile__coll__graph.md5 create mode 100644 3rdparty/quazip-0.5.1/doc/html/classQuaZipFile__coll__graph.png create mode 100644 3rdparty/quazip-0.5.1/doc/html/classQuaZipPrivate-members.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/classQuaZipPrivate.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/classQuaZipPrivate__coll__graph.map create mode 100644 3rdparty/quazip-0.5.1/doc/html/classQuaZipPrivate__coll__graph.md5 create mode 100644 3rdparty/quazip-0.5.1/doc/html/classQuaZipPrivate__coll__graph.png create mode 100644 3rdparty/quazip-0.5.1/doc/html/classQuaZip__coll__graph.map create mode 100644 3rdparty/quazip-0.5.1/doc/html/classQuaZip__coll__graph.md5 create mode 100644 3rdparty/quazip-0.5.1/doc/html/classQuaZip__coll__graph.png create mode 100644 3rdparty/quazip-0.5.1/doc/html/classes.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/closed.png create mode 100644 3rdparty/quazip-0.5.1/doc/html/dir_6b1d21316abab84c9bd8ed600604809a.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/dir_6b1d21316abab84c9bd8ed600604809a_dep.map create mode 100644 3rdparty/quazip-0.5.1/doc/html/dir_6b1d21316abab84c9bd8ed600604809a_dep.md5 create mode 100644 3rdparty/quazip-0.5.1/doc/html/dir_6b1d21316abab84c9bd8ed600604809a_dep.png create mode 100644 3rdparty/quazip-0.5.1/doc/html/dirs.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/doxygen.css create mode 100644 3rdparty/quazip-0.5.1/doc/html/doxygen.png create mode 100644 3rdparty/quazip-0.5.1/doc/html/faq.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/files.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/functions.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/functions_enum.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/functions_eval.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/functions_func.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/functions_vars.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/graph_legend.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/graph_legend.md5 create mode 100644 3rdparty/quazip-0.5.1/doc/html/graph_legend.png create mode 100644 3rdparty/quazip-0.5.1/doc/html/hierarchy.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/index.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/inherit_graph_0.map create mode 100644 3rdparty/quazip-0.5.1/doc/html/inherit_graph_0.md5 create mode 100644 3rdparty/quazip-0.5.1/doc/html/inherit_graph_0.png create mode 100644 3rdparty/quazip-0.5.1/doc/html/inherit_graph_1.map create mode 100644 3rdparty/quazip-0.5.1/doc/html/inherit_graph_1.md5 create mode 100644 3rdparty/quazip-0.5.1/doc/html/inherit_graph_1.png create mode 100644 3rdparty/quazip-0.5.1/doc/html/inherit_graph_10.map create mode 100644 3rdparty/quazip-0.5.1/doc/html/inherit_graph_10.md5 create mode 100644 3rdparty/quazip-0.5.1/doc/html/inherit_graph_10.png create mode 100644 3rdparty/quazip-0.5.1/doc/html/inherit_graph_2.map create mode 100644 3rdparty/quazip-0.5.1/doc/html/inherit_graph_2.md5 create mode 100644 3rdparty/quazip-0.5.1/doc/html/inherit_graph_2.png create mode 100644 3rdparty/quazip-0.5.1/doc/html/inherit_graph_3.map create mode 100644 3rdparty/quazip-0.5.1/doc/html/inherit_graph_3.md5 create mode 100644 3rdparty/quazip-0.5.1/doc/html/inherit_graph_3.png create mode 100644 3rdparty/quazip-0.5.1/doc/html/inherit_graph_4.map create mode 100644 3rdparty/quazip-0.5.1/doc/html/inherit_graph_4.md5 create mode 100644 3rdparty/quazip-0.5.1/doc/html/inherit_graph_4.png create mode 100644 3rdparty/quazip-0.5.1/doc/html/inherit_graph_5.map create mode 100644 3rdparty/quazip-0.5.1/doc/html/inherit_graph_5.md5 create mode 100644 3rdparty/quazip-0.5.1/doc/html/inherit_graph_5.png create mode 100644 3rdparty/quazip-0.5.1/doc/html/inherit_graph_6.map create mode 100644 3rdparty/quazip-0.5.1/doc/html/inherit_graph_6.md5 create mode 100644 3rdparty/quazip-0.5.1/doc/html/inherit_graph_6.png create mode 100644 3rdparty/quazip-0.5.1/doc/html/inherit_graph_7.map create mode 100644 3rdparty/quazip-0.5.1/doc/html/inherit_graph_7.md5 create mode 100644 3rdparty/quazip-0.5.1/doc/html/inherit_graph_7.png create mode 100644 3rdparty/quazip-0.5.1/doc/html/inherit_graph_8.map create mode 100644 3rdparty/quazip-0.5.1/doc/html/inherit_graph_8.md5 create mode 100644 3rdparty/quazip-0.5.1/doc/html/inherit_graph_8.png create mode 100644 3rdparty/quazip-0.5.1/doc/html/inherit_graph_9.map create mode 100644 3rdparty/quazip-0.5.1/doc/html/inherit_graph_9.md5 create mode 100644 3rdparty/quazip-0.5.1/doc/html/inherit_graph_9.png create mode 100644 3rdparty/quazip-0.5.1/doc/html/inherits.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/jquery.js create mode 100644 3rdparty/quazip-0.5.1/doc/html/nav_f.png create mode 100644 3rdparty/quazip-0.5.1/doc/html/nav_h.png create mode 100644 3rdparty/quazip-0.5.1/doc/html/open.png create mode 100644 3rdparty/quazip-0.5.1/doc/html/pages.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/quaadler32_8h_source.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/quachecksum32_8h_source.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/quacrc32_8h_source.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/quagzipfile_8h_source.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/quaziodevice_8h_source.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/quazip_8h_source.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/quazip__global_8h_source.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/quazipdir_8h_source.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/quazipfile_8h_source.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/quazipfileinfo_8h_source.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/quazipnewinfo_8h_source.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/structQuaZipFileInfo-members.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/structQuaZipFileInfo.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/structQuaZipNewInfo-members.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/structQuaZipNewInfo.html create mode 100644 3rdparty/quazip-0.5.1/doc/html/tab_a.png create mode 100644 3rdparty/quazip-0.5.1/doc/html/tab_b.png create mode 100644 3rdparty/quazip-0.5.1/doc/html/tab_h.png create mode 100644 3rdparty/quazip-0.5.1/doc/html/tab_s.png create mode 100644 3rdparty/quazip-0.5.1/doc/html/tabs.css create mode 100644 3rdparty/quazip-0.5.1/doc/html/usage.html create mode 100644 3rdparty/quazip-0.5.1/doc/latex/Makefile create mode 100644 3rdparty/quazip-0.5.1/doc/latex/annotated.tex create mode 100644 3rdparty/quazip-0.5.1/doc/latex/classJlCompress.tex create mode 100644 3rdparty/quazip-0.5.1/doc/latex/classQuaAdler32.tex create mode 100644 3rdparty/quazip-0.5.1/doc/latex/classQuaAdler32__coll__graph.eps create mode 100644 3rdparty/quazip-0.5.1/doc/latex/classQuaAdler32__coll__graph.md5 create mode 100644 3rdparty/quazip-0.5.1/doc/latex/classQuaAdler32__inherit__graph.eps create mode 100644 3rdparty/quazip-0.5.1/doc/latex/classQuaAdler32__inherit__graph.md5 create mode 100644 3rdparty/quazip-0.5.1/doc/latex/classQuaChecksum32.tex create mode 100644 3rdparty/quazip-0.5.1/doc/latex/classQuaChecksum32__inherit__graph.eps create mode 100644 3rdparty/quazip-0.5.1/doc/latex/classQuaChecksum32__inherit__graph.md5 create mode 100644 3rdparty/quazip-0.5.1/doc/latex/classQuaCrc32.tex create mode 100644 3rdparty/quazip-0.5.1/doc/latex/classQuaCrc32__coll__graph.eps create mode 100644 3rdparty/quazip-0.5.1/doc/latex/classQuaCrc32__coll__graph.md5 create mode 100644 3rdparty/quazip-0.5.1/doc/latex/classQuaCrc32__inherit__graph.eps create mode 100644 3rdparty/quazip-0.5.1/doc/latex/classQuaCrc32__inherit__graph.md5 create mode 100644 3rdparty/quazip-0.5.1/doc/latex/classQuaGzipFile.tex create mode 100644 3rdparty/quazip-0.5.1/doc/latex/classQuaZIODevice.tex create mode 100644 3rdparty/quazip-0.5.1/doc/latex/classQuaZip.tex create mode 100644 3rdparty/quazip-0.5.1/doc/latex/classQuaZipDir.tex create mode 100644 3rdparty/quazip-0.5.1/doc/latex/classQuaZipFile.tex create mode 100644 3rdparty/quazip-0.5.1/doc/latex/classQuaZipFilePrivate.tex create mode 100644 3rdparty/quazip-0.5.1/doc/latex/classQuaZipFilePrivate__coll__graph.eps create mode 100644 3rdparty/quazip-0.5.1/doc/latex/classQuaZipFilePrivate__coll__graph.md5 create mode 100644 3rdparty/quazip-0.5.1/doc/latex/classQuaZipFile__coll__graph.eps create mode 100644 3rdparty/quazip-0.5.1/doc/latex/classQuaZipFile__coll__graph.md5 create mode 100644 3rdparty/quazip-0.5.1/doc/latex/classQuaZipPrivate.tex create mode 100644 3rdparty/quazip-0.5.1/doc/latex/classQuaZipPrivate__coll__graph.eps create mode 100644 3rdparty/quazip-0.5.1/doc/latex/classQuaZipPrivate__coll__graph.md5 create mode 100644 3rdparty/quazip-0.5.1/doc/latex/classQuaZip__coll__graph.eps create mode 100644 3rdparty/quazip-0.5.1/doc/latex/classQuaZip__coll__graph.md5 create mode 100644 3rdparty/quazip-0.5.1/doc/latex/dir_6b1d21316abab84c9bd8ed600604809a.tex create mode 100644 3rdparty/quazip-0.5.1/doc/latex/dir_6b1d21316abab84c9bd8ed600604809a_dep.eps create mode 100644 3rdparty/quazip-0.5.1/doc/latex/dir_6b1d21316abab84c9bd8ed600604809a_dep.md5 create mode 100644 3rdparty/quazip-0.5.1/doc/latex/dirs.tex create mode 100644 3rdparty/quazip-0.5.1/doc/latex/doxygen.sty create mode 100644 3rdparty/quazip-0.5.1/doc/latex/faq.tex create mode 100644 3rdparty/quazip-0.5.1/doc/latex/hierarchy.tex create mode 100644 3rdparty/quazip-0.5.1/doc/latex/index.tex create mode 100644 3rdparty/quazip-0.5.1/doc/latex/refman.tex create mode 100644 3rdparty/quazip-0.5.1/doc/latex/structQuaZipFileInfo.tex create mode 100644 3rdparty/quazip-0.5.1/doc/latex/structQuaZipNewInfo.tex create mode 100644 3rdparty/quazip-0.5.1/doc/latex/usage.tex create mode 100644 3rdparty/quazip-0.5.1/includes.pri create mode 100644 3rdparty/quazip-0.5.1/quazip.pri create mode 100644 3rdparty/quazip-0.5.1/quazip.pro create mode 100644 3rdparty/quazip-0.5.1/quazip.sln create mode 100644 3rdparty/quazip-0.5.1/quazip/CMakeLists.txt rename {quazip => 3rdparty/quazip-0.5.1/quazip}/JlCompress.cpp (84%) create mode 100644 3rdparty/quazip-0.5.1/quazip/JlCompress.h rename {quazip => 3rdparty/quazip-0.5.1/quazip}/crypt.h (97%) create mode 100644 3rdparty/quazip-0.5.1/quazip/debian/libquazip0.symbols create mode 100644 3rdparty/quazip-0.5.1/quazip/doc/faq.dox create mode 100644 3rdparty/quazip-0.5.1/quazip/doc/index.dox create mode 100644 3rdparty/quazip-0.5.1/quazip/doc/usage.dox rename {quazip => 3rdparty/quazip-0.5.1/quazip}/ioapi.h (96%) rename {quazip => 3rdparty/quazip-0.5.1/quazip}/qioapi.cpp (85%) rename {quazip => 3rdparty/quazip-0.5.1/quazip}/quaadler32.cpp (100%) rename {quazip => 3rdparty/quazip-0.5.1/quazip}/quaadler32.h (100%) rename {quazip => 3rdparty/quazip-0.5.1/quazip}/quachecksum32.h (100%) rename {quazip => 3rdparty/quazip-0.5.1/quazip}/quacrc32.cpp (100%) rename {quazip => 3rdparty/quazip-0.5.1/quazip}/quacrc32.h (100%) create mode 100644 3rdparty/quazip-0.5.1/quazip/quagzipfile.cpp create mode 100644 3rdparty/quazip-0.5.1/quazip/quagzipfile.h create mode 100644 3rdparty/quazip-0.5.1/quazip/quaziodevice.cpp create mode 100644 3rdparty/quazip-0.5.1/quazip/quaziodevice.h rename {quazip => 3rdparty/quazip-0.5.1/quazip}/quazip.cpp (87%) rename {quazip => 3rdparty/quazip-0.5.1/quazip}/quazip.h (95%) create mode 100644 3rdparty/quazip-0.5.1/quazip/quazip.pri create mode 100644 3rdparty/quazip-0.5.1/quazip/quazip.pro create mode 100644 3rdparty/quazip-0.5.1/quazip/quazip.sln create mode 100644 3rdparty/quazip-0.5.1/quazip/quazip.vcproj create mode 100644 3rdparty/quazip-0.5.1/quazip/quazip.vcxproj create mode 100644 3rdparty/quazip-0.5.1/quazip/quazip.vcxproj.filters rename {quazip => 3rdparty/quazip-0.5.1/quazip}/quazip_global.h (98%) create mode 100644 3rdparty/quazip-0.5.1/quazip/quazipdir.cpp create mode 100644 3rdparty/quazip-0.5.1/quazip/quazipdir.h rename {quazip => 3rdparty/quazip-0.5.1/quazip}/quazipfile.cpp (86%) rename {quazip => 3rdparty/quazip-0.5.1/quazip}/quazipfile.h (97%) create mode 100644 3rdparty/quazip-0.5.1/quazip/quazipfileinfo.cpp rename {quazip => 3rdparty/quazip-0.5.1/quazip}/quazipfileinfo.h (90%) rename {quazip => 3rdparty/quazip-0.5.1/quazip}/quazipnewinfo.cpp (54%) rename {quazip => 3rdparty/quazip-0.5.1/quazip}/quazipnewinfo.h (78%) create mode 100644 3rdparty/quazip-0.5.1/quazip/run_moc.bat rename {quazip => 3rdparty/quazip-0.5.1/quazip}/unzip.c (96%) rename {quazip => 3rdparty/quazip-0.5.1/quazip}/unzip.h (97%) rename {quazip => 3rdparty/quazip-0.5.1/quazip}/zip.c (96%) rename {quazip => 3rdparty/quazip-0.5.1/quazip}/zip.h (97%) create mode 100644 3rdparty/quazip-0.5.1/qztest/qztest.cpp create mode 100644 3rdparty/quazip-0.5.1/qztest/qztest.h create mode 100644 3rdparty/quazip-0.5.1/qztest/qztest.pro create mode 100644 3rdparty/quazip-0.5.1/qztest/qztest.sln create mode 100644 3rdparty/quazip-0.5.1/qztest/qztest.vcproj create mode 100644 3rdparty/quazip-0.5.1/qztest/qztest.vcxproj create mode 100644 3rdparty/quazip-0.5.1/qztest/qztest.vcxproj.filters create mode 100644 3rdparty/quazip-0.5.1/qztest/run_moc.bat create mode 100644 3rdparty/quazip-0.5.1/qztest/testjlcompress.cpp create mode 100644 3rdparty/quazip-0.5.1/qztest/testjlcompress.h create mode 100644 3rdparty/quazip-0.5.1/qztest/testquachecksum32.cpp create mode 100644 3rdparty/quazip-0.5.1/qztest/testquachecksum32.h create mode 100644 3rdparty/quazip-0.5.1/qztest/testquagzipfile.cpp create mode 100644 3rdparty/quazip-0.5.1/qztest/testquagzipfile.h create mode 100644 3rdparty/quazip-0.5.1/qztest/testquaziodevice.cpp create mode 100644 3rdparty/quazip-0.5.1/qztest/testquaziodevice.h create mode 100644 3rdparty/quazip-0.5.1/qztest/testquazip.cpp create mode 100644 3rdparty/quazip-0.5.1/qztest/testquazip.h create mode 100644 3rdparty/quazip-0.5.1/qztest/testquazipdir.cpp create mode 100644 3rdparty/quazip-0.5.1/qztest/testquazipdir.h create mode 100644 3rdparty/quazip-0.5.1/qztest/testquazipfile.cpp create mode 100644 3rdparty/quazip-0.5.1/qztest/testquazipfile.h delete mode 100644 qextserialport/posix_qextserialport.cpp delete mode 100644 qextserialport/qextserialenumerator.h delete mode 100644 qextserialport/qextserialenumerator_osx.cpp delete mode 100644 qextserialport/qextserialenumerator_unix.cpp delete mode 100644 qextserialport/qextserialenumerator_win.cpp delete mode 100644 qextserialport/qextserialport.cpp delete mode 100644 qextserialport/qextserialport.h delete mode 100644 qextserialport/qextserialport_global.h delete mode 100644 qextserialport/qwineventnotifier_p.h delete mode 100644 qextserialport/win_qextserialport.cpp delete mode 100644 quazip/JlCompress.h delete mode 100644 quazip/zconf.h delete mode 100644 quazip/zlib.h diff --git a/3rdparty/qextserialport b/3rdparty/qextserialport new file mode 160000 index 00000000..3be3fbf3 --- /dev/null +++ b/3rdparty/qextserialport @@ -0,0 +1 @@ +Subproject commit 3be3fbf31edf6c91c7838f585b77acd787811296 diff --git a/3rdparty/qtxmlrpc/client/client.pri b/3rdparty/qtxmlrpc/client/client.pri new file mode 100644 index 00000000..10a793a1 --- /dev/null +++ b/3rdparty/qtxmlrpc/client/client.pri @@ -0,0 +1,14 @@ +QT *= network xml + +SOURCES += $$PWD/src/clientprotocol.cpp \ + $$PWD/src/httpclient.cpp \ + $$PWD/src/httpsclient.cpp \ + $$PWD/src/xmlrpcconv.cpp \ + $$PWD/src/xmlrpcclient.cpp \ + +HEADERS += $$PWD/src/clientprotocol.h \ + $$PWD/src/httpclient.h \ + $$PWD/src/httpsclient.h \ + $$PWD/src/xmlrpcconv.h \ + $$PWD/src/xmlrpcclient.h + diff --git a/3rdparty/qtxmlrpc/client/src/clientprotocol.cpp b/3rdparty/qtxmlrpc/client/src/clientprotocol.cpp new file mode 100644 index 00000000..cd270594 --- /dev/null +++ b/3rdparty/qtxmlrpc/client/src/clientprotocol.cpp @@ -0,0 +1,251 @@ +#include "clientprotocol.h" +#include + + +Client_::Client_( const QString &dstHost, const quint16 dstPort ) + : dstHost( dstHost ), dstPort( dstPort ), + protocolRetry( 0 ), maxProtocolRetries( 10 ), protocolStarted( false ) +{ +#ifdef DEBUG_PROTOCOL + qDebug() << this << "Protocol(...)"; +#endif + connectTimeoutTimer = new QTimer( this ); + connectTimeoutTimer->setSingleShot( true ); + connect( connectTimeoutTimer, SIGNAL( timeout() ), SLOT( onConnectTimeout() ) ); + + reconnectSleepTimer = new QTimer( this ); + reconnectSleepTimer->setSingleShot( true ); + connect( reconnectSleepTimer, SIGNAL( timeout() ), SLOT( deferredStart() ) ); +} + + +Client_::~Client_() +{ +#ifdef DEBUG_PROTOCOL + qDebug() << this << "~Protocol()"; +#endif +} + + +QAbstractSocket *Client_::buildSocket() +{ +#ifdef DEBUG_PROTOCOL + qDebug() << this << "buildSocket()"; +#endif + return new QTcpSocket; +} + + +void Client_::deferredStart() +{ +#ifdef DEBUG_PROTOCOL + qDebug() << this << "deferredStart()"; +#endif + if ( protocolRetry == 0 ) { + socket = buildSocket(); + connect( socket, SIGNAL( error(QAbstractSocket::SocketError) ), + SLOT( onSocketError(QAbstractSocket::SocketError) ) ); + connect( socket, SIGNAL( stateChanged(QAbstractSocket::SocketState) ), + SLOT( onSocketStateChanged(QAbstractSocket::SocketState) ) ); + setParent( socket ); + } + + if ( protocolRetry >= maxProtocolRetries ) { + emitError( "Maximum protocol retries has reached" ); + return; + } + + if ( !connectTimeoutTimer->isActive() ) + connectTimeoutTimer->start( connectTimeout ); + + if ( reconnectSleepTimer->isActive() ) + reconnectSleepTimer->stop(); + + switch ( socket->state() ) { + case QAbstractSocket::UnconnectedState: connectSocket(); break; + case QAbstractSocket::ConnectedState: protocolStart(); break; + default:; + } +} + + +void Client_::connectSocket() +{ +#ifdef DEBUG_PROTOCOL + qDebug() << this << "connectSocket()"; +#endif + socket->connectToHost( dstHost, dstPort ); +} + + +void Client_::onConnectTimeout() +{ +#ifdef DEBUG_PROTOCOL + qDebug() << this << "onConnectTimeout()"; +#endif + emitError( "Connect timeout" ); +} + + +void Client_::onSocketStateChanged( QAbstractSocket::SocketState socketState ) +{ +#ifdef DEBUG_PROTOCOL + qDebug() << this << "onSocketStateChanged(" << socketState << ")"; +#endif + if( protocolRetry >= maxProtocolRetries ) { + emitError( "maxProtocolRetries reached" ); + return; + } + + switch( socketState ) { + case QAbstractSocket::ConnectedState: + if( !protocolStarted ) + protocolStart(); + break; + case QAbstractSocket::UnconnectedState: + if( protocolStarted ) + protocolStop(); + reconnectSleepTimer->start( reconnectSleep ); + break; + default:; + } +} + + +void Client_::onSocketError( QAbstractSocket::SocketError socketError ) +{ +#ifdef DEBUG_PROTOCOL + qDebug() << this << "onSocketError(" << socketError << ")"; +#endif + switch( socketError ) { + case QAbstractSocket::ConnectionRefusedError: + case QAbstractSocket::SocketTimeoutError: + case QAbstractSocket::RemoteHostClosedError: + break; + case QAbstractSocket::HostNotFoundError: + qWarning() << this << "onSocketError(): host not found" << dstHost << ":" << dstPort; + emitError( QString("Host not found: ") + dstHost + ":" + QString::number(dstPort) ); + break; + case QAbstractSocket::SocketAccessError: + case QAbstractSocket::SocketResourceError: + case QAbstractSocket::DatagramTooLargeError: + case QAbstractSocket::AddressInUseError: + case QAbstractSocket::NetworkError: + case QAbstractSocket::SocketAddressNotAvailableError: + case QAbstractSocket::UnsupportedSocketOperationError: + case QAbstractSocket::ProxyAuthenticationRequiredError: + case QAbstractSocket::UnknownSocketError: + qCritical() << this << "onSocketError(): bad socket error, aborting" << socketError; + emitError( "Bad socket error" ); + break; + default: + qCritical() << this << "onSocketError(): unknown socket error" << socketError; + emitError( "Unknown socket error" ); + } +} + + +void Client_::protocolStart() +{ +#ifdef DEBUG_PROTOCOL + qDebug() << this << "protocolStart()"; +#endif + stopTimers(); + + protocolRetry++; + protocolStarted = true; + + connect( socket, SIGNAL( readyRead() ), this, SLOT( onReadyRead() ) ); + connect( socket, SIGNAL( bytesWritten(qint64) ), this, SLOT( onBytesWritten(qint64) ) ); +} + + +void Client_::protocolStop() +{ +#ifdef DEBUG_PROTOCOL + qDebug() << this << "protocolStop()"; +#endif + protocolStarted = false; + disconnect( socket, SIGNAL( readyRead() ), this, SLOT( onReadyRead() ) ); + disconnect( socket, SIGNAL( bytesWritten(qint64) ), this, SLOT( onBytesWritten(qint64) ) ); +} + + +void Client_::onBytesWritten( qint64 /*bytes*/ ) +{ +#ifdef DEBUG_PROTOCOL + qDebug() << this << "onBytesWritten(" << bytes << ")"; +#endif +} + + +void Client_::onReadyRead() +{ +#ifdef DEBUG_PROTOCOL + qDebug() << this << "onReadyRead()"; +#endif + QByteArray data = socket->readAll(); +#ifdef DEBUG_PROTOCOL + qDebug() << data; +#endif +} + + +void Client_::emitError( const QString &errTxt ) +{ +#ifdef DEBUG_PROTOCOL + qDebug() << this << "emitError(...)"; +#endif + if ( protocolStarted ) + protocolStop(); + else + stopTimers(); + + socket->disconnect( this ); + socket->abort(); + + emit error( errTxt ); +} + + +void Client_::emitDone() +{ +#ifdef DEBUG_PROTOCOL + qDebug() << this << "emitDone()"; +#endif + if ( protocolStarted ) + protocolStop(); + else + stopTimers(); + + socket->disconnect( this ); + + emit done(); +} + + +void Client_::sureWrite( const QByteArray &response ) +{ +#ifdef DEBUG_PROTOCOL + qDebug() << this << "sureWrite(...)" << endl << response; +#endif + qint64 len = response.size(); + const char * ptr = response.data(); + while ( len ) { + qint64 res = socket->write( ptr, len ); + if ( res < 0 ) break; + len -= res; + ptr += res; + } + socket->flush(); +} + + +void Client_::stopTimers() +{ +#ifdef DEBUG_PROTOCOL + qDebug() << this << "stopTimers()"; +#endif + if( connectTimeoutTimer->isActive() ) connectTimeoutTimer->stop(); + if( reconnectSleepTimer->isActive() ) reconnectSleepTimer->stop(); +} diff --git a/3rdparty/qtxmlrpc/client/src/clientprotocol.h b/3rdparty/qtxmlrpc/client/src/clientprotocol.h new file mode 100644 index 00000000..3980d958 --- /dev/null +++ b/3rdparty/qtxmlrpc/client/src/clientprotocol.h @@ -0,0 +1,63 @@ +#ifndef PROTOCOL_H +#define PROTOCOL_H + +#include +#include +#include + +#include + +// #define DEBUG_PROTOCOL + +class Client_ : public QObject +{ + Q_OBJECT +public: + Client_( const QString &dstHost, const quint16 dstPort ); + ~Client_(); + +public slots: + void deferredStart(); + +protected slots: + void onSocketStateChanged( QAbstractSocket::SocketState socketState ); + void onSocketError( QAbstractSocket::SocketError socketError ); + void onConnectTimeout(); + + virtual void onBytesWritten( qint64 bytes ); + virtual void onReadyRead(); + +signals: + void error( const QString &errTxt ); + void done(); + +protected: + QAbstractSocket *socket; + + QString dstHost; + quint16 dstPort; + + int protocolRetry; + int maxProtocolRetries; + bool protocolStarted; + + virtual QAbstractSocket *buildSocket(); + virtual void connectSocket(); + virtual void protocolStart(); + virtual void protocolStop(); + + void sureWrite( const QByteArray &response ); + void emitError( const QString &error ); + void emitDone(); + +private: + void stopTimers(); + + QTimer * connectTimeoutTimer; + QTimer * reconnectSleepTimer; + + static const int connectTimeout = 30000; // msec + static const int reconnectSleep = 1000; // msec +}; + +#endif // PROTOCOL_H diff --git a/3rdparty/qtxmlrpc/client/src/httpclient.cpp b/3rdparty/qtxmlrpc/client/src/httpclient.cpp new file mode 100644 index 00000000..e2e2fc8e --- /dev/null +++ b/3rdparty/qtxmlrpc/client/src/httpclient.cpp @@ -0,0 +1,208 @@ +#include "httpclient.h" + + +HttpClient::HttpClient( const QString &host, const quint16 port, const QString &path, const HttpMethod method ) + : Client_( host, port ), httpState( Waiting ), method( method ) +{ +#ifdef HTTP_CLIENT_DEBUG + qDebug() << this << "HttpClient(" << host << "," << (method==GET?"GET":"POST") << ")"; +#endif + url.setScheme( "http" ); + url.setHost( host ); + url.setPort( port ); + url.setPath( path ); + connect( this, SIGNAL( done() ), SLOT( onProtocolDone() ) ); +} + +HttpClient::~HttpClient() {} + + +void HttpClient::onReadyRead() +{ + switch( httpState ) { + case Sending: +#ifdef HTTP_CLIENT_DEBUG + qDebug() << this << "onReadyRead(), Sending"; +#endif + httpState = ReadingResponseHeader; + case ReadingResponseHeader: +#ifdef HTTP_CLIENT_DEBUG + qDebug() << this << "onReadyRead(), ReadingResponseHeader"; +#endif + // если не дочитан + if( !readResponseHeader() ) + break; + if( responseHeader.statusCode() == 100 ) { + // Continue + // это нам говорят продолжай слать пост, игнорируем, + // опять будем читать хидер + break; + } + else if ( responseHeader.statusCode() == 302 ) { + // Moved temporary + if ( responseHeader.hasKey( "Location" ) ) { + QString location = responseHeader.value( "Location" ); + if ( location.at( 0 ) == '/' ) + url.setPath( location ); + else + url.setUrl( location ); + method = GET; + } + break; + } + httpState = ReadingResponseBody; + case ReadingResponseBody: +#ifdef HTTP_CLIENT_DEBUG + qDebug() << this << "onReadyRead(), ReadingResponseBody"; +#endif + // если не дочитан + if( !readResponseBody() ) + break; + emitDone(); + break; + default: + qCritical() << this << "onReadyRead(): unknown httpState"; + qFatal( "programming error" ); + } +} + + +void HttpClient::protocolStop() +{ + Client_::protocolStop(); + httpState = Waiting; +} + +void HttpClient::protocolStart() +{ + Client_::protocolStart(); + + Q_ASSERT( httpState == Waiting ); + QString path = url.path(); + if ( path.isEmpty() ) + path = "/"; + if ( method == GET && url.hasQuery() ) + path += "?" + url.encodedQuery(); + + QHttpRequestHeader h( method==GET?"GET":"POST", path ); + h.setValue( "Host", QUrl::toAce( url.host() ) ); + h.setValue( "User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648)" ); + h.setValue( "Accept", "*/*" ); + if ( !referer.isEmpty() ) + h.setValue( "Referer", referer ); + + QList cookieList = cookieJar.cookiesForUrl( url ); + foreach ( QNetworkCookie nc, cookieList ) { + QByteArray cookieNameVal; + cookieNameVal.append( nc.name() ); + cookieNameVal.append( "=" ); + cookieNameVal.append( nc.value() ); + h.addValue( "Cookie", cookieNameVal ); + } + + if ( method == POST ) { + h.setValue( "Content-Type", "application/x-www-form-urlencoded" ); + h.setValue( "Content-Length", QString::number( postData.length() ) ); + } + + QByteArray requestHeader( h.toString().toLatin1() ); + if ( method == POST ) + requestHeader.append( postData ); + +#ifdef TRACE_HTTP + qDebug() << "--- request header ---" << endl << requestHeader; +#endif + + sureWrite( requestHeader ); + + httpState = Sending; + responseHeaderData.clear(); + responseBodyData.clear(); +} + + +bool HttpClient::readResponseHeader() +{ +#ifdef HTTP_CLIENT_DEBUG + qDebug() << this << "HttpClient::readResponseHeader()"; +#endif + bool end = false; + QByteArray tmp; + QByteArray rn( "\r\n", 2 ), n( "\n",1 ); + while ( !end && socket->canReadLine() ) { + tmp = socket->readLine(); + if ( tmp == rn || tmp == n || tmp.isEmpty() ) + end = true; + else + responseHeaderData += tmp; + } + + if( !end ) + return false; + responseHeader = QHttpResponseHeader( QString(responseHeaderData) ); +#ifdef TRACE_HTTP + qDebug() << "--- response header ---" << endl << responseHeader.toString(); +#endif + if( responseHeader.isValid() ) { + if ( responseHeader.hasKey( "Set-Cookie" ) ) { + QByteArray cba; + QList > keys = responseHeader.values(); + QPair p; + foreach( p, keys ) { + if ( p.first == "Set-Cookie" ) { + cba.append( p.second ); + cba.append( "\n" ); + } + } + QList cookieList = QNetworkCookie::parseCookies( cba ); + cookieJar.setCookiesFromUrl( cookieList, url ); + } + return true; + } + + qWarning() << this << "readResponseHeader(): invalid responseHeader"; + emitError( "Invalid response header" ); + return false; +} + +bool HttpClient::readResponseBody() +{ + if ( responseHeader.hasContentLength() ) + return readContentLength(); + else if ( responseHeader.value( "Connection" ) == "close" ) { + responseBodyData += socket->readAll(); + return false; + } + else { + QByteArray data = socket->readAll(); + qCritical() << this << "XmlRpcClient::readResponseBody():" + << "unknown content read method" << endl + << responseHeader.toString() << endl; + emitError( "Unknown content read method" ); + } + + return false; +} + +bool HttpClient::readContentLength() +{ + qint64 l = (qint64)responseHeader.contentLength(); + qint64 n = qMin( socket->bytesAvailable(), l - responseBodyData.size() ); + QByteArray readed( socket->read(n) ); + responseBodyData += readed; +#ifdef HTTP_CLIENT_DEBUG + qDebug() << this << "readContentLength(), left:" << (l - responseBodyData.length() ); +#endif + return responseBodyData.length() == l; +} + + +void HttpClient::onProtocolDone() +{ +#ifdef HTTP_CLIENT_DEBUG + qDebug() << this << "onProtocolDone()"; +#endif + emit dataRecieved(); + emit dataReady( responseBodyData ); +} + diff --git a/3rdparty/qtxmlrpc/client/src/httpclient.h b/3rdparty/qtxmlrpc/client/src/httpclient.h new file mode 100644 index 00000000..a9bc9853 --- /dev/null +++ b/3rdparty/qtxmlrpc/client/src/httpclient.h @@ -0,0 +1,66 @@ +#ifndef HTTPCLIENT_H +#define HTTPCLIENT_H + +#include "clientprotocol.h" + +#include +#include +#include +#include +#include + +#include +#include + +//#define HTTP_CLIENT_DEBUG +//#define TRACE_HTTP + + +class HttpClient : public Client_ +{ + Q_OBJECT +public: + enum HttpMethod { GET, POST }; + + HttpClient( const QString &host, const quint16 port = 80, const QString &path = "/", const HttpMethod method = GET ); + ~HttpClient(); + + inline void setPostData( const QByteArray &ba ) { postData = ba; } + inline void setReferer( const QString &value ) { referer = value; } + +signals: + void dataRecieved(); + void dataReady( const QByteArray &data ); + +protected slots: + void onReadyRead(); + void onProtocolDone(); + +protected: + void protocolStop(); + void protocolStart(); + +private: + enum HttpState { Waiting, Sending, ReadingResponseHeader, ReadingResponseBody } httpState; + + bool readResponseHeader(); + bool readResponseBody(); + bool readChunked(); + bool readContentLength(); + + QUrl url; + HttpMethod method; + QByteArray postData; + QString referer; + QNetworkCookieJar cookieJar; + + QHttpResponseHeader responseHeader; + QByteArray responseHeaderData; + QByteArray responseBodyData; + + qint64 chunkedSize; + + static const int requestTimeout = 60000; // msecs +}; + +#endif // HTTPCLIENT_H diff --git a/3rdparty/qtxmlrpc/client/src/httpsclient.cpp b/3rdparty/qtxmlrpc/client/src/httpsclient.cpp new file mode 100644 index 00000000..97d21409 --- /dev/null +++ b/3rdparty/qtxmlrpc/client/src/httpsclient.cpp @@ -0,0 +1,78 @@ +#include "httpsclient.h" + + +SslParams_::SslParams_( const QString & certFile, const QString & keyFile, + const QByteArray &passwd, QObject * parent ) +: QObject( parent ) +{ + if ( !certFile.isEmpty() ) { + QFile fc( certFile, this ); + fc.open( QFile::ReadOnly ); + certificate = QSslCertificate( fc.readAll() ); + fc.close(); + } + + if ( !keyFile.isEmpty() ) { + QFile fk( keyFile, this ); + fk.open( QFile::ReadOnly ); + privateKey = QSslKey( fk.readAll(), QSsl::Rsa, QSsl::Pem, QSsl::PrivateKey, passwd ); + fk.close(); + } +} + + +HttpsClient::HttpsClient( const QString &host, const quint16 port, const QString &path, + const HttpClient::HttpMethod method, + const QString &cert, const QString &key, const QByteArray &passwd ) +: HttpClient( host, port, path, method ), ssl( cert, key, passwd, this ) +{ +} + + +HttpsClient::~HttpsClient() +{ +} + + +QAbstractSocket *HttpsClient::buildSocket() +{ + QSslSocket *socket = new QSslSocket; + if ( !ssl.certificate.isNull() ) + socket->setLocalCertificate( ssl.certificate ); + if ( !ssl.privateKey.isNull() ) + socket->setPrivateKey( ssl.privateKey ); + + connect( socket, SIGNAL( encrypted() ), this, SLOT( onEncryptedConnection() ) ); + connect( socket, SIGNAL( sslErrors(QList) ), this, SLOT( onSslErrors( QList ) ) ); + + return socket; +} + + +void HttpsClient::onEncryptedConnection() +{ +#ifdef HTTPS_CLIENT_DEBUG + qDebug() << this << "HttpsClient::onEncryptedConnection()"; +#endif + protocolStart(); +} + + +void HttpsClient::connectSocket() +{ + QSslSocket *socketEnc = qobject_cast( socket ); + socketEnc->connectToHostEncrypted( dstHost, dstPort ); +} + + +void HttpsClient::protocolStart() +{ + if ( qobject_cast( socket )->isEncrypted() ) + HttpClient::protocolStart(); +} + + +void HttpsClient::onSslErrors( const QList & ) +{ + qobject_cast( socket )->ignoreSslErrors(); +} diff --git a/3rdparty/qtxmlrpc/client/src/httpsclient.h b/3rdparty/qtxmlrpc/client/src/httpsclient.h new file mode 100644 index 00000000..49a37364 --- /dev/null +++ b/3rdparty/qtxmlrpc/client/src/httpsclient.h @@ -0,0 +1,51 @@ +#ifndef HTTPSCLIENT_H +#define HTTPSCLIENT_H + +#include "httpclient.h" + +#include +#include +#include +#include +#include +#include +#include + +// #define HTTPS_CLIENT_DEBUG + +class SslParams_ : public QObject +{ + Q_OBJECT + +public: + SslParams_( const QString & certFile = "", const QString & keyFile = "", + const QByteArray &passwd = QByteArray(), QObject * parent = 0 ); + + QSslCertificate certificate; + QSslKey privateKey; +}; + + +class HttpsClient : public HttpClient +{ + Q_OBJECT +public: + HttpsClient( const QString &host, const quint16 port = 443, const QString &path = "/", + const HttpClient::HttpMethod method = HttpClient::GET, + const QString &cert = "", const QString &key = "", const QByteArray &passwd = QByteArray() ); + ~HttpsClient(); + +protected: + QAbstractSocket *buildSocket(); + void connectSocket(); + void protocolStart(); + +private: + SslParams_ ssl; + +private slots: + void onEncryptedConnection(); + void onSslErrors(const QList &errors); +}; + +#endif // HTTPSCLIENT_H diff --git a/3rdparty/qtxmlrpc/client/src/xmlrpcclient.cpp b/3rdparty/qtxmlrpc/client/src/xmlrpcclient.cpp new file mode 100644 index 00000000..8a9af038 --- /dev/null +++ b/3rdparty/qtxmlrpc/client/src/xmlrpcclient.cpp @@ -0,0 +1,24 @@ +#include "xmlrpcclient.h" +#include "xmlrpcconv.h" + +XmlRpcClient::XmlRpcClient( const QString &host, const quint16 port ) + : HttpClient( host, port, "/RPC2", HttpClient::POST ) +{ +} + + +void XmlRpcClient::execute( const QString &method, const QVariantList ¶ms ) +{ + setPostData( toXmlRpcRequest( method, params ) ); + connect( this, SIGNAL( dataReady( QByteArray ) ), SLOT(onDataReady( QByteArray ) ) ); + deferredStart(); +} + +void XmlRpcClient::onDataReady( const QByteArray &data ) +{ + QString err; + QVariant response = fromXmlRpcResponse( data, err ); + // TODO fault + emit dataReady( response ); +} + diff --git a/3rdparty/qtxmlrpc/client/src/xmlrpcclient.h b/3rdparty/qtxmlrpc/client/src/xmlrpcclient.h new file mode 100644 index 00000000..288177a3 --- /dev/null +++ b/3rdparty/qtxmlrpc/client/src/xmlrpcclient.h @@ -0,0 +1,28 @@ +#ifndef XMLRPCCLIENT_H +#define XMLRPCCLIENT_H + +#include "httpclient.h" +#include +#include +#include +#include +#include + +class XmlRpcClient : public HttpClient +{ + Q_OBJECT +public: + XmlRpcClient( const QString &host, + const quint16 port ); + + void execute( const QString &method, + const QVariantList ¶ms ); + +signals: + void dataReady( const QVariant &data ); + +private slots: + void onDataReady( const QByteArray &data ); +}; + +#endif // XMLRPCCLIENT_H diff --git a/3rdparty/qtxmlrpc/client/src/xmlrpcconv.cpp b/3rdparty/qtxmlrpc/client/src/xmlrpcconv.cpp new file mode 100644 index 00000000..808d2b11 --- /dev/null +++ b/3rdparty/qtxmlrpc/client/src/xmlrpcconv.cpp @@ -0,0 +1,333 @@ +#include +#include +#include +#include +#include +#include + +#include "xmlrpcconv.h" + +#define XMLRPC_WITHSPACES + +// QVariant to xml conversions +// use QByteArray & reference, becouse it is faster, then return QByteArray +static void toXmlRpcValue( const int spaces, const QVariant & child, QByteArray & b ); +static void toXmlRpcStruct( const int spaces, const QVariantMap & child, QByteArray & b ); +static void toXmlRpcArray( const int spaces, const QVariantList & child, QByteArray & b ); + +// xml to QVariant conversions +static QVariant parseXmlRpcValue( const QDomElement & e, QString& err ); +static QVariant parseXmlRpcStruct( const QDomElement & e, QString& err ); +static QVariant parseXmlRpcArray( const QDomElement & e, QString& err ); + + +QVariant fromXmlRpcResponse( const QString d, QString &err ) +{ + QVariant res = QVariant::Invalid; + + QDomDocument doc; + if ( doc.setContent( d, &err ) ) { + + QDomElement methodResponse = doc.firstChildElement("methodResponse"); + if ( methodResponse.isNull() ) + err = "Element 'methodResponse' is absent in response"; + else { + QDomElement result = methodResponse.firstChildElement(); + if ( result.isNull() ) { + err = "Element 'params' is absent in response"; + return QVariant::Invalid; + } + else if ( result.tagName() == "params" ) { + QDomElement param = result.firstChild().firstChild().toElement(); + res = parseXmlRpcValue( param, err ); + } + else { + err = result.text(); + } + } + } + return res; +} + +QByteArray toXmlRpcRequest( const QString m, const QList& l ) +{ +#ifdef XMLRPC_WITHSPACES + QByteArray r( "\n" ); +#else + QByteArray r( "" ); +#endif + +#ifdef XMLRPC_WITHSPACES + r.append( "\n " ); + r.append( m ); + r.append( "" ); +#else + r.append( "" ); + r.append( m ); + r.append( "" ); +#endif + +#ifdef XMLRPC_WITHSPACES + r.append( "\n " ); +#else + r.append( "" ); +#endif + for ( int i = 0; i < l.size(); i++ ) + { +#ifdef XMLRPC_WITHSPACES + r.append( "\n " ); +#else + r.append( "" ); +#endif + toXmlRpcValue( 6, l.at(i), r ); +#ifdef XMLRPC_WITHSPACES + r.append( "\n " ); +#else + r.append( "" ); +#endif + } + +#ifdef XMLRPC_WITHSPACES + r.append( "\n " ); +#else + r.append( "" ); +#endif + +#ifdef XMLRPC_WITHSPACES + r.append( "\n" ); +#else + r.append( "" ); +#endif + + return r; +} + +static void toXmlRpcArray( const int spaces, const QVariantList & child, QByteArray & b ) +{ +#ifdef DEBUG_XMLRPC + qDebug() << "toXmlRpcArray()"; +#endif + + QListIterator< QVariant > i(child); + + while( i.hasNext() ) + toXmlRpcValue( spaces + 2, i.next(), b ); +} + + +static void toXmlRpcStruct( const int spaces, const QVariantMap & child, QByteArray & b ) +{ +#ifdef DEBUG_XMLRPC + qDebug() << "toXmlRpcStruct()"; +#endif + + QMapIterator< QString, QVariant > i(child); + + while( i.hasNext() ) { + i.next(); +#ifdef XMLRPC_WITHSPACES + b.append( '\n' ); + b.append( QByteArray(spaces, ' ') ); +#endif + b.append( "" ); +#ifdef XMLRPC_WITHSPACES + b.append( '\n' ); + b.append( QByteArray(spaces + 2, ' ') ); +#endif + b.append( "" + i.key() + "" ); + toXmlRpcValue( spaces + 2, i.value(), b ); +#ifdef XMLRPC_WITHSPACES + b.append( '\n' ); + b.append( QByteArray(spaces, ' ') ); +#endif + b.append( "" ); + } +} + + +static void toXmlRpcValue( const int spaces, const QVariant & child, QByteArray & b ) +{ +#ifdef DEBUG_XMLRPC + qDebug() << "toXmlRpcValue()"; +#endif + switch( child.type() ) { + case QVariant::Int: +#ifdef XMLRPC_WITHSPACES + b.append( '\n' ); + b.append( QByteArray(spaces, ' ') ); +#endif + b.append( "" + QString::number(child.toInt()) + "" ); + break; + case QVariant::Bool: +#ifdef XMLRPC_WITHSPACES + b.append( '\n' ); + b.append( QByteArray(spaces, ' ') ); +#endif + b.append( QString("") + (child.toBool() ? "1" : "0") + "" ); + break; + case QVariant::String: +#ifdef XMLRPC_WITHSPACES + b.append( '\n' ); + b.append( QByteArray(spaces, ' ') ); +#endif + b.append( "" + child.toString() + "" ); + break; + case QVariant::Double: +#ifdef XMLRPC_WITHSPACES + b.append( '\n' ); + b.append( QByteArray(spaces, ' ') ); +#endif + b.append( "" + QString::number(child.toDouble()) + "" ); + break; + case QVariant::DateTime: +#ifdef XMLRPC_WITHSPACES + b.append( '\n' ); + b.append( QByteArray(spaces, ' ') ); +#endif + b.append( "" + child.toDateTime().toString("yyyyMMddTHH:mm:ss") + + "" ); + break; + case QVariant::ByteArray: +#ifdef XMLRPC_WITHSPACES + b.append( '\n' ); + b.append( QByteArray(spaces, ' ') ); +#endif + b.append( "" + child.toByteArray().toBase64() + "" ); + break; + case QVariant::List: +#ifdef XMLRPC_WITHSPACES + b.append( '\n' ); + b.append( QByteArray(spaces, ' ') ); +#endif + b.append( "" ); + toXmlRpcArray( spaces + 2, child.toList(), b ); +#ifdef XMLRPC_WITHSPACES + b.append( '\n' ); + b.append( QByteArray(spaces, ' ') ); +#endif + b.append( "" ); + break; + case QVariant::Map: +#ifdef XMLRPC_WITHSPACES + b.append( '\n' ); + b.append( QByteArray(spaces, ' ') ); +#endif + b.append( "" ); + toXmlRpcStruct( spaces + 2, child.toMap(), b ); +#ifdef XMLRPC_WITHSPACES + b.append( '\n' ); + b.append( QByteArray(spaces, ' ') ); +#endif + b.append( "" ); + break; + default: + qCritical() << "toXmlRpcValue(): unknown return xmlrpc type" + << child.typeName() << endl << child; + qFatal("programming error"); + } +} + +static QVariant parseXmlRpcValue( const QDomElement & e, QString& err ) +{ +#ifdef DEBUG_XMLRPC + qDebug() << "parseXmlRpcValue():" << e.tagName(); +#endif + QVariant v = QVariant::Invalid; + + QString tagName = e.tagName(); + if( tagName != "value" ) { + err = "first param tag is not value"; + return v; + } + + QDomElement t = e.firstChild().toElement(); + QString type = t.tagName(); + if( type == "int" || type == "i4" ) { + bool ok; + v = t.firstChild().toText().data().toInt( &ok ); + if( !ok ) + err = "Can't convert int text '" + t.firstChild().toText().data() + "' to number"; + } + else if( type == "boolean" ) + v = t.firstChild().toText().data() == "1" ? true : false; + else if( type == "string" ) + v = t.firstChild().toText().data(); + else if( type == "double" ) { + bool ok; + v = t.firstChild().toText().data().toDouble( &ok ); + if( !ok ) + err = "Can't convert int text '" + t.firstChild().toText().data() + "' to number"; + } + else if( type == "dateTime.iso8601" ) + v = QDateTime::fromString( t.firstChild().toText().data(), "yyyyMMddTHH:mm:ss" ); + else if( type == "base64" ) + v = QByteArray::fromBase64( t.firstChild().toText().data().toLatin1() ); + else if ( type == "array" ) + v = parseXmlRpcArray( t.firstChild().toElement(), err ); + else if ( type == "struct" ) + v = parseXmlRpcStruct( t.firstChild().toElement() , err ); + else if ( type.length() == 0 ) + v = e.toElement().firstChild().toText().data(); + else + err = "unknown type: '" + type + "'"; + + return v; +} + + +static QVariant parseXmlRpcStruct( const QDomElement &e, QString &err ) +{ +#ifdef DEBUG_XMLRPC + qDebug() << "parseXmlRpcStruct():" << e.tagName(); +#endif + QVariantMap r; + + QDomElement t = e; + + while( !t.isNull() ) { + if( t.tagName() != "member" ) { + err = "no member tag in struct, tag " + e.tagName(); + return r; + } + QDomElement s = t.firstChild().toElement(); + if( s.tagName() != "name" ) { + err = "no name tag in member struct, tag " + s.tagName(); + return r; + } + // set map value + r[ s.firstChild().toText().data() ] = parseXmlRpcValue( s.nextSibling().toElement(), err ); + + if( !err.isEmpty() ) + return r; + + t = t.nextSibling().toElement(); + } + + return r; +} + + +static QVariant parseXmlRpcArray( const QDomElement &e, QString &err ) +{ +#ifdef DEBUG_XMLRPC + qDebug() << "parseXmlRpcArray():" << e.tagName(); +#endif + QVariantList r; + if( e.tagName() != "data" ) { + err = "no data tag in array, tag " + e.tagName(); + return r; + } + + QDomElement t = e.firstChild().toElement(); + + while( !t.isNull() ) { + r.append( parseXmlRpcValue(t,err) ); + if( !err.isEmpty() ) + return r; + + t = t.nextSibling().toElement(); + } + + return r; +} + diff --git a/3rdparty/qtxmlrpc/client/src/xmlrpcconv.h b/3rdparty/qtxmlrpc/client/src/xmlrpcconv.h new file mode 100644 index 00000000..d8ca5717 --- /dev/null +++ b/3rdparty/qtxmlrpc/client/src/xmlrpcconv.h @@ -0,0 +1,21 @@ +#ifndef XMLRPCCONV_H +#define XMLRPCCONV_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QByteArray toXmlRpcRequest( const QString m, const QList& l ); +QVariant fromXmlRpcResponse( const QString d, QString &err ); + +#endif + diff --git a/3rdparty/qtxmlrpc/server/server.pri b/3rdparty/qtxmlrpc/server/server.pri new file mode 100644 index 00000000..20791766 --- /dev/null +++ b/3rdparty/qtxmlrpc/server/server.pri @@ -0,0 +1,4 @@ +QT *= network xml + +HEADERS += $$PWD/src/protocol.h $$PWD/src/xmlrpcserver.h +SOURCES += $$PWD/src/protocol.cpp $$PWD/src/xmlrpcserver.cpp diff --git a/3rdparty/qtxmlrpc/server/src/protocol.cpp b/3rdparty/qtxmlrpc/server/src/protocol.cpp new file mode 100644 index 00000000..11821a8e --- /dev/null +++ b/3rdparty/qtxmlrpc/server/src/protocol.cpp @@ -0,0 +1,391 @@ +#include "protocol.h" + +QString ClientProtocol::unconnectedNoDstHost = QString("socket unconnected, no dstHost"); + +ClientProtocol::ClientProtocol( QTcpSocket *parent, + const QString & _dstHost, + const quint16 _dstPort ) + : QObject(parent), socket( parent ), + dstHost( _dstHost ), dstPort( _dstPort ), + protocolRetry( 0 ), maxProtocolRetries( 3 ), protocolStarted( false ), + disconnectFromSocketOnDoneFlag( false ) +{ + Q_ASSERT( socket ); + + // check, if no dstHost, socket must be in the ConnectedState + if( dstHost.isEmpty() && + socket->state() != QAbstractSocket::ConnectedState ) { + qCritical() << this << "constructor, dstHost.isEmpty(), but socket state" + << socket->state(); + qFatal( "you must check socket state, before creating protocol" ); + } + connectTimeoutTimer = new QTimer( this ); + connectTimeoutTimer->setSingleShot( true ); + connect( connectTimeoutTimer, SIGNAL( timeout() ), + SLOT( slotSocketConnectTimeout() ) ); + reconnectSleepTimer = new QTimer( this ); + reconnectSleepTimer->setSingleShot( true ); + connect( reconnectSleepTimer, SIGNAL( timeout() ), + SLOT( deferredStart() ) ); + + // connect socket signals to my slots + connect( socket, SIGNAL( error(QAbstractSocket::SocketError) ), + SLOT( slotSocketError(QAbstractSocket::SocketError) ) ); + connect( socket, SIGNAL( stateChanged(QAbstractSocket::SocketState) ), + SLOT( slotSocketStateChanged(QAbstractSocket::SocketState) ) ); +} + + +void ClientProtocol::slotSocketStateChanged ( QAbstractSocket::SocketState socketState ) +{ +#ifdef DEBUG_PROTOCOL + qDebug() << this << "slotSocketStateChanged(" << socketState << ")"; +#endif + // Не слишком ли много мы ходили в protocolStart? + if( protocolRetry >= maxProtocolRetries ) { + emitError( "maxProtocolRetries reached" ); + return; + } + + switch( socketState ) { + case QAbstractSocket::ConnectedState: + // уже соединены, запускаем протокол +#ifdef DEBUG_PROTOCOL + qDebug() << this << "slotSocketStateChanged((): connected!" + << "protocolRetry" << protocolRetry; +#endif + protocolStart(); + break; + case QAbstractSocket::UnconnectedState: + if( protocolStarted ) + protocolStop(); + + // can reconnect? + if( dstHost.size() ) { +#ifdef DEBUG_PROTOCOL + qDebug() << this + << "slotSocketStateChanged(): starting reconnect timer..."; +#endif + reconnectSleepTimer->start( reconnectSleep ); + } + else + emitError( unconnectedNoDstHost ); + break; + default: + ; // do nothing + } +} + + +void ClientProtocol::slotSocketError( QAbstractSocket::SocketError socketError ) +{ +#ifdef DEBUG_PROTOCOL + qDebug() << this << "slotSocketError(" << socketError << ")"; +#endif + switch( socketError ) { + case QAbstractSocket::ConnectionRefusedError: + case QAbstractSocket::SocketTimeoutError: + case QAbstractSocket::RemoteHostClosedError: + // ну чо поделать, как только socketState + // поменяется в UnconnectedState, начнется новый deferredStart + break; + case QAbstractSocket::HostNotFoundError: + qWarning() << this << "slotSocketError(): host not found" + << dstHost << ":" << dstPort; + emitError( QString("host not found: ") + + dstHost + ":" + QString::number(dstPort) ); + break; + case QAbstractSocket::SocketAccessError: + case QAbstractSocket::SocketResourceError: + case QAbstractSocket::DatagramTooLargeError: + case QAbstractSocket::AddressInUseError: + case QAbstractSocket::NetworkError: + case QAbstractSocket::SocketAddressNotAvailableError: + case QAbstractSocket::UnsupportedSocketOperationError: + case QAbstractSocket::ProxyAuthenticationRequiredError: + case QAbstractSocket::UnknownSocketError: + qCritical() << this << "slotSocketError(): bad socket error, aborting" + << socketError; + emitError( "bad socket error" ); + break; + default: + qCritical() << this << "slotSocketError(): unknown socket error" + << socketError; + emitError( "Unknown socket error" ); + } +} + + +void ClientProtocol::slotSocketConnectTimeout() +{ +#ifdef DEBUG_PROTOCOL + qDebug() << this << "slotSocketConnectTimeout()"; +#endif + emitError( "socket connect timeout" ); +} + + +void ClientProtocol::deferredStart() +{ +#ifdef DEBUG_PROTOCOL + qDebug() << this << "deferredStart()"; +#endif + // Не слишком ли много мы ходили в protocolStart? + if( protocolRetry >= maxProtocolRetries ) { + emitError( "maxProtocolRetries reached" ); + return; + } + + // Не запущен timeoutTimer? + if( ! connectTimeoutTimer->isActive() ) + connectTimeoutTimer->start( connectTimeout ); + + // запущен reconnectSleepTimer? + if( reconnectSleepTimer->isActive() ) + reconnectSleepTimer->stop(); + + switch( socket->state() ) { + case QAbstractSocket::UnconnectedState: + // еще никуда не коннектится, начнем :) +#ifdef DEBUG_PROTOCOL + qDebug() << this << "deferredStart(): socket->connectToHost(" + << dstHost << "," << dstPort << ")"; +#endif + if( dstHost.size() ) + connectSocket(); + else + emitError( "dstHost is empty and socket unconnected" ); + break; + case QAbstractSocket::ConnectedState: + // уже соединены, запускаем протокол +#ifdef DEBUG_PROTOCOL + qDebug() << this << "deferredStart(): connected! protocolRetry" + << protocolRetry; +#endif + protocolStart(); + break; + default: + ; // do nothing + } +} + + +void ClientProtocol::connectSocket() +{ +#ifdef DEBUG_PROTOCOL + qDebug() << this << "ClientProtocol::connectSocket()"; +#endif + + Q_ASSERT( dstHost.size() ); + socket->connectToHost( dstHost, dstPort ); +} + + +#ifdef DEBUG_PROTOCOL +void ClientProtocol::slotBytesWritten ( qint64 bytes ) +{ + qDebug() << this << "ClientProtocol::slotBytesWritten(" << bytes << ")"; +#else +void ClientProtocol::slotBytesWritten ( qint64 ) +{ +#endif +} + + +void ClientProtocol::slotReadyRead() +{ + // default implementation just read all data + QByteArray data = socket->readAll(); +#ifdef DEBUG_PROTOCOL + qDebug() << this << "ClientProtocol::slotReadyRead(): " << data; +#endif +} + + +void ClientProtocol::emitError( const QString & errTxt ) +{ +#ifdef DEBUG_PROTOCOL + qDebug() << this << "emitError(" << errTxt << ")"; +#endif + + if( protocolStarted ) + protocolStop(); + else + stopTimers(); + + // disconnect all signals to me + socket->disconnect( this ); + socket->abort(); + + emit error( errTxt ); +} + + +void ClientProtocol::emitDone() +{ +#ifdef DEBUG_PROTOCOL + qDebug() << this << "emitDone()"; +#endif + + if( protocolStarted ) + protocolStop(); + else + stopTimers(); + + if( disconnectFromSocketOnDoneFlag ) + socket->disconnect( this ); + + emit done(); +} + + +void ClientProtocol::sureWrite( const QByteArray & response ) +{ + qint64 len = response.size(); + const char * ptr = response.data(); + while( len ) { + qint64 res = socket->write( ptr, len ); + if ( res < 0 ) + break; + len -= res; + ptr += res; + } + socket->flush(); +} + + +void ClientProtocol::stopTimers() +{ +#ifdef DEBUG_PROTOCOL + qDebug() << this << "ClientProtocol::stopTimers()"; +#endif + // stop my timers + if( connectTimeoutTimer->isActive() ) + connectTimeoutTimer->stop(); + + if( reconnectSleepTimer->isActive() ) + reconnectSleepTimer->stop(); +} + + +void ClientProtocol::protocolStop() +{ +#ifdef DEBUG_PROTOCOL + qDebug() << this << "ClientProtocol::protocolStop()"; +#endif + protocolStarted = false; + // disconnect socket data signals from protocol handlers + disconnect( socket, SIGNAL( readyRead() ), + this, SLOT( slotReadyRead() ) ); + disconnect( socket, SIGNAL( bytesWritten(qint64) ), + this, SLOT( slotBytesWritten(qint64) ) ); +} + + +void ClientProtocol::protocolStart() +{ +#ifdef DEBUG_PROTOCOL + qDebug() << this << "ClientProtocol::protocolStart()"; +#endif + stopTimers(); + + protocolRetry++; + protocolStarted = true; + // connect socket data signals to protocol handlers + connect( socket, SIGNAL( readyRead() ), + this, SLOT( slotReadyRead() ) ); + connect( socket, SIGNAL( bytesWritten(qint64) ), + this, SLOT( slotBytesWritten(qint64) ) ); + + // noProxyMode? + if( !qstrcmp(metaObject()->className(), "ClientProtocol") ) + emitDone(); +} + + +ClientProtocolWithTimeout::ClientProtocolWithTimeout( QTcpSocket * parent, + const int _protocolTimeout, + const QString & dstHost, + const quint16 dstPort ) + : ClientProtocol( parent, dstHost, dstPort ), + protocolTimeout( _protocolTimeout ) +{ + protocolTimeoutTimer = new QTimer( this ); + protocolTimeoutTimer->setSingleShot( true ); + connect( protocolTimeoutTimer, SIGNAL( timeout() ), + SLOT( slotProtocolTimeout() ) ); +} + + +void ClientProtocolWithTimeout::protocolStop() +{ +#ifdef DEBUG_PROTOCOL + qDebug() << this << "ClientProtocolWithTimeout::protocolStop():" + << "stop protocol timeout timer"; +#endif + ClientProtocol::protocolStop(); + + if( protocolTimeoutTimer->isActive() ) + protocolTimeoutTimer->stop(); +} + + +void ClientProtocolWithTimeout::protocolStart() +{ +#ifdef DEBUG_PROTOCOL + qDebug() << this << "ClientProtocolWithTimeout::protocolStart():" + << "start protocol timeout timer" + << protocolTimeout / 1000 << "secs"; +#endif + ClientProtocol::protocolStart(); + + protocolTimeoutTimer->start( protocolTimeout ); +} + + +void ClientProtocolWithTimeout::slotProtocolTimeout() +{ +#ifdef DEBUG_PROTOCOL + qDebug() << this << "ClientProtocolWithTimeout::slotProtocolTimeout()"; +#endif + if( !objectName().length() ) { + qCritical() << this << "ClientProtocolWithTimeout::slotProtocolTimeout():" + << "protocol name empty!" + << "Please setObjectName() for your protocols!"; + qFatal( "programming error" ); + } + emitError( objectName() + " protocol timeout" ); +} + + +#ifdef DEBUG_PROTOCOL +void ClientProtocolWithTimeout::slotBytesWritten( qint64 bytes ) +{ + qDebug() << this << "ClientProtocolWithTimeout::slotBytesWritten(" + << bytes << "): restart protocol timeout timer" + << protocolTimeout / 1000 << "secs"; +#else +void ClientProtocolWithTimeout::slotBytesWritten( qint64 ) +{ +#endif + Q_ASSERT( protocolStarted ); + Q_ASSERT( protocolTimeoutTimer->isActive() ); + + // restart timeout timer. + protocolTimeoutTimer->start( protocolTimeout ); +} + + +void ClientProtocolWithTimeout::slotReadyRead() +{ +#ifdef DEBUG_PROTOCOL + qDebug() << this << "ClientProtocolWithTimeout::slotReadyRead():" + << "restart protocol timeout timer" + << protocolTimeout / 1000 << "secs"; +#endif + Q_ASSERT( protocolStarted ); + Q_ASSERT( protocolTimeoutTimer->isActive() ); + + // restart timeout timer. + protocolTimeoutTimer->start( protocolTimeout ); +} diff --git a/3rdparty/qtxmlrpc/server/src/protocol.h b/3rdparty/qtxmlrpc/server/src/protocol.h new file mode 100644 index 00000000..8aa212ef --- /dev/null +++ b/3rdparty/qtxmlrpc/server/src/protocol.h @@ -0,0 +1,120 @@ +#ifndef PROTOCOL_H +#define PROTOCOL_H + +#include +#include +#include +#include +#include + +// #define DEBUG_PROTOCOL + +class QTcpSocket; +class ClientProtocol : public QObject +{ +Q_OBJECT +public: + // parent - должен быть ребенком QTcpSocket, + // от и есть Socket, с которой работаем. Если кто-то удаляет + // Socket, она удалит нас как детей, таким образом протоколы не будут + // работать с удаленной Socket + // + // если _dstHost == QString::null, то для работы протокола необходим + // сконнекченный сокет. Иначе выбрасываем error. + ClientProtocol( QTcpSocket * parent, + const QString & _dstHost = QString::null, + const quint16 _dstPort = 0 ); +#ifdef DEBUG_PROTOCOL + ~ClientProtocol() + { + qDebug() << this << "destructor"; + } +#endif + + void disconnectFromSocketOnDone() { disconnectFromSocketOnDoneFlag = true; } + QTcpSocket * getSocket() { return socket; } + static QString unconnectedNoDstHost; +public slots: + // if socket connected, call protocolStart(), slotReadyRead() if bytes available + // otherwise connects and do same thing. + void deferredStart(); +protected slots: + void slotSocketStateChanged ( QAbstractSocket::SocketState socketState ); + void slotSocketError( QAbstractSocket::SocketError socketError ); + + // to be overloaded in child protocol, no need to call this implementations + virtual void slotBytesWritten ( qint64 bytes ); + virtual void slotReadyRead(); + void slotSocketConnectTimeout(); +signals: + void error( const QString& errTxt ); + void done(); +protected: + // socket == parent, сделано чтобы не кастить каждый раз парента + QTcpSocket * socket; + QString dstHost; + quint16 dstPort; + int protocolRetry; + int maxProtocolRetries; + bool protocolStarted; + bool disconnectFromSocketOnDoneFlag; + + // Cыны обязаны вызвать родителей первой строкой. + virtual void protocolStop(); + // Может вызываться maxProtocolRetries раз, если в процессе + // работы происходит Disconnect, либо 1 раз, если дали сконнекченный socket + virtual void protocolStart(); + // если дают QSSLSocket, можно перекрыть + // обычное поведение тут (родителя вызывать уже не нужно) + // основная задача socket->connectToHost.. + virtual void connectSocket(); + // stop() and emit error + void emitError( const QString & errTxt ); + // disconnect my slots, stop timers, emit done() + void emitDone(); + // emitError, if can't write a bit + void sureWrite( const QByteArray & response ); +private: + void stopTimers(); + + QTimer * connectTimeoutTimer; + QTimer * reconnectSleepTimer; + + static const int connectTimeout = 30000; // msec + static const int reconnectSleep = 1000; // msec +}; + + +// Протокол, который выпадает в emitError("protocol timeout"), +// если работает дольше, чем указали при конструировании +class ClientProtocolWithTimeout : public ClientProtocol +{ +Q_OBJECT +public: + ClientProtocolWithTimeout( QTcpSocket * parent, + const int _protocolTimeout, + const QString & dstHost = QString::null, + const quint16 dstPort = 0 ); +#ifdef DEBUG_PROTOCOL + ~ClientProtocolWithTimeout() + { + qDebug() << this << "destructor"; + } +#endif +protected slots: + void slotProtocolTimeout(); + // restart timer, if protocolStated + void slotBytesWritten ( qint64 bytes ); + // restart timer, if protocolStated + void slotReadyRead(); + +protected: + void protocolStop(); + void protocolStart(); + + int protocolTimeout; + QTimer * protocolTimeoutTimer; +}; + + +#endif diff --git a/3rdparty/qtxmlrpc/server/src/qhttpheader.cpp b/3rdparty/qtxmlrpc/server/src/qhttpheader.cpp new file mode 100644 index 00000000..aaabb184 --- /dev/null +++ b/3rdparty/qtxmlrpc/server/src/qhttpheader.cpp @@ -0,0 +1,273 @@ +/* + Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) + + These were part of the QtNetwork module of the Qt Toolkit. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "config.h" +#include "qhttpheader_p.h" + +using namespace WebKit; + +static QString contentLengthString = QLatin1String("content-length"); +static QString contentTypeString = QLatin1String("content-type"); + +QHttpHeader::QHttpHeader() +{ + setValid(true); +} + +QHttpHeader::QHttpHeader(const QString& str) +{ + setValid(true); + parse(str); +} + +QHttpHeader::~QHttpHeader() +{ +} + +bool QHttpHeader::parse(const QString& str) +{ + QStringList lst; + int pos = str.indexOf(QLatin1Char('\n')); + if (pos > 0 && str.at(pos - 1) == QLatin1Char('\r')) + lst = str.trimmed().split(QLatin1String("\r\n")); + else + lst = str.trimmed().split(QLatin1String("\n")); + lst.removeAll(QString()); + + if (lst.isEmpty()) + return true; + + QStringList lines; + QStringList::Iterator it = lst.begin(); + for (; it != lst.end(); ++it) { + if (!(*it).isEmpty()) { + if ((*it)[0].isSpace()) { + if (!lines.isEmpty()) { + lines.last() += QLatin1Char(' '); + lines.last() += (*it).trimmed(); + } + } else + lines.append((*it)); + } + } + + int number = 0; + for (it = lines.begin(); it != lines.end(); ++it) { + if (!parseLine(*it, number++)) { + setValid(false); + return false; + } + } + return true; +} + +QString QHttpHeader::value(const QString& key) const +{ + QString lowercaseKey = key.toLower(); + QList >::ConstIterator it = m_values.constBegin(); + while (it != m_values.constEnd()) { + if ((*it).first.toLower() == lowercaseKey) + return (*it).second; + ++it; + } + return QString(); +} + +bool QHttpHeader::hasKey(const QString& key) const +{ + QString lowercaseKey = key.toLower(); + QList >::ConstIterator it = m_values.constBegin(); + while (it != m_values.constEnd()) { + if ((*it).first.toLower() == lowercaseKey) + return true; + ++it; + } + return false; +} + +void QHttpHeader::setValue(const QString& key, const QString& value) +{ + QString lowercaseKey = key.toLower(); + QList >::Iterator it = m_values.begin(); + while (it != m_values.end()) { + if ((*it).first.toLower() == lowercaseKey) { + (*it).second = value; + return; + } + ++it; + } + addValue(key, value); +} + +void QHttpHeader::addValue(const QString& key, const QString& value) +{ + m_values.append(qMakePair(key, value)); +} + +bool QHttpHeader::parseLine(const QString& line, int) +{ + int i = line.indexOf(QLatin1Char(':')); + if (i == -1) + return false; + + addValue(line.left(i).trimmed(), line.mid(i + 1).trimmed()); + return true; +} + +QString QHttpHeader::toString() const +{ + if (!isValid()) + return QLatin1String(""); + + QString ret = QLatin1String(""); + + QList >::ConstIterator it = m_values.constBegin(); + while (it != m_values.constEnd()) { + ret += (*it).first + QLatin1String(": ") + (*it).second + QLatin1String("\r\n"); + ++it; + } + return ret; +} + +bool QHttpHeader::hasContentLength() const +{ + return hasKey(contentLengthString); +} + +uint QHttpHeader::contentLength() const +{ + return value(contentLengthString).toUInt(); +} + +void QHttpHeader::setContentLength(int len) +{ + setValue(contentLengthString, QString::number(len)); +} + +bool QHttpHeader::hasContentType() const +{ + return hasKey(contentTypeString); +} + +QString QHttpHeader::contentType() const +{ + QString type = value(contentTypeString); + if (type.isEmpty()) + return QString(); + + int pos = type.indexOf(QLatin1Char(';')); + if (pos == -1) + return type; + + return type.left(pos).trimmed(); +} + +void QHttpHeader::setContentType(const QString &type) +{ + setValue(contentTypeString, type); +} + +QHttpResponseHeader::QHttpResponseHeader(int code, const QString &text, int majorVer, int minorVer) + : QHttpHeader() + , m_statusCode(code) + , m_reasonPhrase(text) + , m_majorVersion(majorVer) + , m_minorVersion(minorVer) +{ +} + +bool QHttpResponseHeader::parseLine(const QString& line, int number) +{ + if (number) + return QHttpHeader::parseLine(line, number); + + QString l = line.simplified(); + if (l.length() < 10) + return false; + + if (l.left(5) == QLatin1String("HTTP/") && l[5].isDigit() && l[6] == QLatin1Char('.') + && l[7].isDigit() && l[8] == QLatin1Char(' ') && l[9].isDigit()) { + m_majorVersion = l[5].toLatin1() - '0'; + m_minorVersion = l[7].toLatin1() - '0'; + + int pos = l.indexOf(QLatin1Char(' '), 9); + if (pos != -1) { + m_reasonPhrase = l.mid(pos + 1); + m_statusCode = l.mid(9, pos - 9).toInt(); + } else { + m_statusCode = l.mid(9).toInt(); + m_reasonPhrase.clear(); + } + } else + return false; + + return true; +} + +QString QHttpResponseHeader::toString() const +{ + static QString ret(QLatin1String("HTTP/%1.%2 %3 %4\r\n%5\r\n")); + return ret.arg(m_majorVersion).arg(m_minorVersion).arg(m_statusCode).arg(m_reasonPhrase).arg(QHttpHeader::toString()); +} + +QHttpRequestHeader::QHttpRequestHeader() + : QHttpHeader() +{ + setValid(false); +} + +QHttpRequestHeader::QHttpRequestHeader(const QString& str) +{ + parse(str); +} + +bool QHttpRequestHeader::parseLine(const QString& line, int number) +{ + if (number) + return QHttpHeader::parseLine(line, number); + + QStringList lst = line.simplified().split(QLatin1String(" ")); + if (lst.count() > 0) { + m_method = lst[0]; + if (lst.count() > 1) { + m_path = lst[1]; + if (lst.count() > 2) { + QString v = lst[2]; + if (v.length() >= 8 && v.left(5) == QLatin1String("HTTP/") + && v[5].isDigit() && v[6] == QLatin1Char('.') && v[7].isDigit()) { + m_majorVersion = v[5].toLatin1() - '0'; + m_minorVersion = v[7].toLatin1() - '0'; + return true; + } + } + } + } + + return false; +} + +QString QHttpRequestHeader::toString() const +{ + static QString first(QLatin1String("%1 %2")); + static QString last(QLatin1String(" HTTP/%3.%4\r\n%5\r\n")); + return first.arg(m_method).arg(m_path) + last.arg(m_majorVersion).arg(m_minorVersion).arg(QHttpHeader::toString()); +} + diff --git a/3rdparty/qtxmlrpc/server/src/qhttpheader_p.h b/3rdparty/qtxmlrpc/server/src/qhttpheader_p.h new file mode 100644 index 00000000..0682952f --- /dev/null +++ b/3rdparty/qtxmlrpc/server/src/qhttpheader_p.h @@ -0,0 +1,112 @@ +/* + Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) + + These were part of the QtNetwork module of the Qt Toolkit. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef qhttpheader_p_h +#define qhttpheader_p_h + +#include +#include +#include + +namespace WebKit { + +class QHttpHeader { +public: + QHttpHeader(); + QHttpHeader(const QString&); + virtual ~QHttpHeader(); + + void setValue(const QString& key, const QString& value); + void addValue(const QString& key, const QString& value); + QString value(const QString& key) const; + bool hasKey(const QString&) const; + + // ### Qt 5: change to qint64 + bool hasContentLength() const; + uint contentLength() const; + void setContentLength(int); + + bool hasContentType() const; + QString contentType() const; + void setContentType(const QString&); + + virtual QString toString() const; + bool isValid() const { return m_valid; } + + virtual int majorVersion() const = 0; + virtual int minorVersion() const = 0; + +protected: + virtual bool parseLine(const QString& line, int number); + bool parse(const QString&); + void setValid(bool v) { m_valid = v; } + +private: + bool m_valid; + QList > m_values; +}; + +class QHttpResponseHeader : public QHttpHeader { +public: + QHttpResponseHeader(int code, const QString& text = QString(), int majorVer = 1, int minorVer = 1); + + int statusCode() const { return m_statusCode; } + QString reasonPhrase() const {return m_reasonPhrase; } + int majorVersion() const { return m_majorVersion; } + int minorVersion() const { return m_minorVersion; } + + QString toString() const; + +protected: + bool parseLine(const QString& line, int number); + +private: + int m_statusCode; + QString m_reasonPhrase; + int m_majorVersion; + int m_minorVersion; +}; + +class QHttpRequestHeader : public QHttpHeader { +public: + QHttpRequestHeader(); + QHttpRequestHeader(const QString&); + + QString method() const { return m_method; } + QString path() const { return m_path; } + int majorVersion() const { return m_majorVersion; } + int minorVersion() const { return m_minorVersion; } + + QString toString() const; + +protected: + bool parseLine(const QString& line, int number); + +private: + QString m_method; + QString m_path; + int m_majorVersion; + int m_minorVersion; +}; + +} + +#endif diff --git a/3rdparty/qtxmlrpc/server/src/xmlrpcserver.cpp b/3rdparty/qtxmlrpc/server/src/xmlrpcserver.cpp new file mode 100644 index 00000000..584b6dc0 --- /dev/null +++ b/3rdparty/qtxmlrpc/server/src/xmlrpcserver.cpp @@ -0,0 +1,1077 @@ +#include +#include +#include +#include +#include +#include +#include + +#include "xmlrpcserver.h" + + +// initialization speed up for createFault() and isFault() +static QString faultCode("faultCode"); +static QString faultString("faultString"); + +// returns default http header for our xmlrpc server +static QHttpResponseHeader xmlRpcResponseHeader( const qint64 contentLength ); +// create xmlrpc response from QVariant +static QByteArray toXmlRpcResponse( const QVariant& v ); + +// QVariant to xml conversions +// use QByteArray & reference, becouse it is faster, then return QByteArray +static void toXmlRpcValue( const int spaces, const QVariant & child, QByteArray & b ); +static void toXmlRpcStruct( const int spaces, const QVariantMap & child, QByteArray & b ); +static void toXmlRpcArray( const int spaces, const QVariantList & child, QByteArray & b ); + +// xml to QVariant conversions +static QVariant parseXmlRpcValue( const QDomElement & e, QString& err ); +static QVariant parseXmlRpcStruct( const QDomElement & e, QString& err ); +static QVariant parseXmlRpcArray( const QDomElement & e, QString& err ); + + +SslParams::SslParams( const QString & certFile, const QString & keyFile, QObject * parent ) + : QObject( parent ) +{ + QFile fc( certFile, this ); + fc.open( QFile::ReadOnly ); + certificate = QSslCertificate( fc.readAll() ); + fc.close(); + + ca << certificate; + + QFile fk( keyFile, this ); + fk.open( QFile::ReadOnly ); + privateKey = QSslKey( fk.readAll(), QSsl::Rsa, QSsl::Pem, QSsl::PrivateKey/*, passwd*/ ); + fk.close(); +} + +inline bool isFault( const QVariant& v ) +{ + if( v.type() != QVariant::Map ) + return false; + + const QVariantMap& m = v.toMap(); + + return m.size() == 2 && + m.contains(faultCode) && m[faultCode].type() == QVariant::Int && + m.contains(faultString) && m[faultString].type() == QVariant::String; +} + + +Protocol::Protocol( QAbstractSocket * parent, const int _timeout ) + : QObject( parent ), timeout( 0 ), timeoutTimerId( 0 ), socket( parent ) +{ +#ifdef DEBUG_PROTOCOL + qDebug() << this << "Protocol(): child of" << socket; +#endif + // check we are only one protocol, working with this socket, at this time + foreach( QObject * o, parent->children() ) + if( o != this && qobject_cast(o) ) { + qCritical() << this << "Protocol(): socket" << parent + << "already have another protocol" << o; + qFatal( "programming error" ); + } + + if( _timeout > 0 ) + setTimeout( _timeout ); +} + + +Protocol::~Protocol() +{ +#ifdef DEBUG_PROTOCOL + qDebug() << this << "~Protocol()"; +#endif +} + + +// timeout restarts +void Protocol::setTimeout( const int _timeout ) +{ +#ifdef DEBUG_PROTOCOL + qDebug() << this << "setTimeout():" << _timeout + << "prev timeout was" << timeout; +#endif + if( timeoutTimerId ) { +#ifdef DEBUG_PROTOCOL + qDebug() << this << "setTimeout(): stopping previous timer"; +#endif + killTimer( timeoutTimerId ); + timeoutTimerId = 0; + } + + if( !(timeout > 0) && _timeout > 0 ) { + // если предыдущий timeout НЕ был больше ноля, а текущий больше, + // значит нужно прицепить сигналы приема/отсылки данных на сокете +#ifdef DEBUG_PROTOCOL + qDebug() << this << "setTimeout(): connect socket signals readyRead() and bytesWritten()"; +#endif + connect( socket, SIGNAL(readyRead()), + this, SLOT(__slotReadyRead()) ); + connect( socket, SIGNAL(bytesWritten(qint64)), + this, SLOT(__slotBytesWritten(qint64)) ); + } + else if( timeout > 0 && !(_timeout > 0) ) { + // новый выключен, старый был включен +#ifdef DEBUG_PROTOCOL + qDebug() << this << "setTimeout(): disconnect socket signals readyRead() and bytesWritten()"; +#endif + disconnect( socket, SIGNAL(readyRead()), + this, SLOT(__slotReadyRead()) ); + disconnect( socket, SIGNAL(bytesWritten(qint64)), + this, SLOT(__slotBytesWritten(qint64)) ); + } + + timeout = _timeout; + if( timeout > 0 ) + restartProtocolTimeoutTimer(); +} + + +void Protocol::restartProtocolTimeoutTimer() +{ +#ifdef DEBUG_PROTOCOL + qDebug() << this << "restartProtocolTimeoutTimer()"; +#endif + + if( timeoutTimerId ) + killTimer( timeoutTimerId ); + + Q_ASSERT( timeout > 0 ); + timeoutTimerId = startTimer( timeout ); +} + + +void Protocol::timerEvent( QTimerEvent * event ) +{ +#ifdef DEBUG_PROTOCOL + qDebug() << this << "timerEvent():" << event->timerId() + << "protocol timeout timer id" << timeoutTimerId; +#endif + + if( event->timerId() == timeoutTimerId ) { +#ifdef DEBUG_PROTOCOL + qDebug() << this << "timerEvent(): emit ProtocolTimeout()"; +#endif + emit protocolTimeout( this ); + killTimer( timeoutTimerId ); + timeoutTimerId = 0; + } +} + + +void Protocol::__slotReadyRead() +{ +#ifdef DEBUG_PROTOCOL + qDebug() << this << "__slotReadyRead():" << socket->bytesAvailable() + << "bytes available, restarting protocol timeout timer"; +#endif + + restartProtocolTimeoutTimer(); +} + + +void Protocol::__slotBytesWritten( qint64 /*bytes*/ ) +{ +#ifdef DEBUG_PROTOCOL + qDebug() << this << "__slotBytesWritten():" << bytes + << "written, restarting protocol timeout timer"; +#endif + restartProtocolTimeoutTimer(); +} + +static QHttpResponseHeader xmlRpcResponseHeader( const qint64 contentLength ) +{ +#ifdef DEBUG_XMLRPC + qDebug() << "xmlRpcHeader():" << contentLength; +#endif + QHttpResponseHeader h( 200, "OK", 1, 0 ); + h.setContentType( "text/xml" ); + h.setContentLength( contentLength ); + h.setValue( "connection", "close" ); + h.setValue( "server", "qt-xmlrpc" ); + + return h; +} + + +HttpServer::HttpServer( QAbstractSocket * parent ) + : Protocol( parent, defaultTimeout ), state( ReadingHeader ) +{ +#ifdef DEBUG_XMLRPC + qDebug() << this << "HttpServer():" << parent; +#endif + + connect( socket, SIGNAL( readyRead() ), this, SLOT( slotReadyRead() ) ); + connect( socket, SIGNAL( bytesWritten(qint64) ), this, SLOT( slotBytesWritten(qint64) ) ); + + if ( socket->inherits( "QSslSocket" ) ) { + QSslSocket *sslServer = qobject_cast( socket ); + sslServer->startServerEncryption(); + } + else { + if ( socket->bytesAvailable() > 0 ) + slotReadyRead(); + } +} + + +void HttpServer::slotReadyRead() +{ +#ifdef DEBUG_XMLRPC + qDebug() << this << "slotReadyRead():" << socket->bytesAvailable() << "bytes available"; +#endif + if( !socket->bytesAvailable() ) + return; + + switch( state ) { + case ReadingHeader: + // если заголовок прочитан + if( readRequestHeader() ) { + // если судя по заголовку есть тело, меняем статус на чтение тела + // и попадаем в следующий case + if( requestContainsBody() ) + state = ReadingBody; + } + else { + // тела нет, бросаем сигнал, что заголовок получен + Q_ASSERT( !socket->bytesAvailable() ); + state = WaitingReply; +#ifdef DEBUG_XMLRPC + qDebug() << this << "slotReadyRead(): emit requestReceived()"; +#endif + emit requestReceived( this, requestHeader, requestBody ); + break; + } + case ReadingBody: + if( readRequestBody() ) { + // тело прочитано, бросаем сигнал, что запрос получен + Q_ASSERT( !socket->bytesAvailable() ); + state = WaitingReply; +#ifdef DEBUG_XMLRPC + qDebug() << this << "slotReadyRead(): emit requestReceived()"; +#endif + emit requestReceived( this, requestHeader, requestBody ); + } + break; + case WaitingReply: + qCritical() << this << "slotReadyRead(): got data in WaitingReply state, emit parseError()"; + emit parseError( this ); + break; + case SendingReply: + qCritical() << this << "slotReadyRead(): got data in SendingHeader state, emit parseError()"; + emit parseError( this ); + break; + case Done: + qCritical() << this << "slotReadyRead(): got data in Done state, emit parseError()"; + emit parseError( this ); + break; + default: + qCritical() << this << "slotReadyRead(): unknown state"; + qFatal( "programming error" ); + } +} + + +bool HttpServer::readRequestHeader() +{ +#ifdef DEBUG_XMLRPC + qDebug() << this << "readRequestHeader()"; +#endif + // code from qhttp.cpp + bool end = false; + QByteArray tmp; + QByteArray rn("\r\n",2), n("\n",1); + while (!end && socket->canReadLine()) { + tmp = socket->readLine(); + if (tmp == rn || tmp == n || tmp.isEmpty()) + end = true; + else + requestHeaderBody.append( tmp ); + } + + if( !end ) { +#ifdef DEBUG_XMLRPC + qDebug() << this << "readRequestHeader(): waiting more data, readed" << endl << requestHeaderBody; +#endif + return false; + } + + requestHeader = QHttpRequestHeader( requestHeaderBody ); + + requestHeaderBody.clear(); + requestBody.clear(); + + if( requestHeader.isValid() ) { +#ifdef DEBUG_XMLRPC + qDebug() << this << "readRequestHeader(): header valid" << endl << requestHeader.toString(); +#endif + return true; + } + + qWarning() << this << "readRequestHeader(): invalid requestHeader, emit parseError()" + << endl << requestHeader.toString(); + emit parseError( this ); + return false; +} + + +bool HttpServer::readRequestBody() +{ + Q_ASSERT( requestHeader.isValid() ); + + qint64 bytesToRead = (qint64)requestHeader.contentLength() - (qint64)requestBody.size(); + if( bytesToRead > socket->bytesAvailable() ) + bytesToRead = socket->bytesAvailable(); + +#ifdef DEBUG_XMLRPC + qDebug() << this << "readRequestBody(): already read" << requestBody.size() << "to read" << bytesToRead; +#endif + requestBody.append( socket->read(bytesToRead) ); +#ifdef DEBUG_XMLRPC + qDebug() << this << "readRequestBody(): already read" << requestBody.size() + << "contentLength" << requestHeader.contentLength(); +#endif + + if( requestBody.size() == (int)requestHeader.contentLength() ) + return true; + else + return false; +} + + +bool HttpServer::requestContainsBody() +{ +#ifdef DEBUG_XMLRPC + qDebug() << this << "requestContainsBody()"; +#endif + Q_ASSERT( requestHeader.isValid() ); + return requestHeader.hasContentLength() && requestHeader.hasContentLength(); +} + + +void HttpServer::slotBytesWritten( qint64 bytes ) +{ +#ifdef DEBUG_XMLRPC + qDebug() << this << "slotBytesWritten():" << bytes; +#endif + + bytesWritten += bytes; + if( bytesWritten == bytesToWrite ) { + state = Done; + emit replySent( this ); + } +} + +void HttpServer::slotSendReply( const QByteArray& body ) +{ +#ifdef DEBUG_XMLRPC + qDebug() << this << "sendReply():" << body; +#endif + Q_ASSERT( state == WaitingReply ); + state = SendingReply; + + //QByteArray body = toXmlRpcResponse( e ); + QHttpResponseHeader h( xmlRpcResponseHeader(body.size()) ); + + QByteArray hb = h.toString().toLatin1(); + bytesToWrite = hb.size() + body.size(); + bytesWritten = 0; + + socket->write( hb ); + socket->write( body ); + socket->flush(); +} + +void HttpServer::slotSendReply( const QVariant& e ) +{ +#ifdef DEBUG_XMLRPC + qDebug() << this << "sendReply():" << e; +#endif + Q_ASSERT( state == WaitingReply ); + state = SendingReply; + + QByteArray body = toXmlRpcResponse( e ); + QHttpResponseHeader h( xmlRpcResponseHeader(body.size()) ); + + QByteArray hb = h.toString().toLatin1(); + bytesToWrite = hb.size() + body.size(); + bytesWritten = 0; + + socket->write( hb ); + socket->write( body ); + socket->flush(); +} + + +XmlRpcServer::XmlRpcServer( QObject * parent, + const QString & cert, + const QString & key, + const QByteArray & ) +: QTcpServer( parent ) +{ +#ifdef DEBUG_XMLRPC + qDebug() << this << "XmlRpcServer(): parent" << parent; +#endif + sslParams = NULL; + if ( !cert.isEmpty() && !key.isEmpty() ) + sslParams = new SslParams( cert, key, this ); +} + +void XmlRpcServer::incomingConnection( int socketDescriptor ) +{ +#ifdef DEBUG_XMLRPC + qDebug() << this << "new incoming connection"; +#endif + QAbstractSocket * s = NULL; + if ( sslParams != NULL && !sslParams->certificate.isNull() ) { + s = new QSslSocket( this ); + s->setSocketDescriptor( socketDescriptor ); + + ((QSslSocket *)s)->setLocalCertificate( sslParams->certificate ); + ((QSslSocket *)s)->setPrivateKey( sslParams->privateKey ); + ((QSslSocket *)s)->setCaCertificates( sslParams->ca ); + } + else { + s = new QTcpSocket( this ); + s->setSocketDescriptor( socketDescriptor ); + } + + Q_ASSERT( s->state() == QAbstractSocket::ConnectedState ); + connect( s, SIGNAL(disconnected()), this, SLOT(slotSocketDisconnected()) ); + + HttpServer * p = new HttpServer( s ); + connect( p, SIGNAL(protocolTimeout(Protocol*)), + this, SLOT(slotProtocolTimeout(Protocol*)) ); + connect( p, SIGNAL(parseError(HttpServer*)), + this, SLOT(slotParseError(HttpServer*)) ); + connect( p, SIGNAL(requestReceived(HttpServer*, const QHttpRequestHeader&, const QByteArray&)), + this, SLOT(slotRequestReceived(HttpServer*, const QHttpRequestHeader&, const QByteArray&)) ); + connect( p, SIGNAL(replySent(HttpServer*)), + this, SLOT(slotReplySent(HttpServer*)) ); +} + + +void XmlRpcServer::slotSocketDisconnected() +{ +#ifdef DEBUG_XMLRPC + qDebug() << this << "slotSocketDisconnected()"; +#endif + + // just delete this socket. + sender()->deleteLater(); +} + + +void XmlRpcServer::slotProtocolTimeout( Protocol * p ) +{ +#ifdef DEBUG_XMLRPC + qDebug() << this << "slotProtocolTimeout()"; +#endif + qWarning() << this << "slotProtocolTimeout(): client" + << p->getSocket()->peerAddress() << ":" << p->getSocket()->peerPort() + << "closing connection"; + + p->getSocket()->close(); +} + + +void XmlRpcServer::slotParseError( HttpServer * p ) +{ +#ifdef DEBUG_XMLRPC + qDebug() << this << "slotParseError()"; +#endif + + qWarning() << this << "slotParseError(): client" + << p->getSocket()->peerAddress() << ":" << p->getSocket()->peerPort() + << "closing connection"; + + p->getSocket()->close(); +} + + +void XmlRpcServer::registerSlot( QObject * receiver, const char * slot, QByteArray path ) +{ +#ifdef DEBUG_XMLRPC + qDebug() << this << "registerSlot():" << receiver << slot; +#endif + + // skip code first symbol 1 from SLOT macro (from qobject.cpp) + ++slot; + + // find QMetaMethod.. + const QMetaObject * mo = receiver->metaObject(); + + // we need buf in memory for const char (from qobject.cpp) + QByteArray method = QMetaObject::normalizedSignature( slot ); + const char * normalized = method.constData(); + + int slotId = mo->indexOfSlot( normalized ); + if( slotId == -1 ) { + qCritical() << this << "registerSlot():" << receiver << normalized + << "can't find slot"; + + qFatal("programming error"); + } + QMetaMethod m = receiver->metaObject()->method( slotId ); + + bool isDefferedResult = !qstrcmp( m.typeName(), "DeferredResult*" ); + if( qstrcmp(m.typeName(), "QVariant") && !isDefferedResult ) { + qCritical() << this << "registerSlot():" << receiver << normalized + << "rpc return type should be QVariant or DeferredResult*, but" << m.typeName(); + + qFatal("programming error"); + } + + foreach( QByteArray c, m.parameterTypes() ) + if( c != "QVariant" ) { + qCritical() << this << "registerSlot():" << receiver << normalized + << "all parameters should be QVariant"; + + qFatal("programming error"); + } + + // ok, now lets make just function name from our SLOT + Q_ASSERT( method.indexOf('(') > 0 ); + method.truncate( method.indexOf('(') ); + if( path[0] != '/' ) + path.prepend( '/' ); + if( path[path.size()-1] != '/' ) + path.append( '/' ); + + method.prepend( path ); + + // check if allready exists + if( callbacks.contains(method) ) { + qCritical() << this << "registerSlot():" << receiver << method + << "allready registered, receiver" << callbacks[method]; + qFatal( "programming error" ); + } + callbacks[ method ] = IsMethodDeffered( receiver, isDefferedResult ); + + Methods& methods = objectMethods[ receiver ]; + + if( methods.isEmpty() ) { +#ifdef DEBUG_XMLRPC + qDebug() << this << "registerSlot(): connecting SIGNAL(destroyed()) of" << receiver; +#endif + connect( receiver, SIGNAL(destroyed(QObject*)), + this, SLOT(slotReceiverDestroed(QObject*)) ); + } + + methods.append( method ); +#ifdef DEBUG_XMLRPC + qDebug() << this << "registerSlot(): callbacks" << callbacks; + qDebug() << this << "registerSlot(): objectMethods" << objectMethods; +#endif +} + + +void XmlRpcServer::slotReceiverDestroed( QObject * o ) +{ +#ifdef DEBUG_XMLRPC + qDebug() << this << "slotReceiverDestroed():" << o; +#endif + + Q_ASSERT( objectMethods.contains(o) ); + + foreach( const char * m, objectMethods[o] ) + if( !callbacks.remove(m) ) + qCritical() << this << "slotReceiverDestroed():" + << "can't remove" << m + << "from callbacks"; + + objectMethods.remove( o ); +#ifdef DEBUG_XMLRPC + qDebug() << this << "slotReceiverDestroed(): callbacks" << callbacks; + qDebug() << this << "slotReceiverDestroed(): objectMethods" << objectMethods; +#endif +} + + +void XmlRpcServer::slotRequestReceived( HttpServer * p, const QHttpRequestHeader & h, const QByteArray & body ) +{ +#ifdef DEBUG_XMLRPC + qDebug() << this << "slotRequestReceived():" << p << h.toString() << body; +#endif + + QDomDocument doc; + QString errorMsg; + int errorLine, errorColumn; + + if( !doc.setContent(body, &errorMsg, &errorLine, &errorColumn) ) { + qCritical() << this << "slotRequestReceived(): can't parse xml" << endl << body << endl + << errorMsg << endl << "line:" << errorLine << "column:" << errorColumn; + p->getSocket()->close(); + return; + } + + QVariantList params; + QDomNode n; + QDomElement e; + + // run until first element + n = doc.firstChild(); + while( !n.isNull() ) { + e = n.toElement(); + if( !e.isNull() ) + break; + + n = n.nextSibling(); + } + + if( e.tagName() != "methodCall" ) { + qCritical() << this << "slotRequestReceived(): first element is not methodCall" + << e.tagName() << endl<< body; + p->getSocket()->close(); + return; + } + + // first child SHOULD be methodName + e = e.firstChild().toElement(); + if( e.tagName() != "methodName" ) { + qCritical() << this << "slotRequestReceived(): first element of methodCall is not methodName" + << e.tagName() << endl<< body; + p->getSocket()->close(); + return; + } + + QByteArray methodName = e.firstChild().toText().data().toLatin1(); + + if( methodName.isEmpty() ) { + qCritical() << this << "slotRequestReceived(): methodName empty" + << endl << body; + p->getSocket()->close(); + return; + } + + QByteArray path = h.path().toLatin1(); + + if( path[0] != '/' ) + path.prepend( '/' ); + if( path[path.size()-1] != '/' ) + path.append( '/' ); + + + if( !callbacks.contains(path + methodName) ) { + qCritical() << this << "slotRequestReceived(): method" + << path + methodName << "is not registered as callback"; + p->slotSendReply( toXmlRpcResponse( createFault(-1, "method " + path + methodName + " not registered") ) ); + return; + } + + // run over params + e = e.nextSibling().toElement(); + + if( e.tagName() != "params" ) { + qCritical() << this << "slotRequestReceived(): method" + << methodName << "no params element in xml request" + << endl << body; + p->slotSendReply( toXmlRpcResponse( createFault(-1, "no params element in xml request") ) ); + return; + } + + // run until first element + e = e.firstChild().toElement(); + while( !e.isNull() ) { + if( e.tagName() != "param" ) { + qCritical() << this << "slotRequestReceived(): method" + << methodName << "no param element in xml request" + << endl << body; + p->slotSendReply( toXmlRpcResponse( createFault(-1, "bad param element in xml request") ) ); + return; + } + + QString err; + params.append( parseXmlRpcValue(e.firstChild().toElement(), err) ); + if( !err.isEmpty() ) { + qCritical() << this << "slotRequestReceived(): method" + << methodName << "parse error:" << err + << endl << body; + p->slotSendReply( toXmlRpcResponse( createFault(-1, err) ) ); + return; + } + e = e.nextSibling().toElement(); + } + + QAbstractSocket * s = p->getSocket(); + if ( s->inherits( "QSslSocket" ) ) { + QSslSocket * sslSkt = qobject_cast(s); + QString commonName = sslSkt-> peerCertificate().subjectInfo( QSslCertificate::CommonName ); + params.append( commonName ); + } + + // params parsed, now invoke registered slot. + QVariant retVal; + DeferredResult * retDeffered; + const IsMethodDeffered& md = callbacks[path + methodName]; + bool invoked; + if( md.second ) { + invoked = QMetaObject::invokeMethod( md.first, methodName.constData(), + Qt::DirectConnection, + Q_RETURN_ARG(DeferredResult*, retDeffered), + params.size() > 0 ? Q_ARG(QVariant, params[0]) : QGenericArgument(), + params.size() > 1 ? Q_ARG(QVariant, params[1]) : QGenericArgument(), + params.size() > 2 ? Q_ARG(QVariant, params[2]) : QGenericArgument(), + params.size() > 3 ? Q_ARG(QVariant, params[3]) : QGenericArgument(), + params.size() > 4 ? Q_ARG(QVariant, params[4]) : QGenericArgument(), + params.size() > 5 ? Q_ARG(QVariant, params[5]) : QGenericArgument(), + params.size() > 6 ? Q_ARG(QVariant, params[6]) : QGenericArgument(), + params.size() > 7 ? Q_ARG(QVariant, params[7]) : QGenericArgument(), + params.size() > 8 ? Q_ARG(QVariant, params[8]) : QGenericArgument(), + params.size() > 9 ? Q_ARG(QVariant, params[9]) : QGenericArgument() ); + } + else { + invoked = QMetaObject::invokeMethod( md.first, methodName.constData(), + Qt::DirectConnection, + Q_RETURN_ARG(QVariant, retVal), + params.size() > 0 ? Q_ARG(QVariant, params[0]) : QGenericArgument(), + params.size() > 1 ? Q_ARG(QVariant, params[1]) : QGenericArgument(), + params.size() > 2 ? Q_ARG(QVariant, params[2]) : QGenericArgument(), + params.size() > 3 ? Q_ARG(QVariant, params[3]) : QGenericArgument(), + params.size() > 4 ? Q_ARG(QVariant, params[4]) : QGenericArgument(), + params.size() > 5 ? Q_ARG(QVariant, params[5]) : QGenericArgument(), + params.size() > 6 ? Q_ARG(QVariant, params[6]) : QGenericArgument(), + params.size() > 7 ? Q_ARG(QVariant, params[7]) : QGenericArgument(), + params.size() > 8 ? Q_ARG(QVariant, params[8]) : QGenericArgument(), + params.size() > 9 ? Q_ARG(QVariant, params[9]) : QGenericArgument() ); + } + + if( !invoked ) { + qCritical() << this << "slotRequestReceived(): can't invoke" + << methodName << params; + + QVariant fault = createFault( -1, + "can't invoke " + path + methodName + ", wrong parameters number?" ); + p->slotSendReply( toXmlRpcResponse( fault ) ); + return; + } + + if( md.second ) { + retDeffered->setParent( p->getSocket() ); + connect( retDeffered, SIGNAL(sendReply(const QVariant&)), + p, SLOT(slotSendReply(const QVariant&)) ); + } + else + p->slotSendReply( toXmlRpcResponse( retVal ) ); + + return; +} + + +void XmlRpcServer::slotReplySent( HttpServer * p ) +{ +#ifdef DEBUG_XMLRPC + qDebug() << this << "slotReplySent():" << p; +#endif + + p->getSocket()->close(); +} + + +void toXmlRpcArray( const int spaces, const QVariantList & child, QByteArray & b ) +{ +#ifdef DEBUG_XMLRPC + qDebug() << "toXmlRpcArray()"; +#endif + + QListIterator< QVariant > i(child); + + while( i.hasNext() ) + toXmlRpcValue( spaces + 2, i.next(), b ); +} + + +void toXmlRpcStruct( const int spaces, const QVariantMap & child, QByteArray & b ) +{ +#ifdef DEBUG_XMLRPC + qDebug() << "toXmlRpcStruct()"; +#endif + + QMapIterator< QString, QVariant > i(child); + + while( i.hasNext() ) { + i.next(); +#ifdef XMLRPC_WITHSPACES + b.append( '\n' ); + b.append( QByteArray(spaces, ' ') ); +#endif + b.append( "" ); +#ifdef XMLRPC_WITHSPACES + b.append( '\n' ); + b.append( QByteArray(spaces + 2, ' ') ); +#endif + b.append( "" + i.key() + "" ); + toXmlRpcValue( spaces + 2, i.value(), b ); +#ifdef XMLRPC_WITHSPACES + b.append( '\n' ); + b.append( QByteArray(spaces, ' ') ); +#endif + b.append( "" ); + } +} + + +void toXmlRpcValue( const int spaces, const QVariant & child, QByteArray & b ) +{ +#ifdef DEBUG_XMLRPC + qDebug() << "toXmlRpcValue()"; +#endif + switch( child.type() ) { + case QVariant::Int: +#ifdef XMLRPC_WITHSPACES + b.append( '\n' ); + b.append( QByteArray(spaces, ' ') ); +#endif + b.append( "" + QString::number(child.toInt()) + "" ); + break; + case QVariant::Bool: +#ifdef XMLRPC_WITHSPACES + b.append( '\n' ); + b.append( QByteArray(spaces, ' ') ); +#endif + b.append( QString("") + (child.toBool() ? "1" : "0") + "" ); + break; + case QVariant::String: +#ifdef XMLRPC_WITHSPACES + b.append( '\n' ); + b.append( QByteArray(spaces, ' ') ); +#endif + b.append( "" + child.toString() + "" ); + break; + case QVariant::Double: +#ifdef XMLRPC_WITHSPACES + b.append( '\n' ); + b.append( QByteArray(spaces, ' ') ); +#endif + b.append( "" + QString::number(child.toDouble()) + "" ); + break; + case QVariant::DateTime: +#ifdef XMLRPC_WITHSPACES + b.append( '\n' ); + b.append( QByteArray(spaces, ' ') ); +#endif + b.append( "" + child.toDateTime().toString("yyyyMMddTHH:mm:ss") + + "" ); + break; + case QVariant::ByteArray: +#ifdef XMLRPC_WITHSPACES + b.append( '\n' ); + b.append( QByteArray(spaces, ' ') ); +#endif + b.append( "" + child.toByteArray().toBase64() + "" ); + break; + case QVariant::List: +#ifdef XMLRPC_WITHSPACES + b.append( '\n' ); + b.append( QByteArray(spaces, ' ') ); +#endif + b.append( "" ); + toXmlRpcArray( spaces + 2, child.toList(), b ); +#ifdef XMLRPC_WITHSPACES + b.append( '\n' ); + b.append( QByteArray(spaces, ' ') ); +#endif + b.append( "" ); + break; + case QVariant::Map: +#ifdef XMLRPC_WITHSPACES + b.append( '\n' ); + b.append( QByteArray(spaces, ' ') ); +#endif + b.append( "" ); + toXmlRpcStruct( spaces + 2, child.toMap(), b ); +#ifdef XMLRPC_WITHSPACES + b.append( '\n' ); + b.append( QByteArray(spaces, ' ') ); +#endif + b.append( "" ); + break; + default: + qCritical() << "toXmlRpcValue(): unknown return xmlrpc type" + << child.typeName() << endl << child; + qFatal("programming error"); + } +} + + +QByteArray toXmlRpcResponse( const QVariant& v ) +{ +#ifdef XMLRPC_WITHSPACES + QByteArray r( "\n" ); +#else + QByteArray r( "" ); +#endif + + // this is error? + if( isFault(v) ) { +#ifdef XMLRPC_WITHSPACES + r.append( "\n \n " ); +#else + r.append( "" ); +#endif + toXmlRpcValue( 6, v, r ); +#ifdef XMLRPC_WITHSPACES + r.append( "\n \n " ); +#else + r.append( "" ); +#endif + } + else { +#ifdef XMLRPC_WITHSPACES + r.append( "\n \n " ); +#else + r.append( "" ); +#endif + toXmlRpcValue( 6, v, r ); +#ifdef XMLRPC_WITHSPACES + r.append( "\n \n " ); +#else + r.append( "" ); +#endif + } + +#ifdef XMLRPC_WITHSPACES + r.append( "\n" ); +#else + r.append( "" ); +#endif + +#ifdef DEBUG_XMLRPC + qDebug() << "toXmlRpc():" << v << endl << r; +#endif + + return r; +} + + +QVariant parseXmlRpcValue( const QDomElement & e, QString& err ) +{ +#ifdef DEBUG_XMLRPC + qDebug() << "parseXmlRpcValue():" << e.tagName(); +#endif + QVariant v; + if( e.tagName() != "value" ) { + err = "first param tag not value"; + return v; + } + + QDomElement t = e.firstChild().toElement(); + QString type = t.tagName(); + + if( type == "int" || type == "i4" ) { + bool ok; + v = t.firstChild().toText().data().toInt( &ok ); + if( !ok ) + err = "Can't convert int text '" + t.firstChild().toText().data() + "' to number"; + } + else if( type == "boolean" ) + v = t.firstChild().toText().data() == "1" ? true : false; + else if( type == "string" ) + v = t.firstChild().toText().data(); + else if( type == "double" ) { + bool ok; + v = t.firstChild().toText().data().toDouble( &ok ); + if( !ok ) + err = "Can't convert int text '" + t.firstChild().toText().data() + "' to number"; + } + else if( type == "dateTime.iso8601" ) + v = QDateTime::fromString( t.firstChild().toText().data(), "yyyyMMddTHH:mm:ss" ); + else if( type == "base64" ) + v = QByteArray::fromBase64( t.firstChild().toText().data().toLatin1() ); + else if ( type == "array" ) + v = parseXmlRpcArray( t.firstChild().toElement(), err ); + else if ( type == "struct" ) + v = parseXmlRpcStruct( t.firstChild().toElement(), err ); + else + err = "unknown type: '" + type + "'"; + + return v; +} + + +QVariant parseXmlRpcStruct( const QDomElement & e, QString& err ) +{ +#ifdef DEBUG_XMLRPC + qDebug() << "parseXmlRpcStruct():" << e.tagName(); +#endif + QDomElement t = e; + QVariantMap r; + + while( !t.isNull() ) { + if( t.tagName() != "member" ) { + err = "no member tag in struct, tag " + t.tagName(); + return r; + } + QDomElement s = t.firstChild().toElement(); + if( s.tagName() != "name" ) { + err = "no name tag in member struct, tag " + s.tagName(); + return r; + } + // set map value + r[ s.firstChild().toText().data() ] = parseXmlRpcValue( s.nextSibling().toElement(), err ); + + if( !err.isEmpty() ) + return r; + + t = t.nextSibling().toElement(); + } + + return r; +} + + +QVariant parseXmlRpcArray( const QDomElement & e, QString& err ) +{ +#ifdef DEBUG_XMLRPC + qDebug() << "parseXmlRpcArray():" << e.tagName(); +#endif + QVariantList r; + if( e.tagName() != "data" ) { + err = "no data tag in array, tag " + e.tagName(); + return r; + } + + QDomElement t = e.firstChild().toElement(); + + while( !t.isNull() ) { + r.append( parseXmlRpcValue(t,err) ); + if( !err.isEmpty() ) + return r; + + t = t.nextSibling().toElement(); + } + + return r; +} + + +DeferredEcho::DeferredEcho( const QVariant& e ) + : echo( e ) + +{ + startTimer( 1000 ); // one second timeout, before echo +} + + +void DeferredEcho::timerEvent( QTimerEvent * ) +{ + emit sendReply( echo ); +} + + +DeferredResult::DeferredResult() +{ +#ifdef DEBUG_XMLRPC + qDebug() << this << "DeferredResult()"; +#endif +} + + +DeferredResult::~DeferredResult() +{ +#ifdef DEBUG_XMLRPC + qDebug() << this << "~DeferredResult()"; +#endif +} diff --git a/3rdparty/qtxmlrpc/server/src/xmlrpcserver.h b/3rdparty/qtxmlrpc/server/src/xmlrpcserver.h new file mode 100644 index 00000000..ff7e1568 --- /dev/null +++ b/3rdparty/qtxmlrpc/server/src/xmlrpcserver.h @@ -0,0 +1,226 @@ +#ifndef XMLRPCSERVER_H +#define XMLRPCSERVER_H + +#include +#include +#include +#include +#include +#include +#include + +// ssl +#include +#include + +// #define DEBUG_XMLRPC + +// use spaces in xmlrpc formatting +#define XMLRPC_WITHSPACES + +/* + * Types from http://www.xmlrpc.com/spec maps into QVariant as: + * + * int - int, + * boolean - bool, + * string - QString, + * double - double, + * dateTime.iso8601 - QDateTime, + * base64 - QByteArray + * array - QVariantList + * struct - QVariantMap + * + * Fault method response generated, if return value is + * QVariantMap with two fields: faultCode, faultString. + * + */ + +// creates xmlrpc fault +// Use this in your callbacks, as return createFault( code, msg ); +// For example, in python, xmlrpclib.Fault exception will be raised. +inline QVariant createFault( const int code, const QString & msg ) +{ + QVariantMap f; + + f["faultCode"] = code; + f["faultString"] = msg; + + return f; +} + +/* + * Protocol is base class for Network protocols. + * This implementation implement timeout, if not data sent/received. + * + * Protocol shoud be created as QAbstractSocket child, + * if you delete socket, protocol will be deleted automaticly + * + * Socket can have only one protocol at one time. + * + * Protocol have no start/stop policy, it start when construct and stops + * when destruct. + */ +class Protocol : public QObject +{ + Q_OBJECT +public: + // Timeout activates, if it is above zero, msecs. + Protocol( QAbstractSocket * parent, const int _timeout = 0 ); + ~Protocol(); + + void setTimeout( const int _timeout ); + void stopProtocolTimeout() { setTimeout(0); } + + QAbstractSocket * getSocket() { return socket; } +private slots: + // restarts timeout + void __slotReadyRead(); + void __slotBytesWritten( qint64 bytes ); +signals: + void protocolTimeout( Protocol * ); +protected: + void timerEvent( QTimerEvent *event ); + void restartProtocolTimeoutTimer(); + + int timeout; // таймаут протокола. + int timeoutTimerId; + + // Just not to cast parent() every time you need socket + QAbstractSocket * socket; +}; + + +// very basic HttpServer for XmlRpc +class QHttpRequestHeader; +class HttpServer : public Protocol { + Q_OBJECT +public: + HttpServer( QAbstractSocket * parent ); +public slots: + // sends xmlrpc response from QVariant param + void slotSendReply( const QByteArray& ); + void slotSendReply( const QVariant& ); +protected slots: + void slotReadyRead(); + void slotBytesWritten( qint64 bytes ); +signals: + void parseError( HttpServer * ); + void requestReceived( HttpServer *, const QHttpRequestHeader & h, const QByteArray & body ); + void replySent( HttpServer * ); + +private: + bool readRequestHeader(); + bool readRequestBody(); + bool requestContainsBody(); + enum State { ReadingHeader, ReadingBody, WaitingReply, SendingReply, Done } state; + + QString requestHeaderBody; + QByteArray requestBody; + QHttpRequestHeader requestHeader; + + qint64 bytesWritten; + qint64 bytesToWrite; + + const static int defaultTimeout = 100000; // 100 secs +}; + + +// you can deriver from this class and implement deferredRun +// After deferred sql, network and so, you can emit sendReply signal with result. +// +// This signal will be connected to your HttpServer slotSendReply. +// +// DeferredResult will be deleted, as socket child, or you can this->deleteLater(), +// after emmiting result. +class DeferredResult : public QObject +{ + Q_OBJECT +public: + DeferredResult(); + ~DeferredResult(); +signals: + void sendReply( const QVariant& ); + void sendReply( const QByteArray& ); +}; + + +class DeferredEcho : public DeferredResult +{ + Q_OBJECT +public: + DeferredEcho( const QVariant& e ); +private: + void timerEvent( QTimerEvent * ); + QVariant echo; +}; + + +class SslParams : public QObject +{ + Q_OBJECT +public: + SslParams( const QString & certFile, const QString & keyFile, QObject * parent = 0 ); + + QSslCertificate certificate; + QList ca; + QSslKey privateKey; +}; + + +/** + @author kisel2626@gmail.com +*/ +class QDomElement; +class XmlRpcServer : public QTcpServer +{ + Q_OBJECT +public: + XmlRpcServer( QObject *parent = 0, + const QString & cert = "", + const QString & key = "", + const QByteArray & passwd = QByteArray() ); + + // Slots should return QVariant and accept const QVariant& as params. + // QVariant method( const QVariant &, ... ); + // path + slot should be unique. + void registerSlot( QObject * receiver, const char * slot, QByteArray path = "/RPC2/" ); +public slots: + QVariant echo( const QVariant& e ) { return e; } + DeferredResult * deferredEcho( const QVariant& e ) { return new DeferredEcho( e ); } +private slots: + // we don't support SSL yet, + // if you need SSL, connection handling design must be revised a bit + // void slotNewConnection(); + + // we don't need socket more, if it's disconnected + void slotSocketDisconnected(); + // protocol errors + void slotProtocolTimeout( Protocol * ); + void slotParseError( HttpServer * ); + // when HttpServer receives request + void slotRequestReceived( HttpServer *, const QHttpRequestHeader & h, const QByteArray & body ); + // when reply sent + void slotReplySent( HttpServer * ); + + // when registrant dies, we need to remove their callbacks методов. + void slotReceiverDestroed( QObject * ); + +protected: + void incomingConnection ( int socketDescriptor ); + +private: + // if Method is deffered + typedef QPair< QObject *, bool > IsMethodDeffered; + // fast access for invokeMethod + typedef QHash< QByteArray, IsMethodDeffered > Callbacks; + // fast callbacks delete, when registrant dies + typedef QList< QByteArray > Methods; + typedef QMap< QObject *, Methods > ObjectMethods; + + Callbacks callbacks; + ObjectMethods objectMethods; + + SslParams * sslParams; +}; + +#endif diff --git a/3rdparty/qtxmlrpc/xmlrpctest/client.cpp b/3rdparty/qtxmlrpc/xmlrpctest/client.cpp new file mode 100644 index 00000000..a55f9eba --- /dev/null +++ b/3rdparty/qtxmlrpc/xmlrpctest/client.cpp @@ -0,0 +1,24 @@ +#include "client.h" +#include "xmlrpcclient.h" + +#include + +Client::Client( const QString &address, quint16 port, QObject *parent ) + : QObject( parent ), address( address ), port( port ) +{ + +} + + +void Client::testFunc( const QVariant ¶m ) +{ + XmlRpcClient *client = new XmlRpcClient( address, port ); + connect( client, SIGNAL( dataReady(QVariant) ), this, SLOT( onDataReady(QVariant) ) ); + client->execute( "testFunc", QVariantList() << param ); +} + + +void Client::onDataReady( const QVariant &response ) +{ + qDebug() << response; +} diff --git a/3rdparty/qtxmlrpc/xmlrpctest/client.h b/3rdparty/qtxmlrpc/xmlrpctest/client.h new file mode 100644 index 00000000..cdd2eacf --- /dev/null +++ b/3rdparty/qtxmlrpc/xmlrpctest/client.h @@ -0,0 +1,26 @@ +#ifndef CLIENT_H +#define CLIENT_H + +#include +#include + + +class Client : QObject +{ + Q_OBJECT + +public: + Client( const QString &address, quint16 port, QObject *parent = 0 ); + + void testFunc( const QVariant ¶m ); + +private slots: + void onDataReady( const QVariant &response ); + +private: + QString address; + quint16 port; + +}; + +#endif // CLIENT_H diff --git a/3rdparty/qtxmlrpc/xmlrpctest/client.py b/3rdparty/qtxmlrpc/xmlrpctest/client.py new file mode 100644 index 00000000..7709b920 --- /dev/null +++ b/3rdparty/qtxmlrpc/xmlrpctest/client.py @@ -0,0 +1,13 @@ +#!/usr/bin/python + +from xmlrpclib import ServerProxy +import datetime + +s = ServerProxy('http://localhost:8080') +print s.testFunc('abc') +print s.testFunc(1) +print s.testFunc(True) +print s.testFunc(0.5) + +print s.testFunc(datetime.datetime.now()) +print s.testFunc({'a':1, 'b':2, 'c':3}) diff --git a/3rdparty/qtxmlrpc/xmlrpctest/main.cpp b/3rdparty/qtxmlrpc/xmlrpctest/main.cpp new file mode 100644 index 00000000..d9a63152 --- /dev/null +++ b/3rdparty/qtxmlrpc/xmlrpctest/main.cpp @@ -0,0 +1,30 @@ +#include +#include "server.h" +#include "client.h" + +int main( int argc, char **argv ) +{ + QCoreApplication app( argc, argv ); + + QString address = "127.0.0.1"; + quint16 port = 8080; + + Server s( address, port ); + Client c( address, port ); + + /* NB: Responses are not syncronized */ + + c.testFunc( QVariant( "test" ) ); + c.testFunc( QVariant( 1 ) ); + c.testFunc( QVariant( true ) ); + c.testFunc( QVariant( 1.5 ) ); + + QVariantMap m; + m["one"] = 1; + m["two"] = 2; + m["three"] = 3; + c.testFunc( QVariant( m ) ); + + return app.exec(); +} + diff --git a/3rdparty/qtxmlrpc/xmlrpctest/server.cpp b/3rdparty/qtxmlrpc/xmlrpctest/server.cpp new file mode 100644 index 00000000..561227ca --- /dev/null +++ b/3rdparty/qtxmlrpc/xmlrpctest/server.cpp @@ -0,0 +1,19 @@ +#include "server.h" +#include "xmlrpcserver.h" + +#include + +Server::Server( const QString &address, quint16 port, QObject *parent ) + : QObject( parent ) +{ + XmlRpcServer *srv = new XmlRpcServer; + if ( srv->listen( QHostAddress( address ), port ) ) { + srv->registerSlot( this, SLOT( testFunc(QVariant) ) ); + } +} + + +QVariant Server::testFunc( const QVariant ¶m ) +{ + return param; +} diff --git a/3rdparty/qtxmlrpc/xmlrpctest/server.h b/3rdparty/qtxmlrpc/xmlrpctest/server.h new file mode 100644 index 00000000..a8f527f6 --- /dev/null +++ b/3rdparty/qtxmlrpc/xmlrpctest/server.h @@ -0,0 +1,18 @@ +#ifndef SERVER_H +#define SERVER_H + +#include +#include + +class Server : QObject +{ + Q_OBJECT + +public: + Server( const QString &address, quint16 port, QObject *parent = 0 ); + +private slots: + QVariant testFunc( const QVariant ¶m ); +}; + +#endif // SERVER_H diff --git a/3rdparty/qtxmlrpc/xmlrpctest/xmlrpctest.pro b/3rdparty/qtxmlrpc/xmlrpctest/xmlrpctest.pro new file mode 100644 index 00000000..19f67ca8 --- /dev/null +++ b/3rdparty/qtxmlrpc/xmlrpctest/xmlrpctest.pro @@ -0,0 +1,6 @@ +include(../server/server.pri) +include(../client/client.pri) +INCLUDEPATH += ../server/src +INCLUDEPATH += ../client/src +SOURCES += main.cpp server.cpp client.cpp +HEADERS += server.h client.h diff --git a/3rdparty/quazip-0.5.1/CMakeLists.txt b/3rdparty/quazip-0.5.1/CMakeLists.txt new file mode 100644 index 00000000..75db406e --- /dev/null +++ b/3rdparty/quazip-0.5.1/CMakeLists.txt @@ -0,0 +1,28 @@ +project (QuaZip) +cmake_minimum_required(VERSION 2.6) + +set(qt_min_version "4.5.0") +find_package(Qt4 REQUIRED) +set(QT_USE_QTGUI false) +include(${QT_USE_FILE}) + +# Use system zlib on unix and Qt ZLIB on Windows +IF(UNIX) + find_package(ZLIB REQUIRED) +ELSE(UNIX) + SET(ZLIB_INCLUDE_DIRS "${QT_ROOT}/src/3rdparty/zlib" CACHE STRING "Path to ZLIB headers of Qt") + SET(ZLIB_LIBRARIES "") + IF(NOT EXISTS "${ZLIB_INCLUDE_DIRS}/zlib.h") + MESSAGE("Please specify a valid zlib include dir") + ENDIF(NOT EXISTS "${ZLIB_INCLUDE_DIRS}/zlib.h") +ENDIF(UNIX) + +# All build libraries are moved to this directory +SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}) + +set(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)") +set(LIB_DESTINATION "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" CACHE STRING "Library directory name" FORCE) + +add_subdirectory(quazip) + +install(FILES FindQuaZip.cmake DESTINATION ${CMAKE_ROOT}/Modules) diff --git a/3rdparty/quazip-0.5.1/COPYING b/3rdparty/quazip-0.5.1/COPYING new file mode 100644 index 00000000..2cba2ac7 --- /dev/null +++ b/3rdparty/quazip-0.5.1/COPYING @@ -0,0 +1,458 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS diff --git a/3rdparty/quazip-0.5.1/Doxyfile b/3rdparty/quazip-0.5.1/Doxyfile new file mode 100644 index 00000000..9bac8dda --- /dev/null +++ b/3rdparty/quazip-0.5.1/Doxyfile @@ -0,0 +1,1722 @@ +# Doxyfile 1.7.4 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" "). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# http://www.gnu.org/software/libiconv for the list of possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# by quotes) that should identify the project. + +PROJECT_NAME = QuaZIP + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = quazip-0-5-1 + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer +# a quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = + +# With the PROJECT_LOGO tag one can specify an logo or icon that is +# included in the documentation. The maximum height of the logo should not +# exceed 55 pixels and the maximum width should not exceed 200 pixels. +# Doxygen will copy the logo to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = doc + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, +# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English +# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, +# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, +# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = YES + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful if your file system +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 8 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for +# Java. For instance, namespaces will be presented as packages, qualified +# scopes will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources only. Doxygen will then generate output that is more tailored for +# Fortran. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for +# VHDL. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given extension. +# Doxygen has a built-in mapping, but you can override or extend it using this +# tag. The format is ext=language, where ext is a file extension, and language +# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C, +# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make +# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C +# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions +# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also makes the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public +# instead of private inheritance when no explicit protection keyword is present. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate getter +# and setter methods for a property. Setting this option to YES (the default) +# will make doxygen replace the get and set methods by a property in the +# documentation. This will only work if the methods are indeed getting or +# setting a simple type. If this is not the case, or you want to show the +# methods anyway, you should set this option to NO. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and +# unions are shown inside the group in which they are included (e.g. using +# @ingroup) instead of on a separate page (for HTML and Man pages) or +# section (for LaTeX and RTF). + +INLINE_GROUPED_CLASSES = NO + +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum +# is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. + +TYPEDEF_HIDES_STRUCT = NO + +# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to +# determine which symbols to keep in memory and which to flush to disk. +# When the cache is full, less often used symbols will be written to disk. +# For small to medium size projects (<1000 input files) the default value is +# probably good enough. For larger projects a too small cache size can cause +# doxygen to be busy swapping symbols to and from disk most of the time +# causing a significant performance penalty. +# If the system has enough physical memory increasing the cache will improve the +# performance by keeping more symbols in memory. Note that the value works on +# a logarithmic scale so increasing the size by one will roughly double the +# memory usage. The cache size is given by this formula: +# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols + +SYMBOL_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = NO + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default +# anonymous namespaces are hidden. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen +# will list include files with double quotes in the documentation +# rather than with sharp brackets. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = NO + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen +# will sort the (brief and detailed) documentation of class members so that +# constructors and destructors are listed first. If set to NO (the default) +# the constructors will appear in the respective orders defined by +# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. +# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO +# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the +# hierarchy of group names into alphabetical order. If set to NO (the default) +# the group names will appear in their defined order. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to +# do proper type resolution of all parameters of a function it will reject a +# match between the prototype and the implementation of a member function even +# if there is only one candidate or it is obvious which candidate to choose +# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen +# will still accept a match between prototype and implementation in such cases. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or macro consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and macros in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# in the documentation. The default is NO. + +SHOW_DIRECTORIES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. +# This will remove the Files entry from the Quick Index and from the +# Folder Tree View (if specified). The default is YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the +# Namespaces page. +# This will remove the Namespaces entry from the Quick Index +# and from the Folder Tree View (if specified). The default is YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command , where is the value of +# the FILE_VERSION_FILTER tag, and is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. The create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. +# You can optionally specify a file name after the option, if omitted +# DoxygenLayout.xml will be used as the name of the layout file. + +LAYOUT_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# The WARN_NO_PARAMDOC option can be enabled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is +# also the default input encoding. Doxygen uses libiconv (or the iconv built +# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for +# the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh +# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py +# *.f90 *.f *.for *.vhd *.vhdl + +FILE_PATTERNS = *.cpp \ + *.h \ + *.dox + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. + +EXCLUDE = quazip/unzip.h \ + quazip/zip.h \ + quazip/ioapi.h \ + quazip/crypt.h \ + qztest/ + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = */.moc/* */release/* */debug/* */moc_*.cpp + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. +# If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. +# Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. +# The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty or if +# non of the patterns match the file name, INPUT_FILTER is applied. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) +# and it is also possible to disable source filtering for a specific pattern +# using *.ext= (so without naming a filter). This option only has effect when +# FILTER_SOURCE_FILES is enabled. + +FILTER_SOURCE_PATTERNS = + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = YES + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. +# Otherwise they will link to the documentation. + +REFERENCES_LINK_SOURCE = YES + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = NO + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. Note that when using a custom header you are responsible +# for the proper inclusion of any scripts and style sheets that doxygen +# needs, which is dependent on the configuration options used. +# It is adviced to generate a default header using "doxygen -w html +# header.html footer.html stylesheet.css YourConfigFile" and then modify +# that header. Note that the header is subject to change so you typically +# have to redo this when upgrading to a newer version of doxygen or when changing the value of configuration settings such as GENERATE_TREEVIEW! + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# stylesheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that +# the files will be copied as-is; there are no commands or markers available. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. +# Doxygen will adjust the colors in the stylesheet and background images +# according to this color. Hue is specified as an angle on a colorwheel, +# see http://en.wikipedia.org/wiki/Hue for more information. +# For instance the value 0 represents red, 60 is yellow, 120 is green, +# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. +# The allowed range is 0 to 359. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of +# the colors in the HTML output. For a value of 0 the output will use +# grayscales only. A value of 255 will produce the most vivid colors. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to +# the luminance component of the colors in the HTML output. Values below +# 100 gradually make the output lighter, whereas values above 100 make +# the output darker. The value divided by 100 is the actual gamma applied, +# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, +# and 100 does not change the gamma. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting +# this to NO can help when comparing the output of multiple runs. + +HTML_TIMESTAMP = YES + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. For this to work a browser that supports +# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox +# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). + +HTML_DYNAMIC_SECTIONS = NO + +# If the GENERATE_DOCSET tag is set to YES, additional index files +# will be generated that can be used as input for Apple's Xcode 3 +# integrated development environment, introduced with OSX 10.5 (Leopard). +# To create a documentation set, doxygen will generate a Makefile in the +# HTML output directory. Running make will produce the docset in that +# directory and running "make install" will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find +# it at startup. +# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. + +GENERATE_DOCSET = NO + +# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the +# feed. A documentation feed provides an umbrella under which multiple +# documentation sets from a single provider (such as a company or product suite) +# can be grouped. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that +# should uniquely identify the documentation set bundle. This should be a +# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen +# will append .docset to the name. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING +# is used to encode HtmlHelp index (hhk), content (hhc) and project file +# content. + +CHM_INDEX_ENCODING = + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated +# that can be used as input for Qt's qhelpgenerator to generate a +# Qt Compressed Help (.qch) of the generated HTML documentation. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can +# be used to specify the file name of the resulting .qch file. +# The path specified is relative to the HTML output folder. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#namespace + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#virtual-folders + +QHP_VIRTUAL_FOLDER = doc + +# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to +# add. For more information please see +# http://doc.trolltech.com/qthelpproject.html#custom-filters + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see +# +# Qt Help Project / Custom Filters. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's +# filter section matches. +# +# Qt Help Project / Filter Attributes. + +QHP_SECT_FILTER_ATTRS = + +# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can +# be used to specify the location of Qt's qhelpgenerator. +# If non-empty doxygen will try to run qhelpgenerator on the generated +# .qhp file. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files +# will be generated, which together with the HTML files, form an Eclipse help +# plugin. To install this plugin and make it available under the help contents +# menu in Eclipse, the contents of the directory containing the HTML and XML +# files needs to be copied into the plugins directory of eclipse. The name of +# the directory within the plugins directory should be the same as +# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before +# the help appears. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have +# this name. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + +DISABLE_INDEX = NO + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values +# (range [0,1..20]) that doxygen will group on one line in the generated HTML +# documentation. Note that a value of 0 will completely suppress the enum +# values from appearing in the overview section. + +ENUM_VALUES_PER_LINE = 4 + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. +# If the tag value is set to YES, a side panel will be generated +# containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). +# Windows users are probably better off using the HTML help feature. + +GENERATE_TREEVIEW = NO + +# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, +# and Class Hierarchy pages using a tree view instead of an ordered list. + +USE_INLINE_TREES = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open +# links to external symbols imported via tag files in a separate window. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of Latex formulas included +# as images in the HTML documentation. The default is 10. Note that +# when you change the font size after a successful doxygen run you need +# to manually remove any form_*.png images from the HTML output directory +# to force them to be regenerated. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are +# not supported properly for IE 6.0, but are supported on all modern browsers. +# Note that when changing this option you need to delete any form_*.png files +# in the HTML output before the changes have effect. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax +# (see http://www.mathjax.org) which uses client side Javascript for the +# rendering instead of using prerendered bitmaps. Use this if you do not +# have LaTeX installed or if you want to formulas look prettier in the HTML +# output. When enabled you also need to install MathJax separately and +# configure the path to it using the MATHJAX_RELPATH option. + +USE_MATHJAX = NO + +# When MathJax is enabled you need to specify the location relative to the +# HTML output directory using the MATHJAX_RELPATH option. The destination +# directory should contain the MathJax.js script. For instance, if the mathjax +# directory is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the +# mathjax.org site, so you can quickly see the result without installing +# MathJax, but it is strongly recommended to install a local copy of MathJax +# before deployment. + +MATHJAX_RELPATH = http://www.mathjax.org/mathjax + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box +# for the HTML output. The underlying search engine uses javascript +# and DHTML and should work on any modern browser. Note that when using +# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets +# (GENERATE_DOCSET) there is already a search function so this one should +# typically be disabled. For large projects the javascript based search engine +# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. + +SEARCHENGINE = NO + +# When the SERVER_BASED_SEARCH tag is enabled the search engine will be +# implemented using a PHP enabled web server instead of at the web client +# using Javascript. Doxygen will generate the search PHP script and index +# file to put on the web server. The advantage of the server +# based approach is that it scales better to large projects and allows +# full text search. The disadvantages are that it is more difficult to setup +# and does not have live searching capabilities. + +SERVER_BASED_SEARCH = NO + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = YES + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. +# Note that when enabling USE_PDFLATEX this option is only used for +# generating bitmaps for formulas in the HTML output, but not in the +# Makefile that is written to the output directory. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4wide + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for +# the generated latex document. The footer should contain everything after +# the last chapter. If it is left blank doxygen will generate a +# standard footer. Notice: only use this tag if you know what you are doing! + +LATEX_FOOTER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = NO + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = NO + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +# If LATEX_SOURCE_CODE is set to YES then doxygen will include +# source code with syntax highlighting in the LaTeX output. +# Note that which sources are shown also depends on other settings +# such as SOURCE_BROWSER. + +LATEX_SOURCE_CODE = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. +# This is useful +# if you want to understand what is going on. +# On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# pointed to by INCLUDE_PATH will be searched when a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition that +# overrules the definition found in the source code. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all references to function-like macros +# that are alone on a line, have an all uppercase name, and do not end with a +# semicolon, because these will confuse the parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool +# does not have to be run to correct the links. +# Note that each tag file must have a unique name +# (where the name does NOT include the path) +# If a tag file is not located in the directory in which doxygen +# is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option also works with HAVE_DOT disabled, but it is recommended to +# install and use dot, since it yields more powerful graphs. + +CLASS_DIAGRAMS = YES + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see +# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the +# documentation. The MSCGEN_PATH tag allows you to specify the directory where +# the mscgen tool resides. If left empty the tool is assumed to be found in the +# default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = YES + +# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is +# allowed to run in parallel. When set to 0 (the default) doxygen will +# base this on the number of processors available in the system. You can set it +# explicitly to a value larger than 0 to get control over the balance +# between CPU load and processing speed. + +DOT_NUM_THREADS = 0 + +# By default doxygen will write a font called Helvetica to the output +# directory and reference it in all dot files that doxygen generates. +# When you want a differently looking font you can specify the font name +# using DOT_FONTNAME. You need to make sure dot is able to find the font, +# which can be done by putting it in a standard location or by setting the +# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory +# containing the font. + +DOT_FONTNAME = Helvetica + +# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. +# The default size is 10pt. + +DOT_FONTSIZE = 10 + +# By default doxygen will tell dot to use the output directory to look for the +# FreeSans.ttf font (which doxygen will put there itself). If you specify a +# different font using DOT_FONTNAME you can set the path where dot +# can find it using this tag. + +DOT_FONTPATH = + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH and HAVE_DOT options are set to YES then +# doxygen will generate a call dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable call graphs +# for selected functions only using the \callgraph command. + +CALL_GRAPH = NO + +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then +# doxygen will generate a caller dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable caller +# graphs for selected functions only using the \callergraph command. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will generate a graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are svg, png, jpg, or gif. +# If left blank png will be used. + +DOT_IMAGE_FORMAT = png + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The MSCFILE_DIRS tag can be used to specify one or more directories that +# contain msc files that are included in the documentation (see the +# \mscfile command). + +MSCFILE_DIRS = + +# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the +# number of direct children of the root node in a graph is already larger than +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. + +DOT_GRAPH_MAX_NODES = 50 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. + +MAX_DOT_GRAPH_DEPTH = 0 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, because dot on Windows does not +# seem to support this out of the box. Warning: Depending on the platform used, +# enabling this option may lead to badly anti-aliased labels on the edges of +# a graph (i.e. they become hard to read). + +DOT_TRANSPARENT = NO + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = NO + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES diff --git a/3rdparty/quazip-0.5.1/FindQuaZip.cmake b/3rdparty/quazip-0.5.1/FindQuaZip.cmake new file mode 100644 index 00000000..0142ca37 --- /dev/null +++ b/3rdparty/quazip-0.5.1/FindQuaZip.cmake @@ -0,0 +1,40 @@ +# QUAZIP_FOUND - QuaZip library was found +# QUAZIP_INCLUDE_DIR - Path to QuaZip include dir +# QUAZIP_INCLUDE_DIRS - Path to QuaZip and zlib include dir (combined from QUAZIP_INCLUDE_DIR + ZLIB_INCLUDE_DIR) +# QUAZIP_LIBRARIES - List of QuaZip libraries +# QUAZIP_ZLIB_INCLUDE_DIR - The include dir of zlib headers + + +IF (QUAZIP_INCLUDE_DIRS AND QUAZIP_LIBRARIES) + # in cache already + SET(QUAZIP_FOUND TRUE) +ELSE (QUAZIP_INCLUDE_DIRS AND QUAZIP_LIBRARIES) + IF (WIN32) + FIND_PATH(QUAZIP_LIBRARY_DIR + WIN32_DEBUG_POSTFIX d + NAMES libquazip.dll + HINTS "C:/Programme/" "C:/Program Files" + PATH_SUFFIXES QuaZip/lib + ) + FIND_LIBRARY(QUAZIP_LIBRARIES NAMES libquazip.dll HINTS ${QUAZIP_LIBRARY_DIR}) + FIND_PATH(QUAZIP_INCLUDE_DIR NAMES quazip.h HINTS ${QUAZIP_LIBRARY_DIR}/../ PATH_SUFFIXES include/quazip) + FIND_PATH(QUAZIP_ZLIB_INCLUDE_DIR NAMES zlib.h) + ELSE(WIN32) + FIND_PACKAGE(PkgConfig) +# pkg_check_modules(PC_QCA2 QUIET qca2) + pkg_check_modules(PC_QUAZIP quazip) + FIND_LIBRARY(QUAZIP_LIBRARIES + WIN32_DEBUG_POSTFIX d + NAMES quazip + HINTS /usr/lib /usr/lib64 + ) + FIND_PATH(QUAZIP_INCLUDE_DIR quazip.h + HINTS /usr/include /usr/local/include + PATH_SUFFIXES quazip + ) + FIND_PATH(QUAZIP_ZLIB_INCLUDE_DIR zlib.h HINTS /usr/include /usr/local/include) + ENDIF (WIN32) + INCLUDE(FindPackageHandleStandardArgs) + SET(QUAZIP_INCLUDE_DIRS ${QUAZIP_INCLUDE_DIR} ${QUAZIP_ZLIB_INCLUDE_DIR}) + find_package_handle_standard_args(QUAZIP DEFAULT_MSG QUAZIP_LIBRARIES QUAZIP_INCLUDE_DIR QUAZIP_ZLIB_INCLUDE_DIR QUAZIP_INCLUDE_DIRS) +ENDIF (QUAZIP_INCLUDE_DIRS AND QUAZIP_LIBRARIES) diff --git a/3rdparty/quazip-0.5.1/NEWS.txt b/3rdparty/quazip-0.5.1/NEWS.txt new file mode 100644 index 00000000..9bbe97c0 --- /dev/null +++ b/3rdparty/quazip-0.5.1/NEWS.txt @@ -0,0 +1,111 @@ +QuaZIP changes + +* 2013-03-02 0.5.1 + * Lots of QuaZipDir fixes, thanks to all bug reporters. + * Full Qt Creator support. + * MS VS 2010 Express support. + * Qt5 support (didn't need any source code changes anyway). + * Lots of minor bug fixes. + +* 2012-09-07 0.5 + * Added run_moc.bat files for building under Windows in case Qt + integration is not available (e. g. VS 2008 Express). + * Added the QuaZipDir class to simplify ZIP navigation in terms + of directories. + * Added the QuaGzipFile class for working with GZIP archives. It + was added as a bonus since it has nothing to do with the main + purpose of the library. It probably won't get any major + improvements, although minor bug fixes are possible. + * Added the QuaZIODevice class for working with zlib + compression. It has nothing to do with the ZIP format, and + therefore the same notice as for the QuaGzipFile applies. + * The global comment is no longer erased when adding files to + an archive. + * Many bug fixes. + +* 2012-01-14 0.4.4 + * Fixed isSequential() test that was causing open() failures on + Unix. + * Fixed sub-directory compressing in JlCompress. + * Added MS VS 2008 solution, compatible with the binary Qt + distribution (tested on MS VS 2008 Express, had to run MOC + manually due to the lack of plugin in Express). + * Fixed extracting directories in JlCompress. + * Fixed JlCompress.h includes in the test suite, which used + lowercase names thus breaking on case-sensitive systems. + * Implemented missing QuaZipFile::getZip() that was only + declared. + * Fixed reopening closed files. + * Fixed possible memory leak in case of open error. + +* 2011-09-09 0.4.3 + * New test suite using QTestLib. + * Fixed bytesAvailable(), pos() and atEnd(). + * Added ZIP v1.0 support and disabling data descriptor for + compatibility with some older software. + * Fixed DLL export/import issues for some symbols. + * Added QUAZIP_STATIC macro for compiling as a static library or + directly including the source. + * Added getFileNameList() and getFileInfoList() convenience + functions. + * Added some buffering to JlCompress to improve performance. + +* 2011-08-10 0.4.2 + * Cmake patch (thanks to Bernhard Rosenkraenzer). + * Symbian patch (thanks to Hamish Willee). + * Documented the multiple files limitation of QuaZipFile. + * Fixed relative paths handling in JlCompress. + * Fixed linking to MinGW zlib. + +* 2011-05-26 0.4.1 + * License statement updated to avoid confusion. GPL license + removed for the very same reason. + * Parts of original package are now clearly marked as modified, + just as their license requires. + +* 2011-05-23 0.4 + * QuaZip and QuaZipFile classes now use the Pimpl idiom. This + means that future releases will probably be binary compatible + with this one, but it also means that this one is binary + incompatible with the old ones. + * IO API has been rewritten using QIODevice instead of standard + C library. Among other things it means that QuaZip now supports + files up to 4 GB in size instead of 2 GB. + * Added QuaZip methods allowing access to ZIP files represented + by any seekable QIODevice implementation (QBuffer is a good + example). + +* 2010-07-23 0.3 + * Fixed getComment() for global comments. + * Added some useful classes for calculating checksums (thanks to + Adam Walczak). + * Added some utility classes for working with whole directories + (thanks to Roberto Pompermaier). It would be nice if someone + documents these in English, though. + * Probably fixed some problems with passwords (thanks to Vasiliy + Sorokin). I didn't test it, though. + +* 2008-09-17 0.2.3 + * Fixed license notices in sources. + +* SVN + * Fixed a small bug in QuaZipFile::atEnd(). + +* 2007-01-16 0.2.2 + * Added LGPL as alternative license. + * Added FAQ documentation page. + +* 2006-03-21 0.2.1 + * Fixed setCommentCodec() bug. + * Fixed bug that set month 1-12 instead of 0-11, as specified in + zip.h. + * Added workaround for Qt's bug that caused wrong timestamps. + * Few documentation fixes and cosmetic changes. + +* 2005-07-08 0.2 + * Write support. + * Extended QuaZipFile API, including size(), *pos() functions. + * Support for comments encoding/decoding. + +* 2005-07-01 0.1 + * Initial version. diff --git a/3rdparty/quazip-0.5.1/README.txt b/3rdparty/quazip-0.5.1/README.txt new file mode 100644 index 00000000..811ac8a8 --- /dev/null +++ b/3rdparty/quazip-0.5.1/README.txt @@ -0,0 +1,66 @@ +QuaZIP is the C++ wrapper for Gilles Vollant's ZIP/UNZIP package +(AKA minizip) using Trolltech's Qt library. + +It uses existing ZIP/UNZIP package C code and therefore depends on +the zlib library. + +Also, it depends on Qt 4. + +To compile it on UNIX dialect: + +$ cd quazip +$ qmake +$ make + +You must make sure that: +* You have Qt 4 properly and fully installed (including tools and + headers, not just library) +* "qmake" command runs Qt 4's qmake, not some other version (you'll have + to type full path to qmake otherwise). + +To install compiled shared library, just type: + +$ make install + +By default, it installs in /usr/local, but you may change it using + +$ qmake PREFIX=/wherever/you/want/to/install + +You do not have to compile and install QuaZIP to use it. You can just +(and sometimes it may be the best way) add QuaZIP's source files to your +project and use them. + +See doc/html or, if you do not have a browser, quazip/*.h and +quazip/doc/* files for the more detailed documentation. + +For Windows, it's essentially the same, but you may have to adjust +settings for different environments. + +If you want to include QuaZIP sources directly in your project or if +you want to use QuaZIP compiled as a static library using +"qmake CONFIG+=statliclib", you have to define the QUAZIP_STATIC macro, +otherwise you're likely to run into problems as QuaZIP symbols will be +marked as dllimported. + +Copyright notice: + +Copyright (C) 2005-2012 Sergey A. Tachenov + +This program is free software; you can redistribute it and/or modify it +under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2 of the License, or (at +your option) any later version. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser +General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with this program; if not, write to the Free Software Foundation, +Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +See COPYING file for the full LGPL text. + +Original ZIP package is copyrighted by Gilles Vollant, see +quazip/(un)zip.h files for details, basically it's zlib license. diff --git a/3rdparty/quazip-0.5.1/doc/html/JlCompress_8h_source.html b/3rdparty/quazip-0.5.1/doc/html/JlCompress_8h_source.html new file mode 100644 index 00000000..fe3ae7d1 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/JlCompress_8h_source.html @@ -0,0 +1,97 @@ + + + + +QuaZIP: quazip/JlCompress.h Source File + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ + + +
+
+
+
JlCompress.h
+
+
+
00001 #ifndef JLCOMPRESSFOLDER_H_
+00002 #define JLCOMPRESSFOLDER_H_
+00003 
+00004 #include "quazip.h"
+00005 #include "quazipfile.h"
+00006 #include "quazipfileinfo.h"
+00007 #include <QString>
+00008 #include <QDir>
+00009 #include <QFileInfo>
+00010 #include <QFile>
+00011 
+00013 
+00017 class QUAZIP_EXPORT JlCompress {
+00018 private:
+00020 
+00026     static bool compressFile(QuaZip* zip, QString fileName, QString fileDest);
+00028 
+00037     static bool compressSubDir(QuaZip* parentZip, QString dir, QString parentDir, bool recursive = true);
+00039 
+00045     static bool extractFile(QuaZip* zip, QString fileName, QString fileDest);
+00047 
+00051     static bool removeFile(QStringList listFile);
+00052 
+00053 public:
+00055 
+00060     static bool compressFile(QString fileCompressed, QString file);
+00062 
+00067     static bool compressFiles(QString fileCompressed, QStringList files);
+00069 
+00076     static bool compressDir(QString fileCompressed, QString dir = QString(), bool recursive = true);
+00077 
+00078 public:
+00080 
+00087     static QString extractFile(QString fileCompressed, QString fileName, QString fileDest = QString());
+00089 
+00096     static QStringList extractFiles(QString fileCompressed, QStringList files, QString dir = QString());
+00098 
+00104     static QStringList extractDir(QString fileCompressed, QString dir = QString());
+00106 
+00111     static QStringList getFileList(QString fileCompressed);
+00112 };
+00113 
+00114 #endif /* JLCOMPRESSFOLDER_H_ */
+
+ + + + diff --git a/3rdparty/quazip-0.5.1/doc/html/annotated.html b/3rdparty/quazip-0.5.1/doc/html/annotated.html new file mode 100644 index 00000000..11688631 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/annotated.html @@ -0,0 +1,65 @@ + + + + +QuaZIP: Class List + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ + +
+
+
+
Class List
+
+
+
Here are the classes, structs, unions and interfaces with brief descriptions:
+ + + + + + + + + + + + + +
JlCompressUtility class for typical operations
QuaAdler32Adler32 checksum
QuaChecksum32Checksum interface
QuaCrc32CRC32 checksum
QuaGzipFileGZIP file
QuaZIODeviceA class to compress/decompress QIODevice
QuaZipZIP archive
QuaZipDirProvides ZIP archive navigation
QuaZipFileA file inside ZIP archive
QuaZipFileInfoInformation about a file inside archive
QuaZipFilePrivateThe implementation class for QuaZip
QuaZipNewInfoInformation about a file to be created
QuaZipPrivateAll the internal stuff for the QuaZip class
+
+ + + diff --git a/3rdparty/quazip-0.5.1/doc/html/bc_s.png b/3rdparty/quazip-0.5.1/doc/html/bc_s.png new file mode 100644 index 0000000000000000000000000000000000000000..51ba0066debbeac813d4014d805dc95ebd5b532e GIT binary patch literal 705 zcmV;y0zUnTP)rF$rQRw6Q(&UpP1C2j9>6opbR!_oV&F*Ar#jFVPDcrqyulXW;j+8j#k`kzKrw^%mxu{{V1|%gWybaP{#p01Ow~ zB}u2{E{(}bUp!#{_s(CTu-lqpI0GO7kSiTS0H7s=EN*pJI7&&m$E!@mK+B_{Xx(nj zH0-yS_)(8nX^er(4+o=lHsk1YNuDJFz~=EOD_HN~zW*iu%I90GV!oc&bWQk_4geq* z?tP92Q)0;sZ>cqtNr zOitc-rw&Cz$YQa>g0&|*N&WS=YH&7966!J}!88AdX)_x%jMh)j1wW9Z z*IvhmrFxz{vu`%7PR#}L0f5_4b|fCOXQid+8KYfFC_DlHq_*W{G_-J(_zH3*04SWE z4=w=!x2-hRp+Pe7IRei{XXZoQv3aO*zlhc|&K$GAain(EABqhLSF-2uT86!Xj#Z0B zU3k_Xawp7W)%kt^=&@!R3-to)mi?gz3E*IJe>$ba=d_9I2l8b9axei@p6k1qW)^BJ zqHa=NSguR@Srtva-n?v)XN=T%7nVoVfN2cYfePZIbCZQi`9_mavc00000NkvXXu0mjfn{!2m literal 0 HcmV?d00001 diff --git a/3rdparty/quazip-0.5.1/doc/html/classJlCompress-members.html b/3rdparty/quazip-0.5.1/doc/html/classJlCompress-members.html new file mode 100644 index 00000000..13c81c45 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/classJlCompress-members.html @@ -0,0 +1,58 @@ + + + + +QuaZIP: Member List + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ + +
+
+
+
JlCompress Member List
+
+
+This is the complete list of members for JlCompress, including all inherited members. + + + + + + + +
compressDir(QString fileCompressed, QString dir=QString(), bool recursive=true)JlCompress [static]
compressFile(QString fileCompressed, QString file)JlCompress [static]
compressFiles(QString fileCompressed, QStringList files)JlCompress [static]
extractDir(QString fileCompressed, QString dir=QString())JlCompress [static]
extractFile(QString fileCompressed, QString fileName, QString fileDest=QString())JlCompress [static]
extractFiles(QString fileCompressed, QStringList files, QString dir=QString())JlCompress [static]
getFileList(QString fileCompressed)JlCompress [static]
+ + + diff --git a/3rdparty/quazip-0.5.1/doc/html/classJlCompress.html b/3rdparty/quazip-0.5.1/doc/html/classJlCompress.html new file mode 100644 index 00000000..0541c4d1 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/classJlCompress.html @@ -0,0 +1,376 @@ + + + + +QuaZIP: JlCompress Class Reference + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ + +
+
+ +
+
JlCompress Class Reference
+
+
+ +

Utility class for typical operations. + More...

+ +

#include <JlCompress.h>

+ +

List of all members.

+ + + + + + + + + + + + + + + + +

+Static Public Member Functions

static bool compressFile (QString fileCompressed, QString file)
 Compress a single file.
static bool compressFiles (QString fileCompressed, QStringList files)
 Compress a list of files.
static bool compressDir (QString fileCompressed, QString dir=QString(), bool recursive=true)
 Compress a whole directory.
static QString extractFile (QString fileCompressed, QString fileName, QString fileDest=QString())
 Extract a single file.
static QStringList extractFiles (QString fileCompressed, QStringList files, QString dir=QString())
 Extract a list of files.
static QStringList extractDir (QString fileCompressed, QString dir=QString())
 Extract a whole archive.
static QStringList getFileList (QString fileCompressed)
 Get the file list.
+

Detailed Description

+

Utility class for typical operations.

+

This class contains a number of useful static functions to perform simple operations, such as mass ZIP packing or extraction.

+

Member Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
bool JlCompress::compressFile (QString fileCompressed,
QString file 
) [static]
+
+
+ +

Compress a single file.

+
Parameters:
+ + + +
fileCompressedThe name of the archive.
fileThe file to compress.
+
+
+
Returns:
true if success, false otherwise.
+

OK Comprime il file fileName nel file fileCompressed. Se la funzione fallisce restituisce false e cancella il file che si e tentato di creare.

+

La funzione fallisce se: * non si riesce ad aprire l'oggetto zip; * la compressione del file fallisce; * non si riesce a chiudere l'oggetto zip;

+ +

References QuaZip::close(), QuaZip::getZipError(), QuaZip::mdCreate, and QuaZip::open().

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
bool JlCompress::compressFiles (QString fileCompressed,
QStringList files 
) [static]
+
+
+ +

Compress a list of files.

+
Parameters:
+ + + +
fileCompressedThe name of the archive.
filesThe file list to compress.
+
+
+
Returns:
true if success, false otherwise.
+

OK Comprime i file specificati in files nel file fileCompressed. Se la funzione fallisce restituisce false e cancella il file che si e tentato di creare.

+

La funzione fallisce se: * non si riesce ad aprire l'oggetto zip; * la compressione di un file fallisce; * non si riesce a chiudere l'oggetto zip;

+ +

References QuaZip::close(), QuaZip::getZipError(), QuaZip::mdCreate, and QuaZip::open().

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
bool JlCompress::compressDir (QString fileCompressed,
QString dir = QString(),
bool recursive = true 
) [static]
+
+
+ +

Compress a whole directory.

+
Parameters:
+ + + + +
fileCompressedThe name of the archive.
dirThe directory to compress.
recursiveWhether to pack the subdirectories as well, or just regular files.
+
+
+
Returns:
true if success, false otherwise.
+

OK Comprime la cartella dir nel file fileCompressed, se recursive e true allora comprime anche le sotto cartelle. Se la funzione fallisce restituisce false e cancella il file che si e tentato di creare.

+

La funzione fallisce se: * non si riesce ad aprire l'oggetto zip; * la compressione di un file fallisce; * non si riesce a chiudere l'oggetto zip;

+ +

References QuaZip::close(), QuaZip::getZipError(), QuaZip::mdCreate, and QuaZip::open().

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
QString JlCompress::extractFile (QString fileCompressed,
QString fileName,
QString fileDest = QString() 
) [static]
+
+
+ +

Extract a single file.

+
Parameters:
+ + + + +
fileCompressedThe name of the archive.
fileNameThe file to extract.
fileDestThe destination file, assumed to be identical to file if left empty.
+
+
+
Returns:
The list of the full paths of the files extracted, empty on failure.
+

OK Estrae il file fileName, contenuto nel file fileCompressed, con il nome fileDest. Se fileDest = "" allora il file viene estratto con lo stesso nome con cui e stato compresso. Se la funzione fallisce cancella il file che si e tentato di estrarre. Restituisce il nome assoluto del file estratto.

+

La funzione fallisce se: * non si riesce ad aprire l'oggetto zip; * l'estrazione del file fallisce; * non si riesce a chiudere l'oggetto zip;

+ +

References QuaZip::close(), QuaZip::getZipError(), QuaZip::mdUnzip, and QuaZip::open().

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
QStringList JlCompress::extractFiles (QString fileCompressed,
QStringList files,
QString dir = QString() 
) [static]
+
+
+ +

Extract a list of files.

+
Parameters:
+ + + + +
fileCompressedThe name of the archive.
filesThe file list to extract.
dirThe directory to put the files to, the current directory if left empty.
+
+
+
Returns:
The list of the full paths of the files extracted, empty on failure.
+

OK Estrae i file specificati in files, contenuti nel file fileCompressed, nella cartella dir. La struttura a cartelle del file compresso viene rispettata. Se dir = "" allora il file viene estratto nella cartella corrente. Se la funzione fallisce cancella i file che si e tentato di estrarre. Restituisce i nomi assoluti dei file estratti.

+

La funzione fallisce se: * non si riesce ad aprire l'oggetto zip; * l'estrazione di un file fallisce; * non si riesce a chiudere l'oggetto zip;

+ +

References QuaZip::close(), QuaZip::getZipError(), QuaZip::mdUnzip, and QuaZip::open().

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
QStringList JlCompress::extractDir (QString fileCompressed,
QString dir = QString() 
) [static]
+
+
+ +

Extract a whole archive.

+
Parameters:
+ + + +
fileCompressedThe name of the archive.
dirThe directory to extract to, the current directory if left empty.
+
+
+
Returns:
The list of the full paths of the files extracted, empty on failure.
+

OK Estrae il file fileCompressed nella cartella dir. Se dir = "" allora il file viene estratto nella cartella corrente. Se la funzione fallisce cancella i file che si e tentato di estrarre. Restituisce i nomi assoluti dei file estratti.

+

La funzione fallisce se: * non si riesce ad aprire l'oggetto zip; * la compressione di un file fallisce; * non si riesce a chiudere l'oggetto zip;

+ +

References QuaZip::close(), QuaZip::getCurrentFileName(), QuaZip::getZipError(), QuaZip::goToFirstFile(), QuaZip::goToNextFile(), QuaZip::mdUnzip, and QuaZip::open().

+ +
+
+ +
+
+ + + + + + + + +
QStringList JlCompress::getFileList (QString fileCompressed) [static]
+
+
+ +

Get the file list.

+
Returns:
The list of the files in the archive, or, more precisely, the list of the entries, including both files and directories if they are present separately.
+

OK Restituisce la lista dei file resenti nel file compresso fileCompressed. Se la funzione fallisce, restituisce un elenco vuoto.

+

La funzione fallisce se: * non si riesce ad aprire l'oggetto zip; * la richiesta di informazioni di un file fallisce; * non si riesce a chiudere l'oggetto zip;

+ +

References QuaZip::close(), QuaZip::getCurrentFileInfo(), QuaZip::getZipError(), QuaZip::goToFirstFile(), QuaZip::goToNextFile(), QuaZip::mdUnzip, QuaZipFileInfo::name, and QuaZip::open().

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + diff --git a/3rdparty/quazip-0.5.1/doc/html/classQuaAdler32-members.html b/3rdparty/quazip-0.5.1/doc/html/classQuaAdler32-members.html new file mode 100644 index 00000000..194c03a7 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/classQuaAdler32-members.html @@ -0,0 +1,56 @@ + + + + +QuaZIP: Member List + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ + +
+
+
+
QuaAdler32 Member List
+
+
+This is the complete list of members for QuaAdler32, including all inherited members. + + + + + +
calculate(const QByteArray &data)QuaAdler32 [virtual]
QuaAdler32() (defined in QuaAdler32)QuaAdler32
reset()QuaAdler32 [virtual]
update(const QByteArray &buf)QuaAdler32 [virtual]
value()QuaAdler32 [virtual]
+ + + diff --git a/3rdparty/quazip-0.5.1/doc/html/classQuaAdler32.html b/3rdparty/quazip-0.5.1/doc/html/classQuaAdler32.html new file mode 100644 index 00000000..a05147c1 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/classQuaAdler32.html @@ -0,0 +1,161 @@ + + + + +QuaZIP: QuaAdler32 Class Reference + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ + +
+
+ +
+
QuaAdler32 Class Reference
+
+
+ +

Adler32 checksum. + More...

+ +

#include <quazip/quaadler32.h>

+
+Inheritance diagram for QuaAdler32:
+
+
Inheritance graph
+ + +
[legend]
+
+Collaboration diagram for QuaAdler32:
+
+
Collaboration graph
+ + +
[legend]
+ +

List of all members.

+ + + + + + + + + + +

+Public Member Functions

quint32 calculate (const QByteArray &data)
 Calculates the checksum for data.
+void reset ()
 Resets the calculation on a checksun for a stream.
void update (const QByteArray &buf)
 Updates the calculated checksum for the stream.
quint32 value ()
 Value of the checksum calculated for the stream passed throw update().
+

Detailed Description

+

Adler32 checksum.

+

This class wrappers the adler32 function with the QuaChecksum32 interface. See QuaChecksum32 for more info.

+

Member Function Documentation

+ +
+
+ + + + + + + + +
quint32 QuaAdler32::calculate (const QByteArray & data) [virtual]
+
+
+ +

Calculates the checksum for data.

+

data source data

+
Returns:
data checksum
+

This function has no efect on the value returned by value().

+ +

Implements QuaChecksum32.

+ +
+
+ +
+
+ + + + + + + + +
void QuaAdler32::update (const QByteArray & buf) [virtual]
+
+
+ +

Updates the calculated checksum for the stream.

+

buf next portion of data from the stream

+ +

Implements QuaChecksum32.

+ +
+
+ +
+
+ + + + + + + +
quint32 QuaAdler32::value () [virtual]
+
+
+ +

Value of the checksum calculated for the stream passed throw update().

+
Returns:
checksum
+ +

Implements QuaChecksum32.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + diff --git a/3rdparty/quazip-0.5.1/doc/html/classQuaAdler32__coll__graph.map b/3rdparty/quazip-0.5.1/doc/html/classQuaAdler32__coll__graph.map new file mode 100644 index 00000000..a6932a7a --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/classQuaAdler32__coll__graph.map @@ -0,0 +1,3 @@ + + + diff --git a/3rdparty/quazip-0.5.1/doc/html/classQuaAdler32__coll__graph.md5 b/3rdparty/quazip-0.5.1/doc/html/classQuaAdler32__coll__graph.md5 new file mode 100644 index 00000000..3e34b51d --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/classQuaAdler32__coll__graph.md5 @@ -0,0 +1 @@ +f6aef7d7bad2a6a2c0f29520e9cdb67f \ No newline at end of file diff --git a/3rdparty/quazip-0.5.1/doc/html/classQuaAdler32__coll__graph.png b/3rdparty/quazip-0.5.1/doc/html/classQuaAdler32__coll__graph.png new file mode 100644 index 0000000000000000000000000000000000000000..70f8b85ec06c24b7cf724c5bcf88a693bedc5e16 GIT binary patch literal 1406 zcmeAS@N?(olHy`uVBq!ia0vp^tw3DB!2~4tKUX;jq}Y|gW!U_%O^81uo`>1 zIEGZrc{|58TiR2iA$@C??7IgXY~r31o%So(A7D4zvE$GZgCEQ>GK}A!9hiDhLi{It zILmas@QJ|@DlH;icWx}`h;icB)vOaE93cEipx$H6mhd;Jl5hLc!auJ|zc=;Xa*oAk z&#W$gcJt?jThpHYwo|?kU@(`#km2V6Rxom%Sbs5ZyScgf`t|F5Q;i#Qa&vWcbzAk> zYp%ThnzeP;rcH}%S93o7^5x5i4+Sgw8IBj4EHk;dX5Bisbr=3Ma({xMgLU(SPH#G7 z^h7a2qMbh}Qq164uibRvZ?=;e1HTBq+)(uYXPdcgN2KDL>M-U-o8pe%*YV(xaM$gq zYhj*yb?%hE{|@$NE|F2llzthyXP-fb%_bZ6L`#hirozVOxxW5QRuQ?jbVJmh2^EGP zYlVv+Jl-sC?xo@saH6dD>Jw+h%nIR?3)I>Ab(T!x`ZPNs#N=l}vvzZv!pB*E{*@H7 zvp-nL@~V0MxldV#iWe@KHQ`Ha?|K8Ds^D}cn>DBEweNk&g&{xR zoXm2bCL{BpPxQHaibkdCq2%m}z#9fS%j++1*kp5P!;zM=!9wqu9`~h8e7$(lzPO|I zO(%jMwmS&9%jrJ7`G48$)3Y5GJP+TYAdij&YW`VRSX`KYJmt}@yp%6#ijKR@f> z{(0BU=W+`3l`R85djw`dew>n(@>@pUW`*szQJsX`4 zt_ry)afaP*A5d%l5BZaoar?uvYk!xe8mKB*e*5_J^wE#Ge}{r-`7?S1{}#d}ho-Z*}FdGC+It#$Y9t$$z1n=kFj=@(a9^Y72rn}4?77q@w{ z@$I3H8xvkVY1;G4!tP)8jb`)nuS2ye|0b+>|J`+SYSpi6cX#h^(cfSH{?5MI)e(RG zf15S)=gok)fMXAT>LtIqx7U82&CkCN53?^5Zk%-eYgUXRMsQsM zkB!ZVih%Xk8wE4|L-QRl_qFbOpB@nr!Et(P6t9Grkm8^C%B@H482MP(&Z==~Q~T?| z%gx$3L2WyaupFoC>(D*Mj_sy))W;W_jON`|VtD!e z_lIDwh&~<7Kl2s}^yX(|rLoMIFYh#kJ#|T2&C^@_kKDHA%JIDYld#CzcHf~Da~HVz zIzR8Z_*PkB`Vl#<@JSVizbsy3wrp0af$eM2{TwaXhgN*wx}o!sW$ukF!q=|spPn&G zeq!U}sT{{m_RJ_c^7N{bxl2->&la;+h0MS9*&Q#ucJ103Igfyi`}f;hTfesGD`Hvl ze067Q&4VUXq||)A`S$JG9~2%pzTVZ{-93RrLB6=S`1R}8d*k$XzDfzunrdcdrXYCi m$?q@6*>2evINCwcNBM+H@g01Rjo5$%Dubu1pUXO@geCw=D72ga literal 0 HcmV?d00001 diff --git a/3rdparty/quazip-0.5.1/doc/html/classQuaAdler32__inherit__graph.map b/3rdparty/quazip-0.5.1/doc/html/classQuaAdler32__inherit__graph.map new file mode 100644 index 00000000..a6932a7a --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/classQuaAdler32__inherit__graph.map @@ -0,0 +1,3 @@ + + + diff --git a/3rdparty/quazip-0.5.1/doc/html/classQuaAdler32__inherit__graph.md5 b/3rdparty/quazip-0.5.1/doc/html/classQuaAdler32__inherit__graph.md5 new file mode 100644 index 00000000..3e34b51d --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/classQuaAdler32__inherit__graph.md5 @@ -0,0 +1 @@ +f6aef7d7bad2a6a2c0f29520e9cdb67f \ No newline at end of file diff --git a/3rdparty/quazip-0.5.1/doc/html/classQuaAdler32__inherit__graph.png b/3rdparty/quazip-0.5.1/doc/html/classQuaAdler32__inherit__graph.png new file mode 100644 index 0000000000000000000000000000000000000000..70f8b85ec06c24b7cf724c5bcf88a693bedc5e16 GIT binary patch literal 1406 zcmeAS@N?(olHy`uVBq!ia0vp^tw3DB!2~4tKUX;jq}Y|gW!U_%O^81uo`>1 zIEGZrc{|58TiR2iA$@C??7IgXY~r31o%So(A7D4zvE$GZgCEQ>GK}A!9hiDhLi{It zILmas@QJ|@DlH;icWx}`h;icB)vOaE93cEipx$H6mhd;Jl5hLc!auJ|zc=;Xa*oAk z&#W$gcJt?jThpHYwo|?kU@(`#km2V6Rxom%Sbs5ZyScgf`t|F5Q;i#Qa&vWcbzAk> zYp%ThnzeP;rcH}%S93o7^5x5i4+Sgw8IBj4EHk;dX5Bisbr=3Ma({xMgLU(SPH#G7 z^h7a2qMbh}Qq164uibRvZ?=;e1HTBq+)(uYXPdcgN2KDL>M-U-o8pe%*YV(xaM$gq zYhj*yb?%hE{|@$NE|F2llzthyXP-fb%_bZ6L`#hirozVOxxW5QRuQ?jbVJmh2^EGP zYlVv+Jl-sC?xo@saH6dD>Jw+h%nIR?3)I>Ab(T!x`ZPNs#N=l}vvzZv!pB*E{*@H7 zvp-nL@~V0MxldV#iWe@KHQ`Ha?|K8Ds^D}cn>DBEweNk&g&{xR zoXm2bCL{BpPxQHaibkdCq2%m}z#9fS%j++1*kp5P!;zM=!9wqu9`~h8e7$(lzPO|I zO(%jMwmS&9%jrJ7`G48$)3Y5GJP+TYAdij&YW`VRSX`KYJmt}@yp%6#ijKR@f> z{(0BU=W+`3l`R85djw`dew>n(@>@pUW`*szQJsX`4 zt_ry)afaP*A5d%l5BZaoar?uvYk!xe8mKB*e*5_J^wE#Ge}{r-`7?S1{}#d}ho-Z*}FdGC+It#$Y9t$$z1n=kFj=@(a9^Y72rn}4?77q@w{ z@$I3H8xvkVY1;G4!tP)8jb`)nuS2ye|0b+>|J`+SYSpi6cX#h^(cfSH{?5MI)e(RG zf15S)=gok)fMXAT>LtIqx7U82&CkCN53?^5Zk%-eYgUXRMsQsM zkB!ZVih%Xk8wE4|L-QRl_qFbOpB@nr!Et(P6t9Grkm8^C%B@H482MP(&Z==~Q~T?| z%gx$3L2WyaupFoC>(D*Mj_sy))W;W_jON`|VtD!e z_lIDwh&~<7Kl2s}^yX(|rLoMIFYh#kJ#|T2&C^@_kKDHA%JIDYld#CzcHf~Da~HVz zIzR8Z_*PkB`Vl#<@JSVizbsy3wrp0af$eM2{TwaXhgN*wx}o!sW$ukF!q=|spPn&G zeq!U}sT{{m_RJ_c^7N{bxl2->&la;+h0MS9*&Q#ucJ103Igfyi`}f;hTfesGD`Hvl ze067Q&4VUXq||)A`S$JG9~2%pzTVZ{-93RrLB6=S`1R}8d*k$XzDfzunrdcdrXYCi m$?q@6*>2evINCwcNBM+H@g01Rjo5$%Dubu1pUXO@geCw=D72ga literal 0 HcmV?d00001 diff --git a/3rdparty/quazip-0.5.1/doc/html/classQuaChecksum32-members.html b/3rdparty/quazip-0.5.1/doc/html/classQuaChecksum32-members.html new file mode 100644 index 00000000..59a6b9a8 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/classQuaChecksum32-members.html @@ -0,0 +1,55 @@ + + + + +QuaZIP: Member List + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ + +
+
+
+
QuaChecksum32 Member List
+
+
+This is the complete list of members for QuaChecksum32, including all inherited members. + + + + +
calculate(const QByteArray &data)=0QuaChecksum32 [pure virtual]
reset()=0QuaChecksum32 [pure virtual]
update(const QByteArray &buf)=0QuaChecksum32 [pure virtual]
value()=0QuaChecksum32 [pure virtual]
+ + + diff --git a/3rdparty/quazip-0.5.1/doc/html/classQuaChecksum32.html b/3rdparty/quazip-0.5.1/doc/html/classQuaChecksum32.html new file mode 100644 index 00000000..f76cad41 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/classQuaChecksum32.html @@ -0,0 +1,164 @@ + + + + +QuaZIP: QuaChecksum32 Class Reference + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ + +
+
+ +
+
QuaChecksum32 Class Reference
+
+
+ +

Checksum interface. + More...

+ +

#include <quazip/quachecksum32.h>

+
+Inheritance diagram for QuaChecksum32:
+
+
Inheritance graph
+ + +
[legend]
+ +

List of all members.

+ + + + + + + + + + +

+Public Member Functions

virtual quint32 calculate (const QByteArray &data)=0
 Calculates the checksum for data.
+virtual void reset ()=0
 Resets the calculation on a checksun for a stream.
virtual void update (const QByteArray &buf)=0
 Updates the calculated checksum for the stream.
virtual quint32 value ()=0
 Value of the checksum calculated for the stream passed throw update().
+

Detailed Description

+

Checksum interface.

+

This is an interface for 32 bit checksums. Classes implementing this interface can calcunate a certin checksum in a single step:

+
 QChecksum32 *crc32 = new QuaCrc32(); 
+ rasoult = crc32->calculate(data);
+

or by streaming the data:

+
 QChecksum32 *crc32 = new QuaCrc32(); 
+ while(!fileA.atEnd())
+     crc32->update(fileA.read(bufSize));
+ resoultA = crc32->value();
+ crc32->reset();
+ while(!fileB.atEnd())
+     crc32->update(fileB.read(bufSize));
+ resoultB = crc32->value();
+

Member Function Documentation

+ +
+
+ + + + + + + + +
virtual quint32 QuaChecksum32::calculate (const QByteArray & data) [pure virtual]
+
+
+ +

Calculates the checksum for data.

+

data source data

+
Returns:
data checksum
+

This function has no efect on the value returned by value().

+ +

Implemented in QuaAdler32, and QuaCrc32.

+ +
+
+ +
+
+ + + + + + + + +
virtual void QuaChecksum32::update (const QByteArray & buf) [pure virtual]
+
+
+ +

Updates the calculated checksum for the stream.

+

buf next portion of data from the stream

+ +

Implemented in QuaAdler32, and QuaCrc32.

+ +
+
+ +
+
+ + + + + + + +
virtual quint32 QuaChecksum32::value () [pure virtual]
+
+
+ +

Value of the checksum calculated for the stream passed throw update().

+
Returns:
checksum
+ +

Implemented in QuaAdler32, and QuaCrc32.

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + diff --git a/3rdparty/quazip-0.5.1/doc/html/classQuaChecksum32__inherit__graph.map b/3rdparty/quazip-0.5.1/doc/html/classQuaChecksum32__inherit__graph.map new file mode 100644 index 00000000..9a91e3fd --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/classQuaChecksum32__inherit__graph.map @@ -0,0 +1,4 @@ + + + + diff --git a/3rdparty/quazip-0.5.1/doc/html/classQuaChecksum32__inherit__graph.md5 b/3rdparty/quazip-0.5.1/doc/html/classQuaChecksum32__inherit__graph.md5 new file mode 100644 index 00000000..6dde4089 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/classQuaChecksum32__inherit__graph.md5 @@ -0,0 +1 @@ +84ec9abb25cc3d010952b190062cd40b \ No newline at end of file diff --git a/3rdparty/quazip-0.5.1/doc/html/classQuaChecksum32__inherit__graph.png b/3rdparty/quazip-0.5.1/doc/html/classQuaChecksum32__inherit__graph.png new file mode 100644 index 0000000000000000000000000000000000000000..4fc18c12f534aa006f51150e1aafb7ec1f5a8a0e GIT binary patch literal 3229 zcmZu!X*3(!7DnAtvm3LvR8`ebie5u6YOX11(HNqw2sJAYsgh7r6t_xM%+y@1kV?&C zOsN=hRU1K!G1kyhl!$n_cfI@8dTYIP);W9av)11G?C;w@zLRttXu;1T#lyzN#&3Dc z)Q)9`Sv!cEgLP^o!!lXsw7a#1Dci|k>vel&1{)inou#RfLwNpXL8Jq~@jSsxLGV7W zGz4#!g_dg}ES$2AOcwD8mX}E+FRX zb~ShSSMY~cuBuoU3`8jwoYLfOso`;QOZzggJ8g(IlQVS8xNfs`JpCx@$1rk;m+GMb z<>n*_VSka8XWx2nc||VD9d6AI;~F_)UE0aZ|H=3ifnxi+ zM645+4lp$IgXhuWK*k2mi7P2J^`T^jZJ5OZq(PNGI8&%YID@3f^>RD7zUE`2Zd3Qx z;}xX~Y(m3LK6$1gCC>d&G0xxN{PIqY6LL~Tqp(d;VuNIE%d1jP$V{LR{o}6GMqr+H zwY5N%tLZZzYN*(0T4{OqW`Ej^ME}RP_{rPvPfpkrg@>f&z77mE)sZC5^6lUC9@6p% zB0dG$Kb@g+^kyPa`g+Ff-0qN15lljnAZMV4O_>4iJa{!_;@-)a2rh+|_$R!q$NRoZw}q#PmI_2I>UNyRc=c}kIY+>g++PyE+oF=*8J0TrPWr+@ASd`F z#(M(ZcE=h@=Z-srgG?LwcXB+eH!a@~m(|%_Dfkrtcr@Gbe2bUEoCOoG@)Y7E$GhJ) z{*94=$y2sNK6Z{pO-}AKl924pe=dyjD>pYbsxg=Z3z(#Wrqu#?(3lm&ddmp zkma}^XZoUCnG!NDDHk&aMhb3l9Vqs6o|m<0X^qs>6eN!~K9^pJUg(Xe{CdBWX>Zyq z)|~&5n45|I&GxEA20+UYmk1nZbn`-_rPbzjYDR6~4H0g0-><Me=QqU`1;v%Ik_*X3`w4(m%1EB8R3KDVzeY~5i3j0`6KCT>3_r#dTr{S`)IwKo^JoK zoayO#t|j_JydQ6tC_6G{JU?%OL@>CHkIk*LADXkC*AH|DL^BTVL`4}i2JYGIXDqUz zpj-kBT;tDTa9(%C8Q}}l%%L8W9JE+~MvjNZ4NEs&Z+8h4t;rnl_BQ44l5%DpwC8tw zyZdf{2d=lqy(CZ=h&HZ;u9`_4B=fVOU~YXsc44MH(Y}Il>00oM!$tIfM@ukmMK>h5F%Yx#_DuWC8}Q1? z5)!JOwyZxJ9UZwr*?2DfuG!aEZ2E%U+}1Q#Rh4LZI_%Tf7p#_I=1zO0_~Wp><;An8 za(4NbKXL{Kz>NQJ4g^vISgsH_eN5UriaZNTabsQqIX;B-FSb5~$Rk z71HA_ayReG@6IMBkw*A!s;jN{Dgay0X9Xr#uM`Qow1h^3Kr;TSR2to2{cB63@0XZ^ z1242n4iAL)9A}KU_+@E6j|e)Urcoy(xJZ(3G4Iiq%x^;>NBf)<7gYcFcx#yl6p5Tl zl=-cj+3QQ}kDbx$|cX3&oZWUw!$d|P@A!tZ-Zr#s_kM|N+$>xBhgk;wy4S0n6 z`X(ICD~fkrM^=nW+uJKMj-y+{)?Fzs*{|)MpwSiix*_#V2b`>q=5h@pe@?4)9Mwe5 zc3dhfbZ=i$P}vw@F~VS!+S+EZ>adCLI*08wA0L61RyxH*dKX1ix-VScE0@&luXPD~ z-3r+yVVZJDHLhzTBTOybCpUWQ3Aq^&2gzKK(l(SBmrzZyt2C{jT^? zTkRW&)nwd@7Z%RWMD1CI*UAVCTaWE7M>GV}yb1~o{pzm-2G;zb_LNz&=V|*H9L&k= z?FC@#)d^vUim~hKp~Gfoyd0+zdsuL$h=ZQLh+f7tGG|7E#T&#>O&^h|;#aBJ`mO4^ zx^imY?owRB=kak&XB_-VWUGvB-6Xx<*BviP#~uBQc5bLfbjLrXy7K$0BIcKtD!z2g z%*@n#TC;qcpkInSJ=Y>4=&WH%+D_ckq4giGEVa`|Eo{TWRI&9s&sUM)`^>wxwu4*K zmKQDFvfwHxEBnskLsK(sy!M2XMai?sC^!?5Xm0-@)W-n`RPk4Ry1G6_=oJy-yyMu| zKYfoKl3Mz#$#8vb4bl>NvN!ChW+bzeru%K}HGH3!j zKQ@@v>gE^BeP@J}n^!wr0I7?pkC<-B!Peg_?VNoxx2sl zlEKmG26QntYHel$=ap$y{IhFo3m+KB-jzG`!3S{ED7n12_`UMaL1i0-AM% z7dudX<27r0bdyBaLo-3(dzQDq58n^Idap&~{Q1K4biBbUMeJ~1!I9UmznXr3b5Y{$ z+qX?TqC!Hl1-+BYwum2^@e==|DY9oR9vwI6p~Xdm^0(^Zm+a~8Ccd=W>a{`TW4{ur zWPdMDEhZ@@QiHkp#FA|}Ej|P*W;-^0^0_x!HG3IU1=9$eZ14d0$co5NhGW(5nZ>;8 zwOi0RAK&>o*w7Hiw0aewnMx?W;x9eirh2wDL?Ex%&itk|)Ju>D#-_ibbY^o|_{WsVw&48vg#%{6y E26=~S#sB~S literal 0 HcmV?d00001 diff --git a/3rdparty/quazip-0.5.1/doc/html/classQuaCrc32-members.html b/3rdparty/quazip-0.5.1/doc/html/classQuaCrc32-members.html new file mode 100644 index 00000000..d01d670d --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/classQuaCrc32-members.html @@ -0,0 +1,56 @@ + + + + +QuaZIP: Member List + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ + +
+
+
+
QuaCrc32 Member List
+
+
+This is the complete list of members for QuaCrc32, including all inherited members. + + + + + +
calculate(const QByteArray &data)QuaCrc32 [virtual]
QuaCrc32() (defined in QuaCrc32)QuaCrc32
reset()QuaCrc32 [virtual]
update(const QByteArray &buf)QuaCrc32 [virtual]
value()QuaCrc32 [virtual]
+ + + diff --git a/3rdparty/quazip-0.5.1/doc/html/classQuaCrc32.html b/3rdparty/quazip-0.5.1/doc/html/classQuaCrc32.html new file mode 100644 index 00000000..82ca3842 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/classQuaCrc32.html @@ -0,0 +1,161 @@ + + + + +QuaZIP: QuaCrc32 Class Reference + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ + +
+
+ +
+
QuaCrc32 Class Reference
+
+
+ +

CRC32 checksum. + More...

+ +

#include <quazip/quacrc32.h>

+
+Inheritance diagram for QuaCrc32:
+
+
Inheritance graph
+ + +
[legend]
+
+Collaboration diagram for QuaCrc32:
+
+
Collaboration graph
+ + +
[legend]
+ +

List of all members.

+ + + + + + + + + + +

+Public Member Functions

quint32 calculate (const QByteArray &data)
 Calculates the checksum for data.
+void reset ()
 Resets the calculation on a checksun for a stream.
void update (const QByteArray &buf)
 Updates the calculated checksum for the stream.
quint32 value ()
 Value of the checksum calculated for the stream passed throw update().
+

Detailed Description

+

CRC32 checksum.

+

This class wrappers the crc32 function with the QuaChecksum32 interface. See QuaChecksum32 for more info.

+

Member Function Documentation

+ +
+
+ + + + + + + + +
quint32 QuaCrc32::calculate (const QByteArray & data) [virtual]
+
+
+ +

Calculates the checksum for data.

+

data source data

+
Returns:
data checksum
+

This function has no efect on the value returned by value().

+ +

Implements QuaChecksum32.

+ +
+
+ +
+
+ + + + + + + + +
void QuaCrc32::update (const QByteArray & buf) [virtual]
+
+
+ +

Updates the calculated checksum for the stream.

+

buf next portion of data from the stream

+ +

Implements QuaChecksum32.

+ +
+
+ +
+
+ + + + + + + +
quint32 QuaCrc32::value () [virtual]
+
+
+ +

Value of the checksum calculated for the stream passed throw update().

+
Returns:
checksum
+ +

Implements QuaChecksum32.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + diff --git a/3rdparty/quazip-0.5.1/doc/html/classQuaCrc32__coll__graph.map b/3rdparty/quazip-0.5.1/doc/html/classQuaCrc32__coll__graph.map new file mode 100644 index 00000000..a6932a7a --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/classQuaCrc32__coll__graph.map @@ -0,0 +1,3 @@ + + + diff --git a/3rdparty/quazip-0.5.1/doc/html/classQuaCrc32__coll__graph.md5 b/3rdparty/quazip-0.5.1/doc/html/classQuaCrc32__coll__graph.md5 new file mode 100644 index 00000000..eefdbcd2 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/classQuaCrc32__coll__graph.md5 @@ -0,0 +1 @@ +c5893d01f9e8b7b19610a8cce32f67e4 \ No newline at end of file diff --git a/3rdparty/quazip-0.5.1/doc/html/classQuaCrc32__coll__graph.png b/3rdparty/quazip-0.5.1/doc/html/classQuaCrc32__coll__graph.png new file mode 100644 index 0000000000000000000000000000000000000000..7e01eeb0e4f425fbd71f5833ec291aa0eb990abb GIT binary patch literal 1372 zcmeAS@N?(olHy`uVBq!ia0vp^tw3DB!2~4tKUX;jq}Y|gW!U_%O^81unKy* zIEGZrc{^uswzQ$hfl@njP2DMz*2-G3I2{O9%;ws;*7=3NhU-Bm^FJ_8HSI9rT^Xl60Bh%ahBjgtJ1^H`7i=Zy(=vxlMi(&rhnU+H^l(W7q00?>zTg zd+t*yYf@0)kT6;%>|o^}zX5_yTw*_)R$N#2@6Vq*A!g1e4jnr5=1oq?jfctA)w^T# zo`3#%WwTUJS$TPQc=-A+f}1vOoS5Y0?7J`^;oO5?jND&f=v>u2f#ZdXHl6a`pus15 zq)_JQjM`fL<8OCQW1RTqU`fQT|0Rd(_!sHzsJ(8gVDvfkPg0^&SK*VUCH&-#?42};|B|Kg5&@OC$#L_4Z7&SCGj+wU z1@h^IrtkIz1oV1;T6Zj6LTS&+tqbJB(rnZ7w*1KRXV~nSKJD_8xevWW?QM67r5rrw zcz5HI&j)!_*S74=?e!~?c6<6nyjQDRIcBQF_DZKmu?knF^;q85{si=la)*Uz6$eY< zk&8m_{{FrjbH|0Xrk)iMI*4F;-amEf)GwbU{G@u1{rFLFd}TvYef|B?Sm&K9AKcmZ z*I>4+@!U2ZZ*T7{OxATST50*~?aaUbIXRjA{JgU>&$&)@jIfW}zpnNFue#eMdaEMd zKYn!R{+&M_9F}%=cW+vn%<_WQ?&hY!ANapfqyd*)f%*%B+Dvc(~*cILGSJo^21 zd;b18b7N<8dwYMs`aS(&;_9dS>;Iq4@#?zqwt1Q($H|mAK`XNiaEAAf(JN$~25c=P!A`N?zVzMno_w)&0&$Gts2leAPzb-o4a)%VTk zX?pO~yL-7#ckQ04t@8CdFXXXTSAR|We8a=*)s0t=U%Uuk`)%>vXM5fNop(*_`NfS) z(X~0bwYy#&o&7$3n%A~E1E2TbUB4PxRlPkoH~Qkk`SxpHUtgcP`G4N}jT>jTeF{ny zxc6Sj>D|5BUyqJHcJF^T+s{Qb`uS={*4hJ1G(-%_7fwBSvSeahPv5=MDS1ok?@pXJ zF>C9pLI%_Se;+)2m}ocu{L`YU!%a&gbgsSrx^ksvEaTVzw&{A)XV08@QBF+lXi{Ll zLyUbwqa73_zWFU_bH4l3R4-RsKYzy^;n$~5;!3NjnCD(T!*WXZWE+m}uXY6m9XU`V z`aa7-rmJug`$N7hE7_YE@BDJ?*9_(p+>)9$Z$;6hZ4MhA|E^Vewsgg<(A=kD^Xih@ z`8yR~TWNB#%#O0@(6#e;e&_0YZpoS?p7rva%fA-%I32lq<+Gu6t>g#C{FXzC?=n}P z>UEyPtGfBz@&DI + + diff --git a/3rdparty/quazip-0.5.1/doc/html/classQuaCrc32__inherit__graph.md5 b/3rdparty/quazip-0.5.1/doc/html/classQuaCrc32__inherit__graph.md5 new file mode 100644 index 00000000..eefdbcd2 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/classQuaCrc32__inherit__graph.md5 @@ -0,0 +1 @@ +c5893d01f9e8b7b19610a8cce32f67e4 \ No newline at end of file diff --git a/3rdparty/quazip-0.5.1/doc/html/classQuaCrc32__inherit__graph.png b/3rdparty/quazip-0.5.1/doc/html/classQuaCrc32__inherit__graph.png new file mode 100644 index 0000000000000000000000000000000000000000..7e01eeb0e4f425fbd71f5833ec291aa0eb990abb GIT binary patch literal 1372 zcmeAS@N?(olHy`uVBq!ia0vp^tw3DB!2~4tKUX;jq}Y|gW!U_%O^81unKy* zIEGZrc{^uswzQ$hfl@njP2DMz*2-G3I2{O9%;ws;*7=3NhU-Bm^FJ_8HSI9rT^Xl60Bh%ahBjgtJ1^H`7i=Zy(=vxlMi(&rhnU+H^l(W7q00?>zTg zd+t*yYf@0)kT6;%>|o^}zX5_yTw*_)R$N#2@6Vq*A!g1e4jnr5=1oq?jfctA)w^T# zo`3#%WwTUJS$TPQc=-A+f}1vOoS5Y0?7J`^;oO5?jND&f=v>u2f#ZdXHl6a`pus15 zq)_JQjM`fL<8OCQW1RTqU`fQT|0Rd(_!sHzsJ(8gVDvfkPg0^&SK*VUCH&-#?42};|B|Kg5&@OC$#L_4Z7&SCGj+wU z1@h^IrtkIz1oV1;T6Zj6LTS&+tqbJB(rnZ7w*1KRXV~nSKJD_8xevWW?QM67r5rrw zcz5HI&j)!_*S74=?e!~?c6<6nyjQDRIcBQF_DZKmu?knF^;q85{si=la)*Uz6$eY< zk&8m_{{FrjbH|0Xrk)iMI*4F;-amEf)GwbU{G@u1{rFLFd}TvYef|B?Sm&K9AKcmZ z*I>4+@!U2ZZ*T7{OxATST50*~?aaUbIXRjA{JgU>&$&)@jIfW}zpnNFue#eMdaEMd zKYn!R{+&M_9F}%=cW+vn%<_WQ?&hY!ANapfqyd*)f%*%B+Dvc(~*cILGSJo^21 zd;b18b7N<8dwYMs`aS(&;_9dS>;Iq4@#?zqwt1Q($H|mAK`XNiaEAAf(JN$~25c=P!A`N?zVzMno_w)&0&$Gts2leAPzb-o4a)%VTk zX?pO~yL-7#ckQ04t@8CdFXXXTSAR|We8a=*)s0t=U%Uuk`)%>vXM5fNop(*_`NfS) z(X~0bwYy#&o&7$3n%A~E1E2TbUB4PxRlPkoH~Qkk`SxpHUtgcP`G4N}jT>jTeF{ny zxc6Sj>D|5BUyqJHcJF^T+s{Qb`uS={*4hJ1G(-%_7fwBSvSeahPv5=MDS1ok?@pXJ zF>C9pLI%_Se;+)2m}ocu{L`YU!%a&gbgsSrx^ksvEaTVzw&{A)XV08@QBF+lXi{Ll zLyUbwqa73_zWFU_bH4l3R4-RsKYzy^;n$~5;!3NjnCD(T!*WXZWE+m}uXY6m9XU`V z`aa7-rmJug`$N7hE7_YE@BDJ?*9_(p+>)9$Z$;6hZ4MhA|E^Vewsgg<(A=kD^Xih@ z`8yR~TWNB#%#O0@(6#e;e&_0YZpoS?p7rva%fA-%I32lq<+Gu6t>g#C{FXzC?=n}P z>UEyPtGfBz@&DI + + + +QuaZIP: Member List + + + + + + +
+
+
QuaGzipFile Member List
+
+
+This is the complete list of members for QuaGzipFile, including all inherited members. + + + + + + + + + + + + + +
close()QuaGzipFile [virtual]
flush()QuaGzipFile [virtual]
getFileName() const QuaGzipFile
isSequential() const QuaGzipFile [virtual]
open(QIODevice::OpenMode mode)QuaGzipFile [virtual]
open(int fd, QIODevice::OpenMode mode)QuaGzipFile [virtual]
QuaGzipFile()QuaGzipFile
QuaGzipFile(QObject *parent)QuaGzipFile
QuaGzipFile(const QString &fileName, QObject *parent=NULL)QuaGzipFile
readData(char *data, qint64 maxSize)QuaGzipFile [protected, virtual]
setFileName(const QString &fileName)QuaGzipFile
writeData(const char *data, qint64 maxSize)QuaGzipFile [protected, virtual]
~QuaGzipFile()QuaGzipFile [virtual]
+ + + diff --git a/3rdparty/quazip-0.5.1/doc/html/classQuaGzipFile.html b/3rdparty/quazip-0.5.1/doc/html/classQuaGzipFile.html new file mode 100644 index 00000000..e45c64d4 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/classQuaGzipFile.html @@ -0,0 +1,292 @@ + + + + +QuaZIP: QuaGzipFile Class Reference + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ + +
+
+ +
+
QuaGzipFile Class Reference
+
+
+ +

GZIP file. + More...

+ +

#include <quagzipfile.h>

+ +

List of all members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 QuaGzipFile ()
 Empty constructor.
 QuaGzipFile (QObject *parent)
 Empty constructor with a parent.
 QuaGzipFile (const QString &fileName, QObject *parent=NULL)
 Constructor.
+virtual ~QuaGzipFile ()
 Destructor.
+void setFileName (const QString &fileName)
 Sets the name of the GZIP file to be opened.
+QString getFileName () const
 Returns the name of the GZIP file.
virtual bool isSequential () const
 Returns true.
virtual bool open (QIODevice::OpenMode mode)
 Opens the file.
virtual bool open (int fd, QIODevice::OpenMode mode)
 Opens the file.
virtual bool flush ()
 Flushes data to file.
+virtual void close ()
 Closes the file.

+Protected Member Functions

+virtual qint64 readData (char *data, qint64 maxSize)
 Implementation of QIODevice::readData().
+virtual qint64 writeData (const char *data, qint64 maxSize)
 Implementation of QIODevice::writeData().
+

Detailed Description

+

GZIP file.

+

This class is a wrapper around GZIP file access functions in zlib. Unlike QuaZip classes, it doesn't allow reading from a GZIP file opened as QIODevice, for example, if your GZIP file is in QBuffer. It only provides QIODevice access to a GZIP file contents, but the GZIP file itself must be identified by its name on disk or by descriptor id.

+

Constructor & Destructor Documentation

+ +
+
+ + + + + + + +
QuaGzipFile::QuaGzipFile ()
+
+
+ +

Empty constructor.

+

Must call setFileName() before trying to open.

+ +
+
+ +
+
+ + + + + + + + +
QuaGzipFile::QuaGzipFile (QObject * parent)
+
+
+ +

Empty constructor with a parent.

+

Must call setFileName() before trying to open.

+
Parameters:
+ + +
parentThe parent object, as per QObject logic.
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
QuaGzipFile::QuaGzipFile (const QString & fileName,
QObject * parent = NULL 
)
+
+
+ +

Constructor.

+
Parameters:
+ + + +
fileNameThe name of the GZIP file.
parentThe parent object, as per QObject logic.
+
+
+ +
+
+

Member Function Documentation

+ +
+
+ + + + + + + +
bool QuaGzipFile::isSequential () const [virtual]
+
+
+ +

Returns true.

+

Strictly speaking, zlib supports seeking for GZIP files, but it is poorly implemented, because there is no way to implement it properly. For reading, seeking backwards is very slow, and for writing, it is downright impossible. Therefore, QuaGzipFile does not support seeking at all.

+ +
+
+ +
+
+ + + + + + + + +
bool QuaGzipFile::open (QIODevice::OpenMode mode) [virtual]
+
+
+ +

Opens the file.

+
Parameters:
+ + +
modeCan be either QIODevice::Write or QIODevice::Read. ReadWrite and Append aren't supported.
+
+
+ +

Referenced by open().

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
bool QuaGzipFile::open (int fd,
QIODevice::OpenMode mode 
) [virtual]
+
+
+ +

Opens the file.

+

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

+
Parameters:
+ + + +
fdThe file descriptor to read/write the GZIP file from/to.
modeCan be either QIODevice::Write or QIODevice::Read. ReadWrite and Append aren't supported.
+
+
+ +

References open().

+ +
+
+ +
+
+ + + + + + + +
bool QuaGzipFile::flush () [virtual]
+
+
+ +

Flushes data to file.

+

The data is written using Z_SYNC_FLUSH mode. Doesn't make any sense when reading.

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + diff --git a/3rdparty/quazip-0.5.1/doc/html/classQuaZIODevice-members.html b/3rdparty/quazip-0.5.1/doc/html/classQuaZIODevice-members.html new file mode 100644 index 00000000..cd6bbff9 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/classQuaZIODevice-members.html @@ -0,0 +1,60 @@ + + + + +QuaZIP: Member List + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ + +
+
+
+
QuaZIODevice Member List
+
+
+This is the complete list of members for QuaZIODevice, including all inherited members. + + + + + + + + + +
close()QuaZIODevice [virtual]
flush()QuaZIODevice [virtual]
getIoDevice() const QuaZIODevice
isSequential() const QuaZIODevice [virtual]
open(QIODevice::OpenMode mode)QuaZIODevice [virtual]
QuaZIODevice(QIODevice *io, QObject *parent=NULL)QuaZIODevice
readData(char *data, qint64 maxSize)QuaZIODevice [protected, virtual]
writeData(const char *data, qint64 maxSize)QuaZIODevice [protected, virtual]
~QuaZIODevice()QuaZIODevice
+ + + diff --git a/3rdparty/quazip-0.5.1/doc/html/classQuaZIODevice.html b/3rdparty/quazip-0.5.1/doc/html/classQuaZIODevice.html new file mode 100644 index 00000000..bb357caf --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/classQuaZIODevice.html @@ -0,0 +1,209 @@ + + + + +QuaZIP: QuaZIODevice Class Reference + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ + +
+
+ +
+
QuaZIODevice Class Reference
+
+
+ +

A class to compress/decompress QIODevice. + More...

+ +

#include <quaziodevice.h>

+ +

List of all members.

+ + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 QuaZIODevice (QIODevice *io, QObject *parent=NULL)
 Constructor.
~QuaZIODevice ()
 Destructor.
virtual bool flush ()
 Flushes data waiting to be written.
virtual bool open (QIODevice::OpenMode mode)
 Opens the device.
virtual void close ()
 Closes this device, but not the underlying one.
+QIODevice * getIoDevice () const
 Returns the underlying device.
+virtual bool isSequential () const
 Returns true.

+Protected Member Functions

+virtual qint64 readData (char *data, qint64 maxSize)
 Implementation of QIODevice::readData().
+virtual qint64 writeData (const char *data, qint64 maxSize)
 Implementation of QIODevice::writeData().
+

Detailed Description

+

A class to compress/decompress QIODevice.

+

This class can be used to compress any data written to QIODevice or decompress it back. Compressing data sent over a QTcpSocket is a good example.

+

Constructor & Destructor Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
QuaZIODevice::QuaZIODevice (QIODevice * io,
QObject * parent = NULL 
)
+
+
+ +

Constructor.

+
Parameters:
+ + + +
ioThe QIODevice to read/write.
parentThe parent object, as per QObject logic.
+
+
+ +
+
+

Member Function Documentation

+ +
+
+ + + + + + + +
bool QuaZIODevice::flush () [virtual]
+
+
+ +

Flushes data waiting to be written.

+

Unfortunately, as QIODevice doesn't support flush() by itself, the only thing this method does is write the compressed data into the device using Z_SYNC_FLUSH mode. If you need the compressed data to actually be flushed from the buffer of the underlying QIODevice, you need to call its flush() method as well, providing it supports it (like QTcpSocket does). Example:

+
    QuaZIODevice dev(&sock);
+    dev.open(QIODevice::Write);
+    dev.write(yourDataGoesHere);
+    dev.flush();
+    sock->flush(); // this actually sends data to network
+

This may change in the future versions of QuaZIP by implementing an ugly hack: trying to cast the QIODevice using qobject_cast to known flush()-supporting subclasses, and calling flush if the resulting pointer is not zero.

+ +

Referenced by close().

+ +
+
+ +
+
+ + + + + + + + +
bool QuaZIODevice::open (QIODevice::OpenMode mode) [virtual]
+
+
+ +

Opens the device.

+
Parameters:
+ + +
modeNeither QIODevice::ReadWrite nor QIODevice::Append are not supported.
+
+
+ +
+
+ +
+
+ + + + + + + +
void QuaZIODevice::close () [virtual]
+
+
+ +

Closes this device, but not the underlying one.

+

The underlying QIODevice is not closed in case you want to write something else to it.

+ +

References flush().

+ +

Referenced by ~QuaZIODevice().

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + diff --git a/3rdparty/quazip-0.5.1/doc/html/classQuaZip-members.html b/3rdparty/quazip-0.5.1/doc/html/classQuaZip-members.html new file mode 100644 index 00000000..145c85df --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/classQuaZip-members.html @@ -0,0 +1,99 @@ + + + + +QuaZIP: Member List + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ + +
+
+
+
QuaZip Member List
+
+
+This is the complete list of members for QuaZip, including all inherited members. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CaseSensitivity enum nameQuaZip
close()QuaZip
Constants enum nameQuaZip
convertCaseSensitivity(CaseSensitivity cs)QuaZip [static]
csDefault enum valueQuaZip
csInsensitive enum valueQuaZip
csSensitive enum valueQuaZip
getComment() const QuaZip
getCommentCodec() const QuaZip
getCurrentFileInfo(QuaZipFileInfo *info) const QuaZip
getCurrentFileName() const QuaZip
getEntriesCount() const QuaZip
getFileInfoList() const QuaZip
getFileNameCodec() const QuaZip
getFileNameList() const QuaZip
getIoDevice() const QuaZip
getMode() const QuaZip
getUnzFile()QuaZip
getZipError() const QuaZip
getZipFile()QuaZip
getZipName() const QuaZip
goToFirstFile()QuaZip
goToNextFile()QuaZip
hasCurrentFile() const QuaZip
isDataDescriptorWritingEnabled() const QuaZip
isOpen() const QuaZip
MAX_FILE_NAME_LENGTH enum valueQuaZip
mdAdd enum valueQuaZip
mdAppend enum valueQuaZip
mdCreate enum valueQuaZip
mdNotOpen enum valueQuaZip
mdUnzip enum valueQuaZip
Mode enum nameQuaZip
open(Mode mode, zlib_filefunc_def *ioApi=NULL)QuaZip
QuaZip()QuaZip
QuaZip(const QString &zipName)QuaZip
QuaZip(QIODevice *ioDevice)QuaZip
QuaZipPrivate (defined in QuaZip)QuaZip [friend]
setComment(const QString &comment)QuaZip
setCommentCodec(QTextCodec *commentCodec)QuaZip
setCommentCodec(const char *commentCodecName)QuaZip
setCurrentFile(const QString &fileName, CaseSensitivity cs=csDefault)QuaZip
setDataDescriptorWritingEnabled(bool enabled)QuaZip
setFileNameCodec(QTextCodec *fileNameCodec)QuaZip
setFileNameCodec(const char *fileNameCodecName)QuaZip
setIoDevice(QIODevice *ioDevice)QuaZip
setZipName(const QString &zipName)QuaZip
~QuaZip()QuaZip
+ + + diff --git a/3rdparty/quazip-0.5.1/doc/html/classQuaZip.html b/3rdparty/quazip-0.5.1/doc/html/classQuaZip.html new file mode 100644 index 00000000..dad05c79 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/classQuaZip.html @@ -0,0 +1,953 @@ + + + + +QuaZIP: QuaZip Class Reference + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ + +
+ +
+ +

ZIP archive. + More...

+ +

#include <quazip/quazip.h>

+
+Collaboration diagram for QuaZip:
+
+
Collaboration graph
+ + +
[legend]
+ +

List of all members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Types

enum  Constants { MAX_FILE_NAME_LENGTH = 256 + }
 Useful constants. More...
enum  Mode {
+  mdNotOpen, +mdUnzip, +mdCreate, +mdAppend, +
+  mdAdd +
+ }
 Open mode of the ZIP file. More...
enum  CaseSensitivity { csDefault = 0, +csSensitive = 1, +csInsensitive = 2 + }
 Case sensitivity for the file names. More...

+Public Member Functions

 QuaZip ()
 Constructs QuaZip object.
QuaZip (const QString &zipName)
 Constructs QuaZip object associated with ZIP file zipName.
 QuaZip (QIODevice *ioDevice)
 Constructs QuaZip object associated with ZIP file represented by ioDevice.
 ~QuaZip ()
 Destroys QuaZip object.
bool open (Mode mode, zlib_filefunc_def *ioApi=NULL)
 Opens ZIP file.
void close ()
 Closes ZIP file.
void setFileNameCodec (QTextCodec *fileNameCodec)
 Sets the codec used to encode/decode file names inside archive.
void setFileNameCodec (const char *fileNameCodecName)
 Sets the codec used to encode/decode file names inside archive.
+QTextCodec * getFileNameCodec () const
 Returns the codec used to encode/decode comments inside archive.
void setCommentCodec (QTextCodec *commentCodec)
 Sets the codec used to encode/decode comments inside archive.
void setCommentCodec (const char *commentCodecName)
 Sets the codec used to encode/decode comments inside archive.
+QTextCodec * getCommentCodec () const
 Returns the codec used to encode/decode comments inside archive.
QString getZipName () const
 Returns the name of the ZIP file.
void setZipName (const QString &zipName)
 Sets the name of the ZIP file.
QIODevice * getIoDevice () const
 Returns the device representing this ZIP file.
void setIoDevice (QIODevice *ioDevice)
 Sets the device representing the ZIP file.
+Mode getMode () const
 Returns the mode in which ZIP file was opened.
+bool isOpen () const
 Returns true if ZIP file is open, false otherwise.
int getZipError () const
 Returns the error code of the last operation.
int getEntriesCount () const
 Returns number of the entries in the ZIP central directory.
+QString getComment () const
 Returns global comment in the ZIP file.
void setComment (const QString &comment)
 Sets the global comment in the ZIP file.
bool goToFirstFile ()
 Sets the current file to the first file in the archive.
bool goToNextFile ()
 Sets the current file to the next file in the archive.
bool setCurrentFile (const QString &fileName, CaseSensitivity cs=csDefault)
 Sets current file by its name.
+bool hasCurrentFile () const
 Returns true if the current file has been set.
bool getCurrentFileInfo (QuaZipFileInfo *info) const
 Retrieves information about the current file.
QString getCurrentFileName () const
 Returns the current file name.
unzFile getUnzFile ()
 Returns unzFile handle.
zipFile getZipFile ()
 Returns zipFile handle.
void setDataDescriptorWritingEnabled (bool enabled)
 Changes the data descriptor writing mode.
bool isDataDescriptorWritingEnabled () const
 Returns the data descriptor default writing mode.
QStringList getFileNameList () const
 Returns a list of files inside the archive.
QList< QuaZipFileInfogetFileInfoList () const
 Returns information list about all files inside the archive.

+Static Public Member Functions

static Qt::CaseSensitivity convertCaseSensitivity (CaseSensitivity cs)
 Returns the actual case sensitivity for the specified QuaZIP one.

+Friends

+class QuaZipPrivate
+

Detailed Description

+

ZIP archive.

+

This class implements basic interface to the ZIP archive. It can be used to read table contents of the ZIP archive and retreiving information about the files inside it.

+

You can also use this class to open files inside archive by passing pointer to the instance of this class to the constructor of the QuaZipFile class. But see QuaZipFile::QuaZipFile(QuaZip*, QObject*) for the possible pitfalls.

+

This class is indended to provide interface to the ZIP subpackage of the ZIP/UNZIP package as well as to the UNZIP subpackage. But currently it supports only UNZIP.

+

The use of this class is simple - just create instance using constructor, then set ZIP archive file name using setFile() function (if you did not passed the name to the constructor), then open() and then use different functions to work with it! Well, if you are paranoid, you may also wish to call close before destructing the instance, to check for errors on close.

+

You may also use getUnzFile() and getZipFile() functions to get the ZIP archive handle and use it with ZIP/UNZIP package API directly.

+

This class supports localized file names inside ZIP archive, but you have to set up proper codec with setCodec() function. By default, locale codec will be used, which is probably ok for UNIX systems, but will almost certainly fail with ZIP archives created in Windows. This is because Windows ZIP programs have strange habit of using DOS encoding for file names in ZIP archives. For example, ZIP archive with cyrillic names created in Windows will have file names in IBM866 encoding instead of WINDOWS-1251. I think that calling one function is not much trouble, but for true platform independency it would be nice to have some mechanism for file name encoding auto detection using locale information. Does anyone know a good way to do it?

+

Member Enumeration Documentation

+ +
+
+ + + + +
enum QuaZip::Constants
+
+
+ +

Useful constants.

+
Enumerator:
+ +
MAX_FILE_NAME_LENGTH  +

Maximum file name length. Taken from UNZ_MAXFILENAMEINZIP constant in unzip.c.

+
+
+
+ +
+
+ +
+
+ + + + +
enum QuaZip::Mode
+
+
+ +

Open mode of the ZIP file.

+
Enumerator:
+ + + + + +
mdNotOpen  +

ZIP file is not open. This is the initial mode.

+
mdUnzip  +

ZIP file is open for reading files inside it.

+
mdCreate  +

ZIP file was created with open() call.

+
mdAppend  +

ZIP file was opened in append mode. This refers to APPEND_STATUS_CREATEAFTER mode in ZIP/UNZIP package and means that zip is appended to some existing file what is useful when that file contains self-extractor code. This is obviously not what you whant to use to add files to the existing ZIP archive.

+
mdAdd  +

ZIP file was opened for adding files in the archive.

+
+
+
+ +
+
+ +
+
+ + + + +
enum QuaZip::CaseSensitivity
+
+
+ +

Case sensitivity for the file names.

+

This is what you specify when accessing files in the archive. Works perfectly fine with any characters thanks to Qt's great unicode support. This is different from ZIP/UNZIP API, where only US-ASCII characters was supported.

+
Enumerator:
+ + + +
csDefault  +

Default for platform. Case sensitive for UNIX, not for Windows.

+
csSensitive  +

Case sensitive.

+
csInsensitive  +

Case insensitive.

+
+
+
+ +
+
+

Constructor & Destructor Documentation

+ +
+
+ + + + + + + +
QuaZip::QuaZip ()
+
+
+ +

Constructs QuaZip object.

+

Call setName() before opening constructed object.

+ +
+
+ +
+
+ + + + + + + + +
QuaZip::QuaZip (QIODevice * ioDevice)
+
+
+ +

Constructs QuaZip object associated with ZIP file represented by ioDevice.

+

The IO device must be seekable, otherwise an error will occur when opening.

+ +
+
+ +
+
+ + + + + + + +
QuaZip::~QuaZip ()
+
+
+ +

Destroys QuaZip object.

+

Calls close() if necessary.

+ +

References close(), and isOpen().

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + + + + +
Qt::CaseSensitivity QuaZip::convertCaseSensitivity (QuaZip::CaseSensitivity cs) [static]
+
+
+ +

Returns the actual case sensitivity for the specified QuaZIP one.

+
Parameters:
+ + +
csThe value to convert.
+
+
+
Returns:
If CaseSensitivity::csDefault, then returns the default file name case sensitivity for the platform. Otherwise, just returns the appropriate value from the Qt::CaseSensitivity enum.
+ +

References csDefault, and csSensitive.

+ +

Referenced by QuaZipDir::exists(), and setCurrentFile().

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
bool QuaZip::open (Mode mode,
zlib_filefunc_def * ioApi = NULL 
)
+
+
+ +

Opens ZIP file.

+

Argument mode specifies open mode of the ZIP archive. See Mode for details. Note that there is zipOpen2() function in the ZIP/UNZIP API which accepts globalcomment argument, but it does not use it anywhere, so this open() function does not have this argument. See setComment() if you need to set global comment.

+

If the ZIP file is accessed via explicitly set QIODevice, then this device is opened in the necessary mode. If the device was already opened by some other means, then the behaviour is defined by the device implementation, but generally it is not a very good idea. For example, QFile will at least issue a warning.

+
Returns:
true if successful, false otherwise.
+
Note:
ZIP/UNZIP API open calls do not return error code - they just return NULL indicating an error. But to make things easier, quazip.h header defines additional error code UNZ_ERROROPEN and getZipError() will return it if the open call of the ZIP/UNZIP API returns NULL.
+

Argument ioApi specifies IO function set for ZIP/UNZIP package to use. See unzip.h, zip.h and ioapi.h for details. Note that IO API for QuaZip is different from the original package. The file path argument was changed to be of type voidpf, and QuaZip passes a QIODevice pointer there. This QIODevice is either set explicitly via setIoDevice() or the QuaZip(QIODevice*) constructor, or it is created internally when opening the archive by its file name. The default API (qioapi.cpp) just delegates everything to the QIODevice API. Not only this allows to use a QIODevice instead of file name, but also has a nice side effect of raising the file size limit from 2G to 4G.

+

In short: just forget about the ioApi argument and you'll be fine.

+ +

References isOpen(), mdAdd, mdAppend, mdCreate, mdUnzip, QuaZipPrivate::unzFile_f, and QuaZipPrivate::zipFile_f.

+ +

Referenced by JlCompress::compressDir(), JlCompress::compressFile(), JlCompress::compressFiles(), JlCompress::extractDir(), JlCompress::extractFile(), JlCompress::extractFiles(), JlCompress::getFileList(), and QuaZipFile::open().

+ +
+
+ +
+
+ + + + + + + +
void QuaZip::close ()
+
+
+ +

Closes ZIP file.

+

Call getZipError() to determine if the close was successful. The underlying QIODevice is also closed, regardless of whether it was set explicitly or not.

+ +

References mdAdd, mdAppend, mdCreate, mdNotOpen, mdUnzip, QuaZipPrivate::unzFile_f, and QuaZipPrivate::zipFile_f.

+ +

Referenced by QuaZipFile::close(), JlCompress::compressDir(), JlCompress::compressFile(), JlCompress::compressFiles(), JlCompress::extractDir(), JlCompress::extractFile(), JlCompress::extractFiles(), JlCompress::getFileList(), QuaZipFile::open(), and ~QuaZip().

+ +
+
+ +
+
+ + + + + + + + +
void QuaZip::setFileNameCodec (QTextCodec * fileNameCodec)
+
+
+ +

Sets the codec used to encode/decode file names inside archive.

+

This is necessary to access files in the ZIP archive created under Windows with non-latin characters in file names. For example, file names with cyrillic letters will be in IBM866 encoding.

+ +
+
+ +
+
+ + + + + + + + +
void QuaZip::setFileNameCodec (const char * fileNameCodecName)
+
+
+ +

Sets the codec used to encode/decode file names inside archive.

+

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Equivalent to calling setFileNameCodec(QTextCodec::codecForName(codecName));

+ +
+
+ +
+
+ + + + + + + + +
void QuaZip::setCommentCodec (QTextCodec * commentCodec)
+
+
+ +

Sets the codec used to encode/decode comments inside archive.

+

This codec defaults to locale codec, which is probably ok.

+ +
+
+ +
+
+ + + + + + + + +
void QuaZip::setCommentCodec (const char * commentCodecName)
+
+
+ +

Sets the codec used to encode/decode comments inside archive.

+

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Equivalent to calling setCommentCodec(QTextCodec::codecForName(codecName));

+ +
+
+ +
+
+ + + + + + + +
QString QuaZip::getZipName () const
+
+
+ +

Returns the name of the ZIP file.

+

Returns null string if no ZIP file name has been set, for example when the QuaZip instance is set up to use a QIODevice instead.

+
See also:
setZipName(), setIoDevice(), getIoDevice()
+ +

Referenced by QuaZipFile::getZipName().

+ +
+
+ +
+
+ + + + + + + + +
void QuaZip::setZipName (const QString & zipName)
+
+
+ +

Sets the name of the ZIP file.

+

Does nothing if the ZIP file is open.

+

Does not reset error code returned by getZipError().

+
See also:
setIoDevice(), getIoDevice(), getZipName()
+ +

References isOpen().

+ +
+
+ +
+
+ + + + + + + +
QIODevice * QuaZip::getIoDevice () const
+
+
+ +

Returns the device representing this ZIP file.

+

Returns null string if no device has been set explicitly, for example when opening a ZIP file by name.

+
See also:
setIoDevice(), getZipName(), setZipName()
+ +
+
+ +
+
+ + + + + + + + +
void QuaZip::setIoDevice (QIODevice * ioDevice)
+
+
+ +

Sets the device representing the ZIP file.

+

Does nothing if the ZIP file is open.

+

Does not reset error code returned by getZipError().

+
See also:
getIoDevice(), getZipName(), setZipName()
+ +

References isOpen().

+ +
+
+ +
+
+ + + + + + + +
int QuaZip::getZipError () const
+
+
+ +

Returns the error code of the last operation.

+

Returns UNZ_OK if the last operation was successful.

+

Error code resets to UNZ_OK every time you call any function that accesses something inside ZIP archive, even if it is const (like getEntriesCount()). open() and close() calls reset error code too. See documentation for the specific functions for details on error detection.

+ +

Referenced by QuaZipFile::close(), JlCompress::compressDir(), JlCompress::compressFile(), JlCompress::compressFiles(), JlCompress::extractDir(), JlCompress::extractFile(), JlCompress::extractFiles(), QuaZipFile::getActualFileName(), QuaZipFile::getFileInfo(), JlCompress::getFileList(), and QuaZipFile::open().

+ +
+
+ +
+
+ + + + + + + +
int QuaZip::getEntriesCount () const
+
+
+ +

Returns number of the entries in the ZIP central directory.

+

Returns negative error code in the case of error. The same error code will be returned by subsequent getZipError() call.

+ +

References mdUnzip, and QuaZipPrivate::unzFile_f.

+ +
+
+ +
+
+ + + + + + + + +
void QuaZip::setComment (const QString & comment)
+
+
+ +

Sets the global comment in the ZIP file.

+

The comment will be written to the archive on close operation. QuaZip makes a distinction between a null QByteArray() comment and an empty "" comment in the QuaZip::mdAdd mode. A null comment is the default and it means "don't change the comment". An empty comment removes the original comment.

+
See also:
open()
+ +
+
+ +
+
+ + + + + + + +
bool QuaZip::goToFirstFile ()
+
+
+ +

Sets the current file to the first file in the archive.

+

Returns true on success, false otherwise. Call getZipError() to get the error code.

+ +

References mdUnzip, and QuaZipPrivate::unzFile_f.

+ +

Referenced by JlCompress::extractDir(), JlCompress::getFileList(), and setCurrentFile().

+ +
+
+ +
+
+ + + + + + + +
bool QuaZip::goToNextFile ()
+
+
+ +

Sets the current file to the next file in the archive.

+

Returns true on success, false otherwise. Call getZipError() to determine if there was an error.

+

Should be used only in QuaZip::mdUnzip mode.

+
Note:
If the end of file was reached, getZipError() will return UNZ_OK instead of UNZ_END_OF_LIST_OF_FILE. This is to make things like this easier:
 for(bool more=zip.goToFirstFile(); more; more=zip.goToNextFile()) {
+   // do something
+ }
+ if(zip.getZipError()==UNZ_OK) {
+   // ok, there was no error
+ }
+
+ +

References mdUnzip, and QuaZipPrivate::unzFile_f.

+ +

Referenced by JlCompress::extractDir(), JlCompress::getFileList(), and setCurrentFile().

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
bool QuaZip::setCurrentFile (const QString & fileName,
CaseSensitivity cs = csDefault 
)
+
+
+ +

Sets current file by its name.

+

Returns true if successful, false otherwise. Argument cs specifies case sensitivity of the file name. Call getZipError() in the case of a failure to get error code.

+

This is not a wrapper to unzLocateFile() function. That is because I had to implement locale-specific case-insensitive comparison.

+

Here are the differences from the original implementation:

+
    +
  • If the file was not found, error code is UNZ_OK, not UNZ_END_OF_LIST_OF_FILE (see also goToNextFile()).
  • +
  • If this function fails, it unsets the current file rather than resetting it back to what it was before the call.
  • +
+

If fileName is null string then this function unsets the current file and return true. Note that you should close the file first if it is open! See QuaZipFile::QuaZipFile(QuaZip*,QObject*) for the details.

+

Should be used only in QuaZip::mdUnzip mode.

+
See also:
setFileNameCodec(), CaseSensitivity
+ +

References convertCaseSensitivity(), getCurrentFileName(), goToFirstFile(), goToNextFile(), MAX_FILE_NAME_LENGTH, mdUnzip, and QuaZipPrivate::unzFile_f.

+ +

Referenced by QuaZipFile::open().

+ +
+
+ +
+
+ + + + + + + + +
bool QuaZip::getCurrentFileInfo (QuaZipFileInfoinfo) const
+
+
+ +

Retrieves information about the current file.

+

Fills the structure pointed by info. Returns true on success, false otherwise. In the latter case structure pointed by info remains untouched. If there was an error, getZipError() returns error code.

+

Should be used only in QuaZip::mdUnzip mode.

+

Does nothing and returns false in any of the following cases.

+
    +
  • ZIP is not open;
  • +
  • ZIP does not have current file;
  • +
  • info is NULL;
  • +
+

In all these cases getZipError() returns UNZ_OK since there is no ZIP/UNZIP API call.

+ +

References QuaZipFileInfo::comment, QuaZipFileInfo::compressedSize, QuaZipFileInfo::crc, QuaZipFileInfo::dateTime, QuaZipFileInfo::diskNumberStart, QuaZipFileInfo::externalAttr, QuaZipFileInfo::extra, QuaZipFileInfo::flags, hasCurrentFile(), QuaZipFileInfo::internalAttr, isOpen(), mdUnzip, QuaZipFileInfo::method, QuaZipFileInfo::name, QuaZipFileInfo::uncompressedSize, QuaZipPrivate::unzFile_f, QuaZipFileInfo::versionCreated, and QuaZipFileInfo::versionNeeded.

+ +

Referenced by QuaZipFile::getFileInfo(), and JlCompress::getFileList().

+ +
+
+ +
+
+ + + + + + + +
QString QuaZip::getCurrentFileName () const
+
+
+ +

Returns the current file name.

+

Equivalent to calling getCurrentFileInfo() and then getting name field of the QuaZipFileInfo structure, but faster and more convenient.

+

Should be used only in QuaZip::mdUnzip mode.

+ +

References hasCurrentFile(), isOpen(), MAX_FILE_NAME_LENGTH, mdUnzip, and QuaZipPrivate::unzFile_f.

+ +

Referenced by JlCompress::extractDir(), QuaZipFile::getActualFileName(), and setCurrentFile().

+ +
+
+ +
+
+ + + + + + + +
unzFile QuaZip::getUnzFile ()
+
+
+ +

Returns unzFile handle.

+

You can use this handle to directly call UNZIP part of the ZIP/UNZIP package functions (see unzip.h).

+
Warning:
When using the handle returned by this function, please keep in mind that QuaZip class is unable to detect any changes you make in the ZIP file state (e. g. changing current file, or closing the handle). So please do not do anything with this handle that is possible to do with the functions of this class. Or at least return the handle in the original state before calling some another function of this class (including implicit destructor calls and calls from the QuaZipFile objects that refer to this QuaZip instance!). So if you have changed the current file in the ZIP archive - then change it back or you may experience some strange behavior or even crashes.
+ +

References QuaZipPrivate::unzFile_f.

+ +

Referenced by QuaZipFile::atEnd(), QuaZipFile::close(), QuaZipFile::csize(), QuaZipFile::open(), QuaZipFile::pos(), QuaZipFile::readData(), and QuaZipFile::usize().

+ +
+
+ +
+
+ + + + + + + +
zipFile QuaZip::getZipFile ()
+
+
+ +

Returns zipFile handle.

+

You can use this handle to directly call ZIP part of the ZIP/UNZIP package functions (see zip.h). Warnings about the getUnzFile() function also apply to this function.

+ +

References QuaZipPrivate::zipFile_f.

+ +

Referenced by QuaZipFile::close(), QuaZipFile::open(), and QuaZipFile::writeData().

+ +
+
+ +
+
+ + + + + + + + +
void QuaZip::setDataDescriptorWritingEnabled (bool enabled)
+
+
+ +

Changes the data descriptor writing mode.

+

According to the ZIP format specification, a file inside archive may have a data descriptor immediately following the file data. This is reflected by a special flag in the local file header and in the central directory. By default, QuaZIP sets this flag and writes the data descriptor unless both method and level were set to 0, in which case it operates in 1.0-compatible mode and never writes data descriptors.

+

By setting this flag to false, it is possible to disable data descriptor writing, thus increasing compatibility with archive readers that don't understand this feature of the ZIP file format.

+

Setting this flag affects all the QuaZipFile instances that are opened after this flag is set.

+

The data descriptor writing mode is enabled by default.

+
Parameters:
+ + +
enabledIf true, enable local descriptor writing, disable it otherwise.
+
+
+
See also:
QuaZipFile::setDataDescriptorWritingEnabled()
+ +
+
+ +
+
+ + + + + + + +
bool QuaZip::isDataDescriptorWritingEnabled () const
+
+
+ +

Returns the data descriptor default writing mode.

+
See also:
setDataDescriptorWritingEnabled()
+ +

Referenced by QuaZipFile::open().

+ +
+
+ +
+
+ + + + + + + +
QStringList QuaZip::getFileNameList () const
+
+
+ +

Returns a list of files inside the archive.

+
Returns:
A list of file names or an empty list if there was an error or if the archive is empty (call getZipError() to figure out which).
+
See also:
getFileInfoList()
+ +
+
+ +
+
+ + + + + + + +
QList< QuaZipFileInfo > QuaZip::getFileInfoList () const
+
+
+ +

Returns information list about all files inside the archive.

+
Returns:
A list of QuaZipFileInfo objects or an empty list if there was an error or if the archive is empty (call getZipError() to figure out which).
+
See also:
getFileNameList()
+ +
+
+
The documentation for this class was generated from the following files: +
+ + + diff --git a/3rdparty/quazip-0.5.1/doc/html/classQuaZipDir-members.html b/3rdparty/quazip-0.5.1/doc/html/classQuaZipDir-members.html new file mode 100644 index 00000000..b9aa05b4 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/classQuaZipDir-members.html @@ -0,0 +1,81 @@ + + + + +QuaZIP: Member List + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ + +
+
+
+
QuaZipDir Member List
+
+
+This is the complete list of members for QuaZipDir, including all inherited members. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
caseSensitivity() const QuaZipDir
cd(const QString &dirName)QuaZipDir
cdUp()QuaZipDir
count() const QuaZipDir
dirName() const QuaZipDir
entryInfoList(const QStringList &nameFilters, QDir::Filters filters=QDir::NoFilter, QDir::SortFlags sort=QDir::NoSort) const QuaZipDir
entryInfoList(QDir::Filters filters=QDir::NoFilter, QDir::SortFlags sort=QDir::NoSort) const QuaZipDir
entryList(const QStringList &nameFilters, QDir::Filters filters=QDir::NoFilter, QDir::SortFlags sort=QDir::NoSort) const QuaZipDir
entryList(QDir::Filters filters=QDir::NoFilter, QDir::SortFlags sort=QDir::NoSort) const QuaZipDir
exists(const QString &fileName) const QuaZipDir
exists() const QuaZipDir
filePath(const QString &fileName) const QuaZipDir
filter()QuaZipDir
isRoot() const QuaZipDir
nameFilters() const QuaZipDir
operator!=(const QuaZipDir &that)QuaZipDir [inline]
operator=(const QuaZipDir &that)QuaZipDir
operator==(const QuaZipDir &that)QuaZipDir
operator[](int pos) const QuaZipDir
path() const QuaZipDir
QuaZipDir(const QuaZipDir &that)QuaZipDir
QuaZipDir(QuaZip *zip, const QString &dir=QString())QuaZipDir
relativeFilePath(const QString &fileName) const QuaZipDir
setCaseSensitivity(QuaZip::CaseSensitivity caseSensitivity)QuaZipDir
setFilter(QDir::Filters filters)QuaZipDir
setNameFilters(const QStringList &nameFilters)QuaZipDir
setPath(const QString &path)QuaZipDir
setSorting(QDir::SortFlags sort)QuaZipDir
sorting() const QuaZipDir
~QuaZipDir()QuaZipDir
+ + + diff --git a/3rdparty/quazip-0.5.1/doc/html/classQuaZipDir.html b/3rdparty/quazip-0.5.1/doc/html/classQuaZipDir.html new file mode 100644 index 00000000..378538dc --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/classQuaZipDir.html @@ -0,0 +1,527 @@ + + + + +QuaZIP: QuaZipDir Class Reference + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ + +
+
+ +
+
QuaZipDir Class Reference
+
+
+ +

Provides ZIP archive navigation. + More...

+ +

#include <quazipdir.h>

+ +

List of all members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

QuaZipDir (const QuaZipDir &that)
 The copy constructor.
 QuaZipDir (QuaZip *zip, const QString &dir=QString())
 Constructs a QuaZipDir instance pointing to the specified directory.
~QuaZipDir ()
 Destructor.
+bool operator== (const QuaZipDir &that)
 The assignment operator.
bool operator!= (const QuaZipDir &that)
 operator!=
QuaZipDiroperator= (const QuaZipDir &that)
 operator==
+QString operator[] (int pos) const
 Returns the name of the entry at the specified position.
+QuaZip::CaseSensitivity caseSensitivity () const
 Returns the current case sensitivity mode.
bool cd (const QString &dirName)
 Changes the 'current' directory.
+bool cdUp ()
 Goes up.
+uint count () const
 Returns the number of entries in the directory.
QString dirName () const
 Returns the current directory name.
QList< QuaZipFileInfoentryInfoList (const QStringList &nameFilters, QDir::Filters filters=QDir::NoFilter, QDir::SortFlags sort=QDir::NoSort) const
 Returns the list of the entries in the directory.
QList< QuaZipFileInfoentryInfoList (QDir::Filters filters=QDir::NoFilter, QDir::SortFlags sort=QDir::NoSort) const
 Returns the list of the entries in the directory.
QStringList entryList (const QStringList &nameFilters, QDir::Filters filters=QDir::NoFilter, QDir::SortFlags sort=QDir::NoSort) const
 Returns the list of the entry names in the directory.
QStringList entryList (QDir::Filters filters=QDir::NoFilter, QDir::SortFlags sort=QDir::NoSort) const
 Returns the list of the entry names in the directory.
bool exists (const QString &fileName) const
 Returns true if the entry with the specified name exists.
+bool exists () const
 Return true if the directory pointed by this QuaZipDir exists.
QString filePath (const QString &fileName) const
 Returns the full path to the specified file.
+QDir::Filters filter ()
 Returns the default filter.
bool isRoot () const
 Returns if the QuaZipDir points to the root of the archive.
+QStringList nameFilters () const
 Return the default name filter.
QString path () const
 Returns the path to the current dir.
+QString relativeFilePath (const QString &fileName) const
 Returns the path to the specified file relative to the current dir.
+void setCaseSensitivity (QuaZip::CaseSensitivity caseSensitivity)
 Sets the default case sensitivity mode.
+void setFilter (QDir::Filters filters)
 Sets the default filter.
+void setNameFilters (const QStringList &nameFilters)
 Sets the default name filter.
void setPath (const QString &path)
 Goes to the specified path.
+void setSorting (QDir::SortFlags sort)
 Sets the default sorting mode.
+QDir::SortFlags sorting () const
 Returns the default sorting mode.
+

Detailed Description

+

Provides ZIP archive navigation.

+

This class is modelled after QDir, and is designed to provide similar features for ZIP archives.

+

The only significant difference from QDir is that the root path is not '/', but an empty string since that's how the file paths are stored in the archive. However, QuaZipDir understands the paths starting with '/'. It is important in a few places:

+
    +
  • In the cd() function.
  • +
  • In the constructor.
  • +
  • In the exists() function.
  • +
+

Note that since ZIP uses '/' on all platforms, the '\' separator is not supported.

+

Constructor & Destructor Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
QuaZipDir::QuaZipDir (QuaZipzip,
const QString & dir = QString() 
)
+
+
+ +

Constructs a QuaZipDir instance pointing to the specified directory.

+

If dir is not specified, points to the root of the archive. The same happens if the dir is "/".

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + + + + +
bool QuaZipDir::operator!= (const QuaZipDirthat) [inline]
+
+
+ +

operator!=

+
Returns:
true if either this and that use different QuaZip instances or if they point to different directories.
+ +
+
+ +
+
+ + + + + + + + +
QuaZipDir & QuaZipDir::operator= (const QuaZipDirthat)
+
+
+ +

operator==

+
Returns:
true if both this and that use the same QuaZip instance and point to the same directory.
+ +
+
+ +
+
+ + + + + + + + +
bool QuaZipDir::cd (const QString & dirName)
+
+
+ +

Changes the 'current' directory.

+

If the path starts with '/', it is interpreted as an absolute path from the root of the archive. Otherwise, it is interpreted as a path relative to the current directory as was set by the previous cd() or the constructor.

+

Note that the subsequent path() call will not return a path starting with '/' in all cases.

+ +

References cd(), dirName(), exists(), isRoot(), and path().

+ +

Referenced by cd(), and cdUp().

+ +
+
+ +
+
+ + + + + + + +
QString QuaZipDir::dirName () const
+
+
+ +

Returns the current directory name.

+

The name doesn't include the path.

+ +

Referenced by cd().

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
QList< QuaZipFileInfo > QuaZipDir::entryInfoList (const QStringList & nameFilters,
QDir::Filters filters = QDir::NoFilter,
QDir::SortFlags sort = QDir::NoSort 
) const
+
+
+ +

Returns the list of the entries in the directory.

+
Parameters:
+ + + + +
nameFiltersThe list of file patterns to list, uses the same syntax as QDir.
filtersThe entry type filters, only Files and Dirs are accepted.
sortSorting mode (not supported yet).
+
+
+ +

Referenced by entryInfoList().

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
QList< QuaZipFileInfo > QuaZipDir::entryInfoList (QDir::Filters filters = QDir::NoFilter,
QDir::SortFlags sort = QDir::NoSort 
) const
+
+
+ +

Returns the list of the entries in the directory.

+

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. The same as entryInfoList(QStringList(), filters, sort).

+ +

References entryInfoList().

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
QStringList QuaZipDir::entryList (const QStringList & nameFilters,
QDir::Filters filters = QDir::NoFilter,
QDir::SortFlags sort = QDir::NoSort 
) const
+
+
+ +

Returns the list of the entry names in the directory.

+

The same as entryInfoList(nameFilters, filters, sort), but only returns entry names.

+ +

Referenced by count(), entryList(), exists(), and operator[]().

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
QStringList QuaZipDir::entryList (QDir::Filters filters = QDir::NoFilter,
QDir::SortFlags sort = QDir::NoSort 
) const
+
+
+ +

Returns the list of the entry names in the directory.

+

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. The same as entryList(QStringList(), filters, sort).

+ +

References entryList().

+ +
+
+ +
+
+ + + + + + + + +
bool QuaZipDir::exists (const QString & fileName) const
+
+
+ +

Returns true if the entry with the specified name exists.

+

The ".." is considered to exist if the current directory is not root. The "." and "/" are considered to always exist. Paths starting with "/" are relative to the archive root, other paths are relative to the current dir.

+ +

References QuaZip::convertCaseSensitivity(), entryList(), filePath(), and isRoot().

+ +
+
+ +
+
+ + + + + + + + +
QString QuaZipDir::filePath (const QString & fileName) const
+
+
+ +

Returns the full path to the specified file.

+

Doesn't check if the file actually exists.

+ +

Referenced by exists().

+ +
+
+ +
+
+ + + + + + + +
bool QuaZipDir::isRoot () const
+
+
+ +

Returns if the QuaZipDir points to the root of the archive.

+

Not that the root path is the empty string, not '/'.

+ +

Referenced by cd(), and exists().

+ +
+
+ +
+
+ + + + + + + +
QString QuaZipDir::path () const
+
+
+ +

Returns the path to the current dir.

+

The path never starts with '/', and the root path is an empty string.

+ +

Referenced by cd(), and setPath().

+ +
+
+ +
+
+ + + + + + + + +
void QuaZipDir::setPath (const QString & path)
+
+
+ +

Goes to the specified path.

+

The difference from cd() is that this function never checks if the path actually exists and doesn't use relative paths, so it's possible to go to the root directory with setPath("").

+

Note that this function still chops the trailing and/or leading '/' and treats a single '/' as the root path (path() will still return an empty string).

+ +

References path().

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + diff --git a/3rdparty/quazip-0.5.1/doc/html/classQuaZipFile-members.html b/3rdparty/quazip-0.5.1/doc/html/classQuaZipFile-members.html new file mode 100644 index 00000000..ba79db08 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/classQuaZipFile-members.html @@ -0,0 +1,83 @@ + + + + +QuaZIP: Member List + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ + +
+
+
+
QuaZipFile Member List
+
+
+This is the complete list of members for QuaZipFile, including all inherited members. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
atEnd() const QuaZipFile [virtual]
bytesAvailable() const QuaZipFile [virtual]
close()QuaZipFile [virtual]
csize() const QuaZipFile
getActualFileName() const QuaZipFile
getCaseSensitivity() const QuaZipFile
getFileInfo(QuaZipFileInfo *info)QuaZipFile
getFileName() const QuaZipFile
getZip() const QuaZipFile
getZipError() const QuaZipFile
getZipName() const QuaZipFile
isRaw() const QuaZipFile
isSequential() const QuaZipFile [virtual]
open(OpenMode mode)QuaZipFile [virtual]
open(OpenMode mode, const char *password)QuaZipFile [inline]
open(OpenMode mode, int *method, int *level, bool raw, const char *password=NULL)QuaZipFile
open(OpenMode mode, const QuaZipNewInfo &info, const char *password=NULL, quint32 crc=0, int method=Z_DEFLATED, int level=Z_DEFAULT_COMPRESSION, bool raw=false, int windowBits=-MAX_WBITS, int memLevel=DEF_MEM_LEVEL, int strategy=Z_DEFAULT_STRATEGY)QuaZipFile
pos() const QuaZipFile [virtual]
QuaZipFile()QuaZipFile
QuaZipFile(QObject *parent)QuaZipFile
QuaZipFile(const QString &zipName, QObject *parent=NULL)QuaZipFile
QuaZipFile(const QString &zipName, const QString &fileName, QuaZip::CaseSensitivity cs=QuaZip::csDefault, QObject *parent=NULL)QuaZipFile
QuaZipFile(QuaZip *zip, QObject *parent=NULL)QuaZipFile
QuaZipFilePrivate (defined in QuaZipFile)QuaZipFile [friend]
readData(char *data, qint64 maxSize)QuaZipFile [protected]
setFileName(const QString &fileName, QuaZip::CaseSensitivity cs=QuaZip::csDefault)QuaZipFile
setZip(QuaZip *zip)QuaZipFile
setZipName(const QString &zipName)QuaZipFile
size() const QuaZipFile [virtual]
usize() const QuaZipFile
writeData(const char *data, qint64 maxSize)QuaZipFile [protected]
~QuaZipFile()QuaZipFile [virtual]
+ + + diff --git a/3rdparty/quazip-0.5.1/doc/html/classQuaZipFile.html b/3rdparty/quazip-0.5.1/doc/html/classQuaZipFile.html new file mode 100644 index 00000000..07888ccf --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/classQuaZipFile.html @@ -0,0 +1,932 @@ + + + + +QuaZIP: QuaZipFile Class Reference + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ + +
+
+ +
+
QuaZipFile Class Reference
+
+
+ +

A file inside ZIP archive. + More...

+ +

#include <quazip/quazipfile.h>

+
+Collaboration diagram for QuaZipFile:
+
+
Collaboration graph
+ + +
[legend]
+ +

List of all members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 QuaZipFile ()
 Constructs a QuaZipFile instance.
 QuaZipFile (QObject *parent)
 Constructs a QuaZipFile instance.
 QuaZipFile (const QString &zipName, QObject *parent=NULL)
 Constructs a QuaZipFile instance.
 QuaZipFile (const QString &zipName, const QString &fileName, QuaZip::CaseSensitivity cs=QuaZip::csDefault, QObject *parent=NULL)
 Constructs a QuaZipFile instance.
 QuaZipFile (QuaZip *zip, QObject *parent=NULL)
 Constructs a QuaZipFile instance.
virtual ~QuaZipFile ()
 Destroys a QuaZipFile instance.
QString getZipName () const
 Returns the ZIP archive file name.
QuaZipgetZip () const
 Returns a pointer to the associated QuaZip object.
QString getFileName () const
 Returns file name.
QuaZip::CaseSensitivity getCaseSensitivity () const
 Returns case sensitivity of the file name.
QString getActualFileName () const
 Returns the actual file name in the archive.
void setZipName (const QString &zipName)
 Sets the ZIP archive file name.
bool isRaw () const
 Returns true if the file was opened in raw mode.
void setZip (QuaZip *zip)
 Binds to the existing QuaZip instance.
void setFileName (const QString &fileName, QuaZip::CaseSensitivity cs=QuaZip::csDefault)
 Sets the file name.
virtual bool open (OpenMode mode)
 Opens a file for reading.
bool open (OpenMode mode, const char *password)
 Opens a file for reading.
bool open (OpenMode mode, int *method, int *level, bool raw, const char *password=NULL)
 Opens a file for reading.
bool open (OpenMode mode, const QuaZipNewInfo &info, const char *password=NULL, quint32 crc=0, int method=Z_DEFLATED, int level=Z_DEFAULT_COMPRESSION, bool raw=false, int windowBits=-MAX_WBITS, int memLevel=DEF_MEM_LEVEL, int strategy=Z_DEFAULT_STRATEGY)
 Opens a file for writing.
+virtual bool isSequential () const
 Returns true, but beware!
virtual qint64 pos () const
 Returns current position in the file.
virtual bool atEnd () const
 Returns true if the end of file was reached.
virtual qint64 size () const
 Returns file size.
qint64 csize () const
 Returns compressed file size.
qint64 usize () const
 Returns uncompressed file size.
bool getFileInfo (QuaZipFileInfo *info)
 Gets information about current file.
virtual void close ()
 Closes the file.
+int getZipError () const
 Returns the error code returned by the last ZIP/UNZIP API call.
+virtual qint64 bytesAvailable () const
 Returns the number of bytes available for reading.

+Protected Member Functions

+qint64 readData (char *data, qint64 maxSize)
 Implementation of the QIODevice::readData().
+qint64 writeData (const char *data, qint64 maxSize)
 Implementation of the QIODevice::writeData().

+Friends

+class QuaZipFilePrivate
+

Detailed Description

+

A file inside ZIP archive.

+

This is the most interesting class. Not only it provides C++ interface to the ZIP/UNZIP package, but also integrates it with Qt by subclassing QIODevice. This makes possible to access files inside ZIP archive using QTextStream or QDataStream, for example. Actually, this is the main purpose of the whole QuaZIP library.

+

You can either use existing QuaZip instance to create instance of this class or pass ZIP archive file name to this class, in which case it will create internal QuaZip object. See constructors' descriptions for details. Writing is only possible with the existing instance.

+

Note that due to the underlying library's limitation it is not possible to use multiple QuaZipFile instances to open several files in the same archive at the same time. If you need to write to multiple files in parallel, then you should write to temporary files first, then pack them all at once when you have finished writing. If you need to read multiple files inside the same archive in parallel, you should extract them all into a temporary directory first.

+

+Sequential or random-access?

+

At the first thought, QuaZipFile has fixed size, the start and the end and should be therefore considered random-access device. But there is one major obstacle to making it random-access: ZIP/UNZIP API does not support seek() operation and the only way to implement it is through reopening the file and re-reading to the required position, but this is prohibitively slow.

+

Therefore, QuaZipFile is considered to be a sequential device. This has advantage of availability of the ungetChar() operation (QIODevice does not implement it properly for non-sequential devices unless they support seek()). Disadvantage is a somewhat strange behaviour of the size() and pos() functions. This should be kept in mind while using this class.

+

Constructor & Destructor Documentation

+ +
+
+ + + + + + + +
QuaZipFile::QuaZipFile ()
+
+
+ +

Constructs a QuaZipFile instance.

+

You should use setZipName() and setFileName() or setZip() before trying to call open() on the constructed object.

+ +
+
+ +
+
+ + + + + + + + +
QuaZipFile::QuaZipFile (QObject * parent)
+
+
+ +

Constructs a QuaZipFile instance.

+

parent argument specifies this object's parent object.

+

You should use setZipName() and setFileName() or setZip() before trying to call open() on the constructed object.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
QuaZipFile::QuaZipFile (const QString & zipName,
QObject * parent = NULL 
)
+
+
+ +

Constructs a QuaZipFile instance.

+

parent argument specifies this object's parent object and zipName specifies ZIP archive file name.

+

You should use setFileName() before trying to call open() on the constructed object.

+

QuaZipFile constructed by this constructor can be used for read only access. Use QuaZipFile(QuaZip*,QObject*) for writing.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
QuaZipFile::QuaZipFile (const QString & zipName,
const QString & fileName,
QuaZip::CaseSensitivity cs = QuaZip::csDefault,
QObject * parent = NULL 
)
+
+
+ +

Constructs a QuaZipFile instance.

+

parent argument specifies this object's parent object, zipName specifies ZIP archive file name and fileName and cs specify a name of the file to open inside archive.

+

QuaZipFile constructed by this constructor can be used for read only access. Use QuaZipFile(QuaZip*,QObject*) for writing.

+
See also:
QuaZip::setCurrentFile()
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
QuaZipFile::QuaZipFile (QuaZipzip,
QObject * parent = NULL 
)
+
+
+ +

Constructs a QuaZipFile instance.

+

parent argument specifies this object's parent object.

+

zip is the pointer to the existing QuaZip object. This QuaZipFile object then can be used to read current file in the zip or to write to the file inside it.

+
Warning:
Using this constructor for reading current file can be tricky. Let's take the following example:
 QuaZip zip("archive.zip");
+ zip.open(QuaZip::mdUnzip);
+ zip.setCurrentFile("file-in-archive");
+ QuaZipFile file(&zip);
+ file.open(QIODevice::ReadOnly);
+ // ok, now we can read from the file
+ file.read(somewhere, some);
+ zip.setCurrentFile("another-file-in-archive"); // oops...
+ QuaZipFile anotherFile(&zip);
+ anotherFile.open(QIODevice::ReadOnly);
+ anotherFile.read(somewhere, some); // this is still ok...
+ file.read(somewhere, some); // and this is NOT
+
So, what exactly happens here? When we change current file in the zip archive, file that references it becomes invalid (actually, as far as I understand ZIP/UNZIP sources, it becomes closed, but QuaZipFile has no means to detect it).
+

Summary: do not close zip object or change its current file as long as QuaZipFile is open. Even better - use another constructors which create internal QuaZip instances, one per object, and therefore do not cause unnecessary trouble. This constructor may be useful, though, if you already have a QuaZip instance and do not want to access several files at once. Good example:

+
 QuaZip zip("archive.zip");
+ zip.open(QuaZip::mdUnzip);
+ // first, we need some information about archive itself
+ QByteArray comment=zip.getComment();
+ // and now we are going to access files inside it
+ QuaZipFile file(&zip);
+ for(bool more=zip.goToFirstFile(); more; more=zip.goToNextFile()) {
+   file.open(QIODevice::ReadOnly);
+   // do something cool with file here
+   file.close(); // do not forget to close!
+ }
+ zip.close();
+
+
+
+ +
+
+ + + + + + + +
QuaZipFile::~QuaZipFile () [virtual]
+
+
+ +

Destroys a QuaZipFile instance.

+

Closes file if open, destructs internal QuaZip object (if it exists and is internal, of course).

+ +

References close().

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + + + +
QString QuaZipFile::getZipName () const
+
+
+ +

Returns the ZIP archive file name.

+

If this object was created by passing QuaZip pointer to the constructor, this function will return that QuaZip's file name (or null string if that object does not have file name yet).

+

Otherwise, returns associated ZIP archive file name or null string if there are no name set yet.

+
See also:
setZipName() getFileName()
+ +

References QuaZip::getZipName().

+ +
+
+ +
+
+ + + + + + + +
QuaZip * QuaZipFile::getZip () const
+
+
+ +

Returns a pointer to the associated QuaZip object.

+

Returns NULL if there is no associated QuaZip or it is internal (so you will not mess with it).

+ +
+
+ +
+
+ + + + + + + +
QString QuaZipFile::getFileName () const
+
+
+ +

Returns file name.

+

This function returns file name you passed to this object either by using QuaZipFile(const QString&,const QString&,QuaZip::CaseSensitivity,QObject*) or by calling setFileName(). Real name of the file may differ in case if you used case-insensitivity.

+

Returns null string if there is no file name set yet. This is the case when this QuaZipFile operates on the existing QuaZip object (constructor QuaZipFile(QuaZip*,QObject*) or setZip() was used).

+
See also:
getActualFileName
+ +
+
+ +
+
+ + + + + + + +
QuaZip::CaseSensitivity QuaZipFile::getCaseSensitivity () const
+
+
+ +

Returns case sensitivity of the file name.

+

This function returns case sensitivity argument you passed to this object either by using QuaZipFile(const QString&,const QString&,QuaZip::CaseSensitivity,QObject*) or by calling setFileName().

+

Returns unpredictable value if getFileName() returns null string (this is the case when you did not used setFileName() or constructor above).

+
See also:
getFileName
+ +
+
+ +
+
+ + + + + + + +
QString QuaZipFile::getActualFileName () const
+
+
+ +

Returns the actual file name in the archive.

+

This is not a ZIP archive file name, but a name of file inside archive. It is not necessary the same name that you have passed to the QuaZipFile(const QString&,const QString&,QuaZip::CaseSensitivity,QObject*), setFileName() or QuaZip::setCurrentFile() - this is the real file name inside archive, so it may differ in case if the file name search was case-insensitive.

+

Equivalent to calling getCurrentFileName() on the associated QuaZip object. Returns null string if there is no associated QuaZip object or if it does not have a current file yet. And this is the case if you called setFileName() but did not open the file yet. So this is perfectly fine:

+
 QuaZipFile file("somezip.zip");
+ file.setFileName("somefile");
+ QString name=file.getName(); // name=="somefile"
+ QString actual=file.getActualFileName(); // actual is null string
+ file.open(QIODevice::ReadOnly);
+ QString actual=file.getActualFileName(); // actual can be "SoMeFiLe" on Windows
+
See also:
getZipName(), getFileName(), QuaZip::CaseSensitivity
+ +

References QuaZip::getCurrentFileName(), and QuaZip::getZipError().

+ +
+
+ +
+
+ + + + + + + + +
void QuaZipFile::setZipName (const QString & zipName)
+
+
+ +

Sets the ZIP archive file name.

+

Automatically creates internal QuaZip object and destroys previously created internal QuaZip object, if any.

+

Will do nothing if this file is already open. You must close() it first.

+ +
+
+ +
+
+ + + + + + + +
bool QuaZipFile::isRaw () const
+
+
+ +

Returns true if the file was opened in raw mode.

+

If the file is not open, the returned value is undefined.

+
See also:
open(OpenMode,int*,int*,bool,const char*)
+ +

Referenced by close().

+ +
+
+ +
+
+ + + + + + + + +
void QuaZipFile::setZip (QuaZipzip)
+
+
+ +

Binds to the existing QuaZip instance.

+

This function destroys internal QuaZip object, if any, and makes this QuaZipFile to use current file in the zip object for any further operations. See QuaZipFile(QuaZip*,QObject*) for the possible pitfalls.

+

Will do nothing if the file is currently open. You must close() it first.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
void QuaZipFile::setFileName (const QString & fileName,
QuaZip::CaseSensitivity cs = QuaZip::csDefault 
)
+
+
+ +

Sets the file name.

+

Will do nothing if at least one of the following conditions is met:

+
    +
  • ZIP name has not been set yet (getZipName() returns null string).
  • +
  • This QuaZipFile is associated with external QuaZip. In this case you should call that QuaZip's setCurrentFile() function instead!
  • +
  • File is already open so setting the name is meaningless.
  • +
+
See also:
QuaZip::setCurrentFile
+ +
+
+ +
+
+ + + + + + + + +
bool QuaZipFile::open (OpenMode mode) [virtual]
+
+
+ +

Opens a file for reading.

+

Returns true on success, false otherwise. Call getZipError() to get error code.

+
Note:
Since ZIP/UNZIP API provides buffered reading only, QuaZipFile does not support unbuffered reading. So do not pass QIODevice::Unbuffered flag in mode, or open will fail.
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
bool QuaZipFile::open (OpenMode mode,
const char * password 
) [inline]
+
+
+ +

Opens a file for reading.

+

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Argument password specifies a password to decrypt the file. If it is NULL then this function behaves just like open(OpenMode).

+ +

References open().

+ +

Referenced by open().

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bool QuaZipFile::open (OpenMode mode,
int * method,
int * level,
bool raw,
const char * password = NULL 
)
+
+
+ +

Opens a file for reading.

+

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Argument password specifies a password to decrypt the file.

+

An integers pointed by method and level will receive codes of the compression method and level used. See unzip.h.

+

If raw is true then no decompression is performed.

+

method should not be NULL. level can be NULL if you don't want to know the compression level.

+ +

References QuaZip::close(), QuaZip::getMode(), QuaZip::getUnzFile(), QuaZip::getZipError(), QuaZip::hasCurrentFile(), QuaZip::mdUnzip, QuaZip::open(), and QuaZip::setCurrentFile().

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bool QuaZipFile::open (OpenMode mode,
const QuaZipNewInfoinfo,
const char * password = NULL,
quint32 crc = 0,
int method = Z_DEFLATED,
int level = Z_DEFAULT_COMPRESSION,
bool raw = false,
int windowBits = -MAX_WBITS,
int memLevel = DEF_MEM_LEVEL,
int strategy = Z_DEFAULT_STRATEGY 
)
+
+
+ +

Opens a file for writing.

+

info argument specifies information about file. It should at least specify a correct file name. Also, it is a good idea to specify correct timestamp (by default, current time will be used). See QuaZipNewInfo.

+

The password argument specifies the password for crypting. Pass NULL if you don't need any crypting. The crc argument was supposed to be used for crypting too, but then it turned out that it's false information, so you need to set it to 0 unless you want to use the raw mode (see below).

+

Arguments method and level specify compression method and level. The only method supported is Z_DEFLATED, but you may also specify 0 for no compression. If all of the files in the archive use both method 0 and either level 0 is explicitly specified or data descriptor writing is disabled with QuaZip::setDataDescriptorWritingEnabled(), then the resulting archive is supposed to be compatible with the 1.0 ZIP format version, should you need that. Except for this, level has no other effects with method 0.

+

If raw is true, no compression is performed. In this case, crc and uncompressedSize field of the info are required.

+

Arguments windowBits, memLevel, strategy provide zlib algorithms tuning. See deflateInit2() in zlib.

+ +

References QuaZipNewInfo::comment, QuaZipNewInfo::dateTime, QuaZipNewInfo::externalAttr, QuaZipNewInfo::extraGlobal, QuaZipNewInfo::extraLocal, QuaZip::getCommentCodec(), QuaZip::getFileNameCodec(), QuaZip::getMode(), QuaZip::getZipFile(), QuaZipNewInfo::internalAttr, QuaZip::isDataDescriptorWritingEnabled(), QuaZip::mdAdd, QuaZip::mdAppend, QuaZip::mdCreate, QuaZipNewInfo::name, and QuaZipNewInfo::uncompressedSize.

+ +
+
+ +
+
+ + + + + + + +
qint64 QuaZipFile::pos () const [virtual]
+
+
+ +

Returns current position in the file.

+

Implementation of the QIODevice::pos(). When reading, this function is a wrapper to the ZIP/UNZIP unztell(), therefore it is unable to keep track of the ungetChar() calls (which is non-virtual and therefore is dangerous to reimplement). So if you are using ungetChar() feature of the QIODevice, this function reports incorrect value until you get back characters which you ungot.

+

When writing, pos() returns number of bytes already written (uncompressed unless you use raw mode).

+
Note:
Although QuaZipFile is a sequential device and therefore pos() should always return zero, it does not, because it would be misguiding. Keep this in mind.
+

This function returns -1 if the file or archive is not open.

+

Error code returned by getZipError() is not affected by this function call.

+ +

References QuaZip::getUnzFile().

+ +

Referenced by bytesAvailable().

+ +
+
+ +
+
+ + + + + + + +
bool QuaZipFile::atEnd () const [virtual]
+
+
+ +

Returns true if the end of file was reached.

+

This function returns false in the case of error. This means that you called this function on either not open file, or a file in the not open archive or even on a QuaZipFile instance that does not even have QuaZip instance associated. Do not do that because there is no means to determine whether false is returned because of error or because end of file was reached. Well, on the other side you may interpret false return value as "there is no file open to check for end of file and there is + no end of file therefore".

+

When writing, this function always returns true (because you are always writing to the end of file).

+

Error code returned by getZipError() is not affected by this function call.

+ +

References bytesAvailable(), and QuaZip::getUnzFile().

+ +
+
+ +
+
+ + + + + + + +
qint64 QuaZipFile::size () const [virtual]
+
+
+ +

Returns file size.

+

This function returns csize() if the file is open for reading in raw mode, usize() if it is open for reading in normal mode and pos() if it is open for writing.

+

Returns -1 on error, call getZipError() to get error code.

+
Note:
This function returns file size despite that QuaZipFile is considered to be sequential device, for which size() should return bytesAvailable() instead. But its name would be very misguiding otherwise, so just keep in mind this inconsistence.
+ +

References csize(), and usize().

+ +

Referenced by bytesAvailable().

+ +
+
+ +
+
+ + + + + + + +
qint64 QuaZipFile::csize () const
+
+
+ +

Returns compressed file size.

+

Equivalent to calling getFileInfo() and then getting compressedSize field, but more convenient and faster.

+

File must be open for reading before calling this function.

+

Returns -1 on error, call getZipError() to get error code.

+ +

References QuaZip::getMode(), QuaZip::getUnzFile(), and QuaZip::mdUnzip.

+ +

Referenced by size().

+ +
+
+ +
+
+ + + + + + + +
qint64 QuaZipFile::usize () const
+
+
+ +

Returns uncompressed file size.

+

Equivalent to calling getFileInfo() and then getting uncompressedSize field, but more convenient and faster. See getFileInfo() for a warning.

+

File must be open for reading before calling this function.

+

Returns -1 on error, call getZipError() to get error code.

+ +

References QuaZip::getMode(), QuaZip::getUnzFile(), and QuaZip::mdUnzip.

+ +

Referenced by size().

+ +
+
+ +
+
+ + + + + + + + +
bool QuaZipFile::getFileInfo (QuaZipFileInfoinfo)
+
+
+ +

Gets information about current file.

+

This function does the same thing as calling QuaZip::getCurrentFileInfo() on the associated QuaZip object, but you can not call getCurrentFileInfo() if the associated QuaZip is internal (because you do not have access to it), while you still can call this function in that case.

+

File must be open for reading before calling this function.

+

Returns false in the case of an error.

+ +

References QuaZip::getCurrentFileInfo(), QuaZip::getMode(), QuaZip::getZipError(), and QuaZip::mdUnzip.

+ +
+
+ +
+
+ + + + + + + +
void QuaZipFile::close () [virtual]
+
+
+ +

Closes the file.

+

Call getZipError() to determine if the close was successful.

+ +

References QuaZip::close(), QuaZip::getUnzFile(), QuaZip::getZipError(), QuaZip::getZipFile(), QuaZip::isOpen(), and isRaw().

+ +

Referenced by ~QuaZipFile().

+ +
+
+
The documentation for this class was generated from the following files: +
+ + + diff --git a/3rdparty/quazip-0.5.1/doc/html/classQuaZipFilePrivate-members.html b/3rdparty/quazip-0.5.1/doc/html/classQuaZipFilePrivate-members.html new file mode 100644 index 00000000..e2f2227a --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/classQuaZipFilePrivate-members.html @@ -0,0 +1,52 @@ + + + + +QuaZIP: Member List + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ + +
+
+
+
QuaZipFilePrivate Member List
+
+
+This is the complete list of members for QuaZipFilePrivate, including all inherited members. + +
QuaZipFile (defined in QuaZipFilePrivate)QuaZipFilePrivate [friend]
+ + + diff --git a/3rdparty/quazip-0.5.1/doc/html/classQuaZipFilePrivate.html b/3rdparty/quazip-0.5.1/doc/html/classQuaZipFilePrivate.html new file mode 100644 index 00000000..ffe369c4 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/classQuaZipFilePrivate.html @@ -0,0 +1,75 @@ + + + + +QuaZIP: QuaZipFilePrivate Class Reference + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ + +
+
+ +
+
QuaZipFilePrivate Class Reference
+
+
+ +

The implementation class for QuaZip. + More...

+
+Collaboration diagram for QuaZipFilePrivate:
+
+
Collaboration graph
+ + +
[legend]
+ +

List of all members.

+ + + +

+Friends

+class QuaZipFile
+

Detailed Description

+

The implementation class for QuaZip.

+

The documentation for this class was generated from the following file:
    +
  • quazip/quazipfile.cpp
  • +
+
+ + + diff --git a/3rdparty/quazip-0.5.1/doc/html/classQuaZipFilePrivate__coll__graph.map b/3rdparty/quazip-0.5.1/doc/html/classQuaZipFilePrivate__coll__graph.map new file mode 100644 index 00000000..56c6b635 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/classQuaZipFilePrivate__coll__graph.map @@ -0,0 +1,5 @@ + + + + + diff --git a/3rdparty/quazip-0.5.1/doc/html/classQuaZipFilePrivate__coll__graph.md5 b/3rdparty/quazip-0.5.1/doc/html/classQuaZipFilePrivate__coll__graph.md5 new file mode 100644 index 00000000..88803009 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/classQuaZipFilePrivate__coll__graph.md5 @@ -0,0 +1 @@ +8d67fd832bb90332fedcba49da020a67 \ No newline at end of file diff --git a/3rdparty/quazip-0.5.1/doc/html/classQuaZipFilePrivate__coll__graph.png b/3rdparty/quazip-0.5.1/doc/html/classQuaZipFilePrivate__coll__graph.png new file mode 100644 index 0000000000000000000000000000000000000000..abc750d27df3d3ab01ab913271eeaff4de2f7e13 GIT binary patch literal 5666 zcmYjV2Q-{rw;pXWWW;DO1kr;iqa{ihT@bxQuhB^`nTRe-ln^35B|0H$^j^d0L^p`h zTXfO;+{u6MzwWo*wcm5r+H0M&&p!J+d+#SgTT_LcjDZXQ0FbLbRn!Fl2#E3X84w}< zPmFv^jURwE>MDu=+}|&=IWGc|0@gyw*h0@vyG?m&n;pb$lig0=x8RXgTupI0Yw&2NYgg9zA`sAx2DE$ zQy%5$>@4|a+sNO)dHg+y*!ol2uV25qx|9owAcSaGfqFP;6g?nQ4*LJn1~6$$A~LjI zPa>i4=K0VL8{%4h&z*&y}`Us+X@cPpg3m7o`Z&?rz**5x)c|7-)eY5kM zD0k<*Fwf5*l$=FhUte-^GPCyzW%}Wk$MWax27|Sa8_C7pt>#Sjnw0@3)T^bf!#=nq zho@0$5)fkRa-*g3w}e0FBh|!gkm+tv*LkV!!%s93eHgn^zW~jobFCK4<#F_!Qp{bm z(}k!X9gCRWa)IX?CVJR@1Hvg`?x;!CH-1)9Gcd=kq;@g!4NgjV)E(2S{`URbZ^rqdiK@>8<)%ymDe1++S4Hdz9^Mk(z~^ zKN)MRhK}Y@P0GO7J4QvfRM_k8vP;usb^bd2H6T`Sv(fN6`|2cBWRG0`RS$ZfL((*b z+Liu=Ti=>fL(%yj?oA8s-Yq58H&l>zm}?umNOcz|uzT?O(Wn9|%8$A5nkZ$+zd9}X z<64A;*JQVCHeIPW1Za!~4Qw4P5-VSbpCA^*6AUxce7#q%zSLv%;0eW&aOMazIybsxV>`{=^<`qf~dXs`?Y^V-Gy z<7+41=Pr-F_-g$MGku^`U|i1v_DmEq4csbPtpk={9Mu6I8YLMXT@Qrwzc$-oKaZ8! z9CbM9wbrsyTg-l~S3uyS1_6@v6sYkuilvCf9_Xm2Coy?Uj~wE?O6SWPU3^QqT>b+tIo&Mhvj)-jb>5UcB=*6p*Z;qx}oh8;x<4@y}w zt>&a)`=G}|jk(P3Q|ZXDGLz`_$=&P&&~Ovet8Tk|D#4Rf}R(;`X_Gg2xSvOp@+R|1Up$dB)C zWJywdMEN|HkbA5e-PK@r|0bI~FyL1*oqAQ5lLPr8@!cm$cQ}itUUvR*<$Icx?dG|83f7zUH_j-SQO?=U`nrdmO0{glnG1`LgM z-W972ggvo~gymhxLO(xME8((%LgeG&JtNTY1anodSR$014R!ObG)2{&YK|oi3ESv5 zeQR>DCrOUF`+ZV~

0UrbyQWc{@w)%@}p#qiTpG-&gI7pcr+*@k{KuVyo0rs@T1s zgF2-+wUHHqMng{9YsZz}W9FR?g`c}-DEy}Kh^ODk;<~^(kw~U)q1+SDt&(ue>ct|? zkTVnZC5S&nH2K~w3OF*$M`3Q0PK_##7zHWm6t>?w=OAF!uN-kr&**F7(mb~6|Kvy$ z(eidDJ& zo+jS|pXixeDFy+FLZFbdr-I1s>5{!SclhQF{dQsw(E~ia(fS%>FI%{FmhyB^S?(S_ zno4SjkiJ)Pq}Grxld8-YbVbL*J@{~Yh*|F#)xVNls&pRnZ7I{^=yr=z;MZ+#!+QMa zYND__JC6sovvAd-PZ!ssTlA>6EXrvFW89Zj*5;st)qQZ-$8HR|0wXH6v?1|w9Vcgp zoW6Mdv;Lb?Epw#h`_DnJaMiEfV-6d8Q#wM27f0bDdU#g?huD46Hr`)gd2Jso--)Ay zhYwpL_6FT<`ZI?#xH9EcWuYA?m$KEF50(8i?kNp@_g8XWsCe0%OqkcdY#j1|tu!b7 zqse(s{5ZC7kMaf~7$BJ*XkLix;GH;%CLBMx1h7C~$Nf#QsO;g#uTCW{;&uagd4Y7N zAUU6cn82|KZz~R$XjU<}`le@)I15+@5$#POgORX7Vy+9Kh6MC8X&|A$#V=+r@9(%v z^&G!4Nah0;^izf*2DTUu?e20ey%F;S+J~g(sx@d~S&2BNoxX0`U9TA%UIT#SxE8Mi7 zg@kes6#g8}$v+HqZ9|KYN}p`(2^?7F*vHl5s%#gc*aHkWlO%CfEG7;5HWRlwF$!PZ zF3;xteAj}jnw*!XPsb7XCrvPHZ2p4sh_aQ-Y@?&d;5I}Yb#uuN1qiwlYa{u`Sqm|yyMfM?i|Ni5jzU9ku})#Si4f_)kf(Dn3+K>Jc3dw8#9Z}iD@S7X?=8@05^gK zFV`@qo^I+9*KNn$UHd}X>v|N7IE^t;GfYW%^-x)E>-s(V>;3C3ZwxQWWk18u+k8ol zhQgKJ@e{G8F#=o^X!)yr{-pE107N@I9bHXj;I~LmgH~SRpIbq zs7cCwX`;Vv&k&og*ND9Pkb-Qsk?iuB?2FY}J8GZpo>D>a?k4pNUK^&A()!8mDsQdk ziThK%n+%8F=zeo>i$3awhL#IB6dK=ZjLOz+=t8k>@0Skw=Jl-3L>dnbnV%gJmd0J} zHWMha(SFC)M41_qs1@YF~4WhUQW z*80xWxara+Le)n^bQ5J=oSmJWoG5b(5)u;lO>4$6m=B{SQ7@Gaa|Bo`hTyoX)kI5s z%|)nesZlwb+$u-2ZFh9U)UVH+>bv#p%#`=^YZuTzd&TSlEMO23K=i+|sFL}-#Ekx} z|4L6R)D%=z>ABhm`|csIlriW-IkD7MNqYH_=AAdDx(tyJGBk4n-+(=HNsV+L!*QVZwts9Z^e0%luF;cdW|5e|)`Hoo6|@wkrHJ|z`#fYUa%{uX>J zIUZLiLFXVdpNv}v;_hMjDm4Zr&I7sgh|{Y3{?j!qF_P{x7NO1+Wg_=o_p^k% z|F56uM2t~-)GP=aefr7@6H|{2fG0m$xs4o_o<2V@IfJ4Bs;_h9!qp z9(I|{QjgKAV~@dEKEi)Y(c*9&EFWo-oQJp+GhvIrty$Lj=@@aO82F~uze9{qAO4_3 zF@`>4UY^I40#``wL1Kr5FIgCZ?K)bHA;LlSyHaGkkHfkdT$H!J-saZocq4!99Nc|0 zYV%j|2Cpbo-d^g~eL&{F5UkZ73^!j$cvmeLKT&=MDf;o8?JXQkHsV5&&g}Ny#^3Z7 z?ruP8YvYs0l*Rr9#R1;=U!4Z%+8RBy!!-l7jNvr?KL z-7K`|Hs2yGC|FuvE_Ct@26l0D%r7mCX)c(0sMFDQ3-@b~k9JUlFbHT32;!QD<+sG- z7=HN8?(z8*6z~-G->~^RMu)sKt$nHC$E3p}KMDRCc}J8N$y#1v^4$efOj%UDp60`u zeaGYTUTDji0s%I8K`>FAU0J<{`vv+p4^#v&((6AkjKJPZ?+IpQN?VlK0kY$e(5?pa zu=KL*1#T8%Qy`1vd1#y4=}ur3dh0;PjAA^5p9qrX*A4Ct7!w;=CPOMh+5w6W=J^%o z%-F4e2r*KcNwZ-(mIJrTtF<@_MKd)I$k9lg`0@?=WQl*T?$I@0)DL$;TbZQvYCG|3 zP26u1hirA?O}2R$3kt+!SjC6<8Od26-z8BbtoKv$wcT$pkt5!SXnMl!#MzLa(f61i zT3*i_&FN9^T!vn@B6C)Y&b=pOsmMU+Rq8hyWa)4?xwRucy?(hpno|PGk1K9e4M^0Q zI$Y0_YXxH?N3U4yHTy=AhHoQJ8>omtaQEf$^9z6t{ z6bYK@^#@2}cKV8hmK0G0L}o*O-RP33N|9PdP9;ZR4PX&kk-=k>^}l;>eJWsGIzfjf z#@hYJ*KFBB2GM>DW_eR_2i+1jGkA^U-Y+&t9|ElTJ$eYB?7aY0&FqflQiuN$o!E~t zup3M$V|(Y^ge zghO^_KMfJWQh4fCT5(x!pg%Ys&aiWttuM?xn{;)@5_ zI1|8OoG zzy@=%k&wRB??WjL|5ONPx@V{5dma5Asi}FSll;MT(oEkrz^sOg=VDP3I;V3NaWT~`lqn>_1nBzPOI3B1jLEpgQl+$JSHmTCwmI3g zF$`*_pDe&41;_ewF(Z+=3AA)whx`PlVgh0$AGp%4xU$+vrHaS`WM$Z5-UOhDHpq2caFs<%=PNkCkn;Wyad6(Js(;Oi_%ckjm=DPi4+sMYO99*JTT_9 zp_e^=@j8_N;PjW3EP#QBdkNa}VPF7==wIjm>w|ASDdD{ktl~2gMJYo6v;D>Nbmnps yy}Q9Icsezwgs_85z=9wMX!|ef^e=^qqsXexDiz^an!%I4097ST#S(d|;Qs;DLF8@# literal 0 HcmV?d00001 diff --git a/3rdparty/quazip-0.5.1/doc/html/classQuaZipFile__coll__graph.map b/3rdparty/quazip-0.5.1/doc/html/classQuaZipFile__coll__graph.map new file mode 100644 index 00000000..42037e02 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/classQuaZipFile__coll__graph.map @@ -0,0 +1,5 @@ + + + + + diff --git a/3rdparty/quazip-0.5.1/doc/html/classQuaZipFile__coll__graph.md5 b/3rdparty/quazip-0.5.1/doc/html/classQuaZipFile__coll__graph.md5 new file mode 100644 index 00000000..af6cbc02 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/classQuaZipFile__coll__graph.md5 @@ -0,0 +1 @@ +3cca548c6e61503dea7d82da54af1f8a \ No newline at end of file diff --git a/3rdparty/quazip-0.5.1/doc/html/classQuaZipFile__coll__graph.png b/3rdparty/quazip-0.5.1/doc/html/classQuaZipFile__coll__graph.png new file mode 100644 index 0000000000000000000000000000000000000000..b0778c3430bbc9d53ad7dbdea310bc4a68febeaa GIT binary patch literal 5247 zcmZu#1yEG|*S>TLE4k9GbV~Q4v`FXDQUbDc2rM8aEFBUeEg>Z(Aq^`mA&7K`bVxV< zecx~XGv7D!&AoH)Z|>aRojd1w&NIFxJJ-kNt?VWzr_|<81H``@0z9N<>hl~tUrIS5ik9*aXWCw@XhbWg~b5KJ5YzE001(hg?Ap} z@Zb{n;Zb4Xu42Vtg#BeE@wP<9(c2Gas}^(KDDb5p%(sZ~^YdS(%laNJ5%ISs-0bw> zkR0>!by!xYg1Rz_*l2t3GPAPI4;I@Ue-*D;`2Q-_M8-3|ad1$%E3)}qS{hyc zHik$+9T({6L(r!4K{I*OeU&^sgd+{n?>IO+ul2Ioi0>&ALMp1Ci}mqT55#~%1srH?oXE?; z4hLqQRZKR7R==#Inb&caBF_e%pW_M_C*-IBg3YQSRc+@n3`lIjSnRf|1%7`zat#QX zk$rAi=-Dh0YIA|nIUnFSkG`eU#VzAgNl!Pd~Y`@)w^7Lf_sAjb& z?qbUEH*x{gsNg5`@8fJ^n45hBhsyC_%*}=p>p1f4)7C(zOh(W5xvf>E@QBe_)krN_ z^%V}>10w3PaFRb8Y$@Y>kk%^SDeBBW9PD#E7-YIQnKRy=C!3?yAF=ct^tXT3tgvUL zaI%!RDC6fvN#gzcXiQDCCXKkRL9dJfoMn6)a>qE{KK?7T_kC}d9v6#)OR1iWfN1R% z)~#GgaOr29nAC*XC32WsGN#3xWu!w$p46lw8;ZlgNLUBnK`l1LY+|`NTo39m7WH)| z`!5v$!NRiS?%*+`!VwD~XerQ-@ef1(7cATM;(=EuYiqVg8W}piwj|hN<$)Dis>+AQ66uj{2MtNur4Q6URFw3sBGN8gkIYukx>wbQLgUWb! z^n*2C$+j%^C13yLEYiO1_9i*jN;PJMDe_JfN5zd{q?k=8RCeTS<%M6eF=tz>zIrZ+XY|M(Yn$gF}l zgV4uWIp^&TrVwrTFI`P}~ zuk_}=z@}A<4X%P3RYo=owdV`-s?V0%t(+Q3s)kW zg8eM48aa$m*U#UsZ=Pt3uyYv>SE4~o*u7g#S{|egTfHS&`zy1gx+)@Af?8Mq^hDjB zeM+;k_<;-K{VeZUqpV~~d z!QL(S=Jw&aLCtO?zX7?m{P7lnAkT+%V|QKeDGJH<^TgH!hVlFLcZj5saIq2*O7~q( z7%Oi1sGs%ut3C!2?z0rkpT9ZFf=Y^TSV&C{`FpKa3%s>#yW+=weLgXG zYaH|?f{@O&=Wv?*dsIIGE@&#E8eF{mHBq_2$1BjX?QY|8>H2F3sC(e42^7KN?AeX9 z!<8FA@U=<}=_c79=Od#{#eanEYxP}e#R@a9U|!9S(Up&SU9`Q}D7-!sb9$Oe*qH3> z7YIrO0P%xQgj0n-y?)S5X@>yN!jB>7o2(9HLn=i;t->8I+xO0ua zPmMO+UJ4Disav#|i%khRO55zo3Chm6Dl@PpLB^t0s0p2+-`)LJ2KxImy_(mu2AIPZ zUoiMptLx?&)wd|7o!;7nTK*kQ%Eu`iV_)7G0^s{v$WVF~Xvq%b_-4-v7gk6)=lfnK zwZvB2yFcGqGxg>d(%*I7RA$_|#oeiEN=P+oD?GKqWOPDYqgi`Ov?rx=O!)M!O7i%R zZROhrv;6Fd4V5TM%U6=%Z5_Y6R*m~yU)@M3wD^#8?umH{rChQuMqIfj`R(xFqp_PE zz01kc%1eS{yP0OEB4jj=3`tda0*P(<0M-7JN|OSF_Wdi=IQqN`&f0h2HYw? zE8f?W%Bi2nb0V?rF2Nj8K!3LOp@-aQVrRvijLU<~YWDG$=aW*VBk^9slOj5_alHZy za;f@s#Vk*fx^{J%IEQ)?@KYqnu2nuvyA7B{qh939i>1&d`{Ha^yOj}kr4R!E6wx&v z*9+oyR>M_+U-4eWK?=NeXX;@doVfAi(-9wym*?03c!NoztE&#n%eAO!&(-mTVsg|o z>IK!7KhEf^qxEJXv;FG8&ks$SKeW_V$CnnvBlr>ggv2p!&w0 znaqfO_`}uG2kF*u7NbUHC)d<8SBlyf1dh{@S0!j#?jxV_DG zE8}W3_&0l}Ku*Uk-R4PQ1?(bOx!K-j82Y#6Xzd9GAg^L+P!o$F1AtT0(<_Nbj!(a1 zrxW+%CNA}O+-}fBQb`->wd;@6OMEC_3Tf%@6J6Psv^F{UQAe3C@D@lXrdz7>FMKpu zPPc?`kifQ=!Ci%@P;T<)Y`ymD{!vf)AthX0(8!-|53kbOLlOUxn9b>G_6c!zW^Rra zf?a&c^Co1Rk)T=X^KS?dLDppmzRW$=vJNq%qG9CI{^{M>)j*UZmW^C9T;Y+kH4Np@ zB4ZR^75vv8WP4tRJwLydjug6n#d^5Y#UP9A(A7|6~8q`e$&qpC;~eJJ-SQ zH>W*rrthnS`ij65=np*nLQ_1hN?{^+|5!A^^<=9ur}jD`P1=CQ`6`F{1&vNGp`x5r z?LiEF&r9C|HNygj*-tC#FWtFtD?WfA<*-b!V!)>vC!BiQrM&WO?*ztu0kEt{)!T-A zyFiT?Fx&qAdm6oTEe)n5t4FJr+IB7zK0%iGl&jK%_eSUtyaU^%{}_al0PsdKsx$S{ za)US>yUXg>RFQ0hk?V6Wk|3$3tMGwpBBPh4HsHmwo_Xjx7h-<5`Q{Y+nn=H5bU<(A zSo2pJ!>Z{W5+8X>yiM42nRKvzCRXvza#-|so0_YX+1Z-?K~3yS%KnMHivD(U$}`)U z25xJNWK^BssWd|j#52Usj0bT~gG;S{y?g(V5G_6yOlD`! zM8zOjU!HFS_%v$KKzA%EG#{~x^SDM-RF09FM|HkpU0iU#J2G@uMwOt}3aBN(c_K5e z!9KIko`g2GYnPX%JYIxj!*(0LD+hZJBrcDf*wDLw402?0laI_@4hOTTDdtgrdTo1M zGpWy=Bxg3_@_4bmN*Ka#e4Os|iZ58|F5eQ(*J6_EOBF)XF+^LS*WuV>&fgeFB0&If zdV|`!e*1Ps?V@)90A^^yn^42ww0u`U+)-$GHrZxI?ug{Q@8?Pzno9||lEW?T>;5vj zr>xJ!i!M=Dc51v6L)3yPRWG?c*cbO~p7t7>Rvd~a7CoMJb=8KX8Fi-9#qfIs=kO|rOofl~*W0

@O;P&E>IDAG7z-LY+SU5Y2|H!N4HV-xi5^O2hg%w8@SRhl89 zwqY$|s$kX%mNm0ShBG=ZJuxpWx*)bbzu~*i$TeWtQ*lp}2pnxf64_iY^g9pzX4g7W zg2{V+>Mi6;T&}D)6eqsd&#b+d7{6>I@B=Z23X83C%#15_u%aWpEw;1A>Pk^)chh@t zP0W}{Z{rF8%prw%7;07t60A34XFM>YIkdPKnklR@qj$P;-)2sGh^C2Euq@kBY*Plh zgpRa|;y(lY;3}AVJao{YE`Gr%N~Lbdvq2>+^CfAbt4MDhK7t7p2L_%r zakjYSsP)t_e<@}mx$XRp_&Tvkj|X z(Q;>a47{e5=B?%LIPk_ao1H_)v8s9#^3pv6Et?P9S?dlZeAYQVitehuDXIFVyY#Y! zu7n%M_@p(oNq8Rha)&6tp4g^g;L6`p$gL=ErGng@mc0&=UPako4?%xLFh3*{zYkFi zj!uLoN$L_^sGe5LtZStQH;(wCXOj*`(o@ru$=hyXCl`}{w_^cIR{=-$zmNWWl&Lds zc%SvOsa7}_pUir3dv3SpMEp>`Sf$jc)c8)%?>b}@to-=z(MLs5wzIg!v#d_9&GG4qO)(qAU=McdzXGHK!+Uou6a! zXa;f_zBaha3x%0_sdTJsrBcp)Aiy>i(lEU{TkB8O;bcTI$;%Jw^OF)!suJy2T_vl1 zd6f}oR%n*DNQh;EC9yWD%=qkYZe?ZMjwuEJa5CRJZdFSDMwrody>D)obYgg6YW}sR z26p^s2!TM*&7>Ph-`^bf_V&X1-SC&s_GW2mXsorkG{u8%F81eJN)P0^@v{-MVjQD| zb;YHnoN=YRM%93v)ERcA5Dy$}c_hi zO?vRsVXjb~wUsfV1Ob}3W-~hsBhtLtAs!zrx+Q5?7PRr)7VUos6&d3m<5Rw-b)bBz z*(W@0kz(j}v;=%|msS0>Q2GgU#{Ses6JCU(U3u@EU#*e+hg%t@okNbqLmqMQ45=s$ zKUO6keMD_@3V%409+pW{K%_8qLgCxQ${t4=cQ5g&6-PVNPbj)YtBEhFI&HK*R3RBm_|JWekP_aW${GyYkCY%%+-)L3$@{Rp3VtGIco%;j2gz}arJ zp%Z8PsEUQPXC|16*QD+hiYgwNtdu;K*&9Q>=rsw2sctVvGKzwUVX9o3KOIC~PkhOX mDD3(WK+M7S|G8i{a;dWk3g-O}htZBAp!)2EQl+A0=zjphn-TT^ literal 0 HcmV?d00001 diff --git a/3rdparty/quazip-0.5.1/doc/html/classQuaZipPrivate-members.html b/3rdparty/quazip-0.5.1/doc/html/classQuaZipPrivate-members.html new file mode 100644 index 00000000..087ce8b3 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/classQuaZipPrivate-members.html @@ -0,0 +1,54 @@ + + + + +QuaZIP: Member List + + + + + +

+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ + +
+
+
+
QuaZipPrivate Member List
+
+
+This is the complete list of members for QuaZipPrivate, including all inherited members. + + + +
QuaZip (defined in QuaZipPrivate)QuaZipPrivate [friend]
unzFile_fQuaZipPrivate
zipFile_fQuaZipPrivate
+ + + diff --git a/3rdparty/quazip-0.5.1/doc/html/classQuaZipPrivate.html b/3rdparty/quazip-0.5.1/doc/html/classQuaZipPrivate.html new file mode 100644 index 00000000..ea36f85b --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/classQuaZipPrivate.html @@ -0,0 +1,75 @@ + + + + +QuaZIP: QuaZipPrivate Class Reference + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ + +
+
+ +
+
QuaZipPrivate Class Reference
+
+
+ +

All the internal stuff for the QuaZip class. + More...

+
+Collaboration diagram for QuaZipPrivate:
+
+
Collaboration graph
+ + +
[legend]
+ +

List of all members.

+ + + +

+Friends

+class QuaZip
+

Detailed Description

+

All the internal stuff for the QuaZip class.

+

The documentation for this class was generated from the following file:
    +
  • quazip/quazip.cpp
  • +
+
+ + + diff --git a/3rdparty/quazip-0.5.1/doc/html/classQuaZipPrivate__coll__graph.map b/3rdparty/quazip-0.5.1/doc/html/classQuaZipPrivate__coll__graph.map new file mode 100644 index 00000000..5af3df9f --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/classQuaZipPrivate__coll__graph.map @@ -0,0 +1,3 @@ + + + diff --git a/3rdparty/quazip-0.5.1/doc/html/classQuaZipPrivate__coll__graph.md5 b/3rdparty/quazip-0.5.1/doc/html/classQuaZipPrivate__coll__graph.md5 new file mode 100644 index 00000000..a9687896 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/classQuaZipPrivate__coll__graph.md5 @@ -0,0 +1 @@ +4dadbc94c10e818b6d044a538076a620 \ No newline at end of file diff --git a/3rdparty/quazip-0.5.1/doc/html/classQuaZipPrivate__coll__graph.png b/3rdparty/quazip-0.5.1/doc/html/classQuaZipPrivate__coll__graph.png new file mode 100644 index 0000000000000000000000000000000000000000..5caab7717218d76b1b03fc7ccdf1cc01ca57bf33 GIT binary patch literal 2074 zcmV+#2<7*QP)6I5Yw(-J{dSgsX8oe?0KWIpr^rj~L&^D=+L?hOegq9TLL#PT?P>^qy{g~;+ zY?tB8?Ck99ao#iJ{4U7s?3uIAKD_h3XU^;yEXy+D&_jS0u-@Q?QidB!8Ezf) zr%(6x_CiTdd&t@k(Lnd3a}q<{{hUvEtpX*oEGvKwDC$top=xJ|Z3UBuD;s7GA=(pv zwcV=w)NN`0Lv^v3LvunMgXYsk`Yn?ooVA%&29dQ5behKwL#-*xRB$r2(M?2Z%j`)k zb{LBE3N*451$mlcKId2_FGH1&&-x{aQz@TM%m*_v@{i)2i;}vgYtxW1MEcK~@^aNi zkV%`Fo-Kd6l?WxqNkpE?G-6k8Xv-_gkOZ~+Eu)p8pex?;hm!N5XV0ExVfxM~gHvVt zPVFJTmZuCilroGO>WK4Q7e)7>4W$e@uW%K1_sDovWnW; zS_oAnbsKh{+1BZG6{Yv=4YutKwgE~qptiPF?ctgT9U2;fl9gs|Y~{*__hXC6=TByQ zlGkL56f1!;sLM=N~=mUy_rli3W9qHg!}1iOLyP4E?KfV)*LxnrR!6t#o7(CJcSp zHGB8+xO(*j7BF_Cp9~bGslnyn&Wxb7Yf%Iy{?S$dHgs_^e)YtVlpxpk2%;lPJc2be z5tV-aY&bTbkdowEE@viC1e-%|oqsg*ASy{ZZ((N+LJ?qu&WuKfu1(7sd?QZz<>~nH zbleVEc>`u>X|?z5uWGg)@Czaq1dLs493(E2ZeJL?ePPUAffj*0<*S zb3<9ZudLp;=VZnBo%wMZO=PY>Mrbl2x&HqFQ%=_x zEMJU38Y;zQ=iYzM1ZYvh2(cS#7J)QW^azP)>aKiFX_4g|3R#p~9wD)kGE|mj#U|bS zsLY3|+c4`Xq@jfYG5R8rerZr@((|D#mm>wp>APf1!Y(Yhu)$C%6BZ7!2hdZ#z!}$R zIl<`v*}1I47=eWwN*Qh_Wt?FspAXG}*nCpf`w_DmJ|Ak9slny1BY)05jKa#G2(Y20 zTRnmcKfk{OD}y4yhPn!b^6kDSf6T+mpa^^pt=LmMeuo=MkBU9T3r}Nnk5{0D&;j1i z(Ca?2P#C|vPJ)z)Yx%1uhCF`p(3h(ZY*?O-|MK~RL@cFk=~)~hRJ1AefCsSvw_dI( z47%-?niVE~$Xe49e130Dp{8H?Fdfn7rpLUl)j2(7uhi4m?l8idkg2BrOAiL)~V%$(q ziL0`)SP)V{iUnM`uh>(<^m-At3?2M_>iQR>>OHk>8`F<`kR?>t#%_IAV9QXCUmX4Q z#q7h?>-sGR{GundEqc)A{j4tuWy{bl`~4-Ap1;4HOz#oB!j|TMAY#FVw?qP>mo33s z7}JMQ_*mKC57V*5)d%I&v;?H2EJ<=r3)AIDfiXi73cp(>OY-nf)9F1`O(pIk!CmO8 z+LvXGEfdI;2#3S8B)#*>@!h2d)q7e)AGd@)qSe2aa5zlM2Wpce7~@l?PBk_*Qt8c3 zy1TnCUAjce2b$A&4Gj(L?d=phv5ra8F6S-oRQx(5_gJ zWtov5iQ8=`@wKhFpxXlrZX%mcd98hNehXw6iApsLhrA4!xG!&j zItI9X?1)>B?x(^HdO zrUQ*AQ^rRDT5orR65}Mbr@BKZS+fFJ_n9M^Mq~D;1%Ojt`{gseMeH;lz#DXHC#+X_ z$H5Jy%sMm_b~v>T4TXgpN*Qh_Ww@b~p?P0^$BrGLP?qO?GswimL|dSi6X#<}nuN*Qh_Ww@b~;f7M?KaSPdP+r!ElK=n!07*qoM6N<$ Ef<|xPqW}N^ literal 0 HcmV?d00001 diff --git a/3rdparty/quazip-0.5.1/doc/html/classQuaZip__coll__graph.map b/3rdparty/quazip-0.5.1/doc/html/classQuaZip__coll__graph.map new file mode 100644 index 00000000..ed074fa5 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/classQuaZip__coll__graph.map @@ -0,0 +1,3 @@ + + + diff --git a/3rdparty/quazip-0.5.1/doc/html/classQuaZip__coll__graph.md5 b/3rdparty/quazip-0.5.1/doc/html/classQuaZip__coll__graph.md5 new file mode 100644 index 00000000..37a82d47 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/classQuaZip__coll__graph.md5 @@ -0,0 +1 @@ +d04fc6b476641932472c86fd8096968c \ No newline at end of file diff --git a/3rdparty/quazip-0.5.1/doc/html/classQuaZip__coll__graph.png b/3rdparty/quazip-0.5.1/doc/html/classQuaZip__coll__graph.png new file mode 100644 index 0000000000000000000000000000000000000000..b1e92817b38dadc7e08c85e51d34550051171f66 GIT binary patch literal 2086 zcmV+>2-)|EP)6@DLLEEGj5{+0>5?WG}2carhK|!85?qRnt zmMnXFyLWqgKXzs>^Lb&$z1iP>@5{_@W@m2}i=v1aaB!pr&~gM&~$fVEJBP)A2cOG^u2 zKx^pf>A7&>0#r1XLxEw20>caih8YSBe$!>;jHO*(Ii`1acV{(uR1H(<&mw5O)h$#t zPf~iSIfarB$_3@W%4&LNZOYfs2Xa01{Q2`VEZ=3DUZv$bC?9AaFWBZ<$j%c(ZdHA#~(Y4ag-n6}ob0 zbTM(`)6v*U0wLsZV$yQVK+$?=A}ZcEJ-YNPD&19ct_?#y0g7~{ha#c3E^{Kf@fxw)B&NL1|`q z_4jjQD0wxKqv8*32Ev9ePsgsG8WG~^)m@Ia_x~3v?an8vJF##dOIqjN5 z$?Nv`_`*^?wj#XOwPWY|+dMuVA>=HuYYwGizW3zTLiw9pN*lbT4c>jH%O~$Hy0$n- zi!urM7AnNViQa|EW}oz5&VehNi-WtpWL24lyrIwfm!ivw?Qi)=3xR>Wp^tCRmsER- zUUiWc0t5LR`d{BtMPqULI&3}ED6th`W@vTyC&Bd9Y_uK<_Uk)yhyt4XH{uOCU0%Bm z>naEvntzZVl=2K_C@{=WV3?u6*uzk^9tw<&)H zLmZNKO3{Uc^lJu;*Qdi7ol@4Ma|TVag(l*H!PcfaIX$aC7lB0U;!cqU4lZP$92}Dr;J(Gz&-?THxm+ zFXK`|!4$LM0#39Xmh}x-=5~5w+Wsm!`tgyk~++O5i8zBob z6c}bGF!nH%t%qhobTJ`n{fJo!TMsqL%<$?r;lJh|Maaqkgs`C{)o#v#Up!bLD+3V1 zhB{na*-r1%KNrc$0EB!FE#Fr(d6yXqNBO>@rDxHFCu^jIz(C&6;Okz#fSbIRCykVf zd-?09M%+IB$X6RLY*?L*{rdUCcywLc%JUdPsBqi*3m$kEZo67r5O7*AH6v8~khQio z@Zx^bK)<$-cs{5e`q$>;ayhz~pwmz)TBs)9e{g?hB!W`pVT1!aJSV<=jfkp@kk6rd z)F0c*X{zH;{jsf9t1%3{hSs+EwQos9RNLmaT8&}oHMDS>Gq~HUey;WOKHrW z67(915UM{OKq&c%6Tir^g89MyK%*`*yl}GB@x5}@45Cv42Quujr2^&4L_?tv zX*mcX^v)|M_m&)19%&1H+#39dl%Dj2LLsGxNsA*G<1=T@G&MC5)MqbxdwZ{3xuWz? zy?oc$*x1q0VXZ0~le$(%T@JN7%uryMp};Uhfid|^Nx8Ma+(VSq%?Z+mgf!7KPtmMK z@VSl|Lsg2+eF4n~+3uv%ymVG#z}?Tf%cm;P+Y4hlpsfMUp-N{}Wh1+Yx zPTke446BT(Su@Ao&Q?5^SGGap=_1>W#~G`o%1~wPG&+rAg`wt@=?yq~bu<%^(lToj zi$%X2(d zYHDC$K=-+PXJ_Zw*qG(2Y>eOUKYH}2@ literal 0 HcmV?d00001 diff --git a/3rdparty/quazip-0.5.1/doc/html/classes.html b/3rdparty/quazip-0.5.1/doc/html/classes.html new file mode 100644 index 00000000..a7af47f7 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/classes.html @@ -0,0 +1,55 @@ + + + + +QuaZIP: Class Index + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ + +
+
+
+
Class Index
+
+
+
J | Q
+ +
  J  
+
QuaAdler32   QuaGzipFile   QuaZipDir   QuaZipFilePrivate   
JlCompress   QuaChecksum32   QuaZIODevice   QuaZipFile   QuaZipNewInfo   
  Q  
+
QuaCrc32   QuaZip   QuaZipFileInfo   QuaZipPrivate   
J | Q
+
+ + + diff --git a/3rdparty/quazip-0.5.1/doc/html/closed.png b/3rdparty/quazip-0.5.1/doc/html/closed.png new file mode 100644 index 0000000000000000000000000000000000000000..b7d4bd9fef2272c74b94762c9e2496177017775e GIT binary patch literal 126 zcmeAS@N?(olHy`uVBq!ia0vp^oFL4>1|%O$WD@{VuAVNAAr*{o?>h22DDp4|bgj*t z)u^AqcA-V@guRYpb17F<&b?_~8HV>~XqWvB;^$!VVSTy0!eQcJp_yD7TIQA>7dijs YXf6~H5cs^Q6KEiVr>mdKI;Vst0NsWqGynhq literal 0 HcmV?d00001 diff --git a/3rdparty/quazip-0.5.1/doc/html/dir_6b1d21316abab84c9bd8ed600604809a.html b/3rdparty/quazip-0.5.1/doc/html/dir_6b1d21316abab84c9bd8ed600604809a.html new file mode 100644 index 00000000..4cc6d06f --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/dir_6b1d21316abab84c9bd8ed600604809a.html @@ -0,0 +1,82 @@ + + + + +QuaZIP: quazip/ Directory Reference + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ + +
+
+
+
quazip Directory Reference
+
+
+
+Directory dependency graph for quazip/:
+
+
quazip/
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +

+Files

file  JlCompress.cpp
file  JlCompress.h [code]
file  qioapi.cpp
file  quaadler32.cpp
file  quaadler32.h [code]
file  quachecksum32.h [code]
file  quacrc32.cpp
file  quacrc32.h [code]
file  quagzipfile.cpp
file  quagzipfile.h [code]
file  quaziodevice.cpp
file  quaziodevice.h [code]
file  quazip.cpp
file  quazip.h [code]
file  quazip_global.h [code]
file  quazipdir.cpp
file  quazipdir.h [code]
file  quazipfile.cpp
file  quazipfile.h [code]
file  quazipfileinfo.cpp
file  quazipfileinfo.h [code]
file  quazipnewinfo.cpp
file  quazipnewinfo.h [code]
+
+ + + diff --git a/3rdparty/quazip-0.5.1/doc/html/dir_6b1d21316abab84c9bd8ed600604809a_dep.map b/3rdparty/quazip-0.5.1/doc/html/dir_6b1d21316abab84c9bd8ed600604809a_dep.map new file mode 100644 index 00000000..b35faad8 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/dir_6b1d21316abab84c9bd8ed600604809a_dep.map @@ -0,0 +1,3 @@ + + + diff --git a/3rdparty/quazip-0.5.1/doc/html/dir_6b1d21316abab84c9bd8ed600604809a_dep.md5 b/3rdparty/quazip-0.5.1/doc/html/dir_6b1d21316abab84c9bd8ed600604809a_dep.md5 new file mode 100644 index 00000000..a8036c98 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/dir_6b1d21316abab84c9bd8ed600604809a_dep.md5 @@ -0,0 +1 @@ +fae3a2113ceca135f02b2457a94c54e0 \ No newline at end of file diff --git a/3rdparty/quazip-0.5.1/doc/html/dir_6b1d21316abab84c9bd8ed600604809a_dep.png b/3rdparty/quazip-0.5.1/doc/html/dir_6b1d21316abab84c9bd8ed600604809a_dep.png new file mode 100644 index 0000000000000000000000000000000000000000..f936aee94d987e70001a67459512d3b10f1acae2 GIT binary patch literal 425 zcmeAS@N?(olHy`uVBq!ia0vp^!9Z-y!2~2b$`uoU6kC$Fy9>jA5L~c#`D6wL#yC$G z$B>N1x3dlNS_}kS-)<1vtA9{(g@xNM+pt}^8bLqhG%n3+ky24v?%;GxAYt-G$DjX0 zH!Dk@oqRm4)xr9?h)RCCc!8A3@yE~pOSCOq_j=vybF0+kTmwTwO}#Dov)_8Qx~iWq zHc#L7toFY4(p%s5&;53-?%w#bdAmFH@49yq)p2QO;~y>GClGU9d5IbSu3FRiY!CD7>p1q7#2nqR{q&m3+q*XI z(BydZcH%+b#GOC>=}c^zny`KSwJmdF*rbb(erNiB@_}N$-o0rP&(*AhIIH3U!maCm zp1Qo^_+#Z-*}zJ>{b8H_Y2Wv~oDw;0&jyhxsgir{ulxB{NXFzi^YuT{IUlyEs_*Id Q0){<mdKI;Vst05ZVEE&u=k literal 0 HcmV?d00001 diff --git a/3rdparty/quazip-0.5.1/doc/html/dirs.html b/3rdparty/quazip-0.5.1/doc/html/dirs.html new file mode 100644 index 00000000..ed8fca5c --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/dirs.html @@ -0,0 +1,46 @@ + + + + +QuaZIP: Directories + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ +
+
+
+
Directories
+
+
+
This directory hierarchy is sorted roughly, but not completely, alphabetically:
+
+ + + diff --git a/3rdparty/quazip-0.5.1/doc/html/doxygen.css b/3rdparty/quazip-0.5.1/doc/html/doxygen.css new file mode 100644 index 00000000..74445fe1 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/doxygen.css @@ -0,0 +1,835 @@ +/* The standard CSS for doxygen */ + +body, table, div, p, dl { + font-family: Lucida Grande, Verdana, Geneva, Arial, sans-serif; + font-size: 12px; +} + +/* @group Heading Levels */ + +h1 { + font-size: 150%; +} + +.title { + font-size: 150%; + font-weight: bold; + margin: 10px 2px; +} + +h2 { + font-size: 120%; +} + +h3 { + font-size: 100%; +} + +dt { + font-weight: bold; +} + +div.multicol { + -moz-column-gap: 1em; + -webkit-column-gap: 1em; + -moz-column-count: 3; + -webkit-column-count: 3; +} + +p.startli, p.startdd, p.starttd { + margin-top: 2px; +} + +p.endli { + margin-bottom: 0px; +} + +p.enddd { + margin-bottom: 4px; +} + +p.endtd { + margin-bottom: 2px; +} + +/* @end */ + +caption { + font-weight: bold; +} + +span.legend { + font-size: 70%; + text-align: center; +} + +h3.version { + font-size: 90%; + text-align: center; +} + +div.qindex, div.navtab{ + background-color: #EBEFF6; + border: 1px solid #A3B4D7; + text-align: center; + margin: 2px; + padding: 2px; +} + +div.qindex, div.navpath { + width: 100%; + line-height: 140%; +} + +div.navtab { + margin-right: 15px; +} + +/* @group Link Styling */ + +a { + color: #3D578C; + font-weight: normal; + text-decoration: none; +} + +.contents a:visited { + color: #4665A2; +} + +a:hover { + text-decoration: underline; +} + +a.qindex { + font-weight: bold; +} + +a.qindexHL { + font-weight: bold; + background-color: #9CAFD4; + color: #ffffff; + border: 1px double #869DCA; +} + +.contents a.qindexHL:visited { + color: #ffffff; +} + +a.el { + font-weight: bold; +} + +a.elRef { +} + +a.code { + color: #4665A2; +} + +a.codeRef { + color: #4665A2; +} + +/* @end */ + +dl.el { + margin-left: -1cm; +} + +.fragment { + font-family: monospace, fixed; + font-size: 105%; +} + +pre.fragment { + border: 1px solid #C4CFE5; + background-color: #FBFCFD; + padding: 4px 6px; + margin: 4px 8px 4px 2px; + overflow: auto; + word-wrap: break-word; + font-size: 9pt; + line-height: 125%; +} + +div.ah { + background-color: black; + font-weight: bold; + color: #ffffff; + margin-bottom: 3px; + margin-top: 3px; + padding: 0.2em; + border: solid thin #333; + border-radius: 0.5em; + -webkit-border-radius: .5em; + -moz-border-radius: .5em; + box-shadow: 2px 2px 3px #999; + -webkit-box-shadow: 2px 2px 3px #999; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; + background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444)); + background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000); +} + +div.groupHeader { + margin-left: 16px; + margin-top: 12px; + font-weight: bold; +} + +div.groupText { + margin-left: 16px; + font-style: italic; +} + +body { + background: white; + color: black; + margin: 0; +} + +div.contents { + margin-top: 10px; + margin-left: 10px; + margin-right: 5px; +} + +td.indexkey { + background-color: #EBEFF6; + font-weight: bold; + border: 1px solid #C4CFE5; + margin: 2px 0px 2px 0; + padding: 2px 10px; +} + +td.indexvalue { + background-color: #EBEFF6; + border: 1px solid #C4CFE5; + padding: 2px 10px; + margin: 2px 0px; +} + +tr.memlist { + background-color: #EEF1F7; +} + +p.formulaDsp { + text-align: center; +} + +img.formulaDsp { + +} + +img.formulaInl { + vertical-align: middle; +} + +div.center { + text-align: center; + margin-top: 0px; + margin-bottom: 0px; + padding: 0px; +} + +div.center img { + border: 0px; +} + +address.footer { + text-align: right; + padding-right: 12px; +} + +img.footer { + border: 0px; + vertical-align: middle; +} + +/* @group Code Colorization */ + +span.keyword { + color: #008000 +} + +span.keywordtype { + color: #604020 +} + +span.keywordflow { + color: #e08000 +} + +span.comment { + color: #800000 +} + +span.preprocessor { + color: #806020 +} + +span.stringliteral { + color: #002080 +} + +span.charliteral { + color: #008080 +} + +span.vhdldigit { + color: #ff00ff +} + +span.vhdlchar { + color: #000000 +} + +span.vhdlkeyword { + color: #700070 +} + +span.vhdllogic { + color: #ff0000 +} + +/* @end */ + +/* +.search { + color: #003399; + font-weight: bold; +} + +form.search { + margin-bottom: 0px; + margin-top: 0px; +} + +input.search { + font-size: 75%; + color: #000080; + font-weight: normal; + background-color: #e8eef2; +} +*/ + +td.tiny { + font-size: 75%; +} + +.dirtab { + padding: 4px; + border-collapse: collapse; + border: 1px solid #A3B4D7; +} + +th.dirtab { + background: #EBEFF6; + font-weight: bold; +} + +hr { + height: 0px; + border: none; + border-top: 1px solid #4A6AAA; +} + +hr.footer { + height: 1px; +} + +/* @group Member Descriptions */ + +table.memberdecls { + border-spacing: 0px; + padding: 0px; +} + +.mdescLeft, .mdescRight, +.memItemLeft, .memItemRight, +.memTemplItemLeft, .memTemplItemRight, .memTemplParams { + background-color: #F9FAFC; + border: none; + margin: 4px; + padding: 1px 0 0 8px; +} + +.mdescLeft, .mdescRight { + padding: 0px 8px 4px 8px; + color: #555; +} + +.memItemLeft, .memItemRight, .memTemplParams { + border-top: 1px solid #C4CFE5; +} + +.memItemLeft, .memTemplItemLeft { + white-space: nowrap; +} + +.memItemRight { + width: 100%; +} + +.memTemplParams { + color: #4665A2; + white-space: nowrap; +} + +/* @end */ + +/* @group Member Details */ + +/* Styles for detailed member documentation */ + +.memtemplate { + font-size: 80%; + color: #4665A2; + font-weight: normal; + margin-left: 9px; +} + +.memnav { + background-color: #EBEFF6; + border: 1px solid #A3B4D7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} + +.mempage { + width: 100%; +} + +.memitem { + padding: 0; + margin-bottom: 10px; + margin-right: 5px; +} + +.memname { + white-space: nowrap; + font-weight: bold; + margin-left: 6px; +} + +.memproto { + border-top: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + padding: 6px 0px 6px 0px; + color: #253555; + font-weight: bold; + text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); + /* opera specific markup */ + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + border-top-right-radius: 8px; + border-top-left-radius: 8px; + /* firefox specific markup */ + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + -moz-border-radius-topright: 8px; + -moz-border-radius-topleft: 8px; + /* webkit specific markup */ + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + -webkit-border-top-right-radius: 8px; + -webkit-border-top-left-radius: 8px; + background-image:url('nav_f.png'); + background-repeat:repeat-x; + background-color: #E2E8F2; + +} + +.memdoc { + border-bottom: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + padding: 2px 5px; + background-color: #FBFCFD; + border-top-width: 0; + /* opera specific markup */ + border-bottom-left-radius: 8px; + border-bottom-right-radius: 8px; + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + /* firefox specific markup */ + -moz-border-radius-bottomleft: 8px; + -moz-border-radius-bottomright: 8px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + background-image: -moz-linear-gradient(center top, #FFFFFF 0%, #FFFFFF 60%, #F7F8FB 95%, #EEF1F7); + /* webkit specific markup */ + -webkit-border-bottom-left-radius: 8px; + -webkit-border-bottom-right-radius: 8px; + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + background-image: -webkit-gradient(linear,center top,center bottom,from(#FFFFFF), color-stop(0.6,#FFFFFF), color-stop(0.60,#FFFFFF), color-stop(0.95,#F7F8FB), to(#EEF1F7)); +} + +.paramkey { + text-align: right; +} + +.paramtype { + white-space: nowrap; +} + +.paramname { + color: #602020; + white-space: nowrap; +} +.paramname em { + font-style: normal; +} + +.params, .retval, .exception, .tparams { + border-spacing: 6px 2px; +} + +.params .paramname, .retval .paramname { + font-weight: bold; + vertical-align: top; +} + +.params .paramtype { + font-style: italic; + vertical-align: top; +} + +.params .paramdir { + font-family: "courier new",courier,monospace; + vertical-align: top; +} + + + + +/* @end */ + +/* @group Directory (tree) */ + +/* for the tree view */ + +.ftvtree { + font-family: sans-serif; + margin: 0px; +} + +/* these are for tree view when used as main index */ + +.directory { + font-size: 9pt; + font-weight: bold; + margin: 5px; +} + +.directory h3 { + margin: 0px; + margin-top: 1em; + font-size: 11pt; +} + +/* +The following two styles can be used to replace the root node title +with an image of your choice. Simply uncomment the next two styles, +specify the name of your image and be sure to set 'height' to the +proper pixel height of your image. +*/ + +/* +.directory h3.swap { + height: 61px; + background-repeat: no-repeat; + background-image: url("yourimage.gif"); +} +.directory h3.swap span { + display: none; +} +*/ + +.directory > h3 { + margin-top: 0; +} + +.directory p { + margin: 0px; + white-space: nowrap; +} + +.directory div { + display: none; + margin: 0px; +} + +.directory img { + vertical-align: -30%; +} + +/* these are for tree view when not used as main index */ + +.directory-alt { + font-size: 100%; + font-weight: bold; +} + +.directory-alt h3 { + margin: 0px; + margin-top: 1em; + font-size: 11pt; +} + +.directory-alt > h3 { + margin-top: 0; +} + +.directory-alt p { + margin: 0px; + white-space: nowrap; +} + +.directory-alt div { + display: none; + margin: 0px; +} + +.directory-alt img { + vertical-align: -30%; +} + +/* @end */ + +div.dynheader { + margin-top: 8px; +} + +address { + font-style: normal; + color: #2A3D61; +} + +table.doxtable { + border-collapse:collapse; +} + +table.doxtable td, table.doxtable th { + border: 1px solid #2D4068; + padding: 3px 7px 2px; +} + +table.doxtable th { + background-color: #374F7F; + color: #FFFFFF; + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; + text-align:left; +} + +.tabsearch { + top: 0px; + left: 10px; + height: 36px; + background-image: url('tab_b.png'); + z-index: 101; + overflow: hidden; + font-size: 13px; +} + +.navpath ul +{ + font-size: 11px; + background-image:url('tab_b.png'); + background-repeat:repeat-x; + height:30px; + line-height:30px; + color:#8AA0CC; + border:solid 1px #C2CDE4; + overflow:hidden; + margin:0px; + padding:0px; +} + +.navpath li +{ + list-style-type:none; + float:left; + padding-left:10px; + padding-right:15px; + background-image:url('bc_s.png'); + background-repeat:no-repeat; + background-position:right; + color:#364D7C; +} + +.navpath li.navelem a +{ + height:32px; + display:block; + text-decoration: none; + outline: none; +} + +.navpath li.navelem a:hover +{ + color:#6884BD; +} + +.navpath li.footer +{ + list-style-type:none; + float:right; + padding-left:10px; + padding-right:15px; + background-image:none; + background-repeat:no-repeat; + background-position:right; + color:#364D7C; + font-size: 8pt; +} + + +div.summary +{ + float: right; + font-size: 8pt; + padding-right: 5px; + width: 50%; + text-align: right; +} + +div.summary a +{ + white-space: nowrap; +} + +div.ingroups +{ + font-size: 8pt; + padding-left: 5px; + width: 50%; + text-align: left; +} + +div.ingroups a +{ + white-space: nowrap; +} + +div.header +{ + background-image:url('nav_h.png'); + background-repeat:repeat-x; + background-color: #F9FAFC; + margin: 0px; + border-bottom: 1px solid #C4CFE5; +} + +div.headertitle +{ + padding: 5px 5px 5px 10px; +} + +dl +{ + padding: 0 0 0 10px; +} + +dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug +{ + border-left:4px solid; + padding: 0 0 0 6px; +} + +dl.note +{ + border-color: #D0C000; +} + +dl.warning, dl.attention +{ + border-color: #FF0000; +} + +dl.pre, dl.post, dl.invariant +{ + border-color: #00D000; +} + +dl.deprecated +{ + border-color: #505050; +} + +dl.todo +{ + border-color: #00C0E0; +} + +dl.test +{ + border-color: #3030E0; +} + +dl.bug +{ + border-color: #C08050; +} + +#projectlogo +{ + text-align: center; + vertical-align: bottom; + border-collapse: separate; +} + +#projectlogo img +{ + border: 0px none; +} + +#projectname +{ + font: 300% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 2px 0px; +} + +#projectbrief +{ + font: 120% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 0px; +} + +#projectnumber +{ + font: 50% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 0px; +} + +#titlearea +{ + padding: 0px; + margin: 0px; + width: 100%; + border-bottom: 1px solid #5373B4; +} + +.image +{ + text-align: center; +} + +.dotgraph +{ + text-align: center; +} + +.mscgraph +{ + text-align: center; +} + +.caption +{ + font-weight: bold; +} + diff --git a/3rdparty/quazip-0.5.1/doc/html/doxygen.png b/3rdparty/quazip-0.5.1/doc/html/doxygen.png new file mode 100644 index 0000000000000000000000000000000000000000..635ed52fce7057ac24df92ec7664088a881fa5d0 GIT binary patch literal 3942 zcmV-s51H_ZP)95ENDh(OT9xpYZC{M(=rqI* z+1erNEr&9zRjUI-4rN=4BBz>P@ys*xOjGRjzVE*Fx_qvyt9d@B@BO*&@8Mq!nM{Tc z_WoM84-~xLreSL9@vgZ{m2dF}`u=^ZF3syQ-s2tnBwCI3ZFvSfI20Wbj236~Urq*8Kfw@RKKfRQTgE>}uUHK^ptamY=o)LU(xy55zNQ(`qZ znZ&$O075mrrInIXQgw4%GCbMD8Vn`3n3$EaRwtP1D{A!Gs=e!L%3;ayv@I{rAw{xw z^x^>EIWQM8ob3m}$(BaupDMV;Ed8w5|i(*e`7rU$TOc&1o7`|!LyN5jHI z7uWAR!v4c2xMp?}QmRYyf>i}tYGU(g=>DW&==J@GbhR z5@BNVY3O$`^D%gk4khm9XpFhuwzxUhi9T=Du4rpVuYRSMPHeDqo+4htnZRU@G9`0& z9~p)CsFl1|t*wjfoTo&%davN^3RfJUhQ{ZZIAcD77X^XsF_iR&ZMQ;p>K5*+*48)x z+=<>nh+6Uq85jOkg>{z>a;+V`s(I;I%*5s+R@9a^wNoZ03(g9-EcH%uHvX&yp7`D#`9Kw>DU3s zjD-VuW_A-K)unlS4O3f>_B%pPONUmI#oyL};Lglp3=04>0eBBEw$D1k-$WTsoi#K* z$7h`NcyRZsZ#w~6I<%~u!^xDofYrzF>zVIj2N>Ijs`mVR(Oy&*9f}<{JtQj8jJT!oEc!NQXBq5y|6ET*N?7ox*E6#{i- z@_DLD^IYTtg|Pg?A~!7@OCd8p^)kxK%VBM84docx$Z{MvO)iiqep@or-N}TEU8$%; zJih?#yJ9)V1s_`}c3XbY9V}nEKwNz8ILmR|v)(w|D@oVG;=i`+$*)!(xH{9#$2Za;pyZ1wgU#)mHl|&8%iwu%yncO z`T32Ib0$D}j`c}}5M@M#7oR&G=QwU!!Ja*P7|NJt1@lo=d{_dY-q_lmDcH7{BHncF zR@^PmcLC6EsN?6N{fV3o8}>?h9X_@;=&-p7%tms7$_{3w(anwek_k&<&)~c$Ar?S> zy9gKavndTmxqAbE?SMgcWhXPENdKdz7ntt55Y3Hs3jjc~uR-#$tR(1a_abv9`-QzG z^J0Fsbd&yruq%xAsxf3rc=T}$Zx|AD%x{Fd=? z{qhl3kG5w-PqVK9-Gru%7UIEw)bt$ZMF|Z6HpmO)F%@GNT8yT|#FuWPxv@@Ic={;6 zU7)e!XG|1dx=kU|&|)+m+$&|Yw92Fa;*MnegXcCf8XsHfqg_F5t)3Jt8)EkXKuY21 zqt%4}@R8hK*(_JO0*H+Pa)6Pp&K49rKNeQEYb*x9WY`!`Vh3|80YF%I`lxv9_!$hD zOh$>zWaRIW!);6`vA$Zp;5lnGyX^^N%YEjCeJMHPolKCE1ttIqK<$0w&LcE8)`_c2 z^H^qf6ACV0t7FLLCsu#mL&Mb8gE@rZE#k+1Nrrxw+{N0^#bN*~!qt2>S4e#jC$a$` ze4@{)$aTEYq_!#2|t@Fj3e?w-XVuG$Z}kAR?_kgJAlZIJ)0{eHw#fybNooA zp02jyYVc&w!}m#BVP>ef2|U^J(A-#O1R#A&><*?Y! zOwml{CnE+aU3JfKE@uzge(qMY{^6siuXFt;+mMbapU;Ppejl=L#>s2#SMBbfP9AFT znEVA=TBtZ6d-GfF>kOxylg>Ek%qTp*h2ze!^^hOsmKOEE6b;maQ>~R>3#z`Zawbik z88OTykU3_!Atg^+vnM=1n}?%<$dHzn)?k&T#RWwb+*y;XNQbYNHKo3wr~&}Qa$id; z6^D*K9RTQZUuQVg)g~P%!BIiv+cXllt)KEP9IN)1udQKf>p|~lXj7K<-9}0Q%i9+K zXaF7qXclE>sf)7)J4_M%V{;(sFT7HN$o0#_qU#Ah1D{ zon=JihPcgG5xHuvQwOXBkt3(iUdx{6Gn|aa>@C9Cqg%rPK(+REZ4>6t3z7m@Aj;0l zSHh&%cKSJ*+WOJGwe?Y7d(9RAy)&NVS6uj}1m@U}jXH3oVQT9E0A)$ZDRdK>;_i;+ z7vbEoI7$1XK6vNxT(_sJ(GM4s92e;gB&Q zDO;(Ve^%gPG&lWW1fUf_=9-Q1%&`s%aD^o`Q2u`WI9V>Qm#D5?SW<)Njmt@aR5@6( zL4cdTo+Jg@>Brm1^_gf%0Z?}1AppR3NdFE5uzdpBZz;{Thd6SI-$gb2}pFAww$*j(2=s{mdz2E;lBvVcrN@}i2bC`Q5Y_;BID^f0J+ACVhyQsLg0@`okIk+i=LJ=3yvI*oASj62 za3C{Pu_fQ+atw!zN{$Shr*_UV=|jp4#CqWeGE?Jb`pq!|5bDES&-Ix=-N>DpydHqW z+-{QS+i)d;uGS)M%Suw9khR}3N82j|S{a#&Tctme0s%mTy<1S|;@M-+S4#o@!qr;r z+w(n=;@43Y_n#dI0Gb(T0{G7k-KY8k`MPM_Bss$?)SK){KJMrwv!vz42_U_Za zX7lDqiU8ZvCAfGpAtfVC5bQrYa4C)M9G$S4D&VqpJ8)lm$t5FAAR%ywf>*~VaivC70RVFXISv4Lx&tk^Cf1)qQ|rxp z*8H>)cgoM;(eKxH14u~~@JopNr9@A z#-yXVG?$es;EPqsn-j?45^L52U=nT#0A^T3JY$&B3EH&%2UHdv3P=_3$!n76!34ks zz^2ii@sXAu8LKYMmG=_^*qtiiOFNlG3?QYtG%wrCZh|)vlj8vq3sw~f1b8;_TMB>z zPSyDQy_9bbXD*#sNRGMzfSAwUD}ASX;ZGQcGdE=9q~ORU{v$}=z2Bc8EOe2S&);jS zCZB8P`hPoV1NBk)TQP2z{q$NL-GLUc7%>&fecE^E{I5gs?8!qTK7VgR7Z?}-`YG|z zVN-NvOlQ+B;~J*69_Xd1n-0MLKTY6&*%rTi*0^HXniz8{bCMsVpSXqs(GGO)*_#Kz z9YBCQ_VRhtwhMfppMh@OdxjCN0mH`5hKZr>UoxMx`W~u^kD&bskplglOiRxQvep*2 z0mk+kMP>J)K`8X3`6Zq|X~5IQ-_rrOn+_WvU{1Gs{ow1-Eb;K(Z?p$@ugXpr^?PM( z(5Hv;$*X=QZaqG_4q)N1v9sO(Dsei!;%IcIztt6YUs{yj z^77e`UYa^%<-Ts+d*b=ihKt?0_sj!ePNO@K*PGmGD*v^;rRAkduikx~UNk=@{XKeV zp_ir(dTaGVWBr{_02Kg2Xmlsn|IvIIRYivbo|L{yx}yX5Bte@P6C>1KyqvYnT{boB#j-07*qoM6N<$f^XQQ A+yDRo literal 0 HcmV?d00001 diff --git a/3rdparty/quazip-0.5.1/doc/html/faq.html b/3rdparty/quazip-0.5.1/doc/html/faq.html new file mode 100644 index 00000000..0b4d59b5 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/faq.html @@ -0,0 +1,47 @@ + + + + +QuaZIP: QuaZip FAQ + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ +
+
+
+
QuaZip FAQ
+
+
+

Q. Is there any way to use QuaZipFile in Qt where you are supposed to use normal (non-zipped) file, but not through QIODevice API?

+

A. Usually not. For example, if you are passing file name to some database driver (like SQLite), Qt usually just passes this name down to the 3rd-party library, which is usually does not know anything about QIODevice and therefore there is no way to pass QuaZipFile as normal file. However, if we are talking about some place where you pass file name, and then indirectly use QFile to open it, then it is a good idea to make overloaded method, which accepts a QIODevice pointer. Then you would be able to pass QuaZipFile as well as many other nice things such as QBuffer or QProcess.

+

Q. Can QuaZIP handle files larger than 4GB? What about zip64 standard?

+

A. It isn't supported yet. QuaZIP is a wrapper around minizip. The minizip version QuaZIP was based on didn't support zip64. The newer version that appeared around 2010 reportedly does. But it will take some time and effort to integrate this version with QuaZIP.

+
+ + + diff --git a/3rdparty/quazip-0.5.1/doc/html/files.html b/3rdparty/quazip-0.5.1/doc/html/files.html new file mode 100644 index 00000000..6d39d732 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/files.html @@ -0,0 +1,62 @@ + + + + +QuaZIP: File List + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ + +
+
+
+
File List
+
+
+
Here is a list of all documented files with brief descriptions:
+ + + + + + + + + + + + +
quazip/JlCompress.h [code]
quazip/quaadler32.h [code]
quazip/quachecksum32.h [code]
quazip/quacrc32.h [code]
quazip/quagzipfile.h [code]
quazip/quaziodevice.h [code]
quazip/quazip.h [code]
quazip/quazip_global.h [code]
quazip/quazipdir.h [code]
quazip/quazipfile.h [code]
quazip/quazipfileinfo.h [code]
quazip/quazipnewinfo.h [code]
+
+ + + diff --git a/3rdparty/quazip-0.5.1/doc/html/functions.html b/3rdparty/quazip-0.5.1/doc/html/functions.html new file mode 100644 index 00000000..d4d28a89 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/functions.html @@ -0,0 +1,579 @@ + + + + +QuaZIP: Class Members + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ + + + +
+
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- a -

+ + +

- b -

+ + +

- c -

+ + +

- d -

+ + +

- e -

+ + +

- f -

+ + +

- g -

+ + +

- h -

    +
  • hasCurrentFile() +: QuaZip +
  • +
+ + +

- i -

+ + +

- m -

+ + +

- n -

+ + +

- o -

+ + +

- p -

+ + +

- q -

+ + +

- r -

+ + +

- s -

+ + +

- u -

+ + +

- v -

+ + +

- w -

+ + +

- z -

+ + +

- ~ -

+
+ + + diff --git a/3rdparty/quazip-0.5.1/doc/html/functions_enum.html b/3rdparty/quazip-0.5.1/doc/html/functions_enum.html new file mode 100644 index 00000000..4d6d9ef2 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/functions_enum.html @@ -0,0 +1,66 @@ + + + + +QuaZIP: Class Members - Enumerations + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ + + +
+
+
+ + + diff --git a/3rdparty/quazip-0.5.1/doc/html/functions_eval.html b/3rdparty/quazip-0.5.1/doc/html/functions_eval.html new file mode 100644 index 00000000..de8329b7 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/functions_eval.html @@ -0,0 +1,84 @@ + + + + +QuaZIP: Class Members - Enumerator + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ + + +
+
+
+ + + diff --git a/3rdparty/quazip-0.5.1/doc/html/functions_func.html b/3rdparty/quazip-0.5.1/doc/html/functions_func.html new file mode 100644 index 00000000..ccbc34e2 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/functions_func.html @@ -0,0 +1,473 @@ + + + + +QuaZIP: Class Members - Functions + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ + + + +
+
+  + +

- a -

+ + +

- b -

+ + +

- c -

+ + +

- d -

+ + +

- e -

+ + +

- f -

+ + +

- g -

+ + +

- h -

    +
  • hasCurrentFile() +: QuaZip +
  • +
+ + +

- i -

+ + +

- n -

+ + +

- o -

+ + +

- p -

+ + +

- q -

+ + +

- r -

+ + +

- s -

+ + +

- u -

+ + +

- v -

+ + +

- w -

+ + +

- ~ -

+
+ + + diff --git a/3rdparty/quazip-0.5.1/doc/html/functions_vars.html b/3rdparty/quazip-0.5.1/doc/html/functions_vars.html new file mode 100644 index 00000000..98ca3344 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/functions_vars.html @@ -0,0 +1,117 @@ + + + + +QuaZIP: Class Members - Variables + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ + + +
+
+
+ + + diff --git a/3rdparty/quazip-0.5.1/doc/html/graph_legend.html b/3rdparty/quazip-0.5.1/doc/html/graph_legend.html new file mode 100644 index 00000000..35d21e2a --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/graph_legend.html @@ -0,0 +1,107 @@ + + + + +QuaZIP: Graph Legend + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ +
+
+
+
Graph Legend
+
+
+

This page explains how to interpret the graphs that are generated by doxygen.

+

Consider the following example:

+
/*! Invisible class because of truncation */
+class Invisible { };
+
+/*! Truncated class, inheritance relation is hidden */
+class Truncated : public Invisible { };
+
+/* Class not documented with doxygen comments */
+class Undocumented { };
+
+/*! Class that is inherited using public inheritance */
+class PublicBase : public Truncated { };
+
+/*! A template class */
+template<class T> class Templ { };
+
+/*! Class that is inherited using protected inheritance */
+class ProtectedBase { };
+
+/*! Class that is inherited using private inheritance */
+class PrivateBase { };
+
+/*! Class that is used by the Inherited class */
+class Used { };
+
+/*! Super class that inherits a number of other classes */
+class Inherited : public PublicBase,
+                  protected ProtectedBase,
+                  private PrivateBase,
+                  public Undocumented,
+                  public Templ<int>
+{
+  private:
+    Used *m_usedClass;
+};
+

This will result in the following graph:

+
+graph_legend.png +
+

The boxes in the above graph have the following meaning:

+
    +
  • +A filled gray box represents the struct or class for which the graph is generated.
  • +
  • +A box with a black border denotes a documented struct or class.
  • +
  • +A box with a grey border denotes an undocumented struct or class.
  • +
  • +A box with a red border denotes a documented struct or class forwhich not all inheritance/containment relations are shown. A graph is truncated if it does not fit within the specified boundaries.
  • +
+

The arrows have the following meaning:

+
    +
  • +A dark blue arrow is used to visualize a public inheritance relation between two classes.
  • +
  • +A dark green arrow is used for protected inheritance.
  • +
  • +A dark red arrow is used for private inheritance.
  • +
  • +A purple dashed arrow is used if a class is contained or used by another class. The arrow is labeled with the variable(s) through which the pointed class or struct is accessible.
  • +
  • +A yellow dashed arrow denotes a relation between a template instance and the template class it was instantiated from. The arrow is labeled with the template parameters of the instance.
  • +
+
+ + + diff --git a/3rdparty/quazip-0.5.1/doc/html/graph_legend.md5 b/3rdparty/quazip-0.5.1/doc/html/graph_legend.md5 new file mode 100644 index 00000000..9d509f35 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/graph_legend.md5 @@ -0,0 +1 @@ +9fbb782f23f919c0064b8f454a56ede8 \ No newline at end of file diff --git a/3rdparty/quazip-0.5.1/doc/html/graph_legend.png b/3rdparty/quazip-0.5.1/doc/html/graph_legend.png new file mode 100644 index 0000000000000000000000000000000000000000..3e9f9b16cdf251d56a1b7b6100fe527b836ef573 GIT binary patch literal 12219 zcmZvC1z1#HxBdVkAf+N*g3>7sLkNgScMaX$-69PF3eqLrodQEQ(j5cR-9yLxkH7EU z=YHS)--mf-&SuV;ea_lzz58A7TH%WFlGx8ko`FChY^hHlltCcm9N>5n9T|9^!NY9= zKAsxMNPYkz{{H=h7Q}%-uR&5DL{&Y~4q=`;uPzX1C!+@)QJC~$gg>{)x4st@y>>Dw zEberFu{Ji&C{ z+RR*kR5FHw58UT1%n3ez@Y&)#&msz;0`8$*1-Tvt_ylo^<)eW>e>hFNfPt|1zXspS zacipkLn&h?lx0x6ilfN~Ch~01kU$2~=UcSch6MUtR^866gJ7yud;7}T#3r9j>HCCH#S2^*9=9aK8XPm@nqqtm0(r=0S~K4?K%u=d?mg2lbL^oS*dP~9 z<9**KwD(t7o0%yaX~1KwtF>fXL7Vm(Hxe|aW%0xFXUt>kPE(2Z;k2sjRoxv=LF_DX z`Wi!cHBzxcd+^(uFS7bYx}Ww1`Q|{NeADRtVkwg4@9Wl)&A!Jaw64B>2H8%yAOlEU zQ~4fe%{%Pld?>2H8)l_~Swxt6TFsj8?U}wqynv_G);RPP2sD*2vu{;Kz*Sw6V3}C$ zNIL|Nm)5@$k-C5hxVWDdmZ$33f}vA)1jFeMn`9A;_;2HD3e)Yf}Gdo<>il$k2W9Mi%CMhHMC@j z&*tVX>9+cO`0#JbpgqEb9xFH_mlw#4e=OcUb9cd<4 zT5hgayOttUen@kZoFIWprvuA^)LXdn{_qSam@<&0_QuP$xgXP1X=++#%U&KV)XA!^ z{r#;?-3ccRJp)M-@O)VBj3f0VCl(&5w`h^7MoRQk9}uYIt@p28y+HMEwPisL`>wY2 zpYf6(*Lp(d=TX%PtVvF|M`1u*x*AxV8E9|jdq>6gy}c^!L8*34>xX+^=@Eo8^1`e) zHeO|jWSXsd0B+>KPbX!Wa2fN&=8^yJs{^uj&=AVuX}xq6f*AP`h2 z`c2UD0B8b&h zc_8?BxBWn*+=lCDc{wVQ?yH3{nBZu~+>C-&E}PMEak`Fgg9e~0H+#HOa`p>_&Hpn~Op48*~MV|i%k9Le# z5>@2LBL9FI-3~=4Y8wjHKbIt!b=F4dgSh`e<)JM4i0oS297skDx4*?!DOcW}GFF#r z8eZ`~UposBNLR;w3MQ){un)r{Wq|g3j|kE8Q-NksQCon0fB8` z8M3*xce_kVjx(Ai511oOF{6fw*1ilcOI@+xpUq3{P-H)PVhfB9eMcLhUEVM{{Pqo{%i2D3>5@&?!1QE{Ih%g>uCS~-!%TOYyVD> zgx6bOPWqompiCvKt{;f?inhnS@tjbxEQ5Ei1KRcIf6&LzGxxqnw}dra45#u&>EjYc zOfAgM&*$alx*RRdU#rzwPHxSVY4=uy^2$185E2mRwfZFITgC;M3_U>>?TaSY)zyvC z$1jk-7?G2L@OVCcIpjm9%5TnaxLMG1rPTK#wSz!X#InMoqUt;hmYlYJC*w1zCz+_x zE3acy3g16I+|dre8|+{a5fOXK(B{*UH6)evZ5kRHF1ZHl*^z6t`NsX(io_p3lHN|P zt5!r8mDB08)@#5dS&pHUJT^(F;%nIvhh($?)SJ$5Mb)nsZZ=>NN2noz=tCA6qSk=wq{ zy^eB@&Szvv>#WpdWDy)(wwBryXzLYTgD+GvUF#OCaR|Ok5jijH{}S^hirtlp$LmZQ zv(_1_?djGcXhkQ{`C9M52cPeQ9M%cvnP8$0(ardM9t_;>k0w&oee#fX@z+Zwt(}qg zOV)Vt%x@z$^>&FAU*%mCszP#`=8G3~rf)7XE%3SCB}(d9N;3LFT%WEd7ONHB3zOjw z$ypO8APnDI?k|@|y($$p|Cs^SgJl)fLLM|s1MHtm?r0%5nU7U%?b(Iy&JlS2svUZV zWt9-$BYzdC^)=FLX4habGyGf^S}8mr=YwD>NRlGxuURTyK%1Xj)lKp)mqc zTi2yz+#V9oBidmFJ}u4&=sotxn^td7f-Q1vk#;-Y9uO8O+vTQklr}=LuY}lOdAd^5 zg{8qr`nG|iG$@?Dt{QoJQpbR;3<#jasP3w=$@+}#% z8O?%*jfOd~va2mc-Jyb+e7b!Bl&^+!86^6`d}Jg7BpXB1R#!@u1idr7Vc_3YY+KgG z4ZURgBStGm(U;JQ>6jGhhEv%_vyyyQ1r|l&dN;n}=J3MN^7$!Gy`t4|S?n^}B}dgG zY+;cS6~9SX*iS}#)f#z~vat=9w9ABhg49NNeVEeJ!pAIQEpjgXwtH z2D6f!oUp;;-MzNETQ;>9IH7isp@1pXg>If__3AIIgitP49J@HA%c!{y0MkFsl(^*` zCv|hOda&#tK5vQLiEQ0WAV3pB=24tU_Co5~klM@1{C<{}UAJJPQoR=m)S45upSz~QDTT=ABfSDlad#%as*qGu_Uk9qw zFKwxC6gkYu$ao40@vhERHfCl9Mn)!9RwjlbpFdXz$ul{9OkU;l1QE5enwL|XMd=G8 zdZx!e-6}QaF^O3pUqV_uPJ5$B=cC2I+tnQ2bpoRU101PCgM%Ea3y+U?_ITyP>{wm7 zxw#Ft`CZ&)1_&Y86_Cw`={&1mRo6k990?CcQVPX=A#*JB%@VJrfnp;s6(i5DW=$19}C_e91hf36HgB_ zKUX|l;GQzCt5?aL?>uN`b!U=)@s1j;wbs=gs;~Hy?j7dC!MZL<#`u z*2NW*eU$!b2?=JgYRTepp}0^^PUjY=saz@ta?OgCv%5Pbx7Cl+{qLXN>gnl~UbT)4 zF=;iyyL%#&DgBqgZ$GT)ucoaX9v-f)8pf)rxff4zsX-W(>7P6cK3PFL$;%VVQ!Z3Q zC)&!3HhUQ!*nEc>*WE=fP);{`oH!`IWuCz{ma!%A!ll-EIrRDPcbpBa8{3;)OW7`=~z30X-IZLj0^5|4b*pCD89^o01%+`tbQo`+k+ zOJ`)Xa=*>JJD7*%WYeE(9F?W$=-rP?R)yl|(gZ#4thG?0wA2d?!G@tCN8}Tyn7w*- zn8+8AO~AY(;%Y?+%;RZ=TJuJ*4*qMf?t8kvJ@3kU-s9+zAD^?;a3^18Ofmx53I+z1 zYD3}2ifA~s`lSubKM0eM)dc+1?)0JzZ1iDvu_05~MIna=O*zca=?TW)GWvf6Dl-v3?K`@(9#O=oGk-nNTHTRuL%s5mtsyMH3Dt1kw( z(nQtf1v-PIyVAB4_Da%nq2rZ6IriZrajxXB;3p4x^cP_aXuRXvO!}4-TXs;(jMtOa zn>!Y~9u9Prlrea8c1o|*ifG#8$@?ZIs_U#3Y?hK-ZmLTwD{J+H5(QkxPnD`63UslzVW2u%6Cpj_F`b%LO|{Wn?6Lav`tl6JE`* z-)YY%;)~+H&PmCr7y&pX@5U3Fucb90>`K=eWA5>wvx;)iEZJ6@nXmUR`2n1K?-00~oM@|+TX9#-IQLTEZs|Um=z&?LYfO^#(z?$nyN~SXj zdLw0`NNc^mLCW$6WEz^$C3vFdU(LUX&1-CA-QF55qoQJydx?(TSY z)5CIgY_5<}dofd1u&FPLt)UT0%G)X`lZwMNd;s%yJX(T1>yerEil9#65^*q)tT*Ch z389@YVlx@I0m9-jaALNA=YVfn8_`qon8H$Buz+(>yI1VPZ*oggs0zQm=u2b{e-ors zLLBfJQnMB4zPzg_j3UPgI76DC=l0I{J|Ua%tH@ycmT}p*i^T@}PNR)du+QO1`%Zur zM2-{jDE~4H3TvU<6!NOMNkw2H^hFSUGkl*LJm39Jxjc+KKVy_52>W2y+Inm=r&!@? zt-iK~9%9I2EAY!=94Wg{43oEpuw> z>sk4yR}vUcrc$_b(6DxXdebZwFy?WN5aiMgO)3n^oT!cXHN$-kF=v>g4V|BS6Y{8&CGjZ6kfhed=pd%aQBlWKFbD-=<{Zv0%ew zLHX$KKgn^(wESVVRSv~?yv|#PC}>lIgB1?X!#*HaU65>~AR}FL;T~gCF86dQIj)>vq-<*#YNK5~C@d8FGkM-&qs%|su#J%cEbozkz zm6nr@V`FYMl2*t7evzj*H8?g1v?9dTCN#$9lJhy^1;oe?&N5K^3g0qr2el2v6$HYUQBrhKn zm+YXS);T&>nS%vnuFsD}LQBcBRhib!dY}(`i})ggjQtRAqr-@9d^fRXOVLTQr=xHO zp5avSQjLN0?UKa?I<}Pn+932Gv4(uP6|J`A1kw|Qv_@{@UbkN@nt8=K!jF$p>+9Rq zFY(b}tq(32R=bZ6iO`lk*_0_Tb#`jpq)gqS^(;qMXF}wM&ZMNOnTt90GNTL~MlToX z$J^QvYH#?!7$ygFbIwUZ_FenU z5ZVCwVrOTy-O_7>A1_0|XLi}dB9)aiu!e~}UK@^U|1e96kau5|aRWNl#!4u-+i0~^ zE6aJSrN_vC%<*g^Jt=9UyPLEO;;E4QlFLG|VDBTK{B3F8T}F9d)<%cE#1Gz+WI(On zxR)%zd=+eUwH2K;lp^h8Tje+e>W3e^muM@_uFjS#;9&t*GZ)aCe@J|hd4*^R*1)U} zH0s+m9U7_7EBmF!_A0VRUS6-FRlw)U?hDS>pyy&H)k{^zyh0w|O4KJeAI_r5lDqEo ze+v{&!zulBmTGr5rb}YP#24jKXSSnwJqNn16KPr+ZCm-`huOrv-|MEBAYP(6Zo5!uDPS^AjR->*>)+iR8m-WK@Y6{% zPvx+b6X?k@aN~qZ@a(H@qMvF3~}^?t`Ar3N0&q<*W)QDuO2+wtx@K12E{1! zTXqh18BR~f@8i^q+;B*8nOXf1Cx+UsYW{muu4(2E}@hbFur+x;c%3U;# z4#rAKQbtAzDJV?^VIWcZjCFarx7}l0#|lnsGo=DbA)xIzlQZ51eN(xT_jSK+4%EPP zvzVY_$u zp988^y&3TcJ@6h{OMLLT-43zC&JoL@eJbnnYVr4p7}j}T(!0^4CE~bm2HRF;WpyFp zQPAi3b0zS+>3=r11v6b&TVmctvghJJnct|4IuFm*U7wLNYu1 zh>kWoUOFAx0+{U}fd$;+c6j9Pdn{|u)fdV=3gw@Nh}(y&$oHl8sk;i zQ25yT?riczLEHQM^5JBVkgYx>SjxvIxjc|D3AuIaid9Fd%HSAa7bUzX6{|d0eA7 z9z1%iW=}`Q&_bPct?7_Q z*&EuEu5_?MPEOw4mHs8%C0&qz2YS^c0M=fqIJrm5vy&@3^AyqkENdU>p+7#`Vq|}s z)w4~RwtdRvF7J1Dm?xL|v9HgYYkT|dW4;37VyXzNyz9eM44WAQ{N#F<&eCWt3P2hl z;3WGjxO9GcA}_P`4|fdHddZw%a6skOeI?rN?RYjC(H+7wImKh8vpM@hQ{xC-QdTyB$y6*hoeUJB^Lo9dnnjY6D}F2MO8zKD(m$8e6@ZpFDVHxk^tJ^ZXYP04tN^Z zl+`WFJts0^5QlPW)Y!GBCxRS2VmIeN%~WClV1r7*r6nw7QXyzrC@HZ?Xo&9p8tI>{ z`I&H7;*|1~Oi^*mL(as9+?u_g7Vi_K@qP7InxI}L9-}t0y(d46_ zMaA+-1Axqjb$*9NxdCev+1gP86ACYlKCXsd?^x`vb~!`p*1C*cwX{&j$0vlmNASdG zWzormnnDu^A#K(LMg+6l_JvO*P`p;PBt%MHTOWqkG2v-M1ZD4vPMZH^FqZ~k`YwDS z-zFNqMm5A^){1YR8*^`y$LZ>y4iVqeo_1UjECVosF|Zle81;<*3wh;I34WK2TM)%M z=V&JU$n>shJdUYw@X<*=W7gwN-@is5%(D17Owff-kPs5WYCk==xIkIb>_p?+6Op65i!IXT1puIv zITwi<@x!%P7PC}F1~c1;npMW3x9;|?{kxU6TQb91%B!_W7pYi1UoV_?j3r|*GXPQoLetxs8SG00HDgimC3Kh9dO zAIxg6;k`cfkf<2XDjqs*DjA1xLXq$;ma^Za7CP#el4o9FGY>2<-9C#qnhn-P5MKGa z*Bpi1g|hjW8=9|-*r2I_O@o8A#l>0{>PTxnITx#lj81J=Vf;CTnZ+qn!K(S`thWzh;I7iYKg={qECh{KNNLG`}9GaL2;$mnC znDp2XmqThZ+b)VtvZPSoP4ImhiB%MUDnYukxsJC z>Dz-(GL}0k(hoQIIHNtT(2{(;`N*bnRGbP;N)I>R-xaSMr<`2Ww%-Kt`^sHZGZU#B;QdwbUK0zsFY;SIQM(HWIN5>8%nHhTK1ZJ}b??FKEGLep3m|KX1R%Kyh>qp&5k zp&JZvEwKs=dAIyhp5&QeK(=7jdRgV)<{pXzEQ*Yhk`}-YwuXiLZ%mQoEx6Lbcf)DKMyqJs zTng>pEo(b#wh6ZabI2xMe+cSQTK$CL*6|;fvX^#@$3>+5RmY1Rg?fFLuGRrwHIGwV z-ASiV56~lWp3+eb{VMWEH#8ib3=Y%9dRx3(xMi0cGXxL_mZ5~RWnjns8N8vGk1DYR zKt{zX6KkHvq?kAkCAh99>4vzAz-oDVU)MN110IU7kLflzFE~}fUeC*9wfOfhmvi&+;w0EpA$GzE11kwdy`An0OM*{;Bu}P*J2VxCv`joY#!j0}OYk+VS z@{AP$awi6r+geNGtZ@rH6NV#lKUSHMQF&jgSC}NNt9zvM@BUzTe2)0G+wn|QV;mR5 zvd_!@kV9?$2(y`xT<5JfE$K~fKLYyD#)HkLDlWulD&2c?Zk(r##tRhkZ(<;FxTN(T zf$)h;?JDZq%MkIe@;o2N1U6#j?5|-vJdQ>NakK>F&#BIJ49{jc+LrC)#9@04?)iM@ zenOR2K*XAI;Xecg?T3f+o}EYX|2Gf0Kk9dH$XI%Ig^MUfnCqsxnKC6s3_g2S{{+q3 zeTUs){Ub2@=-%`MAf}QD3xo**AkEEL)9`=0yF4Pybzqz_g*K-kvd{QfSv+*DL}nN z1O4td;{1RRs3OOt3R-HqFd0rU{>yaEia9Nnj{!C-FK>2mcS$WnC6i#D#)AG>pFD=6 z=2rOx@FA3PwZHhs?{Q&3mnomw@-Q$qB0ldMbTGG_slQTV{#6xH@M4I~%J(#znajm9 zj+O%KE^p?$lXwQKm3P@d8ozyVm5PwKlRcsJ$8SSWHJfc_nNq~PlqkI-n|77t>N#!cegb!-)kjXE!O`SPE`>0`T;1L1sHh94-cfN z-Z}2LTlm5Z=h)w-Y|kPd=;FkooqD>q6K<&cp`ct{6wWXMj1o^f|*-c>)dJM0KVGuQrE*Ru3*H(#PoL&oRO)79m8wd_ipA*U<4LCkyPdR3DYt-GP z{7kw7;)D&&=cZ|8e``)r0*zMwcaxW^tk{?Il7WS)5*6j_oyDur+Y6dzx8#Sarih$z zm%RtNfZn70brwz2S?(tHl3V^eMVnlC2=3~7-0>8*5qoIM=`?b}_9Idv;?%`BglBf`>Ukwq5 z`{=r)RU)0ppT7e&b}NH{h{q!D0s;z6dMLwmi&2ID-J_Y;=13PFou4=20m*u{p2VQH z;TjOZZI>E{-@RL3_FL46nYR3x6CN(*cYl5JQ#74c0mo`_=EMgkHjV8cl^}_G7-?d^^*V)0Izl@d*|m(;za;-!pWmJv)>TmwK*y*&j~_~gPE}= zo}Bi%udVe;=Z)y;(dzS4y=5wS{nlh&+aB8FbA#?&Dk9S6F`2&s6dM3hhMKwwaKS(8 z#(x5_BB<*Qf^-tnG9B~ZYl(T+JDy?uxW4Sf_W1L+@+q$QGuxkgeeW!1=r32$o^>}n z`7MPMN7ju)t5p+Hox71($qsZ2iZ|HP<=gQa5YbW_`F`v@zrOxO>mPN$-gjd?OR-Y7 zpQg!7Cek`PS0%JR!(BXiR|BR&6KPpr{7X+Q=X$0^JF`|VKwkluFkr4xhyQQc^{X&v z+JWq4ab0PNMguO<*!F$}_$#q-v8z>g_gglIOZ!I5H0;+omjI;6A7QGXFgp+zxa?g~ zVws{$l+BnY5$$n|eS*g!^m!nuA{(Ll=wiAyxU)VEDARxC(%|1t?oPZ?zZq8i{S6Nn z#!pWvhEr2bf`h)1@=}C`R$TAov;rI>)heBkRWK|%ftGgJV!rxus>s*s?oV2A&t&{N9 z-zV#v`nwB#=cBszzOo_)`!65|N?<{QCYJ>VNMze%-eRNZ_r$i8JLwes`BDC=_WjG9G>xiKS_& zJw}qE>qo9W$Zv&(XmIQrk#OtLlPTJr2AOU#FnBkdau{z@G>({s8?XIF9;nhonaL_E zZMy)_yv9VJWVh%(+nG-i>7__@4|E<*v%yoG>Ja85_s0*{H`mq>KuP1OW&Msdq+pe-K7M zj^x$JS@9~1Uv0_@^mjAh&#XW{Br|7g_9*-BjuJEk+Yw?UKYhBz$-LdV&W}?5UqTgu z?_CJ1mhxTtYpkvo#N*TCgZc3sO5zhuT?k}kFkTXuta0t=h|3mo686Hrv1zXWNJxUk&{#sqN{g@E8?<;c(W-yDypeCapmXeViXJac|G67zSn-&w?C@jF_& z!@vNz8r>*liKNZ*T*~7bx5hklI0e5Lq5NN2r5ik12wd7bZgCmi6z^TqC~pkZfx>~r zt~m#D;SdQPAdA~>$*m4oW1NmA2TRMyFtH@*rTJZ-t`3c|&AJzgcb#eKO5}*-^Std+8xZ5Xh0KKbQy(sXN%QJ+S}Wu zWlYl;94@P!?W4^%KvqEJ&~9Z>wgcwtCuGa$WtTo2`h;#N)9)!Zb!*on`kFp(ccJ&A zk{eden7^OKEQP5lE`Ee;S?0pxqQ=7^GAKkeAFWdOS@7P{uUg|iI|{JdIgrfU-*-7W z?gMIuiF_L0>9mIa>ckTR#+^Q71K)##4?u8rG( zptzjofuVqa%?9Xw{--PLpWf%Wpr1cq2a0TVDuWEzfrVfnJ6-SN_J8e(@)sI_-jTlz z(sKlI4`6!wLMw@uz3!j>YPvf6h!XAMCKlw+s5^H&HlROIz^}-4dEZb%fVQpLiIt#l z>wPh^eC9nOzuWvlCoh3UJ{$QS!7}gc$4G4hEf71_9vq~|0xw7Vg9OZ4m|&>ppt^*_ zhYGYbDsrkGA(avWC;Uv$FVVeOX) + + + +QuaZIP: Class Hierarchy + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ + +
+
+
+
Class Hierarchy
+
+ + + + diff --git a/3rdparty/quazip-0.5.1/doc/html/index.html b/3rdparty/quazip-0.5.1/doc/html/index.html new file mode 100644 index 00000000..cd00d9b6 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/index.html @@ -0,0 +1,124 @@ + + + + +QuaZIP: QuaZIP - Qt/C++ wrapper for ZIP/UNZIP package + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ +
+
+
+
QuaZIP - Qt/C++ wrapper for ZIP/UNZIP package
+
+
+
+Powered by SourceForge.net +

+Overview

+

QuaZIP is a simple C++ wrapper over Gilles Vollant's ZIP/UNZIP package that can be used to access ZIP archives. It uses the Qt toolkit.

+

If you do not know what Qt is, you have two options:

+ +

The choice is yours, but if you are really interested in cross-platform (Windows/Linux/BSD/UNIX/Mac/Others) software development, I would definitely recommend you the latter ^_^

+

QuaZIP allows you to access files inside ZIP archives using QIODevice API, and - yes! - that means that you can also use QTextStream, QDataStream or whatever you would like to use on your zipped files.

+

QuaZIP provides complete abstraction of the ZIP/UNZIP API, for both reading from and writing to ZIP archives.

+

+Download QuaZIP

+

Downloads are available from QuaZIP project's page at SourceForge.net.

+

+Platforms supported

+

QuaZIP has been currently tested on the following platforms:

+
    +
  • linux-g++ (Ubuntu 11.10, Qt 4.7.4)
  • +
  • freebsd-g++ (Qt 4.0.0
  • +
  • hpux-acc (HP-UX 11.11)
  • +
  • hpux-g++ (HP-UX 11.11)
  • +
  • win32-g++ (MinGW)
  • +
  • win32-msvc2010 (MS VS 2010 Express, Qt 4.8.4)
  • +
  • win32-msvc2010 (Qt Creator, Qt 5.0.1)
  • +
  • some Symbian version, reportedly
  • +
+

No testing has been officially done on other systems. Of course, patches to make it work on any platform that it currently does not work on are always welcome!

+

+What is new in this version of QuaZIP?

+

See the NEWS.txt file supplied with the distribution.

+

+Requirements

+

Just zlib and Qt 4/5. Well, Qt 4 depends on zlib anyway, but you will need zlib headers to compile QuaZIP. With Qt5 sometimes you need the zlib library as well (on Windows, for example).

+

+Building, testing and installing

+
Note:
Instructions given in this section assume that you are using some UNIX dialect, but the build process should be very similar on win32-g++ platform too. On other platforms it's essentially the same process, maybe with some qmake adjustments not specific to QuaZIP itself.
+

To build the library, run:

+
+$ cd /wherever/quazip/source/is/quazip-x.y.z/quazip
+$ qmake [PREFIX=where-to-install]
+$ make
+

Make sure that you have Qt 4/5 installed with all required headers and utilities (that is, including the 'dev' or 'devel' package on Linux) and that you run qmake utility of the Qt 4, not some other version you may have already installed (you may need to type full path to qmake like /usr/local/qt4/bin/qmake).

+

To reconfigure (with another PREFIX, for example), just run qmake with appropriate arguments again.

+

If you need to specify additional include path or libraries, use qmake features (see qmake reference in the Qt documentation). For example:

+
+$ qmake LIBS+=-L/usr/local/zlib/lib INCLUDEPATH+=/usr/local/zlib/include
+

(note abscence of "-I" before the include path and the presence of "-L" before the lib path)

+

Also note that you may or may not need to define ZLIB_WINAPI (qmake DEFINES+=ZLIB_WINAPI) when linking to zlib on Windows, depending on how zlib was built (generally, if using zlibwapi.dll, this define is needed).

+

To install compiled library:

+
+$ make install
+

By default, QuaZIP compiles as a DLL/SO, but you have other options:

+
    +
  • Just copy appropriate source files to your project and use them, but you need to define QUAZIP_STATIC before including any QuaZIP headers (best done as a compiler option). This will save you from possible side effects of importing/exporting QuaZIP symbols.
  • +
  • Compile it as a static library using CONFIG += staticlib qmake option. QUAZIP_STATIC is defined automatically by qmake in this case.
  • +
+

Binary compatibility is guaranteed between minor releases starting with version 0.5, thanks to the Pimpl idiom. That is, the next binary incompatible version will be 1.x, and if zip64 support is ever introduced, then there will be a build option to compile either as non-zip64 (binary compatible with the old releases) or as zip64 (which will be binary incompatible due to different file size types).

+

+Testing

+

To check if QuaZIP's basic features work OK on your platform, you may wish to compile the test suite provided in test directory:

+
+$ cd /wherever/quazip/source/is/quazip-x.y.z/qztest
+$ qmake
+$ make
+$ ./qztest
+

Note that the test suite looks for the quazip library in the "quazip" folder of the project ("../quazip"), but you may wish to use LIBS for some systems (Windows often puts the library in the separate "debug" or "release" directory). If you wish to use the quazip version that's already installed, provide the appropriate path.

+

On some systems you may need to set PATH, LD_LIBRARY_PATH or SHLIB_PATH to get "qztest" to actually run.

+

If everything went fine, the test suite should report a lot of PASS messages. If something goes wrong, it will provide details and a warning that some tests failed.

+

+Using

+

See usage page.

+

+Authors and contacts

+

This wrapper has been written by Sergey A. Tachenov, AKA Alqualos. This is my first open source project, so it may suck, but I did not find anything like that, so I just had no other choice but to write it.

+

If you have anything to say to me about QuaZIP library, feel free to do so (read the QuaZip FAQ first, though). I can not promise, though, that I fix all the bugs you report in, add any features you want, or respond to your critics, or respond to your feedback at all. I may be busy, I may be tired of working on QuaZIP, I may be even dead already (you never know...).

+

To report bugs or to post ideas about what should be done, use SourceForge.net's trackers. If you want to send me a private message, use my e-mail address stachenov@gmail.com.

+

Do not use e-mail to report bugs, please. Reporting bugs and problems with the SourceForge.net's bug report system has that advantage that it is visible to public, and I can always search for open tickets that were created long ago. It is highly unlikely that I will search my mail for that kind of stuff, so if a bug reported by mail isn't fixed immediately, it will likely be forgotten forever.

+

Copyright (C) 2005-2012 Sergey A. Tachenov and contributors

+
+ + + diff --git a/3rdparty/quazip-0.5.1/doc/html/inherit_graph_0.map b/3rdparty/quazip-0.5.1/doc/html/inherit_graph_0.map new file mode 100644 index 00000000..13c52318 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/inherit_graph_0.map @@ -0,0 +1,3 @@ + + + diff --git a/3rdparty/quazip-0.5.1/doc/html/inherit_graph_0.md5 b/3rdparty/quazip-0.5.1/doc/html/inherit_graph_0.md5 new file mode 100644 index 00000000..d192be4b --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/inherit_graph_0.md5 @@ -0,0 +1 @@ +87c0f0d7a3432462cbd094e7c615e18e \ No newline at end of file diff --git a/3rdparty/quazip-0.5.1/doc/html/inherit_graph_0.png b/3rdparty/quazip-0.5.1/doc/html/inherit_graph_0.png new file mode 100644 index 0000000000000000000000000000000000000000..cc96c95413d41294d229b4232e462418c6ad3504 GIT binary patch literal 438 zcmV;n0ZIOeP)L=H?#7(9qZm7#Vm6b8leA23AoF z1Lz+WdaQmCbOH9fqCrPUDSw#5{Kih;%V1v^>lN45W;Av?#7wL zX=1q_Pa=d+-|%|-8C+bCh9D{B!*<#2=a;VUy-v5b9^4(E2VKiTL5SvS*MN`9K}|gVI70PkeV7q(W#gadIryP28ia^{KYkbN3xm2Z zYM-CfeNlsbVX!X@_Jv`2|7w~hd>%BJ=Q&N&mypz$rYT91NVyTEu4`S<)BZ2M8$Q1< g*cS%-!eCz*|CKWUZ(Qo=ng9R*07*qoM6N<$f}}~x$^ZZW literal 0 HcmV?d00001 diff --git a/3rdparty/quazip-0.5.1/doc/html/inherit_graph_1.map b/3rdparty/quazip-0.5.1/doc/html/inherit_graph_1.map new file mode 100644 index 00000000..40398203 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/inherit_graph_1.map @@ -0,0 +1,5 @@ + + + + + diff --git a/3rdparty/quazip-0.5.1/doc/html/inherit_graph_1.md5 b/3rdparty/quazip-0.5.1/doc/html/inherit_graph_1.md5 new file mode 100644 index 00000000..49b2a618 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/inherit_graph_1.md5 @@ -0,0 +1 @@ +521dc5609a23895b8a3757ffc576f343 \ No newline at end of file diff --git a/3rdparty/quazip-0.5.1/doc/html/inherit_graph_1.png b/3rdparty/quazip-0.5.1/doc/html/inherit_graph_1.png new file mode 100644 index 0000000000000000000000000000000000000000..b4aeb786b698d53e0d863a977b5e344bd601ae41 GIT binary patch literal 2239 zcmV;w2tfCVP)9nq*~EN z*{y^k0jb2Lm-f(0k5&5T&^F4gNRiqDA}6Xyagd_|Fz|n)qocF4v+;P`?SXj3`Sa(m zUcK7i->;lOU|^GYJf27-+#ZEja2!{5274F)3J44U1q23w0s;d-0h@j>sdPhZ@rgu^ z<8*pZeyZQB>e!eJ7=ZyZ%C24GmvW`9tn^@HY^(;1B^gjtUv2Ug>DGA4XeNPG8W9*^ ztTZ`g$1>yn=rmUMCLi0KTP(@I38j;g=5g7osdV3BqPNl)vi-&vW*BgS>8qCNg{6&) zzf(uf%6I@n~D2iw8OA6=O8d(iG1N!y#zHEOX?RIkAb<1-uk^bEXjac z={iSQ_R!7@nlCYNx2@8|rP-zwzI`v7&2t>r+8T~Vg|4pl!NIsF3T!6Lh-_d$qzpqTUp8E^F@y1lF3xnz*LP#PtU$+G$M*ZTiecthLAJA z%NB#cc+U9vzd!zXd|_d^PuI{L#8_doh*?DFOR@I05#7u3yy!N8+OSwcuSTqlY`M@K{ycXf0` zVzFJ#&GoDXbK=B_Q>RX`>TL_~`Fs--6P=x%%9%}pNhA^j0|WSrF^=i)@6Tp^d-wL9 zJ9mQ+q8Sw#&vT=rZ@llDs>35Ug zU#zdsHaG8({}~AQYinyXpE=}tPLk4&4i2j} zv$KoS(~A!uu5%n03Izxuzx}o$-&uBhynw)X!_!Yc6_4+Y$M-5{QmNHsGBrK@lO(04 zrtaRlb+1sUxWfU*m=6rAI&PX@Y_RxUABIJ)D)p}%v#k@S5QIiSXgqXCwAc@@Wil|V z%A!>&`Qc@@)`C~L3TiGI)eW6(TS zzRp^D=7|V1*v+9$zlo(+X(=~#Eo%LfRo}Pj7|IICX}*_yfVpK`aVRh*t}5#<(Md(s z&W(RVT|cF;#W;6cnaPsIcqclAONgD*0@AXzSq+TEI&M16G#S4Z)r%;iJ1sDQv}}21 zHvLTMxDnNDF{-OgGj;m&5360ft##tS<4n#ltm?Q?Et51G8>#809+>9K4YIXP9C)1h zC7H!KZU!4u_3YTo?W+?99*3uu0Vp6a02B}y019}#-=oxz_rLk(p?BW-o7>~s?hqJH zDE$K2&6__;($d=6BSN@9z?aMAi^ZbP$MZav1MWj$+?2`G+`84cZ{K^%%Nat5&&QKZ zr7()wZ0_+h4ax z`|jUsYis1`r4pX!?%&VI6A`#*(+m>~1_`@INWh4}!NIrQ`s-`2{pHh7|2aH-h2uyr zr!mh20=|KP&j=yS&GoU^E~Sv4C<@_lolRq#oSZyx;K0VlhE4r@P%IXknVHdPu<7xq zTrM{@HkQxl?H?FC*4^E$l!~37zjyNFrOTJ6IF2ZVl?fp{&%N@>{!cy`kW0n>{+B8i zmzEw7LU!y3?b)+at`i%L3el+W+;d@`XYjwCT-Y&@NLcUciE#b;^`W65{f9O-%`kqy z|Jbo(HjfG_YH#0p=FIEgeDmM;-~ZyD)X zrpDja)+~xbG#Zg3)X@=PG7D`t2#go;JlEIv=T~3-W9c7MGV;Qz5&Hb|>xhsQ2#j}y zLIL@Hz~tm@6Mue8W+g&+0$UA%@w#xh?&X(XVA!ELLU->j&&{Q0W)|n>mXgWED_3S8 zJXj}$)YS!o!95J$dJ8~cfV8wUwX`%HJ{(idEG#U4|9$%0xvxe>mJN1dYb8{3?{3HU z`S8IdXxP2G>G0v$OE2xpSOu9*7^zv47k9=HEq0DimkOs5g2fXV+$&__2RIH z0hSDIElO`;={K`J9=0nq1O}{fu@b7feqz~AneS(?Bm)MVtc0p=<76#T1P0h}tP-kb z8^>yqVo3%-0f7OafWQDyKwtnUATR(F5EuXo2n+xPd=3Lu^z`(&Jp_lO)9I>h5E!WF z;K75(k00MYg&muknvNbls^12G_!ocz_Amex5EuXo2n+xP1O|Y@{{R7QnJP*_8%qEH N002ovPDHLkV1iu%R(AjZ literal 0 HcmV?d00001 diff --git a/3rdparty/quazip-0.5.1/doc/html/inherit_graph_10.map b/3rdparty/quazip-0.5.1/doc/html/inherit_graph_10.map new file mode 100644 index 00000000..e0616e7c --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/inherit_graph_10.map @@ -0,0 +1,3 @@ + + + diff --git a/3rdparty/quazip-0.5.1/doc/html/inherit_graph_10.md5 b/3rdparty/quazip-0.5.1/doc/html/inherit_graph_10.md5 new file mode 100644 index 00000000..53013171 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/inherit_graph_10.md5 @@ -0,0 +1 @@ +8e1c8bc28a8271d22c62e3355c4d6457 \ No newline at end of file diff --git a/3rdparty/quazip-0.5.1/doc/html/inherit_graph_10.png b/3rdparty/quazip-0.5.1/doc/html/inherit_graph_10.png new file mode 100644 index 0000000000000000000000000000000000000000..f38d56a2674b6129f65d777d8cec373e39998e0a GIT binary patch literal 518 zcmeAS@N?(olHy`uVBq!ia0vp^#Xzje!2~4#eRGTkQfx`y?k)`fL2$v|<&zm07kVR38^v!Ml$<$ZvW2Ob+hCLEzXLO6zkL!o*xkP~e#2p< z{>PEu78GczDhvFG(S5LW!sZAF`qTLSvBkC0+RiD@Cq1vcz0Ean#ncNo*S(&WD(Ivl z@~xsRamKQhI^J7_tWHY^JAJ90?{!uB!JOAqr@#yV8Y59=P=DnKpLP9(&GB9*Ez5h- z-X!Iey`AW>W3xlmjkyx;H)PpO4E$<6c#fSHn8CJdO72?L*E?!D=kj@-TP4=~sV)8c z+6R|ex3JIuwc*u_W7GakzSVK+rt^x`m+U?FO}7#Mnr9r#=26yu&Us0(na`r!@=aR} z)26(N-E_wDxz6T2tZZw#J<9())@T!+bGPKpJ>4JEkDixq>+cD^R{DT%nH}egz^80) zM0anLSoWdYclP-chMU{hM}C;Wy6Ma}t_5OWd}l^B1+DL&&g&v|^tg}IRJL8*+q@TC z+B?&tt@KL~$A;bo;$_P}w4dYMppd?C$JWjLb@%rI$+kI1o51MM2bq{#4>og`njxgN@xNAzHa+3 literal 0 HcmV?d00001 diff --git a/3rdparty/quazip-0.5.1/doc/html/inherit_graph_2.map b/3rdparty/quazip-0.5.1/doc/html/inherit_graph_2.map new file mode 100644 index 00000000..e20c17c3 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/inherit_graph_2.map @@ -0,0 +1,3 @@ + + + diff --git a/3rdparty/quazip-0.5.1/doc/html/inherit_graph_2.md5 b/3rdparty/quazip-0.5.1/doc/html/inherit_graph_2.md5 new file mode 100644 index 00000000..c6f5b327 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/inherit_graph_2.md5 @@ -0,0 +1 @@ +08d70385c6cb46b3e468c025be58be29 \ No newline at end of file diff --git a/3rdparty/quazip-0.5.1/doc/html/inherit_graph_2.png b/3rdparty/quazip-0.5.1/doc/html/inherit_graph_2.png new file mode 100644 index 0000000000000000000000000000000000000000..da509d6cf24afd8038a1cf88cee08f9031883c6e GIT binary patch literal 496 zcmV>; z5&4Q*+b>dtp6@T{25Y#Kk`VwucMEtur$zD6P$Cqk@6r4Ifz0IqL70qj!F`a zo>`Ie^`SVNb59>T*{_||DF5&X;vF=kL@PTQXZKf}9j^O;61j@)_momPi+!3nH*!fH z)GaWsSNy}3r~Dfu;Cc}fkZo+`0`>TT^57x#=@z);cl$fDTVPg=(BmYXgCQj%ytAiU z;%~<39Aq0yN#UGC?1JhUs3(vU99(rA+J%Hmzs^2((rk^aBznb^Qm(gwf{fLQ%(%0v zHWDX(4jM17o9Nt;s7B{N{Z?J8YHL5TVo~$Y}Ho+->)d-3_%X@+fpJ zMj;1LUhLpQ{wwfe2Ok1Ch(Zpckb@|W{ot}JbzP^I@>b+GWm(>>=(%KBHcgY^*oEiz me*)z}6mk%S97G`pQT_m^x)F^1Aky#v0000 + + diff --git a/3rdparty/quazip-0.5.1/doc/html/inherit_graph_3.md5 b/3rdparty/quazip-0.5.1/doc/html/inherit_graph_3.md5 new file mode 100644 index 00000000..7651521f --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/inherit_graph_3.md5 @@ -0,0 +1 @@ +b61cc9a124a015d73d6cbdf422313db4 \ No newline at end of file diff --git a/3rdparty/quazip-0.5.1/doc/html/inherit_graph_3.png b/3rdparty/quazip-0.5.1/doc/html/inherit_graph_3.png new file mode 100644 index 0000000000000000000000000000000000000000..45d2fc8d2bcf21cb410626208d57650be85c9992 GIT binary patch literal 504 zcmeAS@N?(olHy`uVBq!ia0vp^#Xzje!2~4#eRGTkQfx`y?k)`fL2$v|<&zm07}t8b zIEG|2zMXk@ZHt0H>(gCpBN~oMNNX%2&gp3-S~{`1cIVv~%^#@FWHAqa@L&apozYdc@AuZfjw#H!yj98g?af1>oFXad zB~|A<`zO45v+lta*~j0fTD;VJnXhfjq$Yi!IYKj4d?CAp`|*$Ym+eAp9@oYOq z&Ea9(nckb~eD@rahxwr?>96hdHuuEEPyhJnu=pZ&ch?V%=h?P#@6%fxxWD1X2F16E zOpC58dRWb@bt4iT$$Wid!1J@zW>)1q*|l5-zQK{xZno}iT(#8bg=d#Wzp$P!Dz}=Dn literal 0 HcmV?d00001 diff --git a/3rdparty/quazip-0.5.1/doc/html/inherit_graph_4.map b/3rdparty/quazip-0.5.1/doc/html/inherit_graph_4.map new file mode 100644 index 00000000..007d89db --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/inherit_graph_4.map @@ -0,0 +1,3 @@ + + + diff --git a/3rdparty/quazip-0.5.1/doc/html/inherit_graph_4.md5 b/3rdparty/quazip-0.5.1/doc/html/inherit_graph_4.md5 new file mode 100644 index 00000000..22214eea --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/inherit_graph_4.md5 @@ -0,0 +1 @@ +516630e9457f1fceabe81e76fdbf113d \ No newline at end of file diff --git a/3rdparty/quazip-0.5.1/doc/html/inherit_graph_4.png b/3rdparty/quazip-0.5.1/doc/html/inherit_graph_4.png new file mode 100644 index 0000000000000000000000000000000000000000..75eab91cfe76d21cc838f8af61df29f47fba5844 GIT binary patch literal 415 zcmV;Q0bu@#P)001Qj0ssI2h0=qU00006VoOIv0RI60 z0RN!9r;`8x0aQsuK~!jg?U%jLgD?z+?eGk~-|V zZdn$kR6t?Q7=~e*rm`&YBy}i+P)hZEA4-)=q?G%~`13G1d_M6zJUD60!I{nLZ}(>d z07xkvcFTN+L6Q0T{4gG z?G}5J!=0r(efFUnZV$ytSLH7QH4YqV-5*twD7F7xLzq#DPfh^%s)&)Z=X#a>yWsC3 zDG%7>VddB+w*mgdUprgH(`gl@do^db$mDfpzj!Qz`1{i2@K&5uk)L+xgyit~#P9H+ z9 + + diff --git a/3rdparty/quazip-0.5.1/doc/html/inherit_graph_5.md5 b/3rdparty/quazip-0.5.1/doc/html/inherit_graph_5.md5 new file mode 100644 index 00000000..92d597ec --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/inherit_graph_5.md5 @@ -0,0 +1 @@ +c70793a20c0ee967fcd21a549a42a789 \ No newline at end of file diff --git a/3rdparty/quazip-0.5.1/doc/html/inherit_graph_5.png b/3rdparty/quazip-0.5.1/doc/html/inherit_graph_5.png new file mode 100644 index 0000000000000000000000000000000000000000..60a1497ae5910b6aaafb1aff163cc7b5f7524f71 GIT binary patch literal 458 zcmV;*0X6=KP)00006VoOIv0RI60 z0RN!9r;`8x0e?wEK~!jg?U%8Yg&+_`VcozEtc6DG#WoB*W@Z{%fw=`3*$O{!kB5B- zBJzP?ZiMK-@Em4>x!DQUoDIkY9M7=ecd$B(B7#EX%&{tEy5vQITO7 zwrvwaM06|}(=;v1QrETGiHb1Bgb?F6#_}p9oO8XC@(4nTAfyOFiXa!6)g3i6`Q4B7 z+$N>uoLfc%6ZK2Gp(Fl^!1R9JT#j%%j%nT?w^q+xqp$z?x88nu|K6AL>U<@Ss4hbL zz|s6@xR{s>pLqSpt32`uH45B!-1+Kh5P1h(yjtVEDPm5?V#WwFgmI7p5s(0i9P7MY z73`Y#^L`1>U881rDdp`ULIrZI-O42mhYd0R7=f~YLH8Pj6hX39BuQ1yT9G7>A_yshkRr&%d1T-BuIu8vk_+-b zP1B_IC>}*otm_I2r?DT0t92q}Vm0J~1=bwE6O7XSbN07*qoM6N<$f^X!{ A761SM literal 0 HcmV?d00001 diff --git a/3rdparty/quazip-0.5.1/doc/html/inherit_graph_6.map b/3rdparty/quazip-0.5.1/doc/html/inherit_graph_6.map new file mode 100644 index 00000000..d88e519c --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/inherit_graph_6.map @@ -0,0 +1,3 @@ + + + diff --git a/3rdparty/quazip-0.5.1/doc/html/inherit_graph_6.md5 b/3rdparty/quazip-0.5.1/doc/html/inherit_graph_6.md5 new file mode 100644 index 00000000..dc35309f --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/inherit_graph_6.md5 @@ -0,0 +1 @@ +a304fc926447a90879a7cd82c1947d0c \ No newline at end of file diff --git a/3rdparty/quazip-0.5.1/doc/html/inherit_graph_6.png b/3rdparty/quazip-0.5.1/doc/html/inherit_graph_6.png new file mode 100644 index 0000000000000000000000000000000000000000..836b203bd9b127c409ebb2e478b52b688db5141e GIT binary patch literal 459 zcmV;+0W|)JP)^hmy zPsA8M5JrYg@q%G|1mDE~ED)e+fm*nHG%ZjIus{G72*3gXJm(;-^}4Rlhw?gF>#pml z)%<6grZ-}1g?XNdAdUWy*A85R04xxI1p=@@fIpyy_zzzXss8`~002ovPDHLkV1o3? B#gYI3 literal 0 HcmV?d00001 diff --git a/3rdparty/quazip-0.5.1/doc/html/inherit_graph_7.map b/3rdparty/quazip-0.5.1/doc/html/inherit_graph_7.map new file mode 100644 index 00000000..eb4eff8e --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/inherit_graph_7.map @@ -0,0 +1,3 @@ + + + diff --git a/3rdparty/quazip-0.5.1/doc/html/inherit_graph_7.md5 b/3rdparty/quazip-0.5.1/doc/html/inherit_graph_7.md5 new file mode 100644 index 00000000..d0b20e64 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/inherit_graph_7.md5 @@ -0,0 +1 @@ +bb94f8389c69fe5653003491edaa81cb \ No newline at end of file diff --git a/3rdparty/quazip-0.5.1/doc/html/inherit_graph_7.png b/3rdparty/quazip-0.5.1/doc/html/inherit_graph_7.png new file mode 100644 index 0000000000000000000000000000000000000000..639c9fa5944254677568ab3c13bb4674bc726943 GIT binary patch literal 500 zcmeAS@N?(olHy`uVBq!ia0vp^#Xzje!2~4#eRGTkQfx`y?k)`fL2$v|<&zm07*~3_ zIEG|2zMXNGw?%>H_|rY1G6xcSxGj2>Etn?HkXZiVByY`QIS-C@RzZ!rCHvLaxo7`m z_ip7>5X)S?@4z}ywe-^IipE-rsn{WLR zwVq_<$(vgLwjPa6JhNNIf6b0hX-vyE-2oKklNwoc`w3$^ok8$;d8Ov7coPN`}w{g{~Blh}x&g|z5N#CfD c3PnE{i>!5A><{iW1V$r+r>mdKI;Vst0K?wl*Z=?k literal 0 HcmV?d00001 diff --git a/3rdparty/quazip-0.5.1/doc/html/inherit_graph_8.map b/3rdparty/quazip-0.5.1/doc/html/inherit_graph_8.map new file mode 100644 index 00000000..e6166138 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/inherit_graph_8.map @@ -0,0 +1,3 @@ + + + diff --git a/3rdparty/quazip-0.5.1/doc/html/inherit_graph_8.md5 b/3rdparty/quazip-0.5.1/doc/html/inherit_graph_8.md5 new file mode 100644 index 00000000..199c8b51 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/inherit_graph_8.md5 @@ -0,0 +1 @@ +bb506805d0a0a557d4ccbc22245703be \ No newline at end of file diff --git a/3rdparty/quazip-0.5.1/doc/html/inherit_graph_8.png b/3rdparty/quazip-0.5.1/doc/html/inherit_graph_8.png new file mode 100644 index 0000000000000000000000000000000000000000..284895f64f0b55c98e9f11ee856a3ebeb4fce757 GIT binary patch literal 554 zcmeAS@N?(olHy`uVBq!ia0vp^tw5~G!2~29FWC#?uqAoByDlZ9tC>C9AW+rOGQAZ&%)rU2WNg;ggWJ&W_X9CH1u&G~TG$qN0)AJ^@#*9))O z6Sw~P=g4VKUk0k4GT@25&iZx3m)iOy56|FG(H9qgDRN(R7F*S>6T%;<@O4gy;j_!n zWSe%1*_HJe3TD3$xy>)Nd)e>9>#VLNzhYE+rpvH(Lngbd!*@QnMHAmgo!5{>me8OEwM)>w-@-F+~DH!o#RfUzrEIVHLFSQuC&M7mp$Ca_$8)2 zj5XL;s1=ut=ITLdZE!Fzwll{V$Jf@Xkg?sc)I$ztaD0e0stFH{4M|h literal 0 HcmV?d00001 diff --git a/3rdparty/quazip-0.5.1/doc/html/inherit_graph_9.map b/3rdparty/quazip-0.5.1/doc/html/inherit_graph_9.map new file mode 100644 index 00000000..34899ac4 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/inherit_graph_9.map @@ -0,0 +1,3 @@ + + + diff --git a/3rdparty/quazip-0.5.1/doc/html/inherit_graph_9.md5 b/3rdparty/quazip-0.5.1/doc/html/inherit_graph_9.md5 new file mode 100644 index 00000000..80f63f52 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/inherit_graph_9.md5 @@ -0,0 +1 @@ +2fed9c540a17c647243104aeda47c683 \ No newline at end of file diff --git a/3rdparty/quazip-0.5.1/doc/html/inherit_graph_9.png b/3rdparty/quazip-0.5.1/doc/html/inherit_graph_9.png new file mode 100644 index 0000000000000000000000000000000000000000..3d89b2fe530180be770e6649f671c049d138d722 GIT binary patch literal 520 zcmeAS@N?(olHy`uVBq!ia0vp^6+o=Y!2~4P#CEL#QAytJE)4%caKYZ?lNlHo_j{Ko16 zwsW6(tUq>!dHrl|QR*?QTmB?N?FbApnIEp%a;OGL$3R?lItgC z3UN;ic;x;?{ZPNFQO&BN62T8=o-LpIS4c|O=V_*6=R;fufOcsYEg>UWjL zJWX$lnPm@^FA808EI>3}rEEp#BfV!Vi;c4tzA&%pmwvMG{~5tx_C4>mt=1arhc + + + +QuaZIP: Class Hierarchy + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ + +
+
+
+
Class Hierarchy
+
+
+ + + + + + + + + + + + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+
+ + + diff --git a/3rdparty/quazip-0.5.1/doc/html/jquery.js b/3rdparty/quazip-0.5.1/doc/html/jquery.js new file mode 100644 index 00000000..c052173a --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/jquery.js @@ -0,0 +1,54 @@ +/* + * jQuery JavaScript Library v1.3.2 + * http://jquery.com/ + * + * Copyright (c) 2009 John Resig + * Dual licensed under the MIT and GPL licenses. + * http://docs.jquery.com/License + * + * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009) + * Revision: 6246 + */ +(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("",""]||!O.indexOf("",""]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
"]||!O.indexOf("",""]||(!O.indexOf("",""]||!O.indexOf("",""]||!o.support.htmlSerialize&&[1,"div
","
"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}}); +/* + * Sizzle CSS Selector Engine - v0.9.3 + * Copyright 2009, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * More information: http://sizzlejs.com/ + */ +(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return UT[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="

";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="
";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0) +{I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("
").append(M.responseText.replace(//g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function() +{G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='
';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})(); +/* + * jQuery UI 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI + */ +jQuery.ui||(function(c){var i=c.fn.remove,d=c.browser.mozilla&&(parseFloat(c.browser.version)<1.9);c.ui={version:"1.7.2",plugin:{add:function(k,l,n){var m=c.ui[k].prototype;for(var j in n){m.plugins[j]=m.plugins[j]||[];m.plugins[j].push([l,n[j]])}},call:function(j,l,k){var n=j.plugins[l];if(!n||!j.element[0].parentNode){return}for(var m=0;m0){return true}m[j]=1;l=(m[j]>0);m[j]=0;return l},isOverAxis:function(k,j,l){return(k>j)&&(k<(j+l))},isOver:function(o,k,n,m,j,l){return c.ui.isOverAxis(o,n,j)&&c.ui.isOverAxis(k,m,l)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(d){var f=c.attr,e=c.fn.removeAttr,h="http://www.w3.org/2005/07/aaa",a=/^aria-/,b=/^wairole:/;c.attr=function(k,j,l){var m=l!==undefined;return(j=="role"?(m?f.call(this,k,j,"wairole:"+l):(f.apply(this,arguments)||"").replace(b,"")):(a.test(j)?(m?k.setAttributeNS(h,j.replace(a,"aaa:"),l):f.call(this,k,j.replace(a,"aaa:"))):f.apply(this,arguments)))};c.fn.removeAttr=function(j){return(a.test(j)?this.each(function(){this.removeAttributeNS(h,j.replace(a,""))}):e.call(this,j))}}c.fn.extend({remove:function(){c("*",this).add(this).each(function(){c(this).triggerHandler("remove")});return i.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var j;if((c.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){j=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(c.curCSS(this,"position",1))&&(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}else{j=this.parents().filter(function(){return(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!j.length?c(document):j}});c.extend(c.expr[":"],{data:function(l,k,j){return !!c.data(l,j[3])},focusable:function(k){var l=k.nodeName.toLowerCase(),j=c.attr(k,"tabindex");return(/input|select|textarea|button|object/.test(l)?!k.disabled:"a"==l||"area"==l?k.href||!isNaN(j):!isNaN(j))&&!c(k)["area"==l?"parents":"closest"](":hidden").length},tabbable:function(k){var j=c.attr(k,"tabindex");return(isNaN(j)||j>=0)&&c(k).is(":focusable")}});function g(m,n,o,l){function k(q){var p=c[m][n][q]||[];return(typeof p=="string"?p.split(/,?\s+/):p)}var j=k("getter");if(l.length==1&&typeof l[0]=="string"){j=j.concat(k("getterSetter"))}return(c.inArray(o,j)!=-1)}c.widget=function(k,j){var l=k.split(".")[0];k=k.split(".")[1];c.fn[k]=function(p){var n=(typeof p=="string"),o=Array.prototype.slice.call(arguments,1);if(n&&p.substring(0,1)=="_"){return this}if(n&&g(l,k,p,o)){var m=c.data(this[0],k);return(m?m[p].apply(m,o):undefined)}return this.each(function(){var q=c.data(this,k);(!q&&!n&&c.data(this,k,new c[l][k](this,p))._init());(q&&n&&c.isFunction(q[p])&&q[p].apply(q,o))})};c[l]=c[l]||{};c[l][k]=function(o,n){var m=this;this.namespace=l;this.widgetName=k;this.widgetEventPrefix=c[l][k].eventPrefix||k;this.widgetBaseClass=l+"-"+k;this.options=c.extend({},c.widget.defaults,c[l][k].defaults,c.metadata&&c.metadata.get(o)[k],n);this.element=c(o).bind("setData."+k,function(q,p,r){if(q.target==o){return m._setData(p,r)}}).bind("getData."+k,function(q,p){if(q.target==o){return m._getData(p)}}).bind("remove",function(){return m.destroy()})};c[l][k].prototype=c.extend({},c.widget.prototype,j);c[l][k].getterSetter="option"};c.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(l,m){var k=l,j=this;if(typeof l=="string"){if(m===undefined){return this._getData(l)}k={};k[l]=m}c.each(k,function(n,o){j._setData(n,o)})},_getData:function(j){return this.options[j]},_setData:function(j,k){this.options[j]=k;if(j=="disabled"){this.element[k?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",k)}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(l,m,n){var p=this.options[l],j=(l==this.widgetEventPrefix?l:this.widgetEventPrefix+l);m=c.Event(m);m.type=j;if(m.originalEvent){for(var k=c.event.props.length,o;k;){o=c.event.props[--k];m[o]=m.originalEvent[o]}}this.element.trigger(m,n);return !(c.isFunction(p)&&p.call(this.element[0],m,n)===false||m.isDefaultPrevented())}};c.widget.defaults={disabled:false};c.ui.mouse={_mouseInit:function(){var j=this;this.element.bind("mousedown."+this.widgetName,function(k){return j._mouseDown(k)}).bind("click."+this.widgetName,function(k){if(j._preventClickEvent){j._preventClickEvent=false;k.stopImmediatePropagation();return false}});if(c.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(c.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(l){l.originalEvent=l.originalEvent||{};if(l.originalEvent.mouseHandled){return}(this._mouseStarted&&this._mouseUp(l));this._mouseDownEvent=l;var k=this,m=(l.which==1),j=(typeof this.options.cancel=="string"?c(l.target).parents().add(l.target).filter(this.options.cancel).length:false);if(!m||j||!this._mouseCapture(l)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){k.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(l)&&this._mouseDelayMet(l)){this._mouseStarted=(this._mouseStart(l)!==false);if(!this._mouseStarted){l.preventDefault();return true}}this._mouseMoveDelegate=function(n){return k._mouseMove(n)};this._mouseUpDelegate=function(n){return k._mouseUp(n)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(c.browser.safari||l.preventDefault());l.originalEvent.mouseHandled=true;return true},_mouseMove:function(j){if(c.browser.msie&&!j.button){return this._mouseUp(j)}if(this._mouseStarted){this._mouseDrag(j);return j.preventDefault()}if(this._mouseDistanceMet(j)&&this._mouseDelayMet(j)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,j)!==false);(this._mouseStarted?this._mouseDrag(j):this._mouseUp(j))}return !this._mouseStarted},_mouseUp:function(j){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(j.target==this._mouseDownEvent.target);this._mouseStop(j)}return false},_mouseDistanceMet:function(j){return(Math.max(Math.abs(this._mouseDownEvent.pageX-j.pageX),Math.abs(this._mouseDownEvent.pageY-j.pageY))>=this.options.distance)},_mouseDelayMet:function(j){return this.mouseDelayMet},_mouseStart:function(j){},_mouseDrag:function(j){},_mouseStop:function(j){},_mouseCapture:function(j){return true}};c.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);;/* * jQuery UI Resizable 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Resizables + * + * Depends: + * ui.core.js + */ +(function(c){c.widget("ui.resizable",c.extend({},c.ui.mouse,{_init:function(){var e=this,j=this.options;this.element.addClass("ui-resizable");c.extend(this,{_aspectRatio:!!(j.aspectRatio),aspectRatio:j.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:j.helper||j.ghost||j.animate?j.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){if(/relative/.test(this.element.css("position"))&&c.browser.opera){this.element.css({position:"relative",top:"auto",left:"auto"})}this.element.wrap(c('
').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=j.handles||(!c(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all"){this.handles="n,e,s,w,se,sw,ne,nw"}var k=this.handles.split(",");this.handles={};for(var f=0;f
');if(/sw|se|ne|nw/.test(h)){g.css({zIndex:++j.zIndex})}if("se"==h){g.addClass("ui-icon ui-icon-gripsmall-diagonal-se")}this.handles[h]=".ui-resizable-"+h;this.element.append(g)}}this._renderAxis=function(p){p=p||this.element;for(var m in this.handles){if(this.handles[m].constructor==String){this.handles[m]=c(this.handles[m],this.element).show()}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var n=c(this.handles[m],this.element),o=0;o=/sw|ne|nw|se|n|s/.test(m)?n.outerHeight():n.outerWidth();var l=["padding",/ne|nw|n/.test(m)?"Top":/se|sw|s/.test(m)?"Bottom":/^e$/.test(m)?"Right":"Left"].join("");p.css(l,o);this._proportionallyResize()}if(!c(this.handles[m]).length){continue}}};this._renderAxis(this.element);this._handles=c(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!e.resizing){if(this.className){var i=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}e.axis=i&&i[1]?i[1]:"se"}});if(j.autoHide){this._handles.hide();c(this.element).addClass("ui-resizable-autohide").hover(function(){c(this).removeClass("ui-resizable-autohide");e._handles.show()},function(){if(!e.resizing){c(this).addClass("ui-resizable-autohide");e._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var d=function(f){c(f).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){d(this.element);var e=this.element;e.parent().append(this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")})).end().remove()}this.originalElement.css("resize",this.originalResizeStyle);d(this.originalElement)},_mouseCapture:function(e){var f=false;for(var d in this.handles){if(c(this.handles[d])[0]==e.target){f=true}}return this.options.disabled||!!f},_mouseStart:function(f){var i=this.options,e=this.element.position(),d=this.element;this.resizing=true;this.documentScroll={top:c(document).scrollTop(),left:c(document).scrollLeft()};if(d.is(".ui-draggable")||(/absolute/).test(d.css("position"))){d.css({position:"absolute",top:e.top,left:e.left})}if(c.browser.opera&&(/relative/).test(d.css("position"))){d.css({position:"relative",top:"auto",left:"auto"})}this._renderProxy();var j=b(this.helper.css("left")),g=b(this.helper.css("top"));if(i.containment){j+=c(i.containment).scrollLeft()||0;g+=c(i.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:j,top:g};this.size=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalSize=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalPosition={left:j,top:g};this.sizeDiff={width:d.outerWidth()-d.width(),height:d.outerHeight()-d.height()};this.originalMousePosition={left:f.pageX,top:f.pageY};this.aspectRatio=(typeof i.aspectRatio=="number")?i.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);var h=c(".ui-resizable-"+this.axis).css("cursor");c("body").css("cursor",h=="auto"?this.axis+"-resize":h);d.addClass("ui-resizable-resizing");this._propagate("start",f);return true},_mouseDrag:function(d){var g=this.helper,f=this.options,l={},p=this,i=this.originalMousePosition,m=this.axis;var q=(d.pageX-i.left)||0,n=(d.pageY-i.top)||0;var h=this._change[m];if(!h){return false}var k=h.apply(this,[d,q,n]),j=c.browser.msie&&c.browser.version<7,e=this.sizeDiff;if(this._aspectRatio||d.shiftKey){k=this._updateRatio(k,d)}k=this._respectSize(k,d);this._propagate("resize",d);g.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});if(!this._helper&&this._proportionallyResizeElements.length){this._proportionallyResize()}this._updateCache(k);this._trigger("resize",d,this.ui());return false},_mouseStop:function(g){this.resizing=false;var h=this.options,l=this;if(this._helper){var f=this._proportionallyResizeElements,d=f.length&&(/textarea/i).test(f[0].nodeName),e=d&&c.ui.hasScroll(f[0],"left")?0:l.sizeDiff.height,j=d?0:l.sizeDiff.width;var m={width:(l.size.width-j),height:(l.size.height-e)},i=(parseInt(l.element.css("left"),10)+(l.position.left-l.originalPosition.left))||null,k=(parseInt(l.element.css("top"),10)+(l.position.top-l.originalPosition.top))||null;if(!h.animate){this.element.css(c.extend(m,{top:k,left:i}))}l.helper.height(l.size.height);l.helper.width(l.size.width);if(this._helper&&!h.animate){this._proportionallyResize()}}c("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",g);if(this._helper){this.helper.remove()}return false},_updateCache:function(d){var e=this.options;this.offset=this.helper.offset();if(a(d.left)){this.position.left=d.left}if(a(d.top)){this.position.top=d.top}if(a(d.height)){this.size.height=d.height}if(a(d.width)){this.size.width=d.width}},_updateRatio:function(g,f){var h=this.options,i=this.position,e=this.size,d=this.axis;if(g.height){g.width=(e.height*this.aspectRatio)}else{if(g.width){g.height=(e.width/this.aspectRatio)}}if(d=="sw"){g.left=i.left+(e.width-g.width);g.top=null}if(d=="nw"){g.top=i.top+(e.height-g.height);g.left=i.left+(e.width-g.width)}return g},_respectSize:function(k,f){var i=this.helper,h=this.options,q=this._aspectRatio||f.shiftKey,p=this.axis,s=a(k.width)&&h.maxWidth&&(h.maxWidthk.width),r=a(k.height)&&h.minHeight&&(h.minHeight>k.height);if(g){k.width=h.minWidth}if(r){k.height=h.minHeight}if(s){k.width=h.maxWidth}if(l){k.height=h.maxHeight}var e=this.originalPosition.left+this.originalSize.width,n=this.position.top+this.size.height;var j=/sw|nw|w/.test(p),d=/nw|ne|n/.test(p);if(g&&j){k.left=e-h.minWidth}if(s&&j){k.left=e-h.maxWidth}if(r&&d){k.top=n-h.minHeight}if(l&&d){k.top=n-h.maxHeight}var m=!k.width&&!k.height;if(m&&!k.left&&k.top){k.top=null}else{if(m&&!k.top&&k.left){k.left=null}}return k},_proportionallyResize:function(){var j=this.options;if(!this._proportionallyResizeElements.length){return}var f=this.helper||this.element;for(var e=0;e');var d=c.browser.msie&&c.browser.version<7,f=(d?1:0),g=(d?2:-1);this.helper.addClass(this._helper).css({width:this.element.outerWidth()+g,height:this.element.outerHeight()+g,position:"absolute",left:this.elementOffset.left-f+"px",top:this.elementOffset.top-f+"px",zIndex:++h.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(f,e,d){return{width:this.originalSize.width+e}},w:function(g,e,d){var i=this.options,f=this.originalSize,h=this.originalPosition;return{left:h.left+e,width:f.width-e}},n:function(g,e,d){var i=this.options,f=this.originalSize,h=this.originalPosition;return{top:h.top+d,height:f.height-d}},s:function(f,e,d){return{height:this.originalSize.height+d}},se:function(f,e,d){return c.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[f,e,d]))},sw:function(f,e,d){return c.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[f,e,d]))},ne:function(f,e,d){return c.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[f,e,d]))},nw:function(f,e,d){return c.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[f,e,d]))}},_propagate:function(e,d){c.ui.plugin.call(this,e,[d,this.ui()]);(e!="resize"&&this._trigger(e,d,this.ui()))},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}));c.extend(c.ui.resizable,{version:"1.7.2",eventPrefix:"resize",defaults:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,cancel:":input,option",containment:false,delay:0,distance:1,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1000}});c.ui.plugin.add("resizable","alsoResize",{start:function(e,f){var d=c(this).data("resizable"),g=d.options;_store=function(h){c(h).each(function(){c(this).data("resizable-alsoresize",{width:parseInt(c(this).width(),10),height:parseInt(c(this).height(),10),left:parseInt(c(this).css("left"),10),top:parseInt(c(this).css("top"),10)})})};if(typeof(g.alsoResize)=="object"&&!g.alsoResize.parentNode){if(g.alsoResize.length){g.alsoResize=g.alsoResize[0];_store(g.alsoResize)}else{c.each(g.alsoResize,function(h,i){_store(h)})}}else{_store(g.alsoResize)}},resize:function(f,h){var e=c(this).data("resizable"),i=e.options,g=e.originalSize,k=e.originalPosition;var j={height:(e.size.height-g.height)||0,width:(e.size.width-g.width)||0,top:(e.position.top-k.top)||0,left:(e.position.left-k.left)||0},d=function(l,m){c(l).each(function(){var p=c(this),q=c(this).data("resizable-alsoresize"),o={},n=m&&m.length?m:["width","height","top","left"];c.each(n||["width","height","top","left"],function(r,t){var s=(q[t]||0)+(j[t]||0);if(s&&s>=0){o[t]=s||null}});if(/relative/.test(p.css("position"))&&c.browser.opera){e._revertToRelativePosition=true;p.css({position:"absolute",top:"auto",left:"auto"})}p.css(o)})};if(typeof(i.alsoResize)=="object"&&!i.alsoResize.nodeType){c.each(i.alsoResize,function(l,m){d(l,m)})}else{d(i.alsoResize)}},stop:function(e,f){var d=c(this).data("resizable");if(d._revertToRelativePosition&&c.browser.opera){d._revertToRelativePosition=false;el.css({position:"relative"})}c(this).removeData("resizable-alsoresize-start")}});c.ui.plugin.add("resizable","animate",{stop:function(h,m){var n=c(this).data("resizable"),i=n.options;var g=n._proportionallyResizeElements,d=g.length&&(/textarea/i).test(g[0].nodeName),e=d&&c.ui.hasScroll(g[0],"left")?0:n.sizeDiff.height,k=d?0:n.sizeDiff.width;var f={width:(n.size.width-k),height:(n.size.height-e)},j=(parseInt(n.element.css("left"),10)+(n.position.left-n.originalPosition.left))||null,l=(parseInt(n.element.css("top"),10)+(n.position.top-n.originalPosition.top))||null;n.element.animate(c.extend(f,l&&j?{top:l,left:j}:{}),{duration:i.animateDuration,easing:i.animateEasing,step:function(){var o={width:parseInt(n.element.css("width"),10),height:parseInt(n.element.css("height"),10),top:parseInt(n.element.css("top"),10),left:parseInt(n.element.css("left"),10)};if(g&&g.length){c(g[0]).css({width:o.width,height:o.height})}n._updateCache(o);n._propagate("resize",h)}})}});c.ui.plugin.add("resizable","containment",{start:function(e,q){var s=c(this).data("resizable"),i=s.options,k=s.element;var f=i.containment,j=(f instanceof c)?f.get(0):(/parent/.test(f))?k.parent().get(0):f;if(!j){return}s.containerElement=c(j);if(/document/.test(f)||f==document){s.containerOffset={left:0,top:0};s.containerPosition={left:0,top:0};s.parentData={element:c(document),left:0,top:0,width:c(document).width(),height:c(document).height()||document.body.parentNode.scrollHeight}}else{var m=c(j),h=[];c(["Top","Right","Left","Bottom"]).each(function(p,o){h[p]=b(m.css("padding"+o))});s.containerOffset=m.offset();s.containerPosition=m.position();s.containerSize={height:(m.innerHeight()-h[3]),width:(m.innerWidth()-h[1])};var n=s.containerOffset,d=s.containerSize.height,l=s.containerSize.width,g=(c.ui.hasScroll(j,"left")?j.scrollWidth:l),r=(c.ui.hasScroll(j)?j.scrollHeight:d);s.parentData={element:j,left:n.left,top:n.top,width:g,height:r}}},resize:function(f,p){var s=c(this).data("resizable"),h=s.options,e=s.containerSize,n=s.containerOffset,l=s.size,m=s.position,q=s._aspectRatio||f.shiftKey,d={top:0,left:0},g=s.containerElement;if(g[0]!=document&&(/static/).test(g.css("position"))){d=n}if(m.left<(s._helper?n.left:0)){s.size.width=s.size.width+(s._helper?(s.position.left-n.left):(s.position.left-d.left));if(q){s.size.height=s.size.width/h.aspectRatio}s.position.left=h.helper?n.left:0}if(m.top<(s._helper?n.top:0)) +{s.size.height=s.size.height+(s._helper?(s.position.top-n.top):s.position.top);if(q){s.size.width=s.size.height*h.aspectRatio}s.position.top=s._helper?n.top:0}s.offset.left=s.parentData.left+s.position.left;s.offset.top=s.parentData.top+s.position.top;var k=Math.abs((s._helper?s.offset.left-d.left:(s.offset.left-d.left))+s.sizeDiff.width),r=Math.abs((s._helper?s.offset.top-d.top:(s.offset.top-n.top))+s.sizeDiff.height);var j=s.containerElement.get(0)==s.element.parent().get(0),i=/relative|absolute/.test(s.containerElement.css("position"));if(j&&i){k-=s.parentData.left}if(k+s.size.width>=s.parentData.width){s.size.width=s.parentData.width-k;if(q){s.size.height=s.size.width/s.aspectRatio}}if(r+s.size.height>=s.parentData.height){s.size.height=s.parentData.height-r;if(q){s.size.width=s.size.height*s.aspectRatio}}},stop:function(e,m){var p=c(this).data("resizable"),f=p.options,k=p.position,l=p.containerOffset,d=p.containerPosition,g=p.containerElement;var i=c(p.helper),q=i.offset(),n=i.outerWidth()-p.sizeDiff.width,j=i.outerHeight()-p.sizeDiff.height;if(p._helper&&!f.animate&&(/relative/).test(g.css("position"))){c(this).css({left:q.left-d.left-l.left,width:n,height:j})}if(p._helper&&!f.animate&&(/static/).test(g.css("position"))){c(this).css({left:q.left-d.left-l.left,width:n,height:j})}}});c.ui.plugin.add("resizable","ghost",{start:function(f,g){var d=c(this).data("resizable"),h=d.options,e=d.size;d.ghost=d.originalElement.clone();d.ghost.css({opacity:0.25,display:"block",position:"relative",height:e.height,width:e.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof h.ghost=="string"?h.ghost:"");d.ghost.appendTo(d.helper)},resize:function(e,f){var d=c(this).data("resizable"),g=d.options;if(d.ghost){d.ghost.css({position:"relative",height:d.size.height,width:d.size.width})}},stop:function(e,f){var d=c(this).data("resizable"),g=d.options;if(d.ghost&&d.helper){d.helper.get(0).removeChild(d.ghost.get(0))}}});c.ui.plugin.add("resizable","grid",{resize:function(d,l){var n=c(this).data("resizable"),g=n.options,j=n.size,h=n.originalSize,i=n.originalPosition,m=n.axis,k=g._aspectRatio||d.shiftKey;g.grid=typeof g.grid=="number"?[g.grid,g.grid]:g.grid;var f=Math.round((j.width-h.width)/(g.grid[0]||1))*(g.grid[0]||1),e=Math.round((j.height-h.height)/(g.grid[1]||1))*(g.grid[1]||1);if(/^(se|s|e)$/.test(m)){n.size.width=h.width+f;n.size.height=h.height+e}else{if(/^(ne)$/.test(m)){n.size.width=h.width+f;n.size.height=h.height+e;n.position.top=i.top-e}else{if(/^(sw)$/.test(m)){n.size.width=h.width+f;n.size.height=h.height+e;n.position.left=i.left-f}else{n.size.width=h.width+f;n.size.height=h.height+e;n.position.top=i.top-e;n.position.left=i.left-f}}}}});var b=function(d){return parseInt(d,10)||0};var a=function(d){return !isNaN(parseInt(d,10))}})(jQuery);; +/** + * jQuery.ScrollTo - Easy element scrolling using jQuery. + * Copyright (c) 2008 Ariel Flesler - aflesler(at)gmail(dot)com + * Licensed under GPL license (http://www.opensource.org/licenses/gpl-license.php). + * Date: 2/8/2008 + * @author Ariel Flesler + * @version 1.3.2 + */ +;(function($){var o=$.scrollTo=function(a,b,c){o.window().scrollTo(a,b,c)};o.defaults={axis:'y',duration:1};o.window=function(){return $($.browser.safari?'body':'html')};$.fn.scrollTo=function(l,m,n){if(typeof m=='object'){n=m;m=0}n=$.extend({},o.defaults,n);m=m||n.speed||n.duration;n.queue=n.queue&&n.axis.length>1;if(n.queue)m/=2;n.offset=j(n.offset);n.over=j(n.over);return this.each(function(){var a=this,b=$(a),t=l,c,d={},w=b.is('html,body');switch(typeof t){case'number':case'string':if(/^([+-]=)?\d+(px)?$/.test(t)){t=j(t);break}t=$(t,this);case'object':if(t.is||t.style)c=(t=$(t)).offset()}$.each(n.axis.split(''),function(i,f){var P=f=='x'?'Left':'Top',p=P.toLowerCase(),k='scroll'+P,e=a[k],D=f=='x'?'Width':'Height';if(c){d[k]=c[p]+(w?0:e-b.offset()[p]);if(n.margin){d[k]-=parseInt(t.css('margin'+P))||0;d[k]-=parseInt(t.css('border'+P+'Width'))||0}d[k]+=n.offset[p]||0;if(n.over[p])d[k]+=t[D.toLowerCase()]()*n.over[p]}else d[k]=t[p];if(/^\d+$/.test(d[k]))d[k]=d[k]<=0?0:Math.min(d[k],h(D));if(!i&&n.queue){if(e!=d[k])g(n.onAfterFirst);delete d[k]}});g(n.onAfter);function g(a){b.animate(d,m,n.easing,a&&function(){a.call(this,l)})};function h(D){var b=w?$.browser.opera?document.body:document.documentElement:a;return b['scroll'+D]-b['client'+D]}})};function j(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery); + diff --git a/3rdparty/quazip-0.5.1/doc/html/nav_f.png b/3rdparty/quazip-0.5.1/doc/html/nav_f.png new file mode 100644 index 0000000000000000000000000000000000000000..1b07a16207e67c95fe2ee17e7016e6d08ac7ac99 GIT binary patch literal 159 zcmeAS@N?(olHy`uVBq!ia0vp^j6iI`!2~2XGqLUlQfZzpjv*C{Z|{2YIT`Y>1X`Eg z-tTbne1`SITM8Q!Pb(<)UFZ(m>wMzvKZQqKM~~GcZ=A7j<~E6K62>ozFS=cD3)mf8 z9WX0+R&m(l9KUsLdTx4?9~({T__KA%`}olPJ^N;y|F^pHgs_K%!rj~{8>RwnWbkzL Kb6Mw<&;$VTdq1fF literal 0 HcmV?d00001 diff --git a/3rdparty/quazip-0.5.1/doc/html/nav_h.png b/3rdparty/quazip-0.5.1/doc/html/nav_h.png new file mode 100644 index 0000000000000000000000000000000000000000..01f5fa6a596e36bd12c2d6ceff1b0169fda7e699 GIT binary patch literal 97 zcmeAS@N?(olHy`uVBq!ia0vp^j6lr8!2~3AUOE6t1`SUa$B+ufw|6&kG8phMJMJ~w va4>Y+bZ&9QY?(VEUPY_cGd9nQ`um^ZSUyYpAAuKhL7F^W{an^LB{Ts5DmojT literal 0 HcmV?d00001 diff --git a/3rdparty/quazip-0.5.1/doc/html/open.png b/3rdparty/quazip-0.5.1/doc/html/open.png new file mode 100644 index 0000000000000000000000000000000000000000..7b35d2c2c389743089632fe24c3104f2173d97af GIT binary patch literal 118 zcmeAS@N?(olHy`uVBq!ia0vp^oFL4>1|%O$WD@{Vww^AIAr*{o=Nbw!DDW^(zOibV zl!F8B0?t?i!vld4k#$~0_AX3zElaokn + + + +QuaZIP: Related Pages + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ +
+
+
+
Related Pages
+
+
+
Here is a list of all related documentation pages:
+
+ + + diff --git a/3rdparty/quazip-0.5.1/doc/html/quaadler32_8h_source.html b/3rdparty/quazip-0.5.1/doc/html/quaadler32_8h_source.html new file mode 100644 index 00000000..cdbd3673 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/quaadler32_8h_source.html @@ -0,0 +1,79 @@ + + + + +QuaZIP: quazip/quaadler32.h Source File + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ + + +
+
+
+
quaadler32.h
+
+
+
00001 #ifndef QUAADLER32_H
+00002 #define QUAADLER32_H
+00003 
+00004 #include <QByteArray>
+00005 
+00006 #include "quachecksum32.h"
+00007 
+00009 
+00013 class QUAZIP_EXPORT QuaAdler32 : public QuaChecksum32
+00014 {
+00015 
+00016 public:
+00017         QuaAdler32();
+00018 
+00019         quint32 calculate(const QByteArray &data);
+00020 
+00021         void reset();
+00022         void update(const QByteArray &buf);
+00023         quint32 value();
+00024 
+00025 private:
+00026         quint32 checksum;
+00027 };
+00028 
+00029 #endif //QUAADLER32_H
+
+ + + + diff --git a/3rdparty/quazip-0.5.1/doc/html/quachecksum32_8h_source.html b/3rdparty/quazip-0.5.1/doc/html/quachecksum32_8h_source.html new file mode 100644 index 00000000..2a919511 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/quachecksum32_8h_source.html @@ -0,0 +1,78 @@ + + + + +QuaZIP: quazip/quachecksum32.h Source File + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ + + +
+
+
+
quachecksum32.h
+
+
+
00001 #ifndef QUACHECKSUM32_H
+00002 #define QUACHECKSUM32_H
+00003 
+00004 #include <QByteArray>
+00005 #include "quazip_global.h"
+00006 
+00008 
+00028 class QUAZIP_EXPORT QuaChecksum32
+00029 {
+00030 
+00031 public:
+00033 
+00038         virtual quint32 calculate(const QByteArray &data) = 0;
+00039 
+00041         virtual void reset() = 0;
+00042 
+00044 
+00046         virtual void update(const QByteArray &buf) = 0;
+00047 
+00049 
+00051         virtual quint32 value() = 0;
+00052 };
+00053 
+00054 #endif //QUACHECKSUM32_H
+
+ + + + diff --git a/3rdparty/quazip-0.5.1/doc/html/quacrc32_8h_source.html b/3rdparty/quazip-0.5.1/doc/html/quacrc32_8h_source.html new file mode 100644 index 00000000..d9c5a6b3 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/quacrc32_8h_source.html @@ -0,0 +1,76 @@ + + + + +QuaZIP: quazip/quacrc32.h Source File + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ + + +
+
+
+
quacrc32.h
+
+
+
00001 #ifndef QUACRC32_H
+00002 #define QUACRC32_H
+00003 
+00004 #include "quachecksum32.h"
+00005 
+00007 
+00011 class QUAZIP_EXPORT QuaCrc32 : public QuaChecksum32 {
+00012 
+00013 public:
+00014         QuaCrc32();
+00015 
+00016         quint32 calculate(const QByteArray &data);
+00017 
+00018         void reset();
+00019         void update(const QByteArray &buf);
+00020         quint32 value();
+00021 
+00022 private:
+00023         quint32 checksum;
+00024 };
+00025 
+00026 #endif //QUACRC32_H
+
+ + + + diff --git a/3rdparty/quazip-0.5.1/doc/html/quagzipfile_8h_source.html b/3rdparty/quazip-0.5.1/doc/html/quagzipfile_8h_source.html new file mode 100644 index 00000000..0e66caed --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/quagzipfile_8h_source.html @@ -0,0 +1,97 @@ + + + + +QuaZIP: quazip/quagzipfile.h Source File + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ + + +
+
+
+
quagzipfile.h
+
+
+
00001 #ifndef QUAZIP_QUAGZIPFILE_H
+00002 #define QUAZIP_QUAGZIPFILE_H
+00003 
+00004 #include <QIODevice>
+00005 #include "quazip_global.h"
+00006 
+00007 #include <zlib.h>
+00008 
+00009 class QuaGzipFilePrivate;
+00010 
+00012 
+00015 class QUAZIP_EXPORT QuaGzipFile: public QIODevice {
+00016   Q_OBJECT
+00017 public:
+00019 
+00022   QuaGzipFile();
+00024 
+00028   QuaGzipFile(QObject *parent);
+00030 
+00034   QuaGzipFile(const QString &fileName, QObject *parent = NULL);
+00036   virtual ~QuaGzipFile();
+00038   void setFileName(const QString& fileName);
+00040   QString getFileName() const;
+00042 
+00049   virtual bool isSequential() const;
+00051 
+00055   virtual bool open(QIODevice::OpenMode mode);
+00057 
+00063   virtual bool open(int fd, QIODevice::OpenMode mode);
+00065 
+00069   virtual bool flush();
+00071   virtual void close();
+00072 protected:
+00074   virtual qint64 readData(char *data, qint64 maxSize);
+00076   virtual qint64 writeData(const char *data, qint64 maxSize);
+00077 private:
+00078     // not implemented by design to disable copy
+00079     QuaGzipFile(const QuaGzipFile &that);
+00080     QuaGzipFile& operator=(const QuaGzipFile &that);
+00081     QuaGzipFilePrivate *d;
+00082 };
+00083 
+00084 #endif // QUAZIP_QUAGZIPFILE_H
+
+ + + + diff --git a/3rdparty/quazip-0.5.1/doc/html/quaziodevice_8h_source.html b/3rdparty/quazip-0.5.1/doc/html/quaziodevice_8h_source.html new file mode 100644 index 00000000..44929552 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/quaziodevice_8h_source.html @@ -0,0 +1,86 @@ + + + + +QuaZIP: quazip/quaziodevice.h Source File + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ + + +
+
+
+
quaziodevice.h
+
+
+
00001 #ifndef QUAZIP_QUAZIODEVICE_H
+00002 #define QUAZIP_QUAZIODEVICE_H
+00003 
+00004 #include <QIODevice>
+00005 #include "quazip_global.h"
+00006 
+00007 #include <zlib.h>
+00008 
+00009 class QuaZIODevicePrivate;
+00010 
+00012 
+00017 class QUAZIP_EXPORT QuaZIODevice: public QIODevice {
+00018   Q_OBJECT
+00019 public:
+00021 
+00025   QuaZIODevice(QIODevice *io, QObject *parent = NULL);
+00027   ~QuaZIODevice();
+00029 
+00049   virtual bool flush();
+00051 
+00055   virtual bool open(QIODevice::OpenMode mode);
+00057 
+00061   virtual void close();
+00063   QIODevice *getIoDevice() const;
+00065   virtual bool isSequential() const;
+00066 protected:
+00068   virtual qint64 readData(char *data, qint64 maxSize);
+00070   virtual qint64 writeData(const char *data, qint64 maxSize);
+00071 private:
+00072   QuaZIODevicePrivate *d;
+00073 };
+00074 #endif // QUAZIP_QUAZIODEVICE_H
+
+ + + + diff --git a/3rdparty/quazip-0.5.1/doc/html/quazip_8h_source.html b/3rdparty/quazip-0.5.1/doc/html/quazip_8h_source.html new file mode 100644 index 00000000..0bc2c97e --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/quazip_8h_source.html @@ -0,0 +1,192 @@ + + + + +QuaZIP: quazip/quazip.h Source File + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ + + +
+
+
+
quazip.h
+
+
+
00001 #ifndef QUA_ZIP_H
+00002 #define QUA_ZIP_H
+00003 
+00004 /*
+00005 Copyright (C) 2005-2011 Sergey A. Tachenov
+00006 
+00007 This program is free software; you can redistribute it and/or modify it
+00008 under the terms of the GNU Lesser General Public License as published by
+00009 the Free Software Foundation; either version 2 of the License, or (at
+00010 your option) any later version.
+00011 
+00012 This program is distributed in the hope that it will be useful, but
+00013 WITHOUT ANY WARRANTY; without even the implied warranty of
+00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+00015 General Public License for more details.
+00016 
+00017 You should have received a copy of the GNU Lesser General Public License
+00018 along with this program; if not, write to the Free Software Foundation,
+00019 Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+00020 
+00021 See COPYING file for the full LGPL text.
+00022 
+00023 Original ZIP package is copyrighted by Gilles Vollant, see
+00024 quazip/(un)zip.h files for details, basically it's zlib license.
+00025  **/
+00026 
+00027 #include <QString>
+00028 #include <QStringList>
+00029 #include <QTextCodec>
+00030 
+00031 #include "zip.h"
+00032 #include "unzip.h"
+00033 
+00034 #include "quazip_global.h"
+00035 #include "quazipfileinfo.h"
+00036 
+00037 // just in case it will be defined in the later versions of the ZIP/UNZIP
+00038 #ifndef UNZ_OPENERROR
+00039 // define additional error code
+00040 #define UNZ_OPENERROR -1000
+00041 #endif
+00042 
+00043 class QuaZipPrivate;
+00044 
+00046 
+00083 class QUAZIP_EXPORT QuaZip {
+00084   friend class QuaZipPrivate;
+00085   public:
+00087     enum Constants {
+00088       MAX_FILE_NAME_LENGTH=256 
+00091     };
+00093     enum Mode {
+00094       mdNotOpen, 
+00095       mdUnzip, 
+00096       mdCreate, 
+00097       mdAppend, 
+00105       mdAdd 
+00106     };
+00108 
+00113     enum CaseSensitivity {
+00114       csDefault=0, 
+00115       csSensitive=1, 
+00116       csInsensitive=2 
+00117     };
+00119 
+00125     static Qt::CaseSensitivity convertCaseSensitivity(
+00126             CaseSensitivity cs);
+00127   private:
+00128     QuaZipPrivate *p;
+00129     // not (and will not be) implemented
+00130     QuaZip(const QuaZip& that);
+00131     // not (and will not be) implemented
+00132     QuaZip& operator=(const QuaZip& that);
+00133   public:
+00135 
+00136     QuaZip();
+00138     QuaZip(const QString& zipName);
+00140 
+00141     QuaZip(QIODevice *ioDevice);
+00143 
+00144     ~QuaZip();
+00146 
+00182     bool open(Mode mode, zlib_filefunc_def *ioApi =NULL);
+00184 
+00187     void close();
+00189 
+00194     void setFileNameCodec(QTextCodec *fileNameCodec);
+00196 
+00199     void setFileNameCodec(const char *fileNameCodecName);
+00201     QTextCodec* getFileNameCodec() const;
+00203 
+00205     void setCommentCodec(QTextCodec *commentCodec);
+00207 
+00210     void setCommentCodec(const char *commentCodecName);
+00212     QTextCodec* getCommentCodec() const;
+00214 
+00219     QString getZipName() const;
+00221 
+00226     void setZipName(const QString& zipName);
+00228 
+00232     QIODevice *getIoDevice() const;
+00234 
+00239     void setIoDevice(QIODevice *ioDevice);
+00241     Mode getMode() const;
+00243     bool isOpen() const;
+00245 
+00253     int getZipError() const;
+00255 
+00258     int getEntriesCount() const;
+00260     QString getComment() const;
+00262 
+00270     void setComment(const QString& comment);
+00272 
+00275     bool goToFirstFile();
+00277 
+00294     bool goToNextFile();
+00296 
+00320     bool setCurrentFile(const QString& fileName, CaseSensitivity cs =csDefault);
+00322     bool hasCurrentFile() const;
+00324 
+00339     bool getCurrentFileInfo(QuaZipFileInfo* info)const;
+00341 
+00347     QString getCurrentFileName()const;
+00349 
+00364     unzFile getUnzFile();
+00366 
+00370     zipFile getZipFile();
+00372 
+00395     void setDataDescriptorWritingEnabled(bool enabled);
+00397 
+00400     bool isDataDescriptorWritingEnabled() const;
+00402 
+00408     QStringList getFileNameList() const;
+00410 
+00416     QList<QuaZipFileInfo> getFileInfoList() const;
+00417 };
+00418 
+00419 #endif
+
+ + + + diff --git a/3rdparty/quazip-0.5.1/doc/html/quazip__global_8h_source.html b/3rdparty/quazip-0.5.1/doc/html/quazip__global_8h_source.html new file mode 100644 index 00000000..e937786c --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/quazip__global_8h_source.html @@ -0,0 +1,78 @@ + + + + +QuaZIP: quazip/quazip_global.h Source File + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ + + +
+
+
+
quazip_global.h
+
+
+
00001 
+00024 #ifndef QUAZIP_GLOBAL_H
+00025 #define QUAZIP_GLOBAL_H
+00026 
+00027 #include <QtCore/qglobal.h>
+00028 
+00035 #ifdef QUAZIP_STATIC
+00036 #define QUAZIP_EXPORT
+00037 #else
+00038 
+00042 #if defined(QUAZIP_BUILD)
+00043         #define QUAZIP_EXPORT Q_DECL_EXPORT
+00044 #else
+00045         #define QUAZIP_EXPORT Q_DECL_IMPORT
+00046 #endif
+00047 #endif // QUAZIP_STATIC
+00048 
+00049 #ifdef __GNUC__
+00050 #define UNUSED __attribute__((__unused__))
+00051 #else
+00052 #define UNUSED
+00053 #endif
+00054 
+00055 #endif // QUAZIP_GLOBAL_H
+
+ + + + diff --git a/3rdparty/quazip-0.5.1/doc/html/quazipdir_8h_source.html b/3rdparty/quazip-0.5.1/doc/html/quazipdir_8h_source.html new file mode 100644 index 00000000..9889b702 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/quazipdir_8h_source.html @@ -0,0 +1,123 @@ + + + + +QuaZIP: quazip/quazipdir.h Source File + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ + + +
+
+
+
quazipdir.h
+
+
+
00001 #ifndef QUAZIP_QUAZIPDIR_H
+00002 #define QUAZIP_QUAZIPDIR_H
+00003 
+00004 class QuaZipDirPrivate;
+00005 
+00006 #include "quazip.h"
+00007 #include "quazipfileinfo.h"
+00008 #include <QDir>
+00009 #include <QList>
+00010 #include <QSharedDataPointer>
+00011 
+00013 
+00029 class QUAZIP_EXPORT QuaZipDir {
+00030 private:
+00031     QSharedDataPointer<QuaZipDirPrivate> d;
+00032 public:
+00034     QuaZipDir(const QuaZipDir &that);
+00036 
+00040     QuaZipDir(QuaZip *zip, const QString &dir = QString());
+00042     ~QuaZipDir();
+00044     bool operator==(const QuaZipDir &that);
+00046 
+00050     inline bool operator!=(const QuaZipDir &that) {return !operator==(that);}
+00052 
+00056     QuaZipDir& operator=(const QuaZipDir &that);
+00058     QString operator[](int pos) const;
+00060     QuaZip::CaseSensitivity caseSensitivity() const;
+00062 
+00071     bool cd(const QString &dirName);
+00073     bool cdUp();
+00075     uint count() const;
+00077 
+00080     QString dirName() const;
+00082 
+00089     QList<QuaZipFileInfo> entryInfoList(const QStringList &nameFilters,
+00090         QDir::Filters filters = QDir::NoFilter,
+00091         QDir::SortFlags sort = QDir::NoSort) const;
+00093 
+00098     QList<QuaZipFileInfo> entryInfoList(QDir::Filters filters = QDir::NoFilter,
+00099         QDir::SortFlags sort = QDir::NoSort) const;
+00101 
+00105     QStringList entryList(const QStringList &nameFilters,
+00106         QDir::Filters filters = QDir::NoFilter,
+00107         QDir::SortFlags sort = QDir::NoSort) const;
+00109 
+00114     QStringList entryList(QDir::Filters filters = QDir::NoFilter,
+00115         QDir::SortFlags sort = QDir::NoSort) const;
+00117 
+00123     bool exists(const QString &fileName) const;
+00125     bool exists() const;
+00127 
+00130     QString filePath(const QString &fileName) const;
+00132     QDir::Filters filter();
+00134 
+00137     bool isRoot() const;
+00139     QStringList nameFilters() const;
+00141 
+00145     QString path() const;
+00147     QString relativeFilePath(const QString &fileName) const;
+00149     void setCaseSensitivity(QuaZip::CaseSensitivity caseSensitivity);
+00151     void setFilter(QDir::Filters filters);
+00153     void setNameFilters(const QStringList &nameFilters);
+00155 
+00164     void setPath(const QString &path);
+00166     void setSorting(QDir::SortFlags sort);
+00168     QDir::SortFlags sorting() const;
+00169 };
+00170 
+00171 #endif // QUAZIP_QUAZIPDIR_H
+
+ + + + diff --git a/3rdparty/quazip-0.5.1/doc/html/quazipfile_8h_source.html b/3rdparty/quazip-0.5.1/doc/html/quazipfile_8h_source.html new file mode 100644 index 00000000..000af592 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/quazipfile_8h_source.html @@ -0,0 +1,164 @@ + + + + +QuaZIP: quazip/quazipfile.h Source File + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ + + +
+
+
+
quazipfile.h
+
+
+
00001 #ifndef QUA_ZIPFILE_H
+00002 #define QUA_ZIPFILE_H
+00003 
+00004 /*
+00005 Copyright (C) 2005-2011 Sergey A. Tachenov
+00006 
+00007 This program is free software; you can redistribute it and/or modify it
+00008 under the terms of the GNU Lesser General Public License as published by
+00009 the Free Software Foundation; either version 2 of the License, or (at
+00010 your option) any later version.
+00011 
+00012 This program is distributed in the hope that it will be useful, but
+00013 WITHOUT ANY WARRANTY; without even the implied warranty of
+00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+00015 General Public License for more details.
+00016 
+00017 You should have received a copy of the GNU Lesser General Public License
+00018 along with this program; if not, write to the Free Software Foundation,
+00019 Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+00020 
+00021 See COPYING file for the full LGPL text.
+00022 
+00023 Original ZIP package is copyrighted by Gilles Vollant, see
+00024 quazip/(un)zip.h files for details, basically it's zlib license.
+00025  **/
+00026 
+00027 #include <QIODevice>
+00028 
+00029 #include "quazip_global.h"
+00030 #include "quazip.h"
+00031 #include "quazipnewinfo.h"
+00032 
+00033 class QuaZipFilePrivate;
+00034 
+00036 
+00073 class QUAZIP_EXPORT QuaZipFile: public QIODevice {
+00074   friend class QuaZipFilePrivate;
+00075   Q_OBJECT
+00076   private:
+00077     QuaZipFilePrivate *p;
+00078     // these are not supported nor implemented
+00079     QuaZipFile(const QuaZipFile& that);
+00080     QuaZipFile& operator=(const QuaZipFile& that);
+00081   protected:
+00083     qint64 readData(char *data, qint64 maxSize);
+00085     qint64 writeData(const char *data, qint64 maxSize);
+00086   public:
+00088 
+00091     QuaZipFile();
+00093 
+00098     QuaZipFile(QObject *parent);
+00100 
+00109     QuaZipFile(const QString& zipName, QObject *parent =NULL);
+00111 
+00120     QuaZipFile(const QString& zipName, const QString& fileName,
+00121         QuaZip::CaseSensitivity cs =QuaZip::csDefault, QObject *parent =NULL);
+00123 
+00171     QuaZipFile(QuaZip *zip, QObject *parent =NULL);
+00173 
+00176     virtual ~QuaZipFile();
+00178 
+00187     QString getZipName()const;
+00189 
+00192     QuaZip* getZip()const;
+00194 
+00206     QString getFileName() const;
+00208 
+00219     QuaZip::CaseSensitivity getCaseSensitivity() const;
+00221 
+00245     QString getActualFileName()const;
+00247 
+00253     void setZipName(const QString& zipName);
+00255 
+00259     bool isRaw() const;
+00261 
+00269     void setZip(QuaZip *zip);
+00271 
+00282     void setFileName(const QString& fileName, QuaZip::CaseSensitivity cs =QuaZip::csDefault);
+00284 
+00291     virtual bool open(OpenMode mode);
+00293 
+00297     inline bool open(OpenMode mode, const char *password)
+00298     {return open(mode, NULL, NULL, false, password);}
+00300 
+00311     bool open(OpenMode mode, int *method, int *level, bool raw, const char *password =NULL);
+00313 
+00340     bool open(OpenMode mode, const QuaZipNewInfo& info,
+00341         const char *password =NULL, quint32 crc =0,
+00342         int method =Z_DEFLATED, int level =Z_DEFAULT_COMPRESSION, bool raw =false,
+00343         int windowBits =-MAX_WBITS, int memLevel =DEF_MEM_LEVEL, int strategy =Z_DEFAULT_STRATEGY);
+00345     virtual bool isSequential()const;
+00347 
+00368     virtual qint64 pos()const;
+00370 
+00386     virtual bool atEnd()const;
+00388 
+00400     virtual qint64 size()const;
+00402 
+00409     qint64 csize()const;
+00411 
+00419     qint64 usize()const;
+00421 
+00431     bool getFileInfo(QuaZipFileInfo *info);
+00433 
+00435     virtual void close();
+00437     int getZipError() const;
+00439     virtual qint64 bytesAvailable() const;
+00440 };
+00441 
+00442 #endif
+
+ + + + diff --git a/3rdparty/quazip-0.5.1/doc/html/quazipfileinfo_8h_source.html b/3rdparty/quazip-0.5.1/doc/html/quazipfileinfo_8h_source.html new file mode 100644 index 00000000..e6a2f806 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/quazipfileinfo_8h_source.html @@ -0,0 +1,107 @@ + + + + +QuaZIP: quazip/quazipfileinfo.h Source File + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ + + +
+
+
+
quazipfileinfo.h
+
+
+
00001 #ifndef QUA_ZIPFILEINFO_H
+00002 #define QUA_ZIPFILEINFO_H
+00003 
+00004 /*
+00005 Copyright (C) 2005-2011 Sergey A. Tachenov
+00006 
+00007 This program is free software; you can redistribute it and/or modify it
+00008 under the terms of the GNU Lesser General Public License as published by
+00009 the Free Software Foundation; either version 2 of the License, or (at
+00010 your option) any later version.
+00011 
+00012 This program is distributed in the hope that it will be useful, but
+00013 WITHOUT ANY WARRANTY; without even the implied warranty of
+00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+00015 General Public License for more details.
+00016 
+00017 You should have received a copy of the GNU Lesser General Public License
+00018 along with this program; if not, write to the Free Software Foundation,
+00019 Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+00020 
+00021 See COPYING file for the full LGPL text.
+00022 
+00023 Original ZIP package is copyrighted by Gilles Vollant, see
+00024 quazip/(un)zip.h files for details, basically it's zlib license.
+00025  **/
+00026 
+00027 #include <QByteArray>
+00028 #include <QDateTime>
+00029 #include <QFile>
+00030 
+00031 #include "quazip_global.h"
+00032 
+00034 
+00036 struct QUAZIP_EXPORT QuaZipFileInfo {
+00038   QString name;
+00040   quint16 versionCreated;
+00042   quint16 versionNeeded;
+00044   quint16 flags;
+00046   quint16 method;
+00048   QDateTime dateTime;
+00050   quint32 crc;
+00052   quint32 compressedSize;
+00054   quint32 uncompressedSize;
+00056   quint16 diskNumberStart;
+00058   quint16 internalAttr;
+00060   quint32 externalAttr;
+00062   QString comment;
+00064   QByteArray extra;
+00066 
+00070   QFile::Permissions getPermissions() const;
+00071 };
+00072 
+00073 #endif
+
+ + + + diff --git a/3rdparty/quazip-0.5.1/doc/html/quazipnewinfo_8h_source.html b/3rdparty/quazip-0.5.1/doc/html/quazipnewinfo_8h_source.html new file mode 100644 index 00000000..62d43abf --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/quazipnewinfo_8h_source.html @@ -0,0 +1,113 @@ + + + + +QuaZIP: quazip/quazipnewinfo.h Source File + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ + + +
+
+
+
quazipnewinfo.h
+
+
+
00001 #ifndef QUA_ZIPNEWINFO_H
+00002 #define QUA_ZIPNEWINFO_H
+00003 
+00004 /*
+00005 Copyright (C) 2005-2011 Sergey A. Tachenov
+00006 
+00007 This program is free software; you can redistribute it and/or modify it
+00008 under the terms of the GNU Lesser General Public License as published by
+00009 the Free Software Foundation; either version 2 of the License, or (at
+00010 your option) any later version.
+00011 
+00012 This program is distributed in the hope that it will be useful, but
+00013 WITHOUT ANY WARRANTY; without even the implied warranty of
+00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+00015 General Public License for more details.
+00016 
+00017 You should have received a copy of the GNU Lesser General Public License
+00018 along with this program; if not, write to the Free Software Foundation,
+00019 Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+00020 
+00021 See COPYING file for the full LGPL text.
+00022 
+00023 Original ZIP package is copyrighted by Gilles Vollant, see
+00024 quazip/(un)zip.h files for details, basically it's zlib license.
+00025  **/
+00026 
+00027 #include <QDateTime>
+00028 #include <QString>
+00029 
+00030 #include "quazip_global.h"
+00031 
+00033 
+00038 struct QUAZIP_EXPORT QuaZipNewInfo {
+00040 
+00043   QString name;
+00045 
+00050   QDateTime dateTime;
+00052   quint16 internalAttr;
+00054 
+00059   quint32 externalAttr;
+00061 
+00063   QString comment;
+00065   QByteArray extraLocal;
+00067   QByteArray extraGlobal;
+00069 
+00072   ulong uncompressedSize;
+00074 
+00078   QuaZipNewInfo(const QString& name);
+00080 
+00088   QuaZipNewInfo(const QString& name, const QString& file);
+00090 
+00104   void setFileDateTime(const QString& file);
+00106 
+00111   void setFilePermissions(const QString &file);
+00113 
+00118   void setPermissions(QFile::Permissions permissions);
+00119 };
+00120 
+00121 #endif
+
+ + + + diff --git a/3rdparty/quazip-0.5.1/doc/html/structQuaZipFileInfo-members.html b/3rdparty/quazip-0.5.1/doc/html/structQuaZipFileInfo-members.html new file mode 100644 index 00000000..444fb128 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/structQuaZipFileInfo-members.html @@ -0,0 +1,66 @@ + + + + +QuaZIP: Member List + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ + +
+
+
+
QuaZipFileInfo Member List
+
+ + + + diff --git a/3rdparty/quazip-0.5.1/doc/html/structQuaZipFileInfo.html b/3rdparty/quazip-0.5.1/doc/html/structQuaZipFileInfo.html new file mode 100644 index 00000000..cd3f0c02 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/structQuaZipFileInfo.html @@ -0,0 +1,139 @@ + + + + +QuaZIP: QuaZipFileInfo Struct Reference + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ + +
+
+ +
+
QuaZipFileInfo Struct Reference
+
+
+ +

Information about a file inside archive. + More...

+ +

#include <quazipfileinfo.h>

+ +

List of all members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

QFile::Permissions getPermissions () const
 Get the file permissions.

+Public Attributes

+QString name
 File name.
+quint16 versionCreated
 Version created by.
+quint16 versionNeeded
 Version needed to extract.
+quint16 flags
 General purpose flags.
+quint16 method
 Compression method.
+QDateTime dateTime
 Last modification date and time.
+quint32 crc
 CRC.
+quint32 compressedSize
 Compressed file size.
+quint32 uncompressedSize
 Uncompressed file size.
+quint16 diskNumberStart
 Disk number start.
+quint16 internalAttr
 Internal file attributes.
+quint32 externalAttr
 External file attributes.
+QString comment
 Comment.
+QByteArray extra
 Extra field.
+

Detailed Description

+

Information about a file inside archive.

+

Call QuaZip::getCurrentFileInfo() or QuaZipFile::getFileInfo() to fill this structure.

+

Member Function Documentation

+ +
+
+ + + + + + + +
QFile::Permissions QuaZipFileInfo::getPermissions () const
+
+
+ +

Get the file permissions.

+

Returns the high 16 bits of external attributes converted to QFile::Permissions.

+ +

References externalAttr.

+ +
+
+
The documentation for this struct was generated from the following files: +
+ + + diff --git a/3rdparty/quazip-0.5.1/doc/html/structQuaZipNewInfo-members.html b/3rdparty/quazip-0.5.1/doc/html/structQuaZipNewInfo-members.html new file mode 100644 index 00000000..55979e72 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/structQuaZipNewInfo-members.html @@ -0,0 +1,64 @@ + + + + +QuaZIP: Member List + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ + +
+
+
+
QuaZipNewInfo Member List
+
+
+This is the complete list of members for QuaZipNewInfo, including all inherited members. + + + + + + + + + + + + + +
commentQuaZipNewInfo
dateTimeQuaZipNewInfo
externalAttrQuaZipNewInfo
extraGlobalQuaZipNewInfo
extraLocalQuaZipNewInfo
internalAttrQuaZipNewInfo
nameQuaZipNewInfo
QuaZipNewInfo(const QString &name)QuaZipNewInfo
QuaZipNewInfo(const QString &name, const QString &file)QuaZipNewInfo
setFileDateTime(const QString &file)QuaZipNewInfo
setFilePermissions(const QString &file)QuaZipNewInfo
setPermissions(QFile::Permissions permissions)QuaZipNewInfo
uncompressedSizeQuaZipNewInfo
+ + + diff --git a/3rdparty/quazip-0.5.1/doc/html/structQuaZipNewInfo.html b/3rdparty/quazip-0.5.1/doc/html/structQuaZipNewInfo.html new file mode 100644 index 00000000..fd4e6299 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/structQuaZipNewInfo.html @@ -0,0 +1,319 @@ + + + + +QuaZIP: QuaZipNewInfo Struct Reference + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ + +
+
+ +
+
QuaZipNewInfo Struct Reference
+
+
+ +

Information about a file to be created. + More...

+ +

#include <quazipnewinfo.h>

+ +

List of all members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 QuaZipNewInfo (const QString &name)
 Constructs QuaZipNewInfo instance.
 QuaZipNewInfo (const QString &name, const QString &file)
 Constructs QuaZipNewInfo instance.
void setFileDateTime (const QString &file)
 Sets the file timestamp from the existing file.
void setFilePermissions (const QString &file)
 Sets the file permissions from the existing file.
void setPermissions (QFile::Permissions permissions)
 Sets the file permissions.

+Public Attributes

QString name
 File name.
QDateTime dateTime
 File timestamp.
+quint16 internalAttr
 File internal attributes.
quint32 externalAttr
 File external attributes.
QString comment
 File comment.
+QByteArray extraLocal
 File local extra field.
+QByteArray extraGlobal
 File global extra field.
ulong uncompressedSize
 Uncompressed file size.
+

Detailed Description

+

Information about a file to be created.

+

This structure holds information about a file to be created inside ZIP archive. At least name should be set to something correct before passing this structure to QuaZipFile::open(OpenMode,const QuaZipNewInfo&,int,int,bool).

+

Constructor & Destructor Documentation

+ +
+
+ + + + + + + + +
QuaZipNewInfo::QuaZipNewInfo (const QString & name)
+
+
+ +

Constructs QuaZipNewInfo instance.

+

Initializes name with name, dateTime with current date and time. Attributes are initialized with zeros, comment and extra field with null values.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
QuaZipNewInfo::QuaZipNewInfo (const QString & name,
const QString & file 
)
+
+
+ +

Constructs QuaZipNewInfo instance.

+

Initializes name with name. Timestamp and permissions are taken from the specified file. If the file does not exists or its timestamp is inaccessible (e. g. you do not have read permission for the directory file in), uses current time and zero permissions. Other attributes are initialized with zeros, comment and extra field with null values.

+
See also:
setFileDateTime()
+ +

References dateTime.

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + + + + +
void QuaZipNewInfo::setFileDateTime (const QString & file)
+
+
+ +

Sets the file timestamp from the existing file.

+

Use this function to set the file timestamp from the existing file. Use it like this:

+
 QuaZipFile zipFile(&zip);
+ QFile file("file-to-add");
+ file.open(QIODevice::ReadOnly);
+ QuaZipNewInfo info("file-name-in-archive");
+ info.setFileDateTime("file-to-add"); // take the timestamp from file
+ zipFile.open(QIODevice::WriteOnly, info);
+

This function does not change dateTime if some error occured (e. g. file is inaccessible).

+ +

References dateTime.

+ +
+
+ +
+
+ + + + + + + + +
void QuaZipNewInfo::setFilePermissions (const QString & file)
+
+
+ +

Sets the file permissions from the existing file.

+

Takes permissions from the file and sets the high 16 bits of external attributes. Uses QFileInfo to get permissions on all platforms.

+ +
+
+ +
+
+ + + + + + + + +
void QuaZipNewInfo::setPermissions (QFile::Permissions permissions)
+
+
+ +

Sets the file permissions.

+

Modifies the highest 16 bits of external attributes. The type part is set to dir if the name ends with a slash, and to regular file otherwise.

+ +

References name.

+ +
+
+

Member Data Documentation

+ +
+
+ + + + +
QString QuaZipNewInfo::name
+
+
+ +

File name.

+

This field holds file name inside archive, including path relative to archive root.

+ +

Referenced by QuaZipFile::open(), and setPermissions().

+ +
+
+ +
+
+ + + + +
QDateTime QuaZipNewInfo::dateTime
+
+
+ +

File timestamp.

+

This is the last file modification date and time. Will be stored in the archive central directory. It is a good practice to set it to the source file timestamp instead of archive creating time. Use setFileDateTime() or QuaZipNewInfo(const QString&, const QString&).

+ +

Referenced by QuaZipFile::open(), QuaZipNewInfo(), and setFileDateTime().

+ +
+
+ +
+
+ + + + +
quint32 QuaZipNewInfo::externalAttr
+
+
+ +

File external attributes.

+

The highest 16 bits contain Unix file permissions and type (dir or file). The constructor QuaZipNewInfo(const QString&, const QString&) takes permissions from the provided file.

+ +

Referenced by QuaZipFile::open().

+ +
+
+ +
+
+ + + + +
QString QuaZipNewInfo::comment
+
+
+ +

File comment.

+

Will be encoded using QuaZip::getCommentCodec().

+ +

Referenced by QuaZipFile::open().

+ +
+
+ +
+ +
+ +

Uncompressed file size.

+

This is only needed if you are using raw file zipping mode, i. e. adding precompressed file in the zip archive.

+ +

Referenced by QuaZipFile::open().

+ +
+
+
The documentation for this struct was generated from the following files: +
+ + + diff --git a/3rdparty/quazip-0.5.1/doc/html/tab_a.png b/3rdparty/quazip-0.5.1/doc/html/tab_a.png new file mode 100644 index 0000000000000000000000000000000000000000..2d99ef23fed78c7683f0b5aa803d937060d288c4 GIT binary patch literal 140 zcmeAS@N?(olHy`uVBq!ia0vp^j6kfy!2~3aiye;!Qo)`sjv*C{Z|CmjY;X`^DSv)) z;hc^cTF;t%XWXdwWP5+kt?jQ5uhqKtjd^EY`^^-S;M%tFAj_l)EwVTK)E@1LSD0{e q?a6($SGQTzz1#QBzr0NMKf^0WCX-0bi?u-G89ZJ6T-G@yGywp8?ljB* literal 0 HcmV?d00001 diff --git a/3rdparty/quazip-0.5.1/doc/html/tab_b.png b/3rdparty/quazip-0.5.1/doc/html/tab_b.png new file mode 100644 index 0000000000000000000000000000000000000000..b2c3d2be3c7e518fbca6bb30f571882e72fc506d GIT binary patch literal 178 zcmeAS@N?(olHy`uVBq!ia0vp^j6kfy!2~3aiye;!Qk9-Ajv*C{Z|~mbJ)|JfaM8Xd zIP7xAmLwau9@iXhZTrl-TjWj9jM#?{xt`6uU{<)jb9Suc^QnbhJ(o{ib8=j9u0_mE8M7kgF7f<7W7IEf=8(L_qx|g0H;V7iPxm&Q@G7p8W2Kx&iT|YUM=ITC zY<0Qbr;u&AtXD{o@41wH=7&d8=2Z_{M9Tsa=g*t*@A3H$UOlxZk7?f6RUWpx>Fc_L s#LQ{edY3MpIXkMeV^&YV=9fR%8Jv|Kya=#u06K}m)78&qol`;+0RKEt)&Kwi literal 0 HcmV?d00001 diff --git a/3rdparty/quazip-0.5.1/doc/html/tab_s.png b/3rdparty/quazip-0.5.1/doc/html/tab_s.png new file mode 100644 index 0000000000000000000000000000000000000000..978943ac807718de0e69e5a585a8f0a1e5999285 GIT binary patch literal 189 zcmeAS@N?(olHy`uVBq!ia0vp^j6kfy!2~3aiye;!QZ1e?jv*C{Z|}b5Yzkm-c<7z3 zq^cq0=~}Z;b(!Zvb5Z%sTRFKGlz1=qOFg;myyu?$r`wZb^irPsN1a)6)TwB0r+)wb zPL25;=adu89?fTK`qDR>$D*)b_WOmdKI;Vst02j(hg8%>k literal 0 HcmV?d00001 diff --git a/3rdparty/quazip-0.5.1/doc/html/tabs.css b/3rdparty/quazip-0.5.1/doc/html/tabs.css new file mode 100644 index 00000000..21920562 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/tabs.css @@ -0,0 +1,59 @@ +.tabs, .tabs2, .tabs3 { + background-image: url('tab_b.png'); + width: 100%; + z-index: 101; + font-size: 13px; +} + +.tabs2 { + font-size: 10px; +} +.tabs3 { + font-size: 9px; +} + +.tablist { + margin: 0; + padding: 0; + display: table; +} + +.tablist li { + float: left; + display: table-cell; + background-image: url('tab_b.png'); + line-height: 36px; + list-style: none; +} + +.tablist a { + display: block; + padding: 0 20px; + font-weight: bold; + background-image:url('tab_s.png'); + background-repeat:no-repeat; + background-position:right; + color: #283A5D; + text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); + text-decoration: none; + outline: none; +} + +.tabs3 .tablist a { + padding: 0 10px; +} + +.tablist a:hover { + background-image: url('tab_h.png'); + background-repeat:repeat-x; + color: #fff; + text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); + text-decoration: none; +} + +.tablist li.current a { + background-image: url('tab_a.png'); + background-repeat:repeat-x; + color: #fff; + text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +} diff --git a/3rdparty/quazip-0.5.1/doc/html/usage.html b/3rdparty/quazip-0.5.1/doc/html/usage.html new file mode 100644 index 00000000..660a1f53 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/html/usage.html @@ -0,0 +1,61 @@ + + + + +QuaZIP: Usage + + + + + +
+
+ + + + + + +
+
QuaZIP quazip-0-5-1
+
+
+ +
+
+
+
Usage
+
+
+

This page provides general information on QuaZIP usage. See classes QuaZip and QuaZipFile for the detailed documentation on what can QuaZIP do and what it can not. Also, reading comments in the zip.h and unzip.h files (taken from the original ZIP/UNZIP package) is always a good idea too. After all, QuaZIP is just a wrapper with a few convenience extensions and reimplementations.

+

QuaZip is a class representing ZIP archive, QuaZipFile represents a file inside archive and subclasses QIODevice as well. One limitation is that there can be only one instance of QuaZipFile per QuaZip instance, which kind of makes it confusing why there are two classes instead of one. This is actually no more than an API design mistake.

+

+Terminology

+

"QuaZIP" means whole this library, while "QuaZip" (note the lower case) is just one class in it.

+

"ZIP/UNZIP API" or "minizip" means the original API of the Gilles Vollant's ZIP/UNZIP package. It was slightly modified to better integrate with Qt. These modifications are not source or binary compatible with the official minizip release, which means you can't just drop the newer minizip version into QuaZIP sources and make it work.

+

"ZIP", "ZIP archive" or "ZIP file" means any ZIP archive. Typically this is a plain file with ".zip" (or ".ZIP") file name suffix, but it can also be any seekable QIODevice (say, QBuffer, but not QTcpSocket).

+

"A file inside archive", "a file inside ZIP" or something like that means file either being read or written from/to some ZIP archive.

+

+Error handling

+

Almost any call to ZIP/UNZIP API return some error code. Most of the original API's error checking could be done in this wrapper as well, but it would cause unnecessary code bloating without any benefit. So, QuaZIP only checks for situations that ZIP/UNZIP API can not check for. For example, ZIP/UNZIP API has no "ZIP open mode" concept because read and write modes are completely separated. On the other hand, to avoid creating classes like "QuaZipReader", "QuaZipWriter" or something like that, QuaZIP introduces "ZIP open mode" concept instead, thus making it possible to use one class (QuaZip) for both reading and writing. But this leads to additional open mode checks which are not done in ZIP/UNZIP package.

+

Therefore, error checking is two-level (QuaZIP's level and ZIP/UNZIP API level), which sometimes can be confusing, so here are some advices on how the error checking should be properly done:

+
    +
  • Both QuaZip and QuaZipFile have getZipError() function, which return error code of the last ZIP/UNZIP API call. Most function calls reset error code to UNZ_OK on success and set error code on failure. Some functions do not reset error code. Most of them are const and do not access ZIP archive in any way. Some, on the other hand, do access ZIP archive, but do not reset or set error code. For example, QuaZipFile::pos() function. Such functions are explicitly marked in the documentation.
  • +
  • Most functions have their own way to report errors, by returning a null string, negative value or false. If such a function returns error value, call getZipError() to get more information about error. See "zip.h" and "unzip.h" of the ZIP/UNZIP package for error codes.
  • +
  • If the function returns error-stating value (like false), but getZipError() returns UNZ_OK, it means that you did something obviously wrong. For example, tried to write in the archive open for reading or not open at all. You better just not do that! Most functions also issue a warning using qWarning() function in such cases. See documentation for a specific function for details on when it should not be called.
  • +
+

I know that this is somewhat messy, but I could not find a better way to do all the error handling.

+
+ + + diff --git a/3rdparty/quazip-0.5.1/doc/latex/Makefile b/3rdparty/quazip-0.5.1/doc/latex/Makefile new file mode 100644 index 00000000..5155fffa --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/latex/Makefile @@ -0,0 +1,39 @@ +all: refman.dvi + +ps: refman.ps + +pdf: refman.pdf + +ps_2on1: refman_2on1.ps + +pdf_2on1: refman_2on1.pdf + +refman.ps: refman.dvi + dvips -o refman.ps refman.dvi + +refman.pdf: refman.ps + gswin32c -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=refman.pdf -c save pop -f refman.ps + +refman.dvi: clean refman.tex doxygen.sty + echo "Running latex..." + latex refman.tex + echo "Running makeindex..." + makeindex refman.idx + echo "Rerunning latex...." + latex refman.tex + latex_count=5 ; \ + while egrep -s 'Rerun (LaTeX|to get cross-references right)' refman.log && [ $$latex_count -gt 0 ] ;\ + do \ + echo "Rerunning latex...." ;\ + latex refman.tex ;\ + latex_count=`expr $$latex_count - 1` ;\ + done + +refman_2on1.ps: refman.ps + psnup -2 refman.ps >refman_2on1.ps + +refman_2on1.pdf: refman_2on1.ps + gswin32c -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=refman_2on1.pdf -c save pop -f refman_2on1.ps + +clean: + del /s/y *.ps *.dvi *.aux *.toc *.idx *.ind *.ilg *.log *.out refman.pdf diff --git a/3rdparty/quazip-0.5.1/doc/latex/annotated.tex b/3rdparty/quazip-0.5.1/doc/latex/annotated.tex new file mode 100644 index 00000000..f27a1606 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/latex/annotated.tex @@ -0,0 +1,16 @@ +\section{Class List} +Here are the classes, structs, unions and interfaces with brief descriptions:\begin{DoxyCompactList} +\item\contentsline{section}{{\bf JlCompress} (Utility class for typical operations )}{\pageref{classJlCompress}}{} +\item\contentsline{section}{{\bf QuaAdler32} (Adler32 checksum )}{\pageref{classQuaAdler32}}{} +\item\contentsline{section}{{\bf QuaChecksum32} (Checksum interface )}{\pageref{classQuaChecksum32}}{} +\item\contentsline{section}{{\bf QuaCrc32} (CRC32 checksum )}{\pageref{classQuaCrc32}}{} +\item\contentsline{section}{{\bf QuaGzipFile} (GZIP file )}{\pageref{classQuaGzipFile}}{} +\item\contentsline{section}{{\bf QuaZIODevice} (A class to compress/decompress QIODevice )}{\pageref{classQuaZIODevice}}{} +\item\contentsline{section}{{\bf QuaZip} (ZIP archive )}{\pageref{classQuaZip}}{} +\item\contentsline{section}{{\bf QuaZipDir} (Provides ZIP archive navigation )}{\pageref{classQuaZipDir}}{} +\item\contentsline{section}{{\bf QuaZipFile} (A file inside ZIP archive )}{\pageref{classQuaZipFile}}{} +\item\contentsline{section}{{\bf QuaZipFileInfo} (Information about a file inside archive )}{\pageref{structQuaZipFileInfo}}{} +\item\contentsline{section}{{\bf QuaZipFilePrivate} (The implementation class for \doxyref{QuaZip}{p.}{classQuaZip} )}{\pageref{classQuaZipFilePrivate}}{} +\item\contentsline{section}{{\bf QuaZipNewInfo} (Information about a file to be created )}{\pageref{structQuaZipNewInfo}}{} +\item\contentsline{section}{{\bf QuaZipPrivate} (All the internal stuff for the \doxyref{QuaZip}{p.}{classQuaZip} class )}{\pageref{classQuaZipPrivate}}{} +\end{DoxyCompactList} diff --git a/3rdparty/quazip-0.5.1/doc/latex/classJlCompress.tex b/3rdparty/quazip-0.5.1/doc/latex/classJlCompress.tex new file mode 100644 index 00000000..543a30f6 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/latex/classJlCompress.tex @@ -0,0 +1,239 @@ +\section{JlCompress Class Reference} +\label{classJlCompress}\index{JlCompress@{JlCompress}} + + +Utility class for typical operations. + + + + +{\ttfamily \#include $<$JlCompress.h$>$} + +\subsection*{Static Public Member Functions} +\begin{DoxyCompactItemize} +\item +static bool {\bf compressFile} (QString fileCompressed, QString file) +\begin{DoxyCompactList}\small\item\em Compress a single file. \end{DoxyCompactList}\item +static bool {\bf compressFiles} (QString fileCompressed, QStringList files) +\begin{DoxyCompactList}\small\item\em Compress a list of files. \end{DoxyCompactList}\item +static bool {\bf compressDir} (QString fileCompressed, QString dir=QString(), bool recursive=true) +\begin{DoxyCompactList}\small\item\em Compress a whole directory. \end{DoxyCompactList}\item +static QString {\bf extractFile} (QString fileCompressed, QString fileName, QString fileDest=QString()) +\begin{DoxyCompactList}\small\item\em Extract a single file. \end{DoxyCompactList}\item +static QStringList {\bf extractFiles} (QString fileCompressed, QStringList files, QString dir=QString()) +\begin{DoxyCompactList}\small\item\em Extract a list of files. \end{DoxyCompactList}\item +static QStringList {\bf extractDir} (QString fileCompressed, QString dir=QString()) +\begin{DoxyCompactList}\small\item\em Extract a whole archive. \end{DoxyCompactList}\item +static QStringList {\bf getFileList} (QString fileCompressed) +\begin{DoxyCompactList}\small\item\em Get the file list. \end{DoxyCompactList}\end{DoxyCompactItemize} + + +\subsection{Detailed Description} +Utility class for typical operations. + +This class contains a number of useful static functions to perform simple operations, such as mass ZIP packing or extraction. + +\subsection{Member Function Documentation} +\index{JlCompress@{JlCompress}!compressFile@{compressFile}} +\index{compressFile@{compressFile}!JlCompress@{JlCompress}} +\subsubsection[{compressFile}]{\setlength{\rightskip}{0pt plus 5cm}bool JlCompress::compressFile ( +\begin{DoxyParamCaption} +\item[{QString}]{fileCompressed, } +\item[{QString}]{file} +\end{DoxyParamCaption} +)\hspace{0.3cm}{\ttfamily [static]}}\label{classJlCompress_a4a4de9c62ecf161bb658d4d80495ea97} + + +Compress a single file. + + +\begin{DoxyParams}{Parameters} +{\em fileCompressed} & The name of the archive. \\ +\hline +{\em file} & The file to compress. \\ +\hline +\end{DoxyParams} +\begin{DoxyReturn}{Returns} +true if success, false otherwise. +\end{DoxyReturn} +OK Comprime il file fileName nel file fileCompressed. Se la funzione fallisce restituisce false e cancella il file che si e tentato di creare. + +La funzione fallisce se: $\ast$ non si riesce ad aprire l'oggetto zip; $\ast$ la compressione del file fallisce; $\ast$ non si riesce a chiudere l'oggetto zip; + +References QuaZip::close(), QuaZip::getZipError(), QuaZip::mdCreate, and QuaZip::open(). + +\index{JlCompress@{JlCompress}!compressFiles@{compressFiles}} +\index{compressFiles@{compressFiles}!JlCompress@{JlCompress}} +\subsubsection[{compressFiles}]{\setlength{\rightskip}{0pt plus 5cm}bool JlCompress::compressFiles ( +\begin{DoxyParamCaption} +\item[{QString}]{fileCompressed, } +\item[{QStringList}]{files} +\end{DoxyParamCaption} +)\hspace{0.3cm}{\ttfamily [static]}}\label{classJlCompress_a9cdb92d29a94c6b13a718a3249685846} + + +Compress a list of files. + + +\begin{DoxyParams}{Parameters} +{\em fileCompressed} & The name of the archive. \\ +\hline +{\em files} & The file list to compress. \\ +\hline +\end{DoxyParams} +\begin{DoxyReturn}{Returns} +true if success, false otherwise. +\end{DoxyReturn} +OK Comprime i file specificati in files nel file fileCompressed. Se la funzione fallisce restituisce false e cancella il file che si e tentato di creare. + +La funzione fallisce se: $\ast$ non si riesce ad aprire l'oggetto zip; $\ast$ la compressione di un file fallisce; $\ast$ non si riesce a chiudere l'oggetto zip; + +References QuaZip::close(), QuaZip::getZipError(), QuaZip::mdCreate, and QuaZip::open(). + +\index{JlCompress@{JlCompress}!compressDir@{compressDir}} +\index{compressDir@{compressDir}!JlCompress@{JlCompress}} +\subsubsection[{compressDir}]{\setlength{\rightskip}{0pt plus 5cm}bool JlCompress::compressDir ( +\begin{DoxyParamCaption} +\item[{QString}]{fileCompressed, } +\item[{QString}]{dir = {\ttfamily QString()}, } +\item[{bool}]{recursive = {\ttfamily true}} +\end{DoxyParamCaption} +)\hspace{0.3cm}{\ttfamily [static]}}\label{classJlCompress_a8708eafcadc5c192a1d492e784cfc98f} + + +Compress a whole directory. + + +\begin{DoxyParams}{Parameters} +{\em fileCompressed} & The name of the archive. \\ +\hline +{\em dir} & The directory to compress. \\ +\hline +{\em recursive} & Whether to pack the subdirectories as well, or just regular files. \\ +\hline +\end{DoxyParams} +\begin{DoxyReturn}{Returns} +true if success, false otherwise. +\end{DoxyReturn} +OK Comprime la cartella dir nel file fileCompressed, se recursive e true allora comprime anche le sotto cartelle. Se la funzione fallisce restituisce false e cancella il file che si e tentato di creare. + +La funzione fallisce se: $\ast$ non si riesce ad aprire l'oggetto zip; $\ast$ la compressione di un file fallisce; $\ast$ non si riesce a chiudere l'oggetto zip; + +References QuaZip::close(), QuaZip::getZipError(), QuaZip::mdCreate, and QuaZip::open(). + +\index{JlCompress@{JlCompress}!extractFile@{extractFile}} +\index{extractFile@{extractFile}!JlCompress@{JlCompress}} +\subsubsection[{extractFile}]{\setlength{\rightskip}{0pt plus 5cm}QString JlCompress::extractFile ( +\begin{DoxyParamCaption} +\item[{QString}]{fileCompressed, } +\item[{QString}]{fileName, } +\item[{QString}]{fileDest = {\ttfamily QString()}} +\end{DoxyParamCaption} +)\hspace{0.3cm}{\ttfamily [static]}}\label{classJlCompress_a38c0d58bfe3bbbcb3cf4e98d126633a3} + + +Extract a single file. + + +\begin{DoxyParams}{Parameters} +{\em fileCompressed} & The name of the archive. \\ +\hline +{\em fileName} & The file to extract. \\ +\hline +{\em fileDest} & The destination file, assumed to be identical to {\itshape file\/} if left empty. \\ +\hline +\end{DoxyParams} +\begin{DoxyReturn}{Returns} +The list of the full paths of the files extracted, empty on failure. +\end{DoxyReturn} +OK Estrae il file fileName, contenuto nel file fileCompressed, con il nome fileDest. Se fileDest = \char`\"{}\char`\"{} allora il file viene estratto con lo stesso nome con cui e stato compresso. Se la funzione fallisce cancella il file che si e tentato di estrarre. Restituisce il nome assoluto del file estratto. + +La funzione fallisce se: $\ast$ non si riesce ad aprire l'oggetto zip; $\ast$ l'estrazione del file fallisce; $\ast$ non si riesce a chiudere l'oggetto zip; + +References QuaZip::close(), QuaZip::getZipError(), QuaZip::mdUnzip, and QuaZip::open(). + +\index{JlCompress@{JlCompress}!extractFiles@{extractFiles}} +\index{extractFiles@{extractFiles}!JlCompress@{JlCompress}} +\subsubsection[{extractFiles}]{\setlength{\rightskip}{0pt plus 5cm}QStringList JlCompress::extractFiles ( +\begin{DoxyParamCaption} +\item[{QString}]{fileCompressed, } +\item[{QStringList}]{files, } +\item[{QString}]{dir = {\ttfamily QString()}} +\end{DoxyParamCaption} +)\hspace{0.3cm}{\ttfamily [static]}}\label{classJlCompress_a309e9ee366719a4d8aa28f837fab73ae} + + +Extract a list of files. + + +\begin{DoxyParams}{Parameters} +{\em fileCompressed} & The name of the archive. \\ +\hline +{\em files} & The file list to extract. \\ +\hline +{\em dir} & The directory to put the files to, the current directory if left empty. \\ +\hline +\end{DoxyParams} +\begin{DoxyReturn}{Returns} +The list of the full paths of the files extracted, empty on failure. +\end{DoxyReturn} +OK Estrae i file specificati in files, contenuti nel file fileCompressed, nella cartella dir. La struttura a cartelle del file compresso viene rispettata. Se dir = \char`\"{}\char`\"{} allora il file viene estratto nella cartella corrente. Se la funzione fallisce cancella i file che si e tentato di estrarre. Restituisce i nomi assoluti dei file estratti. + +La funzione fallisce se: $\ast$ non si riesce ad aprire l'oggetto zip; $\ast$ l'estrazione di un file fallisce; $\ast$ non si riesce a chiudere l'oggetto zip; + +References QuaZip::close(), QuaZip::getZipError(), QuaZip::mdUnzip, and QuaZip::open(). + +\index{JlCompress@{JlCompress}!extractDir@{extractDir}} +\index{extractDir@{extractDir}!JlCompress@{JlCompress}} +\subsubsection[{extractDir}]{\setlength{\rightskip}{0pt plus 5cm}QStringList JlCompress::extractDir ( +\begin{DoxyParamCaption} +\item[{QString}]{fileCompressed, } +\item[{QString}]{dir = {\ttfamily QString()}} +\end{DoxyParamCaption} +)\hspace{0.3cm}{\ttfamily [static]}}\label{classJlCompress_a365a153baa4c11812d93cbca60b6a293} + + +Extract a whole archive. + + +\begin{DoxyParams}{Parameters} +{\em fileCompressed} & The name of the archive. \\ +\hline +{\em dir} & The directory to extract to, the current directory if left empty. \\ +\hline +\end{DoxyParams} +\begin{DoxyReturn}{Returns} +The list of the full paths of the files extracted, empty on failure. +\end{DoxyReturn} +OK Estrae il file fileCompressed nella cartella dir. Se dir = \char`\"{}\char`\"{} allora il file viene estratto nella cartella corrente. Se la funzione fallisce cancella i file che si e tentato di estrarre. Restituisce i nomi assoluti dei file estratti. + +La funzione fallisce se: $\ast$ non si riesce ad aprire l'oggetto zip; $\ast$ la compressione di un file fallisce; $\ast$ non si riesce a chiudere l'oggetto zip; + +References QuaZip::close(), QuaZip::getCurrentFileName(), QuaZip::getZipError(), QuaZip::goToFirstFile(), QuaZip::goToNextFile(), QuaZip::mdUnzip, and QuaZip::open(). + +\index{JlCompress@{JlCompress}!getFileList@{getFileList}} +\index{getFileList@{getFileList}!JlCompress@{JlCompress}} +\subsubsection[{getFileList}]{\setlength{\rightskip}{0pt plus 5cm}QStringList JlCompress::getFileList ( +\begin{DoxyParamCaption} +\item[{QString}]{fileCompressed} +\end{DoxyParamCaption} +)\hspace{0.3cm}{\ttfamily [static]}}\label{classJlCompress_ab42422be913f817d7e04c1b1cd5d0156} + + +Get the file list. + +\begin{DoxyReturn}{Returns} +The list of the files in the archive, or, more precisely, the list of the entries, including both files and directories if they are present separately. +\end{DoxyReturn} +OK Restituisce la lista dei file resenti nel file compresso fileCompressed. Se la funzione fallisce, restituisce un elenco vuoto. + +La funzione fallisce se: $\ast$ non si riesce ad aprire l'oggetto zip; $\ast$ la richiesta di informazioni di un file fallisce; $\ast$ non si riesce a chiudere l'oggetto zip; + +References QuaZip::close(), QuaZip::getCurrentFileInfo(), QuaZip::getZipError(), QuaZip::goToFirstFile(), QuaZip::goToNextFile(), QuaZip::mdUnzip, QuaZipFileInfo::name, and QuaZip::open(). + + + +The documentation for this class was generated from the following files:\begin{DoxyCompactItemize} +\item +quazip/JlCompress.h\item +quazip/JlCompress.cpp\end{DoxyCompactItemize} diff --git a/3rdparty/quazip-0.5.1/doc/latex/classQuaAdler32.tex b/3rdparty/quazip-0.5.1/doc/latex/classQuaAdler32.tex new file mode 100644 index 00000000..369609d1 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/latex/classQuaAdler32.tex @@ -0,0 +1,108 @@ +\section{QuaAdler32 Class Reference} +\label{classQuaAdler32}\index{QuaAdler32@{QuaAdler32}} + + +Adler32 checksum. + + + + +{\ttfamily \#include $<$quazip/quaadler32.h$>$} + + + +Inheritance diagram for QuaAdler32: +\nopagebreak +\begin{figure}[H] +\begin{center} +\leavevmode +\includegraphics[width=136pt]{classQuaAdler32__inherit__graph} +\end{center} +\end{figure} + + +Collaboration diagram for QuaAdler32: +\nopagebreak +\begin{figure}[H] +\begin{center} +\leavevmode +\includegraphics[width=136pt]{classQuaAdler32__coll__graph} +\end{center} +\end{figure} +\subsection*{Public Member Functions} +\begin{DoxyCompactItemize} +\item +quint32 {\bf calculate} (const QByteArray \&data) +\begin{DoxyCompactList}\small\item\em Calculates the checksum for data. \end{DoxyCompactList}\item +void {\bf reset} ()\label{classQuaAdler32_a2fe6ac9eb289bafda6a9fd20e6472ab5} + +\begin{DoxyCompactList}\small\item\em Resets the calculation on a checksun for a stream. \end{DoxyCompactList}\item +void {\bf update} (const QByteArray \&buf) +\begin{DoxyCompactList}\small\item\em Updates the calculated checksum for the stream. \end{DoxyCompactList}\item +quint32 {\bf value} () +\begin{DoxyCompactList}\small\item\em Value of the checksum calculated for the stream passed throw \doxyref{update()}{p.}{classQuaAdler32_aba24f7b16aa0cdc26f81a9ad687fc653}. \end{DoxyCompactList}\end{DoxyCompactItemize} + + +\subsection{Detailed Description} +Adler32 checksum. + +This class wrappers the adler32 function with the \doxyref{QuaChecksum32}{p.}{classQuaChecksum32} interface. See \doxyref{QuaChecksum32}{p.}{classQuaChecksum32} for more info. + +\subsection{Member Function Documentation} +\index{QuaAdler32@{QuaAdler32}!calculate@{calculate}} +\index{calculate@{calculate}!QuaAdler32@{QuaAdler32}} +\subsubsection[{calculate}]{\setlength{\rightskip}{0pt plus 5cm}quint32 QuaAdler32::calculate ( +\begin{DoxyParamCaption} +\item[{const QByteArray \&}]{data} +\end{DoxyParamCaption} +)\hspace{0.3cm}{\ttfamily [virtual]}}\label{classQuaAdler32_a350e84fd000ebfa3c33503336a7b21bb} + + +Calculates the checksum for data. + +{\itshape data\/} source data \begin{DoxyReturn}{Returns} +data checksum +\end{DoxyReturn} +This function has no efect on the value returned by \doxyref{value()}{p.}{classQuaAdler32_a2022e1db95c23cef220b335e44d74fb1}. + +Implements {\bf QuaChecksum32} \doxyref{}{p.}{classQuaChecksum32_a14d800fcfd55b2ae11ef07d3924fe0b1}. + +\index{QuaAdler32@{QuaAdler32}!update@{update}} +\index{update@{update}!QuaAdler32@{QuaAdler32}} +\subsubsection[{update}]{\setlength{\rightskip}{0pt plus 5cm}void QuaAdler32::update ( +\begin{DoxyParamCaption} +\item[{const QByteArray \&}]{buf} +\end{DoxyParamCaption} +)\hspace{0.3cm}{\ttfamily [virtual]}}\label{classQuaAdler32_aba24f7b16aa0cdc26f81a9ad687fc653} + + +Updates the calculated checksum for the stream. + +{\itshape buf\/} next portion of data from the stream + +Implements {\bf QuaChecksum32} \doxyref{}{p.}{classQuaChecksum32_a63a6ed3171f9243214d307da67557f7e}. + +\index{QuaAdler32@{QuaAdler32}!value@{value}} +\index{value@{value}!QuaAdler32@{QuaAdler32}} +\subsubsection[{value}]{\setlength{\rightskip}{0pt plus 5cm}quint32 QuaAdler32::value ( +\begin{DoxyParamCaption} +{} +\end{DoxyParamCaption} +)\hspace{0.3cm}{\ttfamily [virtual]}}\label{classQuaAdler32_a2022e1db95c23cef220b335e44d74fb1} + + +Value of the checksum calculated for the stream passed throw \doxyref{update()}{p.}{classQuaAdler32_aba24f7b16aa0cdc26f81a9ad687fc653}. + +\begin{DoxyReturn}{Returns} +checksum +\end{DoxyReturn} + + +Implements {\bf QuaChecksum32} \doxyref{}{p.}{classQuaChecksum32_afd836e7534194fce08356be6a8336da7}. + + + +The documentation for this class was generated from the following files:\begin{DoxyCompactItemize} +\item +quazip/quaadler32.h\item +quazip/quaadler32.cpp\end{DoxyCompactItemize} diff --git a/3rdparty/quazip-0.5.1/doc/latex/classQuaAdler32__coll__graph.eps b/3rdparty/quazip-0.5.1/doc/latex/classQuaAdler32__coll__graph.eps new file mode 100644 index 00000000..5567d863 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/latex/classQuaAdler32__coll__graph.eps @@ -0,0 +1,263 @@ +%!PS-Adobe-3.0 +%%Creator: graphviz version 2.28.0 (20110507.0327) +%%Title: G +%%Pages: (atend) +%%BoundingBox: (atend) +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval +EncodingVector 45 /hyphen put + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw text fitted to its expected width +/alignedtext { % width text + /text exch def + /width exch def + gsave + width 0 gt { + [] 0 setdash + text stringwidth pop width exch sub text length div 0 text ashow + } if + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +setupLatin1 +%%Page: 1 1 +%%PageBoundingBox: 36 36 136 120 +%%PageOrientation: Portrait +0 0 1 beginpage +gsave +36 36 100 84 boxprim clip newpath +1 1 set_scale 0 rotate 40 41 translate +% Node1 +gsave +0 0 0.74902 nodecolor +newpath 12 .5 moveto +12 19.5 lineto +80 19.5 lineto +80 .5 lineto +closepath fill +1 setlinewidth +filled +0 0 0 nodecolor +newpath 12 .5 moveto +12 19.5 lineto +80 19.5 lineto +80 .5 lineto +closepath stroke +0 0 0 nodecolor +10 /Helvetica set_font +20 7.5 moveto 52 (QuaAdler32) alignedtext +grestore +% Node2 +gsave +[ /Rect [ 0 56 92 76 ] + /Border [ 0 0 0 ] + /Action << /Subtype /URI /URI ($classQuaChecksum32.html) >> + /Subtype /Link +/ANN pdfmark +0 0 1 nodecolor +newpath 0 56.5 moveto +0 75.5 lineto +92 75.5 lineto +92 56.5 lineto +closepath fill +1 setlinewidth +filled +0 0 0 nodecolor +newpath 0 56.5 moveto +0 75.5 lineto +92 75.5 lineto +92 56.5 lineto +closepath stroke +0 0 0 nodecolor +10 /Helvetica set_font +8 63.5 moveto 76 (QuaChecksum32) alignedtext +grestore +% Node2->Node1 +gsave +1 setlinewidth +solid +0.66667 0.77647 0.43922 edgecolor +newpath 46 45.8 moveto +46 36.91 46 26.78 46 19.75 curveto +stroke +0.66667 0.77647 0.43922 edgecolor +newpath 42.5 46.08 moveto +46 56.08 lineto +49.5 46.08 lineto +closepath fill +1 setlinewidth +solid +0.66667 0.77647 0.43922 edgecolor +newpath 42.5 46.08 moveto +46 56.08 lineto +49.5 46.08 lineto +closepath stroke +grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +%%BoundingBox: 36 36 136 120 +end +restore +%%EOF diff --git a/3rdparty/quazip-0.5.1/doc/latex/classQuaAdler32__coll__graph.md5 b/3rdparty/quazip-0.5.1/doc/latex/classQuaAdler32__coll__graph.md5 new file mode 100644 index 00000000..19124ff2 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/latex/classQuaAdler32__coll__graph.md5 @@ -0,0 +1 @@ +dbe414b63f5eac72ebd22d72dbae868f \ No newline at end of file diff --git a/3rdparty/quazip-0.5.1/doc/latex/classQuaAdler32__inherit__graph.eps b/3rdparty/quazip-0.5.1/doc/latex/classQuaAdler32__inherit__graph.eps new file mode 100644 index 00000000..5567d863 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/latex/classQuaAdler32__inherit__graph.eps @@ -0,0 +1,263 @@ +%!PS-Adobe-3.0 +%%Creator: graphviz version 2.28.0 (20110507.0327) +%%Title: G +%%Pages: (atend) +%%BoundingBox: (atend) +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval +EncodingVector 45 /hyphen put + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw text fitted to its expected width +/alignedtext { % width text + /text exch def + /width exch def + gsave + width 0 gt { + [] 0 setdash + text stringwidth pop width exch sub text length div 0 text ashow + } if + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +setupLatin1 +%%Page: 1 1 +%%PageBoundingBox: 36 36 136 120 +%%PageOrientation: Portrait +0 0 1 beginpage +gsave +36 36 100 84 boxprim clip newpath +1 1 set_scale 0 rotate 40 41 translate +% Node1 +gsave +0 0 0.74902 nodecolor +newpath 12 .5 moveto +12 19.5 lineto +80 19.5 lineto +80 .5 lineto +closepath fill +1 setlinewidth +filled +0 0 0 nodecolor +newpath 12 .5 moveto +12 19.5 lineto +80 19.5 lineto +80 .5 lineto +closepath stroke +0 0 0 nodecolor +10 /Helvetica set_font +20 7.5 moveto 52 (QuaAdler32) alignedtext +grestore +% Node2 +gsave +[ /Rect [ 0 56 92 76 ] + /Border [ 0 0 0 ] + /Action << /Subtype /URI /URI ($classQuaChecksum32.html) >> + /Subtype /Link +/ANN pdfmark +0 0 1 nodecolor +newpath 0 56.5 moveto +0 75.5 lineto +92 75.5 lineto +92 56.5 lineto +closepath fill +1 setlinewidth +filled +0 0 0 nodecolor +newpath 0 56.5 moveto +0 75.5 lineto +92 75.5 lineto +92 56.5 lineto +closepath stroke +0 0 0 nodecolor +10 /Helvetica set_font +8 63.5 moveto 76 (QuaChecksum32) alignedtext +grestore +% Node2->Node1 +gsave +1 setlinewidth +solid +0.66667 0.77647 0.43922 edgecolor +newpath 46 45.8 moveto +46 36.91 46 26.78 46 19.75 curveto +stroke +0.66667 0.77647 0.43922 edgecolor +newpath 42.5 46.08 moveto +46 56.08 lineto +49.5 46.08 lineto +closepath fill +1 setlinewidth +solid +0.66667 0.77647 0.43922 edgecolor +newpath 42.5 46.08 moveto +46 56.08 lineto +49.5 46.08 lineto +closepath stroke +grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +%%BoundingBox: 36 36 136 120 +end +restore +%%EOF diff --git a/3rdparty/quazip-0.5.1/doc/latex/classQuaAdler32__inherit__graph.md5 b/3rdparty/quazip-0.5.1/doc/latex/classQuaAdler32__inherit__graph.md5 new file mode 100644 index 00000000..19124ff2 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/latex/classQuaAdler32__inherit__graph.md5 @@ -0,0 +1 @@ +dbe414b63f5eac72ebd22d72dbae868f \ No newline at end of file diff --git a/3rdparty/quazip-0.5.1/doc/latex/classQuaChecksum32.tex b/3rdparty/quazip-0.5.1/doc/latex/classQuaChecksum32.tex new file mode 100644 index 00000000..a1fc6908 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/latex/classQuaChecksum32.tex @@ -0,0 +1,113 @@ +\section{QuaChecksum32 Class Reference} +\label{classQuaChecksum32}\index{QuaChecksum32@{QuaChecksum32}} + + +Checksum interface. + + + + +{\ttfamily \#include $<$quazip/quachecksum32.h$>$} + + + +Inheritance diagram for QuaChecksum32: +\nopagebreak +\begin{figure}[H] +\begin{center} +\leavevmode +\includegraphics[width=190pt]{classQuaChecksum32__inherit__graph} +\end{center} +\end{figure} +\subsection*{Public Member Functions} +\begin{DoxyCompactItemize} +\item +virtual quint32 {\bf calculate} (const QByteArray \&data)=0 +\begin{DoxyCompactList}\small\item\em Calculates the checksum for data. \end{DoxyCompactList}\item +virtual void {\bf reset} ()=0\label{classQuaChecksum32_ad3f5db3c76b00069db9bda333cb49d57} + +\begin{DoxyCompactList}\small\item\em Resets the calculation on a checksun for a stream. \end{DoxyCompactList}\item +virtual void {\bf update} (const QByteArray \&buf)=0 +\begin{DoxyCompactList}\small\item\em Updates the calculated checksum for the stream. \end{DoxyCompactList}\item +virtual quint32 {\bf value} ()=0 +\begin{DoxyCompactList}\small\item\em Value of the checksum calculated for the stream passed throw \doxyref{update()}{p.}{classQuaChecksum32_a63a6ed3171f9243214d307da67557f7e}. \end{DoxyCompactList}\end{DoxyCompactItemize} + + +\subsection{Detailed Description} +Checksum interface. + +This is an interface for 32 bit checksums. Classes implementing this interface can calcunate a certin checksum in a single step: +\begin{DoxyCode} + QChecksum32 *crc32 = new QuaCrc32(); + rasoult = crc32->calculate(data); +\end{DoxyCode} + or by streaming the data: +\begin{DoxyCode} + QChecksum32 *crc32 = new QuaCrc32(); + while(!fileA.atEnd()) + crc32->update(fileA.read(bufSize)); + resoultA = crc32->value(); + crc32->reset(); + while(!fileB.atEnd()) + crc32->update(fileB.read(bufSize)); + resoultB = crc32->value(); +\end{DoxyCode} + + +\subsection{Member Function Documentation} +\index{QuaChecksum32@{QuaChecksum32}!calculate@{calculate}} +\index{calculate@{calculate}!QuaChecksum32@{QuaChecksum32}} +\subsubsection[{calculate}]{\setlength{\rightskip}{0pt plus 5cm}virtual quint32 QuaChecksum32::calculate ( +\begin{DoxyParamCaption} +\item[{const QByteArray \&}]{data} +\end{DoxyParamCaption} +)\hspace{0.3cm}{\ttfamily [pure virtual]}}\label{classQuaChecksum32_a14d800fcfd55b2ae11ef07d3924fe0b1} + + +Calculates the checksum for data. + +{\itshape data\/} source data \begin{DoxyReturn}{Returns} +data checksum +\end{DoxyReturn} +This function has no efect on the value returned by \doxyref{value()}{p.}{classQuaChecksum32_afd836e7534194fce08356be6a8336da7}. + +Implemented in {\bf QuaAdler32} \doxyref{}{p.}{classQuaAdler32_a350e84fd000ebfa3c33503336a7b21bb}, and {\bf QuaCrc32} \doxyref{}{p.}{classQuaCrc32_aaf6fdf6e36e55c97bf9eab6ec65ecb9e}. + +\index{QuaChecksum32@{QuaChecksum32}!update@{update}} +\index{update@{update}!QuaChecksum32@{QuaChecksum32}} +\subsubsection[{update}]{\setlength{\rightskip}{0pt plus 5cm}virtual void QuaChecksum32::update ( +\begin{DoxyParamCaption} +\item[{const QByteArray \&}]{buf} +\end{DoxyParamCaption} +)\hspace{0.3cm}{\ttfamily [pure virtual]}}\label{classQuaChecksum32_a63a6ed3171f9243214d307da67557f7e} + + +Updates the calculated checksum for the stream. + +{\itshape buf\/} next portion of data from the stream + +Implemented in {\bf QuaAdler32} \doxyref{}{p.}{classQuaAdler32_aba24f7b16aa0cdc26f81a9ad687fc653}, and {\bf QuaCrc32} \doxyref{}{p.}{classQuaCrc32_a5015d80e04afe6e6d094155b7e99888e}. + +\index{QuaChecksum32@{QuaChecksum32}!value@{value}} +\index{value@{value}!QuaChecksum32@{QuaChecksum32}} +\subsubsection[{value}]{\setlength{\rightskip}{0pt plus 5cm}virtual quint32 QuaChecksum32::value ( +\begin{DoxyParamCaption} +{} +\end{DoxyParamCaption} +)\hspace{0.3cm}{\ttfamily [pure virtual]}}\label{classQuaChecksum32_afd836e7534194fce08356be6a8336da7} + + +Value of the checksum calculated for the stream passed throw \doxyref{update()}{p.}{classQuaChecksum32_a63a6ed3171f9243214d307da67557f7e}. + +\begin{DoxyReturn}{Returns} +checksum +\end{DoxyReturn} + + +Implemented in {\bf QuaAdler32} \doxyref{}{p.}{classQuaAdler32_a2022e1db95c23cef220b335e44d74fb1}, and {\bf QuaCrc32} \doxyref{}{p.}{classQuaCrc32_a957ce46a53862f75c89d6a3ac4f73389}. + + + +The documentation for this class was generated from the following file:\begin{DoxyCompactItemize} +\item +quazip/quachecksum32.h\end{DoxyCompactItemize} diff --git a/3rdparty/quazip-0.5.1/doc/latex/classQuaChecksum32__inherit__graph.eps b/3rdparty/quazip-0.5.1/doc/latex/classQuaChecksum32__inherit__graph.eps new file mode 100644 index 00000000..564a81a2 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/latex/classQuaChecksum32__inherit__graph.eps @@ -0,0 +1,309 @@ +%!PS-Adobe-3.0 +%%Creator: graphviz version 2.28.0 (20110507.0327) +%%Title: G +%%Pages: (atend) +%%BoundingBox: (atend) +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval +EncodingVector 45 /hyphen put + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw text fitted to its expected width +/alignedtext { % width text + /text exch def + /width exch def + gsave + width 0 gt { + [] 0 setdash + text stringwidth pop width exch sub text length div 0 text ashow + } if + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +setupLatin1 +%%Page: 1 1 +%%PageBoundingBox: 36 36 190 120 +%%PageOrientation: Portrait +0 0 1 beginpage +gsave +36 36 154 84 boxprim clip newpath +1 1 set_scale 0 rotate 40 41 translate +% Node1 +gsave +0 0 0.74902 nodecolor +newpath 29 56.5 moveto +29 75.5 lineto +121 75.5 lineto +121 56.5 lineto +closepath fill +1 setlinewidth +filled +0 0 0 nodecolor +newpath 29 56.5 moveto +29 75.5 lineto +121 75.5 lineto +121 56.5 lineto +closepath stroke +0 0 0 nodecolor +10 /Helvetica set_font +37 63.5 moveto 76 (QuaChecksum32) alignedtext +grestore +% Node2 +gsave +[ /Rect [ 0 0 68 20 ] + /Border [ 0 0 0 ] + /Action << /Subtype /URI /URI ($classQuaAdler32.html) >> + /Subtype /Link +/ANN pdfmark +0 0 1 nodecolor +newpath 0 .5 moveto +0 19.5 lineto +68 19.5 lineto +68 .5 lineto +closepath fill +1 setlinewidth +filled +0 0 0 nodecolor +newpath 0 .5 moveto +0 19.5 lineto +68 19.5 lineto +68 .5 lineto +closepath stroke +0 0 0 nodecolor +10 /Helvetica set_font +8 7.5 moveto 52 (QuaAdler32) alignedtext +grestore +% Node1->Node2 +gsave +1 setlinewidth +solid +0.66667 0.77647 0.43922 edgecolor +newpath 61.98 47.86 moveto +54.88 38.5 46.4 27.33 40.64 19.75 curveto +stroke +0.66667 0.77647 0.43922 edgecolor +newpath 59.39 50.24 moveto +68.23 56.08 lineto +64.97 46 lineto +closepath fill +1 setlinewidth +solid +0.66667 0.77647 0.43922 edgecolor +newpath 59.39 50.24 moveto +68.23 56.08 lineto +64.97 46 lineto +closepath stroke +grestore +% Node3 +gsave +[ /Rect [ 86 0 146 20 ] + /Border [ 0 0 0 ] + /Action << /Subtype /URI /URI ($classQuaCrc32.html) >> + /Subtype /Link +/ANN pdfmark +0 0 1 nodecolor +newpath 86 .5 moveto +86 19.5 lineto +146 19.5 lineto +146 .5 lineto +closepath fill +1 setlinewidth +filled +0 0 0 nodecolor +newpath 86 .5 moveto +86 19.5 lineto +146 19.5 lineto +146 .5 lineto +closepath stroke +0 0 0 nodecolor +10 /Helvetica set_font +94 7.5 moveto 44 (QuaCrc32) alignedtext +grestore +% Node1->Node3 +gsave +1 setlinewidth +solid +0.66667 0.77647 0.43922 edgecolor +newpath 88.02 47.86 moveto +95.12 38.5 103.6 27.33 109.36 19.75 curveto +stroke +0.66667 0.77647 0.43922 edgecolor +newpath 85.03 46 moveto +81.77 56.08 lineto +90.61 50.24 lineto +closepath fill +1 setlinewidth +solid +0.66667 0.77647 0.43922 edgecolor +newpath 85.03 46 moveto +81.77 56.08 lineto +90.61 50.24 lineto +closepath stroke +grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +%%BoundingBox: 36 36 190 120 +end +restore +%%EOF diff --git a/3rdparty/quazip-0.5.1/doc/latex/classQuaChecksum32__inherit__graph.md5 b/3rdparty/quazip-0.5.1/doc/latex/classQuaChecksum32__inherit__graph.md5 new file mode 100644 index 00000000..dd4b6e45 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/latex/classQuaChecksum32__inherit__graph.md5 @@ -0,0 +1 @@ +fe6eaf22d351a7125f230bf0b6ba2704 \ No newline at end of file diff --git a/3rdparty/quazip-0.5.1/doc/latex/classQuaCrc32.tex b/3rdparty/quazip-0.5.1/doc/latex/classQuaCrc32.tex new file mode 100644 index 00000000..f40d1f87 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/latex/classQuaCrc32.tex @@ -0,0 +1,108 @@ +\section{QuaCrc32 Class Reference} +\label{classQuaCrc32}\index{QuaCrc32@{QuaCrc32}} + + +CRC32 checksum. + + + + +{\ttfamily \#include $<$quazip/quacrc32.h$>$} + + + +Inheritance diagram for QuaCrc32: +\nopagebreak +\begin{figure}[H] +\begin{center} +\leavevmode +\includegraphics[width=136pt]{classQuaCrc32__inherit__graph} +\end{center} +\end{figure} + + +Collaboration diagram for QuaCrc32: +\nopagebreak +\begin{figure}[H] +\begin{center} +\leavevmode +\includegraphics[width=136pt]{classQuaCrc32__coll__graph} +\end{center} +\end{figure} +\subsection*{Public Member Functions} +\begin{DoxyCompactItemize} +\item +quint32 {\bf calculate} (const QByteArray \&data) +\begin{DoxyCompactList}\small\item\em Calculates the checksum for data. \end{DoxyCompactList}\item +void {\bf reset} ()\label{classQuaCrc32_a3fe7ce6cb73512c963ffaabfbbc66363} + +\begin{DoxyCompactList}\small\item\em Resets the calculation on a checksun for a stream. \end{DoxyCompactList}\item +void {\bf update} (const QByteArray \&buf) +\begin{DoxyCompactList}\small\item\em Updates the calculated checksum for the stream. \end{DoxyCompactList}\item +quint32 {\bf value} () +\begin{DoxyCompactList}\small\item\em Value of the checksum calculated for the stream passed throw \doxyref{update()}{p.}{classQuaCrc32_a5015d80e04afe6e6d094155b7e99888e}. \end{DoxyCompactList}\end{DoxyCompactItemize} + + +\subsection{Detailed Description} +CRC32 checksum. + +This class wrappers the crc32 function with the \doxyref{QuaChecksum32}{p.}{classQuaChecksum32} interface. See \doxyref{QuaChecksum32}{p.}{classQuaChecksum32} for more info. + +\subsection{Member Function Documentation} +\index{QuaCrc32@{QuaCrc32}!calculate@{calculate}} +\index{calculate@{calculate}!QuaCrc32@{QuaCrc32}} +\subsubsection[{calculate}]{\setlength{\rightskip}{0pt plus 5cm}quint32 QuaCrc32::calculate ( +\begin{DoxyParamCaption} +\item[{const QByteArray \&}]{data} +\end{DoxyParamCaption} +)\hspace{0.3cm}{\ttfamily [virtual]}}\label{classQuaCrc32_aaf6fdf6e36e55c97bf9eab6ec65ecb9e} + + +Calculates the checksum for data. + +{\itshape data\/} source data \begin{DoxyReturn}{Returns} +data checksum +\end{DoxyReturn} +This function has no efect on the value returned by \doxyref{value()}{p.}{classQuaCrc32_a957ce46a53862f75c89d6a3ac4f73389}. + +Implements {\bf QuaChecksum32} \doxyref{}{p.}{classQuaChecksum32_a14d800fcfd55b2ae11ef07d3924fe0b1}. + +\index{QuaCrc32@{QuaCrc32}!update@{update}} +\index{update@{update}!QuaCrc32@{QuaCrc32}} +\subsubsection[{update}]{\setlength{\rightskip}{0pt plus 5cm}void QuaCrc32::update ( +\begin{DoxyParamCaption} +\item[{const QByteArray \&}]{buf} +\end{DoxyParamCaption} +)\hspace{0.3cm}{\ttfamily [virtual]}}\label{classQuaCrc32_a5015d80e04afe6e6d094155b7e99888e} + + +Updates the calculated checksum for the stream. + +{\itshape buf\/} next portion of data from the stream + +Implements {\bf QuaChecksum32} \doxyref{}{p.}{classQuaChecksum32_a63a6ed3171f9243214d307da67557f7e}. + +\index{QuaCrc32@{QuaCrc32}!value@{value}} +\index{value@{value}!QuaCrc32@{QuaCrc32}} +\subsubsection[{value}]{\setlength{\rightskip}{0pt plus 5cm}quint32 QuaCrc32::value ( +\begin{DoxyParamCaption} +{} +\end{DoxyParamCaption} +)\hspace{0.3cm}{\ttfamily [virtual]}}\label{classQuaCrc32_a957ce46a53862f75c89d6a3ac4f73389} + + +Value of the checksum calculated for the stream passed throw \doxyref{update()}{p.}{classQuaCrc32_a5015d80e04afe6e6d094155b7e99888e}. + +\begin{DoxyReturn}{Returns} +checksum +\end{DoxyReturn} + + +Implements {\bf QuaChecksum32} \doxyref{}{p.}{classQuaChecksum32_afd836e7534194fce08356be6a8336da7}. + + + +The documentation for this class was generated from the following files:\begin{DoxyCompactItemize} +\item +quazip/quacrc32.h\item +quazip/quacrc32.cpp\end{DoxyCompactItemize} diff --git a/3rdparty/quazip-0.5.1/doc/latex/classQuaCrc32__coll__graph.eps b/3rdparty/quazip-0.5.1/doc/latex/classQuaCrc32__coll__graph.eps new file mode 100644 index 00000000..3e6b5bd3 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/latex/classQuaCrc32__coll__graph.eps @@ -0,0 +1,263 @@ +%!PS-Adobe-3.0 +%%Creator: graphviz version 2.28.0 (20110507.0327) +%%Title: G +%%Pages: (atend) +%%BoundingBox: (atend) +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval +EncodingVector 45 /hyphen put + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw text fitted to its expected width +/alignedtext { % width text + /text exch def + /width exch def + gsave + width 0 gt { + [] 0 setdash + text stringwidth pop width exch sub text length div 0 text ashow + } if + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +setupLatin1 +%%Page: 1 1 +%%PageBoundingBox: 36 36 136 120 +%%PageOrientation: Portrait +0 0 1 beginpage +gsave +36 36 100 84 boxprim clip newpath +1 1 set_scale 0 rotate 40 41 translate +% Node1 +gsave +0 0 0.74902 nodecolor +newpath 16 .5 moveto +16 19.5 lineto +76 19.5 lineto +76 .5 lineto +closepath fill +1 setlinewidth +filled +0 0 0 nodecolor +newpath 16 .5 moveto +16 19.5 lineto +76 19.5 lineto +76 .5 lineto +closepath stroke +0 0 0 nodecolor +10 /Helvetica set_font +24 7.5 moveto 44 (QuaCrc32) alignedtext +grestore +% Node2 +gsave +[ /Rect [ 0 56 92 76 ] + /Border [ 0 0 0 ] + /Action << /Subtype /URI /URI ($classQuaChecksum32.html) >> + /Subtype /Link +/ANN pdfmark +0 0 1 nodecolor +newpath 0 56.5 moveto +0 75.5 lineto +92 75.5 lineto +92 56.5 lineto +closepath fill +1 setlinewidth +filled +0 0 0 nodecolor +newpath 0 56.5 moveto +0 75.5 lineto +92 75.5 lineto +92 56.5 lineto +closepath stroke +0 0 0 nodecolor +10 /Helvetica set_font +8 63.5 moveto 76 (QuaChecksum32) alignedtext +grestore +% Node2->Node1 +gsave +1 setlinewidth +solid +0.66667 0.77647 0.43922 edgecolor +newpath 46 45.8 moveto +46 36.91 46 26.78 46 19.75 curveto +stroke +0.66667 0.77647 0.43922 edgecolor +newpath 42.5 46.08 moveto +46 56.08 lineto +49.5 46.08 lineto +closepath fill +1 setlinewidth +solid +0.66667 0.77647 0.43922 edgecolor +newpath 42.5 46.08 moveto +46 56.08 lineto +49.5 46.08 lineto +closepath stroke +grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +%%BoundingBox: 36 36 136 120 +end +restore +%%EOF diff --git a/3rdparty/quazip-0.5.1/doc/latex/classQuaCrc32__coll__graph.md5 b/3rdparty/quazip-0.5.1/doc/latex/classQuaCrc32__coll__graph.md5 new file mode 100644 index 00000000..58c6544f --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/latex/classQuaCrc32__coll__graph.md5 @@ -0,0 +1 @@ +494c6ee53c032c90c71e084fc73592f9 \ No newline at end of file diff --git a/3rdparty/quazip-0.5.1/doc/latex/classQuaCrc32__inherit__graph.eps b/3rdparty/quazip-0.5.1/doc/latex/classQuaCrc32__inherit__graph.eps new file mode 100644 index 00000000..3e6b5bd3 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/latex/classQuaCrc32__inherit__graph.eps @@ -0,0 +1,263 @@ +%!PS-Adobe-3.0 +%%Creator: graphviz version 2.28.0 (20110507.0327) +%%Title: G +%%Pages: (atend) +%%BoundingBox: (atend) +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval +EncodingVector 45 /hyphen put + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw text fitted to its expected width +/alignedtext { % width text + /text exch def + /width exch def + gsave + width 0 gt { + [] 0 setdash + text stringwidth pop width exch sub text length div 0 text ashow + } if + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +setupLatin1 +%%Page: 1 1 +%%PageBoundingBox: 36 36 136 120 +%%PageOrientation: Portrait +0 0 1 beginpage +gsave +36 36 100 84 boxprim clip newpath +1 1 set_scale 0 rotate 40 41 translate +% Node1 +gsave +0 0 0.74902 nodecolor +newpath 16 .5 moveto +16 19.5 lineto +76 19.5 lineto +76 .5 lineto +closepath fill +1 setlinewidth +filled +0 0 0 nodecolor +newpath 16 .5 moveto +16 19.5 lineto +76 19.5 lineto +76 .5 lineto +closepath stroke +0 0 0 nodecolor +10 /Helvetica set_font +24 7.5 moveto 44 (QuaCrc32) alignedtext +grestore +% Node2 +gsave +[ /Rect [ 0 56 92 76 ] + /Border [ 0 0 0 ] + /Action << /Subtype /URI /URI ($classQuaChecksum32.html) >> + /Subtype /Link +/ANN pdfmark +0 0 1 nodecolor +newpath 0 56.5 moveto +0 75.5 lineto +92 75.5 lineto +92 56.5 lineto +closepath fill +1 setlinewidth +filled +0 0 0 nodecolor +newpath 0 56.5 moveto +0 75.5 lineto +92 75.5 lineto +92 56.5 lineto +closepath stroke +0 0 0 nodecolor +10 /Helvetica set_font +8 63.5 moveto 76 (QuaChecksum32) alignedtext +grestore +% Node2->Node1 +gsave +1 setlinewidth +solid +0.66667 0.77647 0.43922 edgecolor +newpath 46 45.8 moveto +46 36.91 46 26.78 46 19.75 curveto +stroke +0.66667 0.77647 0.43922 edgecolor +newpath 42.5 46.08 moveto +46 56.08 lineto +49.5 46.08 lineto +closepath fill +1 setlinewidth +solid +0.66667 0.77647 0.43922 edgecolor +newpath 42.5 46.08 moveto +46 56.08 lineto +49.5 46.08 lineto +closepath stroke +grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +%%BoundingBox: 36 36 136 120 +end +restore +%%EOF diff --git a/3rdparty/quazip-0.5.1/doc/latex/classQuaCrc32__inherit__graph.md5 b/3rdparty/quazip-0.5.1/doc/latex/classQuaCrc32__inherit__graph.md5 new file mode 100644 index 00000000..58c6544f --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/latex/classQuaCrc32__inherit__graph.md5 @@ -0,0 +1 @@ +494c6ee53c032c90c71e084fc73592f9 \ No newline at end of file diff --git a/3rdparty/quazip-0.5.1/doc/latex/classQuaGzipFile.tex b/3rdparty/quazip-0.5.1/doc/latex/classQuaGzipFile.tex new file mode 100644 index 00000000..addcc550 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/latex/classQuaGzipFile.tex @@ -0,0 +1,177 @@ +\section{QuaGzipFile Class Reference} +\label{classQuaGzipFile}\index{QuaGzipFile@{QuaGzipFile}} + + +GZIP file. + + + + +{\ttfamily \#include $<$quagzipfile.h$>$} + +\subsection*{Public Member Functions} +\begin{DoxyCompactItemize} +\item +{\bf QuaGzipFile} () +\begin{DoxyCompactList}\small\item\em Empty constructor. \end{DoxyCompactList}\item +{\bf QuaGzipFile} (QObject $\ast$parent) +\begin{DoxyCompactList}\small\item\em Empty constructor with a parent. \end{DoxyCompactList}\item +{\bf QuaGzipFile} (const QString \&fileName, QObject $\ast$parent=NULL) +\begin{DoxyCompactList}\small\item\em Constructor. \end{DoxyCompactList}\item +virtual {\bf $\sim$QuaGzipFile} ()\label{classQuaGzipFile_a1200bc76f36bb2e1991e1e0467befbf2} + +\begin{DoxyCompactList}\small\item\em Destructor. \end{DoxyCompactList}\item +void {\bf setFileName} (const QString \&fileName)\label{classQuaGzipFile_a253fbaf410a3d4ae0a719505c5525149} + +\begin{DoxyCompactList}\small\item\em Sets the name of the GZIP file to be opened. \end{DoxyCompactList}\item +QString {\bf getFileName} () const \label{classQuaGzipFile_a9a0954a1db1fcf2aeba0530239bce71c} + +\begin{DoxyCompactList}\small\item\em Returns the name of the GZIP file. \end{DoxyCompactList}\item +virtual bool {\bf isSequential} () const +\begin{DoxyCompactList}\small\item\em Returns true. \end{DoxyCompactList}\item +virtual bool {\bf open} (QIODevice::OpenMode mode) +\begin{DoxyCompactList}\small\item\em Opens the file. \end{DoxyCompactList}\item +virtual bool {\bf open} (int fd, QIODevice::OpenMode mode) +\begin{DoxyCompactList}\small\item\em Opens the file. \end{DoxyCompactList}\item +virtual bool {\bf flush} () +\begin{DoxyCompactList}\small\item\em Flushes data to file. \end{DoxyCompactList}\item +virtual void {\bf close} ()\label{classQuaGzipFile_a273205350b1235a242a1eb5cbf586434} + +\begin{DoxyCompactList}\small\item\em Closes the file. \end{DoxyCompactList}\end{DoxyCompactItemize} +\subsection*{Protected Member Functions} +\begin{DoxyCompactItemize} +\item +virtual qint64 {\bf readData} (char $\ast$data, qint64 maxSize)\label{classQuaGzipFile_a9eab41b46367e63e0c269c42ca883d82} + +\begin{DoxyCompactList}\small\item\em Implementation of QIODevice::readData(). \end{DoxyCompactList}\item +virtual qint64 {\bf writeData} (const char $\ast$data, qint64 maxSize)\label{classQuaGzipFile_a6dd09d41d8a51c96b0f2134eff37f676} + +\begin{DoxyCompactList}\small\item\em Implementation of QIODevice::writeData(). \end{DoxyCompactList}\end{DoxyCompactItemize} + + +\subsection{Detailed Description} +GZIP file. + +This class is a wrapper around GZIP file access functions in zlib. Unlike \doxyref{QuaZip}{p.}{classQuaZip} classes, it doesn't allow reading from a GZIP file opened as QIODevice, for example, if your GZIP file is in QBuffer. It only provides QIODevice access to a GZIP file contents, but the GZIP file itself must be identified by its name on disk or by descriptor id. + +\subsection{Constructor \& Destructor Documentation} +\index{QuaGzipFile@{QuaGzipFile}!QuaGzipFile@{QuaGzipFile}} +\index{QuaGzipFile@{QuaGzipFile}!QuaGzipFile@{QuaGzipFile}} +\subsubsection[{QuaGzipFile}]{\setlength{\rightskip}{0pt plus 5cm}QuaGzipFile::QuaGzipFile ( +\begin{DoxyParamCaption} +{} +\end{DoxyParamCaption} +)}\label{classQuaGzipFile_a709608207b41ca81d5beed2b34982809} + + +Empty constructor. + +Must call \doxyref{setFileName()}{p.}{classQuaGzipFile_a253fbaf410a3d4ae0a719505c5525149} before trying to open. \index{QuaGzipFile@{QuaGzipFile}!QuaGzipFile@{QuaGzipFile}} +\index{QuaGzipFile@{QuaGzipFile}!QuaGzipFile@{QuaGzipFile}} +\subsubsection[{QuaGzipFile}]{\setlength{\rightskip}{0pt plus 5cm}QuaGzipFile::QuaGzipFile ( +\begin{DoxyParamCaption} +\item[{QObject $\ast$}]{parent} +\end{DoxyParamCaption} +)}\label{classQuaGzipFile_a13996f5db660c4a29645f8d208b9ca6b} + + +Empty constructor with a parent. + +Must call \doxyref{setFileName()}{p.}{classQuaGzipFile_a253fbaf410a3d4ae0a719505c5525149} before trying to open. +\begin{DoxyParams}{Parameters} +{\em parent} & The parent object, as per QObject logic. \\ +\hline +\end{DoxyParams} +\index{QuaGzipFile@{QuaGzipFile}!QuaGzipFile@{QuaGzipFile}} +\index{QuaGzipFile@{QuaGzipFile}!QuaGzipFile@{QuaGzipFile}} +\subsubsection[{QuaGzipFile}]{\setlength{\rightskip}{0pt plus 5cm}QuaGzipFile::QuaGzipFile ( +\begin{DoxyParamCaption} +\item[{const QString \&}]{fileName, } +\item[{QObject $\ast$}]{parent = {\ttfamily NULL}} +\end{DoxyParamCaption} +)}\label{classQuaGzipFile_ac7f7703bda9c6169c001aa15641bb2ea} + + +Constructor. + + +\begin{DoxyParams}{Parameters} +{\em fileName} & The name of the GZIP file. \\ +\hline +{\em parent} & The parent object, as per QObject logic. \\ +\hline +\end{DoxyParams} + + +\subsection{Member Function Documentation} +\index{QuaGzipFile@{QuaGzipFile}!isSequential@{isSequential}} +\index{isSequential@{isSequential}!QuaGzipFile@{QuaGzipFile}} +\subsubsection[{isSequential}]{\setlength{\rightskip}{0pt plus 5cm}bool QuaGzipFile::isSequential ( +\begin{DoxyParamCaption} +{} +\end{DoxyParamCaption} +) const\hspace{0.3cm}{\ttfamily [virtual]}}\label{classQuaGzipFile_ae97f4e15d86c965c156df33d00318176} + + +Returns true. + +Strictly speaking, zlib supports seeking for GZIP files, but it is poorly implemented, because there is no way to implement it properly. For reading, seeking backwards is very slow, and for writing, it is downright impossible. Therefore, \doxyref{QuaGzipFile}{p.}{classQuaGzipFile} does not support seeking at all. \index{QuaGzipFile@{QuaGzipFile}!open@{open}} +\index{open@{open}!QuaGzipFile@{QuaGzipFile}} +\subsubsection[{open}]{\setlength{\rightskip}{0pt plus 5cm}bool QuaGzipFile::open ( +\begin{DoxyParamCaption} +\item[{QIODevice::OpenMode}]{mode} +\end{DoxyParamCaption} +)\hspace{0.3cm}{\ttfamily [virtual]}}\label{classQuaGzipFile_a1d560babdfff3a3441d704099a5bc1e4} + + +Opens the file. + + +\begin{DoxyParams}{Parameters} +{\em mode} & Can be either QIODevice::Write or QIODevice::Read. ReadWrite and Append aren't supported. \\ +\hline +\end{DoxyParams} + + +Referenced by open(). + +\index{QuaGzipFile@{QuaGzipFile}!open@{open}} +\index{open@{open}!QuaGzipFile@{QuaGzipFile}} +\subsubsection[{open}]{\setlength{\rightskip}{0pt plus 5cm}bool QuaGzipFile::open ( +\begin{DoxyParamCaption} +\item[{int}]{fd, } +\item[{QIODevice::OpenMode}]{mode} +\end{DoxyParamCaption} +)\hspace{0.3cm}{\ttfamily [virtual]}}\label{classQuaGzipFile_adf5a954bb9bfda2d33cd336a213e2549} + + +Opens the file. + +This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. +\begin{DoxyParams}{Parameters} +{\em fd} & The file descriptor to read/write the GZIP file from/to. \\ +\hline +{\em mode} & Can be either QIODevice::Write or QIODevice::Read. ReadWrite and Append aren't supported. \\ +\hline +\end{DoxyParams} + + +References open(). + +\index{QuaGzipFile@{QuaGzipFile}!flush@{flush}} +\index{flush@{flush}!QuaGzipFile@{QuaGzipFile}} +\subsubsection[{flush}]{\setlength{\rightskip}{0pt plus 5cm}bool QuaGzipFile::flush ( +\begin{DoxyParamCaption} +{} +\end{DoxyParamCaption} +)\hspace{0.3cm}{\ttfamily [virtual]}}\label{classQuaGzipFile_ab745f345b727c81abbc3eb5af4dca844} + + +Flushes data to file. + +The data is written using Z\_\-SYNC\_\-FLUSH mode. Doesn't make any sense when reading. + +The documentation for this class was generated from the following files:\begin{DoxyCompactItemize} +\item +quazip/quagzipfile.h\item +quazip/quagzipfile.cpp\end{DoxyCompactItemize} diff --git a/3rdparty/quazip-0.5.1/doc/latex/classQuaZIODevice.tex b/3rdparty/quazip-0.5.1/doc/latex/classQuaZIODevice.tex new file mode 100644 index 00000000..bb9518c8 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/latex/classQuaZIODevice.tex @@ -0,0 +1,136 @@ +\section{QuaZIODevice Class Reference} +\label{classQuaZIODevice}\index{QuaZIODevice@{QuaZIODevice}} + + +A class to compress/decompress QIODevice. + + + + +{\ttfamily \#include $<$quaziodevice.h$>$} + +\subsection*{Public Member Functions} +\begin{DoxyCompactItemize} +\item +{\bf QuaZIODevice} (QIODevice $\ast$io, QObject $\ast$parent=NULL) +\begin{DoxyCompactList}\small\item\em Constructor. \end{DoxyCompactList}\item +{\bf $\sim$QuaZIODevice} ()\label{classQuaZIODevice_ab3524cef44c240c21e6b7680ee5f42de} + +\begin{DoxyCompactList}\small\item\em Destructor. \end{DoxyCompactList}\item +virtual bool {\bf flush} () +\begin{DoxyCompactList}\small\item\em Flushes data waiting to be written. \end{DoxyCompactList}\item +virtual bool {\bf open} (QIODevice::OpenMode mode) +\begin{DoxyCompactList}\small\item\em Opens the device. \end{DoxyCompactList}\item +virtual void {\bf close} () +\begin{DoxyCompactList}\small\item\em Closes this device, but not the underlying one. \end{DoxyCompactList}\item +QIODevice $\ast$ {\bf getIoDevice} () const \label{classQuaZIODevice_ad63e7f1717c7d91b3c2c5ace908c98b7} + +\begin{DoxyCompactList}\small\item\em Returns the underlying device. \end{DoxyCompactList}\item +virtual bool {\bf isSequential} () const \label{classQuaZIODevice_af2697f58c228741d3715801bf48a9a8b} + +\begin{DoxyCompactList}\small\item\em Returns true. \end{DoxyCompactList}\end{DoxyCompactItemize} +\subsection*{Protected Member Functions} +\begin{DoxyCompactItemize} +\item +virtual qint64 {\bf readData} (char $\ast$data, qint64 maxSize)\label{classQuaZIODevice_aa12b8bc9c923e543eda9ae22dbd1ecbb} + +\begin{DoxyCompactList}\small\item\em Implementation of QIODevice::readData(). \end{DoxyCompactList}\item +virtual qint64 {\bf writeData} (const char $\ast$data, qint64 maxSize)\label{classQuaZIODevice_aab23b6badbc3548eb71ca86bf6211902} + +\begin{DoxyCompactList}\small\item\em Implementation of QIODevice::writeData(). \end{DoxyCompactList}\end{DoxyCompactItemize} + + +\subsection{Detailed Description} +A class to compress/decompress QIODevice. + +This class can be used to compress any data written to QIODevice or decompress it back. Compressing data sent over a QTcpSocket is a good example. + +\subsection{Constructor \& Destructor Documentation} +\index{QuaZIODevice@{QuaZIODevice}!QuaZIODevice@{QuaZIODevice}} +\index{QuaZIODevice@{QuaZIODevice}!QuaZIODevice@{QuaZIODevice}} +\subsubsection[{QuaZIODevice}]{\setlength{\rightskip}{0pt plus 5cm}QuaZIODevice::QuaZIODevice ( +\begin{DoxyParamCaption} +\item[{QIODevice $\ast$}]{io, } +\item[{QObject $\ast$}]{parent = {\ttfamily NULL}} +\end{DoxyParamCaption} +)}\label{classQuaZIODevice_a8321ed35ee9b57cf9b1104912e236361} + + +Constructor. + + +\begin{DoxyParams}{Parameters} +{\em io} & The QIODevice to read/write. \\ +\hline +{\em parent} & The parent object, as per QObject logic. \\ +\hline +\end{DoxyParams} + + +\subsection{Member Function Documentation} +\index{QuaZIODevice@{QuaZIODevice}!flush@{flush}} +\index{flush@{flush}!QuaZIODevice@{QuaZIODevice}} +\subsubsection[{flush}]{\setlength{\rightskip}{0pt plus 5cm}bool QuaZIODevice::flush ( +\begin{DoxyParamCaption} +{} +\end{DoxyParamCaption} +)\hspace{0.3cm}{\ttfamily [virtual]}}\label{classQuaZIODevice_a25f586eb564841b51c395fd17f1cc080} + + +Flushes data waiting to be written. + +Unfortunately, as QIODevice doesn't support \doxyref{flush()}{p.}{classQuaZIODevice_a25f586eb564841b51c395fd17f1cc080} by itself, the only thing this method does is write the compressed data into the device using Z\_\-SYNC\_\-FLUSH mode. If you need the compressed data to actually be flushed from the buffer of the underlying QIODevice, you need to call its \doxyref{flush()}{p.}{classQuaZIODevice_a25f586eb564841b51c395fd17f1cc080} method as well, providing it supports it (like QTcpSocket does). Example: +\begin{DoxyCode} + QuaZIODevice dev(&sock); + dev.open(QIODevice::Write); + dev.write(yourDataGoesHere); + dev.flush(); + sock->flush(); // this actually sends data to network +\end{DoxyCode} + + +This may change in the future versions of QuaZIP by implementing an ugly hack: trying to cast the QIODevice using qobject\_\-cast to known \doxyref{flush()}{p.}{classQuaZIODevice_a25f586eb564841b51c395fd17f1cc080}-\/supporting subclasses, and calling flush if the resulting pointer is not zero. + +Referenced by close(). + +\index{QuaZIODevice@{QuaZIODevice}!open@{open}} +\index{open@{open}!QuaZIODevice@{QuaZIODevice}} +\subsubsection[{open}]{\setlength{\rightskip}{0pt plus 5cm}bool QuaZIODevice::open ( +\begin{DoxyParamCaption} +\item[{QIODevice::OpenMode}]{mode} +\end{DoxyParamCaption} +)\hspace{0.3cm}{\ttfamily [virtual]}}\label{classQuaZIODevice_a175446c18eb20c9aff6faf23f09cc67a} + + +Opens the device. + + +\begin{DoxyParams}{Parameters} +{\em mode} & Neither QIODevice::ReadWrite nor QIODevice::Append are not supported. \\ +\hline +\end{DoxyParams} +\index{QuaZIODevice@{QuaZIODevice}!close@{close}} +\index{close@{close}!QuaZIODevice@{QuaZIODevice}} +\subsubsection[{close}]{\setlength{\rightskip}{0pt plus 5cm}void QuaZIODevice::close ( +\begin{DoxyParamCaption} +{} +\end{DoxyParamCaption} +)\hspace{0.3cm}{\ttfamily [virtual]}}\label{classQuaZIODevice_ad27e447544d57f897316ee6f44535895} + + +Closes this device, but not the underlying one. + +The underlying QIODevice is not closed in case you want to write something else to it. + +References flush(). + + + +Referenced by $\sim$QuaZIODevice(). + + + +The documentation for this class was generated from the following files:\begin{DoxyCompactItemize} +\item +quazip/quaziodevice.h\item +quazip/quaziodevice.cpp\end{DoxyCompactItemize} diff --git a/3rdparty/quazip-0.5.1/doc/latex/classQuaZip.tex b/3rdparty/quazip-0.5.1/doc/latex/classQuaZip.tex new file mode 100644 index 00000000..4db7611b --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/latex/classQuaZip.tex @@ -0,0 +1,762 @@ +\section{QuaZip Class Reference} +\label{classQuaZip}\index{QuaZip@{QuaZip}} + + +ZIP archive. + + + + +{\ttfamily \#include $<$quazip/quazip.h$>$} + + + +Collaboration diagram for QuaZip: +\nopagebreak +\begin{figure}[H] +\begin{center} +\leavevmode +\includegraphics[width=120pt]{classQuaZip__coll__graph} +\end{center} +\end{figure} +\subsection*{Public Types} +\begin{DoxyCompactItemize} +\item +enum {\bf Constants} \{ {\bf MAX\_\-FILE\_\-NAME\_\-LENGTH} = 256 + \} +\begin{DoxyCompactList}\small\item\em Useful constants. \end{DoxyCompactList}\item +enum {\bf Mode} \{ \par +{\bf mdNotOpen}, +{\bf mdUnzip}, +{\bf mdCreate}, +{\bf mdAppend}, +\par +{\bf mdAdd} + \} +\begin{DoxyCompactList}\small\item\em Open mode of the ZIP file. \end{DoxyCompactList}\item +enum {\bf CaseSensitivity} \{ {\bf csDefault} = 0, +{\bf csSensitive} = 1, +{\bf csInsensitive} = 2 + \} +\begin{DoxyCompactList}\small\item\em Case sensitivity for the file names. \end{DoxyCompactList}\end{DoxyCompactItemize} +\subsection*{Public Member Functions} +\begin{DoxyCompactItemize} +\item +{\bf QuaZip} () +\begin{DoxyCompactList}\small\item\em Constructs \doxyref{QuaZip}{p.}{classQuaZip} object. \end{DoxyCompactList}\item +{\bf QuaZip} (const QString \&zipName)\label{classQuaZip_aaea7294b02abd22379cc3a9fccb754b7} + +\begin{DoxyCompactList}\small\item\em Constructs \doxyref{QuaZip}{p.}{classQuaZip} object associated with ZIP file {\itshape zipName\/}. \end{DoxyCompactList}\item +{\bf QuaZip} (QIODevice $\ast$ioDevice) +\begin{DoxyCompactList}\small\item\em Constructs \doxyref{QuaZip}{p.}{classQuaZip} object associated with ZIP file represented by {\itshape ioDevice\/}. \end{DoxyCompactList}\item +{\bf $\sim$QuaZip} () +\begin{DoxyCompactList}\small\item\em Destroys \doxyref{QuaZip}{p.}{classQuaZip} object. \end{DoxyCompactList}\item +bool {\bf open} ({\bf Mode} mode, zlib\_\-filefunc\_\-def $\ast$ioApi=NULL) +\begin{DoxyCompactList}\small\item\em Opens ZIP file. \end{DoxyCompactList}\item +void {\bf close} () +\begin{DoxyCompactList}\small\item\em Closes ZIP file. \end{DoxyCompactList}\item +void {\bf setFileNameCodec} (QTextCodec $\ast$fileNameCodec) +\begin{DoxyCompactList}\small\item\em Sets the codec used to encode/decode file names inside archive. \end{DoxyCompactList}\item +void {\bf setFileNameCodec} (const char $\ast$fileNameCodecName) +\begin{DoxyCompactList}\small\item\em Sets the codec used to encode/decode file names inside archive. \end{DoxyCompactList}\item +QTextCodec $\ast$ {\bf getFileNameCodec} () const \label{classQuaZip_a27b866aa2c75ea6f9c438cbb6e32b43c} + +\begin{DoxyCompactList}\small\item\em Returns the codec used to encode/decode comments inside archive. \end{DoxyCompactList}\item +void {\bf setCommentCodec} (QTextCodec $\ast$commentCodec) +\begin{DoxyCompactList}\small\item\em Sets the codec used to encode/decode comments inside archive. \end{DoxyCompactList}\item +void {\bf setCommentCodec} (const char $\ast$commentCodecName) +\begin{DoxyCompactList}\small\item\em Sets the codec used to encode/decode comments inside archive. \end{DoxyCompactList}\item +QTextCodec $\ast$ {\bf getCommentCodec} () const \label{classQuaZip_a008260161781d8b5d2a0a28493fddaf4} + +\begin{DoxyCompactList}\small\item\em Returns the codec used to encode/decode comments inside archive. \end{DoxyCompactList}\item +QString {\bf getZipName} () const +\begin{DoxyCompactList}\small\item\em Returns the name of the ZIP file. \end{DoxyCompactList}\item +void {\bf setZipName} (const QString \&zipName) +\begin{DoxyCompactList}\small\item\em Sets the name of the ZIP file. \end{DoxyCompactList}\item +QIODevice $\ast$ {\bf getIoDevice} () const +\begin{DoxyCompactList}\small\item\em Returns the device representing this ZIP file. \end{DoxyCompactList}\item +void {\bf setIoDevice} (QIODevice $\ast$ioDevice) +\begin{DoxyCompactList}\small\item\em Sets the device representing the ZIP file. \end{DoxyCompactList}\item +{\bf Mode} {\bf getMode} () const \label{classQuaZip_a129ceff04d28fb00531f7bf7f9329664} + +\begin{DoxyCompactList}\small\item\em Returns the mode in which ZIP file was opened. \end{DoxyCompactList}\item +bool {\bf isOpen} () const \label{classQuaZip_a5b869a9c0d4f49955b759592fec08888} + +\begin{DoxyCompactList}\small\item\em Returns {\ttfamily true} if ZIP file is open, {\ttfamily false} otherwise. \end{DoxyCompactList}\item +int {\bf getZipError} () const +\begin{DoxyCompactList}\small\item\em Returns the error code of the last operation. \end{DoxyCompactList}\item +int {\bf getEntriesCount} () const +\begin{DoxyCompactList}\small\item\em Returns number of the entries in the ZIP central directory. \end{DoxyCompactList}\item +QString {\bf getComment} () const \label{classQuaZip_ae55cfbf2296132df808c557b62433051} + +\begin{DoxyCompactList}\small\item\em Returns global comment in the ZIP file. \end{DoxyCompactList}\item +void {\bf setComment} (const QString \&comment) +\begin{DoxyCompactList}\small\item\em Sets the global comment in the ZIP file. \end{DoxyCompactList}\item +bool {\bf goToFirstFile} () +\begin{DoxyCompactList}\small\item\em Sets the current file to the first file in the archive. \end{DoxyCompactList}\item +bool {\bf goToNextFile} () +\begin{DoxyCompactList}\small\item\em Sets the current file to the next file in the archive. \end{DoxyCompactList}\item +bool {\bf setCurrentFile} (const QString \&fileName, {\bf CaseSensitivity} cs=csDefault) +\begin{DoxyCompactList}\small\item\em Sets current file by its name. \end{DoxyCompactList}\item +bool {\bf hasCurrentFile} () const \label{classQuaZip_a00b237d926648f45da86db25e7cfb697} + +\begin{DoxyCompactList}\small\item\em Returns {\ttfamily true} if the current file has been set. \end{DoxyCompactList}\item +bool {\bf getCurrentFileInfo} ({\bf QuaZipFileInfo} $\ast$info) const +\begin{DoxyCompactList}\small\item\em Retrieves information about the current file. \end{DoxyCompactList}\item +QString {\bf getCurrentFileName} () const +\begin{DoxyCompactList}\small\item\em Returns the current file name. \end{DoxyCompactList}\item +unzFile {\bf getUnzFile} () +\begin{DoxyCompactList}\small\item\em Returns {\ttfamily unzFile} handle. \end{DoxyCompactList}\item +zipFile {\bf getZipFile} () +\begin{DoxyCompactList}\small\item\em Returns {\ttfamily zipFile} handle. \end{DoxyCompactList}\item +void {\bf setDataDescriptorWritingEnabled} (bool enabled) +\begin{DoxyCompactList}\small\item\em Changes the data descriptor writing mode. \end{DoxyCompactList}\item +bool {\bf isDataDescriptorWritingEnabled} () const +\begin{DoxyCompactList}\small\item\em Returns the data descriptor default writing mode. \end{DoxyCompactList}\item +QStringList {\bf getFileNameList} () const +\begin{DoxyCompactList}\small\item\em Returns a list of files inside the archive. \end{DoxyCompactList}\item +QList$<$ {\bf QuaZipFileInfo} $>$ {\bf getFileInfoList} () const +\begin{DoxyCompactList}\small\item\em Returns information list about all files inside the archive. \end{DoxyCompactList}\end{DoxyCompactItemize} +\subsection*{Static Public Member Functions} +\begin{DoxyCompactItemize} +\item +static Qt::CaseSensitivity {\bf convertCaseSensitivity} ({\bf CaseSensitivity} cs) +\begin{DoxyCompactList}\small\item\em Returns the actual case sensitivity for the specified QuaZIP one. \end{DoxyCompactList}\end{DoxyCompactItemize} +\subsection*{Friends} +\begin{DoxyCompactItemize} +\item +class {\bf QuaZipPrivate}\label{classQuaZip_a5d400b33a69412e9d419a484aaf476cd} + +\end{DoxyCompactItemize} + + +\subsection{Detailed Description} +ZIP archive. + +This class implements basic interface to the ZIP archive. It can be used to read table contents of the ZIP archive and retreiving information about the files inside it. + +You can also use this class to open files inside archive by passing pointer to the instance of this class to the constructor of the \doxyref{QuaZipFile}{p.}{classQuaZipFile} class. But see \doxyref{QuaZipFile::QuaZipFile(QuaZip$\ast$, QObject$\ast$)}{p.}{classQuaZipFile_a54e944a6b3d27030f64c8f30d2cc33bb} for the possible pitfalls. + +This class is indended to provide interface to the ZIP subpackage of the ZIP/UNZIP package as well as to the UNZIP subpackage. But currently it supports only UNZIP. + +The use of this class is simple -\/ just create instance using constructor, then set ZIP archive file name using setFile() function (if you did not passed the name to the constructor), then \doxyref{open()}{p.}{classQuaZip_abfa4e6018b2964a3d10a4c54e5ab3962} and then use different functions to work with it! Well, if you are paranoid, you may also wish to call close before destructing the instance, to check for errors on close. + +You may also use \doxyref{getUnzFile()}{p.}{classQuaZip_a3b78a652f296ff4a678a791e8294e642} and \doxyref{getZipFile()}{p.}{classQuaZip_a425043a4d7cc31e2fe2bba73d954f15c} functions to get the ZIP archive handle and use it with ZIP/UNZIP package API directly. + +This class supports localized file names inside ZIP archive, but you have to set up proper codec with setCodec() function. By default, locale codec will be used, which is probably ok for UNIX systems, but will almost certainly fail with ZIP archives created in Windows. This is because Windows ZIP programs have strange habit of using DOS encoding for file names in ZIP archives. For example, ZIP archive with cyrillic names created in Windows will have file names in {\ttfamily IBM866} encoding instead of {\ttfamily WINDOWS-\/1251}. I think that calling one function is not much trouble, but for true platform independency it would be nice to have some mechanism for file name encoding auto detection using locale information. Does anyone know a good way to do it? + +\subsection{Member Enumeration Documentation} +\index{QuaZip@{QuaZip}!Constants@{Constants}} +\index{Constants@{Constants}!QuaZip@{QuaZip}} +\subsubsection[{Constants}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf QuaZip::Constants}}\label{classQuaZip_adce46b942c341dbb5c851eadead65459} + + +Useful constants. + +\begin{Desc} +\item[Enumerator: ]\par +\begin{description} +\index{MAX\_\-FILE\_\-NAME\_\-LENGTH@{MAX\_\-FILE\_\-NAME\_\-LENGTH}!QuaZip@{QuaZip}}\index{QuaZip@{QuaZip}!MAX\_\-FILE\_\-NAME\_\-LENGTH@{MAX\_\-FILE\_\-NAME\_\-LENGTH}}\item[{\em +MAX\_\-FILE\_\-NAME\_\-LENGTH\label{classQuaZip_adce46b942c341dbb5c851eadead65459ab26ce1a9c9e94f901dc2cf90fa5baa4b} +}]Maximum file name length. Taken from {\ttfamily UNZ\_\-MAXFILENAMEINZIP} constant in unzip.c. \end{description} +\end{Desc} + +\index{QuaZip@{QuaZip}!Mode@{Mode}} +\index{Mode@{Mode}!QuaZip@{QuaZip}} +\subsubsection[{Mode}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf QuaZip::Mode}}\label{classQuaZip_a47e28d4116ee716fdd6b431b821d0be4} + + +Open mode of the ZIP file. + +\begin{Desc} +\item[Enumerator: ]\par +\begin{description} +\index{mdNotOpen@{mdNotOpen}!QuaZip@{QuaZip}}\index{QuaZip@{QuaZip}!mdNotOpen@{mdNotOpen}}\item[{\em +mdNotOpen\label{classQuaZip_a47e28d4116ee716fdd6b431b821d0be4ac87ddb1e901e1ec700c16ee0d4d398ce} +}]ZIP file is not open. This is the initial mode. \index{mdUnzip@{mdUnzip}!QuaZip@{QuaZip}}\index{QuaZip@{QuaZip}!mdUnzip@{mdUnzip}}\item[{\em +mdUnzip\label{classQuaZip_a47e28d4116ee716fdd6b431b821d0be4a803a371910c2dc830d111e9ce5b58897} +}]ZIP file is open for reading files inside it. \index{mdCreate@{mdCreate}!QuaZip@{QuaZip}}\index{QuaZip@{QuaZip}!mdCreate@{mdCreate}}\item[{\em +mdCreate\label{classQuaZip_a47e28d4116ee716fdd6b431b821d0be4a25ae05b12590540af8c66ae8298b928e} +}]ZIP file was created with \doxyref{open()}{p.}{classQuaZip_abfa4e6018b2964a3d10a4c54e5ab3962} call. \index{mdAppend@{mdAppend}!QuaZip@{QuaZip}}\index{QuaZip@{QuaZip}!mdAppend@{mdAppend}}\item[{\em +mdAppend\label{classQuaZip_a47e28d4116ee716fdd6b431b821d0be4ab807f0c65653a16d77b365801fd25582} +}]ZIP file was opened in append mode. This refers to {\ttfamily APPEND\_\-STATUS\_\-CREATEAFTER} mode in ZIP/UNZIP package and means that zip is appended to some existing file what is useful when that file contains self-\/extractor code. This is obviously {\itshape not\/} what you whant to use to add files to the existing ZIP archive. \index{mdAdd@{mdAdd}!QuaZip@{QuaZip}}\index{QuaZip@{QuaZip}!mdAdd@{mdAdd}}\item[{\em +mdAdd\label{classQuaZip_a47e28d4116ee716fdd6b431b821d0be4a22c745f349f06add449af523254fdaec} +}]ZIP file was opened for adding files in the archive. \end{description} +\end{Desc} + +\index{QuaZip@{QuaZip}!CaseSensitivity@{CaseSensitivity}} +\index{CaseSensitivity@{CaseSensitivity}!QuaZip@{QuaZip}} +\subsubsection[{CaseSensitivity}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf QuaZip::CaseSensitivity}}\label{classQuaZip_a6053a1d249ed210a85c9d5eb7cf9cdbe} + + +Case sensitivity for the file names. + +This is what you specify when accessing files in the archive. Works perfectly fine with any characters thanks to Qt's great unicode support. This is different from ZIP/UNZIP API, where only US-\/ASCII characters was supported. \begin{Desc} +\item[Enumerator: ]\par +\begin{description} +\index{csDefault@{csDefault}!QuaZip@{QuaZip}}\index{QuaZip@{QuaZip}!csDefault@{csDefault}}\item[{\em +csDefault\label{classQuaZip_a6053a1d249ed210a85c9d5eb7cf9cdbeac3cca8c0b976cf6397a28a5c84e75253} +}]Default for platform. Case sensitive for UNIX, not for Windows. \index{csSensitive@{csSensitive}!QuaZip@{QuaZip}}\index{QuaZip@{QuaZip}!csSensitive@{csSensitive}}\item[{\em +csSensitive\label{classQuaZip_a6053a1d249ed210a85c9d5eb7cf9cdbead8d86b0c34203336cad09348cfa5356e} +}]Case sensitive. \index{csInsensitive@{csInsensitive}!QuaZip@{QuaZip}}\index{QuaZip@{QuaZip}!csInsensitive@{csInsensitive}}\item[{\em +csInsensitive\label{classQuaZip_a6053a1d249ed210a85c9d5eb7cf9cdbea3e492bcc3f64f41a74906cecc45fb366} +}]Case insensitive. \end{description} +\end{Desc} + + + +\subsection{Constructor \& Destructor Documentation} +\index{QuaZip@{QuaZip}!QuaZip@{QuaZip}} +\index{QuaZip@{QuaZip}!QuaZip@{QuaZip}} +\subsubsection[{QuaZip}]{\setlength{\rightskip}{0pt plus 5cm}QuaZip::QuaZip ( +\begin{DoxyParamCaption} +{} +\end{DoxyParamCaption} +)}\label{classQuaZip_a970e0f401c7cfd7a78e78572f758eec4} + + +Constructs \doxyref{QuaZip}{p.}{classQuaZip} object. + +Call setName() before opening constructed object. \index{QuaZip@{QuaZip}!QuaZip@{QuaZip}} +\index{QuaZip@{QuaZip}!QuaZip@{QuaZip}} +\subsubsection[{QuaZip}]{\setlength{\rightskip}{0pt plus 5cm}QuaZip::QuaZip ( +\begin{DoxyParamCaption} +\item[{QIODevice $\ast$}]{ioDevice} +\end{DoxyParamCaption} +)}\label{classQuaZip_ae52ebadd5ce64cdb49d7e198904b0b8c} + + +Constructs \doxyref{QuaZip}{p.}{classQuaZip} object associated with ZIP file represented by {\itshape ioDevice\/}. + +The IO device must be seekable, otherwise an error will occur when opening. \index{QuaZip@{QuaZip}!$\sim$QuaZip@{$\sim$QuaZip}} +\index{$\sim$QuaZip@{$\sim$QuaZip}!QuaZip@{QuaZip}} +\subsubsection[{$\sim$QuaZip}]{\setlength{\rightskip}{0pt plus 5cm}QuaZip::$\sim$QuaZip ( +\begin{DoxyParamCaption} +{} +\end{DoxyParamCaption} +)}\label{classQuaZip_af60a2d3930b90f3b25a3148baecad81e} + + +Destroys \doxyref{QuaZip}{p.}{classQuaZip} object. + +Calls \doxyref{close()}{p.}{classQuaZip_a7a4323b73e12f3b4470109f200728f9f} if necessary. + +References close(), and isOpen(). + + + +\subsection{Member Function Documentation} +\index{QuaZip@{QuaZip}!convertCaseSensitivity@{convertCaseSensitivity}} +\index{convertCaseSensitivity@{convertCaseSensitivity}!QuaZip@{QuaZip}} +\subsubsection[{convertCaseSensitivity}]{\setlength{\rightskip}{0pt plus 5cm}Qt::CaseSensitivity QuaZip::convertCaseSensitivity ( +\begin{DoxyParamCaption} +\item[{{\bf QuaZip::CaseSensitivity}}]{cs} +\end{DoxyParamCaption} +)\hspace{0.3cm}{\ttfamily [static]}}\label{classQuaZip_a1d3fbd445a8e9d3449ded7371931c6b3} + + +Returns the actual case sensitivity for the specified QuaZIP one. + + +\begin{DoxyParams}{Parameters} +{\em cs} & The value to convert. \\ +\hline +\end{DoxyParams} +\begin{DoxyReturn}{Returns} +If CaseSensitivity::csDefault, then returns the default file name case sensitivity for the platform. Otherwise, just returns the appropriate value from the Qt::CaseSensitivity enum. +\end{DoxyReturn} + + +References csDefault, and csSensitive. + + + +Referenced by QuaZipDir::exists(), and setCurrentFile(). + +\index{QuaZip@{QuaZip}!open@{open}} +\index{open@{open}!QuaZip@{QuaZip}} +\subsubsection[{open}]{\setlength{\rightskip}{0pt plus 5cm}bool QuaZip::open ( +\begin{DoxyParamCaption} +\item[{{\bf Mode}}]{mode, } +\item[{zlib\_\-filefunc\_\-def $\ast$}]{ioApi = {\ttfamily NULL}} +\end{DoxyParamCaption} +)}\label{classQuaZip_abfa4e6018b2964a3d10a4c54e5ab3962} + + +Opens ZIP file. + +Argument {\itshape mode\/} specifies open mode of the ZIP archive. See Mode for details. Note that there is zipOpen2() function in the ZIP/UNZIP API which accepts {\itshape globalcomment\/} argument, but it does not use it anywhere, so this \doxyref{open()}{p.}{classQuaZip_abfa4e6018b2964a3d10a4c54e5ab3962} function does not have this argument. See \doxyref{setComment()}{p.}{classQuaZip_a1b5d936a203859340574d5908ffa2222} if you need to set global comment. + +If the ZIP file is accessed via explicitly set QIODevice, then this device is opened in the necessary mode. If the device was already opened by some other means, then the behaviour is defined by the device implementation, but generally it is not a very good idea. For example, QFile will at least issue a warning. + +\begin{DoxyReturn}{Returns} +{\ttfamily true} if successful, {\ttfamily false} otherwise. +\end{DoxyReturn} +\begin{DoxyNote}{Note} +ZIP/UNZIP API open calls do not return error code -\/ they just return {\ttfamily NULL} indicating an error. But to make things easier, \doxyref{quazip.h}{p.}{quazip_8h_source} header defines additional error code {\ttfamily UNZ\_\-ERROROPEN} and \doxyref{getZipError()}{p.}{classQuaZip_a28b91a6282ddd9382c96a069572c6fb4} will return it if the open call of the ZIP/UNZIP API returns {\ttfamily NULL}. +\end{DoxyNote} +Argument {\itshape ioApi\/} specifies IO function set for ZIP/UNZIP package to use. See unzip.h, zip.h and ioapi.h for details. Note that IO API for \doxyref{QuaZip}{p.}{classQuaZip} is different from the original package. The file path argument was changed to be of type {\ttfamily voidpf}, and \doxyref{QuaZip}{p.}{classQuaZip} passes a QIODevice pointer there. This QIODevice is either set explicitly via \doxyref{setIoDevice()}{p.}{classQuaZip_a64642948b6531ee54f5522f29e388cc6} or the \doxyref{QuaZip(QIODevice$\ast$)}{p.}{classQuaZip_ae52ebadd5ce64cdb49d7e198904b0b8c} constructor, or it is created internally when opening the archive by its file name. The default API (qioapi.cpp) just delegates everything to the QIODevice API. Not only this allows to use a QIODevice instead of file name, but also has a nice side effect of raising the file size limit from 2G to 4G. + +In short: just forget about the {\itshape ioApi\/} argument and you'll be fine. + +References isOpen(), mdAdd, mdAppend, mdCreate, mdUnzip, QuaZipPrivate::unzFile\_\-f, and QuaZipPrivate::zipFile\_\-f. + + + +Referenced by JlCompress::compressDir(), JlCompress::compressFile(), JlCompress::compressFiles(), JlCompress::extractDir(), JlCompress::extractFile(), JlCompress::extractFiles(), JlCompress::getFileList(), and QuaZipFile::open(). + +\index{QuaZip@{QuaZip}!close@{close}} +\index{close@{close}!QuaZip@{QuaZip}} +\subsubsection[{close}]{\setlength{\rightskip}{0pt plus 5cm}void QuaZip::close ( +\begin{DoxyParamCaption} +{} +\end{DoxyParamCaption} +)}\label{classQuaZip_a7a4323b73e12f3b4470109f200728f9f} + + +Closes ZIP file. + +Call \doxyref{getZipError()}{p.}{classQuaZip_a28b91a6282ddd9382c96a069572c6fb4} to determine if the close was successful. The underlying QIODevice is also closed, regardless of whether it was set explicitly or not. + +References mdAdd, mdAppend, mdCreate, mdNotOpen, mdUnzip, QuaZipPrivate::unzFile\_\-f, and QuaZipPrivate::zipFile\_\-f. + + + +Referenced by QuaZipFile::close(), JlCompress::compressDir(), JlCompress::compressFile(), JlCompress::compressFiles(), JlCompress::extractDir(), JlCompress::extractFile(), JlCompress::extractFiles(), JlCompress::getFileList(), QuaZipFile::open(), and $\sim$QuaZip(). + +\index{QuaZip@{QuaZip}!setFileNameCodec@{setFileNameCodec}} +\index{setFileNameCodec@{setFileNameCodec}!QuaZip@{QuaZip}} +\subsubsection[{setFileNameCodec}]{\setlength{\rightskip}{0pt plus 5cm}void QuaZip::setFileNameCodec ( +\begin{DoxyParamCaption} +\item[{QTextCodec $\ast$}]{fileNameCodec} +\end{DoxyParamCaption} +)}\label{classQuaZip_a339010b5566704ba3c9cafbfe848d8fb} + + +Sets the codec used to encode/decode file names inside archive. + +This is necessary to access files in the ZIP archive created under Windows with non-\/latin characters in file names. For example, file names with cyrillic letters will be in {\ttfamily IBM866} encoding. \index{QuaZip@{QuaZip}!setFileNameCodec@{setFileNameCodec}} +\index{setFileNameCodec@{setFileNameCodec}!QuaZip@{QuaZip}} +\subsubsection[{setFileNameCodec}]{\setlength{\rightskip}{0pt plus 5cm}void QuaZip::setFileNameCodec ( +\begin{DoxyParamCaption} +\item[{const char $\ast$}]{fileNameCodecName} +\end{DoxyParamCaption} +)}\label{classQuaZip_a8f283519a195aa1d9076bbbb01ea0497} + + +Sets the codec used to encode/decode file names inside archive. + +This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Equivalent to calling setFileNameCodec(QTextCodec::codecForName(codecName)); \index{QuaZip@{QuaZip}!setCommentCodec@{setCommentCodec}} +\index{setCommentCodec@{setCommentCodec}!QuaZip@{QuaZip}} +\subsubsection[{setCommentCodec}]{\setlength{\rightskip}{0pt plus 5cm}void QuaZip::setCommentCodec ( +\begin{DoxyParamCaption} +\item[{QTextCodec $\ast$}]{commentCodec} +\end{DoxyParamCaption} +)}\label{classQuaZip_a1c81fca7215a4374f6f03872ade4885b} + + +Sets the codec used to encode/decode comments inside archive. + +This codec defaults to locale codec, which is probably ok. \index{QuaZip@{QuaZip}!setCommentCodec@{setCommentCodec}} +\index{setCommentCodec@{setCommentCodec}!QuaZip@{QuaZip}} +\subsubsection[{setCommentCodec}]{\setlength{\rightskip}{0pt plus 5cm}void QuaZip::setCommentCodec ( +\begin{DoxyParamCaption} +\item[{const char $\ast$}]{commentCodecName} +\end{DoxyParamCaption} +)}\label{classQuaZip_a413f3c56b54a9a47258d53802cb606e7} + + +Sets the codec used to encode/decode comments inside archive. + +This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Equivalent to calling setCommentCodec(QTextCodec::codecForName(codecName)); \index{QuaZip@{QuaZip}!getZipName@{getZipName}} +\index{getZipName@{getZipName}!QuaZip@{QuaZip}} +\subsubsection[{getZipName}]{\setlength{\rightskip}{0pt plus 5cm}QString QuaZip::getZipName ( +\begin{DoxyParamCaption} +{} +\end{DoxyParamCaption} +) const}\label{classQuaZip_a4f7deef08ff40aeb1a7a04bcd7f228c2} + + +Returns the name of the ZIP file. + +Returns null string if no ZIP file name has been set, for example when the \doxyref{QuaZip}{p.}{classQuaZip} instance is set up to use a QIODevice instead. \begin{DoxySeeAlso}{See also} +\doxyref{setZipName()}{p.}{classQuaZip_aa80b661de1262af905d1677dbcb008cc}, \doxyref{setIoDevice()}{p.}{classQuaZip_a64642948b6531ee54f5522f29e388cc6}, \doxyref{getIoDevice()}{p.}{classQuaZip_afd3ba12fe68748acbf8b7cc14a5a1c29} +\end{DoxySeeAlso} + + +Referenced by QuaZipFile::getZipName(). + +\index{QuaZip@{QuaZip}!setZipName@{setZipName}} +\index{setZipName@{setZipName}!QuaZip@{QuaZip}} +\subsubsection[{setZipName}]{\setlength{\rightskip}{0pt plus 5cm}void QuaZip::setZipName ( +\begin{DoxyParamCaption} +\item[{const QString \&}]{zipName} +\end{DoxyParamCaption} +)}\label{classQuaZip_aa80b661de1262af905d1677dbcb008cc} + + +Sets the name of the ZIP file. + +Does nothing if the ZIP file is open. + +Does not reset error code returned by \doxyref{getZipError()}{p.}{classQuaZip_a28b91a6282ddd9382c96a069572c6fb4}. \begin{DoxySeeAlso}{See also} +\doxyref{setIoDevice()}{p.}{classQuaZip_a64642948b6531ee54f5522f29e388cc6}, \doxyref{getIoDevice()}{p.}{classQuaZip_afd3ba12fe68748acbf8b7cc14a5a1c29}, \doxyref{getZipName()}{p.}{classQuaZip_a4f7deef08ff40aeb1a7a04bcd7f228c2} +\end{DoxySeeAlso} + + +References isOpen(). + +\index{QuaZip@{QuaZip}!getIoDevice@{getIoDevice}} +\index{getIoDevice@{getIoDevice}!QuaZip@{QuaZip}} +\subsubsection[{getIoDevice}]{\setlength{\rightskip}{0pt plus 5cm}QIODevice $\ast$ QuaZip::getIoDevice ( +\begin{DoxyParamCaption} +{} +\end{DoxyParamCaption} +) const}\label{classQuaZip_afd3ba12fe68748acbf8b7cc14a5a1c29} + + +Returns the device representing this ZIP file. + +Returns null string if no device has been set explicitly, for example when opening a ZIP file by name. \begin{DoxySeeAlso}{See also} +\doxyref{setIoDevice()}{p.}{classQuaZip_a64642948b6531ee54f5522f29e388cc6}, \doxyref{getZipName()}{p.}{classQuaZip_a4f7deef08ff40aeb1a7a04bcd7f228c2}, \doxyref{setZipName()}{p.}{classQuaZip_aa80b661de1262af905d1677dbcb008cc} +\end{DoxySeeAlso} +\index{QuaZip@{QuaZip}!setIoDevice@{setIoDevice}} +\index{setIoDevice@{setIoDevice}!QuaZip@{QuaZip}} +\subsubsection[{setIoDevice}]{\setlength{\rightskip}{0pt plus 5cm}void QuaZip::setIoDevice ( +\begin{DoxyParamCaption} +\item[{QIODevice $\ast$}]{ioDevice} +\end{DoxyParamCaption} +)}\label{classQuaZip_a64642948b6531ee54f5522f29e388cc6} + + +Sets the device representing the ZIP file. + +Does nothing if the ZIP file is open. + +Does not reset error code returned by \doxyref{getZipError()}{p.}{classQuaZip_a28b91a6282ddd9382c96a069572c6fb4}. \begin{DoxySeeAlso}{See also} +\doxyref{getIoDevice()}{p.}{classQuaZip_afd3ba12fe68748acbf8b7cc14a5a1c29}, \doxyref{getZipName()}{p.}{classQuaZip_a4f7deef08ff40aeb1a7a04bcd7f228c2}, \doxyref{setZipName()}{p.}{classQuaZip_aa80b661de1262af905d1677dbcb008cc} +\end{DoxySeeAlso} + + +References isOpen(). + +\index{QuaZip@{QuaZip}!getZipError@{getZipError}} +\index{getZipError@{getZipError}!QuaZip@{QuaZip}} +\subsubsection[{getZipError}]{\setlength{\rightskip}{0pt plus 5cm}int QuaZip::getZipError ( +\begin{DoxyParamCaption} +{} +\end{DoxyParamCaption} +) const}\label{classQuaZip_a28b91a6282ddd9382c96a069572c6fb4} + + +Returns the error code of the last operation. + +Returns {\ttfamily UNZ\_\-OK} if the last operation was successful. + +Error code resets to {\ttfamily UNZ\_\-OK} every time you call any function that accesses something inside ZIP archive, even if it is {\ttfamily const} (like \doxyref{getEntriesCount()}{p.}{classQuaZip_a2ea4bd1fca948637c35c2d2752bb5a80}). \doxyref{open()}{p.}{classQuaZip_abfa4e6018b2964a3d10a4c54e5ab3962} and \doxyref{close()}{p.}{classQuaZip_a7a4323b73e12f3b4470109f200728f9f} calls reset error code too. See documentation for the specific functions for details on error detection. + +Referenced by QuaZipFile::close(), JlCompress::compressDir(), JlCompress::compressFile(), JlCompress::compressFiles(), JlCompress::extractDir(), JlCompress::extractFile(), JlCompress::extractFiles(), QuaZipFile::getActualFileName(), QuaZipFile::getFileInfo(), JlCompress::getFileList(), and QuaZipFile::open(). + +\index{QuaZip@{QuaZip}!getEntriesCount@{getEntriesCount}} +\index{getEntriesCount@{getEntriesCount}!QuaZip@{QuaZip}} +\subsubsection[{getEntriesCount}]{\setlength{\rightskip}{0pt plus 5cm}int QuaZip::getEntriesCount ( +\begin{DoxyParamCaption} +{} +\end{DoxyParamCaption} +) const}\label{classQuaZip_a2ea4bd1fca948637c35c2d2752bb5a80} + + +Returns number of the entries in the ZIP central directory. + +Returns negative error code in the case of error. The same error code will be returned by subsequent \doxyref{getZipError()}{p.}{classQuaZip_a28b91a6282ddd9382c96a069572c6fb4} call. + +References mdUnzip, and QuaZipPrivate::unzFile\_\-f. + +\index{QuaZip@{QuaZip}!setComment@{setComment}} +\index{setComment@{setComment}!QuaZip@{QuaZip}} +\subsubsection[{setComment}]{\setlength{\rightskip}{0pt plus 5cm}void QuaZip::setComment ( +\begin{DoxyParamCaption} +\item[{const QString \&}]{comment} +\end{DoxyParamCaption} +)}\label{classQuaZip_a1b5d936a203859340574d5908ffa2222} + + +Sets the global comment in the ZIP file. + +The comment will be written to the archive on close operation. \doxyref{QuaZip}{p.}{classQuaZip} makes a distinction between a null QByteArray() comment and an empty "" comment in the \doxyref{QuaZip::mdAdd}{p.}{classQuaZip_a47e28d4116ee716fdd6b431b821d0be4a22c745f349f06add449af523254fdaec} mode. A null comment is the default and it means "don't change the comment". An empty comment removes the original comment. + +\begin{DoxySeeAlso}{See also} +\doxyref{open()}{p.}{classQuaZip_abfa4e6018b2964a3d10a4c54e5ab3962} +\end{DoxySeeAlso} +\index{QuaZip@{QuaZip}!goToFirstFile@{goToFirstFile}} +\index{goToFirstFile@{goToFirstFile}!QuaZip@{QuaZip}} +\subsubsection[{goToFirstFile}]{\setlength{\rightskip}{0pt plus 5cm}bool QuaZip::goToFirstFile ( +\begin{DoxyParamCaption} +{} +\end{DoxyParamCaption} +)}\label{classQuaZip_a745488f9177bcec3cdb858587584e033} + + +Sets the current file to the first file in the archive. + +Returns {\ttfamily true} on success, {\ttfamily false} otherwise. Call \doxyref{getZipError()}{p.}{classQuaZip_a28b91a6282ddd9382c96a069572c6fb4} to get the error code. + +References mdUnzip, and QuaZipPrivate::unzFile\_\-f. + + + +Referenced by JlCompress::extractDir(), JlCompress::getFileList(), and setCurrentFile(). + +\index{QuaZip@{QuaZip}!goToNextFile@{goToNextFile}} +\index{goToNextFile@{goToNextFile}!QuaZip@{QuaZip}} +\subsubsection[{goToNextFile}]{\setlength{\rightskip}{0pt plus 5cm}bool QuaZip::goToNextFile ( +\begin{DoxyParamCaption} +{} +\end{DoxyParamCaption} +)}\label{classQuaZip_aee6779b6cd338420c2e8c5655fa8ba97} + + +Sets the current file to the next file in the archive. + +Returns {\ttfamily true} on success, {\ttfamily false} otherwise. Call \doxyref{getZipError()}{p.}{classQuaZip_a28b91a6282ddd9382c96a069572c6fb4} to determine if there was an error. + +Should be used only in \doxyref{QuaZip::mdUnzip}{p.}{classQuaZip_a47e28d4116ee716fdd6b431b821d0be4a803a371910c2dc830d111e9ce5b58897} mode. + +\begin{DoxyNote}{Note} +If the end of file was reached, \doxyref{getZipError()}{p.}{classQuaZip_a28b91a6282ddd9382c96a069572c6fb4} will return {\ttfamily UNZ\_\-OK} instead of {\ttfamily UNZ\_\-END\_\-OF\_\-LIST\_\-OF\_\-FILE}. This is to make things like this easier: +\begin{DoxyCode} + for(bool more=zip.goToFirstFile(); more; more=zip.goToNextFile()) { + // do something + } + if(zip.getZipError()==UNZ_OK) { + // ok, there was no error + } +\end{DoxyCode} + +\end{DoxyNote} + + +References mdUnzip, and QuaZipPrivate::unzFile\_\-f. + + + +Referenced by JlCompress::extractDir(), JlCompress::getFileList(), and setCurrentFile(). + +\index{QuaZip@{QuaZip}!setCurrentFile@{setCurrentFile}} +\index{setCurrentFile@{setCurrentFile}!QuaZip@{QuaZip}} +\subsubsection[{setCurrentFile}]{\setlength{\rightskip}{0pt plus 5cm}bool QuaZip::setCurrentFile ( +\begin{DoxyParamCaption} +\item[{const QString \&}]{fileName, } +\item[{{\bf CaseSensitivity}}]{cs = {\ttfamily csDefault}} +\end{DoxyParamCaption} +)}\label{classQuaZip_a6c657bfcfccb59d728e0da24c677d899} + + +Sets current file by its name. + +Returns {\ttfamily true} if successful, {\ttfamily false} otherwise. Argument {\itshape cs\/} specifies case sensitivity of the file name. Call \doxyref{getZipError()}{p.}{classQuaZip_a28b91a6282ddd9382c96a069572c6fb4} in the case of a failure to get error code. + +This is not a wrapper to unzLocateFile() function. That is because I had to implement locale-\/specific case-\/insensitive comparison. + +Here are the differences from the original implementation: + + +\begin{DoxyItemize} +\item If the file was not found, error code is {\ttfamily UNZ\_\-OK}, not {\ttfamily UNZ\_\-END\_\-OF\_\-LIST\_\-OF\_\-FILE} (see also \doxyref{goToNextFile()}{p.}{classQuaZip_aee6779b6cd338420c2e8c5655fa8ba97}). +\item If this function fails, it unsets the current file rather than resetting it back to what it was before the call. +\end{DoxyItemize} + +If {\itshape fileName\/} is null string then this function unsets the current file and return {\ttfamily true}. Note that you should close the file first if it is open! See \doxyref{QuaZipFile::QuaZipFile(QuaZip$\ast$,QObject$\ast$)}{p.}{classQuaZipFile_a54e944a6b3d27030f64c8f30d2cc33bb} for the details. + +Should be used only in \doxyref{QuaZip::mdUnzip}{p.}{classQuaZip_a47e28d4116ee716fdd6b431b821d0be4a803a371910c2dc830d111e9ce5b58897} mode. + +\begin{DoxySeeAlso}{See also} +\doxyref{setFileNameCodec()}{p.}{classQuaZip_a339010b5566704ba3c9cafbfe848d8fb}, \doxyref{CaseSensitivity}{p.}{classQuaZip_a6053a1d249ed210a85c9d5eb7cf9cdbe} +\end{DoxySeeAlso} + + +References convertCaseSensitivity(), getCurrentFileName(), goToFirstFile(), goToNextFile(), MAX\_\-FILE\_\-NAME\_\-LENGTH, mdUnzip, and QuaZipPrivate::unzFile\_\-f. + + + +Referenced by QuaZipFile::open(). + +\index{QuaZip@{QuaZip}!getCurrentFileInfo@{getCurrentFileInfo}} +\index{getCurrentFileInfo@{getCurrentFileInfo}!QuaZip@{QuaZip}} +\subsubsection[{getCurrentFileInfo}]{\setlength{\rightskip}{0pt plus 5cm}bool QuaZip::getCurrentFileInfo ( +\begin{DoxyParamCaption} +\item[{{\bf QuaZipFileInfo} $\ast$}]{info} +\end{DoxyParamCaption} +) const}\label{classQuaZip_a9c91a53ed4c2038e153c64bdc097ebe8} + + +Retrieves information about the current file. + +Fills the structure pointed by {\itshape info\/}. Returns {\ttfamily true} on success, {\ttfamily false} otherwise. In the latter case structure pointed by {\itshape info\/} remains untouched. If there was an error, \doxyref{getZipError()}{p.}{classQuaZip_a28b91a6282ddd9382c96a069572c6fb4} returns error code. + +Should be used only in \doxyref{QuaZip::mdUnzip}{p.}{classQuaZip_a47e28d4116ee716fdd6b431b821d0be4a803a371910c2dc830d111e9ce5b58897} mode. + +Does nothing and returns {\ttfamily false} in any of the following cases. +\begin{DoxyItemize} +\item ZIP is not open; +\item ZIP does not have current file; +\item {\itshape info\/} is {\ttfamily NULL}; +\end{DoxyItemize} + +In all these cases \doxyref{getZipError()}{p.}{classQuaZip_a28b91a6282ddd9382c96a069572c6fb4} returns {\ttfamily UNZ\_\-OK} since there is no ZIP/UNZIP API call. + +References QuaZipFileInfo::comment, QuaZipFileInfo::compressedSize, QuaZipFileInfo::crc, QuaZipFileInfo::dateTime, QuaZipFileInfo::diskNumberStart, QuaZipFileInfo::externalAttr, QuaZipFileInfo::extra, QuaZipFileInfo::flags, hasCurrentFile(), QuaZipFileInfo::internalAttr, isOpen(), mdUnzip, QuaZipFileInfo::method, QuaZipFileInfo::name, QuaZipFileInfo::uncompressedSize, QuaZipPrivate::unzFile\_\-f, QuaZipFileInfo::versionCreated, and QuaZipFileInfo::versionNeeded. + + + +Referenced by QuaZipFile::getFileInfo(), and JlCompress::getFileList(). + +\index{QuaZip@{QuaZip}!getCurrentFileName@{getCurrentFileName}} +\index{getCurrentFileName@{getCurrentFileName}!QuaZip@{QuaZip}} +\subsubsection[{getCurrentFileName}]{\setlength{\rightskip}{0pt plus 5cm}QString QuaZip::getCurrentFileName ( +\begin{DoxyParamCaption} +{} +\end{DoxyParamCaption} +) const}\label{classQuaZip_a9783f8b4f39cd55e71e975aea78fd54a} + + +Returns the current file name. + +Equivalent to calling \doxyref{getCurrentFileInfo()}{p.}{classQuaZip_a9c91a53ed4c2038e153c64bdc097ebe8} and then getting {\ttfamily name} field of the \doxyref{QuaZipFileInfo}{p.}{structQuaZipFileInfo} structure, but faster and more convenient. + +Should be used only in \doxyref{QuaZip::mdUnzip}{p.}{classQuaZip_a47e28d4116ee716fdd6b431b821d0be4a803a371910c2dc830d111e9ce5b58897} mode. + +References hasCurrentFile(), isOpen(), MAX\_\-FILE\_\-NAME\_\-LENGTH, mdUnzip, and QuaZipPrivate::unzFile\_\-f. + + + +Referenced by JlCompress::extractDir(), QuaZipFile::getActualFileName(), and setCurrentFile(). + +\index{QuaZip@{QuaZip}!getUnzFile@{getUnzFile}} +\index{getUnzFile@{getUnzFile}!QuaZip@{QuaZip}} +\subsubsection[{getUnzFile}]{\setlength{\rightskip}{0pt plus 5cm}unzFile QuaZip::getUnzFile ( +\begin{DoxyParamCaption} +{} +\end{DoxyParamCaption} +)}\label{classQuaZip_a3b78a652f296ff4a678a791e8294e642} + + +Returns {\ttfamily unzFile} handle. + +You can use this handle to directly call UNZIP part of the ZIP/UNZIP package functions (see unzip.h). + +\begin{DoxyWarning}{Warning} +When using the handle returned by this function, please keep in mind that \doxyref{QuaZip}{p.}{classQuaZip} class is unable to detect any changes you make in the ZIP file state (e. g. changing current file, or closing the handle). So please do not do anything with this handle that is possible to do with the functions of this class. Or at least return the handle in the original state before calling some another function of this class (including implicit destructor calls and calls from the \doxyref{QuaZipFile}{p.}{classQuaZipFile} objects that refer to this \doxyref{QuaZip}{p.}{classQuaZip} instance!). So if you have changed the current file in the ZIP archive -\/ then change it back or you may experience some strange behavior or even crashes. +\end{DoxyWarning} + + +References QuaZipPrivate::unzFile\_\-f. + + + +Referenced by QuaZipFile::atEnd(), QuaZipFile::close(), QuaZipFile::csize(), QuaZipFile::open(), QuaZipFile::pos(), QuaZipFile::readData(), and QuaZipFile::usize(). + +\index{QuaZip@{QuaZip}!getZipFile@{getZipFile}} +\index{getZipFile@{getZipFile}!QuaZip@{QuaZip}} +\subsubsection[{getZipFile}]{\setlength{\rightskip}{0pt plus 5cm}zipFile QuaZip::getZipFile ( +\begin{DoxyParamCaption} +{} +\end{DoxyParamCaption} +)}\label{classQuaZip_a425043a4d7cc31e2fe2bba73d954f15c} + + +Returns {\ttfamily zipFile} handle. + +You can use this handle to directly call ZIP part of the ZIP/UNZIP package functions (see zip.h). Warnings about the \doxyref{getUnzFile()}{p.}{classQuaZip_a3b78a652f296ff4a678a791e8294e642} function also apply to this function. + +References QuaZipPrivate::zipFile\_\-f. + + + +Referenced by QuaZipFile::close(), QuaZipFile::open(), and QuaZipFile::writeData(). + +\index{QuaZip@{QuaZip}!setDataDescriptorWritingEnabled@{setDataDescriptorWritingEnabled}} +\index{setDataDescriptorWritingEnabled@{setDataDescriptorWritingEnabled}!QuaZip@{QuaZip}} +\subsubsection[{setDataDescriptorWritingEnabled}]{\setlength{\rightskip}{0pt plus 5cm}void QuaZip::setDataDescriptorWritingEnabled ( +\begin{DoxyParamCaption} +\item[{bool}]{enabled} +\end{DoxyParamCaption} +)}\label{classQuaZip_a6c23a12af88f7ea5edd4f9c0a24b9453} + + +Changes the data descriptor writing mode. + +According to the ZIP format specification, a file inside archive may have a data descriptor immediately following the file data. This is reflected by a special flag in the local file header and in the central directory. By default, QuaZIP sets this flag and writes the data descriptor unless both method and level were set to 0, in which case it operates in 1.0-\/compatible mode and never writes data descriptors. + +By setting this flag to false, it is possible to disable data descriptor writing, thus increasing compatibility with archive readers that don't understand this feature of the ZIP file format. + +Setting this flag affects all the \doxyref{QuaZipFile}{p.}{classQuaZipFile} instances that are opened after this flag is set. + +The data descriptor writing mode is enabled by default. + + +\begin{DoxyParams}{Parameters} +{\em enabled} & If {\ttfamily true}, enable local descriptor writing, disable it otherwise.\\ +\hline +\end{DoxyParams} +\begin{DoxySeeAlso}{See also} +QuaZipFile::setDataDescriptorWritingEnabled() +\end{DoxySeeAlso} +\index{QuaZip@{QuaZip}!isDataDescriptorWritingEnabled@{isDataDescriptorWritingEnabled}} +\index{isDataDescriptorWritingEnabled@{isDataDescriptorWritingEnabled}!QuaZip@{QuaZip}} +\subsubsection[{isDataDescriptorWritingEnabled}]{\setlength{\rightskip}{0pt plus 5cm}bool QuaZip::isDataDescriptorWritingEnabled ( +\begin{DoxyParamCaption} +{} +\end{DoxyParamCaption} +) const}\label{classQuaZip_ae5c665a59447c2d30e63e9c6df48ebb7} + + +Returns the data descriptor default writing mode. + +\begin{DoxySeeAlso}{See also} +\doxyref{setDataDescriptorWritingEnabled()}{p.}{classQuaZip_a6c23a12af88f7ea5edd4f9c0a24b9453} +\end{DoxySeeAlso} + + +Referenced by QuaZipFile::open(). + +\index{QuaZip@{QuaZip}!getFileNameList@{getFileNameList}} +\index{getFileNameList@{getFileNameList}!QuaZip@{QuaZip}} +\subsubsection[{getFileNameList}]{\setlength{\rightskip}{0pt plus 5cm}QStringList QuaZip::getFileNameList ( +\begin{DoxyParamCaption} +{} +\end{DoxyParamCaption} +) const}\label{classQuaZip_abb38d8b4c9c4ae0728b48caae9dd82de} + + +Returns a list of files inside the archive. + +\begin{DoxyReturn}{Returns} +A list of file names or an empty list if there was an error or if the archive is empty (call \doxyref{getZipError()}{p.}{classQuaZip_a28b91a6282ddd9382c96a069572c6fb4} to figure out which). +\end{DoxyReturn} +\begin{DoxySeeAlso}{See also} +\doxyref{getFileInfoList()}{p.}{classQuaZip_a7486af66bede8e131db0cd2e81881387} +\end{DoxySeeAlso} +\index{QuaZip@{QuaZip}!getFileInfoList@{getFileInfoList}} +\index{getFileInfoList@{getFileInfoList}!QuaZip@{QuaZip}} +\subsubsection[{getFileInfoList}]{\setlength{\rightskip}{0pt plus 5cm}QList$<$ {\bf QuaZipFileInfo} $>$ QuaZip::getFileInfoList ( +\begin{DoxyParamCaption} +{} +\end{DoxyParamCaption} +) const}\label{classQuaZip_a7486af66bede8e131db0cd2e81881387} + + +Returns information list about all files inside the archive. + +\begin{DoxyReturn}{Returns} +A list of \doxyref{QuaZipFileInfo}{p.}{structQuaZipFileInfo} objects or an empty list if there was an error or if the archive is empty (call \doxyref{getZipError()}{p.}{classQuaZip_a28b91a6282ddd9382c96a069572c6fb4} to figure out which). +\end{DoxyReturn} +\begin{DoxySeeAlso}{See also} +\doxyref{getFileNameList()}{p.}{classQuaZip_abb38d8b4c9c4ae0728b48caae9dd82de} +\end{DoxySeeAlso} + + +The documentation for this class was generated from the following files:\begin{DoxyCompactItemize} +\item +quazip/quazip.h\item +quazip/quazip.cpp\end{DoxyCompactItemize} diff --git a/3rdparty/quazip-0.5.1/doc/latex/classQuaZipDir.tex b/3rdparty/quazip-0.5.1/doc/latex/classQuaZipDir.tex new file mode 100644 index 00000000..91014a9e --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/latex/classQuaZipDir.tex @@ -0,0 +1,346 @@ +\section{QuaZipDir Class Reference} +\label{classQuaZipDir}\index{QuaZipDir@{QuaZipDir}} + + +Provides ZIP archive navigation. + + + + +{\ttfamily \#include $<$quazipdir.h$>$} + +\subsection*{Public Member Functions} +\begin{DoxyCompactItemize} +\item +{\bf QuaZipDir} (const {\bf QuaZipDir} \&that)\label{classQuaZipDir_a6c9cc8b74c52d3fe997b753370566690} + +\begin{DoxyCompactList}\small\item\em The copy constructor. \end{DoxyCompactList}\item +{\bf QuaZipDir} ({\bf QuaZip} $\ast$zip, const QString \&dir=QString()) +\begin{DoxyCompactList}\small\item\em Constructs a \doxyref{QuaZipDir}{p.}{classQuaZipDir} instance pointing to the specified directory. \end{DoxyCompactList}\item +{\bf $\sim$QuaZipDir} ()\label{classQuaZipDir_ae95d60e2c23e611723371bf8fff2b095} + +\begin{DoxyCompactList}\small\item\em Destructor. \end{DoxyCompactList}\item +bool {\bf operator==} (const {\bf QuaZipDir} \&that)\label{classQuaZipDir_a4a2e07484c7159a3f469922ba2383547} + +\begin{DoxyCompactList}\small\item\em The assignment operator. \end{DoxyCompactList}\item +bool {\bf operator!=} (const {\bf QuaZipDir} \&that) +\begin{DoxyCompactList}\small\item\em operator!= \end{DoxyCompactList}\item +{\bf QuaZipDir} \& {\bf operator=} (const {\bf QuaZipDir} \&that) +\begin{DoxyCompactList}\small\item\em operator== \end{DoxyCompactList}\item +QString {\bf operator[$\,$]} (int pos) const \label{classQuaZipDir_a9e37ef5318c44a4575c58d66110e535a} + +\begin{DoxyCompactList}\small\item\em Returns the name of the entry at the specified position. \end{DoxyCompactList}\item +{\bf QuaZip::CaseSensitivity} {\bf caseSensitivity} () const \label{classQuaZipDir_ad7ab403a8d36a3b6149da86ea37178f8} + +\begin{DoxyCompactList}\small\item\em Returns the current case sensitivity mode. \end{DoxyCompactList}\item +bool {\bf cd} (const QString \&dirName) +\begin{DoxyCompactList}\small\item\em Changes the 'current' directory. \end{DoxyCompactList}\item +bool {\bf cdUp} ()\label{classQuaZipDir_a62306db3f4c0866930fa35c7348b84b3} + +\begin{DoxyCompactList}\small\item\em Goes up. \end{DoxyCompactList}\item +uint {\bf count} () const \label{classQuaZipDir_aa3f14665e3991351f4ef94ab8e0ab29d} + +\begin{DoxyCompactList}\small\item\em Returns the number of entries in the directory. \end{DoxyCompactList}\item +QString {\bf dirName} () const +\begin{DoxyCompactList}\small\item\em Returns the current directory name. \end{DoxyCompactList}\item +QList$<$ {\bf QuaZipFileInfo} $>$ {\bf entryInfoList} (const QStringList \&nameFilters, QDir::Filters filters=QDir::NoFilter, QDir::SortFlags sort=QDir::NoSort) const +\begin{DoxyCompactList}\small\item\em Returns the list of the entries in the directory. \end{DoxyCompactList}\item +QList$<$ {\bf QuaZipFileInfo} $>$ {\bf entryInfoList} (QDir::Filters filters=QDir::NoFilter, QDir::SortFlags sort=QDir::NoSort) const +\begin{DoxyCompactList}\small\item\em Returns the list of the entries in the directory. \end{DoxyCompactList}\item +QStringList {\bf entryList} (const QStringList \&nameFilters, QDir::Filters filters=QDir::NoFilter, QDir::SortFlags sort=QDir::NoSort) const +\begin{DoxyCompactList}\small\item\em Returns the list of the entry names in the directory. \end{DoxyCompactList}\item +QStringList {\bf entryList} (QDir::Filters filters=QDir::NoFilter, QDir::SortFlags sort=QDir::NoSort) const +\begin{DoxyCompactList}\small\item\em Returns the list of the entry names in the directory. \end{DoxyCompactList}\item +bool {\bf exists} (const QString \&fileName) const +\begin{DoxyCompactList}\small\item\em Returns {\ttfamily true} if the entry with the specified name exists. \end{DoxyCompactList}\item +bool {\bf exists} () const \label{classQuaZipDir_a22c8f63ce874f5c0e958ae5f42e6d004} + +\begin{DoxyCompactList}\small\item\em Return {\ttfamily true} if the directory pointed by this \doxyref{QuaZipDir}{p.}{classQuaZipDir} exists. \end{DoxyCompactList}\item +QString {\bf filePath} (const QString \&fileName) const +\begin{DoxyCompactList}\small\item\em Returns the full path to the specified file. \end{DoxyCompactList}\item +QDir::Filters {\bf filter} ()\label{classQuaZipDir_abeee1810c7c1c1af93364081dbf70d38} + +\begin{DoxyCompactList}\small\item\em Returns the default filter. \end{DoxyCompactList}\item +bool {\bf isRoot} () const +\begin{DoxyCompactList}\small\item\em Returns if the \doxyref{QuaZipDir}{p.}{classQuaZipDir} points to the root of the archive. \end{DoxyCompactList}\item +QStringList {\bf nameFilters} () const \label{classQuaZipDir_a00f18e23abb8cac04f975e7f31553f2e} + +\begin{DoxyCompactList}\small\item\em Return the default name filter. \end{DoxyCompactList}\item +QString {\bf path} () const +\begin{DoxyCompactList}\small\item\em Returns the path to the current dir. \end{DoxyCompactList}\item +QString {\bf relativeFilePath} (const QString \&fileName) const \label{classQuaZipDir_a2ae89c2b85786a0168656fc7a3faaf01} + +\begin{DoxyCompactList}\small\item\em Returns the path to the specified file relative to the current dir. \end{DoxyCompactList}\item +void {\bf setCaseSensitivity} ({\bf QuaZip::CaseSensitivity} caseSensitivity)\label{classQuaZipDir_ad53c720975bb0c49a823355f7d518793} + +\begin{DoxyCompactList}\small\item\em Sets the default case sensitivity mode. \end{DoxyCompactList}\item +void {\bf setFilter} (QDir::Filters filters)\label{classQuaZipDir_a779a43641f0f3802678e39c9acd1fddb} + +\begin{DoxyCompactList}\small\item\em Sets the default filter. \end{DoxyCompactList}\item +void {\bf setNameFilters} (const QStringList \&nameFilters)\label{classQuaZipDir_abcf208bfd6136e14f36725ae79dce2be} + +\begin{DoxyCompactList}\small\item\em Sets the default name filter. \end{DoxyCompactList}\item +void {\bf setPath} (const QString \&path) +\begin{DoxyCompactList}\small\item\em Goes to the specified path. \end{DoxyCompactList}\item +void {\bf setSorting} (QDir::SortFlags sort)\label{classQuaZipDir_ae43e9d717e3c4b1c0d4790cf558e7451} + +\begin{DoxyCompactList}\small\item\em Sets the default sorting mode. \end{DoxyCompactList}\item +QDir::SortFlags {\bf sorting} () const \label{classQuaZipDir_a4000523c961ab9e0cad08641ff10e3fa} + +\begin{DoxyCompactList}\small\item\em Returns the default sorting mode. \end{DoxyCompactList}\end{DoxyCompactItemize} + + +\subsection{Detailed Description} +Provides ZIP archive navigation. + +This class is modelled after QDir, and is designed to provide similar features for ZIP archives. + +The only significant difference from QDir is that the root path is not '/', but an empty string since that's how the file paths are stored in the archive. However, \doxyref{QuaZipDir}{p.}{classQuaZipDir} understands the paths starting with '/'. It is important in a few places: + + +\begin{DoxyItemize} +\item In the \doxyref{cd()}{p.}{classQuaZipDir_aa829afc0243f1d307302f1167edecc7b} function. +\item In the constructor. +\item In the \doxyref{exists()}{p.}{classQuaZipDir_aacb488fec6e951ac80e5d473534fee97} function. +\end{DoxyItemize} + +Note that since ZIP uses '/' on all platforms, the '$\backslash$' separator is not supported. + +\subsection{Constructor \& Destructor Documentation} +\index{QuaZipDir@{QuaZipDir}!QuaZipDir@{QuaZipDir}} +\index{QuaZipDir@{QuaZipDir}!QuaZipDir@{QuaZipDir}} +\subsubsection[{QuaZipDir}]{\setlength{\rightskip}{0pt plus 5cm}QuaZipDir::QuaZipDir ( +\begin{DoxyParamCaption} +\item[{{\bf QuaZip} $\ast$}]{zip, } +\item[{const QString \&}]{dir = {\ttfamily QString()}} +\end{DoxyParamCaption} +)}\label{classQuaZipDir_a19e5e3a54f322ce03e7f7606a87a2ba1} + + +Constructs a \doxyref{QuaZipDir}{p.}{classQuaZipDir} instance pointing to the specified directory. + +If {\itshape dir\/} is not specified, points to the root of the archive. The same happens if the {\itshape dir\/} is "/". + +\subsection{Member Function Documentation} +\index{QuaZipDir@{QuaZipDir}!operator!=@{operator!=}} +\index{operator!=@{operator!=}!QuaZipDir@{QuaZipDir}} +\subsubsection[{operator!=}]{\setlength{\rightskip}{0pt plus 5cm}bool QuaZipDir::operator!= ( +\begin{DoxyParamCaption} +\item[{const {\bf QuaZipDir} \&}]{that} +\end{DoxyParamCaption} +)\hspace{0.3cm}{\ttfamily [inline]}}\label{classQuaZipDir_a6e60d858d05774c958215ee7741eceed} + + +operator!= + +\begin{DoxyReturn}{Returns} +{\ttfamily true} if either this and {\itshape that\/} use different \doxyref{QuaZip}{p.}{classQuaZip} instances or if they point to different directories. +\end{DoxyReturn} +\index{QuaZipDir@{QuaZipDir}!operator=@{operator=}} +\index{operator=@{operator=}!QuaZipDir@{QuaZipDir}} +\subsubsection[{operator=}]{\setlength{\rightskip}{0pt plus 5cm}{\bf QuaZipDir} \& QuaZipDir::operator= ( +\begin{DoxyParamCaption} +\item[{const {\bf QuaZipDir} \&}]{that} +\end{DoxyParamCaption} +)}\label{classQuaZipDir_aa603c69be0c1597add5951b19f8bc961} + + +operator== + +\begin{DoxyReturn}{Returns} +{\ttfamily true} if both this and {\itshape that\/} use the same \doxyref{QuaZip}{p.}{classQuaZip} instance and point to the same directory. +\end{DoxyReturn} +\index{QuaZipDir@{QuaZipDir}!cd@{cd}} +\index{cd@{cd}!QuaZipDir@{QuaZipDir}} +\subsubsection[{cd}]{\setlength{\rightskip}{0pt plus 5cm}bool QuaZipDir::cd ( +\begin{DoxyParamCaption} +\item[{const QString \&}]{dirName} +\end{DoxyParamCaption} +)}\label{classQuaZipDir_aa829afc0243f1d307302f1167edecc7b} + + +Changes the 'current' directory. + +If the path starts with '/', it is interpreted as an absolute path from the root of the archive. Otherwise, it is interpreted as a path relative to the current directory as was set by the previous \doxyref{cd()}{p.}{classQuaZipDir_aa829afc0243f1d307302f1167edecc7b} or the constructor. + +Note that the subsequent \doxyref{path()}{p.}{classQuaZipDir_a68ac82ad605c0b10f9ee1a2d6d474f52} call will not return a path starting with '/' in all cases. + +References cd(), dirName(), exists(), isRoot(), and path(). + + + +Referenced by cd(), and cdUp(). + +\index{QuaZipDir@{QuaZipDir}!dirName@{dirName}} +\index{dirName@{dirName}!QuaZipDir@{QuaZipDir}} +\subsubsection[{dirName}]{\setlength{\rightskip}{0pt plus 5cm}QString QuaZipDir::dirName ( +\begin{DoxyParamCaption} +{} +\end{DoxyParamCaption} +) const}\label{classQuaZipDir_afd2f76410f7728a7166b7598926fbf96} + + +Returns the current directory name. + +The name doesn't include the path. + +Referenced by cd(). + +\index{QuaZipDir@{QuaZipDir}!entryInfoList@{entryInfoList}} +\index{entryInfoList@{entryInfoList}!QuaZipDir@{QuaZipDir}} +\subsubsection[{entryInfoList}]{\setlength{\rightskip}{0pt plus 5cm}QList$<$ {\bf QuaZipFileInfo} $>$ QuaZipDir::entryInfoList ( +\begin{DoxyParamCaption} +\item[{const QStringList \&}]{nameFilters, } +\item[{QDir::Filters}]{filters = {\ttfamily QDir::NoFilter}, } +\item[{QDir::SortFlags}]{sort = {\ttfamily QDir::NoSort}} +\end{DoxyParamCaption} +) const}\label{classQuaZipDir_aef966735a146fc10c9527c236aa89261} + + +Returns the list of the entries in the directory. + + +\begin{DoxyParams}{Parameters} +{\em nameFilters} & The list of file patterns to list, uses the same syntax as QDir. \\ +\hline +{\em filters} & The entry type filters, only Files and Dirs are accepted. \\ +\hline +{\em sort} & Sorting mode (not supported yet).\\ +\hline +\end{DoxyParams} + + +Referenced by entryInfoList(). + +\index{QuaZipDir@{QuaZipDir}!entryInfoList@{entryInfoList}} +\index{entryInfoList@{entryInfoList}!QuaZipDir@{QuaZipDir}} +\subsubsection[{entryInfoList}]{\setlength{\rightskip}{0pt plus 5cm}QList$<$ {\bf QuaZipFileInfo} $>$ QuaZipDir::entryInfoList ( +\begin{DoxyParamCaption} +\item[{QDir::Filters}]{filters = {\ttfamily QDir::NoFilter}, } +\item[{QDir::SortFlags}]{sort = {\ttfamily QDir::NoSort}} +\end{DoxyParamCaption} +) const}\label{classQuaZipDir_abec530f15597ddf8c8d1f340a333f7aa} + + +Returns the list of the entries in the directory. + +This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. The same as entryInfoList(QStringList(), filters, sort). + +References entryInfoList(). + +\index{QuaZipDir@{QuaZipDir}!entryList@{entryList}} +\index{entryList@{entryList}!QuaZipDir@{QuaZipDir}} +\subsubsection[{entryList}]{\setlength{\rightskip}{0pt plus 5cm}QStringList QuaZipDir::entryList ( +\begin{DoxyParamCaption} +\item[{const QStringList \&}]{nameFilters, } +\item[{QDir::Filters}]{filters = {\ttfamily QDir::NoFilter}, } +\item[{QDir::SortFlags}]{sort = {\ttfamily QDir::NoSort}} +\end{DoxyParamCaption} +) const}\label{classQuaZipDir_a4a32faa77c4120cd3c6db4b683fa16d9} + + +Returns the list of the entry names in the directory. + +The same as entryInfoList(nameFilters, filters, sort), but only returns entry names. + +Referenced by count(), entryList(), exists(), and operator[$\,$](). + +\index{QuaZipDir@{QuaZipDir}!entryList@{entryList}} +\index{entryList@{entryList}!QuaZipDir@{QuaZipDir}} +\subsubsection[{entryList}]{\setlength{\rightskip}{0pt plus 5cm}QStringList QuaZipDir::entryList ( +\begin{DoxyParamCaption} +\item[{QDir::Filters}]{filters = {\ttfamily QDir::NoFilter}, } +\item[{QDir::SortFlags}]{sort = {\ttfamily QDir::NoSort}} +\end{DoxyParamCaption} +) const}\label{classQuaZipDir_ab20e9d3de675b74fcacc98accbc1d766} + + +Returns the list of the entry names in the directory. + +This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. The same as entryList(QStringList(), filters, sort). + +References entryList(). + +\index{QuaZipDir@{QuaZipDir}!exists@{exists}} +\index{exists@{exists}!QuaZipDir@{QuaZipDir}} +\subsubsection[{exists}]{\setlength{\rightskip}{0pt plus 5cm}bool QuaZipDir::exists ( +\begin{DoxyParamCaption} +\item[{const QString \&}]{fileName} +\end{DoxyParamCaption} +) const}\label{classQuaZipDir_aacb488fec6e951ac80e5d473534fee97} + + +Returns {\ttfamily true} if the entry with the specified name exists. + +The ".." is considered to exist if the current directory is not root. The "." and "/" are considered to always exist. Paths starting with "/" are relative to the archive root, other paths are relative to the current dir. + +References QuaZip::convertCaseSensitivity(), entryList(), filePath(), and isRoot(). + +\index{QuaZipDir@{QuaZipDir}!filePath@{filePath}} +\index{filePath@{filePath}!QuaZipDir@{QuaZipDir}} +\subsubsection[{filePath}]{\setlength{\rightskip}{0pt plus 5cm}QString QuaZipDir::filePath ( +\begin{DoxyParamCaption} +\item[{const QString \&}]{fileName} +\end{DoxyParamCaption} +) const}\label{classQuaZipDir_ae8b576a150f8d62c902067603cbc97ae} + + +Returns the full path to the specified file. + +Doesn't check if the file actually exists. + +Referenced by exists(). + +\index{QuaZipDir@{QuaZipDir}!isRoot@{isRoot}} +\index{isRoot@{isRoot}!QuaZipDir@{QuaZipDir}} +\subsubsection[{isRoot}]{\setlength{\rightskip}{0pt plus 5cm}bool QuaZipDir::isRoot ( +\begin{DoxyParamCaption} +{} +\end{DoxyParamCaption} +) const}\label{classQuaZipDir_a598fdf23f1b37e1876476e5969040a32} + + +Returns if the \doxyref{QuaZipDir}{p.}{classQuaZipDir} points to the root of the archive. + +Not that the root path is the empty string, not '/'. + +Referenced by cd(), and exists(). + +\index{QuaZipDir@{QuaZipDir}!path@{path}} +\index{path@{path}!QuaZipDir@{QuaZipDir}} +\subsubsection[{path}]{\setlength{\rightskip}{0pt plus 5cm}QString QuaZipDir::path ( +\begin{DoxyParamCaption} +{} +\end{DoxyParamCaption} +) const}\label{classQuaZipDir_a68ac82ad605c0b10f9ee1a2d6d474f52} + + +Returns the path to the current dir. + +The path never starts with '/', and the root path is an empty string. + +Referenced by cd(), and setPath(). + +\index{QuaZipDir@{QuaZipDir}!setPath@{setPath}} +\index{setPath@{setPath}!QuaZipDir@{QuaZipDir}} +\subsubsection[{setPath}]{\setlength{\rightskip}{0pt plus 5cm}void QuaZipDir::setPath ( +\begin{DoxyParamCaption} +\item[{const QString \&}]{path} +\end{DoxyParamCaption} +)}\label{classQuaZipDir_ae82d06e43856414c30583205d337c111} + + +Goes to the specified path. + +The difference from \doxyref{cd()}{p.}{classQuaZipDir_aa829afc0243f1d307302f1167edecc7b} is that this function never checks if the path actually exists and doesn't use relative paths, so it's possible to go to the root directory with setPath(""). + +Note that this function still chops the trailing and/or leading '/' and treats a single '/' as the root path (\doxyref{path()}{p.}{classQuaZipDir_a68ac82ad605c0b10f9ee1a2d6d474f52} will still return an empty string). + +References path(). + + + +The documentation for this class was generated from the following files:\begin{DoxyCompactItemize} +\item +quazip/quazipdir.h\item +quazip/quazipdir.cpp\end{DoxyCompactItemize} diff --git a/3rdparty/quazip-0.5.1/doc/latex/classQuaZipFile.tex b/3rdparty/quazip-0.5.1/doc/latex/classQuaZipFile.tex new file mode 100644 index 00000000..4f9525b6 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/latex/classQuaZipFile.tex @@ -0,0 +1,668 @@ +\section{QuaZipFile Class Reference} +\label{classQuaZipFile}\index{QuaZipFile@{QuaZipFile}} + + +A file inside ZIP archive. + + + + +{\ttfamily \#include $<$quazip/quazipfile.h$>$} + + + +Collaboration diagram for QuaZipFile: +\nopagebreak +\begin{figure}[H] +\begin{center} +\leavevmode +\includegraphics[width=231pt]{classQuaZipFile__coll__graph} +\end{center} +\end{figure} +\subsection*{Public Member Functions} +\begin{DoxyCompactItemize} +\item +{\bf QuaZipFile} () +\begin{DoxyCompactList}\small\item\em Constructs a \doxyref{QuaZipFile}{p.}{classQuaZipFile} instance. \end{DoxyCompactList}\item +{\bf QuaZipFile} (QObject $\ast$parent) +\begin{DoxyCompactList}\small\item\em Constructs a \doxyref{QuaZipFile}{p.}{classQuaZipFile} instance. \end{DoxyCompactList}\item +{\bf QuaZipFile} (const QString \&zipName, QObject $\ast$parent=NULL) +\begin{DoxyCompactList}\small\item\em Constructs a \doxyref{QuaZipFile}{p.}{classQuaZipFile} instance. \end{DoxyCompactList}\item +{\bf QuaZipFile} (const QString \&zipName, const QString \&fileName, {\bf QuaZip::CaseSensitivity} cs=QuaZip::csDefault, QObject $\ast$parent=NULL) +\begin{DoxyCompactList}\small\item\em Constructs a \doxyref{QuaZipFile}{p.}{classQuaZipFile} instance. \end{DoxyCompactList}\item +{\bf QuaZipFile} ({\bf QuaZip} $\ast$zip, QObject $\ast$parent=NULL) +\begin{DoxyCompactList}\small\item\em Constructs a \doxyref{QuaZipFile}{p.}{classQuaZipFile} instance. \end{DoxyCompactList}\item +virtual {\bf $\sim$QuaZipFile} () +\begin{DoxyCompactList}\small\item\em Destroys a \doxyref{QuaZipFile}{p.}{classQuaZipFile} instance. \end{DoxyCompactList}\item +QString {\bf getZipName} () const +\begin{DoxyCompactList}\small\item\em Returns the ZIP archive file name. \end{DoxyCompactList}\item +{\bf QuaZip} $\ast$ {\bf getZip} () const +\begin{DoxyCompactList}\small\item\em Returns a pointer to the associated \doxyref{QuaZip}{p.}{classQuaZip} object. \end{DoxyCompactList}\item +QString {\bf getFileName} () const +\begin{DoxyCompactList}\small\item\em Returns file name. \end{DoxyCompactList}\item +{\bf QuaZip::CaseSensitivity} {\bf getCaseSensitivity} () const +\begin{DoxyCompactList}\small\item\em Returns case sensitivity of the file name. \end{DoxyCompactList}\item +QString {\bf getActualFileName} () const +\begin{DoxyCompactList}\small\item\em Returns the actual file name in the archive. \end{DoxyCompactList}\item +void {\bf setZipName} (const QString \&zipName) +\begin{DoxyCompactList}\small\item\em Sets the ZIP archive file name. \end{DoxyCompactList}\item +bool {\bf isRaw} () const +\begin{DoxyCompactList}\small\item\em Returns {\ttfamily true} if the file was opened in raw mode. \end{DoxyCompactList}\item +void {\bf setZip} ({\bf QuaZip} $\ast$zip) +\begin{DoxyCompactList}\small\item\em Binds to the existing \doxyref{QuaZip}{p.}{classQuaZip} instance. \end{DoxyCompactList}\item +void {\bf setFileName} (const QString \&fileName, {\bf QuaZip::CaseSensitivity} cs=QuaZip::csDefault) +\begin{DoxyCompactList}\small\item\em Sets the file name. \end{DoxyCompactList}\item +virtual bool {\bf open} (OpenMode mode) +\begin{DoxyCompactList}\small\item\em Opens a file for reading. \end{DoxyCompactList}\item +bool {\bf open} (OpenMode mode, const char $\ast$password) +\begin{DoxyCompactList}\small\item\em Opens a file for reading. \end{DoxyCompactList}\item +bool {\bf open} (OpenMode mode, int $\ast$method, int $\ast$level, bool raw, const char $\ast$password=NULL) +\begin{DoxyCompactList}\small\item\em Opens a file for reading. \end{DoxyCompactList}\item +bool {\bf open} (OpenMode mode, const {\bf QuaZipNewInfo} \&info, const char $\ast$password=NULL, quint32 crc=0, int method=Z\_\-DEFLATED, int level=Z\_\-DEFAULT\_\-COMPRESSION, bool raw=false, int windowBits=-\/MAX\_\-WBITS, int memLevel=DEF\_\-MEM\_\-LEVEL, int strategy=Z\_\-DEFAULT\_\-STRATEGY) +\begin{DoxyCompactList}\small\item\em Opens a file for writing. \end{DoxyCompactList}\item +virtual bool {\bf isSequential} () const \label{classQuaZipFile_a64430ec50820c8096f963a7e5f53001f} + +\begin{DoxyCompactList}\small\item\em Returns {\ttfamily true}, but \doxyref{beware}{p.}{classQuaZipFile_quazipfile-sequential}! \end{DoxyCompactList}\item +virtual qint64 {\bf pos} () const +\begin{DoxyCompactList}\small\item\em Returns current position in the file. \end{DoxyCompactList}\item +virtual bool {\bf atEnd} () const +\begin{DoxyCompactList}\small\item\em Returns {\ttfamily true} if the end of file was reached. \end{DoxyCompactList}\item +virtual qint64 {\bf size} () const +\begin{DoxyCompactList}\small\item\em Returns file size. \end{DoxyCompactList}\item +qint64 {\bf csize} () const +\begin{DoxyCompactList}\small\item\em Returns compressed file size. \end{DoxyCompactList}\item +qint64 {\bf usize} () const +\begin{DoxyCompactList}\small\item\em Returns uncompressed file size. \end{DoxyCompactList}\item +bool {\bf getFileInfo} ({\bf QuaZipFileInfo} $\ast$info) +\begin{DoxyCompactList}\small\item\em Gets information about current file. \end{DoxyCompactList}\item +virtual void {\bf close} () +\begin{DoxyCompactList}\small\item\em Closes the file. \end{DoxyCompactList}\item +int {\bf getZipError} () const \label{classQuaZipFile_a26d2ee56aad947193b73052f80597ef0} + +\begin{DoxyCompactList}\small\item\em Returns the error code returned by the last ZIP/UNZIP API call. \end{DoxyCompactList}\item +virtual qint64 {\bf bytesAvailable} () const \label{classQuaZipFile_a29fbfb34677f69394ae7c986ffd3a0c1} + +\begin{DoxyCompactList}\small\item\em Returns the number of bytes available for reading. \end{DoxyCompactList}\end{DoxyCompactItemize} +\subsection*{Protected Member Functions} +\begin{DoxyCompactItemize} +\item +qint64 {\bf readData} (char $\ast$data, qint64 maxSize)\label{classQuaZipFile_aa1f2274e1579327855a17d67a9046ec2} + +\begin{DoxyCompactList}\small\item\em Implementation of the QIODevice::readData(). \end{DoxyCompactList}\item +qint64 {\bf writeData} (const char $\ast$data, qint64 maxSize)\label{classQuaZipFile_abd07949a6fcc2ef094d2be5398bc8e7c} + +\begin{DoxyCompactList}\small\item\em Implementation of the QIODevice::writeData(). \end{DoxyCompactList}\end{DoxyCompactItemize} +\subsection*{Friends} +\begin{DoxyCompactItemize} +\item +class {\bf QuaZipFilePrivate}\label{classQuaZipFile_abeded291f2788ca39fe2256d78f95266} + +\end{DoxyCompactItemize} + + +\subsection{Detailed Description} +A file inside ZIP archive. + +This is the most interesting class. Not only it provides C++ interface to the ZIP/UNZIP package, but also integrates it with Qt by subclassing QIODevice. This makes possible to access files inside ZIP archive using QTextStream or QDataStream, for example. Actually, this is the main purpose of the whole QuaZIP library. + +You can either use existing \doxyref{QuaZip}{p.}{classQuaZip} instance to create instance of this class or pass ZIP archive file name to this class, in which case it will create internal \doxyref{QuaZip}{p.}{classQuaZip} object. See constructors' descriptions for details. Writing is only possible with the existing instance. + +Note that due to the underlying library's limitation it is not possible to use multiple \doxyref{QuaZipFile}{p.}{classQuaZipFile} instances to open several files in the same archive at the same time. If you need to write to multiple files in parallel, then you should write to temporary files first, then pack them all at once when you have finished writing. If you need to read multiple files inside the same archive in parallel, you should extract them all into a temporary directory first.\subsection{Sequential or random-\/access?}\label{classQuaZipFile_quazipfile-sequential} +At the first thought, \doxyref{QuaZipFile}{p.}{classQuaZipFile} has fixed size, the start and the end and should be therefore considered random-\/access device. But there is one major obstacle to making it random-\/access: ZIP/UNZIP API does not support seek() operation and the only way to implement it is through reopening the file and re-\/reading to the required position, but this is prohibitively slow. + +Therefore, \doxyref{QuaZipFile}{p.}{classQuaZipFile} is considered to be a sequential device. This has advantage of availability of the ungetChar() operation (QIODevice does not implement it properly for non-\/sequential devices unless they support seek()). Disadvantage is a somewhat strange behaviour of the \doxyref{size()}{p.}{classQuaZipFile_ad1a17cc690a01c3edfb82984c3a4c8f0} and \doxyref{pos()}{p.}{classQuaZipFile_a90fd55dab83eca7f95df50b2c41b7f22} functions. This should be kept in mind while using this class. + +\subsection{Constructor \& Destructor Documentation} +\index{QuaZipFile@{QuaZipFile}!QuaZipFile@{QuaZipFile}} +\index{QuaZipFile@{QuaZipFile}!QuaZipFile@{QuaZipFile}} +\subsubsection[{QuaZipFile}]{\setlength{\rightskip}{0pt plus 5cm}QuaZipFile::QuaZipFile ( +\begin{DoxyParamCaption} +{} +\end{DoxyParamCaption} +)}\label{classQuaZipFile_ad31592e0e8a9eaa009c6c0e2040a2158} + + +Constructs a \doxyref{QuaZipFile}{p.}{classQuaZipFile} instance. + +You should use \doxyref{setZipName()}{p.}{classQuaZipFile_ac8109e9a5c19bea75982ff6986b5cb1e} and \doxyref{setFileName()}{p.}{classQuaZipFile_a3732ca7704379d457b6a27db8837de95} or \doxyref{setZip()}{p.}{classQuaZipFile_ab7939a26d1e8de2f6aca54f49a12b980} before trying to call \doxyref{open()}{p.}{classQuaZipFile_a4c20c0ef00ae79c9a59eafe2906c9384} on the constructed object. \index{QuaZipFile@{QuaZipFile}!QuaZipFile@{QuaZipFile}} +\index{QuaZipFile@{QuaZipFile}!QuaZipFile@{QuaZipFile}} +\subsubsection[{QuaZipFile}]{\setlength{\rightskip}{0pt plus 5cm}QuaZipFile::QuaZipFile ( +\begin{DoxyParamCaption} +\item[{QObject $\ast$}]{parent} +\end{DoxyParamCaption} +)}\label{classQuaZipFile_a1349ad27f1947bc3e346d83dbf9586c4} + + +Constructs a \doxyref{QuaZipFile}{p.}{classQuaZipFile} instance. + +{\itshape parent\/} argument specifies this object's parent object. + +You should use \doxyref{setZipName()}{p.}{classQuaZipFile_ac8109e9a5c19bea75982ff6986b5cb1e} and \doxyref{setFileName()}{p.}{classQuaZipFile_a3732ca7704379d457b6a27db8837de95} or \doxyref{setZip()}{p.}{classQuaZipFile_ab7939a26d1e8de2f6aca54f49a12b980} before trying to call \doxyref{open()}{p.}{classQuaZipFile_a4c20c0ef00ae79c9a59eafe2906c9384} on the constructed object. \index{QuaZipFile@{QuaZipFile}!QuaZipFile@{QuaZipFile}} +\index{QuaZipFile@{QuaZipFile}!QuaZipFile@{QuaZipFile}} +\subsubsection[{QuaZipFile}]{\setlength{\rightskip}{0pt plus 5cm}QuaZipFile::QuaZipFile ( +\begin{DoxyParamCaption} +\item[{const QString \&}]{zipName, } +\item[{QObject $\ast$}]{parent = {\ttfamily NULL}} +\end{DoxyParamCaption} +)}\label{classQuaZipFile_ae614495d6b2404a6c59d7cfca5c3f6fd} + + +Constructs a \doxyref{QuaZipFile}{p.}{classQuaZipFile} instance. + +{\itshape parent\/} argument specifies this object's parent object and {\itshape zipName\/} specifies ZIP archive file name. + +You should use \doxyref{setFileName()}{p.}{classQuaZipFile_a3732ca7704379d457b6a27db8837de95} before trying to call \doxyref{open()}{p.}{classQuaZipFile_a4c20c0ef00ae79c9a59eafe2906c9384} on the constructed object. + +\doxyref{QuaZipFile}{p.}{classQuaZipFile} constructed by this constructor can be used for read only access. Use \doxyref{QuaZipFile(QuaZip$\ast$,QObject$\ast$)}{p.}{classQuaZipFile_a54e944a6b3d27030f64c8f30d2cc33bb} for writing. \index{QuaZipFile@{QuaZipFile}!QuaZipFile@{QuaZipFile}} +\index{QuaZipFile@{QuaZipFile}!QuaZipFile@{QuaZipFile}} +\subsubsection[{QuaZipFile}]{\setlength{\rightskip}{0pt plus 5cm}QuaZipFile::QuaZipFile ( +\begin{DoxyParamCaption} +\item[{const QString \&}]{zipName, } +\item[{const QString \&}]{fileName, } +\item[{{\bf QuaZip::CaseSensitivity}}]{cs = {\ttfamily QuaZip::csDefault}, } +\item[{QObject $\ast$}]{parent = {\ttfamily NULL}} +\end{DoxyParamCaption} +)}\label{classQuaZipFile_ac6e883b5a5d3a58c9c56eb497dd91220} + + +Constructs a \doxyref{QuaZipFile}{p.}{classQuaZipFile} instance. + +{\itshape parent\/} argument specifies this object's parent object, {\itshape zipName\/} specifies ZIP archive file name and {\itshape fileName\/} and {\itshape cs\/} specify a name of the file to open inside archive. + +\doxyref{QuaZipFile}{p.}{classQuaZipFile} constructed by this constructor can be used for read only access. Use \doxyref{QuaZipFile(QuaZip$\ast$,QObject$\ast$)}{p.}{classQuaZipFile_a54e944a6b3d27030f64c8f30d2cc33bb} for writing. + +\begin{DoxySeeAlso}{See also} +\doxyref{QuaZip::setCurrentFile()}{p.}{classQuaZip_a6c657bfcfccb59d728e0da24c677d899} +\end{DoxySeeAlso} +\index{QuaZipFile@{QuaZipFile}!QuaZipFile@{QuaZipFile}} +\index{QuaZipFile@{QuaZipFile}!QuaZipFile@{QuaZipFile}} +\subsubsection[{QuaZipFile}]{\setlength{\rightskip}{0pt plus 5cm}QuaZipFile::QuaZipFile ( +\begin{DoxyParamCaption} +\item[{{\bf QuaZip} $\ast$}]{zip, } +\item[{QObject $\ast$}]{parent = {\ttfamily NULL}} +\end{DoxyParamCaption} +)}\label{classQuaZipFile_a54e944a6b3d27030f64c8f30d2cc33bb} + + +Constructs a \doxyref{QuaZipFile}{p.}{classQuaZipFile} instance. + +{\itshape parent\/} argument specifies this object's parent object. + +{\itshape zip\/} is the pointer to the existing \doxyref{QuaZip}{p.}{classQuaZip} object. This \doxyref{QuaZipFile}{p.}{classQuaZipFile} object then can be used to read current file in the {\itshape zip\/} or to write to the file inside it. + +\begin{DoxyWarning}{Warning} +Using this constructor for reading current file can be tricky. Let's take the following example: +\begin{DoxyCode} + QuaZip zip("archive.zip"); + zip.open(QuaZip::mdUnzip); + zip.setCurrentFile("file-in-archive"); + QuaZipFile file(&zip); + file.open(QIODevice::ReadOnly); + // ok, now we can read from the file + file.read(somewhere, some); + zip.setCurrentFile("another-file-in-archive"); // oops... + QuaZipFile anotherFile(&zip); + anotherFile.open(QIODevice::ReadOnly); + anotherFile.read(somewhere, some); // this is still ok... + file.read(somewhere, some); // and this is NOT +\end{DoxyCode} + So, what exactly happens here? When we change current file in the {\ttfamily zip} archive, {\ttfamily file} that references it becomes invalid (actually, as far as I understand ZIP/UNZIP sources, it becomes closed, but \doxyref{QuaZipFile}{p.}{classQuaZipFile} has no means to detect it). +\end{DoxyWarning} +Summary: do not close {\ttfamily zip} object or change its current file as long as \doxyref{QuaZipFile}{p.}{classQuaZipFile} is open. Even better -\/ use another constructors which create internal \doxyref{QuaZip}{p.}{classQuaZip} instances, one per object, and therefore do not cause unnecessary trouble. This constructor may be useful, though, if you already have a \doxyref{QuaZip}{p.}{classQuaZip} instance and do not want to access several files at once. Good example: +\begin{DoxyCode} + QuaZip zip("archive.zip"); + zip.open(QuaZip::mdUnzip); + // first, we need some information about archive itself + QByteArray comment=zip.getComment(); + // and now we are going to access files inside it + QuaZipFile file(&zip); + for(bool more=zip.goToFirstFile(); more; more=zip.goToNextFile()) { + file.open(QIODevice::ReadOnly); + // do something cool with file here + file.close(); // do not forget to close! + } + zip.close(); +\end{DoxyCode} + \index{QuaZipFile@{QuaZipFile}!$\sim$QuaZipFile@{$\sim$QuaZipFile}} +\index{$\sim$QuaZipFile@{$\sim$QuaZipFile}!QuaZipFile@{QuaZipFile}} +\subsubsection[{$\sim$QuaZipFile}]{\setlength{\rightskip}{0pt plus 5cm}QuaZipFile::$\sim$QuaZipFile ( +\begin{DoxyParamCaption} +{} +\end{DoxyParamCaption} +)\hspace{0.3cm}{\ttfamily [virtual]}}\label{classQuaZipFile_aa1e5a0cf491bafae6cc73e649caa97fc} + + +Destroys a \doxyref{QuaZipFile}{p.}{classQuaZipFile} instance. + +Closes file if open, destructs internal \doxyref{QuaZip}{p.}{classQuaZip} object (if it exists and {\itshape is\/} internal, of course). + +References close(). + + + +\subsection{Member Function Documentation} +\index{QuaZipFile@{QuaZipFile}!getZipName@{getZipName}} +\index{getZipName@{getZipName}!QuaZipFile@{QuaZipFile}} +\subsubsection[{getZipName}]{\setlength{\rightskip}{0pt plus 5cm}QString QuaZipFile::getZipName ( +\begin{DoxyParamCaption} +{} +\end{DoxyParamCaption} +) const}\label{classQuaZipFile_a6f034a714aa94631367590de3f8f4e22} + + +Returns the ZIP archive file name. + +If this object was created by passing \doxyref{QuaZip}{p.}{classQuaZip} pointer to the constructor, this function will return that QuaZip's file name (or null string if that object does not have file name yet). + +Otherwise, returns associated ZIP archive file name or null string if there are no name set yet. + +\begin{DoxySeeAlso}{See also} +\doxyref{setZipName()}{p.}{classQuaZipFile_ac8109e9a5c19bea75982ff6986b5cb1e} \doxyref{getFileName()}{p.}{classQuaZipFile_a6999362e70a5b2396fba5cfb30095ff9} +\end{DoxySeeAlso} + + +References QuaZip::getZipName(). + +\index{QuaZipFile@{QuaZipFile}!getZip@{getZip}} +\index{getZip@{getZip}!QuaZipFile@{QuaZipFile}} +\subsubsection[{getZip}]{\setlength{\rightskip}{0pt plus 5cm}{\bf QuaZip} $\ast$ QuaZipFile::getZip ( +\begin{DoxyParamCaption} +{} +\end{DoxyParamCaption} +) const}\label{classQuaZipFile_a72daf8a9da14907a801a783603003205} + + +Returns a pointer to the associated \doxyref{QuaZip}{p.}{classQuaZip} object. + +Returns {\ttfamily NULL} if there is no associated \doxyref{QuaZip}{p.}{classQuaZip} or it is internal (so you will not mess with it). \index{QuaZipFile@{QuaZipFile}!getFileName@{getFileName}} +\index{getFileName@{getFileName}!QuaZipFile@{QuaZipFile}} +\subsubsection[{getFileName}]{\setlength{\rightskip}{0pt plus 5cm}QString QuaZipFile::getFileName ( +\begin{DoxyParamCaption} +{} +\end{DoxyParamCaption} +) const}\label{classQuaZipFile_a6999362e70a5b2396fba5cfb30095ff9} + + +Returns file name. + +This function returns file name you passed to this object either by using \doxyref{QuaZipFile(const QString\&,const QString\&,QuaZip::CaseSensitivity,QObject$\ast$)}{p.}{classQuaZipFile_ac6e883b5a5d3a58c9c56eb497dd91220} or by calling \doxyref{setFileName()}{p.}{classQuaZipFile_a3732ca7704379d457b6a27db8837de95}. Real name of the file may differ in case if you used case-\/insensitivity. + +Returns null string if there is no file name set yet. This is the case when this \doxyref{QuaZipFile}{p.}{classQuaZipFile} operates on the existing \doxyref{QuaZip}{p.}{classQuaZip} object (constructor \doxyref{QuaZipFile(QuaZip$\ast$,QObject$\ast$)}{p.}{classQuaZipFile_a54e944a6b3d27030f64c8f30d2cc33bb} or \doxyref{setZip()}{p.}{classQuaZipFile_ab7939a26d1e8de2f6aca54f49a12b980} was used). + +\begin{DoxySeeAlso}{See also} +\doxyref{getActualFileName}{p.}{classQuaZipFile_a7b8e3c39026855cd98661a1b2815c220} +\end{DoxySeeAlso} +\index{QuaZipFile@{QuaZipFile}!getCaseSensitivity@{getCaseSensitivity}} +\index{getCaseSensitivity@{getCaseSensitivity}!QuaZipFile@{QuaZipFile}} +\subsubsection[{getCaseSensitivity}]{\setlength{\rightskip}{0pt plus 5cm}{\bf QuaZip::CaseSensitivity} QuaZipFile::getCaseSensitivity ( +\begin{DoxyParamCaption} +{} +\end{DoxyParamCaption} +) const}\label{classQuaZipFile_a25dbfddc589bf6b69b39905f3c3bcc73} + + +Returns case sensitivity of the file name. + +This function returns case sensitivity argument you passed to this object either by using \doxyref{QuaZipFile(const QString\&,const QString\&,QuaZip::CaseSensitivity,QObject$\ast$)}{p.}{classQuaZipFile_ac6e883b5a5d3a58c9c56eb497dd91220} or by calling \doxyref{setFileName()}{p.}{classQuaZipFile_a3732ca7704379d457b6a27db8837de95}. + +Returns unpredictable value if \doxyref{getFileName()}{p.}{classQuaZipFile_a6999362e70a5b2396fba5cfb30095ff9} returns null string (this is the case when you did not used \doxyref{setFileName()}{p.}{classQuaZipFile_a3732ca7704379d457b6a27db8837de95} or constructor above). + +\begin{DoxySeeAlso}{See also} +\doxyref{getFileName}{p.}{classQuaZipFile_a6999362e70a5b2396fba5cfb30095ff9} +\end{DoxySeeAlso} +\index{QuaZipFile@{QuaZipFile}!getActualFileName@{getActualFileName}} +\index{getActualFileName@{getActualFileName}!QuaZipFile@{QuaZipFile}} +\subsubsection[{getActualFileName}]{\setlength{\rightskip}{0pt plus 5cm}QString QuaZipFile::getActualFileName ( +\begin{DoxyParamCaption} +{} +\end{DoxyParamCaption} +) const}\label{classQuaZipFile_a7b8e3c39026855cd98661a1b2815c220} + + +Returns the actual file name in the archive. + +This is {\itshape not\/} a ZIP archive file name, but a name of file inside archive. It is not necessary the same name that you have passed to the \doxyref{QuaZipFile(const QString\&,const QString\&,QuaZip::CaseSensitivity,QObject$\ast$)}{p.}{classQuaZipFile_ac6e883b5a5d3a58c9c56eb497dd91220}, \doxyref{setFileName()}{p.}{classQuaZipFile_a3732ca7704379d457b6a27db8837de95} or \doxyref{QuaZip::setCurrentFile()}{p.}{classQuaZip_a6c657bfcfccb59d728e0da24c677d899} -\/ this is the real file name inside archive, so it may differ in case if the file name search was case-\/insensitive. + +Equivalent to calling getCurrentFileName() on the associated \doxyref{QuaZip}{p.}{classQuaZip} object. Returns null string if there is no associated \doxyref{QuaZip}{p.}{classQuaZip} object or if it does not have a current file yet. And this is the case if you called \doxyref{setFileName()}{p.}{classQuaZipFile_a3732ca7704379d457b6a27db8837de95} but did not open the file yet. So this is perfectly fine: +\begin{DoxyCode} + QuaZipFile file("somezip.zip"); + file.setFileName("somefile"); + QString name=file.getName(); // name=="somefile" + QString actual=file.getActualFileName(); // actual is null string + file.open(QIODevice::ReadOnly); + QString actual=file.getActualFileName(); // actual can be "SoMeFiLe" on Windows +\end{DoxyCode} + + +\begin{DoxySeeAlso}{See also} +\doxyref{getZipName()}{p.}{classQuaZipFile_a6f034a714aa94631367590de3f8f4e22}, \doxyref{getFileName()}{p.}{classQuaZipFile_a6999362e70a5b2396fba5cfb30095ff9}, \doxyref{QuaZip::CaseSensitivity}{p.}{classQuaZip_a6053a1d249ed210a85c9d5eb7cf9cdbe} +\end{DoxySeeAlso} + + +References QuaZip::getCurrentFileName(), and QuaZip::getZipError(). + +\index{QuaZipFile@{QuaZipFile}!setZipName@{setZipName}} +\index{setZipName@{setZipName}!QuaZipFile@{QuaZipFile}} +\subsubsection[{setZipName}]{\setlength{\rightskip}{0pt plus 5cm}void QuaZipFile::setZipName ( +\begin{DoxyParamCaption} +\item[{const QString \&}]{zipName} +\end{DoxyParamCaption} +)}\label{classQuaZipFile_ac8109e9a5c19bea75982ff6986b5cb1e} + + +Sets the ZIP archive file name. + +Automatically creates internal \doxyref{QuaZip}{p.}{classQuaZip} object and destroys previously created internal \doxyref{QuaZip}{p.}{classQuaZip} object, if any. + +Will do nothing if this file is already open. You must \doxyref{close()}{p.}{classQuaZipFile_a42a39b12619bccd3d419ee60bbb3fcf6} it first. \index{QuaZipFile@{QuaZipFile}!isRaw@{isRaw}} +\index{isRaw@{isRaw}!QuaZipFile@{QuaZipFile}} +\subsubsection[{isRaw}]{\setlength{\rightskip}{0pt plus 5cm}bool QuaZipFile::isRaw ( +\begin{DoxyParamCaption} +{} +\end{DoxyParamCaption} +) const}\label{classQuaZipFile_a0df3db94c2a34c8d17ddaa0f54fc32c1} + + +Returns {\ttfamily true} if the file was opened in raw mode. + +If the file is not open, the returned value is undefined. + +\begin{DoxySeeAlso}{See also} +\doxyref{open(OpenMode,int$\ast$,int$\ast$,bool,const char$\ast$)}{p.}{classQuaZipFile_aed75bace51f2bb4c3e4f656ab4493aac} +\end{DoxySeeAlso} + + +Referenced by close(). + +\index{QuaZipFile@{QuaZipFile}!setZip@{setZip}} +\index{setZip@{setZip}!QuaZipFile@{QuaZipFile}} +\subsubsection[{setZip}]{\setlength{\rightskip}{0pt plus 5cm}void QuaZipFile::setZip ( +\begin{DoxyParamCaption} +\item[{{\bf QuaZip} $\ast$}]{zip} +\end{DoxyParamCaption} +)}\label{classQuaZipFile_ab7939a26d1e8de2f6aca54f49a12b980} + + +Binds to the existing \doxyref{QuaZip}{p.}{classQuaZip} instance. + +This function destroys internal \doxyref{QuaZip}{p.}{classQuaZip} object, if any, and makes this \doxyref{QuaZipFile}{p.}{classQuaZipFile} to use current file in the {\itshape zip\/} object for any further operations. See \doxyref{QuaZipFile(QuaZip$\ast$,QObject$\ast$)}{p.}{classQuaZipFile_a54e944a6b3d27030f64c8f30d2cc33bb} for the possible pitfalls. + +Will do nothing if the file is currently open. You must \doxyref{close()}{p.}{classQuaZipFile_a42a39b12619bccd3d419ee60bbb3fcf6} it first. \index{QuaZipFile@{QuaZipFile}!setFileName@{setFileName}} +\index{setFileName@{setFileName}!QuaZipFile@{QuaZipFile}} +\subsubsection[{setFileName}]{\setlength{\rightskip}{0pt plus 5cm}void QuaZipFile::setFileName ( +\begin{DoxyParamCaption} +\item[{const QString \&}]{fileName, } +\item[{{\bf QuaZip::CaseSensitivity}}]{cs = {\ttfamily QuaZip::csDefault}} +\end{DoxyParamCaption} +)}\label{classQuaZipFile_a3732ca7704379d457b6a27db8837de95} + + +Sets the file name. + +Will do nothing if at least one of the following conditions is met: +\begin{DoxyItemize} +\item ZIP name has not been set yet (\doxyref{getZipName()}{p.}{classQuaZipFile_a6f034a714aa94631367590de3f8f4e22} returns null string). +\item This \doxyref{QuaZipFile}{p.}{classQuaZipFile} is associated with external \doxyref{QuaZip}{p.}{classQuaZip}. In this case you should call that QuaZip's setCurrentFile() function instead! +\item File is already open so setting the name is meaningless. +\end{DoxyItemize} + +\begin{DoxySeeAlso}{See also} +\doxyref{QuaZip::setCurrentFile}{p.}{classQuaZip_a6c657bfcfccb59d728e0da24c677d899} +\end{DoxySeeAlso} +\index{QuaZipFile@{QuaZipFile}!open@{open}} +\index{open@{open}!QuaZipFile@{QuaZipFile}} +\subsubsection[{open}]{\setlength{\rightskip}{0pt plus 5cm}bool QuaZipFile::open ( +\begin{DoxyParamCaption} +\item[{OpenMode}]{mode} +\end{DoxyParamCaption} +)\hspace{0.3cm}{\ttfamily [virtual]}}\label{classQuaZipFile_a4c20c0ef00ae79c9a59eafe2906c9384} + + +Opens a file for reading. + +Returns {\ttfamily true} on success, {\ttfamily false} otherwise. Call \doxyref{getZipError()}{p.}{classQuaZipFile_a26d2ee56aad947193b73052f80597ef0} to get error code. + +\begin{DoxyNote}{Note} +Since ZIP/UNZIP API provides buffered reading only, \doxyref{QuaZipFile}{p.}{classQuaZipFile} does not support unbuffered reading. So do not pass QIODevice::Unbuffered flag in {\itshape mode\/}, or open will fail. +\end{DoxyNote} +\index{QuaZipFile@{QuaZipFile}!open@{open}} +\index{open@{open}!QuaZipFile@{QuaZipFile}} +\subsubsection[{open}]{\setlength{\rightskip}{0pt plus 5cm}bool QuaZipFile::open ( +\begin{DoxyParamCaption} +\item[{OpenMode}]{mode, } +\item[{const char $\ast$}]{password} +\end{DoxyParamCaption} +)\hspace{0.3cm}{\ttfamily [inline]}}\label{classQuaZipFile_a0bff0d15bbcd70306dc4a553a55776b9} + + +Opens a file for reading. + +This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Argument {\itshape password\/} specifies a password to decrypt the file. If it is NULL then this function behaves just like \doxyref{open(OpenMode)}{p.}{classQuaZipFile_a4c20c0ef00ae79c9a59eafe2906c9384}. + +References open(). + + + +Referenced by open(). + +\index{QuaZipFile@{QuaZipFile}!open@{open}} +\index{open@{open}!QuaZipFile@{QuaZipFile}} +\subsubsection[{open}]{\setlength{\rightskip}{0pt plus 5cm}bool QuaZipFile::open ( +\begin{DoxyParamCaption} +\item[{OpenMode}]{mode, } +\item[{int $\ast$}]{method, } +\item[{int $\ast$}]{level, } +\item[{bool}]{raw, } +\item[{const char $\ast$}]{password = {\ttfamily NULL}} +\end{DoxyParamCaption} +)}\label{classQuaZipFile_aed75bace51f2bb4c3e4f656ab4493aac} + + +Opens a file for reading. + +This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Argument {\itshape password\/} specifies a password to decrypt the file. + +An integers pointed by {\itshape method\/} and {\itshape level\/} will receive codes of the compression method and level used. See unzip.h. + +If raw is {\ttfamily true} then no decompression is performed. + +{\itshape method\/} should not be {\ttfamily NULL}. {\itshape level\/} can be {\ttfamily NULL} if you don't want to know the compression level. + +References QuaZip::close(), QuaZip::getMode(), QuaZip::getUnzFile(), QuaZip::getZipError(), QuaZip::hasCurrentFile(), QuaZip::mdUnzip, QuaZip::open(), and QuaZip::setCurrentFile(). + +\index{QuaZipFile@{QuaZipFile}!open@{open}} +\index{open@{open}!QuaZipFile@{QuaZipFile}} +\subsubsection[{open}]{\setlength{\rightskip}{0pt plus 5cm}bool QuaZipFile::open ( +\begin{DoxyParamCaption} +\item[{OpenMode}]{mode, } +\item[{const {\bf QuaZipNewInfo} \&}]{info, } +\item[{const char $\ast$}]{password = {\ttfamily NULL}, } +\item[{quint32}]{crc = {\ttfamily 0}, } +\item[{int}]{method = {\ttfamily Z\_\-DEFLATED}, } +\item[{int}]{level = {\ttfamily Z\_\-DEFAULT\_\-COMPRESSION}, } +\item[{bool}]{raw = {\ttfamily false}, } +\item[{int}]{windowBits = {\ttfamily -\/MAX\_\-WBITS}, } +\item[{int}]{memLevel = {\ttfamily DEF\_\-MEM\_\-LEVEL}, } +\item[{int}]{strategy = {\ttfamily Z\_\-DEFAULT\_\-STRATEGY}} +\end{DoxyParamCaption} +)}\label{classQuaZipFile_a2429ea59c77371d7af56d739db130b18} + + +Opens a file for writing. + +{\itshape info\/} argument specifies information about file. It should at least specify a correct file name. Also, it is a good idea to specify correct timestamp (by default, current time will be used). See \doxyref{QuaZipNewInfo}{p.}{structQuaZipNewInfo}. + +The {\itshape password\/} argument specifies the password for crypting. Pass NULL if you don't need any crypting. The {\itshape crc\/} argument was supposed to be used for crypting too, but then it turned out that it's false information, so you need to set it to 0 unless you want to use the raw mode (see below). + +Arguments {\itshape method\/} and {\itshape level\/} specify compression method and level. The only method supported is Z\_\-DEFLATED, but you may also specify 0 for no compression. If all of the files in the archive use both method 0 and either level 0 is explicitly specified or data descriptor writing is disabled with \doxyref{QuaZip::setDataDescriptorWritingEnabled()}{p.}{classQuaZip_a6c23a12af88f7ea5edd4f9c0a24b9453}, then the resulting archive is supposed to be compatible with the 1.0 ZIP format version, should you need that. Except for this, {\itshape level\/} has no other effects with method 0. + +If {\itshape raw\/} is {\ttfamily true}, no compression is performed. In this case, {\itshape crc\/} and uncompressedSize field of the {\itshape info\/} are required. + +Arguments {\itshape windowBits\/}, {\itshape memLevel\/}, {\itshape strategy\/} provide zlib algorithms tuning. See deflateInit2() in zlib. + +References QuaZipNewInfo::comment, QuaZipNewInfo::dateTime, QuaZipNewInfo::externalAttr, QuaZipNewInfo::extraGlobal, QuaZipNewInfo::extraLocal, QuaZip::getCommentCodec(), QuaZip::getFileNameCodec(), QuaZip::getMode(), QuaZip::getZipFile(), QuaZipNewInfo::internalAttr, QuaZip::isDataDescriptorWritingEnabled(), QuaZip::mdAdd, QuaZip::mdAppend, QuaZip::mdCreate, QuaZipNewInfo::name, and QuaZipNewInfo::uncompressedSize. + +\index{QuaZipFile@{QuaZipFile}!pos@{pos}} +\index{pos@{pos}!QuaZipFile@{QuaZipFile}} +\subsubsection[{pos}]{\setlength{\rightskip}{0pt plus 5cm}qint64 QuaZipFile::pos ( +\begin{DoxyParamCaption} +{} +\end{DoxyParamCaption} +) const\hspace{0.3cm}{\ttfamily [virtual]}}\label{classQuaZipFile_a90fd55dab83eca7f95df50b2c41b7f22} + + +Returns current position in the file. + +Implementation of the QIODevice::pos(). When reading, this function is a wrapper to the ZIP/UNZIP unztell(), therefore it is unable to keep track of the ungetChar() calls (which is non-\/virtual and therefore is dangerous to reimplement). So if you are using ungetChar() feature of the QIODevice, this function reports incorrect value until you get back characters which you ungot. + +When writing, \doxyref{pos()}{p.}{classQuaZipFile_a90fd55dab83eca7f95df50b2c41b7f22} returns number of bytes already written (uncompressed unless you use raw mode). + +\begin{DoxyNote}{Note} +Although \doxyref{QuaZipFile is a sequential device}{p.}{classQuaZipFile_quazipfile-sequential} and therefore \doxyref{pos()}{p.}{classQuaZipFile_a90fd55dab83eca7f95df50b2c41b7f22} should always return zero, it does not, because it would be misguiding. Keep this in mind. +\end{DoxyNote} +This function returns -\/1 if the file or archive is not open. + +Error code returned by \doxyref{getZipError()}{p.}{classQuaZipFile_a26d2ee56aad947193b73052f80597ef0} is not affected by this function call. + +References QuaZip::getUnzFile(). + + + +Referenced by bytesAvailable(). + +\index{QuaZipFile@{QuaZipFile}!atEnd@{atEnd}} +\index{atEnd@{atEnd}!QuaZipFile@{QuaZipFile}} +\subsubsection[{atEnd}]{\setlength{\rightskip}{0pt plus 5cm}bool QuaZipFile::atEnd ( +\begin{DoxyParamCaption} +{} +\end{DoxyParamCaption} +) const\hspace{0.3cm}{\ttfamily [virtual]}}\label{classQuaZipFile_a1e3f4c3c075da98af426fc167440cfc3} + + +Returns {\ttfamily true} if the end of file was reached. + +This function returns {\ttfamily false} in the case of error. This means that you called this function on either not open file, or a file in the not open archive or even on a \doxyref{QuaZipFile}{p.}{classQuaZipFile} instance that does not even have \doxyref{QuaZip}{p.}{classQuaZip} instance associated. Do not do that because there is no means to determine whether {\ttfamily false} is returned because of error or because end of file was reached. Well, on the other side you may interpret {\ttfamily false} return value as \char`\"{}there is no file open to check for end of file and there is + no end of file therefore\char`\"{}. + +When writing, this function always returns {\ttfamily true} (because you are always writing to the end of file). + +Error code returned by \doxyref{getZipError()}{p.}{classQuaZipFile_a26d2ee56aad947193b73052f80597ef0} is not affected by this function call. + +References bytesAvailable(), and QuaZip::getUnzFile(). + +\index{QuaZipFile@{QuaZipFile}!size@{size}} +\index{size@{size}!QuaZipFile@{QuaZipFile}} +\subsubsection[{size}]{\setlength{\rightskip}{0pt plus 5cm}qint64 QuaZipFile::size ( +\begin{DoxyParamCaption} +{} +\end{DoxyParamCaption} +) const\hspace{0.3cm}{\ttfamily [virtual]}}\label{classQuaZipFile_ad1a17cc690a01c3edfb82984c3a4c8f0} + + +Returns file size. + +This function returns \doxyref{csize()}{p.}{classQuaZipFile_ac4da08e5cdec368a2a686775f7dc5639} if the file is open for reading in raw mode, \doxyref{usize()}{p.}{classQuaZipFile_a4814b5e6e39fb254737b81ea10964f50} if it is open for reading in normal mode and \doxyref{pos()}{p.}{classQuaZipFile_a90fd55dab83eca7f95df50b2c41b7f22} if it is open for writing. + +Returns -\/1 on error, call \doxyref{getZipError()}{p.}{classQuaZipFile_a26d2ee56aad947193b73052f80597ef0} to get error code. + +\begin{DoxyNote}{Note} +This function returns file size despite that \doxyref{QuaZipFile is considered to be sequential device}{p.}{classQuaZipFile_quazipfile-sequential}, for which \doxyref{size()}{p.}{classQuaZipFile_ad1a17cc690a01c3edfb82984c3a4c8f0} should return \doxyref{bytesAvailable()}{p.}{classQuaZipFile_a29fbfb34677f69394ae7c986ffd3a0c1} instead. But its name would be very misguiding otherwise, so just keep in mind this inconsistence. +\end{DoxyNote} + + +References csize(), and usize(). + + + +Referenced by bytesAvailable(). + +\index{QuaZipFile@{QuaZipFile}!csize@{csize}} +\index{csize@{csize}!QuaZipFile@{QuaZipFile}} +\subsubsection[{csize}]{\setlength{\rightskip}{0pt plus 5cm}qint64 QuaZipFile::csize ( +\begin{DoxyParamCaption} +{} +\end{DoxyParamCaption} +) const}\label{classQuaZipFile_ac4da08e5cdec368a2a686775f7dc5639} + + +Returns compressed file size. + +Equivalent to calling \doxyref{getFileInfo()}{p.}{classQuaZipFile_ad3f5807329321be21b12c1ba5798b359} and then getting compressedSize field, but more convenient and faster. + +File must be open for reading before calling this function. + +Returns -\/1 on error, call \doxyref{getZipError()}{p.}{classQuaZipFile_a26d2ee56aad947193b73052f80597ef0} to get error code. + +References QuaZip::getMode(), QuaZip::getUnzFile(), and QuaZip::mdUnzip. + + + +Referenced by size(). + +\index{QuaZipFile@{QuaZipFile}!usize@{usize}} +\index{usize@{usize}!QuaZipFile@{QuaZipFile}} +\subsubsection[{usize}]{\setlength{\rightskip}{0pt plus 5cm}qint64 QuaZipFile::usize ( +\begin{DoxyParamCaption} +{} +\end{DoxyParamCaption} +) const}\label{classQuaZipFile_a4814b5e6e39fb254737b81ea10964f50} + + +Returns uncompressed file size. + +Equivalent to calling \doxyref{getFileInfo()}{p.}{classQuaZipFile_ad3f5807329321be21b12c1ba5798b359} and then getting uncompressedSize field, but more convenient and faster. See \doxyref{getFileInfo()}{p.}{classQuaZipFile_ad3f5807329321be21b12c1ba5798b359} for a warning. + +File must be open for reading before calling this function. + +Returns -\/1 on error, call \doxyref{getZipError()}{p.}{classQuaZipFile_a26d2ee56aad947193b73052f80597ef0} to get error code. + +References QuaZip::getMode(), QuaZip::getUnzFile(), and QuaZip::mdUnzip. + + + +Referenced by size(). + +\index{QuaZipFile@{QuaZipFile}!getFileInfo@{getFileInfo}} +\index{getFileInfo@{getFileInfo}!QuaZipFile@{QuaZipFile}} +\subsubsection[{getFileInfo}]{\setlength{\rightskip}{0pt plus 5cm}bool QuaZipFile::getFileInfo ( +\begin{DoxyParamCaption} +\item[{{\bf QuaZipFileInfo} $\ast$}]{info} +\end{DoxyParamCaption} +)}\label{classQuaZipFile_ad3f5807329321be21b12c1ba5798b359} + + +Gets information about current file. + +This function does the same thing as calling \doxyref{QuaZip::getCurrentFileInfo()}{p.}{classQuaZip_a9c91a53ed4c2038e153c64bdc097ebe8} on the associated \doxyref{QuaZip}{p.}{classQuaZip} object, but you can not call getCurrentFileInfo() if the associated \doxyref{QuaZip}{p.}{classQuaZip} is internal (because you do not have access to it), while you still can call this function in that case. + +File must be open for reading before calling this function. + +Returns {\ttfamily false} in the case of an error. + +References QuaZip::getCurrentFileInfo(), QuaZip::getMode(), QuaZip::getZipError(), and QuaZip::mdUnzip. + +\index{QuaZipFile@{QuaZipFile}!close@{close}} +\index{close@{close}!QuaZipFile@{QuaZipFile}} +\subsubsection[{close}]{\setlength{\rightskip}{0pt plus 5cm}void QuaZipFile::close ( +\begin{DoxyParamCaption} +{} +\end{DoxyParamCaption} +)\hspace{0.3cm}{\ttfamily [virtual]}}\label{classQuaZipFile_a42a39b12619bccd3d419ee60bbb3fcf6} + + +Closes the file. + +Call \doxyref{getZipError()}{p.}{classQuaZipFile_a26d2ee56aad947193b73052f80597ef0} to determine if the close was successful. + +References QuaZip::close(), QuaZip::getUnzFile(), QuaZip::getZipError(), QuaZip::getZipFile(), QuaZip::isOpen(), and isRaw(). + + + +Referenced by $\sim$QuaZipFile(). + + + +The documentation for this class was generated from the following files:\begin{DoxyCompactItemize} +\item +quazip/quazipfile.h\item +quazip/quazipfile.cpp\end{DoxyCompactItemize} diff --git a/3rdparty/quazip-0.5.1/doc/latex/classQuaZipFilePrivate.tex b/3rdparty/quazip-0.5.1/doc/latex/classQuaZipFilePrivate.tex new file mode 100644 index 00000000..10a0ab7a --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/latex/classQuaZipFilePrivate.tex @@ -0,0 +1,31 @@ +\section{QuaZipFilePrivate Class Reference} +\label{classQuaZipFilePrivate}\index{QuaZipFilePrivate@{QuaZipFilePrivate}} + + +The implementation class for \doxyref{QuaZip}{p.}{classQuaZip}. + + + + +Collaboration diagram for QuaZipFilePrivate: +\nopagebreak +\begin{figure}[H] +\begin{center} +\leavevmode +\includegraphics[width=231pt]{classQuaZipFilePrivate__coll__graph} +\end{center} +\end{figure} +\subsection*{Friends} +\begin{DoxyCompactItemize} +\item +class {\bf QuaZipFile}\label{classQuaZipFilePrivate_a40bd4ccb6d2d00726e1de81329ebaa7a} + +\end{DoxyCompactItemize} + + +\subsection{Detailed Description} +The implementation class for \doxyref{QuaZip}{p.}{classQuaZip}. + +The documentation for this class was generated from the following file:\begin{DoxyCompactItemize} +\item +quazip/quazipfile.cpp\end{DoxyCompactItemize} diff --git a/3rdparty/quazip-0.5.1/doc/latex/classQuaZipFilePrivate__coll__graph.eps b/3rdparty/quazip-0.5.1/doc/latex/classQuaZipFilePrivate__coll__graph.eps new file mode 100644 index 00000000..5836e7f1 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/latex/classQuaZipFilePrivate__coll__graph.eps @@ -0,0 +1,414 @@ +%!PS-Adobe-3.0 +%%Creator: graphviz version 2.28.0 (20110507.0327) +%%Title: G +%%Pages: (atend) +%%BoundingBox: (atend) +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval +EncodingVector 45 /hyphen put + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw text fitted to its expected width +/alignedtext { % width text + /text exch def + /width exch def + gsave + width 0 gt { + [] 0 setdash + text stringwidth pop width exch sub text length div 0 text ashow + } if + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +setupLatin1 +%%Page: 1 1 +%%PageBoundingBox: 36 36 231 200 +%%PageOrientation: Portrait +0 0 1 beginpage +gsave +36 36 195 164 boxprim clip newpath +1 1 set_scale 0 rotate 40 41 translate +% Node1 +gsave +0 0 0.74902 nodecolor +newpath 0 68.5 moveto +0 87.5 lineto +92 87.5 lineto +92 68.5 lineto +closepath fill +1 setlinewidth +filled +0 0 0 nodecolor +newpath 0 68.5 moveto +0 87.5 lineto +92 87.5 lineto +92 68.5 lineto +closepath stroke +0 0 0 nodecolor +10 /Helvetica set_font +8 75.5 moveto 76 (QuaZipFilePrivate) alignedtext +grestore +% Node4 +gsave +[ /Rect [ 14.5 0 77 20 ] + /Border [ 0 0 0 ] + /Action << /Subtype /URI /URI ($classQuaZipFile.html) >> + /Subtype /Link +/ANN pdfmark +0 0 1 nodecolor +newpath 14.5 .5 moveto +14.5 19.5 lineto +77.5 19.5 lineto +77.5 .5 lineto +closepath fill +1 setlinewidth +filled +0 0 0 nodecolor +newpath 14.5 .5 moveto +14.5 19.5 lineto +77.5 19.5 lineto +77.5 .5 lineto +closepath stroke +0 0 0 nodecolor +10 /Helvetica set_font +22.5 7.5 moveto 47 (QuaZipFile) alignedtext +grestore +% Node1->Node4 +gsave +1 setlinewidth +dashed +0.77647 0.75294 0.80392 edgecolor +newpath 37.93 58.6 moveto +35.99 52.14 34.78 44.79 36 38 curveto +37.13 31.7 39.63 24.95 41.85 19.78 curveto +stroke +0.77647 0.75294 0.80392 edgecolor +newpath 34.82 60.27 moveto +41.6 68.41 lineto +41.37 57.81 lineto +closepath fill +1 setlinewidth +solid +0.77647 0.75294 0.80392 edgecolor +newpath 34.82 60.27 moveto +41.6 68.41 lineto +41.37 57.81 lineto +closepath stroke +0 0 0 edgecolor +10 /Helvetica set_font +36 41.5 moveto 6 (p) alignedtext +grestore +% Node2 +gsave +[ /Rect [ 96.5 136 143 156 ] + /Border [ 0 0 0 ] + /Action << /Subtype /URI /URI ($classQuaZip.html) >> + /Subtype /Link +/ANN pdfmark +0 0 1 nodecolor +newpath 96.5 136.5 moveto +96.5 155.5 lineto +143.5 155.5 lineto +143.5 136.5 lineto +closepath fill +1 setlinewidth +filled +0 0 0 nodecolor +newpath 96.5 136.5 moveto +96.5 155.5 lineto +143.5 155.5 lineto +143.5 136.5 lineto +closepath stroke +0 0 0 nodecolor +10 /Helvetica set_font +104.5 143.5 moveto 31 (QuaZip) alignedtext +grestore +% Node2->Node1 +gsave +1 setlinewidth +dashed +0.77647 0.75294 0.80392 edgecolor +newpath 102.52 129.41 moveto +87.99 116.45 67.81 98.46 55.91 87.84 curveto +stroke +0.77647 0.75294 0.80392 edgecolor +newpath 100.53 132.33 moveto +110.33 136.37 lineto +105.19 127.1 lineto +closepath fill +1 setlinewidth +solid +0.77647 0.75294 0.80392 edgecolor +newpath 100.53 132.33 moveto +110.33 136.37 lineto +105.19 127.1 lineto +closepath stroke +0 0 0 edgecolor +10 /Helvetica set_font +90 109.5 moveto 13 (zip) alignedtext +grestore +% Node3 +gsave +[ /Rect [ 110.5 68 187 88 ] + /Border [ 0 0 0 ] + /Action << /Subtype /URI /URI ($classQuaZipPrivate.html) >> + /Subtype /Link +/ANN pdfmark +0 0 1 nodecolor +newpath 110.5 68.5 moveto +110.5 87.5 lineto +187.5 87.5 lineto +187.5 68.5 lineto +closepath fill +1 setlinewidth +filled +0 0 0 nodecolor +newpath 110.5 68.5 moveto +110.5 87.5 lineto +187.5 87.5 lineto +187.5 68.5 lineto +closepath stroke +0 0 0 nodecolor +10 /Helvetica set_font +118.5 75.5 moveto 61 (QuaZipPrivate) alignedtext +grestore +% Node2->Node3 +gsave +1 setlinewidth +dashed +0.77647 0.75294 0.80392 edgecolor +newpath 119.52 126.1 moveto +119.97 119.5 121.2 112.2 124 106 curveto +127.21 98.9 133.04 92.43 138.26 87.61 curveto +stroke +0.77647 0.75294 0.80392 edgecolor +newpath 116.02 126.17 moveto +119.35 136.23 lineto +123.02 126.29 lineto +closepath fill +1 setlinewidth +solid +0.77647 0.75294 0.80392 edgecolor +newpath 116.02 126.17 moveto +119.35 136.23 lineto +123.02 126.29 lineto +closepath stroke +0 0 0 edgecolor +10 /Helvetica set_font +124 109.5 moveto 6 (q) alignedtext +grestore +% Node3->Node2 +gsave +1 setlinewidth +dashed +0.77647 0.75294 0.80392 edgecolor +newpath 141.05 97.09 moveto +135.43 109.87 128.15 126.45 123.79 136.37 curveto +stroke +0.77647 0.75294 0.80392 edgecolor +newpath 144.3 98.4 moveto +145.12 87.84 lineto +137.89 95.59 lineto +closepath fill +1 setlinewidth +solid +0.77647 0.75294 0.80392 edgecolor +newpath 144.3 98.4 moveto +145.12 87.84 lineto +137.89 95.59 lineto +closepath stroke +0 0 0 edgecolor +10 /Helvetica set_font +138 109.5 moveto 6 (p) alignedtext +grestore +% Node4->Node1 +gsave +1 setlinewidth +dashed +0.77647 0.75294 0.80392 edgecolor +newpath 46 29.85 moveto +46 42.53 46 58.64 46 68.37 curveto +stroke +0.77647 0.75294 0.80392 edgecolor +newpath 49.5 29.84 moveto +46 19.84 lineto +42.5 29.84 lineto +closepath fill +1 setlinewidth +solid +0.77647 0.75294 0.80392 edgecolor +newpath 49.5 29.84 moveto +46 19.84 lineto +42.5 29.84 lineto +closepath stroke +0 0 0 edgecolor +10 /Helvetica set_font +46 41.5 moveto 6 (q) alignedtext +grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +%%BoundingBox: 36 36 231 200 +end +restore +%%EOF diff --git a/3rdparty/quazip-0.5.1/doc/latex/classQuaZipFilePrivate__coll__graph.md5 b/3rdparty/quazip-0.5.1/doc/latex/classQuaZipFilePrivate__coll__graph.md5 new file mode 100644 index 00000000..74bb2c1e --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/latex/classQuaZipFilePrivate__coll__graph.md5 @@ -0,0 +1 @@ +1f8ac6d56acdc49496bc99c52404e6a3 \ No newline at end of file diff --git a/3rdparty/quazip-0.5.1/doc/latex/classQuaZipFile__coll__graph.eps b/3rdparty/quazip-0.5.1/doc/latex/classQuaZipFile__coll__graph.eps new file mode 100644 index 00000000..04b3c055 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/latex/classQuaZipFile__coll__graph.eps @@ -0,0 +1,414 @@ +%!PS-Adobe-3.0 +%%Creator: graphviz version 2.28.0 (20110507.0327) +%%Title: G +%%Pages: (atend) +%%BoundingBox: (atend) +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval +EncodingVector 45 /hyphen put + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw text fitted to its expected width +/alignedtext { % width text + /text exch def + /width exch def + gsave + width 0 gt { + [] 0 setdash + text stringwidth pop width exch sub text length div 0 text ashow + } if + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +setupLatin1 +%%Page: 1 1 +%%PageBoundingBox: 36 36 231 132 +%%PageOrientation: Portrait +0 0 1 beginpage +gsave +36 36 195 96 boxprim clip newpath +1 1 set_scale 0 rotate 40 41 translate +% Node1 +gsave +0 0 0.74902 nodecolor +newpath 2.5 68.5 moveto +2.5 87.5 lineto +65.5 87.5 lineto +65.5 68.5 lineto +closepath fill +1 setlinewidth +filled +0 0 0 nodecolor +newpath 2.5 68.5 moveto +2.5 87.5 lineto +65.5 87.5 lineto +65.5 68.5 lineto +closepath stroke +0 0 0 nodecolor +10 /Helvetica set_font +10.5 75.5 moveto 47 (QuaZipFile) alignedtext +grestore +% Node2 +gsave +[ /Rect [ 0 0 92 20 ] + /Border [ 0 0 0 ] + /Action << /Subtype /URI /URI ($classQuaZipFilePrivate.html) >> + /Subtype /Link +/ANN pdfmark +0 0 1 nodecolor +newpath 0 .5 moveto +0 19.5 lineto +92 19.5 lineto +92 .5 lineto +closepath fill +1 setlinewidth +filled +0 0 0 nodecolor +newpath 0 .5 moveto +0 19.5 lineto +92 19.5 lineto +92 .5 lineto +closepath stroke +0 0 0 nodecolor +10 /Helvetica set_font +8 7.5 moveto 76 (QuaZipFilePrivate) alignedtext +grestore +% Node1->Node2 +gsave +1 setlinewidth +dashed +0.77647 0.75294 0.80392 edgecolor +newpath 28.58 58.5 moveto +27.46 51.93 27.11 44.55 29 38 curveto +30.9 31.4 34.95 24.86 38.62 19.87 curveto +stroke +0.77647 0.75294 0.80392 edgecolor +newpath 25.24 59.56 moveto +30.96 68.48 lineto +32.05 57.94 lineto +closepath fill +1 setlinewidth +solid +0.77647 0.75294 0.80392 edgecolor +newpath 25.24 59.56 moveto +30.96 68.48 lineto +32.05 57.94 lineto +closepath stroke +0 0 0 edgecolor +10 /Helvetica set_font +29 41.5 moveto 6 (q) alignedtext +grestore +% Node2->Node1 +gsave +1 setlinewidth +dashed +0.77647 0.75294 0.80392 edgecolor +newpath 42.57 29.85 moveto +40.27 42.53 37.34 58.64 35.57 68.37 curveto +stroke +0.77647 0.75294 0.80392 edgecolor +newpath 46.05 30.31 moveto +44.39 19.84 lineto +39.16 29.05 lineto +closepath fill +1 setlinewidth +solid +0.77647 0.75294 0.80392 edgecolor +newpath 46.05 30.31 moveto +44.39 19.84 lineto +39.16 29.05 lineto +closepath stroke +0 0 0 edgecolor +10 /Helvetica set_font +42 41.5 moveto 6 (p) alignedtext +grestore +% Node3 +gsave +[ /Rect [ 96.5 68 143 88 ] + /Border [ 0 0 0 ] + /Action << /Subtype /URI /URI ($classQuaZip.html) >> + /Subtype /Link +/ANN pdfmark +0 0 1 nodecolor +newpath 96.5 68.5 moveto +96.5 87.5 lineto +143.5 87.5 lineto +143.5 68.5 lineto +closepath fill +1 setlinewidth +filled +0 0 0 nodecolor +newpath 96.5 68.5 moveto +96.5 87.5 lineto +143.5 87.5 lineto +143.5 68.5 lineto +closepath stroke +0 0 0 nodecolor +10 /Helvetica set_font +104.5 75.5 moveto 31 (QuaZip) alignedtext +grestore +% Node3->Node2 +gsave +1 setlinewidth +dashed +0.77647 0.75294 0.80392 edgecolor +newpath 102.52 61.41 moveto +87.99 48.45 67.81 30.46 55.91 19.84 curveto +stroke +0.77647 0.75294 0.80392 edgecolor +newpath 100.53 64.33 moveto +110.33 68.37 lineto +105.19 59.1 lineto +closepath fill +1 setlinewidth +solid +0.77647 0.75294 0.80392 edgecolor +newpath 100.53 64.33 moveto +110.33 68.37 lineto +105.19 59.1 lineto +closepath stroke +0 0 0 edgecolor +10 /Helvetica set_font +90 41.5 moveto 13 (zip) alignedtext +grestore +% Node4 +gsave +[ /Rect [ 110.5 0 187 20 ] + /Border [ 0 0 0 ] + /Action << /Subtype /URI /URI ($classQuaZipPrivate.html) >> + /Subtype /Link +/ANN pdfmark +0 0 1 nodecolor +newpath 110.5 .5 moveto +110.5 19.5 lineto +187.5 19.5 lineto +187.5 .5 lineto +closepath fill +1 setlinewidth +filled +0 0 0 nodecolor +newpath 110.5 .5 moveto +110.5 19.5 lineto +187.5 19.5 lineto +187.5 .5 lineto +closepath stroke +0 0 0 nodecolor +10 /Helvetica set_font +118.5 7.5 moveto 61 (QuaZipPrivate) alignedtext +grestore +% Node3->Node4 +gsave +1 setlinewidth +dashed +0.77647 0.75294 0.80392 edgecolor +newpath 119.52 58.1 moveto +119.97 51.5 121.2 44.2 124 38 curveto +127.21 30.9 133.04 24.43 138.26 19.61 curveto +stroke +0.77647 0.75294 0.80392 edgecolor +newpath 116.02 58.17 moveto +119.35 68.23 lineto +123.02 58.29 lineto +closepath fill +1 setlinewidth +solid +0.77647 0.75294 0.80392 edgecolor +newpath 116.02 58.17 moveto +119.35 68.23 lineto +123.02 58.29 lineto +closepath stroke +0 0 0 edgecolor +10 /Helvetica set_font +124 41.5 moveto 6 (q) alignedtext +grestore +% Node4->Node3 +gsave +1 setlinewidth +dashed +0.77647 0.75294 0.80392 edgecolor +newpath 141.05 29.09 moveto +135.43 41.87 128.15 58.45 123.79 68.37 curveto +stroke +0.77647 0.75294 0.80392 edgecolor +newpath 144.3 30.4 moveto +145.12 19.84 lineto +137.89 27.59 lineto +closepath fill +1 setlinewidth +solid +0.77647 0.75294 0.80392 edgecolor +newpath 144.3 30.4 moveto +145.12 19.84 lineto +137.89 27.59 lineto +closepath stroke +0 0 0 edgecolor +10 /Helvetica set_font +138 41.5 moveto 6 (p) alignedtext +grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +%%BoundingBox: 36 36 231 132 +end +restore +%%EOF diff --git a/3rdparty/quazip-0.5.1/doc/latex/classQuaZipFile__coll__graph.md5 b/3rdparty/quazip-0.5.1/doc/latex/classQuaZipFile__coll__graph.md5 new file mode 100644 index 00000000..7db5e126 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/latex/classQuaZipFile__coll__graph.md5 @@ -0,0 +1 @@ +d4c12e105f1f89650e643227b7eb6b67 \ No newline at end of file diff --git a/3rdparty/quazip-0.5.1/doc/latex/classQuaZipPrivate.tex b/3rdparty/quazip-0.5.1/doc/latex/classQuaZipPrivate.tex new file mode 100644 index 00000000..452b3838 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/latex/classQuaZipPrivate.tex @@ -0,0 +1,31 @@ +\section{QuaZipPrivate Class Reference} +\label{classQuaZipPrivate}\index{QuaZipPrivate@{QuaZipPrivate}} + + +All the internal stuff for the \doxyref{QuaZip}{p.}{classQuaZip} class. + + + + +Collaboration diagram for QuaZipPrivate: +\nopagebreak +\begin{figure}[H] +\begin{center} +\leavevmode +\includegraphics[width=120pt]{classQuaZipPrivate__coll__graph} +\end{center} +\end{figure} +\subsection*{Friends} +\begin{DoxyCompactItemize} +\item +class {\bf QuaZip}\label{classQuaZipPrivate_a913fb7bbd3527119ebb8052d57132af2} + +\end{DoxyCompactItemize} + + +\subsection{Detailed Description} +All the internal stuff for the \doxyref{QuaZip}{p.}{classQuaZip} class. + +The documentation for this class was generated from the following file:\begin{DoxyCompactItemize} +\item +quazip/quazip.cpp\end{DoxyCompactItemize} diff --git a/3rdparty/quazip-0.5.1/doc/latex/classQuaZipPrivate__coll__graph.eps b/3rdparty/quazip-0.5.1/doc/latex/classQuaZipPrivate__coll__graph.eps new file mode 100644 index 00000000..5094a8e8 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/latex/classQuaZipPrivate__coll__graph.eps @@ -0,0 +1,291 @@ +%!PS-Adobe-3.0 +%%Creator: graphviz version 2.28.0 (20110507.0327) +%%Title: G +%%Pages: (atend) +%%BoundingBox: (atend) +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval +EncodingVector 45 /hyphen put + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw text fitted to its expected width +/alignedtext { % width text + /text exch def + /width exch def + gsave + width 0 gt { + [] 0 setdash + text stringwidth pop width exch sub text length div 0 text ashow + } if + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +setupLatin1 +%%Page: 1 1 +%%PageBoundingBox: 36 36 120 132 +%%PageOrientation: Portrait +0 0 1 beginpage +gsave +36 36 84 96 boxprim clip newpath +1 1 set_scale 0 rotate 40 41 translate +% Node1 +gsave +0 0 0.74902 nodecolor +newpath -.5 68.5 moveto +-.5 87.5 lineto +76.5 87.5 lineto +76.5 68.5 lineto +closepath fill +1 setlinewidth +filled +0 0 0 nodecolor +newpath -.5 68.5 moveto +-.5 87.5 lineto +76.5 87.5 lineto +76.5 68.5 lineto +closepath stroke +0 0 0 nodecolor +10 /Helvetica set_font +7.5 75.5 moveto 61 (QuaZipPrivate) alignedtext +grestore +% Node2 +gsave +[ /Rect [ 14.5 0 61 20 ] + /Border [ 0 0 0 ] + /Action << /Subtype /URI /URI ($classQuaZip.html) >> + /Subtype /Link +/ANN pdfmark +0 0 1 nodecolor +newpath 14.5 .5 moveto +14.5 19.5 lineto +61.5 19.5 lineto +61.5 .5 lineto +closepath fill +1 setlinewidth +filled +0 0 0 nodecolor +newpath 14.5 .5 moveto +14.5 19.5 lineto +61.5 19.5 lineto +61.5 .5 lineto +closepath stroke +0 0 0 nodecolor +10 /Helvetica set_font +22.5 7.5 moveto 31 (QuaZip) alignedtext +grestore +% Node1->Node2 +gsave +1 setlinewidth +dashed +0.77647 0.75294 0.80392 edgecolor +newpath 30.23 58.65 moveto +29.3 55.8 28.51 52.85 28 50 curveto +26.1 39.4 30.11 27.44 33.6 19.59 curveto +stroke +0.77647 0.75294 0.80392 edgecolor +newpath 27.03 60.11 moveto +33.85 68.22 lineto +33.58 57.63 lineto +closepath fill +1 setlinewidth +solid +0.77647 0.75294 0.80392 edgecolor +newpath 27.03 60.11 moveto +33.85 68.22 lineto +33.58 57.63 lineto +closepath stroke +0 0 0 edgecolor +10 /Helvetica set_font +28 41.5 moveto 6 (p) alignedtext +grestore +% Node2->Node1 +gsave +1 setlinewidth +dashed +0.77647 0.75294 0.80392 edgecolor +newpath 38 29.85 moveto +38 42.53 38 58.64 38 68.37 curveto +stroke +0.77647 0.75294 0.80392 edgecolor +newpath 41.5 29.84 moveto +38 19.84 lineto +34.5 29.84 lineto +closepath fill +1 setlinewidth +solid +0.77647 0.75294 0.80392 edgecolor +newpath 41.5 29.84 moveto +38 19.84 lineto +34.5 29.84 lineto +closepath stroke +0 0 0 edgecolor +10 /Helvetica set_font +38 41.5 moveto 6 (q) alignedtext +grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +%%BoundingBox: 36 36 120 132 +end +restore +%%EOF diff --git a/3rdparty/quazip-0.5.1/doc/latex/classQuaZipPrivate__coll__graph.md5 b/3rdparty/quazip-0.5.1/doc/latex/classQuaZipPrivate__coll__graph.md5 new file mode 100644 index 00000000..04f81a03 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/latex/classQuaZipPrivate__coll__graph.md5 @@ -0,0 +1 @@ +03e89dfdd147054460a64a46c1bdc9c2 \ No newline at end of file diff --git a/3rdparty/quazip-0.5.1/doc/latex/classQuaZip__coll__graph.eps b/3rdparty/quazip-0.5.1/doc/latex/classQuaZip__coll__graph.eps new file mode 100644 index 00000000..4affa4c1 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/latex/classQuaZip__coll__graph.eps @@ -0,0 +1,291 @@ +%!PS-Adobe-3.0 +%%Creator: graphviz version 2.28.0 (20110507.0327) +%%Title: G +%%Pages: (atend) +%%BoundingBox: (atend) +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval +EncodingVector 45 /hyphen put + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw text fitted to its expected width +/alignedtext { % width text + /text exch def + /width exch def + gsave + width 0 gt { + [] 0 setdash + text stringwidth pop width exch sub text length div 0 text ashow + } if + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +setupLatin1 +%%Page: 1 1 +%%PageBoundingBox: 36 36 120 132 +%%PageOrientation: Portrait +0 0 1 beginpage +gsave +36 36 84 96 boxprim clip newpath +1 1 set_scale 0 rotate 40 41 translate +% Node1 +gsave +0 0 0.74902 nodecolor +newpath 14.5 68.5 moveto +14.5 87.5 lineto +61.5 87.5 lineto +61.5 68.5 lineto +closepath fill +1 setlinewidth +filled +0 0 0 nodecolor +newpath 14.5 68.5 moveto +14.5 87.5 lineto +61.5 87.5 lineto +61.5 68.5 lineto +closepath stroke +0 0 0 nodecolor +10 /Helvetica set_font +22.5 75.5 moveto 31 (QuaZip) alignedtext +grestore +% Node2 +gsave +[ /Rect [ -.5 0 76 20 ] + /Border [ 0 0 0 ] + /Action << /Subtype /URI /URI ($classQuaZipPrivate.html) >> + /Subtype /Link +/ANN pdfmark +0 0 1 nodecolor +newpath -.5 .5 moveto +-.5 19.5 lineto +76.5 19.5 lineto +76.5 .5 lineto +closepath fill +1 setlinewidth +filled +0 0 0 nodecolor +newpath -.5 .5 moveto +-.5 19.5 lineto +76.5 19.5 lineto +76.5 .5 lineto +closepath stroke +0 0 0 nodecolor +10 /Helvetica set_font +7.5 7.5 moveto 61 (QuaZipPrivate) alignedtext +grestore +% Node1->Node2 +gsave +1 setlinewidth +dashed +0.77647 0.75294 0.80392 edgecolor +newpath 30.23 58.65 moveto +29.3 55.8 28.51 52.85 28 50 curveto +26.1 39.4 30.11 27.44 33.6 19.59 curveto +stroke +0.77647 0.75294 0.80392 edgecolor +newpath 27.03 60.11 moveto +33.85 68.22 lineto +33.58 57.63 lineto +closepath fill +1 setlinewidth +solid +0.77647 0.75294 0.80392 edgecolor +newpath 27.03 60.11 moveto +33.85 68.22 lineto +33.58 57.63 lineto +closepath stroke +0 0 0 edgecolor +10 /Helvetica set_font +28 41.5 moveto 6 (q) alignedtext +grestore +% Node2->Node1 +gsave +1 setlinewidth +dashed +0.77647 0.75294 0.80392 edgecolor +newpath 38 29.85 moveto +38 42.53 38 58.64 38 68.37 curveto +stroke +0.77647 0.75294 0.80392 edgecolor +newpath 41.5 29.84 moveto +38 19.84 lineto +34.5 29.84 lineto +closepath fill +1 setlinewidth +solid +0.77647 0.75294 0.80392 edgecolor +newpath 41.5 29.84 moveto +38 19.84 lineto +34.5 29.84 lineto +closepath stroke +0 0 0 edgecolor +10 /Helvetica set_font +38 41.5 moveto 6 (p) alignedtext +grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +%%BoundingBox: 36 36 120 132 +end +restore +%%EOF diff --git a/3rdparty/quazip-0.5.1/doc/latex/classQuaZip__coll__graph.md5 b/3rdparty/quazip-0.5.1/doc/latex/classQuaZip__coll__graph.md5 new file mode 100644 index 00000000..303660b1 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/latex/classQuaZip__coll__graph.md5 @@ -0,0 +1 @@ +285ae05030356ab7fd5c5be4e423dbb5 \ No newline at end of file diff --git a/3rdparty/quazip-0.5.1/doc/latex/dir_6b1d21316abab84c9bd8ed600604809a.tex b/3rdparty/quazip-0.5.1/doc/latex/dir_6b1d21316abab84c9bd8ed600604809a.tex new file mode 100644 index 00000000..4f71ee51 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/latex/dir_6b1d21316abab84c9bd8ed600604809a.tex @@ -0,0 +1,59 @@ +\section{quazip/ Directory Reference} +\label{dir_6b1d21316abab84c9bd8ed600604809a}\index{quazip/ Directory Reference@{quazip/ Directory Reference}} +Directory dependency graph for quazip/: +\nopagebreak +\begin{figure}[H] +\begin{center} +\leavevmode +\includegraphics[width=98pt]{dir_6b1d21316abab84c9bd8ed600604809a_dep} +\end{center} +\end{figure} +\subsection*{Files} +\begin{DoxyCompactItemize} +\item +file {\bfseries JlCompress.cpp} +\item +file {\bfseries JlCompress.h} +\item +file {\bfseries qioapi.cpp} +\item +file {\bfseries quaadler32.cpp} +\item +file {\bfseries quaadler32.h} +\item +file {\bfseries quachecksum32.h} +\item +file {\bfseries quacrc32.cpp} +\item +file {\bfseries quacrc32.h} +\item +file {\bfseries quagzipfile.cpp} +\item +file {\bfseries quagzipfile.h} +\item +file {\bfseries quaziodevice.cpp} +\item +file {\bfseries quaziodevice.h} +\item +file {\bfseries quazip.cpp} +\item +file {\bfseries quazip.h} +\item +file {\bfseries quazip\_\-global.h} +\item +file {\bfseries quazipdir.cpp} +\item +file {\bfseries quazipdir.h} +\item +file {\bfseries quazipfile.cpp} +\item +file {\bfseries quazipfile.h} +\item +file {\bfseries quazipfileinfo.cpp} +\item +file {\bfseries quazipfileinfo.h} +\item +file {\bfseries quazipnewinfo.cpp} +\item +file {\bfseries quazipnewinfo.h} +\end{DoxyCompactItemize} diff --git a/3rdparty/quazip-0.5.1/doc/latex/dir_6b1d21316abab84c9bd8ed600604809a_dep.eps b/3rdparty/quazip-0.5.1/doc/latex/dir_6b1d21316abab84c9bd8ed600604809a_dep.eps new file mode 100644 index 00000000..2a17a1c0 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/latex/dir_6b1d21316abab84c9bd8ed600604809a_dep.eps @@ -0,0 +1,222 @@ +%!PS-Adobe-3.0 +%%Creator: graphviz version 2.28.0 (20110507.0327) +%%Title: G +%%Pages: (atend) +%%BoundingBox: (atend) +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval +EncodingVector 45 /hyphen put + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw text fitted to its expected width +/alignedtext { % width text + /text exch def + /width exch def + gsave + width 0 gt { + [] 0 setdash + text stringwidth pop width exch sub text length div 0 text ashow + } if + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +setupLatin1 +%%Page: 1 1 +%%PageBoundingBox: 36 36 98 80 +%%PageOrientation: Portrait +0 0 1 beginpage +gsave +36 36 62 44 boxprim clip newpath +1 1 set_scale 0 rotate 40 41 translate +% dir_6b1d21316abab84c9bd8ed600604809a +gsave +[ /Rect [ 0 0 54 36 ] + /Border [ 0 0 0 ] + /Action << /Subtype /URI /URI (dir_6b1d21316abab84c9bd8ed600604809a.html) >> + /Subtype /Link +/ANN pdfmark +0.66667 0.066667 1 nodecolor +newpath 54 36 moveto +0 36 lineto +0 0 lineto +54 0 lineto +closepath fill +1 setlinewidth +filled +0 0 0 nodecolor +newpath 54 36 moveto +0 36 lineto +0 0 lineto +54 0 lineto +closepath stroke +0 0 0 nodecolor +10 /Helvetica set_font +12.5 15.5 moveto 29 (quazip) alignedtext +grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +%%BoundingBox: 36 36 98 80 +end +restore +%%EOF diff --git a/3rdparty/quazip-0.5.1/doc/latex/dir_6b1d21316abab84c9bd8ed600604809a_dep.md5 b/3rdparty/quazip-0.5.1/doc/latex/dir_6b1d21316abab84c9bd8ed600604809a_dep.md5 new file mode 100644 index 00000000..a8036c98 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/latex/dir_6b1d21316abab84c9bd8ed600604809a_dep.md5 @@ -0,0 +1 @@ +fae3a2113ceca135f02b2457a94c54e0 \ No newline at end of file diff --git a/3rdparty/quazip-0.5.1/doc/latex/dirs.tex b/3rdparty/quazip-0.5.1/doc/latex/dirs.tex new file mode 100644 index 00000000..f16312cf --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/latex/dirs.tex @@ -0,0 +1,4 @@ +\section{Directories} +This directory hierarchy is sorted roughly, but not completely, alphabetically:\begin{DoxyCompactList} +\item \contentsline{section}{quazip}{\pageref{dir_6b1d21316abab84c9bd8ed600604809a}}{} +\end{DoxyCompactList} diff --git a/3rdparty/quazip-0.5.1/doc/latex/doxygen.sty b/3rdparty/quazip-0.5.1/doc/latex/doxygen.sty new file mode 100644 index 00000000..7586ebe3 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/latex/doxygen.sty @@ -0,0 +1,416 @@ +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{doxygen} + +% Packages used by this style file +\RequirePackage{alltt} +\RequirePackage{array} +\RequirePackage{calc} +\RequirePackage{color} +\RequirePackage{fancyhdr} +\RequirePackage{longtable} +\RequirePackage{verbatim} +\RequirePackage{ifthen} +\RequirePackage[table]{xcolor} + +% Use helvetica font instead of times roman +\RequirePackage{helvet} +\RequirePackage{sectsty} +\RequirePackage{tocloft} +\providecommand{\rmdefault}{phv} +\providecommand{\bfdefault}{bc} + + +% Setup fancy headings +\pagestyle{fancyplain} +\newcommand{\clearemptydoublepage}{% + \newpage{\pagestyle{empty}\cleardoublepage}% +} +\renewcommand{\chaptermark}[1]{% + \markboth{#1}{}% +} +\renewcommand{\sectionmark}[1]{% + \markright{\thesection\ #1}% +} +\fancyhead[LE]{\fancyplain{}{\bfseries\thepage}} +\fancyhead[CE]{\fancyplain{}{}} +\fancyhead[RE]{\fancyplain{}{\bfseries\leftmark}} +\fancyhead[LO]{\fancyplain{}{\bfseries\rightmark}} +\fancyhead[CO]{\fancyplain{}{}} +\fancyhead[RO]{\fancyplain{}{\bfseries\thepage}} +\fancyfoot[LE]{\fancyplain{}{}} +\fancyfoot[CE]{\fancyplain{}{}} +\fancyfoot[RE]{\fancyplain{}{\bfseries\scriptsize Generated on Sat Mar 2 2013 11:05:10 for QuaZIP by Doxygen }} +\fancyfoot[LO]{\fancyplain{}{\bfseries\scriptsize Generated on Sat Mar 2 2013 11:05:10 for QuaZIP by Doxygen }} +\fancyfoot[CO]{\fancyplain{}{}} +\fancyfoot[RO]{\fancyplain{}{}} +%---------- Internal commands used in this style file ---------------- + +% Generic environment used by all paragraph-based environments defined +% below. Note that the command \title{...} needs to be defined inside +% those environments! +\newenvironment{DoxyDesc}[1]{% + \begin{list}{}% + {% + \settowidth{\labelwidth}{40pt}% + \setlength{\leftmargin}{\labelwidth}% + \setlength{\parsep}{0pt}% + \setlength{\itemsep}{-4pt}% + \renewcommand{\makelabel}{\entrylabel}% + }% + \item[#1]% +}{% + \end{list}% +} + +%---------- Commands used by doxygen LaTeX output generator ---------- + +% Used by
 ... 
+\newenvironment{DoxyPre}{% + \small% + \begin{alltt}% +}{% + \end{alltt}% + \normalsize% +} + +% Used by @code ... @endcode +\newenvironment{DoxyCode}{% + \footnotesize% + \verbatim% +}{% + \endverbatim% + \normalsize% +} + +% Used by @example, @include, @includelineno and @dontinclude +\newenvironment{DoxyCodeInclude}{% + \DoxyCode% +}{% + \endDoxyCode% +} + +% Used by @verbatim ... @endverbatim +\newenvironment{DoxyVerb}{% + \footnotesize% + \verbatim% +}{% + \endverbatim% + \normalsize% +} + +% Used by @verbinclude +\newenvironment{DoxyVerbInclude}{% + \DoxyVerb% +}{% + \endDoxyVerb% +} + +% Used by numbered lists (using '-#' or
    ...
) +\newenvironment{DoxyEnumerate}{% + \enumerate% +}{% + \endenumerate% +} + +% Used by bullet lists (using '-', @li, @arg, or
    ...
) +\newenvironment{DoxyItemize}{% + \itemize% +}{% + \enditemize% +} + +% Used by description lists (using
...
) +\newenvironment{DoxyDescription}{% + \description% +}{% + \enddescription% +} + +% Used by @image, @dotfile, and @dot ... @enddot +% (only if caption is specified) +\newenvironment{DoxyImage}{% + \begin{figure}[H]% + \begin{center}% +}{% + \end{center}% + \end{figure}% +} + +% Used by @image, @dotfile, @dot ... @enddot, and @msc ... @endmsc +% (only if no caption is specified) +\newenvironment{DoxyImageNoCaption}{% +}{% +} + +% Used by @attention +\newenvironment{DoxyAttention}[1]{% + \begin{DoxyDesc}{#1}% +}{% + \end{DoxyDesc}% +} + +% Used by @author and @authors +\newenvironment{DoxyAuthor}[1]{% + \begin{DoxyDesc}{#1}% +}{% + \end{DoxyDesc}% +} + +% Used by @date +\newenvironment{DoxyDate}[1]{% + \begin{DoxyDesc}{#1}% +}{% + \end{DoxyDesc}% +} + +% Used by @invariant +\newenvironment{DoxyInvariant}[1]{% + \begin{DoxyDesc}{#1}% +}{% + \end{DoxyDesc}% +} + +% Used by @note +\newenvironment{DoxyNote}[1]{% + \begin{DoxyDesc}{#1}% +}{% + \end{DoxyDesc}% +} + +% Used by @post +\newenvironment{DoxyPostcond}[1]{% + \begin{DoxyDesc}{#1}% +}{% + \end{DoxyDesc}% +} + +% Used by @pre +\newenvironment{DoxyPrecond}[1]{% + \begin{DoxyDesc}{#1}% +}{% + \end{DoxyDesc}% +} + +% Used by @remark +\newenvironment{DoxyRemark}[1]{% + \begin{DoxyDesc}{#1}% +}{% + \end{DoxyDesc}% +} + +% Used by @return +\newenvironment{DoxyReturn}[1]{% + \begin{DoxyDesc}{#1}% +}{% + \end{DoxyDesc}% +} + +% Used by @since +\newenvironment{DoxySince}[1]{% + \begin{DoxyDesc}{#1}% +}{% + \end{DoxyDesc}% +} + +% Used by @see +\newenvironment{DoxySeeAlso}[1]{% + \begin{DoxyDesc}{#1}% +}{% + \end{DoxyDesc}% +} + +% Used by @version +\newenvironment{DoxyVersion}[1]{% + \begin{DoxyDesc}{#1}% +}{% + \end{DoxyDesc}% +} + +% Used by @warning +\newenvironment{DoxyWarning}[1]{% + \begin{DoxyDesc}{#1}% +}{% + \end{DoxyDesc}% +} + +% Used by @internal +\newenvironment{DoxyInternal}[1]{% + \paragraph*{#1}% +}{% +} + +% Used by @par and @paragraph +\newenvironment{DoxyParagraph}[1]{% + \begin{list}{}% + {% + \settowidth{\labelwidth}{40pt}% + \setlength{\leftmargin}{\labelwidth}% + \setlength{\parsep}{0pt}% + \setlength{\itemsep}{-4pt}% + \renewcommand{\makelabel}{\entrylabel}% + }% + \item[#1]% +}{% + \end{list}% +} + +% Used by parameter lists +\newenvironment{DoxyParams}[2][]{% + \begin{DoxyDesc}{#2}% + \begin{description}% + \item[] \hspace{\fill} \vspace{-25pt}% + \definecolor{tableShade}{HTML}{F8F8F8}% + \rowcolors{1}{white}{tableShade}% + \arrayrulecolor{gray}% + \setlength{\tabcolsep}{0.01\textwidth}% + \ifthenelse{\equal{#1}{}} + {\begin{longtable}{|>{\raggedleft\hspace{0pt}}p{0.15\textwidth}|% + p{0.87\textwidth}|}}% + {\ifthenelse{\equal{#1}{1}}% + {\begin{longtable}{|>{\centering}p{0.10\textwidth}|% + >{\raggedleft\hspace{0pt}}p{0.15\textwidth}|% + p{0.75\textwidth}|}}% + {\begin{longtable}{|>{\centering}p{0.10\textwidth}|% + >{\centering\hspace{0pt}}p{0.15\textwidth}|% + >{\raggedleft\hspace{0pt}}p{0.15\textwidth}|% + p{0.58\textwidth}|}}% + }\hline% +}{% + \end{longtable}% + \end{description}% + \end{DoxyDesc}% +} + +% is used for parameters within a detailed function description +\newenvironment{DoxyParamCaption}{% + \renewcommand{\item}[2][]{##1 {\em ##2}}% + }{% +} + +% Used by return value lists +\newenvironment{DoxyRetVals}[1]{% + \begin{DoxyDesc}{#1}% + \begin{description}% + \item[] \hspace{\fill} \vspace{-25pt}% + \definecolor{tableShade}{HTML}{F8F8F8}% + \rowcolors{1}{white}{tableShade}% + \arrayrulecolor{gray}% + \setlength{\tabcolsep}{0.01\textwidth}% + \begin{longtable}{|>{\raggedleft\hspace{0pt}}p{0.25\textwidth}|% + p{0.77\textwidth}|}% + \hline% +}{% + \end{longtable}% + \end{description}% + \end{DoxyDesc}% +} + +% Used by exception lists +\newenvironment{DoxyExceptions}[1]{% + \begin{DoxyDesc}{#1}% + \begin{description}% + \item[] \hspace{\fill} \vspace{-25pt}% + \definecolor{tableShade}{HTML}{F8F8F8}% + \rowcolors{1}{white}{tableShade}% + \arrayrulecolor{gray}% + \setlength{\tabcolsep}{0.01\textwidth}% + \begin{longtable}{|>{\raggedleft\hspace{0pt}}p{0.25\textwidth}|% + p{0.77\textwidth}|}% + \hline% +}{% + \end{longtable}% + \end{description}% + \end{DoxyDesc}% +} + +% Used by template parameter lists +\newenvironment{DoxyTemplParams}[1]{% + \begin{DoxyDesc}{#1}% + \begin{description}% + \item[] \hspace{\fill} \vspace{-25pt}% + \definecolor{tableShade}{HTML}{F8F8F8}% + \rowcolors{1}{white}{tableShade}% + \arrayrulecolor{gray}% + \setlength{\tabcolsep}{0.01\textwidth}% + \begin{longtable}{|>{\raggedleft\hspace{0pt}}p{0.25\textwidth}|% + p{0.77\textwidth}|}% + \hline% +}{% + \end{longtable}% + \end{description}% + \end{DoxyDesc}% +} + +\newcommand{\doxyref}[3]{\textbf{#1} (\textnormal{#2}\,\pageref{#3})} +\newenvironment{DoxyCompactList} +{\begin{list}{}{ + \setlength{\leftmargin}{0.5cm} + \setlength{\itemsep}{0pt} + \setlength{\parsep}{0pt} + \setlength{\topsep}{0pt} + \renewcommand{\makelabel}{\hfill}}} +{\end{list}} +\newenvironment{DoxyCompactItemize} +{ + \begin{itemize} + \setlength{\itemsep}{-3pt} + \setlength{\parsep}{0pt} + \setlength{\topsep}{0pt} + \setlength{\partopsep}{0pt} +} +{\end{itemize}} +\newcommand{\PBS}[1]{\let\temp=\\#1\let\\=\temp} +\newlength{\tmplength} +\newenvironment{TabularC}[1] +{ +\setlength{\tmplength} + {\linewidth/(#1)-\tabcolsep*2-\arrayrulewidth*(#1+1)/(#1)} + \par\begin{tabular*}{\linewidth} + {*{#1}{|>{\PBS\raggedright\hspace{0pt}}p{\the\tmplength}}|} +} +{\end{tabular*}\par} +\newcommand{\entrylabel}[1]{ + {\parbox[b]{\labelwidth-4pt}{\makebox[0pt][l]{\textbf{#1}}\vspace{1.5\baselineskip}}}} +\newenvironment{Desc} +{\begin{list}{} + { + \settowidth{\labelwidth}{40pt} + \setlength{\leftmargin}{\labelwidth} + \setlength{\parsep}{0pt} + \setlength{\itemsep}{-4pt} + \renewcommand{\makelabel}{\entrylabel} + } +} +{\end{list}} +\newenvironment{Indent} + {\begin{list}{}{\setlength{\leftmargin}{0.5cm}} + \item[]\ignorespaces} + {\unskip\end{list}} +\setlength{\parindent}{0cm} +\setlength{\parskip}{0.2cm} +\addtocounter{secnumdepth}{2} +\usepackage[T1]{fontenc} +\makeatletter +\renewcommand{\paragraph}{\@startsection{paragraph}{4}{0ex}% + {-1.0ex}% + {1.0ex}% + {\usefont{OT1}{phv}{bc}{n}\color{darkgray}}} +\renewcommand{\subparagraph}{\@startsection{subparagraph}{5}{0ex}% + {-1.0ex}% + {1.0ex}% + {\usefont{OT1}{phv}{bc}{n}\color{darkgray}}} +\makeatother +\allsectionsfont{\usefont{OT1}{phv}{bc}{n}\selectfont\color{darkgray}} +\stepcounter{secnumdepth} +\stepcounter{tocdepth} +\definecolor{comment}{rgb}{0.5,0.0,0.0} +\definecolor{keyword}{rgb}{0.0,0.5,0.0} +\definecolor{keywordtype}{rgb}{0.38,0.25,0.125} +\definecolor{keywordflow}{rgb}{0.88,0.5,0.0} +\definecolor{preprocessor}{rgb}{0.5,0.38,0.125} +\definecolor{stringliteral}{rgb}{0.0,0.125,0.25} +\definecolor{charliteral}{rgb}{0.0,0.5,0.5} +\definecolor{vhdldigit}{rgb}{1.0,0.0,1.0} +\definecolor{vhdlkeyword}{rgb}{0.43,0.0,0.43} +\definecolor{vhdllogic}{rgb}{1.0,0.0,0.0} +\definecolor{vhdlchar}{rgb}{0.0,0.0,0.0} diff --git a/3rdparty/quazip-0.5.1/doc/latex/faq.tex b/3rdparty/quazip-0.5.1/doc/latex/faq.tex new file mode 100644 index 00000000..20628fdd --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/latex/faq.tex @@ -0,0 +1,9 @@ +\label{faq_faq-non-QIODevice} + Q. Is there any way to use \doxyref{QuaZipFile}{p.}{classQuaZipFile} in Qt where you are supposed to use normal (non-\/zipped) file, but not through QIODevice API? + +A. Usually not. For example, if you are passing file name to some database driver (like SQLite), Qt usually just passes this name down to the 3rd-\/party library, which is usually does not know anything about QIODevice and therefore there is no way to pass \doxyref{QuaZipFile}{p.}{classQuaZipFile} as normal file. However, if we are talking about some place where you pass file name, and then indirectly use QFile to open it, then it is a good idea to make overloaded method, which accepts a QIODevice pointer. Then you would be able to pass \doxyref{QuaZipFile}{p.}{classQuaZipFile} as well as many other nice things such as QBuffer or QProcess. + +\label{faq_faq-zip64} + Q. Can QuaZIP handle files larger than 4GB? What about zip64 standard? + +A. It isn't supported yet. QuaZIP is a wrapper around minizip. The minizip version QuaZIP was based on didn't support zip64. The newer version that appeared around 2010 reportedly does. But it will take some time and effort to integrate this version with QuaZIP. \ No newline at end of file diff --git a/3rdparty/quazip-0.5.1/doc/latex/hierarchy.tex b/3rdparty/quazip-0.5.1/doc/latex/hierarchy.tex new file mode 100644 index 00000000..718377f9 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/latex/hierarchy.tex @@ -0,0 +1,18 @@ +\section{Class Hierarchy} +This inheritance list is sorted roughly, but not completely, alphabetically:\begin{DoxyCompactList} +\item \contentsline{section}{JlCompress}{\pageref{classJlCompress}}{} +\item \contentsline{section}{QuaChecksum32}{\pageref{classQuaChecksum32}}{} +\begin{DoxyCompactList} +\item \contentsline{section}{QuaAdler32}{\pageref{classQuaAdler32}}{} +\item \contentsline{section}{QuaCrc32}{\pageref{classQuaCrc32}}{} +\end{DoxyCompactList} +\item \contentsline{section}{QuaGzipFile}{\pageref{classQuaGzipFile}}{} +\item \contentsline{section}{QuaZIODevice}{\pageref{classQuaZIODevice}}{} +\item \contentsline{section}{QuaZip}{\pageref{classQuaZip}}{} +\item \contentsline{section}{QuaZipDir}{\pageref{classQuaZipDir}}{} +\item \contentsline{section}{QuaZipFile}{\pageref{classQuaZipFile}}{} +\item \contentsline{section}{QuaZipFileInfo}{\pageref{structQuaZipFileInfo}}{} +\item \contentsline{section}{QuaZipFilePrivate}{\pageref{classQuaZipFilePrivate}}{} +\item \contentsline{section}{QuaZipNewInfo}{\pageref{structQuaZipNewInfo}}{} +\item \contentsline{section}{QuaZipPrivate}{\pageref{classQuaZipPrivate}}{} +\end{DoxyCompactList} diff --git a/3rdparty/quazip-0.5.1/doc/latex/index.tex b/3rdparty/quazip-0.5.1/doc/latex/index.tex new file mode 100644 index 00000000..d6d85098 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/latex/index.tex @@ -0,0 +1,88 @@ + \section{Overview}\label{index_overview} +QuaZIP is a simple C++ wrapper over {\tt Gilles Vollant's ZIP/UNZIP package} that can be used to access ZIP archives. It uses {\tt the Qt toolkit}. + +If you do not know what Qt is, you have two options: +\begin{DoxyItemize} +\item Just forget about QuaZIP. +\item Learn more about Qt by downloading it and/or reading the excellent {\tt official Qt documentation} +\end{DoxyItemize} + +The choice is yours, but if you are really interested in cross-\/platform (Windows/Linux/BSD/UNIX/Mac/Others) software development, I would definitely recommend you the latter $^\wedge$\_\-$^\wedge$ + +QuaZIP allows you to access files inside ZIP archives using QIODevice API, and -\/ yes! -\/ that means that you can also use QTextStream, QDataStream or whatever you would like to use on your zipped files. + +QuaZIP provides complete abstraction of the ZIP/UNZIP API, for both reading from and writing to ZIP archives.\section{Download QuaZIP}\label{index_download} +Downloads are available from {\tt QuaZIP project's page at SourceForge.net}.\section{Platforms supported}\label{index_platforms} +QuaZIP has been currently tested on the following platforms: +\begin{DoxyItemize} +\item linux-\/g++ (Ubuntu 11.10, Qt 4.7.4) +\item freebsd-\/g++ (Qt 4.0.0 +\item hpux-\/acc (HP-\/UX 11.11) +\item hpux-\/g++ (HP-\/UX 11.11) +\item win32-\/g++ (MinGW) +\item win32-\/msvc2010 (MS VS 2010 Express, Qt 4.8.4) +\item win32-\/msvc2010 (Qt Creator, Qt 5.0.1) +\item some Symbian version, reportedly +\end{DoxyItemize} + +No testing has been officially done on other systems. Of course, patches to make it work on any platform that it currently does not work on are always welcome!\section{What is new in this version of QuaZIP?}\label{index_whats-new} +See the NEWS.txt file supplied with the distribution.\section{Requirements}\label{index_Requirements} +Just {\tt zlib} and Qt 4/5. Well, Qt 4 depends on zlib anyway, but you will need zlib headers to compile QuaZIP. With Qt5 sometimes you need the zlib library as well (on Windows, for example).\section{Building, testing and installing}\label{index_building} +\begin{DoxyNote}{Note} +Instructions given in this section assume that you are using some UNIX dialect, but the build process should be very similar on win32-\/g++ platform too. On other platforms it's essentially the same process, maybe with some qmake adjustments not specific to QuaZIP itself. +\end{DoxyNote} +To build the library, run: \begin{DoxyVerb} +$ cd /wherever/quazip/source/is/quazip-x.y.z/quazip +$ qmake [PREFIX=where-to-install] +$ make +\end{DoxyVerb} + + +Make sure that you have Qt 4/5 installed with all required headers and utilities (that is, including the 'dev' or 'devel' package on Linux) and that you run qmake utility of the Qt 4, not some other version you may have already installed (you may need to type full path to qmake like /usr/local/qt4/bin/qmake). + +To reconfigure (with another PREFIX, for example), just run qmake with appropriate arguments again. + +If you need to specify additional include path or libraries, use qmake features (see qmake reference in the Qt documentation). For example: + +\begin{DoxyVerb} +$ qmake LIBS+=-L/usr/local/zlib/lib INCLUDEPATH+=/usr/local/zlib/include +\end{DoxyVerb} + (note abscence of \char`\"{}-\/I\char`\"{} before the include path and the presence of \char`\"{}-\/L\char`\"{} before the lib path) + +Also note that you may or may not need to define ZLIB\_\-WINAPI (qmake DEFINES+=ZLIB\_\-WINAPI) when linking to zlib on Windows, depending on how zlib was built (generally, if using zlibwapi.dll, this define is needed). + +To install compiled library: \begin{DoxyVerb} +$ make install +\end{DoxyVerb} + + +By default, QuaZIP compiles as a DLL/SO, but you have other options: +\begin{DoxyItemize} +\item Just copy appropriate source files to your project and use them, but you need to define QUAZIP\_\-STATIC before including any QuaZIP headers (best done as a compiler option). This will save you from possible side effects of importing/exporting QuaZIP symbols. +\item Compile it as a static library using CONFIG += staticlib qmake option. QUAZIP\_\-STATIC is defined automatically by qmake in this case. +\end{DoxyItemize} + +Binary compatibility is guaranteed between minor releases starting with version 0.5, thanks to the Pimpl idiom. That is, the next binary incompatible version will be 1.x, and if zip64 support is ever introduced, then there will be a build option to compile either as non-\/zip64 (binary compatible with the old releases) or as zip64 (which will be binary incompatible due to different file size types).\section{Testing}\label{index_test} +To check if QuaZIP's basic features work OK on your platform, you may wish to compile the test suite provided in test directory: \begin{DoxyVerb} +$ cd /wherever/quazip/source/is/quazip-x.y.z/qztest +$ qmake +$ make +$ ./qztest +\end{DoxyVerb} + + +Note that the test suite looks for the quazip library in the \char`\"{}quazip\char`\"{} folder of the project (\char`\"{}../quazip\char`\"{}), but you may wish to use LIBS for some systems (Windows often puts the library in the separate \char`\"{}debug\char`\"{} or \char`\"{}release\char`\"{} directory). If you wish to use the quazip version that's already installed, provide the appropriate path. + +On some systems you may need to set PATH, LD\_\-LIBRARY\_\-PATH or SHLIB\_\-PATH to get \char`\"{}qztest\char`\"{} to actually run. + +If everything went fine, the test suite should report a lot of PASS messages. If something goes wrong, it will provide details and a warning that some tests failed.\section{Using}\label{index_using} +See \doxyref{usage page}{p.}{usage}.\section{Authors and contacts}\label{index_contacts} +This wrapper has been written by Sergey A. Tachenov, AKA Alqualos. This is my first open source project, so it may suck, but I did not find anything like that, so I just had no other choice but to write it. + +If you have anything to say to me about QuaZIP library, feel free to do so (read the \doxyref{QuaZip FAQ}{p.}{faq} first, though). I can not promise, though, that I fix all the bugs you report in, add any features you want, or respond to your critics, or respond to your feedback at all. I may be busy, I may be tired of working on QuaZIP, I may be even dead already (you never know...). + +To report bugs or to post ideas about what should be done, use SourceForge.net's {\tt trackers}. If you want to send me a private message, use my e-\/mail address {\tt stachenov@gmail.com}. + +Do not use e-\/mail to report bugs, please. Reporting bugs and problems with the SourceForge.net's bug report system has that advantage that it is visible to public, and I can always search for open tickets that were created long ago. It is highly unlikely that I will search my mail for that kind of stuff, so if a bug reported by mail isn't fixed immediately, it will likely be forgotten forever. + +Copyright (C) 2005-\/2012 Sergey A. Tachenov and contributors \ No newline at end of file diff --git a/3rdparty/quazip-0.5.1/doc/latex/refman.tex b/3rdparty/quazip-0.5.1/doc/latex/refman.tex new file mode 100644 index 00000000..6080774f --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/latex/refman.tex @@ -0,0 +1,71 @@ +\documentclass[a4paper]{book} +\usepackage{makeidx} +\usepackage{graphicx} +\usepackage{multicol} +\usepackage{float} +\usepackage{listings} +\usepackage{color} +\usepackage{ifthen} +\usepackage[table]{xcolor} +\usepackage{textcomp} +\usepackage{alltt} +\usepackage[utf8]{inputenc} +\usepackage{mathptmx} +\usepackage[scaled=.90]{helvet} +\usepackage{courier} +\usepackage{sectsty} +\usepackage[titles]{tocloft} +\usepackage{doxygen} +\lstset{language=C++,inputencoding=utf8,basicstyle=\footnotesize,breaklines=true,breakatwhitespace=true,tabsize=8,numbers=left } +\makeindex +\setcounter{tocdepth}{3} +\renewcommand{\footrulewidth}{0.4pt} +\renewcommand{\familydefault}{\sfdefault} +\begin{document} +\begin{titlepage} +\vspace*{7cm} +\begin{center} +{\Large QuaZIP \\[1ex]\large quazip-\/0-\/5-\/1 }\\ +\vspace*{1cm} +{\large Generated by Doxygen 1.7.4}\\ +\vspace*{0.5cm} +{\small Sat Mar 2 2013 11:05:10}\\ +\end{center} +\end{titlepage} +\clearemptydoublepage +\pagenumbering{roman} +\tableofcontents +\clearemptydoublepage +\pagenumbering{arabic} +\chapter{QuaZIP -\/ Qt/C++ wrapper for ZIP/UNZIP package} +\label{index}\input{index} +\chapter{QuaZip FAQ} +\label{faq} +\input{faq} +\chapter{Usage} +\label{usage} +\input{usage} +\chapter{Directory Hierarchy} +\input{dirs} +\chapter{Class Index} +\input{hierarchy} +\chapter{Class Index} +\input{annotated} +\chapter{Directory Documentation} +\input{dir_6b1d21316abab84c9bd8ed600604809a} +\chapter{Class Documentation} +\input{classJlCompress} +\input{classQuaAdler32} +\input{classQuaChecksum32} +\input{classQuaCrc32} +\input{classQuaGzipFile} +\input{classQuaZIODevice} +\input{classQuaZip} +\input{classQuaZipDir} +\input{classQuaZipFile} +\input{structQuaZipFileInfo} +\input{classQuaZipFilePrivate} +\input{structQuaZipNewInfo} +\input{classQuaZipPrivate} +\printindex +\end{document} diff --git a/3rdparty/quazip-0.5.1/doc/latex/structQuaZipFileInfo.tex b/3rdparty/quazip-0.5.1/doc/latex/structQuaZipFileInfo.tex new file mode 100644 index 00000000..b701edf5 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/latex/structQuaZipFileInfo.tex @@ -0,0 +1,90 @@ +\section{QuaZipFileInfo Struct Reference} +\label{structQuaZipFileInfo}\index{QuaZipFileInfo@{QuaZipFileInfo}} + + +Information about a file inside archive. + + + + +{\ttfamily \#include $<$quazipfileinfo.h$>$} + +\subsection*{Public Member Functions} +\begin{DoxyCompactItemize} +\item +QFile::Permissions {\bf getPermissions} () const +\begin{DoxyCompactList}\small\item\em Get the file permissions. \end{DoxyCompactList}\end{DoxyCompactItemize} +\subsection*{Public Attributes} +\begin{DoxyCompactItemize} +\item +QString {\bf name}\label{structQuaZipFileInfo_a16ac323965deccf0232bfae69d933a84} + +\begin{DoxyCompactList}\small\item\em File name. \end{DoxyCompactList}\item +quint16 {\bf versionCreated}\label{structQuaZipFileInfo_a52f3f1d960ebaa2acbc2a86458fa3e6e} + +\begin{DoxyCompactList}\small\item\em Version created by. \end{DoxyCompactList}\item +quint16 {\bf versionNeeded}\label{structQuaZipFileInfo_a8b73982808bded49e88e624a65e1a94f} + +\begin{DoxyCompactList}\small\item\em Version needed to extract. \end{DoxyCompactList}\item +quint16 {\bf flags}\label{structQuaZipFileInfo_a56d36f777e4fc892c71e22d080622e2c} + +\begin{DoxyCompactList}\small\item\em General purpose flags. \end{DoxyCompactList}\item +quint16 {\bf method}\label{structQuaZipFileInfo_af5c1bbda7f5dec2c358e7a543564de4c} + +\begin{DoxyCompactList}\small\item\em Compression method. \end{DoxyCompactList}\item +QDateTime {\bf dateTime}\label{structQuaZipFileInfo_ad6993d099436813a27fd31aebe42911a} + +\begin{DoxyCompactList}\small\item\em Last modification date and time. \end{DoxyCompactList}\item +quint32 {\bf crc}\label{structQuaZipFileInfo_aceee045c9ebce0b9724f40d342bc99ea} + +\begin{DoxyCompactList}\small\item\em CRC. \end{DoxyCompactList}\item +quint32 {\bf compressedSize}\label{structQuaZipFileInfo_af6116eaac1f36b2a4b3a6a39851a85cc} + +\begin{DoxyCompactList}\small\item\em Compressed file size. \end{DoxyCompactList}\item +quint32 {\bf uncompressedSize}\label{structQuaZipFileInfo_a0eb908e1b1ea637d1f1f4d6aa31db07f} + +\begin{DoxyCompactList}\small\item\em Uncompressed file size. \end{DoxyCompactList}\item +quint16 {\bf diskNumberStart}\label{structQuaZipFileInfo_aa70157fdc2bd8de10405055b4233050b} + +\begin{DoxyCompactList}\small\item\em Disk number start. \end{DoxyCompactList}\item +quint16 {\bf internalAttr}\label{structQuaZipFileInfo_a36e681a93b041617addee78cb939c93d} + +\begin{DoxyCompactList}\small\item\em Internal file attributes. \end{DoxyCompactList}\item +quint32 {\bf externalAttr}\label{structQuaZipFileInfo_afeb65ffdacc4fc0ba7848d4b37f62ecf} + +\begin{DoxyCompactList}\small\item\em External file attributes. \end{DoxyCompactList}\item +QString {\bf comment}\label{structQuaZipFileInfo_adc2aad7bbd87ce3415e2a19851266bfc} + +\begin{DoxyCompactList}\small\item\em Comment. \end{DoxyCompactList}\item +QByteArray {\bf extra}\label{structQuaZipFileInfo_affc7b097de2c3c2ef5801c60f96adc72} + +\begin{DoxyCompactList}\small\item\em Extra field. \end{DoxyCompactList}\end{DoxyCompactItemize} + + +\subsection{Detailed Description} +Information about a file inside archive. + +Call \doxyref{QuaZip::getCurrentFileInfo()}{p.}{classQuaZip_a9c91a53ed4c2038e153c64bdc097ebe8} or \doxyref{QuaZipFile::getFileInfo()}{p.}{classQuaZipFile_ad3f5807329321be21b12c1ba5798b359} to fill this structure. + +\subsection{Member Function Documentation} +\index{QuaZipFileInfo@{QuaZipFileInfo}!getPermissions@{getPermissions}} +\index{getPermissions@{getPermissions}!QuaZipFileInfo@{QuaZipFileInfo}} +\subsubsection[{getPermissions}]{\setlength{\rightskip}{0pt plus 5cm}QFile::Permissions QuaZipFileInfo::getPermissions ( +\begin{DoxyParamCaption} +{} +\end{DoxyParamCaption} +) const}\label{structQuaZipFileInfo_af87f96a64d7c02b002622f81d13accdb} + + +Get the file permissions. + +Returns the high 16 bits of external attributes converted to QFile::Permissions. + +References externalAttr. + + + +The documentation for this struct was generated from the following files:\begin{DoxyCompactItemize} +\item +quazip/quazipfileinfo.h\item +quazip/quazipfileinfo.cpp\end{DoxyCompactItemize} diff --git a/3rdparty/quazip-0.5.1/doc/latex/structQuaZipNewInfo.tex b/3rdparty/quazip-0.5.1/doc/latex/structQuaZipNewInfo.tex new file mode 100644 index 00000000..c96cc2f6 --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/latex/structQuaZipNewInfo.tex @@ -0,0 +1,205 @@ +\section{QuaZipNewInfo Struct Reference} +\label{structQuaZipNewInfo}\index{QuaZipNewInfo@{QuaZipNewInfo}} + + +Information about a file to be created. + + + + +{\ttfamily \#include $<$quazipnewinfo.h$>$} + +\subsection*{Public Member Functions} +\begin{DoxyCompactItemize} +\item +{\bf QuaZipNewInfo} (const QString \&{\bf name}) +\begin{DoxyCompactList}\small\item\em Constructs \doxyref{QuaZipNewInfo}{p.}{structQuaZipNewInfo} instance. \end{DoxyCompactList}\item +{\bf QuaZipNewInfo} (const QString \&{\bf name}, const QString \&file) +\begin{DoxyCompactList}\small\item\em Constructs \doxyref{QuaZipNewInfo}{p.}{structQuaZipNewInfo} instance. \end{DoxyCompactList}\item +void {\bf setFileDateTime} (const QString \&file) +\begin{DoxyCompactList}\small\item\em Sets the file timestamp from the existing file. \end{DoxyCompactList}\item +void {\bf setFilePermissions} (const QString \&file) +\begin{DoxyCompactList}\small\item\em Sets the file permissions from the existing file. \end{DoxyCompactList}\item +void {\bf setPermissions} (QFile::Permissions permissions) +\begin{DoxyCompactList}\small\item\em Sets the file permissions. \end{DoxyCompactList}\end{DoxyCompactItemize} +\subsection*{Public Attributes} +\begin{DoxyCompactItemize} +\item +QString {\bf name} +\begin{DoxyCompactList}\small\item\em File name. \end{DoxyCompactList}\item +QDateTime {\bf dateTime} +\begin{DoxyCompactList}\small\item\em File timestamp. \end{DoxyCompactList}\item +quint16 {\bf internalAttr}\label{structQuaZipNewInfo_a59ce9776c2ac7547ade8cb4c404c77ab} + +\begin{DoxyCompactList}\small\item\em File internal attributes. \end{DoxyCompactList}\item +quint32 {\bf externalAttr} +\begin{DoxyCompactList}\small\item\em File external attributes. \end{DoxyCompactList}\item +QString {\bf comment} +\begin{DoxyCompactList}\small\item\em File comment. \end{DoxyCompactList}\item +QByteArray {\bf extraLocal}\label{structQuaZipNewInfo_ab377a81c51cf495c7aeee4f19340a43f} + +\begin{DoxyCompactList}\small\item\em File local extra field. \end{DoxyCompactList}\item +QByteArray {\bf extraGlobal}\label{structQuaZipNewInfo_abda207eb3949db3a88761c1b06e6bd58} + +\begin{DoxyCompactList}\small\item\em File global extra field. \end{DoxyCompactList}\item +ulong {\bf uncompressedSize} +\begin{DoxyCompactList}\small\item\em Uncompressed file size. \end{DoxyCompactList}\end{DoxyCompactItemize} + + +\subsection{Detailed Description} +Information about a file to be created. + +This structure holds information about a file to be created inside ZIP archive. At least name should be set to something correct before passing this structure to QuaZipFile::open(OpenMode,const QuaZipNewInfo\&,int,int,bool). + +\subsection{Constructor \& Destructor Documentation} +\index{QuaZipNewInfo@{QuaZipNewInfo}!QuaZipNewInfo@{QuaZipNewInfo}} +\index{QuaZipNewInfo@{QuaZipNewInfo}!QuaZipNewInfo@{QuaZipNewInfo}} +\subsubsection[{QuaZipNewInfo}]{\setlength{\rightskip}{0pt plus 5cm}QuaZipNewInfo::QuaZipNewInfo ( +\begin{DoxyParamCaption} +\item[{const QString \&}]{name} +\end{DoxyParamCaption} +)}\label{structQuaZipNewInfo_a46c0f551cf9e6b2131929beb39187aac} + + +Constructs \doxyref{QuaZipNewInfo}{p.}{structQuaZipNewInfo} instance. + +Initializes name with {\itshape name\/}, dateTime with current date and time. Attributes are initialized with zeros, comment and extra field with null values. \index{QuaZipNewInfo@{QuaZipNewInfo}!QuaZipNewInfo@{QuaZipNewInfo}} +\index{QuaZipNewInfo@{QuaZipNewInfo}!QuaZipNewInfo@{QuaZipNewInfo}} +\subsubsection[{QuaZipNewInfo}]{\setlength{\rightskip}{0pt plus 5cm}QuaZipNewInfo::QuaZipNewInfo ( +\begin{DoxyParamCaption} +\item[{const QString \&}]{name, } +\item[{const QString \&}]{file} +\end{DoxyParamCaption} +)}\label{structQuaZipNewInfo_ad47cf11f4277edcb09a8ba2b2963f2a9} + + +Constructs \doxyref{QuaZipNewInfo}{p.}{structQuaZipNewInfo} instance. + +Initializes name with {\itshape name\/}. Timestamp and permissions are taken from the specified file. If the {\itshape file\/} does not exists or its timestamp is inaccessible (e. g. you do not have read permission for the directory file in), uses current time and zero permissions. Other attributes are initialized with zeros, comment and extra field with null values. + +\begin{DoxySeeAlso}{See also} +\doxyref{setFileDateTime()}{p.}{structQuaZipNewInfo_a2b18b554d056877a2f33ffb9d241ed85} +\end{DoxySeeAlso} + + +References dateTime. + + + +\subsection{Member Function Documentation} +\index{QuaZipNewInfo@{QuaZipNewInfo}!setFileDateTime@{setFileDateTime}} +\index{setFileDateTime@{setFileDateTime}!QuaZipNewInfo@{QuaZipNewInfo}} +\subsubsection[{setFileDateTime}]{\setlength{\rightskip}{0pt plus 5cm}void QuaZipNewInfo::setFileDateTime ( +\begin{DoxyParamCaption} +\item[{const QString \&}]{file} +\end{DoxyParamCaption} +)}\label{structQuaZipNewInfo_a2b18b554d056877a2f33ffb9d241ed85} + + +Sets the file timestamp from the existing file. + +Use this function to set the file timestamp from the existing file. Use it like this: +\begin{DoxyCode} + QuaZipFile zipFile(&zip); + QFile file("file-to-add"); + file.open(QIODevice::ReadOnly); + QuaZipNewInfo info("file-name-in-archive"); + info.setFileDateTime("file-to-add"); // take the timestamp from file + zipFile.open(QIODevice::WriteOnly, info); +\end{DoxyCode} + + +This function does not change dateTime if some error occured (e. g. file is inaccessible). + +References dateTime. + +\index{QuaZipNewInfo@{QuaZipNewInfo}!setFilePermissions@{setFilePermissions}} +\index{setFilePermissions@{setFilePermissions}!QuaZipNewInfo@{QuaZipNewInfo}} +\subsubsection[{setFilePermissions}]{\setlength{\rightskip}{0pt plus 5cm}void QuaZipNewInfo::setFilePermissions ( +\begin{DoxyParamCaption} +\item[{const QString \&}]{file} +\end{DoxyParamCaption} +)}\label{structQuaZipNewInfo_a08bee5211eb0b49da260c7a9e7a266b8} + + +Sets the file permissions from the existing file. + +Takes permissions from the file and sets the high 16 bits of external attributes. Uses QFileInfo to get permissions on all platforms. \index{QuaZipNewInfo@{QuaZipNewInfo}!setPermissions@{setPermissions}} +\index{setPermissions@{setPermissions}!QuaZipNewInfo@{QuaZipNewInfo}} +\subsubsection[{setPermissions}]{\setlength{\rightskip}{0pt plus 5cm}void QuaZipNewInfo::setPermissions ( +\begin{DoxyParamCaption} +\item[{QFile::Permissions}]{permissions} +\end{DoxyParamCaption} +)}\label{structQuaZipNewInfo_aed68dc20f7dc42b5056491cf3c1d2d20} + + +Sets the file permissions. + +Modifies the highest 16 bits of external attributes. The type part is set to dir if the name ends with a slash, and to regular file otherwise. + +References name. + + + +\subsection{Member Data Documentation} +\index{QuaZipNewInfo@{QuaZipNewInfo}!name@{name}} +\index{name@{name}!QuaZipNewInfo@{QuaZipNewInfo}} +\subsubsection[{name}]{\setlength{\rightskip}{0pt plus 5cm}QString {\bf QuaZipNewInfo::name}}\label{structQuaZipNewInfo_a2bdef01b6ac3326e48598e32bfa5fbe8} + + +File name. + +This field holds file name inside archive, including path relative to archive root. + +Referenced by QuaZipFile::open(), and setPermissions(). + +\index{QuaZipNewInfo@{QuaZipNewInfo}!dateTime@{dateTime}} +\index{dateTime@{dateTime}!QuaZipNewInfo@{QuaZipNewInfo}} +\subsubsection[{dateTime}]{\setlength{\rightskip}{0pt plus 5cm}QDateTime {\bf QuaZipNewInfo::dateTime}}\label{structQuaZipNewInfo_aec7f3ac72c72a2e10b82ad64c2fa3453} + + +File timestamp. + +This is the last file modification date and time. Will be stored in the archive central directory. It is a good practice to set it to the source file timestamp instead of archive creating time. Use \doxyref{setFileDateTime()}{p.}{structQuaZipNewInfo_a2b18b554d056877a2f33ffb9d241ed85} or \doxyref{QuaZipNewInfo(const QString\&, const QString\&)}{p.}{structQuaZipNewInfo_ad47cf11f4277edcb09a8ba2b2963f2a9}. + +Referenced by QuaZipFile::open(), QuaZipNewInfo(), and setFileDateTime(). + +\index{QuaZipNewInfo@{QuaZipNewInfo}!externalAttr@{externalAttr}} +\index{externalAttr@{externalAttr}!QuaZipNewInfo@{QuaZipNewInfo}} +\subsubsection[{externalAttr}]{\setlength{\rightskip}{0pt plus 5cm}quint32 {\bf QuaZipNewInfo::externalAttr}}\label{structQuaZipNewInfo_affd1a9700d302e1395bd04f0864da7d0} + + +File external attributes. + +The highest 16 bits contain Unix file permissions and type (dir or file). The constructor \doxyref{QuaZipNewInfo(const QString\&, const QString\&)}{p.}{structQuaZipNewInfo_ad47cf11f4277edcb09a8ba2b2963f2a9} takes permissions from the provided file. + +Referenced by QuaZipFile::open(). + +\index{QuaZipNewInfo@{QuaZipNewInfo}!comment@{comment}} +\index{comment@{comment}!QuaZipNewInfo@{QuaZipNewInfo}} +\subsubsection[{comment}]{\setlength{\rightskip}{0pt plus 5cm}QString {\bf QuaZipNewInfo::comment}}\label{structQuaZipNewInfo_ae24b1d38c3550b4724862ffcf8f20924} + + +File comment. + +Will be encoded using \doxyref{QuaZip::getCommentCodec()}{p.}{classQuaZip_a008260161781d8b5d2a0a28493fddaf4}. + +Referenced by QuaZipFile::open(). + +\index{QuaZipNewInfo@{QuaZipNewInfo}!uncompressedSize@{uncompressedSize}} +\index{uncompressedSize@{uncompressedSize}!QuaZipNewInfo@{QuaZipNewInfo}} +\subsubsection[{uncompressedSize}]{\setlength{\rightskip}{0pt plus 5cm}ulong {\bf QuaZipNewInfo::uncompressedSize}}\label{structQuaZipNewInfo_a18c079b3f2f5ab6eecdd61d6dbe93be6} + + +Uncompressed file size. + +This is only needed if you are using raw file zipping mode, i. e. adding precompressed file in the zip archive. + +Referenced by QuaZipFile::open(). + + + +The documentation for this struct was generated from the following files:\begin{DoxyCompactItemize} +\item +quazip/quazipnewinfo.h\item +quazip/quazipnewinfo.cpp\end{DoxyCompactItemize} diff --git a/3rdparty/quazip-0.5.1/doc/latex/usage.tex b/3rdparty/quazip-0.5.1/doc/latex/usage.tex new file mode 100644 index 00000000..f2aed82e --- /dev/null +++ b/3rdparty/quazip-0.5.1/doc/latex/usage.tex @@ -0,0 +1,22 @@ +This page provides general information on QuaZIP usage. See classes \doxyref{QuaZip}{p.}{classQuaZip} and \doxyref{QuaZipFile}{p.}{classQuaZipFile} for the detailed documentation on what can QuaZIP do and what it can not. Also, reading comments in the zip.h and unzip.h files (taken from the original ZIP/UNZIP package) is always a good idea too. After all, QuaZIP is just a wrapper with a few convenience extensions and reimplementations. + +\doxyref{QuaZip}{p.}{classQuaZip} is a class representing ZIP archive, \doxyref{QuaZipFile}{p.}{classQuaZipFile} represents a file inside archive and subclasses QIODevice as well. One limitation is that there can be only one instance of \doxyref{QuaZipFile}{p.}{classQuaZipFile} per \doxyref{QuaZip}{p.}{classQuaZip} instance, which kind of makes it confusing why there are two classes instead of one. This is actually no more than an API design mistake.\section{Terminology}\label{usage_terminology} +\char`\"{}QuaZIP\char`\"{} means whole this library, while \char`\"{}QuaZip\char`\"{} (note the lower case) is just one class in it. + +\char`\"{}ZIP/UNZIP API\char`\"{} or \char`\"{}minizip\char`\"{} means the original API of the Gilles Vollant's ZIP/UNZIP package. It was slightly modified to better integrate with Qt. These modifications are not source or binary compatible with the official minizip release, which means you can't just drop the newer minizip version into QuaZIP sources and make it work. + +\char`\"{}ZIP\char`\"{}, \char`\"{}ZIP archive\char`\"{} or \char`\"{}ZIP file\char`\"{} means any ZIP archive. Typically this is a plain file with \char`\"{}.zip\char`\"{} (or \char`\"{}.ZIP\char`\"{}) file name suffix, but it can also be any seekable QIODevice (say, QBuffer, but not QTcpSocket). + +\char`\"{}A file inside archive\char`\"{}, \char`\"{}a file inside ZIP\char`\"{} or something like that means file either being read or written from/to some ZIP archive.\section{Error handling}\label{usage_error-handling} +Almost any call to ZIP/UNZIP API return some error code. Most of the original API's error checking could be done in this wrapper as well, but it would cause unnecessary code bloating without any benefit. So, QuaZIP only checks for situations that ZIP/UNZIP API can not check for. For example, ZIP/UNZIP API has no \char`\"{}ZIP open mode\char`\"{} concept because read and write modes are completely separated. On the other hand, to avoid creating classes like \char`\"{}QuaZipReader\char`\"{}, \char`\"{}QuaZipWriter\char`\"{} or something like that, QuaZIP introduces \char`\"{}ZIP open mode\char`\"{} concept instead, thus making it possible to use one class (\doxyref{QuaZip}{p.}{classQuaZip}) for both reading and writing. But this leads to additional open mode checks which are not done in ZIP/UNZIP package. + +Therefore, error checking is two-\/level (QuaZIP's level and ZIP/UNZIP API level), which sometimes can be confusing, so here are some advices on how the error checking should be properly done: + + +\begin{DoxyItemize} +\item Both \doxyref{QuaZip}{p.}{classQuaZip} and \doxyref{QuaZipFile}{p.}{classQuaZipFile} have getZipError() function, which return error code of the last ZIP/UNZIP API call. Most function calls reset error code to UNZ\_\-OK on success and set error code on failure. Some functions do not reset error code. Most of them are {\ttfamily const} and do not access ZIP archive in any way. Some, on the other hand, {\itshape do\/} access ZIP archive, but do not reset or set error code. For example, \doxyref{QuaZipFile::pos()}{p.}{classQuaZipFile_a90fd55dab83eca7f95df50b2c41b7f22} function. Such functions are explicitly marked in the documentation. +\item Most functions have their own way to report errors, by returning a null string, negative value or {\ttfamily false}. If such a function returns error value, call getZipError() to get more information about error. See \char`\"{}zip.h\char`\"{} and \char`\"{}unzip.h\char`\"{} of the ZIP/UNZIP package for error codes. +\item If the function returns error-\/stating value (like {\ttfamily false}), but getZipError() returns UNZ\_\-OK, it means that you did something obviously wrong. For example, tried to write in the archive open for reading or not open at all. You better just not do that! Most functions also issue a warning using qWarning() function in such cases. See documentation for a specific function for details on when it should not be called. +\end{DoxyItemize} + +I know that this is somewhat messy, but I could not find a better way to do all the error handling. \ No newline at end of file diff --git a/3rdparty/quazip-0.5.1/includes.pri b/3rdparty/quazip-0.5.1/includes.pri new file mode 100644 index 00000000..8362f975 --- /dev/null +++ b/3rdparty/quazip-0.5.1/includes.pri @@ -0,0 +1,10 @@ +OBJECTS_DIR = .obj +MOC_DIR = .moc + +unix { + isEmpty(PREFIX): PREFIX=/usr/local +} + +win32 { + isEmpty(PREFIX): warning("PREFIX unspecified, make install won't work") +} diff --git a/3rdparty/quazip-0.5.1/quazip.pri b/3rdparty/quazip-0.5.1/quazip.pri new file mode 100644 index 00000000..07cd9c04 --- /dev/null +++ b/3rdparty/quazip-0.5.1/quazip.pri @@ -0,0 +1,3 @@ +INCLUDEPATH+=$$PWD +DEPENDPATH+=$$PWD/quazip +include($$PWD/quazip/quazip.pri) diff --git a/3rdparty/quazip-0.5.1/quazip.pro b/3rdparty/quazip-0.5.1/quazip.pro new file mode 100644 index 00000000..28aa9ab6 --- /dev/null +++ b/3rdparty/quazip-0.5.1/quazip.pro @@ -0,0 +1,2 @@ +TEMPLATE=subdirs +SUBDIRS=quazip qztest diff --git a/3rdparty/quazip-0.5.1/quazip.sln b/3rdparty/quazip-0.5.1/quazip.sln new file mode 100644 index 00000000..de38ccd0 --- /dev/null +++ b/3rdparty/quazip-0.5.1/quazip.sln @@ -0,0 +1,26 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual C++ Express 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "quazip", "quazip\quazip.vcxproj", "{E4AC5F56-B711-4F0E-BC83-CDE8B6CD53AD}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "qztest", "qztest\qztest.vcxproj", "{7632B767-D089-4F15-8B1E-C4B3F9EBF592}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E4AC5F56-B711-4F0E-BC83-CDE8B6CD53AD}.Debug|Win32.ActiveCfg = Debug|Win32 + {E4AC5F56-B711-4F0E-BC83-CDE8B6CD53AD}.Debug|Win32.Build.0 = Debug|Win32 + {E4AC5F56-B711-4F0E-BC83-CDE8B6CD53AD}.Release|Win32.ActiveCfg = Release|Win32 + {E4AC5F56-B711-4F0E-BC83-CDE8B6CD53AD}.Release|Win32.Build.0 = Release|Win32 + {7632B767-D089-4F15-8B1E-C4B3F9EBF592}.Debug|Win32.ActiveCfg = Debug|Win32 + {7632B767-D089-4F15-8B1E-C4B3F9EBF592}.Debug|Win32.Build.0 = Debug|Win32 + {7632B767-D089-4F15-8B1E-C4B3F9EBF592}.Release|Win32.ActiveCfg = Release|Win32 + {7632B767-D089-4F15-8B1E-C4B3F9EBF592}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/3rdparty/quazip-0.5.1/quazip/CMakeLists.txt b/3rdparty/quazip-0.5.1/quazip/CMakeLists.txt new file mode 100644 index 00000000..5129f27c --- /dev/null +++ b/3rdparty/quazip-0.5.1/quazip/CMakeLists.txt @@ -0,0 +1,26 @@ +# set all include directories for in and out of source builds +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_BINARY_DIR} + ${ZLIB_INCLUDE_DIRS} +) + +# include with QT_USE selected library parts +INCLUDE(${QT_USE_FILE}) + +file(GLOB SRCS "*.c" "*.cpp") +file(GLOB PUBLIC_HEADERS "*.h") + +# Must be added to enable export macro +ADD_DEFINITIONS(-DQUAZIP_BUILD) + +qt4_wrap_cpp(MOC_SRCS ${PUBLIC_HEADERS}) +set(SRCS ${SRCS} ${MOC_SRCS}) + +add_library(quazip SHARED ${SRCS}) +set_target_properties(quazip PROPERTIES VERSION 1.0.0 SOVERSION 1) +# Link against ZLIB_LIBRARIES if needed (on Windows this variable is empty) +target_link_libraries(quazip ${QT_QTMAIN_LIBRARY} ${QT_QTCORE_LIBRARY} ${ZLIB_LIBRARIES}) + +install(FILES ${PUBLIC_HEADERS} DESTINATION include/quazip) +install(TARGETS quazip LIBRARY DESTINATION ${LIB_DESTINATION} ARCHIVE DESTINATION ${LIB_DESTINATION} RUNTIME DESTINATION ${LIB_DESTINATION}) diff --git a/quazip/JlCompress.cpp b/3rdparty/quazip-0.5.1/quazip/JlCompress.cpp similarity index 84% rename from quazip/JlCompress.cpp rename to 3rdparty/quazip-0.5.1/quazip/JlCompress.cpp index 6d2a7ee7..b57654c1 100644 --- a/quazip/JlCompress.cpp +++ b/3rdparty/quazip-0.5.1/quazip/JlCompress.cpp @@ -142,12 +142,24 @@ bool JlCompress::extractFile(QuaZip* zip, QString fileName, QString fileDest) { if (zip->getMode()!=QuaZip::mdUnzip) return false; // Apro il file compresso - zip->setCurrentFile(fileName); + if (!fileName.isEmpty()) + zip->setCurrentFile(fileName); QuaZipFile inFile(zip); if(!inFile.open(QIODevice::ReadOnly) || inFile.getZipError()!=UNZ_OK) return false; // Controllo esistenza cartella file risultato - QDir().mkpath(QFileInfo(fileDest).absolutePath()); + QDir curDir; + if (!curDir.mkpath(QFileInfo(fileDest).absolutePath())) { + return false; + } + + QuaZipFileInfo info; + if (!zip->getCurrentFileInfo(&info)) + return false; + + if (fileDest.endsWith('/') && QFileInfo(fileDest).isDir()) { + return QFile(fileDest).setPermissions(info.getPermissions()); + } // Apro il file risultato QFile outFile; @@ -156,9 +168,11 @@ bool JlCompress::extractFile(QuaZip* zip, QString fileName, QString fileDest) { // Copio i dati if (!copyData(inFile, outFile) || inFile.getZipError()!=UNZ_OK) { + outFile.close(); removeFile(QStringList(fileDest)); return false; } + outFile.close(); // Chiudo i file inFile.close(); @@ -166,9 +180,8 @@ bool JlCompress::extractFile(QuaZip* zip, QString fileName, QString fileDest) { removeFile(QStringList(fileDest)); return false; } - outFile.close(); - return true; + return outFile.setPermissions(info.getPermissions()); } /** @@ -201,29 +214,25 @@ bool JlCompress::removeFile(QStringList listFile) { */ bool JlCompress::compressFile(QString fileCompressed, QString file) { // Creo lo zip - QuaZip* zip = new QuaZip(QFileInfo(fileCompressed).absoluteFilePath()); + QuaZip zip(fileCompressed); QDir().mkpath(QFileInfo(fileCompressed).absolutePath()); - if(!zip->open(QuaZip::mdCreate)) { - delete zip; + if(!zip.open(QuaZip::mdCreate)) { QFile::remove(fileCompressed); return false; } // Aggiungo il file - if (!compressFile(zip,file,QFileInfo(file).fileName())) { - delete zip; + if (!compressFile(&zip,file,QFileInfo(file).fileName())) { QFile::remove(fileCompressed); return false; } // Chiudo il file zip - zip->close(); - if(zip->getZipError()!=0) { - delete zip; + zip.close(); + if(zip.getZipError()!=0) { QFile::remove(fileCompressed); return false; } - delete zip; return true; } @@ -240,10 +249,9 @@ bool JlCompress::compressFile(QString fileCompressed, QString file) { */ bool JlCompress::compressFiles(QString fileCompressed, QStringList files) { // Creo lo zip - QuaZip* zip = new QuaZip(QFileInfo(fileCompressed).absoluteFilePath()); + QuaZip zip(fileCompressed); QDir().mkpath(QFileInfo(fileCompressed).absolutePath()); - if(!zip->open(QuaZip::mdCreate)) { - delete zip; + if(!zip.open(QuaZip::mdCreate)) { QFile::remove(fileCompressed); return false; } @@ -252,21 +260,18 @@ bool JlCompress::compressFiles(QString fileCompressed, QStringList files) { QFileInfo info; Q_FOREACH (QString file, files) { info.setFile(file); - if (!info.exists() || !compressFile(zip,file,info.fileName())) { - delete zip; + if (!info.exists() || !compressFile(&zip,file,info.fileName())) { QFile::remove(fileCompressed); return false; } } // Chiudo il file zip - zip->close(); - if(zip->getZipError()!=0) { - delete zip; + zip.close(); + if(zip.getZipError()!=0) { QFile::remove(fileCompressed); return false; } - delete zip; return true; } @@ -284,29 +289,25 @@ bool JlCompress::compressFiles(QString fileCompressed, QStringList files) { */ bool JlCompress::compressDir(QString fileCompressed, QString dir, bool recursive) { // Creo lo zip - QuaZip* zip = new QuaZip(QFileInfo(fileCompressed).absoluteFilePath()); + QuaZip zip(fileCompressed); QDir().mkpath(QFileInfo(fileCompressed).absolutePath()); - if(!zip->open(QuaZip::mdCreate)) { - delete zip; + if(!zip.open(QuaZip::mdCreate)) { QFile::remove(fileCompressed); return false; } // Aggiungo i file e le sotto cartelle - if (!compressSubDir(zip,dir,dir,recursive)<0) { - delete zip; + if (!compressSubDir(&zip,dir,dir,recursive)) { QFile::remove(fileCompressed); return false; } // Chiudo il file zip - zip->close(); - if(zip->getZipError()!=0) { - delete zip; + zip.close(); + if(zip.getZipError()!=0) { QFile::remove(fileCompressed); return false; } - delete zip; return true; } @@ -327,27 +328,24 @@ bool JlCompress::compressDir(QString fileCompressed, QString dir, bool recursive */ QString JlCompress::extractFile(QString fileCompressed, QString fileName, QString fileDest) { // Apro lo zip - QuaZip* zip = new QuaZip(QFileInfo(fileCompressed).absoluteFilePath()); - if(!zip->open(QuaZip::mdUnzip)) { - delete zip; + QuaZip zip(fileCompressed); + if(!zip.open(QuaZip::mdUnzip)) { return QString(); } // Estraggo il file - if (fileDest.isEmpty()) fileDest = fileName; - if (!extractFile(zip,fileName,fileDest)) { - delete zip; + if (fileDest.isEmpty()) + fileDest = fileName; + if (!extractFile(&zip,fileName,fileDest)) { return QString(); } // Chiudo il file zip - zip->close(); - if(zip->getZipError()!=0) { + zip.close(); + if(zip.getZipError()!=0) { removeFile(QStringList(fileDest)); return QString(); } - delete zip; - return QFileInfo(fileDest).absoluteFilePath(); } @@ -365,32 +363,30 @@ QString JlCompress::extractFile(QString fileCompressed, QString fileName, QStrin */ QStringList JlCompress::extractFiles(QString fileCompressed, QStringList files, QString dir) { // Creo lo zip - QuaZip* zip = new QuaZip(QFileInfo(fileCompressed).absoluteFilePath()); - if(!zip->open(QuaZip::mdUnzip)) { - delete zip; + QuaZip zip(fileCompressed); + if(!zip.open(QuaZip::mdUnzip)) { return QStringList(); } // Estraggo i file + QStringList extracted; for (int i=0; iclose(); - if(zip->getZipError()!=0) { - delete zip; - removeFile(files); + zip.close(); + if(zip.getZipError()!=0) { + removeFile(extracted); return QStringList(); } - delete zip; - return files; + return extracted; } /**OK @@ -406,36 +402,34 @@ QStringList JlCompress::extractFiles(QString fileCompressed, QStringList files, */ QStringList JlCompress::extractDir(QString fileCompressed, QString dir) { // Apro lo zip - QuaZip* zip = new QuaZip(QFileInfo(fileCompressed).absoluteFilePath()); - if(!zip->open(QuaZip::mdUnzip)) { - delete zip; + QuaZip zip(fileCompressed); + if(!zip.open(QuaZip::mdUnzip)) { return QStringList(); } - // Estraggo i file - QStringList lst = getFileList(fileCompressed); - QDir directory(dir); - for (int i=0; iclose(); - if(zip->getZipError()!=0) { - delete zip; - removeFile(lst); + QStringList extracted; + if (!zip.goToFirstFile()) { return QStringList(); } - delete zip; + do { + QString name = zip.getCurrentFileName(); + QString absFilePath = directory.absoluteFilePath(name); + if (!extractFile(&zip, "", absFilePath)) { + removeFile(extracted); + return QStringList(); + } + extracted.append(absFilePath); + } while (zip.goToNextFile()); - return lst; + // Chiudo il file zip + zip.close(); + if(zip.getZipError()!=0) { + removeFile(extracted); + return QStringList(); + } + + return extracted; } /**OK diff --git a/3rdparty/quazip-0.5.1/quazip/JlCompress.h b/3rdparty/quazip-0.5.1/quazip/JlCompress.h new file mode 100644 index 00000000..968f7a89 --- /dev/null +++ b/3rdparty/quazip-0.5.1/quazip/JlCompress.h @@ -0,0 +1,114 @@ +#ifndef JLCOMPRESSFOLDER_H_ +#define JLCOMPRESSFOLDER_H_ + +#include "quazip.h" +#include "quazipfile.h" +#include "quazipfileinfo.h" +#include +#include +#include +#include + +/// Utility class for typical operations. +/** + This class contains a number of useful static functions to perform + simple operations, such as mass ZIP packing or extraction. + */ +class QUAZIP_EXPORT JlCompress { +private: + /// Compress a single file. + /** + \param zip Opened zip to compress the file to. + \param fileName The full path to the source file. + \param fileDest The full name of the file inside the archive. + \return true if success, false otherwise. + */ + static bool compressFile(QuaZip* zip, QString fileName, QString fileDest); + /// Compress a subdirectory. + /** + \param parentZip Opened zip containing the parent directory. + \param dir The full path to the directory to pack. + \param parentDir The full path to the directory corresponding to + the root of the ZIP. + \param recursive Whether to pack sub-directories as well or only + files. + \return true if success, false otherwise. + */ + static bool compressSubDir(QuaZip* parentZip, QString dir, QString parentDir, bool recursive = true); + /// Extract a single file. + /** + \param zip The opened zip archive to extract from. + \param fileName The full name of the file to extract. + \param fileDest The full path to the destination file. + \return true if success, false otherwise. + */ + static bool extractFile(QuaZip* zip, QString fileName, QString fileDest); + /// Remove some files. + /** + \param listFile The list of files to remove. + \return true if success, false otherwise. + */ + static bool removeFile(QStringList listFile); + +public: + /// Compress a single file. + /** + \param fileCompressed The name of the archive. + \param file The file to compress. + \return true if success, false otherwise. + */ + static bool compressFile(QString fileCompressed, QString file); + /// Compress a list of files. + /** + \param fileCompressed The name of the archive. + \param files The file list to compress. + \return true if success, false otherwise. + */ + static bool compressFiles(QString fileCompressed, QStringList files); + /// Compress a whole directory. + /** + \param fileCompressed The name of the archive. + \param dir The directory to compress. + \param recursive Whether to pack the subdirectories as well, or + just regular files. + \return true if success, false otherwise. + */ + static bool compressDir(QString fileCompressed, QString dir = QString(), bool recursive = true); + +public: + /// Extract a single file. + /** + \param fileCompressed The name of the archive. + \param fileName The file to extract. + \param fileDest The destination file, assumed to be identical to + \a file if left empty. + \return The list of the full paths of the files extracted, empty on failure. + */ + static QString extractFile(QString fileCompressed, QString fileName, QString fileDest = QString()); + /// Extract a list of files. + /** + \param fileCompressed The name of the archive. + \param files The file list to extract. + \param dir The directory to put the files to, the current + directory if left empty. + \return The list of the full paths of the files extracted, empty on failure. + */ + static QStringList extractFiles(QString fileCompressed, QStringList files, QString dir = QString()); + /// Extract a whole archive. + /** + \param fileCompressed The name of the archive. + \param dir The directory to extract to, the current directory if + left empty. + \return The list of the full paths of the files extracted, empty on failure. + */ + static QStringList extractDir(QString fileCompressed, QString dir = QString()); + /// Get the file list. + /** + \return The list of the files in the archive, or, more precisely, the + list of the entries, including both files and directories if they + are present separately. + */ + static QStringList getFileList(QString fileCompressed); +}; + +#endif /* JLCOMPRESSFOLDER_H_ */ diff --git a/quazip/crypt.h b/3rdparty/quazip-0.5.1/quazip/crypt.h similarity index 97% rename from quazip/crypt.h rename to 3rdparty/quazip-0.5.1/quazip/crypt.h index 640de0f2..1d6da628 100644 --- a/quazip/crypt.h +++ b/3rdparty/quazip-0.5.1/quazip/crypt.h @@ -1,135 +1,135 @@ -/* crypt.h -- base code for crypt/uncrypt ZIPfile - - - Version 1.01e, February 12th, 2005 - - Copyright (C) 1998-2005 Gilles Vollant - - This code is a modified version of crypting code in Infozip distribution - - The encryption/decryption parts of this source code (as opposed to the - non-echoing password parts) were originally written in Europe. The - whole source package can be freely distributed, including from the USA. - (Prior to January 2000, re-export from the US was a violation of US law.) - - This encryption code is a direct transcription of the algorithm from - Roger Schlafly, described by Phil Katz in the file appnote.txt. This - file (appnote.txt) is distributed with the PKZIP program (even in the - version without encryption capabilities). - - If you don't need crypting in your application, just define symbols - NOCRYPT and NOUNCRYPT. - - This code support the "Traditional PKWARE Encryption". - - The new AES encryption added on Zip format by Winzip (see the page - http://www.winzip.com/aes_info.htm ) and PKWare PKZip 5.x Strong - Encryption is not supported. -*/ - -#include "quazip_global.h" - -#define CRC32(c, b) ((*(pcrc_32_tab+(((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8)) - -/*********************************************************************** - * Return the next byte in the pseudo-random sequence - */ -static int decrypt_byte(unsigned long* pkeys, const unsigned long* pcrc_32_tab UNUSED) -{ - //(void) pcrc_32_tab; /* avoid "unused parameter" warning */ - unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an - * unpredictable manner on 16-bit systems; not a problem - * with any known compiler so far, though */ - - temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2; - return (int)(((temp * (temp ^ 1)) >> 8) & 0xff); -} - -/*********************************************************************** - * Update the encryption keys with the next byte of plain text - */ -static int update_keys(unsigned long* pkeys,const unsigned long* pcrc_32_tab,int c) -{ - (*(pkeys+0)) = CRC32((*(pkeys+0)), c); - (*(pkeys+1)) += (*(pkeys+0)) & 0xff; - (*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1; - { - register int keyshift = (int)((*(pkeys+1)) >> 24); - (*(pkeys+2)) = CRC32((*(pkeys+2)), keyshift); - } - return c; -} - - -/*********************************************************************** - * Initialize the encryption keys and the random header according to - * the given password. - */ -static void init_keys(const char* passwd,unsigned long* pkeys,const unsigned long* pcrc_32_tab) -{ - *(pkeys+0) = 305419896L; - *(pkeys+1) = 591751049L; - *(pkeys+2) = 878082192L; - while (*passwd != '\0') { - update_keys(pkeys,pcrc_32_tab,(int)*passwd); - passwd++; - } -} - -#define zdecode(pkeys,pcrc_32_tab,c) \ - (update_keys(pkeys,pcrc_32_tab,c ^= decrypt_byte(pkeys,pcrc_32_tab))) - -#define zencode(pkeys,pcrc_32_tab,c,t) \ - (t=decrypt_byte(pkeys,pcrc_32_tab), update_keys(pkeys,pcrc_32_tab,c), t^(c)) - -#ifdef INCLUDECRYPTINGCODE_IFCRYPTALLOWED - -#define RAND_HEAD_LEN 12 - /* "last resort" source for second part of crypt seed pattern */ -# ifndef ZCR_SEED2 -# define ZCR_SEED2 3141592654UL /* use PI as default pattern */ -# endif - -static int crypthead(passwd, buf, bufSize, pkeys, pcrc_32_tab, crcForCrypting) - const char *passwd; /* password string */ - unsigned char *buf; /* where to write header */ - int bufSize; - unsigned long* pkeys; - const unsigned long* pcrc_32_tab; - unsigned long crcForCrypting; -{ - int n; /* index in random header */ - int t; /* temporary */ - int c; /* random byte */ - unsigned char header[RAND_HEAD_LEN-2]; /* random header */ - static unsigned calls = 0; /* ensure different random header each time */ - - if (bufSize> 7) & 0xff; - header[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, c, t); - } - /* Encrypt random header (last two bytes is high word of crc) */ - init_keys(passwd, pkeys, pcrc_32_tab); - for (n = 0; n < RAND_HEAD_LEN-2; n++) - { - buf[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, header[n], t); - } - buf[n++] = zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 16) & 0xff, t); - buf[n++] = zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 24) & 0xff, t); - return n; -} - -#endif +/* crypt.h -- base code for crypt/uncrypt ZIPfile + + + Version 1.01e, February 12th, 2005 + + Copyright (C) 1998-2005 Gilles Vollant + + This code is a modified version of crypting code in Infozip distribution + + The encryption/decryption parts of this source code (as opposed to the + non-echoing password parts) were originally written in Europe. The + whole source package can be freely distributed, including from the USA. + (Prior to January 2000, re-export from the US was a violation of US law.) + + This encryption code is a direct transcription of the algorithm from + Roger Schlafly, described by Phil Katz in the file appnote.txt. This + file (appnote.txt) is distributed with the PKZIP program (even in the + version without encryption capabilities). + + If you don't need crypting in your application, just define symbols + NOCRYPT and NOUNCRYPT. + + This code support the "Traditional PKWARE Encryption". + + The new AES encryption added on Zip format by Winzip (see the page + http://www.winzip.com/aes_info.htm ) and PKWare PKZip 5.x Strong + Encryption is not supported. +*/ + +#include "quazip_global.h" + +#define CRC32(c, b) ((*(pcrc_32_tab+(((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8)) + +/*********************************************************************** + * Return the next byte in the pseudo-random sequence + */ +static int decrypt_byte(unsigned long* pkeys, const unsigned long* pcrc_32_tab UNUSED) +{ + //(void) pcrc_32_tab; /* avoid "unused parameter" warning */ + unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an + * unpredictable manner on 16-bit systems; not a problem + * with any known compiler so far, though */ + + temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2; + return (int)(((temp * (temp ^ 1)) >> 8) & 0xff); +} + +/*********************************************************************** + * Update the encryption keys with the next byte of plain text + */ +static int update_keys(unsigned long* pkeys,const unsigned long* pcrc_32_tab,int c) +{ + (*(pkeys+0)) = CRC32((*(pkeys+0)), c); + (*(pkeys+1)) += (*(pkeys+0)) & 0xff; + (*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1; + { + register int keyshift = (int)((*(pkeys+1)) >> 24); + (*(pkeys+2)) = CRC32((*(pkeys+2)), keyshift); + } + return c; +} + + +/*********************************************************************** + * Initialize the encryption keys and the random header according to + * the given password. + */ +static void init_keys(const char* passwd,unsigned long* pkeys,const unsigned long* pcrc_32_tab) +{ + *(pkeys+0) = 305419896L; + *(pkeys+1) = 591751049L; + *(pkeys+2) = 878082192L; + while (*passwd != '\0') { + update_keys(pkeys,pcrc_32_tab,(int)*passwd); + passwd++; + } +} + +#define zdecode(pkeys,pcrc_32_tab,c) \ + (update_keys(pkeys,pcrc_32_tab,c ^= decrypt_byte(pkeys,pcrc_32_tab))) + +#define zencode(pkeys,pcrc_32_tab,c,t) \ + (t=decrypt_byte(pkeys,pcrc_32_tab), update_keys(pkeys,pcrc_32_tab,c), t^(c)) + +#ifdef INCLUDECRYPTINGCODE_IFCRYPTALLOWED + +#define RAND_HEAD_LEN 12 + /* "last resort" source for second part of crypt seed pattern */ +# ifndef ZCR_SEED2 +# define ZCR_SEED2 3141592654UL /* use PI as default pattern */ +# endif + +static int crypthead(passwd, buf, bufSize, pkeys, pcrc_32_tab, crcForCrypting) + const char *passwd; /* password string */ + unsigned char *buf; /* where to write header */ + int bufSize; + unsigned long* pkeys; + const unsigned long* pcrc_32_tab; + unsigned long crcForCrypting; +{ + int n; /* index in random header */ + int t; /* temporary */ + int c; /* random byte */ + unsigned char header[RAND_HEAD_LEN-2]; /* random header */ + static unsigned calls = 0; /* ensure different random header each time */ + + if (bufSize> 7) & 0xff; + header[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, c, t); + } + /* Encrypt random header (last two bytes is high word of crc) */ + init_keys(passwd, pkeys, pcrc_32_tab); + for (n = 0; n < RAND_HEAD_LEN-2; n++) + { + buf[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, header[n], t); + } + buf[n++] = zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 16) & 0xff, t); + buf[n++] = zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 24) & 0xff, t); + return n; +} + +#endif diff --git a/3rdparty/quazip-0.5.1/quazip/debian/libquazip0.symbols b/3rdparty/quazip-0.5.1/quazip/debian/libquazip0.symbols new file mode 100644 index 00000000..ed3c09b6 --- /dev/null +++ b/3rdparty/quazip-0.5.1/quazip/debian/libquazip0.symbols @@ -0,0 +1,163 @@ +libquazip.so.0 libquazip0 #MINVER# + _Z24qiodevice_open_file_funcPvS_i@Base 0.4.4 + _Z24qiodevice_read_file_funcPvS_S_m@Base 0.4.4 + _Z24qiodevice_seek_file_funcPvS_mi@Base 0.4.4 + _Z24qiodevice_tell_file_funcPvS_@Base 0.4.4 + _Z25qiodevice_close_file_funcPvS_@Base 0.4.4 + _Z25qiodevice_error_file_funcPvS_@Base 0.4.4 + _Z25qiodevice_write_file_funcPvS_PKvm@Base 0.4.4 + _ZN10JlCompress10extractDirE7QStringS0_@Base 0.4.4 + _ZN10JlCompress11compressDirE7QStringS0_b@Base 0.4.4 + _ZN10JlCompress11extractFileE7QStringS0_S0_@Base 0.4.4 + _ZN10JlCompress11getFileListE7QString@Base 0.4.4 + _ZN10JlCompress12compressFileE7QStringS0_@Base 0.4.4 + _ZN10JlCompress12extractFilesE7QString11QStringListS0_@Base 0.4.4 + _ZN10JlCompress13compressFilesE7QString11QStringList@Base 0.4.4 + _ZN10QuaAdler325resetEv@Base 0.4.4 + _ZN10QuaAdler325valueEv@Base 0.4.4 + _ZN10QuaAdler326updateERK10QByteArray@Base 0.4.4 + _ZN10QuaAdler329calculateERK10QByteArray@Base 0.4.4 + _ZN10QuaAdler32C1Ev@Base 0.4.4 + _ZN10QuaAdler32C2Ev@Base 0.4.4 + _ZN10QuaZipFile10setZipNameERK7QString@Base 0.4.4 + _ZN10QuaZipFile11getFileInfoEP14QuaZipFileInfo@Base 0.4.4 + _ZN10QuaZipFile11setFileNameERK7QStringN6QuaZip15CaseSensitivityE@Base 0.4.4 + _ZN10QuaZipFile4openE6QFlagsIN9QIODevice12OpenModeFlagEE@Base 0.4.4 + _ZN10QuaZipFile4openE6QFlagsIN9QIODevice12OpenModeFlagEEPiS4_bPKc@Base 0.4.4 + _ZN10QuaZipFile4openE6QFlagsIN9QIODevice12OpenModeFlagEERK13QuaZipNewInfoPKcjiibiii@Base 0.4.4 + _ZN10QuaZipFile5closeEv@Base 0.4.4 + _ZN10QuaZipFile6setZipEP6QuaZip@Base 0.4.4 + _ZN10QuaZipFile8readDataEPcx@Base 0.4.4 + _ZN10QuaZipFile9writeDataEPKcx@Base 0.4.4 + _ZN10QuaZipFileC1EP6QuaZipP7QObject@Base 0.4.4 + _ZN10QuaZipFileC1EP7QObject@Base 0.4.4 + _ZN10QuaZipFileC1ERK7QStringP7QObject@Base 0.4.4 + _ZN10QuaZipFileC1ERK7QStringS2_N6QuaZip15CaseSensitivityEP7QObject@Base 0.4.4 + _ZN10QuaZipFileC1Ev@Base 0.4.4 + _ZN10QuaZipFileC2EP6QuaZipP7QObject@Base 0.4.4 + _ZN10QuaZipFileC2EP7QObject@Base 0.4.4 + _ZN10QuaZipFileC2ERK7QStringP7QObject@Base 0.4.4 + _ZN10QuaZipFileC2ERK7QStringS2_N6QuaZip15CaseSensitivityEP7QObject@Base 0.4.4 + _ZN10QuaZipFileC2Ev@Base 0.4.4 + _ZN10QuaZipFileD0Ev@Base 0.4.4 + _ZN10QuaZipFileD1Ev@Base 0.4.4 + _ZN10QuaZipFileD2Ev@Base 0.4.4 + _ZN13QuaZipNewInfo15setFileDateTimeERK7QString@Base 0.4.4 + _ZN13QuaZipNewInfoC1ERK7QString@Base 0.4.4 + _ZN13QuaZipNewInfoC1ERK7QStringS2_@Base 0.4.4 + _ZN13QuaZipNewInfoC2ERK7QString@Base 0.4.4 + _ZN13QuaZipNewInfoC2ERK7QStringS2_@Base 0.4.4 + _ZN13QuaZipNewInfoD1Ev@Base 0.4.4 + _ZN13QuaZipNewInfoD2Ev@Base 0.4.4 + _ZN14QuaZipFileInfoD1Ev@Base 0.4.4 + _ZN14QuaZipFileInfoD2Ev@Base 0.4.4 + _ZN6QuaZip10getUnzFileEv@Base 0.4.4 + _ZN6QuaZip10getZipFileEv@Base 0.4.4 + _ZN6QuaZip10setCommentERK7QString@Base 0.4.4 + _ZN6QuaZip10setZipNameERK7QString@Base 0.4.4 + _ZN6QuaZip11setIoDeviceEP9QIODevice@Base 0.4.4 + _ZN6QuaZip12goToNextFileEv@Base 0.4.4 + _ZN6QuaZip13goToFirstFileEv@Base 0.4.4 + _ZN6QuaZip14setCurrentFileERK7QStringNS_15CaseSensitivityE@Base 0.4.4 + _ZN6QuaZip15setCommentCodecEP10QTextCodec@Base 0.4.4 + _ZN6QuaZip15setCommentCodecEPKc@Base 0.4.4 + _ZN6QuaZip16setFileNameCodecEP10QTextCodec@Base 0.4.4 + _ZN6QuaZip16setFileNameCodecEPKc@Base 0.4.4 + _ZN6QuaZip31setDataDescriptorWritingEnabledEb@Base 0.4.4 + _ZN6QuaZip4openENS_4ModeEP19zlib_filefunc_def_s@Base 0.4.4 + _ZN6QuaZip5closeEv@Base 0.4.4 + _ZN6QuaZipC1EP9QIODevice@Base 0.4.4 + _ZN6QuaZipC1ERK7QString@Base 0.4.4 + _ZN6QuaZipC1Ev@Base 0.4.4 + _ZN6QuaZipC2EP9QIODevice@Base 0.4.4 + _ZN6QuaZipC2ERK7QString@Base 0.4.4 + _ZN6QuaZipC2Ev@Base 0.4.4 + _ZN6QuaZipD1Ev@Base 0.4.4 + _ZN6QuaZipD2Ev@Base 0.4.4 + _ZN7QStringD1Ev@Base 0.4.4 + _ZN7QStringD2Ev@Base 0.4.4 + _ZN8QuaCrc325resetEv@Base 0.4.4 + _ZN8QuaCrc325valueEv@Base 0.4.4 + _ZN8QuaCrc326updateERK10QByteArray@Base 0.4.4 + _ZN8QuaCrc329calculateERK10QByteArray@Base 0.4.4 + _ZN8QuaCrc32C1Ev@Base 0.4.4 + _ZN8QuaCrc32C2Ev@Base 0.4.4 + _ZNK10QuaZipFile10getZipNameEv@Base 0.4.4 + _ZNK10QuaZipFile10metaObjectEv@Base 0.4.4 + _ZNK10QuaZipFile11getFileNameEv@Base 0.4.4 + _ZNK10QuaZipFile11getZipErrorEv@Base 0.4.4 + _ZNK10QuaZipFile12isSequentialEv@Base 0.4.4 + _ZNK10QuaZipFile14bytesAvailableEv@Base 0.4.4 + _ZNK10QuaZipFile17getActualFileNameEv@Base 0.4.4 + _ZNK10QuaZipFile18getCaseSensitivityEv@Base 0.4.4 + _ZNK10QuaZipFile3posEv@Base 0.4.4 + _ZNK10QuaZipFile4sizeEv@Base 0.4.4 + _ZNK10QuaZipFile5atEndEv@Base 0.4.4 + _ZNK10QuaZipFile5csizeEv@Base 0.4.4 + _ZNK10QuaZipFile5isRawEv@Base 0.4.4 + _ZNK10QuaZipFile5usizeEv@Base 0.4.4 + _ZNK10QuaZipFile6getZipEv@Base 0.4.4 + _ZNK6QuaZip10getCommentEv@Base 0.4.4 + _ZNK6QuaZip10getZipNameEv@Base 0.4.4 + _ZNK6QuaZip11getIoDeviceEv@Base 0.4.4 + _ZNK6QuaZip11getZipErrorEv@Base 0.4.4 + _ZNK6QuaZip14hasCurrentFileEv@Base 0.4.4 + _ZNK6QuaZip15getCommentCodecEv@Base 0.4.4 + _ZNK6QuaZip15getEntriesCountEv@Base 0.4.4 + _ZNK6QuaZip15getFileInfoListEv@Base 0.4.4 + _ZNK6QuaZip15getFileNameListEv@Base 0.4.4 + _ZNK6QuaZip16getFileNameCodecEv@Base 0.4.4 + _ZNK6QuaZip18getCurrentFileInfoEP14QuaZipFileInfo@Base 0.4.4 + _ZNK6QuaZip18getCurrentFileNameEv@Base 0.4.4 + _ZNK6QuaZip30isDataDescriptorWritingEnabledEv@Base 0.4.4 + _ZNK6QuaZip6isOpenEv@Base 0.4.4 + _ZNK6QuaZip7getModeEv@Base 0.4.4 + _ZTI10QuaAdler32@Base 0.4.4 + _ZTI10QuaZipFile@Base 0.4.4 + _ZTI13QuaChecksum32@Base 0.4.4 + _ZTI8QuaCrc32@Base 0.4.4 + _ZTS10QuaAdler32@Base 0.4.4 + _ZTS10QuaZipFile@Base 0.4.4 + _ZTS13QuaChecksum32@Base 0.4.4 + _ZTS8QuaCrc32@Base 0.4.4 + _ZTV10QuaAdler32@Base 0.4.4 + _ZTV10QuaZipFile@Base 0.4.4 + _ZTV13QuaChecksum32@Base 0.4.4 + _ZTV8QuaCrc32@Base 0.4.4 + fill_qiodevice_filefunc@Base 0.4.4 + unzClose@Base 0.4.4 + unzCloseCurrentFile@Base 0.4.4 + unzGetCurrentFileInfo@Base 0.4.4 + unzGetFilePos@Base 0.4.4 + unzGetGlobalComment@Base 0.4.4 + unzGetGlobalInfo@Base 0.4.4 + unzGetLocalExtrafield@Base 0.4.4 + unzGetOffset@Base 0.4.4 + unzGoToFilePos@Base 0.4.4 + unzGoToFirstFile@Base 0.4.4 + unzGoToNextFile@Base 0.4.4 + unzLocateFile@Base 0.4.4 + unzOpen2@Base 0.4.4 + unzOpen@Base 0.4.4 + unzOpenCurrentFile2@Base 0.4.4 + unzOpenCurrentFile3@Base 0.4.4 + unzOpenCurrentFile@Base 0.4.4 + unzOpenCurrentFilePassword@Base 0.4.4 + unzReadCurrentFile@Base 0.4.4 + unzSetOffset@Base 0.4.4 + unzStringFileNameCompare@Base 0.4.4 + unz_copyright@Base 0.4.4 + unzeof@Base 0.4.4 + unztell@Base 0.4.4 + zipClearFlags@Base 0.4.4 + zipClose@Base 0.4.4 + zipCloseFileInZip@Base 0.4.4 + zipCloseFileInZipRaw@Base 0.4.4 + zipOpen2@Base 0.4.4 + zipOpen@Base 0.4.4 + zipOpenNewFileInZip2@Base 0.4.4 + zipOpenNewFileInZip3@Base 0.4.4 + zipOpenNewFileInZip@Base 0.4.4 + zipSetFlags@Base 0.4.4 + zipWriteInFileInZip@Base 0.4.4 + zip_copyright@Base 0.4.4 diff --git a/3rdparty/quazip-0.5.1/quazip/doc/faq.dox b/3rdparty/quazip-0.5.1/quazip/doc/faq.dox new file mode 100644 index 00000000..0029ea97 --- /dev/null +++ b/3rdparty/quazip-0.5.1/quazip/doc/faq.dox @@ -0,0 +1,32 @@ +/** + * \page faq QuaZip FAQ + * + * + * + * \anchor faq-non-QIODevice Q. Is there any way to use QuaZipFile in Qt + * where you are supposed to use normal (non-zipped) file, but not + * through QIODevice API? + * + * A. Usually not. For example, if you are passing file name to some + * database driver (like SQLite), Qt usually just passes this name down + * to the 3rd-party library, which is usually does not know anything + * about QIODevice and therefore there is no way to pass QuaZipFile as + * normal file. However, if we are talking about some place where you + * pass file name, and then indirectly use QFile to open it, then it is + * a good idea to make overloaded method, which accepts a QIODevice + * pointer. Then you would be able to pass QuaZipFile as well as many + * other nice things such as QBuffer or QProcess. + * + * \anchor faq-zip64 Q. Can QuaZIP handle files larger than 4GB? What + * about zip64 standard? + * + * A. It isn't supported yet. QuaZIP is a wrapper around minizip. The minizip + * version QuaZIP was based on didn't support zip64. The newer version + * that appeared around 2010 reportedly does. But it will take some time + * and effort to integrate this version with QuaZIP. + **/ diff --git a/3rdparty/quazip-0.5.1/quazip/doc/index.dox b/3rdparty/quazip-0.5.1/quazip/doc/index.dox new file mode 100644 index 00000000..43291248 --- /dev/null +++ b/3rdparty/quazip-0.5.1/quazip/doc/index.dox @@ -0,0 +1,179 @@ +/** + * \mainpage QuaZIP - Qt/C++ wrapper for ZIP/UNZIP package + * +\htmlonly +Powered by SourceForge.net +\endhtmlonly + * \section overview Overview + * + * QuaZIP is a simple C++ wrapper over Gilles Vollant's ZIP/UNZIP + * package that can be used to access ZIP archives. It uses the Qt toolkit. + * + * If you do not know what Qt is, you have two options: + * - Just forget about QuaZIP. + * - Learn more about Qt by downloading it and/or reading the excellent official Qt documentation + * + * The choice is yours, but if you are really interested in + * cross-platform (Windows/Linux/BSD/UNIX/Mac/Others) software + * development, I would definitely recommend you the latter ^_^ + * + * QuaZIP allows you to access files inside ZIP archives using QIODevice + * API, and - yes! - that means that you can also use QTextStream, + * QDataStream or whatever you would like to use on your zipped files. + * + * QuaZIP provides complete abstraction of the ZIP/UNZIP API, for both + * reading from and writing to ZIP archives. + * + * \section download Download QuaZIP + * + * Downloads are available from QuaZIP project's page + * at SourceForge.net. + * + * \section platforms Platforms supported + * + * QuaZIP has been currently tested on the following platforms: + * - linux-g++ (Ubuntu 11.10, Qt 4.7.4) + * - freebsd-g++ (Qt 4.0.0 + * - hpux-acc (HP-UX 11.11) + * - hpux-g++ (HP-UX 11.11) + * - win32-g++ (MinGW) + * - win32-msvc2010 (MS VS 2010 Express, Qt 4.8.4) + * - win32-msvc2010 (Qt Creator, Qt 5.0.1) + * - some Symbian version, reportedly + * + * No testing has been officially done on other systems. Of course, patches to + * make it work on any platform that it currently does not work on are + * always welcome! + * + * \section whats-new What is new in this version of QuaZIP? + * + * See the NEWS.txt file supplied with the distribution. + * + * \section Requirements + * + * Just zlib and Qt 4/5. Well, Qt 4 + * depends on zlib anyway, but you will need zlib headers to compile + * QuaZIP. With Qt5 sometimes you need the zlib library as well (on + * Windows, for example). + * + * \section building Building, testing and installing + * + * \note Instructions given in this section assume that you are + * using some UNIX dialect, but the build process should be very similar + * on win32-g++ platform too. On other platforms it's essentially the + * same process, maybe with some qmake adjustments not specific to + * QuaZIP itself. + * + * To build the library, run: +\verbatim +$ cd /wherever/quazip/source/is/quazip-x.y.z/quazip +$ qmake [PREFIX=where-to-install] +$ make +\endverbatim + * + * Make sure that you have Qt 4/5 installed with all required headers and + * utilities (that is, including the 'dev' or 'devel' package on Linux) + * and that you run qmake utility of the Qt 4, not some other version + * you may have already installed (you may need to type full path to + * qmake like /usr/local/qt4/bin/qmake). + * + * To reconfigure (with another PREFIX, for example), just run qmake + * with appropriate arguments again. + * + * If you need to specify additional include path or libraries, use + * qmake features (see qmake reference in the Qt documentation). For + * example: + * +\verbatim +$ qmake LIBS+=-L/usr/local/zlib/lib INCLUDEPATH+=/usr/local/zlib/include +\endverbatim + * (note abscence of "-I" before the include path and the presence of "-L" + * before the lib path) + * + * Also note that you may or may not need to define ZLIB_WINAPI (qmake + * DEFINES+=ZLIB_WINAPI) when linking to zlib on Windows, depending on + * how zlib was built (generally, if using zlibwapi.dll, this define is + * needed). + * + * To install compiled library: +\verbatim +$ make install +\endverbatim + * + * By default, QuaZIP compiles as a DLL/SO, but you have other + * options: + * - Just copy appropriate source files to your project and use them, + * but you need to define QUAZIP_STATIC before including any QuaZIP + * headers (best done as a compiler option). This will save you from + * possible side effects of importing/exporting QuaZIP symbols. + * - Compile it as a static library using CONFIG += staticlib qmake + * option. QUAZIP_STATIC is defined automatically by qmake in this case. + * + * Binary compatibility is guaranteed between minor releases starting + * with version 0.5, thanks to the Pimpl idiom. That is, the next binary + * incompatible version will be 1.x, and if zip64 support is ever + * introduced, then there will be a build option to compile either as + * non-zip64 (binary compatible with the old releases) or as zip64 + * (which will be binary incompatible due to different file size types). + * + * \section test Testing + * + * To check if QuaZIP's basic features work OK on your platform, you may + * wish to compile the test suite provided in test directory: +\verbatim +$ cd /wherever/quazip/source/is/quazip-x.y.z/qztest +$ qmake +$ make +$ ./qztest +\endverbatim + * + * Note that the test suite looks for the quazip library in the "quazip" + * folder of the project ("../quazip"), but you may wish to use LIBS + * for some systems (Windows often puts the library in the separate + * "debug" or "release" directory). If you wish to use the quazip + * version that's already installed, provide the appropriate path. + * + * On some systems you may need to set PATH, LD_LIBRARY_PATH or + * SHLIB_PATH to get "qztest" to actually run. + * + * If everything went fine, the test suite should report a lot of PASS + * messages. If something goes wrong, it will provide details and a + * warning that some tests failed. + * + * \section using Using + * + * See \ref usage "usage page". + * + * \section contacts Authors and contacts + * + * This wrapper has been written by Sergey A. Tachenov, AKA Alqualos. + * This is my first open source project, so it may suck, but I did not + * find anything like that, so I just had no other choice but to write + * it. + * + * If you have anything to say to me about QuaZIP library, feel free to + * do so (read the \ref faq first, though). I can not promise, + * though, that I fix all the bugs you report in, add any features you + * want, or respond to your critics, or respond to your feedback at all. + * I may be busy, I may be tired of working on QuaZIP, I may be even + * dead already (you never know...). + * + * To report bugs or to post ideas about what should be done, use + * SourceForge.net's trackers. + * If you want to send me a private message, use my e-mail address + * stachenov@gmail.com. + * + * Do not use e-mail to report bugs, please. Reporting bugs and problems + * with the SourceForge.net's bug report system has that advantage that + * it is visible to public, and I can always search for open tickets + * that were created long ago. It is highly unlikely that I will search + * my mail for that kind of stuff, so if a bug reported by mail isn't + * fixed immediately, it will likely be forgotten forever. + * + * Copyright (C) 2005-2012 Sergey A. Tachenov and contributors + **/ diff --git a/3rdparty/quazip-0.5.1/quazip/doc/usage.dox b/3rdparty/quazip-0.5.1/quazip/doc/usage.dox new file mode 100644 index 00000000..108f6cbc --- /dev/null +++ b/3rdparty/quazip-0.5.1/quazip/doc/usage.dox @@ -0,0 +1,77 @@ +/** \page usage Usage + * + * This page provides general information on QuaZIP usage. See classes + * QuaZip and QuaZipFile for the detailed documentation on what can + * QuaZIP do and what it can not. Also, reading comments in the zip.h and + * unzip.h files (taken from the original ZIP/UNZIP package) is always a + * good idea too. After all, QuaZIP is just a wrapper with a few + * convenience extensions and reimplementations. + * + * QuaZip is a class representing ZIP archive, QuaZipFile represents a + * file inside archive and subclasses QIODevice as well. One limitation + * is that there can be only one instance of QuaZipFile per QuaZip + * instance, which kind of makes it confusing why there are two classes + * instead of one. This is actually no more than an API design mistake. + * + * \section terminology Terminology + * + * "QuaZIP" means whole this library, while "QuaZip" (note the + * lower case) is just one class in it. + * + * "ZIP/UNZIP API" or "minizip" means the original API of the Gilles + * Vollant's ZIP/UNZIP package. It was slightly modified to better + * integrate with Qt. These modifications are not source or binary + * compatible with the official minizip release, which means you can't + * just drop the newer minizip version into QuaZIP sources and make it + * work. + * + * "ZIP", "ZIP archive" or "ZIP file" means any ZIP archive. Typically + * this is a plain file with ".zip" (or ".ZIP") file name suffix, but it + * can also be any seekable QIODevice (say, QBuffer, but not + * QTcpSocket). + * + * "A file inside archive", "a file inside ZIP" or something like that + * means file either being read or written from/to some ZIP archive. + * + * \section error-handling Error handling + * + * Almost any call to ZIP/UNZIP API return some error code. Most of the + * original API's error checking could be done in this wrapper as well, + * but it would cause unnecessary code bloating without any benefit. So, + * QuaZIP only checks for situations that ZIP/UNZIP API can not check + * for. For example, ZIP/UNZIP API has no "ZIP open mode" concept + * because read and write modes are completely separated. On the other + * hand, to avoid creating classes like "QuaZipReader", "QuaZipWriter" + * or something like that, QuaZIP introduces "ZIP open mode" concept + * instead, thus making it possible to use one class (QuaZip) for both + * reading and writing. But this leads to additional open mode checks + * which are not done in ZIP/UNZIP package. + * + * Therefore, error checking is two-level (QuaZIP's level and ZIP/UNZIP + * API level), which sometimes can be confusing, so here are some + * advices on how the error checking should be properly done: + * + * - Both QuaZip and QuaZipFile have getZipError() function, which return + * error code of the last ZIP/UNZIP API call. Most function calls + * reset error code to UNZ_OK on success and set error code on + * failure. Some functions do not reset error code. Most of them are + * \c const and do not access ZIP archive in any way. Some, on the + * other hand, \em do access ZIP archive, but do not reset or set + * error code. For example, QuaZipFile::pos() function. Such functions + * are explicitly marked in the documentation. + * - Most functions have their own way to report errors, by returning a + * null string, negative value or \c false. If such a function returns + * error value, call getZipError() to get more information about + * error. See "zip.h" and "unzip.h" of the ZIP/UNZIP package for error + * codes. + * - If the function returns error-stating value (like \c false), but + * getZipError() returns UNZ_OK, it means that you did something + * obviously wrong. For example, tried to write in the archive open + * for reading or not open at all. You better just not do that! + * Most functions also issue a warning using qWarning() function in + * such cases. See documentation for a specific function for details + * on when it should not be called. + * + * I know that this is somewhat messy, but I could not find a better way + * to do all the error handling. + **/ diff --git a/quazip/ioapi.h b/3rdparty/quazip-0.5.1/quazip/ioapi.h similarity index 96% rename from quazip/ioapi.h rename to 3rdparty/quazip-0.5.1/quazip/ioapi.h index c6b71d4d..f4c21809 100644 --- a/quazip/ioapi.h +++ b/3rdparty/quazip-0.5.1/quazip/ioapi.h @@ -1,78 +1,77 @@ -/* ioapi.h -- IO base function header for compress/uncompress .zip - files using zlib + zip or unzip API - - Version 1.01e, February 12th, 2005 - - Copyright (C) 1998-2005 Gilles Vollant - - Modified by Sergey A. Tachenov to integrate with Qt. -*/ - -#ifndef _ZLIBIOAPI_H -#define _ZLIBIOAPI_H - -#define OF(x) x - -#define ZLIB_FILEFUNC_SEEK_CUR (1) -#define ZLIB_FILEFUNC_SEEK_END (2) -#define ZLIB_FILEFUNC_SEEK_SET (0) - -#define ZLIB_FILEFUNC_MODE_READ (1) -#define ZLIB_FILEFUNC_MODE_WRITE (2) -#define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3) - -#define ZLIB_FILEFUNC_MODE_EXISTING (4) -#define ZLIB_FILEFUNC_MODE_CREATE (8) - - -#ifndef ZCALLBACK - -#if (defined(WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK) -#define ZCALLBACK CALLBACK -#else -#define ZCALLBACK -#endif -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, voidpf file, int mode)); -typedef uLong (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size)); -typedef uLong (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size)); -typedef uLong (ZCALLBACK *tell_file_func) OF((voidpf opaque, voidpf stream)); -typedef int (ZCALLBACK *seek_file_func) OF((voidpf opaque, voidpf stream, uLong offset, int origin)); -typedef int (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream)); -typedef int (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream)); - -typedef struct zlib_filefunc_def_s -{ - open_file_func zopen_file; - read_file_func zread_file; - write_file_func zwrite_file; - tell_file_func ztell_file; - seek_file_func zseek_file; - close_file_func zclose_file; - testerror_file_func zerror_file; - voidpf opaque; -} zlib_filefunc_def; - - - -void fill_qiodevice_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); - -#define ZREAD(filefunc,filestream,buf,size) ((*((filefunc).zread_file))((filefunc).opaque,filestream,buf,size)) -#define ZWRITE(filefunc,filestream,buf,size) ((*((filefunc).zwrite_file))((filefunc).opaque,filestream,buf,size)) -#define ZTELL(filefunc,filestream) ((*((filefunc).ztell_file))((filefunc).opaque,filestream)) -#define ZSEEK(filefunc,filestream,pos,mode) ((*((filefunc).zseek_file))((filefunc).opaque,filestream,pos,mode)) -#define ZCLOSE(filefunc,filestream) ((*((filefunc).zclose_file))((filefunc).opaque,filestream)) -#define ZERROR(filefunc,filestream) ((*((filefunc).zerror_file))((filefunc).opaque,filestream)) - - -#ifdef __cplusplus -} -#endif - -#endif - +/* ioapi.h -- IO base function header for compress/uncompress .zip + files using zlib + zip or unzip API + + Version 1.01e, February 12th, 2005 + + Copyright (C) 1998-2005 Gilles Vollant + + Modified by Sergey A. Tachenov to integrate with Qt. +*/ + +#ifndef _ZLIBIOAPI_H +#define _ZLIBIOAPI_H + + +#define ZLIB_FILEFUNC_SEEK_CUR (1) +#define ZLIB_FILEFUNC_SEEK_END (2) +#define ZLIB_FILEFUNC_SEEK_SET (0) + +#define ZLIB_FILEFUNC_MODE_READ (1) +#define ZLIB_FILEFUNC_MODE_WRITE (2) +#define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3) + +#define ZLIB_FILEFUNC_MODE_EXISTING (4) +#define ZLIB_FILEFUNC_MODE_CREATE (8) + + +#ifndef ZCALLBACK + +#if (defined(WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK) +#define ZCALLBACK CALLBACK +#else +#define ZCALLBACK +#endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, voidpf file, int mode)); +typedef uLong (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size)); +typedef uLong (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size)); +typedef uLong (ZCALLBACK *tell_file_func) OF((voidpf opaque, voidpf stream)); +typedef int (ZCALLBACK *seek_file_func) OF((voidpf opaque, voidpf stream, uLong offset, int origin)); +typedef int (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream)); +typedef int (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream)); + +typedef struct zlib_filefunc_def_s +{ + open_file_func zopen_file; + read_file_func zread_file; + write_file_func zwrite_file; + tell_file_func ztell_file; + seek_file_func zseek_file; + close_file_func zclose_file; + testerror_file_func zerror_file; + voidpf opaque; +} zlib_filefunc_def; + + + +void fill_qiodevice_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); + +#define ZREAD(filefunc,filestream,buf,size) ((*((filefunc).zread_file))((filefunc).opaque,filestream,buf,size)) +#define ZWRITE(filefunc,filestream,buf,size) ((*((filefunc).zwrite_file))((filefunc).opaque,filestream,buf,size)) +#define ZTELL(filefunc,filestream) ((*((filefunc).ztell_file))((filefunc).opaque,filestream)) +#define ZSEEK(filefunc,filestream,pos,mode) ((*((filefunc).zseek_file))((filefunc).opaque,filestream,pos,mode)) +#define ZCLOSE(filefunc,filestream) ((*((filefunc).zclose_file))((filefunc).opaque,filestream)) +#define ZERROR(filefunc,filestream) ((*((filefunc).zerror_file))((filefunc).opaque,filestream)) + + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/quazip/qioapi.cpp b/3rdparty/quazip-0.5.1/quazip/qioapi.cpp similarity index 85% rename from quazip/qioapi.cpp rename to 3rdparty/quazip-0.5.1/quazip/qioapi.cpp index 407e2f8d..ca212765 100644 --- a/quazip/qioapi.cpp +++ b/3rdparty/quazip-0.5.1/quazip/qioapi.cpp @@ -1,142 +1,146 @@ -/* ioapi.c -- IO base function header for compress/uncompress .zip - files using zlib + zip or unzip API - - Version 1.01e, February 12th, 2005 - - Copyright (C) 1998-2005 Gilles Vollant - - Modified by Sergey A. Tachenov to integrate with Qt. -*/ - -#include -#include -#include - -#include "zlib.h" -#include "ioapi.h" -#include "quazip_global.h" -#include - - -/* I've found an old Unix (a SunOS 4.1.3_U1) without all SEEK_* defined.... */ - -#ifndef SEEK_CUR -#define SEEK_CUR 1 -#endif - -#ifndef SEEK_END -#define SEEK_END 2 -#endif - -#ifndef SEEK_SET -#define SEEK_SET 0 -#endif - -voidpf ZCALLBACK qiodevice_open_file_func ( - voidpf opaque UNUSED, - voidpf file, - int mode) -{ - QIODevice *iodevice = reinterpret_cast(file); - if(iodevice->isSequential()) - return NULL; - if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) - iodevice->open(QIODevice::ReadOnly); - else - if (mode & ZLIB_FILEFUNC_MODE_EXISTING) - iodevice->open(QIODevice::ReadWrite); - else - if (mode & ZLIB_FILEFUNC_MODE_CREATE) - iodevice->open(QIODevice::WriteOnly); - - if(iodevice->isOpen()) - return iodevice; - else - return NULL; -} - - -uLong ZCALLBACK qiodevice_read_file_func ( - voidpf opaque UNUSED, - voidpf stream, - void* buf, - uLong size) -{ - uLong ret; - ret = (uLong)((QIODevice*)stream)->read((char*)buf,size); - return ret; -} - - -uLong ZCALLBACK qiodevice_write_file_func ( - voidpf opaque UNUSED, - voidpf stream, - const void* buf, - uLong size) -{ - uLong ret; - ret = (uLong)((QIODevice*)stream)->write((char*)buf,size); - return ret; -} - -uLong ZCALLBACK qiodevice_tell_file_func ( - voidpf opaque UNUSED, - voidpf stream) -{ - uLong ret; - ret = ((QIODevice*)stream)->pos(); - return ret; -} - -int ZCALLBACK qiodevice_seek_file_func ( - voidpf opaque UNUSED, - voidpf stream, - uLong offset, - int origin) -{ - uLong qiodevice_seek_result=0; - int ret; - switch (origin) - { - case ZLIB_FILEFUNC_SEEK_CUR : - qiodevice_seek_result = ((QIODevice*)stream)->pos() + offset; - break; - case ZLIB_FILEFUNC_SEEK_END : - qiodevice_seek_result = ((QIODevice*)stream)->size() - offset; - break; - case ZLIB_FILEFUNC_SEEK_SET : - qiodevice_seek_result = offset; - break; - default: return -1; - } - ret = !((QIODevice*)stream)->seek(qiodevice_seek_result); - return ret; -} - -int ZCALLBACK qiodevice_close_file_func ( - voidpf opaque UNUSED, - voidpf stream) -{ - ((QIODevice*)stream)->close(); - return 0; -} - -int ZCALLBACK qiodevice_error_file_func ( - voidpf opaque UNUSED, - voidpf stream) -{ - return !((QIODevice*)stream)->errorString().isEmpty(); -} - -void fill_qiodevice_filefunc ( - zlib_filefunc_def* pzlib_filefunc_def) -{ - pzlib_filefunc_def->zopen_file = qiodevice_open_file_func; - pzlib_filefunc_def->zread_file = qiodevice_read_file_func; - pzlib_filefunc_def->zwrite_file = qiodevice_write_file_func; - pzlib_filefunc_def->ztell_file = qiodevice_tell_file_func; - pzlib_filefunc_def->zseek_file = qiodevice_seek_file_func; - pzlib_filefunc_def->zclose_file = qiodevice_close_file_func; - pzlib_filefunc_def->zerror_file = qiodevice_error_file_func; - pzlib_filefunc_def->opaque = NULL; -} +/* ioapi.c -- IO base function header for compress/uncompress .zip + files using zlib + zip or unzip API + + Version 1.01e, February 12th, 2005 + + Copyright (C) 1998-2005 Gilles Vollant + + Modified by Sergey A. Tachenov to integrate with Qt. +*/ + +#include +#include +#include + +#include "zlib.h" +#include "ioapi.h" +#include "quazip_global.h" +#include + + +/* I've found an old Unix (a SunOS 4.1.3_U1) without all SEEK_* defined.... */ + +#ifndef SEEK_CUR +#define SEEK_CUR 1 +#endif + +#ifndef SEEK_END +#define SEEK_END 2 +#endif + +#ifndef SEEK_SET +#define SEEK_SET 0 +#endif + +voidpf ZCALLBACK qiodevice_open_file_func ( + voidpf /*opaque UNUSED*/, + voidpf file, + int mode) +{ + QIODevice *iodevice = reinterpret_cast(file); + if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) + iodevice->open(QIODevice::ReadOnly); + else + if (mode & ZLIB_FILEFUNC_MODE_EXISTING) + iodevice->open(QIODevice::ReadWrite); + else + if (mode & ZLIB_FILEFUNC_MODE_CREATE) + iodevice->open(QIODevice::WriteOnly); + + if (iodevice->isOpen()) { + if (iodevice->isSequential()) { + iodevice->close(); + return NULL; + } else { + return iodevice; + } + } else + return NULL; +} + + +uLong ZCALLBACK qiodevice_read_file_func ( + voidpf /*opaque UNUSED*/, + voidpf stream, + void* buf, + uLong size) +{ + uLong ret; + ret = (uLong)((QIODevice*)stream)->read((char*)buf,size); + return ret; +} + + +uLong ZCALLBACK qiodevice_write_file_func ( + voidpf /*opaque UNUSED*/, + voidpf stream, + const void* buf, + uLong size) +{ + uLong ret; + ret = (uLong)((QIODevice*)stream)->write((char*)buf,size); + return ret; +} + +uLong ZCALLBACK qiodevice_tell_file_func ( + voidpf /*opaque UNUSED*/, + voidpf stream) +{ + uLong ret; + ret = ((QIODevice*)stream)->pos(); + return ret; +} + +int ZCALLBACK qiodevice_seek_file_func ( + voidpf /*opaque UNUSED*/, + voidpf stream, + uLong offset, + int origin) +{ + uLong qiodevice_seek_result=0; + int ret; + switch (origin) + { + case ZLIB_FILEFUNC_SEEK_CUR : + qiodevice_seek_result = ((QIODevice*)stream)->pos() + offset; + break; + case ZLIB_FILEFUNC_SEEK_END : + qiodevice_seek_result = ((QIODevice*)stream)->size() - offset; + break; + case ZLIB_FILEFUNC_SEEK_SET : + qiodevice_seek_result = offset; + break; + default: return -1; + } + ret = !((QIODevice*)stream)->seek(qiodevice_seek_result); + return ret; +} + +int ZCALLBACK qiodevice_close_file_func ( + voidpf /*opaque UNUSED*/, + voidpf stream) +{ + ((QIODevice*)stream)->close(); + return 0; +} + +int ZCALLBACK qiodevice_error_file_func ( + voidpf /*opaque UNUSED*/, + voidpf /*stream UNUSED*/) +{ + // can't check for error due to the QIODevice API limitation + return 0; +} + +void fill_qiodevice_filefunc ( + zlib_filefunc_def* pzlib_filefunc_def) +{ + pzlib_filefunc_def->zopen_file = qiodevice_open_file_func; + pzlib_filefunc_def->zread_file = qiodevice_read_file_func; + pzlib_filefunc_def->zwrite_file = qiodevice_write_file_func; + pzlib_filefunc_def->ztell_file = qiodevice_tell_file_func; + pzlib_filefunc_def->zseek_file = qiodevice_seek_file_func; + pzlib_filefunc_def->zclose_file = qiodevice_close_file_func; + pzlib_filefunc_def->zerror_file = qiodevice_error_file_func; + pzlib_filefunc_def->opaque = NULL; +} diff --git a/quazip/quaadler32.cpp b/3rdparty/quazip-0.5.1/quazip/quaadler32.cpp similarity index 100% rename from quazip/quaadler32.cpp rename to 3rdparty/quazip-0.5.1/quazip/quaadler32.cpp diff --git a/quazip/quaadler32.h b/3rdparty/quazip-0.5.1/quazip/quaadler32.h similarity index 100% rename from quazip/quaadler32.h rename to 3rdparty/quazip-0.5.1/quazip/quaadler32.h diff --git a/quazip/quachecksum32.h b/3rdparty/quazip-0.5.1/quazip/quachecksum32.h similarity index 100% rename from quazip/quachecksum32.h rename to 3rdparty/quazip-0.5.1/quazip/quachecksum32.h diff --git a/quazip/quacrc32.cpp b/3rdparty/quazip-0.5.1/quazip/quacrc32.cpp similarity index 100% rename from quazip/quacrc32.cpp rename to 3rdparty/quazip-0.5.1/quazip/quacrc32.cpp diff --git a/quazip/quacrc32.h b/3rdparty/quazip-0.5.1/quazip/quacrc32.h similarity index 100% rename from quazip/quacrc32.h rename to 3rdparty/quazip-0.5.1/quazip/quacrc32.h diff --git a/3rdparty/quazip-0.5.1/quazip/quagzipfile.cpp b/3rdparty/quazip-0.5.1/quazip/quagzipfile.cpp new file mode 100644 index 00000000..2f256875 --- /dev/null +++ b/3rdparty/quazip-0.5.1/quazip/quagzipfile.cpp @@ -0,0 +1,148 @@ +#include + +#include "quagzipfile.h" + +/// \cond internal +class QuaGzipFilePrivate { + friend class QuaGzipFile; + QString fileName; + gzFile gzd; + inline QuaGzipFilePrivate(): gzd(NULL) {} + inline QuaGzipFilePrivate(const QString &fileName): + fileName(fileName), gzd(NULL) {} + template bool open(FileId id, + QIODevice::OpenMode mode, QString &error); + gzFile open(int fd, const char *modeString); + gzFile open(const QString &name, const char *modeString); +}; + +gzFile QuaGzipFilePrivate::open(const QString &name, const char *modeString) +{ + return gzopen(QFile::encodeName(name).constData(), modeString); +} + +gzFile QuaGzipFilePrivate::open(int fd, const char *modeString) +{ + return gzdopen(fd, modeString); +} + +template +bool QuaGzipFilePrivate::open(FileId id, QIODevice::OpenMode mode, + QString &error) +{ + char modeString[2]; + modeString[0] = modeString[1] = '\0'; + if ((mode & QIODevice::Append) != 0) { + error = QuaGzipFile::trUtf8("QIODevice::Append is not " + "supported for GZIP"); + return false; + } + if ((mode & QIODevice::ReadOnly) != 0 + && (mode & QIODevice::WriteOnly) != 0) { + error = QuaGzipFile::trUtf8("Opening gzip for both reading" + " and writing is not supported"); + return false; + } else if ((mode & QIODevice::ReadOnly) != 0) { + modeString[0] = 'r'; + } else if ((mode & QIODevice::WriteOnly) != 0) { + modeString[0] = 'w'; + } else { + error = QuaGzipFile::trUtf8("You can open a gzip either for reading" + " or for writing. Which is it?"); + return false; + } + gzd = open(id, modeString); + if (gzd == NULL) { + error = QuaGzipFile::trUtf8("Could not gzopen() file"); + return false; + } + return true; +} +/// \endcond + +QuaGzipFile::QuaGzipFile(): +d(new QuaGzipFilePrivate()) +{ +} + +QuaGzipFile::QuaGzipFile(QObject *parent): +QIODevice(parent), +d(new QuaGzipFilePrivate()) +{ +} + +QuaGzipFile::QuaGzipFile(const QString &fileName, QObject *parent): + QIODevice(parent), +d(new QuaGzipFilePrivate(fileName)) +{ +} + +QuaGzipFile::~QuaGzipFile() +{ + if (isOpen()) { + close(); + } + delete d; +} + +void QuaGzipFile::setFileName(const QString& fileName) +{ + d->fileName = fileName; +} + +QString QuaGzipFile::getFileName() const +{ + return d->fileName; +} + +bool QuaGzipFile::isSequential() const +{ + return true; +} + +bool QuaGzipFile::open(QIODevice::OpenMode mode) +{ + QString error; + if (!d->open(d->fileName, mode, error)) { + setErrorString(error); + return false; + } + return QIODevice::open(mode); +} + +bool QuaGzipFile::open(int fd, QIODevice::OpenMode mode) +{ + QString error; + if (!d->open(fd, mode, error)) { + setErrorString(error); + return false; + } + return QIODevice::open(mode); +} + +bool QuaGzipFile::flush() +{ + return gzflush(d->gzd, Z_SYNC_FLUSH) == Z_OK; +} + +void QuaGzipFile::close() +{ + QIODevice::close(); + gzclose(d->gzd); +} + +qint64 QuaGzipFile::readData(char *data, qint64 maxSize) +{ + return gzread(d->gzd, (voidp)data, (unsigned)maxSize); +} + +qint64 QuaGzipFile::writeData(const char *data, qint64 maxSize) +{ + if (maxSize == 0) + return 0; + int written = gzwrite(d->gzd, (voidp)data, (unsigned)maxSize); + if (written == 0) + return -1; + else + return written; +} diff --git a/3rdparty/quazip-0.5.1/quazip/quagzipfile.h b/3rdparty/quazip-0.5.1/quazip/quagzipfile.h new file mode 100644 index 00000000..0a711738 --- /dev/null +++ b/3rdparty/quazip-0.5.1/quazip/quagzipfile.h @@ -0,0 +1,84 @@ +#ifndef QUAZIP_QUAGZIPFILE_H +#define QUAZIP_QUAGZIPFILE_H + +#include +#include "quazip_global.h" + +#include + +class QuaGzipFilePrivate; + +/// GZIP file +/** + This class is a wrapper around GZIP file access functions in zlib. Unlike QuaZip classes, it doesn't allow reading from a GZIP file opened as QIODevice, for example, if your GZIP file is in QBuffer. It only provides QIODevice access to a GZIP file contents, but the GZIP file itself must be identified by its name on disk or by descriptor id. + */ +class QUAZIP_EXPORT QuaGzipFile: public QIODevice { + Q_OBJECT +public: + /// Empty constructor. + /** + Must call setFileName() before trying to open. + */ + QuaGzipFile(); + /// Empty constructor with a parent. + /** + Must call setFileName() before trying to open. + \param parent The parent object, as per QObject logic. + */ + QuaGzipFile(QObject *parent); + /// Constructor. + /** + \param fileName The name of the GZIP file. + \param parent The parent object, as per QObject logic. + */ + QuaGzipFile(const QString &fileName, QObject *parent = NULL); + /// Destructor. + virtual ~QuaGzipFile(); + /// Sets the name of the GZIP file to be opened. + void setFileName(const QString& fileName); + /// Returns the name of the GZIP file. + QString getFileName() const; + /// Returns true. + /** + Strictly speaking, zlib supports seeking for GZIP files, but it is + poorly implemented, because there is no way to implement it + properly. For reading, seeking backwards is very slow, and for + writing, it is downright impossible. Therefore, QuaGzipFile does not + support seeking at all. + */ + virtual bool isSequential() const; + /// Opens the file. + /** + \param mode Can be either QIODevice::Write or QIODevice::Read. + ReadWrite and Append aren't supported. + */ + virtual bool open(QIODevice::OpenMode mode); + /// Opens the file. + /** + \overload + \param fd The file descriptor to read/write the GZIP file from/to. + \param mode Can be either QIODevice::Write or QIODevice::Read. + ReadWrite and Append aren't supported. + */ + virtual bool open(int fd, QIODevice::OpenMode mode); + /// Flushes data to file. + /** + The data is written using Z_SYNC_FLUSH mode. Doesn't make any sense + when reading. + */ + virtual bool flush(); + /// Closes the file. + virtual void close(); +protected: + /// Implementation of QIODevice::readData(). + virtual qint64 readData(char *data, qint64 maxSize); + /// Implementation of QIODevice::writeData(). + virtual qint64 writeData(const char *data, qint64 maxSize); +private: + // not implemented by design to disable copy + QuaGzipFile(const QuaGzipFile &that); + QuaGzipFile& operator=(const QuaGzipFile &that); + QuaGzipFilePrivate *d; +}; + +#endif // QUAZIP_QUAGZIPFILE_H diff --git a/3rdparty/quazip-0.5.1/quazip/quaziodevice.cpp b/3rdparty/quazip-0.5.1/quazip/quaziodevice.cpp new file mode 100644 index 00000000..9907198f --- /dev/null +++ b/3rdparty/quazip-0.5.1/quazip/quaziodevice.cpp @@ -0,0 +1,296 @@ +#include "quaziodevice.h" + +#define QUAZIO_INBUFSIZE 4096 +#define QUAZIO_OUTBUFSIZE 4096 + +/// \cond internal +class QuaZIODevicePrivate { + friend class QuaZIODevice; + QuaZIODevicePrivate(QIODevice *io); + ~QuaZIODevicePrivate(); + QIODevice *io; + z_stream zins; + z_stream zouts; + char *inBuf; + int inBufPos; + int inBufSize; + char *outBuf; + int outBufPos; + int outBufSize; + bool zBufError; + int doFlush(QString &error); +}; + +QuaZIODevicePrivate::QuaZIODevicePrivate(QIODevice *io): + io(io), + inBuf(NULL), + inBufPos(0), + inBufSize(0), + outBuf(NULL), + outBufPos(0), + outBufSize(0), + zBufError(false) +{ + zins.zalloc = (alloc_func) NULL; + zins.zfree = (free_func) NULL; + zins.opaque = NULL; + zouts.zalloc = (alloc_func) NULL; + zouts.zfree = (free_func) NULL; + zouts.opaque = NULL; + inBuf = new char[QUAZIO_INBUFSIZE]; + outBuf = new char[QUAZIO_OUTBUFSIZE]; +#ifdef QUAZIP_ZIODEVICE_DEBUG_OUTPUT + debug.setFileName("debug.out"); + debug.open(QIODevice::WriteOnly); +#endif +#ifdef QUAZIP_ZIODEVICE_DEBUG_INPUT + indebug.setFileName("debug.in"); + indebug.open(QIODevice::WriteOnly); +#endif +} + +QuaZIODevicePrivate::~QuaZIODevicePrivate() +{ +#ifdef QUAZIP_ZIODEVICE_DEBUG_OUTPUT + debug.close(); +#endif +#ifdef QUAZIP_ZIODEVICE_DEBUG_INPUT + indebug.close(); +#endif + if (inBuf != NULL) + delete[] inBuf; + if (outBuf != NULL) + delete[] outBuf; +} + +int QuaZIODevicePrivate::doFlush(QString &error) +{ + int flushed = 0; + while (outBufPos < outBufSize) { + int more = io->write(outBuf + outBufPos, outBufSize - outBufPos); + if (more == -1) { + error = io->errorString(); + return -1; + } + if (more == 0) + break; + outBufPos += more; + flushed += more; + } + if (outBufPos == outBufSize) { + outBufPos = outBufSize = 0; + } + return flushed; +} + +/// \endcond + +// #define QUAZIP_ZIODEVICE_DEBUG_OUTPUT +// #define QUAZIP_ZIODEVICE_DEBUG_INPUT +#ifdef QUAZIP_ZIODEVICE_DEBUG_OUTPUT +#include +static QFile debug; +#endif +#ifdef QUAZIP_ZIODEVICE_DEBUG_INPUT +#include +static QFile indebug; +#endif + +QuaZIODevice::QuaZIODevice(QIODevice *io, QObject *parent): + QIODevice(parent), + d(new QuaZIODevicePrivate(io)) +{ + connect(io, SIGNAL(readyRead()), SIGNAL(readyRead())); +} + +QuaZIODevice::~QuaZIODevice() +{ + if (isOpen()) + close(); + delete d; +} + +QIODevice *QuaZIODevice::getIoDevice() const +{ + return d->io; +} + +bool QuaZIODevice::open(QIODevice::OpenMode mode) +{ + if ((mode & QIODevice::Append) != 0) { + setErrorString(trUtf8("QIODevice::Append is not supported for" + " QuaZIODevice")); + return false; + } + if ((mode & QIODevice::ReadWrite) == QIODevice::ReadWrite) { + setErrorString(trUtf8("QIODevice::ReadWrite is not supported for" + " QuaZIODevice")); + return false; + } + if ((mode & QIODevice::ReadOnly) != 0) { + if (inflateInit(&d->zins) != Z_OK) { + setErrorString(d->zins.msg); + return false; + } + } + if ((mode & QIODevice::WriteOnly) != 0) { + if (deflateInit(&d->zouts, Z_DEFAULT_COMPRESSION) != Z_OK) { + setErrorString(d->zouts.msg); + return false; + } + } + return QIODevice::open(mode); +} + +void QuaZIODevice::close() +{ + if ((openMode() & QIODevice::ReadOnly) != 0) { + if (inflateEnd(&d->zins) != Z_OK) { + setErrorString(d->zins.msg); + } + } + if ((openMode() & QIODevice::WriteOnly) != 0) { + flush(); + if (deflateEnd(&d->zouts) != Z_OK) { + setErrorString(d->zouts.msg); + } + } + QIODevice::close(); +} + +qint64 QuaZIODevice::readData(char *data, qint64 maxSize) +{ + int read = 0; + while (read < maxSize) { + if (d->inBufPos == d->inBufSize) { + d->inBufPos = 0; + d->inBufSize = d->io->read(d->inBuf, QUAZIO_INBUFSIZE); + if (d->inBufSize == -1) { + d->inBufSize = 0; + setErrorString(d->io->errorString()); + return -1; + } + if (d->inBufSize == 0) + break; + } + while (read < maxSize && d->inBufPos < d->inBufSize) { + d->zins.next_in = (Bytef *) (d->inBuf + d->inBufPos); + d->zins.avail_in = d->inBufSize - d->inBufPos; + d->zins.next_out = (Bytef *) (data + read); + d->zins.avail_out = (uInt) (maxSize - read); // hope it's less than 2GB + int more = 0; + switch (inflate(&d->zins, Z_SYNC_FLUSH)) { + case Z_OK: + read = (char *) d->zins.next_out - data; + d->inBufPos = (char *) d->zins.next_in - d->inBuf; + break; + case Z_STREAM_END: + read = (char *) d->zins.next_out - data; + d->inBufPos = (char *) d->zins.next_in - d->inBuf; + return read; + case Z_BUF_ERROR: // this should never happen, but just in case + if (!d->zBufError) { + qWarning("Z_BUF_ERROR detected with %d/%d in/out, weird", + d->zins.avail_in, d->zins.avail_out); + d->zBufError = true; + } + memmove(d->inBuf, d->inBuf + d->inBufPos, d->inBufSize - d->inBufPos); + d->inBufSize -= d->inBufPos; + d->inBufPos = 0; + more = d->io->read(d->inBuf + d->inBufSize, QUAZIO_INBUFSIZE - d->inBufSize); + if (more == -1) { + setErrorString(d->io->errorString()); + return -1; + } + if (more == 0) + return read; + d->inBufSize += more; + break; + default: + setErrorString(QString::fromLocal8Bit(d->zins.msg)); + return -1; + } + } + } +#ifdef QUAZIP_ZIODEVICE_DEBUG_INPUT + indebug.write(data, read); +#endif + return read; +} + +qint64 QuaZIODevice::writeData(const char *data, qint64 maxSize) +{ + int written = 0; + QString error; + if (d->doFlush(error) == -1) { + setErrorString(error); + return -1; + } + while (written < maxSize) { + // there is some data waiting in the output buffer + if (d->outBufPos < d->outBufSize) + return written; + d->zouts.next_in = (Bytef *) (data + written); + d->zouts.avail_in = (uInt) (maxSize - written); // hope it's less than 2GB + d->zouts.next_out = (Bytef *) d->outBuf; + d->zouts.avail_out = QUAZIO_OUTBUFSIZE; + switch (deflate(&d->zouts, Z_NO_FLUSH)) { + case Z_OK: + written = (char *) d->zouts.next_in - data; + d->outBufSize = (char *) d->zouts.next_out - d->outBuf; + break; + default: + setErrorString(QString::fromLocal8Bit(d->zouts.msg)); + return -1; + } + if (d->doFlush(error) == -1) { + setErrorString(error); + return -1; + } + } +#ifdef QUAZIP_ZIODEVICE_DEBUG_OUTPUT + debug.write(data, written); +#endif + return written; +} + +bool QuaZIODevice::flush() +{ + QString error; + if (d->doFlush(error) < 0) { + setErrorString(error); + return false; + } + // can't flush buffer, some data is still waiting + if (d->outBufPos < d->outBufSize) + return true; + Bytef c = 0; + d->zouts.next_in = &c; // fake input buffer + d->zouts.avail_in = 0; // of zero size + do { + d->zouts.next_out = (Bytef *) d->outBuf; + d->zouts.avail_out = QUAZIO_OUTBUFSIZE; + switch (deflate(&d->zouts, Z_SYNC_FLUSH)) { + case Z_OK: + d->outBufSize = (char *) d->zouts.next_out - d->outBuf; + if (d->doFlush(error) < 0) { + setErrorString(error); + return false; + } + if (d->outBufPos < d->outBufSize) + return true; + break; + case Z_BUF_ERROR: // nothing to write? + return true; + default: + setErrorString(QString::fromLocal8Bit(d->zouts.msg)); + return false; + } + } while (d->zouts.avail_out == 0); + return true; +} + +bool QuaZIODevice::isSequential() const +{ + return true; +} diff --git a/3rdparty/quazip-0.5.1/quazip/quaziodevice.h b/3rdparty/quazip-0.5.1/quazip/quaziodevice.h new file mode 100644 index 00000000..ff0d31a5 --- /dev/null +++ b/3rdparty/quazip-0.5.1/quazip/quaziodevice.h @@ -0,0 +1,74 @@ +#ifndef QUAZIP_QUAZIODEVICE_H +#define QUAZIP_QUAZIODEVICE_H + +#include +#include "quazip_global.h" + +#include + +class QuaZIODevicePrivate; + +/// A class to compress/decompress QIODevice. +/** + This class can be used to compress any data written to QIODevice or + decompress it back. Compressing data sent over a QTcpSocket is a good + example. + */ +class QUAZIP_EXPORT QuaZIODevice: public QIODevice { + Q_OBJECT +public: + /// Constructor. + /** + \param io The QIODevice to read/write. + \param parent The parent object, as per QObject logic. + */ + QuaZIODevice(QIODevice *io, QObject *parent = NULL); + /// Destructor. + ~QuaZIODevice(); + /// Flushes data waiting to be written. + /** + Unfortunately, as QIODevice doesn't support flush() by itself, the + only thing this method does is write the compressed data into the + device using Z_SYNC_FLUSH mode. If you need the compressed data to + actually be flushed from the buffer of the underlying QIODevice, you + need to call its flush() method as well, providing it supports it + (like QTcpSocket does). Example: + \code + QuaZIODevice dev(&sock); + dev.open(QIODevice::Write); + dev.write(yourDataGoesHere); + dev.flush(); + sock->flush(); // this actually sends data to network + \endcode + + This may change in the future versions of QuaZIP by implementing an + ugly hack: trying to cast the QIODevice using qobject_cast to known + flush()-supporting subclasses, and calling flush if the resulting + pointer is not zero. + */ + virtual bool flush(); + /// Opens the device. + /** + \param mode Neither QIODevice::ReadWrite nor QIODevice::Append are + not supported. + */ + virtual bool open(QIODevice::OpenMode mode); + /// Closes this device, but not the underlying one. + /** + The underlying QIODevice is not closed in case you want to write + something else to it. + */ + virtual void close(); + /// Returns the underlying device. + QIODevice *getIoDevice() const; + /// Returns true. + virtual bool isSequential() const; +protected: + /// Implementation of QIODevice::readData(). + virtual qint64 readData(char *data, qint64 maxSize); + /// Implementation of QIODevice::writeData(). + virtual qint64 writeData(const char *data, qint64 maxSize); +private: + QuaZIODevicePrivate *d; +}; +#endif // QUAZIP_QUAZIODEVICE_H diff --git a/quazip/quazip.cpp b/3rdparty/quazip-0.5.1/quazip/quazip.cpp similarity index 87% rename from quazip/quazip.cpp rename to 3rdparty/quazip-0.5.1/quazip/quazip.cpp index e13d1ce8..cc8838e2 100644 --- a/quazip/quazip.cpp +++ b/3rdparty/quazip-0.5.1/quazip/quazip.cpp @@ -1,519 +1,554 @@ -/* -Copyright (C) 2005-2011 Sergey A. Tachenov - -This program is free software; you can redistribute it and/or modify it -under the terms of the GNU Lesser General Public License as published by -the Free Software Foundation; either version 2 of the License, or (at -your option) any later version. - -This program is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser -General Public License for more details. - -You should have received a copy of the GNU Lesser General Public License -along with this program; if not, write to the Free Software Foundation, -Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -See COPYING file for the full LGPL text. - -Original ZIP package is copyrighted by Gilles Vollant, see -quazip/(un)zip.h files for details, basically it's zlib license. - **/ - -#include -#include - -#include "quazip.h" - -class QuaZipPrivate { - friend class QuaZip; - private: - QuaZip *q; - QTextCodec *fileNameCodec, *commentCodec; - QString zipName; - QIODevice *ioDevice; - QString comment; - QuaZip::Mode mode; - union { - unzFile unzFile_f; - zipFile zipFile_f; - }; - bool hasCurrentFile_f; - int zipError; - bool dataDescriptorWritingEnabled; - inline QuaZipPrivate(QuaZip *q): - q(q), - fileNameCodec(QTextCodec::codecForLocale()), - commentCodec(QTextCodec::codecForLocale()), - ioDevice(NULL), - mode(QuaZip::mdNotOpen), - hasCurrentFile_f(false), - zipError(UNZ_OK), - dataDescriptorWritingEnabled(true) {} - inline QuaZipPrivate(QuaZip *q, const QString &zipName): - q(q), - fileNameCodec(QTextCodec::codecForLocale()), - commentCodec(QTextCodec::codecForLocale()), - zipName(zipName), - ioDevice(NULL), - mode(QuaZip::mdNotOpen), - hasCurrentFile_f(false), - zipError(UNZ_OK), - dataDescriptorWritingEnabled(true) {} - inline QuaZipPrivate(QuaZip *q, QIODevice *ioDevice): - q(q), - fileNameCodec(QTextCodec::codecForLocale()), - commentCodec(QTextCodec::codecForLocale()), - ioDevice(ioDevice), - mode(QuaZip::mdNotOpen), - hasCurrentFile_f(false), - zipError(UNZ_OK), - dataDescriptorWritingEnabled(true) {} - template - bool getFileInfoList(QList *result) const; -}; - -QuaZip::QuaZip(): - p(new QuaZipPrivate(this)) -{ -} - -QuaZip::QuaZip(const QString& zipName): - p(new QuaZipPrivate(this, zipName)) -{ -} - -QuaZip::QuaZip(QIODevice *ioDevice): - p(new QuaZipPrivate(this, ioDevice)) -{ -} - -QuaZip::~QuaZip() -{ - if(isOpen()) - close(); - delete p; -} - -bool QuaZip::open(Mode mode, zlib_filefunc_def* ioApi) -{ - p->zipError=UNZ_OK; - if(isOpen()) { - qWarning("QuaZip::open(): ZIP already opened"); - return false; - } - QIODevice *ioDevice = p->ioDevice; - if (ioDevice == NULL) { - if (p->zipName.isEmpty()) { - qWarning("QuaZip::open(): set either ZIP file name or IO device first"); - return false; - } else { - ioDevice = new QFile(p->zipName); - } - } - switch(mode) { - case mdUnzip: - p->unzFile_f=unzOpen2(ioDevice, ioApi); - if(p->unzFile_f!=NULL) { - p->mode=mode; - p->ioDevice = ioDevice; - return true; - } else { - p->zipError=UNZ_OPENERROR; - if (!p->zipName.isEmpty()) - delete ioDevice; - return false; - } - case mdCreate: - case mdAppend: - case mdAdd: - p->zipFile_f=zipOpen2(ioDevice, - mode==mdCreate?APPEND_STATUS_CREATE: - mode==mdAppend?APPEND_STATUS_CREATEAFTER: - APPEND_STATUS_ADDINZIP, - NULL, - ioApi); - if(p->zipFile_f!=NULL) { - p->mode=mode; - p->ioDevice = ioDevice; - return true; - } else { - p->zipError=UNZ_OPENERROR; - if (!p->zipName.isEmpty()) - delete ioDevice; - return false; - } - default: - qWarning("QuaZip::open(): unknown mode: %d", (int)mode); - if (!p->zipName.isEmpty()) - delete ioDevice; - return false; - break; - } -} - -void QuaZip::close() -{ - p->zipError=UNZ_OK; - switch(p->mode) { - case mdNotOpen: - qWarning("QuaZip::close(): ZIP is not open"); - return; - case mdUnzip: - p->zipError=unzClose(p->unzFile_f); - break; - case mdCreate: - case mdAppend: - case mdAdd: - p->zipError=zipClose(p->zipFile_f, p->commentCodec->fromUnicode(p->comment).constData()); - break; - default: - qWarning("QuaZip::close(): unknown mode: %d", (int)p->mode); - return; - } - // opened by name, need to delete the internal IO device - if (!p->zipName.isEmpty()) - delete p->ioDevice; - if(p->zipError==UNZ_OK) - p->mode=mdNotOpen; -} - -void QuaZip::setZipName(const QString& zipName) -{ - if(isOpen()) { - qWarning("QuaZip::setZipName(): ZIP is already open!"); - return; - } - p->zipName=zipName; - p->ioDevice = NULL; -} - -void QuaZip::setIoDevice(QIODevice *ioDevice) -{ - if(isOpen()) { - qWarning("QuaZip::setIoDevice(): ZIP is already open!"); - return; - } - p->ioDevice = ioDevice; - p->zipName = QString(); -} - -int QuaZip::getEntriesCount()const -{ - QuaZip *fakeThis=(QuaZip*)this; // non-const - fakeThis->p->zipError=UNZ_OK; - if(p->mode!=mdUnzip) { - qWarning("QuaZip::getEntriesCount(): ZIP is not open in mdUnzip mode"); - return -1; - } - unz_global_info globalInfo; - if((fakeThis->p->zipError=unzGetGlobalInfo(p->unzFile_f, &globalInfo))!=UNZ_OK) - return p->zipError; - return (int)globalInfo.number_entry; -} - -QString QuaZip::getComment()const -{ - QuaZip *fakeThis=(QuaZip*)this; // non-const - fakeThis->p->zipError=UNZ_OK; - if(p->mode!=mdUnzip) { - qWarning("QuaZip::getComment(): ZIP is not open in mdUnzip mode"); - return QString(); - } - unz_global_info globalInfo; - QByteArray comment; - if((fakeThis->p->zipError=unzGetGlobalInfo(p->unzFile_f, &globalInfo))!=UNZ_OK) - return QString(); - comment.resize(globalInfo.size_comment); - if((fakeThis->p->zipError=unzGetGlobalComment(p->unzFile_f, comment.data(), comment.size())) < 0) - return QString(); - fakeThis->p->zipError = UNZ_OK; - return p->commentCodec->toUnicode(comment); -} - -bool QuaZip::setCurrentFile(const QString& fileName, CaseSensitivity cs) -{ - p->zipError=UNZ_OK; - if(p->mode!=mdUnzip) { - qWarning("QuaZip::setCurrentFile(): ZIP is not open in mdUnzip mode"); - return false; - } - if(fileName.isEmpty()) { - p->hasCurrentFile_f=false; - return true; - } - // Unicode-aware reimplementation of the unzLocateFile function - if(p->unzFile_f==NULL) { - p->zipError=UNZ_PARAMERROR; - return false; - } - if(fileName.length()>MAX_FILE_NAME_LENGTH) { - p->zipError=UNZ_PARAMERROR; - return false; - } - bool sens; - if(cs==csDefault) { -#ifdef Q_OS_WIN - sens=false; -#else - sens=true; -#endif - } else sens=cs==csSensitive; - QString lower, current; - if(!sens) lower=fileName.toLower(); - p->hasCurrentFile_f=false; - for(bool more=goToFirstFile(); more; more=goToNextFile()) { - current=getCurrentFileName(); - if(current.isEmpty()) return false; - if(sens) { - if(current==fileName) break; - } else { - if(current.toLower()==lower) break; - } - } - return p->hasCurrentFile_f; -} - -bool QuaZip::goToFirstFile() -{ - p->zipError=UNZ_OK; - if(p->mode!=mdUnzip) { - qWarning("QuaZip::goToFirstFile(): ZIP is not open in mdUnzip mode"); - return false; - } - p->zipError=unzGoToFirstFile(p->unzFile_f); - p->hasCurrentFile_f=p->zipError==UNZ_OK; - return p->hasCurrentFile_f; -} - -bool QuaZip::goToNextFile() -{ - p->zipError=UNZ_OK; - if(p->mode!=mdUnzip) { - qWarning("QuaZip::goToFirstFile(): ZIP is not open in mdUnzip mode"); - return false; - } - p->zipError=unzGoToNextFile(p->unzFile_f); - p->hasCurrentFile_f=p->zipError==UNZ_OK; - if(p->zipError==UNZ_END_OF_LIST_OF_FILE) - p->zipError=UNZ_OK; - return p->hasCurrentFile_f; -} - -bool QuaZip::getCurrentFileInfo(QuaZipFileInfo *info)const -{ - QuaZip *fakeThis=(QuaZip*)this; // non-const - fakeThis->p->zipError=UNZ_OK; - if(p->mode!=mdUnzip) { - qWarning("QuaZip::getCurrentFileInfo(): ZIP is not open in mdUnzip mode"); - return false; - } - unz_file_info info_z; - QByteArray fileName; - QByteArray extra; - QByteArray comment; - if(info==NULL) return false; - if(!isOpen()||!hasCurrentFile()) return false; - if((fakeThis->p->zipError=unzGetCurrentFileInfo(p->unzFile_f, &info_z, NULL, 0, NULL, 0, NULL, 0))!=UNZ_OK) - return false; - fileName.resize(info_z.size_filename); - extra.resize(info_z.size_file_extra); - comment.resize(info_z.size_file_comment); - if((fakeThis->p->zipError=unzGetCurrentFileInfo(p->unzFile_f, NULL, - fileName.data(), fileName.size(), - extra.data(), extra.size(), - comment.data(), comment.size()))!=UNZ_OK) - return false; - info->versionCreated=info_z.version; - info->versionNeeded=info_z.version_needed; - info->flags=info_z.flag; - info->method=info_z.compression_method; - info->crc=info_z.crc; - info->compressedSize=info_z.compressed_size; - info->uncompressedSize=info_z.uncompressed_size; - info->diskNumberStart=info_z.disk_num_start; - info->internalAttr=info_z.internal_fa; - info->externalAttr=info_z.external_fa; - info->name=p->fileNameCodec->toUnicode(fileName); - info->comment=p->commentCodec->toUnicode(comment); - info->extra=extra; - info->dateTime=QDateTime( - QDate(info_z.tmu_date.tm_year, info_z.tmu_date.tm_mon+1, info_z.tmu_date.tm_mday), - QTime(info_z.tmu_date.tm_hour, info_z.tmu_date.tm_min, info_z.tmu_date.tm_sec)); - return true; -} - -QString QuaZip::getCurrentFileName()const -{ - QuaZip *fakeThis=(QuaZip*)this; // non-const - fakeThis->p->zipError=UNZ_OK; - if(p->mode!=mdUnzip) { - qWarning("QuaZip::getCurrentFileName(): ZIP is not open in mdUnzip mode"); - return QString(); - } - if(!isOpen()||!hasCurrentFile()) return QString(); - QByteArray fileName(MAX_FILE_NAME_LENGTH, 0); - if((fakeThis->p->zipError=unzGetCurrentFileInfo(p->unzFile_f, NULL, fileName.data(), fileName.size(), - NULL, 0, NULL, 0))!=UNZ_OK) - return QString(); - return p->fileNameCodec->toUnicode(fileName.constData()); -} - -void QuaZip::setFileNameCodec(QTextCodec *fileNameCodec) -{ - p->fileNameCodec=fileNameCodec; -} - -void QuaZip::setFileNameCodec(const char *fileNameCodecName) -{ - p->fileNameCodec=QTextCodec::codecForName(fileNameCodecName); -} - -QTextCodec *QuaZip::getFileNameCodec()const -{ - return p->fileNameCodec; -} - -void QuaZip::setCommentCodec(QTextCodec *commentCodec) -{ - p->commentCodec=commentCodec; -} - -void QuaZip::setCommentCodec(const char *commentCodecName) -{ - p->commentCodec=QTextCodec::codecForName(commentCodecName); -} - -QTextCodec *QuaZip::getCommentCodec()const -{ - return p->commentCodec; -} - -QString QuaZip::getZipName() const -{ - return p->zipName; -} - -QIODevice *QuaZip::getIoDevice() const -{ - if (!p->zipName.isEmpty()) // opened by name, using an internal QIODevice - return NULL; - return p->ioDevice; -} - -QuaZip::Mode QuaZip::getMode()const -{ - return p->mode; -} - -bool QuaZip::isOpen()const -{ - return p->mode!=mdNotOpen; -} - -int QuaZip::getZipError() const -{ - return p->zipError; -} - -void QuaZip::setComment(const QString& comment) -{ - p->comment=comment; -} - -bool QuaZip::hasCurrentFile()const -{ - return p->hasCurrentFile_f; -} - -unzFile QuaZip::getUnzFile() -{ - return p->unzFile_f; -} - -zipFile QuaZip::getZipFile() -{ - return p->zipFile_f; -} - -void QuaZip::setDataDescriptorWritingEnabled(bool enabled) -{ - p->dataDescriptorWritingEnabled = enabled; -} - -bool QuaZip::isDataDescriptorWritingEnabled() const -{ - return p->dataDescriptorWritingEnabled; -} - -template -static TFileInfo getFileInfo(QuaZip *zip, bool *ok); - -template<> -QuaZipFileInfo getFileInfo(QuaZip *zip, bool *ok) -{ - QuaZipFileInfo info; - *ok = zip->getCurrentFileInfo(&info); - return info; -} - -template<> -QString getFileInfo(QuaZip *zip, bool *ok) -{ - QString name = zip->getCurrentFileName(); - *ok = !name.isEmpty(); - return name; -} - -template -bool QuaZipPrivate::getFileInfoList(QList *result) const -{ - QuaZipPrivate *fakeThis=const_cast(this); - fakeThis->zipError=UNZ_OK; - if (mode!=QuaZip::mdUnzip) { - qWarning("QuaZip::getFileNameList/getFileInfoList(): " - "ZIP is not open in mdUnzip mode"); - return false; - } - QString currentFile; - if (q->hasCurrentFile()) { - currentFile = q->getCurrentFileName(); - } - if (q->goToFirstFile()) { - do { - bool ok; - result->append(getFileInfo(q, &ok)); - if (!ok) - return false; - } while (q->goToNextFile()); - } - if (zipError != UNZ_OK) - return false; - if (currentFile.isEmpty()) { - if (!q->setCurrentFile(currentFile)) - return false; - } else { - if (!q->goToFirstFile()) - return false; - } - return true; -} - -QStringList QuaZip::getFileNameList() const -{ - QStringList list; - if (p->getFileInfoList(&list)) - return list; - else - return QStringList(); -} - -QList QuaZip::getFileInfoList() const -{ - QList list; - if (p->getFileInfoList(&list)) - return list; - else - return QList(); -} +/* +Copyright (C) 2005-2011 Sergey A. Tachenov + +This program is free software; you can redistribute it and/or modify it +under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2 of the License, or (at +your option) any later version. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser +General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with this program; if not, write to the Free Software Foundation, +Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +See COPYING file for the full LGPL text. + +Original ZIP package is copyrighted by Gilles Vollant, see +quazip/(un)zip.h files for details, basically it's zlib license. + **/ + +#include +#include + +#include "quazip.h" + +/// All the internal stuff for the QuaZip class. +/** + \internal + + This class keeps all the private stuff for the QuaZip class so it can + be changed without breaking binary compatibility, according to the + Pimpl idiom. + */ +class QuaZipPrivate { + friend class QuaZip; + private: + /// The pointer to the corresponding QuaZip instance. + QuaZip *q; + /// The codec for file names. + QTextCodec *fileNameCodec; + /// The codec for comments. + QTextCodec *commentCodec; + /// The archive file name. + QString zipName; + /// The device to access the archive. + QIODevice *ioDevice; + /// The global comment. + QString comment; + /// The open mode. + QuaZip::Mode mode; + union { + /// The internal handle for UNZIP modes. + unzFile unzFile_f; + /// The internal handle for ZIP modes. + zipFile zipFile_f; + }; + /// Whether a current file is set. + bool hasCurrentFile_f; + /// The last error. + int zipError; + /// Whether \ref QuaZip::setDataDescriptorWritingEnabled() "the data descriptor writing mode" is enabled. + bool dataDescriptorWritingEnabled; + /// The constructor for the corresponding QuaZip constructor. + inline QuaZipPrivate(QuaZip *q): + q(q), + fileNameCodec(QTextCodec::codecForLocale()), + commentCodec(QTextCodec::codecForLocale()), + ioDevice(NULL), + mode(QuaZip::mdNotOpen), + hasCurrentFile_f(false), + zipError(UNZ_OK), + dataDescriptorWritingEnabled(true) {} + /// The constructor for the corresponding QuaZip constructor. + inline QuaZipPrivate(QuaZip *q, const QString &zipName): + q(q), + fileNameCodec(QTextCodec::codecForLocale()), + commentCodec(QTextCodec::codecForLocale()), + zipName(zipName), + ioDevice(NULL), + mode(QuaZip::mdNotOpen), + hasCurrentFile_f(false), + zipError(UNZ_OK), + dataDescriptorWritingEnabled(true) {} + /// The constructor for the corresponding QuaZip constructor. + inline QuaZipPrivate(QuaZip *q, QIODevice *ioDevice): + q(q), + fileNameCodec(QTextCodec::codecForLocale()), + commentCodec(QTextCodec::codecForLocale()), + ioDevice(ioDevice), + mode(QuaZip::mdNotOpen), + hasCurrentFile_f(false), + zipError(UNZ_OK), + dataDescriptorWritingEnabled(true) {} + /// Returns either a list of file names or a list of QuaZipFileInfo. + template + bool getFileInfoList(QList *result) const; +}; + +QuaZip::QuaZip(): + p(new QuaZipPrivate(this)) +{ +} + +QuaZip::QuaZip(const QString& zipName): + p(new QuaZipPrivate(this, zipName)) +{ +} + +QuaZip::QuaZip(QIODevice *ioDevice): + p(new QuaZipPrivate(this, ioDevice)) +{ +} + +QuaZip::~QuaZip() +{ + if(isOpen()) + close(); + delete p; +} + +bool QuaZip::open(Mode mode, zlib_filefunc_def* ioApi) +{ + p->zipError=UNZ_OK; + if(isOpen()) { + qWarning("QuaZip::open(): ZIP already opened"); + return false; + } + QIODevice *ioDevice = p->ioDevice; + if (ioDevice == NULL) { + if (p->zipName.isEmpty()) { + qWarning("QuaZip::open(): set either ZIP file name or IO device first"); + return false; + } else { + ioDevice = new QFile(p->zipName); + } + } + switch(mode) { + case mdUnzip: + p->unzFile_f=unzOpen2(ioDevice, ioApi); + if(p->unzFile_f!=NULL) { + p->mode=mode; + p->ioDevice = ioDevice; + return true; + } else { + p->zipError=UNZ_OPENERROR; + if (!p->zipName.isEmpty()) + delete ioDevice; + return false; + } + case mdCreate: + case mdAppend: + case mdAdd: + p->zipFile_f=zipOpen2(ioDevice, + mode==mdCreate?APPEND_STATUS_CREATE: + mode==mdAppend?APPEND_STATUS_CREATEAFTER: + APPEND_STATUS_ADDINZIP, + NULL, + ioApi); + if(p->zipFile_f!=NULL) { + p->mode=mode; + p->ioDevice = ioDevice; + return true; + } else { + p->zipError=UNZ_OPENERROR; + if (!p->zipName.isEmpty()) + delete ioDevice; + return false; + } + default: + qWarning("QuaZip::open(): unknown mode: %d", (int)mode); + if (!p->zipName.isEmpty()) + delete ioDevice; + return false; + break; + } +} + +void QuaZip::close() +{ + p->zipError=UNZ_OK; + switch(p->mode) { + case mdNotOpen: + qWarning("QuaZip::close(): ZIP is not open"); + return; + case mdUnzip: + p->zipError=unzClose(p->unzFile_f); + break; + case mdCreate: + case mdAppend: + case mdAdd: + p->zipError=zipClose(p->zipFile_f, + p->comment.isNull() ? NULL + : p->commentCodec->fromUnicode(p->comment).constData()); + break; + default: + qWarning("QuaZip::close(): unknown mode: %d", (int)p->mode); + return; + } + // opened by name, need to delete the internal IO device + if (!p->zipName.isEmpty()) { + delete p->ioDevice; + p->ioDevice = NULL; + } + if(p->zipError==UNZ_OK) + p->mode=mdNotOpen; +} + +void QuaZip::setZipName(const QString& zipName) +{ + if(isOpen()) { + qWarning("QuaZip::setZipName(): ZIP is already open!"); + return; + } + p->zipName=zipName; + p->ioDevice = NULL; +} + +void QuaZip::setIoDevice(QIODevice *ioDevice) +{ + if(isOpen()) { + qWarning("QuaZip::setIoDevice(): ZIP is already open!"); + return; + } + p->ioDevice = ioDevice; + p->zipName = QString(); +} + +int QuaZip::getEntriesCount()const +{ + QuaZip *fakeThis=(QuaZip*)this; // non-const + fakeThis->p->zipError=UNZ_OK; + if(p->mode!=mdUnzip) { + qWarning("QuaZip::getEntriesCount(): ZIP is not open in mdUnzip mode"); + return -1; + } + unz_global_info globalInfo; + if((fakeThis->p->zipError=unzGetGlobalInfo(p->unzFile_f, &globalInfo))!=UNZ_OK) + return p->zipError; + return (int)globalInfo.number_entry; +} + +QString QuaZip::getComment()const +{ + QuaZip *fakeThis=(QuaZip*)this; // non-const + fakeThis->p->zipError=UNZ_OK; + if(p->mode!=mdUnzip) { + qWarning("QuaZip::getComment(): ZIP is not open in mdUnzip mode"); + return QString(); + } + unz_global_info globalInfo; + QByteArray comment; + if((fakeThis->p->zipError=unzGetGlobalInfo(p->unzFile_f, &globalInfo))!=UNZ_OK) + return QString(); + comment.resize(globalInfo.size_comment); + if((fakeThis->p->zipError=unzGetGlobalComment(p->unzFile_f, comment.data(), comment.size())) < 0) + return QString(); + fakeThis->p->zipError = UNZ_OK; + return p->commentCodec->toUnicode(comment); +} + +bool QuaZip::setCurrentFile(const QString& fileName, CaseSensitivity cs) +{ + p->zipError=UNZ_OK; + if(p->mode!=mdUnzip) { + qWarning("QuaZip::setCurrentFile(): ZIP is not open in mdUnzip mode"); + return false; + } + if(fileName.isEmpty()) { + p->hasCurrentFile_f=false; + return true; + } + // Unicode-aware reimplementation of the unzLocateFile function + if(p->unzFile_f==NULL) { + p->zipError=UNZ_PARAMERROR; + return false; + } + if(fileName.length()>MAX_FILE_NAME_LENGTH) { + p->zipError=UNZ_PARAMERROR; + return false; + } + bool sens = convertCaseSensitivity(cs) == Qt::CaseSensitive; + QString lower, current; + if(!sens) lower=fileName.toLower(); + p->hasCurrentFile_f=false; + for(bool more=goToFirstFile(); more; more=goToNextFile()) { + current=getCurrentFileName(); + if(current.isEmpty()) return false; + if(sens) { + if(current==fileName) break; + } else { + if(current.toLower()==lower) break; + } + } + return p->hasCurrentFile_f; +} + +bool QuaZip::goToFirstFile() +{ + p->zipError=UNZ_OK; + if(p->mode!=mdUnzip) { + qWarning("QuaZip::goToFirstFile(): ZIP is not open in mdUnzip mode"); + return false; + } + p->zipError=unzGoToFirstFile(p->unzFile_f); + p->hasCurrentFile_f=p->zipError==UNZ_OK; + return p->hasCurrentFile_f; +} + +bool QuaZip::goToNextFile() +{ + p->zipError=UNZ_OK; + if(p->mode!=mdUnzip) { + qWarning("QuaZip::goToFirstFile(): ZIP is not open in mdUnzip mode"); + return false; + } + p->zipError=unzGoToNextFile(p->unzFile_f); + p->hasCurrentFile_f=p->zipError==UNZ_OK; + if(p->zipError==UNZ_END_OF_LIST_OF_FILE) + p->zipError=UNZ_OK; + return p->hasCurrentFile_f; +} + +bool QuaZip::getCurrentFileInfo(QuaZipFileInfo *info)const +{ + QuaZip *fakeThis=(QuaZip*)this; // non-const + fakeThis->p->zipError=UNZ_OK; + if(p->mode!=mdUnzip) { + qWarning("QuaZip::getCurrentFileInfo(): ZIP is not open in mdUnzip mode"); + return false; + } + unz_file_info info_z; + QByteArray fileName; + QByteArray extra; + QByteArray comment; + if(info==NULL) return false; + if(!isOpen()||!hasCurrentFile()) return false; + if((fakeThis->p->zipError=unzGetCurrentFileInfo(p->unzFile_f, &info_z, NULL, 0, NULL, 0, NULL, 0))!=UNZ_OK) + return false; + fileName.resize(info_z.size_filename); + extra.resize(info_z.size_file_extra); + comment.resize(info_z.size_file_comment); + if((fakeThis->p->zipError=unzGetCurrentFileInfo(p->unzFile_f, NULL, + fileName.data(), fileName.size(), + extra.data(), extra.size(), + comment.data(), comment.size()))!=UNZ_OK) + return false; + info->versionCreated=info_z.version; + info->versionNeeded=info_z.version_needed; + info->flags=info_z.flag; + info->method=info_z.compression_method; + info->crc=info_z.crc; + info->compressedSize=info_z.compressed_size; + info->uncompressedSize=info_z.uncompressed_size; + info->diskNumberStart=info_z.disk_num_start; + info->internalAttr=info_z.internal_fa; + info->externalAttr=info_z.external_fa; + info->name=p->fileNameCodec->toUnicode(fileName); + info->comment=p->commentCodec->toUnicode(comment); + info->extra=extra; + info->dateTime=QDateTime( + QDate(info_z.tmu_date.tm_year, info_z.tmu_date.tm_mon+1, info_z.tmu_date.tm_mday), + QTime(info_z.tmu_date.tm_hour, info_z.tmu_date.tm_min, info_z.tmu_date.tm_sec)); + return true; +} + +QString QuaZip::getCurrentFileName()const +{ + QuaZip *fakeThis=(QuaZip*)this; // non-const + fakeThis->p->zipError=UNZ_OK; + if(p->mode!=mdUnzip) { + qWarning("QuaZip::getCurrentFileName(): ZIP is not open in mdUnzip mode"); + return QString(); + } + if(!isOpen()||!hasCurrentFile()) return QString(); + QByteArray fileName(MAX_FILE_NAME_LENGTH, 0); + if((fakeThis->p->zipError=unzGetCurrentFileInfo(p->unzFile_f, NULL, fileName.data(), fileName.size(), + NULL, 0, NULL, 0))!=UNZ_OK) + return QString(); + return p->fileNameCodec->toUnicode(fileName.constData()); +} + +void QuaZip::setFileNameCodec(QTextCodec *fileNameCodec) +{ + p->fileNameCodec=fileNameCodec; +} + +void QuaZip::setFileNameCodec(const char *fileNameCodecName) +{ + p->fileNameCodec=QTextCodec::codecForName(fileNameCodecName); +} + +QTextCodec *QuaZip::getFileNameCodec()const +{ + return p->fileNameCodec; +} + +void QuaZip::setCommentCodec(QTextCodec *commentCodec) +{ + p->commentCodec=commentCodec; +} + +void QuaZip::setCommentCodec(const char *commentCodecName) +{ + p->commentCodec=QTextCodec::codecForName(commentCodecName); +} + +QTextCodec *QuaZip::getCommentCodec()const +{ + return p->commentCodec; +} + +QString QuaZip::getZipName() const +{ + return p->zipName; +} + +QIODevice *QuaZip::getIoDevice() const +{ + if (!p->zipName.isEmpty()) // opened by name, using an internal QIODevice + return NULL; + return p->ioDevice; +} + +QuaZip::Mode QuaZip::getMode()const +{ + return p->mode; +} + +bool QuaZip::isOpen()const +{ + return p->mode!=mdNotOpen; +} + +int QuaZip::getZipError() const +{ + return p->zipError; +} + +void QuaZip::setComment(const QString& comment) +{ + p->comment=comment; +} + +bool QuaZip::hasCurrentFile()const +{ + return p->hasCurrentFile_f; +} + +unzFile QuaZip::getUnzFile() +{ + return p->unzFile_f; +} + +zipFile QuaZip::getZipFile() +{ + return p->zipFile_f; +} + +void QuaZip::setDataDescriptorWritingEnabled(bool enabled) +{ + p->dataDescriptorWritingEnabled = enabled; +} + +bool QuaZip::isDataDescriptorWritingEnabled() const +{ + return p->dataDescriptorWritingEnabled; +} + +template +TFileInfo QuaZip_getFileInfo(QuaZip *zip, bool *ok); + +template<> +QuaZipFileInfo QuaZip_getFileInfo(QuaZip *zip, bool *ok) +{ + QuaZipFileInfo info; + *ok = zip->getCurrentFileInfo(&info); + return info; +} + +template<> +QString QuaZip_getFileInfo(QuaZip *zip, bool *ok) +{ + QString name = zip->getCurrentFileName(); + *ok = !name.isEmpty(); + return name; +} + +template +bool QuaZipPrivate::getFileInfoList(QList *result) const +{ + QuaZipPrivate *fakeThis=const_cast(this); + fakeThis->zipError=UNZ_OK; + if (mode!=QuaZip::mdUnzip) { + qWarning("QuaZip::getFileNameList/getFileInfoList(): " + "ZIP is not open in mdUnzip mode"); + return false; + } + QString currentFile; + if (q->hasCurrentFile()) { + currentFile = q->getCurrentFileName(); + } + if (q->goToFirstFile()) { + do { + bool ok; + result->append(QuaZip_getFileInfo(q, &ok)); + if (!ok) + return false; + } while (q->goToNextFile()); + } + if (zipError != UNZ_OK) + return false; + if (currentFile.isEmpty()) { + if (!q->goToFirstFile()) + return false; + } else { + if (!q->setCurrentFile(currentFile)) + return false; + } + return true; +} + +QStringList QuaZip::getFileNameList() const +{ + QStringList list; + if (p->getFileInfoList(&list)) + return list; + else + return QStringList(); +} + +QList QuaZip::getFileInfoList() const +{ + QList list; + if (p->getFileInfoList(&list)) + return list; + else + return QList(); +} + +Qt::CaseSensitivity QuaZip::convertCaseSensitivity(QuaZip::CaseSensitivity cs) +{ + if (cs == csDefault) { +#ifdef Q_WS_WIN + return Qt::CaseInsensitive; +#else + return Qt::CaseSensitive; +#endif + } else { + return cs == csSensitive ? Qt::CaseSensitive : Qt::CaseInsensitive; + } +} diff --git a/quazip/quazip.h b/3rdparty/quazip-0.5.1/quazip/quazip.h similarity index 95% rename from quazip/quazip.h rename to 3rdparty/quazip-0.5.1/quazip/quazip.h index 9d10c8b3..4daa322b 100644 --- a/quazip/quazip.h +++ b/3rdparty/quazip-0.5.1/quazip/quazip.h @@ -1,406 +1,419 @@ -#ifndef QUA_ZIP_H -#define QUA_ZIP_H - -/* -Copyright (C) 2005-2011 Sergey A. Tachenov - -This program is free software; you can redistribute it and/or modify it -under the terms of the GNU Lesser General Public License as published by -the Free Software Foundation; either version 2 of the License, or (at -your option) any later version. - -This program is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser -General Public License for more details. - -You should have received a copy of the GNU Lesser General Public License -along with this program; if not, write to the Free Software Foundation, -Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -See COPYING file for the full LGPL text. - -Original ZIP package is copyrighted by Gilles Vollant, see -quazip/(un)zip.h files for details, basically it's zlib license. - **/ - -#include -#include -#include - -#include "zip.h" -#include "unzip.h" - -#include "quazip_global.h" -#include "quazipfileinfo.h" - -// just in case it will be defined in the later versions of the ZIP/UNZIP -#ifndef UNZ_OPENERROR -// define additional error code -#define UNZ_OPENERROR -1000 -#endif - -class QuaZipPrivate; - -/// ZIP archive. -/** \class QuaZip quazip.h - * This class implements basic interface to the ZIP archive. It can be - * used to read table contents of the ZIP archive and retreiving - * information about the files inside it. - * - * You can also use this class to open files inside archive by passing - * pointer to the instance of this class to the constructor of the - * QuaZipFile class. But see QuaZipFile::QuaZipFile(QuaZip*, QObject*) - * for the possible pitfalls. - * - * This class is indended to provide interface to the ZIP subpackage of - * the ZIP/UNZIP package as well as to the UNZIP subpackage. But - * currently it supports only UNZIP. - * - * The use of this class is simple - just create instance using - * constructor, then set ZIP archive file name using setFile() function - * (if you did not passed the name to the constructor), then open() and - * then use different functions to work with it! Well, if you are - * paranoid, you may also wish to call close before destructing the - * instance, to check for errors on close. - * - * You may also use getUnzFile() and getZipFile() functions to get the - * ZIP archive handle and use it with ZIP/UNZIP package API directly. - * - * This class supports localized file names inside ZIP archive, but you - * have to set up proper codec with setCodec() function. By default, - * locale codec will be used, which is probably ok for UNIX systems, but - * will almost certainly fail with ZIP archives created in Windows. This - * is because Windows ZIP programs have strange habit of using DOS - * encoding for file names in ZIP archives. For example, ZIP archive - * with cyrillic names created in Windows will have file names in \c - * IBM866 encoding instead of \c WINDOWS-1251. I think that calling one - * function is not much trouble, but for true platform independency it - * would be nice to have some mechanism for file name encoding auto - * detection using locale information. Does anyone know a good way to do - * it? - **/ -class QUAZIP_EXPORT QuaZip { - friend class QuaZipPrivate; - public: - /// Useful constants. - enum Constants { - MAX_FILE_NAME_LENGTH=256 /**< Maximum file name length. Taken from - \c UNZ_MAXFILENAMEINZIP constant in - unzip.c. */ - }; - /// Open mode of the ZIP file. - enum Mode { - mdNotOpen, ///< ZIP file is not open. This is the initial mode. - mdUnzip, ///< ZIP file is open for reading files inside it. - mdCreate, ///< ZIP file was created with open() call. - mdAppend, /**< ZIP file was opened in append mode. This refers to - * \c APPEND_STATUS_CREATEAFTER mode in ZIP/UNZIP package - * and means that zip is appended to some existing file - * what is useful when that file contains - * self-extractor code. This is obviously \em not what - * you whant to use to add files to the existing ZIP - * archive. - **/ - mdAdd ///< ZIP file was opened for adding files in the archive. - }; - /// Case sensitivity for the file names. - /** This is what you specify when accessing files in the archive. - * Works perfectly fine with any characters thanks to Qt's great - * unicode support. This is different from ZIP/UNZIP API, where - * only US-ASCII characters was supported. - **/ - enum CaseSensitivity { - csDefault=0, ///< Default for platform. Case sensitive for UNIX, not for Windows. - csSensitive=1, ///< Case sensitive. - csInsensitive=2 ///< Case insensitive. - }; - private: - QuaZipPrivate *p; - // not (and will not be) implemented - QuaZip(const QuaZip& that); - // not (and will not be) implemented - QuaZip& operator=(const QuaZip& that); - public: - /// Constructs QuaZip object. - /** Call setName() before opening constructed object. */ - QuaZip(); - /// Constructs QuaZip object associated with ZIP file \a zipName. - QuaZip(const QString& zipName); - /// Constructs QuaZip object associated with ZIP file represented by \a ioDevice. - /** The IO device must be seekable, otherwise an error will occur when opening. */ - QuaZip(QIODevice *ioDevice); - /// Destroys QuaZip object. - /** Calls close() if necessary. */ - ~QuaZip(); - /// Opens ZIP file. - /** - * Argument \a mode specifies open mode of the ZIP archive. See Mode - * for details. Note that there is zipOpen2() function in the - * ZIP/UNZIP API which accepts \a globalcomment argument, but it - * does not use it anywhere, so this open() function does not have this - * argument. See setComment() if you need to set global comment. - * - * If the ZIP file is accessed via explicitly set QIODevice, then - * this device is opened in the necessary mode. If the device was - * already opened by some other means, then the behaviour is defined by - * the device implementation, but generally it is not a very good - * idea. For example, QFile will at least issue a warning. - * - * \return \c true if successful, \c false otherwise. - * - * \note ZIP/UNZIP API open calls do not return error code - they - * just return \c NULL indicating an error. But to make things - * easier, quazip.h header defines additional error code \c - * UNZ_ERROROPEN and getZipError() will return it if the open call - * of the ZIP/UNZIP API returns \c NULL. - * - * Argument \a ioApi specifies IO function set for ZIP/UNZIP - * package to use. See unzip.h, zip.h and ioapi.h for details. Note - * that IO API for QuaZip is different from the original package. - * The file path argument was changed to be of type \c voidpf, and - * QuaZip passes a QIODevice pointer there. This QIODevice is either - * set explicitly via setIoDevice() or the QuaZip(QIODevice*) - * constructor, or it is created internally when opening the archive - * by its file name. The default API (qioapi.cpp) just delegates - * everything to the QIODevice API. Not only this allows to use a - * QIODevice instead of file name, but also has a nice side effect - * of raising the file size limit from 2G to 4G. - * - * In short: just forget about the \a ioApi argument and you'll be - * fine. - **/ - bool open(Mode mode, zlib_filefunc_def *ioApi =NULL); - /// Closes ZIP file. - /** Call getZipError() to determine if the close was successful. The - * underlying QIODevice is also closed, regardless of whether it was - * set explicitly or not. */ - void close(); - /// Sets the codec used to encode/decode file names inside archive. - /** This is necessary to access files in the ZIP archive created - * under Windows with non-latin characters in file names. For - * example, file names with cyrillic letters will be in \c IBM866 - * encoding. - **/ - void setFileNameCodec(QTextCodec *fileNameCodec); - /// Sets the codec used to encode/decode file names inside archive. - /** \overload - * Equivalent to calling setFileNameCodec(QTextCodec::codecForName(codecName)); - **/ - void setFileNameCodec(const char *fileNameCodecName); - /// Returns the codec used to encode/decode comments inside archive. - QTextCodec* getFileNameCodec() const; - /// Sets the codec used to encode/decode comments inside archive. - /** This codec defaults to locale codec, which is probably ok. - **/ - void setCommentCodec(QTextCodec *commentCodec); - /// Sets the codec used to encode/decode comments inside archive. - /** \overload - * Equivalent to calling setCommentCodec(QTextCodec::codecForName(codecName)); - **/ - void setCommentCodec(const char *commentCodecName); - /// Returns the codec used to encode/decode comments inside archive. - QTextCodec* getCommentCodec() const; - /// Returns the name of the ZIP file. - /** Returns null string if no ZIP file name has been set, for - * example when the QuaZip instance is set up to use a QIODevice - * instead. - * \sa setZipName(), setIoDevice(), getIoDevice() - **/ - QString getZipName() const; - /// Sets the name of the ZIP file. - /** Does nothing if the ZIP file is open. - * - * Does not reset error code returned by getZipError(). - * \sa setIoDevice(), getIoDevice(), getZipName() - **/ - void setZipName(const QString& zipName); - /// Returns the device representing this ZIP file. - /** Returns null string if no device has been set explicitly, for - * example when opening a ZIP file by name. - * \sa setIoDevice(), getZipName(), setZipName() - **/ - QIODevice *getIoDevice() const; - /// Sets the device representing the ZIP file. - /** Does nothing if the ZIP file is open. - * - * Does not reset error code returned by getZipError(). - * \sa getIoDevice(), getZipName(), setZipName() - **/ - void setIoDevice(QIODevice *ioDevice); - /// Returns the mode in which ZIP file was opened. - Mode getMode() const; - /// Returns \c true if ZIP file is open, \c false otherwise. - bool isOpen() const; - /// Returns the error code of the last operation. - /** Returns \c UNZ_OK if the last operation was successful. - * - * Error code resets to \c UNZ_OK every time you call any function - * that accesses something inside ZIP archive, even if it is \c - * const (like getEntriesCount()). open() and close() calls reset - * error code too. See documentation for the specific functions for - * details on error detection. - **/ - int getZipError() const; - /// Returns number of the entries in the ZIP central directory. - /** Returns negative error code in the case of error. The same error - * code will be returned by subsequent getZipError() call. - **/ - int getEntriesCount() const; - /// Returns global comment in the ZIP file. - QString getComment() const; - /// Sets global comment in the ZIP file. - /** Comment will be written to the archive on close operation. - * - * \sa open() - **/ - void setComment(const QString& comment); - /// Sets the current file to the first file in the archive. - /** Returns \c true on success, \c false otherwise. Call - * getZipError() to get the error code. - **/ - bool goToFirstFile(); - /// Sets the current file to the next file in the archive. - /** Returns \c true on success, \c false otherwise. Call - * getZipError() to determine if there was an error. - * - * Should be used only in QuaZip::mdUnzip mode. - * - * \note If the end of file was reached, getZipError() will return - * \c UNZ_OK instead of \c UNZ_END_OF_LIST_OF_FILE. This is to make - * things like this easier: - * \code - * for(bool more=zip.goToFirstFile(); more; more=zip.goToNextFile()) { - * // do something - * } - * if(zip.getZipError()==UNZ_OK) { - * // ok, there was no error - * } - * \endcode - **/ - bool goToNextFile(); - /// Sets current file by its name. - /** Returns \c true if successful, \c false otherwise. Argument \a - * cs specifies case sensitivity of the file name. Call - * getZipError() in the case of a failure to get error code. - * - * This is not a wrapper to unzLocateFile() function. That is - * because I had to implement locale-specific case-insensitive - * comparison. - * - * Here are the differences from the original implementation: - * - * - If the file was not found, error code is \c UNZ_OK, not \c - * UNZ_END_OF_LIST_OF_FILE (see also goToNextFile()). - * - If this function fails, it unsets the current file rather than - * resetting it back to what it was before the call. - * - * If \a fileName is null string then this function unsets the - * current file and return \c true. Note that you should close the - * file first if it is open! See - * QuaZipFile::QuaZipFile(QuaZip*,QObject*) for the details. - * - * Should be used only in QuaZip::mdUnzip mode. - * - * \sa setFileNameCodec(), CaseSensitivity - **/ - bool setCurrentFile(const QString& fileName, CaseSensitivity cs =csDefault); - /// Returns \c true if the current file has been set. - bool hasCurrentFile() const; - /// Retrieves information about the current file. - /** Fills the structure pointed by \a info. Returns \c true on - * success, \c false otherwise. In the latter case structure pointed - * by \a info remains untouched. If there was an error, - * getZipError() returns error code. - * - * Should be used only in QuaZip::mdUnzip mode. - * - * Does nothing and returns \c false in any of the following cases. - * - ZIP is not open; - * - ZIP does not have current file; - * - \a info is \c NULL; - * - * In all these cases getZipError() returns \c UNZ_OK since there - * is no ZIP/UNZIP API call. - **/ - bool getCurrentFileInfo(QuaZipFileInfo* info)const; - /// Returns the current file name. - /** Equivalent to calling getCurrentFileInfo() and then getting \c - * name field of the QuaZipFileInfo structure, but faster and more - * convenient. - * - * Should be used only in QuaZip::mdUnzip mode. - **/ - QString getCurrentFileName()const; - /// Returns \c unzFile handle. - /** You can use this handle to directly call UNZIP part of the - * ZIP/UNZIP package functions (see unzip.h). - * - * \warning When using the handle returned by this function, please - * keep in mind that QuaZip class is unable to detect any changes - * you make in the ZIP file state (e. g. changing current file, or - * closing the handle). So please do not do anything with this - * handle that is possible to do with the functions of this class. - * Or at least return the handle in the original state before - * calling some another function of this class (including implicit - * destructor calls and calls from the QuaZipFile objects that refer - * to this QuaZip instance!). So if you have changed the current - * file in the ZIP archive - then change it back or you may - * experience some strange behavior or even crashes. - **/ - unzFile getUnzFile(); - /// Returns \c zipFile handle. - /** You can use this handle to directly call ZIP part of the - * ZIP/UNZIP package functions (see zip.h). Warnings about the - * getUnzFile() function also apply to this function. - **/ - zipFile getZipFile(); - /// Changes the data descriptor writing mode. - /** - According to the ZIP format specification, a file inside archive - may have a data descriptor immediately following the file - data. This is reflected by a special flag in the local file header - and in the central directory. By default, QuaZIP sets this flag - and writes the data descriptor unless both method and level were - set to 0, in which case it operates in 1.0-compatible mode and - never writes data descriptors. - - By setting this flag to false, it is possible to disable data - descriptor writing, thus increasing compatibility with archive - readers that don't understand this feature of the ZIP file format. - - Setting this flag affects all the QuaZipFile instances that are - opened after this flag is set. - - The data descriptor writing mode is enabled by default. - - \param enabled If \c true, enable local descriptor writing, - disable it otherwise. - - \sa QuaZipFile::setDataDescriptorWritingEnabled() - */ - void setDataDescriptorWritingEnabled(bool enabled); - /// Returns the data descriptor default writing mode. - /** - \sa setDataDescriptorWritingEnabled() - */ - bool isDataDescriptorWritingEnabled() const; - /// Returns a list of files inside the archive. - /** - \return A list of file names or an empty list if there - was an error or if the archive is empty (call getZipError() to - figure out which). - \sa getFileInfoList() - */ - QStringList getFileNameList() const; - /// Returns information list about all files inside the archive. - /** - \return A list of QuaZipFileInfo objects or an empty list if there - was an error or if the archive is empty (call getZipError() to - figure out which). - \sa getFileNameList() - */ - QList getFileInfoList() const; -}; - -#endif +#ifndef QUA_ZIP_H +#define QUA_ZIP_H + +/* +Copyright (C) 2005-2011 Sergey A. Tachenov + +This program is free software; you can redistribute it and/or modify it +under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2 of the License, or (at +your option) any later version. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser +General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with this program; if not, write to the Free Software Foundation, +Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +See COPYING file for the full LGPL text. + +Original ZIP package is copyrighted by Gilles Vollant, see +quazip/(un)zip.h files for details, basically it's zlib license. + **/ + +#include +#include +#include + +#include "zip.h" +#include "unzip.h" + +#include "quazip_global.h" +#include "quazipfileinfo.h" + +// just in case it will be defined in the later versions of the ZIP/UNZIP +#ifndef UNZ_OPENERROR +// define additional error code +#define UNZ_OPENERROR -1000 +#endif + +class QuaZipPrivate; + +/// ZIP archive. +/** \class QuaZip quazip.h + * This class implements basic interface to the ZIP archive. It can be + * used to read table contents of the ZIP archive and retreiving + * information about the files inside it. + * + * You can also use this class to open files inside archive by passing + * pointer to the instance of this class to the constructor of the + * QuaZipFile class. But see QuaZipFile::QuaZipFile(QuaZip*, QObject*) + * for the possible pitfalls. + * + * This class is indended to provide interface to the ZIP subpackage of + * the ZIP/UNZIP package as well as to the UNZIP subpackage. But + * currently it supports only UNZIP. + * + * The use of this class is simple - just create instance using + * constructor, then set ZIP archive file name using setFile() function + * (if you did not passed the name to the constructor), then open() and + * then use different functions to work with it! Well, if you are + * paranoid, you may also wish to call close before destructing the + * instance, to check for errors on close. + * + * You may also use getUnzFile() and getZipFile() functions to get the + * ZIP archive handle and use it with ZIP/UNZIP package API directly. + * + * This class supports localized file names inside ZIP archive, but you + * have to set up proper codec with setCodec() function. By default, + * locale codec will be used, which is probably ok for UNIX systems, but + * will almost certainly fail with ZIP archives created in Windows. This + * is because Windows ZIP programs have strange habit of using DOS + * encoding for file names in ZIP archives. For example, ZIP archive + * with cyrillic names created in Windows will have file names in \c + * IBM866 encoding instead of \c WINDOWS-1251. I think that calling one + * function is not much trouble, but for true platform independency it + * would be nice to have some mechanism for file name encoding auto + * detection using locale information. Does anyone know a good way to do + * it? + **/ +class QUAZIP_EXPORT QuaZip { + friend class QuaZipPrivate; + public: + /// Useful constants. + enum Constants { + MAX_FILE_NAME_LENGTH=256 /**< Maximum file name length. Taken from + \c UNZ_MAXFILENAMEINZIP constant in + unzip.c. */ + }; + /// Open mode of the ZIP file. + enum Mode { + mdNotOpen, ///< ZIP file is not open. This is the initial mode. + mdUnzip, ///< ZIP file is open for reading files inside it. + mdCreate, ///< ZIP file was created with open() call. + mdAppend, /**< ZIP file was opened in append mode. This refers to + * \c APPEND_STATUS_CREATEAFTER mode in ZIP/UNZIP package + * and means that zip is appended to some existing file + * what is useful when that file contains + * self-extractor code. This is obviously \em not what + * you whant to use to add files to the existing ZIP + * archive. + **/ + mdAdd ///< ZIP file was opened for adding files in the archive. + }; + /// Case sensitivity for the file names. + /** This is what you specify when accessing files in the archive. + * Works perfectly fine with any characters thanks to Qt's great + * unicode support. This is different from ZIP/UNZIP API, where + * only US-ASCII characters was supported. + **/ + enum CaseSensitivity { + csDefault=0, ///< Default for platform. Case sensitive for UNIX, not for Windows. + csSensitive=1, ///< Case sensitive. + csInsensitive=2 ///< Case insensitive. + }; + /// Returns the actual case sensitivity for the specified QuaZIP one. + /** + \param cs The value to convert. + \returns If CaseSensitivity::csDefault, then returns the default + file name case sensitivity for the platform. Otherwise, just + returns the appropriate value from the Qt::CaseSensitivity enum. + */ + static Qt::CaseSensitivity convertCaseSensitivity( + CaseSensitivity cs); + private: + QuaZipPrivate *p; + // not (and will not be) implemented + QuaZip(const QuaZip& that); + // not (and will not be) implemented + QuaZip& operator=(const QuaZip& that); + public: + /// Constructs QuaZip object. + /** Call setName() before opening constructed object. */ + QuaZip(); + /// Constructs QuaZip object associated with ZIP file \a zipName. + QuaZip(const QString& zipName); + /// Constructs QuaZip object associated with ZIP file represented by \a ioDevice. + /** The IO device must be seekable, otherwise an error will occur when opening. */ + QuaZip(QIODevice *ioDevice); + /// Destroys QuaZip object. + /** Calls close() if necessary. */ + ~QuaZip(); + /// Opens ZIP file. + /** + * Argument \a mode specifies open mode of the ZIP archive. See Mode + * for details. Note that there is zipOpen2() function in the + * ZIP/UNZIP API which accepts \a globalcomment argument, but it + * does not use it anywhere, so this open() function does not have this + * argument. See setComment() if you need to set global comment. + * + * If the ZIP file is accessed via explicitly set QIODevice, then + * this device is opened in the necessary mode. If the device was + * already opened by some other means, then the behaviour is defined by + * the device implementation, but generally it is not a very good + * idea. For example, QFile will at least issue a warning. + * + * \return \c true if successful, \c false otherwise. + * + * \note ZIP/UNZIP API open calls do not return error code - they + * just return \c NULL indicating an error. But to make things + * easier, quazip.h header defines additional error code \c + * UNZ_ERROROPEN and getZipError() will return it if the open call + * of the ZIP/UNZIP API returns \c NULL. + * + * Argument \a ioApi specifies IO function set for ZIP/UNZIP + * package to use. See unzip.h, zip.h and ioapi.h for details. Note + * that IO API for QuaZip is different from the original package. + * The file path argument was changed to be of type \c voidpf, and + * QuaZip passes a QIODevice pointer there. This QIODevice is either + * set explicitly via setIoDevice() or the QuaZip(QIODevice*) + * constructor, or it is created internally when opening the archive + * by its file name. The default API (qioapi.cpp) just delegates + * everything to the QIODevice API. Not only this allows to use a + * QIODevice instead of file name, but also has a nice side effect + * of raising the file size limit from 2G to 4G. + * + * In short: just forget about the \a ioApi argument and you'll be + * fine. + **/ + bool open(Mode mode, zlib_filefunc_def *ioApi =NULL); + /// Closes ZIP file. + /** Call getZipError() to determine if the close was successful. The + * underlying QIODevice is also closed, regardless of whether it was + * set explicitly or not. */ + void close(); + /// Sets the codec used to encode/decode file names inside archive. + /** This is necessary to access files in the ZIP archive created + * under Windows with non-latin characters in file names. For + * example, file names with cyrillic letters will be in \c IBM866 + * encoding. + **/ + void setFileNameCodec(QTextCodec *fileNameCodec); + /// Sets the codec used to encode/decode file names inside archive. + /** \overload + * Equivalent to calling setFileNameCodec(QTextCodec::codecForName(codecName)); + **/ + void setFileNameCodec(const char *fileNameCodecName); + /// Returns the codec used to encode/decode comments inside archive. + QTextCodec* getFileNameCodec() const; + /// Sets the codec used to encode/decode comments inside archive. + /** This codec defaults to locale codec, which is probably ok. + **/ + void setCommentCodec(QTextCodec *commentCodec); + /// Sets the codec used to encode/decode comments inside archive. + /** \overload + * Equivalent to calling setCommentCodec(QTextCodec::codecForName(codecName)); + **/ + void setCommentCodec(const char *commentCodecName); + /// Returns the codec used to encode/decode comments inside archive. + QTextCodec* getCommentCodec() const; + /// Returns the name of the ZIP file. + /** Returns null string if no ZIP file name has been set, for + * example when the QuaZip instance is set up to use a QIODevice + * instead. + * \sa setZipName(), setIoDevice(), getIoDevice() + **/ + QString getZipName() const; + /// Sets the name of the ZIP file. + /** Does nothing if the ZIP file is open. + * + * Does not reset error code returned by getZipError(). + * \sa setIoDevice(), getIoDevice(), getZipName() + **/ + void setZipName(const QString& zipName); + /// Returns the device representing this ZIP file. + /** Returns null string if no device has been set explicitly, for + * example when opening a ZIP file by name. + * \sa setIoDevice(), getZipName(), setZipName() + **/ + QIODevice *getIoDevice() const; + /// Sets the device representing the ZIP file. + /** Does nothing if the ZIP file is open. + * + * Does not reset error code returned by getZipError(). + * \sa getIoDevice(), getZipName(), setZipName() + **/ + void setIoDevice(QIODevice *ioDevice); + /// Returns the mode in which ZIP file was opened. + Mode getMode() const; + /// Returns \c true if ZIP file is open, \c false otherwise. + bool isOpen() const; + /// Returns the error code of the last operation. + /** Returns \c UNZ_OK if the last operation was successful. + * + * Error code resets to \c UNZ_OK every time you call any function + * that accesses something inside ZIP archive, even if it is \c + * const (like getEntriesCount()). open() and close() calls reset + * error code too. See documentation for the specific functions for + * details on error detection. + **/ + int getZipError() const; + /// Returns number of the entries in the ZIP central directory. + /** Returns negative error code in the case of error. The same error + * code will be returned by subsequent getZipError() call. + **/ + int getEntriesCount() const; + /// Returns global comment in the ZIP file. + QString getComment() const; + /// Sets the global comment in the ZIP file. + /** The comment will be written to the archive on close operation. + * QuaZip makes a distinction between a null QByteArray() comment + * and an empty "" comment in the QuaZip::mdAdd mode. + * A null comment is the default and it means "don't change + * the comment". An empty comment removes the original comment. + * + * \sa open() + **/ + void setComment(const QString& comment); + /// Sets the current file to the first file in the archive. + /** Returns \c true on success, \c false otherwise. Call + * getZipError() to get the error code. + **/ + bool goToFirstFile(); + /// Sets the current file to the next file in the archive. + /** Returns \c true on success, \c false otherwise. Call + * getZipError() to determine if there was an error. + * + * Should be used only in QuaZip::mdUnzip mode. + * + * \note If the end of file was reached, getZipError() will return + * \c UNZ_OK instead of \c UNZ_END_OF_LIST_OF_FILE. This is to make + * things like this easier: + * \code + * for(bool more=zip.goToFirstFile(); more; more=zip.goToNextFile()) { + * // do something + * } + * if(zip.getZipError()==UNZ_OK) { + * // ok, there was no error + * } + * \endcode + **/ + bool goToNextFile(); + /// Sets current file by its name. + /** Returns \c true if successful, \c false otherwise. Argument \a + * cs specifies case sensitivity of the file name. Call + * getZipError() in the case of a failure to get error code. + * + * This is not a wrapper to unzLocateFile() function. That is + * because I had to implement locale-specific case-insensitive + * comparison. + * + * Here are the differences from the original implementation: + * + * - If the file was not found, error code is \c UNZ_OK, not \c + * UNZ_END_OF_LIST_OF_FILE (see also goToNextFile()). + * - If this function fails, it unsets the current file rather than + * resetting it back to what it was before the call. + * + * If \a fileName is null string then this function unsets the + * current file and return \c true. Note that you should close the + * file first if it is open! See + * QuaZipFile::QuaZipFile(QuaZip*,QObject*) for the details. + * + * Should be used only in QuaZip::mdUnzip mode. + * + * \sa setFileNameCodec(), CaseSensitivity + **/ + bool setCurrentFile(const QString& fileName, CaseSensitivity cs =csDefault); + /// Returns \c true if the current file has been set. + bool hasCurrentFile() const; + /// Retrieves information about the current file. + /** Fills the structure pointed by \a info. Returns \c true on + * success, \c false otherwise. In the latter case structure pointed + * by \a info remains untouched. If there was an error, + * getZipError() returns error code. + * + * Should be used only in QuaZip::mdUnzip mode. + * + * Does nothing and returns \c false in any of the following cases. + * - ZIP is not open; + * - ZIP does not have current file; + * - \a info is \c NULL; + * + * In all these cases getZipError() returns \c UNZ_OK since there + * is no ZIP/UNZIP API call. + **/ + bool getCurrentFileInfo(QuaZipFileInfo* info)const; + /// Returns the current file name. + /** Equivalent to calling getCurrentFileInfo() and then getting \c + * name field of the QuaZipFileInfo structure, but faster and more + * convenient. + * + * Should be used only in QuaZip::mdUnzip mode. + **/ + QString getCurrentFileName()const; + /// Returns \c unzFile handle. + /** You can use this handle to directly call UNZIP part of the + * ZIP/UNZIP package functions (see unzip.h). + * + * \warning When using the handle returned by this function, please + * keep in mind that QuaZip class is unable to detect any changes + * you make in the ZIP file state (e. g. changing current file, or + * closing the handle). So please do not do anything with this + * handle that is possible to do with the functions of this class. + * Or at least return the handle in the original state before + * calling some another function of this class (including implicit + * destructor calls and calls from the QuaZipFile objects that refer + * to this QuaZip instance!). So if you have changed the current + * file in the ZIP archive - then change it back or you may + * experience some strange behavior or even crashes. + **/ + unzFile getUnzFile(); + /// Returns \c zipFile handle. + /** You can use this handle to directly call ZIP part of the + * ZIP/UNZIP package functions (see zip.h). Warnings about the + * getUnzFile() function also apply to this function. + **/ + zipFile getZipFile(); + /// Changes the data descriptor writing mode. + /** + According to the ZIP format specification, a file inside archive + may have a data descriptor immediately following the file + data. This is reflected by a special flag in the local file header + and in the central directory. By default, QuaZIP sets this flag + and writes the data descriptor unless both method and level were + set to 0, in which case it operates in 1.0-compatible mode and + never writes data descriptors. + + By setting this flag to false, it is possible to disable data + descriptor writing, thus increasing compatibility with archive + readers that don't understand this feature of the ZIP file format. + + Setting this flag affects all the QuaZipFile instances that are + opened after this flag is set. + + The data descriptor writing mode is enabled by default. + + \param enabled If \c true, enable local descriptor writing, + disable it otherwise. + + \sa QuaZipFile::setDataDescriptorWritingEnabled() + */ + void setDataDescriptorWritingEnabled(bool enabled); + /// Returns the data descriptor default writing mode. + /** + \sa setDataDescriptorWritingEnabled() + */ + bool isDataDescriptorWritingEnabled() const; + /// Returns a list of files inside the archive. + /** + \return A list of file names or an empty list if there + was an error or if the archive is empty (call getZipError() to + figure out which). + \sa getFileInfoList() + */ + QStringList getFileNameList() const; + /// Returns information list about all files inside the archive. + /** + \return A list of QuaZipFileInfo objects or an empty list if there + was an error or if the archive is empty (call getZipError() to + figure out which). + \sa getFileNameList() + */ + QList getFileInfoList() const; +}; + +#endif diff --git a/3rdparty/quazip-0.5.1/quazip/quazip.pri b/3rdparty/quazip-0.5.1/quazip/quazip.pri new file mode 100644 index 00000000..0228a804 --- /dev/null +++ b/3rdparty/quazip-0.5.1/quazip/quazip.pri @@ -0,0 +1,28 @@ +INCLUDEPATH += $$PWD +DEPENDPATH += $$PWD + +DEFINES += QUAZIP_STATIC +#DEFINES+=ZLIB_WINAPI + +HEADERS += $$PWD/crypt.h \ + $$PWD/ioapi.h \ + $$PWD/JlCompress.h \ + $$PWD/quaadler32.h \ + $$PWD/quachecksum32.h \ + $$PWD/quacrc32.h \ + $$PWD/quazip.h \ + $$PWD/quazipfile.h \ + $$PWD/quazipfileinfo.h \ + $$PWD/quazipnewinfo.h \ + $$PWD/unzip.h \ + $$PWD/zip.h +SOURCES += $$PWD/qioapi.cpp \ + $$PWD/JlCompress.cpp \ + $$PWD/quaadler32.cpp \ + $$PWD/quacrc32.cpp \ + $$PWD/quazip.cpp \ + $$PWD/quazipfile.cpp \ + $$PWD/quazipnewinfo.cpp \ + $$PWD/quazipfileinfo.cpp \ + $$PWD/unzip.c \ + $$PWD/zip.c diff --git a/3rdparty/quazip-0.5.1/quazip/quazip.pro b/3rdparty/quazip-0.5.1/quazip/quazip.pro new file mode 100644 index 00000000..6b8456ff --- /dev/null +++ b/3rdparty/quazip-0.5.1/quazip/quazip.pro @@ -0,0 +1,77 @@ +TEMPLATE = lib +CONFIG += qt warn_on +QT -= gui +DEPENDPATH += . +INCLUDEPATH += . +!win32:VERSION = 1.0.0 + +DEFINES += QUAZIP_BUILD +CONFIG(staticlib): DEFINES += QUAZIP_STATIC + +# Input +HEADERS += \ +crypt.h \ +ioapi.h \ +JlCompress.h \ +quaadler32.h \ +quachecksum32.h \ +quacrc32.h \ +quagzipfile.h \ +quaziodevice.h \ +quazipdir.h \ +quazipfile.h \ +quazipfileinfo.h \ +quazip_global.h \ +quazip.h \ +quazipnewinfo.h \ +unzip.h \ +zip.h + +SOURCES += *.c *.cpp + +unix:!symbian { + headers.path=$$PREFIX/include/quazip + headers.files=$$HEADERS + target.path=$$PREFIX/lib + INSTALLS += headers target + + OBJECTS_DIR=.obj + MOC_DIR=.moc + +} + +win32 { + headers.path=$$PREFIX/include/quazip + headers.files=$$HEADERS + target.path=$$PREFIX/lib + INSTALLS += headers target + # workaround for qdatetime.h macro bug + DEFINES += NOMINMAX +} + + +symbian { + + # Note, on Symbian you may run into troubles with LGPL. + # The point is, if your application uses some version of QuaZip, + # and a newer binary compatible version of QuaZip is released, then + # the users of your application must be able to relink it with the + # new QuaZip version. For example, to take advantage of some QuaZip + # bug fixes. + + # This is probably best achieved by building QuaZip as a static + # library and providing linkable object files of your application, + # so users can relink it. + + CONFIG += staticlib + CONFIG += debug_and_release + + LIBS += -lezip + + #Export headers to SDK Epoc32/include directory + exportheaders.sources = $$HEADERS + exportheaders.path = quazip + for(header, exportheaders.sources) { + BLD_INF_RULES.prj_exports += "$$header $$exportheaders.path/$$basename(header)" + } +} diff --git a/3rdparty/quazip-0.5.1/quazip/quazip.sln b/3rdparty/quazip-0.5.1/quazip/quazip.sln new file mode 100644 index 00000000..9a31b32b --- /dev/null +++ b/3rdparty/quazip-0.5.1/quazip/quazip.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual C++ Express 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "quazip", "quazip.vcproj", "{E4AC5F56-B711-4F0E-BC83-CDE8B6CD53AD}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E4AC5F56-B711-4F0E-BC83-CDE8B6CD53AD}.Debug|Win32.ActiveCfg = Debug|Win32 + {E4AC5F56-B711-4F0E-BC83-CDE8B6CD53AD}.Debug|Win32.Build.0 = Debug|Win32 + {E4AC5F56-B711-4F0E-BC83-CDE8B6CD53AD}.Release|Win32.ActiveCfg = Release|Win32 + {E4AC5F56-B711-4F0E-BC83-CDE8B6CD53AD}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/3rdparty/quazip-0.5.1/quazip/quazip.vcproj b/3rdparty/quazip-0.5.1/quazip/quazip.vcproj new file mode 100644 index 00000000..20c2c6cf --- /dev/null +++ b/3rdparty/quazip-0.5.1/quazip/quazip.vcproj @@ -0,0 +1,314 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/3rdparty/quazip-0.5.1/quazip/quazip.vcxproj b/3rdparty/quazip-0.5.1/quazip/quazip.vcxproj new file mode 100644 index 00000000..fea38ac3 --- /dev/null +++ b/3rdparty/quazip-0.5.1/quazip/quazip.vcxproj @@ -0,0 +1,121 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {E4AC5F56-B711-4F0E-BC83-CDE8B6CD53AD} + Win32Proj + + + + DynamicLibrary + + + DynamicLibrary + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + Debug\ + Debug\ + true + Release\ + Release\ + true + + + + Disabled + WIN32;_DEBUG;_WINDOWS;QUAZIP_BUILD;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + QtCored4.lib;%(AdditionalDependencies) + true + Windows + MachineX86 + + + + + WIN32;NDEBUG;_WINDOWS;QUAZIP_BUILD;%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + QtCore4.lib;%(AdditionalDependencies) + true + Windows + true + true + MachineX86 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/3rdparty/quazip-0.5.1/quazip/quazip.vcxproj.filters b/3rdparty/quazip-0.5.1/quazip/quazip.vcxproj.filters new file mode 100644 index 00000000..a7520a8b --- /dev/null +++ b/3rdparty/quazip-0.5.1/quazip/quazip.vcxproj.filters @@ -0,0 +1,117 @@ + + + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + \ No newline at end of file diff --git a/quazip/quazip_global.h b/3rdparty/quazip-0.5.1/quazip/quazip_global.h similarity index 98% rename from quazip/quazip_global.h rename to 3rdparty/quazip-0.5.1/quazip/quazip_global.h index f60de970..d9d09ade 100644 --- a/quazip/quazip_global.h +++ b/3rdparty/quazip-0.5.1/quazip/quazip_global.h @@ -26,8 +26,6 @@ quazip/(un)zip.h files for details, basically it's zlib license. #include -#define QUAZIP_BUILD - /** This is automatically defined when building a static library, but when including QuaZip sources directly into a project, QUAZIP_STATIC should diff --git a/3rdparty/quazip-0.5.1/quazip/quazipdir.cpp b/3rdparty/quazip-0.5.1/quazip/quazipdir.cpp new file mode 100644 index 00000000..41bdff37 --- /dev/null +++ b/3rdparty/quazip-0.5.1/quazip/quazipdir.cpp @@ -0,0 +1,518 @@ +#include "quazipdir.h" + +#include +#include + +/// \cond internal +class QuaZipDirPrivate: public QSharedData { + friend class QuaZipDir; +private: + QuaZipDirPrivate(QuaZip *zip, const QString &dir = QString()): + zip(zip), dir(dir), caseSensitivity(QuaZip::csDefault), + filter(QDir::NoFilter), sorting(QDir::NoSort) {} + QuaZip *zip; + QString dir; + QuaZip::CaseSensitivity caseSensitivity; + QDir::Filters filter; + QStringList nameFilters; + QDir::SortFlags sorting; + template + bool entryInfoList(QStringList nameFilters, QDir::Filters filter, + QDir::SortFlags sort, TFileInfoList &result) const; + inline QString simplePath() const {return QDir::cleanPath(dir);} +}; +/// \endcond + +QuaZipDir::QuaZipDir(const QuaZipDir &that): + d(that.d) +{ +} + +QuaZipDir::QuaZipDir(QuaZip *zip, const QString &dir): + d(new QuaZipDirPrivate(zip, dir)) +{ + if (d->dir.startsWith('/')) + d->dir = d->dir.mid(1); +} + +QuaZipDir::~QuaZipDir() +{ +} + +bool QuaZipDir::operator==(const QuaZipDir &that) +{ + return d->zip == that.d->zip && d->dir == that.d->dir; +} + +QuaZipDir& QuaZipDir::operator=(const QuaZipDir &that) +{ + this->d = that.d; + return *this; +} + +QString QuaZipDir::operator[](int pos) const +{ + return entryList().at(pos); +} + +QuaZip::CaseSensitivity QuaZipDir::caseSensitivity() const +{ + return d->caseSensitivity; +} + +bool QuaZipDir::cd(const QString &directoryName) +{ + if (directoryName == "/") { + d->dir = ""; + return true; + } + QString dirName = directoryName; + if (dirName.endsWith('/')) + dirName.chop(1); + if (dirName.contains('/')) { + QuaZipDir dir(*this); + if (dirName.startsWith('/')) { +#ifdef QUAZIP_QUAZIPDIR_DEBUG + qDebug("QuaZipDir::cd(%s): going to /", + dirName.toUtf8().constData()); +#endif + if (!dir.cd("/")) + return false; + } + QStringList path = dirName.split('/', QString::SkipEmptyParts); + for (QStringList::const_iterator i = path.constBegin(); + i != path.end(); + ++i) { + const QString &step = *i; +#ifdef QUAZIP_QUAZIPDIR_DEBUG + qDebug("QuaZipDir::cd(%s): going to %s", + dirName.toUtf8().constData(), + step.toUtf8().constData()); +#endif + if (!dir.cd(step)) + return false; + } + d->dir = dir.path(); + return true; + } else { // no '/' + if (dirName == ".") { + return true; + } else if (dirName == "..") { + if (isRoot()) { + return false; + } else { + int slashPos = d->dir.lastIndexOf('/'); + if (slashPos == -1) { + d->dir = ""; + } else { + d->dir = d->dir.left(slashPos); + } + return true; + } + } else { // a simple subdirectory + if (exists(dirName)) { + if (isRoot()) + d->dir = dirName; + else + d->dir += "/" + dirName; + return true; + } else { + return false; + } + } + } +} + +bool QuaZipDir::cdUp() +{ + return cd(".."); +} + +uint QuaZipDir::count() const +{ + return entryList().count(); +} + +QString QuaZipDir::dirName() const +{ + return QDir(d->dir).dirName(); +} + +QuaZipFileInfo QuaZipDir_getFileInfo(QuaZip *zip, bool *ok, + const QString &relativeName, + bool isReal) +{ + QuaZipFileInfo info; + if (isReal) { + *ok = zip->getCurrentFileInfo(&info); + } else { + *ok = true; + info.compressedSize = 0; + info.crc = 0; + info.diskNumberStart = 0; + info.externalAttr = 0; + info.flags = 0; + info.internalAttr = 0; + info.method = 0; + info.uncompressedSize = 0; + info.versionCreated = info.versionNeeded = 0; + } + info.name = relativeName; + return info; +} + +template +void QuaZipDir_convertInfoList(const QList &from, TFileInfoList &to); + +template<> +void QuaZipDir_convertInfoList(const QList &from, QList &to) +{ + to = from; +} + +template<> +void QuaZipDir_convertInfoList(const QList &from, QStringList &to) +{ + to.clear(); + for (QList::const_iterator i = from.constBegin(); + i != from.constEnd(); + ++i) { + to.append(i->name); + } +} + +/// \cond internal +/** + An utility class to restore the current file. + */ +class QuaZipDirRestoreCurrent { +public: + inline QuaZipDirRestoreCurrent(QuaZip *zip): + zip(zip), currentFile(zip->getCurrentFileName()) {} + inline ~QuaZipDirRestoreCurrent() + { + zip->setCurrentFile(currentFile); + } +private: + QuaZip *zip; + QString currentFile; +}; +/// \endcond + +/// \cond internal +class QuaZipDirComparator +{ + private: + QDir::SortFlags sort; + static QString getExtension(const QString &name); + int compareStrings(const QString &string1, const QString &string2); + public: + inline QuaZipDirComparator(QDir::SortFlags sort): sort(sort) {} + bool operator()(const QuaZipFileInfo &info1, const QuaZipFileInfo &info2); +}; + +QString QuaZipDirComparator::getExtension(const QString &name) +{ + if (name.endsWith('.') || name.indexOf('.', 1) == -1) { + return ""; + } else { + return name.mid(name.lastIndexOf('.') + 1); + } + +} + +int QuaZipDirComparator::compareStrings(const QString &string1, + const QString &string2) +{ + if (sort & QDir::LocaleAware) { + if (sort & QDir::IgnoreCase) { + return string1.toLower().localeAwareCompare(string2.toLower()); + } else { + return string1.localeAwareCompare(string2); + } + } else { + return string1.compare(string2, (sort & QDir::IgnoreCase) + ? Qt::CaseInsensitive : Qt::CaseSensitive); + } +} + +bool QuaZipDirComparator::operator()(const QuaZipFileInfo &info1, + const QuaZipFileInfo &info2) +{ + QDir::SortFlags order = sort + & (QDir::Name | QDir::Time | QDir::Size | QDir::Type); + if ((sort & QDir::DirsFirst) == QDir::DirsFirst + || (sort & QDir::DirsLast) == QDir::DirsLast) { + if (info1.name.endsWith('/') && !info2.name.endsWith('/')) + return (sort & QDir::DirsFirst) == QDir::DirsFirst; + else if (!info1.name.endsWith('/') && info2.name.endsWith('/')) + return (sort & QDir::DirsLast) == QDir::DirsLast; + } + bool result; + int extDiff; + switch (order) { + case QDir::Name: + result = compareStrings(info1.name, info2.name) < 0; + break; + case QDir::Type: + extDiff = compareStrings(getExtension(info1.name), + getExtension(info2.name)); + if (extDiff == 0) { + result = compareStrings(info1.name, info2.name) < 0; + } else { + result = extDiff < 0; + } + break; + case QDir::Size: + if (info1.uncompressedSize == info2.uncompressedSize) { + result = compareStrings(info1.name, info2.name) < 0; + } else { + result = info1.uncompressedSize < info2.uncompressedSize; + } + break; + case QDir::Time: + if (info1.dateTime == info2.dateTime) { + result = compareStrings(info1.name, info2.name) < 0; + } else { + result = info1.dateTime < info2.dateTime; + } + break; + default: + qWarning("QuaZipDirComparator(): Invalid sort mode 0x%2X", + static_cast(sort)); + return false; + } + return (sort & QDir::Reversed) ? !result : result; +} + +template +bool QuaZipDirPrivate::entryInfoList(QStringList nameFilters, + QDir::Filters filter, QDir::SortFlags sort, TFileInfoList &result) const +{ + QString basePath = simplePath(); + if (!basePath.isEmpty()) + basePath += "/"; + int baseLength = basePath.length(); + result.clear(); + QuaZipDirRestoreCurrent saveCurrent(zip); + if (!zip->goToFirstFile()) { + return zip->getZipError() == UNZ_OK; + } + QDir::Filters fltr = filter; + if (fltr == QDir::NoFilter) + fltr = this->filter; + if (fltr == QDir::NoFilter) + fltr = QDir::AllEntries; + QStringList nmfltr = nameFilters; + if (nmfltr.isEmpty()) + nmfltr = this->nameFilters; + QSet dirsFound; + QList list; + do { + QString name = zip->getCurrentFileName(); + if (!name.startsWith(basePath)) + continue; + QString relativeName = name.mid(baseLength); + if (relativeName.isEmpty()) + continue; + bool isDir = false; + bool isReal = true; + if (relativeName.contains('/')) { + int indexOfSlash = relativeName.indexOf('/'); + // something like "subdir/" + isReal = indexOfSlash == relativeName.length() - 1; + relativeName = relativeName.left(indexOfSlash + 1); + if (dirsFound.contains(relativeName)) + continue; + isDir = true; + } + dirsFound.insert(relativeName); + if ((fltr & QDir::Dirs) == 0 && isDir) + continue; + if ((fltr & QDir::Files) == 0 && !isDir) + continue; + if (!nmfltr.isEmpty() && QDir::match(nmfltr, relativeName)) + continue; + bool ok; + QuaZipFileInfo info = QuaZipDir_getFileInfo(zip, &ok, relativeName, + isReal); + if (!ok) { + return false; + } + list.append(info); + } while (zip->goToNextFile()); + QDir::SortFlags srt = sort; + if (srt == QDir::NoSort) + srt = sorting; +#ifdef QUAZIP_QUAZIPDIR_DEBUG + qDebug("QuaZipDirPrivate::entryInfoList(): before sort:"); + foreach (QuaZipFileInfo info, list) { + qDebug("%s\t%s", info.name.toUtf8().constData(), + info.dateTime.toString(Qt::ISODate).toUtf8().constData()); + } +#endif + if (srt != QDir::NoSort && (srt & QDir::Unsorted) != QDir::Unsorted) { + if (QuaZip::convertCaseSensitivity(caseSensitivity) + == Qt::CaseInsensitive) + srt |= QDir::IgnoreCase; + QuaZipDirComparator lessThan(srt); + qSort(list.begin(), list.end(), lessThan); + } + QuaZipDir_convertInfoList(list, result); + return true; +} + +/// \endcond + +QList QuaZipDir::entryInfoList(const QStringList &nameFilters, + QDir::Filters filters, QDir::SortFlags sort) const +{ + QList result; + if (d->entryInfoList(nameFilters, filters, sort, result)) + return result; + else + return QList(); +} + +QList QuaZipDir::entryInfoList(QDir::Filters filters, + QDir::SortFlags sort) const +{ + return entryInfoList(QStringList(), filters, sort); +} + +QStringList QuaZipDir::entryList(const QStringList &nameFilters, + QDir::Filters filters, QDir::SortFlags sort) const +{ + QStringList result; + if (d->entryInfoList(nameFilters, filters, sort, result)) + return result; + else + return QStringList(); +} + +QStringList QuaZipDir::entryList(QDir::Filters filters, + QDir::SortFlags sort) const +{ + return entryList(QStringList(), filters, sort); +} + +bool QuaZipDir::exists(const QString &filePath) const +{ + if (filePath == "/") + return true; + QString fileName = filePath; + if (fileName.endsWith('/')) + fileName.chop(1); + if (fileName.contains('/')) { + QFileInfo fileInfo(fileName); +#ifdef QUAZIP_QUAZIPDIR_DEBUG + qDebug("QuaZipDir::exists(): fileName=%s, fileInfo.fileName()=%s, " + "fileInfo.path()=%s", fileName.toUtf8().constData(), + fileInfo.fileName().toUtf8().constData(), + fileInfo.path().toUtf8().constData()); +#endif + QuaZipDir dir(*this); + return dir.cd(fileInfo.path()) && dir.exists(fileInfo.fileName()); + } else { + if (fileName == "..") { + return !isRoot(); + } else if (fileName == ".") { + return true; + } else { + QStringList entries = entryList(QDir::AllEntries, QDir::NoSort); +#ifdef QUAZIP_QUAZIPDIR_DEBUG + qDebug("QuaZipDir::exists(): looking for %s", + fileName.toUtf8().constData()); + for (QStringList::const_iterator i = entries.constBegin(); + i != entries.constEnd(); + ++i) { + qDebug("QuaZipDir::exists(): entry: %s", + i->toUtf8().constData()); + } +#endif + Qt::CaseSensitivity cs = QuaZip::convertCaseSensitivity( + d->caseSensitivity); + if (filePath.endsWith('/')) { + return entries.contains(filePath, cs); + } else { + return entries.contains(fileName, cs) + || entries.contains(fileName + "/", cs); + } + } + } +} + +bool QuaZipDir::exists() const +{ + QDir thisDir(d->dir); + return QuaZipDir(d->zip, thisDir.filePath("..")).exists(thisDir.dirName()); +} + +QString QuaZipDir::filePath(const QString &fileName) const +{ + return QDir(d->dir).filePath(fileName); +} + +QDir::Filters QuaZipDir::filter() +{ + return d->filter; +} + +bool QuaZipDir::isRoot() const +{ + return d->simplePath().isEmpty(); +} + +QStringList QuaZipDir::nameFilters() const +{ + return d->nameFilters; +} + +QString QuaZipDir::path() const +{ + return d->dir; +} + +QString QuaZipDir::relativeFilePath(const QString &fileName) const +{ + return QDir(d->dir).relativeFilePath(fileName); +} + +void QuaZipDir::setCaseSensitivity(QuaZip::CaseSensitivity caseSensitivity) +{ + d->caseSensitivity = caseSensitivity; +} + +void QuaZipDir::setFilter(QDir::Filters filters) +{ + d->filter = filters; +} + +void QuaZipDir::setNameFilters(const QStringList &nameFilters) +{ + d->nameFilters = nameFilters; +} + +void QuaZipDir::setPath(const QString &path) +{ + QString newDir = path; + if (newDir == "/") { + d->dir = ""; + } else { + if (newDir.endsWith('/')) + newDir.chop(1); + if (newDir.startsWith('/')) + newDir = newDir.mid(1); + d->dir = newDir; + } +} + +void QuaZipDir::setSorting(QDir::SortFlags sort) +{ + d->sorting = sort; +} + +QDir::SortFlags QuaZipDir::sorting() const +{ + return d->sorting; +} diff --git a/3rdparty/quazip-0.5.1/quazip/quazipdir.h b/3rdparty/quazip-0.5.1/quazip/quazipdir.h new file mode 100644 index 00000000..e2d70bc8 --- /dev/null +++ b/3rdparty/quazip-0.5.1/quazip/quazipdir.h @@ -0,0 +1,171 @@ +#ifndef QUAZIP_QUAZIPDIR_H +#define QUAZIP_QUAZIPDIR_H + +class QuaZipDirPrivate; + +#include "quazip.h" +#include "quazipfileinfo.h" +#include +#include +#include + +/// Provides ZIP archive navigation. +/** +* This class is modelled after QDir, and is designed to provide similar +* features for ZIP archives. +* +* The only significant difference from QDir is that the root path is not +* '/', but an empty string since that's how the file paths are stored in +* the archive. However, QuaZipDir understands the paths starting with +* '/'. It is important in a few places: +* +* - In the cd() function. +* - In the constructor. +* - In the exists() function. +* +* Note that since ZIP uses '/' on all platforms, the '\' separator is +* not supported. +*/ +class QUAZIP_EXPORT QuaZipDir { +private: + QSharedDataPointer d; +public: + /// The copy constructor. + QuaZipDir(const QuaZipDir &that); + /// Constructs a QuaZipDir instance pointing to the specified directory. + /** + If \a dir is not specified, points to the root of the archive. + The same happens if the \a dir is "/". + */ + QuaZipDir(QuaZip *zip, const QString &dir = QString()); + /// Destructor. + ~QuaZipDir(); + /// The assignment operator. + bool operator==(const QuaZipDir &that); + /// operator!= + /** + \return \c true if either this and \a that use different QuaZip + instances or if they point to different directories. + */ + inline bool operator!=(const QuaZipDir &that) {return !operator==(that);} + /// operator== + /** + \return \c true if both this and \a that use the same QuaZip + instance and point to the same directory. + */ + QuaZipDir& operator=(const QuaZipDir &that); + /// Returns the name of the entry at the specified position. + QString operator[](int pos) const; + /// Returns the current case sensitivity mode. + QuaZip::CaseSensitivity caseSensitivity() const; + /// Changes the 'current' directory. + /** + * If the path starts with '/', it is interpreted as an absolute + * path from the root of the archive. Otherwise, it is interpreted + * as a path relative to the current directory as was set by the + * previous cd() or the constructor. + * + * Note that the subsequent path() call will not return a path + * starting with '/' in all cases. + */ + bool cd(const QString &dirName); + /// Goes up. + bool cdUp(); + /// Returns the number of entries in the directory. + uint count() const; + /// Returns the current directory name. + /** + The name doesn't include the path. + */ + QString dirName() const; + /// Returns the list of the entries in the directory. + /** + \param nameFilters The list of file patterns to list, uses the same + syntax as QDir. + \param filters The entry type filters, only Files and Dirs are + accepted. + \param sort Sorting mode (not supported yet). + */ + QList entryInfoList(const QStringList &nameFilters, + QDir::Filters filters = QDir::NoFilter, + QDir::SortFlags sort = QDir::NoSort) const; + /// Returns the list of the entries in the directory. + /** + \overload + + The same as entryInfoList(QStringList(), filters, sort). + */ + QList entryInfoList(QDir::Filters filters = QDir::NoFilter, + QDir::SortFlags sort = QDir::NoSort) const; + /// Returns the list of the entry names in the directory. + /** + The same as entryInfoList(nameFilters, filters, sort), but only + returns entry names. + */ + QStringList entryList(const QStringList &nameFilters, + QDir::Filters filters = QDir::NoFilter, + QDir::SortFlags sort = QDir::NoSort) const; + /// Returns the list of the entry names in the directory. + /** + \overload + + The same as entryList(QStringList(), filters, sort). + */ + QStringList entryList(QDir::Filters filters = QDir::NoFilter, + QDir::SortFlags sort = QDir::NoSort) const; + /// Returns \c true if the entry with the specified name exists. + /** + The ".." is considered to exist if the current directory + is not root. The "." and "/" are considered to + always exist. Paths starting with "/" are relative to + the archive root, other paths are relative to the current dir. + */ + bool exists(const QString &fileName) const; + /// Return \c true if the directory pointed by this QuaZipDir exists. + bool exists() const; + /// Returns the full path to the specified file. + /** + Doesn't check if the file actually exists. + */ + QString filePath(const QString &fileName) const; + /// Returns the default filter. + QDir::Filters filter(); + /// Returns if the QuaZipDir points to the root of the archive. + /** + Not that the root path is the empty string, not '/'. + */ + bool isRoot() const; + /// Return the default name filter. + QStringList nameFilters() const; + /// Returns the path to the current dir. + /** + The path never starts with '/', and the root path is an empty + string. + */ + QString path() const; + /// Returns the path to the specified file relative to the current dir. + QString relativeFilePath(const QString &fileName) const; + /// Sets the default case sensitivity mode. + void setCaseSensitivity(QuaZip::CaseSensitivity caseSensitivity); + /// Sets the default filter. + void setFilter(QDir::Filters filters); + /// Sets the default name filter. + void setNameFilters(const QStringList &nameFilters); + /// Goes to the specified path. + /** + The difference from cd() is that this function never checks if the + path actually exists and doesn't use relative paths, so it's + possible to go to the root directory with setPath(""). + + Note that this function still chops the trailing and/or leading + '/' and treats a single '/' as the root path (path() will still + return an empty string). + */ + void setPath(const QString &path); + /// Sets the default sorting mode. + void setSorting(QDir::SortFlags sort); + /// Returns the default sorting mode. + QDir::SortFlags sorting() const; +}; + +#endif // QUAZIP_QUAZIPDIR_H diff --git a/quazip/quazipfile.cpp b/3rdparty/quazip-0.5.1/quazip/quazipfile.cpp similarity index 86% rename from quazip/quazipfile.cpp rename to 3rdparty/quazip-0.5.1/quazip/quazipfile.cpp index 98b4fc95..323f815e 100644 --- a/quazip/quazipfile.cpp +++ b/3rdparty/quazip-0.5.1/quazip/quazipfile.cpp @@ -1,440 +1,488 @@ -/* -Copyright (C) 2005-2011 Sergey A. Tachenov - -This program is free software; you can redistribute it and/or modify it -under the terms of the GNU Lesser General Public License as published by -the Free Software Foundation; either version 2 of the License, or (at -your option) any later version. - -This program is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser -General Public License for more details. - -You should have received a copy of the GNU Lesser General Public License -along with this program; if not, write to the Free Software Foundation, -Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -See COPYING file for the full LGPL text. - -Original ZIP package is copyrighted by Gilles Vollant, see -quazip/(un)zip.h files for details, basically it's zlib license. - **/ - -#include "quazipfile.h" - -using namespace std; - -class QuaZipFilePrivate { - friend class QuaZipFile; - private: - QuaZipFile *q; - QuaZip *zip; - QString fileName; - QuaZip::CaseSensitivity caseSensitivity; - bool raw; - qint64 writePos; - // these two are for writing raw files - ulong uncompressedSize; - quint32 crc; - bool internal; - int zipError; - inline void resetZipError() const {setZipError(UNZ_OK);} - // const, but sets zipError! - void setZipError(int zipError) const; - inline QuaZipFilePrivate(QuaZipFile *q): - q(q), zip(NULL), internal(true), zipError(UNZ_OK) {} - inline QuaZipFilePrivate(QuaZipFile *q, const QString &zipName): - q(q), internal(true), zipError(UNZ_OK) - { - zip=new QuaZip(zipName); - } - inline QuaZipFilePrivate(QuaZipFile *q, const QString &zipName, const QString &fileName, - QuaZip::CaseSensitivity cs): - q(q), internal(true), zipError(UNZ_OK) - { - zip=new QuaZip(zipName); - this->fileName=fileName; - this->caseSensitivity=cs; - } - inline QuaZipFilePrivate(QuaZipFile *q, QuaZip *zip): - q(q), zip(zip), internal(false), zipError(UNZ_OK) {} - inline ~QuaZipFilePrivate() - { - if (internal) - delete zip; - } -}; - -QuaZipFile::QuaZipFile(): - p(new QuaZipFilePrivate(this)) -{ -} - -QuaZipFile::QuaZipFile(QObject *parent): - QIODevice(parent), - p(new QuaZipFilePrivate(this)) -{ -} - -QuaZipFile::QuaZipFile(const QString& zipName, QObject *parent): - QIODevice(parent), - p(new QuaZipFilePrivate(this, zipName)) -{ -} - -QuaZipFile::QuaZipFile(const QString& zipName, const QString& fileName, - QuaZip::CaseSensitivity cs, QObject *parent): - QIODevice(parent), - p(new QuaZipFilePrivate(this, zipName, fileName, cs)) -{ -} - -QuaZipFile::QuaZipFile(QuaZip *zip, QObject *parent): - QIODevice(parent), - p(new QuaZipFilePrivate(this, zip)) -{ -} - -QuaZipFile::~QuaZipFile() -{ - if (isOpen()) - close(); - delete p; -} - -QString QuaZipFile::getZipName() const -{ - return p->zip==NULL ? QString() : p->zip->getZipName(); -} - -QString QuaZipFile::getActualFileName()const -{ - p->setZipError(UNZ_OK); - if (p->zip == NULL || (openMode() & WriteOnly)) - return QString(); - QString name=p->zip->getCurrentFileName(); - if(name.isNull()) - p->setZipError(p->zip->getZipError()); - return name; -} - -void QuaZipFile::setZipName(const QString& zipName) -{ - if(isOpen()) { - qWarning("QuaZipFile::setZipName(): file is already open - can not set ZIP name"); - return; - } - if(p->zip!=NULL && p->internal) - delete p->zip; - p->zip=new QuaZip(zipName); - p->internal=true; -} - -void QuaZipFile::setZip(QuaZip *zip) -{ - if(isOpen()) { - qWarning("QuaZipFile::setZip(): file is already open - can not set ZIP"); - return; - } - if(p->zip!=NULL && p->internal) - delete p->zip; - p->zip=zip; - p->fileName=QString(); - p->internal=false; -} - -void QuaZipFile::setFileName(const QString& fileName, QuaZip::CaseSensitivity cs) -{ - if(p->zip==NULL) { - qWarning("QuaZipFile::setFileName(): call setZipName() first"); - return; - } - if(!p->internal) { - qWarning("QuaZipFile::setFileName(): should not be used when not using internal QuaZip"); - return; - } - if(isOpen()) { - qWarning("QuaZipFile::setFileName(): can not set file name for already opened file"); - return; - } - p->fileName=fileName; - p->caseSensitivity=cs; -} - -void QuaZipFilePrivate::setZipError(int zipError) const -{ - QuaZipFilePrivate *fakeThis = const_cast(this); // non-const - fakeThis->zipError=zipError; - if(zipError==UNZ_OK) - q->setErrorString(QString()); - else - q->setErrorString(QObject::tr("ZIP/UNZIP API error %1").arg(zipError)); -} - -bool QuaZipFile::open(OpenMode mode) -{ - return open(mode, NULL); -} - -bool QuaZipFile::open(OpenMode mode, int *method, int *level, bool raw, const char *password) -{ - p->resetZipError(); - if(isOpen()) { - qWarning("QuaZipFile::open(): already opened"); - return false; - } - if(mode&Unbuffered) { - qWarning("QuaZipFile::open(): Unbuffered mode is not supported"); - return false; - } - if((mode&ReadOnly)&&!(mode&WriteOnly)) { - if(p->internal) { - if(!p->zip->open(QuaZip::mdUnzip)) { - p->setZipError(p->zip->getZipError()); - return false; - } - if(!p->zip->setCurrentFile(p->fileName, p->caseSensitivity)) { - p->setZipError(p->zip->getZipError()); - p->zip->close(); - return false; - } - } else { - if(p->zip==NULL) { - qWarning("QuaZipFile::open(): zip is NULL"); - return false; - } - if(p->zip->getMode()!=QuaZip::mdUnzip) { - qWarning("QuaZipFile::open(): file open mode %d incompatible with ZIP open mode %d", - (int)mode, (int)p->zip->getMode()); - return false; - } - if(!p->zip->hasCurrentFile()) { - qWarning("QuaZipFile::open(): zip does not have current file"); - return false; - } - } - p->setZipError(unzOpenCurrentFile3(p->zip->getUnzFile(), method, level, (int)raw, password)); - if(p->zipError==UNZ_OK) { - setOpenMode(mode); - p->raw=raw; - return true; - } else - return false; - } - qWarning("QuaZipFile::open(): open mode %d not supported by this function", (int)mode); - return false; -} - -bool QuaZipFile::open(OpenMode mode, const QuaZipNewInfo& info, - const char *password, quint32 crc, - int method, int level, bool raw, - int windowBits, int memLevel, int strategy) -{ - zip_fileinfo info_z; - p->resetZipError(); - if(isOpen()) { - qWarning("QuaZipFile::open(): already opened"); - return false; - } - if((mode&WriteOnly)&&!(mode&ReadOnly)) { - if(p->internal) { - qWarning("QuaZipFile::open(): write mode is incompatible with internal QuaZip approach"); - return false; - } - if(p->zip==NULL) { - qWarning("QuaZipFile::open(): zip is NULL"); - return false; - } - if(p->zip->getMode()!=QuaZip::mdCreate&&p->zip->getMode()!=QuaZip::mdAppend&&p->zip->getMode()!=QuaZip::mdAdd) { - qWarning("QuaZipFile::open(): file open mode %d incompatible with ZIP open mode %d", - (int)mode, (int)p->zip->getMode()); - return false; - } - info_z.tmz_date.tm_year=info.dateTime.date().year(); - info_z.tmz_date.tm_mon=info.dateTime.date().month() - 1; - info_z.tmz_date.tm_mday=info.dateTime.date().day(); - info_z.tmz_date.tm_hour=info.dateTime.time().hour(); - info_z.tmz_date.tm_min=info.dateTime.time().minute(); - info_z.tmz_date.tm_sec=info.dateTime.time().second(); - info_z.dosDate = 0; - info_z.internal_fa=(uLong)info.internalAttr; - info_z.external_fa=(uLong)info.externalAttr; - if (!p->zip->isDataDescriptorWritingEnabled()) - zipClearFlags(p->zip->getZipFile(), ZIP_WRITE_DATA_DESCRIPTOR); - p->setZipError(zipOpenNewFileInZip3(p->zip->getZipFile(), - p->zip->getFileNameCodec()->fromUnicode(info.name).constData(), &info_z, - info.extraLocal.constData(), info.extraLocal.length(), - info.extraGlobal.constData(), info.extraGlobal.length(), - p->zip->getCommentCodec()->fromUnicode(info.comment).constData(), - method, level, (int)raw, - windowBits, memLevel, strategy, - password, (uLong)crc)); - if(p->zipError==UNZ_OK) { - p->writePos=0; - setOpenMode(mode); - p->raw=raw; - if(raw) { - p->crc=crc; - p->uncompressedSize=info.uncompressedSize; - } - return true; - } else - return false; - } - qWarning("QuaZipFile::open(): open mode %d not supported by this function", (int)mode); - return false; -} - -bool QuaZipFile::isSequential()const -{ - return true; -} - -qint64 QuaZipFile::pos()const -{ - if(p->zip==NULL) { - qWarning("QuaZipFile::pos(): call setZipName() or setZip() first"); - return -1; - } - if(!isOpen()) { - qWarning("QuaZipFile::pos(): file is not open"); - return -1; - } - if(openMode()&ReadOnly) - // QIODevice::pos() is broken for sequential devices, - // but thankfully bytesAvailable() returns the number of - // bytes buffered, so we know how far ahead we are. - return unztell(p->zip->getUnzFile()) - QIODevice::bytesAvailable(); - else - return p->writePos; -} - -bool QuaZipFile::atEnd()const -{ - if(p->zip==NULL) { - qWarning("QuaZipFile::atEnd(): call setZipName() or setZip() first"); - return false; - } - if(!isOpen()) { - qWarning("QuaZipFile::atEnd(): file is not open"); - return false; - } - if(openMode()&ReadOnly) - // the same problem as with pos() - return QIODevice::bytesAvailable() == 0 - && unzeof(p->zip->getUnzFile())==1; - else - return true; -} - -qint64 QuaZipFile::size()const -{ - if(!isOpen()) { - qWarning("QuaZipFile::atEnd(): file is not open"); - return -1; - } - if(openMode()&ReadOnly) - return p->raw?csize():usize(); - else - return p->writePos; -} - -qint64 QuaZipFile::csize()const -{ - unz_file_info info_z; - p->setZipError(UNZ_OK); - if(p->zip==NULL||p->zip->getMode()!=QuaZip::mdUnzip) return -1; - p->setZipError(unzGetCurrentFileInfo(p->zip->getUnzFile(), &info_z, NULL, 0, NULL, 0, NULL, 0)); - if(p->zipError!=UNZ_OK) - return -1; - return info_z.compressed_size; -} - -qint64 QuaZipFile::usize()const -{ - unz_file_info info_z; - p->setZipError(UNZ_OK); - if(p->zip==NULL||p->zip->getMode()!=QuaZip::mdUnzip) return -1; - p->setZipError(unzGetCurrentFileInfo(p->zip->getUnzFile(), &info_z, NULL, 0, NULL, 0, NULL, 0)); - if(p->zipError!=UNZ_OK) - return -1; - return info_z.uncompressed_size; -} - -bool QuaZipFile::getFileInfo(QuaZipFileInfo *info) -{ - if(p->zip==NULL||p->zip->getMode()!=QuaZip::mdUnzip) return false; - p->zip->getCurrentFileInfo(info); - p->setZipError(p->zip->getZipError()); - return p->zipError==UNZ_OK; -} - -void QuaZipFile::close() -{ - p->resetZipError(); - if(p->zip==NULL||!p->zip->isOpen()) return; - if(!isOpen()) { - qWarning("QuaZipFile::close(): file isn't open"); - return; - } - if(openMode()&ReadOnly) - p->setZipError(unzCloseCurrentFile(p->zip->getUnzFile())); - else if(openMode()&WriteOnly) - if(isRaw()) p->setZipError(zipCloseFileInZipRaw(p->zip->getZipFile(), p->uncompressedSize, p->crc)); - else p->setZipError(zipCloseFileInZip(p->zip->getZipFile())); - else { - qWarning("Wrong open mode: %d", (int)openMode()); - return; - } - if(p->zipError==UNZ_OK) setOpenMode(QIODevice::NotOpen); - else return; - if(p->internal) { - p->zip->close(); - p->setZipError(p->zip->getZipError()); - } -} - -qint64 QuaZipFile::readData(char *data, qint64 maxSize) -{ - p->setZipError(UNZ_OK); - qint64 bytesRead=unzReadCurrentFile(p->zip->getUnzFile(), data, (unsigned)maxSize); - if(bytesRead<0) p->setZipError((int)bytesRead); - return bytesRead; -} - -qint64 QuaZipFile::writeData(const char* data, qint64 maxSize) -{ - p->setZipError(ZIP_OK); - p->setZipError(zipWriteInFileInZip(p->zip->getZipFile(), data, (uint)maxSize)); - if(p->zipError!=ZIP_OK) return -1; - else { - p->writePos+=maxSize; - return maxSize; - } -} - -QString QuaZipFile::getFileName() const -{ - return p->fileName; -} - -QuaZip::CaseSensitivity QuaZipFile::getCaseSensitivity() const -{ - return p->caseSensitivity; -} - -bool QuaZipFile::isRaw() const -{ - return p->raw; -} - -int QuaZipFile::getZipError() const -{ - return p->zipError; -} - -qint64 QuaZipFile::bytesAvailable() const -{ - return size() - pos(); -} +/* +Copyright (C) 2005-2011 Sergey A. Tachenov + +This program is free software; you can redistribute it and/or modify it +under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2 of the License, or (at +your option) any later version. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser +General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with this program; if not, write to the Free Software Foundation, +Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +See COPYING file for the full LGPL text. + +Original ZIP package is copyrighted by Gilles Vollant, see +quazip/(un)zip.h files for details, basically it's zlib license. + **/ + +#include "quazipfile.h" + +using namespace std; + +/// The implementation class for QuaZip. +/** +\internal + +This class contains all the private stuff for the QuaZipFile class, thus +allowing to preserve binary compatibility between releases, the +technique known as the Pimpl (private implementation) idiom. +*/ +class QuaZipFilePrivate { + friend class QuaZipFile; + private: + /// The pointer to the associated QuaZipFile instance. + QuaZipFile *q; + /// The QuaZip object to work with. + QuaZip *zip; + /// The file name. + QString fileName; + /// Case sensitivity mode. + QuaZip::CaseSensitivity caseSensitivity; + /// Whether this file is opened in the raw mode. + bool raw; + /// Write position to keep track of. + /** + QIODevice::pos() is broken for non-seekable devices, so we need + our own position. + */ + qint64 writePos; + /// Uncompressed size to write along with a raw file. + ulong uncompressedSize; + /// CRC to write along with a raw file. + quint32 crc; + /// Whether \ref zip points to an internal QuaZip instance. + /** + This is true if the archive was opened by name, rather than by + supplying an existing QuaZip instance. + */ + bool internal; + /// The last error. + int zipError; + /// Resets \ref zipError. + inline void resetZipError() const {setZipError(UNZ_OK);} + /// Sets the zip error. + /** + This function is marked as const although it changes one field. + This allows to call it from const functions that don't change + anything by themselves. + */ + void setZipError(int zipError) const; + /// The constructor for the corresponding QuaZipFile constructor. + inline QuaZipFilePrivate(QuaZipFile *q): + q(q), zip(NULL), internal(true), zipError(UNZ_OK) {} + /// The constructor for the corresponding QuaZipFile constructor. + inline QuaZipFilePrivate(QuaZipFile *q, const QString &zipName): + q(q), internal(true), zipError(UNZ_OK) + { + zip=new QuaZip(zipName); + } + /// The constructor for the corresponding QuaZipFile constructor. + inline QuaZipFilePrivate(QuaZipFile *q, const QString &zipName, const QString &fileName, + QuaZip::CaseSensitivity cs): + q(q), internal(true), zipError(UNZ_OK) + { + zip=new QuaZip(zipName); + this->fileName=fileName; + if (this->fileName.startsWith('/')) + this->fileName = this->fileName.mid(1); + this->caseSensitivity=cs; + } + /// The constructor for the QuaZipFile constructor accepting a file name. + inline QuaZipFilePrivate(QuaZipFile *q, QuaZip *zip): + q(q), zip(zip), internal(false), zipError(UNZ_OK) {} + /// The destructor. + inline ~QuaZipFilePrivate() + { + if (internal) + delete zip; + } +}; + +QuaZipFile::QuaZipFile(): + p(new QuaZipFilePrivate(this)) +{ +} + +QuaZipFile::QuaZipFile(QObject *parent): + QIODevice(parent), + p(new QuaZipFilePrivate(this)) +{ +} + +QuaZipFile::QuaZipFile(const QString& zipName, QObject *parent): + QIODevice(parent), + p(new QuaZipFilePrivate(this, zipName)) +{ +} + +QuaZipFile::QuaZipFile(const QString& zipName, const QString& fileName, + QuaZip::CaseSensitivity cs, QObject *parent): + QIODevice(parent), + p(new QuaZipFilePrivate(this, zipName, fileName, cs)) +{ +} + +QuaZipFile::QuaZipFile(QuaZip *zip, QObject *parent): + QIODevice(parent), + p(new QuaZipFilePrivate(this, zip)) +{ +} + +QuaZipFile::~QuaZipFile() +{ + if (isOpen()) + close(); + delete p; +} + +QString QuaZipFile::getZipName() const +{ + return p->zip==NULL ? QString() : p->zip->getZipName(); +} + +QuaZip *QuaZipFile::getZip() const +{ + return p->internal ? NULL : p->zip; +} + +QString QuaZipFile::getActualFileName()const +{ + p->setZipError(UNZ_OK); + if (p->zip == NULL || (openMode() & WriteOnly)) + return QString(); + QString name=p->zip->getCurrentFileName(); + if(name.isNull()) + p->setZipError(p->zip->getZipError()); + return name; +} + +void QuaZipFile::setZipName(const QString& zipName) +{ + if(isOpen()) { + qWarning("QuaZipFile::setZipName(): file is already open - can not set ZIP name"); + return; + } + if(p->zip!=NULL && p->internal) + delete p->zip; + p->zip=new QuaZip(zipName); + p->internal=true; +} + +void QuaZipFile::setZip(QuaZip *zip) +{ + if(isOpen()) { + qWarning("QuaZipFile::setZip(): file is already open - can not set ZIP"); + return; + } + if(p->zip!=NULL && p->internal) + delete p->zip; + p->zip=zip; + p->fileName=QString(); + p->internal=false; +} + +void QuaZipFile::setFileName(const QString& fileName, QuaZip::CaseSensitivity cs) +{ + if(p->zip==NULL) { + qWarning("QuaZipFile::setFileName(): call setZipName() first"); + return; + } + if(!p->internal) { + qWarning("QuaZipFile::setFileName(): should not be used when not using internal QuaZip"); + return; + } + if(isOpen()) { + qWarning("QuaZipFile::setFileName(): can not set file name for already opened file"); + return; + } + p->fileName=fileName; + if (p->fileName.startsWith('/')) + p->fileName = p->fileName.mid(1); + p->caseSensitivity=cs; +} + +void QuaZipFilePrivate::setZipError(int zipError) const +{ + QuaZipFilePrivate *fakeThis = const_cast(this); // non-const + fakeThis->zipError=zipError; + if(zipError==UNZ_OK) + q->setErrorString(QString()); + else + q->setErrorString(q->tr("ZIP/UNZIP API error %1").arg(zipError)); +} + +bool QuaZipFile::open(OpenMode mode) +{ + return open(mode, NULL); +} + +bool QuaZipFile::open(OpenMode mode, int *method, int *level, bool raw, const char *password) +{ + p->resetZipError(); + if(isOpen()) { + qWarning("QuaZipFile::open(): already opened"); + return false; + } + if(mode&Unbuffered) { + qWarning("QuaZipFile::open(): Unbuffered mode is not supported"); + return false; + } + if((mode&ReadOnly)&&!(mode&WriteOnly)) { + if(p->internal) { + if(!p->zip->open(QuaZip::mdUnzip)) { + p->setZipError(p->zip->getZipError()); + return false; + } + if(!p->zip->setCurrentFile(p->fileName, p->caseSensitivity)) { + p->setZipError(p->zip->getZipError()); + p->zip->close(); + return false; + } + } else { + if(p->zip==NULL) { + qWarning("QuaZipFile::open(): zip is NULL"); + return false; + } + if(p->zip->getMode()!=QuaZip::mdUnzip) { + qWarning("QuaZipFile::open(): file open mode %d incompatible with ZIP open mode %d", + (int)mode, (int)p->zip->getMode()); + return false; + } + if(!p->zip->hasCurrentFile()) { + qWarning("QuaZipFile::open(): zip does not have current file"); + return false; + } + } + p->setZipError(unzOpenCurrentFile3(p->zip->getUnzFile(), method, level, (int)raw, password)); + if(p->zipError==UNZ_OK) { + setOpenMode(mode); + p->raw=raw; + return true; + } else + return false; + } + qWarning("QuaZipFile::open(): open mode %d not supported by this function", (int)mode); + return false; +} + +bool QuaZipFile::open(OpenMode mode, const QuaZipNewInfo& info, + const char *password, quint32 crc, + int method, int level, bool raw, + int windowBits, int memLevel, int strategy) +{ + zip_fileinfo info_z; + p->resetZipError(); + if(isOpen()) { + qWarning("QuaZipFile::open(): already opened"); + return false; + } + if((mode&WriteOnly)&&!(mode&ReadOnly)) { + if(p->internal) { + qWarning("QuaZipFile::open(): write mode is incompatible with internal QuaZip approach"); + return false; + } + if(p->zip==NULL) { + qWarning("QuaZipFile::open(): zip is NULL"); + return false; + } + if(p->zip->getMode()!=QuaZip::mdCreate&&p->zip->getMode()!=QuaZip::mdAppend&&p->zip->getMode()!=QuaZip::mdAdd) { + qWarning("QuaZipFile::open(): file open mode %d incompatible with ZIP open mode %d", + (int)mode, (int)p->zip->getMode()); + return false; + } + info_z.tmz_date.tm_year=info.dateTime.date().year(); + info_z.tmz_date.tm_mon=info.dateTime.date().month() - 1; + info_z.tmz_date.tm_mday=info.dateTime.date().day(); + info_z.tmz_date.tm_hour=info.dateTime.time().hour(); + info_z.tmz_date.tm_min=info.dateTime.time().minute(); + info_z.tmz_date.tm_sec=info.dateTime.time().second(); + info_z.dosDate = 0; + info_z.internal_fa=(uLong)info.internalAttr; + info_z.external_fa=(uLong)info.externalAttr; + if (!p->zip->isDataDescriptorWritingEnabled()) + zipClearFlags(p->zip->getZipFile(), ZIP_WRITE_DATA_DESCRIPTOR); + p->setZipError(zipOpenNewFileInZip3(p->zip->getZipFile(), + p->zip->getFileNameCodec()->fromUnicode(info.name).constData(), &info_z, + info.extraLocal.constData(), info.extraLocal.length(), + info.extraGlobal.constData(), info.extraGlobal.length(), + p->zip->getCommentCodec()->fromUnicode(info.comment).constData(), + method, level, (int)raw, + windowBits, memLevel, strategy, + password, (uLong)crc)); + if(p->zipError==UNZ_OK) { + p->writePos=0; + setOpenMode(mode); + p->raw=raw; + if(raw) { + p->crc=crc; + p->uncompressedSize=info.uncompressedSize; + } + return true; + } else + return false; + } + qWarning("QuaZipFile::open(): open mode %d not supported by this function", (int)mode); + return false; +} + +bool QuaZipFile::isSequential()const +{ + return true; +} + +qint64 QuaZipFile::pos()const +{ + if(p->zip==NULL) { + qWarning("QuaZipFile::pos(): call setZipName() or setZip() first"); + return -1; + } + if(!isOpen()) { + qWarning("QuaZipFile::pos(): file is not open"); + return -1; + } + if(openMode()&ReadOnly) + // QIODevice::pos() is broken for sequential devices, + // but thankfully bytesAvailable() returns the number of + // bytes buffered, so we know how far ahead we are. + return unztell(p->zip->getUnzFile()) - QIODevice::bytesAvailable(); + else + return p->writePos; +} + +bool QuaZipFile::atEnd()const +{ + if(p->zip==NULL) { + qWarning("QuaZipFile::atEnd(): call setZipName() or setZip() first"); + return false; + } + if(!isOpen()) { + qWarning("QuaZipFile::atEnd(): file is not open"); + return false; + } + if(openMode()&ReadOnly) + // the same problem as with pos() + return QIODevice::bytesAvailable() == 0 + && unzeof(p->zip->getUnzFile())==1; + else + return true; +} + +qint64 QuaZipFile::size()const +{ + if(!isOpen()) { + qWarning("QuaZipFile::atEnd(): file is not open"); + return -1; + } + if(openMode()&ReadOnly) + return p->raw?csize():usize(); + else + return p->writePos; +} + +qint64 QuaZipFile::csize()const +{ + unz_file_info info_z; + p->setZipError(UNZ_OK); + if(p->zip==NULL||p->zip->getMode()!=QuaZip::mdUnzip) return -1; + p->setZipError(unzGetCurrentFileInfo(p->zip->getUnzFile(), &info_z, NULL, 0, NULL, 0, NULL, 0)); + if(p->zipError!=UNZ_OK) + return -1; + return info_z.compressed_size; +} + +qint64 QuaZipFile::usize()const +{ + unz_file_info info_z; + p->setZipError(UNZ_OK); + if(p->zip==NULL||p->zip->getMode()!=QuaZip::mdUnzip) return -1; + p->setZipError(unzGetCurrentFileInfo(p->zip->getUnzFile(), &info_z, NULL, 0, NULL, 0, NULL, 0)); + if(p->zipError!=UNZ_OK) + return -1; + return info_z.uncompressed_size; +} + +bool QuaZipFile::getFileInfo(QuaZipFileInfo *info) +{ + if(p->zip==NULL||p->zip->getMode()!=QuaZip::mdUnzip) return false; + p->zip->getCurrentFileInfo(info); + p->setZipError(p->zip->getZipError()); + return p->zipError==UNZ_OK; +} + +void QuaZipFile::close() +{ + p->resetZipError(); + if(p->zip==NULL||!p->zip->isOpen()) return; + if(!isOpen()) { + qWarning("QuaZipFile::close(): file isn't open"); + return; + } + if(openMode()&ReadOnly) + p->setZipError(unzCloseCurrentFile(p->zip->getUnzFile())); + else if(openMode()&WriteOnly) + if(isRaw()) p->setZipError(zipCloseFileInZipRaw(p->zip->getZipFile(), p->uncompressedSize, p->crc)); + else p->setZipError(zipCloseFileInZip(p->zip->getZipFile())); + else { + qWarning("Wrong open mode: %d", (int)openMode()); + return; + } + if(p->zipError==UNZ_OK) setOpenMode(QIODevice::NotOpen); + else return; + if(p->internal) { + p->zip->close(); + p->setZipError(p->zip->getZipError()); + } +} + +qint64 QuaZipFile::readData(char *data, qint64 maxSize) +{ + p->setZipError(UNZ_OK); + qint64 bytesRead=unzReadCurrentFile(p->zip->getUnzFile(), data, (unsigned)maxSize); + if (bytesRead < 0) { + p->setZipError((int) bytesRead); + return -1; + } + return bytesRead; +} + +qint64 QuaZipFile::writeData(const char* data, qint64 maxSize) +{ + p->setZipError(ZIP_OK); + p->setZipError(zipWriteInFileInZip(p->zip->getZipFile(), data, (uint)maxSize)); + if(p->zipError!=ZIP_OK) return -1; + else { + p->writePos+=maxSize; + return maxSize; + } +} + +QString QuaZipFile::getFileName() const +{ + return p->fileName; +} + +QuaZip::CaseSensitivity QuaZipFile::getCaseSensitivity() const +{ + return p->caseSensitivity; +} + +bool QuaZipFile::isRaw() const +{ + return p->raw; +} + +int QuaZipFile::getZipError() const +{ + return p->zipError; +} + +qint64 QuaZipFile::bytesAvailable() const +{ + return size() - pos(); +} diff --git a/quazip/quazipfile.h b/3rdparty/quazip-0.5.1/quazip/quazipfile.h similarity index 97% rename from quazip/quazipfile.h rename to 3rdparty/quazip-0.5.1/quazip/quazipfile.h index 80435ef3..f6cc41a6 100644 --- a/quazip/quazipfile.h +++ b/3rdparty/quazip-0.5.1/quazip/quazipfile.h @@ -1,442 +1,442 @@ -#ifndef QUA_ZIPFILE_H -#define QUA_ZIPFILE_H - -/* -Copyright (C) 2005-2011 Sergey A. Tachenov - -This program is free software; you can redistribute it and/or modify it -under the terms of the GNU Lesser General Public License as published by -the Free Software Foundation; either version 2 of the License, or (at -your option) any later version. - -This program is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser -General Public License for more details. - -You should have received a copy of the GNU Lesser General Public License -along with this program; if not, write to the Free Software Foundation, -Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -See COPYING file for the full LGPL text. - -Original ZIP package is copyrighted by Gilles Vollant, see -quazip/(un)zip.h files for details, basically it's zlib license. - **/ - -#include - -#include "quazip_global.h" -#include "quazip.h" -#include "quazipnewinfo.h" - -class QuaZipFilePrivate; - -/// A file inside ZIP archive. -/** \class QuaZipFile quazipfile.h - * This is the most interesting class. Not only it provides C++ - * interface to the ZIP/UNZIP package, but also integrates it with Qt by - * subclassing QIODevice. This makes possible to access files inside ZIP - * archive using QTextStream or QDataStream, for example. Actually, this - * is the main purpose of the whole QuaZIP library. - * - * You can either use existing QuaZip instance to create instance of - * this class or pass ZIP archive file name to this class, in which case - * it will create internal QuaZip object. See constructors' descriptions - * for details. Writing is only possible with the existing instance. - * - * Note that due to the underlying library's limitation it is not - * possible to use multiple QuaZipFile instances to open several files - * in the same archive at the same time. If you need to write to - * multiple files in parallel, then you should write to temporary files - * first, then pack them all at once when you have finished writing. If - * you need to read multiple files inside the same archive in parallel, - * you should extract them all into a temporary directory first. - * - * \section quazipfile-sequential Sequential or random-access? - * - * At the first thought, QuaZipFile has fixed size, the start and the - * end and should be therefore considered random-access device. But - * there is one major obstacle to making it random-access: ZIP/UNZIP API - * does not support seek() operation and the only way to implement it is - * through reopening the file and re-reading to the required position, - * but this is prohibitively slow. - * - * Therefore, QuaZipFile is considered to be a sequential device. This - * has advantage of availability of the ungetChar() operation (QIODevice - * does not implement it properly for non-sequential devices unless they - * support seek()). Disadvantage is a somewhat strange behaviour of the - * size() and pos() functions. This should be kept in mind while using - * this class. - * - **/ -class QUAZIP_EXPORT QuaZipFile: public QIODevice { - friend class QuaZipFilePrivate; - Q_OBJECT - private: - QuaZipFilePrivate *p; - // these are not supported nor implemented - QuaZipFile(const QuaZipFile& that); - QuaZipFile& operator=(const QuaZipFile& that); - protected: - /// Implementation of the QIODevice::readData(). - qint64 readData(char *data, qint64 maxSize); - /// Implementation of the QIODevice::writeData(). - qint64 writeData(const char *data, qint64 maxSize); - public: - /// Constructs a QuaZipFile instance. - /** You should use setZipName() and setFileName() or setZip() before - * trying to call open() on the constructed object. - **/ - QuaZipFile(); - /// Constructs a QuaZipFile instance. - /** \a parent argument specifies this object's parent object. - * - * You should use setZipName() and setFileName() or setZip() before - * trying to call open() on the constructed object. - **/ - QuaZipFile(QObject *parent); - /// Constructs a QuaZipFile instance. - /** \a parent argument specifies this object's parent object and \a - * zipName specifies ZIP archive file name. - * - * You should use setFileName() before trying to call open() on the - * constructed object. - * - * QuaZipFile constructed by this constructor can be used for read - * only access. Use QuaZipFile(QuaZip*,QObject*) for writing. - **/ - QuaZipFile(const QString& zipName, QObject *parent =NULL); - /// Constructs a QuaZipFile instance. - /** \a parent argument specifies this object's parent object, \a - * zipName specifies ZIP archive file name and \a fileName and \a cs - * specify a name of the file to open inside archive. - * - * QuaZipFile constructed by this constructor can be used for read - * only access. Use QuaZipFile(QuaZip*,QObject*) for writing. - * - * \sa QuaZip::setCurrentFile() - **/ - QuaZipFile(const QString& zipName, const QString& fileName, - QuaZip::CaseSensitivity cs =QuaZip::csDefault, QObject *parent =NULL); - /// Constructs a QuaZipFile instance. - /** \a parent argument specifies this object's parent object. - * - * \a zip is the pointer to the existing QuaZip object. This - * QuaZipFile object then can be used to read current file in the - * \a zip or to write to the file inside it. - * - * \warning Using this constructor for reading current file can be - * tricky. Let's take the following example: - * \code - * QuaZip zip("archive.zip"); - * zip.open(QuaZip::mdUnzip); - * zip.setCurrentFile("file-in-archive"); - * QuaZipFile file(&zip); - * file.open(QIODevice::ReadOnly); - * // ok, now we can read from the file - * file.read(somewhere, some); - * zip.setCurrentFile("another-file-in-archive"); // oops... - * QuaZipFile anotherFile(&zip); - * anotherFile.open(QIODevice::ReadOnly); - * anotherFile.read(somewhere, some); // this is still ok... - * file.read(somewhere, some); // and this is NOT - * \endcode - * So, what exactly happens here? When we change current file in the - * \c zip archive, \c file that references it becomes invalid - * (actually, as far as I understand ZIP/UNZIP sources, it becomes - * closed, but QuaZipFile has no means to detect it). - * - * Summary: do not close \c zip object or change its current file as - * long as QuaZipFile is open. Even better - use another constructors - * which create internal QuaZip instances, one per object, and - * therefore do not cause unnecessary trouble. This constructor may - * be useful, though, if you already have a QuaZip instance and do - * not want to access several files at once. Good example: - * \code - * QuaZip zip("archive.zip"); - * zip.open(QuaZip::mdUnzip); - * // first, we need some information about archive itself - * QByteArray comment=zip.getComment(); - * // and now we are going to access files inside it - * QuaZipFile file(&zip); - * for(bool more=zip.goToFirstFile(); more; more=zip.goToNextFile()) { - * file.open(QIODevice::ReadOnly); - * // do something cool with file here - * file.close(); // do not forget to close! - * } - * zip.close(); - * \endcode - **/ - QuaZipFile(QuaZip *zip, QObject *parent =NULL); - /// Destroys a QuaZipFile instance. - /** Closes file if open, destructs internal QuaZip object (if it - * exists and \em is internal, of course). - **/ - virtual ~QuaZipFile(); - /// Returns the ZIP archive file name. - /** If this object was created by passing QuaZip pointer to the - * constructor, this function will return that QuaZip's file name - * (or null string if that object does not have file name yet). - * - * Otherwise, returns associated ZIP archive file name or null - * string if there are no name set yet. - * - * \sa setZipName() getFileName() - **/ - QString getZipName()const; - /// Returns a pointer to the associated QuaZip object. - /** Returns \c NULL if there is no associated QuaZip or it is - * internal (so you will not mess with it). - **/ - QuaZip* getZip()const; - /// Returns file name. - /** This function returns file name you passed to this object either - * by using - * QuaZipFile(const QString&,const QString&,QuaZip::CaseSensitivity,QObject*) - * or by calling setFileName(). Real name of the file may differ in - * case if you used case-insensitivity. - * - * Returns null string if there is no file name set yet. This is the - * case when this QuaZipFile operates on the existing QuaZip object - * (constructor QuaZipFile(QuaZip*,QObject*) or setZip() was used). - * - * \sa getActualFileName - **/ - QString getFileName() const; - /// Returns case sensitivity of the file name. - /** This function returns case sensitivity argument you passed to - * this object either by using - * QuaZipFile(const QString&,const QString&,QuaZip::CaseSensitivity,QObject*) - * or by calling setFileName(). - * - * Returns unpredictable value if getFileName() returns null string - * (this is the case when you did not used setFileName() or - * constructor above). - * - * \sa getFileName - **/ - QuaZip::CaseSensitivity getCaseSensitivity() const; - /// Returns the actual file name in the archive. - /** This is \em not a ZIP archive file name, but a name of file inside - * archive. It is not necessary the same name that you have passed - * to the - * QuaZipFile(const QString&,const QString&,QuaZip::CaseSensitivity,QObject*), - * setFileName() or QuaZip::setCurrentFile() - this is the real file - * name inside archive, so it may differ in case if the file name - * search was case-insensitive. - * - * Equivalent to calling getCurrentFileName() on the associated - * QuaZip object. Returns null string if there is no associated - * QuaZip object or if it does not have a current file yet. And this - * is the case if you called setFileName() but did not open the - * file yet. So this is perfectly fine: - * \code - * QuaZipFile file("somezip.zip"); - * file.setFileName("somefile"); - * QString name=file.getName(); // name=="somefile" - * QString actual=file.getActualFileName(); // actual is null string - * file.open(QIODevice::ReadOnly); - * QString actual=file.getActualFileName(); // actual can be "SoMeFiLe" on Windows - * \endcode - * - * \sa getZipName(), getFileName(), QuaZip::CaseSensitivity - **/ - QString getActualFileName()const; - /// Sets the ZIP archive file name. - /** Automatically creates internal QuaZip object and destroys - * previously created internal QuaZip object, if any. - * - * Will do nothing if this file is already open. You must close() it - * first. - **/ - void setZipName(const QString& zipName); - /// Returns \c true if the file was opened in raw mode. - /** If the file is not open, the returned value is undefined. - * - * \sa open(OpenMode,int*,int*,bool,const char*) - **/ - bool isRaw() const; - /// Binds to the existing QuaZip instance. - /** This function destroys internal QuaZip object, if any, and makes - * this QuaZipFile to use current file in the \a zip object for any - * further operations. See QuaZipFile(QuaZip*,QObject*) for the - * possible pitfalls. - * - * Will do nothing if the file is currently open. You must close() - * it first. - **/ - void setZip(QuaZip *zip); - /// Sets the file name. - /** Will do nothing if at least one of the following conditions is - * met: - * - ZIP name has not been set yet (getZipName() returns null - * string). - * - This QuaZipFile is associated with external QuaZip. In this - * case you should call that QuaZip's setCurrentFile() function - * instead! - * - File is already open so setting the name is meaningless. - * - * \sa QuaZip::setCurrentFile - **/ - void setFileName(const QString& fileName, QuaZip::CaseSensitivity cs =QuaZip::csDefault); - /// Opens a file for reading. - /** Returns \c true on success, \c false otherwise. - * Call getZipError() to get error code. - * - * \note Since ZIP/UNZIP API provides buffered reading only, - * QuaZipFile does not support unbuffered reading. So do not pass - * QIODevice::Unbuffered flag in \a mode, or open will fail. - **/ - virtual bool open(OpenMode mode); - /// Opens a file for reading. - /** \overload - * Argument \a password specifies a password to decrypt the file. If - * it is NULL then this function behaves just like open(OpenMode). - **/ - inline bool open(OpenMode mode, const char *password) - {return open(mode, NULL, NULL, false, password);} - /// Opens a file for reading. - /** \overload - * Argument \a password specifies a password to decrypt the file. - * - * An integers pointed by \a method and \a level will receive codes - * of the compression method and level used. See unzip.h. - * - * If raw is \c true then no decompression is performed. - * - * \a method should not be \c NULL. \a level can be \c NULL if you - * don't want to know the compression level. - **/ - bool open(OpenMode mode, int *method, int *level, bool raw, const char *password =NULL); - /// Opens a file for writing. - /** \a info argument specifies information about file. It should at - * least specify a correct file name. Also, it is a good idea to - * specify correct timestamp (by default, current time will be - * used). See QuaZipNewInfo. - * - * The \a password argument specifies the password for crypting. Pass NULL - * if you don't need any crypting. The \a crc argument was supposed - * to be used for crypting too, but then it turned out that it's - * false information, so you need to set it to 0 unless you want to - * use the raw mode (see below). - * - * Arguments \a method and \a level specify compression method and - * level. The only method supported is Z_DEFLATED, but you may also - * specify 0 for no compression. If all of the files in the archive - * use both method 0 and either level 0 is explicitly specified or - * data descriptor writing is disabled with - * QuaZip::setDataDescriptorWritingEnabled(), then the - * resulting archive is supposed to be compatible with the 1.0 ZIP - * format version, should you need that. Except for this, \a level - * has no other effects with method 0. - * - * If \a raw is \c true, no compression is performed. In this case, - * \a crc and uncompressedSize field of the \a info are required. - * - * Arguments \a windowBits, \a memLevel, \a strategy provide zlib - * algorithms tuning. See deflateInit2() in zlib. - **/ - bool open(OpenMode mode, const QuaZipNewInfo& info, - const char *password =NULL, quint32 crc =0, - int method =Z_DEFLATED, int level =Z_DEFAULT_COMPRESSION, bool raw =false, - int windowBits =-MAX_WBITS, int memLevel =DEF_MEM_LEVEL, int strategy =Z_DEFAULT_STRATEGY); - /// Returns \c true, but \ref quazipfile-sequential "beware"! - virtual bool isSequential()const; - /// Returns current position in the file. - /** Implementation of the QIODevice::pos(). When reading, this - * function is a wrapper to the ZIP/UNZIP unztell(), therefore it is - * unable to keep track of the ungetChar() calls (which is - * non-virtual and therefore is dangerous to reimplement). So if you - * are using ungetChar() feature of the QIODevice, this function - * reports incorrect value until you get back characters which you - * ungot. - * - * When writing, pos() returns number of bytes already written - * (uncompressed unless you use raw mode). - * - * \note Although - * \ref quazipfile-sequential "QuaZipFile is a sequential device" - * and therefore pos() should always return zero, it does not, - * because it would be misguiding. Keep this in mind. - * - * This function returns -1 if the file or archive is not open. - * - * Error code returned by getZipError() is not affected by this - * function call. - **/ - virtual qint64 pos()const; - /// Returns \c true if the end of file was reached. - /** This function returns \c false in the case of error. This means - * that you called this function on either not open file, or a file - * in the not open archive or even on a QuaZipFile instance that - * does not even have QuaZip instance associated. Do not do that - * because there is no means to determine whether \c false is - * returned because of error or because end of file was reached. - * Well, on the other side you may interpret \c false return value - * as "there is no file open to check for end of file and there is - * no end of file therefore". - * - * When writing, this function always returns \c true (because you - * are always writing to the end of file). - * - * Error code returned by getZipError() is not affected by this - * function call. - **/ - virtual bool atEnd()const; - /// Returns file size. - /** This function returns csize() if the file is open for reading in - * raw mode, usize() if it is open for reading in normal mode and - * pos() if it is open for writing. - * - * Returns -1 on error, call getZipError() to get error code. - * - * \note This function returns file size despite that - * \ref quazipfile-sequential "QuaZipFile is considered to be sequential device", - * for which size() should return bytesAvailable() instead. But its - * name would be very misguiding otherwise, so just keep in mind - * this inconsistence. - **/ - virtual qint64 size()const; - /// Returns compressed file size. - /** Equivalent to calling getFileInfo() and then getting - * compressedSize field, but more convenient and faster. - * - * File must be open for reading before calling this function. - * - * Returns -1 on error, call getZipError() to get error code. - **/ - qint64 csize()const; - /// Returns uncompressed file size. - /** Equivalent to calling getFileInfo() and then getting - * uncompressedSize field, but more convenient and faster. See - * getFileInfo() for a warning. - * - * File must be open for reading before calling this function. - * - * Returns -1 on error, call getZipError() to get error code. - **/ - qint64 usize()const; - /// Gets information about current file. - /** This function does the same thing as calling - * QuaZip::getCurrentFileInfo() on the associated QuaZip object, - * but you can not call getCurrentFileInfo() if the associated - * QuaZip is internal (because you do not have access to it), while - * you still can call this function in that case. - * - * File must be open for reading before calling this function. - * - * Returns \c false in the case of an error. - **/ - bool getFileInfo(QuaZipFileInfo *info); - /// Closes the file. - /** Call getZipError() to determine if the close was successful. - **/ - virtual void close(); - /// Returns the error code returned by the last ZIP/UNZIP API call. - int getZipError() const; - /// Returns the number of bytes available for reading. - virtual qint64 bytesAvailable() const; -}; - -#endif +#ifndef QUA_ZIPFILE_H +#define QUA_ZIPFILE_H + +/* +Copyright (C) 2005-2011 Sergey A. Tachenov + +This program is free software; you can redistribute it and/or modify it +under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2 of the License, or (at +your option) any later version. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser +General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with this program; if not, write to the Free Software Foundation, +Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +See COPYING file for the full LGPL text. + +Original ZIP package is copyrighted by Gilles Vollant, see +quazip/(un)zip.h files for details, basically it's zlib license. + **/ + +#include + +#include "quazip_global.h" +#include "quazip.h" +#include "quazipnewinfo.h" + +class QuaZipFilePrivate; + +/// A file inside ZIP archive. +/** \class QuaZipFile quazipfile.h + * This is the most interesting class. Not only it provides C++ + * interface to the ZIP/UNZIP package, but also integrates it with Qt by + * subclassing QIODevice. This makes possible to access files inside ZIP + * archive using QTextStream or QDataStream, for example. Actually, this + * is the main purpose of the whole QuaZIP library. + * + * You can either use existing QuaZip instance to create instance of + * this class or pass ZIP archive file name to this class, in which case + * it will create internal QuaZip object. See constructors' descriptions + * for details. Writing is only possible with the existing instance. + * + * Note that due to the underlying library's limitation it is not + * possible to use multiple QuaZipFile instances to open several files + * in the same archive at the same time. If you need to write to + * multiple files in parallel, then you should write to temporary files + * first, then pack them all at once when you have finished writing. If + * you need to read multiple files inside the same archive in parallel, + * you should extract them all into a temporary directory first. + * + * \section quazipfile-sequential Sequential or random-access? + * + * At the first thought, QuaZipFile has fixed size, the start and the + * end and should be therefore considered random-access device. But + * there is one major obstacle to making it random-access: ZIP/UNZIP API + * does not support seek() operation and the only way to implement it is + * through reopening the file and re-reading to the required position, + * but this is prohibitively slow. + * + * Therefore, QuaZipFile is considered to be a sequential device. This + * has advantage of availability of the ungetChar() operation (QIODevice + * does not implement it properly for non-sequential devices unless they + * support seek()). Disadvantage is a somewhat strange behaviour of the + * size() and pos() functions. This should be kept in mind while using + * this class. + * + **/ +class QUAZIP_EXPORT QuaZipFile: public QIODevice { + friend class QuaZipFilePrivate; + Q_OBJECT + private: + QuaZipFilePrivate *p; + // these are not supported nor implemented + QuaZipFile(const QuaZipFile& that); + QuaZipFile& operator=(const QuaZipFile& that); + protected: + /// Implementation of the QIODevice::readData(). + qint64 readData(char *data, qint64 maxSize); + /// Implementation of the QIODevice::writeData(). + qint64 writeData(const char *data, qint64 maxSize); + public: + /// Constructs a QuaZipFile instance. + /** You should use setZipName() and setFileName() or setZip() before + * trying to call open() on the constructed object. + **/ + QuaZipFile(); + /// Constructs a QuaZipFile instance. + /** \a parent argument specifies this object's parent object. + * + * You should use setZipName() and setFileName() or setZip() before + * trying to call open() on the constructed object. + **/ + QuaZipFile(QObject *parent); + /// Constructs a QuaZipFile instance. + /** \a parent argument specifies this object's parent object and \a + * zipName specifies ZIP archive file name. + * + * You should use setFileName() before trying to call open() on the + * constructed object. + * + * QuaZipFile constructed by this constructor can be used for read + * only access. Use QuaZipFile(QuaZip*,QObject*) for writing. + **/ + QuaZipFile(const QString& zipName, QObject *parent =NULL); + /// Constructs a QuaZipFile instance. + /** \a parent argument specifies this object's parent object, \a + * zipName specifies ZIP archive file name and \a fileName and \a cs + * specify a name of the file to open inside archive. + * + * QuaZipFile constructed by this constructor can be used for read + * only access. Use QuaZipFile(QuaZip*,QObject*) for writing. + * + * \sa QuaZip::setCurrentFile() + **/ + QuaZipFile(const QString& zipName, const QString& fileName, + QuaZip::CaseSensitivity cs =QuaZip::csDefault, QObject *parent =NULL); + /// Constructs a QuaZipFile instance. + /** \a parent argument specifies this object's parent object. + * + * \a zip is the pointer to the existing QuaZip object. This + * QuaZipFile object then can be used to read current file in the + * \a zip or to write to the file inside it. + * + * \warning Using this constructor for reading current file can be + * tricky. Let's take the following example: + * \code + * QuaZip zip("archive.zip"); + * zip.open(QuaZip::mdUnzip); + * zip.setCurrentFile("file-in-archive"); + * QuaZipFile file(&zip); + * file.open(QIODevice::ReadOnly); + * // ok, now we can read from the file + * file.read(somewhere, some); + * zip.setCurrentFile("another-file-in-archive"); // oops... + * QuaZipFile anotherFile(&zip); + * anotherFile.open(QIODevice::ReadOnly); + * anotherFile.read(somewhere, some); // this is still ok... + * file.read(somewhere, some); // and this is NOT + * \endcode + * So, what exactly happens here? When we change current file in the + * \c zip archive, \c file that references it becomes invalid + * (actually, as far as I understand ZIP/UNZIP sources, it becomes + * closed, but QuaZipFile has no means to detect it). + * + * Summary: do not close \c zip object or change its current file as + * long as QuaZipFile is open. Even better - use another constructors + * which create internal QuaZip instances, one per object, and + * therefore do not cause unnecessary trouble. This constructor may + * be useful, though, if you already have a QuaZip instance and do + * not want to access several files at once. Good example: + * \code + * QuaZip zip("archive.zip"); + * zip.open(QuaZip::mdUnzip); + * // first, we need some information about archive itself + * QByteArray comment=zip.getComment(); + * // and now we are going to access files inside it + * QuaZipFile file(&zip); + * for(bool more=zip.goToFirstFile(); more; more=zip.goToNextFile()) { + * file.open(QIODevice::ReadOnly); + * // do something cool with file here + * file.close(); // do not forget to close! + * } + * zip.close(); + * \endcode + **/ + QuaZipFile(QuaZip *zip, QObject *parent =NULL); + /// Destroys a QuaZipFile instance. + /** Closes file if open, destructs internal QuaZip object (if it + * exists and \em is internal, of course). + **/ + virtual ~QuaZipFile(); + /// Returns the ZIP archive file name. + /** If this object was created by passing QuaZip pointer to the + * constructor, this function will return that QuaZip's file name + * (or null string if that object does not have file name yet). + * + * Otherwise, returns associated ZIP archive file name or null + * string if there are no name set yet. + * + * \sa setZipName() getFileName() + **/ + QString getZipName()const; + /// Returns a pointer to the associated QuaZip object. + /** Returns \c NULL if there is no associated QuaZip or it is + * internal (so you will not mess with it). + **/ + QuaZip* getZip()const; + /// Returns file name. + /** This function returns file name you passed to this object either + * by using + * QuaZipFile(const QString&,const QString&,QuaZip::CaseSensitivity,QObject*) + * or by calling setFileName(). Real name of the file may differ in + * case if you used case-insensitivity. + * + * Returns null string if there is no file name set yet. This is the + * case when this QuaZipFile operates on the existing QuaZip object + * (constructor QuaZipFile(QuaZip*,QObject*) or setZip() was used). + * + * \sa getActualFileName + **/ + QString getFileName() const; + /// Returns case sensitivity of the file name. + /** This function returns case sensitivity argument you passed to + * this object either by using + * QuaZipFile(const QString&,const QString&,QuaZip::CaseSensitivity,QObject*) + * or by calling setFileName(). + * + * Returns unpredictable value if getFileName() returns null string + * (this is the case when you did not used setFileName() or + * constructor above). + * + * \sa getFileName + **/ + QuaZip::CaseSensitivity getCaseSensitivity() const; + /// Returns the actual file name in the archive. + /** This is \em not a ZIP archive file name, but a name of file inside + * archive. It is not necessary the same name that you have passed + * to the + * QuaZipFile(const QString&,const QString&,QuaZip::CaseSensitivity,QObject*), + * setFileName() or QuaZip::setCurrentFile() - this is the real file + * name inside archive, so it may differ in case if the file name + * search was case-insensitive. + * + * Equivalent to calling getCurrentFileName() on the associated + * QuaZip object. Returns null string if there is no associated + * QuaZip object or if it does not have a current file yet. And this + * is the case if you called setFileName() but did not open the + * file yet. So this is perfectly fine: + * \code + * QuaZipFile file("somezip.zip"); + * file.setFileName("somefile"); + * QString name=file.getName(); // name=="somefile" + * QString actual=file.getActualFileName(); // actual is null string + * file.open(QIODevice::ReadOnly); + * QString actual=file.getActualFileName(); // actual can be "SoMeFiLe" on Windows + * \endcode + * + * \sa getZipName(), getFileName(), QuaZip::CaseSensitivity + **/ + QString getActualFileName()const; + /// Sets the ZIP archive file name. + /** Automatically creates internal QuaZip object and destroys + * previously created internal QuaZip object, if any. + * + * Will do nothing if this file is already open. You must close() it + * first. + **/ + void setZipName(const QString& zipName); + /// Returns \c true if the file was opened in raw mode. + /** If the file is not open, the returned value is undefined. + * + * \sa open(OpenMode,int*,int*,bool,const char*) + **/ + bool isRaw() const; + /// Binds to the existing QuaZip instance. + /** This function destroys internal QuaZip object, if any, and makes + * this QuaZipFile to use current file in the \a zip object for any + * further operations. See QuaZipFile(QuaZip*,QObject*) for the + * possible pitfalls. + * + * Will do nothing if the file is currently open. You must close() + * it first. + **/ + void setZip(QuaZip *zip); + /// Sets the file name. + /** Will do nothing if at least one of the following conditions is + * met: + * - ZIP name has not been set yet (getZipName() returns null + * string). + * - This QuaZipFile is associated with external QuaZip. In this + * case you should call that QuaZip's setCurrentFile() function + * instead! + * - File is already open so setting the name is meaningless. + * + * \sa QuaZip::setCurrentFile + **/ + void setFileName(const QString& fileName, QuaZip::CaseSensitivity cs =QuaZip::csDefault); + /// Opens a file for reading. + /** Returns \c true on success, \c false otherwise. + * Call getZipError() to get error code. + * + * \note Since ZIP/UNZIP API provides buffered reading only, + * QuaZipFile does not support unbuffered reading. So do not pass + * QIODevice::Unbuffered flag in \a mode, or open will fail. + **/ + virtual bool open(OpenMode mode); + /// Opens a file for reading. + /** \overload + * Argument \a password specifies a password to decrypt the file. If + * it is NULL then this function behaves just like open(OpenMode). + **/ + inline bool open(OpenMode mode, const char *password) + {return open(mode, NULL, NULL, false, password);} + /// Opens a file for reading. + /** \overload + * Argument \a password specifies a password to decrypt the file. + * + * An integers pointed by \a method and \a level will receive codes + * of the compression method and level used. See unzip.h. + * + * If raw is \c true then no decompression is performed. + * + * \a method should not be \c NULL. \a level can be \c NULL if you + * don't want to know the compression level. + **/ + bool open(OpenMode mode, int *method, int *level, bool raw, const char *password =NULL); + /// Opens a file for writing. + /** \a info argument specifies information about file. It should at + * least specify a correct file name. Also, it is a good idea to + * specify correct timestamp (by default, current time will be + * used). See QuaZipNewInfo. + * + * The \a password argument specifies the password for crypting. Pass NULL + * if you don't need any crypting. The \a crc argument was supposed + * to be used for crypting too, but then it turned out that it's + * false information, so you need to set it to 0 unless you want to + * use the raw mode (see below). + * + * Arguments \a method and \a level specify compression method and + * level. The only method supported is Z_DEFLATED, but you may also + * specify 0 for no compression. If all of the files in the archive + * use both method 0 and either level 0 is explicitly specified or + * data descriptor writing is disabled with + * QuaZip::setDataDescriptorWritingEnabled(), then the + * resulting archive is supposed to be compatible with the 1.0 ZIP + * format version, should you need that. Except for this, \a level + * has no other effects with method 0. + * + * If \a raw is \c true, no compression is performed. In this case, + * \a crc and uncompressedSize field of the \a info are required. + * + * Arguments \a windowBits, \a memLevel, \a strategy provide zlib + * algorithms tuning. See deflateInit2() in zlib. + **/ + bool open(OpenMode mode, const QuaZipNewInfo& info, + const char *password =NULL, quint32 crc =0, + int method =Z_DEFLATED, int level =Z_DEFAULT_COMPRESSION, bool raw =false, + int windowBits =-MAX_WBITS, int memLevel =DEF_MEM_LEVEL, int strategy =Z_DEFAULT_STRATEGY); + /// Returns \c true, but \ref quazipfile-sequential "beware"! + virtual bool isSequential()const; + /// Returns current position in the file. + /** Implementation of the QIODevice::pos(). When reading, this + * function is a wrapper to the ZIP/UNZIP unztell(), therefore it is + * unable to keep track of the ungetChar() calls (which is + * non-virtual and therefore is dangerous to reimplement). So if you + * are using ungetChar() feature of the QIODevice, this function + * reports incorrect value until you get back characters which you + * ungot. + * + * When writing, pos() returns number of bytes already written + * (uncompressed unless you use raw mode). + * + * \note Although + * \ref quazipfile-sequential "QuaZipFile is a sequential device" + * and therefore pos() should always return zero, it does not, + * because it would be misguiding. Keep this in mind. + * + * This function returns -1 if the file or archive is not open. + * + * Error code returned by getZipError() is not affected by this + * function call. + **/ + virtual qint64 pos()const; + /// Returns \c true if the end of file was reached. + /** This function returns \c false in the case of error. This means + * that you called this function on either not open file, or a file + * in the not open archive or even on a QuaZipFile instance that + * does not even have QuaZip instance associated. Do not do that + * because there is no means to determine whether \c false is + * returned because of error or because end of file was reached. + * Well, on the other side you may interpret \c false return value + * as "there is no file open to check for end of file and there is + * no end of file therefore". + * + * When writing, this function always returns \c true (because you + * are always writing to the end of file). + * + * Error code returned by getZipError() is not affected by this + * function call. + **/ + virtual bool atEnd()const; + /// Returns file size. + /** This function returns csize() if the file is open for reading in + * raw mode, usize() if it is open for reading in normal mode and + * pos() if it is open for writing. + * + * Returns -1 on error, call getZipError() to get error code. + * + * \note This function returns file size despite that + * \ref quazipfile-sequential "QuaZipFile is considered to be sequential device", + * for which size() should return bytesAvailable() instead. But its + * name would be very misguiding otherwise, so just keep in mind + * this inconsistence. + **/ + virtual qint64 size()const; + /// Returns compressed file size. + /** Equivalent to calling getFileInfo() and then getting + * compressedSize field, but more convenient and faster. + * + * File must be open for reading before calling this function. + * + * Returns -1 on error, call getZipError() to get error code. + **/ + qint64 csize()const; + /// Returns uncompressed file size. + /** Equivalent to calling getFileInfo() and then getting + * uncompressedSize field, but more convenient and faster. See + * getFileInfo() for a warning. + * + * File must be open for reading before calling this function. + * + * Returns -1 on error, call getZipError() to get error code. + **/ + qint64 usize()const; + /// Gets information about current file. + /** This function does the same thing as calling + * QuaZip::getCurrentFileInfo() on the associated QuaZip object, + * but you can not call getCurrentFileInfo() if the associated + * QuaZip is internal (because you do not have access to it), while + * you still can call this function in that case. + * + * File must be open for reading before calling this function. + * + * Returns \c false in the case of an error. + **/ + bool getFileInfo(QuaZipFileInfo *info); + /// Closes the file. + /** Call getZipError() to determine if the close was successful. + **/ + virtual void close(); + /// Returns the error code returned by the last ZIP/UNZIP API call. + int getZipError() const; + /// Returns the number of bytes available for reading. + virtual qint64 bytesAvailable() const; +}; + +#endif diff --git a/3rdparty/quazip-0.5.1/quazip/quazipfileinfo.cpp b/3rdparty/quazip-0.5.1/quazip/quazipfileinfo.cpp new file mode 100644 index 00000000..ccde58f0 --- /dev/null +++ b/3rdparty/quazip-0.5.1/quazip/quazipfileinfo.cpp @@ -0,0 +1,26 @@ +#include "quazipfileinfo.h" + +QFile::Permissions QuaZipFileInfo::getPermissions() const +{ + quint32 uPerm = (externalAttr & 0xFFFF0000u) >> 16; + QFile::Permissions perm = 0; + if ((uPerm & 0400) != 0) + perm |= QFile::ReadOwner; + if ((uPerm & 0200) != 0) + perm |= QFile::WriteOwner; + if ((uPerm & 0100) != 0) + perm |= QFile::ExeOwner; + if ((uPerm & 0040) != 0) + perm |= QFile::ReadGroup; + if ((uPerm & 0020) != 0) + perm |= QFile::WriteGroup; + if ((uPerm & 0010) != 0) + perm |= QFile::ExeGroup; + if ((uPerm & 0004) != 0) + perm |= QFile::ReadOther; + if ((uPerm & 0002) != 0) + perm |= QFile::WriteOther; + if ((uPerm & 0001) != 0) + perm |= QFile::ExeOther; + return perm; +} diff --git a/quazip/quazipfileinfo.h b/3rdparty/quazip-0.5.1/quazip/quazipfileinfo.h similarity index 90% rename from quazip/quazipfileinfo.h rename to 3rdparty/quazip-0.5.1/quazip/quazipfileinfo.h index 1cf12c7f..327425f1 100644 --- a/quazip/quazipfileinfo.h +++ b/3rdparty/quazip-0.5.1/quazip/quazipfileinfo.h @@ -1,66 +1,73 @@ -#ifndef QUA_ZIPFILEINFO_H -#define QUA_ZIPFILEINFO_H - -/* -Copyright (C) 2005-2011 Sergey A. Tachenov - -This program is free software; you can redistribute it and/or modify it -under the terms of the GNU Lesser General Public License as published by -the Free Software Foundation; either version 2 of the License, or (at -your option) any later version. - -This program is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser -General Public License for more details. - -You should have received a copy of the GNU Lesser General Public License -along with this program; if not, write to the Free Software Foundation, -Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -See COPYING file for the full LGPL text. - -Original ZIP package is copyrighted by Gilles Vollant, see -quazip/(un)zip.h files for details, basically it's zlib license. - **/ - -#include -#include - -#include "quazip_global.h" - -/// Information about a file inside archive. -/** Call QuaZip::getCurrentFileInfo() or QuaZipFile::getFileInfo() to - * fill this structure. */ -struct QUAZIP_EXPORT QuaZipFileInfo { - /// File name. - QString name; - /// Version created by. - quint16 versionCreated; - /// Version needed to extract. - quint16 versionNeeded; - /// General purpose flags. - quint16 flags; - /// Compression method. - quint16 method; - /// Last modification date and time. - QDateTime dateTime; - /// CRC. - quint32 crc; - /// Compressed file size. - quint32 compressedSize; - /// Uncompressed file size. - quint32 uncompressedSize; - /// Disk number start. - quint16 diskNumberStart; - /// Internal file attributes. - quint16 internalAttr; - /// External file attributes. - quint32 externalAttr; - /// Comment. - QString comment; - /// Extra field. - QByteArray extra; -}; - -#endif +#ifndef QUA_ZIPFILEINFO_H +#define QUA_ZIPFILEINFO_H + +/* +Copyright (C) 2005-2011 Sergey A. Tachenov + +This program is free software; you can redistribute it and/or modify it +under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2 of the License, or (at +your option) any later version. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser +General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with this program; if not, write to the Free Software Foundation, +Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +See COPYING file for the full LGPL text. + +Original ZIP package is copyrighted by Gilles Vollant, see +quazip/(un)zip.h files for details, basically it's zlib license. + **/ + +#include +#include +#include + +#include "quazip_global.h" + +/// Information about a file inside archive. +/** Call QuaZip::getCurrentFileInfo() or QuaZipFile::getFileInfo() to + * fill this structure. */ +struct QUAZIP_EXPORT QuaZipFileInfo { + /// File name. + QString name; + /// Version created by. + quint16 versionCreated; + /// Version needed to extract. + quint16 versionNeeded; + /// General purpose flags. + quint16 flags; + /// Compression method. + quint16 method; + /// Last modification date and time. + QDateTime dateTime; + /// CRC. + quint32 crc; + /// Compressed file size. + quint32 compressedSize; + /// Uncompressed file size. + quint32 uncompressedSize; + /// Disk number start. + quint16 diskNumberStart; + /// Internal file attributes. + quint16 internalAttr; + /// External file attributes. + quint32 externalAttr; + /// Comment. + QString comment; + /// Extra field. + QByteArray extra; + /// Get the file permissions. + /** + Returns the high 16 bits of external attributes converted to + QFile::Permissions. + */ + QFile::Permissions getPermissions() const; +}; + +#endif diff --git a/quazip/quazipnewinfo.cpp b/3rdparty/quazip-0.5.1/quazip/quazipnewinfo.cpp similarity index 54% rename from quazip/quazipnewinfo.cpp rename to 3rdparty/quazip-0.5.1/quazip/quazipnewinfo.cpp index fb4df6e7..a84b9a0f 100644 --- a/quazip/quazipnewinfo.cpp +++ b/3rdparty/quazip-0.5.1/quazip/quazipnewinfo.cpp @@ -1,51 +1,89 @@ -/* -Copyright (C) 2005-2011 Sergey A. Tachenov - -This program is free software; you can redistribute it and/or modify it -under the terms of the GNU Lesser General Public License as published by -the Free Software Foundation; either version 2 of the License, or (at -your option) any later version. - -This program is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser -General Public License for more details. - -You should have received a copy of the GNU Lesser General Public License -along with this program; if not, write to the Free Software Foundation, -Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -See COPYING file for the full LGPL text. - -Original ZIP package is copyrighted by Gilles Vollant, see -quazip/(un)zip.h files for details, basically it's zlib license. -*/ - -#include - -#include "quazipnewinfo.h" - - -QuaZipNewInfo::QuaZipNewInfo(const QString& name): - name(name), dateTime(QDateTime::currentDateTime()), internalAttr(0), externalAttr(0) -{ -} - -QuaZipNewInfo::QuaZipNewInfo(const QString& name, const QString& file): - name(name), internalAttr(0), externalAttr(0) -{ - QFileInfo info(file); - QDateTime lm = info.lastModified(); - if (!info.exists()) - dateTime = QDateTime::currentDateTime(); - else - dateTime = lm; -} - -void QuaZipNewInfo::setFileDateTime(const QString& file) -{ - QFileInfo info(file); - QDateTime lm = info.lastModified(); - if (info.exists()) - dateTime = lm; -} +/* +Copyright (C) 2005-2011 Sergey A. Tachenov + +This program is free software; you can redistribute it and/or modify it +under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2 of the License, or (at +your option) any later version. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser +General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with this program; if not, write to the Free Software Foundation, +Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +See COPYING file for the full LGPL text. + +Original ZIP package is copyrighted by Gilles Vollant, see +quazip/(un)zip.h files for details, basically it's zlib license. +*/ + +#include + +#include "quazipnewinfo.h" + +static void QuaZipNewInfo_setPermissions(QuaZipNewInfo *info, + QFile::Permissions perm, bool isDir) +{ + quint32 uPerm = isDir ? 0040000 : 0100000; + if ((perm & QFile::ReadOwner) != 0) + uPerm |= 0400; + if ((perm & QFile::WriteOwner) != 0) + uPerm |= 0200; + if ((perm & QFile::ExeOwner) != 0) + uPerm |= 0100; + if ((perm & QFile::ReadGroup) != 0) + uPerm |= 0040; + if ((perm & QFile::WriteGroup) != 0) + uPerm |= 0020; + if ((perm & QFile::ExeGroup) != 0) + uPerm |= 0010; + if ((perm & QFile::ReadOther) != 0) + uPerm |= 0004; + if ((perm & QFile::WriteOther) != 0) + uPerm |= 0002; + if ((perm & QFile::ExeOther) != 0) + uPerm |= 0001; + info->externalAttr = (info->externalAttr & ~0xFFFF0000u) | (uPerm << 16); +} + +QuaZipNewInfo::QuaZipNewInfo(const QString& name): + name(name), dateTime(QDateTime::currentDateTime()), internalAttr(0), externalAttr(0) +{ +} + +QuaZipNewInfo::QuaZipNewInfo(const QString& name, const QString& file): + name(name), internalAttr(0), externalAttr(0) +{ + QFileInfo info(file); + QDateTime lm = info.lastModified(); + if (!info.exists()) { + dateTime = QDateTime::currentDateTime(); + } else { + dateTime = lm; + QuaZipNewInfo_setPermissions(this, info.permissions(), info.isDir()); + } +} + +void QuaZipNewInfo::setFileDateTime(const QString& file) +{ + QFileInfo info(file); + QDateTime lm = info.lastModified(); + if (info.exists()) + dateTime = lm; +} + +void QuaZipNewInfo::setFilePermissions(const QString &file) +{ + QFileInfo info = QFileInfo(file); + QFile::Permissions perm = info.permissions(); + QuaZipNewInfo_setPermissions(this, perm, info.isDir()); +} + +void QuaZipNewInfo::setPermissions(QFile::Permissions permissions) +{ + QuaZipNewInfo_setPermissions(this, permissions, name.endsWith('/')); +} diff --git a/quazip/quazipnewinfo.h b/3rdparty/quazip-0.5.1/quazip/quazipnewinfo.h similarity index 78% rename from quazip/quazipnewinfo.h rename to 3rdparty/quazip-0.5.1/quazip/quazipnewinfo.h index 08c4eaea..cd321c27 100644 --- a/quazip/quazipnewinfo.h +++ b/3rdparty/quazip-0.5.1/quazip/quazipnewinfo.h @@ -1,102 +1,121 @@ -#ifndef QUA_ZIPNEWINFO_H -#define QUA_ZIPNEWINFO_H - -/* -Copyright (C) 2005-2011 Sergey A. Tachenov - -This program is free software; you can redistribute it and/or modify it -under the terms of the GNU Lesser General Public License as published by -the Free Software Foundation; either version 2 of the License, or (at -your option) any later version. - -This program is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser -General Public License for more details. - -You should have received a copy of the GNU Lesser General Public License -along with this program; if not, write to the Free Software Foundation, -Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -See COPYING file for the full LGPL text. - -Original ZIP package is copyrighted by Gilles Vollant, see -quazip/(un)zip.h files for details, basically it's zlib license. - **/ - -#include -#include - -#include "quazip_global.h" - -/// Information about a file to be created. -/** This structure holds information about a file to be created inside - * ZIP archive. At least name should be set to something correct before - * passing this structure to - * QuaZipFile::open(OpenMode,const QuaZipNewInfo&,int,int,bool). - **/ -struct QUAZIP_EXPORT QuaZipNewInfo { - /// File name. - /** This field holds file name inside archive, including path relative - * to archive root. - **/ - QString name; - /// File timestamp. - /** This is the last file modification date and time. Will be stored - * in the archive central directory. It is a good practice to set it - * to the source file timestamp instead of archive creating time. Use - * setFileDateTime() or QuaZipNewInfo(const QString&, const QString&). - **/ - QDateTime dateTime; - /// File internal attributes. - quint16 internalAttr; - /// File external attributes. - quint32 externalAttr; - /// File comment. - /** Will be encoded using QuaZip::getCommentCodec(). - **/ - QString comment; - /// File local extra field. - QByteArray extraLocal; - /// File global extra field. - QByteArray extraGlobal; - /// Uncompressed file size. - /** This is only needed if you are using raw file zipping mode, i. e. - * adding precompressed file in the zip archive. - **/ - ulong uncompressedSize; - /// Constructs QuaZipNewInfo instance. - /** Initializes name with \a name, dateTime with current date and - * time. Attributes are initialized with zeros, comment and extra - * field with null values. - **/ - QuaZipNewInfo(const QString& name); - /// Constructs QuaZipNewInfo instance. - /** Initializes name with \a name and dateTime with timestamp of the - * file named \a file. If the \a file does not exists or its timestamp - * is inaccessible (e. g. you do not have read permission for the - * directory file in), uses current date and time. Attributes are - * initialized with zeros, comment and extra field with null values. - * - * \sa setFileDateTime() - **/ - QuaZipNewInfo(const QString& name, const QString& file); - /// Sets the file timestamp from the existing file. - /** Use this function to set the file timestamp from the existing - * file. Use it like this: - * \code - * QuaZipFile zipFile(&zip); - * QFile file("file-to-add"); - * file.open(QIODevice::ReadOnly); - * QuaZipNewInfo info("file-name-in-archive"); - * info.setFileDateTime("file-to-add"); // take the timestamp from file - * zipFile.open(QIODevice::WriteOnly, info); - * \endcode - * - * This function does not change dateTime if some error occured (e. g. - * file is inaccessible). - **/ - void setFileDateTime(const QString& file); -}; - -#endif +#ifndef QUA_ZIPNEWINFO_H +#define QUA_ZIPNEWINFO_H + +/* +Copyright (C) 2005-2011 Sergey A. Tachenov + +This program is free software; you can redistribute it and/or modify it +under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2 of the License, or (at +your option) any later version. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser +General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with this program; if not, write to the Free Software Foundation, +Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +See COPYING file for the full LGPL text. + +Original ZIP package is copyrighted by Gilles Vollant, see +quazip/(un)zip.h files for details, basically it's zlib license. + **/ + +#include +#include + +#include "quazip_global.h" + +/// Information about a file to be created. +/** This structure holds information about a file to be created inside + * ZIP archive. At least name should be set to something correct before + * passing this structure to + * QuaZipFile::open(OpenMode,const QuaZipNewInfo&,int,int,bool). + **/ +struct QUAZIP_EXPORT QuaZipNewInfo { + /// File name. + /** This field holds file name inside archive, including path relative + * to archive root. + **/ + QString name; + /// File timestamp. + /** This is the last file modification date and time. Will be stored + * in the archive central directory. It is a good practice to set it + * to the source file timestamp instead of archive creating time. Use + * setFileDateTime() or QuaZipNewInfo(const QString&, const QString&). + **/ + QDateTime dateTime; + /// File internal attributes. + quint16 internalAttr; + /// File external attributes. + /** + The highest 16 bits contain Unix file permissions and type (dir or + file). The constructor QuaZipNewInfo(const QString&, const QString&) + takes permissions from the provided file. + */ + quint32 externalAttr; + /// File comment. + /** Will be encoded using QuaZip::getCommentCodec(). + **/ + QString comment; + /// File local extra field. + QByteArray extraLocal; + /// File global extra field. + QByteArray extraGlobal; + /// Uncompressed file size. + /** This is only needed if you are using raw file zipping mode, i. e. + * adding precompressed file in the zip archive. + **/ + ulong uncompressedSize; + /// Constructs QuaZipNewInfo instance. + /** Initializes name with \a name, dateTime with current date and + * time. Attributes are initialized with zeros, comment and extra + * field with null values. + **/ + QuaZipNewInfo(const QString& name); + /// Constructs QuaZipNewInfo instance. + /** Initializes name with \a name. Timestamp and permissions are taken + * from the specified file. If the \a file does not exists or its timestamp + * is inaccessible (e. g. you do not have read permission for the + * directory file in), uses current time and zero permissions. Other attributes are + * initialized with zeros, comment and extra field with null values. + * + * \sa setFileDateTime() + **/ + QuaZipNewInfo(const QString& name, const QString& file); + /// Sets the file timestamp from the existing file. + /** Use this function to set the file timestamp from the existing + * file. Use it like this: + * \code + * QuaZipFile zipFile(&zip); + * QFile file("file-to-add"); + * file.open(QIODevice::ReadOnly); + * QuaZipNewInfo info("file-name-in-archive"); + * info.setFileDateTime("file-to-add"); // take the timestamp from file + * zipFile.open(QIODevice::WriteOnly, info); + * \endcode + * + * This function does not change dateTime if some error occured (e. g. + * file is inaccessible). + **/ + void setFileDateTime(const QString& file); + /// Sets the file permissions from the existing file. + /** + Takes permissions from the file and sets the high 16 bits of + external attributes. Uses QFileInfo to get permissions on all + platforms. + */ + void setFilePermissions(const QString &file); + /// Sets the file permissions. + /** + Modifies the highest 16 bits of external attributes. The type part + is set to dir if the name ends with a slash, and to regular file + otherwise. + */ + void setPermissions(QFile::Permissions permissions); +}; + +#endif diff --git a/3rdparty/quazip-0.5.1/quazip/run_moc.bat b/3rdparty/quazip-0.5.1/quazip/run_moc.bat new file mode 100644 index 00000000..6b63fc77 --- /dev/null +++ b/3rdparty/quazip-0.5.1/quazip/run_moc.bat @@ -0,0 +1,3 @@ +moc -o moc\moc_quazipfile.cpp quazipfile.h +moc -o moc\moc_quagzipfile.cpp quagzipfile.h +moc -o moc\moc_quaziodevice.cpp quaziodevice.h diff --git a/quazip/unzip.c b/3rdparty/quazip-0.5.1/quazip/unzip.c similarity index 96% rename from quazip/unzip.c rename to 3rdparty/quazip-0.5.1/quazip/unzip.c index bbec7647..6e115ae6 100644 --- a/quazip/unzip.c +++ b/3rdparty/quazip-0.5.1/quazip/unzip.c @@ -1,1603 +1,1603 @@ -/* unzip.c -- IO for uncompress .zip files using zlib - Version 1.01e, February 12th, 2005 - - Copyright (C) 1998-2005 Gilles Vollant - - Read unzip.h for more info - - Modified by Sergey A. Tachenov to integrate with Qt. -*/ - -/* Decryption code comes from crypt.c by Info-ZIP but has been greatly reduced in terms of -compatibility with older software. The following is from the original crypt.c. Code -woven in by Terry Thorsen 1/2003. -*/ -/* - Copyright (c) 1990-2000 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2000-Apr-09 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/* - crypt.c (full version) by Info-ZIP. Last revised: [see crypt.h] - - The encryption/decryption parts of this source code (as opposed to the - non-echoing password parts) were originally written in Europe. The - whole source package can be freely distributed, including from the USA. - (Prior to January 2000, re-export from the US was a violation of US law.) - */ - -/* - This encryption code is a direct transcription of the algorithm from - Roger Schlafly, described by Phil Katz in the file appnote.txt. This - file (appnote.txt) is distributed with the PKZIP program (even in the - version without encryption capabilities). - */ - - -#include -#include -#include -#include "zlib.h" -#include "unzip.h" - -#ifdef STDC -# include -# include -# include -#endif -#ifdef NO_ERRNO_H - extern int errno; -#else -# include -#endif - - -#ifndef local -# define local static -#endif -/* compile with -Dlocal if your debugger can't find static symbols */ - - -#ifndef CASESENSITIVITYDEFAULT_NO -# if !defined(unix) && !defined(CASESENSITIVITYDEFAULT_YES) -# define CASESENSITIVITYDEFAULT_NO -# endif -#endif - - -#ifndef UNZ_BUFSIZE -#define UNZ_BUFSIZE (16384) -#endif - -#ifndef UNZ_MAXFILENAMEINZIP -#define UNZ_MAXFILENAMEINZIP (256) -#endif - -#ifndef ALLOC -# define ALLOC(size) (malloc(size)) -#endif -#ifndef TRYFREE -# define TRYFREE(p) {if (p) free(p);} -#endif - -#define SIZECENTRALDIRITEM (0x2e) -#define SIZEZIPLOCALHEADER (0x1e) - - - - -const char unz_copyright[] = - " unzip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll"; - -/* unz_file_info_interntal contain internal info about a file in zipfile*/ -typedef struct unz_file_info_internal_s -{ - uLong offset_curfile;/* relative offset of local header 4 bytes */ -} unz_file_info_internal; - - -/* file_in_zip_read_info_s contain internal information about a file in zipfile, - when reading and decompress it */ -typedef struct -{ - char *read_buffer; /* internal buffer for compressed data */ - z_stream stream; /* zLib stream structure for inflate */ - - uLong pos_in_zipfile; /* position in byte on the zipfile, for fseek*/ - uLong stream_initialised; /* flag set if stream structure is initialised*/ - - uLong offset_local_extrafield;/* offset of the local extra field */ - uInt size_local_extrafield;/* size of the local extra field */ - uLong pos_local_extrafield; /* position in the local extra field in read*/ - - uLong crc32; /* crc32 of all data uncompressed */ - uLong crc32_wait; /* crc32 we must obtain after decompress all */ - uLong rest_read_compressed; /* number of byte to be decompressed */ - uLong rest_read_uncompressed;/*number of byte to be obtained after decomp*/ - zlib_filefunc_def z_filefunc; - voidpf filestream; /* io structore of the zipfile */ - uLong compression_method; /* compression method (0==store) */ - uLong byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ - int raw; -} file_in_zip_read_info_s; - - -/* unz_s contain internal information about the zipfile -*/ -typedef struct -{ - zlib_filefunc_def z_filefunc; - voidpf filestream; /* io structore of the zipfile */ - unz_global_info gi; /* public global information */ - uLong byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ - uLong num_file; /* number of the current file in the zipfile*/ - uLong pos_in_central_dir; /* pos of the current file in the central dir*/ - uLong current_file_ok; /* flag about the usability of the current file*/ - uLong central_pos; /* position of the beginning of the central dir*/ - - uLong size_central_dir; /* size of the central directory */ - uLong offset_central_dir; /* offset of start of central directory with - respect to the starting disk number */ - - unz_file_info cur_file_info; /* public info about the current file in zip*/ - unz_file_info_internal cur_file_info_internal; /* private info about it*/ - file_in_zip_read_info_s* pfile_in_zip_read; /* structure about the current - file if we are decompressing it */ - int encrypted; -# ifndef NOUNCRYPT - unsigned long keys[3]; /* keys defining the pseudo-random sequence */ - const unsigned long* pcrc_32_tab; -# endif -} unz_s; - - -#ifndef NOUNCRYPT -#include "crypt.h" -#endif - -/* =========================================================================== - Read a byte from a gz_stream; update next_in and avail_in. Return EOF - for end of file. - IN assertion: the stream s has been sucessfully opened for reading. -*/ - - -local int unzlocal_getByte OF(( - const zlib_filefunc_def* pzlib_filefunc_def, - voidpf filestream, - int *pi)); - -local int unzlocal_getByte(pzlib_filefunc_def,filestream,pi) - const zlib_filefunc_def* pzlib_filefunc_def; - voidpf filestream; - int *pi; -{ - unsigned char c; - int err = (int)ZREAD(*pzlib_filefunc_def,filestream,&c,1); - if (err==1) - { - *pi = (int)c; - return UNZ_OK; - } - else - { - if (ZERROR(*pzlib_filefunc_def,filestream)) - return UNZ_ERRNO; - else - return UNZ_EOF; - } -} - - -/* =========================================================================== - Reads a long in LSB order from the given gz_stream. Sets -*/ -local int unzlocal_getShort OF(( - const zlib_filefunc_def* pzlib_filefunc_def, - voidpf filestream, - uLong *pX)); - -local int unzlocal_getShort (pzlib_filefunc_def,filestream,pX) - const zlib_filefunc_def* pzlib_filefunc_def; - voidpf filestream; - uLong *pX; -{ - uLong x ; - int i; - int err; - - err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i); - x = (uLong)i; - - if (err==UNZ_OK) - err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i); - x += ((uLong)i)<<8; - - if (err==UNZ_OK) - *pX = x; - else - *pX = 0; - return err; -} - -local int unzlocal_getLong OF(( - const zlib_filefunc_def* pzlib_filefunc_def, - voidpf filestream, - uLong *pX)); - -local int unzlocal_getLong (pzlib_filefunc_def,filestream,pX) - const zlib_filefunc_def* pzlib_filefunc_def; - voidpf filestream; - uLong *pX; -{ - uLong x ; - int i; - int err; - - err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i); - x = (uLong)i; - - if (err==UNZ_OK) - err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i); - x += ((uLong)i)<<8; - - if (err==UNZ_OK) - err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i); - x += ((uLong)i)<<16; - - if (err==UNZ_OK) - err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i); - x += ((uLong)i)<<24; - - if (err==UNZ_OK) - *pX = x; - else - *pX = 0; - return err; -} - - -/* My own strcmpi / strcasecmp */ -local int strcmpcasenosensitive_internal (fileName1,fileName2) - const char* fileName1; - const char* fileName2; -{ - for (;;) - { - char c1=*(fileName1++); - char c2=*(fileName2++); - if ((c1>='a') && (c1<='z')) - c1 -= 0x20; - if ((c2>='a') && (c2<='z')) - c2 -= 0x20; - if (c1=='\0') - return ((c2=='\0') ? 0 : -1); - if (c2=='\0') - return 1; - if (c1c2) - return 1; - } -} - - -#ifdef CASESENSITIVITYDEFAULT_NO -#define CASESENSITIVITYDEFAULTVALUE 2 -#else -#define CASESENSITIVITYDEFAULTVALUE 1 -#endif - -#ifndef STRCMPCASENOSENTIVEFUNCTION -#define STRCMPCASENOSENTIVEFUNCTION strcmpcasenosensitive_internal -#endif - -/* - Compare two filename (fileName1,fileName2). - If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp) - If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi - or strcasecmp) - If iCaseSenisivity = 0, case sensitivity is defaut of your operating system - (like 1 on Unix, 2 on Windows) - -*/ -extern int ZEXPORT unzStringFileNameCompare (fileName1,fileName2,iCaseSensitivity) - const char* fileName1; - const char* fileName2; - int iCaseSensitivity; -{ - if (iCaseSensitivity==0) - iCaseSensitivity=CASESENSITIVITYDEFAULTVALUE; - - if (iCaseSensitivity==1) - return strcmp(fileName1,fileName2); - - return STRCMPCASENOSENTIVEFUNCTION(fileName1,fileName2); -} - -#ifndef BUFREADCOMMENT -#define BUFREADCOMMENT (0x400) -#endif - -/* - Locate the Central directory of a zipfile (at the end, just before - the global comment) -*/ -local uLong unzlocal_SearchCentralDir OF(( - const zlib_filefunc_def* pzlib_filefunc_def, - voidpf filestream)); - -local uLong unzlocal_SearchCentralDir(pzlib_filefunc_def,filestream) - const zlib_filefunc_def* pzlib_filefunc_def; - voidpf filestream; -{ - unsigned char* buf; - uLong uSizeFile; - uLong uBackRead; - uLong uMaxBack=0xffff; /* maximum size of global comment */ - uLong uPosFound=0; - - if (ZSEEK(*pzlib_filefunc_def,filestream,0,ZLIB_FILEFUNC_SEEK_END) != 0) - return 0; - - - uSizeFile = ZTELL(*pzlib_filefunc_def,filestream); - - if (uMaxBack>uSizeFile) - uMaxBack = uSizeFile; - - buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4); - if (buf==NULL) - return 0; - - uBackRead = 4; - while (uBackReaduMaxBack) - uBackRead = uMaxBack; - else - uBackRead+=BUFREADCOMMENT; - uReadPos = uSizeFile-uBackRead ; - - uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ? - (BUFREADCOMMENT+4) : (uSizeFile-uReadPos); - if (ZSEEK(*pzlib_filefunc_def,filestream,uReadPos,ZLIB_FILEFUNC_SEEK_SET)!=0) - break; - - if (ZREAD(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize) - break; - - for (i=(int)uReadSize-3; (i--)>0;) - if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && - ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06)) - { - uPosFound = uReadPos+i; - break; - } - - if (uPosFound!=0) - break; - } - TRYFREE(buf); - return uPosFound; -} - -/* - Open a Zip file. path contain the full pathname (by example, - on a Windows NT computer "c:\\test\\zlib114.zip" or on an Unix computer - "zlib/zlib114.zip". - If the zipfile cannot be opened (file doesn't exist or in not valid), the - return value is NULL. - Else, the return value is a unzFile Handle, usable with other function - of this unzip package. -*/ -extern unzFile ZEXPORT unzOpen2 (file, pzlib_filefunc_def) - voidpf file; - zlib_filefunc_def* pzlib_filefunc_def; -{ - unz_s us; - unz_s *s; - uLong central_pos,uL; - - uLong number_disk; /* number of the current dist, used for - spaning ZIP, unsupported, always 0*/ - uLong number_disk_with_CD; /* number the the disk with central dir, used - for spaning ZIP, unsupported, always 0*/ - uLong number_entry_CD; /* total number of entries in - the central dir - (same than number_entry on nospan) */ - - int err=UNZ_OK; - - if (unz_copyright[0]!=' ') - return NULL; - - if (pzlib_filefunc_def==NULL) - fill_qiodevice_filefunc(&us.z_filefunc); - else - us.z_filefunc = *pzlib_filefunc_def; - - us.filestream= (*(us.z_filefunc.zopen_file))(us.z_filefunc.opaque, - file, - ZLIB_FILEFUNC_MODE_READ | - ZLIB_FILEFUNC_MODE_EXISTING); - if (us.filestream==NULL) - return NULL; - - central_pos = unzlocal_SearchCentralDir(&us.z_filefunc,us.filestream); - if (central_pos==0) - err=UNZ_ERRNO; - - if (ZSEEK(us.z_filefunc, us.filestream, - central_pos,ZLIB_FILEFUNC_SEEK_SET)!=0) - err=UNZ_ERRNO; - - /* the signature, already checked */ - if (unzlocal_getLong(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK) - err=UNZ_ERRNO; - - /* number of this disk */ - if (unzlocal_getShort(&us.z_filefunc, us.filestream,&number_disk)!=UNZ_OK) - err=UNZ_ERRNO; - - /* number of the disk with the start of the central directory */ - if (unzlocal_getShort(&us.z_filefunc, us.filestream,&number_disk_with_CD)!=UNZ_OK) - err=UNZ_ERRNO; - - /* total number of entries in the central dir on this disk */ - if (unzlocal_getShort(&us.z_filefunc, us.filestream,&us.gi.number_entry)!=UNZ_OK) - err=UNZ_ERRNO; - - /* total number of entries in the central dir */ - if (unzlocal_getShort(&us.z_filefunc, us.filestream,&number_entry_CD)!=UNZ_OK) - err=UNZ_ERRNO; - - if ((number_entry_CD!=us.gi.number_entry) || - (number_disk_with_CD!=0) || - (number_disk!=0)) - err=UNZ_BADZIPFILE; - - /* size of the central directory */ - if (unzlocal_getLong(&us.z_filefunc, us.filestream,&us.size_central_dir)!=UNZ_OK) - err=UNZ_ERRNO; - - /* offset of start of central directory with respect to the - starting disk number */ - if (unzlocal_getLong(&us.z_filefunc, us.filestream,&us.offset_central_dir)!=UNZ_OK) - err=UNZ_ERRNO; - - /* zipfile comment length */ - if (unzlocal_getShort(&us.z_filefunc, us.filestream,&us.gi.size_comment)!=UNZ_OK) - err=UNZ_ERRNO; - - if ((central_pospfile_in_zip_read!=NULL) - unzCloseCurrentFile(file); - - ZCLOSE(s->z_filefunc, s->filestream); - TRYFREE(s); - return UNZ_OK; -} - - -/* - Write info about the ZipFile in the *pglobal_info structure. - No preparation of the structure is needed - return UNZ_OK if there is no problem. */ -extern int ZEXPORT unzGetGlobalInfo (file,pglobal_info) - unzFile file; - unz_global_info *pglobal_info; -{ - unz_s* s; - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - *pglobal_info=s->gi; - return UNZ_OK; -} - - -/* - Translate date/time from Dos format to tm_unz (readable more easilty) -*/ -local void unzlocal_DosDateToTmuDate (ulDosDate, ptm) - uLong ulDosDate; - tm_unz* ptm; -{ - uLong uDate; - uDate = (uLong)(ulDosDate>>16); - ptm->tm_mday = (uInt)(uDate&0x1f) ; - ptm->tm_mon = (uInt)((((uDate)&0x1E0)/0x20)-1) ; - ptm->tm_year = (uInt)(((uDate&0x0FE00)/0x0200)+1980) ; - - ptm->tm_hour = (uInt) ((ulDosDate &0xF800)/0x800); - ptm->tm_min = (uInt) ((ulDosDate&0x7E0)/0x20) ; - ptm->tm_sec = (uInt) (2*(ulDosDate&0x1f)) ; -} - -/* - Get Info about the current file in the zipfile, with internal only info -*/ -local int unzlocal_GetCurrentFileInfoInternal OF((unzFile file, - unz_file_info *pfile_info, - unz_file_info_internal - *pfile_info_internal, - char *szFileName, - uLong fileNameBufferSize, - void *extraField, - uLong extraFieldBufferSize, - char *szComment, - uLong commentBufferSize)); - -local int unzlocal_GetCurrentFileInfoInternal (file, - pfile_info, - pfile_info_internal, - szFileName, fileNameBufferSize, - extraField, extraFieldBufferSize, - szComment, commentBufferSize) - unzFile file; - unz_file_info *pfile_info; - unz_file_info_internal *pfile_info_internal; - char *szFileName; - uLong fileNameBufferSize; - void *extraField; - uLong extraFieldBufferSize; - char *szComment; - uLong commentBufferSize; -{ - unz_s* s; - unz_file_info file_info; - unz_file_info_internal file_info_internal; - int err=UNZ_OK; - uLong uMagic; - uLong uSeek=0; - - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - if (ZSEEK(s->z_filefunc, s->filestream, - s->pos_in_central_dir+s->byte_before_the_zipfile, - ZLIB_FILEFUNC_SEEK_SET)!=0) - err=UNZ_ERRNO; - - - /* we check the magic */ - if (err==UNZ_OK) { - if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uMagic) != UNZ_OK) - err=UNZ_ERRNO; - else if (uMagic!=0x02014b50) - err=UNZ_BADZIPFILE; - } - - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.version) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.version_needed) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.flag) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.compression_method) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info.dosDate) != UNZ_OK) - err=UNZ_ERRNO; - - unzlocal_DosDateToTmuDate(file_info.dosDate,&file_info.tmu_date); - - if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info.crc) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info.compressed_size) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info.uncompressed_size) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.size_filename) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.size_file_extra) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.size_file_comment) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.disk_num_start) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.internal_fa) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info.external_fa) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info_internal.offset_curfile) != UNZ_OK) - err=UNZ_ERRNO; - - uSeek+=file_info.size_filename; - if ((err==UNZ_OK) && (szFileName!=NULL)) - { - uLong uSizeRead ; - if (file_info.size_filename0) && (fileNameBufferSize>0)) - if (ZREAD(s->z_filefunc, s->filestream,szFileName,uSizeRead)!=uSizeRead) - err=UNZ_ERRNO; - uSeek -= uSizeRead; - } - - - if ((err==UNZ_OK) && (extraField!=NULL)) - { - uLong uSizeRead ; - if (file_info.size_file_extraz_filefunc, s->filestream,uSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) - uSeek=0; - else - err=UNZ_ERRNO; - } - if ((file_info.size_file_extra>0) && (extraFieldBufferSize>0)) - if (ZREAD(s->z_filefunc, s->filestream,extraField,uSizeRead)!=uSizeRead) - err=UNZ_ERRNO; - uSeek += file_info.size_file_extra - uSizeRead; - } - else - uSeek+=file_info.size_file_extra; - - - if ((err==UNZ_OK) && (szComment!=NULL)) - { - uLong uSizeRead ; - if (file_info.size_file_commentz_filefunc, s->filestream,uSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) - uSeek=0; - else - err=UNZ_ERRNO; - } - if ((file_info.size_file_comment>0) && (commentBufferSize>0)) - if (ZREAD(s->z_filefunc, s->filestream,szComment,uSizeRead)!=uSizeRead) - err=UNZ_ERRNO; - uSeek+=file_info.size_file_comment - uSizeRead; - } - else - uSeek+=file_info.size_file_comment; - - if ((err==UNZ_OK) && (pfile_info!=NULL)) - *pfile_info=file_info; - - if ((err==UNZ_OK) && (pfile_info_internal!=NULL)) - *pfile_info_internal=file_info_internal; - - return err; -} - - - -/* - Write info about the ZipFile in the *pglobal_info structure. - No preparation of the structure is needed - return UNZ_OK if there is no problem. -*/ -extern int ZEXPORT unzGetCurrentFileInfo (file, - pfile_info, - szFileName, fileNameBufferSize, - extraField, extraFieldBufferSize, - szComment, commentBufferSize) - unzFile file; - unz_file_info *pfile_info; - char *szFileName; - uLong fileNameBufferSize; - void *extraField; - uLong extraFieldBufferSize; - char *szComment; - uLong commentBufferSize; -{ - return unzlocal_GetCurrentFileInfoInternal(file,pfile_info,NULL, - szFileName,fileNameBufferSize, - extraField,extraFieldBufferSize, - szComment,commentBufferSize); -} - -/* - Set the current file of the zipfile to the first file. - return UNZ_OK if there is no problem -*/ -extern int ZEXPORT unzGoToFirstFile (file) - unzFile file; -{ - int err=UNZ_OK; - unz_s* s; - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - s->pos_in_central_dir=s->offset_central_dir; - s->num_file=0; - err=unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info, - &s->cur_file_info_internal, - NULL,0,NULL,0,NULL,0); - s->current_file_ok = (err == UNZ_OK); - return err; -} - -/* - Set the current file of the zipfile to the next file. - return UNZ_OK if there is no problem - return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. -*/ -extern int ZEXPORT unzGoToNextFile (file) - unzFile file; -{ - unz_s* s; - int err; - - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - if (!s->current_file_ok) - return UNZ_END_OF_LIST_OF_FILE; - if (s->gi.number_entry != 0xffff) /* 2^16 files overflow hack */ - if (s->num_file+1==s->gi.number_entry) - return UNZ_END_OF_LIST_OF_FILE; - - s->pos_in_central_dir += SIZECENTRALDIRITEM + s->cur_file_info.size_filename + - s->cur_file_info.size_file_extra + s->cur_file_info.size_file_comment ; - s->num_file++; - err = unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info, - &s->cur_file_info_internal, - NULL,0,NULL,0,NULL,0); - s->current_file_ok = (err == UNZ_OK); - return err; -} - - -/* - Try locate the file szFileName in the zipfile. - For the iCaseSensitivity signification, see unzipStringFileNameCompare - - return value : - UNZ_OK if the file is found. It becomes the current file. - UNZ_END_OF_LIST_OF_FILE if the file is not found -*/ -extern int ZEXPORT unzLocateFile (file, szFileName, iCaseSensitivity) - unzFile file; - const char *szFileName; - int iCaseSensitivity; -{ - unz_s* s; - int err; - - /* We remember the 'current' position in the file so that we can jump - * back there if we fail. - */ - unz_file_info cur_file_infoSaved; - unz_file_info_internal cur_file_info_internalSaved; - uLong num_fileSaved; - uLong pos_in_central_dirSaved; - - - if (file==NULL) - return UNZ_PARAMERROR; - - if (strlen(szFileName)>=UNZ_MAXFILENAMEINZIP) - return UNZ_PARAMERROR; - - s=(unz_s*)file; - if (!s->current_file_ok) - return UNZ_END_OF_LIST_OF_FILE; - - /* Save the current state */ - num_fileSaved = s->num_file; - pos_in_central_dirSaved = s->pos_in_central_dir; - cur_file_infoSaved = s->cur_file_info; - cur_file_info_internalSaved = s->cur_file_info_internal; - - err = unzGoToFirstFile(file); - - while (err == UNZ_OK) - { - char szCurrentFileName[UNZ_MAXFILENAMEINZIP+1]; - err = unzGetCurrentFileInfo(file,NULL, - szCurrentFileName,sizeof(szCurrentFileName)-1, - NULL,0,NULL,0); - if (err == UNZ_OK) - { - if (unzStringFileNameCompare(szCurrentFileName, - szFileName,iCaseSensitivity)==0) - return UNZ_OK; - err = unzGoToNextFile(file); - } - } - - /* We failed, so restore the state of the 'current file' to where we - * were. - */ - s->num_file = num_fileSaved ; - s->pos_in_central_dir = pos_in_central_dirSaved ; - s->cur_file_info = cur_file_infoSaved; - s->cur_file_info_internal = cur_file_info_internalSaved; - return err; -} - - -/* -/////////////////////////////////////////// -// Contributed by Ryan Haksi (mailto://cryogen@infoserve.net) -// I need random access -// -// Further optimization could be realized by adding an ability -// to cache the directory in memory. The goal being a single -// comprehensive file read to put the file I need in a memory. -*/ - -/* -typedef struct unz_file_pos_s -{ - uLong pos_in_zip_directory; // offset in file - uLong num_of_file; // # of file -} unz_file_pos; -*/ - -extern int ZEXPORT unzGetFilePos(file, file_pos) - unzFile file; - unz_file_pos* file_pos; -{ - unz_s* s; - - if (file==NULL || file_pos==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - if (!s->current_file_ok) - return UNZ_END_OF_LIST_OF_FILE; - - file_pos->pos_in_zip_directory = s->pos_in_central_dir; - file_pos->num_of_file = s->num_file; - - return UNZ_OK; -} - -extern int ZEXPORT unzGoToFilePos(file, file_pos) - unzFile file; - unz_file_pos* file_pos; -{ - unz_s* s; - int err; - - if (file==NULL || file_pos==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - - /* jump to the right spot */ - s->pos_in_central_dir = file_pos->pos_in_zip_directory; - s->num_file = file_pos->num_of_file; - - /* set the current file */ - err = unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info, - &s->cur_file_info_internal, - NULL,0,NULL,0,NULL,0); - /* return results */ - s->current_file_ok = (err == UNZ_OK); - return err; -} - -/* -// Unzip Helper Functions - should be here? -/////////////////////////////////////////// -*/ - -/* - Read the local header of the current zipfile - Check the coherency of the local header and info in the end of central - directory about this file - store in *piSizeVar the size of extra info in local header - (filename and size of extra field data) -*/ -local int unzlocal_CheckCurrentFileCoherencyHeader (s,piSizeVar, - poffset_local_extrafield, - psize_local_extrafield) - unz_s* s; - uInt* piSizeVar; - uLong *poffset_local_extrafield; - uInt *psize_local_extrafield; -{ - uLong uMagic,uData,uFlags; - uLong size_filename; - uLong size_extra_field; - int err=UNZ_OK; - - *piSizeVar = 0; - *poffset_local_extrafield = 0; - *psize_local_extrafield = 0; - - if (ZSEEK(s->z_filefunc, s->filestream,s->cur_file_info_internal.offset_curfile + - s->byte_before_the_zipfile,ZLIB_FILEFUNC_SEEK_SET)!=0) - return UNZ_ERRNO; - - - if (err==UNZ_OK) { - if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uMagic) != UNZ_OK) - err=UNZ_ERRNO; - else if (uMagic!=0x04034b50) - err=UNZ_BADZIPFILE; - } - - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) - err=UNZ_ERRNO; -/* - else if ((err==UNZ_OK) && (uData!=s->cur_file_info.wVersion)) - err=UNZ_BADZIPFILE; -*/ - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&uFlags) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) - err=UNZ_ERRNO; - else if ((err==UNZ_OK) && (uData!=s->cur_file_info.compression_method)) - err=UNZ_BADZIPFILE; - - if ((err==UNZ_OK) && (s->cur_file_info.compression_method!=0) && - (s->cur_file_info.compression_method!=Z_DEFLATED)) - err=UNZ_BADZIPFILE; - - if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* date/time */ - err=UNZ_ERRNO; - - if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* crc */ - err=UNZ_ERRNO; - else if ((err==UNZ_OK) && (uData!=s->cur_file_info.crc) && - ((uFlags & 8)==0)) - err=UNZ_BADZIPFILE; - - if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* size compr */ - err=UNZ_ERRNO; - else if ((err==UNZ_OK) && (uData!=s->cur_file_info.compressed_size) && - ((uFlags & 8)==0)) - err=UNZ_BADZIPFILE; - - if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* size uncompr */ - err=UNZ_ERRNO; - else if ((err==UNZ_OK) && (uData!=s->cur_file_info.uncompressed_size) && - ((uFlags & 8)==0)) - err=UNZ_BADZIPFILE; - - - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&size_filename) != UNZ_OK) - err=UNZ_ERRNO; - else if ((err==UNZ_OK) && (size_filename!=s->cur_file_info.size_filename)) - err=UNZ_BADZIPFILE; - - *piSizeVar += (uInt)size_filename; - - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&size_extra_field) != UNZ_OK) - err=UNZ_ERRNO; - *poffset_local_extrafield= s->cur_file_info_internal.offset_curfile + - SIZEZIPLOCALHEADER + size_filename; - *psize_local_extrafield = (uInt)size_extra_field; - - *piSizeVar += (uInt)size_extra_field; - - return err; -} - -/* - Open for reading data the current file in the zipfile. - If there is no error and the file is opened, the return value is UNZ_OK. -*/ -extern int ZEXPORT unzOpenCurrentFile3 (file, method, level, raw, password) - unzFile file; - int* method; - int* level; - int raw; - const char* password; -{ - int err=UNZ_OK; - uInt iSizeVar; - unz_s* s; - file_in_zip_read_info_s* pfile_in_zip_read_info; - uLong offset_local_extrafield; /* offset of the local extra field */ - uInt size_local_extrafield; /* size of the local extra field */ -# ifndef NOUNCRYPT - char source[12]; -# else - if (password != NULL) - return UNZ_PARAMERROR; -# endif - - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - if (!s->current_file_ok) - return UNZ_PARAMERROR; - - if (s->pfile_in_zip_read != NULL) - unzCloseCurrentFile(file); - - if (unzlocal_CheckCurrentFileCoherencyHeader(s,&iSizeVar, - &offset_local_extrafield,&size_local_extrafield)!=UNZ_OK) - return UNZ_BADZIPFILE; - - pfile_in_zip_read_info = (file_in_zip_read_info_s*) - ALLOC(sizeof(file_in_zip_read_info_s)); - if (pfile_in_zip_read_info==NULL) - return UNZ_INTERNALERROR; - - pfile_in_zip_read_info->read_buffer=(char*)ALLOC(UNZ_BUFSIZE); - pfile_in_zip_read_info->offset_local_extrafield = offset_local_extrafield; - pfile_in_zip_read_info->size_local_extrafield = size_local_extrafield; - pfile_in_zip_read_info->pos_local_extrafield=0; - pfile_in_zip_read_info->raw=raw; - - if (pfile_in_zip_read_info->read_buffer==NULL) - { - TRYFREE(pfile_in_zip_read_info); - return UNZ_INTERNALERROR; - } - - pfile_in_zip_read_info->stream_initialised=0; - - if (method!=NULL) - *method = (int)s->cur_file_info.compression_method; - - if (level!=NULL) - { - *level = 6; - switch (s->cur_file_info.flag & 0x06) - { - case 6 : *level = 1; break; - case 4 : *level = 2; break; - case 2 : *level = 9; break; - } - } - - if ((s->cur_file_info.compression_method!=0) && - (s->cur_file_info.compression_method!=Z_DEFLATED)) - err=UNZ_BADZIPFILE; - - pfile_in_zip_read_info->crc32_wait=s->cur_file_info.crc; - pfile_in_zip_read_info->crc32=0; - pfile_in_zip_read_info->compression_method = - s->cur_file_info.compression_method; - pfile_in_zip_read_info->filestream=s->filestream; - pfile_in_zip_read_info->z_filefunc=s->z_filefunc; - pfile_in_zip_read_info->byte_before_the_zipfile=s->byte_before_the_zipfile; - - pfile_in_zip_read_info->stream.total_out = 0; - - if ((s->cur_file_info.compression_method==Z_DEFLATED) && - (!raw)) - { - pfile_in_zip_read_info->stream.zalloc = (alloc_func)0; - pfile_in_zip_read_info->stream.zfree = (free_func)0; - pfile_in_zip_read_info->stream.opaque = (voidpf)0; - pfile_in_zip_read_info->stream.next_in = (voidpf)0; - pfile_in_zip_read_info->stream.avail_in = 0; - - err=inflateInit2(&pfile_in_zip_read_info->stream, -MAX_WBITS); - if (err == Z_OK) - pfile_in_zip_read_info->stream_initialised=1; - else - { - TRYFREE(pfile_in_zip_read_info); - return err; - } - /* windowBits is passed < 0 to tell that there is no zlib header. - * Note that in this case inflate *requires* an extra "dummy" byte - * after the compressed stream in order to complete decompression and - * return Z_STREAM_END. - * In unzip, i don't wait absolutely Z_STREAM_END because I known the - * size of both compressed and uncompressed data - */ - } - pfile_in_zip_read_info->rest_read_compressed = - s->cur_file_info.compressed_size ; - pfile_in_zip_read_info->rest_read_uncompressed = - s->cur_file_info.uncompressed_size ; - - - pfile_in_zip_read_info->pos_in_zipfile = - s->cur_file_info_internal.offset_curfile + SIZEZIPLOCALHEADER + - iSizeVar; - - pfile_in_zip_read_info->stream.avail_in = (uInt)0; - - s->pfile_in_zip_read = pfile_in_zip_read_info; - -# ifndef NOUNCRYPT - if (password != NULL) - { - int i; - s->pcrc_32_tab = get_crc_table(); - init_keys(password,s->keys,s->pcrc_32_tab); - if (ZSEEK(s->z_filefunc, s->filestream, - s->pfile_in_zip_read->pos_in_zipfile + - s->pfile_in_zip_read->byte_before_the_zipfile, - SEEK_SET)!=0) - return UNZ_INTERNALERROR; - if(ZREAD(s->z_filefunc, s->filestream,source, 12)<12) - return UNZ_INTERNALERROR; - - for (i = 0; i<12; i++) - zdecode(s->keys,s->pcrc_32_tab,source[i]); - - s->pfile_in_zip_read->pos_in_zipfile+=12; - s->encrypted=1; - } -# endif - - - return UNZ_OK; -} - -extern int ZEXPORT unzOpenCurrentFile (file) - unzFile file; -{ - return unzOpenCurrentFile3(file, NULL, NULL, 0, NULL); -} - -extern int ZEXPORT unzOpenCurrentFilePassword (file, password) - unzFile file; - const char* password; -{ - return unzOpenCurrentFile3(file, NULL, NULL, 0, password); -} - -extern int ZEXPORT unzOpenCurrentFile2 (file,method,level,raw) - unzFile file; - int* method; - int* level; - int raw; -{ - return unzOpenCurrentFile3(file, method, level, raw, NULL); -} - -/* - Read bytes from the current file. - buf contain buffer where data must be copied - len the size of buf. - - return the number of byte copied if somes bytes are copied - return 0 if the end of file was reached - return <0 with error code if there is an error - (UNZ_ERRNO for IO error, or zLib error for uncompress error) -*/ -extern int ZEXPORT unzReadCurrentFile (file, buf, len) - unzFile file; - voidp buf; - unsigned len; -{ - int err=UNZ_OK; - uInt iRead = 0; - unz_s* s; - file_in_zip_read_info_s* pfile_in_zip_read_info; - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - pfile_in_zip_read_info=s->pfile_in_zip_read; - - if (pfile_in_zip_read_info==NULL) - return UNZ_PARAMERROR; - - - if (pfile_in_zip_read_info->read_buffer == NULL) - return UNZ_END_OF_LIST_OF_FILE; - if (len==0) - return 0; - - pfile_in_zip_read_info->stream.next_out = (Bytef*)buf; - - pfile_in_zip_read_info->stream.avail_out = (uInt)len; - - if ((len>pfile_in_zip_read_info->rest_read_uncompressed) && - (!(pfile_in_zip_read_info->raw))) - pfile_in_zip_read_info->stream.avail_out = - (uInt)pfile_in_zip_read_info->rest_read_uncompressed; - - if ((len>pfile_in_zip_read_info->rest_read_compressed+ - pfile_in_zip_read_info->stream.avail_in) && - (pfile_in_zip_read_info->raw)) - pfile_in_zip_read_info->stream.avail_out = - (uInt)pfile_in_zip_read_info->rest_read_compressed+ - pfile_in_zip_read_info->stream.avail_in; - - while (pfile_in_zip_read_info->stream.avail_out>0) - { - if ((pfile_in_zip_read_info->stream.avail_in==0) && - (pfile_in_zip_read_info->rest_read_compressed>0)) - { - uInt uReadThis = UNZ_BUFSIZE; - if (pfile_in_zip_read_info->rest_read_compressedrest_read_compressed; - if (uReadThis == 0) - return UNZ_EOF; - if (ZSEEK(pfile_in_zip_read_info->z_filefunc, - pfile_in_zip_read_info->filestream, - pfile_in_zip_read_info->pos_in_zipfile + - pfile_in_zip_read_info->byte_before_the_zipfile, - ZLIB_FILEFUNC_SEEK_SET)!=0) - return UNZ_ERRNO; - if (ZREAD(pfile_in_zip_read_info->z_filefunc, - pfile_in_zip_read_info->filestream, - pfile_in_zip_read_info->read_buffer, - uReadThis)!=uReadThis) - return UNZ_ERRNO; - - -# ifndef NOUNCRYPT - if(s->encrypted) - { - uInt i; - for(i=0;iread_buffer[i] = - zdecode(s->keys,s->pcrc_32_tab, - pfile_in_zip_read_info->read_buffer[i]); - } -# endif - - - pfile_in_zip_read_info->pos_in_zipfile += uReadThis; - - pfile_in_zip_read_info->rest_read_compressed-=uReadThis; - - pfile_in_zip_read_info->stream.next_in = - (Bytef*)pfile_in_zip_read_info->read_buffer; - pfile_in_zip_read_info->stream.avail_in = (uInt)uReadThis; - } - - if ((pfile_in_zip_read_info->compression_method==0) || (pfile_in_zip_read_info->raw)) - { - uInt uDoCopy,i ; - - if ((pfile_in_zip_read_info->stream.avail_in == 0) && - (pfile_in_zip_read_info->rest_read_compressed == 0)) - return (iRead==0) ? UNZ_EOF : iRead; - - if (pfile_in_zip_read_info->stream.avail_out < - pfile_in_zip_read_info->stream.avail_in) - uDoCopy = pfile_in_zip_read_info->stream.avail_out ; - else - uDoCopy = pfile_in_zip_read_info->stream.avail_in ; - - for (i=0;istream.next_out+i) = - *(pfile_in_zip_read_info->stream.next_in+i); - - pfile_in_zip_read_info->crc32 = crc32(pfile_in_zip_read_info->crc32, - pfile_in_zip_read_info->stream.next_out, - uDoCopy); - pfile_in_zip_read_info->rest_read_uncompressed-=uDoCopy; - pfile_in_zip_read_info->stream.avail_in -= uDoCopy; - pfile_in_zip_read_info->stream.avail_out -= uDoCopy; - pfile_in_zip_read_info->stream.next_out += uDoCopy; - pfile_in_zip_read_info->stream.next_in += uDoCopy; - pfile_in_zip_read_info->stream.total_out += uDoCopy; - iRead += uDoCopy; - } - else - { - uLong uTotalOutBefore,uTotalOutAfter; - const Bytef *bufBefore; - uLong uOutThis; - int flush=Z_SYNC_FLUSH; - - uTotalOutBefore = pfile_in_zip_read_info->stream.total_out; - bufBefore = pfile_in_zip_read_info->stream.next_out; - - /* - if ((pfile_in_zip_read_info->rest_read_uncompressed == - pfile_in_zip_read_info->stream.avail_out) && - (pfile_in_zip_read_info->rest_read_compressed == 0)) - flush = Z_FINISH; - */ - err=inflate(&pfile_in_zip_read_info->stream,flush); - - if ((err>=0) && (pfile_in_zip_read_info->stream.msg!=NULL)) - err = Z_DATA_ERROR; - - uTotalOutAfter = pfile_in_zip_read_info->stream.total_out; - uOutThis = uTotalOutAfter-uTotalOutBefore; - - pfile_in_zip_read_info->crc32 = - crc32(pfile_in_zip_read_info->crc32,bufBefore, - (uInt)(uOutThis)); - - pfile_in_zip_read_info->rest_read_uncompressed -= - uOutThis; - - iRead += (uInt)(uTotalOutAfter - uTotalOutBefore); - - if (err==Z_STREAM_END) - return (iRead==0) ? UNZ_EOF : iRead; - if (err!=Z_OK) - break; - } - } - - if (err==Z_OK) - return iRead; - return err; -} - - -/* - Give the current position in uncompressed data -*/ -extern z_off_t ZEXPORT unztell (file) - unzFile file; -{ - unz_s* s; - file_in_zip_read_info_s* pfile_in_zip_read_info; - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - pfile_in_zip_read_info=s->pfile_in_zip_read; - - if (pfile_in_zip_read_info==NULL) - return UNZ_PARAMERROR; - - return (z_off_t)pfile_in_zip_read_info->stream.total_out; -} - - -/* - return 1 if the end of file was reached, 0 elsewhere -*/ -extern int ZEXPORT unzeof (file) - unzFile file; -{ - unz_s* s; - file_in_zip_read_info_s* pfile_in_zip_read_info; - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - pfile_in_zip_read_info=s->pfile_in_zip_read; - - if (pfile_in_zip_read_info==NULL) - return UNZ_PARAMERROR; - - if (pfile_in_zip_read_info->rest_read_uncompressed == 0) - return 1; - else - return 0; -} - - - -/* - Read extra field from the current file (opened by unzOpenCurrentFile) - This is the local-header version of the extra field (sometimes, there is - more info in the local-header version than in the central-header) - - if buf==NULL, it return the size of the local extra field that can be read - - if buf!=NULL, len is the size of the buffer, the extra header is copied in - buf. - the return value is the number of bytes copied in buf, or (if <0) - the error code -*/ -extern int ZEXPORT unzGetLocalExtrafield (file,buf,len) - unzFile file; - voidp buf; - unsigned len; -{ - unz_s* s; - file_in_zip_read_info_s* pfile_in_zip_read_info; - uInt read_now; - uLong size_to_read; - - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - pfile_in_zip_read_info=s->pfile_in_zip_read; - - if (pfile_in_zip_read_info==NULL) - return UNZ_PARAMERROR; - - size_to_read = (pfile_in_zip_read_info->size_local_extrafield - - pfile_in_zip_read_info->pos_local_extrafield); - - if (buf==NULL) - return (int)size_to_read; - - if (len>size_to_read) - read_now = (uInt)size_to_read; - else - read_now = (uInt)len ; - - if (read_now==0) - return 0; - - if (ZSEEK(pfile_in_zip_read_info->z_filefunc, - pfile_in_zip_read_info->filestream, - pfile_in_zip_read_info->offset_local_extrafield + - pfile_in_zip_read_info->pos_local_extrafield, - ZLIB_FILEFUNC_SEEK_SET)!=0) - return UNZ_ERRNO; - - if (ZREAD(pfile_in_zip_read_info->z_filefunc, - pfile_in_zip_read_info->filestream, - buf,read_now)!=read_now) - return UNZ_ERRNO; - - return (int)read_now; -} - -/* - Close the file in zip opened with unzipOpenCurrentFile - Return UNZ_CRCERROR if all the file was read but the CRC is not good -*/ -extern int ZEXPORT unzCloseCurrentFile (file) - unzFile file; -{ - int err=UNZ_OK; - - unz_s* s; - file_in_zip_read_info_s* pfile_in_zip_read_info; - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - pfile_in_zip_read_info=s->pfile_in_zip_read; - - if (pfile_in_zip_read_info==NULL) - return UNZ_PARAMERROR; - - - if ((pfile_in_zip_read_info->rest_read_uncompressed == 0) && - (!pfile_in_zip_read_info->raw)) - { - if (pfile_in_zip_read_info->crc32 != pfile_in_zip_read_info->crc32_wait) - err=UNZ_CRCERROR; - } - - - TRYFREE(pfile_in_zip_read_info->read_buffer); - pfile_in_zip_read_info->read_buffer = NULL; - if (pfile_in_zip_read_info->stream_initialised) - inflateEnd(&pfile_in_zip_read_info->stream); - - pfile_in_zip_read_info->stream_initialised = 0; - TRYFREE(pfile_in_zip_read_info); - - s->pfile_in_zip_read=NULL; - - return err; -} - - -/* - Get the global comment string of the ZipFile, in the szComment buffer. - uSizeBuf is the size of the szComment buffer. - return the number of byte copied or an error code <0 -*/ -extern int ZEXPORT unzGetGlobalComment (file, szComment, uSizeBuf) - unzFile file; - char *szComment; - uLong uSizeBuf; -{ - unz_s* s; - uLong uReadThis ; - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - - uReadThis = uSizeBuf; - if (uReadThis>s->gi.size_comment) - uReadThis = s->gi.size_comment; - - if (ZSEEK(s->z_filefunc,s->filestream,s->central_pos+22,ZLIB_FILEFUNC_SEEK_SET)!=0) - return UNZ_ERRNO; - - if (uReadThis>0) - { - *szComment='\0'; - if (ZREAD(s->z_filefunc,s->filestream,szComment,uReadThis)!=uReadThis) - return UNZ_ERRNO; - } - - if ((szComment != NULL) && (uSizeBuf > s->gi.size_comment)) - *(szComment+s->gi.size_comment)='\0'; - return (int)uReadThis; -} - -/* Additions by RX '2004 */ -extern uLong ZEXPORT unzGetOffset (file) - unzFile file; -{ - unz_s* s; - - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - if (!s->current_file_ok) - return 0; - if (s->gi.number_entry != 0 && s->gi.number_entry != 0xffff) - if (s->num_file==s->gi.number_entry) - return 0; - return s->pos_in_central_dir; -} - -extern int ZEXPORT unzSetOffset (file, pos) - unzFile file; - uLong pos; -{ - unz_s* s; - int err; - - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - - s->pos_in_central_dir = pos; - s->num_file = s->gi.number_entry; /* hack */ - err = unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info, - &s->cur_file_info_internal, - NULL,0,NULL,0,NULL,0); - s->current_file_ok = (err == UNZ_OK); - return err; -} +/* unzip.c -- IO for uncompress .zip files using zlib + Version 1.01e, February 12th, 2005 + + Copyright (C) 1998-2005 Gilles Vollant + + Read unzip.h for more info + + Modified by Sergey A. Tachenov to integrate with Qt. +*/ + +/* Decryption code comes from crypt.c by Info-ZIP but has been greatly reduced in terms of +compatibility with older software. The following is from the original crypt.c. Code +woven in by Terry Thorsen 1/2003. +*/ +/* + Copyright (c) 1990-2000 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/* + crypt.c (full version) by Info-ZIP. Last revised: [see crypt.h] + + The encryption/decryption parts of this source code (as opposed to the + non-echoing password parts) were originally written in Europe. The + whole source package can be freely distributed, including from the USA. + (Prior to January 2000, re-export from the US was a violation of US law.) + */ + +/* + This encryption code is a direct transcription of the algorithm from + Roger Schlafly, described by Phil Katz in the file appnote.txt. This + file (appnote.txt) is distributed with the PKZIP program (even in the + version without encryption capabilities). + */ + + +#include +#include +#include +#include "zlib.h" +#include "unzip.h" + +#ifdef STDC +# include +# include +# include +#endif +#ifdef NO_ERRNO_H + extern int errno; +#else +# include +#endif + + +#ifndef local +# define local static +#endif +/* compile with -Dlocal if your debugger can't find static symbols */ + + +#ifndef CASESENSITIVITYDEFAULT_NO +# if !defined(unix) && !defined(CASESENSITIVITYDEFAULT_YES) +# define CASESENSITIVITYDEFAULT_NO +# endif +#endif + + +#ifndef UNZ_BUFSIZE +#define UNZ_BUFSIZE (16384) +#endif + +#ifndef UNZ_MAXFILENAMEINZIP +#define UNZ_MAXFILENAMEINZIP (256) +#endif + +#ifndef ALLOC +# define ALLOC(size) (malloc(size)) +#endif +#ifndef TRYFREE +# define TRYFREE(p) {if (p) free(p);} +#endif + +#define SIZECENTRALDIRITEM (0x2e) +#define SIZEZIPLOCALHEADER (0x1e) + + + + +const char unz_copyright[] = + " unzip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll"; + +/* unz_file_info_interntal contain internal info about a file in zipfile*/ +typedef struct unz_file_info_internal_s +{ + uLong offset_curfile;/* relative offset of local header 4 bytes */ +} unz_file_info_internal; + + +/* file_in_zip_read_info_s contain internal information about a file in zipfile, + when reading and decompress it */ +typedef struct +{ + char *read_buffer; /* internal buffer for compressed data */ + z_stream stream; /* zLib stream structure for inflate */ + + uLong pos_in_zipfile; /* position in byte on the zipfile, for fseek*/ + uLong stream_initialised; /* flag set if stream structure is initialised*/ + + uLong offset_local_extrafield;/* offset of the local extra field */ + uInt size_local_extrafield;/* size of the local extra field */ + uLong pos_local_extrafield; /* position in the local extra field in read*/ + + uLong crc32; /* crc32 of all data uncompressed */ + uLong crc32_wait; /* crc32 we must obtain after decompress all */ + uLong rest_read_compressed; /* number of byte to be decompressed */ + uLong rest_read_uncompressed;/*number of byte to be obtained after decomp*/ + zlib_filefunc_def z_filefunc; + voidpf filestream; /* io structore of the zipfile */ + uLong compression_method; /* compression method (0==store) */ + uLong byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ + int raw; +} file_in_zip_read_info_s; + + +/* unz_s contain internal information about the zipfile +*/ +typedef struct +{ + zlib_filefunc_def z_filefunc; + voidpf filestream; /* io structore of the zipfile */ + unz_global_info gi; /* public global information */ + uLong byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ + uLong num_file; /* number of the current file in the zipfile*/ + uLong pos_in_central_dir; /* pos of the current file in the central dir*/ + uLong current_file_ok; /* flag about the usability of the current file*/ + uLong central_pos; /* position of the beginning of the central dir*/ + + uLong size_central_dir; /* size of the central directory */ + uLong offset_central_dir; /* offset of start of central directory with + respect to the starting disk number */ + + unz_file_info cur_file_info; /* public info about the current file in zip*/ + unz_file_info_internal cur_file_info_internal; /* private info about it*/ + file_in_zip_read_info_s* pfile_in_zip_read; /* structure about the current + file if we are decompressing it */ + int encrypted; +# ifndef NOUNCRYPT + unsigned long keys[3]; /* keys defining the pseudo-random sequence */ + const unsigned long* pcrc_32_tab; +# endif +} unz_s; + + +#ifndef NOUNCRYPT +#include "crypt.h" +#endif + +/* =========================================================================== + Read a byte from a gz_stream; update next_in and avail_in. Return EOF + for end of file. + IN assertion: the stream s has been sucessfully opened for reading. +*/ + + +local int unzlocal_getByte OF(( + const zlib_filefunc_def* pzlib_filefunc_def, + voidpf filestream, + int *pi)); + +local int unzlocal_getByte(pzlib_filefunc_def,filestream,pi) + const zlib_filefunc_def* pzlib_filefunc_def; + voidpf filestream; + int *pi; +{ + unsigned char c; + int err = (int)ZREAD(*pzlib_filefunc_def,filestream,&c,1); + if (err==1) + { + *pi = (int)c; + return UNZ_OK; + } + else + { + if (ZERROR(*pzlib_filefunc_def,filestream)) + return UNZ_ERRNO; + else + return UNZ_EOF; + } +} + + +/* =========================================================================== + Reads a long in LSB order from the given gz_stream. Sets +*/ +local int unzlocal_getShort OF(( + const zlib_filefunc_def* pzlib_filefunc_def, + voidpf filestream, + uLong *pX)); + +local int unzlocal_getShort (pzlib_filefunc_def,filestream,pX) + const zlib_filefunc_def* pzlib_filefunc_def; + voidpf filestream; + uLong *pX; +{ + uLong x ; + int i; + int err; + + err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i); + x = (uLong)i; + + if (err==UNZ_OK) + err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i); + x += ((uLong)i)<<8; + + if (err==UNZ_OK) + *pX = x; + else + *pX = 0; + return err; +} + +local int unzlocal_getLong OF(( + const zlib_filefunc_def* pzlib_filefunc_def, + voidpf filestream, + uLong *pX)); + +local int unzlocal_getLong (pzlib_filefunc_def,filestream,pX) + const zlib_filefunc_def* pzlib_filefunc_def; + voidpf filestream; + uLong *pX; +{ + uLong x ; + int i; + int err; + + err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i); + x = (uLong)i; + + if (err==UNZ_OK) + err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i); + x += ((uLong)i)<<8; + + if (err==UNZ_OK) + err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i); + x += ((uLong)i)<<16; + + if (err==UNZ_OK) + err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i); + x += ((uLong)i)<<24; + + if (err==UNZ_OK) + *pX = x; + else + *pX = 0; + return err; +} + + +/* My own strcmpi / strcasecmp */ +local int strcmpcasenosensitive_internal (fileName1,fileName2) + const char* fileName1; + const char* fileName2; +{ + for (;;) + { + char c1=*(fileName1++); + char c2=*(fileName2++); + if ((c1>='a') && (c1<='z')) + c1 -= 0x20; + if ((c2>='a') && (c2<='z')) + c2 -= 0x20; + if (c1=='\0') + return ((c2=='\0') ? 0 : -1); + if (c2=='\0') + return 1; + if (c1c2) + return 1; + } +} + + +#ifdef CASESENSITIVITYDEFAULT_NO +#define CASESENSITIVITYDEFAULTVALUE 2 +#else +#define CASESENSITIVITYDEFAULTVALUE 1 +#endif + +#ifndef STRCMPCASENOSENTIVEFUNCTION +#define STRCMPCASENOSENTIVEFUNCTION strcmpcasenosensitive_internal +#endif + +/* + Compare two filename (fileName1,fileName2). + If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp) + If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi + or strcasecmp) + If iCaseSenisivity = 0, case sensitivity is defaut of your operating system + (like 1 on Unix, 2 on Windows) + +*/ +extern int ZEXPORT unzStringFileNameCompare (fileName1,fileName2,iCaseSensitivity) + const char* fileName1; + const char* fileName2; + int iCaseSensitivity; +{ + if (iCaseSensitivity==0) + iCaseSensitivity=CASESENSITIVITYDEFAULTVALUE; + + if (iCaseSensitivity==1) + return strcmp(fileName1,fileName2); + + return STRCMPCASENOSENTIVEFUNCTION(fileName1,fileName2); +} + +#ifndef BUFREADCOMMENT +#define BUFREADCOMMENT (0x400) +#endif + +/* + Locate the Central directory of a zipfile (at the end, just before + the global comment) +*/ +local uLong unzlocal_SearchCentralDir OF(( + const zlib_filefunc_def* pzlib_filefunc_def, + voidpf filestream)); + +local uLong unzlocal_SearchCentralDir(pzlib_filefunc_def,filestream) + const zlib_filefunc_def* pzlib_filefunc_def; + voidpf filestream; +{ + unsigned char* buf; + uLong uSizeFile; + uLong uBackRead; + uLong uMaxBack=0xffff; /* maximum size of global comment */ + uLong uPosFound=0; + + if (ZSEEK(*pzlib_filefunc_def,filestream,0,ZLIB_FILEFUNC_SEEK_END) != 0) + return 0; + + + uSizeFile = ZTELL(*pzlib_filefunc_def,filestream); + + if (uMaxBack>uSizeFile) + uMaxBack = uSizeFile; + + buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4); + if (buf==NULL) + return 0; + + uBackRead = 4; + while (uBackReaduMaxBack) + uBackRead = uMaxBack; + else + uBackRead+=BUFREADCOMMENT; + uReadPos = uSizeFile-uBackRead ; + + uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ? + (BUFREADCOMMENT+4) : (uSizeFile-uReadPos); + if (ZSEEK(*pzlib_filefunc_def,filestream,uReadPos,ZLIB_FILEFUNC_SEEK_SET)!=0) + break; + + if (ZREAD(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize) + break; + + for (i=(int)uReadSize-3; (i--)>0;) + if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && + ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06)) + { + uPosFound = uReadPos+i; + break; + } + + if (uPosFound!=0) + break; + } + TRYFREE(buf); + return uPosFound; +} + +/* + Open a Zip file. path contain the full pathname (by example, + on a Windows NT computer "c:\\test\\zlib114.zip" or on an Unix computer + "zlib/zlib114.zip". + If the zipfile cannot be opened (file doesn't exist or in not valid), the + return value is NULL. + Else, the return value is a unzFile Handle, usable with other function + of this unzip package. +*/ +extern unzFile ZEXPORT unzOpen2 (file, pzlib_filefunc_def) + voidpf file; + zlib_filefunc_def* pzlib_filefunc_def; +{ + unz_s us; + unz_s *s; + uLong central_pos,uL; + + uLong number_disk; /* number of the current dist, used for + spaning ZIP, unsupported, always 0*/ + uLong number_disk_with_CD; /* number the the disk with central dir, used + for spaning ZIP, unsupported, always 0*/ + uLong number_entry_CD; /* total number of entries in + the central dir + (same than number_entry on nospan) */ + + int err=UNZ_OK; + + if (unz_copyright[0]!=' ') + return NULL; + + if (pzlib_filefunc_def==NULL) + fill_qiodevice_filefunc(&us.z_filefunc); + else + us.z_filefunc = *pzlib_filefunc_def; + + us.filestream= (*(us.z_filefunc.zopen_file))(us.z_filefunc.opaque, + file, + ZLIB_FILEFUNC_MODE_READ | + ZLIB_FILEFUNC_MODE_EXISTING); + if (us.filestream==NULL) + return NULL; + + central_pos = unzlocal_SearchCentralDir(&us.z_filefunc,us.filestream); + if (central_pos==0) + err=UNZ_ERRNO; + + if (ZSEEK(us.z_filefunc, us.filestream, + central_pos,ZLIB_FILEFUNC_SEEK_SET)!=0) + err=UNZ_ERRNO; + + /* the signature, already checked */ + if (unzlocal_getLong(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK) + err=UNZ_ERRNO; + + /* number of this disk */ + if (unzlocal_getShort(&us.z_filefunc, us.filestream,&number_disk)!=UNZ_OK) + err=UNZ_ERRNO; + + /* number of the disk with the start of the central directory */ + if (unzlocal_getShort(&us.z_filefunc, us.filestream,&number_disk_with_CD)!=UNZ_OK) + err=UNZ_ERRNO; + + /* total number of entries in the central dir on this disk */ + if (unzlocal_getShort(&us.z_filefunc, us.filestream,&us.gi.number_entry)!=UNZ_OK) + err=UNZ_ERRNO; + + /* total number of entries in the central dir */ + if (unzlocal_getShort(&us.z_filefunc, us.filestream,&number_entry_CD)!=UNZ_OK) + err=UNZ_ERRNO; + + if ((number_entry_CD!=us.gi.number_entry) || + (number_disk_with_CD!=0) || + (number_disk!=0)) + err=UNZ_BADZIPFILE; + + /* size of the central directory */ + if (unzlocal_getLong(&us.z_filefunc, us.filestream,&us.size_central_dir)!=UNZ_OK) + err=UNZ_ERRNO; + + /* offset of start of central directory with respect to the + starting disk number */ + if (unzlocal_getLong(&us.z_filefunc, us.filestream,&us.offset_central_dir)!=UNZ_OK) + err=UNZ_ERRNO; + + /* zipfile comment length */ + if (unzlocal_getShort(&us.z_filefunc, us.filestream,&us.gi.size_comment)!=UNZ_OK) + err=UNZ_ERRNO; + + if ((central_pospfile_in_zip_read!=NULL) + unzCloseCurrentFile(file); + + ZCLOSE(s->z_filefunc, s->filestream); + TRYFREE(s); + return UNZ_OK; +} + + +/* + Write info about the ZipFile in the *pglobal_info structure. + No preparation of the structure is needed + return UNZ_OK if there is no problem. */ +extern int ZEXPORT unzGetGlobalInfo (file,pglobal_info) + unzFile file; + unz_global_info *pglobal_info; +{ + unz_s* s; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + *pglobal_info=s->gi; + return UNZ_OK; +} + + +/* + Translate date/time from Dos format to tm_unz (readable more easilty) +*/ +local void unzlocal_DosDateToTmuDate (ulDosDate, ptm) + uLong ulDosDate; + tm_unz* ptm; +{ + uLong uDate; + uDate = (uLong)(ulDosDate>>16); + ptm->tm_mday = (uInt)(uDate&0x1f) ; + ptm->tm_mon = (uInt)((((uDate)&0x1E0)/0x20)-1) ; + ptm->tm_year = (uInt)(((uDate&0x0FE00)/0x0200)+1980) ; + + ptm->tm_hour = (uInt) ((ulDosDate &0xF800)/0x800); + ptm->tm_min = (uInt) ((ulDosDate&0x7E0)/0x20) ; + ptm->tm_sec = (uInt) (2*(ulDosDate&0x1f)) ; +} + +/* + Get Info about the current file in the zipfile, with internal only info +*/ +local int unzlocal_GetCurrentFileInfoInternal OF((unzFile file, + unz_file_info *pfile_info, + unz_file_info_internal + *pfile_info_internal, + char *szFileName, + uLong fileNameBufferSize, + void *extraField, + uLong extraFieldBufferSize, + char *szComment, + uLong commentBufferSize)); + +local int unzlocal_GetCurrentFileInfoInternal (file, + pfile_info, + pfile_info_internal, + szFileName, fileNameBufferSize, + extraField, extraFieldBufferSize, + szComment, commentBufferSize) + unzFile file; + unz_file_info *pfile_info; + unz_file_info_internal *pfile_info_internal; + char *szFileName; + uLong fileNameBufferSize; + void *extraField; + uLong extraFieldBufferSize; + char *szComment; + uLong commentBufferSize; +{ + unz_s* s; + unz_file_info file_info; + unz_file_info_internal file_info_internal; + int err=UNZ_OK; + uLong uMagic; + uLong uSeek=0; + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + if (ZSEEK(s->z_filefunc, s->filestream, + s->pos_in_central_dir+s->byte_before_the_zipfile, + ZLIB_FILEFUNC_SEEK_SET)!=0) + err=UNZ_ERRNO; + + + /* we check the magic */ + if (err==UNZ_OK) { + if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uMagic) != UNZ_OK) + err=UNZ_ERRNO; + else if (uMagic!=0x02014b50) + err=UNZ_BADZIPFILE; + } + + if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.version) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.version_needed) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.flag) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.compression_method) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info.dosDate) != UNZ_OK) + err=UNZ_ERRNO; + + unzlocal_DosDateToTmuDate(file_info.dosDate,&file_info.tmu_date); + + if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info.crc) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info.compressed_size) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info.uncompressed_size) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.size_filename) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.size_file_extra) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.size_file_comment) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.disk_num_start) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.internal_fa) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info.external_fa) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info_internal.offset_curfile) != UNZ_OK) + err=UNZ_ERRNO; + + uSeek+=file_info.size_filename; + if ((err==UNZ_OK) && (szFileName!=NULL)) + { + uLong uSizeRead ; + if (file_info.size_filename0) && (fileNameBufferSize>0)) + if (ZREAD(s->z_filefunc, s->filestream,szFileName,uSizeRead)!=uSizeRead) + err=UNZ_ERRNO; + uSeek -= uSizeRead; + } + + + if ((err==UNZ_OK) && (extraField!=NULL)) + { + uLong uSizeRead ; + if (file_info.size_file_extraz_filefunc, s->filestream,uSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) + uSeek=0; + else + err=UNZ_ERRNO; + } + if ((file_info.size_file_extra>0) && (extraFieldBufferSize>0)) + if (ZREAD(s->z_filefunc, s->filestream,extraField,uSizeRead)!=uSizeRead) + err=UNZ_ERRNO; + uSeek += file_info.size_file_extra - uSizeRead; + } + else + uSeek+=file_info.size_file_extra; + + + if ((err==UNZ_OK) && (szComment!=NULL)) + { + uLong uSizeRead ; + if (file_info.size_file_commentz_filefunc, s->filestream,uSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) + uSeek=0; + else + err=UNZ_ERRNO; + } + if ((file_info.size_file_comment>0) && (commentBufferSize>0)) + if (ZREAD(s->z_filefunc, s->filestream,szComment,uSizeRead)!=uSizeRead) + err=UNZ_ERRNO; + uSeek+=file_info.size_file_comment - uSizeRead; + } + else + uSeek+=file_info.size_file_comment; + + if ((err==UNZ_OK) && (pfile_info!=NULL)) + *pfile_info=file_info; + + if ((err==UNZ_OK) && (pfile_info_internal!=NULL)) + *pfile_info_internal=file_info_internal; + + return err; +} + + + +/* + Write info about the ZipFile in the *pglobal_info structure. + No preparation of the structure is needed + return UNZ_OK if there is no problem. +*/ +extern int ZEXPORT unzGetCurrentFileInfo (file, + pfile_info, + szFileName, fileNameBufferSize, + extraField, extraFieldBufferSize, + szComment, commentBufferSize) + unzFile file; + unz_file_info *pfile_info; + char *szFileName; + uLong fileNameBufferSize; + void *extraField; + uLong extraFieldBufferSize; + char *szComment; + uLong commentBufferSize; +{ + return unzlocal_GetCurrentFileInfoInternal(file,pfile_info,NULL, + szFileName,fileNameBufferSize, + extraField,extraFieldBufferSize, + szComment,commentBufferSize); +} + +/* + Set the current file of the zipfile to the first file. + return UNZ_OK if there is no problem +*/ +extern int ZEXPORT unzGoToFirstFile (file) + unzFile file; +{ + int err=UNZ_OK; + unz_s* s; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + s->pos_in_central_dir=s->offset_central_dir; + s->num_file=0; + err=unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info, + &s->cur_file_info_internal, + NULL,0,NULL,0,NULL,0); + s->current_file_ok = (err == UNZ_OK); + return err; +} + +/* + Set the current file of the zipfile to the next file. + return UNZ_OK if there is no problem + return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. +*/ +extern int ZEXPORT unzGoToNextFile (file) + unzFile file; +{ + unz_s* s; + int err; + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + if (!s->current_file_ok) + return UNZ_END_OF_LIST_OF_FILE; + if (s->gi.number_entry != 0xffff) /* 2^16 files overflow hack */ + if (s->num_file+1==s->gi.number_entry) + return UNZ_END_OF_LIST_OF_FILE; + + s->pos_in_central_dir += SIZECENTRALDIRITEM + s->cur_file_info.size_filename + + s->cur_file_info.size_file_extra + s->cur_file_info.size_file_comment ; + s->num_file++; + err = unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info, + &s->cur_file_info_internal, + NULL,0,NULL,0,NULL,0); + s->current_file_ok = (err == UNZ_OK); + return err; +} + + +/* + Try locate the file szFileName in the zipfile. + For the iCaseSensitivity signification, see unzipStringFileNameCompare + + return value : + UNZ_OK if the file is found. It becomes the current file. + UNZ_END_OF_LIST_OF_FILE if the file is not found +*/ +extern int ZEXPORT unzLocateFile (file, szFileName, iCaseSensitivity) + unzFile file; + const char *szFileName; + int iCaseSensitivity; +{ + unz_s* s; + int err; + + /* We remember the 'current' position in the file so that we can jump + * back there if we fail. + */ + unz_file_info cur_file_infoSaved; + unz_file_info_internal cur_file_info_internalSaved; + uLong num_fileSaved; + uLong pos_in_central_dirSaved; + + + if (file==NULL) + return UNZ_PARAMERROR; + + if (strlen(szFileName)>=UNZ_MAXFILENAMEINZIP) + return UNZ_PARAMERROR; + + s=(unz_s*)file; + if (!s->current_file_ok) + return UNZ_END_OF_LIST_OF_FILE; + + /* Save the current state */ + num_fileSaved = s->num_file; + pos_in_central_dirSaved = s->pos_in_central_dir; + cur_file_infoSaved = s->cur_file_info; + cur_file_info_internalSaved = s->cur_file_info_internal; + + err = unzGoToFirstFile(file); + + while (err == UNZ_OK) + { + char szCurrentFileName[UNZ_MAXFILENAMEINZIP+1]; + err = unzGetCurrentFileInfo(file,NULL, + szCurrentFileName,sizeof(szCurrentFileName)-1, + NULL,0,NULL,0); + if (err == UNZ_OK) + { + if (unzStringFileNameCompare(szCurrentFileName, + szFileName,iCaseSensitivity)==0) + return UNZ_OK; + err = unzGoToNextFile(file); + } + } + + /* We failed, so restore the state of the 'current file' to where we + * were. + */ + s->num_file = num_fileSaved ; + s->pos_in_central_dir = pos_in_central_dirSaved ; + s->cur_file_info = cur_file_infoSaved; + s->cur_file_info_internal = cur_file_info_internalSaved; + return err; +} + + +/* +/////////////////////////////////////////// +// Contributed by Ryan Haksi (mailto://cryogen@infoserve.net) +// I need random access +// +// Further optimization could be realized by adding an ability +// to cache the directory in memory. The goal being a single +// comprehensive file read to put the file I need in a memory. +*/ + +/* +typedef struct unz_file_pos_s +{ + uLong pos_in_zip_directory; // offset in file + uLong num_of_file; // # of file +} unz_file_pos; +*/ + +extern int ZEXPORT unzGetFilePos(file, file_pos) + unzFile file; + unz_file_pos* file_pos; +{ + unz_s* s; + + if (file==NULL || file_pos==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + if (!s->current_file_ok) + return UNZ_END_OF_LIST_OF_FILE; + + file_pos->pos_in_zip_directory = s->pos_in_central_dir; + file_pos->num_of_file = s->num_file; + + return UNZ_OK; +} + +extern int ZEXPORT unzGoToFilePos(file, file_pos) + unzFile file; + unz_file_pos* file_pos; +{ + unz_s* s; + int err; + + if (file==NULL || file_pos==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + + /* jump to the right spot */ + s->pos_in_central_dir = file_pos->pos_in_zip_directory; + s->num_file = file_pos->num_of_file; + + /* set the current file */ + err = unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info, + &s->cur_file_info_internal, + NULL,0,NULL,0,NULL,0); + /* return results */ + s->current_file_ok = (err == UNZ_OK); + return err; +} + +/* +// Unzip Helper Functions - should be here? +/////////////////////////////////////////// +*/ + +/* + Read the local header of the current zipfile + Check the coherency of the local header and info in the end of central + directory about this file + store in *piSizeVar the size of extra info in local header + (filename and size of extra field data) +*/ +local int unzlocal_CheckCurrentFileCoherencyHeader (s,piSizeVar, + poffset_local_extrafield, + psize_local_extrafield) + unz_s* s; + uInt* piSizeVar; + uLong *poffset_local_extrafield; + uInt *psize_local_extrafield; +{ + uLong uMagic,uData,uFlags; + uLong size_filename; + uLong size_extra_field; + int err=UNZ_OK; + + *piSizeVar = 0; + *poffset_local_extrafield = 0; + *psize_local_extrafield = 0; + + if (ZSEEK(s->z_filefunc, s->filestream,s->cur_file_info_internal.offset_curfile + + s->byte_before_the_zipfile,ZLIB_FILEFUNC_SEEK_SET)!=0) + return UNZ_ERRNO; + + + if (err==UNZ_OK) { + if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uMagic) != UNZ_OK) + err=UNZ_ERRNO; + else if (uMagic!=0x04034b50) + err=UNZ_BADZIPFILE; + } + + if (unzlocal_getShort(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) + err=UNZ_ERRNO; +/* + else if ((err==UNZ_OK) && (uData!=s->cur_file_info.wVersion)) + err=UNZ_BADZIPFILE; +*/ + if (unzlocal_getShort(&s->z_filefunc, s->filestream,&uFlags) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) + err=UNZ_ERRNO; + else if ((err==UNZ_OK) && (uData!=s->cur_file_info.compression_method)) + err=UNZ_BADZIPFILE; + + if ((err==UNZ_OK) && (s->cur_file_info.compression_method!=0) && + (s->cur_file_info.compression_method!=Z_DEFLATED)) + err=UNZ_BADZIPFILE; + + if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* date/time */ + err=UNZ_ERRNO; + + if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* crc */ + err=UNZ_ERRNO; + else if ((err==UNZ_OK) && (uData!=s->cur_file_info.crc) && + ((uFlags & 8)==0)) + err=UNZ_BADZIPFILE; + + if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* size compr */ + err=UNZ_ERRNO; + else if ((err==UNZ_OK) && (uData!=s->cur_file_info.compressed_size) && + ((uFlags & 8)==0)) + err=UNZ_BADZIPFILE; + + if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* size uncompr */ + err=UNZ_ERRNO; + else if ((err==UNZ_OK) && (uData!=s->cur_file_info.uncompressed_size) && + ((uFlags & 8)==0)) + err=UNZ_BADZIPFILE; + + + if (unzlocal_getShort(&s->z_filefunc, s->filestream,&size_filename) != UNZ_OK) + err=UNZ_ERRNO; + else if ((err==UNZ_OK) && (size_filename!=s->cur_file_info.size_filename)) + err=UNZ_BADZIPFILE; + + *piSizeVar += (uInt)size_filename; + + if (unzlocal_getShort(&s->z_filefunc, s->filestream,&size_extra_field) != UNZ_OK) + err=UNZ_ERRNO; + *poffset_local_extrafield= s->cur_file_info_internal.offset_curfile + + SIZEZIPLOCALHEADER + size_filename; + *psize_local_extrafield = (uInt)size_extra_field; + + *piSizeVar += (uInt)size_extra_field; + + return err; +} + +/* + Open for reading data the current file in the zipfile. + If there is no error and the file is opened, the return value is UNZ_OK. +*/ +extern int ZEXPORT unzOpenCurrentFile3 (file, method, level, raw, password) + unzFile file; + int* method; + int* level; + int raw; + const char* password; +{ + int err=UNZ_OK; + uInt iSizeVar; + unz_s* s; + file_in_zip_read_info_s* pfile_in_zip_read_info; + uLong offset_local_extrafield; /* offset of the local extra field */ + uInt size_local_extrafield; /* size of the local extra field */ +# ifndef NOUNCRYPT + char source[12]; +# else + if (password != NULL) + return UNZ_PARAMERROR; +# endif + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + if (!s->current_file_ok) + return UNZ_PARAMERROR; + + if (s->pfile_in_zip_read != NULL) + unzCloseCurrentFile(file); + + if (unzlocal_CheckCurrentFileCoherencyHeader(s,&iSizeVar, + &offset_local_extrafield,&size_local_extrafield)!=UNZ_OK) + return UNZ_BADZIPFILE; + + pfile_in_zip_read_info = (file_in_zip_read_info_s*) + ALLOC(sizeof(file_in_zip_read_info_s)); + if (pfile_in_zip_read_info==NULL) + return UNZ_INTERNALERROR; + + pfile_in_zip_read_info->read_buffer=(char*)ALLOC(UNZ_BUFSIZE); + pfile_in_zip_read_info->offset_local_extrafield = offset_local_extrafield; + pfile_in_zip_read_info->size_local_extrafield = size_local_extrafield; + pfile_in_zip_read_info->pos_local_extrafield=0; + pfile_in_zip_read_info->raw=raw; + + if (pfile_in_zip_read_info->read_buffer==NULL) + { + TRYFREE(pfile_in_zip_read_info); + return UNZ_INTERNALERROR; + } + + pfile_in_zip_read_info->stream_initialised=0; + + if (method!=NULL) + *method = (int)s->cur_file_info.compression_method; + + if (level!=NULL) + { + *level = 6; + switch (s->cur_file_info.flag & 0x06) + { + case 6 : *level = 1; break; + case 4 : *level = 2; break; + case 2 : *level = 9; break; + } + } + + if ((s->cur_file_info.compression_method!=0) && + (s->cur_file_info.compression_method!=Z_DEFLATED)) + err=UNZ_BADZIPFILE; + + pfile_in_zip_read_info->crc32_wait=s->cur_file_info.crc; + pfile_in_zip_read_info->crc32=0; + pfile_in_zip_read_info->compression_method = + s->cur_file_info.compression_method; + pfile_in_zip_read_info->filestream=s->filestream; + pfile_in_zip_read_info->z_filefunc=s->z_filefunc; + pfile_in_zip_read_info->byte_before_the_zipfile=s->byte_before_the_zipfile; + + pfile_in_zip_read_info->stream.total_out = 0; + + if ((s->cur_file_info.compression_method==Z_DEFLATED) && + (!raw)) + { + pfile_in_zip_read_info->stream.zalloc = (alloc_func)0; + pfile_in_zip_read_info->stream.zfree = (free_func)0; + pfile_in_zip_read_info->stream.opaque = (voidpf)0; + pfile_in_zip_read_info->stream.next_in = (voidpf)0; + pfile_in_zip_read_info->stream.avail_in = 0; + + err=inflateInit2(&pfile_in_zip_read_info->stream, -MAX_WBITS); + if (err == Z_OK) + pfile_in_zip_read_info->stream_initialised=1; + else + { + TRYFREE(pfile_in_zip_read_info); + return err; + } + /* windowBits is passed < 0 to tell that there is no zlib header. + * Note that in this case inflate *requires* an extra "dummy" byte + * after the compressed stream in order to complete decompression and + * return Z_STREAM_END. + * In unzip, i don't wait absolutely Z_STREAM_END because I known the + * size of both compressed and uncompressed data + */ + } + pfile_in_zip_read_info->rest_read_compressed = + s->cur_file_info.compressed_size ; + pfile_in_zip_read_info->rest_read_uncompressed = + s->cur_file_info.uncompressed_size ; + + + pfile_in_zip_read_info->pos_in_zipfile = + s->cur_file_info_internal.offset_curfile + SIZEZIPLOCALHEADER + + iSizeVar; + + pfile_in_zip_read_info->stream.avail_in = (uInt)0; + + s->pfile_in_zip_read = pfile_in_zip_read_info; + +# ifndef NOUNCRYPT + if (password != NULL) + { + int i; + s->pcrc_32_tab = get_crc_table(); + init_keys(password,s->keys,s->pcrc_32_tab); + if (ZSEEK(s->z_filefunc, s->filestream, + s->pfile_in_zip_read->pos_in_zipfile + + s->pfile_in_zip_read->byte_before_the_zipfile, + SEEK_SET)!=0) + return UNZ_INTERNALERROR; + if(ZREAD(s->z_filefunc, s->filestream,source, 12)<12) + return UNZ_INTERNALERROR; + + for (i = 0; i<12; i++) + zdecode(s->keys,s->pcrc_32_tab,source[i]); + + s->pfile_in_zip_read->pos_in_zipfile+=12; + s->encrypted=1; + } +# endif + + + return UNZ_OK; +} + +extern int ZEXPORT unzOpenCurrentFile (file) + unzFile file; +{ + return unzOpenCurrentFile3(file, NULL, NULL, 0, NULL); +} + +extern int ZEXPORT unzOpenCurrentFilePassword (file, password) + unzFile file; + const char* password; +{ + return unzOpenCurrentFile3(file, NULL, NULL, 0, password); +} + +extern int ZEXPORT unzOpenCurrentFile2 (file,method,level,raw) + unzFile file; + int* method; + int* level; + int raw; +{ + return unzOpenCurrentFile3(file, method, level, raw, NULL); +} + +/* + Read bytes from the current file. + buf contain buffer where data must be copied + len the size of buf. + + return the number of byte copied if somes bytes are copied + return 0 if the end of file was reached + return <0 with error code if there is an error + (UNZ_ERRNO for IO error, or zLib error for uncompress error) +*/ +extern int ZEXPORT unzReadCurrentFile (file, buf, len) + unzFile file; + voidp buf; + unsigned len; +{ + int err=UNZ_OK; + uInt iRead = 0; + unz_s* s; + file_in_zip_read_info_s* pfile_in_zip_read_info; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return UNZ_PARAMERROR; + + + if ((pfile_in_zip_read_info->read_buffer == NULL)) + return UNZ_END_OF_LIST_OF_FILE; + if (len==0) + return 0; + + pfile_in_zip_read_info->stream.next_out = (Bytef*)buf; + + pfile_in_zip_read_info->stream.avail_out = (uInt)len; + + if ((len>pfile_in_zip_read_info->rest_read_uncompressed) && + (!(pfile_in_zip_read_info->raw))) + pfile_in_zip_read_info->stream.avail_out = + (uInt)pfile_in_zip_read_info->rest_read_uncompressed; + + if ((len>pfile_in_zip_read_info->rest_read_compressed+ + pfile_in_zip_read_info->stream.avail_in) && + (pfile_in_zip_read_info->raw)) + pfile_in_zip_read_info->stream.avail_out = + (uInt)pfile_in_zip_read_info->rest_read_compressed+ + pfile_in_zip_read_info->stream.avail_in; + + while (pfile_in_zip_read_info->stream.avail_out>0) + { + if ((pfile_in_zip_read_info->stream.avail_in==0) && + (pfile_in_zip_read_info->rest_read_compressed>0)) + { + uInt uReadThis = UNZ_BUFSIZE; + if (pfile_in_zip_read_info->rest_read_compressedrest_read_compressed; + if (uReadThis == 0) + return UNZ_EOF; + if (ZSEEK(pfile_in_zip_read_info->z_filefunc, + pfile_in_zip_read_info->filestream, + pfile_in_zip_read_info->pos_in_zipfile + + pfile_in_zip_read_info->byte_before_the_zipfile, + ZLIB_FILEFUNC_SEEK_SET)!=0) + return UNZ_ERRNO; + if (ZREAD(pfile_in_zip_read_info->z_filefunc, + pfile_in_zip_read_info->filestream, + pfile_in_zip_read_info->read_buffer, + uReadThis)!=uReadThis) + return UNZ_ERRNO; + + +# ifndef NOUNCRYPT + if(s->encrypted) + { + uInt i; + for(i=0;iread_buffer[i] = + zdecode(s->keys,s->pcrc_32_tab, + pfile_in_zip_read_info->read_buffer[i]); + } +# endif + + + pfile_in_zip_read_info->pos_in_zipfile += uReadThis; + + pfile_in_zip_read_info->rest_read_compressed-=uReadThis; + + pfile_in_zip_read_info->stream.next_in = + (Bytef*)pfile_in_zip_read_info->read_buffer; + pfile_in_zip_read_info->stream.avail_in = (uInt)uReadThis; + } + + if ((pfile_in_zip_read_info->compression_method==0) || (pfile_in_zip_read_info->raw)) + { + uInt uDoCopy,i ; + + if ((pfile_in_zip_read_info->stream.avail_in == 0) && + (pfile_in_zip_read_info->rest_read_compressed == 0)) + return (iRead==0) ? UNZ_EOF : iRead; + + if (pfile_in_zip_read_info->stream.avail_out < + pfile_in_zip_read_info->stream.avail_in) + uDoCopy = pfile_in_zip_read_info->stream.avail_out ; + else + uDoCopy = pfile_in_zip_read_info->stream.avail_in ; + + for (i=0;istream.next_out+i) = + *(pfile_in_zip_read_info->stream.next_in+i); + + pfile_in_zip_read_info->crc32 = crc32(pfile_in_zip_read_info->crc32, + pfile_in_zip_read_info->stream.next_out, + uDoCopy); + pfile_in_zip_read_info->rest_read_uncompressed-=uDoCopy; + pfile_in_zip_read_info->stream.avail_in -= uDoCopy; + pfile_in_zip_read_info->stream.avail_out -= uDoCopy; + pfile_in_zip_read_info->stream.next_out += uDoCopy; + pfile_in_zip_read_info->stream.next_in += uDoCopy; + pfile_in_zip_read_info->stream.total_out += uDoCopy; + iRead += uDoCopy; + } + else + { + uLong uTotalOutBefore,uTotalOutAfter; + const Bytef *bufBefore; + uLong uOutThis; + int flush=Z_SYNC_FLUSH; + + uTotalOutBefore = pfile_in_zip_read_info->stream.total_out; + bufBefore = pfile_in_zip_read_info->stream.next_out; + + /* + if ((pfile_in_zip_read_info->rest_read_uncompressed == + pfile_in_zip_read_info->stream.avail_out) && + (pfile_in_zip_read_info->rest_read_compressed == 0)) + flush = Z_FINISH; + */ + err=inflate(&pfile_in_zip_read_info->stream,flush); + + if ((err>=0) && (pfile_in_zip_read_info->stream.msg!=NULL)) + err = Z_DATA_ERROR; + + uTotalOutAfter = pfile_in_zip_read_info->stream.total_out; + uOutThis = uTotalOutAfter-uTotalOutBefore; + + pfile_in_zip_read_info->crc32 = + crc32(pfile_in_zip_read_info->crc32,bufBefore, + (uInt)(uOutThis)); + + pfile_in_zip_read_info->rest_read_uncompressed -= + uOutThis; + + iRead += (uInt)(uTotalOutAfter - uTotalOutBefore); + + if (err==Z_STREAM_END) + return (iRead==0) ? UNZ_EOF : iRead; + if (err!=Z_OK) + break; + } + } + + if (err==Z_OK) + return iRead; + return err; +} + + +/* + Give the current position in uncompressed data +*/ +extern z_off_t ZEXPORT unztell (file) + unzFile file; +{ + unz_s* s; + file_in_zip_read_info_s* pfile_in_zip_read_info; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return UNZ_PARAMERROR; + + return (z_off_t)pfile_in_zip_read_info->stream.total_out; +} + + +/* + return 1 if the end of file was reached, 0 elsewhere +*/ +extern int ZEXPORT unzeof (file) + unzFile file; +{ + unz_s* s; + file_in_zip_read_info_s* pfile_in_zip_read_info; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return UNZ_PARAMERROR; + + if (pfile_in_zip_read_info->rest_read_uncompressed == 0) + return 1; + else + return 0; +} + + + +/* + Read extra field from the current file (opened by unzOpenCurrentFile) + This is the local-header version of the extra field (sometimes, there is + more info in the local-header version than in the central-header) + + if buf==NULL, it return the size of the local extra field that can be read + + if buf!=NULL, len is the size of the buffer, the extra header is copied in + buf. + the return value is the number of bytes copied in buf, or (if <0) + the error code +*/ +extern int ZEXPORT unzGetLocalExtrafield (file,buf,len) + unzFile file; + voidp buf; + unsigned len; +{ + unz_s* s; + file_in_zip_read_info_s* pfile_in_zip_read_info; + uInt read_now; + uLong size_to_read; + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return UNZ_PARAMERROR; + + size_to_read = (pfile_in_zip_read_info->size_local_extrafield - + pfile_in_zip_read_info->pos_local_extrafield); + + if (buf==NULL) + return (int)size_to_read; + + if (len>size_to_read) + read_now = (uInt)size_to_read; + else + read_now = (uInt)len ; + + if (read_now==0) + return 0; + + if (ZSEEK(pfile_in_zip_read_info->z_filefunc, + pfile_in_zip_read_info->filestream, + pfile_in_zip_read_info->offset_local_extrafield + + pfile_in_zip_read_info->pos_local_extrafield, + ZLIB_FILEFUNC_SEEK_SET)!=0) + return UNZ_ERRNO; + + if (ZREAD(pfile_in_zip_read_info->z_filefunc, + pfile_in_zip_read_info->filestream, + buf,read_now)!=read_now) + return UNZ_ERRNO; + + return (int)read_now; +} + +/* + Close the file in zip opened with unzipOpenCurrentFile + Return UNZ_CRCERROR if all the file was read but the CRC is not good +*/ +extern int ZEXPORT unzCloseCurrentFile (file) + unzFile file; +{ + int err=UNZ_OK; + + unz_s* s; + file_in_zip_read_info_s* pfile_in_zip_read_info; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return UNZ_PARAMERROR; + + + if ((pfile_in_zip_read_info->rest_read_uncompressed == 0) && + (!pfile_in_zip_read_info->raw)) + { + if (pfile_in_zip_read_info->crc32 != pfile_in_zip_read_info->crc32_wait) + err=UNZ_CRCERROR; + } + + + TRYFREE(pfile_in_zip_read_info->read_buffer); + pfile_in_zip_read_info->read_buffer = NULL; + if (pfile_in_zip_read_info->stream_initialised) + inflateEnd(&pfile_in_zip_read_info->stream); + + pfile_in_zip_read_info->stream_initialised = 0; + TRYFREE(pfile_in_zip_read_info); + + s->pfile_in_zip_read=NULL; + + return err; +} + + +/* + Get the global comment string of the ZipFile, in the szComment buffer. + uSizeBuf is the size of the szComment buffer. + return the number of byte copied or an error code <0 +*/ +extern int ZEXPORT unzGetGlobalComment (file, szComment, uSizeBuf) + unzFile file; + char *szComment; + uLong uSizeBuf; +{ + unz_s* s; + uLong uReadThis ; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + + uReadThis = uSizeBuf; + if (uReadThis>s->gi.size_comment) + uReadThis = s->gi.size_comment; + + if (ZSEEK(s->z_filefunc,s->filestream,s->central_pos+22,ZLIB_FILEFUNC_SEEK_SET)!=0) + return UNZ_ERRNO; + + if (uReadThis>0) + { + *szComment='\0'; + if (ZREAD(s->z_filefunc,s->filestream,szComment,uReadThis)!=uReadThis) + return UNZ_ERRNO; + } + + if ((szComment != NULL) && (uSizeBuf > s->gi.size_comment)) + *(szComment+s->gi.size_comment)='\0'; + return (int)uReadThis; +} + +/* Additions by RX '2004 */ +extern uLong ZEXPORT unzGetOffset (file) + unzFile file; +{ + unz_s* s; + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + if (!s->current_file_ok) + return 0; + if (s->gi.number_entry != 0 && s->gi.number_entry != 0xffff) + if (s->num_file==s->gi.number_entry) + return 0; + return s->pos_in_central_dir; +} + +extern int ZEXPORT unzSetOffset (file, pos) + unzFile file; + uLong pos; +{ + unz_s* s; + int err; + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + + s->pos_in_central_dir = pos; + s->num_file = s->gi.number_entry; /* hack */ + err = unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info, + &s->cur_file_info_internal, + NULL,0,NULL,0,NULL,0); + s->current_file_ok = (err == UNZ_OK); + return err; +} diff --git a/quazip/unzip.h b/3rdparty/quazip-0.5.1/quazip/unzip.h similarity index 97% rename from quazip/unzip.h rename to 3rdparty/quazip-0.5.1/quazip/unzip.h index 49929728..33c9dc1a 100644 --- a/quazip/unzip.h +++ b/3rdparty/quazip-0.5.1/quazip/unzip.h @@ -1,357 +1,356 @@ -/* unzip.h -- IO for uncompress .zip files using zlib - Version 1.01e, February 12th, 2005 - - Copyright (C) 1998-2005 Gilles Vollant - - This unzip package allow extract file from .ZIP file, compatible with PKZip 2.04g - WinZip, InfoZip tools and compatible. - - Multi volume ZipFile (span) are not supported. - Encryption compatible with pkzip 2.04g only supported - Old compressions used by old PKZip 1.x are not supported - - - I WAIT FEEDBACK at mail info@winimage.com - Visit also http://www.winimage.com/zLibDll/unzip.htm for evolution - - Condition of use and distribution are the same than zlib : - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - Modified by Sergey A. Tachenov to integrate with Qt. - - -*/ - -/* for more info about .ZIP format, see - http://www.info-zip.org/pub/infozip/doc/appnote-981119-iz.zip - http://www.info-zip.org/pub/infozip/doc/ - PkWare has also a specification at : - ftp://ftp.pkware.com/probdesc.zip -*/ - -#ifndef _unz_H -#define _unz_H - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef _ZLIB_H -#include "zlib.h" -#endif - -#ifndef _ZLIBIOAPI_H -#include "ioapi.h" -#endif - -#if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP) -/* like the STRICT of WIN32, we define a pointer that cannot be converted - from (void*) without cast */ -typedef struct TagunzFile__ { int unused; } unzFile__; -typedef unzFile__ *unzFile; -#else -typedef voidp unzFile; -#endif - -#define OF(x) x - -#define UNZ_OK (0) -#define UNZ_END_OF_LIST_OF_FILE (-100) -#define UNZ_ERRNO (Z_ERRNO) -#define UNZ_EOF (0) -#define UNZ_PARAMERROR (-102) -#define UNZ_BADZIPFILE (-103) -#define UNZ_INTERNALERROR (-104) -#define UNZ_CRCERROR (-105) - -/* tm_unz contain date/time info */ -typedef struct tm_unz_s -{ - uInt tm_sec; /* seconds after the minute - [0,59] */ - uInt tm_min; /* minutes after the hour - [0,59] */ - uInt tm_hour; /* hours since midnight - [0,23] */ - uInt tm_mday; /* day of the month - [1,31] */ - uInt tm_mon; /* months since January - [0,11] */ - uInt tm_year; /* years - [1980..2044] */ -} tm_unz; - -/* unz_global_info structure contain global data about the ZIPfile - These data comes from the end of central dir */ -typedef struct unz_global_info_s -{ - uLong number_entry; /* total number of entries in - the central dir on this disk */ - uLong size_comment; /* size of the global comment of the zipfile */ -} unz_global_info; - - -/* unz_file_info contain information about a file in the zipfile */ -typedef struct unz_file_info_s -{ - uLong version; /* version made by 2 bytes */ - uLong version_needed; /* version needed to extract 2 bytes */ - uLong flag; /* general purpose bit flag 2 bytes */ - uLong compression_method; /* compression method 2 bytes */ - uLong dosDate; /* last mod file date in Dos fmt 4 bytes */ - uLong crc; /* crc-32 4 bytes */ - uLong compressed_size; /* compressed size 4 bytes */ - uLong uncompressed_size; /* uncompressed size 4 bytes */ - uLong size_filename; /* filename length 2 bytes */ - uLong size_file_extra; /* extra field length 2 bytes */ - uLong size_file_comment; /* file comment length 2 bytes */ - - uLong disk_num_start; /* disk number start 2 bytes */ - uLong internal_fa; /* internal file attributes 2 bytes */ - uLong external_fa; /* external file attributes 4 bytes */ - - tm_unz tmu_date; -} unz_file_info; - -extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1, - const char* fileName2, - int iCaseSensitivity)); -/* - Compare two filename (fileName1,fileName2). - If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp) - If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi - or strcasecmp) - If iCaseSenisivity = 0, case sensitivity is defaut of your operating system - (like 1 on Unix, 2 on Windows) -*/ - - -extern unzFile ZEXPORT unzOpen OF((voidpf file)); -/* - Open a Zip file. path contain whatever zopen_file from the IO API - accepts. For Qt implementation it is a pointer to QIODevice, for - fopen() implementation it's a file name. - If the zipfile cannot be opened (file don't exist or in not valid), the - return value is NULL. - Else, the return value is a unzFile Handle, usable with other function - of this unzip package. -*/ - -extern unzFile ZEXPORT unzOpen2 OF((voidpf file, - zlib_filefunc_def* pzlib_filefunc_def)); -/* - Open a Zip file, like unzOpen, but provide a set of file low level API - for read/write the zip file (see ioapi.h) -*/ - -extern int ZEXPORT unzClose OF((unzFile file)); -/* - Close a ZipFile opened with unzipOpen. - If there is files inside the .Zip opened with unzOpenCurrentFile (see later), - these files MUST be closed with unzipCloseCurrentFile before call unzipClose. - return UNZ_OK if there is no problem. */ - -extern int ZEXPORT unzGetGlobalInfo OF((unzFile file, - unz_global_info *pglobal_info)); -/* - Write info about the ZipFile in the *pglobal_info structure. - No preparation of the structure is needed - return UNZ_OK if there is no problem. */ - - -extern int ZEXPORT unzGetGlobalComment OF((unzFile file, - char *szComment, - uLong uSizeBuf)); -/* - Get the global comment string of the ZipFile, in the szComment buffer. - uSizeBuf is the size of the szComment buffer. - return the number of byte copied or an error code <0 -*/ - - -/***************************************************************************/ -/* Unzip package allow you browse the directory of the zipfile */ - -extern int ZEXPORT unzGoToFirstFile OF((unzFile file)); -/* - Set the current file of the zipfile to the first file. - return UNZ_OK if there is no problem -*/ - -extern int ZEXPORT unzGoToNextFile OF((unzFile file)); -/* - Set the current file of the zipfile to the next file. - return UNZ_OK if there is no problem - return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. -*/ - -extern int ZEXPORT unzLocateFile OF((unzFile file, - const char *szFileName, - int iCaseSensitivity)); -/* - Try locate the file szFileName in the zipfile. - For the iCaseSensitivity signification, see unzStringFileNameCompare - - return value : - UNZ_OK if the file is found. It becomes the current file. - UNZ_END_OF_LIST_OF_FILE if the file is not found -*/ - - -/* ****************************************** */ -/* Ryan supplied functions */ -/* unz_file_info contain information about a file in the zipfile */ -typedef struct unz_file_pos_s -{ - uLong pos_in_zip_directory; /* offset in zip file directory */ - uLong num_of_file; /* # of file */ -} unz_file_pos; - -extern int ZEXPORT unzGetFilePos( - unzFile file, - unz_file_pos* file_pos); - -extern int ZEXPORT unzGoToFilePos( - unzFile file, - unz_file_pos* file_pos); - -/* ****************************************** */ - -extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file, - unz_file_info *pfile_info, - char *szFileName, - uLong fileNameBufferSize, - void *extraField, - uLong extraFieldBufferSize, - char *szComment, - uLong commentBufferSize)); -/* - Get Info about the current file - if pfile_info!=NULL, the *pfile_info structure will contain somes info about - the current file - if szFileName!=NULL, the filemane string will be copied in szFileName - (fileNameBufferSize is the size of the buffer) - if extraField!=NULL, the extra field information will be copied in extraField - (extraFieldBufferSize is the size of the buffer). - This is the Central-header version of the extra field - if szComment!=NULL, the comment string of the file will be copied in szComment - (commentBufferSize is the size of the buffer) -*/ - -/***************************************************************************/ -/* for reading the content of the current zipfile, you can open it, read data - from it, and close it (you can close it before reading all the file) - */ - -extern int ZEXPORT unzOpenCurrentFile OF((unzFile file)); -/* - Open for reading data the current file in the zipfile. - If there is no error, the return value is UNZ_OK. -*/ - -extern int ZEXPORT unzOpenCurrentFilePassword OF((unzFile file, - const char* password)); -/* - Open for reading data the current file in the zipfile. - password is a crypting password - If there is no error, the return value is UNZ_OK. -*/ - -extern int ZEXPORT unzOpenCurrentFile2 OF((unzFile file, - int* method, - int* level, - int raw)); -/* - Same than unzOpenCurrentFile, but open for read raw the file (not uncompress) - if raw==1 - *method will receive method of compression, *level will receive level of - compression - note : you can set level parameter as NULL (if you did not want known level, - but you CANNOT set method parameter as NULL -*/ - -extern int ZEXPORT unzOpenCurrentFile3 OF((unzFile file, - int* method, - int* level, - int raw, - const char* password)); -/* - Same than unzOpenCurrentFile, but open for read raw the file (not uncompress) - if raw==1 - *method will receive method of compression, *level will receive level of - compression - note : you can set level parameter as NULL (if you did not want known level, - but you CANNOT set method parameter as NULL -*/ - - -extern int ZEXPORT unzCloseCurrentFile OF((unzFile file)); -/* - Close the file in zip opened with unzOpenCurrentFile - Return UNZ_CRCERROR if all the file was read but the CRC is not good -*/ - -extern int ZEXPORT unzReadCurrentFile OF((unzFile file, - voidp buf, - unsigned len)); -/* - Read bytes from the current file (opened by unzOpenCurrentFile) - buf contain buffer where data must be copied - len the size of buf. - - return the number of byte copied if somes bytes are copied - return 0 if the end of file was reached - return <0 with error code if there is an error - (UNZ_ERRNO for IO error, or zLib error for uncompress error) -*/ - -extern z_off_t ZEXPORT unztell OF((unzFile file)); -/* - Give the current position in uncompressed data -*/ - -extern int ZEXPORT unzeof OF((unzFile file)); -/* - return 1 if the end of file was reached, 0 elsewhere -*/ - -extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file, - voidp buf, - unsigned len)); -/* - Read extra field from the current file (opened by unzOpenCurrentFile) - This is the local-header version of the extra field (sometimes, there is - more info in the local-header version than in the central-header) - - if buf==NULL, it return the size of the local extra field - - if buf!=NULL, len is the size of the buffer, the extra header is copied in - buf. - the return value is the number of bytes copied in buf, or (if <0) - the error code -*/ - -/***************************************************************************/ - -/* Get the current file offset */ -extern uLong ZEXPORT unzGetOffset (unzFile file); - -/* Set the current file offset */ -extern int ZEXPORT unzSetOffset (unzFile file, uLong pos); - - - -#ifdef __cplusplus -} -#endif - -#endif /* _unz_H */ +/* unzip.h -- IO for uncompress .zip files using zlib + Version 1.01e, February 12th, 2005 + + Copyright (C) 1998-2005 Gilles Vollant + + This unzip package allow extract file from .ZIP file, compatible with PKZip 2.04g + WinZip, InfoZip tools and compatible. + + Multi volume ZipFile (span) are not supported. + Encryption compatible with pkzip 2.04g only supported + Old compressions used by old PKZip 1.x are not supported + + + I WAIT FEEDBACK at mail info@winimage.com + Visit also http://www.winimage.com/zLibDll/unzip.htm for evolution + + Condition of use and distribution are the same than zlib : + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Modified by Sergey A. Tachenov to integrate with Qt. + + +*/ + +/* for more info about .ZIP format, see + http://www.info-zip.org/pub/infozip/doc/appnote-981119-iz.zip + http://www.info-zip.org/pub/infozip/doc/ + PkWare has also a specification at : + ftp://ftp.pkware.com/probdesc.zip +*/ + +#ifndef _unz_H +#define _unz_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _ZLIB_H +#include "zlib.h" +#endif + +#ifndef _ZLIBIOAPI_H +#include "ioapi.h" +#endif + +#if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP) +/* like the STRICT of WIN32, we define a pointer that cannot be converted + from (void*) without cast */ +typedef struct TagunzFile__ { int unused; } unzFile__; +typedef unzFile__ *unzFile; +#else +typedef voidp unzFile; +#endif + + +#define UNZ_OK (0) +#define UNZ_END_OF_LIST_OF_FILE (-100) +#define UNZ_ERRNO (Z_ERRNO) +#define UNZ_EOF (0) +#define UNZ_PARAMERROR (-102) +#define UNZ_BADZIPFILE (-103) +#define UNZ_INTERNALERROR (-104) +#define UNZ_CRCERROR (-105) + +/* tm_unz contain date/time info */ +typedef struct tm_unz_s +{ + uInt tm_sec; /* seconds after the minute - [0,59] */ + uInt tm_min; /* minutes after the hour - [0,59] */ + uInt tm_hour; /* hours since midnight - [0,23] */ + uInt tm_mday; /* day of the month - [1,31] */ + uInt tm_mon; /* months since January - [0,11] */ + uInt tm_year; /* years - [1980..2044] */ +} tm_unz; + +/* unz_global_info structure contain global data about the ZIPfile + These data comes from the end of central dir */ +typedef struct unz_global_info_s +{ + uLong number_entry; /* total number of entries in + the central dir on this disk */ + uLong size_comment; /* size of the global comment of the zipfile */ +} unz_global_info; + + +/* unz_file_info contain information about a file in the zipfile */ +typedef struct unz_file_info_s +{ + uLong version; /* version made by 2 bytes */ + uLong version_needed; /* version needed to extract 2 bytes */ + uLong flag; /* general purpose bit flag 2 bytes */ + uLong compression_method; /* compression method 2 bytes */ + uLong dosDate; /* last mod file date in Dos fmt 4 bytes */ + uLong crc; /* crc-32 4 bytes */ + uLong compressed_size; /* compressed size 4 bytes */ + uLong uncompressed_size; /* uncompressed size 4 bytes */ + uLong size_filename; /* filename length 2 bytes */ + uLong size_file_extra; /* extra field length 2 bytes */ + uLong size_file_comment; /* file comment length 2 bytes */ + + uLong disk_num_start; /* disk number start 2 bytes */ + uLong internal_fa; /* internal file attributes 2 bytes */ + uLong external_fa; /* external file attributes 4 bytes */ + + tm_unz tmu_date; +} unz_file_info; + +extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1, + const char* fileName2, + int iCaseSensitivity)); +/* + Compare two filename (fileName1,fileName2). + If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp) + If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi + or strcasecmp) + If iCaseSenisivity = 0, case sensitivity is defaut of your operating system + (like 1 on Unix, 2 on Windows) +*/ + + +extern unzFile ZEXPORT unzOpen OF((voidpf file)); +/* + Open a Zip file. path contain whatever zopen_file from the IO API + accepts. For Qt implementation it is a pointer to QIODevice, for + fopen() implementation it's a file name. + If the zipfile cannot be opened (file don't exist or in not valid), the + return value is NULL. + Else, the return value is a unzFile Handle, usable with other function + of this unzip package. +*/ + +extern unzFile ZEXPORT unzOpen2 OF((voidpf file, + zlib_filefunc_def* pzlib_filefunc_def)); +/* + Open a Zip file, like unzOpen, but provide a set of file low level API + for read/write the zip file (see ioapi.h) +*/ + +extern int ZEXPORT unzClose OF((unzFile file)); +/* + Close a ZipFile opened with unzipOpen. + If there is files inside the .Zip opened with unzOpenCurrentFile (see later), + these files MUST be closed with unzipCloseCurrentFile before call unzipClose. + return UNZ_OK if there is no problem. */ + +extern int ZEXPORT unzGetGlobalInfo OF((unzFile file, + unz_global_info *pglobal_info)); +/* + Write info about the ZipFile in the *pglobal_info structure. + No preparation of the structure is needed + return UNZ_OK if there is no problem. */ + + +extern int ZEXPORT unzGetGlobalComment OF((unzFile file, + char *szComment, + uLong uSizeBuf)); +/* + Get the global comment string of the ZipFile, in the szComment buffer. + uSizeBuf is the size of the szComment buffer. + return the number of byte copied or an error code <0 +*/ + + +/***************************************************************************/ +/* Unzip package allow you browse the directory of the zipfile */ + +extern int ZEXPORT unzGoToFirstFile OF((unzFile file)); +/* + Set the current file of the zipfile to the first file. + return UNZ_OK if there is no problem +*/ + +extern int ZEXPORT unzGoToNextFile OF((unzFile file)); +/* + Set the current file of the zipfile to the next file. + return UNZ_OK if there is no problem + return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. +*/ + +extern int ZEXPORT unzLocateFile OF((unzFile file, + const char *szFileName, + int iCaseSensitivity)); +/* + Try locate the file szFileName in the zipfile. + For the iCaseSensitivity signification, see unzStringFileNameCompare + + return value : + UNZ_OK if the file is found. It becomes the current file. + UNZ_END_OF_LIST_OF_FILE if the file is not found +*/ + + +/* ****************************************** */ +/* Ryan supplied functions */ +/* unz_file_info contain information about a file in the zipfile */ +typedef struct unz_file_pos_s +{ + uLong pos_in_zip_directory; /* offset in zip file directory */ + uLong num_of_file; /* # of file */ +} unz_file_pos; + +extern int ZEXPORT unzGetFilePos( + unzFile file, + unz_file_pos* file_pos); + +extern int ZEXPORT unzGoToFilePos( + unzFile file, + unz_file_pos* file_pos); + +/* ****************************************** */ + +extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file, + unz_file_info *pfile_info, + char *szFileName, + uLong fileNameBufferSize, + void *extraField, + uLong extraFieldBufferSize, + char *szComment, + uLong commentBufferSize)); +/* + Get Info about the current file + if pfile_info!=NULL, the *pfile_info structure will contain somes info about + the current file + if szFileName!=NULL, the filemane string will be copied in szFileName + (fileNameBufferSize is the size of the buffer) + if extraField!=NULL, the extra field information will be copied in extraField + (extraFieldBufferSize is the size of the buffer). + This is the Central-header version of the extra field + if szComment!=NULL, the comment string of the file will be copied in szComment + (commentBufferSize is the size of the buffer) +*/ + +/***************************************************************************/ +/* for reading the content of the current zipfile, you can open it, read data + from it, and close it (you can close it before reading all the file) + */ + +extern int ZEXPORT unzOpenCurrentFile OF((unzFile file)); +/* + Open for reading data the current file in the zipfile. + If there is no error, the return value is UNZ_OK. +*/ + +extern int ZEXPORT unzOpenCurrentFilePassword OF((unzFile file, + const char* password)); +/* + Open for reading data the current file in the zipfile. + password is a crypting password + If there is no error, the return value is UNZ_OK. +*/ + +extern int ZEXPORT unzOpenCurrentFile2 OF((unzFile file, + int* method, + int* level, + int raw)); +/* + Same than unzOpenCurrentFile, but open for read raw the file (not uncompress) + if raw==1 + *method will receive method of compression, *level will receive level of + compression + note : you can set level parameter as NULL (if you did not want known level, + but you CANNOT set method parameter as NULL +*/ + +extern int ZEXPORT unzOpenCurrentFile3 OF((unzFile file, + int* method, + int* level, + int raw, + const char* password)); +/* + Same than unzOpenCurrentFile, but open for read raw the file (not uncompress) + if raw==1 + *method will receive method of compression, *level will receive level of + compression + note : you can set level parameter as NULL (if you did not want known level, + but you CANNOT set method parameter as NULL +*/ + + +extern int ZEXPORT unzCloseCurrentFile OF((unzFile file)); +/* + Close the file in zip opened with unzOpenCurrentFile + Return UNZ_CRCERROR if all the file was read but the CRC is not good +*/ + +extern int ZEXPORT unzReadCurrentFile OF((unzFile file, + voidp buf, + unsigned len)); +/* + Read bytes from the current file (opened by unzOpenCurrentFile) + buf contain buffer where data must be copied + len the size of buf. + + return the number of byte copied if somes bytes are copied + return 0 if the end of file was reached + return <0 with error code if there is an error + (UNZ_ERRNO for IO error, or zLib error for uncompress error) +*/ + +extern z_off_t ZEXPORT unztell OF((unzFile file)); +/* + Give the current position in uncompressed data +*/ + +extern int ZEXPORT unzeof OF((unzFile file)); +/* + return 1 if the end of file was reached, 0 elsewhere +*/ + +extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file, + voidp buf, + unsigned len)); +/* + Read extra field from the current file (opened by unzOpenCurrentFile) + This is the local-header version of the extra field (sometimes, there is + more info in the local-header version than in the central-header) + + if buf==NULL, it return the size of the local extra field + + if buf!=NULL, len is the size of the buffer, the extra header is copied in + buf. + the return value is the number of bytes copied in buf, or (if <0) + the error code +*/ + +/***************************************************************************/ + +/* Get the current file offset */ +extern uLong ZEXPORT unzGetOffset (unzFile file); + +/* Set the current file offset */ +extern int ZEXPORT unzSetOffset (unzFile file, uLong pos); + + + +#ifdef __cplusplus +} +#endif + +#endif /* _unz_H */ diff --git a/quazip/zip.c b/3rdparty/quazip-0.5.1/quazip/zip.c similarity index 96% rename from quazip/zip.c rename to 3rdparty/quazip-0.5.1/quazip/zip.c index 9bc6ae15..774fd7b5 100644 --- a/quazip/zip.c +++ b/3rdparty/quazip-0.5.1/quazip/zip.c @@ -1,1280 +1,1282 @@ -/* zip.c -- IO on .zip files using zlib - Version 1.01e, February 12th, 2005 - - 27 Dec 2004 Rolf Kalbermatter - Modification to zipOpen2 to support globalComment retrieval. - - Copyright (C) 1998-2005 Gilles Vollant - - Read zip.h for more info - - Modified by Sergey A. Tachenov to integrate with Qt. -*/ - - -#include -#include -#include -#include -#include "zlib.h" -#include "zip.h" -#include "quazip_global.h" - -#ifdef STDC -# include -# include -# include -#endif -#ifdef NO_ERRNO_H - extern int errno; -#else -# include -#endif - - -#ifndef local -# define local static -#endif -/* compile with -Dlocal if your debugger can't find static symbols */ - -#ifndef VERSIONMADEBY -# define VERSIONMADEBY (0x031e) /* best for standard pkware crypt */ -#endif - -#ifndef Z_BUFSIZE -#define Z_BUFSIZE (16384) -#endif - -#ifndef Z_MAXFILENAMEINZIP -#define Z_MAXFILENAMEINZIP (256) -#endif - -#ifndef ALLOC -# define ALLOC(size) (malloc(size)) -#endif -#ifndef TRYFREE -# define TRYFREE(p) {if (p) free(p);} -#endif - -/* -#define SIZECENTRALDIRITEM (0x2e) -#define SIZEZIPLOCALHEADER (0x1e) -*/ - -/* I've found an old Unix (a SunOS 4.1.3_U1) without all SEEK_* defined.... */ - -#ifndef SEEK_CUR -#define SEEK_CUR 1 -#endif - -#ifndef SEEK_END -#define SEEK_END 2 -#endif - -#ifndef SEEK_SET -#define SEEK_SET 0 -#endif - -#ifndef DEF_MEM_LEVEL -#if MAX_MEM_LEVEL >= 8 -# define DEF_MEM_LEVEL 8 -#else -# define DEF_MEM_LEVEL MAX_MEM_LEVEL -#endif -#endif -const char zip_copyright[] = - " zip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll"; - - -#define SIZEDATA_INDATABLOCK (4096-(4*4)) - -#define LOCALHEADERMAGIC (0x04034b50) -#define DESCRIPTORHEADERMAGIC (0x08074b50) -#define CENTRALHEADERMAGIC (0x02014b50) -#define ENDHEADERMAGIC (0x06054b50) - -#define FLAG_LOCALHEADER_OFFSET (0x06) -#define CRC_LOCALHEADER_OFFSET (0x0e) - -#define SIZECENTRALHEADER (0x2e) /* 46 */ - -typedef struct linkedlist_datablock_internal_s -{ - struct linkedlist_datablock_internal_s* next_datablock; - uLong avail_in_this_block; - uLong filled_in_this_block; - uLong unused; /* for future use and alignement */ - unsigned char data[SIZEDATA_INDATABLOCK]; -} linkedlist_datablock_internal; - -typedef struct linkedlist_data_s -{ - linkedlist_datablock_internal* first_block; - linkedlist_datablock_internal* last_block; -} linkedlist_data; - - -typedef struct -{ - z_stream stream; /* zLib stream structure for inflate */ - int stream_initialised; /* 1 is stream is initialised */ - uInt pos_in_buffered_data; /* last written byte in buffered_data */ - - uLong pos_local_header; /* offset of the local header of the file - currenty writing */ - char* central_header; /* central header data for the current file */ - uLong size_centralheader; /* size of the central header for cur file */ - uLong flag; /* flag of the file currently writing */ - - int method; /* compression method of file currenty wr.*/ - int raw; /* 1 for directly writing raw data */ - Byte buffered_data[Z_BUFSIZE];/* buffer contain compressed data to be writ*/ - uLong dosDate; - uLong crc32; - int encrypt; -#ifndef NOCRYPT - unsigned long keys[3]; /* keys defining the pseudo-random sequence */ - const unsigned long* pcrc_32_tab; - int crypt_header_size; -#endif -} curfile_info; - -typedef struct -{ - zlib_filefunc_def z_filefunc; - voidpf filestream; /* io structore of the zipfile */ - linkedlist_data central_dir;/* datablock with central dir in construction*/ - int in_opened_file_inzip; /* 1 if a file in the zip is currently writ.*/ - curfile_info ci; /* info on the file curretly writing */ - - uLong begin_pos; /* position of the beginning of the zipfile */ - uLong add_position_when_writting_offset; - uLong number_entry; -#ifndef NO_ADDFILEINEXISTINGZIP - char *globalcomment; -#endif - unsigned flags; -} zip_internal; - - - -#ifndef NOCRYPT -#define INCLUDECRYPTINGCODE_IFCRYPTALLOWED -#include "crypt.h" -#endif - -local linkedlist_datablock_internal* allocate_new_datablock() -{ - linkedlist_datablock_internal* ldi; - ldi = (linkedlist_datablock_internal*) - ALLOC(sizeof(linkedlist_datablock_internal)); - if (ldi!=NULL) - { - ldi->next_datablock = NULL ; - ldi->filled_in_this_block = 0 ; - ldi->avail_in_this_block = SIZEDATA_INDATABLOCK ; - } - return ldi; -} - -local void free_datablock(ldi) - linkedlist_datablock_internal* ldi; -{ - while (ldi!=NULL) - { - linkedlist_datablock_internal* ldinext = ldi->next_datablock; - TRYFREE(ldi); - ldi = ldinext; - } -} - -local void init_linkedlist(ll) - linkedlist_data* ll; -{ - ll->first_block = ll->last_block = NULL; -} - -#if 0 // unused -local void free_linkedlist(ll) - linkedlist_data* ll; -{ - free_datablock(ll->first_block); - ll->first_block = ll->last_block = NULL; -} -#endif - -local int add_data_in_datablock(ll,buf,len) - linkedlist_data* ll; - const void* buf; - uLong len; -{ - linkedlist_datablock_internal* ldi; - const unsigned char* from_copy; - - if (ll==NULL) - return ZIP_INTERNALERROR; - - if (ll->last_block == NULL) - { - ll->first_block = ll->last_block = allocate_new_datablock(); - if (ll->first_block == NULL) - return ZIP_INTERNALERROR; - } - - ldi = ll->last_block; - from_copy = (unsigned char*)buf; - - while (len>0) - { - uInt copy_this; - uInt i; - unsigned char* to_copy; - - if (ldi->avail_in_this_block==0) - { - ldi->next_datablock = allocate_new_datablock(); - if (ldi->next_datablock == NULL) - return ZIP_INTERNALERROR; - ldi = ldi->next_datablock ; - ll->last_block = ldi; - } - - if (ldi->avail_in_this_block < len) - copy_this = (uInt)ldi->avail_in_this_block; - else - copy_this = (uInt)len; - - to_copy = &(ldi->data[ldi->filled_in_this_block]); - - for (i=0;ifilled_in_this_block += copy_this; - ldi->avail_in_this_block -= copy_this; - from_copy += copy_this ; - len -= copy_this; - } - return ZIP_OK; -} - - - -/****************************************************************************/ - -#ifndef NO_ADDFILEINEXISTINGZIP -/* =========================================================================== - Inputs a long in LSB order to the given file - nbByte == 1, 2 or 4 (byte, short or long) -*/ - -local int ziplocal_putValue OF((const zlib_filefunc_def* pzlib_filefunc_def, - voidpf filestream, uLong x, int nbByte)); -local int ziplocal_putValue (pzlib_filefunc_def, filestream, x, nbByte) - const zlib_filefunc_def* pzlib_filefunc_def; - voidpf filestream; - uLong x; - int nbByte; -{ - unsigned char buf[4]; - int n; - for (n = 0; n < nbByte; n++) - { - buf[n] = (unsigned char)(x & 0xff); - x >>= 8; - } - if (x != 0) - { /* data overflow - hack for ZIP64 (X Roche) */ - for (n = 0; n < nbByte; n++) - { - buf[n] = 0xff; - } - } - - if (ZWRITE(*pzlib_filefunc_def,filestream,buf,nbByte)!=(uLong)nbByte) - return ZIP_ERRNO; - else - return ZIP_OK; -} - -local void ziplocal_putValue_inmemory OF((void* dest, uLong x, int nbByte)); -local void ziplocal_putValue_inmemory (dest, x, nbByte) - void* dest; - uLong x; - int nbByte; -{ - unsigned char* buf=(unsigned char*)dest; - int n; - for (n = 0; n < nbByte; n++) { - buf[n] = (unsigned char)(x & 0xff); - x >>= 8; - } - - if (x != 0) - { /* data overflow - hack for ZIP64 */ - for (n = 0; n < nbByte; n++) - { - buf[n] = 0xff; - } - } -} - -/****************************************************************************/ - - -local uLong ziplocal_TmzDateToDosDate(ptm,dosDate) - const tm_zip* ptm; - uLong dosDate UNUSED; -{ - uLong year = (uLong)ptm->tm_year; - if (year>1980) - year-=1980; - else if (year>80) - year-=80; - return - (uLong) (((ptm->tm_mday) + (32 * (ptm->tm_mon+1)) + (512 * year)) << 16) | - ((ptm->tm_sec/2) + (32* ptm->tm_min) + (2048 * (uLong)ptm->tm_hour)); -} - - -/****************************************************************************/ - -local int ziplocal_getByte OF(( - const zlib_filefunc_def* pzlib_filefunc_def, - voidpf filestream, - int *pi)); - -local int ziplocal_getByte(pzlib_filefunc_def,filestream,pi) - const zlib_filefunc_def* pzlib_filefunc_def; - voidpf filestream; - int *pi; -{ - unsigned char c; - int err = (int)ZREAD(*pzlib_filefunc_def,filestream,&c,1); - if (err==1) - { - *pi = (int)c; - return ZIP_OK; - } - else - { - if (ZERROR(*pzlib_filefunc_def,filestream)) - return ZIP_ERRNO; - else - return ZIP_EOF; - } -} - - -/* =========================================================================== - Reads a long in LSB order from the given gz_stream. Sets -*/ -local int ziplocal_getShort OF(( - const zlib_filefunc_def* pzlib_filefunc_def, - voidpf filestream, - uLong *pX)); - -local int ziplocal_getShort (pzlib_filefunc_def,filestream,pX) - const zlib_filefunc_def* pzlib_filefunc_def; - voidpf filestream; - uLong *pX; -{ - uLong x ; - int i; - int err; - - err = ziplocal_getByte(pzlib_filefunc_def,filestream,&i); - x = (uLong)i; - - if (err==ZIP_OK) - err = ziplocal_getByte(pzlib_filefunc_def,filestream,&i); - x += ((uLong)i)<<8; - - if (err==ZIP_OK) - *pX = x; - else - *pX = 0; - return err; -} - -local int ziplocal_getLong OF(( - const zlib_filefunc_def* pzlib_filefunc_def, - voidpf filestream, - uLong *pX)); - -local int ziplocal_getLong (pzlib_filefunc_def,filestream,pX) - const zlib_filefunc_def* pzlib_filefunc_def; - voidpf filestream; - uLong *pX; -{ - uLong x ; - int i; - int err; - - err = ziplocal_getByte(pzlib_filefunc_def,filestream,&i); - x = (uLong)i; - - if (err==ZIP_OK) - err = ziplocal_getByte(pzlib_filefunc_def,filestream,&i); - x += ((uLong)i)<<8; - - if (err==ZIP_OK) - err = ziplocal_getByte(pzlib_filefunc_def,filestream,&i); - x += ((uLong)i)<<16; - - if (err==ZIP_OK) - err = ziplocal_getByte(pzlib_filefunc_def,filestream,&i); - x += ((uLong)i)<<24; - - if (err==ZIP_OK) - *pX = x; - else - *pX = 0; - return err; -} - -#ifndef BUFREADCOMMENT -#define BUFREADCOMMENT (0x400) -#endif -/* - Locate the Central directory of a zipfile (at the end, just before - the global comment) -*/ -local uLong ziplocal_SearchCentralDir OF(( - const zlib_filefunc_def* pzlib_filefunc_def, - voidpf filestream)); - -local uLong ziplocal_SearchCentralDir(pzlib_filefunc_def,filestream) - const zlib_filefunc_def* pzlib_filefunc_def; - voidpf filestream; -{ - unsigned char* buf; - uLong uSizeFile; - uLong uBackRead; - uLong uMaxBack=0xffff; /* maximum size of global comment */ - uLong uPosFound=0; - - if (ZSEEK(*pzlib_filefunc_def,filestream,0,ZLIB_FILEFUNC_SEEK_END) != 0) - return 0; - - - uSizeFile = ZTELL(*pzlib_filefunc_def,filestream); - - if (uMaxBack>uSizeFile) - uMaxBack = uSizeFile; - - buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4); - if (buf==NULL) - return 0; - - uBackRead = 4; - while (uBackReaduMaxBack) - uBackRead = uMaxBack; - else - uBackRead+=BUFREADCOMMENT; - uReadPos = uSizeFile-uBackRead ; - - uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ? - (BUFREADCOMMENT+4) : (uSizeFile-uReadPos); - if (ZSEEK(*pzlib_filefunc_def,filestream,uReadPos,ZLIB_FILEFUNC_SEEK_SET)!=0) - break; - - if (ZREAD(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize) - break; - - for (i=(int)uReadSize-3; (i--)>0;) - if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && - ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06)) - { - uPosFound = uReadPos+i; - break; - } - - if (uPosFound!=0) - break; - } - TRYFREE(buf); - return uPosFound; -} -#endif /* !NO_ADDFILEINEXISTINGZIP*/ - -/************************************************************/ -extern zipFile ZEXPORT zipOpen2 (file, append, globalcomment, pzlib_filefunc_def) - voidpf file; - int append; - zipcharpc* globalcomment; - zlib_filefunc_def* pzlib_filefunc_def; -{ - zip_internal ziinit; - zip_internal* zi; - int err=ZIP_OK; - - - if (pzlib_filefunc_def==NULL) - fill_qiodevice_filefunc(&ziinit.z_filefunc); - else - ziinit.z_filefunc = *pzlib_filefunc_def; - - ziinit.filestream = (*(ziinit.z_filefunc.zopen_file)) - (ziinit.z_filefunc.opaque, - file, - (append == APPEND_STATUS_CREATE) ? - (ZLIB_FILEFUNC_MODE_READ | ZLIB_FILEFUNC_MODE_WRITE | ZLIB_FILEFUNC_MODE_CREATE) : - (ZLIB_FILEFUNC_MODE_READ | ZLIB_FILEFUNC_MODE_WRITE | ZLIB_FILEFUNC_MODE_EXISTING)); - - if (ziinit.filestream == NULL) - return NULL; - ziinit.begin_pos = ZTELL(ziinit.z_filefunc,ziinit.filestream); - ziinit.in_opened_file_inzip = 0; - ziinit.ci.stream_initialised = 0; - ziinit.number_entry = 0; - ziinit.add_position_when_writting_offset = 0; - ziinit.flags = ZIP_WRITE_DATA_DESCRIPTOR; - init_linkedlist(&(ziinit.central_dir)); - - - zi = (zip_internal*)ALLOC(sizeof(zip_internal)); - if (zi==NULL) - { - ZCLOSE(ziinit.z_filefunc,ziinit.filestream); - return NULL; - } - - /* now we add file in a zipfile */ -# ifndef NO_ADDFILEINEXISTINGZIP - ziinit.globalcomment = NULL; - if (append == APPEND_STATUS_ADDINZIP) - { - uLong byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ - - uLong size_central_dir; /* size of the central directory */ - uLong offset_central_dir; /* offset of start of central directory */ - uLong central_pos,uL; - - uLong number_disk; /* number of the current dist, used for - spaning ZIP, unsupported, always 0*/ - uLong number_disk_with_CD; /* number the the disk with central dir, used - for spaning ZIP, unsupported, always 0*/ - uLong number_entry; - uLong number_entry_CD; /* total number of entries in - the central dir - (same than number_entry on nospan) */ - uLong size_comment; - - central_pos = ziplocal_SearchCentralDir(&ziinit.z_filefunc,ziinit.filestream); - if (central_pos==0) - err=ZIP_ERRNO; - - if (ZSEEK(ziinit.z_filefunc, ziinit.filestream, - central_pos,ZLIB_FILEFUNC_SEEK_SET)!=0) - err=ZIP_ERRNO; - - /* the signature, already checked */ - if (ziplocal_getLong(&ziinit.z_filefunc, ziinit.filestream,&uL)!=ZIP_OK) - err=ZIP_ERRNO; - - /* number of this disk */ - if (ziplocal_getShort(&ziinit.z_filefunc, ziinit.filestream,&number_disk)!=ZIP_OK) - err=ZIP_ERRNO; - - /* number of the disk with the start of the central directory */ - if (ziplocal_getShort(&ziinit.z_filefunc, ziinit.filestream,&number_disk_with_CD)!=ZIP_OK) - err=ZIP_ERRNO; - - /* total number of entries in the central dir on this disk */ - if (ziplocal_getShort(&ziinit.z_filefunc, ziinit.filestream,&number_entry)!=ZIP_OK) - err=ZIP_ERRNO; - - /* total number of entries in the central dir */ - if (ziplocal_getShort(&ziinit.z_filefunc, ziinit.filestream,&number_entry_CD)!=ZIP_OK) - err=ZIP_ERRNO; - - if ((number_entry_CD!=number_entry) || - (number_disk_with_CD!=0) || - (number_disk!=0)) - err=ZIP_BADZIPFILE; - - /* size of the central directory */ - if (ziplocal_getLong(&ziinit.z_filefunc, ziinit.filestream,&size_central_dir)!=ZIP_OK) - err=ZIP_ERRNO; - - /* offset of start of central directory with respect to the - starting disk number */ - if (ziplocal_getLong(&ziinit.z_filefunc, ziinit.filestream,&offset_central_dir)!=ZIP_OK) - err=ZIP_ERRNO; - - /* zipfile global comment length */ - if (ziplocal_getShort(&ziinit.z_filefunc, ziinit.filestream,&size_comment)!=ZIP_OK) - err=ZIP_ERRNO; - - if ((central_pos0) - { - ziinit.globalcomment = ALLOC(size_comment+1); - if (ziinit.globalcomment) - { - size_comment = ZREAD(ziinit.z_filefunc, ziinit.filestream,ziinit.globalcomment,size_comment); - ziinit.globalcomment[size_comment]=0; - } - } - - byte_before_the_zipfile = central_pos - - (offset_central_dir+size_central_dir); - ziinit.add_position_when_writting_offset = byte_before_the_zipfile; - - { - uLong size_central_dir_to_read = size_central_dir; - size_t buf_size = SIZEDATA_INDATABLOCK; - void* buf_read = (void*)ALLOC(buf_size); - if (ZSEEK(ziinit.z_filefunc, ziinit.filestream, - offset_central_dir + byte_before_the_zipfile, - ZLIB_FILEFUNC_SEEK_SET) != 0) - err=ZIP_ERRNO; - - while ((size_central_dir_to_read>0) && (err==ZIP_OK)) - { - uLong read_this = SIZEDATA_INDATABLOCK; - if (read_this > size_central_dir_to_read) - read_this = size_central_dir_to_read; - if (ZREAD(ziinit.z_filefunc, ziinit.filestream,buf_read,read_this) != read_this) - err=ZIP_ERRNO; - - if (err==ZIP_OK) - err = add_data_in_datablock(&ziinit.central_dir,buf_read, - (uLong)read_this); - size_central_dir_to_read-=read_this; - } - TRYFREE(buf_read); - } - ziinit.begin_pos = byte_before_the_zipfile; - ziinit.number_entry = number_entry_CD; - - if (ZSEEK(ziinit.z_filefunc, ziinit.filestream, - offset_central_dir+byte_before_the_zipfile,ZLIB_FILEFUNC_SEEK_SET)!=0) - err=ZIP_ERRNO; - } - - if (globalcomment) - { - *globalcomment = ziinit.globalcomment; - } -# endif /* !NO_ADDFILEINEXISTINGZIP*/ - - if (err != ZIP_OK) - { -# ifndef NO_ADDFILEINEXISTINGZIP - TRYFREE(ziinit.globalcomment); -# endif /* !NO_ADDFILEINEXISTINGZIP*/ - TRYFREE(zi); - return NULL; - } - else - { - *zi = ziinit; - return (zipFile)zi; - } -} - -extern zipFile ZEXPORT zipOpen (file, append) - voidpf file; - int append; -{ - return zipOpen2(file,append,NULL,NULL); -} - -extern int ZEXPORT zipOpenNewFileInZip3 (file, filename, zipfi, - extrafield_local, size_extrafield_local, - extrafield_global, size_extrafield_global, - comment, method, level, raw, - windowBits, memLevel, strategy, - password, crcForCrypting) - zipFile file; - const char* filename; - const zip_fileinfo* zipfi; - const void* extrafield_local; - uInt size_extrafield_local; - const void* extrafield_global; - uInt size_extrafield_global; - const char* comment; - int method; - int level; - int raw; - int windowBits; - int memLevel; - int strategy; - const char* password; - uLong crcForCrypting; -{ - zip_internal* zi; - uInt size_filename; - uInt size_comment; - uInt i; - int err = ZIP_OK; - uLong version_to_extract; - -# ifdef NOCRYPT - if (password != NULL) - return ZIP_PARAMERROR; -# endif - - if (file == NULL) - return ZIP_PARAMERROR; - if ((method!=0) && (method!=Z_DEFLATED)) - return ZIP_PARAMERROR; - - zi = (zip_internal*)file; - - if (zi->in_opened_file_inzip == 1) - { - err = zipCloseFileInZip (file); - if (err != ZIP_OK) - return err; - } - - if (method == 0 - && (level == 0 || (zi->flags & ZIP_WRITE_DATA_DESCRIPTOR) == 0)) - { - version_to_extract = 10; - } - else - { - version_to_extract = 20; - } - - - if (filename==NULL) - filename="-"; - - if (comment==NULL) - size_comment = 0; - else - size_comment = (uInt)strlen(comment); - - size_filename = (uInt)strlen(filename); - - if (zipfi == NULL) - zi->ci.dosDate = 0; - else - { - if (zipfi->dosDate != 0) - zi->ci.dosDate = zipfi->dosDate; - else zi->ci.dosDate = ziplocal_TmzDateToDosDate(&zipfi->tmz_date,zipfi->dosDate); - } - - zi->ci.flag = 0; - if ((level==8) || (level==9)) - zi->ci.flag |= 2; - if (level==2) - zi->ci.flag |= 4; - if (level==1) - zi->ci.flag |= 6; - if (password != NULL) - { - zi->ci.flag |= 1; - } - if (version_to_extract >= 20 - && (zi->flags & ZIP_WRITE_DATA_DESCRIPTOR) != 0) - zi->ci.flag |= 8; - zi->ci.crc32 = 0; - zi->ci.method = method; - zi->ci.encrypt = 0; - zi->ci.stream_initialised = 0; - zi->ci.pos_in_buffered_data = 0; - zi->ci.raw = raw; - zi->ci.pos_local_header = ZTELL(zi->z_filefunc,zi->filestream) ; - zi->ci.size_centralheader = SIZECENTRALHEADER + size_filename + - size_extrafield_global + size_comment; - zi->ci.central_header = (char*)ALLOC((uInt)zi->ci.size_centralheader); - - ziplocal_putValue_inmemory(zi->ci.central_header,(uLong)CENTRALHEADERMAGIC,4); - /* version info */ - ziplocal_putValue_inmemory(zi->ci.central_header+4,(uLong)VERSIONMADEBY,2); - ziplocal_putValue_inmemory(zi->ci.central_header+6,(uLong)version_to_extract,2); - ziplocal_putValue_inmemory(zi->ci.central_header+8,(uLong)zi->ci.flag,2); - ziplocal_putValue_inmemory(zi->ci.central_header+10,(uLong)zi->ci.method,2); - ziplocal_putValue_inmemory(zi->ci.central_header+12,(uLong)zi->ci.dosDate,4); - ziplocal_putValue_inmemory(zi->ci.central_header+16,(uLong)0,4); /*crc*/ - ziplocal_putValue_inmemory(zi->ci.central_header+20,(uLong)0,4); /*compr size*/ - ziplocal_putValue_inmemory(zi->ci.central_header+24,(uLong)0,4); /*uncompr size*/ - ziplocal_putValue_inmemory(zi->ci.central_header+28,(uLong)size_filename,2); - ziplocal_putValue_inmemory(zi->ci.central_header+30,(uLong)size_extrafield_global,2); - ziplocal_putValue_inmemory(zi->ci.central_header+32,(uLong)size_comment,2); - ziplocal_putValue_inmemory(zi->ci.central_header+34,(uLong)0,2); /*disk nm start*/ - - if (zipfi==NULL) - ziplocal_putValue_inmemory(zi->ci.central_header+36,(uLong)0,2); - else - ziplocal_putValue_inmemory(zi->ci.central_header+36,(uLong)zipfi->internal_fa,2); - - if (zipfi==NULL) - ziplocal_putValue_inmemory(zi->ci.central_header+38,(uLong)0,4); - else - ziplocal_putValue_inmemory(zi->ci.central_header+38,(uLong)zipfi->external_fa,4); - - ziplocal_putValue_inmemory(zi->ci.central_header+42,(uLong)zi->ci.pos_local_header- zi->add_position_when_writting_offset,4); - - for (i=0;ici.central_header+SIZECENTRALHEADER+i) = *(filename+i); - - for (i=0;ici.central_header+SIZECENTRALHEADER+size_filename+i) = - *(((const char*)extrafield_global)+i); - - for (i=0;ici.central_header+SIZECENTRALHEADER+size_filename+ - size_extrafield_global+i) = *(comment+i); - if (zi->ci.central_header == NULL) - return ZIP_INTERNALERROR; - - /* write the local header */ - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)LOCALHEADERMAGIC,4); - - if (err==ZIP_OK) - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)version_to_extract,2); - if (err==ZIP_OK) - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->ci.flag,2); - - if (err==ZIP_OK) - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->ci.method,2); - - if (err==ZIP_OK) - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->ci.dosDate,4); - - if (err==ZIP_OK) - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4); /* crc 32, unknown */ - if (err==ZIP_OK) - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4); /* compressed size, unknown */ - if (err==ZIP_OK) - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4); /* uncompressed size, unknown */ - - if (err==ZIP_OK) - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)size_filename,2); - - if (err==ZIP_OK) - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)size_extrafield_local,2); - - if ((err==ZIP_OK) && (size_filename>0)) - if (ZWRITE(zi->z_filefunc,zi->filestream,filename,size_filename)!=size_filename) - err = ZIP_ERRNO; - - if ((err==ZIP_OK) && (size_extrafield_local>0)) - if (ZWRITE(zi->z_filefunc,zi->filestream,extrafield_local,size_extrafield_local) - !=size_extrafield_local) - err = ZIP_ERRNO; - - zi->ci.stream.avail_in = (uInt)0; - zi->ci.stream.avail_out = (uInt)Z_BUFSIZE; - zi->ci.stream.next_out = zi->ci.buffered_data; - zi->ci.stream.total_in = 0; - zi->ci.stream.total_out = 0; - - if ((err==ZIP_OK) && (zi->ci.method == Z_DEFLATED) && (!zi->ci.raw)) - { - zi->ci.stream.zalloc = (alloc_func)0; - zi->ci.stream.zfree = (free_func)0; - zi->ci.stream.opaque = (voidpf)0; - - if (windowBits>0) - windowBits = -windowBits; - - err = deflateInit2(&zi->ci.stream, level, - Z_DEFLATED, windowBits, memLevel, strategy); - - if (err==Z_OK) - zi->ci.stream_initialised = 1; - } -# ifndef NOCRYPT - zi->ci.crypt_header_size = 0; - if ((err==Z_OK) && (password != NULL)) - { - unsigned char bufHead[RAND_HEAD_LEN]; - unsigned int sizeHead; - zi->ci.encrypt = 1; - zi->ci.pcrc_32_tab = get_crc_table(); - /*init_keys(password,zi->ci.keys,zi->ci.pcrc_32_tab);*/ - - crcForCrypting = (uLong)zi->ci.dosDate << 16; // ATTANTION! Without this row, you don't unpack your password protected archive in other app. - - sizeHead=crypthead(password,bufHead,RAND_HEAD_LEN,zi->ci.keys,zi->ci.pcrc_32_tab,crcForCrypting); - zi->ci.crypt_header_size = sizeHead; - - if (ZWRITE(zi->z_filefunc,zi->filestream,bufHead,sizeHead) != sizeHead) - err = ZIP_ERRNO; - } -# endif - - if (err==Z_OK) - zi->in_opened_file_inzip = 1; - return err; -} - -extern int ZEXPORT zipOpenNewFileInZip2(file, filename, zipfi, - extrafield_local, size_extrafield_local, - extrafield_global, size_extrafield_global, - comment, method, level, raw) - zipFile file; - const char* filename; - const zip_fileinfo* zipfi; - const void* extrafield_local; - uInt size_extrafield_local; - const void* extrafield_global; - uInt size_extrafield_global; - const char* comment; - int method; - int level; - int raw; -{ - return zipOpenNewFileInZip3 (file, filename, zipfi, - extrafield_local, size_extrafield_local, - extrafield_global, size_extrafield_global, - comment, method, level, raw, - -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, - NULL, 0); -} - -extern int ZEXPORT zipOpenNewFileInZip (file, filename, zipfi, - extrafield_local, size_extrafield_local, - extrafield_global, size_extrafield_global, - comment, method, level) - zipFile file; - const char* filename; - const zip_fileinfo* zipfi; - const void* extrafield_local; - uInt size_extrafield_local; - const void* extrafield_global; - uInt size_extrafield_global; - const char* comment; - int method; - int level; -{ - return zipOpenNewFileInZip2 (file, filename, zipfi, - extrafield_local, size_extrafield_local, - extrafield_global, size_extrafield_global, - comment, method, level, 0); -} - -local int zipFlushWriteBuffer(zi) - zip_internal* zi; -{ - int err=ZIP_OK; - - if (zi->ci.encrypt != 0) - { -#ifndef NOCRYPT - uInt i; - int t; - for (i=0;ici.pos_in_buffered_data;i++) - zi->ci.buffered_data[i] = zencode(zi->ci.keys, zi->ci.pcrc_32_tab, - zi->ci.buffered_data[i],t); -#endif - } - if (ZWRITE(zi->z_filefunc,zi->filestream,zi->ci.buffered_data,zi->ci.pos_in_buffered_data) - !=zi->ci.pos_in_buffered_data) - err = ZIP_ERRNO; - zi->ci.pos_in_buffered_data = 0; - return err; -} - -extern int ZEXPORT zipWriteInFileInZip (file, buf, len) - zipFile file; - const void* buf; - unsigned len; -{ - zip_internal* zi; - int err=ZIP_OK; - - if (file == NULL) - return ZIP_PARAMERROR; - zi = (zip_internal*)file; - - if (zi->in_opened_file_inzip == 0) - return ZIP_PARAMERROR; - - zi->ci.stream.next_in = (void*)buf; - zi->ci.stream.avail_in = len; - zi->ci.crc32 = crc32(zi->ci.crc32,buf,len); - - while ((err==ZIP_OK) && (zi->ci.stream.avail_in>0)) - { - if (zi->ci.stream.avail_out == 0) - { - if (zipFlushWriteBuffer(zi) == ZIP_ERRNO) - err = ZIP_ERRNO; - zi->ci.stream.avail_out = (uInt)Z_BUFSIZE; - zi->ci.stream.next_out = zi->ci.buffered_data; - } - - - if(err != ZIP_OK) - break; - - if ((zi->ci.method == Z_DEFLATED) && (!zi->ci.raw)) - { - uLong uTotalOutBefore = zi->ci.stream.total_out; - err=deflate(&zi->ci.stream, Z_NO_FLUSH); - zi->ci.pos_in_buffered_data += (uInt)(zi->ci.stream.total_out - uTotalOutBefore) ; - - } - else - { - uInt copy_this,i; - if (zi->ci.stream.avail_in < zi->ci.stream.avail_out) - copy_this = zi->ci.stream.avail_in; - else - copy_this = zi->ci.stream.avail_out; - for (i=0;ici.stream.next_out)+i) = - *(((const char*)zi->ci.stream.next_in)+i); - { - zi->ci.stream.avail_in -= copy_this; - zi->ci.stream.avail_out-= copy_this; - zi->ci.stream.next_in+= copy_this; - zi->ci.stream.next_out+= copy_this; - zi->ci.stream.total_in+= copy_this; - zi->ci.stream.total_out+= copy_this; - zi->ci.pos_in_buffered_data += copy_this; - } - } - } - - return err; -} - -extern int ZEXPORT zipCloseFileInZipRaw (file, uncompressed_size, crc32) - zipFile file; - uLong uncompressed_size; - uLong crc32; -{ - zip_internal* zi; - uLong compressed_size; - int err=ZIP_OK; - - if (file == NULL) - return ZIP_PARAMERROR; - zi = (zip_internal*)file; - - if (zi->in_opened_file_inzip == 0) - return ZIP_PARAMERROR; - zi->ci.stream.avail_in = 0; - - if ((zi->ci.method == Z_DEFLATED) && (!zi->ci.raw)) - while (err==ZIP_OK) - { - uLong uTotalOutBefore; - if (zi->ci.stream.avail_out == 0) - { - if (zipFlushWriteBuffer(zi) == ZIP_ERRNO) - err = ZIP_ERRNO; - zi->ci.stream.avail_out = (uInt)Z_BUFSIZE; - zi->ci.stream.next_out = zi->ci.buffered_data; - } - uTotalOutBefore = zi->ci.stream.total_out; - err=deflate(&zi->ci.stream, Z_FINISH); - zi->ci.pos_in_buffered_data += (uInt)(zi->ci.stream.total_out - uTotalOutBefore) ; - } - - if (err==Z_STREAM_END) - err=ZIP_OK; /* this is normal */ - - if ((zi->ci.pos_in_buffered_data>0) && (err==ZIP_OK)) - if (zipFlushWriteBuffer(zi)==ZIP_ERRNO) - err = ZIP_ERRNO; - - if ((zi->ci.method == Z_DEFLATED) && (!zi->ci.raw)) - { - err=deflateEnd(&zi->ci.stream); - zi->ci.stream_initialised = 0; - } - - if (!zi->ci.raw) - { - crc32 = (uLong)zi->ci.crc32; - uncompressed_size = (uLong)zi->ci.stream.total_in; - } - compressed_size = (uLong)zi->ci.stream.total_out; -# ifndef NOCRYPT - compressed_size += zi->ci.crypt_header_size; -# endif - - ziplocal_putValue_inmemory(zi->ci.central_header+16,crc32,4); /*crc*/ - ziplocal_putValue_inmemory(zi->ci.central_header+20, - compressed_size,4); /*compr size*/ - if (zi->ci.stream.data_type == Z_ASCII) - ziplocal_putValue_inmemory(zi->ci.central_header+36,(uLong)Z_ASCII,2); - ziplocal_putValue_inmemory(zi->ci.central_header+24, - uncompressed_size,4); /*uncompr size*/ - - if (err==ZIP_OK) - err = add_data_in_datablock(&zi->central_dir,zi->ci.central_header, - (uLong)zi->ci.size_centralheader); - free(zi->ci.central_header); - - if (err==ZIP_OK) - { - uLong cur_pos_inzip = ZTELL(zi->z_filefunc,zi->filestream); - if (ZSEEK(zi->z_filefunc,zi->filestream, - zi->ci.pos_local_header + 14,ZLIB_FILEFUNC_SEEK_SET)!=0) - err = ZIP_ERRNO; - - if (err==ZIP_OK) - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,crc32,4); /* crc 32, unknown */ - - if (err==ZIP_OK) /* compressed size, unknown */ - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,compressed_size,4); - - if (err==ZIP_OK) /* uncompressed size, unknown */ - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,uncompressed_size,4); - - if (ZSEEK(zi->z_filefunc,zi->filestream, - cur_pos_inzip,ZLIB_FILEFUNC_SEEK_SET)!=0) - err = ZIP_ERRNO; - - if ((zi->ci.flag & 8) != 0) { - /* Write local Descriptor after file data */ - if (err==ZIP_OK) - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)DESCRIPTORHEADERMAGIC,4); - - if (err==ZIP_OK) - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,crc32,4); /* crc 32, unknown */ - - if (err==ZIP_OK) /* compressed size, unknown */ - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,compressed_size,4); - - if (err==ZIP_OK) /* uncompressed size, unknown */ - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,uncompressed_size,4); - } - - - } - - zi->number_entry ++; - zi->in_opened_file_inzip = 0; - - return err; -} - -extern int ZEXPORT zipCloseFileInZip (file) - zipFile file; -{ - return zipCloseFileInZipRaw (file,0,0); -} - -extern int ZEXPORT zipClose (file, global_comment) - zipFile file; - const char* global_comment; -{ - zip_internal* zi; - int err = 0; - uLong size_centraldir = 0; - uLong centraldir_pos_inzip; - uInt size_global_comment; - if (file == NULL) - return ZIP_PARAMERROR; - zi = (zip_internal*)file; - - if (zi->in_opened_file_inzip == 1) - { - err = zipCloseFileInZip (file); - } - -#ifndef NO_ADDFILEINEXISTINGZIP - if (global_comment==NULL) - global_comment = zi->globalcomment; -#endif - if (global_comment==NULL) - size_global_comment = 0; - else - size_global_comment = (uInt)strlen(global_comment); - - centraldir_pos_inzip = ZTELL(zi->z_filefunc,zi->filestream); - if (err==ZIP_OK) - { - linkedlist_datablock_internal* ldi = zi->central_dir.first_block ; - while (ldi!=NULL) - { - if ((err==ZIP_OK) && (ldi->filled_in_this_block>0)) - if (ZWRITE(zi->z_filefunc,zi->filestream, - ldi->data,ldi->filled_in_this_block) - !=ldi->filled_in_this_block ) - err = ZIP_ERRNO; - - size_centraldir += ldi->filled_in_this_block; - ldi = ldi->next_datablock; - } - } - free_datablock(zi->central_dir.first_block); - - if (err==ZIP_OK) /* Magic End */ - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)ENDHEADERMAGIC,4); - - if (err==ZIP_OK) /* number of this disk */ - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,2); - - if (err==ZIP_OK) /* number of the disk with the start of the central directory */ - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,2); - - if (err==ZIP_OK) /* total number of entries in the central dir on this disk */ - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->number_entry,2); - - if (err==ZIP_OK) /* total number of entries in the central dir */ - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->number_entry,2); - - if (err==ZIP_OK) /* size of the central directory */ - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)size_centraldir,4); - - if (err==ZIP_OK) /* offset of start of central directory with respect to the - starting disk number */ - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream, - (uLong)(centraldir_pos_inzip - zi->add_position_when_writting_offset),4); - - if (err==ZIP_OK) /* zipfile comment length */ - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)size_global_comment,2); - - if ((err==ZIP_OK) && (size_global_comment>0)) - if (ZWRITE(zi->z_filefunc,zi->filestream, - global_comment,size_global_comment) != size_global_comment) - err = ZIP_ERRNO; - - if (ZCLOSE(zi->z_filefunc,zi->filestream) != 0) - if (err == ZIP_OK) - err = ZIP_ERRNO; - -#ifndef NO_ADDFILEINEXISTINGZIP - TRYFREE(zi->globalcomment); -#endif - TRYFREE(zi); - - return err; -} - -extern int ZEXPORT zipSetFlags(zipFile file, unsigned flags) -{ - zip_internal* zi; - if (file == NULL) - return ZIP_PARAMERROR; - zi = (zip_internal*)file; - zi->flags |= flags; - return ZIP_OK; -} - -extern int ZEXPORT zipClearFlags(zipFile file, unsigned flags) -{ - zip_internal* zi; - if (file == NULL) - return ZIP_PARAMERROR; - zi = (zip_internal*)file; - zi->flags &= ~flags; - return ZIP_OK; -} +/* zip.c -- IO on .zip files using zlib + Version 1.01e, February 12th, 2005 + + 27 Dec 2004 Rolf Kalbermatter + Modification to zipOpen2 to support globalComment retrieval. + + Copyright (C) 1998-2005 Gilles Vollant + + Read zip.h for more info + + Modified by Sergey A. Tachenov to integrate with Qt. +*/ + + +#include +#include +#include +#include +#include "zlib.h" +#include "zip.h" +#include "quazip_global.h" + +#ifdef STDC +# include +# include +# include +#endif +#ifdef NO_ERRNO_H + extern int errno; +#else +# include +#endif + + +#ifndef local +# define local static +#endif +/* compile with -Dlocal if your debugger can't find static symbols */ + +#ifndef VERSIONMADEBY +# define VERSIONMADEBY (0x031e) /* best for standard pkware crypt */ +#endif + +#ifndef Z_BUFSIZE +#define Z_BUFSIZE (16384) +#endif + +#ifndef Z_MAXFILENAMEINZIP +#define Z_MAXFILENAMEINZIP (256) +#endif + +#ifndef ALLOC +# define ALLOC(size) (malloc(size)) +#endif +#ifndef TRYFREE +# define TRYFREE(p) {if (p) free(p);} +#endif + +/* +#define SIZECENTRALDIRITEM (0x2e) +#define SIZEZIPLOCALHEADER (0x1e) +*/ + +/* I've found an old Unix (a SunOS 4.1.3_U1) without all SEEK_* defined.... */ + +#ifndef SEEK_CUR +#define SEEK_CUR 1 +#endif + +#ifndef SEEK_END +#define SEEK_END 2 +#endif + +#ifndef SEEK_SET +#define SEEK_SET 0 +#endif + +#ifndef DEF_MEM_LEVEL +#if MAX_MEM_LEVEL >= 8 +# define DEF_MEM_LEVEL 8 +#else +# define DEF_MEM_LEVEL MAX_MEM_LEVEL +#endif +#endif +const char zip_copyright[] = + " zip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll"; + + +#define SIZEDATA_INDATABLOCK (4096-(4*4)) + +#define LOCALHEADERMAGIC (0x04034b50) +#define DESCRIPTORHEADERMAGIC (0x08074b50) +#define CENTRALHEADERMAGIC (0x02014b50) +#define ENDHEADERMAGIC (0x06054b50) + +#define FLAG_LOCALHEADER_OFFSET (0x06) +#define CRC_LOCALHEADER_OFFSET (0x0e) + +#define SIZECENTRALHEADER (0x2e) /* 46 */ + +typedef struct linkedlist_datablock_internal_s +{ + struct linkedlist_datablock_internal_s* next_datablock; + uLong avail_in_this_block; + uLong filled_in_this_block; + uLong unused; /* for future use and alignement */ + unsigned char data[SIZEDATA_INDATABLOCK]; +} linkedlist_datablock_internal; + +typedef struct linkedlist_data_s +{ + linkedlist_datablock_internal* first_block; + linkedlist_datablock_internal* last_block; +} linkedlist_data; + + +typedef struct +{ + z_stream stream; /* zLib stream structure for inflate */ + int stream_initialised; /* 1 is stream is initialised */ + uInt pos_in_buffered_data; /* last written byte in buffered_data */ + + uLong pos_local_header; /* offset of the local header of the file + currenty writing */ + char* central_header; /* central header data for the current file */ + uLong size_centralheader; /* size of the central header for cur file */ + uLong flag; /* flag of the file currently writing */ + + int method; /* compression method of file currenty wr.*/ + int raw; /* 1 for directly writing raw data */ + Byte buffered_data[Z_BUFSIZE];/* buffer contain compressed data to be writ*/ + uLong dosDate; + uLong crc32; + int encrypt; +#ifndef NOCRYPT + unsigned long keys[3]; /* keys defining the pseudo-random sequence */ + const unsigned long* pcrc_32_tab; + int crypt_header_size; +#endif +} curfile_info; + +typedef struct +{ + zlib_filefunc_def z_filefunc; + voidpf filestream; /* io structore of the zipfile */ + linkedlist_data central_dir;/* datablock with central dir in construction*/ + int in_opened_file_inzip; /* 1 if a file in the zip is currently writ.*/ + curfile_info ci; /* info on the file curretly writing */ + + uLong begin_pos; /* position of the beginning of the zipfile */ + uLong add_position_when_writting_offset; + uLong number_entry; +#ifndef NO_ADDFILEINEXISTINGZIP + char *globalcomment; +#endif + unsigned flags; +} zip_internal; + + + +#ifndef NOCRYPT +#define INCLUDECRYPTINGCODE_IFCRYPTALLOWED +#include "crypt.h" +#endif + +local linkedlist_datablock_internal* allocate_new_datablock() +{ + linkedlist_datablock_internal* ldi; + ldi = (linkedlist_datablock_internal*) + ALLOC(sizeof(linkedlist_datablock_internal)); + if (ldi!=NULL) + { + ldi->next_datablock = NULL ; + ldi->filled_in_this_block = 0 ; + ldi->avail_in_this_block = SIZEDATA_INDATABLOCK ; + } + return ldi; +} + +local void free_datablock(ldi) + linkedlist_datablock_internal* ldi; +{ + while (ldi!=NULL) + { + linkedlist_datablock_internal* ldinext = ldi->next_datablock; + TRYFREE(ldi); + ldi = ldinext; + } +} + +local void init_linkedlist(ll) + linkedlist_data* ll; +{ + ll->first_block = ll->last_block = NULL; +} + +#if 0 // unused +local void free_linkedlist(ll) + linkedlist_data* ll; +{ + free_datablock(ll->first_block); + ll->first_block = ll->last_block = NULL; +} +#endif + +local int add_data_in_datablock(ll,buf,len) + linkedlist_data* ll; + const void* buf; + uLong len; +{ + linkedlist_datablock_internal* ldi; + const unsigned char* from_copy; + + if (ll==NULL) + return ZIP_INTERNALERROR; + + if (ll->last_block == NULL) + { + ll->first_block = ll->last_block = allocate_new_datablock(); + if (ll->first_block == NULL) + return ZIP_INTERNALERROR; + } + + ldi = ll->last_block; + from_copy = (unsigned char*)buf; + + while (len>0) + { + uInt copy_this; + uInt i; + unsigned char* to_copy; + + if (ldi->avail_in_this_block==0) + { + ldi->next_datablock = allocate_new_datablock(); + if (ldi->next_datablock == NULL) + return ZIP_INTERNALERROR; + ldi = ldi->next_datablock ; + ll->last_block = ldi; + } + + if (ldi->avail_in_this_block < len) + copy_this = (uInt)ldi->avail_in_this_block; + else + copy_this = (uInt)len; + + to_copy = &(ldi->data[ldi->filled_in_this_block]); + + for (i=0;ifilled_in_this_block += copy_this; + ldi->avail_in_this_block -= copy_this; + from_copy += copy_this ; + len -= copy_this; + } + return ZIP_OK; +} + + + +/****************************************************************************/ + +#ifndef NO_ADDFILEINEXISTINGZIP +/* =========================================================================== + Inputs a long in LSB order to the given file + nbByte == 1, 2 or 4 (byte, short or long) +*/ + +local int ziplocal_putValue OF((const zlib_filefunc_def* pzlib_filefunc_def, + voidpf filestream, uLong x, int nbByte)); +local int ziplocal_putValue (pzlib_filefunc_def, filestream, x, nbByte) + const zlib_filefunc_def* pzlib_filefunc_def; + voidpf filestream; + uLong x; + int nbByte; +{ + unsigned char buf[4]; + int n; + for (n = 0; n < nbByte; n++) + { + buf[n] = (unsigned char)(x & 0xff); + x >>= 8; + } + if (x != 0) + { /* data overflow - hack for ZIP64 (X Roche) */ + for (n = 0; n < nbByte; n++) + { + buf[n] = 0xff; + } + } + + if (ZWRITE(*pzlib_filefunc_def,filestream,buf,nbByte)!=(uLong)nbByte) + return ZIP_ERRNO; + else + return ZIP_OK; +} + +local void ziplocal_putValue_inmemory OF((void* dest, uLong x, int nbByte)); +local void ziplocal_putValue_inmemory (dest, x, nbByte) + void* dest; + uLong x; + int nbByte; +{ + unsigned char* buf=(unsigned char*)dest; + int n; + for (n = 0; n < nbByte; n++) { + buf[n] = (unsigned char)(x & 0xff); + x >>= 8; + } + + if (x != 0) + { /* data overflow - hack for ZIP64 */ + for (n = 0; n < nbByte; n++) + { + buf[n] = 0xff; + } + } +} + +/****************************************************************************/ + + +local uLong ziplocal_TmzDateToDosDate(ptm,dosDate) + const tm_zip* ptm; + uLong dosDate UNUSED; +{ + uLong year = (uLong)ptm->tm_year; + if (year>1980) + year-=1980; + else if (year>80) + year-=80; + return + (uLong) (((ptm->tm_mday) + (32 * (ptm->tm_mon+1)) + (512 * year)) << 16) | + ((ptm->tm_sec/2) + (32* ptm->tm_min) + (2048 * (uLong)ptm->tm_hour)); +} + + +/****************************************************************************/ + +local int ziplocal_getByte OF(( + const zlib_filefunc_def* pzlib_filefunc_def, + voidpf filestream, + int *pi)); + +local int ziplocal_getByte(pzlib_filefunc_def,filestream,pi) + const zlib_filefunc_def* pzlib_filefunc_def; + voidpf filestream; + int *pi; +{ + unsigned char c; + int err = (int)ZREAD(*pzlib_filefunc_def,filestream,&c,1); + if (err==1) + { + *pi = (int)c; + return ZIP_OK; + } + else + { + if (ZERROR(*pzlib_filefunc_def,filestream)) + return ZIP_ERRNO; + else + return ZIP_EOF; + } +} + + +/* =========================================================================== + Reads a long in LSB order from the given gz_stream. Sets +*/ +local int ziplocal_getShort OF(( + const zlib_filefunc_def* pzlib_filefunc_def, + voidpf filestream, + uLong *pX)); + +local int ziplocal_getShort (pzlib_filefunc_def,filestream,pX) + const zlib_filefunc_def* pzlib_filefunc_def; + voidpf filestream; + uLong *pX; +{ + uLong x ; + int i; + int err; + + err = ziplocal_getByte(pzlib_filefunc_def,filestream,&i); + x = (uLong)i; + + if (err==ZIP_OK) + err = ziplocal_getByte(pzlib_filefunc_def,filestream,&i); + x += ((uLong)i)<<8; + + if (err==ZIP_OK) + *pX = x; + else + *pX = 0; + return err; +} + +local int ziplocal_getLong OF(( + const zlib_filefunc_def* pzlib_filefunc_def, + voidpf filestream, + uLong *pX)); + +local int ziplocal_getLong (pzlib_filefunc_def,filestream,pX) + const zlib_filefunc_def* pzlib_filefunc_def; + voidpf filestream; + uLong *pX; +{ + uLong x ; + int i; + int err; + + err = ziplocal_getByte(pzlib_filefunc_def,filestream,&i); + x = (uLong)i; + + if (err==ZIP_OK) + err = ziplocal_getByte(pzlib_filefunc_def,filestream,&i); + x += ((uLong)i)<<8; + + if (err==ZIP_OK) + err = ziplocal_getByte(pzlib_filefunc_def,filestream,&i); + x += ((uLong)i)<<16; + + if (err==ZIP_OK) + err = ziplocal_getByte(pzlib_filefunc_def,filestream,&i); + x += ((uLong)i)<<24; + + if (err==ZIP_OK) + *pX = x; + else + *pX = 0; + return err; +} + +#ifndef BUFREADCOMMENT +#define BUFREADCOMMENT (0x400) +#endif +/* + Locate the Central directory of a zipfile (at the end, just before + the global comment) +*/ +local uLong ziplocal_SearchCentralDir OF(( + const zlib_filefunc_def* pzlib_filefunc_def, + voidpf filestream)); + +local uLong ziplocal_SearchCentralDir(pzlib_filefunc_def,filestream) + const zlib_filefunc_def* pzlib_filefunc_def; + voidpf filestream; +{ + unsigned char* buf; + uLong uSizeFile; + uLong uBackRead; + uLong uMaxBack=0xffff; /* maximum size of global comment */ + uLong uPosFound=0; + + if (ZSEEK(*pzlib_filefunc_def,filestream,0,ZLIB_FILEFUNC_SEEK_END) != 0) + return 0; + + + uSizeFile = ZTELL(*pzlib_filefunc_def,filestream); + + if (uMaxBack>uSizeFile) + uMaxBack = uSizeFile; + + buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4); + if (buf==NULL) + return 0; + + uBackRead = 4; + while (uBackReaduMaxBack) + uBackRead = uMaxBack; + else + uBackRead+=BUFREADCOMMENT; + uReadPos = uSizeFile-uBackRead ; + + uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ? + (BUFREADCOMMENT+4) : (uSizeFile-uReadPos); + if (ZSEEK(*pzlib_filefunc_def,filestream,uReadPos,ZLIB_FILEFUNC_SEEK_SET)!=0) + break; + + if (ZREAD(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize) + break; + + for (i=(int)uReadSize-3; (i--)>0;) + if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && + ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06)) + { + uPosFound = uReadPos+i; + break; + } + + if (uPosFound!=0) + break; + } + TRYFREE(buf); + return uPosFound; +} +#endif /* !NO_ADDFILEINEXISTINGZIP*/ + +/************************************************************/ +extern zipFile ZEXPORT zipOpen2 (file, append, globalcomment, pzlib_filefunc_def) + voidpf file; + int append; + zipcharpc* globalcomment; + zlib_filefunc_def* pzlib_filefunc_def; +{ + zip_internal ziinit; + zip_internal* zi; + int err=ZIP_OK; + + + if (pzlib_filefunc_def==NULL) + fill_qiodevice_filefunc(&ziinit.z_filefunc); + else + ziinit.z_filefunc = *pzlib_filefunc_def; + + ziinit.filestream = (*(ziinit.z_filefunc.zopen_file)) + (ziinit.z_filefunc.opaque, + file, + (append == APPEND_STATUS_CREATE) ? + (ZLIB_FILEFUNC_MODE_READ | ZLIB_FILEFUNC_MODE_WRITE | ZLIB_FILEFUNC_MODE_CREATE) : + (ZLIB_FILEFUNC_MODE_READ | ZLIB_FILEFUNC_MODE_WRITE | ZLIB_FILEFUNC_MODE_EXISTING)); + + if (ziinit.filestream == NULL) + return NULL; + ziinit.begin_pos = ZTELL(ziinit.z_filefunc,ziinit.filestream); + ziinit.in_opened_file_inzip = 0; + ziinit.ci.stream_initialised = 0; + ziinit.number_entry = 0; + ziinit.add_position_when_writting_offset = 0; + ziinit.flags = ZIP_WRITE_DATA_DESCRIPTOR; + init_linkedlist(&(ziinit.central_dir)); + + + zi = (zip_internal*)ALLOC(sizeof(zip_internal)); + if (zi==NULL) + { + ZCLOSE(ziinit.z_filefunc,ziinit.filestream); + return NULL; + } + + /* now we add file in a zipfile */ +# ifndef NO_ADDFILEINEXISTINGZIP + ziinit.globalcomment = NULL; + if (append == APPEND_STATUS_ADDINZIP) + { + uLong byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ + + uLong size_central_dir; /* size of the central directory */ + uLong offset_central_dir; /* offset of start of central directory */ + uLong central_pos,uL; + + uLong number_disk; /* number of the current dist, used for + spaning ZIP, unsupported, always 0*/ + uLong number_disk_with_CD; /* number the the disk with central dir, used + for spaning ZIP, unsupported, always 0*/ + uLong number_entry; + uLong number_entry_CD; /* total number of entries in + the central dir + (same than number_entry on nospan) */ + uLong size_comment; + + central_pos = ziplocal_SearchCentralDir(&ziinit.z_filefunc,ziinit.filestream); + if (central_pos==0) + err=ZIP_ERRNO; + + if (ZSEEK(ziinit.z_filefunc, ziinit.filestream, + central_pos,ZLIB_FILEFUNC_SEEK_SET)!=0) + err=ZIP_ERRNO; + + /* the signature, already checked */ + if (ziplocal_getLong(&ziinit.z_filefunc, ziinit.filestream,&uL)!=ZIP_OK) + err=ZIP_ERRNO; + + /* number of this disk */ + if (ziplocal_getShort(&ziinit.z_filefunc, ziinit.filestream,&number_disk)!=ZIP_OK) + err=ZIP_ERRNO; + + /* number of the disk with the start of the central directory */ + if (ziplocal_getShort(&ziinit.z_filefunc, ziinit.filestream,&number_disk_with_CD)!=ZIP_OK) + err=ZIP_ERRNO; + + /* total number of entries in the central dir on this disk */ + if (ziplocal_getShort(&ziinit.z_filefunc, ziinit.filestream,&number_entry)!=ZIP_OK) + err=ZIP_ERRNO; + + /* total number of entries in the central dir */ + if (ziplocal_getShort(&ziinit.z_filefunc, ziinit.filestream,&number_entry_CD)!=ZIP_OK) + err=ZIP_ERRNO; + + if ((number_entry_CD!=number_entry) || + (number_disk_with_CD!=0) || + (number_disk!=0)) + err=ZIP_BADZIPFILE; + + /* size of the central directory */ + if (ziplocal_getLong(&ziinit.z_filefunc, ziinit.filestream,&size_central_dir)!=ZIP_OK) + err=ZIP_ERRNO; + + /* offset of start of central directory with respect to the + starting disk number */ + if (ziplocal_getLong(&ziinit.z_filefunc, ziinit.filestream,&offset_central_dir)!=ZIP_OK) + err=ZIP_ERRNO; + + /* zipfile global comment length */ + if (ziplocal_getShort(&ziinit.z_filefunc, ziinit.filestream,&size_comment)!=ZIP_OK) + err=ZIP_ERRNO; + + if ((central_pos0) + { + ziinit.globalcomment = ALLOC(size_comment+1); + if (ziinit.globalcomment) + { + size_comment = ZREAD(ziinit.z_filefunc, ziinit.filestream,ziinit.globalcomment,size_comment); + ziinit.globalcomment[size_comment]=0; + } + } + + byte_before_the_zipfile = central_pos - + (offset_central_dir+size_central_dir); + ziinit.add_position_when_writting_offset = byte_before_the_zipfile; + + { + uLong size_central_dir_to_read = size_central_dir; + size_t buf_size = SIZEDATA_INDATABLOCK; + void* buf_read = (void*)ALLOC(buf_size); + if (ZSEEK(ziinit.z_filefunc, ziinit.filestream, + offset_central_dir + byte_before_the_zipfile, + ZLIB_FILEFUNC_SEEK_SET) != 0) + err=ZIP_ERRNO; + + while ((size_central_dir_to_read>0) && (err==ZIP_OK)) + { + uLong read_this = SIZEDATA_INDATABLOCK; + if (read_this > size_central_dir_to_read) + read_this = size_central_dir_to_read; + if (ZREAD(ziinit.z_filefunc, ziinit.filestream,buf_read,read_this) != read_this) + err=ZIP_ERRNO; + + if (err==ZIP_OK) + err = add_data_in_datablock(&ziinit.central_dir,buf_read, + (uLong)read_this); + size_central_dir_to_read-=read_this; + } + TRYFREE(buf_read); + } + ziinit.begin_pos = byte_before_the_zipfile; + ziinit.number_entry = number_entry_CD; + + if (ZSEEK(ziinit.z_filefunc, ziinit.filestream, + offset_central_dir+byte_before_the_zipfile,ZLIB_FILEFUNC_SEEK_SET)!=0) + err=ZIP_ERRNO; + } + + if (globalcomment) + { + *globalcomment = ziinit.globalcomment; + } +# endif /* !NO_ADDFILEINEXISTINGZIP*/ + + if (err != ZIP_OK) + { +# ifndef NO_ADDFILEINEXISTINGZIP + TRYFREE(ziinit.globalcomment); +# endif /* !NO_ADDFILEINEXISTINGZIP*/ + TRYFREE(zi); + return NULL; + } + else + { + *zi = ziinit; + return (zipFile)zi; + } +} + +extern zipFile ZEXPORT zipOpen (file, append) + voidpf file; + int append; +{ + return zipOpen2(file,append,NULL,NULL); +} + +extern int ZEXPORT zipOpenNewFileInZip3 (file, filename, zipfi, + extrafield_local, size_extrafield_local, + extrafield_global, size_extrafield_global, + comment, method, level, raw, + windowBits, memLevel, strategy, + password, crcForCrypting) + zipFile file; + const char* filename; + const zip_fileinfo* zipfi; + const void* extrafield_local; + uInt size_extrafield_local; + const void* extrafield_global; + uInt size_extrafield_global; + const char* comment; + int method; + int level; + int raw; + int windowBits; + int memLevel; + int strategy; + const char* password; + uLong crcForCrypting; +{ + zip_internal* zi; + uInt size_filename; + uInt size_comment; + uInt i; + int err = ZIP_OK; + uLong version_to_extract; + +# ifdef NOCRYPT + if (password != NULL) + return ZIP_PARAMERROR; +# endif + + if (file == NULL) + return ZIP_PARAMERROR; + if ((method!=0) && (method!=Z_DEFLATED)) + return ZIP_PARAMERROR; + + zi = (zip_internal*)file; + + if (zi->in_opened_file_inzip == 1) + { + err = zipCloseFileInZip (file); + if (err != ZIP_OK) + return err; + } + + if (method == 0 + && (level == 0 || (zi->flags & ZIP_WRITE_DATA_DESCRIPTOR) == 0)) + { + version_to_extract = 10; + } + else + { + version_to_extract = 20; + } + + + if (filename==NULL) + filename="-"; + + if (comment==NULL) + size_comment = 0; + else + size_comment = (uInt)strlen(comment); + + size_filename = (uInt)strlen(filename); + + if (zipfi == NULL) + zi->ci.dosDate = 0; + else + { + if (zipfi->dosDate != 0) + zi->ci.dosDate = zipfi->dosDate; + else zi->ci.dosDate = ziplocal_TmzDateToDosDate(&zipfi->tmz_date,zipfi->dosDate); + } + + zi->ci.flag = 0; + if ((level==8) || (level==9)) + zi->ci.flag |= 2; + if ((level==2)) + zi->ci.flag |= 4; + if ((level==1)) + zi->ci.flag |= 6; + if (password != NULL) + { + zi->ci.flag |= 1; + } + if (version_to_extract >= 20 + && (zi->flags & ZIP_WRITE_DATA_DESCRIPTOR) != 0) + zi->ci.flag |= 8; + zi->ci.crc32 = 0; + zi->ci.method = method; + zi->ci.encrypt = 0; + zi->ci.stream_initialised = 0; + zi->ci.pos_in_buffered_data = 0; + zi->ci.raw = raw; + zi->ci.pos_local_header = ZTELL(zi->z_filefunc,zi->filestream) ; + zi->ci.size_centralheader = SIZECENTRALHEADER + size_filename + + size_extrafield_global + size_comment; + zi->ci.central_header = (char*)ALLOC((uInt)zi->ci.size_centralheader); + + ziplocal_putValue_inmemory(zi->ci.central_header,(uLong)CENTRALHEADERMAGIC,4); + /* version info */ + ziplocal_putValue_inmemory(zi->ci.central_header+4,(uLong)VERSIONMADEBY,2); + ziplocal_putValue_inmemory(zi->ci.central_header+6,(uLong)version_to_extract,2); + ziplocal_putValue_inmemory(zi->ci.central_header+8,(uLong)zi->ci.flag,2); + ziplocal_putValue_inmemory(zi->ci.central_header+10,(uLong)zi->ci.method,2); + ziplocal_putValue_inmemory(zi->ci.central_header+12,(uLong)zi->ci.dosDate,4); + ziplocal_putValue_inmemory(zi->ci.central_header+16,(uLong)0,4); /*crc*/ + ziplocal_putValue_inmemory(zi->ci.central_header+20,(uLong)0,4); /*compr size*/ + ziplocal_putValue_inmemory(zi->ci.central_header+24,(uLong)0,4); /*uncompr size*/ + ziplocal_putValue_inmemory(zi->ci.central_header+28,(uLong)size_filename,2); + ziplocal_putValue_inmemory(zi->ci.central_header+30,(uLong)size_extrafield_global,2); + ziplocal_putValue_inmemory(zi->ci.central_header+32,(uLong)size_comment,2); + ziplocal_putValue_inmemory(zi->ci.central_header+34,(uLong)0,2); /*disk nm start*/ + + if (zipfi==NULL) + ziplocal_putValue_inmemory(zi->ci.central_header+36,(uLong)0,2); + else + ziplocal_putValue_inmemory(zi->ci.central_header+36,(uLong)zipfi->internal_fa,2); + + if (zipfi==NULL) + ziplocal_putValue_inmemory(zi->ci.central_header+38,(uLong)0,4); + else + ziplocal_putValue_inmemory(zi->ci.central_header+38,(uLong)zipfi->external_fa,4); + + ziplocal_putValue_inmemory(zi->ci.central_header+42,(uLong)zi->ci.pos_local_header- zi->add_position_when_writting_offset,4); + + for (i=0;ici.central_header+SIZECENTRALHEADER+i) = *(filename+i); + + for (i=0;ici.central_header+SIZECENTRALHEADER+size_filename+i) = + *(((const char*)extrafield_global)+i); + + for (i=0;ici.central_header+SIZECENTRALHEADER+size_filename+ + size_extrafield_global+i) = *(comment+i); + if (zi->ci.central_header == NULL) + return ZIP_INTERNALERROR; + + /* write the local header */ + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)LOCALHEADERMAGIC,4); + + if (err==ZIP_OK) + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)version_to_extract,2); + if (err==ZIP_OK) + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->ci.flag,2); + + if (err==ZIP_OK) + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->ci.method,2); + + if (err==ZIP_OK) + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->ci.dosDate,4); + + if (err==ZIP_OK) + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4); /* crc 32, unknown */ + if (err==ZIP_OK) + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4); /* compressed size, unknown */ + if (err==ZIP_OK) + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4); /* uncompressed size, unknown */ + + if (err==ZIP_OK) + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)size_filename,2); + + if (err==ZIP_OK) + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)size_extrafield_local,2); + + if ((err==ZIP_OK) && (size_filename>0)) + if (ZWRITE(zi->z_filefunc,zi->filestream,filename,size_filename)!=size_filename) + err = ZIP_ERRNO; + + if ((err==ZIP_OK) && (size_extrafield_local>0)) + if (ZWRITE(zi->z_filefunc,zi->filestream,extrafield_local,size_extrafield_local) + !=size_extrafield_local) + err = ZIP_ERRNO; + + memset(&zi->ci.stream, '\0', sizeof zi->ci.stream); + zi->ci.stream.avail_in = (uInt)0; + zi->ci.stream.avail_out = (uInt)Z_BUFSIZE; + zi->ci.stream.next_out = zi->ci.buffered_data; + zi->ci.stream.total_in = 0; + zi->ci.stream.total_out = 0; + + if ((err==ZIP_OK) && (zi->ci.method == Z_DEFLATED) && (!zi->ci.raw)) + { + zi->ci.stream.zalloc = (alloc_func)0; + zi->ci.stream.zfree = (free_func)0; + zi->ci.stream.opaque = (voidpf)0; + + if (windowBits>0) + windowBits = -windowBits; + + err = deflateInit2(&zi->ci.stream, level, + Z_DEFLATED, windowBits, memLevel, strategy); + + if (err==Z_OK) + zi->ci.stream_initialised = 1; + } +# ifndef NOCRYPT + zi->ci.crypt_header_size = 0; + if ((err==Z_OK) && (password != NULL)) + { + unsigned char bufHead[RAND_HEAD_LEN]; + unsigned int sizeHead; + zi->ci.encrypt = 1; + zi->ci.pcrc_32_tab = get_crc_table(); + /*init_keys(password,zi->ci.keys,zi->ci.pcrc_32_tab);*/ + + crcForCrypting = (uLong)zi->ci.dosDate << 16; // ATTANTION! Without this row, you don't unpack your password protected archive in other app. + + sizeHead=crypthead(password,bufHead,RAND_HEAD_LEN,zi->ci.keys,zi->ci.pcrc_32_tab,crcForCrypting); + zi->ci.crypt_header_size = sizeHead; + + if (ZWRITE(zi->z_filefunc,zi->filestream,bufHead,sizeHead) != sizeHead) + err = ZIP_ERRNO; + } +# endif + + if (err==Z_OK) + zi->in_opened_file_inzip = 1; + return err; +} + +extern int ZEXPORT zipOpenNewFileInZip2(file, filename, zipfi, + extrafield_local, size_extrafield_local, + extrafield_global, size_extrafield_global, + comment, method, level, raw) + zipFile file; + const char* filename; + const zip_fileinfo* zipfi; + const void* extrafield_local; + uInt size_extrafield_local; + const void* extrafield_global; + uInt size_extrafield_global; + const char* comment; + int method; + int level; + int raw; +{ + return zipOpenNewFileInZip3 (file, filename, zipfi, + extrafield_local, size_extrafield_local, + extrafield_global, size_extrafield_global, + comment, method, level, raw, + -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, + NULL, 0); +} + +extern int ZEXPORT zipOpenNewFileInZip (file, filename, zipfi, + extrafield_local, size_extrafield_local, + extrafield_global, size_extrafield_global, + comment, method, level) + zipFile file; + const char* filename; + const zip_fileinfo* zipfi; + const void* extrafield_local; + uInt size_extrafield_local; + const void* extrafield_global; + uInt size_extrafield_global; + const char* comment; + int method; + int level; +{ + return zipOpenNewFileInZip2 (file, filename, zipfi, + extrafield_local, size_extrafield_local, + extrafield_global, size_extrafield_global, + comment, method, level, 0); +} + +local int zipFlushWriteBuffer(zi) + zip_internal* zi; +{ + int err=ZIP_OK; + + if (zi->ci.encrypt != 0) + { +#ifndef NOCRYPT + uInt i; + int t; + for (i=0;ici.pos_in_buffered_data;i++) + zi->ci.buffered_data[i] = zencode(zi->ci.keys, zi->ci.pcrc_32_tab, + zi->ci.buffered_data[i],t); +#endif + } + if (ZWRITE(zi->z_filefunc,zi->filestream,zi->ci.buffered_data,zi->ci.pos_in_buffered_data) + !=zi->ci.pos_in_buffered_data) + err = ZIP_ERRNO; + zi->ci.pos_in_buffered_data = 0; + return err; +} + +extern int ZEXPORT zipWriteInFileInZip (file, buf, len) + zipFile file; + const void* buf; + unsigned len; +{ + zip_internal* zi; + int err=ZIP_OK; + + if (file == NULL) + return ZIP_PARAMERROR; + zi = (zip_internal*)file; + + if (zi->in_opened_file_inzip == 0) + return ZIP_PARAMERROR; + + zi->ci.stream.next_in = (void*)buf; + zi->ci.stream.avail_in = len; + zi->ci.crc32 = crc32(zi->ci.crc32,buf,len); + + while ((err==ZIP_OK) && (zi->ci.stream.avail_in>0)) + { + if (zi->ci.stream.avail_out == 0) + { + if (zipFlushWriteBuffer(zi) == ZIP_ERRNO) + err = ZIP_ERRNO; + zi->ci.stream.avail_out = (uInt)Z_BUFSIZE; + zi->ci.stream.next_out = zi->ci.buffered_data; + } + + + if(err != ZIP_OK) + break; + + if ((zi->ci.method == Z_DEFLATED) && (!zi->ci.raw)) + { + uLong uTotalOutBefore = zi->ci.stream.total_out; + err=deflate(&zi->ci.stream, Z_NO_FLUSH); + zi->ci.pos_in_buffered_data += (uInt)(zi->ci.stream.total_out - uTotalOutBefore) ; + + } + else + { + uInt copy_this,i; + if (zi->ci.stream.avail_in < zi->ci.stream.avail_out) + copy_this = zi->ci.stream.avail_in; + else + copy_this = zi->ci.stream.avail_out; + for (i=0;ici.stream.next_out)+i) = + *(((const char*)zi->ci.stream.next_in)+i); + { + zi->ci.stream.avail_in -= copy_this; + zi->ci.stream.avail_out-= copy_this; + zi->ci.stream.next_in+= copy_this; + zi->ci.stream.next_out+= copy_this; + zi->ci.stream.total_in+= copy_this; + zi->ci.stream.total_out+= copy_this; + zi->ci.pos_in_buffered_data += copy_this; + } + } + } + + return err; +} + +extern int ZEXPORT zipCloseFileInZipRaw (file, uncompressed_size, crc32) + zipFile file; + uLong uncompressed_size; + uLong crc32; +{ + zip_internal* zi; + uLong compressed_size; + int err=ZIP_OK; + + if (file == NULL) + return ZIP_PARAMERROR; + zi = (zip_internal*)file; + + if (zi->in_opened_file_inzip == 0) + return ZIP_PARAMERROR; + zi->ci.stream.avail_in = 0; + + if ((zi->ci.method == Z_DEFLATED) && (!zi->ci.raw)) + while (err==ZIP_OK) + { + uLong uTotalOutBefore; + if (zi->ci.stream.avail_out == 0) + { + if (zipFlushWriteBuffer(zi) == ZIP_ERRNO) + err = ZIP_ERRNO; + zi->ci.stream.avail_out = (uInt)Z_BUFSIZE; + zi->ci.stream.next_out = zi->ci.buffered_data; + } + uTotalOutBefore = zi->ci.stream.total_out; + err=deflate(&zi->ci.stream, Z_FINISH); + zi->ci.pos_in_buffered_data += (uInt)(zi->ci.stream.total_out - uTotalOutBefore) ; + } + + if (err==Z_STREAM_END) + err=ZIP_OK; /* this is normal */ + + if ((zi->ci.pos_in_buffered_data>0) && (err==ZIP_OK)) + if (zipFlushWriteBuffer(zi)==ZIP_ERRNO) + err = ZIP_ERRNO; + + if ((zi->ci.method == Z_DEFLATED) && (!zi->ci.raw)) + { + err=deflateEnd(&zi->ci.stream); + zi->ci.stream_initialised = 0; + } + + if (!zi->ci.raw) + { + crc32 = (uLong)zi->ci.crc32; + uncompressed_size = (uLong)zi->ci.stream.total_in; + } + compressed_size = (uLong)zi->ci.stream.total_out; +# ifndef NOCRYPT + compressed_size += zi->ci.crypt_header_size; +# endif + + ziplocal_putValue_inmemory(zi->ci.central_header+16,crc32,4); /*crc*/ + ziplocal_putValue_inmemory(zi->ci.central_header+20, + compressed_size,4); /*compr size*/ + if (zi->ci.stream.data_type == Z_ASCII) + ziplocal_putValue_inmemory(zi->ci.central_header+36,(uLong)Z_ASCII,2); + ziplocal_putValue_inmemory(zi->ci.central_header+24, + uncompressed_size,4); /*uncompr size*/ + + if (err==ZIP_OK) + err = add_data_in_datablock(&zi->central_dir,zi->ci.central_header, + (uLong)zi->ci.size_centralheader); + free(zi->ci.central_header); + + if (err==ZIP_OK) + { + uLong cur_pos_inzip = ZTELL(zi->z_filefunc,zi->filestream); + if (ZSEEK(zi->z_filefunc,zi->filestream, + zi->ci.pos_local_header + 14,ZLIB_FILEFUNC_SEEK_SET)!=0) + err = ZIP_ERRNO; + + if (err==ZIP_OK) + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,crc32,4); /* crc 32, unknown */ + + if (err==ZIP_OK) /* compressed size, unknown */ + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,compressed_size,4); + + if (err==ZIP_OK) /* uncompressed size, unknown */ + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,uncompressed_size,4); + + if (ZSEEK(zi->z_filefunc,zi->filestream, + cur_pos_inzip,ZLIB_FILEFUNC_SEEK_SET)!=0) + err = ZIP_ERRNO; + + if ((zi->ci.flag & 8) != 0) { + /* Write local Descriptor after file data */ + if (err==ZIP_OK) + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)DESCRIPTORHEADERMAGIC,4); + + if (err==ZIP_OK) + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,crc32,4); /* crc 32, unknown */ + + if (err==ZIP_OK) /* compressed size, unknown */ + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,compressed_size,4); + + if (err==ZIP_OK) /* uncompressed size, unknown */ + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,uncompressed_size,4); + } + + + } + + zi->number_entry ++; + zi->in_opened_file_inzip = 0; + + return err; +} + +extern int ZEXPORT zipCloseFileInZip (file) + zipFile file; +{ + return zipCloseFileInZipRaw (file,0,0); +} + +extern int ZEXPORT zipClose (file, global_comment) + zipFile file; + const char* global_comment; +{ + zip_internal* zi; + int err = 0; + uLong size_centraldir = 0; + uLong centraldir_pos_inzip; + uInt size_global_comment; + if (file == NULL) + return ZIP_PARAMERROR; + zi = (zip_internal*)file; + + if (zi->in_opened_file_inzip == 1) + { + err = zipCloseFileInZip (file); + } + +#ifndef NO_ADDFILEINEXISTINGZIP + if (global_comment==NULL) + global_comment = zi->globalcomment; +#endif + if (global_comment==NULL) + size_global_comment = 0; + else + size_global_comment = (uInt)strlen(global_comment); + + centraldir_pos_inzip = ZTELL(zi->z_filefunc,zi->filestream); + if (err==ZIP_OK) + { + linkedlist_datablock_internal* ldi = zi->central_dir.first_block ; + while (ldi!=NULL) + { + if ((err==ZIP_OK) && (ldi->filled_in_this_block>0)) + if (ZWRITE(zi->z_filefunc,zi->filestream, + ldi->data,ldi->filled_in_this_block) + !=ldi->filled_in_this_block ) + err = ZIP_ERRNO; + + size_centraldir += ldi->filled_in_this_block; + ldi = ldi->next_datablock; + } + } + free_datablock(zi->central_dir.first_block); + + if (err==ZIP_OK) /* Magic End */ + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)ENDHEADERMAGIC,4); + + if (err==ZIP_OK) /* number of this disk */ + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,2); + + if (err==ZIP_OK) /* number of the disk with the start of the central directory */ + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,2); + + if (err==ZIP_OK) /* total number of entries in the central dir on this disk */ + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->number_entry,2); + + if (err==ZIP_OK) /* total number of entries in the central dir */ + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->number_entry,2); + + if (err==ZIP_OK) /* size of the central directory */ + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)size_centraldir,4); + + if (err==ZIP_OK) /* offset of start of central directory with respect to the + starting disk number */ + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream, + (uLong)(centraldir_pos_inzip - zi->add_position_when_writting_offset),4); + + if (err==ZIP_OK) /* zipfile comment length */ + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)size_global_comment,2); + + if ((err==ZIP_OK) && (size_global_comment>0)) + if (ZWRITE(zi->z_filefunc,zi->filestream, + global_comment,size_global_comment) != size_global_comment) + err = ZIP_ERRNO; + + if (ZCLOSE(zi->z_filefunc,zi->filestream) != 0) + if (err == ZIP_OK) + err = ZIP_ERRNO; + +#ifndef NO_ADDFILEINEXISTINGZIP + TRYFREE(zi->globalcomment); +#endif + TRYFREE(zi); + + return err; +} + +extern int ZEXPORT zipSetFlags(zipFile file, unsigned flags) +{ + zip_internal* zi; + if (file == NULL) + return ZIP_PARAMERROR; + zi = (zip_internal*)file; + zi->flags |= flags; + return ZIP_OK; +} + +extern int ZEXPORT zipClearFlags(zipFile file, unsigned flags) +{ + zip_internal* zi; + if (file == NULL) + return ZIP_PARAMERROR; + zi = (zip_internal*)file; + zi->flags &= ~flags; + return ZIP_OK; +} diff --git a/quazip/zip.h b/3rdparty/quazip-0.5.1/quazip/zip.h similarity index 97% rename from quazip/zip.h rename to 3rdparty/quazip-0.5.1/quazip/zip.h index 053775f0..269ec2da 100644 --- a/quazip/zip.h +++ b/3rdparty/quazip-0.5.1/quazip/zip.h @@ -1,247 +1,245 @@ -/* zip.h -- IO for compress .zip files using zlib - Version 1.01e, February 12th, 2005 - - Copyright (C) 1998-2005 Gilles Vollant - - This unzip package allow creates .ZIP file, compatible with PKZip 2.04g - WinZip, InfoZip tools and compatible. - Multi volume ZipFile (span) are not supported. - Encryption compatible with pkzip 2.04g only supported - Old compressions used by old PKZip 1.x are not supported - - For uncompress .zip file, look at unzip.h - - - I WAIT FEEDBACK at mail info@winimage.com - Visit also http://www.winimage.com/zLibDll/unzip.html for evolution - - Condition of use and distribution are the same than zlib : - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - Modified by Sergey A. Tachenov to integrate with Qt. - - -*/ - -/* for more info about .ZIP format, see - http://www.info-zip.org/pub/infozip/doc/appnote-981119-iz.zip - http://www.info-zip.org/pub/infozip/doc/ - PkWare has also a specification at : - ftp://ftp.pkware.com/probdesc.zip -*/ - -#ifndef _zip_H -#define _zip_H - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef _ZLIB_H -#include "zlib.h" -#endif - -#ifndef _ZLIBIOAPI_H -#include "ioapi.h" -#endif - -#if defined(STRICTZIP) || defined(STRICTZIPUNZIP) -/* like the STRICT of WIN32, we define a pointer that cannot be converted - from (void*) without cast */ -typedef struct TagzipFile__ { int unused; } zipFile__; -typedef zipFile__ *zipFile; -#else -typedef voidp zipFile; -#endif - -#define OF(x) x - -#define ZIP_OK (0) -#define ZIP_EOF (0) -#define ZIP_ERRNO (Z_ERRNO) -#define ZIP_PARAMERROR (-102) -#define ZIP_BADZIPFILE (-103) -#define ZIP_INTERNALERROR (-104) - -#define ZIP_WRITE_DATA_DESCRIPTOR 0x8u - -#ifndef DEF_MEM_LEVEL -# if MAX_MEM_LEVEL >= 8 -# define DEF_MEM_LEVEL 8 -# else -# define DEF_MEM_LEVEL MAX_MEM_LEVEL -# endif -#endif -/* default memLevel */ - -/* tm_zip contain date/time info */ -typedef struct tm_zip_s -{ - uInt tm_sec; /* seconds after the minute - [0,59] */ - uInt tm_min; /* minutes after the hour - [0,59] */ - uInt tm_hour; /* hours since midnight - [0,23] */ - uInt tm_mday; /* day of the month - [1,31] */ - uInt tm_mon; /* months since January - [0,11] */ - uInt tm_year; /* years - [1980..2044] */ -} tm_zip; - -typedef struct -{ - tm_zip tmz_date; /* date in understandable format */ - uLong dosDate; /* if dos_date == 0, tmu_date is used */ -/* uLong flag; */ /* general purpose bit flag 2 bytes */ - - uLong internal_fa; /* internal file attributes 2 bytes */ - uLong external_fa; /* external file attributes 4 bytes */ -} zip_fileinfo; - -typedef const char* zipcharpc; - - -#define APPEND_STATUS_CREATE (0) -#define APPEND_STATUS_CREATEAFTER (1) -#define APPEND_STATUS_ADDINZIP (2) - -extern zipFile ZEXPORT zipOpen OF((voidpf file, int append)); -/* - Create a zipfile. - file is whatever the IO API accepts. For Qt IO API it's a pointer to - QIODevice. For fopen() IO API it's a file name (const char*). - if the file pathname exist and append==APPEND_STATUS_CREATEAFTER, the zip - will be created at the end of the file. - (useful if the file contain a self extractor code) - if the file pathname exist and append==APPEND_STATUS_ADDINZIP, we will - add files in existing zip (be sure you don't add file that doesn't exist) - If the zipfile cannot be opened, the return value is NULL. - Else, the return value is a zipFile Handle, usable with other function - of this zip package. -*/ - -/* Note : there is no delete function into a zipfile. - If you want delete file into a zipfile, you must open a zipfile, and create another - Of couse, you can use RAW reading and writing to copy the file you did not want delte -*/ - -extern zipFile ZEXPORT zipOpen2 OF((voidpf file, - int append, - zipcharpc* globalcomment, - zlib_filefunc_def* pzlib_filefunc_def)); - -extern int ZEXPORT zipOpenNewFileInZip OF((zipFile file, - const char* filename, - const zip_fileinfo* zipfi, - const void* extrafield_local, - uInt size_extrafield_local, - const void* extrafield_global, - uInt size_extrafield_global, - const char* comment, - int method, - int level)); -/* - Open a file in the ZIP for writing. - filename : the filename in zip (if NULL, '-' without quote will be used - *zipfi contain supplemental information - if extrafield_local!=NULL and size_extrafield_local>0, extrafield_local - contains the extrafield data the the local header - if extrafield_global!=NULL and size_extrafield_global>0, extrafield_global - contains the extrafield data the the local header - if comment != NULL, comment contain the comment string - method contain the compression method (0 for store, Z_DEFLATED for deflate) - level contain the level of compression (can be Z_DEFAULT_COMPRESSION) -*/ - - -extern int ZEXPORT zipOpenNewFileInZip2 OF((zipFile file, - const char* filename, - const zip_fileinfo* zipfi, - const void* extrafield_local, - uInt size_extrafield_local, - const void* extrafield_global, - uInt size_extrafield_global, - const char* comment, - int method, - int level, - int raw)); - -/* - Same than zipOpenNewFileInZip, except if raw=1, we write raw file - */ - -extern int ZEXPORT zipOpenNewFileInZip3 OF((zipFile file, - const char* filename, - const zip_fileinfo* zipfi, - const void* extrafield_local, - uInt size_extrafield_local, - const void* extrafield_global, - uInt size_extrafield_global, - const char* comment, - int method, - int level, - int raw, - int windowBits, - int memLevel, - int strategy, - const char* password, - uLong crcForCtypting)); - -/* - Same than zipOpenNewFileInZip2, except - windowBits,memLevel,,strategy : see parameter strategy in deflateInit2 - password : crypting password (NULL for no crypting) - crcForCtypting : crc of file to compress (needed for crypting) - */ - - -extern int ZEXPORT zipWriteInFileInZip OF((zipFile file, - const void* buf, - unsigned len)); -/* - Write data in the zipfile -*/ - -extern int ZEXPORT zipCloseFileInZip OF((zipFile file)); -/* - Close the current file in the zipfile -*/ - -extern int ZEXPORT zipCloseFileInZipRaw OF((zipFile file, - uLong uncompressed_size, - uLong crc32)); -/* - Close the current file in the zipfile, for fiel opened with - parameter raw=1 in zipOpenNewFileInZip2 - uncompressed_size and crc32 are value for the uncompressed size -*/ - -extern int ZEXPORT zipClose OF((zipFile file, - const char* global_comment)); -/* - Close the zipfile -*/ - -/* - Added by Sergey A. Tachenov to tweak zipping behaviour. - */ -extern int ZEXPORT zipSetFlags(zipFile file, unsigned flags); -extern int ZEXPORT zipClearFlags(zipFile file, unsigned flags); - -#ifdef __cplusplus -} -#endif - -#endif /* _zip_H */ +/* zip.h -- IO for compress .zip files using zlib + Version 1.01e, February 12th, 2005 + + Copyright (C) 1998-2005 Gilles Vollant + + This unzip package allow creates .ZIP file, compatible with PKZip 2.04g + WinZip, InfoZip tools and compatible. + Multi volume ZipFile (span) are not supported. + Encryption compatible with pkzip 2.04g only supported + Old compressions used by old PKZip 1.x are not supported + + For uncompress .zip file, look at unzip.h + + + I WAIT FEEDBACK at mail info@winimage.com + Visit also http://www.winimage.com/zLibDll/unzip.html for evolution + + Condition of use and distribution are the same than zlib : + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Modified by Sergey A. Tachenov to integrate with Qt. + + +*/ + +/* for more info about .ZIP format, see + http://www.info-zip.org/pub/infozip/doc/appnote-981119-iz.zip + http://www.info-zip.org/pub/infozip/doc/ + PkWare has also a specification at : + ftp://ftp.pkware.com/probdesc.zip +*/ + +#ifndef _zip_H +#define _zip_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _ZLIB_H +#include "zlib.h" +#endif + +#ifndef _ZLIBIOAPI_H +#include "ioapi.h" +#endif + +#if defined(STRICTZIP) || defined(STRICTZIPUNZIP) +/* like the STRICT of WIN32, we define a pointer that cannot be converted + from (void*) without cast */ +typedef struct TagzipFile__ { int unused; } zipFile__; +typedef zipFile__ *zipFile; +#else +typedef voidp zipFile; +#endif + +#define ZIP_OK (0) +#define ZIP_EOF (0) +#define ZIP_ERRNO (Z_ERRNO) +#define ZIP_PARAMERROR (-102) +#define ZIP_BADZIPFILE (-103) +#define ZIP_INTERNALERROR (-104) + +#define ZIP_WRITE_DATA_DESCRIPTOR 0x8u + +#ifndef DEF_MEM_LEVEL +# if MAX_MEM_LEVEL >= 8 +# define DEF_MEM_LEVEL 8 +# else +# define DEF_MEM_LEVEL MAX_MEM_LEVEL +# endif +#endif +/* default memLevel */ + +/* tm_zip contain date/time info */ +typedef struct tm_zip_s +{ + uInt tm_sec; /* seconds after the minute - [0,59] */ + uInt tm_min; /* minutes after the hour - [0,59] */ + uInt tm_hour; /* hours since midnight - [0,23] */ + uInt tm_mday; /* day of the month - [1,31] */ + uInt tm_mon; /* months since January - [0,11] */ + uInt tm_year; /* years - [1980..2044] */ +} tm_zip; + +typedef struct +{ + tm_zip tmz_date; /* date in understandable format */ + uLong dosDate; /* if dos_date == 0, tmu_date is used */ +/* uLong flag; */ /* general purpose bit flag 2 bytes */ + + uLong internal_fa; /* internal file attributes 2 bytes */ + uLong external_fa; /* external file attributes 4 bytes */ +} zip_fileinfo; + +typedef const char* zipcharpc; + + +#define APPEND_STATUS_CREATE (0) +#define APPEND_STATUS_CREATEAFTER (1) +#define APPEND_STATUS_ADDINZIP (2) + +extern zipFile ZEXPORT zipOpen OF((voidpf file, int append)); +/* + Create a zipfile. + file is whatever the IO API accepts. For Qt IO API it's a pointer to + QIODevice. For fopen() IO API it's a file name (const char*). + if the file pathname exist and append==APPEND_STATUS_CREATEAFTER, the zip + will be created at the end of the file. + (useful if the file contain a self extractor code) + if the file pathname exist and append==APPEND_STATUS_ADDINZIP, we will + add files in existing zip (be sure you don't add file that doesn't exist) + If the zipfile cannot be opened, the return value is NULL. + Else, the return value is a zipFile Handle, usable with other function + of this zip package. +*/ + +/* Note : there is no delete function into a zipfile. + If you want delete file into a zipfile, you must open a zipfile, and create another + Of couse, you can use RAW reading and writing to copy the file you did not want delte +*/ + +extern zipFile ZEXPORT zipOpen2 OF((voidpf file, + int append, + zipcharpc* globalcomment, + zlib_filefunc_def* pzlib_filefunc_def)); + +extern int ZEXPORT zipOpenNewFileInZip OF((zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, + uInt size_extrafield_local, + const void* extrafield_global, + uInt size_extrafield_global, + const char* comment, + int method, + int level)); +/* + Open a file in the ZIP for writing. + filename : the filename in zip (if NULL, '-' without quote will be used + *zipfi contain supplemental information + if extrafield_local!=NULL and size_extrafield_local>0, extrafield_local + contains the extrafield data the the local header + if extrafield_global!=NULL and size_extrafield_global>0, extrafield_global + contains the extrafield data the the local header + if comment != NULL, comment contain the comment string + method contain the compression method (0 for store, Z_DEFLATED for deflate) + level contain the level of compression (can be Z_DEFAULT_COMPRESSION) +*/ + + +extern int ZEXPORT zipOpenNewFileInZip2 OF((zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, + uInt size_extrafield_local, + const void* extrafield_global, + uInt size_extrafield_global, + const char* comment, + int method, + int level, + int raw)); + +/* + Same than zipOpenNewFileInZip, except if raw=1, we write raw file + */ + +extern int ZEXPORT zipOpenNewFileInZip3 OF((zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, + uInt size_extrafield_local, + const void* extrafield_global, + uInt size_extrafield_global, + const char* comment, + int method, + int level, + int raw, + int windowBits, + int memLevel, + int strategy, + const char* password, + uLong crcForCtypting)); + +/* + Same than zipOpenNewFileInZip2, except + windowBits,memLevel,,strategy : see parameter strategy in deflateInit2 + password : crypting password (NULL for no crypting) + crcForCtypting : crc of file to compress (needed for crypting) + */ + + +extern int ZEXPORT zipWriteInFileInZip OF((zipFile file, + const void* buf, + unsigned len)); +/* + Write data in the zipfile +*/ + +extern int ZEXPORT zipCloseFileInZip OF((zipFile file)); +/* + Close the current file in the zipfile +*/ + +extern int ZEXPORT zipCloseFileInZipRaw OF((zipFile file, + uLong uncompressed_size, + uLong crc32)); +/* + Close the current file in the zipfile, for fiel opened with + parameter raw=1 in zipOpenNewFileInZip2 + uncompressed_size and crc32 are value for the uncompressed size +*/ + +extern int ZEXPORT zipClose OF((zipFile file, + const char* global_comment)); +/* + Close the zipfile +*/ + +/* + Added by Sergey A. Tachenov to tweak zipping behaviour. + */ +extern int ZEXPORT zipSetFlags(zipFile file, unsigned flags); +extern int ZEXPORT zipClearFlags(zipFile file, unsigned flags); + +#ifdef __cplusplus +} +#endif + +#endif /* _zip_H */ diff --git a/3rdparty/quazip-0.5.1/qztest/qztest.cpp b/3rdparty/quazip-0.5.1/qztest/qztest.cpp new file mode 100644 index 00000000..05a39fbd --- /dev/null +++ b/3rdparty/quazip-0.5.1/qztest/qztest.cpp @@ -0,0 +1,164 @@ +#include "qztest.h" +#include "testquazip.h" +#include "testquazipfile.h" +#include "testquachecksum32.h" +#include "testjlcompress.h" +#include "testquazipdir.h" +#include "testquagzipfile.h" +#include "testquaziodevice.h" + +#include +#include + +#include +#include +#include +#include + +#include + +bool createTestFiles(const QStringList &fileNames, const QString &dir) +{ + QDir curDir; + foreach (QString fileName, fileNames) { + QString filePath = QDir(dir).filePath(fileName); + QDir testDir = QFileInfo(filePath).dir(); + if (!testDir.exists()) { + if (!curDir.mkpath(testDir.path())) { + qWarning("Couldn't mkpath %s", + testDir.path().toUtf8().constData()); + return false; + } + } + if (fileName.endsWith('/')) { + if (!curDir.mkpath(filePath)) { + qWarning("Couldn't mkpath %s", + fileName.toUtf8().constData()); + return false; + } + } else { + QFile testFile(filePath); + if (!testFile.open(QIODevice::WriteOnly | QIODevice::Text)) { + qWarning("Couldn't create %s", + fileName.toUtf8().constData()); + return false; + } + QTextStream testStream(&testFile); + testStream << "This is a test file named " << fileName << endl; + } + } + return true; +} + +bool createTestArchive(const QString &zipName, + const QStringList &fileNames, + const QString &dir) { + QuaZip zip(zipName); + if (!zip.open(QuaZip::mdCreate)) { + qWarning("Couldn't open %s", zipName.toUtf8().constData()); + return false; + } + int i = 0; + QDateTime dt1; + foreach (QString fileName, fileNames) { + QuaZipFile zipFile(&zip); + QString filePath = QDir(dir).filePath(fileName); + QFileInfo fileInfo(filePath); + QuaZipNewInfo newInfo(fileName, filePath); + if (i == 0) // to test code that needs different timestamps + newInfo.dateTime = newInfo.dateTime.addSecs(-60); + else if (i == 1) // will use for the next file too + dt1 = newInfo.dateTime; + else if (i == 2) // to test identical timestamps + newInfo.dateTime = dt1; + if (!zipFile.open(QIODevice::WriteOnly, + newInfo, NULL, 0, + fileInfo.isDir() ? 0 : 8)) { + qWarning("Couldn't open %s in %s", fileName.toUtf8() + .constData(), zipName.toUtf8().constData()); + return false; + } + if (!fileInfo.isDir()) { + QFile file(filePath); + if (!file.open(QIODevice::ReadOnly)) { + qWarning("Couldn't open %s", filePath.toUtf8() + .constData()); + return false; + } + while (!file.atEnd()) { + char buf[4096]; + qint64 l = file.read(buf, 4096); + if (l <= 0) { + qWarning("Couldn't read %s", filePath.toUtf8() + .constData()); + return false; + } + if (zipFile.write(buf, l) != l) { + qWarning("Couldn't write to %s in %s", + filePath.toUtf8().constData(), + zipName.toUtf8().constData()); + return false; + } + } + file.close(); + } + zipFile.close(); + ++i; + } + zip.setComment(QString("This is the %1 archive").arg(zipName)); + zip.close(); + return QFileInfo(zipName).exists(); +} + +void removeTestFiles(const QStringList &fileNames, const QString &dir) +{ + QDir curDir; + foreach (QString fileName, fileNames) { + curDir.remove(QDir(dir).filePath(fileName)); + } + foreach (QString fileName, fileNames) { + QDir fileDir = QFileInfo(QDir(dir).filePath(fileName)).dir(); + if (fileDir.exists()) { + // Non-empty dirs won't get removed, and that's good. + curDir.rmpath(fileDir.path()); + } + } +} + +int main(int argc, char **argv) +{ + QCoreApplication app(argc, argv); + int err = 0; + { + TestQuaZip testQuaZip; + err = qMax(err, QTest::qExec(&testQuaZip, app.arguments())); + } + { + TestQuaZipFile testQuaZipFile; + err = qMax(err, QTest::qExec(&testQuaZipFile, app.arguments())); + } + { + TestQuaChecksum32 testQuaChecksum32; + err = qMax(err, QTest::qExec(&testQuaChecksum32, app.arguments())); + } + { + TestJlCompress testJlCompress; + err = qMax(err, QTest::qExec(&testJlCompress, app.arguments())); + } + { + TestQuaZipDir testQuaZipDir; + err = qMax(err, QTest::qExec(&testQuaZipDir, app.arguments())); + } + { + TestQuaZIODevice testQuaZIODevice; + err = qMax(err, QTest::qExec(&testQuaZIODevice, app.arguments())); + } + { + TestQuaGzipFile testQuaGzipFile; + err = qMax(err, QTest::qExec(&testQuaGzipFile, app.arguments())); + } + if (err != 0) { + qWarning("There were errors in some of the tests above."); + } + return err; +} diff --git a/3rdparty/quazip-0.5.1/qztest/qztest.h b/3rdparty/quazip-0.5.1/qztest/qztest.h new file mode 100644 index 00000000..94c6eaa5 --- /dev/null +++ b/3rdparty/quazip-0.5.1/qztest/qztest.h @@ -0,0 +1,15 @@ +#ifndef QUAZIP_TEST_QZTEST_H +#define QUAZIP_TEST_QZTEST_H + +#include +#include + +extern bool createTestFiles(const QStringList &fileNames, const QString + &dir = "tmp"); +extern void removeTestFiles(const QStringList &fileNames, const QString + &dir = "tmp"); +extern bool createTestArchive(const QString &zipName, + const QStringList &fileNames, + const QString &dir = "tmp"); + +#endif // QUAZIP_TEST_QZTEST_H diff --git a/3rdparty/quazip-0.5.1/qztest/qztest.pro b/3rdparty/quazip-0.5.1/qztest/qztest.pro new file mode 100644 index 00000000..35522302 --- /dev/null +++ b/3rdparty/quazip-0.5.1/qztest/qztest.pro @@ -0,0 +1,41 @@ +TEMPLATE = app +QT -= gui +CONFIG += qtestlib +CONFIG += console +CONFIG -= app_bundle +DEPENDPATH += . +INCLUDEPATH += . +!win32: LIBS += -lz +win32 { + # workaround for qdatetime.h macro bug + DEFINES += NOMINMAX +} + +# Input +HEADERS += qztest.h \ +testjlcompress.h \ +testquachecksum32.h \ +testquagzipfile.h \ +testquaziodevice.h \ +testquazipdir.h \ +testquazipfile.h \ +testquazip.h + +SOURCES += qztest.cpp \ +testjlcompress.cpp \ +testquachecksum32.cpp \ +testquagzipfile.cpp \ +testquaziodevice.cpp \ +testquazip.cpp \ +testquazipdir.cpp \ +testquazipfile.cpp + +OBJECTS_DIR = .obj +MOC_DIR = .moc + +win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../quazip/release/ -lquazip +else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../quazip/debug/ -lquazip +else:unix: LIBS += -L$$OUT_PWD/../quazip/ -lquazip + +INCLUDEPATH += $$PWD/.. +DEPENDPATH += $$PWD/../quazip diff --git a/3rdparty/quazip-0.5.1/qztest/qztest.sln b/3rdparty/quazip-0.5.1/qztest/qztest.sln new file mode 100644 index 00000000..b468c7ad --- /dev/null +++ b/3rdparty/quazip-0.5.1/qztest/qztest.sln @@ -0,0 +1,26 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual C++ Express 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "qztest", "qztest.vcproj", "{7632B767-D089-4F15-8B1E-C4B3F9EBF592}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "quazip", "..\quazip\quazip.vcproj", "{E4AC5F56-B711-4F0E-BC83-CDE8B6CD53AD}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {7632B767-D089-4F15-8B1E-C4B3F9EBF592}.Debug|Win32.ActiveCfg = Debug|Win32 + {7632B767-D089-4F15-8B1E-C4B3F9EBF592}.Debug|Win32.Build.0 = Debug|Win32 + {7632B767-D089-4F15-8B1E-C4B3F9EBF592}.Release|Win32.ActiveCfg = Release|Win32 + {7632B767-D089-4F15-8B1E-C4B3F9EBF592}.Release|Win32.Build.0 = Release|Win32 + {E4AC5F56-B711-4F0E-BC83-CDE8B6CD53AD}.Debug|Win32.ActiveCfg = Debug|Win32 + {E4AC5F56-B711-4F0E-BC83-CDE8B6CD53AD}.Debug|Win32.Build.0 = Debug|Win32 + {E4AC5F56-B711-4F0E-BC83-CDE8B6CD53AD}.Release|Win32.ActiveCfg = Release|Win32 + {E4AC5F56-B711-4F0E-BC83-CDE8B6CD53AD}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/3rdparty/quazip-0.5.1/qztest/qztest.vcproj b/3rdparty/quazip-0.5.1/qztest/qztest.vcproj new file mode 100644 index 00000000..37ddf8b2 --- /dev/null +++ b/3rdparty/quazip-0.5.1/qztest/qztest.vcproj @@ -0,0 +1,293 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/3rdparty/quazip-0.5.1/qztest/qztest.vcxproj b/3rdparty/quazip-0.5.1/qztest/qztest.vcxproj new file mode 100644 index 00000000..78a2d6ba --- /dev/null +++ b/3rdparty/quazip-0.5.1/qztest/qztest.vcxproj @@ -0,0 +1,126 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {7632B767-D089-4F15-8B1E-C4B3F9EBF592} + qztest + Win32Proj + + + + Application + + + Application + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + Debug\ + Debug\ + true + Release\ + Release\ + true + + + + Disabled + ..;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + QtCored4.lib;QtTestd4.lib;%(AdditionalDependencies) + true + Console + MachineX86 + + + + + ..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + QtCore4.lib;QtTest4.lib;%(AdditionalDependencies) + true + Console + true + true + MachineX86 + + + + + {e4ac5f56-b711-4f0e-bc83-cde8b6cd53ad} + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/3rdparty/quazip-0.5.1/qztest/qztest.vcxproj.filters b/3rdparty/quazip-0.5.1/qztest/qztest.vcxproj.filters new file mode 100644 index 00000000..71acdd23 --- /dev/null +++ b/3rdparty/quazip-0.5.1/qztest/qztest.vcxproj.filters @@ -0,0 +1,94 @@ + + + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + + + \ No newline at end of file diff --git a/3rdparty/quazip-0.5.1/qztest/run_moc.bat b/3rdparty/quazip-0.5.1/qztest/run_moc.bat new file mode 100644 index 00000000..e49c8a14 --- /dev/null +++ b/3rdparty/quazip-0.5.1/qztest/run_moc.bat @@ -0,0 +1,7 @@ +moc -o moc\moc_testjlcompress.cpp testjlcompress.h +moc -o moc\moc_testquachecksum32.cpp testquachecksum32.h +moc -o moc\moc_testquazip.cpp testquazip.h +moc -o moc\moc_testquazipfile.cpp testquazipfile.h +moc -o moc\moc_testquazipdir.cpp testquazipdir.h +moc -o moc\moc_testquagzipfile.cpp testquagzipfile.h +moc -o moc\moc_testquaziodevice.cpp testquaziodevice.h diff --git a/3rdparty/quazip-0.5.1/qztest/testjlcompress.cpp b/3rdparty/quazip-0.5.1/qztest/testjlcompress.cpp new file mode 100644 index 00000000..dcf1e1d1 --- /dev/null +++ b/3rdparty/quazip-0.5.1/qztest/testjlcompress.cpp @@ -0,0 +1,236 @@ +#include "testjlcompress.h" + +#include "qztest.h" + +#include +#include + +#include + +#include + +void TestJlCompress::compressFile_data() +{ + QTest::addColumn("zipName"); + QTest::addColumn("fileName"); + QTest::newRow("simple") << "jlsimplefile.zip" << "test0.txt"; +} + +void TestJlCompress::compressFile() +{ + QFETCH(QString, zipName); + QFETCH(QString, fileName); + QDir curDir; + if (curDir.exists(zipName)) { + if (!curDir.remove(zipName)) + QFAIL("Can't remove zip file"); + } + if (!createTestFiles(QStringList() << fileName)) { + QFAIL("Can't create test file"); + } + QVERIFY(JlCompress::compressFile(zipName, "tmp/" + fileName)); + // get the file list and check it + QStringList fileList = JlCompress::getFileList(zipName); + QCOMPARE(fileList.count(), 1); + QVERIFY(fileList[0] == fileName); + removeTestFiles(QStringList() << fileName); + curDir.remove(zipName); +} + +void TestJlCompress::compressFiles_data() +{ + QTest::addColumn("zipName"); + QTest::addColumn("fileNames"); + QTest::newRow("simple") << "jlsimplefiles.zip" << + (QStringList() << "test0.txt" << "test00.txt"); + QTest::newRow("different subdirs") << "jlsubdirfiles.zip" << + (QStringList() << "subdir1/test1.txt" << "subdir2/test2.txt"); +} + +void TestJlCompress::compressFiles() +{ + QFETCH(QString, zipName); + QFETCH(QStringList, fileNames); + QDir curDir; + if (curDir.exists(zipName)) { + if (!curDir.remove(zipName)) + QFAIL("Can't remove zip file"); + } + if (!createTestFiles(fileNames)) { + QFAIL("Can't create test files"); + } + QStringList realNamesList, shortNamesList; + foreach (QString fileName, fileNames) { + QString realName = "tmp/" + fileName; + realNamesList += realName; + shortNamesList += QFileInfo(realName).fileName(); + } + QVERIFY(JlCompress::compressFiles(zipName, realNamesList)); + // get the file list and check it + QStringList fileList = JlCompress::getFileList(zipName); + QCOMPARE(fileList, shortNamesList); + removeTestFiles(fileNames); + curDir.remove(zipName); +} + +void TestJlCompress::compressDir_data() +{ + QTest::addColumn("zipName"); + QTest::addColumn("fileNames"); + QTest::newRow("simple") << "jldir.zip" << ( + QStringList() << "test0.txt" << "testdir1/test1.txt" + << "testdir2/test2.txt" << "testdir2/subdir/test2sub.txt"); +} + +void TestJlCompress::compressDir() +{ + QFETCH(QString, zipName); + QFETCH(QStringList, fileNames); + QDir curDir; + if (curDir.exists(zipName)) { + if (!curDir.remove(zipName)) + QFAIL("Can't remove zip file"); + } + if (!createTestFiles(fileNames, "compressDir_tmp")) { + QFAIL("Can't create test files"); + } + QVERIFY(JlCompress::compressDir(zipName, "compressDir_tmp")); + // get the file list and check it + QStringList fileList = JlCompress::getFileList(zipName); + qSort(fileList); + qSort(fileNames); + QCOMPARE(fileList, fileNames); + removeTestFiles(fileNames, "compressDir_tmp"); + curDir.remove(zipName); +} + +void TestJlCompress::extractFile_data() +{ + QTest::addColumn("zipName"); + QTest::addColumn("fileNames"); + QTest::addColumn("fileToExtract"); + QTest::addColumn("destName"); + QTest::newRow("simple") << "jlextfile.zip" << ( + QStringList() << "test0.txt" << "testdir1/test1.txt" + << "testdir2/test2.txt" << "testdir2/subdir/test2sub.txt") + << "testdir2/test2.txt" << "test2.txt"; +} + +void TestJlCompress::extractFile() +{ + QFETCH(QString, zipName); + QFETCH(QStringList, fileNames); + QFETCH(QString, fileToExtract); + QFETCH(QString, destName); + QDir curDir; + if (!curDir.mkpath("jlext/jlfile")) { + QFAIL("Couldn't mkpath jlext/jlfile"); + } + if (!createTestFiles(fileNames)) { + QFAIL("Couldn't create test files"); + } + if (!JlCompress::compressDir(zipName, "tmp")) { + QFAIL("Couldn't create test archive"); + } + QVERIFY(!JlCompress::extractFile(zipName, fileToExtract, + "jlext/jlfile/" + destName).isEmpty()); + QFileInfo destInfo("jlext/jlfile/" + destName), srcInfo("tmp/" + + fileToExtract); + QCOMPARE(destInfo.size(), srcInfo.size()); + QCOMPARE(destInfo.permissions(), srcInfo.permissions()); + curDir.remove("jlext/jlfile/" + destName); + curDir.mkdir("jlext/jlfile/" + destName); + QVERIFY(JlCompress::extractFile(zipName, fileToExtract, + "jlext/jlfile/" + destName).isEmpty()); + curDir.rmpath("jlext/jlfile/" + destName); + removeTestFiles(fileNames); + curDir.remove(zipName); +} + +void TestJlCompress::extractFiles_data() +{ + QTest::addColumn("zipName"); + QTest::addColumn("fileNames"); + QTest::addColumn("filesToExtract"); + QTest::newRow("simple") << "jlextfiles.zip" << ( + QStringList() << "test0.txt" << "testdir1/test1.txt" + << "testdir2/test2.txt" << "testdir2/subdir/test2sub.txt") + << (QStringList() << "testdir2/test2.txt" << "testdir1/test1.txt"); +} + +void TestJlCompress::extractFiles() +{ + QFETCH(QString, zipName); + QFETCH(QStringList, fileNames); + QFETCH(QStringList, filesToExtract); + QDir curDir; + if (!curDir.mkpath("jlext/jlfiles")) { + QFAIL("Couldn't mkpath jlext/jlfiles"); + } + if (!createTestFiles(fileNames)) { + QFAIL("Couldn't create test files"); + } + if (!JlCompress::compressDir(zipName, "tmp")) { + QFAIL("Couldn't create test archive"); + } + QVERIFY(!JlCompress::extractFiles(zipName, filesToExtract, + "jlext/jlfiles").isEmpty()); + foreach (QString fileName, filesToExtract) { + QFileInfo fileInfo("jlext/jlfiles/" + fileName); + QFileInfo extInfo("tmp/" + fileName); + QCOMPARE(fileInfo.size(), extInfo.size()); + QCOMPARE(fileInfo.permissions(), extInfo.permissions()); + curDir.remove("jlext/jlfiles/" + fileName); + curDir.rmpath(fileInfo.dir().path()); + } + curDir.rmpath("jlext/jlfiles"); + removeTestFiles(fileNames); + curDir.remove(zipName); +} + +void TestJlCompress::extractDir_data() +{ + QTest::addColumn("zipName"); + QTest::addColumn("fileNames"); + QTest::newRow("simple") << "jlextdir.zip" << ( + QStringList() << "test0.txt" << "testdir1/test1.txt" + << "testdir2/test2.txt" << "testdir2/subdir/test2sub.txt"); + QTest::newRow("separate dir") << "sepdir.zip" << ( + QStringList() << "laj/" << "laj/lajfile.txt"); +} + +void TestJlCompress::extractDir() +{ + QFETCH(QString, zipName); + QFETCH(QStringList, fileNames); + QDir curDir; + if (!curDir.mkpath("jlext/jldir")) { + QFAIL("Couldn't mkpath jlext/jldir"); + } + if (!createTestFiles(fileNames)) { + QFAIL("Couldn't create test files"); + } + if (!createTestArchive(zipName, fileNames)) { + QFAIL("Couldn't create test archive"); + } + QStringList extracted; + QCOMPARE((extracted = JlCompress::extractDir(zipName, "jlext/jldir")) + .count(), fileNames.count()); + foreach (QString fileName, fileNames) { + QString fullName = "jlext/jldir/" + fileName; + QFileInfo fileInfo(fullName); + QFileInfo extInfo("tmp/" + fileName); + if (!fileInfo.isDir()) + QCOMPARE(fileInfo.size(), extInfo.size()); + QCOMPARE(fileInfo.permissions(), extInfo.permissions()); + curDir.remove(fullName); + curDir.rmpath(fileInfo.dir().path()); + QString absolutePath = fileInfo.absoluteFilePath(); + if (fileInfo.isDir() && !absolutePath.endsWith('/')) + absolutePath += '/'; + QVERIFY(extracted.contains(absolutePath)); + } + curDir.rmpath("jlext/jldir"); + removeTestFiles(fileNames); + curDir.remove(zipName); +} diff --git a/3rdparty/quazip-0.5.1/qztest/testjlcompress.h b/3rdparty/quazip-0.5.1/qztest/testjlcompress.h new file mode 100644 index 00000000..c19beb0c --- /dev/null +++ b/3rdparty/quazip-0.5.1/qztest/testjlcompress.h @@ -0,0 +1,23 @@ +#ifndef QUAZIP_TEST_JLCOMPRESS_H +#define QUAZIP_TEST_JLCOMPRESS_H + +#include + +class TestJlCompress: public QObject { + Q_OBJECT +private slots: + void compressFile_data(); + void compressFile(); + void compressFiles_data(); + void compressFiles(); + void compressDir_data(); + void compressDir(); + void extractFile_data(); + void extractFile(); + void extractFiles_data(); + void extractFiles(); + void extractDir_data(); + void extractDir(); +}; + +#endif // QUAZIP_TEST_JLCOMPRESS_H diff --git a/3rdparty/quazip-0.5.1/qztest/testquachecksum32.cpp b/3rdparty/quazip-0.5.1/qztest/testquachecksum32.cpp new file mode 100644 index 00000000..0025531f --- /dev/null +++ b/3rdparty/quazip-0.5.1/qztest/testquachecksum32.cpp @@ -0,0 +1,14 @@ +#include "testquachecksum32.h" + +#include +#include + +#include + +void TestQuaChecksum32::calculate() +{ + QuaCrc32 crc32; + QCOMPARE(crc32.calculate("Wikipedia"), 0xADAAC02Eu); + QuaAdler32 adler32; + QCOMPARE(adler32.calculate("Wikipedia"), 0x11E60398u); +} diff --git a/3rdparty/quazip-0.5.1/qztest/testquachecksum32.h b/3rdparty/quazip-0.5.1/qztest/testquachecksum32.h new file mode 100644 index 00000000..63c6efe0 --- /dev/null +++ b/3rdparty/quazip-0.5.1/qztest/testquachecksum32.h @@ -0,0 +1,12 @@ +#ifndef QUAZIP_TEST_QUACHECKSUM32_H +#define QUAZIP_TEST_QUACHECKSUM32_H + +#include + +class TestQuaChecksum32: public QObject { + Q_OBJECT +private slots: + void calculate(); +}; + +#endif // QUAZIP_TEST_QUACHECKSUM32_H diff --git a/3rdparty/quazip-0.5.1/qztest/testquagzipfile.cpp b/3rdparty/quazip-0.5.1/qztest/testquagzipfile.cpp new file mode 100644 index 00000000..ef3319e2 --- /dev/null +++ b/3rdparty/quazip-0.5.1/qztest/testquagzipfile.cpp @@ -0,0 +1,43 @@ +#include "testquagzipfile.h" +#include +#include +#include +#include + +void TestQuaGzipFile::read() +{ + QDir curDir; + curDir.mkpath("tmp"); + voidp gzFile = gzopen("tmp/test.gz", "wb"); + gzwrite(gzFile, "test", 4); + gzclose(gzFile); + QuaGzipFile testFile("tmp/test.gz"); + QVERIFY(testFile.open(QIODevice::ReadOnly)); + char buf[5]; + buf[4] = '\0'; + QCOMPARE(testFile.read(buf, 5), static_cast(4)); + testFile.close(); + QVERIFY(!testFile.isOpen()); + QCOMPARE(static_cast(buf), "test"); + curDir.remove("tmp/test.gz"); + curDir.rmdir("tmp"); +} + +void TestQuaGzipFile::write() +{ + QDir curDir; + curDir.mkpath("tmp"); + QuaGzipFile testFile("tmp/test.gz"); + QVERIFY(testFile.open(QIODevice::WriteOnly)); + QCOMPARE(testFile.write("test", 4), static_cast(4)); + testFile.close(); + QVERIFY(!testFile.isOpen()); + voidp gzFile = gzopen("tmp/test.gz", "rb"); + char buf[5]; + buf[4] = '\0'; + QCOMPARE(gzread(gzFile, buf, 5), 4); + gzclose(gzFile); + QCOMPARE(static_cast(buf), "test"); + curDir.remove("tmp/test.gz"); + curDir.rmdir("tmp"); +} diff --git a/3rdparty/quazip-0.5.1/qztest/testquagzipfile.h b/3rdparty/quazip-0.5.1/qztest/testquagzipfile.h new file mode 100644 index 00000000..0ecf605c --- /dev/null +++ b/3rdparty/quazip-0.5.1/qztest/testquagzipfile.h @@ -0,0 +1,13 @@ +#ifndef QUAZIP_TEST_QUAGZIPFILE_H +#define QUAZIP_TEST_QUAGZIPFILE_H + +#include + +class TestQuaGzipFile: public QObject { + Q_OBJECT +private slots: + void read(); + void write(); +}; + +#endif // QUAZIP_TEST_QUAGZIPFILE_H diff --git a/3rdparty/quazip-0.5.1/qztest/testquaziodevice.cpp b/3rdparty/quazip-0.5.1/qztest/testquaziodevice.cpp new file mode 100644 index 00000000..8f64361b --- /dev/null +++ b/3rdparty/quazip-0.5.1/qztest/testquaziodevice.cpp @@ -0,0 +1,57 @@ +#include "testquaziodevice.h" +#include +#include +#include +#include + +void TestQuaZIODevice::read() +{ + QByteArray buf(256, 0); + z_stream zouts; + zouts.zalloc = (alloc_func) NULL; + zouts.zfree = (free_func) NULL; + zouts.opaque = NULL; + deflateInit(&zouts, Z_DEFAULT_COMPRESSION); + zouts.next_in = reinterpret_cast(const_cast("test")); + zouts.avail_in = 4; + zouts.next_out = reinterpret_cast(buf.data()); + zouts.avail_out = buf.size(); + deflate(&zouts, Z_FINISH); + deflateEnd(&zouts); + QBuffer testBuffer(&buf); + testBuffer.open(QIODevice::ReadOnly); + QuaZIODevice testDevice(&testBuffer); + QVERIFY(testDevice.open(QIODevice::ReadOnly)); + char outBuf[5]; + QCOMPARE(testDevice.read(outBuf, 5), static_cast(4)); + testDevice.close(); + QVERIFY(!testDevice.isOpen()); +} + +void TestQuaZIODevice::write() +{ + QByteArray buf(256, 0); + QBuffer testBuffer(&buf); + testBuffer.open(QIODevice::WriteOnly); + QuaZIODevice testDevice(&testBuffer); + QVERIFY(testDevice.open(QIODevice::WriteOnly)); + QCOMPARE(testDevice.write("test", 4), static_cast(4)); + testDevice.close(); + QVERIFY(!testDevice.isOpen()); + z_stream zins; + zins.zalloc = (alloc_func) NULL; + zins.zfree = (free_func) NULL; + zins.opaque = NULL; + inflateInit(&zins); + zins.next_in = reinterpret_cast(buf.data()); + zins.avail_in = testBuffer.pos(); + char outBuf[5]; + zins.next_out = reinterpret_cast(outBuf); + zins.avail_out = 5; + inflate(&zins, Z_FINISH); + inflateEnd(&zins); + int size = 5 - zins.avail_out; + QCOMPARE(size, 4); + outBuf[4] = '\0'; + QCOMPARE(static_cast(outBuf), "test"); +} diff --git a/3rdparty/quazip-0.5.1/qztest/testquaziodevice.h b/3rdparty/quazip-0.5.1/qztest/testquaziodevice.h new file mode 100644 index 00000000..1efad7c7 --- /dev/null +++ b/3rdparty/quazip-0.5.1/qztest/testquaziodevice.h @@ -0,0 +1,13 @@ +#ifndef QUAZIP_TEST_QUAZIODEVICE_H +#define QUAZIP_TEST_QUAZIODEVICE_H + +#include + +class TestQuaZIODevice: public QObject { + Q_OBJECT +private slots: + void read(); + void write(); +}; + +#endif // QUAZIP_TEST_QUAZIODEVICE_H diff --git a/3rdparty/quazip-0.5.1/qztest/testquazip.cpp b/3rdparty/quazip-0.5.1/qztest/testquazip.cpp new file mode 100644 index 00000000..6728289c --- /dev/null +++ b/3rdparty/quazip-0.5.1/qztest/testquazip.cpp @@ -0,0 +1,125 @@ +#include "testquazip.h" + +#include "qztest.h" + +#include +#include +#include + +#include + +#include +#include + +void TestQuaZip::getFileList_data() +{ + QTest::addColumn("zipName"); + QTest::addColumn("fileNames"); + QTest::newRow("simple") << "qzfilelist.zip" << ( + QStringList() << "test0.txt" << "testdir1/test1.txt" + << "testdir2/test2.txt" << "testdir2/subdir/test2sub.txt"); + QTest::newRow("russian") << QString::fromUtf8("файл.zip") << ( + QStringList() << QString::fromUtf8("test0.txt") << QString::fromUtf8("test1/test1.txt") + << "testdir2/test2.txt" << "testdir2/subdir/test2sub.txt"); + QTest::newRow("japanese") << QString::fromUtf8("テスト.zip") << ( + QStringList() << QString::fromUtf8("test.txt")); + QTest::newRow("hebrew") << QString::fromUtf8("פתח תקווה.zip") << ( + QStringList() << QString::fromUtf8("test.txt")); +} + +void TestQuaZip::getFileList() +{ + QFETCH(QString, zipName); + QFETCH(QStringList, fileNames); + qSort(fileNames); + QDir curDir; + if (curDir.exists(zipName)) { + if (!curDir.remove(zipName)) + QFAIL("Can't remove zip file"); + } + if (!createTestFiles(fileNames)) { + QFAIL("Can't create test file"); + } + if (!createTestArchive(zipName, fileNames)) { + QFAIL("Can't create test archive"); + } + QuaZip testZip(zipName); + QVERIFY(testZip.open(QuaZip::mdUnzip)); + QVERIFY(testZip.goToFirstFile()); + QString firstFile = testZip.getCurrentFileName(); + QStringList fileList = testZip.getFileNameList(); + qSort(fileList); + QCOMPARE(fileList, fileNames); + QHash srcInfo; + foreach (QString fileName, fileNames) { + srcInfo[fileName] = QFileInfo("tmp/" + fileName); + } + QList destList = testZip.getFileInfoList(); + QCOMPARE(destList.size(), srcInfo.size()); + for (int i = 0; i < destList.size(); i++) { + QCOMPARE(static_cast(destList[i].uncompressedSize), + srcInfo[destList[i].name].size()); + } + // test that we didn't mess up the current file + QCOMPARE(testZip.getCurrentFileName(), firstFile); + testZip.close(); + // clean up + removeTestFiles(fileNames); + curDir.remove(zipName); +} + +void TestQuaZip::add_data() +{ + QTest::addColumn("zipName"); + QTest::addColumn("fileNames"); + QTest::addColumn("fileNamesToAdd"); + QTest::newRow("simple") << "qzadd.zip" << ( + QStringList() << "test0.txt" << "testdir1/test1.txt" + << "testdir2/test2.txt" << "testdir2/subdir/test2sub.txt") + << (QStringList() << "testAdd.txt"); +} + +void TestQuaZip::add() +{ + QFETCH(QString, zipName); + QFETCH(QStringList, fileNames); + QFETCH(QStringList, fileNamesToAdd); + QDir curDir; + if (curDir.exists(zipName)) { + if (!curDir.remove(zipName)) + QFAIL("Can't remove zip file"); + } + if (!createTestFiles(fileNames)) { + QFAIL("Can't create test file"); + } + if (!createTestArchive(zipName, fileNames)) { + QFAIL("Can't create test archive"); + } + if (!createTestFiles(fileNamesToAdd)) { + QFAIL("Can't create test files to add"); + } + QuaZip testZip(zipName); + QVERIFY(testZip.open(QuaZip::mdUnzip)); + // according to the bug #3485459 the global is lost, so we test it + QString globalComment = testZip.getComment(); + testZip.close(); + QVERIFY(testZip.open(QuaZip::mdAdd)); + foreach (QString fileName, fileNamesToAdd) { + QuaZipFile testFile(&testZip); + QVERIFY(testFile.open(QIODevice::WriteOnly, + QuaZipNewInfo(fileName, "tmp/" + fileName))); + QFile inFile("tmp/" + fileName); + QVERIFY(inFile.open(QIODevice::ReadOnly)); + testFile.write(inFile.readAll()); + inFile.close(); + testFile.close(); + } + testZip.close(); + QVERIFY(testZip.open(QuaZip::mdUnzip)); + QCOMPARE(testZip.getFileNameList(), fileNames + fileNamesToAdd); + QCOMPARE(testZip.getComment(), globalComment); + testZip.close(); + removeTestFiles(fileNames); + removeTestFiles(fileNamesToAdd); + curDir.remove(zipName); +} diff --git a/3rdparty/quazip-0.5.1/qztest/testquazip.h b/3rdparty/quazip-0.5.1/qztest/testquazip.h new file mode 100644 index 00000000..b22f9d0b --- /dev/null +++ b/3rdparty/quazip-0.5.1/qztest/testquazip.h @@ -0,0 +1,15 @@ +#ifndef QUAZIP_TEST_QUAZIP_H +#define QUAZIP_TEST_QUAZIP_H + +#include + +class TestQuaZip: public QObject { + Q_OBJECT +private slots: + void getFileList_data(); + void getFileList(); + void add_data(); + void add(); +}; + +#endif // QUAZIP_TEST_QUAZIP_H diff --git a/3rdparty/quazip-0.5.1/qztest/testquazipdir.cpp b/3rdparty/quazip-0.5.1/qztest/testquazipdir.cpp new file mode 100644 index 00000000..83780aeb --- /dev/null +++ b/3rdparty/quazip-0.5.1/qztest/testquazipdir.cpp @@ -0,0 +1,154 @@ +#include "testquazipdir.h" +#include "qztest.h" +#include +#include +#include + +void TestQuaZipDir::entryList_data() +{ + QTest::addColumn("zipName"); + QTest::addColumn("fileNames"); + QTest::addColumn("dirName"); + // QDir::Filters type breaks Qt meta type system on MSVC + QTest::addColumn("filter"); + QTest::addColumn("sort"); + QTest::addColumn("entries"); + QTest::newRow("simple") << "simple.zip" << ( + QStringList() << "test0.txt" << "testdir1/test1.txt" + << "testdir2/test2.txt" << "testdir2/subdir/test2sub.txt") + << "testdir2" << static_cast(QDir::NoFilter) + << static_cast(QDir::Unsorted) + << (QStringList() << "test2.txt" << "subdir/"); + QTest::newRow("separate dir") << "sepdir.zip" << ( + QStringList() << "laj/" << "laj/lajfile.txt") + << "" << static_cast(QDir::NoFilter) + << static_cast(QDir::Unsorted) + << (QStringList() << "laj/"); + QTest::newRow("separate dir (subdir listing)") << "sepdirsub.zip" << ( + QStringList() << "laj/" << "laj/lajfile.txt") + << "laj" << static_cast(QDir::NoFilter) + << static_cast(QDir::Unsorted) + << (QStringList() << "lajfile.txt"); + QTest::newRow("dirs only") << "dirsonly.zip" << ( + QStringList() << "file" << "dir/") + << "" << static_cast(QDir::Dirs) + << static_cast(QDir::Unsorted) + << (QStringList() << "dir/"); + QTest::newRow("files only") << "filesonly.zip" << ( + QStringList() << "file1" << "parent/dir/" << "parent/file2") + << "parent" << static_cast(QDir::Files) + << static_cast(QDir::Unsorted) + << (QStringList() << "file2"); + QTest::newRow("sorted") << "sorted.zip" << ( + QStringList() << "file1" << "parent/subdir/" << "parent/subdir2/file3" << "parent/file2" << "parent/file0") + << "parent" << static_cast(QDir::NoFilter) + << static_cast(QDir::Name) + << (QStringList() << "file0" << "file2" << "subdir/" << "subdir2/"); + QTest::newRow("sorted dirs first") << "sorted-dirs.zip" << ( + QStringList() << "file1" << "parent/subdir/" << "parent/subdir2/file3" << "parent/file2" << "parent/file0") + << "parent" << static_cast(QDir::NoFilter) + << static_cast(QDir::Name | QDir::DirsFirst) + << (QStringList() << "subdir/" << "subdir2/" << "file0" << "file2"); + QTest::newRow("sorted dirs first reversed") << "sorted-reverse.zip" << ( + QStringList() << "file1" << "parent/subdir/" << "parent/subdir2/file3" << "parent/file2" << "parent/file0") + << "parent" << static_cast(QDir::NoFilter) + << static_cast(QDir::Name | QDir::DirsFirst | QDir::Reversed) + << (QStringList() << "subdir2/" << "subdir/" << "file2" << "file0"); + QTest::newRow("sorted by size") << "sorted-size.zip" << ( + QStringList() << "file000" << "file10") + << "/" << static_cast(QDir::NoFilter) + << static_cast(QDir::Size) + << (QStringList() << "file10" << "file000"); + QTest::newRow("sorted by time") << "sorted-time.zip" << ( + QStringList() << "file04" << "file03" << "file02" << "subdir/subfile") + << "/" << static_cast(QDir::NoFilter) + << static_cast(QDir::Time) + << (QStringList() << "subdir/" << "file04" << "file02" << "file03"); +} + +void TestQuaZipDir::entryList() +{ + QFETCH(QString, zipName); + QFETCH(QStringList, fileNames); + QFETCH(QString, dirName); + QFETCH(int, filter); + QFETCH(int, sort); + QDir::Filters filters = static_cast(filter); + QDir::SortFlags sorting = static_cast(sort); + QFETCH(QStringList, entries); + QDir curDir; + if (!createTestFiles(fileNames)) { + QFAIL("Couldn't create test files"); + } + if (!createTestArchive(zipName, fileNames)) { + QFAIL("Couldn't create test archive"); + } + removeTestFiles(fileNames); + QuaZip zip(zipName); + QVERIFY(zip.open(QuaZip::mdUnzip)); + QuaZipDir dir(&zip, dirName); + QCOMPARE(dir.entryList(filters, sorting), entries); + zip.close(); + curDir.remove(zipName); +} + +void TestQuaZipDir::cd_data() +{ + QTest::addColumn("zipName"); + QTest::addColumn("fileNames"); + QTest::addColumn("dirName"); + QTest::addColumn("targetDirName"); + QTest::addColumn("result"); + QTest::newRow("cdDown") << "simple.zip" << ( + QStringList() << "cddown.txt" << "testdir1/test1.txt" + << "testdir2/test2.txt" << "testdir2/subdir/test2sub.txt") + << "" << "testdir1" << "testdir1"; + QTest::newRow("cdUp") << "cdup.zip" << ( + QStringList() << "test0.txt" << "testdir1/test1.txt" + << "testdir2/test2.txt" << "testdir2/subdir/test2sub.txt") + << "testdir1" << ".." << ""; + QTest::newRow("cdSide") << "cdside.zip" << ( + QStringList() << "test0.txt" << "testdir1/test1.txt" + << "testdir2/test2.txt" << "testdir2/subdir/test2sub.txt") + << "testdir1" << "../testdir2" << "testdir2"; + QTest::newRow("cdDownUp") << "cdside.zip" << ( + QStringList() << "test0.txt" << "testdir1/test1.txt" + << "testdir2/test2.txt" << "testdir2/subdir/test2sub.txt") + << "" << "testdir1/.." << ""; + QTest::newRow("cdDeep") << "cdside.zip" << ( + QStringList() << "test0.txt" << "testdir1/test1.txt" + << "testdir2/test2.txt" << "testdir2/subdir/test2sub.txt") + << "" << "testdir2/subdir" << "testdir2/subdir"; + QTest::newRow("cdDeeper") << "cdside.zip" << ( + QStringList() << "test0.txt" << "testdir1/test1.txt" + << "testdir2/test2.txt" << "testdir2/subdir/subdir2/subdir3/test2sub.txt") + << "testdir2/subdir" << "subdir2/subdir3" << "testdir2/subdir/subdir2/subdir3"; + QTest::newRow("cdRoot") << "cdup.zip" << ( + QStringList() << "test0.txt" << "testdir1/test1.txt" + << "testdir2/test2.txt" << "testdir2/subdir/test2sub.txt") + << "testdir1" << "/" << ""; +} + +void TestQuaZipDir::cd() +{ + QFETCH(QString, zipName); + QFETCH(QStringList, fileNames); + QFETCH(QString, dirName); + QFETCH(QString, targetDirName); + QFETCH(QString, result); + QDir curDir; + if (!createTestFiles(fileNames)) { + QFAIL("Couldn't create test files"); + } + if (!createTestArchive(zipName, fileNames)) { + QFAIL("Couldn't create test archive"); + } + removeTestFiles(fileNames); + QuaZip zip(zipName); + QVERIFY(zip.open(QuaZip::mdUnzip)); + QuaZipDir dir(&zip, dirName); + QVERIFY(dir.cd(targetDirName)); + QCOMPARE(dir.path(), result); + zip.close(); + curDir.remove(zipName); +} diff --git a/3rdparty/quazip-0.5.1/qztest/testquazipdir.h b/3rdparty/quazip-0.5.1/qztest/testquazipdir.h new file mode 100644 index 00000000..b7585e26 --- /dev/null +++ b/3rdparty/quazip-0.5.1/qztest/testquazipdir.h @@ -0,0 +1,15 @@ +#ifndef QUAZIP_TEST_QUAZIPDIR_H +#define QUAZIP_TEST_QUAZIPDIR_H + +#include + +class TestQuaZipDir: public QObject { + Q_OBJECT +private slots: + void entryList_data(); + void entryList(); + void cd_data(); + void cd(); +}; + +#endif // QUAZIP_TEST_QUAZIPDIR_H diff --git a/3rdparty/quazip-0.5.1/qztest/testquazipfile.cpp b/3rdparty/quazip-0.5.1/qztest/testquazipfile.cpp new file mode 100644 index 00000000..6d89c4d1 --- /dev/null +++ b/3rdparty/quazip-0.5.1/qztest/testquazipfile.cpp @@ -0,0 +1,214 @@ +#include "testquazipfile.h" + +#include "qztest.h" + +#include +#include +#include + +#include +#include +#include + +#include + +void TestQuaZipFile::zipUnzip_data() +{ + QTest::addColumn("zipName"); + QTest::addColumn("fileNames"); + QTest::addColumn("fileNameCodec"); + QTest::newRow("simple") << "simple.zip" << ( + QStringList() << "test0.txt" << "testdir1/test1.txt" + << "testdir2/test2.txt" << "testdir2/subdir/test2sub.txt") + << QByteArray(); + QTest::newRow("Cyrillic") << "cyrillic.zip" << ( + QStringList() + << QString::fromUtf8("русское имя файла с пробелами.txt")) + << QByteArray("IBM866"); +} + +void TestQuaZipFile::zipUnzip() +{ + QFETCH(QString, zipName); + QFETCH(QStringList, fileNames); + QFETCH(QByteArray, fileNameCodec); + QFile testFile(zipName); + if (testFile.exists()) { + if (!testFile.remove()) { + QFAIL("Couldn't remove existing archive to create a new one"); + } + } + if (!createTestFiles(fileNames)) { + QFAIL("Couldn't create test files for zipping"); + } + QuaZip testZip(&testFile); + if (!fileNameCodec.isEmpty()) + testZip.setFileNameCodec(fileNameCodec); + QVERIFY(testZip.open(QuaZip::mdCreate)); + QString comment = "Test comment"; + testZip.setComment(comment); + foreach (QString fileName, fileNames) { + QFile inFile("tmp/" + fileName); + if (!inFile.open(QIODevice::ReadOnly)) { + qDebug("File name: %s", fileName.toUtf8().constData()); + QFAIL("Couldn't open input file"); + } + QuaZipFile outFile(&testZip); + QVERIFY(outFile.open(QIODevice::WriteOnly, QuaZipNewInfo(fileName, + inFile.fileName()))); + for (qint64 pos = 0, len = inFile.size(); pos < len; ) { + char buf[4096]; + qint64 readSize = qMin(static_cast(4096), len - pos); + qint64 l; + if ((l = inFile.read(buf, readSize)) != readSize) { + qDebug("Reading %ld bytes from %s at %ld returned %ld", + static_cast(readSize), + fileName.toUtf8().constData(), + static_cast(pos), + static_cast(l)); + QFAIL("Read failure"); + } + QVERIFY(outFile.write(buf, readSize)); + pos += readSize; + } + inFile.close(); + outFile.close(); + QCOMPARE(outFile.getZipError(), ZIP_OK); + } + testZip.close(); + QCOMPARE(testZip.getZipError(), ZIP_OK); + // now test unzip + QuaZip testUnzip(&testFile); + if (!fileNameCodec.isEmpty()) + testUnzip.setFileNameCodec(fileNameCodec); + QVERIFY(testUnzip.open(QuaZip::mdUnzip)); + QCOMPARE(testUnzip.getComment(), comment); + QVERIFY(testUnzip.goToFirstFile()); + foreach (QString fileName, fileNames) { + QCOMPARE(testUnzip.getCurrentFileName(), fileName); + testUnzip.goToNextFile(); + } + testUnzip.close(); + QCOMPARE(testUnzip.getZipError(), UNZ_OK); + // clean up + removeTestFiles(fileNames); + testFile.remove(); +} + +void TestQuaZipFile::bytesAvailable_data() +{ + QTest::addColumn("zipName"); + QTest::addColumn("fileNames"); + QTest::newRow("simple") << "test.zip" << ( + QStringList() << "test0.txt" << "testdir1/test1.txt" + << "testdir2/test2.txt" << "testdir2/subdir/test2sub.txt"); +} + +void TestQuaZipFile::bytesAvailable() +{ + QFETCH(QString, zipName); + QFETCH(QStringList, fileNames); + QDir curDir; + if (!createTestFiles(fileNames)) { + QFAIL("Couldn't create test files"); + } + if (!JlCompress::compressDir(zipName, "tmp")) { + QFAIL("Couldn't create test archive"); + } + QuaZip testZip(zipName); + QVERIFY(testZip.open(QuaZip::mdUnzip)); + foreach (QString fileName, fileNames) { + QFileInfo fileInfo("tmp/" + fileName); + QVERIFY(testZip.setCurrentFile(fileName)); + QuaZipFile zipFile(&testZip); + QVERIFY(zipFile.open(QIODevice::ReadOnly)); + QCOMPARE(zipFile.bytesAvailable(), fileInfo.size()); + QCOMPARE(zipFile.read(1).size(), 1); + QCOMPARE(zipFile.bytesAvailable(), fileInfo.size() - 1); + QCOMPARE(zipFile.read(fileInfo.size() - 1).size(), + static_cast(fileInfo.size() - 1)); + QCOMPARE(zipFile.bytesAvailable(), (qint64) 0); + } + removeTestFiles(fileNames); + testZip.close(); + curDir.remove(zipName); +} + +void TestQuaZipFile::atEnd_data() +{ + bytesAvailable_data(); +} + +void TestQuaZipFile::atEnd() +{ + QFETCH(QString, zipName); + QFETCH(QStringList, fileNames); + QDir curDir; + if (!createTestFiles(fileNames)) { + QFAIL("Couldn't create test files"); + } + if (!JlCompress::compressDir(zipName, "tmp")) { + QFAIL("Couldn't create test archive"); + } + QuaZip testZip(zipName); + QVERIFY(testZip.open(QuaZip::mdUnzip)); + foreach (QString fileName, fileNames) { + QFileInfo fileInfo("tmp/" + fileName); + QVERIFY(testZip.setCurrentFile(fileName)); + QuaZipFile zipFile(&testZip); + QVERIFY(zipFile.open(QIODevice::ReadOnly)); + QCOMPARE(zipFile.atEnd(), false); + QCOMPARE(zipFile.read(1).size(), 1); + QCOMPARE(zipFile.atEnd(), false); + QCOMPARE(zipFile.read(fileInfo.size() - 1).size(), + static_cast(fileInfo.size() - 1)); + QCOMPARE(zipFile.atEnd(), true); + } + removeTestFiles(fileNames); + testZip.close(); + curDir.remove(zipName); +} + +void TestQuaZipFile::pos_data() +{ + bytesAvailable_data(); +} + +void TestQuaZipFile::pos() +{ + QFETCH(QString, zipName); + QFETCH(QStringList, fileNames); + QDir curDir; + if (!createTestFiles(fileNames)) { + QFAIL("Couldn't create test files"); + } + if (!JlCompress::compressDir(zipName, "tmp")) { + QFAIL("Couldn't create test archive"); + } + QuaZip testZip(zipName); + QVERIFY(testZip.open(QuaZip::mdUnzip)); + foreach (QString fileName, fileNames) { + QFileInfo fileInfo("tmp/" + fileName); + QVERIFY(testZip.setCurrentFile(fileName)); + QuaZipFile zipFile(&testZip); + QVERIFY(zipFile.open(QIODevice::ReadOnly)); + QCOMPARE(zipFile.pos(), (qint64) 0); + QCOMPARE(zipFile.read(1).size(), 1); + QCOMPARE(zipFile.pos(), (qint64) 1); + QCOMPARE(zipFile.read(fileInfo.size() - 1).size(), + static_cast(fileInfo.size() - 1)); + QCOMPARE(zipFile.pos(), fileInfo.size()); + } + removeTestFiles(fileNames); + testZip.close(); + curDir.remove(zipName); +} + +void TestQuaZipFile::getZip() +{ + QuaZip testZip; + QuaZipFile f1(&testZip); + QCOMPARE(f1.getZip(), &testZip); + QuaZipFile f2("doesntexist.zip", "someFile"); + QCOMPARE(f2.getZip(), static_cast(NULL)); +} diff --git a/3rdparty/quazip-0.5.1/qztest/testquazipfile.h b/3rdparty/quazip-0.5.1/qztest/testquazipfile.h new file mode 100644 index 00000000..17e7e063 --- /dev/null +++ b/3rdparty/quazip-0.5.1/qztest/testquazipfile.h @@ -0,0 +1,21 @@ +#ifndef QUAZIP_TEST_QUAZIPFILE_H +#define QUAZIP_TEST_QUAZIPFILE_H + +#include +#include + +class TestQuaZipFile: public QObject { + Q_OBJECT +private slots: + void zipUnzip_data(); + void zipUnzip(); + void bytesAvailable_data(); + void bytesAvailable(); + void atEnd_data(); + void atEnd(); + void pos_data(); + void pos(); + void getZip(); +}; + +#endif // QUAZIP_TEST_QUAZIPFILE_H diff --git a/SleepyHeadQT.pro b/SleepyHeadQT.pro index 3e1aacb0..6dddfce4 100644 --- a/SleepyHeadQT.pro +++ b/SleepyHeadQT.pro @@ -19,9 +19,6 @@ CONFIG += rtti # message("Static build.") #} -#CONFIG += link_pkgconfig -#PKGCONFIG += freetype2 - TARGET = SleepyHead unix:!macx { TARGET.path=/usr/bin @@ -31,14 +28,33 @@ TEMPLATE = app # GIT_VERSION = $$system(git describe --tags --long --abbrev=6 --dirty="*") - -#exists(.git):DEFINES += GIT_BRANCH=\\\"$$system(git rev-parse --symbolic-full-name --abbrev-ref HEAD)\\\" exists(.git):DEFINES += GIT_BRANCH=\\\"$$system(git rev-parse --abbrev-ref HEAD)\\\" else:DEFINES += GIT_BRANCH=\\\"UNKNOWN\\\" exists(.git):DEFINES += GIT_REVISION=\\\"$$system(git rev-parse HEAD)\\\" else:DEFINES += GIT_REVISION=\\\"UNKNOWN\\\" +unix:!macx:LIBS += -lX11 -lz -lGLU + +macx { + SOURCES += + LIBS += -framework IOKit -framework CoreFoundation -lz + ICON = icons/iconfile.icns +} + +win32 { + DEFINES += WINVER=0x0501 # needed for mingw to pull in appropriate dbt business...probably a better way to do this + LIBS += -lsetupapi -lz +} +if (win32-msvc2008|win32-msvc2010|win32-msvc2012):!equals(TEMPLATE_PREFIX, "vc") { + LIBS += -ladvapi32 + DEFINES += BUILD_WITH_MSVC=1 +} + +include(3rdparty/qextserialport/src/qextserialport.pri) +include(3rdparty/quazip-0.5.1/quazip/quazip.pri) + + SOURCES += main.cpp\ SleepLib/machine.cpp \ SleepLib/machine_loader.cpp \ @@ -63,7 +79,6 @@ SOURCES += main.cpp\ Graphs/gFlagsLine.cpp \ Graphs/glcommon.cpp \ Graphs/gSegmentChart.cpp \ - qextserialport/qextserialport.cpp \ preferencesdialog.cpp \ Graphs/gGraphView.cpp \ Graphs/gStatsLine.cpp \ @@ -76,15 +91,6 @@ SOURCES += main.cpp\ SleepLib/loader_plugins/intellipap_loader.cpp \ SleepLib/calcs.cpp \ updateparser.cpp \ - quazip/zip.c \ - quazip/unzip.c \ - quazip/quazipnewinfo.cpp \ - quazip/quazipfile.cpp \ - quazip/quazip.cpp \ - quazip/quacrc32.cpp \ - quazip/quaadler32.cpp \ - quazip/qioapi.cpp \ - quazip/JlCompress.cpp \ UpdaterWindow.cpp \ SleepLib/common.cpp \ SleepLib/loader_plugins/icon_loader.cpp \ @@ -92,27 +98,6 @@ SOURCES += main.cpp\ reports.cpp \ summary.cpp -unix:SOURCES += qextserialport/posix_qextserialport.cpp -unix:!macx:SOURCES += qextserialport/qextserialenumerator_unix.cpp -unix:!macx:LIBS += -lX11 -lz -lGLU - -macx { - SOURCES += qextserialport/qextserialenumerator_osx.cpp - LIBS += -framework IOKit -framework CoreFoundation -lz - ICON = icons/iconfile.icns -} - -win32 { - SOURCES += qextserialport/win_qextserialport.cpp qextserialport/qextserialenumerator_win.cpp - DEFINES += WINVER=0x0501 # needed for mingw to pull in appropriate dbt business...probably a better way to do this - LIBS += -lsetupapi -lz - - -} -if (win32-msvc2008|win32-msvc2010):!equals(TEMPLATE_PREFIX, "vc") { - LIBS += -ladvapi32 - DEFINES += BUILD_WITH_MSVC=1 -} HEADERS += \ SleepLib/machine.h \ SleepLib/machine_loader.h \ @@ -138,9 +123,6 @@ HEADERS += \ Graphs/glcommon.h \ Graphs/gSegmentChart.h\ SleepLib/loader_plugins/resmed_loader.h \ - qextserialport/qextserialport_global.h \ - qextserialport/qextserialport.h \ - qextserialport/qextserialenumerator.h \ preferencesdialog.h \ Graphs/gGraphView.h \ Graphs/gStatsLine.h \ @@ -154,19 +136,6 @@ HEADERS += \ SleepLib/calcs.h \ version.h \ updateparser.h \ - quazip/zip.h \ - quazip/unzip.h \ - quazip/quazipnewinfo.h \ - quazip/quazip_global.h \ - quazip/quazipfileinfo.h \ - quazip/quazipfile.h \ - quazip/quazip.h \ - quazip/quacrc32.h \ - quazip/quachecksum32.h \ - quazip/quaadler32.h \ - quazip/JlCompress.h \ - quazip/ioapi.h \ - quazip/crypt.h \ UpdaterWindow.h \ SleepLib/common.h \ SleepLib/loader_plugins/icon_loader.h \ @@ -187,13 +156,6 @@ FORMS += \ exportcsv.ui \ UpdaterWindow.ui -TRANSLATIONS += \ - Translations/Nederlands.nl_NL.ts \ - Translations/Francais.fr.ts \ - Translations/Svenska.se.ts \ - Translations/Deutsch.de_DE.ts \ - Translations/Espaniol.es.ts - RESOURCES += \ Resources.qrc @@ -212,8 +174,15 @@ OTHER_FILES += \ docs/script.js \ update.xml \ docs/changelog.txt \ - docs/update_notes.html + docs/update_notes.html \ + qextserialport/qextserialport.pri +TRANSLATIONS += \ + Translations/Nederlands.nl_NL.ts \ + Translations/Francais.fr.ts \ + Translations/Svenska.se.ts \ + Translations/Deutsch.de_DE.ts \ + Translations/Espaniol.es.ts win32 { CONFIG(debug, debug|release) { @@ -223,9 +192,6 @@ win32 { DDIR = $$OUT_PWD/release/Translations } DDIR ~= s,/,\\,g - # install_trans.path = $$DDIR/Translations - # install_trans.files = $$PWD/Translations/*.qm - # INSTALLS += install_trans TRANS_FILES += $$PWD/Translations/*.qm TRANS_FILES_WIN = $${TRANS_FILES} @@ -243,17 +209,3 @@ mac { TransFiles.path = Contents/MacOS QMAKE_BUNDLE_DATA += TransFiles } - - - - - - - - - - - - - - diff --git a/UpdaterWindow.cpp b/UpdaterWindow.cpp index cd251560..99ad78d7 100644 --- a/UpdaterWindow.cpp +++ b/UpdaterWindow.cpp @@ -13,8 +13,8 @@ #include #include "SleepLib/profiles.h" -#include "quazip/quazip.h" -#include "quazip/quazipfile.h" +#include "3rdparty/quazip-0.5.1/quazip/quazip.h" +#include "3rdparty/quazip-0.5.1/quazip/quazipfile.h" #include "UpdaterWindow.h" #include "ui_UpdaterWindow.h" #include "version.h" diff --git a/mainwindow.cpp b/mainwindow.cpp index d546bf94..7b47e5f3 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -612,17 +612,21 @@ void MainWindow::on_action_About_triggered() QString msg=QString( "" "
" -"

"+STR_TR_SleepyHead+" v%1.%2.%3-%4 (%8)

"+tr("Build Date")+": %5 %6
%7
"+tr("Data Folder Location")+": %9


"+ -tr("Copyright")+" ©2012 Mark Watkins (jedimark)
\n"+ -tr("This software is released under the GNU Public License v3.0
")+ +"

"+STR_TR_SleepyHead+" v%1.%2.%3-%4 (%8)

"+tr("Build Date")+": %5 %6
%7
"+tr("Data Folder Location")+": %9


"+ +tr("Copyright")+" ©2012 Mark Watkins (jedimark)
\n"+ +tr("This software is released under the GNU Public License v3.0
")+ "

"+tr("SleepyHead Project Page")+": http://sourceforge.net/projects/sleepyhead
"+ tr("SleepyHead Wiki")+": http://sleepyhead.sourceforge.net
"+ tr("Authors Twitter Feed")+": http://twitter.com/jedimark64

"+ "
"+ tr("

The author wishes to express thanks to James Marshall and Rich Freeman for their assistance with this project.

")+ -"

"+tr("This software comes with absolutely no warranty, either express of implied. It comes with no guarantee of fitness for any particular purpose. No guarantees are made regarding the accuracy of any data this program displays.")+"

" -"

"+tr("This is NOT medical software, it is merely a research tool that provides a visual interpretation of data recorded by supported devices. This software is NOT suitable for medical diagnosis, CPAP complaince reporting and other similar purposes.")+"

" -"

"+tr("The author and any associates of his accept NO responsibilty for damages, issues or non-issues resulting from the use or mis-use of this software
Use this software entirely at your own risk.")+"

" +"

"+tr("This software comes with absolutely no warranty, either express of implied.")+" "+ +tr("It comes with no guarantee of fitness for any particular purpose.")+" "+ +tr("No guarantees are made regarding the accuracy of any data this program displays.")+"

" +"

"+tr("This is NOT medical software, it is merely a research tool that provides a visual interpretation of data recorded by supported devices.")+ +tr("This software is NOT suitable for medical diagnosis, CPAP complaince reporting and other similar purposes.")+"

" +"

"+tr("The author and any associates of his accept NO responsibilty for damages, issues or non-issues resulting from the use or mis-use of this software.")+"
"+ +tr("Use this software entirely at your own risk.")+"

" "

"+tr("If you find this free software to be of use, please consider supporting the development efforts by making a paypal donation to the Author")+"

" "
" ).arg(major_version).arg(minor_version).arg(revision_number).arg(release_number).arg(__DATE__).arg(__TIME__).arg(gitrev).arg(ReleaseStatus).arg(QDir::toNativeSeparators(GetAppRoot())); @@ -681,6 +685,8 @@ void MainWindow::on_action_Reset_Graph_Layout_triggered() void MainWindow::on_action_Preferences_triggered() { + //MW: TODO: This will crash if attempted to enter while still loading.. + if (m_inRecalculation) { mainwin->Notify(tr("Access to Preferences has been blocked until recalculation completes.")); return; @@ -718,6 +724,10 @@ void MainWindow::on_oximetryButton_clicked() ui->tabWidget->insertTab(3,oximetry,STR_TR_Oximetry); first=true; } + + // MW: Instead, how about starting a direct import? + oximetry->serialImport(); + ui->tabWidget->setCurrentWidget(oximetry); if (!first) oximetry->RedrawGraphs(); qstatus2->setText(STR_TR_Oximetry); @@ -764,7 +774,7 @@ void MainWindow::DelayedScreenshot() a+="/screenshot-"+QDateTime::currentDateTime().toString(Qt::ISODate)+".jpg"; qDebug() << "Saving screenshot to" << a; if (pixmap.save(a)) { - Notify("There was an error saving screenshot to file \""+QDir::toNativeSeparators(a)+"\""); + Notify(tr("There was an error saving screenshot to file \"%1\"").arg(QDir::toNativeSeparators(a))); } } diff --git a/oximetry.cpp b/oximetry.cpp index cdde20e6..8706d6a0 100644 --- a/oximetry.cpp +++ b/oximetry.cpp @@ -12,7 +12,7 @@ #include "oximetry.h" #include "ui_oximetry.h" #include "common_gui.h" -#include "qextserialport/qextserialenumerator.h" +#include "3rdparty/qextserialport/src/qextserialenumerator.h" #include "SleepLib/loader_plugins/cms50_loader.h" #include "SleepLib/event.h" #include "SleepLib/calcs.h" @@ -55,7 +55,6 @@ SerialOximeter::SerialOximeter(QObject * parent,QString oxiname, QString portnam connect(timer,SIGNAL(timeout()),this,SLOT(Timeout())); import_mode=false; m_mode=SO_WAIT; - } SerialOximeter::~SerialOximeter() @@ -405,8 +404,12 @@ Session *SerialOximeter::createSession(QDateTime date) bool SerialOximeter::startLive() { + modeLock.lock(); import_mode=false; + killTimers(); m_mode=SO_LIVE; + modeLock.unlock(); + lastpr=lasto2=0; buffer.clear(); @@ -418,8 +421,10 @@ bool SerialOximeter::startLive() void SerialOximeter::stopLive() { + modeLock.lock(); if (timer->isActive()) timer->stop(); m_mode=SO_WAIT; + modeLock.unlock(); if (session) { compactAll(); calcSPO2Drop(session); @@ -607,8 +612,10 @@ void CMS50Serial::import_process() void CMS50Serial::ReadyRead() { + modeLock.lock(); if (m_mode==SO_OFF) return; + static int lastbytesize=0; QByteArray bytes; @@ -619,8 +626,10 @@ void CMS50Serial::ReadyRead() if (m_mode==SO_WAIT) { killTimers(); // Close(); + modeLock.unlock(); return; } + modeLock.unlock(); m_callbacks++; if (!import_mode) { @@ -711,6 +720,16 @@ void CMS50Serial::ReadyRead() killTimers(); qDebug() << "Getting ready for import"; + + // Hide the connect message box + if (mainwin->getOximetry()->connectDeviceMsgBox) { + //mainwin->getOximetry()->connectDeviceMsgBox->setText("Transfering Oximetry data from device"); + mainwin->getOximetry()->disconnect(mainwin->getOximetry()->connectDeviceMsgBox,SIGNAL(buttonClicked(QAbstractButton*)),mainwin->getOximetry(),SLOT(cancel_CheckPorts())); + mainwin->getOximetry()->close(); + delete mainwin->getOximetry()->connectDeviceMsgBox; + mainwin->getOximetry()->connectDeviceMsgBox=NULL; + } + mainwin->getOximetry()->graphView()->setEmptyText(tr("Please Wait, Importing...")); mainwin->getOximetry()->graphView()->timedRedraw(50); @@ -867,18 +886,14 @@ bool CMS50Serial::startImport() buffer.clear(); data.clear(); + killTimers(); + modeLock.lock(); + m_mode=SO_IMPORT; import_mode=true; started_import=false; started_reading=false; finished_import=false; - killTimers(); - - connect(this,SIGNAL(importProcess()),this,SLOT(import_process())); - - if (!m_opened && !Open(QextSerialPort::EventDriven)) - return false; - imptime.start(); @@ -889,6 +904,15 @@ bool CMS50Serial::startImport() import_fails=0; failcnt=0; + connect(this,SIGNAL(importProcess()),this,SLOT(import_process())); + + modeLock.unlock(); + + if (!m_opened && !Open(QextSerialPort::EventDriven)) { + return false; + } + + // doesn't need to happen until process.. createSession(); @@ -900,13 +924,29 @@ bool CMS50Serial::startImport() return true; } +void CMS50Serial::stopImport() // Silently stops import dead +{ + disconnect(this,SIGNAL(importProcess()),this,SLOT(import_process())); + + modeLock.lock(); + m_mode=SO_OFF; +// killTimers(); + started_import=false; + import_mode=false; + finished_import=false; + modeLock.unlock(); +} + void CMS50Serial::startImportTimeout() { - if ((m_mode==SO_WAIT) + modeLock.lock(); + if ((m_mode==SO_WAIT) || (m_mode==SO_OFF) ||finished_import - ||started_import) - return; + ||started_import) { + modeLock.unlock(); + return; + } // Wait until events really are jammed on the CMS50D+ before re-requesting data. if (imp_callbacks==0) { // Frozen, but still hasn't started? int elapsed=imptime.elapsed()/1000; @@ -914,16 +954,18 @@ void CMS50Serial::startImportTimeout() if (elapsed>30) { // Give up after ~20 seconds m_mode=SO_WAIT; killTimers(); + modeLock.unlock(); emit(importAborted()); mainwin->getOximetry()->graphView()->setEmptyText(tr("Import Failed")); mainwin->getOximetry()->graphView()->timedRedraw(50); return; } else { + modeLock.unlock(); QString a=tr("Set Oximeter to Upload"); for (int j=0;jgetOximetry()->graphView()->setEmptyText(a); mainwin->getOximetry()->graphView()->timedRedraw(50); - + modeLock.lock(); // Note: Newer CMS50 devices transmit from user input requestData(); } @@ -931,11 +973,15 @@ void CMS50Serial::startImportTimeout() // Schedule another callback to make sure it's started cms50timer->singleShot(1000,this,SLOT(startImportTimeout())); } + modeLock.unlock(); } void CMS50Serial::resetImportTimeout() { - if ((m_mode==SO_WAIT)||(finished_import)) + modeLock.lock(); + if ((m_mode==SO_WAIT)||(finished_import)) { + modeLock.unlock(); return; + } if (imp_callbacks!=cb_reset) { // Still receiving data.. reset timer @@ -958,12 +1004,14 @@ void CMS50Serial::resetImportTimeout() m_mode=SO_WAIT; // Temporarily pause until complete shutdown. emit(importProcess()); + modeLock.unlock(); return; } qDebug() << "Should CMS50 resetImportTimeout reach here?"; // else what??? } cb_reset=imp_callbacks; + modeLock.unlock(); } @@ -1130,6 +1178,81 @@ void Oximetry::on_RefreshPortsButton_clicked() } oximeter->setPortName(portname); } +void Oximetry::serialImport() +{ + connect(oximeter,SIGNAL(importComplete(Session*)),this,SLOT(import_complete(Session*))); + connect(oximeter,SIGNAL(importAborted()),this,SLOT(import_aborted())); + connect(oximeter,SIGNAL(updateProgress(float)),this,SLOT(update_progress(float))); + PLETHY->setVisible(false); + day->getSessions().clear(); + GraphView->setDay(day); + //GraphView->setEmptyText(tr("Make Sure Oximeter is Ready")); + //GraphView->redraw(); + + cancel_Import=false; + QTimer::singleShot(100,this,SLOT(timeout_CheckPorts())); + connectDeviceMsgBox=new QMessageBox(QMessageBox::Information,tr("Connect Oximeter"),tr("Please connect oximeter device"), + QMessageBox::Cancel); + connect(connectDeviceMsgBox,SIGNAL(buttonClicked(QAbstractButton*)),this,SLOT(cancel_CheckPorts(QAbstractButton*))); + connectDeviceMsgBox->setModal(false); + connectDeviceMsgBox->show(); + QApplication::processEvents(); +} + +void Oximetry::cancel_CheckPorts(QAbstractButton*b) +{ + qDebug() << "cancel_CheckPorts()"; + cancel_Import=true; + + disconnect(connectDeviceMsgBox,0,0,0);//SIGNAL(buttonClicked(QAbstractButton*)),this,SLOT(cancel_CheckPorts())); + disconnect(oximeter,SIGNAL(importComplete(Session*)),this,SLOT(import_complete(Session*))); + disconnect(oximeter,SIGNAL(importAborted()),this,SLOT(import_aborted())); + disconnect(oximeter,SIGNAL(updateProgress(float)),this,SLOT(update_progress(float))); + + connectDeviceMsgBox->close(); + delete connectDeviceMsgBox; + connectDeviceMsgBox=NULL; + + + if (oximeter->isImporting()) + oximeter->stopImport(); +} + +void Oximetry::timeout_CheckPorts() +{ + if (cancel_Import) { + return; + } + if (portname=="") { + qDebug() << "restarting timeout_CheckPorts()"; + on_RefreshPortsButton_clicked(); + if (portname=="") { + QTimer::singleShot(1000,this,SLOT(timeout_CheckPorts())); + return; + } + } + + qDebug() << "Calling oximeter->startImport()"; + if (!oximeter->startImport()) { + QTimer::singleShot(1000,this,SLOT(timeout_CheckPorts())); + return; + } + qDebug() << "Success at oximeter->startImport()"; + + disconnect(connectDeviceMsgBox,SIGNAL(buttonClicked(QAbstractButton*)),this,SLOT(cancel_CheckPorts(QAbstractButton*))); + connectDeviceMsgBox->close(); + delete connectDeviceMsgBox; + + //connectDeviceMsgBox=NULL; + connectDeviceMsgBox=new QMessageBox(QMessageBox::Information,tr("Device Connected"),tr("Please make sure Oximeter device is in upload mode."), + QMessageBox::Cancel); + connectDeviceMsgBox->setModal(false); + connect(connectDeviceMsgBox,SIGNAL(buttonClicked(QAbstractButton*)),this,SLOT(cancel_CheckPorts(QAbstractButton*))); + connectDeviceMsgBox->show(); + QApplication::processEvents(); + //mainwin->Notify(tr("Please make sure Oximeter device is in upload mode."),tr("Device Connected")); +} + void Oximetry::RedrawGraphs() { GraphView->redraw(); @@ -1373,13 +1496,18 @@ void Oximetry::on_ImportButton_clicked() void Oximetry::import_finished() { + if (connectDeviceMsgBox) { + connectDeviceMsgBox->close(); + disconnect(connectDeviceMsgBox,SIGNAL(buttonClicked(QAbstractButton*)),this,SLOT(cancel_CheckPorts())); + delete connectDeviceMsgBox; + connectDeviceMsgBox=NULL; + } disconnect(oximeter,SIGNAL(importComplete(Session*)),this,SLOT(import_complete(Session*))); disconnect(oximeter,SIGNAL(importAborted()),this,SLOT(import_aborted())); disconnect(oximeter,SIGNAL(updateProgress(float)),this,SLOT(update_progress(float))); oximeter->disconnect(oximeter,SIGNAL(importProcess()),0,0); -// oximeter->killTimers(); // oximeter->Close(); // Hanging here.. :( diff --git a/oximetry.h b/oximetry.h index 45a2783b..b3a85cd6 100644 --- a/oximetry.h +++ b/oximetry.h @@ -11,7 +11,9 @@ #include #include #include -#include +#include +#include +#include <3rdparty/qextserialport/src/qextserialport.h> #include "SleepLib/profiles.h" #include "SleepLib/day.h" @@ -128,6 +130,7 @@ public: //! \brief Returns the serial ports stop bits setting StopBitsType stopBits() { return m_stopbits; } + bool isImporting() { return import_mode; } EventList * Pulse() { return pulse; } EventList * Spo2() { return spo2; } @@ -210,7 +213,7 @@ protected: EventDataType lasto2,lastpr; QByteArray buffer; - + QMutex modeLock; }; /*! \class CMS50Serial @@ -227,6 +230,9 @@ public: //! \brief Start the serial parts of Import mode. virtual bool startImport(); + //! \brief Stop the serial parts of Import mode. + virtual void stopImport(); + //! \brief Sends the 0xf6,0xf6,0xf6 data string to the serial port to start live mode again virtual void resetDevice(); @@ -303,9 +309,13 @@ public: //! \brief Loads and displays a session containing oximetry data into into the Oximetry module void openSession(Session * session); + //! \brief Initiate an automated serial import + void serialImport(); + QMessageBox *connectDeviceMsgBox; + private slots: //! \brief Scans the list of serial ports and detects any oximetry devices - void on_RefreshPortsButton_clicked(); + void on_RefreshPortsButton_clicked(); //! \brief Start or Stop live view mode void on_RunButton_toggled(bool checked); // Live mode button @@ -352,6 +362,9 @@ private slots: //! \brief Reset the datetime to what was set when first loaded void on_resetTimeButton_clicked(); + void timeout_CheckPorts(); + void cancel_CheckPorts(QAbstractButton*); + private: //! \brief Imports a .spo file bool openSPOFile(QString filename); @@ -365,6 +378,7 @@ private: void updateGraphs(); Ui::Oximetry *ui; + bool cancel_Import; gGraphView *GraphView; MyScrollBar *scrollbar; QHBoxLayout *layout; diff --git a/qextserialport/posix_qextserialport.cpp b/qextserialport/posix_qextserialport.cpp deleted file mode 100644 index 1f5be897..00000000 --- a/qextserialport/posix_qextserialport.cpp +++ /dev/null @@ -1,959 +0,0 @@ - - -#include -#include -#include "qextserialport.h" -#include -#include - -void QextSerialPort::platformSpecificInit() -{ - fd = 0; - readNotifier = 0; -} - -/*! -Standard destructor. -*/ -void QextSerialPort::platformSpecificDestruct() -{} - -/*! -Sets the baud rate of the serial port. Note that not all rates are applicable on -all platforms. The following table shows translations of the various baud rate -constants on Windows(including NT/2000) and POSIX platforms. Speeds marked with an * -are speeds that are usable on both Windows and POSIX. - -\note -BAUD76800 may not be supported on all POSIX systems. SGI/IRIX systems do not support -BAUD1800. - -\verbatim - - RATE Windows Speed POSIX Speed - ----------- ------------- ----------- - BAUD50 110 50 - BAUD75 110 75 - *BAUD110 110 110 - BAUD134 110 134.5 - BAUD150 110 150 - BAUD200 110 200 - *BAUD300 300 300 - *BAUD600 600 600 - *BAUD1200 1200 1200 - BAUD1800 1200 1800 - *BAUD2400 2400 2400 - *BAUD4800 4800 4800 - *BAUD9600 9600 9600 - BAUD14400 14400 9600 - *BAUD19200 19200 19200 - *BAUD38400 38400 38400 - BAUD56000 56000 38400 - *BAUD57600 57600 57600 - BAUD76800 57600 76800 - *BAUD115200 115200 115200 - BAUD128000 128000 115200 - BAUD256000 256000 115200 -\endverbatim -*/ -void QextSerialPort::setBaudRate(BaudRateType baudRate) -{ - QMutexLocker lock(mutex); - if (Settings.BaudRate!=baudRate) { - switch (baudRate) { - case BAUD14400: - Settings.BaudRate=BAUD9600; - break; - - case BAUD56000: - Settings.BaudRate=BAUD38400; - break; - - case BAUD76800: - -#ifndef B76800 - Settings.BaudRate=BAUD57600; -#else - Settings.BaudRate=baudRate; -#endif - break; - - case BAUD128000: - case BAUD256000: - Settings.BaudRate=BAUD115200; - break; - - default: - Settings.BaudRate=baudRate; - break; - } - } - if (isOpen()) { - switch (baudRate) { - - /*50 baud*/ - case BAUD50: - TTY_PORTABILITY_WARNING("QextSerialPort Portability Warning: Windows does not support 50 baud operation."); -#ifdef CBAUD - Posix_CommConfig.c_cflag&=(~CBAUD); - Posix_CommConfig.c_cflag|=B50; -#else - cfsetispeed(&Posix_CommConfig, B50); - cfsetospeed(&Posix_CommConfig, B50); -#endif - break; - - /*75 baud*/ - case BAUD75: - TTY_PORTABILITY_WARNING("QextSerialPort Portability Warning: Windows does not support 75 baud operation."); -#ifdef CBAUD - Posix_CommConfig.c_cflag&=(~CBAUD); - Posix_CommConfig.c_cflag|=B75; -#else - cfsetispeed(&Posix_CommConfig, B75); - cfsetospeed(&Posix_CommConfig, B75); -#endif - break; - - /*110 baud*/ - case BAUD110: -#ifdef CBAUD - Posix_CommConfig.c_cflag&=(~CBAUD); - Posix_CommConfig.c_cflag|=B110; -#else - cfsetispeed(&Posix_CommConfig, B110); - cfsetospeed(&Posix_CommConfig, B110); -#endif - break; - - /*134.5 baud*/ - case BAUD134: - TTY_PORTABILITY_WARNING("QextSerialPort Portability Warning: Windows does not support 134.5 baud operation."); -#ifdef CBAUD - Posix_CommConfig.c_cflag&=(~CBAUD); - Posix_CommConfig.c_cflag|=B134; -#else - cfsetispeed(&Posix_CommConfig, B134); - cfsetospeed(&Posix_CommConfig, B134); -#endif - break; - - /*150 baud*/ - case BAUD150: - TTY_PORTABILITY_WARNING("QextSerialPort Portability Warning: Windows does not support 150 baud operation."); -#ifdef CBAUD - Posix_CommConfig.c_cflag&=(~CBAUD); - Posix_CommConfig.c_cflag|=B150; -#else - cfsetispeed(&Posix_CommConfig, B150); - cfsetospeed(&Posix_CommConfig, B150); -#endif - break; - - /*200 baud*/ - case BAUD200: - TTY_PORTABILITY_WARNING("QextSerialPort Portability Warning: Windows does not support 200 baud operation."); -#ifdef CBAUD - Posix_CommConfig.c_cflag&=(~CBAUD); - Posix_CommConfig.c_cflag|=B200; -#else - cfsetispeed(&Posix_CommConfig, B200); - cfsetospeed(&Posix_CommConfig, B200); -#endif - break; - - /*300 baud*/ - case BAUD300: -#ifdef CBAUD - Posix_CommConfig.c_cflag&=(~CBAUD); - Posix_CommConfig.c_cflag|=B300; -#else - cfsetispeed(&Posix_CommConfig, B300); - cfsetospeed(&Posix_CommConfig, B300); -#endif - break; - - /*600 baud*/ - case BAUD600: -#ifdef CBAUD - Posix_CommConfig.c_cflag&=(~CBAUD); - Posix_CommConfig.c_cflag|=B600; -#else - cfsetispeed(&Posix_CommConfig, B600); - cfsetospeed(&Posix_CommConfig, B600); -#endif - break; - - /*1200 baud*/ - case BAUD1200: -#ifdef CBAUD - Posix_CommConfig.c_cflag&=(~CBAUD); - Posix_CommConfig.c_cflag|=B1200; -#else - cfsetispeed(&Posix_CommConfig, B1200); - cfsetospeed(&Posix_CommConfig, B1200); -#endif - break; - - /*1800 baud*/ - case BAUD1800: - TTY_PORTABILITY_WARNING("QextSerialPort Portability Warning: Windows and IRIX do not support 1800 baud operation."); -#ifdef CBAUD - Posix_CommConfig.c_cflag&=(~CBAUD); - Posix_CommConfig.c_cflag|=B1800; -#else - cfsetispeed(&Posix_CommConfig, B1800); - cfsetospeed(&Posix_CommConfig, B1800); -#endif - break; - - /*2400 baud*/ - case BAUD2400: -#ifdef CBAUD - Posix_CommConfig.c_cflag&=(~CBAUD); - Posix_CommConfig.c_cflag|=B2400; -#else - cfsetispeed(&Posix_CommConfig, B2400); - cfsetospeed(&Posix_CommConfig, B2400); -#endif - break; - - /*4800 baud*/ - case BAUD4800: -#ifdef CBAUD - Posix_CommConfig.c_cflag&=(~CBAUD); - Posix_CommConfig.c_cflag|=B4800; -#else - cfsetispeed(&Posix_CommConfig, B4800); - cfsetospeed(&Posix_CommConfig, B4800); -#endif - break; - - /*9600 baud*/ - case BAUD9600: -#ifdef CBAUD - Posix_CommConfig.c_cflag&=(~CBAUD); - Posix_CommConfig.c_cflag|=B9600; -#else - cfsetispeed(&Posix_CommConfig, B9600); - cfsetospeed(&Posix_CommConfig, B9600); -#endif - break; - - /*14400 baud*/ - case BAUD14400: - TTY_WARNING("QextSerialPort: POSIX does not support 14400 baud operation. Switching to 9600 baud."); -#ifdef CBAUD - Posix_CommConfig.c_cflag&=(~CBAUD); - Posix_CommConfig.c_cflag|=B9600; -#else - cfsetispeed(&Posix_CommConfig, B9600); - cfsetospeed(&Posix_CommConfig, B9600); -#endif - break; - - /*19200 baud*/ - case BAUD19200: -#ifdef CBAUD - Posix_CommConfig.c_cflag&=(~CBAUD); - Posix_CommConfig.c_cflag|=B19200; -#else - cfsetispeed(&Posix_CommConfig, B19200); - cfsetospeed(&Posix_CommConfig, B19200); -#endif - break; - - /*38400 baud*/ - case BAUD38400: -#ifdef CBAUD - Posix_CommConfig.c_cflag&=(~CBAUD); - Posix_CommConfig.c_cflag|=B38400; -#else - cfsetispeed(&Posix_CommConfig, B38400); - cfsetospeed(&Posix_CommConfig, B38400); -#endif - break; - - /*56000 baud*/ - case BAUD56000: - TTY_WARNING("QextSerialPort: POSIX does not support 56000 baud operation. Switching to 38400 baud."); -#ifdef CBAUD - Posix_CommConfig.c_cflag&=(~CBAUD); - Posix_CommConfig.c_cflag|=B38400; -#else - cfsetispeed(&Posix_CommConfig, B38400); - cfsetospeed(&Posix_CommConfig, B38400); -#endif - break; - - /*57600 baud*/ - case BAUD57600: -#ifdef CBAUD - Posix_CommConfig.c_cflag&=(~CBAUD); - Posix_CommConfig.c_cflag|=B57600; -#else - cfsetispeed(&Posix_CommConfig, B57600); - cfsetospeed(&Posix_CommConfig, B57600); -#endif - break; - - /*76800 baud*/ - case BAUD76800: - TTY_PORTABILITY_WARNING("QextSerialPort Portability Warning: Windows and some POSIX systems do not support 76800 baud operation."); -#ifdef CBAUD - Posix_CommConfig.c_cflag&=(~CBAUD); - -#ifdef B76800 - Posix_CommConfig.c_cflag|=B76800; -#else - TTY_WARNING("QextSerialPort: QextSerialPort was compiled without 76800 baud support. Switching to 57600 baud."); - Posix_CommConfig.c_cflag|=B57600; -#endif //B76800 -#else //CBAUD -#ifdef B76800 - cfsetispeed(&Posix_CommConfig, B76800); - cfsetospeed(&Posix_CommConfig, B76800); -#else - TTY_WARNING("QextSerialPort: QextSerialPort was compiled without 76800 baud support. Switching to 57600 baud."); - cfsetispeed(&Posix_CommConfig, B57600); - cfsetospeed(&Posix_CommConfig, B57600); -#endif //B76800 -#endif //CBAUD - break; - - /*115200 baud*/ - case BAUD115200: -#ifdef CBAUD - Posix_CommConfig.c_cflag&=(~CBAUD); - Posix_CommConfig.c_cflag|=B115200; -#else - cfsetispeed(&Posix_CommConfig, B115200); - cfsetospeed(&Posix_CommConfig, B115200); -#endif - break; - - /*128000 baud*/ - case BAUD128000: - TTY_WARNING("QextSerialPort: POSIX does not support 128000 baud operation. Switching to 115200 baud."); -#ifdef CBAUD - Posix_CommConfig.c_cflag&=(~CBAUD); - Posix_CommConfig.c_cflag|=B115200; -#else - cfsetispeed(&Posix_CommConfig, B115200); - cfsetospeed(&Posix_CommConfig, B115200); -#endif - break; - - /*256000 baud*/ - case BAUD256000: - TTY_WARNING("QextSerialPort: POSIX does not support 256000 baud operation. Switching to 115200 baud."); -#ifdef CBAUD - Posix_CommConfig.c_cflag&=(~CBAUD); - Posix_CommConfig.c_cflag|=B115200; -#else - cfsetispeed(&Posix_CommConfig, B115200); - cfsetospeed(&Posix_CommConfig, B115200); -#endif - break; - } - tcsetattr(fd, TCSAFLUSH, &Posix_CommConfig); - } -} - -/*! -Sets the number of data bits used by the serial port. Possible values of dataBits are: -\verbatim - DATA_5 5 data bits - DATA_6 6 data bits - DATA_7 7 data bits - DATA_8 8 data bits -\endverbatim - -\note -This function is subject to the following restrictions: -\par - 5 data bits cannot be used with 2 stop bits. -\par - 8 data bits cannot be used with space parity on POSIX systems. -*/ -void QextSerialPort::setDataBits(DataBitsType dataBits) -{ - QMutexLocker lock(mutex); - if (Settings.DataBits!=dataBits) { - if ((Settings.StopBits==STOP_2 && dataBits==DATA_5) || - (Settings.StopBits==STOP_1_5 && dataBits!=DATA_5) || - (Settings.Parity==PAR_SPACE && dataBits==DATA_8)) { - } - else { - Settings.DataBits=dataBits; - } - } - if (isOpen()) { - switch(dataBits) { - - /*5 data bits*/ - case DATA_5: - if (Settings.StopBits==STOP_2) { - TTY_WARNING("QextSerialPort: 5 Data bits cannot be used with 2 stop bits."); - } - else { - Settings.DataBits=dataBits; - Posix_CommConfig.c_cflag&=(~CSIZE); - Posix_CommConfig.c_cflag|=CS5; - tcsetattr(fd, TCSAFLUSH, &Posix_CommConfig); - } - break; - - /*6 data bits*/ - case DATA_6: - if (Settings.StopBits==STOP_1_5) { - TTY_WARNING("QextSerialPort: 6 Data bits cannot be used with 1.5 stop bits."); - } - else { - Settings.DataBits=dataBits; - Posix_CommConfig.c_cflag&=(~CSIZE); - Posix_CommConfig.c_cflag|=CS6; - tcsetattr(fd, TCSAFLUSH, &Posix_CommConfig); - } - break; - - /*7 data bits*/ - case DATA_7: - if (Settings.StopBits==STOP_1_5) { - TTY_WARNING("QextSerialPort: 7 Data bits cannot be used with 1.5 stop bits."); - } - else { - Settings.DataBits=dataBits; - Posix_CommConfig.c_cflag&=(~CSIZE); - Posix_CommConfig.c_cflag|=CS7; - tcsetattr(fd, TCSAFLUSH, &Posix_CommConfig); - } - break; - - /*8 data bits*/ - case DATA_8: - if (Settings.StopBits==STOP_1_5) { - TTY_WARNING("QextSerialPort: 8 Data bits cannot be used with 1.5 stop bits."); - } - else { - Settings.DataBits=dataBits; - Posix_CommConfig.c_cflag&=(~CSIZE); - Posix_CommConfig.c_cflag|=CS8; - tcsetattr(fd, TCSAFLUSH, &Posix_CommConfig); - } - break; - } - } -} - -/*! -Sets the parity associated with the serial port. The possible values of parity are: -\verbatim - PAR_SPACE Space Parity - PAR_MARK Mark Parity - PAR_NONE No Parity - PAR_EVEN Even Parity - PAR_ODD Odd Parity -\endverbatim - -\note -This function is subject to the following limitations: -\par -POSIX systems do not support mark parity. -\par -POSIX systems support space parity only if tricked into doing so, and only with - fewer than 8 data bits. Use space parity very carefully with POSIX systems. -*/ -void QextSerialPort::setParity(ParityType parity) -{ - QMutexLocker lock(mutex); - if (Settings.Parity!=parity) { - if (parity==PAR_MARK || (parity==PAR_SPACE && Settings.DataBits==DATA_8)) { - } - else { - Settings.Parity=parity; - } - } - if (isOpen()) { - switch (parity) { - - /*space parity*/ - case PAR_SPACE: - if (Settings.DataBits==DATA_8) { - TTY_PORTABILITY_WARNING("QextSerialPort: Space parity is only supported in POSIX with 7 or fewer data bits"); - } - else { - - /*space parity not directly supported - add an extra data bit to simulate it*/ - Posix_CommConfig.c_cflag&=~(PARENB|CSIZE); - switch(Settings.DataBits) { - case DATA_5: - Settings.DataBits=DATA_6; - Posix_CommConfig.c_cflag|=CS6; - break; - - case DATA_6: - Settings.DataBits=DATA_7; - Posix_CommConfig.c_cflag|=CS7; - break; - - case DATA_7: - Settings.DataBits=DATA_8; - Posix_CommConfig.c_cflag|=CS8; - break; - - case DATA_8: - break; - } - tcsetattr(fd, TCSAFLUSH, &Posix_CommConfig); - } - break; - - /*mark parity - WINDOWS ONLY*/ - case PAR_MARK: - TTY_WARNING("QextSerialPort: Mark parity is not supported by POSIX."); - break; - - /*no parity*/ - case PAR_NONE: - Posix_CommConfig.c_cflag&=(~PARENB); - tcsetattr(fd, TCSAFLUSH, &Posix_CommConfig); - break; - - /*even parity*/ - case PAR_EVEN: - Posix_CommConfig.c_cflag&=(~PARODD); - Posix_CommConfig.c_cflag|=PARENB; - tcsetattr(fd, TCSAFLUSH, &Posix_CommConfig); - break; - - /*odd parity*/ - case PAR_ODD: - Posix_CommConfig.c_cflag|=(PARENB|PARODD); - tcsetattr(fd, TCSAFLUSH, &Posix_CommConfig); - break; - } - } -} - -/*! -Sets the number of stop bits used by the serial port. Possible values of stopBits are: -\verbatim - STOP_1 1 stop bit - STOP_1_5 1.5 stop bits - STOP_2 2 stop bits -\endverbatim -\note -This function is subject to the following restrictions: -\par - 2 stop bits cannot be used with 5 data bits. -\par - POSIX does not support 1.5 stop bits. - -*/ -void QextSerialPort::setStopBits(StopBitsType stopBits) -{ - QMutexLocker lock(mutex); - if (Settings.StopBits!=stopBits) { - if ((Settings.DataBits==DATA_5 && stopBits==STOP_2) || stopBits==STOP_1_5) {} - else { - Settings.StopBits=stopBits; - } - } - if (isOpen()) { - switch (stopBits) { - - /*one stop bit*/ - case STOP_1: - Settings.StopBits=stopBits; - Posix_CommConfig.c_cflag&=(~CSTOPB); - tcsetattr(fd, TCSAFLUSH, &Posix_CommConfig); - break; - - /*1.5 stop bits*/ - case STOP_1_5: - TTY_WARNING("QextSerialPort: 1.5 stop bit operation is not supported by POSIX."); - break; - - /*two stop bits*/ - case STOP_2: - if (Settings.DataBits==DATA_5) { - TTY_WARNING("QextSerialPort: 2 stop bits cannot be used with 5 data bits"); - } - else { - Settings.StopBits=stopBits; - Posix_CommConfig.c_cflag|=CSTOPB; - tcsetattr(fd, TCSAFLUSH, &Posix_CommConfig); - } - break; - } - } -} - -/*! -Sets the flow control used by the port. Possible values of flow are: -\verbatim - FLOW_OFF No flow control - FLOW_HARDWARE Hardware (RTS/CTS) flow control - FLOW_XONXOFF Software (XON/XOFF) flow control -\endverbatim -\note -FLOW_HARDWARE may not be supported on all versions of UNIX. In cases where it is -unsupported, FLOW_HARDWARE is the same as FLOW_OFF. - -*/ -void QextSerialPort::setFlowControl(FlowType flow) -{ - QMutexLocker lock(mutex); - if (Settings.FlowControl!=flow) { - Settings.FlowControl=flow; - } - if (isOpen()) { - switch(flow) { - - /*no flow control*/ - case FLOW_OFF: - Posix_CommConfig.c_cflag&=(~CRTSCTS); - Posix_CommConfig.c_iflag&=(~(IXON|IXOFF|IXANY)); - tcsetattr(fd, TCSAFLUSH, &Posix_CommConfig); - break; - - /*software (XON/XOFF) flow control*/ - case FLOW_XONXOFF: - Posix_CommConfig.c_cflag&=(~CRTSCTS); - Posix_CommConfig.c_iflag|=(IXON|IXOFF|IXANY); - tcsetattr(fd, TCSAFLUSH, &Posix_CommConfig); - break; - - case FLOW_HARDWARE: - Posix_CommConfig.c_cflag|=CRTSCTS; - Posix_CommConfig.c_iflag&=(~(IXON|IXOFF|IXANY)); - tcsetattr(fd, TCSAFLUSH, &Posix_CommConfig); - break; - } - } -} - -/*! -Sets the read and write timeouts for the port to millisec milliseconds. -Note that this is a per-character timeout, i.e. the port will wait this long for each -individual character, not for the whole read operation. This timeout also applies to the -bytesWaiting() function. - -\note -POSIX does not support millisecond-level control for I/O timeout values. Any -timeout set using this function will be set to the next lowest tenth of a second for -the purposes of detecting read or write timeouts. For example a timeout of 550 milliseconds -will be seen by the class as a timeout of 500 milliseconds for the purposes of reading and -writing the port. However millisecond-level control is allowed by the select() system call, -so for example a 550-millisecond timeout will be seen as 550 milliseconds on POSIX systems for -the purpose of detecting available bytes in the read buffer. - -*/ -void QextSerialPort::setTimeout(long millisec) -{ - QMutexLocker lock(mutex); - Settings.Timeout_Millisec = millisec; - Posix_Copy_Timeout.tv_sec = millisec / 1000; - Posix_Copy_Timeout.tv_usec = millisec % 1000; - if (isOpen()) { - if (millisec == -1) - fcntl(fd, F_SETFL, O_NDELAY); - else - //O_SYNC should enable blocking ::write() - //however this seems not working on Linux 2.6.21 (works on OpenBSD 4.2) - fcntl(fd, F_SETFL, O_SYNC); - tcgetattr(fd, & Posix_CommConfig); - Posix_CommConfig.c_cc[VTIME] = millisec/100; - tcsetattr(fd, TCSAFLUSH, & Posix_CommConfig); - } -} - -/*! -Opens the serial port associated to this class. -This function has no effect if the port associated with the class is already open. -The port is also configured to the current settings, as stored in the Settings structure. -*/ -bool QextSerialPort::open(OpenMode mode) -{ - QMutexLocker lock(mutex); - if (mode == QIODevice::NotOpen) - return isOpen(); - if (!isOpen()) { - qDebug() << "trying to open file" << port.toLatin1(); - //note: linux 2.6.21 seems to ignore O_NDELAY flag - if ((fd = ::open(port.toLatin1() ,O_RDWR | O_NOCTTY | O_NDELAY)) != -1) { - qDebug("file opened succesfully"); - - setOpenMode(mode); // Flag the port as opened - tcgetattr(fd, &old_termios); // Save the old termios - Posix_CommConfig = old_termios; // Make a working copy - cfmakeraw(&Posix_CommConfig); // Enable raw access - - /*set up other port settings*/ - Posix_CommConfig.c_cflag|=CREAD|CLOCAL; - Posix_CommConfig.c_lflag&=(~(ICANON|ECHO|ECHOE|ECHOK|ECHONL|ISIG)); - Posix_CommConfig.c_iflag&=(~(INPCK|IGNPAR|PARMRK|ISTRIP|ICRNL|IXANY)); - Posix_CommConfig.c_oflag&=(~OPOST); - Posix_CommConfig.c_cc[VMIN]= 0; -#ifdef _POSIX_VDISABLE // Is a disable character available on this system? - // Some systems allow for per-device disable-characters, so get the - // proper value for the configured device - const long vdisable = fpathconf(fd, _PC_VDISABLE); - Posix_CommConfig.c_cc[VINTR] = vdisable; - Posix_CommConfig.c_cc[VQUIT] = vdisable; - Posix_CommConfig.c_cc[VSTART] = vdisable; - Posix_CommConfig.c_cc[VSTOP] = vdisable; - Posix_CommConfig.c_cc[VSUSP] = vdisable; -#endif //_POSIX_VDISABLE - setBaudRate(Settings.BaudRate); - setDataBits(Settings.DataBits); - setParity(Settings.Parity); - setStopBits(Settings.StopBits); - setFlowControl(Settings.FlowControl); - setTimeout(Settings.Timeout_Millisec); - tcsetattr(fd, TCSAFLUSH, &Posix_CommConfig); - - if (queryMode() == QextSerialPort::EventDriven) { - readNotifier = new QSocketNotifier(fd, QSocketNotifier::Read, this); - connect(readNotifier, SIGNAL(activated(int)), this, SIGNAL(readyRead())); - } - } else { - qDebug() << "could not open file:" << strerror(errno); - lastErr = E_FILE_NOT_FOUND; - } - } - return isOpen(); -} - -/*! -Closes a serial port. This function has no effect if the serial port associated with the class -is not currently open. -*/ -void QextSerialPort::close() -{ - QMutexLocker lock(mutex); - if( isOpen() ) - { - // Force a flush and then restore the original termios - flush(); - // Using both TCSAFLUSH and TCSANOW here discards any pending input - tcsetattr(fd, TCSAFLUSH | TCSANOW, &old_termios); // Restore termios - // Be a good QIODevice and call QIODevice::close() before POSIX close() - // so the aboutToClose() signal is emitted at the proper time - QIODevice::close(); // Flag the device as closed - // QIODevice::close() doesn't actually close the port, so do that here - ::close(fd); - if(readNotifier) { - delete readNotifier; - readNotifier = 0; - } - } -} - -/*! -Flushes all pending I/O to the serial port. This function has no effect if the serial port -associated with the class is not currently open. -*/ -void QextSerialPort::flush() -{ - QMutexLocker lock(mutex); - if (isOpen()) - tcflush(fd, TCIOFLUSH); -} - -/*! -This function will return the number of bytes waiting in the receive queue of the serial port. -It is included primarily to provide a complete QIODevice interface, and will not record errors -in the lastErr member (because it is const). This function is also not thread-safe - in -multithreading situations, use QextSerialPort::bytesWaiting() instead. -*/ -qint64 QextSerialPort::size() const -{ - int numBytes; - if (ioctl(fd, FIONREAD, &numBytes)<0) { - numBytes = 0; - } - return (qint64)numBytes; -} - -/*! -Returns the number of bytes waiting in the port's receive queue. This function will return 0 if -the port is not currently open, or -1 on error. -*/ -qint64 QextSerialPort::bytesAvailable() const -{ - QMutexLocker lock(mutex); - if (isOpen()) { - int bytesQueued; - if (ioctl(fd, FIONREAD, &bytesQueued) == -1) { - return (qint64)-1; - } - return bytesQueued + QIODevice::bytesAvailable(); - } - return 0; -} - -/*! -This function is included to implement the full QIODevice interface, and currently has no -purpose within this class. This function is meaningless on an unbuffered device and currently -only prints a warning message to that effect. -*/ -void QextSerialPort::ungetChar(char) -{ - /*meaningless on unbuffered sequential device - return error and print a warning*/ - TTY_WARNING("QextSerialPort: ungetChar() called on an unbuffered sequential device - operation is meaningless"); -} - -/*! -Translates a system-specific error code to a QextSerialPort error code. Used internally. -*/ -void QextSerialPort::translateError(ulong error) -{ - switch (error) { - case EBADF: - case ENOTTY: - lastErr=E_INVALID_FD; - break; - - case EINTR: - lastErr=E_CAUGHT_NON_BLOCKED_SIGNAL; - break; - - case ENOMEM: - lastErr=E_NO_MEMORY; - break; - } -} - -/*! -Sets DTR line to the requested state (high by default). This function will have no effect if -the port associated with the class is not currently open. -*/ -void QextSerialPort::setDtr(bool set) -{ - QMutexLocker lock(mutex); - if (isOpen()) { - int status; - ioctl(fd, TIOCMGET, &status); - if (set) { - status|=TIOCM_DTR; - } - else { - status&=~TIOCM_DTR; - } - ioctl(fd, TIOCMSET, &status); - } -} - -/*! -Sets RTS line to the requested state (high by default). This function will have no effect if -the port associated with the class is not currently open. -*/ -void QextSerialPort::setRts(bool set) -{ - QMutexLocker lock(mutex); - if (isOpen()) { - int status; - ioctl(fd, TIOCMGET, &status); - if (set) { - status|=TIOCM_RTS; - } - else { - status&=~TIOCM_RTS; - } - ioctl(fd, TIOCMSET, &status); - } -} - -/*! -Returns the line status as stored by the port function. This function will retrieve the states -of the following lines: DCD, CTS, DSR, and RI. On POSIX systems, the following additional lines -can be monitored: DTR, RTS, Secondary TXD, and Secondary RXD. The value returned is an unsigned -long with specific bits indicating which lines are high. The following constants should be used -to examine the states of individual lines: - -\verbatim -Mask Line ------- ---- -LS_CTS CTS -LS_DSR DSR -LS_DCD DCD -LS_RI RI -LS_RTS RTS (POSIX only) -LS_DTR DTR (POSIX only) -LS_ST Secondary TXD (POSIX only) -LS_SR Secondary RXD (POSIX only) -\endverbatim - -This function will return 0 if the port associated with the class is not currently open. -*/ -unsigned long QextSerialPort::lineStatus() -{ - unsigned long Status=0, Temp=0; - QMutexLocker lock(mutex); - if (isOpen()) { - ioctl(fd, TIOCMGET, &Temp); - if (Temp&TIOCM_CTS) { - Status|=LS_CTS; - } - if (Temp&TIOCM_DSR) { - Status|=LS_DSR; - } - if (Temp&TIOCM_RI) { - Status|=LS_RI; - } - if (Temp&TIOCM_CD) { - Status|=LS_DCD; - } - if (Temp&TIOCM_DTR) { - Status|=LS_DTR; - } - if (Temp&TIOCM_RTS) { - Status|=LS_RTS; - } - if (Temp&TIOCM_ST) { - Status|=LS_ST; - } - if (Temp&TIOCM_SR) { - Status|=LS_SR; - } - } - return Status; -} - -/*! -Reads a block of data from the serial port. This function will read at most maxSize bytes from -the serial port and place them in the buffer pointed to by data. Return value is the number of -bytes actually read, or -1 on error. - -\warning before calling this function ensure that serial port associated with this class -is currently open (use isOpen() function to check if port is open). -*/ -qint64 QextSerialPort::readData(char * data, qint64 maxSize) -{ - QMutexLocker lock(mutex); - int retVal = ::read(fd, data, maxSize); - if (retVal == -1) - lastErr = E_READ_FAILED; - - return retVal; -} - -/*! -Writes a block of data to the serial port. This function will write maxSize bytes -from the buffer pointed to by data to the serial port. Return value is the number -of bytes actually written, or -1 on error. - -\warning before calling this function ensure that serial port associated with this class -is currently open (use isOpen() function to check if port is open). -*/ -qint64 QextSerialPort::writeData(const char * data, qint64 maxSize) -{ - QMutexLocker lock(mutex); - int retVal = ::write(fd, data, maxSize); - if (retVal == -1) - lastErr = E_WRITE_FAILED; - - return (qint64)retVal; -} diff --git a/qextserialport/qextserialenumerator.h b/qextserialport/qextserialenumerator.h deleted file mode 100644 index de173715..00000000 --- a/qextserialport/qextserialenumerator.h +++ /dev/null @@ -1,199 +0,0 @@ -/*! - * \file qextserialenumerator.h - * \author Michal Policht - * \see QextSerialEnumerator - */ - -#ifndef _QEXTSERIALENUMERATOR_H_ -#define _QEXTSERIALENUMERATOR_H_ - - -#include -#include -#include -#include "qextserialport_global.h" - -#ifdef Q_OS_WIN - #include - #include - #include -#endif /*Q_OS_WIN*/ - -#ifdef Q_OS_MAC - #include -#endif - -/*! - * Structure containing port information. - */ -struct QextPortInfo { - QString portName; ///< Port name. - QString physName; ///< Physical name. - QString friendName; ///< Friendly name. - QString enumName; ///< Enumerator name. - int vendorID; ///< Vendor ID. - int productID; ///< Product ID -}; - -#ifdef Q_OS_WIN -#ifdef QT_GUI_LIB -#include -class QextSerialEnumerator; - -class QextSerialRegistrationWidget : public QWidget -{ - Q_OBJECT - public: - QextSerialRegistrationWidget( QextSerialEnumerator* qese ) { - this->qese = qese; - } - ~QextSerialRegistrationWidget( ) { } - - protected: - QextSerialEnumerator* qese; - bool winEvent( MSG* message, long* result ); -}; -#endif // QT_GUI_LIB -#endif // Q_OS_WIN - -/*! - Provides list of ports available in the system. - - \section Usage - To poll the system for a list of connected devices, simply use getPorts(). Each - QextPortInfo structure will populated with information about the corresponding device. - - \b Example - \code - QList ports = QextSerialEnumerator::getPorts(); - foreach( QextPortInfo port, ports ) { - // inspect port... - } - \endcode - - To enable event-driven notification of device connection events, first call - setUpNotifications() and then connect to the deviceDiscovered() and deviceRemoved() - signals. Event-driven behavior is currently available only on Windows and OS X. - - \b Example - \code - QextSerialEnumerator* enumerator = new QextSerialEnumerator(); - connect(enumerator, SIGNAL(deviceDiscovered(const QextPortInfo &)), - myClass, SLOT(onDeviceDiscovered(const QextPortInfo &))); - connect(enumerator, SIGNAL(deviceRemoved(const QextPortInfo &)), - myClass, SLOT(onDeviceRemoved(const QextPortInfo &))); - \endcode - - \section Credits - Windows implementation is based on Zach Gorman's work from - The Code Project (http://www.codeproject.com/system/setupdi.asp). - - OS X implementation, see - http://developer.apple.com/documentation/DeviceDrivers/Conceptual/AccessingHardware/AH_Finding_Devices/chapter_4_section_2.html - - \author Michal Policht, Liam Staskawicz -*/ -class QEXTSERIALPORT_EXPORT QextSerialEnumerator : public QObject -{ -Q_OBJECT - public: - QextSerialEnumerator( ); - ~QextSerialEnumerator( ); - - #ifdef Q_OS_WIN - LRESULT onDeviceChangeWin( WPARAM wParam, LPARAM lParam ); - private: - /*! - * Get value of specified property from the registry. - * \param key handle to an open key. - * \param property property name. - * \return property value. - */ - static QString getRegKeyValue(HKEY key, LPCTSTR property); - - /*! - * Get specific property from registry. - * \param devInfo pointer to the device information set that contains the interface - * and its underlying device. Returned by SetupDiGetClassDevs() function. - * \param devData pointer to an SP_DEVINFO_DATA structure that defines the device instance. - * this is returned by SetupDiGetDeviceInterfaceDetail() function. - * \param property registry property. One of defined SPDRP_* constants. - * \return property string. - */ - static QString getDeviceProperty(HDEVINFO devInfo, PSP_DEVINFO_DATA devData, DWORD property); - - /*! - * Search for serial ports using setupapi. - * \param infoList list with result. - */ - static void setupAPIScan(QList & infoList); - void setUpNotificationWin( ); - static bool getDeviceDetailsWin( QextPortInfo* portInfo, HDEVINFO devInfo, - PSP_DEVINFO_DATA devData, WPARAM wParam = DBT_DEVICEARRIVAL ); - static void enumerateDevicesWin( const GUID & guidDev, QList* infoList ); - bool matchAndDispatchChangedDevice(const QString & deviceID, const GUID & guid, WPARAM wParam); - #ifdef QT_GUI_LIB - QextSerialRegistrationWidget* notificationWidget; - #endif - #endif /*Q_OS_WIN*/ - - #ifdef Q_OS_UNIX - #ifdef Q_OS_MAC - private: - /*! - * Search for serial ports using IOKit. - * \param infoList list with result. - */ - static void scanPortsOSX(QList & infoList); - static void iterateServicesOSX(io_object_t service, QList & infoList); - static bool getServiceDetailsOSX( io_object_t service, QextPortInfo* portInfo ); - - void setUpNotificationOSX( ); - void onDeviceDiscoveredOSX( io_object_t service ); - void onDeviceTerminatedOSX( io_object_t service ); - friend void deviceDiscoveredCallbackOSX( void *ctxt, io_iterator_t serialPortIterator ); - friend void deviceTerminatedCallbackOSX( void *ctxt, io_iterator_t serialPortIterator ); - - IONotificationPortRef notificationPortRef; - - #else // Q_OS_MAC - private: - /*! - * Search for serial ports on unix. - * \param infoList list with result. - */ - static void scanPortsNix(QList & infoList); - #endif // Q_OS_MAC - #endif /* Q_OS_UNIX */ - - public: - /*! - Get list of ports. - \return list of ports currently available in the system. - */ - static QList getPorts(); - /*! - Enable event-driven notifications of board discovery/removal. - */ - void setUpNotifications( ); - - signals: - /*! - A new device has been connected to the system. - - setUpNotifications() must be called first to enable event-driven device notifications. - Currently only implemented on Windows and OS X. - \param info The device that has been discovered. - */ - void deviceDiscovered( const QextPortInfo & info ); - /*! - A device has been disconnected from the system. - - setUpNotifications() must be called first to enable event-driven device notifications. - Currently only implemented on Windows and OS X. - \param info The device that was disconnected. - */ - void deviceRemoved( const QextPortInfo & info ); -}; - -#endif /*_QEXTSERIALENUMERATOR_H_*/ diff --git a/qextserialport/qextserialenumerator_osx.cpp b/qextserialport/qextserialenumerator_osx.cpp deleted file mode 100644 index 229d73f3..00000000 --- a/qextserialport/qextserialenumerator_osx.cpp +++ /dev/null @@ -1,288 +0,0 @@ - - - -#include "qextserialenumerator.h" -#include -#include - -#include -#include -#include - -QextSerialEnumerator::QextSerialEnumerator( ) -{ - if( !QMetaType::isRegistered( QMetaType::type("QextPortInfo") ) ) - qRegisterMetaType("QextPortInfo"); -} - -QextSerialEnumerator::~QextSerialEnumerator( ) -{ - IONotificationPortDestroy( notificationPortRef ); -} - -// static -QList QextSerialEnumerator::getPorts() -{ - QList infoList; - io_iterator_t serialPortIterator = 0; - kern_return_t kernResult = KERN_FAILURE; - CFMutableDictionaryRef matchingDictionary; - - // first try to get any serialbsd devices, then try any USBCDC devices - if( !(matchingDictionary = IOServiceMatching(kIOSerialBSDServiceValue) ) ) { - qWarning("IOServiceMatching returned a NULL dictionary."); - return infoList; - } - CFDictionaryAddValue(matchingDictionary, CFSTR(kIOSerialBSDTypeKey), CFSTR(kIOSerialBSDAllTypes)); - - // then create the iterator with all the matching devices - if( IOServiceGetMatchingServices(kIOMasterPortDefault, matchingDictionary, &serialPortIterator) != KERN_SUCCESS ) { - qCritical() << "IOServiceGetMatchingServices failed, returned" << kernResult; - return infoList; - } - iterateServicesOSX(serialPortIterator, infoList); - IOObjectRelease(serialPortIterator); - serialPortIterator = 0; - - if( !(matchingDictionary = IOServiceNameMatching("AppleUSBCDC")) ) { - qWarning("IOServiceNameMatching returned a NULL dictionary."); - return infoList; - } - - if( IOServiceGetMatchingServices(kIOMasterPortDefault, matchingDictionary, &serialPortIterator) != KERN_SUCCESS ) { - qCritical() << "IOServiceGetMatchingServices failed, returned" << kernResult; - return infoList; - } - iterateServicesOSX(serialPortIterator, infoList); - IOObjectRelease(serialPortIterator); - - return infoList; -} - -void QextSerialEnumerator::iterateServicesOSX(io_object_t service, QList & infoList) -{ - // Iterate through all modems found. - io_object_t usbService; - while( ( usbService = IOIteratorNext(service) ) ) - { - QextPortInfo info; - info.vendorID = 0; - info.productID = 0; - getServiceDetailsOSX( usbService, &info ); - infoList.append(info); - } -} - -bool QextSerialEnumerator::getServiceDetailsOSX( io_object_t service, QextPortInfo* portInfo ) -{ - bool retval = true; - CFTypeRef bsdPathAsCFString = NULL; - CFTypeRef productNameAsCFString = NULL; - CFTypeRef vendorIdAsCFNumber = NULL; - CFTypeRef productIdAsCFNumber = NULL; - // check the name of the modem's callout device - bsdPathAsCFString = IORegistryEntryCreateCFProperty(service, CFSTR(kIOCalloutDeviceKey), - kCFAllocatorDefault, 0); - - // wander up the hierarchy until we find the level that can give us the - // vendor/product IDs and the product name, if available - io_registry_entry_t parent; - kern_return_t kernResult = IORegistryEntryGetParentEntry(service, kIOServicePlane, &parent); - while( kernResult == KERN_SUCCESS && !vendorIdAsCFNumber && !productIdAsCFNumber ) - { - if(!productNameAsCFString) - productNameAsCFString = IORegistryEntrySearchCFProperty(parent, - kIOServicePlane, - CFSTR("Product Name"), - kCFAllocatorDefault, 0); - vendorIdAsCFNumber = IORegistryEntrySearchCFProperty(parent, - kIOServicePlane, - CFSTR(kUSBVendorID), - kCFAllocatorDefault, 0); - productIdAsCFNumber = IORegistryEntrySearchCFProperty(parent, - kIOServicePlane, - CFSTR(kUSBProductID), - kCFAllocatorDefault, 0); - io_registry_entry_t oldparent = parent; - kernResult = IORegistryEntryGetParentEntry(parent, kIOServicePlane, &parent); - IOObjectRelease(oldparent); - } - - io_string_t ioPathName; - IORegistryEntryGetPath( service, kIOServicePlane, ioPathName ); - portInfo->physName = ioPathName; - - if( bsdPathAsCFString ) - { - char path[MAXPATHLEN]; - if( CFStringGetCString((CFStringRef)bsdPathAsCFString, path, - PATH_MAX, kCFStringEncodingUTF8) ) - portInfo->portName = path; - CFRelease(bsdPathAsCFString); - } - - if(productNameAsCFString) - { - char productName[MAXPATHLEN]; - if( CFStringGetCString((CFStringRef)productNameAsCFString, productName, - PATH_MAX, kCFStringEncodingUTF8) ) - portInfo->friendName = productName; - CFRelease(productNameAsCFString); - } - - if(vendorIdAsCFNumber) - { - SInt32 vID; - if(CFNumberGetValue((CFNumberRef)vendorIdAsCFNumber, kCFNumberSInt32Type, &vID)) - portInfo->vendorID = vID; - CFRelease(vendorIdAsCFNumber); - } - - if(productIdAsCFNumber) - { - SInt32 pID; - if(CFNumberGetValue((CFNumberRef)productIdAsCFNumber, kCFNumberSInt32Type, &pID)) - portInfo->productID = pID; - CFRelease(productIdAsCFNumber); - } - IOObjectRelease(service); - return retval; -} - -// IOKit callbacks registered via setupNotifications() -void deviceDiscoveredCallbackOSX( void *ctxt, io_iterator_t serialPortIterator ); -void deviceTerminatedCallbackOSX( void *ctxt, io_iterator_t serialPortIterator ); - -void deviceDiscoveredCallbackOSX( void *ctxt, io_iterator_t serialPortIterator ) -{ - QextSerialEnumerator* qese = (QextSerialEnumerator*)ctxt; - io_object_t serialService; - while ((serialService = IOIteratorNext(serialPortIterator))) - qese->onDeviceDiscoveredOSX(serialService); -} - -void deviceTerminatedCallbackOSX( void *ctxt, io_iterator_t serialPortIterator ) -{ - QextSerialEnumerator* qese = (QextSerialEnumerator*)ctxt; - io_object_t serialService; - while ((serialService = IOIteratorNext(serialPortIterator))) - qese->onDeviceTerminatedOSX(serialService); -} - -/* - A device has been discovered via IOKit. - Create a QextPortInfo if possible, and emit the signal indicating that we've found it. -*/ -void QextSerialEnumerator::onDeviceDiscoveredOSX( io_object_t service ) -{ - QextPortInfo info; - info.vendorID = 0; - info.productID = 0; - if( getServiceDetailsOSX( service, &info ) ) - emit deviceDiscovered( info ); -} - -/* - Notification via IOKit that a device has been removed. - Create a QextPortInfo if possible, and emit the signal indicating that it's gone. -*/ -void QextSerialEnumerator::onDeviceTerminatedOSX( io_object_t service ) -{ - QextPortInfo info; - info.vendorID = 0; - info.productID = 0; - if( getServiceDetailsOSX( service, &info ) ) - emit deviceRemoved( info ); -} - -/* - Create matching dictionaries for the devices we want to get notifications for, - and add them to the current run loop. Invoke the callbacks that will be responding - to these notifications once to arm them, and discover any devices that - are currently connected at the time notifications are setup. -*/ -void QextSerialEnumerator::setUpNotifications( ) -{ - kern_return_t kernResult; - mach_port_t masterPort; - CFRunLoopSourceRef notificationRunLoopSource; - CFMutableDictionaryRef classesToMatch; - CFMutableDictionaryRef cdcClassesToMatch; - io_iterator_t portIterator; - - kernResult = IOMasterPort(MACH_PORT_NULL, &masterPort); - if (KERN_SUCCESS != kernResult) { - qDebug() << "IOMasterPort returned:" << kernResult; - return; - } - - classesToMatch = IOServiceMatching(kIOSerialBSDServiceValue); - if (classesToMatch == NULL) - qDebug("IOServiceMatching returned a NULL dictionary."); - else - CFDictionarySetValue(classesToMatch, CFSTR(kIOSerialBSDTypeKey), CFSTR(kIOSerialBSDAllTypes)); - - if( !(cdcClassesToMatch = IOServiceNameMatching("AppleUSBCDC") ) ) { - qWarning("couldn't create cdc matching dict"); - return; - } - - // Retain an additional reference since each call to IOServiceAddMatchingNotification consumes one. - classesToMatch = (CFMutableDictionaryRef) CFRetain(classesToMatch); - cdcClassesToMatch = (CFMutableDictionaryRef) CFRetain(cdcClassesToMatch); - - notificationPortRef = IONotificationPortCreate(masterPort); - if(notificationPortRef == NULL) { - qDebug("IONotificationPortCreate return a NULL IONotificationPortRef."); - return; - } - - notificationRunLoopSource = IONotificationPortGetRunLoopSource(notificationPortRef); - if (notificationRunLoopSource == NULL) { - qDebug("IONotificationPortGetRunLoopSource returned NULL CFRunLoopSourceRef."); - return; - } - - CFRunLoopAddSource(CFRunLoopGetCurrent(), notificationRunLoopSource, kCFRunLoopDefaultMode); - - kernResult = IOServiceAddMatchingNotification(notificationPortRef, kIOMatchedNotification, classesToMatch, - deviceDiscoveredCallbackOSX, this, &portIterator); - if (kernResult != KERN_SUCCESS) { - qDebug() << "IOServiceAddMatchingNotification return:" << kernResult; - return; - } - - // arm the callback, and grab any devices that are already connected - deviceDiscoveredCallbackOSX( this, portIterator ); - - kernResult = IOServiceAddMatchingNotification(notificationPortRef, kIOMatchedNotification, cdcClassesToMatch, - deviceDiscoveredCallbackOSX, this, &portIterator); - if (kernResult != KERN_SUCCESS) { - qDebug() << "IOServiceAddMatchingNotification return:" << kernResult; - return; - } - - // arm the callback, and grab any devices that are already connected - deviceDiscoveredCallbackOSX( this, portIterator ); - - kernResult = IOServiceAddMatchingNotification(notificationPortRef, kIOTerminatedNotification, classesToMatch, - deviceTerminatedCallbackOSX, this, &portIterator); - if (kernResult != KERN_SUCCESS) { - qDebug() << "IOServiceAddMatchingNotification return:" << kernResult; - return; - } - - // arm the callback, and clear any devices that are terminated - deviceTerminatedCallbackOSX( this, portIterator ); - - kernResult = IOServiceAddMatchingNotification(notificationPortRef, kIOTerminatedNotification, cdcClassesToMatch, - deviceTerminatedCallbackOSX, this, &portIterator); - if (kernResult != KERN_SUCCESS) { - qDebug() << "IOServiceAddMatchingNotification return:" << kernResult; - return; - } - - // arm the callback, and clear any devices that are terminated - deviceTerminatedCallbackOSX( this, portIterator ); -} - diff --git a/qextserialport/qextserialenumerator_unix.cpp b/qextserialport/qextserialenumerator_unix.cpp deleted file mode 100644 index f43a75b6..00000000 --- a/qextserialport/qextserialenumerator_unix.cpp +++ /dev/null @@ -1,75 +0,0 @@ - - - -#include "qextserialenumerator.h" -#include -#include -#include -#include - -QextSerialEnumerator::QextSerialEnumerator( ) -{ - if( !QMetaType::isRegistered( QMetaType::type("QextPortInfo") ) ) - qRegisterMetaType("QextPortInfo"); -} - -QextSerialEnumerator::~QextSerialEnumerator( ) -{ -} - -QList QextSerialEnumerator::getPorts() -{ - QList infoList; -#ifdef Q_OS_LINUX - QStringList portNamePrefixes, portNameList; - portNamePrefixes << "ttyS*"; // list normal serial ports first - - QDir dir("/dev"); - portNameList = dir.entryList(portNamePrefixes, (QDir::System | QDir::Files), QDir::Name); - - // remove the values which are not serial ports for e.g. /dev/ttysa - for (int i = 0; i < portNameList.size(); i++) { - bool ok; - QString current = portNameList.at(i); - // remove the ttyS part, and check, if the other part is a number - current.remove(0,4).toInt(&ok, 10); - if (!ok) { - portNameList.removeAt(i); - i--; - } - } - - // get the non standard serial ports names - // (USB-serial, bluetooth-serial, 18F PICs, and so on) - // if you know an other name prefix for serial ports please let us know - portNamePrefixes.clear(); - portNamePrefixes << "ttyACM*" << "ttyUSB*" << "rfcomm*"; - portNameList.append(dir.entryList(portNamePrefixes, (QDir::System | QDir::Files), QDir::Name)); - - foreach (QString str , portNameList) { - QextPortInfo inf; - inf.physName = "/dev/"+str; - inf.portName = str; - - if (str.contains("ttyS")) { - inf.friendName = "Serial port "+str.remove(0, 4); - } - else if (str.contains("ttyUSB")) { - inf.friendName = "USB-serial adapter "+str.remove(0, 6); - } - else if (str.contains("rfcomm")) { - inf.friendName = "Bluetooth-serial adapter "+str.remove(0, 6); - } - inf.enumName = "/dev"; // is there a more helpful name for this? - infoList.append(inf); - } -#else - qCritical("Enumeration for POSIX systems (except Linux) is not implemented yet."); -#endif - return infoList; -} - -void QextSerialEnumerator::setUpNotifications( ) -{ - qCritical("Notifications for *Nix/FreeBSD are not implemented yet"); -} diff --git a/qextserialport/qextserialenumerator_win.cpp b/qextserialport/qextserialenumerator_win.cpp deleted file mode 100644 index f001e70b..00000000 --- a/qextserialport/qextserialenumerator_win.cpp +++ /dev/null @@ -1,206 +0,0 @@ - - - -#include "qextserialenumerator.h" -#include -#include - -#include -#include -#include "qextserialport.h" -#include - -QextSerialEnumerator::QextSerialEnumerator( ) -{ - if( !QMetaType::isRegistered( QMetaType::type("QextPortInfo") ) ) - qRegisterMetaType("QextPortInfo"); -#if (defined QT_GUI_LIB) - notificationWidget = 0; -#endif // Q_OS_WIN -} - -QextSerialEnumerator::~QextSerialEnumerator( ) -{ -#if (defined QT_GUI_LIB) - if( notificationWidget ) - delete notificationWidget; -#endif -} - - - -// see http://msdn.microsoft.com/en-us/library/ms791134.aspx for list of GUID classes -#ifndef GUID_DEVCLASS_PORTS - DEFINE_GUID(GUID_DEVCLASS_PORTS, 0x4D36E978, 0xE325, 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18 ); -#endif - -/* Gordon Schumacher's macros for TCHAR -> QString conversions and vice versa */ -#ifdef UNICODE - #define QStringToTCHAR(x) (wchar_t*) x.utf16() - #define PQStringToTCHAR(x) (wchar_t*) x->utf16() - #define TCHARToQString(x) QString::fromUtf16((ushort*)(x)) - #define TCHARToQStringN(x,y) QString::fromUtf16((ushort*)(x),(y)) -#else - #define QStringToTCHAR(x) x.local8Bit().constData() - #define PQStringToTCHAR(x) x->local8Bit().constData() - #define TCHARToQString(x) QString::fromLocal8Bit((x)) - #define TCHARToQStringN(x,y) QString::fromLocal8Bit((x),(y)) -#endif /*UNICODE*/ - - -//static -QString QextSerialEnumerator::getRegKeyValue(HKEY key, LPCTSTR property) -{ - DWORD size = 0; - DWORD type; - RegQueryValueEx(key, property, NULL, NULL, NULL, & size); - BYTE* buff = new BYTE[size]; - QString result; - if( RegQueryValueEx(key, property, NULL, &type, buff, & size) == ERROR_SUCCESS ) - result = TCHARToQString(buff); - RegCloseKey(key); - delete [] buff; - return result; -} - -//static -QString QextSerialEnumerator::getDeviceProperty(HDEVINFO devInfo, PSP_DEVINFO_DATA devData, DWORD property) -{ - DWORD buffSize = 0; - SetupDiGetDeviceRegistryProperty(devInfo, devData, property, NULL, NULL, 0, & buffSize); - BYTE* buff = new BYTE[buffSize]; - SetupDiGetDeviceRegistryProperty(devInfo, devData, property, NULL, buff, buffSize, NULL); - QString result = TCHARToQString(buff); - delete [] buff; - return result; -} - -QList QextSerialEnumerator::getPorts() -{ - QList ports; - enumerateDevicesWin(GUID_DEVCLASS_PORTS, &ports); - return ports; -} - -void QextSerialEnumerator::enumerateDevicesWin( const GUID & guid, QList* infoList ) -{ - HDEVINFO devInfo; - if( (devInfo = SetupDiGetClassDevs(&guid, NULL, NULL, DIGCF_PRESENT)) != INVALID_HANDLE_VALUE) - { - SP_DEVINFO_DATA devInfoData; - devInfoData.cbSize = sizeof(SP_DEVINFO_DATA); - for(int i = 0; SetupDiEnumDeviceInfo(devInfo, i, &devInfoData); i++) - { - QextPortInfo info; - info.productID = info.vendorID = 0; - getDeviceDetailsWin( &info, devInfo, &devInfoData ); - infoList->append(info); - } - SetupDiDestroyDeviceInfoList(devInfo); - } -} - -#ifdef QT_GUI_LIB -bool QextSerialRegistrationWidget::winEvent( MSG* message, long* result ) -{ - if ( message->message == WM_DEVICECHANGE ) { - qese->onDeviceChangeWin( message->wParam, message->lParam ); - *result = 1; - return true; - } - return false; -} -#endif - -void QextSerialEnumerator::setUpNotifications( ) -{ - #ifdef QT_GUI_LIB - if(notificationWidget) - return; - notificationWidget = new QextSerialRegistrationWidget(this); - - DEV_BROADCAST_DEVICEINTERFACE dbh; - ZeroMemory(&dbh, sizeof(dbh)); - dbh.dbcc_size = sizeof(dbh); - dbh.dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE; - CopyMemory(&dbh.dbcc_classguid, &GUID_DEVCLASS_PORTS, sizeof(GUID)); - if( RegisterDeviceNotification( (HANDLE)notificationWidget->winId( ), &dbh, DEVICE_NOTIFY_WINDOW_HANDLE ) == NULL) - qWarning() << "RegisterDeviceNotification failed:" << GetLastError(); - // setting up notifications doesn't tell us about devices already connected - // so get those manually - foreach( QextPortInfo port, getPorts() ) - emit deviceDiscovered( port ); - #else - qWarning("QextSerialEnumerator: GUI not enabled - can't register for device notifications."); - #endif // QT_GUI_LIB -} - -LRESULT QextSerialEnumerator::onDeviceChangeWin( WPARAM wParam, LPARAM lParam ) -{ - if ( DBT_DEVICEARRIVAL == wParam || DBT_DEVICEREMOVECOMPLETE == wParam ) - { - PDEV_BROADCAST_HDR pHdr = (PDEV_BROADCAST_HDR)lParam; - if( pHdr->dbch_devicetype == DBT_DEVTYP_DEVICEINTERFACE ) - { - PDEV_BROADCAST_DEVICEINTERFACE pDevInf = (PDEV_BROADCAST_DEVICEINTERFACE)pHdr; - // delimiters are different across APIs...change to backslash. ugh. - QString deviceID = TCHARToQString(pDevInf->dbcc_name).toUpper().replace("#", "\\"); - - matchAndDispatchChangedDevice(deviceID, GUID_DEVCLASS_PORTS, wParam); - } - } - return 0; -} - -bool QextSerialEnumerator::matchAndDispatchChangedDevice(const QString & deviceID, const GUID & guid, WPARAM wParam) -{ - bool rv = false; - DWORD dwFlag = (DBT_DEVICEARRIVAL == wParam) ? DIGCF_PRESENT : DIGCF_ALLCLASSES; - HDEVINFO devInfo; - if( (devInfo = SetupDiGetClassDevs(&guid,NULL,NULL,dwFlag)) != INVALID_HANDLE_VALUE ) - { - SP_DEVINFO_DATA spDevInfoData; - spDevInfoData.cbSize = sizeof(SP_DEVINFO_DATA); - for(int i=0; SetupDiEnumDeviceInfo(devInfo, i, &spDevInfoData); i++) - { - DWORD nSize=0 ; - TCHAR buf[MAX_PATH]; - if ( SetupDiGetDeviceInstanceId(devInfo, &spDevInfoData, buf, MAX_PATH, &nSize) && - deviceID.contains(TCHARToQString(buf))) // we found a match - { - rv = true; - QextPortInfo info; - info.productID = info.vendorID = 0; - getDeviceDetailsWin( &info, devInfo, &spDevInfoData, wParam ); - if( wParam == DBT_DEVICEARRIVAL ) - emit deviceDiscovered(info); - else if( wParam == DBT_DEVICEREMOVECOMPLETE ) - emit deviceRemoved(info); - break; - } - } - SetupDiDestroyDeviceInfoList(devInfo); - } - return rv; -} - -bool QextSerialEnumerator::getDeviceDetailsWin( QextPortInfo* portInfo, HDEVINFO devInfo, PSP_DEVINFO_DATA devData, WPARAM wParam ) -{ - portInfo->friendName = getDeviceProperty(devInfo, devData, SPDRP_FRIENDLYNAME); - if( wParam == DBT_DEVICEARRIVAL) - portInfo->physName = getDeviceProperty(devInfo, devData, SPDRP_PHYSICAL_DEVICE_OBJECT_NAME); - portInfo->enumName = getDeviceProperty(devInfo, devData, SPDRP_ENUMERATOR_NAME); - QString hardwareIDs = getDeviceProperty(devInfo, devData, SPDRP_HARDWAREID); - HKEY devKey = SetupDiOpenDevRegKey(devInfo, devData, DICS_FLAG_GLOBAL, 0, DIREG_DEV, KEY_READ); - portInfo->portName = QextSerialPort::fullPortNameWin( getRegKeyValue(devKey, TEXT("PortName")) ); - QRegExp idRx("VID_(\\w+)&PID_(\\w+)"); - if( hardwareIDs.toUpper().contains(idRx) ) - { - bool dummy; - portInfo->vendorID = idRx.cap(1).toInt(&dummy, 16); - portInfo->productID = idRx.cap(2).toInt(&dummy, 16); - //qDebug() << "got vid:" << vid << "pid:" << pid; - } - return true; -} - diff --git a/qextserialport/qextserialport.cpp b/qextserialport/qextserialport.cpp deleted file mode 100644 index ccf35983..00000000 --- a/qextserialport/qextserialport.cpp +++ /dev/null @@ -1,254 +0,0 @@ - - -#include -#include "qextserialport.h" - -/*! -Default constructor. Note that the name of the device used by a QextSerialPort constructed with -this constructor will be determined by #defined constants, or lack thereof - the default behavior -is the same as _TTY_LINUX_. Possible naming conventions and their associated constants are: - -\verbatim - -Constant Used By Naming Convention ----------- ------------- ------------------------ -Q_OS_WIN Windows COM1, COM2 -_TTY_IRIX_ SGI/IRIX /dev/ttyf1, /dev/ttyf2 -_TTY_HPUX_ HP-UX /dev/tty1p0, /dev/tty2p0 -_TTY_SUN_ SunOS/Solaris /dev/ttya, /dev/ttyb -_TTY_DIGITAL_ Digital UNIX /dev/tty01, /dev/tty02 -_TTY_FREEBSD_ FreeBSD /dev/ttyd0, /dev/ttyd1 -_TTY_OPENBSD_ OpenBSD /dev/tty00, /dev/tty01 -_TTY_LINUX_ Linux /dev/ttyS0, /dev/ttyS1 - Linux /dev/ttyS0, /dev/ttyS1 -\endverbatim - -This constructor assigns the device name to the name of the first port on the specified system. -See the other constructors if you need to open a different port. -*/ -QextSerialPort::QextSerialPort(QextSerialPort::QueryMode mode) - : QIODevice() -{ - -#ifdef Q_OS_WIN - setPortName("COM1"); - -#elif defined(_TTY_IRIX_) - setPortName("/dev/ttyf1"); - -#elif defined(_TTY_HPUX_) - setPortName("/dev/tty1p0"); - -#elif defined(_TTY_SUN_) - setPortName("/dev/ttya"); - -#elif defined(_TTY_DIGITAL_) - setPortName("/dev/tty01"); - -#elif defined(_TTY_FREEBSD_) - setPortName("/dev/ttyd1"); - -#elif defined(_TTY_OPENBSD_) - setPortName("/dev/tty00"); - -#else - setPortName("/dev/ttyS0"); -#endif - - construct(); - setQueryMode(mode); - platformSpecificInit(); -} - -/*! -Constructs a serial port attached to the port specified by name. -name is the name of the device, which is windowsystem-specific, -e.g."COM1" or "/dev/ttyS0". -*/ -QextSerialPort::QextSerialPort(const QString & name, QextSerialPort::QueryMode mode) - : QIODevice() -{ - construct(); - setQueryMode(mode); - setPortName(name); - platformSpecificInit(); -} - -/*! -Constructs a port with default name and specified settings. -*/ -QextSerialPort::QextSerialPort(const PortSettings& settings, QextSerialPort::QueryMode mode) - : QIODevice() -{ - construct(); - setBaudRate(settings.BaudRate); - setDataBits(settings.DataBits); - setParity(settings.Parity); - setStopBits(settings.StopBits); - setFlowControl(settings.FlowControl); - setTimeout(settings.Timeout_Millisec); - setQueryMode(mode); - platformSpecificInit(); -} - -/*! -Constructs a port with specified name and settings. -*/ -QextSerialPort::QextSerialPort(const QString & name, const PortSettings& settings, QextSerialPort::QueryMode mode) - : QIODevice() -{ - construct(); - setPortName(name); - setBaudRate(settings.BaudRate); - setDataBits(settings.DataBits); - setParity(settings.Parity); - setStopBits(settings.StopBits); - setFlowControl(settings.FlowControl); - setTimeout(settings.Timeout_Millisec); - setQueryMode(mode); - platformSpecificInit(); -} - -/*! -Common constructor function for setting up default port settings. -(115200 Baud, 8N1, Hardware flow control where supported, otherwise no flow control, and 0 ms timeout). -*/ -void QextSerialPort::construct() -{ - lastErr = E_NO_ERROR; - Settings.BaudRate=BAUD115200; - Settings.DataBits=DATA_8; - Settings.Parity=PAR_NONE; - Settings.StopBits=STOP_1; - Settings.FlowControl=FLOW_HARDWARE; - Settings.Timeout_Millisec=500; - mutex = new QMutex( QMutex::Recursive ); - setOpenMode(QIODevice::NotOpen); -} - -void QextSerialPort::setQueryMode(QueryMode mechanism) -{ - _queryMode = mechanism; -} - -/*! -Sets the name of the device associated with the object, e.g. "COM1", or "/dev/ttyS0". -*/ -void QextSerialPort::setPortName(const QString & name) -{ - #ifdef Q_OS_WIN - port = fullPortNameWin( name ); - #else - port = name; - #endif -} - -/*! -Returns the name set by setPortName(). -*/ -QString QextSerialPort::portName() const -{ - return port; -} - -/*! - Reads all available data from the device, and returns it as a QByteArray. - This function has no way of reporting errors; returning an empty QByteArray() - can mean either that no data was currently available for reading, or that an error occurred. -*/ -QByteArray QextSerialPort::readAll() -{ - int avail = this->bytesAvailable(); - return (avail > 0) ? this->read(avail) : QByteArray(); -} - -/*! -Returns the baud rate of the serial port. For a list of possible return values see -the definition of the enum BaudRateType. -*/ -BaudRateType QextSerialPort::baudRate(void) const -{ - return Settings.BaudRate; -} - -/*! -Returns the number of data bits used by the port. For a list of possible values returned by -this function, see the definition of the enum DataBitsType. -*/ -DataBitsType QextSerialPort::dataBits() const -{ - return Settings.DataBits; -} - -/*! -Returns the type of parity used by the port. For a list of possible values returned by -this function, see the definition of the enum ParityType. -*/ -ParityType QextSerialPort::parity() const -{ - return Settings.Parity; -} - -/*! -Returns the number of stop bits used by the port. For a list of possible return values, see -the definition of the enum StopBitsType. -*/ -StopBitsType QextSerialPort::stopBits() const -{ - return Settings.StopBits; -} - -/*! -Returns the type of flow control used by the port. For a list of possible values returned -by this function, see the definition of the enum FlowType. -*/ -FlowType QextSerialPort::flowControl() const -{ - return Settings.FlowControl; -} - -/*! -Returns true if device is sequential, otherwise returns false. Serial port is sequential device -so this function always returns true. Check QIODevice::isSequential() documentation for more -information. -*/ -bool QextSerialPort::isSequential() const -{ - return true; -} - -QString QextSerialPort::errorString() -{ - switch(lastErr) - { - case E_NO_ERROR: return "No Error has occurred"; - case E_INVALID_FD: return "Invalid file descriptor (port was not opened correctly)"; - case E_NO_MEMORY: return "Unable to allocate memory tables (POSIX)"; - case E_CAUGHT_NON_BLOCKED_SIGNAL: return "Caught a non-blocked signal (POSIX)"; - case E_PORT_TIMEOUT: return "Operation timed out (POSIX)"; - case E_INVALID_DEVICE: return "The file opened by the port is not a valid device"; - case E_BREAK_CONDITION: return "The port detected a break condition"; - case E_FRAMING_ERROR: return "The port detected a framing error (usually caused by incorrect baud rate settings)"; - case E_IO_ERROR: return "There was an I/O error while communicating with the port"; - case E_BUFFER_OVERRUN: return "Character buffer overrun"; - case E_RECEIVE_OVERFLOW: return "Receive buffer overflow"; - case E_RECEIVE_PARITY_ERROR: return "The port detected a parity error in the received data"; - case E_TRANSMIT_OVERFLOW: return "Transmit buffer overflow"; - case E_READ_FAILED: return "General read operation failure"; - case E_WRITE_FAILED: return "General write operation failure"; - case E_FILE_NOT_FOUND: return "The "+this->portName()+" file doesn't exists"; - default: return QString("Unknown error: %1").arg(lastErr); - } -} - -/*! -Standard destructor. -*/ -QextSerialPort::~QextSerialPort() -{ - if (isOpen()) { - close(); - } - platformSpecificDestruct(); - delete mutex; -} diff --git a/qextserialport/qextserialport.h b/qextserialport/qextserialport.h deleted file mode 100644 index d153483c..00000000 --- a/qextserialport/qextserialport.h +++ /dev/null @@ -1,333 +0,0 @@ - -#ifndef _QEXTSERIALPORT_H_ -#define _QEXTSERIALPORT_H_ - -#include "qextserialport_global.h" - -/*if all warning messages are turned off, flag portability warnings to be turned off as well*/ -#ifdef _TTY_NOWARN_ -#define _TTY_NOWARN_PORT_ -#endif - -/*macros for warning and debug messages*/ -#ifdef _TTY_NOWARN_PORT_ -#define TTY_PORTABILITY_WARNING(s) -#else -#define TTY_PORTABILITY_WARNING(s) qWarning(s) -#endif /*_TTY_NOWARN_PORT_*/ -#ifdef _TTY_NOWARN_ -#define TTY_WARNING(s) -#else -#define TTY_WARNING(s) qWarning(s) -#endif /*_TTY_NOWARN_*/ - - -/*line status constants*/ -#define LS_CTS 0x01 -#define LS_DSR 0x02 -#define LS_DCD 0x04 -#define LS_RI 0x08 -#define LS_RTS 0x10 -#define LS_DTR 0x20 -#define LS_ST 0x40 -#define LS_SR 0x80 - -/*error constants*/ -#define E_NO_ERROR 0 -#define E_INVALID_FD 1 -#define E_NO_MEMORY 2 -#define E_CAUGHT_NON_BLOCKED_SIGNAL 3 -#define E_PORT_TIMEOUT 4 -#define E_INVALID_DEVICE 5 -#define E_BREAK_CONDITION 6 -#define E_FRAMING_ERROR 7 -#define E_IO_ERROR 8 -#define E_BUFFER_OVERRUN 9 -#define E_RECEIVE_OVERFLOW 10 -#define E_RECEIVE_PARITY_ERROR 11 -#define E_TRANSMIT_OVERFLOW 12 -#define E_READ_FAILED 13 -#define E_WRITE_FAILED 14 -#define E_FILE_NOT_FOUND 15 - -enum BaudRateType -{ - BAUD50, //POSIX ONLY - BAUD75, //POSIX ONLY - BAUD110, - BAUD134, //POSIX ONLY - BAUD150, //POSIX ONLY - BAUD200, //POSIX ONLY - BAUD300, - BAUD600, - BAUD1200, - BAUD1800, //POSIX ONLY - BAUD2400, - BAUD4800, - BAUD9600, - BAUD14400, //WINDOWS ONLY - BAUD19200, - BAUD38400, - BAUD56000, //WINDOWS ONLY - BAUD57600, - BAUD76800, //POSIX ONLY - BAUD115200, - BAUD128000, //WINDOWS ONLY - BAUD256000 //WINDOWS ONLY -}; - -enum DataBitsType -{ - DATA_5, - DATA_6, - DATA_7, - DATA_8 -}; - -enum ParityType -{ - PAR_NONE, - PAR_ODD, - PAR_EVEN, - PAR_MARK, //WINDOWS ONLY - PAR_SPACE -}; - -enum StopBitsType -{ - STOP_1, - STOP_1_5, //WINDOWS ONLY - STOP_2 -}; - -enum FlowType -{ - FLOW_OFF, - FLOW_HARDWARE, - FLOW_XONXOFF -}; - -/** - * structure to contain port settings - */ -struct PortSettings -{ - BaudRateType BaudRate; - DataBitsType DataBits; - ParityType Parity; - StopBitsType StopBits; - FlowType FlowControl; - long Timeout_Millisec; -}; - -#include -#include -#ifdef Q_OS_UNIX -#include -#include -#include -#include -#include -#include -#include -#include -#elif (defined Q_OS_WIN) -#include -#include -#include -#include "qextserialport/qwineventnotifier_p.h" -#endif - -/*! -Encapsulates a serial port on both POSIX and Windows systems. - -\note -Be sure to check the full list of members, as QIODevice provides quite a lot of -functionality for QextSerialPort. - -\section Usage -QextSerialPort offers both a polling and event driven API. Event driven is typically easier -to use, since you never have to worry about checking for new data. - -\b Example -\code -QextSerialPort* port = new QextSerialPort("COM1", QextSerialPort::EventDriven); -connect(port, SIGNAL(readyRead()), myClass, SLOT(onDataAvailable())); -port->open(); - -void MyClass::onDataAvailable() { - int avail = port->bytesAvailable(); - if( avail > 0 ) { - QByteArray usbdata; - usbdata.resize(avail); - int read = port->read(usbdata.data(), usbdata.size()); - if( read > 0 ) { - processNewData(usbdata); - } - } -} -\endcode - -\section Compatibility -The user will be notified of errors and possible portability conflicts at run-time -by default - this behavior can be turned off by defining _TTY_NOWARN_ -(to turn off all warnings) or _TTY_NOWARN_PORT_ (to turn off portability warnings) in the project. - -On Windows NT/2000/XP this class uses Win32 serial port functions by default. The user may -select POSIX behavior under NT, 2000, or XP ONLY by defining Q_OS_UNIX in the project. -No guarantees are made as to the quality of POSIX support under NT/2000 however. - -\author Stefan Sander, Michal Policht, Brandon Fosdick, Liam Staskawicz -*/ -class QEXTSERIALPORT_EXPORT QextSerialPort: public QIODevice -{ - Q_OBJECT - public: - enum QueryMode { - Polling, - EventDriven - }; - - QextSerialPort(QueryMode mode = EventDriven); - QextSerialPort(const QString & name, QueryMode mode = EventDriven); - QextSerialPort(PortSettings const& s, QueryMode mode = EventDriven); - QextSerialPort(const QString & name, PortSettings const& s, QueryMode mode = EventDriven); - ~QextSerialPort(); - - void setPortName(const QString & name); - QString portName() const; - - /**! - * Get query mode. - * \return query mode. - */ - inline QueryMode queryMode() const { return _queryMode; } - - /*! - * Set desired serial communication handling style. You may choose from polling - * or event driven approach. This function does nothing when port is open; to - * apply changes port must be reopened. - * - * In event driven approach read() and write() functions are acting - * asynchronously. They return immediately and the operation is performed in - * the background, so they doesn't freeze the calling thread. - * To determine when operation is finished, QextSerialPort runs separate thread - * and monitors serial port events. Whenever the event occurs, adequate signal - * is emitted. - * - * When polling is set, read() and write() are acting synchronously. Signals are - * not working in this mode and some functions may not be available. The advantage - * of polling is that it generates less overhead due to lack of signals emissions - * and it doesn't start separate thread to monitor events. - * - * Generally event driven approach is more capable and friendly, although some - * applications may need as low overhead as possible and then polling comes. - * - * \param mode query mode. - */ - void setQueryMode(QueryMode mode); - - void setBaudRate(BaudRateType); - BaudRateType baudRate() const; - - void setDataBits(DataBitsType); - DataBitsType dataBits() const; - - void setParity(ParityType); - ParityType parity() const; - - void setStopBits(StopBitsType); - StopBitsType stopBits() const; - - void setFlowControl(FlowType); - FlowType flowControl() const; - - void setTimeout(long); - - bool open(OpenMode mode); - bool isSequential() const; - void close(); - void flush(); - - qint64 size() const; - qint64 bytesAvailable() const; - QByteArray readAll(); - - void ungetChar(char c); - - ulong lastError() const; - void translateError(ulong error); - - void setDtr(bool set=true); - void setRts(bool set=true); - ulong lineStatus(); - QString errorString(); - -#ifdef Q_OS_WIN - virtual bool waitForReadyRead(int msecs); ///< @todo implement. - virtual qint64 bytesToWrite() const; - static QString fullPortNameWin(const QString & name); -#endif - - protected: - QMutex* mutex; - QString port; - PortSettings Settings; - ulong lastErr; - QueryMode _queryMode; - - // platform specific members -#ifdef Q_OS_UNIX - int fd; - QSocketNotifier *readNotifier; - struct termios Posix_CommConfig; - struct termios old_termios; - struct timeval Posix_Timeout; - struct timeval Posix_Copy_Timeout; -#elif (defined Q_OS_WIN) - HANDLE Win_Handle; - OVERLAPPED overlap; - COMMCONFIG Win_CommConfig; - COMMTIMEOUTS Win_CommTimeouts; - QWinEventNotifier *winEventNotifier; - DWORD eventMask; - QList pendingWrites; - QReadWriteLock* bytesToWriteLock; - qint64 _bytesToWrite; -#endif - - void construct(); // common construction - void platformSpecificDestruct(); - void platformSpecificInit(); - qint64 readData(char * data, qint64 maxSize); - qint64 writeData(const char * data, qint64 maxSize); - -#ifdef Q_OS_WIN - private slots: - void onWinEvent(HANDLE h); -#endif - - private: - Q_DISABLE_COPY(QextSerialPort) - - signals: -// /** -// * This signal is emitted whenever port settings are updated. -// * \param valid \p true if settings are valid, \p false otherwise. -// * -// * @todo implement. -// */ -// // void validSettings(bool valid); - - /*! - * This signal is emitted whenever dsr line has changed its state. You may - * use this signal to check if device is connected. - * \param status \p true when DSR signal is on, \p false otherwise. - * - * \see lineStatus(). - */ - void dsrChanged(bool status); - -}; - -#endif diff --git a/qextserialport/qextserialport_global.h b/qextserialport/qextserialport_global.h deleted file mode 100644 index a2b77727..00000000 --- a/qextserialport/qextserialport_global.h +++ /dev/null @@ -1,17 +0,0 @@ - - -#ifndef QEXTSERIALPORT_GLOBAL_H -#define QEXTSERIALPORT_GLOBAL_H - -#include - -#define QEXTSERIALPORT_LIB - -#ifdef QEXTSERIALPORT_LIB -# define QEXTSERIALPORT_EXPORT Q_DECL_EXPORT -#else -# define QEXTSERIALPORT_EXPORT Q_DECL_IMPORT -#endif - -#endif // QEXTSERIALPORT_GLOBAL_H - diff --git a/qextserialport/qwineventnotifier_p.h b/qextserialport/qwineventnotifier_p.h deleted file mode 100644 index d005ba0a..00000000 --- a/qextserialport/qwineventnotifier_p.h +++ /dev/null @@ -1,94 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtCore module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial Usage -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Nokia. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWINEVENTNOTIFIER_P_H -#define QWINEVENTNOTIFIER_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists for the convenience -// of other Qt classes. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include "QtCore/qobject.h" -#include "QtCore/qt_windows.h" - -QT_BEGIN_NAMESPACE - -class Q_CORE_EXPORT QWinEventNotifier : public QObject -{ - Q_OBJECT - Q_DECLARE_PRIVATE(QObject) - -public: - explicit QWinEventNotifier(QObject *parent = 0); - explicit QWinEventNotifier(HANDLE hEvent, QObject *parent = 0); - ~QWinEventNotifier(); - - void setHandle(HANDLE hEvent); - HANDLE handle() const; - - bool isEnabled() const; - -public Q_SLOTS: - void setEnabled(bool enable); - -Q_SIGNALS: - void activated(HANDLE hEvent); - -protected: - bool event(QEvent * e); - -private: - Q_DISABLE_COPY(QWinEventNotifier) - - HANDLE handleToEvent; - bool enabled; -}; - -QT_END_NAMESPACE - -#endif // QWINEVENTNOTIFIER_P_H diff --git a/qextserialport/win_qextserialport.cpp b/qextserialport/win_qextserialport.cpp deleted file mode 100644 index 13a064da..00000000 --- a/qextserialport/win_qextserialport.cpp +++ /dev/null @@ -1,868 +0,0 @@ - - -#include -#include -#include -#include "qextserialport.h" - -void QextSerialPort::platformSpecificInit() -{ - Win_Handle=INVALID_HANDLE_VALUE; - ZeroMemory(&overlap, sizeof(OVERLAPPED)); - overlap.hEvent = CreateEvent(NULL, true, false, NULL); - winEventNotifier = 0; - bytesToWriteLock = new QReadWriteLock; - _bytesToWrite = 0; -} - -/*! -Standard destructor. -*/ -void QextSerialPort::platformSpecificDestruct() { - CloseHandle(overlap.hEvent); - delete bytesToWriteLock; -} - -QString QextSerialPort::fullPortNameWin(const QString & name) -{ - QRegExp rx("^COM(\\d+)"); - QString fullName(name); - if(fullName.contains(rx)) { - int portnum = rx.cap(1).toInt(); - if(portnum > 9) // COM ports greater than 9 need \\.\ prepended - fullName.prepend("\\\\.\\"); - } - return fullName; -} - -/*! -Opens a serial port. Note that this function does not specify which device to open. If you need -to open a device by name, see QextSerialPort::open(const char*). This function has no effect -if the port associated with the class is already open. The port is also configured to the current -settings, as stored in the Settings structure. -*/ -bool QextSerialPort::open(OpenMode mode) { - unsigned long confSize = sizeof(COMMCONFIG); - Win_CommConfig.dwSize = confSize; - DWORD dwFlagsAndAttributes = 0; - if (queryMode() == QextSerialPort::EventDriven) - dwFlagsAndAttributes += FILE_FLAG_OVERLAPPED; - - QMutexLocker lock(mutex); - if (mode == QIODevice::NotOpen) - return isOpen(); - if (!isOpen()) { - /*open the port*/ - Win_Handle=CreateFileA(port.toLatin1(), GENERIC_READ|GENERIC_WRITE, - 0, NULL, OPEN_EXISTING, dwFlagsAndAttributes, NULL); - if (Win_Handle!=INVALID_HANDLE_VALUE) { - QIODevice::open(mode); - /*configure port settings*/ - GetCommConfig(Win_Handle, &Win_CommConfig, &confSize); - GetCommState(Win_Handle, &(Win_CommConfig.dcb)); - - /*set up parameters*/ - Win_CommConfig.dcb.fBinary=TRUE; - Win_CommConfig.dcb.fInX=FALSE; - Win_CommConfig.dcb.fOutX=FALSE; - Win_CommConfig.dcb.fAbortOnError=FALSE; - Win_CommConfig.dcb.fNull=FALSE; - setBaudRate(Settings.BaudRate); - setDataBits(Settings.DataBits); - setStopBits(Settings.StopBits); - setParity(Settings.Parity); - setFlowControl(Settings.FlowControl); - setTimeout(Settings.Timeout_Millisec); - SetCommConfig(Win_Handle, &Win_CommConfig, sizeof(COMMCONFIG)); - - //init event driven approach - if (queryMode() == QextSerialPort::EventDriven) { - Win_CommTimeouts.ReadIntervalTimeout = MAXDWORD; - Win_CommTimeouts.ReadTotalTimeoutMultiplier = 0; - Win_CommTimeouts.ReadTotalTimeoutConstant = 0; - Win_CommTimeouts.WriteTotalTimeoutMultiplier = 0; - Win_CommTimeouts.WriteTotalTimeoutConstant = 0; - SetCommTimeouts(Win_Handle, &Win_CommTimeouts); - if (!SetCommMask( Win_Handle, EV_TXEMPTY | EV_RXCHAR | EV_DSR)) { - qWarning() << "failed to set Comm Mask. Error code:", GetLastError(); - return false; - } - winEventNotifier = new QWinEventNotifier(overlap.hEvent, this); - connect(winEventNotifier, SIGNAL(activated(HANDLE)), this, SLOT(onWinEvent(HANDLE))); - WaitCommEvent(Win_Handle, &eventMask, &overlap); - } - } - } else { - return false; - } - return isOpen(); -} - -/*! -Closes a serial port. This function has no effect if the serial port associated with the class -is not currently open. -*/ -void QextSerialPort::close() -{ - QMutexLocker lock(mutex); - if (isOpen()) { - flush(); - QIODevice::close(); // mark ourselves as closed - CancelIo(Win_Handle); - if (CloseHandle(Win_Handle)) - Win_Handle = INVALID_HANDLE_VALUE; - if (winEventNotifier) - winEventNotifier->deleteLater(); - - _bytesToWrite = 0; - - foreach(OVERLAPPED* o, pendingWrites) { - CloseHandle(o->hEvent); - delete o; - } - pendingWrites.clear(); - } -} - -/*! -Flushes all pending I/O to the serial port. This function has no effect if the serial port -associated with the class is not currently open. -*/ -void QextSerialPort::flush() { - QMutexLocker lock(mutex); - if (isOpen()) { - FlushFileBuffers(Win_Handle); - } -} - -/*! -This function will return the number of bytes waiting in the receive queue of the serial port. -It is included primarily to provide a complete QIODevice interface, and will not record errors -in the lastErr member (because it is const). This function is also not thread-safe - in -multithreading situations, use QextSerialPort::bytesAvailable() instead. -*/ -qint64 QextSerialPort::size() const { - int availBytes; - COMSTAT Win_ComStat; - DWORD Win_ErrorMask=0; - ClearCommError(Win_Handle, &Win_ErrorMask, &Win_ComStat); - availBytes = Win_ComStat.cbInQue; - return (qint64)availBytes; -} - -/*! -Returns the number of bytes waiting in the port's receive queue. This function will return 0 if -the port is not currently open, or -1 on error. -*/ -qint64 QextSerialPort::bytesAvailable() const { - QMutexLocker lock(mutex); - if (isOpen()) { - DWORD Errors; - COMSTAT Status; - if (ClearCommError(Win_Handle, &Errors, &Status)) { - return Status.cbInQue + QIODevice::bytesAvailable(); - } - return (qint64)-1; - } - return 0; -} - -/*! -Translates a system-specific error code to a QextSerialPort error code. Used internally. -*/ -void QextSerialPort::translateError(ulong error) { - if (error&CE_BREAK) { - lastErr=E_BREAK_CONDITION; - } - else if (error&CE_FRAME) { - lastErr=E_FRAMING_ERROR; - } - else if (error&CE_IOE) { - lastErr=E_IO_ERROR; - } - else if (error&CE_MODE) { - lastErr=E_INVALID_FD; - } - else if (error&CE_OVERRUN) { - lastErr=E_BUFFER_OVERRUN; - } - else if (error&CE_RXPARITY) { - lastErr=E_RECEIVE_PARITY_ERROR; - } - else if (error&CE_RXOVER) { - lastErr=E_RECEIVE_OVERFLOW; - } - else if (error&CE_TXFULL) { - lastErr=E_TRANSMIT_OVERFLOW; - } -} - -/*! -Reads a block of data from the serial port. This function will read at most maxlen bytes from -the serial port and place them in the buffer pointed to by data. Return value is the number of -bytes actually read, or -1 on error. - -\warning before calling this function ensure that serial port associated with this class -is currently open (use isOpen() function to check if port is open). -*/ -qint64 QextSerialPort::readData(char *data, qint64 maxSize) -{ - DWORD retVal; - QMutexLocker lock(mutex); - retVal = 0; - if (queryMode() == QextSerialPort::EventDriven) { - OVERLAPPED overlapRead; - ZeroMemory(&overlapRead, sizeof(OVERLAPPED)); - if (!ReadFile(Win_Handle, (void*)data, (DWORD)maxSize, & retVal, & overlapRead)) { - if (GetLastError() == ERROR_IO_PENDING) - GetOverlappedResult(Win_Handle, & overlapRead, & retVal, true); - else { - lastErr = E_READ_FAILED; - retVal = (DWORD)-1; - } - } - } else if (!ReadFile(Win_Handle, (void*)data, (DWORD)maxSize, & retVal, NULL)) { - lastErr = E_READ_FAILED; - retVal = (DWORD)-1; - } - return (qint64)retVal; -} - -/*! -Writes a block of data to the serial port. This function will write len bytes -from the buffer pointed to by data to the serial port. Return value is the number -of bytes actually written, or -1 on error. - -\warning before calling this function ensure that serial port associated with this class -is currently open (use isOpen() function to check if port is open). -*/ -qint64 QextSerialPort::writeData(const char *data, qint64 maxSize) -{ - QMutexLocker lock( mutex ); - DWORD retVal = 0; - if (queryMode() == QextSerialPort::EventDriven) { - OVERLAPPED* newOverlapWrite = new OVERLAPPED; - ZeroMemory(newOverlapWrite, sizeof(OVERLAPPED)); - newOverlapWrite->hEvent = CreateEvent(NULL, true, false, NULL); - if (WriteFile(Win_Handle, (void*)data, (DWORD)maxSize, & retVal, newOverlapWrite)) { - CloseHandle(newOverlapWrite->hEvent); - delete newOverlapWrite; - } - else if (GetLastError() == ERROR_IO_PENDING) { - // writing asynchronously...not an error - QWriteLocker writelocker(bytesToWriteLock); - _bytesToWrite += maxSize; - pendingWrites.append(newOverlapWrite); - } - else { - qDebug() << "serialport write error:" << GetLastError(); - lastErr = E_WRITE_FAILED; - retVal = (DWORD)-1; - if(!CancelIo(newOverlapWrite->hEvent)) - qDebug() << "serialport: couldn't cancel IO"; - if(!CloseHandle(newOverlapWrite->hEvent)) - qDebug() << "serialport: couldn't close OVERLAPPED handle"; - delete newOverlapWrite; - } - } else if (!WriteFile(Win_Handle, (void*)data, (DWORD)maxSize, & retVal, NULL)) { - lastErr = E_WRITE_FAILED; - retVal = (DWORD)-1; - } - return (qint64)retVal; -} - -/*! -This function is included to implement the full QIODevice interface, and currently has no -purpose within this class. This function is meaningless on an unbuffered device and currently -only prints a warning message to that effect. -*/ -void QextSerialPort::ungetChar(char c) { - - /*meaningless on unbuffered sequential device - return error and print a warning*/ - TTY_WARNING("QextSerialPort: ungetChar() called on an unbuffered sequential device - operation is meaningless"); -} - -/*! -Sets the flow control used by the port. Possible values of flow are: -\verbatim - FLOW_OFF No flow control - FLOW_HARDWARE Hardware (RTS/CTS) flow control - FLOW_XONXOFF Software (XON/XOFF) flow control -\endverbatim -*/ -void QextSerialPort::setFlowControl(FlowType flow) { - QMutexLocker lock(mutex); - if (Settings.FlowControl!=flow) { - Settings.FlowControl=flow; - } - if (isOpen()) { - switch(flow) { - - /*no flow control*/ - case FLOW_OFF: - Win_CommConfig.dcb.fOutxCtsFlow=FALSE; - Win_CommConfig.dcb.fRtsControl=RTS_CONTROL_DISABLE; - Win_CommConfig.dcb.fInX=FALSE; - Win_CommConfig.dcb.fOutX=FALSE; - SetCommConfig(Win_Handle, &Win_CommConfig, sizeof(COMMCONFIG)); - break; - - /*software (XON/XOFF) flow control*/ - case FLOW_XONXOFF: - Win_CommConfig.dcb.fOutxCtsFlow=FALSE; - Win_CommConfig.dcb.fRtsControl=RTS_CONTROL_DISABLE; - Win_CommConfig.dcb.fInX=TRUE; - Win_CommConfig.dcb.fOutX=TRUE; - SetCommConfig(Win_Handle, &Win_CommConfig, sizeof(COMMCONFIG)); - break; - - case FLOW_HARDWARE: - Win_CommConfig.dcb.fOutxCtsFlow=TRUE; - Win_CommConfig.dcb.fRtsControl=RTS_CONTROL_HANDSHAKE; - Win_CommConfig.dcb.fInX=FALSE; - Win_CommConfig.dcb.fOutX=FALSE; - SetCommConfig(Win_Handle, &Win_CommConfig, sizeof(COMMCONFIG)); - break; - } - } -} - -/*! -Sets the parity associated with the serial port. The possible values of parity are: -\verbatim - PAR_SPACE Space Parity - PAR_MARK Mark Parity - PAR_NONE No Parity - PAR_EVEN Even Parity - PAR_ODD Odd Parity -\endverbatim -*/ -void QextSerialPort::setParity(ParityType parity) { - QMutexLocker lock(mutex); - if (Settings.Parity!=parity) { - Settings.Parity=parity; - } - if (isOpen()) { - Win_CommConfig.dcb.Parity=(unsigned char)parity; - switch (parity) { - - /*space parity*/ - case PAR_SPACE: - if (Settings.DataBits==DATA_8) { - TTY_PORTABILITY_WARNING("QextSerialPort Portability Warning: Space parity with 8 data bits is not supported by POSIX systems."); - } - Win_CommConfig.dcb.fParity=TRUE; - break; - - /*mark parity - WINDOWS ONLY*/ - case PAR_MARK: - TTY_PORTABILITY_WARNING("QextSerialPort Portability Warning: Mark parity is not supported by POSIX systems"); - Win_CommConfig.dcb.fParity=TRUE; - break; - - /*no parity*/ - case PAR_NONE: - Win_CommConfig.dcb.fParity=FALSE; - break; - - /*even parity*/ - case PAR_EVEN: - Win_CommConfig.dcb.fParity=TRUE; - break; - - /*odd parity*/ - case PAR_ODD: - Win_CommConfig.dcb.fParity=TRUE; - break; - } - SetCommConfig(Win_Handle, &Win_CommConfig, sizeof(COMMCONFIG)); - } -} - -/*! -Sets the number of data bits used by the serial port. Possible values of dataBits are: -\verbatim - DATA_5 5 data bits - DATA_6 6 data bits - DATA_7 7 data bits - DATA_8 8 data bits -\endverbatim - -\note -This function is subject to the following restrictions: -\par - 5 data bits cannot be used with 2 stop bits. -\par - 1.5 stop bits can only be used with 5 data bits. -\par - 8 data bits cannot be used with space parity on POSIX systems. -*/ -void QextSerialPort::setDataBits(DataBitsType dataBits) { - QMutexLocker lock(mutex); - if (Settings.DataBits!=dataBits) { - if ((Settings.StopBits==STOP_2 && dataBits==DATA_5) || - (Settings.StopBits==STOP_1_5 && dataBits!=DATA_5)) { - } - else { - Settings.DataBits=dataBits; - } - } - if (isOpen()) { - switch(dataBits) { - - /*5 data bits*/ - case DATA_5: - if (Settings.StopBits==STOP_2) { - TTY_WARNING("QextSerialPort: 5 Data bits cannot be used with 2 stop bits."); - } - else { - Win_CommConfig.dcb.ByteSize=5; - SetCommConfig(Win_Handle, &Win_CommConfig, sizeof(COMMCONFIG)); - } - break; - - /*6 data bits*/ - case DATA_6: - if (Settings.StopBits==STOP_1_5) { - TTY_WARNING("QextSerialPort: 6 Data bits cannot be used with 1.5 stop bits."); - } - else { - Win_CommConfig.dcb.ByteSize=6; - SetCommConfig(Win_Handle, &Win_CommConfig, sizeof(COMMCONFIG)); - } - break; - - /*7 data bits*/ - case DATA_7: - if (Settings.StopBits==STOP_1_5) { - TTY_WARNING("QextSerialPort: 7 Data bits cannot be used with 1.5 stop bits."); - } - else { - Win_CommConfig.dcb.ByteSize=7; - SetCommConfig(Win_Handle, &Win_CommConfig, sizeof(COMMCONFIG)); - } - break; - - /*8 data bits*/ - case DATA_8: - if (Settings.StopBits==STOP_1_5) { - TTY_WARNING("QextSerialPort: 8 Data bits cannot be used with 1.5 stop bits."); - } - else { - Win_CommConfig.dcb.ByteSize=8; - SetCommConfig(Win_Handle, &Win_CommConfig, sizeof(COMMCONFIG)); - } - break; - } - } -} - -/*! -Sets the number of stop bits used by the serial port. Possible values of stopBits are: -\verbatim - STOP_1 1 stop bit - STOP_1_5 1.5 stop bits - STOP_2 2 stop bits -\endverbatim - -\note -This function is subject to the following restrictions: -\par - 2 stop bits cannot be used with 5 data bits. -\par - 1.5 stop bits cannot be used with 6 or more data bits. -\par - POSIX does not support 1.5 stop bits. -*/ -void QextSerialPort::setStopBits(StopBitsType stopBits) { - QMutexLocker lock(mutex); - if (Settings.StopBits!=stopBits) { - if ((Settings.DataBits==DATA_5 && stopBits==STOP_2) || - (stopBits==STOP_1_5 && Settings.DataBits!=DATA_5)) { - } - else { - Settings.StopBits=stopBits; - } - } - if (isOpen()) { - switch (stopBits) { - - /*one stop bit*/ - case STOP_1: - Win_CommConfig.dcb.StopBits=ONESTOPBIT; - SetCommConfig(Win_Handle, &Win_CommConfig, sizeof(COMMCONFIG)); - break; - - /*1.5 stop bits*/ - case STOP_1_5: - TTY_PORTABILITY_WARNING("QextSerialPort Portability Warning: 1.5 stop bit operation is not supported by POSIX."); - if (Settings.DataBits!=DATA_5) { - TTY_WARNING("QextSerialPort: 1.5 stop bits can only be used with 5 data bits"); - } - else { - Win_CommConfig.dcb.StopBits=ONE5STOPBITS; - SetCommConfig(Win_Handle, &Win_CommConfig, sizeof(COMMCONFIG)); - } - break; - - /*two stop bits*/ - case STOP_2: - if (Settings.DataBits==DATA_5) { - TTY_WARNING("QextSerialPort: 2 stop bits cannot be used with 5 data bits"); - } - else { - Win_CommConfig.dcb.StopBits=TWOSTOPBITS; - SetCommConfig(Win_Handle, &Win_CommConfig, sizeof(COMMCONFIG)); - } - break; - } - } -} - -/*! -Sets the baud rate of the serial port. Note that not all rates are applicable on -all platforms. The following table shows translations of the various baud rate -constants on Windows(including NT/2000) and POSIX platforms. Speeds marked with an * -are speeds that are usable on both Windows and POSIX. -\verbatim - - RATE Windows Speed POSIX Speed - ----------- ------------- ----------- - BAUD50 110 50 - BAUD75 110 75 - *BAUD110 110 110 - BAUD134 110 134.5 - BAUD150 110 150 - BAUD200 110 200 - *BAUD300 300 300 - *BAUD600 600 600 - *BAUD1200 1200 1200 - BAUD1800 1200 1800 - *BAUD2400 2400 2400 - *BAUD4800 4800 4800 - *BAUD9600 9600 9600 - BAUD14400 14400 9600 - *BAUD19200 19200 19200 - *BAUD38400 38400 38400 - BAUD56000 56000 38400 - *BAUD57600 57600 57600 - BAUD76800 57600 76800 - *BAUD115200 115200 115200 - BAUD128000 128000 115200 - BAUD256000 256000 115200 -\endverbatim -*/ -void QextSerialPort::setBaudRate(BaudRateType baudRate) { - QMutexLocker lock(mutex); - if (Settings.BaudRate!=baudRate) { - switch (baudRate) { - case BAUD50: - case BAUD75: - case BAUD134: - case BAUD150: - case BAUD200: - Settings.BaudRate=BAUD110; - break; - - case BAUD1800: - Settings.BaudRate=BAUD1200; - break; - - case BAUD76800: - Settings.BaudRate=BAUD57600; - break; - - default: - Settings.BaudRate=baudRate; - break; - } - } - if (isOpen()) { - switch (baudRate) { - - /*50 baud*/ - case BAUD50: - TTY_WARNING("QextSerialPort: Windows does not support 50 baud operation. Switching to 110 baud."); - Win_CommConfig.dcb.BaudRate=CBR_110; - break; - - /*75 baud*/ - case BAUD75: - TTY_WARNING("QextSerialPort: Windows does not support 75 baud operation. Switching to 110 baud."); - Win_CommConfig.dcb.BaudRate=CBR_110; - break; - - /*110 baud*/ - case BAUD110: - Win_CommConfig.dcb.BaudRate=CBR_110; - break; - - /*134.5 baud*/ - case BAUD134: - TTY_WARNING("QextSerialPort: Windows does not support 134.5 baud operation. Switching to 110 baud."); - Win_CommConfig.dcb.BaudRate=CBR_110; - break; - - /*150 baud*/ - case BAUD150: - TTY_WARNING("QextSerialPort: Windows does not support 150 baud operation. Switching to 110 baud."); - Win_CommConfig.dcb.BaudRate=CBR_110; - break; - - /*200 baud*/ - case BAUD200: - TTY_WARNING("QextSerialPort: Windows does not support 200 baud operation. Switching to 110 baud."); - Win_CommConfig.dcb.BaudRate=CBR_110; - break; - - /*300 baud*/ - case BAUD300: - Win_CommConfig.dcb.BaudRate=CBR_300; - break; - - /*600 baud*/ - case BAUD600: - Win_CommConfig.dcb.BaudRate=CBR_600; - break; - - /*1200 baud*/ - case BAUD1200: - Win_CommConfig.dcb.BaudRate=CBR_1200; - break; - - /*1800 baud*/ - case BAUD1800: - TTY_WARNING("QextSerialPort: Windows does not support 1800 baud operation. Switching to 1200 baud."); - Win_CommConfig.dcb.BaudRate=CBR_1200; - break; - - /*2400 baud*/ - case BAUD2400: - Win_CommConfig.dcb.BaudRate=CBR_2400; - break; - - /*4800 baud*/ - case BAUD4800: - Win_CommConfig.dcb.BaudRate=CBR_4800; - break; - - /*9600 baud*/ - case BAUD9600: - Win_CommConfig.dcb.BaudRate=CBR_9600; - break; - - /*14400 baud*/ - case BAUD14400: - TTY_PORTABILITY_WARNING("QextSerialPort Portability Warning: POSIX does not support 14400 baud operation."); - Win_CommConfig.dcb.BaudRate=CBR_14400; - break; - - /*19200 baud*/ - case BAUD19200: - Win_CommConfig.dcb.BaudRate=CBR_19200; - break; - - /*38400 baud*/ - case BAUD38400: - Win_CommConfig.dcb.BaudRate=CBR_38400; - break; - - /*56000 baud*/ - case BAUD56000: - TTY_PORTABILITY_WARNING("QextSerialPort Portability Warning: POSIX does not support 56000 baud operation."); - Win_CommConfig.dcb.BaudRate=CBR_56000; - break; - - /*57600 baud*/ - case BAUD57600: - Win_CommConfig.dcb.BaudRate=CBR_57600; - break; - - /*76800 baud*/ - case BAUD76800: - TTY_WARNING("QextSerialPort: Windows does not support 76800 baud operation. Switching to 57600 baud."); - Win_CommConfig.dcb.BaudRate=CBR_57600; - break; - - /*115200 baud*/ - case BAUD115200: - Win_CommConfig.dcb.BaudRate=CBR_115200; - break; - - /*128000 baud*/ - case BAUD128000: - TTY_PORTABILITY_WARNING("QextSerialPort Portability Warning: POSIX does not support 128000 baud operation."); - Win_CommConfig.dcb.BaudRate=CBR_128000; - break; - - /*256000 baud*/ - case BAUD256000: - TTY_PORTABILITY_WARNING("QextSerialPort Portability Warning: POSIX does not support 256000 baud operation."); - Win_CommConfig.dcb.BaudRate=CBR_256000; - break; - } - SetCommConfig(Win_Handle, &Win_CommConfig, sizeof(COMMCONFIG)); - } -} - -/*! -Sets DTR line to the requested state (high by default). This function will have no effect if -the port associated with the class is not currently open. -*/ -void QextSerialPort::setDtr(bool set) { - QMutexLocker lock(mutex); - if (isOpen()) { - if (set) { - EscapeCommFunction(Win_Handle, SETDTR); - } - else { - EscapeCommFunction(Win_Handle, CLRDTR); - } - } -} - -/*! -Sets RTS line to the requested state (high by default). This function will have no effect if -the port associated with the class is not currently open. -*/ -void QextSerialPort::setRts(bool set) { - QMutexLocker lock(mutex); - if (isOpen()) { - if (set) { - EscapeCommFunction(Win_Handle, SETRTS); - } - else { - EscapeCommFunction(Win_Handle, CLRRTS); - } - } -} - -/*! -Returns the line status as stored by the port function. This function will retrieve the states -of the following lines: DCD, CTS, DSR, and RI. On POSIX systems, the following additional lines -can be monitored: DTR, RTS, Secondary TXD, and Secondary RXD. The value returned is an unsigned -long with specific bits indicating which lines are high. The following constants should be used -to examine the states of individual lines: - -\verbatim -Mask Line ------- ---- -LS_CTS CTS -LS_DSR DSR -LS_DCD DCD -LS_RI RI -\endverbatim - -This function will return 0 if the port associated with the class is not currently open. -*/ -ulong QextSerialPort::lineStatus(void) { - unsigned long Status=0, Temp=0; - QMutexLocker lock(mutex); - if (isOpen()) { - GetCommModemStatus(Win_Handle, &Temp); - if (Temp&MS_CTS_ON) { - Status|=LS_CTS; - } - if (Temp&MS_DSR_ON) { - Status|=LS_DSR; - } - if (Temp&MS_RING_ON) { - Status|=LS_RI; - } - if (Temp&MS_RLSD_ON) { - Status|=LS_DCD; - } - } - return Status; -} - -bool QextSerialPort::waitForReadyRead(int msecs) -{ - //@todo implement - return false; -} - -qint64 QextSerialPort::bytesToWrite() const -{ - QReadLocker rl(bytesToWriteLock); - return _bytesToWrite; -} - -/* - Triggered when there's activity on our HANDLE. -*/ -void QextSerialPort::onWinEvent(HANDLE h) -{ - QMutexLocker lock(mutex); - if(h == overlap.hEvent) { - if (eventMask & EV_RXCHAR) { - if (sender() != this && bytesAvailable() > 0) - emit readyRead(); - } - if (eventMask & EV_TXEMPTY) { - /* - A write completed. Run through the list of OVERLAPPED writes, and if - they completed successfully, take them off the list and delete them. - Otherwise, leave them on there so they can finish. - */ - qint64 totalBytesWritten = 0; - QList overlapsToDelete; - foreach(OVERLAPPED* o, pendingWrites) { - DWORD numBytes = 0; - if (GetOverlappedResult(Win_Handle, o, & numBytes, false)) { - overlapsToDelete.append(o); - totalBytesWritten += numBytes; - } else if( GetLastError() != ERROR_IO_INCOMPLETE ) { - overlapsToDelete.append(o); - qWarning() << "CommEvent overlapped write error:" << GetLastError(); - } - } - - if (sender() != this && totalBytesWritten > 0) { - QWriteLocker writelocker(bytesToWriteLock); - emit bytesWritten(totalBytesWritten); - _bytesToWrite = 0; - } - - foreach(OVERLAPPED* o, overlapsToDelete) { - OVERLAPPED *toDelete = pendingWrites.takeAt(pendingWrites.indexOf(o)); - CloseHandle(toDelete->hEvent); - delete toDelete; - } - } - if (eventMask & EV_DSR) { - if (lineStatus() & LS_DSR) - emit dsrChanged(true); - else - emit dsrChanged(false); - } - } - WaitCommEvent(Win_Handle, &eventMask, &overlap); -} - -/*! -Sets the read and write timeouts for the port to millisec milliseconds. -Setting 0 indicates that timeouts are not used for read nor write operations; -however read() and write() functions will still block. Set -1 to provide -non-blocking behaviour (read() and write() will return immediately). - -\note this function does nothing in event driven mode. -*/ -void QextSerialPort::setTimeout(long millisec) { - QMutexLocker lock(mutex); - Settings.Timeout_Millisec = millisec; - - if (millisec == -1) { - Win_CommTimeouts.ReadIntervalTimeout = MAXDWORD; - Win_CommTimeouts.ReadTotalTimeoutConstant = 0; - } else { - Win_CommTimeouts.ReadIntervalTimeout = millisec; - Win_CommTimeouts.ReadTotalTimeoutConstant = millisec; - } - Win_CommTimeouts.ReadTotalTimeoutMultiplier = 0; - Win_CommTimeouts.WriteTotalTimeoutMultiplier = millisec; - Win_CommTimeouts.WriteTotalTimeoutConstant = 0; - if (queryMode() != QextSerialPort::EventDriven) - SetCommTimeouts(Win_Handle, &Win_CommTimeouts); -} - diff --git a/quazip/JlCompress.h b/quazip/JlCompress.h deleted file mode 100644 index c5bfd46b..00000000 --- a/quazip/JlCompress.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef JLCOMPRESSFOLDER_H_ -#define JLCOMPRESSFOLDER_H_ - -#include "quazip.h" -#include "quazipfile.h" -#include "quazipfileinfo.h" -#include -#include -#include -#include - -class QUAZIP_EXPORT JlCompress { -private: - static bool compressFile(QuaZip* zip, QString fileName, QString fileDest); - static bool compressSubDir(QuaZip* parentZip, QString dir, QString parentDir, bool recursive = true); - static bool extractFile(QuaZip* zip, QString fileName, QString fileDest); - - static bool removeFile(QStringList listFile); - -public: - static bool compressFile(QString fileCompressed, QString file); - static bool compressFiles(QString fileCompressed, QStringList files); - static bool compressDir(QString fileCompressed, QString dir = QString(), bool recursive = true); - -public: - static QString extractFile(QString fileCompressed, QString file, QString fileDest = QString()); - static QStringList extractFiles(QString fileCompressed, QStringList files, QString dir = QString()); - static QStringList extractDir(QString fileCompressed, QString dir = QString()); - static QStringList getFileList(QString fileCompressed); -}; - -#endif /* JLCOMPRESSFOLDER_H_ */ diff --git a/quazip/zconf.h b/quazip/zconf.h deleted file mode 100644 index f60d653d..00000000 --- a/quazip/zconf.h +++ /dev/null @@ -1,429 +0,0 @@ -/* zconf.h -- configuration of the zlib compression library - * Copyright (C) 1995-2010 Jean-loup Gailly. - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* @(#) $Id$ */ - -#ifndef ZCONF_H -#define ZCONF_H - -/* - * If you *really* need a unique prefix for all types and library functions, - * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. - * Even better than compiling with -DZ_PREFIX would be to use configure to set - * this permanently in zconf.h using "./configure --zprefix". - */ -#ifdef Z_PREFIX /* may be set to #if 1 by ./configure */ - -/* all linked symbols */ -# define _dist_code z__dist_code -# define _length_code z__length_code -# define _tr_align z__tr_align -# define _tr_flush_block z__tr_flush_block -# define _tr_init z__tr_init -# define _tr_stored_block z__tr_stored_block -# define _tr_tally z__tr_tally -# define adler32 z_adler32 -# define adler32_combine z_adler32_combine -# define adler32_combine64 z_adler32_combine64 -# define compress z_compress -# define compress2 z_compress2 -# define compressBound z_compressBound -# define crc32 z_crc32 -# define crc32_combine z_crc32_combine -# define crc32_combine64 z_crc32_combine64 -# define deflate z_deflate -# define deflateBound z_deflateBound -# define deflateCopy z_deflateCopy -# define deflateEnd z_deflateEnd -# define deflateInit2_ z_deflateInit2_ -# define deflateInit_ z_deflateInit_ -# define deflateParams z_deflateParams -# define deflatePrime z_deflatePrime -# define deflateReset z_deflateReset -# define deflateSetDictionary z_deflateSetDictionary -# define deflateSetHeader z_deflateSetHeader -# define deflateTune z_deflateTune -# define deflate_copyright z_deflate_copyright -# define get_crc_table z_get_crc_table -# define gz_error z_gz_error -# define gz_intmax z_gz_intmax -# define gz_strwinerror z_gz_strwinerror -# define gzbuffer z_gzbuffer -# define gzclearerr z_gzclearerr -# define gzclose z_gzclose -# define gzclose_r z_gzclose_r -# define gzclose_w z_gzclose_w -# define gzdirect z_gzdirect -# define gzdopen z_gzdopen -# define gzeof z_gzeof -# define gzerror z_gzerror -# define gzflush z_gzflush -# define gzgetc z_gzgetc -# define gzgets z_gzgets -# define gzoffset z_gzoffset -# define gzoffset64 z_gzoffset64 -# define gzopen z_gzopen -# define gzopen64 z_gzopen64 -# define gzprintf z_gzprintf -# define gzputc z_gzputc -# define gzputs z_gzputs -# define gzread z_gzread -# define gzrewind z_gzrewind -# define gzseek z_gzseek -# define gzseek64 z_gzseek64 -# define gzsetparams z_gzsetparams -# define gztell z_gztell -# define gztell64 z_gztell64 -# define gzungetc z_gzungetc -# define gzwrite z_gzwrite -# define inflate z_inflate -# define inflateBack z_inflateBack -# define inflateBackEnd z_inflateBackEnd -# define inflateBackInit_ z_inflateBackInit_ -# define inflateCopy z_inflateCopy -# define inflateEnd z_inflateEnd -# define inflateGetHeader z_inflateGetHeader -# define inflateInit2_ z_inflateInit2_ -# define inflateInit_ z_inflateInit_ -# define inflateMark z_inflateMark -# define inflatePrime z_inflatePrime -# define inflateReset z_inflateReset -# define inflateReset2 z_inflateReset2 -# define inflateSetDictionary z_inflateSetDictionary -# define inflateSync z_inflateSync -# define inflateSyncPoint z_inflateSyncPoint -# define inflateUndermine z_inflateUndermine -# define inflate_copyright z_inflate_copyright -# define inflate_fast z_inflate_fast -# define inflate_table z_inflate_table -# define uncompress z_uncompress -# define zError z_zError -# define zcalloc z_zcalloc -# define zcfree z_zcfree -# define zlibCompileFlags z_zlibCompileFlags -# define zlibVersion z_zlibVersion - -/* all zlib typedefs in zlib.h and zconf.h */ -# define Byte z_Byte -# define Bytef z_Bytef -# define alloc_func z_alloc_func -# define charf z_charf -# define free_func z_free_func -# define gzFile z_gzFile -# define gz_header z_gz_header -# define gz_headerp z_gz_headerp -# define in_func z_in_func -# define intf z_intf -# define out_func z_out_func -# define uInt z_uInt -# define uIntf z_uIntf -# define uLong z_uLong -# define uLongf z_uLongf -# define voidp z_voidp -# define voidpc z_voidpc -# define voidpf z_voidpf - -/* all zlib structs in zlib.h and zconf.h */ -# define gz_header_s z_gz_header_s -# define internal_state z_internal_state - -#endif - -#if defined(__MSDOS__) && !defined(MSDOS) -# define MSDOS -#endif -#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) -# define OS2 -#endif -#if defined(_WINDOWS) && !defined(WINDOWS) -# define WINDOWS -#endif -#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) -# ifndef WIN32 -# define WIN32 -# endif -#endif -#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) -# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) -# ifndef SYS16BIT -# define SYS16BIT -# endif -# endif -#endif - -/* - * Compile with -DMAXSEG_64K if the alloc function cannot allocate more - * than 64k bytes at a time (needed on systems with 16-bit int). - */ -#ifdef SYS16BIT -# define MAXSEG_64K -#endif -#ifdef MSDOS -# define UNALIGNED_OK -#endif - -#ifdef __STDC_VERSION__ -# ifndef STDC -# define STDC -# endif -# if __STDC_VERSION__ >= 199901L -# ifndef STDC99 -# define STDC99 -# endif -# endif -#endif -#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) -# define STDC -#endif -#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) -# define STDC -#endif -#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) -# define STDC -#endif -#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) -# define STDC -#endif - -#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ -# define STDC -#endif - -#ifndef STDC -# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ -# define const /* note: need a more gentle solution here */ -# endif -#endif - -/* Some Mac compilers merge all .h files incorrectly: */ -#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__) -# define NO_DUMMY_DECL -#endif - -/* Maximum value for memLevel in deflateInit2 */ -#ifndef MAX_MEM_LEVEL -# ifdef MAXSEG_64K -# define MAX_MEM_LEVEL 8 -# else -# define MAX_MEM_LEVEL 9 -# endif -#endif - -/* Maximum value for windowBits in deflateInit2 and inflateInit2. - * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files - * created by gzip. (Files created by minigzip can still be extracted by - * gzip.) - */ -#ifndef MAX_WBITS -# define MAX_WBITS 15 /* 32K LZ77 window */ -#endif - -/* The memory requirements for deflate are (in bytes): - (1 << (windowBits+2)) + (1 << (memLevel+9)) - that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) - plus a few kilobytes for small objects. For example, if you want to reduce - the default memory requirements from 256K to 128K, compile with - make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" - Of course this will generally degrade compression (there's no free lunch). - - The memory requirements for inflate are (in bytes) 1 << windowBits - that is, 32K for windowBits=15 (default value) plus a few kilobytes - for small objects. -*/ - - /* Type declarations */ - -#ifndef OF /* function prototypes */ -# ifdef STDC -# define OF(args) args -# else -# define OF(args) () -# endif -#endif - -/* The following definitions for FAR are needed only for MSDOS mixed - * model programming (small or medium model with some far allocations). - * This was tested only with MSC; for other MSDOS compilers you may have - * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, - * just define FAR to be empty. - */ -#ifdef SYS16BIT -# if defined(M_I86SM) || defined(M_I86MM) - /* MSC small or medium model */ -# define SMALL_MEDIUM -# ifdef _MSC_VER -# define FAR _far -# else -# define FAR far -# endif -# endif -# if (defined(__SMALL__) || defined(__MEDIUM__)) - /* Turbo C small or medium model */ -# define SMALL_MEDIUM -# ifdef __BORLANDC__ -# define FAR _far -# else -# define FAR far -# endif -# endif -#endif - -#if defined(WINDOWS) || defined(WIN32) - /* If building or using zlib as a DLL, define ZLIB_DLL. - * This is not mandatory, but it offers a little performance increase. - */ -# ifdef ZLIB_DLL -# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) -# ifdef ZLIB_INTERNAL -# define ZEXTERN extern __declspec(dllexport) -# else -# define ZEXTERN extern __declspec(dllimport) -# endif -# endif -# endif /* ZLIB_DLL */ - /* If building or using zlib with the WINAPI/WINAPIV calling convention, - * define ZLIB_WINAPI. - * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. - */ -# ifdef ZLIB_WINAPI -# ifdef FAR -# undef FAR -# endif -# include - /* No need for _export, use ZLIB.DEF instead. */ - /* For complete Windows compatibility, use WINAPI, not __stdcall. */ -# define ZEXPORT WINAPI -# ifdef WIN32 -# define ZEXPORTVA WINAPIV -# else -# define ZEXPORTVA FAR CDECL -# endif -# endif -#endif - -#if defined (__BEOS__) -# ifdef ZLIB_DLL -# ifdef ZLIB_INTERNAL -# define ZEXPORT __declspec(dllexport) -# define ZEXPORTVA __declspec(dllexport) -# else -# define ZEXPORT __declspec(dllimport) -# define ZEXPORTVA __declspec(dllimport) -# endif -# endif -#endif - -#ifndef ZEXTERN -# define ZEXTERN extern -#endif -#ifndef ZEXPORT -# define ZEXPORT -#endif -#ifndef ZEXPORTVA -# define ZEXPORTVA -#endif - -#ifndef FAR -# define FAR -#endif - -#if !defined(__MACTYPES__) -typedef unsigned char Byte; /* 8 bits */ -#endif -typedef unsigned int uInt; /* 16 bits or more */ -typedef unsigned long uLong; /* 32 bits or more */ - -#ifdef SMALL_MEDIUM - /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ -# define Bytef Byte FAR -#else - typedef Byte FAR Bytef; -#endif -typedef char FAR charf; -typedef int FAR intf; -typedef uInt FAR uIntf; -typedef uLong FAR uLongf; - -#ifdef STDC - typedef void const *voidpc; - typedef void FAR *voidpf; - typedef void *voidp; -#else - typedef Byte const *voidpc; - typedef Byte FAR *voidpf; - typedef Byte *voidp; -#endif - - -#ifndef BUILD_WITH_MSVC /* was set to #if 1 by ./configure */ -# define Z_HAVE_UNISTD_H -#endif - -#ifdef STDC -# include /* for off_t */ -#endif - -/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and - * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even - * though the former does not conform to the LFS document), but considering - * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as - * equivalently requesting no 64-bit operations - */ -#if -_LARGEFILE64_SOURCE - -1 == 1 -# undef _LARGEFILE64_SOURCE -#endif - -#if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE) -# include /* for SEEK_* and off_t */ -# ifdef VMS -# include /* for off_t */ -# endif -# ifndef z_off_t -# define z_off_t off_t -# endif -#endif - -#ifndef SEEK_SET -# define SEEK_SET 0 /* Seek from beginning of file. */ -# define SEEK_CUR 1 /* Seek from current position. */ -# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ -#endif - -#ifndef z_off_t -# define z_off_t long -#endif - -#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0 -# define z_off64_t off64_t -#else -# define z_off64_t z_off_t -#endif - -#if defined(__OS400__) -# define NO_vsnprintf -#endif - -#if defined(__MVS__) -# define NO_vsnprintf -#endif - -/* MVS linker does not support external names larger than 8 bytes */ -#if defined(__MVS__) - #pragma map(deflateInit_,"DEIN") - #pragma map(deflateInit2_,"DEIN2") - #pragma map(deflateEnd,"DEEND") - #pragma map(deflateBound,"DEBND") - #pragma map(inflateInit_,"ININ") - #pragma map(inflateInit2_,"ININ2") - #pragma map(inflateEnd,"INEND") - #pragma map(inflateSync,"INSY") - #pragma map(inflateSetDictionary,"INSEDI") - #pragma map(compressBound,"CMBND") - #pragma map(inflate_table,"INTABL") - #pragma map(inflate_fast,"INFA") - #pragma map(inflate_copyright,"INCOPY") -#endif - -#endif /* ZCONF_H */ diff --git a/quazip/zlib.h b/quazip/zlib.h deleted file mode 100644 index d3a3da8e..00000000 --- a/quazip/zlib.h +++ /dev/null @@ -1,1613 +0,0 @@ -/* zlib.h -- interface of the 'zlib' general purpose compression library - version 1.2.5, April 19th, 2010 - - Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - Jean-loup Gailly Mark Adler - jloup@gzip.org madler@alumni.caltech.edu - - - The data format used by the zlib library is described by RFCs (Request for - Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt - (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format). -*/ - -#ifndef ZLIB_H -#define ZLIB_H - -#include "zconf.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define ZLIB_VERSION "1.2.5" -#define ZLIB_VERNUM 0x1250 -#define ZLIB_VER_MAJOR 1 -#define ZLIB_VER_MINOR 2 -#define ZLIB_VER_REVISION 5 -#define ZLIB_VER_SUBREVISION 0 - -/* - The 'zlib' compression library provides in-memory compression and - decompression functions, including integrity checks of the uncompressed data. - This version of the library supports only one compression method (deflation) - but other algorithms will be added later and will have the same stream - interface. - - Compression can be done in a single step if the buffers are large enough, - or can be done by repeated calls of the compression function. In the latter - case, the application must provide more input and/or consume the output - (providing more output space) before each call. - - The compressed data format used by default by the in-memory functions is - the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped - around a deflate stream, which is itself documented in RFC 1951. - - The library also supports reading and writing files in gzip (.gz) format - with an interface similar to that of stdio using the functions that start - with "gz". The gzip format is different from the zlib format. gzip is a - gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. - - This library can optionally read and write gzip streams in memory as well. - - The zlib format was designed to be compact and fast for use in memory - and on communications channels. The gzip format was designed for single- - file compression on file systems, has a larger header than zlib to maintain - directory information, and uses a different, slower check method than zlib. - - The library does not install any signal handler. The decoder checks - the consistency of the compressed data, so the library should never crash - even in case of corrupted input. -*/ - -typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size)); -typedef void (*free_func) OF((voidpf opaque, voidpf address)); - -struct internal_state; - -typedef struct z_stream_s { - Bytef *next_in; /* next input byte */ - uInt avail_in; /* number of bytes available at next_in */ - uLong total_in; /* total nb of input bytes read so far */ - - Bytef *next_out; /* next output byte should be put there */ - uInt avail_out; /* remaining free space at next_out */ - uLong total_out; /* total nb of bytes output so far */ - - char *msg; /* last error message, NULL if no error */ - struct internal_state FAR *state; /* not visible by applications */ - - alloc_func zalloc; /* used to allocate the internal state */ - free_func zfree; /* used to free the internal state */ - voidpf opaque; /* private data object passed to zalloc and zfree */ - - int data_type; /* best guess about the data type: binary or text */ - uLong adler; /* adler32 value of the uncompressed data */ - uLong reserved; /* reserved for future use */ -} z_stream; - -typedef z_stream FAR *z_streamp; - -/* - gzip header information passed to and from zlib routines. See RFC 1952 - for more details on the meanings of these fields. -*/ -typedef struct gz_header_s { - int text; /* true if compressed data believed to be text */ - uLong time; /* modification time */ - int xflags; /* extra flags (not used when writing a gzip file) */ - int os; /* operating system */ - Bytef *extra; /* pointer to extra field or Z_NULL if none */ - uInt extra_len; /* extra field length (valid if extra != Z_NULL) */ - uInt extra_max; /* space at extra (only when reading header) */ - Bytef *name; /* pointer to zero-terminated file name or Z_NULL */ - uInt name_max; /* space at name (only when reading header) */ - Bytef *comment; /* pointer to zero-terminated comment or Z_NULL */ - uInt comm_max; /* space at comment (only when reading header) */ - int hcrc; /* true if there was or will be a header crc */ - int done; /* true when done reading gzip header (not used - when writing a gzip file) */ -} gz_header; - -typedef gz_header FAR *gz_headerp; - -/* - The application must update next_in and avail_in when avail_in has dropped - to zero. It must update next_out and avail_out when avail_out has dropped - to zero. The application must initialize zalloc, zfree and opaque before - calling the init function. All other fields are set by the compression - library and must not be updated by the application. - - The opaque value provided by the application will be passed as the first - parameter for calls of zalloc and zfree. This can be useful for custom - memory management. The compression library attaches no meaning to the - opaque value. - - zalloc must return Z_NULL if there is not enough memory for the object. - If zlib is used in a multi-threaded application, zalloc and zfree must be - thread safe. - - On 16-bit systems, the functions zalloc and zfree must be able to allocate - exactly 65536 bytes, but will not be required to allocate more than this if - the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, pointers - returned by zalloc for objects of exactly 65536 bytes *must* have their - offset normalized to zero. The default allocation function provided by this - library ensures this (see zutil.c). To reduce memory requirements and avoid - any allocation of 64K objects, at the expense of compression ratio, compile - the library with -DMAX_WBITS=14 (see zconf.h). - - The fields total_in and total_out can be used for statistics or progress - reports. After compression, total_in holds the total size of the - uncompressed data and may be saved for use in the decompressor (particularly - if the decompressor wants to decompress everything in a single step). -*/ - - /* constants */ - -#define Z_NO_FLUSH 0 -#define Z_PARTIAL_FLUSH 1 -#define Z_SYNC_FLUSH 2 -#define Z_FULL_FLUSH 3 -#define Z_FINISH 4 -#define Z_BLOCK 5 -#define Z_TREES 6 -/* Allowed flush values; see deflate() and inflate() below for details */ - -#define Z_OK 0 -#define Z_STREAM_END 1 -#define Z_NEED_DICT 2 -#define Z_ERRNO (-1) -#define Z_STREAM_ERROR (-2) -#define Z_DATA_ERROR (-3) -#define Z_MEM_ERROR (-4) -#define Z_BUF_ERROR (-5) -#define Z_VERSION_ERROR (-6) -/* Return codes for the compression/decompression functions. Negative values - * are errors, positive values are used for special but normal events. - */ - -#define Z_NO_COMPRESSION 0 -#define Z_BEST_SPEED 1 -#define Z_BEST_COMPRESSION 9 -#define Z_DEFAULT_COMPRESSION (-1) -/* compression levels */ - -#define Z_FILTERED 1 -#define Z_HUFFMAN_ONLY 2 -#define Z_RLE 3 -#define Z_FIXED 4 -#define Z_DEFAULT_STRATEGY 0 -/* compression strategy; see deflateInit2() below for details */ - -#define Z_BINARY 0 -#define Z_TEXT 1 -#define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */ -#define Z_UNKNOWN 2 -/* Possible values of the data_type field (though see inflate()) */ - -#define Z_DEFLATED 8 -/* The deflate compression method (the only one supported in this version) */ - -#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ - -#define zlib_version zlibVersion() -/* for compatibility with versions < 1.0.2 */ - - - /* basic functions */ - -ZEXTERN const char * ZEXPORT zlibVersion OF((void)); -/* The application can compare zlibVersion and ZLIB_VERSION for consistency. - If the first character differs, the library code actually used is not - compatible with the zlib.h header file used by the application. This check - is automatically made by deflateInit and inflateInit. - */ - -/* -ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); - - Initializes the internal stream state for compression. The fields - zalloc, zfree and opaque must be initialized before by the caller. If - zalloc and zfree are set to Z_NULL, deflateInit updates them to use default - allocation functions. - - The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: - 1 gives best speed, 9 gives best compression, 0 gives no compression at all - (the input data is simply copied a block at a time). Z_DEFAULT_COMPRESSION - requests a default compromise between speed and compression (currently - equivalent to level 6). - - deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_STREAM_ERROR if level is not a valid compression level, or - Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible - with the version assumed by the caller (ZLIB_VERSION). msg is set to null - if there is no error message. deflateInit does not perform any compression: - this will be done by deflate(). -*/ - - -ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); -/* - deflate compresses as much data as possible, and stops when the input - buffer becomes empty or the output buffer becomes full. It may introduce - some output latency (reading input without producing any output) except when - forced to flush. - - The detailed semantics are as follows. deflate performs one or both of the - following actions: - - - Compress more input starting at next_in and update next_in and avail_in - accordingly. If not all input can be processed (because there is not - enough room in the output buffer), next_in and avail_in are updated and - processing will resume at this point for the next call of deflate(). - - - Provide more output starting at next_out and update next_out and avail_out - accordingly. This action is forced if the parameter flush is non zero. - Forcing flush frequently degrades the compression ratio, so this parameter - should be set only when necessary (in interactive applications). Some - output may be provided even if flush is not set. - - Before the call of deflate(), the application should ensure that at least - one of the actions is possible, by providing more input and/or consuming more - output, and updating avail_in or avail_out accordingly; avail_out should - never be zero before the call. The application can consume the compressed - output when it wants, for example when the output buffer is full (avail_out - == 0), or after each call of deflate(). If deflate returns Z_OK and with - zero avail_out, it must be called again after making room in the output - buffer because there might be more output pending. - - Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to - decide how much data to accumulate before producing output, in order to - maximize compression. - - If the parameter flush is set to Z_SYNC_FLUSH, all pending output is - flushed to the output buffer and the output is aligned on a byte boundary, so - that the decompressor can get all input data available so far. (In - particular avail_in is zero after the call if enough output space has been - provided before the call.) Flushing may degrade compression for some - compression algorithms and so it should be used only when necessary. This - completes the current deflate block and follows it with an empty stored block - that is three bits plus filler bits to the next byte, followed by four bytes - (00 00 ff ff). - - If flush is set to Z_PARTIAL_FLUSH, all pending output is flushed to the - output buffer, but the output is not aligned to a byte boundary. All of the - input data so far will be available to the decompressor, as for Z_SYNC_FLUSH. - This completes the current deflate block and follows it with an empty fixed - codes block that is 10 bits long. This assures that enough bytes are output - in order for the decompressor to finish the block before the empty fixed code - block. - - If flush is set to Z_BLOCK, a deflate block is completed and emitted, as - for Z_SYNC_FLUSH, but the output is not aligned on a byte boundary, and up to - seven bits of the current block are held to be written as the next byte after - the next deflate block is completed. In this case, the decompressor may not - be provided enough bits at this point in order to complete decompression of - the data provided so far to the compressor. It may need to wait for the next - block to be emitted. This is for advanced applications that need to control - the emission of deflate blocks. - - If flush is set to Z_FULL_FLUSH, all output is flushed as with - Z_SYNC_FLUSH, and the compression state is reset so that decompression can - restart from this point if previous compressed data has been damaged or if - random access is desired. Using Z_FULL_FLUSH too often can seriously degrade - compression. - - If deflate returns with avail_out == 0, this function must be called again - with the same value of the flush parameter and more output space (updated - avail_out), until the flush is complete (deflate returns with non-zero - avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that - avail_out is greater than six to avoid repeated flush markers due to - avail_out == 0 on return. - - If the parameter flush is set to Z_FINISH, pending input is processed, - pending output is flushed and deflate returns with Z_STREAM_END if there was - enough output space; if deflate returns with Z_OK, this function must be - called again with Z_FINISH and more output space (updated avail_out) but no - more input data, until it returns with Z_STREAM_END or an error. After - deflate has returned Z_STREAM_END, the only possible operations on the stream - are deflateReset or deflateEnd. - - Z_FINISH can be used immediately after deflateInit if all the compression - is to be done in a single step. In this case, avail_out must be at least the - value returned by deflateBound (see below). If deflate does not return - Z_STREAM_END, then it must be called again as described above. - - deflate() sets strm->adler to the adler32 checksum of all input read - so far (that is, total_in bytes). - - deflate() may update strm->data_type if it can make a good guess about - the input data type (Z_BINARY or Z_TEXT). In doubt, the data is considered - binary. This field is only for information purposes and does not affect the - compression algorithm in any manner. - - deflate() returns Z_OK if some progress has been made (more input - processed or more output produced), Z_STREAM_END if all input has been - consumed and all output has been produced (only when flush is set to - Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example - if next_in or next_out was Z_NULL), Z_BUF_ERROR if no progress is possible - (for example avail_in or avail_out was zero). Note that Z_BUF_ERROR is not - fatal, and deflate() can be called again with more input and more output - space to continue compressing. -*/ - - -ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)); -/* - All dynamically allocated data structures for this stream are freed. - This function discards any unprocessed input and does not flush any pending - output. - - deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the - stream state was inconsistent, Z_DATA_ERROR if the stream was freed - prematurely (some input or output was discarded). In the error case, msg - may be set but then points to a static string (which must not be - deallocated). -*/ - - -/* -ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); - - Initializes the internal stream state for decompression. The fields - next_in, avail_in, zalloc, zfree and opaque must be initialized before by - the caller. If next_in is not Z_NULL and avail_in is large enough (the - exact value depends on the compression method), inflateInit determines the - compression method from the zlib header and allocates all data structures - accordingly; otherwise the allocation will be deferred to the first call of - inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to - use default allocation functions. - - inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_VERSION_ERROR if the zlib library version is incompatible with the - version assumed by the caller, or Z_STREAM_ERROR if the parameters are - invalid, such as a null pointer to the structure. msg is set to null if - there is no error message. inflateInit does not perform any decompression - apart from possibly reading the zlib header if present: actual decompression - will be done by inflate(). (So next_in and avail_in may be modified, but - next_out and avail_out are unused and unchanged.) The current implementation - of inflateInit() does not process any header information -- that is deferred - until inflate() is called. -*/ - - -ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); -/* - inflate decompresses as much data as possible, and stops when the input - buffer becomes empty or the output buffer becomes full. It may introduce - some output latency (reading input without producing any output) except when - forced to flush. - - The detailed semantics are as follows. inflate performs one or both of the - following actions: - - - Decompress more input starting at next_in and update next_in and avail_in - accordingly. If not all input can be processed (because there is not - enough room in the output buffer), next_in is updated and processing will - resume at this point for the next call of inflate(). - - - Provide more output starting at next_out and update next_out and avail_out - accordingly. inflate() provides as much output as possible, until there is - no more input data or no more space in the output buffer (see below about - the flush parameter). - - Before the call of inflate(), the application should ensure that at least - one of the actions is possible, by providing more input and/or consuming more - output, and updating the next_* and avail_* values accordingly. The - application can consume the uncompressed output when it wants, for example - when the output buffer is full (avail_out == 0), or after each call of - inflate(). If inflate returns Z_OK and with zero avail_out, it must be - called again after making room in the output buffer because there might be - more output pending. - - The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FINISH, - Z_BLOCK, or Z_TREES. Z_SYNC_FLUSH requests that inflate() flush as much - output as possible to the output buffer. Z_BLOCK requests that inflate() - stop if and when it gets to the next deflate block boundary. When decoding - the zlib or gzip format, this will cause inflate() to return immediately - after the header and before the first block. When doing a raw inflate, - inflate() will go ahead and process the first block, and will return when it - gets to the end of that block, or when it runs out of data. - - The Z_BLOCK option assists in appending to or combining deflate streams. - Also to assist in this, on return inflate() will set strm->data_type to the - number of unused bits in the last byte taken from strm->next_in, plus 64 if - inflate() is currently decoding the last block in the deflate stream, plus - 128 if inflate() returned immediately after decoding an end-of-block code or - decoding the complete header up to just before the first byte of the deflate - stream. The end-of-block will not be indicated until all of the uncompressed - data from that block has been written to strm->next_out. The number of - unused bits may in general be greater than seven, except when bit 7 of - data_type is set, in which case the number of unused bits will be less than - eight. data_type is set as noted here every time inflate() returns for all - flush options, and so can be used to determine the amount of currently - consumed input in bits. - - The Z_TREES option behaves as Z_BLOCK does, but it also returns when the - end of each deflate block header is reached, before any actual data in that - block is decoded. This allows the caller to determine the length of the - deflate block header for later use in random access within a deflate block. - 256 is added to the value of strm->data_type when inflate() returns - immediately after reaching the end of the deflate block header. - - inflate() should normally be called until it returns Z_STREAM_END or an - error. However if all decompression is to be performed in a single step (a - single call of inflate), the parameter flush should be set to Z_FINISH. In - this case all pending input is processed and all pending output is flushed; - avail_out must be large enough to hold all the uncompressed data. (The size - of the uncompressed data may have been saved by the compressor for this - purpose.) The next operation on this stream must be inflateEnd to deallocate - the decompression state. The use of Z_FINISH is never required, but can be - used to inform inflate that a faster approach may be used for the single - inflate() call. - - In this implementation, inflate() always flushes as much output as - possible to the output buffer, and always uses the faster approach on the - first call. So the only effect of the flush parameter in this implementation - is on the return value of inflate(), as noted below, or when it returns early - because Z_BLOCK or Z_TREES is used. - - If a preset dictionary is needed after this call (see inflateSetDictionary - below), inflate sets strm->adler to the adler32 checksum of the dictionary - chosen by the compressor and returns Z_NEED_DICT; otherwise it sets - strm->adler to the adler32 checksum of all output produced so far (that is, - total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described - below. At the end of the stream, inflate() checks that its computed adler32 - checksum is equal to that saved by the compressor and returns Z_STREAM_END - only if the checksum is correct. - - inflate() can decompress and check either zlib-wrapped or gzip-wrapped - deflate data. The header type is detected automatically, if requested when - initializing with inflateInit2(). Any information contained in the gzip - header is not retained, so applications that need that information should - instead use raw inflate, see inflateInit2() below, or inflateBack() and - perform their own processing of the gzip header and trailer. - - inflate() returns Z_OK if some progress has been made (more input processed - or more output produced), Z_STREAM_END if the end of the compressed data has - been reached and all uncompressed output has been produced, Z_NEED_DICT if a - preset dictionary is needed at this point, Z_DATA_ERROR if the input data was - corrupted (input stream not conforming to the zlib format or incorrect check - value), Z_STREAM_ERROR if the stream structure was inconsistent (for example - next_in or next_out was Z_NULL), Z_MEM_ERROR if there was not enough memory, - Z_BUF_ERROR if no progress is possible or if there was not enough room in the - output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and - inflate() can be called again with more input and more output space to - continue decompressing. If Z_DATA_ERROR is returned, the application may - then call inflateSync() to look for a good compression block if a partial - recovery of the data is desired. -*/ - - -ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); -/* - All dynamically allocated data structures for this stream are freed. - This function discards any unprocessed input and does not flush any pending - output. - - inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state - was inconsistent. In the error case, msg may be set but then points to a - static string (which must not be deallocated). -*/ - - - /* Advanced functions */ - -/* - The following functions are needed only in some special applications. -*/ - -/* -ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, - int level, - int method, - int windowBits, - int memLevel, - int strategy)); - - This is another version of deflateInit with more compression options. The - fields next_in, zalloc, zfree and opaque must be initialized before by the - caller. - - The method parameter is the compression method. It must be Z_DEFLATED in - this version of the library. - - The windowBits parameter is the base two logarithm of the window size - (the size of the history buffer). It should be in the range 8..15 for this - version of the library. Larger values of this parameter result in better - compression at the expense of memory usage. The default value is 15 if - deflateInit is used instead. - - windowBits can also be -8..-15 for raw deflate. In this case, -windowBits - determines the window size. deflate() will then generate raw deflate data - with no zlib header or trailer, and will not compute an adler32 check value. - - windowBits can also be greater than 15 for optional gzip encoding. Add - 16 to windowBits to write a simple gzip header and trailer around the - compressed data instead of a zlib wrapper. The gzip header will have no - file name, no extra data, no comment, no modification time (set to zero), no - header crc, and the operating system will be set to 255 (unknown). If a - gzip stream is being written, strm->adler is a crc32 instead of an adler32. - - The memLevel parameter specifies how much memory should be allocated - for the internal compression state. memLevel=1 uses minimum memory but is - slow and reduces compression ratio; memLevel=9 uses maximum memory for - optimal speed. The default value is 8. See zconf.h for total memory usage - as a function of windowBits and memLevel. - - The strategy parameter is used to tune the compression algorithm. Use the - value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a - filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no - string match), or Z_RLE to limit match distances to one (run-length - encoding). Filtered data consists mostly of small values with a somewhat - random distribution. In this case, the compression algorithm is tuned to - compress them better. The effect of Z_FILTERED is to force more Huffman - coding and less string matching; it is somewhat intermediate between - Z_DEFAULT_STRATEGY and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as - fast as Z_HUFFMAN_ONLY, but give better compression for PNG image data. The - strategy parameter only affects the compression ratio but not the - correctness of the compressed output even if it is not set appropriately. - Z_FIXED prevents the use of dynamic Huffman codes, allowing for a simpler - decoder for special applications. - - deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_STREAM_ERROR if any parameter is invalid (such as an invalid - method), or Z_VERSION_ERROR if the zlib library version (zlib_version) is - incompatible with the version assumed by the caller (ZLIB_VERSION). msg is - set to null if there is no error message. deflateInit2 does not perform any - compression: this will be done by deflate(). -*/ - -ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, - const Bytef *dictionary, - uInt dictLength)); -/* - Initializes the compression dictionary from the given byte sequence - without producing any compressed output. This function must be called - immediately after deflateInit, deflateInit2 or deflateReset, before any call - of deflate. The compressor and decompressor must use exactly the same - dictionary (see inflateSetDictionary). - - The dictionary should consist of strings (byte sequences) that are likely - to be encountered later in the data to be compressed, with the most commonly - used strings preferably put towards the end of the dictionary. Using a - dictionary is most useful when the data to be compressed is short and can be - predicted with good accuracy; the data can then be compressed better than - with the default empty dictionary. - - Depending on the size of the compression data structures selected by - deflateInit or deflateInit2, a part of the dictionary may in effect be - discarded, for example if the dictionary is larger than the window size - provided in deflateInit or deflateInit2. Thus the strings most likely to be - useful should be put at the end of the dictionary, not at the front. In - addition, the current implementation of deflate will use at most the window - size minus 262 bytes of the provided dictionary. - - Upon return of this function, strm->adler is set to the adler32 value - of the dictionary; the decompressor may later use this value to determine - which dictionary has been used by the compressor. (The adler32 value - applies to the whole dictionary even if only a subset of the dictionary is - actually used by the compressor.) If a raw deflate was requested, then the - adler32 value is not computed and strm->adler is not set. - - deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a - parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is - inconsistent (for example if deflate has already been called for this stream - or if the compression method is bsort). deflateSetDictionary does not - perform any compression: this will be done by deflate(). -*/ - -ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, - z_streamp source)); -/* - Sets the destination stream as a complete copy of the source stream. - - This function can be useful when several compression strategies will be - tried, for example when there are several ways of pre-processing the input - data with a filter. The streams that will be discarded should then be freed - by calling deflateEnd. Note that deflateCopy duplicates the internal - compression state which can be quite large, so this strategy is slow and can - consume lots of memory. - - deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_STREAM_ERROR if the source stream state was inconsistent - (such as zalloc being Z_NULL). msg is left unchanged in both source and - destination. -*/ - -ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm)); -/* - This function is equivalent to deflateEnd followed by deflateInit, - but does not free and reallocate all the internal compression state. The - stream will keep the same compression level and any other attributes that - may have been set by deflateInit2. - - deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent (such as zalloc or state being Z_NULL). -*/ - -ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, - int level, - int strategy)); -/* - Dynamically update the compression level and compression strategy. The - interpretation of level and strategy is as in deflateInit2. This can be - used to switch between compression and straight copy of the input data, or - to switch to a different kind of input data requiring a different strategy. - If the compression level is changed, the input available so far is - compressed with the old level (and may be flushed); the new level will take - effect only at the next call of deflate(). - - Before the call of deflateParams, the stream state must be set as for - a call of deflate(), since the currently available input may have to be - compressed and flushed. In particular, strm->avail_out must be non-zero. - - deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source - stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR if - strm->avail_out was zero. -*/ - -ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm, - int good_length, - int max_lazy, - int nice_length, - int max_chain)); -/* - Fine tune deflate's internal compression parameters. This should only be - used by someone who understands the algorithm used by zlib's deflate for - searching for the best matching string, and even then only by the most - fanatic optimizer trying to squeeze out the last compressed bit for their - specific input data. Read the deflate.c source code for the meaning of the - max_lazy, good_length, nice_length, and max_chain parameters. - - deflateTune() can be called after deflateInit() or deflateInit2(), and - returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream. - */ - -ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm, - uLong sourceLen)); -/* - deflateBound() returns an upper bound on the compressed size after - deflation of sourceLen bytes. It must be called after deflateInit() or - deflateInit2(), and after deflateSetHeader(), if used. This would be used - to allocate an output buffer for deflation in a single pass, and so would be - called before deflate(). -*/ - -ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm, - int bits, - int value)); -/* - deflatePrime() inserts bits in the deflate output stream. The intent - is that this function is used to start off the deflate output with the bits - leftover from a previous deflate stream when appending to it. As such, this - function can only be used for raw deflate, and must be used before the first - deflate() call after a deflateInit2() or deflateReset(). bits must be less - than or equal to 16, and that many of the least significant bits of value - will be inserted in the output. - - deflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm, - gz_headerp head)); -/* - deflateSetHeader() provides gzip header information for when a gzip - stream is requested by deflateInit2(). deflateSetHeader() may be called - after deflateInit2() or deflateReset() and before the first call of - deflate(). The text, time, os, extra field, name, and comment information - in the provided gz_header structure are written to the gzip header (xflag is - ignored -- the extra flags are set according to the compression level). The - caller must assure that, if not Z_NULL, name and comment are terminated with - a zero byte, and that if extra is not Z_NULL, that extra_len bytes are - available there. If hcrc is true, a gzip header crc is included. Note that - the current versions of the command-line version of gzip (up through version - 1.3.x) do not support header crc's, and will report that it is a "multi-part - gzip file" and give up. - - If deflateSetHeader is not used, the default gzip header has text false, - the time set to zero, and os set to 255, with no extra, name, or comment - fields. The gzip header is returned to the default state by deflateReset(). - - deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -/* -ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, - int windowBits)); - - This is another version of inflateInit with an extra parameter. The - fields next_in, avail_in, zalloc, zfree and opaque must be initialized - before by the caller. - - The windowBits parameter is the base two logarithm of the maximum window - size (the size of the history buffer). It should be in the range 8..15 for - this version of the library. The default value is 15 if inflateInit is used - instead. windowBits must be greater than or equal to the windowBits value - provided to deflateInit2() while compressing, or it must be equal to 15 if - deflateInit2() was not used. If a compressed stream with a larger window - size is given as input, inflate() will return with the error code - Z_DATA_ERROR instead of trying to allocate a larger window. - - windowBits can also be zero to request that inflate use the window size in - the zlib header of the compressed stream. - - windowBits can also be -8..-15 for raw inflate. In this case, -windowBits - determines the window size. inflate() will then process raw deflate data, - not looking for a zlib or gzip header, not generating a check value, and not - looking for any check values for comparison at the end of the stream. This - is for use with other formats that use the deflate compressed data format - such as zip. Those formats provide their own check values. If a custom - format is developed using the raw deflate format for compressed data, it is - recommended that a check value such as an adler32 or a crc32 be applied to - the uncompressed data as is done in the zlib, gzip, and zip formats. For - most applications, the zlib format should be used as is. Note that comments - above on the use in deflateInit2() applies to the magnitude of windowBits. - - windowBits can also be greater than 15 for optional gzip decoding. Add - 32 to windowBits to enable zlib and gzip decoding with automatic header - detection, or add 16 to decode only the gzip format (the zlib format will - return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a - crc32 instead of an adler32. - - inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_VERSION_ERROR if the zlib library version is incompatible with the - version assumed by the caller, or Z_STREAM_ERROR if the parameters are - invalid, such as a null pointer to the structure. msg is set to null if - there is no error message. inflateInit2 does not perform any decompression - apart from possibly reading the zlib header if present: actual decompression - will be done by inflate(). (So next_in and avail_in may be modified, but - next_out and avail_out are unused and unchanged.) The current implementation - of inflateInit2() does not process any header information -- that is - deferred until inflate() is called. -*/ - -ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, - const Bytef *dictionary, - uInt dictLength)); -/* - Initializes the decompression dictionary from the given uncompressed byte - sequence. This function must be called immediately after a call of inflate, - if that call returned Z_NEED_DICT. The dictionary chosen by the compressor - can be determined from the adler32 value returned by that call of inflate. - The compressor and decompressor must use exactly the same dictionary (see - deflateSetDictionary). For raw inflate, this function can be called - immediately after inflateInit2() or inflateReset() and before any call of - inflate() to set the dictionary. The application must insure that the - dictionary that was used for compression is provided. - - inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a - parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is - inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the - expected one (incorrect adler32 value). inflateSetDictionary does not - perform any decompression: this will be done by subsequent calls of - inflate(). -*/ - -ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); -/* - Skips invalid compressed data until a full flush point (see above the - description of deflate with Z_FULL_FLUSH) can be found, or until all - available input is skipped. No output is provided. - - inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR - if no more input was provided, Z_DATA_ERROR if no flush point has been - found, or Z_STREAM_ERROR if the stream structure was inconsistent. In the - success case, the application may save the current current value of total_in - which indicates where valid compressed data was found. In the error case, - the application may repeatedly call inflateSync, providing more input each - time, until success or end of the input data. -*/ - -ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest, - z_streamp source)); -/* - Sets the destination stream as a complete copy of the source stream. - - This function can be useful when randomly accessing a large stream. The - first pass through the stream can periodically record the inflate state, - allowing restarting inflate at those points when randomly accessing the - stream. - - inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_STREAM_ERROR if the source stream state was inconsistent - (such as zalloc being Z_NULL). msg is left unchanged in both source and - destination. -*/ - -ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm)); -/* - This function is equivalent to inflateEnd followed by inflateInit, - but does not free and reallocate all the internal decompression state. The - stream will keep attributes that may have been set by inflateInit2. - - inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent (such as zalloc or state being Z_NULL). -*/ - -ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm, - int windowBits)); -/* - This function is the same as inflateReset, but it also permits changing - the wrap and window size requests. The windowBits parameter is interpreted - the same as it is for inflateInit2. - - inflateReset2 returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent (such as zalloc or state being Z_NULL), or if - the windowBits parameter is invalid. -*/ - -ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm, - int bits, - int value)); -/* - This function inserts bits in the inflate input stream. The intent is - that this function is used to start inflating at a bit position in the - middle of a byte. The provided bits will be used before any bytes are used - from next_in. This function should only be used with raw inflate, and - should be used before the first inflate() call after inflateInit2() or - inflateReset(). bits must be less than or equal to 16, and that many of the - least significant bits of value will be inserted in the input. - - If bits is negative, then the input stream bit buffer is emptied. Then - inflatePrime() can be called again to put bits in the buffer. This is used - to clear out bits leftover after feeding inflate a block description prior - to feeding inflate codes. - - inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm)); -/* - This function returns two values, one in the lower 16 bits of the return - value, and the other in the remaining upper bits, obtained by shifting the - return value down 16 bits. If the upper value is -1 and the lower value is - zero, then inflate() is currently decoding information outside of a block. - If the upper value is -1 and the lower value is non-zero, then inflate is in - the middle of a stored block, with the lower value equaling the number of - bytes from the input remaining to copy. If the upper value is not -1, then - it is the number of bits back from the current bit position in the input of - the code (literal or length/distance pair) currently being processed. In - that case the lower value is the number of bytes already emitted for that - code. - - A code is being processed if inflate is waiting for more input to complete - decoding of the code, or if it has completed decoding but is waiting for - more output space to write the literal or match data. - - inflateMark() is used to mark locations in the input data for random - access, which may be at bit positions, and to note those cases where the - output of a code may span boundaries of random access blocks. The current - location in the input stream can be determined from avail_in and data_type - as noted in the description for the Z_BLOCK flush parameter for inflate. - - inflateMark returns the value noted above or -1 << 16 if the provided - source stream state was inconsistent. -*/ - -ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm, - gz_headerp head)); -/* - inflateGetHeader() requests that gzip header information be stored in the - provided gz_header structure. inflateGetHeader() may be called after - inflateInit2() or inflateReset(), and before the first call of inflate(). - As inflate() processes the gzip stream, head->done is zero until the header - is completed, at which time head->done is set to one. If a zlib stream is - being decoded, then head->done is set to -1 to indicate that there will be - no gzip header information forthcoming. Note that Z_BLOCK or Z_TREES can be - used to force inflate() to return immediately after header processing is - complete and before any actual data is decompressed. - - The text, time, xflags, and os fields are filled in with the gzip header - contents. hcrc is set to true if there is a header CRC. (The header CRC - was valid if done is set to one.) If extra is not Z_NULL, then extra_max - contains the maximum number of bytes to write to extra. Once done is true, - extra_len contains the actual extra field length, and extra contains the - extra field, or that field truncated if extra_max is less than extra_len. - If name is not Z_NULL, then up to name_max characters are written there, - terminated with a zero unless the length is greater than name_max. If - comment is not Z_NULL, then up to comm_max characters are written there, - terminated with a zero unless the length is greater than comm_max. When any - of extra, name, or comment are not Z_NULL and the respective field is not - present in the header, then that field is set to Z_NULL to signal its - absence. This allows the use of deflateSetHeader() with the returned - structure to duplicate the header. However if those fields are set to - allocated memory, then the application will need to save those pointers - elsewhere so that they can be eventually freed. - - If inflateGetHeader is not used, then the header information is simply - discarded. The header is always checked for validity, including the header - CRC if present. inflateReset() will reset the process to discard the header - information. The application would need to call inflateGetHeader() again to - retrieve the header from the next gzip stream. - - inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -/* -ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, - unsigned char FAR *window)); - - Initialize the internal stream state for decompression using inflateBack() - calls. The fields zalloc, zfree and opaque in strm must be initialized - before the call. If zalloc and zfree are Z_NULL, then the default library- - derived memory allocation routines are used. windowBits is the base two - logarithm of the window size, in the range 8..15. window is a caller - supplied buffer of that size. Except for special applications where it is - assured that deflate was used with small window sizes, windowBits must be 15 - and a 32K byte window must be supplied to be able to decompress general - deflate streams. - - See inflateBack() for the usage of these routines. - - inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of - the paramaters are invalid, Z_MEM_ERROR if the internal state could not be - allocated, or Z_VERSION_ERROR if the version of the library does not match - the version of the header file. -*/ - -typedef unsigned (*in_func) OF((void FAR *, unsigned char FAR * FAR *)); -typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned)); - -ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm, - in_func in, void FAR *in_desc, - out_func out, void FAR *out_desc)); -/* - inflateBack() does a raw inflate with a single call using a call-back - interface for input and output. This is more efficient than inflate() for - file i/o applications in that it avoids copying between the output and the - sliding window by simply making the window itself the output buffer. This - function trusts the application to not change the output buffer passed by - the output function, at least until inflateBack() returns. - - inflateBackInit() must be called first to allocate the internal state - and to initialize the state with the user-provided window buffer. - inflateBack() may then be used multiple times to inflate a complete, raw - deflate stream with each call. inflateBackEnd() is then called to free the - allocated state. - - A raw deflate stream is one with no zlib or gzip header or trailer. - This routine would normally be used in a utility that reads zip or gzip - files and writes out uncompressed files. The utility would decode the - header and process the trailer on its own, hence this routine expects only - the raw deflate stream to decompress. This is different from the normal - behavior of inflate(), which expects either a zlib or gzip header and - trailer around the deflate stream. - - inflateBack() uses two subroutines supplied by the caller that are then - called by inflateBack() for input and output. inflateBack() calls those - routines until it reads a complete deflate stream and writes out all of the - uncompressed data, or until it encounters an error. The function's - parameters and return types are defined above in the in_func and out_func - typedefs. inflateBack() will call in(in_desc, &buf) which should return the - number of bytes of provided input, and a pointer to that input in buf. If - there is no input available, in() must return zero--buf is ignored in that - case--and inflateBack() will return a buffer error. inflateBack() will call - out(out_desc, buf, len) to write the uncompressed data buf[0..len-1]. out() - should return zero on success, or non-zero on failure. If out() returns - non-zero, inflateBack() will return with an error. Neither in() nor out() - are permitted to change the contents of the window provided to - inflateBackInit(), which is also the buffer that out() uses to write from. - The length written by out() will be at most the window size. Any non-zero - amount of input may be provided by in(). - - For convenience, inflateBack() can be provided input on the first call by - setting strm->next_in and strm->avail_in. If that input is exhausted, then - in() will be called. Therefore strm->next_in must be initialized before - calling inflateBack(). If strm->next_in is Z_NULL, then in() will be called - immediately for input. If strm->next_in is not Z_NULL, then strm->avail_in - must also be initialized, and then if strm->avail_in is not zero, input will - initially be taken from strm->next_in[0 .. strm->avail_in - 1]. - - The in_desc and out_desc parameters of inflateBack() is passed as the - first parameter of in() and out() respectively when they are called. These - descriptors can be optionally used to pass any information that the caller- - supplied in() and out() functions need to do their job. - - On return, inflateBack() will set strm->next_in and strm->avail_in to - pass back any unused input that was provided by the last in() call. The - return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR - if in() or out() returned an error, Z_DATA_ERROR if there was a format error - in the deflate stream (in which case strm->msg is set to indicate the nature - of the error), or Z_STREAM_ERROR if the stream was not properly initialized. - In the case of Z_BUF_ERROR, an input or output error can be distinguished - using strm->next_in which will be Z_NULL only if in() returned an error. If - strm->next_in is not Z_NULL, then the Z_BUF_ERROR was due to out() returning - non-zero. (in() will always be called before out(), so strm->next_in is - assured to be defined if out() returns non-zero.) Note that inflateBack() - cannot return Z_OK. -*/ - -ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm)); -/* - All memory allocated by inflateBackInit() is freed. - - inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream - state was inconsistent. -*/ - -ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void)); -/* Return flags indicating compile-time options. - - Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other: - 1.0: size of uInt - 3.2: size of uLong - 5.4: size of voidpf (pointer) - 7.6: size of z_off_t - - Compiler, assembler, and debug options: - 8: DEBUG - 9: ASMV or ASMINF -- use ASM code - 10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention - 11: 0 (reserved) - - One-time table building (smaller code, but not thread-safe if true): - 12: BUILDFIXED -- build static block decoding tables when needed - 13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed - 14,15: 0 (reserved) - - Library content (indicates missing functionality): - 16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking - deflate code when not needed) - 17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect - and decode gzip streams (to avoid linking crc code) - 18-19: 0 (reserved) - - Operation variations (changes in library functionality): - 20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate - 21: FASTEST -- deflate algorithm with only one, lowest compression level - 22,23: 0 (reserved) - - The sprintf variant used by gzprintf (zero is best): - 24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format - 25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure! - 26: 0 = returns value, 1 = void -- 1 means inferred string length returned - - Remainder: - 27-31: 0 (reserved) - */ - - - /* utility functions */ - -/* - The following utility functions are implemented on top of the basic - stream-oriented functions. To simplify the interface, some default options - are assumed (compression level and memory usage, standard memory allocation - functions). The source code of these utility functions can be modified if - you need special options. -*/ - -ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen)); -/* - Compresses the source buffer into the destination buffer. sourceLen is - the byte length of the source buffer. Upon entry, destLen is the total size - of the destination buffer, which must be at least the value returned by - compressBound(sourceLen). Upon exit, destLen is the actual size of the - compressed buffer. - - compress returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_BUF_ERROR if there was not enough room in the output - buffer. -*/ - -ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen, - int level)); -/* - Compresses the source buffer into the destination buffer. The level - parameter has the same meaning as in deflateInit. sourceLen is the byte - length of the source buffer. Upon entry, destLen is the total size of the - destination buffer, which must be at least the value returned by - compressBound(sourceLen). Upon exit, destLen is the actual size of the - compressed buffer. - - compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_BUF_ERROR if there was not enough room in the output buffer, - Z_STREAM_ERROR if the level parameter is invalid. -*/ - -ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen)); -/* - compressBound() returns an upper bound on the compressed size after - compress() or compress2() on sourceLen bytes. It would be used before a - compress() or compress2() call to allocate the destination buffer. -*/ - -ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen)); -/* - Decompresses the source buffer into the destination buffer. sourceLen is - the byte length of the source buffer. Upon entry, destLen is the total size - of the destination buffer, which must be large enough to hold the entire - uncompressed data. (The size of the uncompressed data must have been saved - previously by the compressor and transmitted to the decompressor by some - mechanism outside the scope of this compression library.) Upon exit, destLen - is the actual size of the uncompressed buffer. - - uncompress returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_BUF_ERROR if there was not enough room in the output - buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete. -*/ - - - /* gzip file access functions */ - -/* - This library supports reading and writing files in gzip (.gz) format with - an interface similar to that of stdio, using the functions that start with - "gz". The gzip format is different from the zlib format. gzip is a gzip - wrapper, documented in RFC 1952, wrapped around a deflate stream. -*/ - -typedef voidp gzFile; /* opaque gzip file descriptor */ - -/* -ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); - - Opens a gzip (.gz) file for reading or writing. The mode parameter is as - in fopen ("rb" or "wb") but can also include a compression level ("wb9") or - a strategy: 'f' for filtered data as in "wb6f", 'h' for Huffman-only - compression as in "wb1h", 'R' for run-length encoding as in "wb1R", or 'F' - for fixed code compression as in "wb9F". (See the description of - deflateInit2 for more information about the strategy parameter.) Also "a" - can be used instead of "w" to request that the gzip stream that will be - written be appended to the file. "+" will result in an error, since reading - and writing to the same gzip file is not supported. - - gzopen can be used to read a file which is not in gzip format; in this - case gzread will directly read from the file without decompression. - - gzopen returns NULL if the file could not be opened, if there was - insufficient memory to allocate the gzFile state, or if an invalid mode was - specified (an 'r', 'w', or 'a' was not provided, or '+' was provided). - errno can be checked to determine if the reason gzopen failed was that the - file could not be opened. -*/ - -ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode)); -/* - gzdopen associates a gzFile with the file descriptor fd. File descriptors - are obtained from calls like open, dup, creat, pipe or fileno (if the file - has been previously opened with fopen). The mode parameter is as in gzopen. - - The next call of gzclose on the returned gzFile will also close the file - descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor - fd. If you want to keep fd open, use fd = dup(fd_keep); gz = gzdopen(fd, - mode);. The duplicated descriptor should be saved to avoid a leak, since - gzdopen does not close fd if it fails. - - gzdopen returns NULL if there was insufficient memory to allocate the - gzFile state, if an invalid mode was specified (an 'r', 'w', or 'a' was not - provided, or '+' was provided), or if fd is -1. The file descriptor is not - used until the next gz* read, write, seek, or close operation, so gzdopen - will not detect if fd is invalid (unless fd is -1). -*/ - -ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size)); -/* - Set the internal buffer size used by this library's functions. The - default buffer size is 8192 bytes. This function must be called after - gzopen() or gzdopen(), and before any other calls that read or write the - file. The buffer memory allocation is always deferred to the first read or - write. Two buffers are allocated, either both of the specified size when - writing, or one of the specified size and the other twice that size when - reading. A larger buffer size of, for example, 64K or 128K bytes will - noticeably increase the speed of decompression (reading). - - The new buffer size also affects the maximum length for gzprintf(). - - gzbuffer() returns 0 on success, or -1 on failure, such as being called - too late. -*/ - -ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)); -/* - Dynamically update the compression level or strategy. See the description - of deflateInit2 for the meaning of these parameters. - - gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not - opened for writing. -*/ - -ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); -/* - Reads the given number of uncompressed bytes from the compressed file. If - the input file was not in gzip format, gzread copies the given number of - bytes into the buffer. - - After reaching the end of a gzip stream in the input, gzread will continue - to read, looking for another gzip stream, or failing that, reading the rest - of the input file directly without decompression. The entire input file - will be read if gzread is called until it returns less than the requested - len. - - gzread returns the number of uncompressed bytes actually read, less than - len for end of file, or -1 for error. -*/ - -ZEXTERN int ZEXPORT gzwrite OF((gzFile file, - voidpc buf, unsigned len)); -/* - Writes the given number of uncompressed bytes into the compressed file. - gzwrite returns the number of uncompressed bytes written or 0 in case of - error. -*/ - -ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...)); -/* - Converts, formats, and writes the arguments to the compressed file under - control of the format string, as in fprintf. gzprintf returns the number of - uncompressed bytes actually written, or 0 in case of error. The number of - uncompressed bytes written is limited to 8191, or one less than the buffer - size given to gzbuffer(). The caller should assure that this limit is not - exceeded. If it is exceeded, then gzprintf() will return an error (0) with - nothing written. In this case, there may also be a buffer overflow with - unpredictable consequences, which is possible only if zlib was compiled with - the insecure functions sprintf() or vsprintf() because the secure snprintf() - or vsnprintf() functions were not available. This can be determined using - zlibCompileFlags(). -*/ - -ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s)); -/* - Writes the given null-terminated string to the compressed file, excluding - the terminating null character. - - gzputs returns the number of characters written, or -1 in case of error. -*/ - -ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len)); -/* - Reads bytes from the compressed file until len-1 characters are read, or a - newline character is read and transferred to buf, or an end-of-file - condition is encountered. If any characters are read or if len == 1, the - string is terminated with a null character. If no characters are read due - to an end-of-file or len < 1, then the buffer is left untouched. - - gzgets returns buf which is a null-terminated string, or it returns NULL - for end-of-file or in case of error. If there was an error, the contents at - buf are indeterminate. -*/ - -ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); -/* - Writes c, converted to an unsigned char, into the compressed file. gzputc - returns the value that was written, or -1 in case of error. -*/ - -ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); -/* - Reads one byte from the compressed file. gzgetc returns this byte or -1 - in case of end of file or error. -*/ - -ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file)); -/* - Push one character back onto the stream to be read as the first character - on the next read. At least one character of push-back is allowed. - gzungetc() returns the character pushed, or -1 on failure. gzungetc() will - fail if c is -1, and may fail if a character has been pushed but not read - yet. If gzungetc is used immediately after gzopen or gzdopen, at least the - output buffer size of pushed characters is allowed. (See gzbuffer above.) - The pushed character will be discarded if the stream is repositioned with - gzseek() or gzrewind(). -*/ - -ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); -/* - Flushes all pending output into the compressed file. The parameter flush - is as in the deflate() function. The return value is the zlib error number - (see function gzerror below). gzflush is only permitted when writing. - - If the flush parameter is Z_FINISH, the remaining data is written and the - gzip stream is completed in the output. If gzwrite() is called again, a new - gzip stream will be started in the output. gzread() is able to read such - concatented gzip streams. - - gzflush should be called only when strictly necessary because it will - degrade compression if called too often. -*/ - -/* -ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file, - z_off_t offset, int whence)); - - Sets the starting position for the next gzread or gzwrite on the given - compressed file. The offset represents a number of bytes in the - uncompressed data stream. The whence parameter is defined as in lseek(2); - the value SEEK_END is not supported. - - If the file is opened for reading, this function is emulated but can be - extremely slow. If the file is opened for writing, only forward seeks are - supported; gzseek then compresses a sequence of zeroes up to the new - starting position. - - gzseek returns the resulting offset location as measured in bytes from - the beginning of the uncompressed stream, or -1 in case of error, in - particular if the file is opened for writing and the new starting position - would be before the current position. -*/ - -ZEXTERN int ZEXPORT gzrewind OF((gzFile file)); -/* - Rewinds the given file. This function is supported only for reading. - - gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET) -*/ - -/* -ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file)); - - Returns the starting position for the next gzread or gzwrite on the given - compressed file. This position represents a number of bytes in the - uncompressed data stream, and is zero when starting, even if appending or - reading a gzip stream from the middle of a file using gzdopen(). - - gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR) -*/ - -/* -ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file)); - - Returns the current offset in the file being read or written. This offset - includes the count of bytes that precede the gzip stream, for example when - appending or when using gzdopen() for reading. When reading, the offset - does not include as yet unused buffered input. This information can be used - for a progress indicator. On error, gzoffset() returns -1. -*/ - -ZEXTERN int ZEXPORT gzeof OF((gzFile file)); -/* - Returns true (1) if the end-of-file indicator has been set while reading, - false (0) otherwise. Note that the end-of-file indicator is set only if the - read tried to go past the end of the input, but came up short. Therefore, - just like feof(), gzeof() may return false even if there is no more data to - read, in the event that the last read request was for the exact number of - bytes remaining in the input file. This will happen if the input file size - is an exact multiple of the buffer size. - - If gzeof() returns true, then the read functions will return no more data, - unless the end-of-file indicator is reset by gzclearerr() and the input file - has grown since the previous end of file was detected. -*/ - -ZEXTERN int ZEXPORT gzdirect OF((gzFile file)); -/* - Returns true (1) if file is being copied directly while reading, or false - (0) if file is a gzip stream being decompressed. This state can change from - false to true while reading the input file if the end of a gzip stream is - reached, but is followed by data that is not another gzip stream. - - If the input file is empty, gzdirect() will return true, since the input - does not contain a gzip stream. - - If gzdirect() is used immediately after gzopen() or gzdopen() it will - cause buffers to be allocated to allow reading the file to determine if it - is a gzip file. Therefore if gzbuffer() is used, it should be called before - gzdirect(). -*/ - -ZEXTERN int ZEXPORT gzclose OF((gzFile file)); -/* - Flushes all pending output if necessary, closes the compressed file and - deallocates the (de)compression state. Note that once file is closed, you - cannot call gzerror with file, since its structures have been deallocated. - gzclose must not be called more than once on the same file, just as free - must not be called more than once on the same allocation. - - gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a - file operation error, or Z_OK on success. -*/ - -ZEXTERN int ZEXPORT gzclose_r OF((gzFile file)); -ZEXTERN int ZEXPORT gzclose_w OF((gzFile file)); -/* - Same as gzclose(), but gzclose_r() is only for use when reading, and - gzclose_w() is only for use when writing or appending. The advantage to - using these instead of gzclose() is that they avoid linking in zlib - compression or decompression code that is not used when only reading or only - writing respectively. If gzclose() is used, then both compression and - decompression code will be included the application when linking to a static - zlib library. -*/ - -ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum)); -/* - Returns the error message for the last error which occurred on the given - compressed file. errnum is set to zlib error number. If an error occurred - in the file system and not in the compression library, errnum is set to - Z_ERRNO and the application may consult errno to get the exact error code. - - The application must not modify the returned string. Future calls to - this function may invalidate the previously returned string. If file is - closed, then the string previously returned by gzerror will no longer be - available. - - gzerror() should be used to distinguish errors from end-of-file for those - functions above that do not distinguish those cases in their return values. -*/ - -ZEXTERN void ZEXPORT gzclearerr OF((gzFile file)); -/* - Clears the error and end-of-file flags for file. This is analogous to the - clearerr() function in stdio. This is useful for continuing to read a gzip - file that is being written concurrently. -*/ - - - /* checksum functions */ - -/* - These functions are not related to compression but are exported - anyway because they might be useful in applications using the compression - library. -*/ - -ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); -/* - Update a running Adler-32 checksum with the bytes buf[0..len-1] and - return the updated checksum. If buf is Z_NULL, this function returns the - required initial value for the checksum. - - An Adler-32 checksum is almost as reliable as a CRC32 but can be computed - much faster. - - Usage example: - - uLong adler = adler32(0L, Z_NULL, 0); - - while (read_buffer(buffer, length) != EOF) { - adler = adler32(adler, buffer, length); - } - if (adler != original_adler) error(); -*/ - -/* -ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2, - z_off_t len2)); - - Combine two Adler-32 checksums into one. For two sequences of bytes, seq1 - and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for - each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of - seq1 and seq2 concatenated, requiring only adler1, adler2, and len2. -*/ - -ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); -/* - Update a running CRC-32 with the bytes buf[0..len-1] and return the - updated CRC-32. If buf is Z_NULL, this function returns the required - initial value for the for the crc. Pre- and post-conditioning (one's - complement) is performed within this function so it shouldn't be done by the - application. - - Usage example: - - uLong crc = crc32(0L, Z_NULL, 0); - - while (read_buffer(buffer, length) != EOF) { - crc = crc32(crc, buffer, length); - } - if (crc != original_crc) error(); -*/ - -/* -ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2)); - - Combine two CRC-32 check values into one. For two sequences of bytes, - seq1 and seq2 with lengths len1 and len2, CRC-32 check values were - calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32 - check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and - len2. -*/ - - - /* various hacks, don't look :) */ - -/* deflateInit and inflateInit are macros to allow checking the zlib version - * and the compiler's view of z_stream: - */ -ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method, - int windowBits, int memLevel, - int strategy, const char *version, - int stream_size)); -ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits, - unsigned char FAR *window, - const char *version, - int stream_size)); -#define deflateInit(strm, level) \ - deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) -#define inflateInit(strm) \ - inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) -#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ - deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ - (strategy), ZLIB_VERSION, sizeof(z_stream)) -#define inflateInit2(strm, windowBits) \ - inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) -#define inflateBackInit(strm, windowBits, window) \ - inflateBackInit_((strm), (windowBits), (window), \ - ZLIB_VERSION, sizeof(z_stream)) - -/* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or - * change the regular functions to 64 bits if _FILE_OFFSET_BITS is 64 (if - * both are true, the application gets the *64 functions, and the regular - * functions are changed to 64 bits) -- in case these are set on systems - * without large file support, _LFS64_LARGEFILE must also be true - */ -#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0 - ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); - ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int)); - ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile)); - ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile)); - ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t)); - ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t)); -#endif - -#if !defined(ZLIB_INTERNAL) && _FILE_OFFSET_BITS-0 == 64 && _LFS64_LARGEFILE-0 -# define gzopen gzopen64 -# define gzseek gzseek64 -# define gztell gztell64 -# define gzoffset gzoffset64 -# define adler32_combine adler32_combine64 -# define crc32_combine crc32_combine64 -# ifndef _LARGEFILE64_SOURCE - ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); - ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int)); - ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile)); - ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile)); - ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t)); - ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t)); -# endif -#else - ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *)); - ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile, z_off_t, int)); - ZEXTERN z_off_t ZEXPORT gztell OF((gzFile)); - ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile)); - ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t)); - ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t)); -#endif - -/* hack for buggy compilers */ -#if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL) - struct internal_state {int dummy;}; -#endif - -/* undocumented functions */ -ZEXTERN const char * ZEXPORT zError OF((int)); -ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp)); -ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void)); -ZEXTERN int ZEXPORT inflateUndermine OF((z_streamp, int)); - -#ifdef __cplusplus -} -#endif - -#endif /* ZLIB_H */