1 /****************************************************************************
2 **
3 ** DQt - D bindings for the Qt Toolkit
4 **
5 ** GNU Lesser General Public License Usage
6 ** This file may be used under the terms of the GNU Lesser
7 ** General Public License version 3 as published by the Free Software
8 ** Foundation and appearing in the file LICENSE.LGPL3 included in the
9 ** packaging of this file. Please review the following information to
10 ** ensure the GNU Lesser General Public License version 3 requirements
11 ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
12 **
13 ****************************************************************************/
14 module qt.core.diriterator;
15 extern(C++):
16 
17 import qt.config;
18 import qt.core.dir;
19 import qt.core.fileinfo;
20 import qt.core.flags;
21 import qt.core.scopedpointer;
22 import qt.core.string;
23 import qt.core.stringlist;
24 import qt.helpers;
25 
26 /+ class QDirIteratorPrivate; +/
27 extern(C++, class) struct /+ Q_CORE_EXPORT +/ QDirIterator {
28 public:
29     enum IteratorFlag {
30         NoIteratorFlags = 0x0,
31         FollowSymlinks = 0x1,
32         Subdirectories = 0x2
33     }
34     /+ Q_DECLARE_FLAGS(IteratorFlags, IteratorFlag) +/
35 alias IteratorFlags = QFlags!(IteratorFlag);
36     this(ref const(QDir) dir, IteratorFlags flags = IteratorFlag.NoIteratorFlags);
37     this(ref const(QString) path,
38                      IteratorFlags flags = IteratorFlag.NoIteratorFlags);
39     this(ref const(QString) path,
40                      QDir.Filters filter,
41                      IteratorFlags flags = IteratorFlag.NoIteratorFlags);
42     this(ref const(QString) path,
43                      ref const(QStringList) nameFilters,
44                      QDir.Filters filters = QDir.Filter.NoFilter,
45                      IteratorFlags flags = IteratorFlag.NoIteratorFlags);
46 
47     ~this();
48 
49     QString next();
50     bool hasNext() const;
51 
52     QString fileName() const;
53     QString filePath() const;
54     QFileInfo fileInfo() const;
55     QString path() const;
56 
57 private:
58     /+ Q_DISABLE_COPY(QDirIterator) +/
59 @disable this(this);
60 /+this(ref const(QDirIterator));+//+ref QDirIterator operator =(ref const(QDirIterator));+/
61     QScopedPointer!(QDirIteratorPrivate) d;
62     /+ friend class QDir; +/
63 }
64 /+pragma(inline, true) QFlags!(QDirIterator.IteratorFlags.enum_type) operator |(QDirIterator.IteratorFlags.enum_type f1, QDirIterator.IteratorFlags.enum_type f2)/+noexcept+/{return QFlags!(QDirIterator.IteratorFlags.enum_type)(f1)|f2;}+/
65 /+pragma(inline, true) QFlags!(QDirIterator.IteratorFlags.enum_type) operator |(QDirIterator.IteratorFlags.enum_type f1, QFlags!(QDirIterator.IteratorFlags.enum_type) f2)/+noexcept+/{return f2|f1;}+/
66 /+pragma(inline, true) QIncompatibleFlag operator |(QDirIterator.IteratorFlags.enum_type f1, int f2)/+noexcept+/{return QIncompatibleFlag(int(f1)|f2);}+/
67 
68 /+ Q_DECLARE_OPERATORS_FOR_FLAGS(QDirIterator::IteratorFlags) +/