KDELibs4Support

ksavefile.h
1 /*
2  This file is part of the KDE libraries
3  Copyright 1999 Waldo Bastian <[email protected]>
4  Copyright 2006 Jaison Lee <[email protected]>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License version 2 as published by the Free Software Foundation.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Library General Public License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to
17  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  Boston, MA 02110-1301, USA.
19 */
20 
21 #ifndef KSAVEFILE_H
22 #define KSAVEFILE_H
23 
24 #include <kdelibs4support_export.h>
25 
26 #include "kbackup.h"
27 
28 #include <QFile>
29 #include <QString>
30 
98 class KDELIBS4SUPPORT_DEPRECATED_EXPORT KSaveFile : public QFile
99 {
100 public:
104  KSaveFile();
105 
111  KDELIBS4SUPPORT_DEPRECATED explicit KSaveFile(const QString &filename);
112 
119  virtual ~KSaveFile();
120 
127  void setFileName(const QString &filename);
128 
135  QString fileName() const override;
136 
142  QFile::FileError error() const;
143 
150  QString errorString() const;
151 
163  bool open(OpenMode flags = QIODevice::ReadWrite) override;
164 
170  void abort();
171 
177  bool finalize();
178 
203  void setDirectWriteFallback(bool enabled);
204 
211  bool directWriteFallback() const;
212 
213 private:
214  Q_DISABLE_COPY(KSaveFile)
215 
216  class Private;
217  Private *const d;
218 };
219 
220 #endif
QString errorString() const const
QFileDevice::FileError error() const const
virtual QString fileName() const const override
Class to allow for atomic file I/O, as well as utility functions.
Definition: ksavefile.h:98
void setFileName(const QString &name)
virtual bool open(QIODevice::OpenMode mode) override
Q_DISABLE_COPY(Class)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jul 6 2020 22:57:52 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.