File indexing completed on 2025-03-09 04:23:10

0001 #ifndef QUA_ZIP_H
0002 #define QUA_ZIP_H
0003 
0004 /*
0005 Copyright (C) 2005-2014 Sergey A. Tachenov
0006 
0007 This file is part of QuaZIP.
0008 
0009 QuaZIP is free software: you can redistribute it and/or modify
0010 it under the terms of the GNU Lesser General Public License as published by
0011 the Free Software Foundation, either version 2.1 of the License, or
0012 (at your option) any later version.
0013 
0014 QuaZIP is distributed in the hope that it will be useful,
0015 but WITHOUT ANY WARRANTY; without even the implied warranty of
0016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0017 GNU Lesser General Public License for more details.
0018 
0019 You should have received a copy of the GNU Lesser General Public License
0020 along with QuaZIP.  If not, see <http://www.gnu.org/licenses/>.
0021 
0022 See COPYING file for the full LGPL text.
0023 
0024 Original ZIP package is copyrighted by Gilles Vollant, see
0025 quazip/(un)zip.h files for details, basically it's zlib license.
0026  **/
0027 
0028 #include <QString>
0029 #include <QStringList>
0030 #include <QTextCodec>
0031 
0032 #include "zip.h"
0033 #include "unzip.h"
0034 
0035 #include "quazip_global.h"
0036 #include "quazipfileinfo.h"
0037 
0038 // just in case it will be defined in the later versions of the ZIP/UNZIP
0039 #ifndef UNZ_OPENERROR
0040 // define additional error code
0041 #define UNZ_OPENERROR -1000
0042 #endif
0043 
0044 class QuaZipPrivate;
0045 
0046 /// ZIP archive.
0047 /** \class QuaZip quazip.h <quazip/quazip.h>
0048  * This class implements basic interface to the ZIP archive. It can be
0049  * used to read table contents of the ZIP archive and retreiving
0050  * information about the files inside it.
0051  *
0052  * You can also use this class to open files inside archive by passing
0053  * pointer to the instance of this class to the constructor of the
0054  * QuaZipFile class. But see QuaZipFile::QuaZipFile(QuaZip*, QObject*)
0055  * for the possible pitfalls.
0056  *
0057  * This class is indended to provide interface to the ZIP subpackage of
0058  * the ZIP/UNZIP package as well as to the UNZIP subpackage. But
0059  * currently it supports only UNZIP.
0060  *
0061  * The use of this class is simple - just create instance using
0062  * constructor, then set ZIP archive file name using setFile() function
0063  * (if you did not passed the name to the constructor), then open() and
0064  * then use different functions to work with it! Well, if you are
0065  * paranoid, you may also wish to call close before destructing the
0066  * instance, to check for errors on close.
0067  *
0068  * You may also use getUnzFile() and getZipFile() functions to get the
0069  * ZIP archive handle and use it with ZIP/UNZIP package API directly.
0070  *
0071  * This class supports localized file names inside ZIP archive, but you
0072  * have to set up proper codec with setCodec() function. By default,
0073  * locale codec will be used, which is probably ok for UNIX systems, but
0074  * will almost certainly fail with ZIP archives created in Windows. This
0075  * is because Windows ZIP programs have strange habit of using DOS
0076  * encoding for file names in ZIP archives. For example, ZIP archive
0077  * with cyrillic names created in Windows will have file names in \c
0078  * IBM866 encoding instead of \c WINDOWS-1251. I think that calling one
0079  * function is not much trouble, but for true platform independency it
0080  * would be nice to have some mechanism for file name encoding auto
0081  * detection using locale information. Does anyone know a good way to do
0082  * it?
0083  **/
0084 class QUAZIP_EXPORT QuaZip {
0085   friend class QuaZipPrivate;
0086   public:
0087     /// Useful constants.
0088     enum Constants {
0089       MAX_FILE_NAME_LENGTH=256 /**< Maximum file name length. Taken from
0090                                  \c UNZ_MAXFILENAMEINZIP constant in
0091                                  unzip.c. */
0092     };
0093     /// Open mode of the ZIP file.
0094     enum Mode {
0095       mdNotOpen, ///< ZIP file is not open. This is the initial mode.
0096       mdUnzip, ///< ZIP file is open for reading files inside it.
0097       mdCreate, ///< ZIP file was created with open() call.
0098       mdAppend, /**< ZIP file was opened in append mode. This refers to
0099                   * \c APPEND_STATUS_CREATEAFTER mode in ZIP/UNZIP package
0100                   * and means that zip is appended to some existing file
0101                   * what is useful when that file contains
0102                   * self-extractor code. This is obviously \em not what
0103                   * you whant to use to add files to the existing ZIP
0104                   * archive.
0105                   **/
0106       mdAdd ///< ZIP file was opened for adding files in the archive.
0107     };
0108     /// Case sensitivity for the file names.
0109     /** This is what you specify when accessing files in the archive.
0110      * Works perfectly fine with any characters thanks to Qt's great
0111      * unicode support. This is different from ZIP/UNZIP API, where
0112      * only US-ASCII characters was supported.
0113      **/
0114     enum CaseSensitivity {
0115       csDefault=0, ///< Default for platform. Case sensitive for UNIX, not for Windows.
0116       csSensitive=1, ///< Case sensitive.
0117       csInsensitive=2 ///< Case insensitive.
0118     };
0119     /// Returns the actual case sensitivity for the specified QuaZIP one.
0120     /**
0121       \param cs The value to convert.
0122       \returns If CaseSensitivity::csDefault, then returns the default
0123       file name case sensitivity for the platform. Otherwise, just
0124       returns the appropriate value from the Qt::CaseSensitivity enum.
0125       */
0126     static Qt::CaseSensitivity convertCaseSensitivity(
0127             CaseSensitivity cs);
0128   private:
0129     QuaZipPrivate *p;
0130     // not (and will not be) implemented
0131     QuaZip(const QuaZip& that);
0132     // not (and will not be) implemented
0133     QuaZip& operator=(const QuaZip& that);
0134   public:
0135     /// Constructs QuaZip object.
0136     /** Call setName() before opening constructed object. */
0137     QuaZip();
0138     /// Constructs QuaZip object associated with ZIP file \a zipName.
0139     QuaZip(const QString& zipName);
0140     /// Constructs QuaZip object associated with ZIP file represented by \a ioDevice.
0141     /** The IO device must be seekable, otherwise an error will occur when opening. */
0142     QuaZip(QIODevice *ioDevice);
0143     /// Destroys QuaZip object.
0144     /** Calls close() if necessary. */
0145     ~QuaZip();
0146     /// Opens ZIP file.
0147     /**
0148      * Argument \a mode specifies open mode of the ZIP archive. See Mode
0149      * for details. Note that there is zipOpen2() function in the
0150      * ZIP/UNZIP API which accepts \a globalcomment argument, but it
0151      * does not use it anywhere, so this open() function does not have this
0152      * argument. See setComment() if you need to set global comment.
0153      *
0154      * If the ZIP file is accessed via explicitly set QIODevice, then
0155      * this device is opened in the necessary mode. If the device was
0156      * already opened by some other means, then QuaZIP checks if the
0157      * open mode is compatible to the mode needed for the requested operation.
0158      * If necessary, seeking is performed to position the device properly.
0159      *
0160      * \return \c true if successful, \c false otherwise.
0161      *
0162      * \note ZIP/UNZIP API open calls do not return error code - they
0163      * just return \c NULL indicating an error. But to make things
0164      * easier, quazip.h header defines additional error code \c
0165      * UNZ_ERROROPEN and getZipError() will return it if the open call
0166      * of the ZIP/UNZIP API returns \c NULL.
0167      *
0168      * Argument \a ioApi specifies IO function set for ZIP/UNZIP
0169      * package to use. See unzip.h, zip.h and ioapi.h for details. Note
0170      * that IO API for QuaZip is different from the original package.
0171      * The file path argument was changed to be of type \c voidpf, and
0172      * QuaZip passes a QIODevice pointer there. This QIODevice is either
0173      * set explicitly via setIoDevice() or the QuaZip(QIODevice*)
0174      * constructor, or it is created internally when opening the archive
0175      * by its file name. The default API (qioapi.cpp) just delegates
0176      * everything to the QIODevice API. Not only this allows to use a
0177      * QIODevice instead of file name, but also has a nice side effect
0178      * of raising the file size limit from 2G to 4G (in non-zip64 archives).
0179      *
0180      * \note If the zip64 support is needed, the ioApi argument \em must be NULL
0181      * because due to the backwards compatibility issues it can be used to
0182      * provide a 32-bit API only.
0183      *
0184      * \note If the \ref QuaZip::setAutoClose() "no-auto-close" feature is used,
0185      * then the \a ioApi argument \em should be NULL because the old API
0186      * doesn't support the 'fake close' operation, causing slight memory leaks
0187      * and other possible troubles (like closing the output device in case
0188      * when an error occurs during opening).
0189      *
0190      * In short: just forget about the \a ioApi argument and you'll be
0191      * fine.
0192      **/
0193     bool open(Mode mode, zlib_filefunc_def *ioApi =NULL);
0194     /// Closes ZIP file.
0195     /** Call getZipError() to determine if the close was successful.
0196      *
0197      * If the file was opened by name, then the underlying QIODevice is closed
0198      * and deleted.
0199      *
0200      * If the underlying QIODevice was set explicitly using setIoDevice() or
0201      * the appropriate constructor, then it is closed if the auto-close flag
0202      * is set (which it is by default). Call setAutoClose() to clear the
0203      * auto-close flag if this behavior is undesirable.
0204      *
0205      * Since Qt 5.1, the QSaveFile was introduced. It breaks the QIODevice API
0206      * by making close() private and crashing the application if it is called
0207      * from the base class where it is public. It is an excellent example
0208      * of poor design that illustrates why you should never ever break
0209      * an is-a relationship between the base class and a subclass. QuaZIP
0210      * works around this bug by checking if the QIODevice is an instance
0211      * of QSaveFile, using qobject_cast<>, and if it is, calls
0212      * QSaveFile::commit() instead of close(). It is a really ugly hack,
0213      * but at least it makes your programs work instead of crashing. Note that
0214      * if the auto-close flag is cleared, then this is a non-issue, and
0215      * commit() isn't called.
0216       */
0217     void close();
0218     /// Sets the codec used to encode/decode file names inside archive.
0219     /** This is necessary to access files in the ZIP archive created
0220      * under Windows with non-latin characters in file names. For
0221      * example, file names with cyrillic letters will be in \c IBM866
0222      * encoding.
0223      **/
0224     void setFileNameCodec(QTextCodec *fileNameCodec);
0225     /// Sets the codec used to encode/decode file names inside archive.
0226     /** \overload
0227      * Equivalent to calling setFileNameCodec(QTextCodec::codecForName(codecName));
0228      **/
0229     void setFileNameCodec(const char *fileNameCodecName);
0230     /// Returns the codec used to encode/decode comments inside archive.
0231     QTextCodec* getFileNameCodec() const;
0232     /// Sets the codec used to encode/decode comments inside archive.
0233     /** This codec defaults to locale codec, which is probably ok.
0234      **/
0235     void setCommentCodec(QTextCodec *commentCodec);
0236     /// Sets the codec used to encode/decode comments inside archive.
0237     /** \overload
0238      * Equivalent to calling setCommentCodec(QTextCodec::codecForName(codecName));
0239      **/
0240     void setCommentCodec(const char *commentCodecName);
0241     /// Returns the codec used to encode/decode comments inside archive.
0242     QTextCodec* getCommentCodec() const;
0243     /// Returns the name of the ZIP file.
0244     /** Returns null string if no ZIP file name has been set, for
0245      * example when the QuaZip instance is set up to use a QIODevice
0246      * instead.
0247      * \sa setZipName(), setIoDevice(), getIoDevice()
0248      **/
0249     QString getZipName() const;
0250     /// Sets the name of the ZIP file.
0251     /** Does nothing if the ZIP file is open.
0252      *
0253      * Does not reset error code returned by getZipError().
0254      * \sa setIoDevice(), getIoDevice(), getZipName()
0255      **/
0256     void setZipName(const QString& zipName);
0257     /// Returns the device representing this ZIP file.
0258     /** Returns null string if no device has been set explicitly, for
0259      * example when opening a ZIP file by name.
0260      * \sa setIoDevice(), getZipName(), setZipName()
0261      **/
0262     QIODevice *getIoDevice() const;
0263     /// Sets the device representing the ZIP file.
0264     /** Does nothing if the ZIP file is open.
0265      *
0266      * Does not reset error code returned by getZipError().
0267      * \sa getIoDevice(), getZipName(), setZipName()
0268      **/
0269     void setIoDevice(QIODevice *ioDevice);
0270     /// Returns the mode in which ZIP file was opened.
0271     Mode getMode() const;
0272     /// Returns \c true if ZIP file is open, \c false otherwise.
0273     bool isOpen() const;
0274     /// Returns the error code of the last operation.
0275     /** Returns \c UNZ_OK if the last operation was successful.
0276      *
0277      * Error code resets to \c UNZ_OK every time you call any function
0278      * that accesses something inside ZIP archive, even if it is \c
0279      * const (like getEntriesCount()). open() and close() calls reset
0280      * error code too. See documentation for the specific functions for
0281      * details on error detection.
0282      **/
0283     int getZipError() const;
0284     /// Returns number of the entries in the ZIP central directory.
0285     /** Returns negative error code in the case of error. The same error
0286      * code will be returned by subsequent getZipError() call.
0287      **/
0288     int getEntriesCount() const;
0289     /// Returns global comment in the ZIP file.
0290     QString getComment() const;
0291     /// Sets the global comment in the ZIP file.
0292     /** The comment will be written to the archive on close operation.
0293      * QuaZip makes a distinction between a null QByteArray() comment 
0294      * and an empty &quot;&quot; comment in the QuaZip::mdAdd mode. 
0295      * A null comment is the default and it means &quot;don't change 
0296      * the comment&quot;. An empty comment removes the original comment.
0297      *
0298      * \sa open()
0299      **/
0300     void setComment(const QString& comment);
0301     /// Sets the current file to the first file in the archive.
0302     /** Returns \c true on success, \c false otherwise. Call
0303      * getZipError() to get the error code.
0304      **/
0305     bool goToFirstFile();
0306     /// Sets the current file to the next file in the archive.
0307     /** Returns \c true on success, \c false otherwise. Call
0308      * getZipError() to determine if there was an error.
0309      *
0310      * Should be used only in QuaZip::mdUnzip mode.
0311      *
0312      * \note If the end of file was reached, getZipError() will return
0313      * \c UNZ_OK instead of \c UNZ_END_OF_LIST_OF_FILE. This is to make
0314      * things like this easier:
0315      * \code
0316      * for(bool more=zip.goToFirstFile(); more; more=zip.goToNextFile()) {
0317      *   // do something
0318      * }
0319      * if(zip.getZipError()==UNZ_OK) {
0320      *   // ok, there was no error
0321      * }
0322      * \endcode
0323      **/
0324     bool goToNextFile();
0325     /// Sets current file by its name.
0326     /** Returns \c true if successful, \c false otherwise. Argument \a
0327      * cs specifies case sensitivity of the file name. Call
0328      * getZipError() in the case of a failure to get error code.
0329      *
0330      * This is not a wrapper to unzLocateFile() function. That is
0331      * because I had to implement locale-specific case-insensitive
0332      * comparison.
0333      *
0334      * Here are the differences from the original implementation:
0335      *
0336      * - If the file was not found, error code is \c UNZ_OK, not \c
0337      *   UNZ_END_OF_LIST_OF_FILE (see also goToNextFile()).
0338      * - If this function fails, it unsets the current file rather than
0339      *   resetting it back to what it was before the call.
0340      *
0341      * If \a fileName is null string then this function unsets the
0342      * current file and return \c true. Note that you should close the
0343      * file first if it is open! See
0344      * QuaZipFile::QuaZipFile(QuaZip*,QObject*) for the details.
0345      *
0346      * Should be used only in QuaZip::mdUnzip mode.
0347      *
0348      * \sa setFileNameCodec(), CaseSensitivity
0349      **/
0350     bool setCurrentFile(const QString& fileName, CaseSensitivity cs =csDefault);
0351     /// Returns \c true if the current file has been set.
0352     bool hasCurrentFile() const;
0353     /// Retrieves information about the current file.
0354     /** Fills the structure pointed by \a info. Returns \c true on
0355      * success, \c false otherwise. In the latter case structure pointed
0356      * by \a info remains untouched. If there was an error,
0357      * getZipError() returns error code.
0358      *
0359      * Should be used only in QuaZip::mdUnzip mode.
0360      *
0361      * Does nothing and returns \c false in any of the following cases.
0362      * - ZIP is not open;
0363      * - ZIP does not have current file.
0364      *
0365      * In both cases getZipError() returns \c UNZ_OK since there
0366      * is no ZIP/UNZIP API call.
0367      *
0368      * This overload doesn't support zip64, but will work OK on zip64 archives
0369      * except that if one of the sizes (compressed or uncompressed) is greater
0370      * than 0xFFFFFFFFu, it will be set to exactly 0xFFFFFFFFu.
0371      *
0372      * \sa getCurrentFileInfo(QuaZipFileInfo64* info)const
0373      * \sa QuaZipFileInfo64::toQuaZipFileInfo(QuaZipFileInfo&)const
0374      **/
0375     bool getCurrentFileInfo(QuaZipFileInfo* info)const;
0376     /// Retrieves information about the current file.
0377     /** \overload
0378      *
0379      * This function supports zip64. If the archive doesn't use zip64, it is
0380      * completely equivalent to getCurrentFileInfo(QuaZipFileInfo* info)
0381      * except for the argument type.
0382      *
0383      * \sa
0384      **/
0385     bool getCurrentFileInfo(QuaZipFileInfo64* info)const;
0386     /// Returns the current file name.
0387     /** Equivalent to calling getCurrentFileInfo() and then getting \c
0388      * name field of the QuaZipFileInfo structure, but faster and more
0389      * convenient.
0390      *
0391      * Should be used only in QuaZip::mdUnzip mode.
0392      **/
0393     QString getCurrentFileName()const;
0394     /// Returns \c unzFile handle.
0395     /** You can use this handle to directly call UNZIP part of the
0396      * ZIP/UNZIP package functions (see unzip.h).
0397      *
0398      * \warning When using the handle returned by this function, please
0399      * keep in mind that QuaZip class is unable to detect any changes
0400      * you make in the ZIP file state (e. g. changing current file, or
0401      * closing the handle). So please do not do anything with this
0402      * handle that is possible to do with the functions of this class.
0403      * Or at least return the handle in the original state before
0404      * calling some another function of this class (including implicit
0405      * destructor calls and calls from the QuaZipFile objects that refer
0406      * to this QuaZip instance!). So if you have changed the current
0407      * file in the ZIP archive - then change it back or you may
0408      * experience some strange behavior or even crashes.
0409      **/
0410     unzFile getUnzFile();
0411     /// Returns \c zipFile handle.
0412     /** You can use this handle to directly call ZIP part of the
0413      * ZIP/UNZIP package functions (see zip.h). Warnings about the
0414      * getUnzFile() function also apply to this function.
0415      **/
0416     zipFile getZipFile();
0417     /// Changes the data descriptor writing mode.
0418     /**
0419       According to the ZIP format specification, a file inside archive
0420       may have a data descriptor immediately following the file
0421       data. This is reflected by a special flag in the local file header
0422       and in the central directory. By default, QuaZIP sets this flag
0423       and writes the data descriptor unless both method and level were
0424       set to 0, in which case it operates in 1.0-compatible mode and
0425       never writes data descriptors.
0426 
0427       By setting this flag to false, it is possible to disable data
0428       descriptor writing, thus increasing compatibility with archive
0429       readers that don't understand this feature of the ZIP file format.
0430 
0431       Setting this flag affects all the QuaZipFile instances that are
0432       opened after this flag is set.
0433 
0434       The data descriptor writing mode is enabled by default.
0435 
0436       Note that if the ZIP archive is written into a QIODevice for which
0437       QIODevice::isSequential() returns \c true, then the data descriptor
0438       is mandatory and will be written even if this flag is set to false.
0439 
0440       \param enabled If \c true, enable local descriptor writing,
0441       disable it otherwise.
0442 
0443       \sa QuaZipFile::isDataDescriptorWritingEnabled()
0444       */
0445     void setDataDescriptorWritingEnabled(bool enabled);
0446     /// Returns the data descriptor default writing mode.
0447     /**
0448       \sa setDataDescriptorWritingEnabled()
0449       */
0450     bool isDataDescriptorWritingEnabled() const;
0451     /// Returns a list of files inside the archive.
0452     /**
0453       \return A list of file names or an empty list if there
0454       was an error or if the archive is empty (call getZipError() to
0455       figure out which).
0456       \sa getFileInfoList()
0457       */
0458     QStringList getFileNameList() const;
0459     /// Returns information list about all files inside the archive.
0460     /**
0461       \return A list of QuaZipFileInfo objects or an empty list if there
0462       was an error or if the archive is empty (call getZipError() to
0463       figure out which).
0464 
0465       This function doesn't support zip64, but will still work with zip64
0466       archives, converting results using QuaZipFileInfo64::toQuaZipFileInfo().
0467       If all file sizes are below 4 GB, it will work just fine.
0468 
0469       \sa getFileNameList()
0470       \sa getFileInfoList64()
0471       */
0472     QList<QuaZipFileInfo> getFileInfoList() const;
0473     /// Returns information list about all files inside the archive.
0474     /**
0475       \overload
0476 
0477       This function supports zip64.
0478 
0479       \sa getFileNameList()
0480       \sa getFileInfoList()
0481       */
0482     QList<QuaZipFileInfo64> getFileInfoList64() const;
0483     /// Enables the zip64 mode.
0484     /**
0485      * @param zip64 If \c true, the zip64 mode is enabled, disabled otherwise.
0486      *
0487      * Once this is enabled, all new files (until the mode is disabled again)
0488      * will be created in the zip64 mode, thus enabling the ability to write
0489      * files larger than 4 GB. By default, the zip64 mode is off due to
0490      * compatibility reasons.
0491      *
0492      * Note that this does not affect the ability to read zip64 archives in any
0493      * way.
0494      *
0495      * \sa isZip64Enabled()
0496      */
0497     void setZip64Enabled(bool zip64);
0498     /// Returns whether the zip64 mode is enabled.
0499     /**
0500      * @return \c true if and only if the zip64 mode is enabled.
0501      *
0502      * \sa setZip64Enabled()
0503      */
0504     bool isZip64Enabled() const;
0505     /// Returns the auto-close flag.
0506     /**
0507       @sa setAutoClose()
0508       */
0509     bool isAutoClose() const;
0510     /// Sets or unsets the auto-close flag.
0511     /**
0512       By default, QuaZIP opens the underlying QIODevice when open() is called,
0513       and closes it when close() is called. In some cases, when the device
0514       is set explicitly using setIoDevice(), it may be desirable to
0515       leave the device open. If the auto-close flag is unset using this method,
0516       then the device isn't closed automatically if it was set explicitly.
0517 
0518       If it is needed to clear this flag, it is recommended to do so before
0519       opening the archive because otherwise QuaZIP may close the device
0520       during the open() call if an error is encountered after the device
0521       is opened.
0522 
0523       If the device was not set explicitly, but rather the setZipName() or
0524       the appropriate constructor was used to set the ZIP file name instead,
0525       then the auto-close flag has no effect, and the internal device
0526       is closed nevertheless because there is no other way to close it.
0527 
0528       @sa isAutoClose()
0529       @sa setIoDevice()
0530       */
0531     void setAutoClose(bool autoClose) const;
0532     /// Sets the default file name codec to use.
0533     /**
0534      * The default codec is used by the constructors, so calling this function
0535      * won't affect the QuaZip instances already created at that moment.
0536      *
0537      * The codec specified here can be overriden by calling setFileNameCodec().
0538      * If neither function is called, QTextCodec::codecForLocale() will be used
0539      * to decode or encode file names. Use this function with caution if
0540      * the application uses other libraries that depend on QuaZIP. Those
0541      * libraries can either call this function by themselves, thus overriding
0542      * your setting or can rely on the default encoding, thus failing
0543      * mysteriously if you change it. For these reasons, it isn't recommended
0544      * to use this function if you are developing a library, not an application.
0545      * Instead, ask your library users to call it in case they need specific
0546      * encoding.
0547      *
0548      * In most cases, using setFileNameCodec() instead is the right choice.
0549      * However, if you depend on third-party code that uses QuaZIP, then the
0550      * reasons stated above can actually become a reason to use this function
0551      * in case the third-party code in question fails because it doesn't
0552      * understand the encoding you need and doesn't provide a way to specify it.
0553      * This applies to the JlCompress class as well, as it was contributed and
0554      * doesn't support explicit encoding parameters.
0555      *
0556      * In short: use setFileNameCodec() when you can, resort to
0557      * setDefaultFileNameCodec() when you don't have access to the QuaZip
0558      * instance.
0559      *
0560      * @param codec The codec to use by default. If NULL, resets to default.
0561      */
0562     static void setDefaultFileNameCodec(QTextCodec *codec);
0563     /**
0564      * @overload
0565      * Equivalent to calling
0566      * setDefltFileNameCodec(QTextCodec::codecForName(codecName)).
0567      */
0568     static void setDefaultFileNameCodec(const char *codecName);
0569 };
0570 
0571 #endif