QGIS API Documentation
4.3.0-Master (52aa6503bed)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
stac
qgsstaccollectionlist.cpp
Go to the documentation of this file.
1
/***************************************************************************
2
qgsstaccollectionlist.cpp
3
---------------------
4
begin : October 2024
5
copyright : (C) 2024 by Stefanos Natsis
6
email : uclaros at gmail 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 "
qgsstaccollectionlist.h
"
17
18
#include "
qgsstaccollection.h
"
19
20
#include <QString>
21
22
using namespace
Qt::StringLiterals;
23
24
QgsStacCollectionList::QgsStacCollectionList
(
const
QVector< QgsStacCollection * >
collections
,
const
QVector< QgsStacLink > links,
int
numberMatched
)
25
: mCollections(
collections
)
26
, mNumberMatched(
numberMatched
)
27
{
28
for
(
const
QgsStacLink
&link : links )
29
{
30
if
( link.relation() ==
"self"
_L1 || link.relation() ==
"root"
_L1 || link.relation() ==
"next"
_L1 || link.relation() ==
"prev"
_L1 )
31
mUrls.insert( link.relation(), link.href() );
32
}
33
}
34
35
36
QgsStacCollectionList::~QgsStacCollectionList
()
37
{
38
qDeleteAll( mCollections );
39
}
40
41
QVector<QgsStacCollection *>
QgsStacCollectionList::collections
()
const
42
{
43
return
mCollections;
44
}
45
46
QVector<QgsStacCollection *>
QgsStacCollectionList::takeCollections
()
47
{
48
QVector< QgsStacCollection * > cols = mCollections;
49
mCollections.clear();
// detach
50
return
cols;
51
}
52
53
int
QgsStacCollectionList::numberReturned
()
const
54
{
55
return
mCollections.size();
56
}
57
58
int
QgsStacCollectionList::numberMatched
()
const
59
{
60
return
mNumberMatched;
61
}
62
63
QUrl
QgsStacCollectionList::url
()
const
64
{
65
return
QUrl( mUrls.value( u
"self"
_s, QString() ) );
66
}
67
68
QUrl
QgsStacCollectionList::rootUrl
()
const
69
{
70
return
QUrl( mUrls.value( u
"root"
_s, QString() ) );
71
}
72
73
QUrl
QgsStacCollectionList::nextUrl
()
const
74
{
75
return
QUrl( mUrls.value( u
"next"
_s, QString() ) );
76
}
77
78
QUrl
QgsStacCollectionList::prevUrl
()
const
79
{
80
return
QUrl( mUrls.value( u
"prev"
_s, QString() ) );
81
}
QgsStacCollectionList::prevUrl
QUrl prevUrl() const
Returns the url of the collections' "prev" link.
Definition
qgsstaccollectionlist.cpp:78
QgsStacCollectionList::~QgsStacCollectionList
~QgsStacCollectionList()
Destructor.
Definition
qgsstaccollectionlist.cpp:36
QgsStacCollectionList::collections
QVector< QgsStacCollection * > collections() const
Returns the collections Ownership is not transferred.
Definition
qgsstaccollectionlist.cpp:41
QgsStacCollectionList::QgsStacCollectionList
QgsStacCollectionList()=delete
Default constructor deleted, use the variant with required parameters.
QgsStacCollectionList::numberReturned
int numberReturned() const
Returns the number of returned collections.
Definition
qgsstaccollectionlist.cpp:53
QgsStacCollectionList::rootUrl
QUrl rootUrl() const
Returns the url of the collections' "root" link.
Definition
qgsstaccollectionlist.cpp:68
QgsStacCollectionList::nextUrl
QUrl nextUrl() const
Returns the url of the collections' "next" link.
Definition
qgsstaccollectionlist.cpp:73
QgsStacCollectionList::url
QUrl url() const
Returns the url of the collections' "self" link.
Definition
qgsstaccollectionlist.cpp:63
QgsStacCollectionList::takeCollections
QVector< QgsStacCollection * > takeCollections()
Returns the collections Caller takes ownership of the returned collections.
Definition
qgsstaccollectionlist.cpp:46
QgsStacCollectionList::numberMatched
int numberMatched() const
Returns the total number of available collections If this information was not available by the STAC s...
Definition
qgsstaccollectionlist.cpp:58
QgsStacLink
Stores data associated with a STAC link.
Definition
qgsstaclink.h:31
qgsstaccollection.h
qgsstaccollectionlist.h
Generated on
for QGIS API Documentation by
1.17.0