quazipdir.h
#ifndef QUAZIP_QUAZIPDIR_H
#define QUAZIP_QUAZIPDIR_H
/*
Copyright (C) 2005-2014 Sergey A. Tachenov
This file is part of QuaZip.
QuaZip is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 2.1 of the License, or
(at your option) any later version.
QuaZip is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with QuaZip. If not, see <http://www.gnu.org/licenses/>.
See COPYING file for the full LGPL text.
Original ZIP package is copyrighted by Gilles Vollant and contributors,
see quazip/(un)zip.h files for details. Basically it's the zlib license.
*/
class QuaZipDirPrivate;
#include "quazip.h"
#include "quazipfileinfo.h"
#include <QtCore/QDir>
#include <QtCore/QList>
#include <QtCore/QSharedDataPointer>
class QUAZIP_EXPORT QuaZipDir {
private:
QSharedDataPointer<QuaZipDirPrivate> d;
public:
QuaZipDir(const QuaZipDir &that);
QuaZipDir(QuaZip *zip, const QString &dir = QString());
~QuaZipDir();
bool operator==(const QuaZipDir &that);
inline bool operator!=(const QuaZipDir &that) {return !operator==(that);}
QuaZipDir& operator=(const QuaZipDir &that);
QString operator[](int pos) const;
QuaZip::CaseSensitivity caseSensitivity() const;
bool cd(const QString &dirName);
bool cdUp();
uint count() const;
QString dirName() const;
QList<QuaZipFileInfo> entryInfoList(const QStringList &nameFilters,
QDir::Filters filters = QDir::NoFilter,
QDir::SortFlags sort = QDir::NoSort) const;
QList<QuaZipFileInfo> entryInfoList(QDir::Filters filters = QDir::NoFilter,
QDir::SortFlags sort = QDir::NoSort) const;
QList<QuaZipFileInfo64> entryInfoList64(const QStringList &nameFilters,
QDir::Filters filters = QDir::NoFilter,
QDir::SortFlags sort = QDir::NoSort) const;
QList<QuaZipFileInfo64> entryInfoList64(QDir::Filters filters = QDir::NoFilter,
QDir::SortFlags sort = QDir::NoSort) const;
QStringList entryList(const QStringList &nameFilters,
QDir::Filters filters = QDir::NoFilter,
QDir::SortFlags sort = QDir::NoSort) const;
QStringList entryList(QDir::Filters filters = QDir::NoFilter,
QDir::SortFlags sort = QDir::NoSort) const;
bool exists(const QString &fileName) const;
bool exists() const;
QString filePath(const QString &fileName) const;
QDir::Filters filter();
bool isRoot() const;
QStringList nameFilters() const;
QString path() const;
QString relativeFilePath(const QString &fileName) const;
void setCaseSensitivity(QuaZip::CaseSensitivity caseSensitivity);
void setFilter(QDir::Filters filters);
void setNameFilters(const QStringList &nameFilters);
void setPath(const QString &path);
void setSorting(QDir::SortFlags sort);
QDir::SortFlags sorting() const;
};
QuaZipFileInfo64 QuaZipDir_getFileInfo(QuaZip *zip,
bool *ok,
const QString &relativeName,
bool isReal);
#endif // QUAZIP_QUAZIPDIR_H
QuaZipDir::caseSensitivity
QuaZip::CaseSensitivity caseSensitivity() const
Returns the current case sensitivity mode.
Definition quazipdir.cpp:71
QuaZipDir::dirName
QString dirName() const
Returns the current directory name.
Definition quazipdir.cpp:142
QuaZipDir::entryList
QStringList entryList(const QStringList &nameFilters, QDir::Filters filters=QDir::NoFilter, QDir::SortFlags sort=QDir::NoSort) const
Returns the list of the entry names in the directory.
Definition quazipdir.cpp:405
QuaZipDir::operator==
bool operator==(const QuaZipDir &that)
The assignment operator.
Definition quazipdir.cpp:61
QuaZipDir::cdUp
bool cdUp()
Goes up.
Definition quazipdir.cpp:132
QuaZipDir::QuaZipDir
QuaZipDir(const QuaZipDir &that)
The copy constructor.
QuaZipDir::operator!=
bool operator!=(const QuaZipDir &that)
operator!=
Definition quazipdir.h:75
QuaZipDir::setFilter
void setFilter(QDir::Filters filters)
Sets the default filter.
Definition quazipdir.cpp:502
QuaZipDir::count
uint count() const
Returns the number of entries in the directory.
Definition quazipdir.cpp:137
QuaZipDir::relativeFilePath
QString relativeFilePath(const QString &fileName) const
Returns the path to the specified file relative to the current dir.
Definition quazipdir.cpp:492
QuaZipDir::operator=
QuaZipDir & operator=(const QuaZipDir &that)
operator==
QuaZipDir::operator[]
QString operator[](int pos) const
Returns the name of the entry at the specified position.
Definition quazipdir.cpp:66
QuaZipDir::cd
bool cd(const QString &dirName)
Changes the 'current' directory.
Definition quazipdir.cpp:76
QuaZipDir::setNameFilters
void setNameFilters(const QStringList &nameFilters)
Sets the default name filter.
Definition quazipdir.cpp:507
QuaZipDir::filter
QDir::Filters filter()
Returns the default filter.
Definition quazipdir.cpp:472
QuaZipDir::isRoot
bool isRoot() const
Returns if the QuaZipDir points to the root of the archive.
Definition quazipdir.cpp:477
QuaZipDir::setCaseSensitivity
void setCaseSensitivity(QuaZip::CaseSensitivity caseSensitivity)
Sets the default case sensitivity mode.
Definition quazipdir.cpp:497
QuaZipDir::nameFilters
QStringList nameFilters() const
Return the default name filter.
Definition quazipdir.cpp:482
QuaZipDir::entryInfoList64
QList< QuaZipFileInfo64 > entryInfoList64(const QStringList &nameFilters, QDir::Filters filters=QDir::NoFilter, QDir::SortFlags sort=QDir::NoSort) const
Returns the list of the entries in the directory with zip64 support.
Definition quazipdir.cpp:390
QuaZipDir::sorting
QDir::SortFlags sorting() const
Returns the default sorting mode.
Definition quazipdir.cpp:531
QuaZipDir::setSorting
void setSorting(QDir::SortFlags sort)
Sets the default sorting mode.
Definition quazipdir.cpp:526
QuaZipDir::path
QString path() const
Returns the path to the current dir.
Definition quazipdir.cpp:487
QuaZipDir::exists
bool exists(const QString &fileName) const
Returns true if the entry with the specified name exists.
Definition quazipdir.cpp:420
QuaZipDir::setPath
void setPath(const QString &path)
Goes to the specified path.
Definition quazipdir.cpp:512
QuaZipDir::~QuaZipDir
~QuaZipDir()
Destructor.
QuaZipDir::entryInfoList
QList< QuaZipFileInfo > entryInfoList(const QStringList &nameFilters, QDir::Filters filters=QDir::NoFilter, QDir::SortFlags sort=QDir::NoSort) const
Returns the list of the entries in the directory.
Definition quazipdir.cpp:375
QuaZipDir::filePath
QString filePath(const QString &fileName) const
Returns the full path to the specified file.
Definition quazipdir.cpp:467
QuaZip
ZIP archive.
Definition quazip.h:84
QuaZip::CaseSensitivity
CaseSensitivity
Case sensitivity for the file names.
Definition quazip.h:114
QuaZipFileInfo64
Information about a file inside archive (with zip64 support).
Definition quazipfileinfo.h:85