Line | Source Code | Coverage |
---|
1 | | - |
2 | | - |
3 | | - |
4 | | - |
5 | | - |
6 | | - |
7 | | - |
8 | | - |
9 | | - |
10 | | - |
11 | QFilePrivate::QFilePrivate() | - |
12 | { | - |
13 | } | - |
14 | | - |
15 | QFilePrivate::~QFilePrivate() | - |
16 | { | - |
17 | } | - |
18 | | - |
19 | bool | - |
20 | QFilePrivate::openExternalFile(int flags, int fd, QFile::FileHandleFlags handleFlags) | - |
21 | { | - |
22 | | - |
23 | | - |
24 | | - |
25 | | - |
26 | | - |
27 | delete fileEngine; | - |
28 | fileEngine = 0; | - |
29 | QFSFileEngine *fe = new QFSFileEngine; | - |
30 | fileEngine = fe; | - |
31 | return fe->open(QIODevice::OpenMode(flags), fd, handleFlags); executed: return fe->open(QIODevice::OpenMode(flags), fd, handleFlags); Execution Count:30 | 30 |
32 | | - |
33 | } | - |
34 | | - |
35 | bool | - |
36 | QFilePrivate::openExternalFile(int flags, FILE *fh, QFile::FileHandleFlags handleFlags) | - |
37 | { | - |
38 | | - |
39 | | - |
40 | | - |
41 | | - |
42 | | - |
43 | delete fileEngine; | - |
44 | fileEngine = 0; | - |
45 | QFSFileEngine *fe = new QFSFileEngine; | - |
46 | fileEngine = fe; | - |
47 | return fe->open(QIODevice::OpenMode(flags), fh, handleFlags); executed: return fe->open(QIODevice::OpenMode(flags), fh, handleFlags); Execution Count:31 | 31 |
48 | | - |
49 | } | - |
50 | | - |
51 | QAbstractFileEngine *QFilePrivate::engine() const | - |
52 | { | - |
53 | if (!fileEngine) evaluated: !fileEngine yes Evaluation Count:26726 | yes Evaluation Count:197807 |
| 26726-197807 |
54 | fileEngine = QAbstractFileEngine::create(fileName); executed: fileEngine = QAbstractFileEngine::create(fileName); Execution Count:26726 | 26726 |
55 | return fileEngine; executed: return fileEngine; Execution Count:224533 | 224533 |
56 | } | - |
57 | QFile::QFile() | - |
58 | : QFileDevice(*new QFilePrivate, 0) | - |
59 | { | - |
60 | } executed: } Execution Count:157 | 157 |
61 | | - |
62 | | - |
63 | | - |
64 | QFile::QFile(QObject *parent) | - |
65 | : QFileDevice(*new QFilePrivate, parent) | - |
66 | { | - |
67 | } executed: } Execution Count:1 | 1 |
68 | | - |
69 | | - |
70 | | - |
71 | QFile::QFile(const QString &name) | - |
72 | : QFileDevice(*new QFilePrivate, 0) | - |
73 | { | - |
74 | QFilePrivate * const d = d_func(); | - |
75 | d->fileName = name; | - |
76 | } executed: } Execution Count:25376 | 25376 |
77 | | - |
78 | | - |
79 | | - |
80 | | - |
81 | QFile::QFile(const QString &name, QObject *parent) | - |
82 | : QFileDevice(*new QFilePrivate, parent) | - |
83 | { | - |
84 | QFilePrivate * const d = d_func(); | - |
85 | d->fileName = name; | - |
86 | } executed: } Execution Count:1 | 1 |
87 | | - |
88 | | - |
89 | | - |
90 | QFile::QFile(QFilePrivate &dd, QObject *parent) | - |
91 | : QFileDevice(dd, parent) | - |
92 | { | - |
93 | } executed: } Execution Count:1485 | 1485 |
94 | | - |
95 | | - |
96 | | - |
97 | | - |
98 | | - |
99 | QFile::~QFile() | - |
100 | { | - |
101 | } | - |
102 | | - |
103 | | - |
104 | | - |
105 | | - |
106 | | - |
107 | | - |
108 | | - |
109 | QString QFile::fileName() const | - |
110 | { | - |
111 | const QFilePrivate * const d = d_func(); | - |
112 | return d->engine()->fileName(QAbstractFileEngine::DefaultName); executed: return d->engine()->fileName(QAbstractFileEngine::DefaultName); Execution Count:3159 | 3159 |
113 | } | - |
114 | void | - |
115 | QFile::setFileName(const QString &name) | - |
116 | { | - |
117 | QFilePrivate * const d = d_func(); | - |
118 | if (isOpen()) { partially evaluated: isOpen() no Evaluation Count:0 | yes Evaluation Count:1399 |
| 0-1399 |
119 | QMessageLogger("io/qfile.cpp", 319, __PRETTY_FUNCTION__).warning("QFile::setFileName: File (%s) is already opened", | - |
120 | QString(fileName()).toLocal8Bit().constData()); | - |
121 | close(); | - |
122 | } | 0 |
123 | if(d->fileEngine) { evaluated: d->fileEngine yes Evaluation Count:1291 | yes Evaluation Count:108 |
| 108-1291 |
124 | delete d->fileEngine; | - |
125 | d->fileEngine = 0; | - |
126 | } executed: } Execution Count:1291 | 1291 |
127 | d->fileName = name; | - |
128 | } executed: } Execution Count:1399 | 1399 |
129 | bool | - |
130 | QFile::exists() const | - |
131 | { | - |
132 | const QFilePrivate * const d = d_func(); | - |
133 | | - |
134 | return (d->engine()->fileFlags(QAbstractFileEngine::FlagsMask | 4952 |
135 | | QAbstractFileEngine::FileFlag(0x1000000)) & QAbstractFileEngine::ExistsFlag); executed: return (d->engine()->fileFlags(QAbstractFileEngine::FlagsMask | QAbstractFileEngine::FileFlag(0x1000000)) & QAbstractFileEngine::ExistsFlag); Execution Count:4952 | 4952 |
136 | } | - |
137 | | - |
138 | | - |
139 | | - |
140 | | - |
141 | | - |
142 | | - |
143 | bool | - |
144 | QFile::exists(const QString &fileName) | - |
145 | { | - |
146 | return QFileInfo(fileName).exists(); executed: return QFileInfo(fileName).exists(); Execution Count:3184 | 3184 |
147 | } | - |
148 | QString | - |
149 | QFile::readLink() const | - |
150 | { | - |
151 | const QFilePrivate * const d = d_func(); | - |
152 | return d->engine()->fileName(QAbstractFileEngine::LinkName); executed: return d->engine()->fileName(QAbstractFileEngine::LinkName); Execution Count:2 | 2 |
153 | } | - |
154 | QString | - |
155 | QFile::readLink(const QString &fileName) | - |
156 | { | - |
157 | return QFileInfo(fileName).readLink(); executed: return QFileInfo(fileName).readLink(); Execution Count:1 | 1 |
158 | } | - |
159 | bool | - |
160 | QFile::remove() | - |
161 | { | - |
162 | QFilePrivate * const d = d_func(); | - |
163 | if (d->fileName.isEmpty()) { partially evaluated: d->fileName.isEmpty() no Evaluation Count:0 | yes Evaluation Count:5495 |
| 0-5495 |
164 | QMessageLogger("io/qfile.cpp", 496, __PRETTY_FUNCTION__).warning("QFile::remove: Empty or null file name"); | - |
165 | return false; never executed: return false; | 0 |
166 | } | - |
167 | unsetError(); | - |
168 | close(); | - |
169 | if(error() == QFile::NoError) { partially evaluated: error() == QFile::NoError yes Evaluation Count:5495 | no Evaluation Count:0 |
| 0-5495 |
170 | if (d->engine()->remove()) { evaluated: d->engine()->remove() yes Evaluation Count:4879 | yes Evaluation Count:616 |
| 616-4879 |
171 | unsetError(); | - |
172 | return true; executed: return true; Execution Count:4879 | 4879 |
173 | } | - |
174 | d->setError(QFile::RemoveError, d->fileEngine->errorString()); | - |
175 | } executed: } Execution Count:616 | 616 |
176 | return false; executed: return false; Execution Count:616 | 616 |
177 | } | - |
178 | bool | - |
179 | QFile::remove(const QString &fileName) | - |
180 | { | - |
181 | return QFile(fileName).remove(); executed: return QFile(fileName).remove(); Execution Count:4325 | 4325 |
182 | } | - |
183 | bool | - |
184 | QFile::rename(const QString &newName) | - |
185 | { | - |
186 | QFilePrivate * const d = d_func(); | - |
187 | if (d->fileName.isEmpty()) { partially evaluated: d->fileName.isEmpty() no Evaluation Count:0 | yes Evaluation Count:211 |
| 0-211 |
188 | QMessageLogger("io/qfile.cpp", 549, __PRETTY_FUNCTION__).warning("QFile::rename: Empty or null file name"); | - |
189 | return false; never executed: return false; | 0 |
190 | } | - |
191 | if (d->fileName == newName) { evaluated: d->fileName == newName yes Evaluation Count:1 | yes Evaluation Count:210 |
| 1-210 |
192 | d->setError(QFile::RenameError, tr("Destination file is the same file.")); | - |
193 | return false; executed: return false; Execution Count:1 | 1 |
194 | } | - |
195 | if (!exists()) { evaluated: !exists() yes Evaluation Count:2 | yes Evaluation Count:208 |
| 2-208 |
196 | d->setError(QFile::RenameError, tr("Source file does not exist.")); | - |
197 | return false; executed: return false; Execution Count:2 | 2 |
198 | } | - |
199 | | - |
200 | | - |
201 | if (QFile::exists(newName) evaluated: QFile::exists(newName) yes Evaluation Count:4 | yes Evaluation Count:204 |
| 4-204 |
202 | && (d->fileName.compare(newName, Qt::CaseInsensitive) partially evaluated: d->fileName.compare(newName, Qt::CaseInsensitive) yes Evaluation Count:4 | no Evaluation Count:0 |
| 0-4 |
203 | || QFileSystemEngine::id(QFileSystemEntry(d->fileName)) != QFileSystemEngine::id(QFileSystemEntry(newName)))) { never evaluated: QFileSystemEngine::id(QFileSystemEntry(d->fileName)) != QFileSystemEngine::id(QFileSystemEntry(newName)) | 0 |
204 | | - |
205 | | - |
206 | | - |
207 | d->setError(QFile::RenameError, tr("Destination file exists")); | - |
208 | return false; executed: return false; Execution Count:4 | 4 |
209 | } | - |
210 | unsetError(); | - |
211 | close(); | - |
212 | if(error() == QFile::NoError) { partially evaluated: error() == QFile::NoError yes Evaluation Count:204 | no Evaluation Count:0 |
| 0-204 |
213 | if (d->engine()->rename(newName)) { evaluated: d->engine()->rename(newName) yes Evaluation Count:200 | yes Evaluation Count:4 |
| 4-200 |
214 | unsetError(); | - |
215 | | - |
216 | d->fileEngine->setFileName(newName); | - |
217 | d->fileName = newName; | - |
218 | return true; executed: return true; Execution Count:200 | 200 |
219 | } | - |
220 | | - |
221 | if (isSequential()) { partially evaluated: isSequential() no Evaluation Count:0 | yes Evaluation Count:4 |
| 0-4 |
222 | d->setError(QFile::RenameError, tr("Will not rename sequential file using block copy")); | - |
223 | return false; never executed: return false; | 0 |
224 | } | - |
225 | | - |
226 | QFile out(newName); | - |
227 | if (open(QIODevice::ReadOnly)) { partially evaluated: open(QIODevice::ReadOnly) yes Evaluation Count:4 | no Evaluation Count:0 |
| 0-4 |
228 | if (out.open(QIODevice::WriteOnly | QIODevice::Truncate)) { evaluated: out.open(QIODevice::WriteOnly | QIODevice::Truncate) yes Evaluation Count:1 | yes Evaluation Count:3 |
| 1-3 |
229 | bool error = false; | - |
230 | char block[4096]; | - |
231 | qint64 bytes; | - |
232 | while ((bytes = read(block, sizeof(block))) > 0) { evaluated: (bytes = read(block, sizeof(block))) > 0 yes Evaluation Count:1 | yes Evaluation Count:1 |
| 1 |
233 | if (bytes != out.write(block, bytes)) { partially evaluated: bytes != out.write(block, bytes) no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
234 | d->setError(QFile::RenameError, out.errorString()); | - |
235 | error = true; | - |
236 | break; | 0 |
237 | } | - |
238 | } executed: } Execution Count:1 | 1 |
239 | if (bytes == -1) { partially evaluated: bytes == -1 no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
240 | d->setError(QFile::RenameError, errorString()); | - |
241 | error = true; | - |
242 | } | 0 |
243 | if(!error) { partially evaluated: !error yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
244 | if (!remove()) { partially evaluated: !remove() yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
245 | d->setError(QFile::RenameError, tr("Cannot remove source file")); | - |
246 | error = true; | - |
247 | } executed: } Execution Count:1 | 1 |
248 | } executed: } Execution Count:1 | 1 |
249 | if (error) { partially evaluated: error yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
250 | out.remove(); | - |
251 | } else { executed: } Execution Count:1 | 1 |
252 | d->fileEngine->setFileName(newName); | - |
253 | setPermissions(permissions()); | - |
254 | unsetError(); | - |
255 | setFileName(newName); | - |
256 | } | 0 |
257 | close(); | - |
258 | return !error; executed: return !error; Execution Count:1 | 1 |
259 | } | - |
260 | close(); | - |
261 | } executed: } Execution Count:3 | 3 |
262 | d->setError(QFile::RenameError, out.isOpen() ? errorString() : out.errorString()); | - |
263 | } executed: } Execution Count:3 | 3 |
264 | return false; executed: return false; Execution Count:3 | 3 |
265 | } | - |
266 | bool | - |
267 | QFile::rename(const QString &oldName, const QString &newName) | - |
268 | { | - |
269 | return QFile(oldName).rename(newName); executed: return QFile(oldName).rename(newName); Execution Count:7 | 7 |
270 | } | - |
271 | bool | - |
272 | QFile::link(const QString &linkName) | - |
273 | { | - |
274 | QFilePrivate * const d = d_func(); | - |
275 | if (d->fileName.isEmpty()) { partially evaluated: d->fileName.isEmpty() no Evaluation Count:0 | yes Evaluation Count:145 |
| 0-145 |
276 | QMessageLogger("io/qfile.cpp", 667, __PRETTY_FUNCTION__).warning("QFile::link: Empty or null file name"); | - |
277 | return false; never executed: return false; | 0 |
278 | } | - |
279 | QFileInfo fi(linkName); | - |
280 | if (d->engine()->link(fi.absoluteFilePath())) { partially evaluated: d->engine()->link(fi.absoluteFilePath()) yes Evaluation Count:145 | no Evaluation Count:0 |
| 0-145 |
281 | unsetError(); | - |
282 | return true; executed: return true; Execution Count:145 | 145 |
283 | } | - |
284 | d->setError(QFile::RenameError, d->fileEngine->errorString()); | - |
285 | return false; never executed: return false; | 0 |
286 | } | - |
287 | bool | - |
288 | QFile::link(const QString &fileName, const QString &linkName) | - |
289 | { | - |
290 | return QFile(fileName).link(linkName); executed: return QFile(fileName).link(linkName); Execution Count:143 | 143 |
291 | } | - |
292 | bool | - |
293 | QFile::copy(const QString &newName) | - |
294 | { | - |
295 | QFilePrivate * const d = d_func(); | - |
296 | if (d->fileName.isEmpty()) { partially evaluated: d->fileName.isEmpty() no Evaluation Count:0 | yes Evaluation Count:101 |
| 0-101 |
297 | QMessageLogger("io/qfile.cpp", 713, __PRETTY_FUNCTION__).warning("QFile::copy: Empty or null file name"); | - |
298 | return false; never executed: return false; | 0 |
299 | } | - |
300 | if (QFile(newName).exists()) { evaluated: QFile(newName).exists() yes Evaluation Count:3 | yes Evaluation Count:98 |
| 3-98 |
301 | | - |
302 | | - |
303 | | - |
304 | d->setError(QFile::CopyError, tr("Destination file exists")); | - |
305 | return false; executed: return false; Execution Count:3 | 3 |
306 | } | - |
307 | unsetError(); | - |
308 | close(); | - |
309 | if(error() == QFile::NoError) { partially evaluated: error() == QFile::NoError yes Evaluation Count:98 | no Evaluation Count:0 |
| 0-98 |
310 | if (d->engine()->copy(newName)) { partially evaluated: d->engine()->copy(newName) no Evaluation Count:0 | yes Evaluation Count:98 |
| 0-98 |
311 | unsetError(); | - |
312 | return true; never executed: return true; | 0 |
313 | } else { | - |
314 | bool error = false; | - |
315 | if(!open(QFile::ReadOnly)) { evaluated: !open(QFile::ReadOnly) yes Evaluation Count:1 | yes Evaluation Count:97 |
| 1-97 |
316 | error = true; | - |
317 | d->setError(QFile::CopyError, tr("Cannot open %1 for input").arg(d->fileName)); | - |
318 | } else { executed: } Execution Count:1 | 1 |
319 | QString fileTemplate = QLatin1String("%1/qt_temp.XXXXXX"); | - |
320 | | - |
321 | | - |
322 | | - |
323 | | - |
324 | | - |
325 | QTemporaryFile out(fileTemplate.arg(QFileInfo(newName).path())); | - |
326 | if (!out.open()) { partially evaluated: !out.open() no Evaluation Count:0 | yes Evaluation Count:97 |
| 0-97 |
327 | out.setFileTemplate(fileTemplate.arg(QDir::tempPath())); | - |
328 | if (!out.open()) never evaluated: !out.open() | 0 |
329 | error = true; never executed: error = true; | 0 |
330 | } | 0 |
331 | | - |
332 | if (error) { partially evaluated: error no Evaluation Count:0 | yes Evaluation Count:97 |
| 0-97 |
333 | out.close(); | - |
334 | close(); | - |
335 | d->setError(QFile::CopyError, tr("Cannot open for output")); | - |
336 | } else { | 0 |
337 | char block[4096]; | - |
338 | qint64 totalRead = 0; | - |
339 | while(!atEnd()) { evaluated: !atEnd() yes Evaluation Count:771 | yes Evaluation Count:97 |
| 97-771 |
340 | qint64 in = read(block, sizeof(block)); | - |
341 | if (in <= 0) partially evaluated: in <= 0 no Evaluation Count:0 | yes Evaluation Count:771 |
| 0-771 |
342 | break; | 0 |
343 | totalRead += in; | - |
344 | if(in != out.write(block, in)) { partially evaluated: in != out.write(block, in) no Evaluation Count:0 | yes Evaluation Count:771 |
| 0-771 |
345 | close(); | - |
346 | d->setError(QFile::CopyError, tr("Failure to write block")); | - |
347 | error = true; | - |
348 | break; | 0 |
349 | } | - |
350 | } executed: } Execution Count:771 | 771 |
351 | | - |
352 | if (totalRead != size()) { partially evaluated: totalRead != size() no Evaluation Count:0 | yes Evaluation Count:97 |
| 0-97 |
353 | | - |
354 | | - |
355 | error = true; | - |
356 | } | 0 |
357 | if (!error && !out.rename(newName)) { partially evaluated: !error yes Evaluation Count:97 | no Evaluation Count:0 |
partially evaluated: !out.rename(newName) no Evaluation Count:0 | yes Evaluation Count:97 |
| 0-97 |
358 | error = true; | - |
359 | close(); | - |
360 | d->setError(QFile::CopyError, tr("Cannot create %1 for output").arg(newName)); | - |
361 | } | 0 |
362 | | - |
363 | | - |
364 | | - |
365 | | - |
366 | if (!error) partially evaluated: !error yes Evaluation Count:97 | no Evaluation Count:0 |
| 0-97 |
367 | out.setAutoRemove(false); executed: out.setAutoRemove(false); Execution Count:97 | 97 |
368 | | - |
369 | } executed: } Execution Count:97 | 97 |
370 | } | - |
371 | if(!error) { evaluated: !error yes Evaluation Count:97 | yes Evaluation Count:1 |
| 1-97 |
372 | QFile::setPermissions(newName, permissions()); | - |
373 | close(); | - |
374 | unsetError(); | - |
375 | return true; executed: return true; Execution Count:97 | 97 |
376 | } | - |
377 | } executed: } Execution Count:1 | 1 |
378 | } | - |
379 | return false; executed: return false; Execution Count:1 | 1 |
380 | } | - |
381 | bool | - |
382 | QFile::copy(const QString &fileName, const QString &newName) | - |
383 | { | - |
384 | return QFile(fileName).copy(newName); executed: return QFile(fileName).copy(newName); Execution Count:92 | 92 |
385 | } | - |
386 | bool QFile::open(OpenMode mode) | - |
387 | { | - |
388 | QFilePrivate * const d = d_func(); | - |
389 | if (isOpen()) { partially evaluated: isOpen() no Evaluation Count:0 | yes Evaluation Count:21302 |
| 0-21302 |
390 | QMessageLogger("io/qfile.cpp", 834, __PRETTY_FUNCTION__).warning("QFile::open: File (%s) already open", QString(fileName()).toLocal8Bit().constData()); | - |
391 | return false; never executed: return false; | 0 |
392 | } | - |
393 | if (mode & Append) evaluated: mode & Append yes Evaluation Count:248 | yes Evaluation Count:21054 |
| 248-21054 |
394 | mode |= WriteOnly; executed: mode |= WriteOnly; Execution Count:248 | 248 |
395 | | - |
396 | unsetError(); | - |
397 | if ((mode & (ReadOnly | WriteOnly)) == 0) { partially evaluated: (mode & (ReadOnly | WriteOnly)) == 0 no Evaluation Count:0 | yes Evaluation Count:21302 |
| 0-21302 |
398 | QMessageLogger("io/qfile.cpp", 842, __PRETTY_FUNCTION__).warning("QIODevice::open: File access not specified"); | - |
399 | return false; never executed: return false; | 0 |
400 | } | - |
401 | | - |
402 | | - |
403 | if (d->engine()->open(mode | QIODevice::Unbuffered)) { evaluated: d->engine()->open(mode | QIODevice::Unbuffered) yes Evaluation Count:18007 | yes Evaluation Count:3296 |
| 3296-18007 |
404 | QIODevice::open(mode); | - |
405 | if (mode & Append) evaluated: mode & Append yes Evaluation Count:247 | yes Evaluation Count:17759 |
| 247-17759 |
406 | seek(size()); executed: seek(size()); Execution Count:247 | 247 |
407 | return true; executed: return true; Execution Count:18006 | 18006 |
408 | } | - |
409 | QFile::FileError err = d->fileEngine->error(); | - |
410 | if(err == QFile::UnspecifiedError) evaluated: err == QFile::UnspecifiedError yes Evaluation Count:204 | yes Evaluation Count:3092 |
| 204-3092 |
411 | err = QFile::OpenError; executed: err = QFile::OpenError; Execution Count:204 | 204 |
412 | d->setError(err, d->fileEngine->errorString()); | - |
413 | return false; executed: return false; Execution Count:3296 | 3296 |
414 | } | - |
415 | bool QFile::open(FILE *fh, OpenMode mode, FileHandleFlags handleFlags) | - |
416 | { | - |
417 | QFilePrivate * const d = d_func(); | - |
418 | if (isOpen()) { partially evaluated: isOpen() no Evaluation Count:0 | yes Evaluation Count:31 |
| 0-31 |
419 | QMessageLogger("io/qfile.cpp", 908, __PRETTY_FUNCTION__).warning("QFile::open: File (%s) already open", QString(fileName()).toLocal8Bit().constData()); | - |
420 | return false; never executed: return false; | 0 |
421 | } | - |
422 | if (mode & Append) partially evaluated: mode & Append no Evaluation Count:0 | yes Evaluation Count:31 |
| 0-31 |
423 | mode |= WriteOnly; never executed: mode |= WriteOnly; | 0 |
424 | unsetError(); | - |
425 | if ((mode & (ReadOnly | WriteOnly)) == 0) { partially evaluated: (mode & (ReadOnly | WriteOnly)) == 0 no Evaluation Count:0 | yes Evaluation Count:31 |
| 0-31 |
426 | QMessageLogger("io/qfile.cpp", 915, __PRETTY_FUNCTION__).warning("QFile::open: File access not specified"); | - |
427 | return false; never executed: return false; | 0 |
428 | } | - |
429 | if (d->openExternalFile(mode, fh, handleFlags)) { partially evaluated: d->openExternalFile(mode, fh, handleFlags) yes Evaluation Count:31 | no Evaluation Count:0 |
| 0-31 |
430 | QIODevice::open(mode); | - |
431 | if (!(mode & Append) && !isSequential()) { partially evaluated: !(mode & Append) yes Evaluation Count:31 | no Evaluation Count:0 |
evaluated: !isSequential() yes Evaluation Count:27 | yes Evaluation Count:4 |
| 0-31 |
432 | qint64 pos = (qint64)::ftello64(fh); | - |
433 | if (pos != -1) { partially evaluated: pos != -1 yes Evaluation Count:27 | no Evaluation Count:0 |
| 0-27 |
434 | | - |
435 | QIODevice::seek(pos); | - |
436 | } executed: } Execution Count:27 | 27 |
437 | } executed: } Execution Count:27 | 27 |
438 | return true; executed: return true; Execution Count:31 | 31 |
439 | } | - |
440 | return false; never executed: return false; | 0 |
441 | } | - |
442 | bool QFile::open(int fd, OpenMode mode, FileHandleFlags handleFlags) | - |
443 | { | - |
444 | QFilePrivate * const d = d_func(); | - |
445 | if (isOpen()) { partially evaluated: isOpen() no Evaluation Count:0 | yes Evaluation Count:30 |
| 0-30 |
446 | QMessageLogger("io/qfile.cpp", 967, __PRETTY_FUNCTION__).warning("QFile::open: File (%s) already open", QString(fileName()).toLocal8Bit().constData()); | - |
447 | return false; never executed: return false; | 0 |
448 | } | - |
449 | if (mode & Append) partially evaluated: mode & Append no Evaluation Count:0 | yes Evaluation Count:30 |
| 0-30 |
450 | mode |= WriteOnly; never executed: mode |= WriteOnly; | 0 |
451 | unsetError(); | - |
452 | if ((mode & (ReadOnly | WriteOnly)) == 0) { partially evaluated: (mode & (ReadOnly | WriteOnly)) == 0 no Evaluation Count:0 | yes Evaluation Count:30 |
| 0-30 |
453 | QMessageLogger("io/qfile.cpp", 974, __PRETTY_FUNCTION__).warning("QFile::open: File access not specified"); | - |
454 | return false; never executed: return false; | 0 |
455 | } | - |
456 | if (d->openExternalFile(mode, fd, handleFlags)) { partially evaluated: d->openExternalFile(mode, fd, handleFlags) yes Evaluation Count:30 | no Evaluation Count:0 |
| 0-30 |
457 | QIODevice::open(mode); | - |
458 | if (!(mode & Append) && !isSequential()) { partially evaluated: !(mode & Append) yes Evaluation Count:30 | no Evaluation Count:0 |
evaluated: !isSequential() yes Evaluation Count:24 | yes Evaluation Count:6 |
| 0-30 |
459 | qint64 pos = (qint64)::lseek64(fd, off64_t(0), 1); | - |
460 | if (pos != -1) { partially evaluated: pos != -1 yes Evaluation Count:24 | no Evaluation Count:0 |
| 0-24 |
461 | | - |
462 | QIODevice::seek(pos); | - |
463 | } executed: } Execution Count:24 | 24 |
464 | } executed: } Execution Count:24 | 24 |
465 | return true; executed: return true; Execution Count:30 | 30 |
466 | } | - |
467 | return false; never executed: return false; | 0 |
468 | } | - |
469 | | - |
470 | | - |
471 | | - |
472 | | - |
473 | bool QFile::resize(qint64 sz) | - |
474 | { | - |
475 | return QFileDevice::resize(sz); executed: return QFileDevice::resize(sz); Execution Count:773 | 773 |
476 | } | - |
477 | bool | - |
478 | QFile::resize(const QString &fileName, qint64 sz) | - |
479 | { | - |
480 | return QFile(fileName).resize(sz); executed: return QFile(fileName).resize(sz); Execution Count:3 | 3 |
481 | } | - |
482 | | - |
483 | | - |
484 | | - |
485 | | - |
486 | QFile::Permissions QFile::permissions() const | - |
487 | { | - |
488 | return QFileDevice::permissions(); executed: return QFileDevice::permissions(); Execution Count:226 | 226 |
489 | } | - |
490 | QFile::Permissions | - |
491 | QFile::permissions(const QString &fileName) | - |
492 | { | - |
493 | return QFile(fileName).permissions(); executed: return QFile(fileName).permissions(); Execution Count:9 | 9 |
494 | } | - |
495 | bool QFile::setPermissions(Permissions permissions) | - |
496 | { | - |
497 | return QFileDevice::setPermissions(permissions); executed: return QFileDevice::setPermissions(permissions); Execution Count:515 | 515 |
498 | } | - |
499 | | - |
500 | | - |
501 | | - |
502 | | - |
503 | | - |
504 | | - |
505 | | - |
506 | bool | - |
507 | QFile::setPermissions(const QString &fileName, Permissions permissions) | - |
508 | { | - |
509 | return QFile(fileName).setPermissions(permissions); executed: return QFile(fileName).setPermissions(permissions); Execution Count:119 | 119 |
510 | } | - |
511 | | - |
512 | | - |
513 | | - |
514 | | - |
515 | qint64 QFile::size() const | - |
516 | { | - |
517 | return QFileDevice::size(); executed: return QFileDevice::size(); Execution Count:123885 | 123885 |
518 | } | - |
519 | | - |
520 | | - |
521 | | - |
| | |