KDE3Support
k3tempfile.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef K3TEMPFILE_H
00021 #define K3TEMPFILE_H
00022
00023 #include <kde3support_export.h>
00024 #include <QtCore/QString>
00025 #include <stdio.h>
00026
00027 class QFile;
00028 class QTextStream;
00029 class QDataStream;
00030 class KSaveFile;
00031
00055 class KDE3SUPPORT_EXPORT K3TempFile
00056 {
00057 friend class KSaveFile;
00058 public:
00071 explicit K3TempFile(const QString& filePrefix=QString(),
00072 const QString& fileExtension=QString(),
00073 int mode = 0600 );
00074
00079 ~K3TempFile();
00080
00086 void setAutoDelete(bool autoDelete);
00087
00099 int status() const;
00100
00122 QString name() const;
00123
00129 int handle() const;
00130
00136 FILE *fstream();
00137
00143 QTextStream *textStream();
00144
00150 QDataStream *dataStream();
00151
00157 QFile *file();
00158
00163 void unlink();
00164
00174 bool sync();
00175
00182 bool close();
00183
00184 protected:
00188 explicit K3TempFile(bool);
00189
00197 bool create(const QString &filePrefix,
00198 const QString &fileExtension, int mode);
00199
00207 void setError(int error);
00213 bool isOpen() const;
00214 private:
00215
00216 Q_DISABLE_COPY(K3TempFile)
00217
00218 class Private;
00219 Private * const d;
00220 };
00221
00222 #endif