ArnLib
4.0.x
Active Registry Network
|
Class for handling persistent Arn Data object. More...
#include <ArnPersist.hpp>
Public Slots | |
bool | doArchive (const QString &name=QString()) |
Do a persistent database backup. More... | |
Public Member Functions | |
ArnPersist (QObject *parent=arnNullptr) | |
~ArnPersist () | |
bool | setMountPoint (const QString &path) |
Set the persistent enabled tree path. More... | |
void | setPersistDir (const QString &path) |
Set the persistent file directory root More... | |
void | setArchiveDir (const QString &path) |
Set the persistent database backup directory. More... | |
void | setVcs (ArnVcs *vcs) |
Set the Version Control System to be used. More... | |
bool | setupDataBase (const QString &dbName="persist.db") |
Setup the persistent database. More... | |
bool | flush (const QString &path=QString()) |
Save any pending values now. More... | |
Class for handling persistent Arn Data object.
About Persistent Arn Data Object
This class is used at an ArnServer to implemennt persistent objects.
Example usage
Definition at line 168 of file ArnPersist.hpp.
|
explicit |
Definition at line 210 of file ArnPersist.cpp.
ArnPersist::~ArnPersist | ( | ) |
Definition at line 226 of file ArnPersist.cpp.
|
slot |
Do a persistent database backup.
By default the backup file will be marked by date and clock. Optionally a custom name can be set for the backup file.
[in] | name | is the file name of the backup. QString() gives default name. |
Definition at line 843 of file ArnPersist.cpp.
bool ArnPersist::flush | ( | const QString & | path = QString() | ) |
Save any pending values now.
Persistent values are normally delayed before saving.
[in] | path | is the starting path (tree) as filter. If empty, no filter. |
false | if error. |
Definition at line 527 of file ArnPersist.cpp.
void ArnPersist::setArchiveDir | ( | const QString & | path | ) |
Set the persistent database backup directory.
In this directory, all backup files are stored.
[in] | path | is the persistent file directory root. |
Definition at line 240 of file ArnPersist.cpp.
bool ArnPersist::setMountPoint | ( | const QString & | path | ) |
Set the persistent enabled tree path.
Mountpoint is a folder. When an Arn Data Object change to Save mode in this folder or anywhere below in the tree, it will be treated as a persistent object.
[in] | path | is the persistent enabled tree. |
false | if error. |
Definition at line 434 of file ArnPersist.cpp.
void ArnPersist::setPersistDir | ( | const QString & | path | ) |
Set the persistent file directory root
In this directory and below, all persistent files are stored. The path correspond to the root in Arn.
This file directory can optionally be managed by a version control system, set by using setVcs().
Example: path is set to "/usr/local/arn_persist". There is a file stored at "/usr/local/arn_persist/@/doc/help.html". This file will be mapped to Arn at "//doc/help.html".
[in] | path | is the persistent file directory root. |
Definition at line 232 of file ArnPersist.cpp.
bool ArnPersist::setupDataBase | ( | const QString & | dbName = "persist.db" | ) |
Setup the persistent database.
Starting a SQLite database to store persistent Arn Data Object in.
[in] | dbName | is the name (and path) of the SQLite database file. |
false | if error. |
Definition at line 466 of file ArnPersist.cpp.
void ArnPersist::setVcs | ( | ArnVcs * | vcs | ) |
Set the Version Control System to be used.
The VCS is implemented in a class derived from ArnVcs. Ownership is taken of this VCS. Any previos set VCS will be deleted.
[in] | vcs | is the class implementing the VCS. Use 0 (null) to set none. |
Definition at line 248 of file ArnPersist.cpp.