#include "tcsDB_BACKUP.h" class tcsDB_BACKUP : public eccsERROR_CLASS { public: tcsDB_BACKUP(const dbSYMADDRESS symAddr, vltLOGICAL branch, const char *backupFile); ~tcsDB_BACKUP(); ccsCOMPL_STAT DoBackup(); void SetBackupFile (const char *backupFile); void SetSymAddr(const dbSYMADDRESS symAddr); void SetTypeBranch(vltLOGICAL branch); void ChangeCWPinBackupFile(const char *cwp); private: ccsCOMPL_STAT DbBackupSingleAttr (ccsENVNAME env, dbSYMADDRESS symAddr, dbDIRADDRESS *dirAddr ); ccsCOMPL_STAT DbBackupPoint(ccsENVNAME env, dbSYMADDRESS alias, vltLOGICAL branch ); ccsCOMPL_STAT DbBackupFct(dbSYMADDRESS symAddr, vltLOGICAL branch); dbSYMADDRESS symCwp; FILE *dbBackupFd; // file descriptor of output file char dbBackupOut[MAXPATHLEN]; // output file char *dbBackupPtr; int dbBackupSize; vltLOGICAL dbBranch; dbSYMADDRESS dbOvlCwp; };
public eccsERROR_CLASS*
tcsDB_BACKUP(const dbSYMADDRESS symAddr, vltLOGICAL branch, const char *backupFile); ~tcsDB_BACKUP(); ccsCOMPL_STAT DoBackup(); void SetBackupFile (const char *backupFile); void SetSymAddr(const dbSYMADDRESS symAddr); void SetTypeBranch(vltLOGICAL branch); void ChangeCWPinBackupFile(const char *cwp);
ccsCOMPL_STAT DbBackupFct(dbSYMADDRESS symAddr, vltLOGICAL branch); Checks the input parameters passed to dbBackup(), prepares the corresponding parameters needed for the backup and calls the appropriate backup function. symAddr <IN> symbolic name of the database item specified by the user branch <IN> flag indicating in case of a point, whether only the attributes of the point or also of the subpoints shall be read ccsCOMPL_STAT DbBackupPoint(ccsENVNAME env, dbSYMADDRESS alias, vltLOGICAL branch); Generates a backup of all attributes of a point and if <branch> is set also of all subpoints. env <IN> environment, where to read alias <IN> alias name of current working point branch <IN> flag indicating whether only the attributes of the current working point or additionally of all subpoints shall be read ccsCOMPL_STAT DbBackupSingleAttr (ccsENVNAME env, dbSYMADDRESS symAddr, dbDIRADDRESS *dirAddr ); Reads the data of the attribute <addr> and writes it in a formatted form into a file. env <IN> environment, where to read the attribute addr <IN> attribute name dirAddr <IN> direct address of attribute
dbSYMADDRESS symCwp; // symbolic address of the point/branch // to be backed up FILE *dbBackupFd; // file descriptor of output file char dbBackupOut[MAXPATHLEN]; // output file name char *dbBackupPtr; int dbBackupSize; vltLOGICAL dbBranch; // flag indicating whether only the attributes // of the current working point or // additionally of all subpoints shall be read dbSYMADDRESS dbOvlCwp;
The database is backed up in the file specified in the constructor or with the SetBackupFile method.