Skip to content
Skip to link menu
Trinity API Reference
Trinity API Reference
tdecore
tdecore
tdecore
tdetempfile.h
1
/*
2
This file is part of the KDE libraries
3
Copyright (c) 1999 Waldo Bastian <bastian@kde.org>
4
5
This library is free software; you can redistribute it and/or
6
modify it under the terms of the GNU Library General Public
7
License version 2 as published by the Free Software Foundation.
8
9
This library is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
Library General Public License for more details.
13
14
You should have received a copy of the GNU Library General Public License
15
along with this library; see the file COPYING.LIB. If not, write to
16
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17
Boston, MA 02110-1301, USA.
18
*/
19
20
#ifndef _TDETEMPFILE_H_
21
#define _TDETEMPFILE_H_
22
23
#include <tqstring.h>
24
#include <stdio.h>
25
#include <errno.h>
26
#include "tdelibs_export.h"
27
28
class
TQFile;
29
class
TQTextStream;
30
class
TQDataStream;
31
class
KSaveFile
;
32
class
KTempFilePrivate;
33
55
class
TDECORE_EXPORT
KTempFile
56
{
57
friend
class
KSaveFile
;
58
public
:
71
KTempFile
(TQString filePrefix=TQString::null,
72
TQString fileExtension=TQString::null,
73
int
mode = 0600 );
74
75
80
~KTempFile
();
81
87
void
setAutoDelete
(
bool
autoDelete) { bAutoDelete = autoDelete; }
88
100
int
status()
const
;
101
122
TQString name()
const
;
123
129
int
handle()
const
;
130
136
FILE *fstream();
137
143
TQTextStream *textStream();
144
150
TQDataStream *dataStream();
151
157
TQFile *file();
158
163
void
unlink();
164
175
bool
sync();
176
183
bool
close();
184
185
protected
:
189
KTempFile
(
bool
);
190
195
bool
create(
const
TQString &filePrefix,
196
const
TQString &fileExtension,
int
mode);
197
198
void
setError(
int
error) { mError = error; }
199
private
:
200
int
mError;
201
TQString mTmpName;
202
int
mFd;
203
FILE *mStream;
204
TQFile *mFile;
205
TQTextStream *mTextStream;
206
TQDataStream *mDataStream;
207
bool
bOpen;
208
bool
bAutoDelete;
209
210
KTempFilePrivate *d;
211
};
212
213
#endif
KSaveFile
The KSaveFile class has been made to write out changes to an existing file atomically.
Definition
ksavefile.h:42
KTempFile
The KTempFile class creates and opens a unique file for temporary use.
Definition
tdetempfile.h:56
KTempFile::setAutoDelete
void setAutoDelete(bool autoDelete)
Turn automatic deletion on or off.
Definition
tdetempfile.h:87
tdecore
Skip menu "tdecore"
Main Page
Namespace List
Class Hierarchy
Alphabetical List
Class List
File List
Namespace Members
Class Members
Related Pages
tdecore
Skip menu "tdecore"
arts
dcop
dnssd
interfaces
kspeech
interface
library
tdetexteditor
kate
kded
kdoctools
kimgio
kjs
libtdemid
libtdescreensaver
tdeabc
tdecmshell
tdecore
tdefx
tdehtml
tdeinit
tdeio
bookmarks
httpfilter
kpasswdserver
kssl
tdefile
tdeio
tdeioexec
tdeioslave
http
tdemdi
tdemdi
tdenewstuff
tdeparts
tdeprint
tderandr
tderesources
tdespell2
tdesu
tdeui
tdeunittest
tdeutils
tdewallet