QGIS API Documentation 3.41.0-Master (fda2aa46e9a)
Loading...
Searching...
No Matches
Public Types | Static Public Member Functions | List of all members
QgsProviderUtils Class Reference

Contains utility functions for working with data providers. More...

#include <qgsproviderutils.h>

Public Types

enum class  SublayerCompletenessFlag : int { IgnoreUnknownFeatureCount = 1 << 0 , IgnoreUnknownGeometryType = 1 << 1 }
 Flags which control how QgsProviderUtils::sublayerDetailsAreIncomplete() tests for completeness. More...
 
typedef QFlags< SublayerCompletenessFlagSublayerCompletenessFlags
 

Static Public Member Functions

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.
 
static QString suggestLayerNameFromFilePath (const QString &path)
 Suggests a suitable layer name given only a file path.
 

Detailed Description

Contains utility functions for working with data providers.

Since
QGIS 3.22

Definition at line 33 of file qgsproviderutils.h.

Member Typedef Documentation

◆ SublayerCompletenessFlags

Definition at line 45 of file qgsproviderutils.h.

Member Enumeration Documentation

◆ SublayerCompletenessFlag

Flags which control how QgsProviderUtils::sublayerDetailsAreIncomplete() tests for completeness.

Enumerator
IgnoreUnknownFeatureCount 

Indicates that an unknown feature count should not be considered as incomplete.

IgnoreUnknownGeometryType 

Indicates that an unknown geometry type should not be considered as incomplete.

Definition at line 40 of file qgsproviderutils.h.

Member Function Documentation

◆ sublayerDetailsAreIncomplete()

bool QgsProviderUtils::sublayerDetailsAreIncomplete ( const QList< QgsProviderSublayerDetails > &  details,
QgsProviderUtils::SublayerCompletenessFlags  flags = QgsProviderUtils::SublayerCompletenessFlags() 
)
static

Returns true if the sublayer details are incomplete, and require a more in-depth scan.

For instance, if the details contain any vector sublayers with unknown geometry types then a query with the Qgis::SublayerQueryFlag::ResolveGeometryType flag is required.

The flags argument can be used to control the level of completeness required during the test.

Definition at line 22 of file qgsproviderutils.cpp.

◆ suggestLayerNameFromFilePath()

QString QgsProviderUtils::suggestLayerNameFromFilePath ( const QString &  path)
static

Suggests a suitable layer name given only a file path.

Usually this corresponds to the base file name of path (e.g. "rivers" for a path of "c:/my data/water/rivers.shp"). However some data formats which use fixed file paths (such as aigrid files) will instead return the parent directory name (e.g. "rivers" for a path of "c:/my data/water/rivers/hdr.adf").

Definition at line 59 of file qgsproviderutils.cpp.


The documentation for this class was generated from the following files: