QGIS API Documentation  3.24.2-Tisler (13c1a02865)
qgsproviderutils.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsproviderutils.h
3  ----------------------------
4  begin : June 2021
5  copyright : (C) 2021 by Nyall Dawson
6  email : nyall dot dawson at gmail dot com
7  ***************************************************************************/
8 /***************************************************************************
9  * *
10  * This program is free software; you can redistribute it and/or modify *
11  * it under the terms of the GNU General Public License as published by *
12  * the Free Software Foundation; either version 2 of the License, or *
13  * (at your option) any later version. *
14  * *
15  ***************************************************************************/
16 #ifndef QGSPROVIDERUTILS_H
17 #define QGSPROVIDERUTILS_H
18 
19 #include "qgis_core.h"
20 #include "qgis.h"
21 #include <QList>
22 
24 
33 class CORE_EXPORT QgsProviderUtils
34 {
35  public:
36 
40  enum class SublayerCompletenessFlag : int
41  {
42  IgnoreUnknownFeatureCount = 1 << 0,
43  IgnoreUnknownGeometryType = 1 << 1,
44  };
45  Q_DECLARE_FLAGS( SublayerCompletenessFlags, SublayerCompletenessFlag )
46 
47 
56  static bool sublayerDetailsAreIncomplete( const QList< QgsProviderSublayerDetails > &details, QgsProviderUtils::SublayerCompletenessFlags flags = QgsProviderUtils::SublayerCompletenessFlags() );
57 
67  static QString suggestLayerNameFromFilePath( const QString &path );
68 
69 };
70 
71 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsProviderUtils::SublayerCompletenessFlags )
72 
73 #endif //QGSPROVIDERUTILS_H
74 
75 
76 
Contains details about a sub layer available from a dataset.
Contains utility functions for working with data providers.
SublayerCompletenessFlag
Flags which control how QgsProviderUtils::sublayerDetailsAreIncomplete() tests for completeness.
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsField::ConfigurationFlags) CORE_EXPORT QDataStream &operator<<(QDataStream &out
Writes the field to stream out. QGIS version compatibility is not guaranteed.