15 #ifndef QGSGMLSCHEMA_H
16 #define QGSGMLSCHEMA_H
18 #include "qgis_core.h"
28 #include <QDomElement>
29 #include <QStringList>
50 QList<QgsField> &
fields() {
return mFields; }
52 int fieldIndex(
const QString &name );
54 QString
path()
const {
return mPath; }
76 QList<QgsField> mFields;
79 QStringList mGeometryAttributes;
93 bool parseXSD(
const QByteArray &xml );
102 bool guessSchema(
const QByteArray &data );
105 QStringList typeNames()
const;
108 QList<QgsField> fields(
const QString &
typeName );
111 QStringList geometryAttributes(
const QString &
typeName );
130 void startElement(
const XML_Char *el,
const XML_Char **attr );
131 void endElement(
const XML_Char *el );
132 void characters(
const XML_Char *chars,
int len );
133 static void start(
void *data,
const XML_Char *el,
const XML_Char **attr )
135 static_cast<QgsGmlSchema *
>( data )->startElement( el, attr );
137 static void end(
void *data,
const XML_Char *el )
141 static void chars(
void *data,
const XML_Char *chars,
int len )
143 static_cast<QgsGmlSchema *
>( data )->characters( chars, len );
146 void addAttribute(
const QString &name,
const QString &value );
154 QString readAttribute(
const QString &attributeName,
const XML_Char **attr )
const;
157 QWidget *findMainWindow()
const;
160 QList<QDomElement> domElements(
const QDomElement &element,
const QString &path );
163 QDomElement domElement(
const QDomElement &element,
const QString &path );
166 QList<QDomElement> domElements( QList<QDomElement> &elements,
const QString &attr,
const QString &attrVal );
169 QDomElement domElement(
const QDomElement &element,
const QString &path,
const QString &attr,
const QString &attrVal );
172 QString stripNS(
const QString &name );
180 QString xsdComplexTypeGmlBaseType(
const QDomElement &element,
const QString &name );
187 ParseMode modeStackTop() {
return mParseModeStack.isEmpty() ?
None : mParseModeStack.top(); }
190 ParseMode modeStackPop() {
return mParseModeStack.isEmpty() ?
None : mParseModeStack.pop(); }
194 QStack<ParseMode> mParseModeStack;
198 QString mCurrentFeatureId;
199 int mFeatureCount = 0;
200 QString mAttributeName;
202 QString mCoordinateSeparator;
204 QString mTupleSeparator;
215 QStringList mParsePathStack;
217 QString mCurrentFeatureName;
220 QStringList mGeometryTypes;
223 QMap<QString, QgsGmlFeatureClass> mFeatureClassMap;
This class represents a coordinate reference system (CRS).
QgsError is container for error messages (report).
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Description of feature class in GML.
QStringList & geometryAttributes()
QgsGmlFeatureClass()=default
Constructor for QgsGmlFeatureClass.
QList< QgsField > & fields()
QgsError error() const
Gets error if parseXSD() or guessSchema() failed.
A rectangle specified with double values.