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 );
98 bool guessSchema(
const QByteArray &data );
101 QStringList typeNames()
const;
104 QList<QgsField> fields(
const QString &
typeName );
107 QStringList geometryAttributes(
const QString &typeName );
126 void startElement(
const XML_Char *el,
const XML_Char **attr );
127 void endElement(
const XML_Char *el );
128 void characters(
const XML_Char *chars,
int len );
129 static void start(
void *data,
const XML_Char *el,
const XML_Char **attr )
131 static_cast<QgsGmlSchema *
>( data )->startElement( el, attr );
133 static void end(
void *data,
const XML_Char *el )
137 static void chars(
void *data,
const XML_Char *chars,
int len )
139 static_cast<QgsGmlSchema *
>( data )->characters( chars, len );
142 void addAttribute(
const QString &name,
const QString &value );
149 QString readAttribute(
const QString &attributeName,
const XML_Char **attr )
const;
152 QWidget *findMainWindow()
const;
155 QList<QDomElement> domElements(
const QDomElement &element,
const QString &path );
158 QDomElement domElement(
const QDomElement &element,
const QString &path );
161 QList<QDomElement> domElements( QList<QDomElement> &elements,
const QString &attr,
const QString &attrVal );
164 QDomElement domElement(
const QDomElement &element,
const QString &path,
const QString &attr,
const QString &attrVal );
167 QString stripNS(
const QString &name );
175 QString xsdComplexTypeGmlBaseType(
const QDomElement &element,
const QString &name );
178 bool xsdFeatureClass(
const QDomElement &element,
const QString &typeName,
QgsGmlFeatureClass &featureClass );
182 ParseMode modeStackTop() {
return mParseModeStack.isEmpty() ? None : mParseModeStack.top(); }
185 ParseMode modeStackPop() {
return mParseModeStack.isEmpty() ? None : mParseModeStack.pop(); }
189 QStack<ParseMode> mParseModeStack;
193 QString mCurrentFeatureId;
194 int mFeatureCount = 0;
195 QString mAttributeName;
197 QString mCoordinateSeparator;
199 QString mTupleSeparator;
210 QStringList mParsePathStack;
212 QString mCurrentFeatureName;
215 QStringList mGeometryTypes;
218 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()