• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdecore
 

tdecore

  • tdecore
ksavefile.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 _KSAVEFILE_H_
21#define _KSAVEFILE_H_
22
23#include <tqstring.h>
24#include <stdio.h>
25#include <errno.h>
26#include <tdetempfile.h>
27
28class KSaveFilePrivate;
29
41class TDECORE_EXPORT KSaveFile
42{
43public:
49 KSaveFile(const TQString &filename, int mode = 0666 );
50
55 ~KSaveFile();
56
68 int status() const
69 { return mTempFile.status(); }
70
76 TQString name() const;
77
83 int handle() const
84 { return mTempFile.handle(); }
85
91 FILE *fstream()
92 { return mTempFile.fstream(); }
93
99 TQFile *file()
100 { return mTempFile.file(); }
101
107 TQTextStream *textStream()
108 { return mTempFile.textStream(); }
109
115 TQDataStream *dataStream()
116 { return mTempFile.dataStream(); }
117
122 void abort();
123
130 bool close();
131
141 static bool backupFile( const TQString& filename,
142 const TQString& backupDir = TQString::null,
143 const TQString& backupExtension = TQString::fromLatin1( "~" ) );
144
145private:
146 TQString mFileName;
147 KTempFile mTempFile;
148
149 KSaveFilePrivate *d;
150};
151
152#endif
KSaveFile
The KSaveFile class has been made to write out changes to an existing file atomically.
Definition: ksavefile.h:42
KSaveFile::dataStream
TQDataStream * dataStream()
A TQDataStream* open for writing to the file.
Definition: ksavefile.h:115
KSaveFile::file
TQFile * file()
A TQFile* open for writing to the file.
Definition: ksavefile.h:99
KSaveFile::status
int status() const
Returns the status of the file based on errno.
Definition: ksavefile.h:68
KSaveFile::fstream
FILE * fstream()
A FILE* stream open for writing to the file.
Definition: ksavefile.h:91
KSaveFile::handle
int handle() const
An integer file descriptor open for writing to the file.
Definition: ksavefile.h:83
KSaveFile::textStream
TQTextStream * textStream()
A TQTextStream* open for writing to the file.
Definition: ksavefile.h:107
KTempFile
The KTempFile class creates and opens a unique file for temporary use.
Definition: tdetempfile.h:56

tdecore

Skip menu "tdecore"
  • Main Page
  • Modules
  • 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
Generated for tdecore by doxygen 1.9.4
This website is maintained by Timothy Pearson.