Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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
4#ifndef QTEMPORARYDIR_H
5#define QTEMPORARYDIR_H
6
7#include <QtCore/qglobal.h>
8#include <QtCore/qdir.h>
9#include <QtCore/qscopedpointer.h>
10
12
13
14#if QT_CONFIG(temporaryfile)
15
16class QTemporaryDirPrivate;
17
18class Q_CORE_EXPORT QTemporaryDir
19{
20public:
21 QTemporaryDir();
22 explicit QTemporaryDir(const QString &templateName);
23 QTemporaryDir(QTemporaryDir &&other) noexcept
24 : d_ptr{std::exchange(other.d_ptr, nullptr)}
25 { }
26
27 QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_MOVE_AND_SWAP(QTemporaryDir)
28
29 ~QTemporaryDir();
30
31 void swap(QTemporaryDir &other) noexcept
32 { qt_ptr_swap(d_ptr, other.d_ptr); }
33
34 bool isValid() const;
35 QString errorString() const;
36
37 bool autoRemove() const;
38 void setAutoRemove(bool b);
39 bool remove();
40
41 QString path() const;
42 QString filePath(const QString &fileName) const;
43
44private:
45 QTemporaryDirPrivate *d_ptr;
46
47 Q_DISABLE_COPY(QTemporaryDir)
48};
49
50inline void swap(QTemporaryDir &lhs, QTemporaryDir &rhs) noexcept
51{
52 lhs.swap(rhs);
53}
54
55#endif // QT_CONFIG(temporaryfile)
56
58
59#endif // QTEMPORARYDIR_H
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
Combined button and popup list for selecting options.
Q_MULTIMEDIA_EXPORT QString errorString(HRESULT hr)
GLboolean GLboolean GLboolean b
GLsizei const GLchar *const * path
constexpr void qt_ptr_swap(T *&lhs, T *&rhs) noexcept
Definition qswap.h:29
settings remove("monkey")
QSharedPointer< T > other(t)
[5]
this swap(other)