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; }
72 QList<QgsField> mFields;
75 QStringList mGeometryAttributes;
89 bool parseXSD(
const QByteArray &xml );
97 bool guessSchema(
const QByteArray &data );
100 QStringList typeNames()
const;
103 QList<QgsField> fields(
const QString &
typeName );
106 QStringList geometryAttributes(
const QString &typeName );
125 void startElement(
const XML_Char *el,
const XML_Char **attr );
126 void endElement(
const XML_Char *el );
127 void characters(
const XML_Char *chars,
int len );
128 static void start(
void *data,
const XML_Char *el,
const XML_Char **attr )
130 static_cast<QgsGmlSchema *
>( data )->startElement( el, attr );
132 static void end(
void *data,
const XML_Char *el )
136 static void chars(
void *data,
const XML_Char *chars,
int len )
138 static_cast<QgsGmlSchema *
>( data )->characters( chars, len );
141 void addAttribute(
const QString &name,
const QString &value );
148 QString readAttribute(
const QString &attributeName,
const XML_Char **attr )
const;
151 QWidget *findMainWindow()
const;
154 QList<QDomElement> domElements(
const QDomElement &element,
const QString &path );
157 QDomElement domElement(
const QDomElement &element,
const QString &path );
160 QList<QDomElement> domElements( QList<QDomElement> &elements,
const QString &attr,
const QString &attrVal );
163 QDomElement domElement(
const QDomElement &element,
const QString &path,
const QString &attr,
const QString &attrVal );
166 QString stripNS(
const QString &name );
174 QString xsdComplexTypeGmlBaseType(
const QDomElement &element,
const QString &name );
177 bool xsdFeatureClass(
const QDomElement &element,
const QString &typeName,
QgsGmlFeatureClass &featureClass );
181 ParseMode modeStackTop() {
return mParseModeStack.isEmpty() ? None : mParseModeStack.top(); }
184 ParseMode modeStackPop() {
return mParseModeStack.isEmpty() ? None : mParseModeStack.pop(); }
188 QStack<ParseMode> mParseModeStack;
192 QString mCurrentFeatureId;
193 int mFeatureCount = 0;
194 QString mAttributeName;
196 QString mCoordinateSeparator;
198 QString mTupleSeparator;
209 QStringList mParsePathStack;
211 QString mCurrentFeatureName;
214 QStringList mGeometryTypes;
217 QMap<QString, QgsGmlFeatureClass> mFeatureClassMap;
A rectangle specified with double values.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
QList< QgsField > & fields()
Description of feature class in GML.
QgsError is container for error messages (report).
This class represents a coordinate reference system (CRS).
QgsError error() const
Gets error if parseXSD() or guessSchema() failed.
QStringList & geometryAttributes()