Version: 0.6.0
gxmlconnstor.h
1 /******************************************************************************
2  * Project: wxGIS (GIS Remote)
3  * Purpose: wxGxXMLConnectionStorage class.
4  * Author: Dmitry Baryshnikov (aka Bishop), polimax@mail.ru
5  ******************************************************************************
6 * Copyright (C) 2012,2013 Dmitry Baryshnikov
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  ****************************************************************************/
21 #pragma once
22 
23 #include "wxgis/catalog/catalog.h"
24 #include "wxgis/catalog/gxobject.h"
25 #include "wxgis/core/json/jsonval.h"
26 #include "wxgis/core/json/jsonreader.h"
27 #include "wxgis/core/json/jsonwriter.h"
28 
29 #include <wx/fswatcher.h>
30 
37 /*
38 class WXDLLIMPEXP_GIS_CLT wxGxXMLConnectionStorage :
39  public wxGxObjectContainer
40 {
41  DECLARE_ABSTRACT_CLASS(wxGxXMLConnectionStorage)
42 public:
43  wxGxXMLConnectionStorage(void);
44  ~wxGxXMLConnectionStorage(void);
45  //events
46  virtual void OnFileSystemEvent(wxFileSystemWatcherEvent& event);
47 protected:
48  virtual void LoadConnectionsStorage(void);
49  virtual bool IsObjectExist(wxGxObject* const pObj, const wxXmlNode* pNode) = 0;
50  virtual void CreateConnectionsStorage(void) = 0;
51  virtual wxGxObject* CreateChildGxObject(const wxXmlNode* pNode) = 0;
52  virtual int GetStorageVersion(void) const = 0;
53 protected:
54  wxString m_sXmlStorageName;
55  wxString m_sXmlStoragePath;
56  wxCriticalSection m_oCritSect;
57 };
58 */
59 
67 class WXDLLIMPEXP_GIS_CLT wxGxJSONConnectionStorage :
68  public wxGxObjectContainer
69 {
70  DECLARE_ABSTRACT_CLASS(wxGxJSONConnectionStorage)
71 public:
74  virtual bool AddItem(int nStoreId, const wxString& sName, const wxString& sPath);
75  virtual bool DeleteItemById(int nStoreId);
76  virtual bool RenameItemById(int nStoreId, const wxString& NewName);
77  //events
78  virtual void OnFileSystemEvent(wxFileSystemWatcherEvent& event);
79 protected:
80  virtual void LoadConnectionsStorage(void);
81  virtual bool IsObjectExist(wxGxObject* const pObj, const wxJSONValue& GxObjConfValue) = 0;
82  virtual void CreateConnectionsStorage(void) = 0;
83  virtual wxGxObject* CreateChildGxObject(const wxJSONValue& GxObjConfValue) = 0;
84  virtual int GetStorageVersion(void) const = 0;
85 protected:
86  wxString m_sStorageName;
87  wxString m_sStoragePath;
88  wxCriticalSection m_oCritSect;
89 };
The JSON value class implementation.
Definition: jsonval.h:91
Definition: gxobject.h:78
Definition: gxmlconnstor.h:67
Definition: gxobject.h:37