libquentier 0.5.0
The library for rich desktop clients of Evernote service
Loading...
Searching...
No Matches
Signals | Public Member Functions | Protected Member Functions | Friends | List of all members
quentier::ILocalStoragePatch Class Referenceabstract

The ILocalStoragePatch class represents the interface for patches of local storage. Each such patch somehow changes the layout of local storage persistence so that only compliant & corresponding versions of libquentier can be used to work with it. More...

#include <ILocalStoragePatch.h>

Inheritance diagram for quentier::ILocalStoragePatch:
Inheritance graph
[legend]
Collaboration diagram for quentier::ILocalStoragePatch:
Collaboration graph
[legend]

Signals

void progress (double progress)
 
void backupProgress (double progress)
 
void restoreBackupProgress (double progress)
 

Public Member Functions

virtual int fromVersion () const =0
 
virtual int toVersion () const =0
 
virtual QString patchShortDescription () const =0
 
virtual QString patchLongDescription () const =0
 
virtual bool backupLocalStorage (ErrorString &errorDescription)=0
 
virtual bool restoreLocalStorageFromBackup (ErrorString &errorDescription)=0
 
virtual bool removeLocalStorageBackup (ErrorString &errorDescription)=0
 
virtual bool apply (ErrorString &errorDescription)=0
 

Protected Member Functions

 ILocalStoragePatch (QObject *parent=nullptr)
 

Friends

class LocalStorageDatabaseUpgrader
 

Detailed Description

The ILocalStoragePatch class represents the interface for patches of local storage. Each such patch somehow changes the layout of local storage persistence so that only compliant & corresponding versions of libquentier can be used to work with it.

Member Function Documentation

◆ apply()

virtual bool quentier::ILocalStoragePatch::apply ( ErrorString errorDescription)
pure virtual

Apply the patch to local storage

Parameters
errorDescriptionThe textual description of the error in case of patch application failure
Returns
True in case of successful patch application, false otherwise

◆ backupLocalStorage()

virtual bool quentier::ILocalStoragePatch::backupLocalStorage ( ErrorString errorDescription)
pure virtual

Backup either the entire local storage or its parts affected by the particular patch, should be called before applying the patch (but can be skipped if not desired).

Parameters
errorDescriptionThe textual description of the error in case of backup preparation failure
Returns
True if the local storage was backed up for the patch successfully, false otherwise

◆ backupProgress

void quentier::ILocalStoragePatch::backupProgress ( double  progress)
signal

Local storage backup preparation progress

Parameters
progressBackup preparation progress value, from 0 to 1

◆ fromVersion()

virtual int quentier::ILocalStoragePatch::fromVersion ( ) const
pure virtual
Returns
Version of local storage to which the patch needs to be applied

◆ patchLongDescription()

virtual QString quentier::ILocalStoragePatch::patchLongDescription ( ) const
pure virtual
Returns
Long i.e. detailed description of the patch

◆ patchShortDescription()

virtual QString quentier::ILocalStoragePatch::patchShortDescription ( ) const
pure virtual
Returns
Short description of the patch

◆ progress

void quentier::ILocalStoragePatch::progress ( double  progress)
signal

Patch application progress signal

Parameters
progressPatch application progress value, from 0 to 1

◆ removeLocalStorageBackup()

virtual bool quentier::ILocalStoragePatch::removeLocalStorageBackup ( ErrorString errorDescription)
pure virtual

Remove the previously made backup of local storage, presumably after successful application of the patch so the backup is no longer needed. It won't work if no backup was made before applying a patch, obviously.

Parameters
errorDescriptionThe textual description of the error in case of failure to remove the local storage backup
Returns
True if local storage backup was successfully removed, false otherwise

◆ restoreBackupProgress

void quentier::ILocalStoragePatch::restoreBackupProgress ( double  progress)
signal

Local storage restoration from backup progress

Parameters
progressLocal storage restoration from backup progress value, from 0 to 1

◆ restoreLocalStorageFromBackup()

virtual bool quentier::ILocalStoragePatch::restoreLocalStorageFromBackup ( ErrorString errorDescription)
pure virtual

Restore local storage from previously made backup, presumably after the failed attempt to apply a patch. Won't work if no backup was made before applying a patch, obviously.

Parameters
errorDescriptionThe textual description of the error in case of failure to restore the local storage from backup
Returns
True if local storage was successfully restored from backup, false otherwise

◆ toVersion()

virtual int quentier::ILocalStoragePatch::toVersion ( ) const
pure virtual
Returns
Version of local storage to which the patch would upgrade the local storage