QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
externalstorage
qgsexternalstorage.cpp
Go to the documentation of this file.
1
/***************************************************************************
2
qgsexternalstorage.cpp
3
--------------------------------------
4
Date : March 2021
5
Copyright : (C) 2021 by Julien Cabieces
6
Email : julien dot cabieces at oslandia dot com
7
***************************************************************************
8
* *
9
* This program is free software; you can redistribute it and/or modify *
10
* it under the terms of the GNU General Public License as published by *
11
* the Free Software Foundation; either version 2 of the License, or *
12
* (at your option) any later version. *
13
* *
14
***************************************************************************/
15
16
#include "
qgsexternalstorage.h
"
17
18
#include "moc_qgsexternalstorage.cpp"
19
20
void
QgsExternalStorageContent::reportError
(
const
QString &errorMsg )
21
{
22
setStatus
(
Qgis::ContentStatus::Failed
);
23
mErrorString
= errorMsg;
24
emit
errorOccurred
(
mErrorString
);
25
}
26
27
void
QgsExternalStorageContent::setStatus
(
Qgis::ContentStatus
status
)
28
{
29
mStatus =
status
;
30
}
31
32
Qgis::ContentStatus
QgsExternalStorageContent::status
()
const
33
{
34
return
mStatus;
35
}
36
37
const
QString &
QgsExternalStorageContent::errorString
()
const
38
{
39
return
mErrorString
;
40
};
41
42
QgsExternalStorageStoredContent
*
QgsExternalStorage::store
(
const
QString &filePath,
const
QString &url,
const
QString &authCfg,
Qgis::ActionStart
storingMode )
const
43
{
44
QgsExternalStorageStoredContent
*content =
doStore
( filePath, url, authCfg );
45
if
( storingMode ==
Qgis::ActionStart::Immediate
)
46
content->
store
();
47
48
return
content;
49
}
50
51
QgsExternalStorageFetchedContent
*
QgsExternalStorage::fetch
(
const
QString &url,
const
QString &authCfg,
Qgis::ActionStart
fetchingMode )
const
52
{
53
QgsExternalStorageFetchedContent
*content =
doFetch
( url, authCfg );
54
if
( fetchingMode ==
Qgis::ActionStart::Immediate
)
55
content->
fetch
();
56
57
return
content;
58
}
Qgis::ContentStatus
ContentStatus
Status for fetched or stored content.
Definition
qgis.h:2015
Qgis::ContentStatus::Failed
@ Failed
Content fetching/storing has failed.
Definition
qgis.h:2019
Qgis::ActionStart
ActionStart
Enum to determine when an operation would begin.
Definition
qgis.h:1244
Qgis::ActionStart::Immediate
@ Immediate
Action will start immediately.
Definition
qgis.h:1246
QgsExternalStorageContent::reportError
void reportError(const QString &errorMsg)
Update content according to given errorMsg error message Inherited classes should call this method wh...
Definition
qgsexternalstorage.cpp:20
QgsExternalStorageContent::setStatus
void setStatus(Qgis::ContentStatus status)
Sets the external storage status.
Definition
qgsexternalstorage.cpp:27
QgsExternalStorageContent::errorOccurred
void errorOccurred(const QString &errorString)
The signal is emitted when an error occurred.
QgsExternalStorageContent::status
Qgis::ContentStatus status() const
Returns content status.
Definition
qgsexternalstorage.cpp:32
QgsExternalStorageContent::mErrorString
QString mErrorString
Definition
qgsexternalstorage.h:160
QgsExternalStorageContent::errorString
const QString & errorString() const
Returns error textual description if an error occurred and status() returns Failed.
Definition
qgsexternalstorage.cpp:37
QgsExternalStorageFetchedContent
Abstract base class for QgsExternalStorage fetched content.
Definition
qgsexternalstorage.h:174
QgsExternalStorageFetchedContent::fetch
virtual void fetch()=0
Starts fetching.
QgsExternalStorageStoredContent
Abstract base class for QgsExternalStorage stored content.
Definition
qgsexternalstorage.h:203
QgsExternalStorageStoredContent::store
virtual void store()=0
Starts storing.
QgsExternalStorage::doFetch
virtual QgsExternalStorageFetchedContent * doFetch(const QString &url, const QString &authCfg=QString()) const =0
Fetches file from url using authCfg for this project external storage.
QgsExternalStorage::doStore
virtual QgsExternalStorageStoredContent * doStore(const QString &filePath, const QString &url, const QString &authCfg=QString()) const =0
Stores file filePath to the url using authCfg authentication for this project external storage.
QgsExternalStorage::store
QgsExternalStorageStoredContent * store(const QString &filePath, const QString &url, const QString &authCfg=QString(), Qgis::ActionStart storingMode=Qgis::ActionStart::Deferred) const
Stores file filePath to the url for this project external storage.
Definition
qgsexternalstorage.cpp:42
QgsExternalStorage::fetch
QgsExternalStorageFetchedContent * fetch(const QString &url, const QString &authCfg=QString(), Qgis::ActionStart fetchingMode=Qgis::ActionStart::Deferred) const
Fetches file from url for this project external storage.
Definition
qgsexternalstorage.cpp:51
qgsexternalstorage.h
Generated on
for QGIS API Documentation by
1.17.0