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