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
qtemporarydir.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 QTEMPORARYDIR_H
6#define QTEMPORARYDIR_H
7
8#include <QtCore/qglobal.h>
9#include <QtCore/qdir.h>
10#include <QtCore/qscopedpointer.h>
11
13
14
15#if QT_CONFIG(temporaryfile)
16
18
20{
21public:
23 explicit QTemporaryDir(const QString &templateName);
25 : d_ptr{std::exchange(other.d_ptr, nullptr)}
26 { }
27
29
31
32 void swap(QTemporaryDir &other) noexcept
34
35 bool isValid() const;
36 QString errorString() const;
37
38 bool autoRemove() const;
39 void setAutoRemove(bool b);
40 bool remove();
41
42 QString path() const;
43 QString filePath(const QString &fileName) const;
44
45private:
47
49};
50
51inline void swap(QTemporaryDir &lhs, QTemporaryDir &rhs) noexcept
52{
53 lhs.swap(rhs);
54}
55
56#endif // QT_CONFIG(temporaryfile)
57
59
60#endif // QTEMPORARYDIR_H
\inmodule QtSql