ToolMap
Loading...
Searching...
No Matches
tmprojectmerge.h
1/***************************************************************************
2 tmprojectmerge.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 _tmProjectMerge_H_
16#define _tmProjectMerge_H_
17
18// For compilers that support precompilation, includes "wx/wx.h".
19#include <wx/wxprec.h>
20
21#include "database.h"
22
23// Include wxWidgets' headers
24#ifndef WX_PRECOMP
25#include <wx/wx.h>
26#endif
27
28#include <wx/filename.h>
29
30class DataBase;
31
33 private:
34 wxFileName m_MasterFileName;
35 wxFileName m_SlaveFileName;
36 DataBase* m_DB;
37 bool m_manage_database;
38
39 bool m_beVerbose;
40 wxArrayString m_Errors;
41
42 bool _HasSameNumberRecords(DataBase* db, const wxString& tablename);
43
44 bool _HasSameRecords(DataBase* db, const wxString& query, long& errnumber, long& firstId, bool raiseError);
45
46 bool _HasSimilarResults(DataBase* db, const wxString& query, long& errnumber);
47
48 bool _CopyUpdateTable(const wxString& tablename, const wxString& keycol, wxArrayLong* oldids, wxArrayLong* newids);
49
50 bool _MergeGeom(const wxString& geomtablename, const wxString& aatablename, int geomtype);
51
52 bool _IsReady();
53
54 bool _GetIdMax(const wxString& dbName, const wxString& tableName, long& idMax);
55
56 public:
57 tmProjectMerge(const wxString& masterprj, const wxString& slaveprj, DataBase* database = nullptr);
58
59 virtual ~tmProjectMerge();
60
61 inline const bool IsVerbose() const;
62
63 void SetVerbose(bool value);
64
65 inline const wxArrayString GetErrors() const;
66
67 wxString GetLastError();
68
69 bool CheckSimilar();
70
71 bool MergeIntoMaster();
72
73 DataBase* GetDatabaseRef() {
74 return m_DB;
75 }
76};
77
78inline const bool tmProjectMerge::IsVerbose() const {
79 return m_beVerbose;
80}
81
82inline const wxArrayString tmProjectMerge::GetErrors() const {
83 return m_Errors;
84}
85
86#endif
Definition database.h:55
Definition tmprojectmerge.h:32
Definition of class DataBase.