Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qfilesystemiterator_p.h
Go to the documentation of this file.
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// Qt-Security score:significant reason:default
4
5#ifndef QFILESYSTEMITERATOR_P_H
6#define QFILESYSTEMITERATOR_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtCore/qglobal.h>
20
21#ifndef QT_NO_FILESYSTEMITERATOR
22
23#include <QtCore/qdir.h>
24#include <QtCore/qstringlist.h>
25
26#include <QtCore/private/qdirentryinfo_p.h>
27#include <QtCore/private/qfilesystementry_p.h>
28#include <QtCore/private/qfilesystemmetadata_p.h>
29
30#include <memory>
31
32QT_BEGIN_NAMESPACE
33
34class QFileSystemIterator
35{
36public:
37 QFileSystemIterator(const QFileSystemEntry &entry, QDir::Filters filters);
38 QFileSystemIterator(const QFileSystemEntry &entry);
39 QFileSystemIterator(const QFileSystemEntry &entry, QDirListing::IteratorFlags filters);
40 ~QFileSystemIterator();
41
42 std::optional<QDirEntryInfo> advance();
43
44private:
45 QString dirPath;
46
47 // Platform-specific data
48#if defined(Q_OS_WIN)
49 QFileSystemEntry::NativePath nativePath;
50 HANDLE findFileHandle;
51 QStringList uncShares;
52 bool uncFallback;
53 int uncShareIndex;
54 bool onlyDirs;
55#else
56 struct DirStreamCloser {
57 void operator()(QT_DIR *dir) { if (dir) QT_CLOSEDIR(dir); }
58 };
59 using DirPtr = std::unique_ptr<QT_DIR, DirStreamCloser>;
60 DirPtr dir;
61
62 QT_DIRENT *dirEntry = nullptr;
63 int lastError = 0;
64#endif
65
66 Q_DISABLE_COPY_MOVE(QFileSystemIterator)
67};
68
69QT_END_NAMESPACE
70
71#endif // QT_NO_FILESYSTEMITERATOR
72
73#endif // include guard
Combined button and popup list for selecting options.