1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QFILESYSTEMITERATOR_P_H
5#define QFILESYSTEMITERATOR_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtCore/qglobal.h>
19
20#ifndef QT_NO_FILESYSTEMITERATOR
21
22#include <QtCore/qdir.h>
23#include <QtCore/qdiriterator.h>
24#include <QtCore/qstringlist.h>
25
26#include <QtCore/private/qfilesystementry_p.h>
27#include <QtCore/private/qfilesystemmetadata_p.h>
28
29// Platform-specific headers
30#if !defined(Q_OS_WIN)
31#include <QtCore/qscopedpointer.h>
32#endif
33
34QT_BEGIN_NAMESPACE
35
36class QFileSystemIterator
37{
38public:
39 QFileSystemIterator(const QFileSystemEntry &entry, QDir::Filters filters,
40 const QStringList &nameFilters, QDirIterator::IteratorFlags flags
41 = QDirIterator::FollowSymlinks | QDirIterator::Subdirectories);
42 ~QFileSystemIterator();
43
44 bool advance(QFileSystemEntry &fileEntry, QFileSystemMetaData &metaData);
45
46private:
47 QFileSystemEntry::NativePath nativePath;
48
49 // Platform-specific data
50#if defined(Q_OS_WIN)
51 QString dirPath;
52 HANDLE findFileHandle;
53 QStringList uncShares;
54 bool uncFallback;
55 int uncShareIndex;
56 bool onlyDirs;
57#else
58 QT_DIR *dir;
59 QT_DIRENT *dirEntry;
60 int lastError;
61#endif
62
63 Q_DISABLE_COPY_MOVE(QFileSystemIterator)
64};
65
66QT_END_NAMESPACE
67
68#endif // QT_NO_FILESYSTEMITERATOR
69
70#endif // include guard
71

source code of qtbase/src/corelib/io/qfilesystemiterator_p.h