summaryrefslogtreecommitdiff
path: root/rbutil/rbutilqt/zip/zip_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'rbutil/rbutilqt/zip/zip_p.h')
-rw-r--r--rbutil/rbutilqt/zip/zip_p.h186
1 files changed, 93 insertions, 93 deletions
diff --git a/rbutil/rbutilqt/zip/zip_p.h b/rbutil/rbutilqt/zip/zip_p.h
index b3c45ac7b8..8c57f99225 100644
--- a/rbutil/rbutilqt/zip/zip_p.h
+++ b/rbutil/rbutilqt/zip/zip_p.h
@@ -1,93 +1,93 @@
1/**************************************************************************** 1/****************************************************************************
2** Filename: zip_p.h 2** Filename: zip_p.h
3** Last updated [dd/mm/yyyy]: 28/01/2007 3** Last updated [dd/mm/yyyy]: 28/01/2007
4** 4**
5** pkzip 2.0 file compression. 5** pkzip 2.0 file compression.
6** 6**
7** Some of the code has been inspired by other open source projects, 7** Some of the code has been inspired by other open source projects,
8** (mainly Info-Zip and Gilles Vollant's minizip). 8** (mainly Info-Zip and Gilles Vollant's minizip).
9** Compression and decompression actually uses the zlib library. 9** Compression and decompression actually uses the zlib library.
10** 10**
11** Copyright (C) 2007 Angius Fabrizio. All rights reserved. 11** Copyright (C) 2007 Angius Fabrizio. All rights reserved.
12** 12**
13** This file is part of the OSDaB project (http://osdab.sourceforge.net/). 13** This file is part of the OSDaB project (http://osdab.sourceforge.net/).
14** 14**
15** This file may be distributed and/or modified under the terms of the 15** This file may be distributed and/or modified under the terms of the
16** GNU General Public License version 2 as published by the Free Software 16** GNU General Public License version 2 as published by the Free Software
17** Foundation and appearing in the file LICENSE.GPL included in the 17** Foundation and appearing in the file LICENSE.GPL included in the
18** packaging of this file. 18** packaging of this file.
19** 19**
20** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 20** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
21** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 21** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
22** 22**
23** See the file LICENSE.GPL that came with this software distribution or 23** See the file LICENSE.GPL that came with this software distribution or
24** visit http://www.gnu.org/copyleft/gpl.html for GPL licensing information. 24** visit http://www.gnu.org/copyleft/gpl.html for GPL licensing information.
25** 25**
26**********************************************************************/ 26**********************************************************************/
27 27
28// 28//
29// W A R N I N G 29// W A R N I N G
30// ------------- 30// -------------
31// 31//
32// This file is not part of the Zip/UnZip API. It exists purely as an 32// This file is not part of the Zip/UnZip API. It exists purely as an
33// implementation detail. This header file may change from version to 33// implementation detail. This header file may change from version to
34// version without notice, or even be removed. 34// version without notice, or even be removed.
35// 35//
36// We mean it. 36// We mean it.
37// 37//
38 38
39#ifndef OSDAB_ZIP_P__H 39#ifndef OSDAB_ZIP_P__H
40#define OSDAB_ZIP_P__H 40#define OSDAB_ZIP_P__H
41 41
42#include "zip.h" 42#include "zip.h"
43#include "zipentry_p.h" 43#include "zipentry_p.h"
44 44
45#include <QtGlobal> 45#include <QtGlobal>
46#include <QFileInfo> 46#include <QFileInfo>
47 47
48/*! 48/*!
49 zLib authors suggest using larger buffers (128K or 256K) for (de)compression (especially for inflate()) 49 zLib authors suggest using larger buffers (128K or 256K) for (de)compression (especially for inflate())
50 we use a 256K buffer here - if you want to use this code on a pre-iceage mainframe please change it ;) 50 we use a 256K buffer here - if you want to use this code on a pre-iceage mainframe please change it ;)
51*/ 51*/
52#define ZIP_READ_BUFFER (256*1024) 52#define ZIP_READ_BUFFER (256*1024)
53 53
54class ZipPrivate 54class ZipPrivate
55{ 55{
56public: 56public:
57 ZipPrivate(); 57 ZipPrivate();
58 virtual ~ZipPrivate(); 58 virtual ~ZipPrivate();
59 59
60 QMap<QString,ZipEntryP*>* headers; 60 QMap<QString,ZipEntryP*>* headers;
61 61
62 QIODevice* device; 62 QIODevice* device;
63 63
64 char buffer1[ZIP_READ_BUFFER]; 64 char buffer1[ZIP_READ_BUFFER];
65 char buffer2[ZIP_READ_BUFFER]; 65 char buffer2[ZIP_READ_BUFFER];
66 66
67 unsigned char* uBuffer; 67 unsigned char* uBuffer;
68 68
69 const quint32* crcTable; 69 const quint32* crcTable;
70 70
71 QString comment; 71 QString comment;
72 QString password; 72 QString password;
73 73
74 Zip::ErrorCode createArchive(QIODevice* device); 74 Zip::ErrorCode createArchive(QIODevice* device);
75 Zip::ErrorCode closeArchive(); 75 Zip::ErrorCode closeArchive();
76 void reset(); 76 void reset();
77 77
78 bool zLibInit(); 78 bool zLibInit();
79 79
80 Zip::ErrorCode createEntry(const QFileInfo& file, const QString& root, Zip::CompressionLevel level); 80 Zip::ErrorCode createEntry(const QFileInfo& file, const QString& root, Zip::CompressionLevel level);
81 Zip::CompressionLevel detectCompressionByMime(const QString& ext); 81 Zip::CompressionLevel detectCompressionByMime(const QString& ext);
82 82
83 inline void encryptBytes(quint32* keys, char* buffer, qint64 read); 83 inline void encryptBytes(quint32* keys, char* buffer, qint64 read);
84 84
85 inline void setULong(quint32 v, char* buffer, unsigned int offset); 85 inline void setULong(quint32 v, char* buffer, unsigned int offset);
86 inline void updateKeys(quint32* keys, int c) const; 86 inline void updateKeys(quint32* keys, int c) const;
87 inline void initKeys(quint32* keys) const; 87 inline void initKeys(quint32* keys) const;
88 inline int decryptByte(quint32 key2) const; 88 inline int decryptByte(quint32 key2) const;
89 89
90 inline QString extractRoot(const QString& p); 90 inline QString extractRoot(const QString& p);
91}; 91};
92 92
93#endif // OSDAB_ZIP_P__H 93#endif // OSDAB_ZIP_P__H