Transactional librepcb::FileSystem implementation.
More...
#include <transactionalfilesystem.h>
Transactional librepcb::FileSystem implementation.
This is an implementation of the librepcb::FileSystem interface with many features needed to create, open and save LibrePCB library elements and projects in a very safe way to always guarantee consistency of all files.
It handles following things:
◆ RestoreCallback
Callback type used to determine whether a backup should be restored or not.
- Parameters
-
dir | The directory to be restored. |
- Return values
-
true | Restore backup. |
false | Do not restore backup. |
- Exceptions
-
◆ TransactionalFileSystem() [1/3]
◆ TransactionalFileSystem() [2/3]
◆ TransactionalFileSystem() [3/3]
◆ ~TransactionalFileSystem()
◆ getPath()
◆ isWritable()
bool isWritable |
( |
| ) |
const |
|
inlinenoexcept |
◆ isRestoredFromAutosave()
bool isRestoredFromAutosave |
( |
| ) |
const |
|
inlinenoexcept |
◆ getAbsPath()
FilePath getAbsPath |
( |
const QString & |
path = "" | ) |
const |
|
overridevirtualnoexcept |
◆ getDirs()
QStringList getDirs |
( |
const QString & |
path = "" | ) |
const |
|
overridevirtualnoexcept |
◆ getFiles()
QStringList getFiles |
( |
const QString & |
path = "" | ) |
const |
|
overridevirtualnoexcept |
◆ fileExists()
bool fileExists |
( |
const QString & |
path | ) |
const |
|
overridevirtualnoexcept |
◆ read()
QByteArray read |
( |
const QString & |
path | ) |
const |
|
overridevirtual |
◆ write()
void write |
( |
const QString & |
path, |
|
|
const QByteArray & |
content |
|
) |
| |
|
overridevirtual |
◆ removeFile()
void removeFile |
( |
const QString & |
path | ) |
|
|
overridevirtual |
◆ removeDirRecursively()
void removeDirRecursively |
( |
const QString & |
path = "" | ) |
|
|
overridevirtual |
◆ loadFromZip() [1/2]
void loadFromZip |
( |
QByteArray |
content | ) |
|
◆ loadFromZip() [2/2]
◆ exportToZip() [1/2]
QByteArray exportToZip |
( |
| ) |
const |
◆ exportToZip() [2/2]
void exportToZip |
( |
const FilePath & |
fp | ) |
const |
◆ discardChanges()
◆ checkForModifications()
QStringList checkForModifications |
( |
| ) |
const |
◆ autosave()
◆ save()
◆ open()
◆ openRO()
◆ openRW()
◆ cleanPath()
QString cleanPath |
( |
QString |
path | ) |
|
|
staticnoexcept |
◆ isRemoved()
bool isRemoved |
( |
const QString & |
path | ) |
const |
|
privatenoexcept |
◆ exportDirToZip()
void exportDirToZip |
( |
QuaZipFile & |
file, |
|
|
const FilePath & |
zipFp, |
|
|
const QString & |
dir |
|
) |
| const |
|
private |
◆ saveDiff()
void saveDiff |
( |
const QString & |
type | ) |
const |
|
private |
◆ loadDiff()
◆ removeDiff()
void removeDiff |
( |
const QString & |
type | ) |
|
|
private |
◆ mFilePath
◆ mIsWritable
◆ mLock
◆ mRestoredFromAutosave
bool mRestoredFromAutosave |
|
private |
◆ mModifiedFiles
QHash<QString, QByteArray> mModifiedFiles |
|
private |
◆ mRemovedFiles
QSet<QString> mRemovedFiles |
|
private |
◆ mRemovedDirs
QSet<QString> mRemovedDirs |
|
private |
The documentation for this class was generated from the following files: