ToolMap
Loading...
Searching...
No Matches
backupmanager.h
1/***************************************************************************
2 backupmanager.h
3 -------------------
4 copyright : (C) 2011 CREALP Lucien Schreiber
5 ***************************************************************************/
6
7/***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef _BACKUPMANAGER_H
17#define _BACKUPMANAGER_H
18
19#include <wx/wxprec.h>
20
21#ifndef WX_PRECOMP
22#include <wx/wx.h>
23#endif
24
25#include <wx/filename.h>
26#include <wx/progdlg.h>
27#include <wx/regex.h>
28#include <wx/sstream.h>
29#include <wx/wfstream.h>
30#include <wx/xml/xml.h>
31#include <wx/zipstrm.h>
32
33class DataBaseTM;
34
36 private:
37 wxFileName m_OutFileName;
38 wxFileName m_InDirectory;
39 wxString m_Comment;
40 wxString m_Author;
41 wxDateTime m_Date;
42 bool m_UseDate;
43
44 public:
45 BackupFile();
46
47 virtual ~BackupFile();
48
49 bool IsValid() const;
50
51 inline const wxFileName GetOutputName() const;
52
53 void SetOutputName(const wxFileName& value);
54
55 inline const wxFileName GetInputDirectory() const;
56
57 void SetInputDirectory(const wxFileName& value);
58
59 inline const wxString GetComment() const;
60
61 void SetComment(const wxString& value);
62
63 inline const wxString GetAuthor() const;
64
65 void SetAuthor(const wxString& value);
66
67 inline const wxDateTime GetDate() const;
68
69 void SetDate(wxDateTime value);
70
71 inline const bool IsUsingDate() const;
72
73 void SetUseDate(bool value);
74};
75
76inline const wxFileName BackupFile::GetOutputName() const {
77 return m_OutFileName;
78}
79
80inline const wxFileName BackupFile::GetInputDirectory() const {
81 return m_InDirectory;
82}
83
84inline const wxString BackupFile::GetComment() const {
85 return m_Comment;
86}
87
88inline const wxString BackupFile::GetAuthor() const {
89 return m_Author;
90}
91
92inline const wxDateTime BackupFile::GetDate() const {
93 return m_Date;
94}
95
96inline const bool BackupFile::IsUsingDate() const {
97 return m_UseDate;
98}
99
100/***************** BACKUP MANAGER **********************/
102 private:
103 DataBaseTM* m_Database;
104
105 void _ListMySQLFiles(const wxString& directory, wxArrayString& files);
106
107 public:
108 BackupManager(DataBaseTM* database);
109
110 virtual ~BackupManager();
111
112 bool Backup(const BackupFile& fileinfo, wxWindow* progressparent = nullptr);
113
114 bool Restore(const BackupFile& fileinfo, wxWindow* progressparent = nullptr);
115
116 bool GetFileInfo(const wxFileName& file, BackupFile& fileinfo);
117
118 bool SetMetadata(const BackupFile& fileinfo, wxZipOutputStream* zip);
119
120 inline DataBaseTM* GetDatabase();
121};
122
123inline DataBaseTM* BackupManager::GetDatabase() {
124 return m_Database;
125}
126
127#endif
Definition backupmanager.h:35
Definition backupmanager.h:101
Definition database_tm.h:80