QuaZip quazip-1-4
quazipdir.h
1#ifndef QUAZIP_QUAZIPDIR_H
2#define QUAZIP_QUAZIPDIR_H
3
4/*
5Copyright (C) 2005-2014 Sergey A. Tachenov
6
7This file is part of QuaZip.
8
9QuaZip is free software: you can redistribute it and/or modify
10it under the terms of the GNU Lesser General Public License as published by
11the Free Software Foundation, either version 2.1 of the License, or
12(at your option) any later version.
13
14QuaZip is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17GNU Lesser General Public License for more details.
18
19You should have received a copy of the GNU Lesser General Public License
20along with QuaZip. If not, see <http://www.gnu.org/licenses/>.
21
22See COPYING file for the full LGPL text.
23
24Original ZIP package is copyrighted by Gilles Vollant and contributors,
25see quazip/(un)zip.h files for details. Basically it's the zlib license.
26*/
27
28class QuaZipDirPrivate;
29
30#include "quazip.h"
31#include "quazipfileinfo.h"
32#include <QtCore/QDir>
33#include <QtCore/QList>
34#include <QtCore/QSharedDataPointer>
35
37
54class QUAZIP_EXPORT QuaZipDir {
55private:
57public:
59 QuaZipDir(const QuaZipDir &that);
61
65 QuaZipDir(QuaZip *zip, const QString &dir = QString());
69 bool operator==(const QuaZipDir &that);
71
75 inline bool operator!=(const QuaZipDir &that) {return !operator==(that);}
77
83 QString operator[](int pos) const;
85 QuaZip::CaseSensitivity caseSensitivity() const;
87
96 bool cd(const QString &dirName);
98 bool cdUp();
100 uint count() const;
102
105 QString dirName() const;
107
114 QList<QuaZipFileInfo> entryInfoList(const QStringList &nameFilters,
115 QDir::Filters filters = QDir::NoFilter,
116 QDir::SortFlags sort = QDir::NoSort) const;
118
123 QList<QuaZipFileInfo> entryInfoList(QDir::Filters filters = QDir::NoFilter,
124 QDir::SortFlags sort = QDir::NoSort) const;
126
133 QList<QuaZipFileInfo64> entryInfoList64(const QStringList &nameFilters,
134 QDir::Filters filters = QDir::NoFilter,
135 QDir::SortFlags sort = QDir::NoSort) const;
137
142 QList<QuaZipFileInfo64> entryInfoList64(QDir::Filters filters = QDir::NoFilter,
143 QDir::SortFlags sort = QDir::NoSort) const;
145
149 QStringList entryList(const QStringList &nameFilters,
150 QDir::Filters filters = QDir::NoFilter,
151 QDir::SortFlags sort = QDir::NoSort) const;
153
158 QStringList entryList(QDir::Filters filters = QDir::NoFilter,
159 QDir::SortFlags sort = QDir::NoSort) const;
161
167 bool exists(const QString &fileName) const;
169 bool exists() const;
171
174 QString filePath(const QString &fileName) const;
176 QDir::Filters filter();
178
181 bool isRoot() const;
183 QStringList nameFilters() const;
185
189 QString path() const;
191
199 QString relativeFilePath(const QString &fileName) const;
201 void setCaseSensitivity(QuaZip::CaseSensitivity caseSensitivity);
203 void setFilter(QDir::Filters filters);
205 void setNameFilters(const QStringList &nameFilters);
207
216 void setPath(const QString &path);
218 void setSorting(QDir::SortFlags sort);
220 QDir::SortFlags sorting() const;
221};
222
223#endif // QUAZIP_QUAZIPDIR_H
Provides ZIP archive navigation.
Definition: quazipdir.h:54
QuaZipDir(const QuaZipDir &that)
The copy constructor.
bool operator!=(const QuaZipDir &that)
operator!=
Definition: quazipdir.h:75
QuaZipDir & operator=(const QuaZipDir &that)
operator==
~QuaZipDir()
Destructor.
ZIP archive.
Definition: quazip.h:84
CaseSensitivity
Case sensitivity for the file names.
Definition: quazip.h:114
typedef Filters
typedef SortFlags