Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
Loading...
Searching...
No Matches
BackupsManager Class Reference

#include <BackupsManager.hpp>

Classes

struct  BackupInfo
 

Static Public Member Functions

static std::vector< BackupInfogetSortedBackups ()
 
static bool createNewBackup (bool limitBackupsQuantity=true)
 Created a new backup.
 
static void limitBackupQuantity ()
 Limit the quantity of backups files saved at once. Deletes the oldest backups if limit is exceeded.
 
static bool deleteBackup (const BackupInfo &backupInfo)
 Deletes a specific backup.
 
static bool restoreBackup (const BackupInfo &backupInfo, CDialog *dlgFather)
 Restores a specific backup. Created a backup of the app state before the restoration and overrided the Project and .diamar folders with the backups. Reads the restored project and downloads the changes to the modules. If this process fails, the app state won't be changed (Project and .diamar folders are recovered), but modules downloads won't be reversed. Requires reboot after this process.
 

Static Public Attributes

static constexpr const uint64_t kMaxBackups {10}
 
static constexpr const std::string kBackupsFolder {"Backups"}
 
static constexpr const std::string kBackupPrefix {"backup"}
 
static constexpr const std::string kBackupExtension {"zip"}
 

Member Function Documentation

◆ createNewBackup()

bool BackupsManager::createNewBackup ( bool limitBackupsQuantity = true)
static

Created a new backup.

Parameters
limitBackupsQuantityIf the limit of backup files should be considered to remove oldest.
Returns
TRUE if the backup has been successful, otherwise, FALSE.

◆ deleteBackup()

bool BackupsManager::deleteBackup ( const BackupInfo & backupInfo)
static

Deletes a specific backup.

Parameters
backupInfoInfo of the backup file.
Returns
TRUE if the backup is deleted, otherwise, FALSE.

◆ getSortedBackups()

std::vector< BackupsManager::BackupInfo > BackupsManager::getSortedBackups ( )
static

Gets backups files sorted from newest to oldest.

Returns
BackupInfos of existing backups files.

◆ limitBackupQuantity()

void BackupsManager::limitBackupQuantity ( )
static

Limit the quantity of backups files saved at once. Deletes the oldest backups if limit is exceeded.

◆ restoreBackup()

bool BackupsManager::restoreBackup ( const BackupInfo & backupInfo,
CDialog * dlgFather )
static

Restores a specific backup. Created a backup of the app state before the restoration and overrided the Project and .diamar folders with the backups. Reads the restored project and downloads the changes to the modules. If this process fails, the app state won't be changed (Project and .diamar folders are recovered), but modules downloads won't be reversed. Requires reboot after this process.

Parameters
backupInfoBackup to restore.
dlgFatherDialog father.
Returns
TRUE if the backup is restored successfully, otherwise, false.

< Mapa NombreCarpeta - PathCarpeta

< Nombre de copia del Project por si falla el restore

< Nombre de copia del .diamar por si falla el restore

Member Data Documentation

◆ kBackupExtension

const std::string BackupsManager::kBackupExtension {"zip"}
staticconstexpr

◆ kBackupPrefix

const std::string BackupsManager::kBackupPrefix {"backup"}
staticconstexpr

◆ kBackupsFolder

const std::string BackupsManager::kBackupsFolder {"Backups"}
staticconstexpr

◆ kMaxBackups

const uint64_t BackupsManager::kMaxBackups {10}
staticconstexpr

The documentation for this class was generated from the following files: