![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
Provides ZIP archive navigation. More...
#include <quazipdir.h>
Public Member Functions | |
| QuaZipDir (const QuaZipDir &that) | |
| The copy constructor. More... | |
| QuaZipDir (QuaZip *zip, const QString &dir=QString()) | |
| Constructs a QuaZipDir instance pointing to the specified directory. More... | |
| ~QuaZipDir () | |
| Destructor. More... | |
| bool | operator== (const QuaZipDir &that) |
| The assignment operator. More... | |
| bool | operator!= (const QuaZipDir &that) |
| operator!= More... | |
| QuaZipDir & | operator= (const QuaZipDir &that) |
| operator== More... | |
| QString | operator[] (int pos) const |
| Returns the name of the entry at the specified position. More... | |
| QuaZip::CaseSensitivity | caseSensitivity () const |
| Returns the current case sensitivity mode. More... | |
| bool | cd (const QString &dirName) |
| Changes the 'current' directory. More... | |
| bool | cdUp () |
| Goes up. More... | |
| uint | count () const |
| Returns the number of entries in the directory. More... | |
| QString | dirName () const |
| Returns the current directory name. More... | |
| 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. More... | |
| QList< QuaZipFileInfo > | entryInfoList (QDir::Filters filters=QDir::NoFilter, QDir::SortFlags sort=QDir::NoSort) const |
| Returns the list of the entries in the directory. More... | |
| 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. More... | |
| QList< QuaZipFileInfo64 > | entryInfoList64 (QDir::Filters filters=QDir::NoFilter, QDir::SortFlags sort=QDir::NoSort) const |
| Returns the list of the entries in the directory with zip64 support. More... | |
| 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. More... | |
| QStringList | entryList (QDir::Filters filters=QDir::NoFilter, QDir::SortFlags sort=QDir::NoSort) const |
| Returns the list of the entry names in the directory. More... | |
| bool | exists (const QString &fileName) const |
Returns true if the entry with the specified name exists. More... | |
| bool | exists () const |
Return true if the directory pointed by this QuaZipDir exists. More... | |
| QString | filePath (const QString &fileName) const |
| Returns the full path to the specified file. More... | |
| QDir::Filters | filter () |
| Returns the default filter. More... | |
| bool | isRoot () const |
| Returns if the QuaZipDir points to the root of the archive. More... | |
| QStringList | nameFilters () const |
| Return the default name filter. More... | |
| QString | path () const |
| Returns the path to the current dir. More... | |
| QString | relativeFilePath (const QString &fileName) const |
| Returns the path to the specified file relative to the current dir. More... | |
| void | setCaseSensitivity (QuaZip::CaseSensitivity caseSensitivity) |
| Sets the default case sensitivity mode. More... | |
| void | setFilter (QDir::Filters filters) |
| Sets the default filter. More... | |
| void | setNameFilters (const QStringList &nameFilters) |
| Sets the default name filter. More... | |
| void | setPath (const QString &path) |
| Goes to the specified path. More... | |
| void | setSorting (QDir::SortFlags sort) |
| Sets the default sorting mode. More... | |
| QDir::SortFlags | sorting () const |
| Returns the default sorting mode. More... | |
Provides ZIP archive navigation.
This class is modelled after QDir, and is designed to provide similar features for ZIP archives.
The only significant difference from QDir is that the root path is not '/', but an empty string since that's how the file paths are stored in the archive. However, QuaZipDir understands the paths starting with '/'. It is important in a few places:
Note that since ZIP uses '/' on all platforms, the '\' separator is not supported.
Definition at line 55 of file quazipdir.h.
| QuaZipDir::QuaZipDir | ( | const QuaZipDir & | that | ) |
| QuaZipDir::QuaZipDir | ( | QuaZip * | zip, |
| const QString & | dir = QString() |
||
| ) |
Constructs a QuaZipDir instance pointing to the specified directory.
If dir is not specified, points to the root of the archive. The same happens if the dir is "/".
Definition at line 63 of file quazipdir.cpp.
| QuaZipDir::~QuaZipDir | ( | ) |
Destructor.
Definition at line 68 of file quazipdir.cpp.
| QuaZip::CaseSensitivity QuaZipDir::caseSensitivity | ( | ) | const |
Returns the current case sensitivity mode.
Definition at line 81 of file quazipdir.cpp.
Referenced by setCaseSensitivity().
| bool QuaZipDir::cd | ( | const QString & | dirName | ) |
Changes the 'current' directory.
If the path starts with '/', it is interpreted as an absolute path from the root of the archive. Otherwise, it is interpreted as a path relative to the current directory as was set by the previous cd() or the constructor.
Note that the subsequent path() call will not return a path starting with '/' in all cases.
Definition at line 85 of file quazipdir.cpp.
References cd(), dirName(), exists(), isRoot(), path(), and QtCompat::SkipEmptyParts.
| bool QuaZipDir::cdUp | ( | ) |
| uint QuaZipDir::count | ( | ) | const |
Returns the number of entries in the directory.
Definition at line 144 of file quazipdir.cpp.
References entryList().
| QString QuaZipDir::dirName | ( | ) | const |
Returns the current directory name.
The name doesn't include the path.
Definition at line 146 of file quazipdir.cpp.
Referenced by cd().
| QList< QuaZipFileInfo > QuaZipDir::entryInfoList | ( | const QStringList & | nameFilters, |
| QDir::Filters | filters = QDir::NoFilter, |
||
| QDir::SortFlags | sort = QDir::NoSort |
||
| ) | const |
Returns the list of the entries in the directory.
| nameFilters | The list of file patterns to list, uses the same syntax as QDir. |
| filters | The entry type filters, only Files and Dirs are accepted. |
| sort | Sorting mode. |
Definition at line 366 of file quazipdir.cpp.
References nameFilters(), and result.
Referenced by entryInfoList().
| QList< QuaZipFileInfo > QuaZipDir::entryInfoList | ( | QDir::Filters | filters = QDir::NoFilter, |
| QDir::SortFlags | sort = QDir::NoSort |
||
| ) | const |
Returns the list of the entries in the directory.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
The same as entryInfoList(QStringList(), filters, sort).
Definition at line 376 of file quazipdir.cpp.
References entryInfoList().
| QList< QuaZipFileInfo64 > QuaZipDir::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.
| nameFilters | The list of file patterns to list, uses the same syntax as QDir. |
| filters | The entry type filters, only Files and Dirs are accepted. |
| sort | Sorting mode. |
Definition at line 381 of file quazipdir.cpp.
References nameFilters(), and result.
Referenced by entryInfoList64().
| QList< QuaZipFileInfo64 > QuaZipDir::entryInfoList64 | ( | QDir::Filters | filters = QDir::NoFilter, |
| QDir::SortFlags | sort = QDir::NoSort |
||
| ) | const |
Returns the list of the entries in the directory with zip64 support.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
The same as entryInfoList64(QStringList(), filters, sort).
Definition at line 392 of file quazipdir.cpp.
References entryInfoList64().
| QStringList QuaZipDir::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.
The same as entryInfoList(nameFilters, filters, sort), but only returns entry names.
Definition at line 397 of file quazipdir.cpp.
References nameFilters(), and result.
Referenced by count(), entryList(), exists(), and operator[]().
| QStringList QuaZipDir::entryList | ( | QDir::Filters | filters = QDir::NoFilter, |
| QDir::SortFlags | sort = QDir::NoSort |
||
| ) | const |
Returns the list of the entry names in the directory.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
The same as entryList(QStringList(), filters, sort).
Definition at line 407 of file quazipdir.cpp.
References entryList().
| bool QuaZipDir::exists | ( | ) | const |
Return true if the directory pointed by this QuaZipDir exists.
Definition at line 455 of file quazipdir.cpp.
References QuaZipDir().
Referenced by cd().
| bool QuaZipDir::exists | ( | const QString & | fileName | ) | const |
Returns true if the entry with the specified name exists.
The ".." is considered to exist if the current directory is not root. The "." and "/" are considered to always exist. Paths starting with "/" are relative to the archive root, other paths are relative to the current dir.
Definition at line 412 of file quazipdir.cpp.
References cd(), QuaZip::convertCaseSensitivity(), entryList(), exists(), filePath(), and isRoot().
Referenced by exists().
| QString QuaZipDir::filePath | ( | const QString & | fileName | ) | const |
Returns the full path to the specified file.
Doesn't check if the file actually exists.
Definition at line 457 of file quazipdir.cpp.
Referenced by exists().
| QDir::Filters QuaZipDir::filter | ( | ) |
Returns the default filter.
Definition at line 461 of file quazipdir.cpp.
| bool QuaZipDir::isRoot | ( | ) | const |
Returns if the QuaZipDir points to the root of the archive.
Not that the root path is the empty string, not '/'.
Definition at line 463 of file quazipdir.cpp.
| QStringList QuaZipDir::nameFilters | ( | ) | const |
Return the default name filter.
Definition at line 465 of file quazipdir.cpp.
Referenced by entryInfoList(), entryInfoList64(), entryList(), and setNameFilters().
|
inline |
operator!=
true if either this and that use different QuaZip instances or if they point to different directories. Definition at line 77 of file quazipdir.h.
References cloudViewer::utility::operator==().
operator==
true if both this and that use the same QuaZip instance and point to the same directory. Definition at line 74 of file quazipdir.cpp.
| bool QuaZipDir::operator== | ( | const QuaZipDir & | that | ) |
The assignment operator.
Definition at line 70 of file quazipdir.cpp.
| QString QuaZipDir::operator[] | ( | int | pos | ) | const |
Returns the name of the entry at the specified position.
Definition at line 79 of file quazipdir.cpp.
References entryList().
| QString QuaZipDir::path | ( | ) | const |
Returns the path to the current dir.
The path never starts with '/', and the root path is an empty string.
Definition at line 467 of file quazipdir.cpp.
| QString QuaZipDir::relativeFilePath | ( | const QString & | fileName | ) | const |
Returns the path to the specified file relative to the current dir.
This function is mostly useless, provided only for the sake of completeness.
| fileName | The path to the file, should start with "/" if relative to the archive root. |
Definition at line 469 of file quazipdir.cpp.
| void QuaZipDir::setCaseSensitivity | ( | QuaZip::CaseSensitivity | caseSensitivity | ) |
Sets the default case sensitivity mode.
Definition at line 473 of file quazipdir.cpp.
References caseSensitivity().
| void QuaZipDir::setFilter | ( | QDir::Filters | filters | ) |
Sets the default filter.
Definition at line 477 of file quazipdir.cpp.
| void QuaZipDir::setNameFilters | ( | const QStringList & | nameFilters | ) |
Sets the default name filter.
Definition at line 479 of file quazipdir.cpp.
References nameFilters().
| void QuaZipDir::setPath | ( | const QString & | path | ) |
Goes to the specified path.
The difference from cd() is that this function never checks if the path actually exists and doesn't use relative paths, so it's possible to go to the root directory with setPath("").
Note that this function still chops the trailing and/or leading '/' and treats a single '/' as the root path (path() will still return an empty string).
Definition at line 483 of file quazipdir.cpp.
References path().
| void QuaZipDir::setSorting | ( | QDir::SortFlags | sort | ) |
Sets the default sorting mode.
Definition at line 494 of file quazipdir.cpp.
| QDir::SortFlags QuaZipDir::sorting | ( | ) | const |
Returns the default sorting mode.
Definition at line 496 of file quazipdir.cpp.