io/qfsfileengine_iterator.cpp

Source codeSwitch to Preprocessed file
LineSource CodeCoverage
1/**************************************************************************** -
2** -
3** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -
4** Contact: http://www.qt-project.org/legal -
5** -
6** This file is part of the QtCore module of the Qt Toolkit. -
7** -
8** $QT_BEGIN_LICENSE:LGPL$ -
9** Commercial License Usage -
10** Licensees holding valid commercial Qt licenses may use this file in -
11** accordance with the commercial license agreement provided with the -
12** Software or, alternatively, in accordance with the terms contained in -
13** a written agreement between you and Digia. For licensing terms and -
14** conditions see http://qt.digia.com/licensing. For further information -
15** use the contact form at http://qt.digia.com/contact-us. -
16** -
17** GNU Lesser General Public License Usage -
18** Alternatively, this file may be used under the terms of the GNU Lesser -
19** General Public License version 2.1 as published by the Free Software -
20** Foundation and appearing in the file LICENSE.LGPL included in the -
21** packaging of this file. Please review the following information to -
22** ensure the GNU Lesser General Public License version 2.1 requirements -
23** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -
24** -
25** In addition, as a special exception, Digia gives you certain additional -
26** rights. These rights are described in the Digia Qt LGPL Exception -
27** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -
28** -
29** GNU General Public License Usage -
30** Alternatively, this file may be used under the terms of the GNU -
31** General Public License version 3.0 as published by the Free Software -
32** Foundation and appearing in the file LICENSE.GPL included in the -
33** packaging of this file. Please review the following information to -
34** ensure the GNU General Public License version 3.0 requirements will be -
35** met: http://www.gnu.org/copyleft/gpl.html. -
36** -
37** -
38** $QT_END_LICENSE$ -
39** -
40****************************************************************************/ -
41 -
42#include "qfsfileengine_iterator_p.h" -
43#include "qfileinfo_p.h" -
44#include "qvariant.h" -
45 -
46#ifndef QT_NO_FILESYSTEMITERATOR -
47 -
48QT_BEGIN_NAMESPACE -
49 -
50QFSFileEngineIterator::QFSFileEngineIterator(QDir::Filters filters, const QStringList &filterNames) -
51 : QAbstractFileEngineIterator(filters, filterNames) -
52 , done(false) -
53{ -
54}
never executed: }
0
55 -
56QFSFileEngineIterator::~QFSFileEngineIterator() -
57{ -
58} -
59 -
60bool QFSFileEngineIterator::hasNext() const -
61{ -
62 if (!done && !nativeIterator) {
never evaluated: !done
never evaluated: !nativeIterator
0
63 nativeIterator.reset(new QFileSystemIterator(QFileSystemEntry(path()),
never executed (the execution status of this line is deduced): nativeIterator.reset(new QFileSystemIterator(QFileSystemEntry(path()),
-
64 filters(), nameFilters()));
never executed (the execution status of this line is deduced): filters(), nameFilters()));
-
65 advance();
never executed (the execution status of this line is deduced): advance();
-
66 }
never executed: }
0
67 -
68 return !done;
never executed: return !done;
0
69} -
70 -
71QString QFSFileEngineIterator::next() -
72{ -
73 if (!hasNext())
never evaluated: !hasNext()
0
74 return QString();
never executed: return QString();
0
75 -
76 advance();
never executed (the execution status of this line is deduced): advance();
-
77 return currentFilePath();
never executed: return currentFilePath();
0
78} -
79 -
80void QFSFileEngineIterator::advance() const -
81{ -
82 currentInfo = nextInfo;
never executed (the execution status of this line is deduced): currentInfo = nextInfo;
-
83 -
84 QFileSystemEntry entry;
never executed (the execution status of this line is deduced): QFileSystemEntry entry;
-
85 QFileSystemMetaData data;
never executed (the execution status of this line is deduced): QFileSystemMetaData data;
-
86 if (nativeIterator->advance(entry, data)) {
never evaluated: nativeIterator->advance(entry, data)
0
87 nextInfo = QFileInfo(new QFileInfoPrivate(entry, data));
never executed (the execution status of this line is deduced): nextInfo = QFileInfo(new QFileInfoPrivate(entry, data));
-
88 } else {
never executed: }
0
89 done = true;
never executed (the execution status of this line is deduced): done = true;
-
90 nativeIterator.reset();
never executed (the execution status of this line is deduced): nativeIterator.reset();
-
91 }
never executed: }
0
92} -
93 -
94QString QFSFileEngineIterator::currentFileName() const -
95{ -
96 return currentInfo.fileName();
never executed: return currentInfo.fileName();
0
97} -
98 -
99QFileInfo QFSFileEngineIterator::currentFileInfo() const -
100{ -
101 return currentInfo;
never executed: return currentInfo;
0
102} -
103 -
104QT_END_NAMESPACE -
105 -
106#endif // QT_NO_FILESYSTEMITERATOR -
107 -
Source codeSwitch to Preprocessed file

Generated by Squish Coco Non-Commercial