/src/gdal/ogr/ogrsf_frmts/gml/gmlreader.h
Line | Count | Source (jump to first uncovered line) |
1 | | /****************************************************************************** |
2 | | * |
3 | | * Project: GML Reader |
4 | | * Purpose: Public Declarations for OGR free GML Reader code. |
5 | | * Author: Frank Warmerdam, warmerdam@pobox.com |
6 | | * |
7 | | ****************************************************************************** |
8 | | * Copyright (c) 2002, Frank Warmerdam |
9 | | * Copyright (c) 2008-2013, Even Rouault <even dot rouault at spatialys.com> |
10 | | * |
11 | | * SPDX-License-Identifier: MIT |
12 | | ****************************************************************************/ |
13 | | |
14 | | #ifndef GMLREADER_H_INCLUDED |
15 | | #define GMLREADER_H_INCLUDED |
16 | | |
17 | | #include "cpl_port.h" |
18 | | #include "cpl_vsi.h" |
19 | | #include "cpl_minixml.h" |
20 | | #include "ogr_core.h" |
21 | | #include "gmlutils.h" |
22 | | #include "gmlfeature.h" |
23 | | |
24 | | #include <map> |
25 | | #include <vector> |
26 | | |
27 | | // Special value to map to a NULL field |
28 | 0 | #define OGR_GML_NULL "___OGR_GML_NULL___" |
29 | | |
30 | | /************************************************************************/ |
31 | | /* IGMLReader */ |
32 | | /************************************************************************/ |
33 | | class CPL_DLL IGMLReader |
34 | | { |
35 | | public: |
36 | | virtual ~IGMLReader(); |
37 | | |
38 | | virtual bool IsClassListLocked() const = 0; |
39 | | virtual void SetClassListLocked(bool bFlag) = 0; |
40 | | |
41 | | virtual void SetSourceFile(const char *pszFilename) = 0; |
42 | | |
43 | | virtual void SetFP(CPL_UNUSED VSILFILE *fp) |
44 | 0 | { |
45 | 0 | } |
46 | | |
47 | | virtual const char *GetSourceFileName() = 0; |
48 | | |
49 | | virtual int GetClassCount() const = 0; |
50 | | virtual GMLFeatureClass *GetClass(int i) const = 0; |
51 | | virtual GMLFeatureClass *GetClass(const char *pszName) const = 0; |
52 | | |
53 | | virtual int AddClass(GMLFeatureClass *poClass) = 0; |
54 | | virtual void ClearClasses() = 0; |
55 | | |
56 | | virtual GMLFeature *NextFeature() = 0; |
57 | | virtual void ResetReading() = 0; |
58 | | |
59 | | virtual bool LoadClasses(const char *pszFile = nullptr) = 0; |
60 | | virtual bool SaveClasses(const char *pszFile = nullptr) = 0; |
61 | | |
62 | | virtual bool ResolveXlinks(const char *pszFile, bool *pbOutIsTempFile, |
63 | | char **papszSkip = nullptr, |
64 | | const bool bStrict = false) = 0; |
65 | | |
66 | | virtual bool HugeFileResolver(const char *pszFile, bool bSqliteIsTempFile, |
67 | | int iSqliteCacheMB) = 0; |
68 | | |
69 | | virtual bool PrescanForSchema(bool bGetExtents = true, |
70 | | bool bOnlyDetectSRS = false) = 0; |
71 | | virtual bool PrescanForTemplate() = 0; |
72 | | |
73 | | virtual bool HasStoppedParsing() = 0; |
74 | | |
75 | | virtual void SetGlobalSRSName(CPL_UNUSED const char *pszGlobalSRSName) |
76 | 0 | { |
77 | 0 | } |
78 | | |
79 | | virtual const char *GetGlobalSRSName() = 0; |
80 | | virtual bool CanUseGlobalSRSName() = 0; |
81 | | |
82 | | virtual bool SetFilteredClassName(const char *pszClassName) = 0; |
83 | | virtual const char *GetFilteredClassName() = 0; |
84 | | |
85 | | virtual bool IsSequentialLayers() const |
86 | 0 | { |
87 | 0 | return false; |
88 | 0 | } |
89 | | }; |
90 | | |
91 | | IGMLReader *CreateGMLReader(bool bUseExpatParserPreferably, |
92 | | bool bInvertAxisOrderIfLatLong, |
93 | | bool bConsiderEPSGAsURN, |
94 | | GMLSwapCoordinatesEnum eSwapCoordinates, |
95 | | bool bGetSecondaryGeometryOption); |
96 | | |
97 | | #endif /* GMLREADER_H_INCLUDED */ |