Eneboo - Documentación para desarrolladores
tools/aqzip/AQZipReader.h
Ir a la documentación de este archivo.
00001 /***************************************************************************
00002  AQZipReader.h
00003  -------------------
00004  begin                : 12/12/2011
00005  copyright            : (C) 2003-2011 by InfoSiAL S.L.
00006  email                : mail@infosial.com
00007  ***************************************************************************/
00008 /***************************************************************************
00009  *   This program is free software; you can redistribute it and/or modify  *
00010  *   it under the terms of the GNU General Public License as published by  *
00011  *   the Free Software Foundation; version 2 of the License.               *
00012  ***************************************************************************/
00013 /***************************************************************************
00014  Este  programa es software libre. Puede redistribuirlo y/o modificarlo
00015  bajo  los  términos  de  la  Licencia  Pública General de GNU   en  su
00016  versión 2, publicada  por  la  Free  Software Foundation.
00017  ***************************************************************************/
00018 
00019 #ifndef AQZIPREADER_H
00020 #define AQZIPREADER_H
00021 
00022 #include <qdatetime.h>
00023 #include <qfile.h>
00024 #include <qfileinfo.h>
00025 #include <qstring.h>
00026 #include <qvaluelist.h>
00027 
00028 class AQZipReaderPrivate;
00029 
00030 class AQZipReader
00031 {
00032 public:
00033   AQZipReader(const QString &fileName, uint mode = IO_ReadOnly);
00034 
00035   explicit AQZipReader(QIODevice *device);
00036   ~AQZipReader();
00037 
00038   QIODevice *device() const;
00039 
00040   bool isReadable() const;
00041   bool exists() const;
00042 
00043   struct FileInfo {
00044     FileInfo();
00045     FileInfo(const FileInfo &other);
00046     ~FileInfo();
00047     FileInfo &operator=(const FileInfo &other);
00048     bool isValid() const;
00049     QString filePath;
00050     uint isDir : 1;
00051     uint isFile : 1;
00052     uint isSymLink : 1;
00053     QFileInfo::PermissionSpec permissions;
00054     uint crc32;
00055     Q_UINT64 size;
00056     QDateTime lastModified;
00057     void *d;
00058   };
00059 
00060   QValueList<FileInfo> fileInfoList() const;
00061   int count() const;
00062 
00063   FileInfo entryInfoAt(int index) const;
00064   QByteArray fileData(const QString &fileName) const;
00065   bool extractAll(const QString &destinationDir) const;
00066 
00067   enum Status {
00068     NoError,
00069     FileReadError,
00070     FileOpenError,
00071     FilePermissionsError,
00072     FileError
00073   };
00074 
00075   Status status() const;
00076 
00077   void close();
00078 
00079 private:
00080   AQZipReaderPrivate *d;
00081   AQZipReader(const AQZipReader &);
00082   AQZipReader &operator=(const AQZipReader &);
00083 };
00084 
00085 #endif // AQZIPREADER_H
00086 
00087 /****************************************************************************
00088 **
00089 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
00090 ** All rights reserved.
00091 ** Contact: Nokia Corporation (qt-info@nokia.com)
00092 **
00093 ** This file is part of the QtGui module of the Qt Toolkit.
00094 **
00095 ** $QT_BEGIN_LICENSE:LGPL$
00096 ** GNU Lesser General Public License Usage
00097 ** This file may be used under the terms of the GNU Lesser General Public
00098 ** License version 2.1 as published by the Free Software Foundation and
00099 ** appearing in the file LICENSE.LGPL included in the packaging of this
00100 ** file. Please review the following information to ensure the GNU Lesser
00101 ** General Public License version 2.1 requirements will be met:
00102 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
00103 **
00104 ** In addition, as a special exception, Nokia gives you certain additional
00105 ** rights. These rights are described in the Nokia Qt LGPL Exception
00106 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
00107 **
00108 ** GNU General Public License Usage
00109 ** Alternatively, this file may be used under the terms of the GNU General
00110 ** Public License version 3.0 as published by the Free Software Foundation
00111 ** and appearing in the file LICENSE.GPL included in the packaging of this
00112 ** file. Please review the following information to ensure the GNU General
00113 ** Public License version 3.0 requirements will be met:
00114 ** http://www.gnu.org/copyleft/gpl.html.
00115 **
00116 ** Other Usage
00117 ** Alternatively, this file may be used in accordance with the terms and
00118 ** conditions contained in a signed written agreement between you and Nokia.
00119 **
00120 **
00121 **
00122 **
00123 **
00124 ** $QT_END_LICENSE$
00125 **
00126 ****************************************************************************/
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'