Version: 0.6.0
dataset.h
1 /******************************************************************************
2  * Project: wxGIS
3  * Purpose: wxGISDataset class.
4  * Author: Dmitry Baryshnikov (aka Bishop), polimax@mail.ru
5  ******************************************************************************
6 * Copyright (C) 2009-2014 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 
22 #pragma once
23 
24 #include "wxgis/datasource/gdalinh.h"
25 #include "wxgis/core/pointer.h"
26 
33 class WXDLLIMPEXP_GIS_DS wxGISDataset :
34  public wxObject,
35  public wxGISPointer
36 {
37  DECLARE_ABSTRACT_CLASS(wxGISDataset)
38 public:
39  wxGISDataset(const CPLString &sPath = "");
40  virtual ~wxGISDataset(void);
41  virtual wxGISEnumDatasetType GetType(void) const;
42  virtual int GetSubType(void) const;
43  virtual void SetSubType(int nSubType);
44  virtual CPLString GetPath(void) const;
45  virtual size_t GetSubsetsCount(void) const;
46  virtual wxString GetName(void) const;
47  virtual bool Open(bool bUpdate, bool bShared) = 0;
48  virtual void Close(void);
49  virtual bool IsOpened(void) const;
50  virtual bool IsReadOnly(void) const;
51  virtual bool IsCached(void) const;
52  virtual bool IsCaching(void) const;
53  virtual wxGISDataset* GetSubset(size_t nIndex);
54  virtual const wxGISSpatialReference GetSpatialReference(void);
55  virtual bool Delete(ITrackCancel* const pTrackCancel = NULL);
56  virtual bool Rename(const wxString &sNewName, ITrackCancel* const pTrackCancel = NULL);
57  virtual bool Copy(const CPLString &szDestPath, ITrackCancel* const pTrackCancel = NULL);
58  virtual bool Move(const CPLString &szDestPath, ITrackCancel* const pTrackCancel = NULL);
59  virtual bool CanDelete(void);
60  virtual bool CanRename(void);
61  virtual bool CanCopy(const CPLString &szDestPath);
62  virtual bool CanMove(const CPLString &szDestPath);
63  virtual void Cache(ITrackCancel* const pTrackCancel = NULL) = 0;
64  virtual void StopCaching(void);
65  virtual char **GetFileList() = 0;
66 protected:
67  virtual CPLString FixPathSeparator(CPLString &szPath);
68  virtual void* OpenInternal(const CPLString &szPath, bool bUpdate, bool bShared);
69 protected:
70  CPLString m_sPath;
71  wxCriticalSection m_CritSect;
72  int m_nSubType;
73  wxGISEnumDatasetType m_nType;
74  bool m_bIsOpened, m_bIsReadOnly, m_bIsCached;
75  wxGISSpatialReference m_SpatialReference;
76 };
77 
Definition: pointer.h:55
A TrackCancel interface class.
Definition: core.h:144
Definition: dataset.h:33
Definition: gdalinh.h:57