AbZip
1.5
|
This class provides a search or extraction directory iterator. You can use this class to navigate entries within the archive. A starting root folder and file name fitlers can be applied. More...
#include <ZipDirIterator.h>
Public Member Functions | |
ZipDirIterator (const AbZip &zip, const QString &path=QString(), AbZip::ZipOptions options=AbZip::None) | |
Constructs a ZipDirIterator class ready to search the archive. You can pass options to decide how the directory should be iterated. More... | |
ZipDirIterator (const AbZip &zip, const QString &path, const QStringList &nameFilters, AbZip::ZipOptions options=AbZip::None) | |
Constructs a ZipDirIterator class ready to search the archive using nameFilters. You can pass options to decide how the directory should be iterated. More... | |
virtual | ~ZipDirIterator () |
Destroys the ZipDirIterator. | |
QString | next () |
next Advances the iterator to the next matching entry, and returns the file path of this new entry. If hasNext() returns false, this function does nothing, and returns a null QString. More... | |
bool | hasNext () const |
hasNext Tests if their is at least one more matching entry found. More... | |
QString | fileName () const |
fileName Returns the file name for the current entry, without the path prepended. More... | |
QString | filePath () const |
filePath Returns the full file and path for the current entry. More... | |
ZipFileInfo | fileInfo () const |
fileInfo Get a ZipFileInfo class containing all the information about the entry in the archive. More... | |
QString | path () const |
path Returns the path only of the found entry. More... | |
Friends | |
class | AbZipPrivate |
This class provides a search or extraction directory iterator. You can use this class to navigate entries within the archive. A starting root folder and file name fitlers can be applied.
Here is an example of how to find all PDF files within the archive.
AbZip zip("myarchive.zip"); ZipDirIterator it( zip, "", QStringList() << "*.pdf", AbZip::Recursive ); while (it.hasNext()) { it.next(); ZipFileInfo info = it.fileInfo(); qDebug() << info.filePath << info.lastModifiedDate; } zip.close();
ZipDirIterator::ZipDirIterator | ( | const AbZip & | zip, |
const QString & | path = QString() , |
||
AbZip::ZipOptions | options = AbZip::None |
||
) |
Constructs a ZipDirIterator class ready to search the archive. You can pass options to decide how the directory should be iterated.
zip | The AbZip class |
path | The root folder within the archive to start iterating from. |
options | Iterator options (Recursive, CaseSensitive, IgnoreFolders, IgnoreFiles) |
ZipDirIterator::ZipDirIterator | ( | const AbZip & | zip, |
const QString & | path, | ||
const QStringList & | nameFilters, | ||
AbZip::ZipOptions | options = AbZip::None |
||
) |
Constructs a ZipDirIterator class ready to search the archive using nameFilters. You can pass options to decide how the directory should be iterated.
zip | The AbZip class |
path | The root folder within the archive to start iterating from. |
nameFilters | Set name filters to search for (e.g. "*.pdf" or "*abc*) |
options | Iterator options (Recursive, CaseSensitive, IgnoreFolders, IgnoreFiles) |
QString ZipDirIterator::next | ( | ) |
next Advances the iterator to the next matching entry, and returns the file path of this new entry. If hasNext() returns false, this function does nothing, and returns a null QString.
bool ZipDirIterator::hasNext | ( | ) | const |
hasNext Tests if their is at least one more matching entry found.
QString ZipDirIterator::fileName | ( | ) | const |
fileName Returns the file name for the current entry, without the path prepended.
QString ZipDirIterator::filePath | ( | ) | const |
filePath Returns the full file and path for the current entry.
ZipFileInfo ZipDirIterator::fileInfo | ( | ) | const |
fileInfo Get a ZipFileInfo class containing all the information about the entry in the archive.
QString ZipDirIterator::path | ( | ) | const |
path Returns the path only of the found entry.