QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
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.h"
20#include "qgis_core.h"
21
22#include <QList>
23
25
34class CORE_EXPORT QgsProviderUtils
35{
36 public:
37
41 enum class SublayerCompletenessFlag : int SIP_ENUM_BASETYPE( IntFlag )
42 {
43 IgnoreUnknownFeatureCount = 1 << 0,
44 IgnoreUnknownGeometryType = 1 << 1,
45 };
47
48
57 static bool sublayerDetailsAreIncomplete( const QList< QgsProviderSublayerDetails > &details, QgsProviderUtils::SublayerCompletenessFlags flags = QgsProviderUtils::SublayerCompletenessFlags() );
58
68 static QString suggestLayerNameFromFilePath( const QString &path );
69
70};
71
73
74#endif //QGSPROVIDERUTILS_H
75
76
77
Contains details about a sub layer available from a dataset.
Contains utility functions for working with data providers.
static bool sublayerDetailsAreIncomplete(const QList< QgsProviderSublayerDetails > &details, QgsProviderUtils::SublayerCompletenessFlags flags=QgsProviderUtils::SublayerCompletenessFlags())
Returns true if the sublayer details are incomplete, and require a more in-depth scan.
QFlags< SublayerCompletenessFlag > SublayerCompletenessFlags
static QString suggestLayerNameFromFilePath(const QString &path)
Suggests a suitable layer name given only a file path.
SublayerCompletenessFlag
Flags which control how QgsProviderUtils::sublayerDetailsAreIncomplete() tests for completeness.
#define SIP_ENUM_BASETYPE(type)
Definition qgis_sip.h:275
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsProjectionSelectionWidget::CrsOptions)