swift
|
A subclass of QFile which writes to a temporary file while it is open, then renames the file when it is closed, so that it overwrites the target file as a single, atomic transaction. More...
Public Member Functions | |
CAtomicFile (const QString &filename) | |
virtual | ~CAtomicFile () |
virtual bool | open (OpenMode mode) |
virtual void | close () |
bool | checkedClose () |
Calls close() and returns false if there was an error at any stage. | |
void | abandon () |
Closes the file without renaming it. | |
FileError | error () const |
void | unsetError () |
A subclass of QFile which writes to a temporary file while it is open, then renames the file when it is closed, so that it overwrites the target file as a single, atomic transaction.
If the application crashes while data is still being written, the original file is unchanged.
Definition at line 25 of file atomicfile.h.
|
inline |
Definition at line 31 of file atomicfile.h.
|
virtual |
Definition at line 68 of file atomicfile.cpp.
|
virtual |
After closing the file, it is renamed so that it overwrites the target file.
Definition at line 73 of file atomicfile.cpp.
CAtomicFile::FileError swift::misc::CAtomicFile::error | ( | ) | const |
Definition at line 102 of file atomicfile.cpp.
|
virtual |
Just before opening the file, the filename is changed so we actually write to a temporary file.
Definition at line 44 of file atomicfile.cpp.
void swift::misc::CAtomicFile::unsetError | ( | ) |
Definition at line 109 of file atomicfile.cpp.