ToolMap
Loading...
Searching...
No Matches
tmprojectmaintenance.h
1/***************************************************************************
2 tmprojectmaintenance.h
3 -------------------
4 copyright : (C) 2012 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#ifndef _TMPROJECTMAINTENANCE_H_
16#define _TMPROJECTMAINTENANCE_H_
17
18// For compilers that support precompilation, includes "wx/wx.h".
19#include <wx/wxprec.h>
20
21// Include wxWidgets' headers
22#ifndef WX_PRECOMP
23#include <wx/wx.h>
24#endif
25
26#include <wx/filename.h>
27
28class DataBase;
29
31 private:
32 wxArrayString m_Messages;
33 wxArrayString m_Errors;
34
35 bool m_IsVerbose;
36 DataBase* m_DB;
37 bool m_DestroyDatabase;
38
39 wxArrayString _GetAllTables();
40
41 bool _DoCodeOnTables(const wxString& query, const wxString& errmsg, const wxString& sucessmsg);
42
43 bool _CleanLayerOrphansKind(const wxString& tablegeom, const wxString& tablekind);
44
45 bool _CleanLayerOrphansAttributes(int geomtype, const wxString& generictablename);
46
47 public:
48 tmProjectMaintenance(const wxString& databasename, DataBase* database = nullptr);
49
50 virtual ~tmProjectMaintenance();
51
52 // bool CheckTables();
53 bool RepairTables();
54
55 bool OptimizeTables();
56
57 bool ClearOrphans();
58
59 inline const bool IsVerbose() const;
60
61 void SetVerbose(bool value);
62
63 inline const wxArrayString GetErrors() const;
64
65 inline const wxArrayString GetMessages() const;
66};
67
68inline const bool tmProjectMaintenance::IsVerbose() const {
69 return m_IsVerbose;
70}
71
72inline const wxArrayString tmProjectMaintenance::GetErrors() const {
73 return m_Errors;
74}
75
76inline const wxArrayString tmProjectMaintenance::GetMessages() const {
77 return m_Messages;
78}
79
80#endif
Definition database.h:55
Definition tmprojectmaintenance.h:30