60#include <QtCore/qset.h>
61#include <QtCore/qstack.h>
62#include <QtCore/qvariant.h>
63#if QT_CONFIG(regularexpression)
64#include <QtCore/qregularexpression.h>
67#include <QtCore/private/qfilesystemiterator_p.h>
68#include <QtCore/private/qfilesystementry_p.h>
69#include <QtCore/private/qfilesystemmetadata_p.h>
70#include <QtCore/private/qfilesystemengine_p.h>
71#include <QtCore/private/qfileinfo_p.h>
72#include <QtCore/private/qduplicatetracker_p.h>
80template <
class Iterator>
94 QDir::Filters _filters, QDirIterator::IteratorFlags
flags,
bool resolveEngine =
true);
103 std::unique_ptr<QAbstractFileEngine>
engine;
110#if QT_CONFIG(regularexpression)
115#ifndef QT_NO_FILESYSTEMITERATOR
130 QDir::Filters _filters, QDirIterator::IteratorFlags
flags,
bool resolveEngine)
134 , iteratorFlags(
flags)
136#if QT_CONFIG(regularexpression)
141 nameRegExps.append(re);
182#ifndef QT_NO_FILESYSTEMITERATOR
187 qWarning(
"Qt was built with -no-feature-filesystemiterator: no files/plugins will be found!");
226#ifndef QT_NO_FILESYSTEMITERATOR
261 if (!fileInfo.
isDir())
298 const bool dotOrDotDot =
fileName[0] == u
'.'
299 && ((fileNameSize == 1)
300 ||(fileNameSize == 2 &&
fileName[1] == u
'.'));
307#if QT_CONFIG(regularexpression)
310 bool matched =
false;
311 for (
const auto &re : nameRegExps) {
312 if (re.match(
fileName).hasMatch()) {
332 if (!includeHidden && !dotOrDotDot &&
fi.
isHidden())
357 if (filterPermissions
503#ifndef QT_NO_FILESYSTEMITERATOR
The QAbstractFileEngineIterator class provides an iterator interface for custom file engines.
~QDirIteratorPrivateIteratorStack()
QDirIteratorPrivateIteratorStack< QAbstractFileEngineIterator > fileEngineIterators
void pushDirectory(const QFileInfo &fileInfo)
const QDir::Filters filters
std::unique_ptr< QAbstractFileEngine > engine
const QStringList nameFilters
QDuplicateTracker< QString > visitedLinks
bool entryMatches(const QString &fileName, const QFileInfo &fileInfo)
bool matchesFilters(const QString &fileName, const QFileInfo &fi) const
QFileSystemEntry dirEntry
void checkAndPushDirectory(const QFileInfo &)
QDirIteratorPrivateIteratorStack< QFileSystemIterator > nativeIterators
QDirIteratorPrivate(const QFileSystemEntry &entry, const QStringList &nameFilters, QDir::Filters _filters, QDirIterator::IteratorFlags flags, bool resolveEngine=true)
QFileInfo currentFileInfo
const QDirIterator::IteratorFlags iteratorFlags
bool hasNext() const
Returns true if there is at least one more entry in the directory; otherwise, false is returned.
QDirIterator(const QDir &dir, IteratorFlags flags=NoIteratorFlags)
Constructs a QDirIterator that can iterate over dir's entrylist, using dir's name filters and regular...
QString fileName() const
Returns the file name for the current directory entry, without the path prepended.
QString next()
Advances the iterator to the next entry, and returns the file path of this new entry.
~QDirIterator()
Destroys the QDirIterator.
QFileInfo fileInfo() const
Returns a QFileInfo for the current directory entry.
QString filePath() const
Returns the full file path for the current directory entry.
QString path() const
Returns the base directory of the iterator.
QFileSystemEntry fileEntry
\inmodule QtCore \reentrant
bool isSymLink() const
Returns true if this object points to a symbolic link, shortcut, or alias; otherwise returns false.
QString fileName() const
Returns the name of the file, excluding the path.
bool isExecutable() const
Returns true if the file is executable; otherwise returns false.
bool isFile() const
Returns true if this object points to a file or to a symbolic link to a file.
bool isDir() const
Returns true if this object points to a directory or to a symbolic link to a directory.
QSharedDataPointer< QFileInfoPrivate > d_ptr
bool isWritable() const
Returns true if the user can write to the file; otherwise returns false.
QString canonicalFilePath() const
Returns the canonical path including the file name, i.e.
bool isHidden() const
Returns true if this is a ‘hidden’ file; otherwise returns false.
QString filePath() const
Returns the file name, including the path (which may be absolute or relative).
bool exists() const
Returns true if the file exists; otherwise returns false.
bool isReadable() const
Returns true if the user can read the file; otherwise returns false.
static QAbstractFileEngine * resolveEntryAndCreateLegacyEngine(QFileSystemEntry &entry, QFileSystemMetaData &data)
Q_AUTOTEST_EXPORT QString filePath() const
Q_AUTOTEST_EXPORT QString fileName() const
bool isEmpty() const noexcept
static QRegularExpression fromWildcard(QStringView pattern, Qt::CaseSensitivity cs=Qt::CaseInsensitive, WildcardConversionOptions options=DefaultWildcardConversion)
void reset(T *other=nullptr) noexcept(noexcept(Cleanup::cleanup(std::declval< T * >())))
Deletes the existing object it is pointing to (if any), and sets its pointer to other.
T & top()
Returns a reference to the stack's top item.
T pop()
Removes the top item from the stack and returns it.
\macro QT_RESTRICTED_CAST_FROM_ASCII
const QChar * constData() const
Returns a pointer to the data stored in the QString.
qDeleteAll(list.begin(), list.end())
QSet< QString >::iterator it
Combined button and popup list for selecting options.
static bool contains(const QJsonArray &haystack, unsigned needle)
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
GLsizei const GLchar *const * path
QFileInfo info(fileName)
[8]
QFileInfo fi("c:/temp/foo")
[newstuff]
const QStringList filters({"Image files (*.png *.xpm *.jpg)", "Text files (*.txt)", "Any files (*)" })
[6]