QGIS API Documentation  3.18.1-Zürich (202f1bf7e5)
Public Types | Public Member Functions | List of all members
QgsNetworkContentFetcherRegistry Class Reference

Registry for temporary fetched files. More...

#include <qgsnetworkcontentfetcherregistry.h>

Inheritance diagram for QgsNetworkContentFetcherRegistry:
Inheritance graph
[legend]

Public Types

enum  FetchingMode { DownloadLater , DownloadImmediately }
 Enum to determine when the download should start. More...
 

Public Member Functions

 QgsNetworkContentFetcherRegistry ()=default
 Create the registry for temporary downloaded files. More...
 
 ~QgsNetworkContentFetcherRegistry () override
 
const QgsFetchedContentfetch (const QString &url, FetchingMode fetchingMode=DownloadLater)
 Initialize a download for the given URL. More...
 
QFile * localFile (const QString &filePathOrUrl)
 Returns a QFile from a local file or to a temporary file previously fetched by the registry. More...
 
QString localPath (const QString &filePathOrUrl)
 Returns the path to a local file or to a temporary file previously fetched by the registry. More...
 

Detailed Description

Registry for temporary fetched files.

This provides a simple way of downloading and accessing remote files during QGIS application running.

See also
QgsFetchedContent
Since
QGIS 3.2

Definition at line 123 of file qgsnetworkcontentfetcherregistry.h.

Member Enumeration Documentation

◆ FetchingMode

Enum to determine when the download should start.

Enumerator
DownloadLater 

Do not start immediately the download to properly connect the fetched signal.

DownloadImmediately 

The download will start immediately, not need to run QgsFecthedContent::download()

Definition at line 128 of file qgsnetworkcontentfetcherregistry.h.

Constructor & Destructor Documentation

◆ QgsNetworkContentFetcherRegistry()

QgsNetworkContentFetcherRegistry::QgsNetworkContentFetcherRegistry ( )
explicitdefault

Create the registry for temporary downloaded files.

◆ ~QgsNetworkContentFetcherRegistry()

QgsNetworkContentFetcherRegistry::~QgsNetworkContentFetcherRegistry ( )
override

Definition at line 24 of file qgsnetworkcontentfetcherregistry.cpp.

Member Function Documentation

◆ fetch()

const QgsFetchedContent * QgsNetworkContentFetcherRegistry::fetch ( const QString &  url,
FetchingMode  fetchingMode = DownloadLater 
)

Initialize a download for the given URL.

Parameters
urlthe URL to be fetched
fetchingModedefines if the download will start immediately or shall be manually triggered
Note
If the download starts immediately, it will not redownload any already fetched or currently fetching file.

Definition at line 34 of file qgsnetworkcontentfetcherregistry.cpp.

◆ localFile()

QFile * QgsNetworkContentFetcherRegistry::localFile ( const QString &  filePathOrUrl)

Returns a QFile from a local file or to a temporary file previously fetched by the registry.

Parameters
filePathOrUrlcan either be a local file path or a remote content which has previously been fetched

Definition at line 53 of file qgsnetworkcontentfetcherregistry.cpp.

◆ localPath()

QString QgsNetworkContentFetcherRegistry::localPath ( const QString &  filePathOrUrl)

Returns the path to a local file or to a temporary file previously fetched by the registry.

Parameters
filePathOrUrlcan either be a local file path or a remote content which has previously been fetched

Definition at line 84 of file qgsnetworkcontentfetcherregistry.cpp.


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