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#if !defined(Q_OS_WIN)
31#include <private/qstringconverter_p.h>
32#endif
33
34#include <memory>
35
36QT_BEGIN_NAMESPACE
37
38class QFileSystemIterator
39{
40public:
41 QFileSystemIterator(const QFileSystemEntry &entry, QDir::Filters filters);
42 QFileSystemIterator(const QFileSystemEntry &entry);
43 QFileSystemIterator(const QFileSystemEntry &entry, QDirListing::IteratorFlags filters);
44 ~QFileSystemIterator();
45
46 std::optional<QDirEntryInfo> advance();
47
48private:
49 QString dirPath;
50
51 // Platform-specific data
52#if defined(Q_OS_WIN)
53 QFileSystemEntry::NativePath nativePath;
54 HANDLE findFileHandle;
55 QStringList uncShares;
56 bool uncFallback;
57 int uncShareIndex;
58 bool onlyDirs;
59#else
60 struct DirStreamCloser {
61 void operator()(QT_DIR *dir) { if (dir) QT_CLOSEDIR(dir); }
62 };
63 using DirPtr = std::unique_ptr<QT_DIR, DirStreamCloser>;
64 DirPtr dir;
65
66 QT_DIRENT *dirEntry = nullptr;
67 int lastError = 0;
68 QStringDecoder toUtf16;
69#endif
70
71 Q_DISABLE_COPY_MOVE(QFileSystemIterator)
72};
73
74QT_END_NAMESPACE
75
76#endif // QT_NO_FILESYSTEMITERATOR
77
78#endif // include guard
Combined button and popup list for selecting options.