Line data Source code
1 : /****************************************************************************** 2 : * $Id$ 3 : * 4 : * Project: GML registry 5 : * Purpose: GML reader 6 : * Author: Even Rouault, <even dot rouault at spatialys.com> 7 : * 8 : ****************************************************************************** 9 : * Copyright (c) 2013, Even Rouault <even dot rouault at spatialys.com> 10 : * 11 : * Permission is hereby granted, free of charge, to any person obtaining a 12 : * copy of this software and associated documentation files (the "Software"), 13 : * to deal in the Software without restriction, including without limitation 14 : * the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 : * and/or sell copies of the Software, and to permit persons to whom the 16 : * Software is furnished to do so, subject to the following conditions: 17 : * 18 : * The above copyright notice and this permission notice shall be included 19 : * in all copies or substantial portions of the Software. 20 : * 21 : * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 : * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 : * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 : * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 : * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 : * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 : * DEALINGS IN THE SOFTWARE. 28 : ****************************************************************************/ 29 : 30 : #ifndef GMLREGISTRY_H_INCLUDED 31 : #define GMLREGISTRY_H_INCLUDED 32 : 33 : #include "cpl_string.h" 34 : #include "cpl_minixml.h" 35 : 36 : #include <vector> 37 : 38 : class GMLRegistryFeatureType 39 : { 40 : public: 41 : CPLString osElementName; 42 : CPLString osElementValue; 43 : CPLString osSchemaLocation; 44 : CPLString osGFSSchemaLocation; 45 : 46 : bool Parse(const char *pszRegistryFilename, CPLXMLNode *psNode); 47 : }; 48 : 49 : class GMLRegistryNamespace 50 : { 51 : public: 52 577 : GMLRegistryNamespace() : bUseGlobalSRSName(false) 53 : { 54 577 : } 55 : 56 : CPLString osPrefix; 57 : CPLString osURI; 58 : bool bUseGlobalSRSName; 59 : std::vector<GMLRegistryFeatureType> aoFeatureTypes; 60 : 61 : bool Parse(const char *pszRegistryFilename, CPLXMLNode *psNode); 62 : }; 63 : 64 : class GMLRegistry 65 : { 66 : CPLString osRegistryPath; 67 : 68 : public: 69 : std::vector<GMLRegistryNamespace> aoNamespaces; 70 : 71 97 : explicit GMLRegistry(const CPLString &osRegistryPathIn) 72 97 : : osRegistryPath(osRegistryPathIn) 73 : { 74 97 : } 75 : 76 : bool Parse(); 77 : }; 78 : 79 : #endif /* GMLREGISTRY_H_INCLUDED */