File indexing completed on 2025-01-18 10:07:39
0001
0002
0003
0004 #ifndef QTEMPORARYDIR_H
0005 #define QTEMPORARYDIR_H
0006
0007 #include <QtCore/qglobal.h>
0008 #include <QtCore/qdir.h>
0009 #include <QtCore/qscopedpointer.h>
0010
0011 QT_BEGIN_NAMESPACE
0012
0013
0014 #ifndef QT_NO_TEMPORARYFILE
0015
0016 class QTemporaryDirPrivate;
0017
0018 class Q_CORE_EXPORT QTemporaryDir
0019 {
0020 public:
0021 QTemporaryDir();
0022 explicit QTemporaryDir(const QString &templateName);
0023 QTemporaryDir(QTemporaryDir &&other) noexcept
0024 : d_ptr{std::exchange(other.d_ptr, nullptr)}
0025 { }
0026
0027 QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_MOVE_AND_SWAP(QTemporaryDir)
0028
0029 ~QTemporaryDir();
0030
0031 void swap(QTemporaryDir &other) noexcept
0032 { qt_ptr_swap(d_ptr, other.d_ptr); }
0033
0034 bool isValid() const;
0035 QString errorString() const;
0036
0037 bool autoRemove() const;
0038 void setAutoRemove(bool b);
0039 bool remove();
0040
0041 QString path() const;
0042 QString filePath(const QString &fileName) const;
0043
0044 private:
0045 QTemporaryDirPrivate *d_ptr;
0046
0047 Q_DISABLE_COPY(QTemporaryDir)
0048 };
0049
0050 inline void swap(QTemporaryDir &lhs, QTemporaryDir &rhs) noexcept
0051 {
0052 lhs.swap(rhs);
0053 }
0054
0055 #endif
0056
0057 QT_END_NAMESPACE
0058
0059 #endif