|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.kde.koala.KSaveFile
public class KSaveFile
The KSaveFile class has been made to write out changes to an existing file atomically. This means that EITHER: a) All changes have been written successfully to the file. b) Some error occurred, no changes have been written whatsoever and the old file is still in place.
Constructor Summary | |
---|---|
protected |
KSaveFile(java.lang.Class dummy)
|
|
KSaveFile(java.lang.String filename)
|
|
KSaveFile(java.lang.String filename,
int mode)
Creates a new KSaveFile with the given file name. |
Method Summary | |
---|---|
void |
abort()
Aborts the write operation and removes any intermediate files This implies a close. |
static boolean |
backupFile(java.lang.String filename)
|
static boolean |
backupFile(java.lang.String filename,
java.lang.String backupDir)
|
static boolean |
backupFile(java.lang.String filename,
java.lang.String backupDir,
java.lang.String backupExtension)
Static method to create a backup file before saving. |
boolean |
close()
Closes the file and makes the changes definitive. |
org.kde.qt.QDataStream |
dataStream()
A QDataStream open for writing to the file. |
void |
dispose()
Delete the wrapped C++ instance ahead of finalize() |
org.kde.qt.QFile |
file()
A QFile open for writing to the file. |
protected void |
finalize()
Deletes the wrapped C++ instance |
int |
handle()
An integer file descriptor open for writing to the file. |
boolean |
isDisposed()
Has the wrapped C++ instance been deleted? |
java.lang.String |
name()
The name of the file as passed to the constructor. |
int |
status()
Returns the status of the file based on errno. |
org.kde.qt.QTextStream |
textStream()
A QTextStream open for writing to the file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected KSaveFile(java.lang.Class dummy)
public KSaveFile(java.lang.String filename, int mode)
filename
- the path of the filemode
- the mode of the file (see chmod(1))public KSaveFile(java.lang.String filename)
Method Detail |
---|
public int status()
public java.lang.String name()
public int handle()
public org.kde.qt.QFile file()
public org.kde.qt.QTextStream textStream()
public org.kde.qt.QDataStream dataStream()
public void abort()
public boolean close()
public static boolean backupFile(java.lang.String filename, java.lang.String backupDir, java.lang.String backupExtension)
filename
- the file to backupbackupDir
- optional directory where to save the backup file in.
If empty (the default), the backup will be in the same directory as filename.
backupExtension
- the extension to append to filename
, "~" by default.public static boolean backupFile(java.lang.String filename, java.lang.String backupDir)
public static boolean backupFile(java.lang.String filename)
protected void finalize() throws java.lang.InternalError
finalize
in class java.lang.Object
java.lang.InternalError
public void dispose()
public boolean isDisposed()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |