misc/quazip/quazip.cpp
author nemo
Thu, 01 Nov 2012 13:22:52 -0400
branch0.9.18
changeset 7920 4760f92481ab
parent 7889 57b117d441b9
permissions -rw-r--r--
Added tag 0.9.18-release for changeset be11c26a3a0b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7889
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
     1
/*
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
     2
Copyright (C) 2005-2011 Sergey A. Tachenov
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
     3
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
     4
This program is free software; you can redistribute it and/or modify it
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
     5
under the terms of the GNU Lesser General Public License as published by
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
     6
the Free Software Foundation; either version 2 of the License, or (at
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
     7
your option) any later version.
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
     8
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
     9
This program is distributed in the hope that it will be useful, but
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    10
WITHOUT ANY WARRANTY; without even the implied warranty of
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    12
General Public License for more details.
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    13
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    14
You should have received a copy of the GNU Lesser General Public License
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    15
along with this program; if not, write to the Free Software Foundation,
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    16
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    17
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    18
See COPYING file for the full LGPL text.
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    19
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    20
Original ZIP package is copyrighted by Gilles Vollant, see
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    21
quazip/(un)zip.h files for details, basically it's zlib license.
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    22
 **/
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    23
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    24
#include <QFile>
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    25
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    26
#include "quazip.h"
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    27
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    28
class QuaZipPrivate {
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    29
  friend class QuaZip;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    30
  private:
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    31
    QTextCodec *fileNameCodec, *commentCodec;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    32
    QString zipName;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    33
    QIODevice *ioDevice;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    34
    QString comment;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    35
    QuaZip::Mode mode;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    36
    union {
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    37
      unzFile unzFile_f;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    38
      zipFile zipFile_f;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    39
    };
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    40
    bool hasCurrentFile_f;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    41
    int zipError;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    42
    inline QuaZipPrivate():
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    43
      fileNameCodec(QTextCodec::codecForLocale()),
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    44
      commentCodec(QTextCodec::codecForLocale()),
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    45
      ioDevice(NULL),
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    46
      mode(QuaZip::mdNotOpen),
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    47
      hasCurrentFile_f(false),
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    48
      zipError(UNZ_OK) {}
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    49
    inline QuaZipPrivate(const QString &zipName):
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    50
      fileNameCodec(QTextCodec::codecForLocale()),
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    51
      commentCodec(QTextCodec::codecForLocale()),
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    52
      zipName(zipName),
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    53
      ioDevice(NULL),
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    54
      mode(QuaZip::mdNotOpen),
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    55
      hasCurrentFile_f(false),
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    56
      zipError(UNZ_OK) {}
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    57
    inline QuaZipPrivate(QIODevice *ioDevice):
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    58
      fileNameCodec(QTextCodec::codecForLocale()),
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    59
      commentCodec(QTextCodec::codecForLocale()),
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    60
      ioDevice(ioDevice),
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    61
      mode(QuaZip::mdNotOpen),
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    62
      hasCurrentFile_f(false),
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    63
      zipError(UNZ_OK) {}
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    64
};
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    65
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    66
QuaZip::QuaZip():
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    67
  p(new QuaZipPrivate())
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    68
{
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    69
}
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    70
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    71
QuaZip::QuaZip(const QString& zipName):
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    72
  p(new QuaZipPrivate(zipName))
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    73
{
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    74
}
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    75
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    76
QuaZip::QuaZip(QIODevice *ioDevice):
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    77
  p(new QuaZipPrivate(ioDevice))
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    78
{
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    79
}
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    80
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    81
QuaZip::~QuaZip()
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    82
{
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    83
  if(isOpen())
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    84
    close();
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    85
  delete p;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    86
}
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    87
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    88
bool QuaZip::open(Mode mode, zlib_filefunc_def* ioApi)
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    89
{
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    90
  p->zipError=UNZ_OK;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    91
  if(isOpen()) {
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    92
    qWarning("QuaZip::open(): ZIP already opened");
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    93
    return false;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    94
  }
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    95
  QIODevice *ioDevice = p->ioDevice;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    96
  if (ioDevice == NULL) {
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    97
    if (p->zipName.isEmpty()) {
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    98
      qWarning("QuaZip::open(): set either ZIP file name or IO device first");
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
    99
      return false;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   100
    } else {
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   101
      ioDevice = new QFile(p->zipName);
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   102
    }
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   103
  }
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   104
  switch(mode) {
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   105
    case mdUnzip:
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   106
      p->unzFile_f=unzOpen2(ioDevice, ioApi);
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   107
      if(p->unzFile_f!=NULL) {
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   108
        p->mode=mode;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   109
        p->ioDevice = ioDevice;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   110
        return true;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   111
      } else {
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   112
        p->zipError=UNZ_OPENERROR;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   113
        if (!p->zipName.isEmpty())
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   114
          delete ioDevice;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   115
        return false;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   116
      }
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   117
    case mdCreate:
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   118
    case mdAppend:
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   119
    case mdAdd:
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   120
      p->zipFile_f=zipOpen2(ioDevice,
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   121
          mode==mdCreate?APPEND_STATUS_CREATE:
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   122
          mode==mdAppend?APPEND_STATUS_CREATEAFTER:
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   123
          APPEND_STATUS_ADDINZIP,
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   124
          NULL,
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   125
          ioApi);
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   126
      if(p->zipFile_f!=NULL) {
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   127
        p->mode=mode;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   128
        p->ioDevice = ioDevice;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   129
        return true;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   130
      } else {
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   131
        p->zipError=UNZ_OPENERROR;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   132
        if (!p->zipName.isEmpty())
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   133
          delete ioDevice;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   134
        return false;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   135
      }
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   136
    default:
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   137
      qWarning("QuaZip::open(): unknown mode: %d", (int)mode);
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   138
      if (!p->zipName.isEmpty())
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   139
        delete ioDevice;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   140
      return false;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   141
      break;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   142
  }
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   143
}
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   144
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   145
void QuaZip::close()
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   146
{
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   147
  p->zipError=UNZ_OK;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   148
  switch(p->mode) {
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   149
    case mdNotOpen:
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   150
      qWarning("QuaZip::close(): ZIP is not open");
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   151
      return;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   152
    case mdUnzip:
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   153
      p->zipError=unzClose(p->unzFile_f);
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   154
      break;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   155
    case mdCreate:
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   156
    case mdAppend:
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   157
    case mdAdd:
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   158
      p->zipError=zipClose(p->zipFile_f, p->commentCodec->fromUnicode(p->comment).constData());
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   159
      break;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   160
    default:
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   161
      qWarning("QuaZip::close(): unknown mode: %d", (int)p->mode);
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   162
      return;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   163
  }
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   164
  // opened by name, need to delete the internal IO device
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   165
  if (!p->zipName.isEmpty())
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   166
    delete p->ioDevice;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   167
  if(p->zipError==UNZ_OK)
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   168
    p->mode=mdNotOpen;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   169
}
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   170
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   171
void QuaZip::setZipName(const QString& zipName)
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   172
{
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   173
  if(isOpen()) {
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   174
    qWarning("QuaZip::setZipName(): ZIP is already open!");
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   175
    return;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   176
  }
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   177
  p->zipName=zipName;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   178
  p->ioDevice = NULL;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   179
}
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   180
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   181
void QuaZip::setIoDevice(QIODevice *ioDevice)
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   182
{
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   183
  if(isOpen()) {
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   184
    qWarning("QuaZip::setIoDevice(): ZIP is already open!");
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   185
    return;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   186
  }
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   187
  p->ioDevice = ioDevice;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   188
  p->zipName = QString();
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   189
}
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   190
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   191
int QuaZip::getEntriesCount()const
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   192
{
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   193
  QuaZip *fakeThis=(QuaZip*)this; // non-const
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   194
  fakeThis->p->zipError=UNZ_OK;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   195
  if(p->mode!=mdUnzip) {
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   196
    qWarning("QuaZip::getEntriesCount(): ZIP is not open in mdUnzip mode");
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   197
    return -1;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   198
  }
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   199
  unz_global_info globalInfo;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   200
  if((fakeThis->p->zipError=unzGetGlobalInfo(p->unzFile_f, &globalInfo))!=UNZ_OK)
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   201
    return p->zipError;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   202
  return (int)globalInfo.number_entry;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   203
}
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   204
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   205
QString QuaZip::getComment()const
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   206
{
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   207
  QuaZip *fakeThis=(QuaZip*)this; // non-const
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   208
  fakeThis->p->zipError=UNZ_OK;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   209
  if(p->mode!=mdUnzip) {
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   210
    qWarning("QuaZip::getComment(): ZIP is not open in mdUnzip mode");
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   211
    return QString();
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   212
  }
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   213
  unz_global_info globalInfo;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   214
  QByteArray comment;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   215
  if((fakeThis->p->zipError=unzGetGlobalInfo(p->unzFile_f, &globalInfo))!=UNZ_OK)
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   216
    return QString();
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   217
  comment.resize(globalInfo.size_comment);
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   218
  if((fakeThis->p->zipError=unzGetGlobalComment(p->unzFile_f, comment.data(), comment.size())) < 0)
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   219
    return QString();
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   220
  fakeThis->p->zipError = UNZ_OK;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   221
  return p->commentCodec->toUnicode(comment);
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   222
}
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   223
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   224
bool QuaZip::setCurrentFile(const QString& fileName, CaseSensitivity cs)
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   225
{
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   226
  p->zipError=UNZ_OK;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   227
  if(p->mode!=mdUnzip) {
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   228
    qWarning("QuaZip::setCurrentFile(): ZIP is not open in mdUnzip mode");
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   229
    return false;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   230
  }
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   231
  if(fileName.isEmpty()) {
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   232
    p->hasCurrentFile_f=false;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   233
    return true;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   234
  }
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   235
  // Unicode-aware reimplementation of the unzLocateFile function
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   236
  if(p->unzFile_f==NULL) {
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   237
    p->zipError=UNZ_PARAMERROR;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   238
    return false;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   239
  }
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   240
  if(fileName.length()>MAX_FILE_NAME_LENGTH) {
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   241
    p->zipError=UNZ_PARAMERROR;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   242
    return false;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   243
  }
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   244
  bool sens;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   245
  if(cs==csDefault) {
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   246
#ifdef Q_WS_WIN
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   247
    sens=false;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   248
#else
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   249
    sens=true;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   250
#endif
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   251
  } else sens=cs==csSensitive;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   252
  QString lower, current;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   253
  if(!sens) lower=fileName.toLower();
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   254
  p->hasCurrentFile_f=false;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   255
  for(bool more=goToFirstFile(); more; more=goToNextFile()) {
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   256
    current=getCurrentFileName();
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   257
    if(current.isEmpty()) return false;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   258
    if(sens) {
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   259
      if(current==fileName) break;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   260
    } else {
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   261
      if(current.toLower()==lower) break;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   262
    }
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   263
  }
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   264
  return p->hasCurrentFile_f;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   265
}
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   266
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   267
bool QuaZip::goToFirstFile()
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   268
{
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   269
  p->zipError=UNZ_OK;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   270
  if(p->mode!=mdUnzip) {
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   271
    qWarning("QuaZip::goToFirstFile(): ZIP is not open in mdUnzip mode");
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   272
    return false;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   273
  }
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   274
  p->zipError=unzGoToFirstFile(p->unzFile_f);
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   275
  p->hasCurrentFile_f=p->zipError==UNZ_OK;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   276
  return p->hasCurrentFile_f;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   277
}
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   278
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   279
bool QuaZip::goToNextFile()
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   280
{
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   281
  p->zipError=UNZ_OK;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   282
  if(p->mode!=mdUnzip) {
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   283
    qWarning("QuaZip::goToFirstFile(): ZIP is not open in mdUnzip mode");
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   284
    return false;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   285
  }
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   286
  p->zipError=unzGoToNextFile(p->unzFile_f);
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   287
  p->hasCurrentFile_f=p->zipError==UNZ_OK;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   288
  if(p->zipError==UNZ_END_OF_LIST_OF_FILE)
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   289
    p->zipError=UNZ_OK;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   290
  return p->hasCurrentFile_f;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   291
}
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   292
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   293
bool QuaZip::getCurrentFileInfo(QuaZipFileInfo *info)const
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   294
{
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   295
  QuaZip *fakeThis=(QuaZip*)this; // non-const
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   296
  fakeThis->p->zipError=UNZ_OK;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   297
  if(p->mode!=mdUnzip) {
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   298
    qWarning("QuaZip::getCurrentFileInfo(): ZIP is not open in mdUnzip mode");
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   299
    return false;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   300
  }
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   301
  unz_file_info info_z;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   302
  QByteArray fileName;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   303
  QByteArray extra;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   304
  QByteArray comment;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   305
  if(info==NULL) return false;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   306
  if(!isOpen()||!hasCurrentFile()) return false;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   307
  if((fakeThis->p->zipError=unzGetCurrentFileInfo(p->unzFile_f, &info_z, NULL, 0, NULL, 0, NULL, 0))!=UNZ_OK)
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   308
    return false;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   309
  fileName.resize(info_z.size_filename);
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   310
  extra.resize(info_z.size_file_extra);
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   311
  comment.resize(info_z.size_file_comment);
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   312
  if((fakeThis->p->zipError=unzGetCurrentFileInfo(p->unzFile_f, NULL,
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   313
      fileName.data(), fileName.size(),
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   314
      extra.data(), extra.size(),
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   315
      comment.data(), comment.size()))!=UNZ_OK)
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   316
    return false;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   317
  info->versionCreated=info_z.version;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   318
  info->versionNeeded=info_z.version_needed;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   319
  info->flags=info_z.flag;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   320
  info->method=info_z.compression_method;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   321
  info->crc=info_z.crc;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   322
  info->compressedSize=info_z.compressed_size;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   323
  info->uncompressedSize=info_z.uncompressed_size;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   324
  info->diskNumberStart=info_z.disk_num_start;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   325
  info->internalAttr=info_z.internal_fa;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   326
  info->externalAttr=info_z.external_fa;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   327
  info->name=p->fileNameCodec->toUnicode(fileName);
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   328
  info->comment=p->commentCodec->toUnicode(comment);
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   329
  info->extra=extra;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   330
  info->dateTime=QDateTime(
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   331
      QDate(info_z.tmu_date.tm_year, info_z.tmu_date.tm_mon+1, info_z.tmu_date.tm_mday),
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   332
      QTime(info_z.tmu_date.tm_hour, info_z.tmu_date.tm_min, info_z.tmu_date.tm_sec));
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   333
  return true;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   334
}
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   335
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   336
QString QuaZip::getCurrentFileName()const
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   337
{
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   338
  QuaZip *fakeThis=(QuaZip*)this; // non-const
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   339
  fakeThis->p->zipError=UNZ_OK;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   340
  if(p->mode!=mdUnzip) {
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   341
    qWarning("QuaZip::getCurrentFileName(): ZIP is not open in mdUnzip mode");
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   342
    return QString();
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   343
  }
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   344
  if(!isOpen()||!hasCurrentFile()) return QString();
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   345
  QByteArray fileName(MAX_FILE_NAME_LENGTH, 0);
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   346
  if((fakeThis->p->zipError=unzGetCurrentFileInfo(p->unzFile_f, NULL, fileName.data(), fileName.size(),
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   347
      NULL, 0, NULL, 0))!=UNZ_OK)
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   348
    return QString();
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   349
  return p->fileNameCodec->toUnicode(fileName.constData());
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   350
}
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   351
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   352
void QuaZip::setFileNameCodec(QTextCodec *fileNameCodec)
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   353
{
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   354
  p->fileNameCodec=fileNameCodec;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   355
}
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   356
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   357
void QuaZip::setFileNameCodec(const char *fileNameCodecName)
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   358
{
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   359
  p->fileNameCodec=QTextCodec::codecForName(fileNameCodecName);
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   360
}
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   361
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   362
QTextCodec *QuaZip::getFileNameCodec()const
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   363
{
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   364
  return p->fileNameCodec;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   365
}
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   366
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   367
void QuaZip::setCommentCodec(QTextCodec *commentCodec)
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   368
{
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   369
  p->commentCodec=commentCodec;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   370
}
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   371
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   372
void QuaZip::setCommentCodec(const char *commentCodecName)
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   373
{
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   374
  p->commentCodec=QTextCodec::codecForName(commentCodecName);
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   375
}
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   376
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   377
QTextCodec *QuaZip::getCommentCodec()const
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   378
{
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   379
  return p->commentCodec;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   380
}
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   381
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   382
QString QuaZip::getZipName() const
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   383
{
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   384
  return p->zipName;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   385
}
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   386
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   387
QIODevice *QuaZip::getIoDevice() const
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   388
{
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   389
  if (!p->zipName.isEmpty()) // opened by name, using an internal QIODevice
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   390
    return NULL;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   391
  return p->ioDevice;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   392
}
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   393
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   394
QuaZip::Mode QuaZip::getMode()const
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   395
{
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   396
  return p->mode;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   397
}
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   398
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   399
bool QuaZip::isOpen()const
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   400
{
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   401
  return p->mode!=mdNotOpen;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   402
}
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   403
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   404
int QuaZip::getZipError() const
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   405
{
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   406
  return p->zipError;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   407
}
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   408
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   409
void QuaZip::setComment(const QString& comment)
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   410
{
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   411
  p->comment=comment;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   412
}
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   413
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   414
bool QuaZip::hasCurrentFile()const
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   415
{
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   416
  return p->hasCurrentFile_f;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   417
}
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   418
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   419
unzFile QuaZip::getUnzFile()
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   420
{
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   421
  return p->unzFile_f;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   422
}
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   423
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   424
zipFile QuaZip::getZipFile()
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   425
{
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   426
  return p->zipFile_f;
57b117d441b9 consistent line endings
nemo
parents: 5752
diff changeset
   427
}